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[]> { ...@@ -178,7 +178,7 @@ function getRightMenuList(node: EventDataNode): Promise<ContextMenuItem[]> {
/**查看详情*/ /**查看详情*/
function detailButton(record) { function detailButton(record) {
router.push({ router.push({
path: '/dataStandards/publicCode/detailStandard', path: '/dataStandards/publicCode/detailPublicCode',
query: { query: {
businessId:record.businessId, businessId:record.businessId,
}, },
......
...@@ -56,6 +56,8 @@ ...@@ -56,6 +56,8 @@
</BasicTable> </BasicTable>
<!-- 版本管理 弹窗--> <!-- 版本管理 弹窗-->
<VersionModal @register="registerModal" @success="handleSuccess" /> <VersionModal @register="registerModal" @success="handleSuccess" />
<!-- 查看详情 弹窗-->
<DetailPublicCodeModal @register="registerDetailModal" @success="handleSuccess" />
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -68,14 +70,17 @@ import {router} from "@/router"; ...@@ -68,14 +70,17 @@ import {router} from "@/router";
import { BasicForm, useForm } from '@/components/Form'; import { BasicForm, useForm } from '@/components/Form';
import { import {
detailColumns, detailFormSchema, detailColumns, detailFormSchema,
detailSchema, searchFormSchema, detailSchema
} from './publicCode.data'; } from './publicCode.data';
import {onMounted, ref} from "vue"; import {onMounted, ref} from "vue";
import {useRoute} from "vue-router"; import {useRoute} from "vue-router";
import VersionModal from './VersionModal.vue' import VersionModal from './VersionModal.vue'
import DetailPublicCodeModal from './detailPublicCodeModal.vue'
import {useModal} from "@/components/Modal"; import {useModal} from "@/components/Modal";
import { useMessage } from '@/hooks/web/useMessage'; import { useMessage } from '@/hooks/web/useMessage';
import { BasicTable, useTable, TableAction } from '@/components/Table'; import { BasicTable, useTable, TableAction } from '@/components/Table';
const route = useRoute() const route = useRoute()
const title = ref('') const title = ref('')
const formData = ref({}) const formData = ref({})
...@@ -83,6 +88,7 @@ const businessId = ref('') ...@@ -83,6 +88,7 @@ const businessId = ref('')
const isShow = ref(false) const isShow = ref(false)
const optionValue = ref('') const optionValue = ref('')
const [registerModal, { openModal }] = useModal(); const [registerModal, { openModal }] = useModal();
const [registerDetailModal, { openModal: openDetailModal }] = useModal();
const { createMessage, createConfirm } = useMessage(); const { createMessage, createConfirm } = useMessage();
const [registerForm1, { setFieldsValue: setFieldsValue1 }] = useForm({ const [registerForm1, { setFieldsValue: setFieldsValue1 }] = useForm({
labelWidth: 100, labelWidth: 100,
...@@ -147,7 +153,7 @@ function editButton(record) { ...@@ -147,7 +153,7 @@ function editButton(record) {
/**基本标准对比*/ /**基本标准对比*/
function contrastButton(record) { function contrastButton(record) {
router.push({ router.push({
path: '/dataStandards/publicCode/basicStandardsContrast', path: '/dataStandards/publicCode/publicCodeContrast',
query: { query: {
businessId:businessId.value, businessId:businessId.value,
}, },
...@@ -173,8 +179,10 @@ function resetButton(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 @@ ...@@ -47,7 +47,8 @@
</span> </span>
</template> </template>
</BasicTable> </BasicTable>
<AddCodeValueModal @register="registerModal" @success="handleSuccess" />
<EditPublicCodeModal @register="registerEditPublicCodeModal" @success="handleSuccess" />
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
...@@ -59,29 +60,32 @@ import {router} from "@/router"; ...@@ -59,29 +60,32 @@ import {router} from "@/router";
import { BasicForm, useForm } from '@/components/Form'; import { BasicForm, useForm } from '@/components/Form';
import { import {
detailColumns, detailFormSchema, detailColumns, detailFormSchema,
editStandardsDetailFormSchema1, editStandardsDetailFormSchema,
} from './publicCode.data'; } from './publicCode.data';
import {onMounted, ref} from "vue"; import {onMounted, ref} from "vue";
import {useRoute} from "vue-router"; import {useRoute} from "vue-router";
import {useModal} from "@/components/Modal"; import {useModal} from "@/components/Modal";
import { useMessage } from '@/hooks/web/useMessage'; import { useMessage } from '@/hooks/web/useMessage';
import { BasicTable, useTable, TableAction } from '@/components/Table'; import { BasicTable, useTable, TableAction } from '@/components/Table';
import AddCodeValueModal from './AddCodeValueModal.vue';
import EditPublicCodeModal from './editPublicCodeModal.vue';
const route = useRoute() const route = useRoute()
const title = ref('') const title = ref('')
const formData = ref({}) const formData = ref({})
const businessId = ref('') const businessId = ref('')
const { createMessage, createConfirm } = useMessage(); const { createMessage, createConfirm } = useMessage();
const [registerModal, { openModal: openModal }] = useModal();
const [registerEditPublicCodeModal, { openModal: openEditPublicCodeModal }] = useModal();
const [registerForm1, { setFieldsValue: setFieldsValue1 }] = useForm({ const [registerForm1, { setFieldsValue: setFieldsValue1 }] = useForm({
labelWidth: 100, labelWidth: 100,
baseColProps: { lg: 12, md: 24 }, baseColProps: { lg: 12, md: 24 },
schemas: editStandardsDetailFormSchema1, schemas: editStandardsDetailFormSchema,
showActionButtonGroup: false, showActionButtonGroup: false,
actionColOptions: { actionColOptions: {
span: 23, span: 23,
}, },
}); });
const [registerTable, { reload, updateTableDataRecord, getSearchInfo,getForm,getRowSelection }] = useTable({ const [registerTable, { reload, updateTableDataRecord, getSearchInfo,getForm,getRowSelection }] = useTable({
title: '公共代码', title: '公共代码',
api: async (params) => { api: async (params) => {
...@@ -140,13 +144,17 @@ function saveButton(record) { ...@@ -140,13 +144,17 @@ function saveButton(record) {
/**编辑*/ /**编辑*/
function editButton(record) { function editButton(record) {
openEditPublicCodeModal(true,{
record:record
})
} }
/**添加值*/ /**添加值*/
function addValueButton(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[] = [ ...@@ -612,7 +612,7 @@ export const detailFormSchema: FormSchema[] = [
}, },
]; ];
/**编辑公共代码 表单1*/ /**编辑公共代码 表单1*/
export const editStandardsDetailFormSchema1: FormSchema[] = [ export const editStandardsDetailFormSchema: FormSchema[] = [
{ {
field: '', field: '',
label: '属性', label: '属性',
...@@ -751,452 +751,201 @@ export const editStandardsDetailFormSchema1: FormSchema[] = [ ...@@ -751,452 +751,201 @@ export const editStandardsDetailFormSchema1: FormSchema[] = [
}, },
}, },
]; ];
/**编辑公共代码 表单2*/
export const addValueFormSchema: FormSchema[] = [
/**版本对比 表单*/
export const contrastSchema: FormSchema[] = [
{ {
field: 'standardNumber', field: 'codeValue',
label: '标准编号', label: '代码值',
component: 'Input', component: 'Input',
colProps: { lg: 24, md: 24 }, required: true,
rules: [
{
required: true,
message: '请输入标准编号',
},
],
componentProps: { componentProps: {
style: { placeholder: '请输入代码值',
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入标准编号',
}, },
colProps: { lg: 24, md: 24 },
}, },
{ {
field: 'standardChineseName', field: 'codeMeaning',
label: '标准中文名称', label: '代码含义',
component: 'Input', component: 'Input',
colProps: { lg: 24, md: 24 }, required: true,
rules: [
{
required: true,
message: '请输入标准中文名称',
},
],
componentProps: { componentProps: {
style: { placeholder: '请输入代码含义',
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入标准中文名称',
}, },
colProps: { lg: 24, md: 24 },
}, },
{ {
field: 'standardEnglishName', field: 'description',
label: '标准英文名称', label: '说明',
component: 'Input', component: 'Input',
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入标准英文名称',
},
],
componentProps: { componentProps: {
style: { placeholder: '请输入说明',
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入标准英文名称',
}, },
colProps: { lg: 24, md: 24 },
}, },
];
/**编辑公共代码 表单3*/
export const addValueSearchSchema: FormSchema[] = [
{ {
field: 'standardAlias', field: 'sourceSystem',
label: '标准别名', label: '源系统',
component: 'Input', component: 'Input',
colProps: { lg: 24, md: 24 }, required: true,
rules: [
{
required: true,
message: '请输入标准别名',
},
],
componentProps: { componentProps: {
style: { placeholder: '请输入源系统',
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入标准别名',
}, },
colProps: { span: 8 },
}, },
{ {
field: 'businessDefinition', field: 'sourceSystemCodeValue',
label: '业务定义', label: '源系统码值',
component: 'Input', component: 'Input',
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入业务定义',
},
],
componentProps: { componentProps: {
style: { placeholder: '请输入源系统码值',
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入业务定义',
}, },
colProps: { span: 8 },
}, },
];
/**编辑公共代码 表单4*/
export const editPublicCodeSchema: FormSchema[] = [
{ {
field: 'standardSource', field: 'codeValue',
label: '标准来源', label: '代码值',
component: 'Select', component: 'Input',
colProps: { lg: 24, md: 24 }, required: true,
rules: [
{
required: true,
message: '请选择标准来源',
},
],
componentProps: { componentProps: {
style: { placeholder: '请输入代码值',
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: '请选择标准来源',
}, },
colProps: { lg: 24, md: 24 },
}, },
{ {
field: 'definitionBasis', field: 'codeMeaning',
label: '定义依据', label: '代码含义',
component: 'Input', component: 'Input',
colProps: { lg: 24, md: 24 }, required: true,
rules: [
{
required: true,
message: '请输入定义依据',
},
],
componentProps: { componentProps: {
style: { placeholder: '请输入代码含义',
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入定义依据',
}, },
colProps: { lg: 24, md: 24 },
}, },
{ {
field: 'businessRule', field: 'description',
label: '业务规则', label: '说明',
component: 'Input', component: 'Input',
colProps: { lg: 24, md: 24 }, required: true,
rules: [
{
required: true,
message: '请输入业务规则',
},
],
componentProps: { componentProps: {
style: { placeholder: '请输入说明',
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入业务规则',
}, },
},
{
field: 'dataType',
label: '数据类型',
component: 'Select',
colProps: { lg: 24, md: 24 }, 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', field: 'sourceSystemCodeValue',
label: '取值范围', label: '源系统码值',
component: 'Input', component: 'Input',
colProps: { lg: 24, md: 24 }, required: true,
rules: [
{
required: true,
message: '请输入取值范围',
},
],
componentProps: { componentProps: {
style: { placeholder: '请输入源系统码值',
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入取值范围',
}, },
colProps: { lg: 24, md: 24 },
}, },
];
/**详情公共代码 表单5*/
export const detailPublicCodeSchema: FormSchema[] = [
{ {
field: 'codeNumber', field: 'codeValue',
label: '代码编号', label: '代码',
component: 'Input', component: 'Input',
colProps: { lg: 24, md: 24 }, required: true,
rules: [
{
required: true,
message: '请输入代码编号',
},
],
componentProps: { componentProps: {
style: { style: {
border: 'none', border: 'none',
backgroundColor: 'transparent',
}, },
readonly: true, readonly: true,
placeholder: '请输入代码编号', placeholder: '请输入代码',
}, },
},
{
field: 'adaptability',
label: '适应性',
component: 'Select',
colProps: { lg: 24, md: 24 }, 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', field: 'codeMeaning',
label: '数据显示', label: '代码含义',
component: 'Input', component: 'Input',
colProps: { lg: 24, md: 24 }, required: true,
rules: [
{
required: true,
message: '请输入数据显示',
},
],
componentProps: { componentProps: {
style: { style: {
border: 'none', border: 'none',
backgroundColor: 'transparent',
}, },
readonly: true, readonly: true,
placeholder: '请输入数据显示', placeholder: '请输入代码含义',
}, },
colProps: { lg: 24, md: 24 },
}, },
{ {
field: 'tecDataType', field: 'description',
label: '数据类型', label: '说明',
component: 'Input', component: 'Input',
colProps: { lg: 24, md: 24 }, required: true,
rules: [
{
required: true,
message: '请输入数据类型',
},
],
componentProps: { componentProps: {
style: { style: {
border: 'none', border: 'none',
backgroundColor: 'transparent',
}, },
readonly: true, readonly: true,
placeholder: '请输入数据类型', placeholder: '请输入说明',
}, },
colProps: { lg: 24, md: 24 },
}, },
{ {
field: 'dataPrecision', field: 'sourceSystemCodeValue',
label: '数据精度', label: '源系统码值',
component: 'Input', component: 'Input',
colProps: { lg: 24, md: 24 }, required: true,
rules: [
{
required: true,
message: '请输入数据精度',
},
],
componentProps: { componentProps: {
style: { style: {
border: 'none', border: 'none',
backgroundColor: 'transparent',
}, },
readonly: true, readonly: true,
placeholder: '请输入数据精度', placeholder: '请输入源系统码值',
}, },
colProps: { lg: 24, md: 24 },
}, },
];
/**编辑公共代码 列表表头*/
export const addValueColumns: BasicColumn[] = [
{ {
field: 'dataLength', title: '源系统',
label: '数据长度', dataIndex: 'sourceSystem',
component: 'Input', width: 150
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入数据长度',
},
],
componentProps: {
style: {
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入数据长度',
},
}, },
{ {
field: 'measurementUnit', title: '源系统码值',
label: '计量单位', dataIndex: 'sourceSystemCodeValue',
component: 'Input', width: 150
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入计量单位',
},
],
componentProps: {
style: {
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入计量单位',
},
}, },
];
/**版本对比 表单*/
export const contrastSchema: FormSchema[] = [
{ {
field: 'creator', field: '',
label: '创建人员', label: '属性',
component: 'Input', component: 'BasicTitle',
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入创建人员',
},
],
componentProps: { componentProps: {
readonly: true,
style: { style: {
border: 'none', marginLeft: '15px',
backgroundColor: 'transparent', fontWeight: 'bold',
}, },
readonly: true,
placeholder: '请输入创建人员',
}, },
colProps: { lg: 24, md: 24 },
}, },
{ {
field: 'updater', field: 'standardPath',
label: '更新人员', label: '标准路径',
component: 'Input', component: 'Input',
colProps: { lg: 24, md: 24 }, colProps: { lg: 24, md: 24 },
rules: [ rules: [
{ {
required: true, required: true,
message: '请输入更新人员', message: '请输入标准路径',
}, },
], ],
componentProps: { componentProps: {
...@@ -1205,18 +954,18 @@ export const contrastSchema: FormSchema[] = [ ...@@ -1205,18 +954,18 @@ export const contrastSchema: FormSchema[] = [
backgroundColor: 'transparent', backgroundColor: 'transparent',
}, },
readonly: true, readonly: true,
placeholder: '请输入更新人员', placeholder: '请输入标准路径',
}, },
}, },
{ {
field: 'createDate', field: 'standardNumber',
label: '创建日期', label: '标准编号',
component: 'Input', component: 'Input',
colProps: { lg: 24, md: 24 }, colProps: { lg: 24, md: 24 },
rules: [ rules: [
{ {
required: true, required: true,
message: '请输入创建日期', message: '请输入标准编号',
}, },
], ],
componentProps: { componentProps: {
...@@ -1225,18 +974,18 @@ export const contrastSchema: FormSchema[] = [ ...@@ -1225,18 +974,18 @@ export const contrastSchema: FormSchema[] = [
backgroundColor: 'transparent', backgroundColor: 'transparent',
}, },
readonly: true, readonly: true,
placeholder: '请输入创建日期', placeholder: '请输入标准编号',
}, },
}, },
{ {
field: 'updateDate', field: 'standardChineseName',
label: '更新日期', label: '标准中文名称',
component: 'Input', component: 'Input',
colProps: { lg: 24, md: 24 }, colProps: { lg: 24, md: 24 },
rules: [ rules: [
{ {
required: true, required: true,
message: '请输入更新日期', message: '请输入标准中文名称',
}, },
], ],
componentProps: { componentProps: {
...@@ -1245,18 +994,18 @@ export const contrastSchema: FormSchema[] = [ ...@@ -1245,18 +994,18 @@ export const contrastSchema: FormSchema[] = [
backgroundColor: 'transparent', backgroundColor: 'transparent',
}, },
readonly: true, readonly: true,
placeholder: '请输入更新日期', placeholder: '请输入标准中文名称',
}, },
}, },
{ {
field: 'secondaryAuthorityDepartment', field: 'standardSource',
label: '权威二级部门', label: '标准来源',
component: 'Input', component: 'Input',
colProps: { lg: 24, md: 24 }, colProps: { lg: 24, md: 24 },
rules: [ rules: [
{ {
required: true, required: true,
message: '请输入权威二级部门', message: '请输入标准来源',
}, },
], ],
componentProps: { componentProps: {
...@@ -1265,18 +1014,18 @@ export const contrastSchema: FormSchema[] = [ ...@@ -1265,18 +1014,18 @@ export const contrastSchema: FormSchema[] = [
backgroundColor: 'transparent', backgroundColor: 'transparent',
}, },
readonly: true, readonly: true,
placeholder: '请输入权威二级部门', placeholder: '请输入标准来源',
}, },
}, },
{ {
field: 'tertiaryAuthorityDepartment', field: 'businessDefinition',
label: '权威三级部门', label: '业务定义',
component: 'Input', component: 'Input',
colProps: { lg: 24, md: 24 }, colProps: { lg: 24, md: 24 },
rules: [ rules: [
{ {
required: true, required: true,
message: '请输入权威三级部门', message: '请输入业务定义',
}, },
], ],
componentProps: { componentProps: {
...@@ -1285,18 +1034,18 @@ export const contrastSchema: FormSchema[] = [ ...@@ -1285,18 +1034,18 @@ export const contrastSchema: FormSchema[] = [
backgroundColor: 'transparent', backgroundColor: 'transparent',
}, },
readonly: true, readonly: true,
placeholder: '请输入权威三级部门', placeholder: '请输入业务定义',
}, },
}, },
{ {
field: 'coreSystem', field: 'definitionBasis',
label: '核心系统', label: '定义依据',
component: 'Input', component: 'Input',
colProps: { lg: 24, md: 24 }, colProps: { lg: 24, md: 24 },
rules: [ rules: [
{ {
required: true, required: true,
message: '请输入核心系统', message: '请输入定义依据',
}, },
], ],
componentProps: { componentProps: {
...@@ -1305,103 +1054,37 @@ export const contrastSchema: FormSchema[] = [ ...@@ -1305,103 +1054,37 @@ export const contrastSchema: FormSchema[] = [
backgroundColor: 'transparent', backgroundColor: 'transparent',
}, },
readonly: true, readonly: true,
placeholder: '请输入核心系统', placeholder: '请输入定义依据',
}, },
}, },
];
/**版本对比 列表*/
export const contrastTableColumns: BasicColumn[] = [
{ {
field: 'dataStandardStatus', title: '代码值',
label: '数据标准状态', dataIndex: 'codeValue',
component: 'Select', width: 150
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: '请输入数据标准状态',
},
}, },
{ {
field: 'expirationDate', title: '代码含义',
label: '失效时间', dataIndex: 'codeMeaning',
component: 'Input', width: 150
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入失效时间',
},
],
componentProps: {
style: {
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
},
}, },
{ {
field: 'expirationReason', title: '说明',
label: '失效原因', dataIndex: 'description',
component: 'Input', width: 150
colProps: { lg: 24, md: 24 },
rules: [
{
required: true,
message: '请输入失效原因',
},
],
componentProps: {
style: {
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入失效原因',
},
}, },
{ {
field: 'collaborativeDepartment', title: '修改人',
label: '协作部门', dataIndex: 'updateBy',
component: 'Input', width: 150
colProps: { lg: 24, md: 24 }, },
rules: [ {
{ title: '修改时间',
required: true, dataIndex: 'updateDate',
message: '请输入协作部门', width: 150
}, },
],
componentProps: {
style: {
border: 'none',
backgroundColor: 'transparent',
},
readonly: true,
placeholder: '请输入协作部门',
},
}
]; ];
......
...@@ -25,9 +25,13 @@ ...@@ -25,9 +25,13 @@
</div> </div>
</div> </div>
</div> </div>
<div> <Divider />
<BasicForm @register="registerLeftForm" /> <div style="display: flex; justify-content: center;">
<a-button style="margin-right: 5px" type="primary" @click="">回滚到此版本</a-button>
</div> </div>
<Divider />
<BasicForm @register="registerLeftForm" />
<BasicTable @register="registerTable1"/>
</div> </div>
<div class="w-1/2 xl:w-1/2"> <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"> <div style="display: flex;justify-content: space-between; align-items: center;margin-bottom: 10px;margin-left: 12px">
...@@ -48,17 +52,33 @@ ...@@ -48,17 +52,33 @@
</div> </div>
</div> </div>
</div> </div>
<div> <Divider />
<BasicForm @register="registerRightForm" /> <div style="display: flex; justify-content: center;">
<a-button style="margin-right: 5px" type="primary" @click="">回滚到此版本</a-button>
</div> </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> </div>
</PageWrapper> </PageWrapper>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { BasicTable, useTable } from '@/components/Table';
import { PageWrapper } from '@/components/Page'; import { PageWrapper } from '@/components/Page';
import {contrastSchema} from '@/views/dataStandards/basicStandards/basicStandards.data'; import { addValueSearchSchema, contrastSchema, contrastTableColumns} from './publicCode.data';
import {leftContrastData,rightContrastData} from '@/views/dataStandards/basicStandards/basicStandardsData'; import { leftContrastData, rightContrastData,leftContrastTableData,rightContrastTableData} from './publicCodeData';
import { useMessage } from '@/hooks/web/useMessage'; import { useMessage } from '@/hooks/web/useMessage';
import { BasicForm, useForm } from '@/components/Form'; import { BasicForm, useForm } from '@/components/Form';
import {onMounted,ref} from "vue"; import {onMounted,ref} from "vue";
...@@ -66,6 +86,9 @@ ...@@ -66,6 +86,9 @@
import Icon from '@/components/Icon/Icon.vue'; import Icon from '@/components/Icon/Icon.vue';
import {router} from "@/router"; import {router} from "@/router";
import { useRoute,onBeforeRouteLeave } from 'vue-router'; import { useRoute,onBeforeRouteLeave } from 'vue-router';
import { Divider } from 'ant-design-vue';
import { BasicTable, useTable, TableAction } from '@/components/Table';
defineOptions({ name: 'Metadata' }); defineOptions({ name: 'Metadata' });
const route = useRoute(); const route = useRoute();
const title = ref('对外投资出资方式') const title = ref('对外投资出资方式')
...@@ -74,18 +97,72 @@ ...@@ -74,18 +97,72 @@
{ value: 'V2', label: 'V2' }, { value: 'V2', label: 'V2' },
{ value: 'V3', label: 'V3' }, { value: 'V3', label: 'V3' },
]); ]);
const orderOptions = ref<any>([
{ value: '1', label: '代码值升序' },
{ value: '2', label: '代码值降序' },
]);
const { createMessage } = useMessage(); const { createMessage } = useMessage();
const [registerLeftForm,{setFieldsValue:setLeftFieldsValue}] = useForm({ const [registerLeftForm,{setFieldsValue:setLeftFieldsValue}] = useForm({
labelWidth: 100, labelWidth: 100,
schemas: contrastSchema, schemas: contrastSchema,
showActionButtonGroup: false, showActionButtonGroup: false,
}); });
const [registerRightForm,{setFieldsValue:setRightFieldsValue}] = useForm({ const [registerRightForm,{setFieldsValue:setRightFieldsValue}] = useForm({
labelWidth: 100, labelWidth: 100,
schemas: contrastSchema, schemas: contrastSchema,
showActionButtonGroup: false, 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() { function startContrast() {
createMessage.success('开始对比'); createMessage.success('开始对比');
...@@ -94,7 +171,7 @@ ...@@ -94,7 +171,7 @@
/**结束对比*/ /**结束对比*/
function endContrast() { function endContrast() {
router.push({ router.push({
path: '/dataStandards/publicCode/detailStandard', path: '/dataStandards/publicCode/detailPublicCode',
query: { query: {
businessId:route.query.businessId, businessId:route.query.businessId,
}, },
......
...@@ -566,6 +566,7 @@ export const leftContrastData: any[] = [ ...@@ -566,6 +566,7 @@ export const leftContrastData: any[] = [
"publishStatus": "已发布", "publishStatus": "已发布",
"businessDefinition": "对外投资出资方式", "businessDefinition": "对外投资出资方式",
"standardCode": "BAS000004", "standardCode": "BAS000004",
"standardPath":'/公共代码/个人工作区/对外投资出资方式',
"referenceStandard":[ "referenceStandard":[
{ icon: '🌐🔍', text: '数据源1' }, { icon: '🌐🔍', text: '数据源1' },
], ],
...@@ -609,6 +610,7 @@ export const rightContrastData = [ ...@@ -609,6 +610,7 @@ export const rightContrastData = [
{ {
"businessId": 201, "businessId": 201,
"standardChineseName": "对外投资出资方式", "standardChineseName": "对外投资出资方式",
"standardPath":'/公共代码/个人工作区/对外投资出资方式',
"anotherName": "对外投资出资方式", "anotherName": "对外投资出资方式",
"parentId": 102, "parentId": 102,
"publishStatus": "已发布", "publishStatus": "已发布",
...@@ -653,6 +655,60 @@ export const rightContrastData = [ ...@@ -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 数据*/ /**关联关系 表格3 数据*/
export const relatedRelationshipsData3 = [ export const relatedRelationshipsData3 = [
...@@ -712,3 +768,19 @@ export const detailData = [ ...@@ -712,3 +768,19 @@ export const detailData = [
sourceSystemCodeValue: '-', 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