fix
Showing
6 changed files
with
148 additions
and
34 deletions
| ... | @@ -552,3 +552,8 @@ export const getContractDetail = (params) => request({ | ... | @@ -552,3 +552,8 @@ export const getContractDetail = (params) => request({ |
| 552 | method: 'get', | 552 | method: 'get', |
| 553 | params | 553 | params |
| 554 | }) | 554 | }) |
| 555 | |||
| 556 | // 获取所有字典 | ||
| 557 | export const getDictAllList = () => request({ | ||
| 558 | url: `${import.meta.env.VITE_APP_CONFIG_URL}/dict/data/get-all` | ||
| 559 | }) | ... | ... |
| ... | @@ -313,4 +313,32 @@ export const exportStandardCodeData = (params) => request({ | ... | @@ -313,4 +313,32 @@ export const exportStandardCodeData = (params) => request({ |
| 313 | method: 'post', | 313 | method: 'post', |
| 314 | data: params, | 314 | data: params, |
| 315 | responseType: 'blob' | 315 | responseType: 'blob' |
| 316 | }) | ||
| 317 | /** 元数据标准-树形列表 */ | ||
| 318 | export const getMetaStandardTree = () => request({ | ||
| 319 | url: `${import.meta.env.VITE_APP_STANDARD_URL}/meta-standard/list-tree`, | ||
| 320 | method: 'get' | ||
| 321 | }) | ||
| 322 | /** 元数据标准-新增 */ | ||
| 323 | export const saveMetaStandard = (params) => request({ | ||
| 324 | url: `${import.meta.env.VITE_APP_STANDARD_URL}/meta-standard/save`, | ||
| 325 | method: 'post', | ||
| 326 | data: params | ||
| 327 | }) | ||
| 328 | /** 元数据标准-修改 */ | ||
| 329 | export const updateMetaStandard = (params) => request({ | ||
| 330 | url: `${import.meta.env.VITE_APP_STANDARD_URL}/meta-standard/update`, | ||
| 331 | method: 'put', | ||
| 332 | data: params | ||
| 333 | }) | ||
| 334 | /** 元数据标准-删除 */ | ||
| 335 | export const deleteMetaStandard = (params) => request({ | ||
| 336 | url: `${import.meta.env.VITE_APP_STANDARD_URL}/meta-standard/delete`, | ||
| 337 | method: 'delete', | ||
| 338 | data: params | ||
| 339 | }) | ||
| 340 | /** 元数据标准-详情 */ | ||
| 341 | export const getMetaStandardDetail = (guid) => request({ | ||
| 342 | url: `${import.meta.env.VITE_APP_STANDARD_URL}/meta-standard/detail?guid=${guid}`, | ||
| 343 | method: 'get' | ||
| 316 | }) | 344 | }) |
| ... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
This diff is collapsed.
Click to expand it.
| ... | @@ -201,7 +201,7 @@ const formItems: any = ref([ | ... | @@ -201,7 +201,7 @@ const formItems: any = ref([ |
| 201 | }, | 201 | }, |
| 202 | { | 202 | { |
| 203 | label: '排序', | 203 | label: '排序', |
| 204 | type: 'inputNumber', | 204 | type: 'input', |
| 205 | placeholder: '请输入', | 205 | placeholder: '请输入', |
| 206 | field: 'orderNum', | 206 | field: 'orderNum', |
| 207 | default: '', | 207 | default: '', |
| ... | @@ -241,6 +241,7 @@ const formItems: any = ref([ | ... | @@ -241,6 +241,7 @@ const formItems: any = ref([ |
| 241 | required: true, | 241 | required: true, |
| 242 | multiple: true, | 242 | multiple: true, |
| 243 | tagsTooltip: true, | 243 | tagsTooltip: true, |
| 244 | collapse: true, | ||
| 244 | filterable: true, | 245 | filterable: true, |
| 245 | visible: true | 246 | visible: true |
| 246 | }, | 247 | }, |
| ... | @@ -271,7 +272,25 @@ const formRules: any = ref({ | ... | @@ -271,7 +272,25 @@ const formRules: any = ref({ |
| 271 | standard: { required: true, message: '请输入标准号' }, | 272 | standard: { required: true, message: '请输入标准号' }, |
| 272 | standardName: { required: true, message: '请输入标准名称' }, | 273 | standardName: { required: true, message: '请输入标准名称' }, |
| 273 | publishingUnitCode: { required: true, message: '请选择发布单位' }, | 274 | publishingUnitCode: { required: true, message: '请选择发布单位' }, |
| 274 | orderNum: { required: true, message: '请输入排序' }, | 275 | orderNum: { |
| 276 | required: true, | ||
| 277 | validator: (rule, value, callback) => { | ||
| 278 | if (value === 0) { | ||
| 279 | callback(); | ||
| 280 | return; | ||
| 281 | } | ||
| 282 | if (!value) { | ||
| 283 | callback(new Error('请填写排序')); | ||
| 284 | return; | ||
| 285 | } | ||
| 286 | const r = /(^[0-9]([0-9]*)$|^[0-9]$)/; // 正整数(可以以0打头) | ||
| 287 | if (value && !r.test(value)) { | ||
| 288 | callback(new Error('请填写大于或等于零整数')); | ||
| 289 | return; | ||
| 290 | } | ||
| 291 | callback(); | ||
| 292 | } | ||
| 293 | }, | ||
| 275 | typeCode: { required: true, message: '请选择代码类型' }, | 294 | typeCode: { required: true, message: '请选择代码类型' }, |
| 276 | codeFields: { required: true, message: '请选择编码字段' }, | 295 | codeFields: { required: true, message: '请选择编码字段' }, |
| 277 | codeFieldName: { required: true, message: '请选择编码名称' } | 296 | codeFieldName: { required: true, message: '请选择编码名称' } |
| ... | @@ -292,7 +311,7 @@ const formInfo = ref({ | ... | @@ -292,7 +311,7 @@ const formInfo = ref({ |
| 292 | const orginData = [ | 311 | const orginData = [ |
| 293 | { | 312 | { |
| 294 | ROWID: 'field_0', | 313 | ROWID: 'field_0', |
| 295 | fieldName: 'code', | 314 | fieldName: '代码', |
| 296 | description: '编码字段', | 315 | description: '编码字段', |
| 297 | fieldType: 'varchar', | 316 | fieldType: 'varchar', |
| 298 | fieldLength: '10', | 317 | fieldLength: '10', |
| ... | @@ -303,7 +322,7 @@ const orginData = [ | ... | @@ -303,7 +322,7 @@ const orginData = [ |
| 303 | STATE: 'Running' | 322 | STATE: 'Running' |
| 304 | }, { | 323 | }, { |
| 305 | ROWID: 'field_1', | 324 | ROWID: 'field_1', |
| 306 | fieldName: 'name', | 325 | fieldName: '名称', |
| 307 | description: '编码名称', | 326 | description: '编码名称', |
| 308 | fieldType: 'varchar', | 327 | fieldType: 'varchar', |
| 309 | fieldLength: '20', | 328 | fieldLength: '20', |
| ... | @@ -675,6 +694,7 @@ const setCodeOptions = () => { | ... | @@ -675,6 +694,7 @@ const setCodeOptions = () => { |
| 675 | } | 694 | } |
| 676 | 695 | ||
| 677 | const toolBtnClick = (btn, data) => { | 696 | const toolBtnClick = (btn, data) => { |
| 697 | console.log(formItems.value.length) | ||
| 678 | const type = btn.value | 698 | const type = btn.value |
| 679 | if (data) { | 699 | if (data) { |
| 680 | if (type.indexOf('add') > -1) { | 700 | if (type.indexOf('add') > -1) { |
| ... | @@ -839,6 +859,7 @@ const tableSwitchChange = (val, scope, field) => { | ... | @@ -839,6 +859,7 @@ const tableSwitchChange = (val, scope, field) => { |
| 839 | } | 859 | } |
| 840 | 860 | ||
| 841 | const tableBtnClick = (scope, btn) => { | 861 | const tableBtnClick = (scope, btn) => { |
| 862 | |||
| 842 | const type = btn.value; | 863 | const type = btn.value; |
| 843 | const row = scope.row; | 864 | const row = scope.row; |
| 844 | if (type == "edit") { | 865 | if (type == "edit") { |
| ... | @@ -874,7 +895,11 @@ const tableBtnClick = (scope, btn) => { | ... | @@ -874,7 +895,11 @@ const tableBtnClick = (scope, btn) => { |
| 874 | formTable.value.tableInfo.loading = false | 895 | formTable.value.tableInfo.loading = false |
| 875 | drawerInfo.value.loading = false; | 896 | drawerInfo.value.loading = false; |
| 876 | }) | 897 | }) |
| 877 | } else if (type == "delete") { | 898 | } else if (type === 'remove') { |
| 899 | const existIndex = formTableData.value.findIndex(s => s.ROWID == row.ROWID) | ||
| 900 | existIndex > -1 && formTableData.value.splice(existIndex, 1) | ||
| 901 | } | ||
| 902 | else if (type == "delete") { | ||
| 878 | currTableData.value = row; | 903 | currTableData.value = row; |
| 879 | tableInfo.value.loading = true | 904 | tableInfo.value.loading = true |
| 880 | open("此操作将永久删除, 是否继续?", "warning"); | 905 | open("此操作将永久删除, 是否继续?", "warning"); |
| ... | @@ -1091,7 +1116,13 @@ const loadDrawer = async () => { | ... | @@ -1091,7 +1116,13 @@ const loadDrawer = async () => { |
| 1091 | }) | 1116 | }) |
| 1092 | formTable.value.tableInfo.fields = fields | 1117 | formTable.value.tableInfo.fields = fields |
| 1093 | formItems.value.forEach(item => { | 1118 | formItems.value.forEach(item => { |
| 1094 | item.default = '' | 1119 | if (item.field === 'bizState') { |
| 1120 | item.default = 'Y' | ||
| 1121 | } else if (item.field === 'typeCode') { | ||
| 1122 | item.default = '1' | ||
| 1123 | } else { | ||
| 1124 | item.default = '' | ||
| 1125 | } | ||
| 1095 | item.disabled = false | 1126 | item.disabled = false |
| 1096 | }) | 1127 | }) |
| 1097 | formInfo.value.formInfo.items = formItems.value | 1128 | formInfo.value.formInfo.items = formItems.value |
| ... | @@ -1343,6 +1374,11 @@ const scrollTable = (rowInfo) => { | ... | @@ -1343,6 +1374,11 @@ const scrollTable = (rowInfo) => { |
| 1343 | const drawerBtnClick = (btn, info) => { | 1374 | const drawerBtnClick = (btn, info) => { |
| 1344 | console.log('btn', btn, info) | 1375 | console.log('btn', btn, info) |
| 1345 | console.log('table', formTable.value) | 1376 | console.log('table', formTable.value) |
| 1377 | let uniqFieldNameList = Array.from(new Set(formTable.value.tableInfo.data.map(item => item.fieldName))) | ||
| 1378 | if (uniqFieldNameList.length !== formTable.value.tableInfo.data.length) { | ||
| 1379 | ElMessage.error('表结构字段名称需唯一,不允许重名') | ||
| 1380 | return | ||
| 1381 | } | ||
| 1346 | let params = { | 1382 | let params = { |
| 1347 | standardCodeFields: formTable.value.tableInfo.data.map(item => { | 1383 | standardCodeFields: formTable.value.tableInfo.data.map(item => { |
| 1348 | let obj = { | 1384 | let obj = { | ... | ... |
| ... | @@ -273,6 +273,8 @@ const batching = (type) => { | ... | @@ -273,6 +273,8 @@ const batching = (type) => { |
| 273 | // uploadSteps.value[0].cascaderInfo.options = dictionaryList.value | 273 | // uploadSteps.value[0].cascaderInfo.options = dictionaryList.value |
| 274 | // } | 274 | // } |
| 275 | uploadInfo.value.uploadInfo.steps = uploadSteps.value | 275 | uploadInfo.value.uploadInfo.steps = uploadSteps.value |
| 276 | uploadSetting.value.forEach(item => item.value = '') | ||
| 277 | sheetNameList.value = [] | ||
| 276 | const content: any = [uploadInfo.value] | 278 | const content: any = [uploadInfo.value] |
| 277 | dialogInfo.value.contents = content | 279 | dialogInfo.value.contents = content |
| 278 | dialogInfo.value.visible = true | 280 | dialogInfo.value.visible = true |
| ... | @@ -515,17 +517,18 @@ onActivated(() => { | ... | @@ -515,17 +517,18 @@ onActivated(() => { |
| 515 | <Dialog :dialogInfo="dialogInfo" @btnClick="dialogBtnClick" @onUpload="onUpload" @uploadBtnClick="uploadBtnClick" | 517 | <Dialog :dialogInfo="dialogInfo" @btnClick="dialogBtnClick" @onUpload="onUpload" @uploadBtnClick="uploadBtnClick" |
| 516 | @cascaderChange="cascaderChange" @selectChange="selectChange"> | 518 | @cascaderChange="cascaderChange" @selectChange="selectChange"> |
| 517 | <div> | 519 | <div> |
| 518 | <div class="title" style="color:#333">2、导入前请先导入文件的sheet与标准做对应</div> | 520 | <div class="title" style="color:#333;margin:20px 0 10px">2、导入前请先导入文件的sheet与标准做对应</div> |
| 519 | <el-form :label-width="240" style="margin-top:20px"> | 521 | <el-table :data="uploadSetting"> |
| 520 | <el-form-item label="全局变量"> | 522 | <el-table-column type="index" label="序号" width="55" align="center"/> |
| 521 | <span>选择sheet页</span> | 523 | <el-table-column label="代码名称" prop="standardName"></el-table-column> |
| 522 | </el-form-item> | 524 | <el-table-column label="选择sheet页"> |
| 523 | <el-form-item v-for="item in uploadSetting" :key="item.standardGuid" :label="item.standardName" required > | 525 | <template #default="scope"> |
| 524 | <el-select v-model="item.value" placeholder="请选择" style="width:200px" clearable> | 526 | <el-select v-model="scope.row.value" placeholder="请选择" style="width:200px" clearable> |
| 525 | <el-option v-for="item,i in sheetNameList" :label="item" :value="item" :key="i"></el-option> | 527 | <el-option v-for="item,i in sheetNameList" :label="item" :value="item" :key="i"></el-option> |
| 526 | </el-select> | 528 | </el-select> |
| 527 | </el-form-item> | 529 | </template> |
| 528 | </el-form> | 530 | </el-table-column> |
| 531 | </el-table> | ||
| 529 | </div> | 532 | </div> |
| 530 | </Dialog> | 533 | </Dialog> |
| 531 | </div> | 534 | </div> |
| ... | @@ -590,5 +593,11 @@ onActivated(() => { | ... | @@ -590,5 +593,11 @@ onActivated(() => { |
| 590 | padding: 0 16px; | 593 | padding: 0 16px; |
| 591 | height: calc(100% - 71px); | 594 | height: calc(100% - 71px); |
| 592 | } | 595 | } |
| 596 | |||
| 593 | } | 597 | } |
| 594 | </style> | 598 | </style> |
| 599 | <style lang="scss"> | ||
| 600 | .upload_panel_wrap .upload_panel .file_panel .file_item .file_btn { | ||
| 601 | word-break: keep-all; | ||
| 602 | } | ||
| 603 | </style> | ... | ... |
| ... | @@ -13,9 +13,10 @@ import DictFileds from './components/dictFileds.vue' | ... | @@ -13,9 +13,10 @@ import DictFileds from './components/dictFileds.vue' |
| 13 | import useCatchStore from "@/store/modules/catch"; | 13 | import useCatchStore from "@/store/modules/catch"; |
| 14 | import { download } from '@/utils/common' | 14 | import { download } from '@/utils/common' |
| 15 | import { getParamsList } from '@/api/modules/dataAsset' | 15 | import { getParamsList } from '@/api/modules/dataAsset' |
| 16 | import { getStandardCodeList } from '@/api/modules/dataMetaService' | 16 | import { getMetaStandardTree } from '@/api/modules/dataMetaService' |
| 17 | import router from '@/router' | 17 | import router from '@/router' |
| 18 | import { TableColumnWidth } from '@/utils/enum'; | 18 | import { TableColumnWidth } from '@/utils/enum'; |
| 19 | import StandardDialog from './components/standardDialog.vue' | ||
| 19 | 20 | ||
| 20 | const { proxy } = getCurrentInstance() as any; | 21 | const { proxy } = getCurrentInstance() as any; |
| 21 | 22 | ||
| ... | @@ -29,21 +30,23 @@ const treeInfo = ref({ | ... | @@ -29,21 +30,23 @@ const treeInfo = ref({ |
| 29 | queryValue: "", | 30 | queryValue: "", |
| 30 | queryPlaceholder: "请输入关键字搜索", | 31 | queryPlaceholder: "请输入关键字搜索", |
| 31 | props: { | 32 | props: { |
| 32 | label: "label", | 33 | label: "standardName", |
| 33 | value: "value", | 34 | value: "guid", |
| 34 | isLeaf: "isLeaf", | 35 | isLeaf: "isLeaf", |
| 35 | }, | 36 | }, |
| 36 | lazy: true, | 37 | // lazy: true, |
| 37 | nodeKey: 'value', | 38 | nodeKey: 'guid', |
| 38 | expandedKey: ['01'], | 39 | expandedKey: [], |
| 39 | currentNodeKey: '01', | 40 | currentNodeKey: '', |
| 40 | data: [], | 41 | data: [], |
| 41 | expandOnNodeClick: false, | 42 | expandOnNodeClick: false, |
| 42 | loading: false, | 43 | loading: false, |
| 43 | currentObj: {} | 44 | currentObj: {}, |
| 45 | editTreeItem: true, | ||
| 46 | className: 'tree-list' | ||
| 44 | }) | 47 | }) |
| 45 | function nodeClick (data) { | 48 | function nodeClick (data) { |
| 46 | drawerInfo.value.visible = false | 49 | // drawerInfo.value.visible = false |
| 47 | const changeCont = () => { | 50 | const changeCont = () => { |
| 48 | nextTick(() => { | 51 | nextTick(() => { |
| 49 | treeInfo.value.currentNodeKey = data.value | 52 | treeInfo.value.currentNodeKey = data.value |
| ... | @@ -85,6 +88,27 @@ function nodeClick (data) { | ... | @@ -85,6 +88,27 @@ function nodeClick (data) { |
| 85 | changeCont() | 88 | changeCont() |
| 86 | } | 89 | } |
| 87 | } | 90 | } |
| 91 | function treeCustomClick (node, type) { | ||
| 92 | console.log(node, type) | ||
| 93 | if (type === 'edit') { | ||
| 94 | // 编辑 | ||
| 95 | standardDialog.type = 'edit' | ||
| 96 | standardDialog.guid = node.data.guid | ||
| 97 | standardDialog.visible = true | ||
| 98 | return | ||
| 99 | } | ||
| 100 | } | ||
| 101 | function getTree () { | ||
| 102 | getMetaStandardTree().then((res:any) => { | ||
| 103 | if (res.code === proxy.$passCode) { | ||
| 104 | let data = res.data || [] | ||
| 105 | data.forEach(item => { | ||
| 106 | item.showEdit = true | ||
| 107 | }) | ||
| 108 | treeInfo.value.data = data | ||
| 109 | } | ||
| 110 | }) | ||
| 111 | } | ||
| 88 | 112 | ||
| 89 | const tableSearchInput = ref('') | 113 | const tableSearchInput = ref('') |
| 90 | const currTableData: any = ref<Object>({}); | 114 | const currTableData: any = ref<Object>({}); |
| ... | @@ -262,15 +286,20 @@ const formInfo = ref({ | ... | @@ -262,15 +286,20 @@ const formInfo = ref({ |
| 262 | // 元标准dialog | 286 | // 元标准dialog |
| 263 | const standardDialog = reactive({ | 287 | const standardDialog = reactive({ |
| 264 | visible: false, | 288 | visible: false, |
| 265 | title: '新增元标准' | 289 | type: 'add', |
| 290 | guid: null | ||
| 266 | }) | 291 | }) |
| 267 | function openStandardDialog () { | 292 | function openStandardDialog () { |
| 268 | standardDialog.visible = true | 293 | standardDialog.visible = true |
| 269 | } | 294 | } |
| 295 | |||
| 296 | onBeforeMount(() => { | ||
| 297 | getTree() | ||
| 298 | }) | ||
| 270 | </script> | 299 | </script> |
| 271 | 300 | ||
| 272 | <template> | 301 | <template> |
| 273 | <!-- <div class="container_wrap full flex standard"> | 302 | <div class="container_wrap full flex standard"> |
| 274 | <div class="aside_wrap"> | 303 | <div class="aside_wrap"> |
| 275 | <div class="aside_title"> | 304 | <div class="aside_title"> |
| 276 | 元数据标准列表 | 305 | 元数据标准列表 |
| ... | @@ -278,7 +307,11 @@ function openStandardDialog () { | ... | @@ -278,7 +307,11 @@ function openStandardDialog () { |
| 278 | <CirclePlus /> | 307 | <CirclePlus /> |
| 279 | </el-icon> | 308 | </el-icon> |
| 280 | </div> | 309 | </div> |
| 281 | <Tree ref="dictTreeRef" :treeInfo="treeInfo" @nodeClick="nodeClick" @loadNode="loadTreeNode"/> | 310 | <Tree ref="dictTreeRef" :treeInfo="treeInfo" @nodeClick="nodeClick" @itemMenuClick="treeCustomClick"> |
| 311 | <template #default="{ node, data }"> | ||
| 312 | {{ node.label }} | ||
| 313 | </template> | ||
| 314 | </Tree> | ||
| 282 | </div> | 315 | </div> |
| 283 | <div class="main_wrap"> | 316 | <div class="main_wrap"> |
| 284 | <div class="table_tool_wrap"> | 317 | <div class="table_tool_wrap"> |
| ... | @@ -296,10 +329,14 @@ function openStandardDialog () { | ... | @@ -296,10 +329,14 @@ function openStandardDialog () { |
| 296 | @tablePageChange="tablePageChange" @tableSwitchBeforeChange="tableSwitchBeforeChange" /> | 329 | @tablePageChange="tablePageChange" @tableSwitchBeforeChange="tableSwitchBeforeChange" /> |
| 297 | </div> | 330 | </div> |
| 298 | </div> | 331 | </div> |
| 299 | <el-dialog v-model="standardDialog.visible" :title="standardDialog.title" width="700"> | 332 | <StandardDialog |
| 300 | 333 | v-model="standardDialog.visible" | |
| 301 | </el-dialog> | 334 | :standardOptions="treeInfo.data" |
| 302 | </div> --> | 335 | :type="standardDialog.type" |
| 336 | :guid="standardDialog.guid" | ||
| 337 | @success="getTree" | ||
| 338 | /> | ||
| 339 | </div> | ||
| 303 | </template> | 340 | </template> |
| 304 | 341 | ||
| 305 | <style lang="scss"> | 342 | <style lang="scss"> |
| ... | @@ -324,7 +361,6 @@ function openStandardDialog () { | ... | @@ -324,7 +361,6 @@ function openStandardDialog () { |
| 324 | display: flex; | 361 | display: flex; |
| 325 | justify-content: space-between; | 362 | justify-content: space-between; |
| 326 | align-items: center; | 363 | align-items: center; |
| 327 | |||
| 328 | } | 364 | } |
| 329 | } | 365 | } |
| 330 | 366 | ... | ... |
-
Please register or sign in to post a comment