Browse Source

chore: 兼容ant3

master
wangxiang 2 years ago
parent
commit
2bffff7869
  1. 1
      src/views/common/project/project.data.ts
  2. 2
      src/views/system/config/config.data.ts
  3. 40
      src/views/system/config/index.vue
  4. 1
      src/views/system/dept/dept.data.ts
  5. 1
      src/views/system/region/region.data.ts
  6. 18
      src/views/workflow/extension/form/form.data.ts
  7. 35
      src/views/workflow/extension/form/index.vue

1
src/views/common/project/project.data.ts

@ -100,7 +100,6 @@ export const formSchema: FormSchema[] = [ @@ -100,7 +100,6 @@ export const formSchema: FormSchema[] = [
key: 'id',
value: 'id',
},
getPopupContainer: () => document.body,
}
},
{

2
src/views/system/config/config.data.ts

@ -53,7 +53,7 @@ export const columns: ColumnProps<any>[] = [ @@ -53,7 +53,7 @@ export const columns: ColumnProps<any>[] = [
title: '操作',
align: 'center',
dataIndex: 'action',
slots: { customRender: 'action' },
//slots: { customRender: 'action' },
fixed: false
}
];

40
src/views/system/config/index.vue

@ -144,25 +144,27 @@ @@ -144,25 +144,27 @@
</div>
</div>
</template>
<template #action="{ record }">
<div :class="[`${prefixCls}__action`, 'center']">
<a-button
v-auth="['config_edit']"
type="link"
size="small"
@click="handleEdit(record)"
><Icon icon="fa6-regular:pen-to-square" :size="14"/>修改
</a-button>
<ADivider type="vertical" class="action-divider"/>
<a-button
v-auth="['config_del']"
type="link"
size="small"
color="error"
@click="handleDel(record)"
><Icon icon="ant-design:delete-outlined" :size="15"/>删除
</a-button>
</div>
<template #bodyCell="{ column, record }">
<template v-if="column.dataIndex === 'action'">
<div :class="[`${prefixCls}__action`, 'center']">
<a-button
v-auth="['config_edit']"
type="link"
size="small"
@click="handleEdit(record)"
><Icon icon="fa6-regular:pen-to-square" :size="14"/>修改
</a-button>
<ADivider type="vertical" class="action-divider"/>
<a-button
v-auth="['config_del']"
type="link"
size="small"
color="error"
@click="handleDel(record)"
><Icon icon="ant-design:delete-outlined" :size="15"/>删除
</a-button>
</div>
</template>
</template>
</ATable>
<!--弹出窗体区域-->

1
src/views/system/dept/dept.data.ts

@ -100,7 +100,6 @@ export const formSchema: FormSchema[] = [ @@ -100,7 +100,6 @@ export const formSchema: FormSchema[] = [
key: 'deptId',
value: 'deptId',
},
getPopupContainer: () => document.body,
}
},
{

1
src/views/system/region/region.data.ts

@ -76,7 +76,6 @@ export const regionFormSchema: FormSchema[] = [ @@ -76,7 +76,6 @@ export const regionFormSchema: FormSchema[] = [
key: 'id',
value: 'id'
},
getPopupContainer: () => document.body,
}
},
{

18
src/views/workflow/extension/form/form.data.ts

@ -48,20 +48,10 @@ export const columns: BasicColumn[] = [ @@ -48,20 +48,10 @@ export const columns: BasicColumn[] = [
/** 搜索表单配置 */
export const searchFormSchema: FormSchema[] = [
{
field: 'categoryId',
label: '表单分类',
component: 'ApiTreeSelect',
componentProps: {
placeholder: '请选择分类',
fieldNames: {
label: 'name',
key: 'id',
value: 'id'
},
getPopupContainer: () => document.body,
api: listFormCategory,
listToTree: true,
},
field: 'categoryId',
slot: 'categoryId',
component: 'Input',
colProps: { span: 8 }
},
{
@ -93,7 +83,6 @@ export const formSchema: FormSchema[] = [ @@ -93,7 +83,6 @@ export const formSchema: FormSchema[] = [
key: 'id',
value: 'id'
},
getPopupContainer: () => document.body,
api: listFormCategory,
listToTree: true,
},
@ -128,7 +117,6 @@ export const formCategorySchema: FormSchema[] = [ @@ -128,7 +117,6 @@ export const formCategorySchema: FormSchema[] = [
key: 'id',
value: 'id'
},
getPopupContainer: () => document.body,
},
required: true,
},

35
src/views/workflow/extension/form/index.vue

@ -99,6 +99,19 @@ @@ -99,6 +99,19 @@
/>
</template>
</template>
<template #form-categoryId>
<ApiTreeSelect
ref="formCategoryIdElRef"
placeholder="请选择表单分类"
:fieldNames="{
label: 'name',
key: 'id',
value: 'id'
}"
:api="listFormCategory"
:listToTree="true"
/>
</template>
</BasicTable>
<FormModal @register="registerModal" @success="handleRefreshTable"/>
<FormCategoryModal @register="registerFormCategoryModal" @success="handleRefreshTree"/>
@ -107,7 +120,7 @@ @@ -107,7 +120,7 @@
</template>
<script lang="ts">
import { defineComponent, reactive, toRaw, onMounted } from 'vue';
import { defineComponent, reactive, toRaw, onMounted, ref } from 'vue';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
import { listFormDefinition, delFormDefinition, } from '/@/api/platform/workflow/extension/controller/formDefinition';
import { PageWrapper } from '/@/components/Page';
@ -122,13 +135,13 @@ @@ -122,13 +135,13 @@
import { listFormCategory, delFormCategory } from '/@/api/platform/workflow/extension/controller/formCategory';
import { PlusOutlined, FormOutlined, DeleteOutlined } from '@ant-design/icons-vue';
import { useRouter } from 'vue-router';
import ApiTreeSelect from '/@/components/Form/src/components/ApiTreeSelect.vue';
/** 类型规范统一声明定义区域 */
interface TableState {
ids: string[];
single: boolean;
multiple: boolean;
searchInfo: Recordable;
treeData: TreeItem[];
}
@ -144,7 +157,8 @@ @@ -144,7 +157,8 @@
FormOutlined,
DeleteOutlined,
WorkflowFormDesign,
FormCategoryModal
FormCategoryModal,
ApiTreeSelect
},
setup() {
@ -156,11 +170,10 @@ @@ -156,11 +170,10 @@
single: true,
//
multiple: true,
//
searchInfo: {},
treeData: []
});
const { push } = useRouter();
const formCategoryIdElRef = ref();
const { createConfirm, createMessage } = useMessage();
const [registerModal, { openModal }] = useModal();
const [registerFormCategoryModal, { openModal: openFormCategoryModal }] = useModal();
@ -184,7 +197,6 @@ @@ -184,7 +197,6 @@
bordered: true,
clickToRowSelect: false,
showIndexColumn: false,
searchInfo: state.searchInfo,
actionColumn: {
width: 220,
title: '操作',
@ -266,12 +278,7 @@ @@ -266,12 +278,7 @@
/** 处理树形列表刷新 */
async function handleRefreshTree() {
state.treeData = listToTree(await listFormCategory());
await getForm().updateSchema({
field: 'categoryId',
componentProps: {
treeData: state.treeData
}
});
await getForm().resetFields();
}
/** 处理工作流表单设计 */
@ -309,7 +316,9 @@ @@ -309,7 +316,9 @@
handleRefreshTree,
handleFormCategoryAdd,
handleFormCategoryEdit,
handleFormCategoryDel
handleFormCategoryDel,
listFormCategory,
formCategoryIdElRef
};
}
});

Loading…
Cancel
Save