Commit 348b36b1 authored by liwei's avatar liwei

修改了公共代码页面

parent 55c55214
<template>
<BasicModal width="50%" v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit">
<BasicForm @register="registerForm" />
<BasicTable @register="registerTable"/>
</BasicModal>
</template>
<script lang="ts" setup>
import {ref, computed, unref, reactive} from 'vue';
import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form';
import {addValueColumns, addValueFormSchema, addValueSearchSchema, searchFormSchema} from './publicCode.data';
import { useMessage } from '@/hooks/web/useMessage';
import {
addValueData,TreeData
} from "./publicCodeData";
import { BasicTable, useTable, TableAction } from '@/components/Table';
defineOptions({ name: 'AccountModal' });
const emit = defineEmits(['success', 'register']);
const { createMessage } = useMessage();
const rowId = ref('');
const getTitle = computed(() => ('添加值'));
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 100,
baseColProps: { lg: 12, md: 24 },
schemas: addValueFormSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
//初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields();
setModalProps({ confirmLoading: false });
setFieldsValue({
...data.record,
})
const treeList = handleTree(TreeData, 'businessId',undefined,undefined,undefined)
updateSchema([
{
field: 'QualityId',
componentProps: {
treeData: treeList
},
},
]);
});
const [registerTable] = useTable({
title: '源系统码值',
api: async (params) => {
const response = {
pageNu: "1",
pageSize: "10",
pages: "1",
total: addValueData.length,
code:'',
message:'',
data: [],
};
//过滤data中的数据,取出等于params.deptId的数据
return { ...response,data: addValueData };
},
columns:addValueColumns,
useSearchForm: true,
showTableSetting: false,
showIndexColumn:false,
pagination:false,
bordered: true,
formConfig: {
labelWidth: 120,
schemas: addValueSearchSchema,
autoSubmitOnEnter: true,
},
});
/**确定按钮*/
async function handleSubmit() {
createMessage.success('添加成功');
closeModal()
}
/**数组对象转成树*/
function handleTree(data, id, parentId, children, rootId) {
id = id || 'id'
parentId = parentId || 'parentId'
children = children || 'children'
rootId = rootId || Math.min.apply(Math, data.map(item => { return item[parentId] })) || 0
// 对源数据深度克隆
const cloneData = JSON.parse(JSON.stringify(data))
// 循环所有项
const treeData = cloneData.filter(father => {
const branchArr = cloneData.filter(child => {
// 返回每一项的子级数组
return father[id] === child[parentId]
})
branchArr.length > 0 ? father.children = branchArr : ''
// 返回第一层
return father[parentId] === rootId
})
return treeData !== '' ? treeData : data
}
</script>
......@@ -178,7 +178,7 @@ function getRightMenuList(node: EventDataNode): Promise<ContextMenuItem[]> {
/**查看详情*/
function detailButton(record) {
router.push({
path: '/dataStandards/publicCode/detailStandard',
path: '/dataStandards/publicCode/detailPublicCode',
query: {
businessId:record.businessId,
},
......
......@@ -56,6 +56,8 @@
</BasicTable>
<!-- 版本管理 弹窗-->
<VersionModal @register="registerModal" @success="handleSuccess" />
<!-- 查看详情 弹窗-->
<DetailPublicCodeModal @register="registerDetailModal" @success="handleSuccess" />
</div>
</template>
<script lang="ts" setup>
......@@ -68,14 +70,17 @@ import {router} from "@/router";
import { BasicForm, useForm } from '@/components/Form';
import {
detailColumns, detailFormSchema,
detailSchema, searchFormSchema,
detailSchema
} from './publicCode.data';
import {onMounted, ref} from "vue";
import {useRoute} from "vue-router";
import VersionModal from './VersionModal.vue'
import DetailPublicCodeModal from './detailPublicCodeModal.vue'
import {useModal} from "@/components/Modal";
import { useMessage } from '@/hooks/web/useMessage';
import { BasicTable, useTable, TableAction } from '@/components/Table';
const route = useRoute()
const title = ref('')
const formData = ref({})
......@@ -83,6 +88,7 @@ const businessId = ref('')
const isShow = ref(false)
const optionValue = ref('')
const [registerModal, { openModal }] = useModal();
const [registerDetailModal, { openModal: openDetailModal }] = useModal();
const { createMessage, createConfirm } = useMessage();
const [registerForm1, { setFieldsValue: setFieldsValue1 }] = useForm({
labelWidth: 100,
......@@ -147,7 +153,7 @@ function editButton(record) {
/**基本标准对比*/
function contrastButton(record) {
router.push({
path: '/dataStandards/publicCode/basicStandardsContrast',
path: '/dataStandards/publicCode/publicCodeContrast',
query: {
businessId:businessId.value,
},
......@@ -173,8 +179,10 @@ function resetButton(value) {
/**查看详情*/
function detailButton(value) {
function detailButton(record) {
openDetailModal(true,{
record:record
})
}
/**退出查看*/
......
<template>
<BasicModal width="50%" v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit">
<BasicForm @register="registerForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import {ref, computed, unref, reactive} from 'vue';
import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form';
import {detailPublicCodeSchema, editPublicCodeSchema} from './publicCode.data';
import { useMessage } from '@/hooks/web/useMessage';
import {
addValueData
} from "./publicCodeData";
import { BasicTable, useTable, TableAction } from '@/components/Table';
defineOptions({ name: 'AccountModal' });
const emit = defineEmits(['success', 'register']);
const { createMessage } = useMessage();
const rowId = ref('');
const getTitle = computed(() => ('查看详情'));
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 100,
baseColProps: { lg: 12, md: 24 },
schemas: detailPublicCodeSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
//初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields();
setModalProps({ confirmLoading: false,showOkBtn: false,showCancelBtn: false });
setFieldsValue({
...data.record,
})
});
/**确定按钮*/
async function handleSubmit() {
createMessage.success('编辑成功');
closeModal()
}
</script>
......@@ -47,7 +47,8 @@
</span>
</template>
</BasicTable>
<AddCodeValueModal @register="registerModal" @success="handleSuccess" />
<EditPublicCodeModal @register="registerEditPublicCodeModal" @success="handleSuccess" />
</div>
</template>
<script lang="ts" setup>
......@@ -59,29 +60,32 @@ import {router} from "@/router";
import { BasicForm, useForm } from '@/components/Form';
import {
detailColumns, detailFormSchema,
editStandardsDetailFormSchema1,
editStandardsDetailFormSchema,
} from './publicCode.data';
import {onMounted, ref} from "vue";
import {useRoute} from "vue-router";
import {useModal} from "@/components/Modal";
import { useMessage } from '@/hooks/web/useMessage';
import { BasicTable, useTable, TableAction } from '@/components/Table';
import AddCodeValueModal from './AddCodeValueModal.vue';
import EditPublicCodeModal from './editPublicCodeModal.vue';
const route = useRoute()
const title = ref('')
const formData = ref({})
const businessId = ref('')
const { createMessage, createConfirm } = useMessage();
const [registerModal, { openModal: openModal }] = useModal();
const [registerEditPublicCodeModal, { openModal: openEditPublicCodeModal }] = useModal();
const [registerForm1, { setFieldsValue: setFieldsValue1 }] = useForm({
labelWidth: 100,
baseColProps: { lg: 12, md: 24 },
schemas: editStandardsDetailFormSchema1,
schemas: editStandardsDetailFormSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
const [registerTable, { reload, updateTableDataRecord, getSearchInfo,getForm,getRowSelection }] = useTable({
title: '公共代码',
api: async (params) => {
......@@ -140,13 +144,17 @@ function saveButton(record) {
/**编辑*/
function editButton(record) {
openEditPublicCodeModal(true,{
record:record
})
}
/**添加值*/
function addValueButton(record) {
openModal(true,{
})
}
/**删除*/
......
<template>
<BasicModal width="50%" v-bind="$attrs" @register="registerModal" :title="getTitle" @ok="handleSubmit">
<BasicForm @register="registerForm" />
</BasicModal>
</template>
<script lang="ts" setup>
import {ref, computed, unref, reactive} from 'vue';
import { BasicModal, useModalInner } from '@/components/Modal';
import { BasicForm, useForm } from '@/components/Form';
import {editPublicCodeSchema} from './publicCode.data';
import { useMessage } from '@/hooks/web/useMessage';
import {
addValueData
} from "./publicCodeData";
import { BasicTable, useTable, TableAction } from '@/components/Table';
defineOptions({ name: 'AccountModal' });
const emit = defineEmits(['success', 'register']);
const { createMessage } = useMessage();
const rowId = ref('');
const getTitle = computed(() => ('编辑公共代码'));
//获取接口数据并放在下拉框里(这里是打开了一个弹框)
//初始化表单
const [registerForm, { setFieldsValue, updateSchema, resetFields, validate }] = useForm({
labelWidth: 100,
baseColProps: { lg: 12, md: 24 },
schemas: editPublicCodeSchema,
showActionButtonGroup: false,
actionColOptions: {
span: 23,
},
});
//初始化弹框
const [registerModal, { setModalProps, closeModal }] = useModalInner(async (data) => {
resetFields();
setModalProps({ confirmLoading: false });
setFieldsValue({
...data.record,
})
});
/**确定按钮*/
async function handleSubmit() {
createMessage.success('编辑成功');
closeModal()
}
</script>
......@@ -612,7 +612,7 @@ export const detailFormSchema: FormSchema[] = [
},
];
/**编辑公共代码 表单1*/
export const editStandardsDetailFormSchema1: FormSchema[] = [
export const editStandardsDetailFormSchema: FormSchema[] = [
{
field: '',
label: '属性',
......@@ -751,452 +751,201 @@ export const editStandardsDetailFormSchema1: FormSchema[] = [
},
},
];
/**版本对比 表单*/
export const contrastSchema: FormSchema[] = [
/**编辑公共代码 表单2*/
export const addValueFormSchema: FormSchema[] = [
{
field: 'standardNumber',
label: '标准编号',
field: 'codeValue',
label: '代码值',
component: 'Input',
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入标准编号',
},
],
required: true,
componentProps: {
style: {
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入标准编号',
placeholder: '请输入代码值',
},
colProps: { lg: 24, md: 24 },
},
{
field: 'standardChineseName',
label: '标准中文名称',
field: 'codeMeaning',
label: '代码含义',
component: 'Input',
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入标准中文名称',
},
],
required: true,
componentProps: {
style: {
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入标准中文名称',
placeholder: '请输入代码含义',
},
colProps: { lg: 24, md: 24 },
},
{
field: 'standardEnglishName',
label: '标准英文名称',
field: 'description',
label: '说明',
component: 'Input',
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入标准英文名称',
},
],
componentProps: {
style: {
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入标准英文名称',
placeholder: '请输入说明',
},
colProps: { lg: 24, md: 24 },
},
];
/**编辑公共代码 表单3*/
export const addValueSearchSchema: FormSchema[] = [
{
field: 'standardAlias',
label: '标准别名',
field: 'sourceSystem',
label: '源系统',
component: 'Input',
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入标准别名',
},
],
required: true,
componentProps: {
style: {
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入标准别名',
placeholder: '请输入源系统',
},
colProps: { span: 8 },
},
{
field: 'businessDefinition',
label: '业务定义',
field: 'sourceSystemCodeValue',
label: '源系统码值',
component: 'Input',
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入业务定义',
},
],
componentProps: {
style: {
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入业务定义',
placeholder: '请输入源系统码值',
},
colProps: { span: 8 },
},
];
/**编辑公共代码 表单4*/
export const editPublicCodeSchema: FormSchema[] = [
{
field: 'standardSource',
label: '标准来源',
component: 'Select',
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请选择标准来源',
},
],
field: 'codeValue',
label: '代码值',
component: 'Input',
required: true,
componentProps: {
style: {
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
disabled: true,
options:[
{
label:'国际标准',
value:'1'
},
{
label:'国家标准',
value:'2'
},
{
label:'行业标准',
value:'3'
},
{
label:'行业实践',
value:'4'
},
{
label:'监管规定(人行)',
value:'5'
},
{
label:'监管规定(银监)',
value:'6'
},
{
label:'行内发文',
value:'7'
},
{
label:'行内协商一致',
value:'8'
},
],
placeholder: '请选择标准来源',
placeholder: '请输入代码值',
},
colProps: { lg: 24, md: 24 },
},
{
field: 'definitionBasis',
label: '定义依据',
field: 'codeMeaning',
label: '代码含义',
component: 'Input',
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入定义依据',
},
],
required: true,
componentProps: {
style: {
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入定义依据',
placeholder: '请输入代码含义',
},
colProps: { lg: 24, md: 24 },
},
{
field: 'businessRule',
label: '业务规则',
field: 'description',
label: '说明',
component: 'Input',
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入业务规则',
},
],
required: true,
componentProps: {
style: {
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入业务规则',
placeholder: '请输入说明',
},
},
{
field: 'dataType',
label: '数据类型',
component: 'Select',
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请选择数据类型',
},
],
componentProps: {
style: {
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
disabled: true,
options:[
{
label:'文本类',
value:'1'
},
{
label:'数值类',
value:'2'
},
{
label:'代码类',
value:'3'
},
{
label:'标志类',
value:'4'
},
{
label:'日期时间类',
value:'5'
},
{
label:'编号类',
value:'6'
},
],
placeholder: '请选择数据类型',
},
},
{
field: 'valueRange',
label: '取值范围',
field: 'sourceSystemCodeValue',
label: '源系统码值',
component: 'Input',
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入取值范围',
},
],
required: true,
componentProps: {
style: {
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入取值范围',
placeholder: '请输入源系统码值',
},
colProps: { lg: 24, md: 24 },
},
];
/**详情公共代码 表单5*/
export const detailPublicCodeSchema: FormSchema[] = [
{
field: 'codeNumber',
label: '代码编号',
field: 'codeValue',
label: '代码',
component: 'Input',
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入代码编号',
},
],
required: true,
componentProps: {
style: {
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入代码编号',
placeholder: '请输入代码',
},
},
{
field: 'adaptability',
label: '适应性',
component: 'Select',
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入适应性',
},
],
componentProps: {
style: {
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
disabled: true,
options:[
{
label:'当前适用',
value:'1'
},
{
label:'未来适用',
value:'2'
},
],
placeholder: '请输入适应性',
},
},
{
field: 'dataDisplay',
label: '数据显示',
field: 'codeMeaning',
label: '代码含义',
component: 'Input',
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入数据显示',
},
],
required: true,
componentProps: {
style: {
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入数据显示',
placeholder: '请输入代码含义',
},
colProps: { lg: 24, md: 24 },
},
{
field: 'tecDataType',
label: '数据类型',
field: 'description',
label: '说明',
component: 'Input',
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入数据类型',
},
],
required: true,
componentProps: {
style: {
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入数据类型',
placeholder: '请输入说明',
},
colProps: { lg: 24, md: 24 },
},
{
field: 'dataPrecision',
label: '数据精度',
field: 'sourceSystemCodeValue',
label: '源系统码值',
component: 'Input',
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入数据精度',
},
],
required: true,
componentProps: {
style: {
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入数据精度',
placeholder: '请输入源系统码值',
},
colProps: { lg: 24, md: 24 },
},
];
/**编辑公共代码 列表表头*/
export const addValueColumns: BasicColumn[] = [
{
field: 'dataLength',
label: '数据长度',
component: 'Input',
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入数据长度',
},
],
componentProps: {
style: {
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入数据长度',
},
title: '源系统',
dataIndex: 'sourceSystem',
width: 150
},
{
field: 'measurementUnit',
label: '计量单位',
component: 'Input',
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入计量单位',
},
],
componentProps: {
style: {
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入计量单位',
},
title: '源系统码值',
dataIndex: 'sourceSystemCodeValue',
width: 150
},
];
/**版本对比 表单*/
export const contrastSchema: FormSchema[] = [
{
field: 'creator',
label: '创建人员',
component: 'Input',
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入创建人员',
},
],
field: '',
label: '属性',
component: 'BasicTitle',
componentProps: {
readonly: true,
style: {
border: 'none',
backgroundColor: 'transparent',
marginLeft: '15px',
fontWeight: 'bold',
},
readonly: true,
placeholder: '请输入创建人员',
},
colProps: { lg: 24, md: 24 },
},
{
field: 'updater',
label: '更新人员',
field: 'standardPath',
label: '标准路径',
component: 'Input',
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入更新人员',
message: '请输入标准路径',
},
],
componentProps: {
......@@ -1205,18 +954,18 @@ export const contrastSchema: FormSchema[] = [
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入更新人员',
placeholder: '请输入标准路径',
},
},
{
field: 'createDate',
label: '创建日期',
field: 'standardNumber',
label: '标准编号',
component: 'Input',
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入创建日期',
message: '请输入标准编号',
},
],
componentProps: {
......@@ -1225,18 +974,18 @@ export const contrastSchema: FormSchema[] = [
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入创建日期',
placeholder: '请输入标准编号',
},
},
{
field: 'updateDate',
label: '更新日期',
field: 'standardChineseName',
label: '标准中文名称',
component: 'Input',
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入更新日期',
message: '请输入标准中文名称',
},
],
componentProps: {
......@@ -1245,18 +994,18 @@ export const contrastSchema: FormSchema[] = [
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入更新日期',
placeholder: '请输入标准中文名称',
},
},
{
field: 'secondaryAuthorityDepartment',
label: '权威二级部门',
field: 'standardSource',
label: '标准来源',
component: 'Input',
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入权威二级部门',
message: '请输入标准来源',
},
],
componentProps: {
......@@ -1265,18 +1014,18 @@ export const contrastSchema: FormSchema[] = [
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入权威二级部门',
placeholder: '请输入标准来源',
},
},
{
field: 'tertiaryAuthorityDepartment',
label: '权威三级部门',
field: 'businessDefinition',
label: '业务定义',
component: 'Input',
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入权威三级部门',
message: '请输入业务定义',
},
],
componentProps: {
......@@ -1285,18 +1034,18 @@ export const contrastSchema: FormSchema[] = [
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入权威三级部门',
placeholder: '请输入业务定义',
},
},
{
field: 'coreSystem',
label: '核心系统',
field: 'definitionBasis',
label: '定义依据',
component: 'Input',
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入核心系统',
message: '请输入定义依据',
},
],
componentProps: {
......@@ -1305,103 +1054,37 @@ export const contrastSchema: FormSchema[] = [
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入核心系统',
placeholder: '请输入定义依据',
},
},
];
/**版本对比 列表*/
export const contrastTableColumns: BasicColumn[] = [
{
field: 'dataStandardStatus',
label: '数据标准状态',
component: 'Select',
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入数据标准状态',
},
],
componentProps: {
style: {
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
disabled: true,
options:[
{
label:'有效',
value:'1'
},
{
label:'失效',
value:'2'
},
{
label:'未生效',
value:'3'
}
],
placeholder: '请输入数据标准状态',
},
title: '代码值',
dataIndex: 'codeValue',
width: 150
},
{
field: 'expirationDate',
label: '失效时间',
component: 'Input',
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入失效时间',
},
],
componentProps: {
style: {
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
},
title: '代码含义',
dataIndex: 'codeMeaning',
width: 150
},
{
field: 'expirationReason',
label: '失效原因',
component: 'Input',
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入失效原因',
},
],
componentProps: {
style: {
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入失效原因',
},
title: '说明',
dataIndex: 'description',
width: 150
},
{
field: 'collaborativeDepartment',
label: '协作部门',
component: 'Input',
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入协作部门',
},
],
componentProps: {
style: {
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入协作部门',
},
}
title: '修改人',
dataIndex: 'updateBy',
width: 150
},
{
title: '修改时间',
dataIndex: 'updateDate',
width: 150
},
];
......
......@@ -25,9 +25,13 @@
</div>
</div>
</div>
<div>
<BasicForm @register="registerLeftForm" />
<Divider />
<div style="display: flex; justify-content: center;">
<a-button style="margin-right: 5px" type="primary" @click="">回滚到此版本</a-button>
</div>
<Divider />
<BasicForm @register="registerLeftForm" />
<BasicTable @register="registerTable1"/>
</div>
<div class="w-1/2 xl:w-1/2">
<div style="display: flex;justify-content: space-between; align-items: center;margin-bottom: 10px;margin-left: 12px">
......@@ -48,17 +52,33 @@
</div>
</div>
</div>
<div>
<BasicForm @register="registerRightForm" />
<Divider />
<div style="display: flex; justify-content: center;">
<a-button style="margin-right: 5px" type="primary" @click="">回滚到此版本</a-button>
</div>
<Divider />
<BasicForm @register="registerRightForm" />
<div style="display: flex;justify-content:flex-end;margin-top:3%;margin-bottom: 10%">
<div>
版本<Select
v-model:value="optionValue"
show-search
placeholder="请选择升降序"
style="width: 200px;margin-left: 10px"
:options="orderOptions"
@change="handleChange"
></Select>
</div>
</div>
<BasicTable @register="registerTable2"/>
<Divider />
</div>
</PageWrapper>
</template>
<script lang="ts" setup>
import { BasicTable, useTable } from '@/components/Table';
import { PageWrapper } from '@/components/Page';
import {contrastSchema} from '@/views/dataStandards/basicStandards/basicStandards.data';
import {leftContrastData,rightContrastData} from '@/views/dataStandards/basicStandards/basicStandardsData';
import { addValueSearchSchema, contrastSchema, contrastTableColumns} from './publicCode.data';
import { leftContrastData, rightContrastData,leftContrastTableData,rightContrastTableData} from './publicCodeData';
import { useMessage } from '@/hooks/web/useMessage';
import { BasicForm, useForm } from '@/components/Form';
import {onMounted,ref} from "vue";
......@@ -66,6 +86,9 @@
import Icon from '@/components/Icon/Icon.vue';
import {router} from "@/router";
import { useRoute,onBeforeRouteLeave } from 'vue-router';
import { Divider } from 'ant-design-vue';
import { BasicTable, useTable, TableAction } from '@/components/Table';
defineOptions({ name: 'Metadata' });
const route = useRoute();
const title = ref('对外投资出资方式')
......@@ -74,18 +97,72 @@
{ value: 'V2', label: 'V2' },
{ value: 'V3', label: 'V3' },
]);
const orderOptions = ref<any>([
{ value: '1', label: '代码值升序' },
{ value: '2', label: '代码值降序' },
]);
const { createMessage } = useMessage();
const [registerLeftForm,{setFieldsValue:setLeftFieldsValue}] = useForm({
labelWidth: 100,
schemas: contrastSchema,
showActionButtonGroup: false,
});
const [registerRightForm,{setFieldsValue:setRightFieldsValue}] = useForm({
labelWidth: 100,
schemas: contrastSchema,
showActionButtonGroup: false,
});
const [registerTable1] = useTable({
title: '公共代码',
api: async (params) => {
const response = {
pageNu: "1",
pageSize: "10",
pages: "1",
total: leftContrastTableData.length,
code:'',
message:'',
data: [],
};
//过滤data中的数据,取出等于params.deptId的数据
return { ...response,data: leftContrastTableData };
},
columns:contrastTableColumns,
useSearchForm: true,
showTableSetting: false,
showIndexColumn:false,
pagination:false,
bordered: true,
formConfig: {
labelWidth: 120,
schemas: addValueSearchSchema,
autoSubmitOnEnter: true,
},
});
const [registerTable2] = useTable({
title: '',
api: async (params) => {
const response = {
pageNu: "1",
pageSize: "10",
pages: "1",
total: rightContrastTableData.length,
code:'',
message:'',
data: [],
};
//过滤data中的数据,取出等于params.deptId的数据
return { ...response,data: rightContrastTableData };
},
columns:contrastTableColumns,
useSearchForm: false,
showTableSetting: false,
showIndexColumn:false,
pagination:false,
bordered: true,
});
/**开始对比*/
function startContrast() {
createMessage.success('开始对比');
......@@ -94,7 +171,7 @@
/**结束对比*/
function endContrast() {
router.push({
path: '/dataStandards/publicCode/detailStandard',
path: '/dataStandards/publicCode/detailPublicCode',
query: {
businessId:route.query.businessId,
},
......
......@@ -566,6 +566,7 @@ export const leftContrastData: any[] = [
"publishStatus": "已发布",
"businessDefinition": "对外投资出资方式",
"standardCode": "BAS000004",
"standardPath":'/公共代码/个人工作区/对外投资出资方式',
"referenceStandard":[
{ icon: '🌐🔍', text: '数据源1' },
],
......@@ -609,6 +610,7 @@ export const rightContrastData = [
{
"businessId": 201,
"standardChineseName": "对外投资出资方式",
"standardPath":'/公共代码/个人工作区/对外投资出资方式',
"anotherName": "对外投资出资方式",
"parentId": 102,
"publishStatus": "已发布",
......@@ -653,6 +655,60 @@ export const rightContrastData = [
},
]
/**对比左侧数据*/
export const leftContrastTableData = [
{
"businessId": 1,
"codeValue": "00",
"codeMeaning": "未填写",
"description": '-',
"updateBy": "DMP_admin",
"updateDate": "2024-05-31 17:11:50",
},
{
"businessId": 2,
"codeValue": "01",
"codeMeaning": "男性",
"description": '-',
"updateBy": "DMP_admin",
"updateDate": "2024-05-31 17:11:50",
},
{
"businessId": 3,
"codeValue": "02",
"codeMeaning": "女性",
"description": '-',
"updateBy": "DMP_admin",
"updateDate": "2024-05-31 17:11:50",
},
]
/**对比右侧数据*/
export const rightContrastTableData = [
{
"businessId": 1,
"codeValue": "00",
"codeMeaning": "未填写",
"description": '-',
"updateBy": "DMP_admin",
"updateDate": "2024-05-31 17:11:50",
},
{
"businessId": 2,
"codeValue": "01",
"codeMeaning": "男性",
"description": '-',
"updateBy": "DMP_admin",
"updateDate": "2024-05-31 17:11:50",
},
{
"businessId": 3,
"codeValue": "02",
"codeMeaning": "女性",
"description": '-',
"updateBy": "DMP_admin",
"updateDate": "2024-05-31 17:11:50",
},
]
/**关联关系 表格3 数据*/
export const relatedRelationshipsData3 = [
......@@ -712,3 +768,19 @@ export const detailData = [
sourceSystemCodeValue: '-',
},
]
/**编辑公共代码 列表数据*/
export const addValueData = [
{
sourceSystem: '系统1',
sourceSystemCodeValue: '00',
},
{
sourceSystem: '系统2',
sourceSystemCodeValue: '01',
},
{
sourceSystem: '系统3',
sourceSystemCodeValue: '02',
},
]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment