Merge branch 'develop' of http://117.78.60.236:8000/csbr-daop/fe-data-asset-management into develop
Showing
19 changed files
with
700 additions
and
106 deletions
| ... | @@ -36,6 +36,9 @@ VITE_APP_CHECK_BASEURL = ms-daop-zcgl-data-inventory | ... | @@ -36,6 +36,9 @@ VITE_APP_CHECK_BASEURL = ms-daop-zcgl-data-inventory |
| 36 | # 数据字典接口地址 | 36 | # 数据字典接口地址 |
| 37 | VITE_APP_CONFIG_URL = 'ms-daop-configure-service' | 37 | VITE_APP_CONFIG_URL = 'ms-daop-configure-service' |
| 38 | 38 | ||
| 39 | # 文件上传下载接口地址 | ||
| 40 | VITE_APP_COMMON_URL = 'ms-daop-common-service' | ||
| 41 | |||
| 39 | 42 | ||
| 40 | #门户接口 | 43 | #门户接口 |
| 41 | VITE_API_PORTALURL = https://swzl-test.zgsjzc.com/portal | 44 | VITE_API_PORTALURL = https://swzl-test.zgsjzc.com/portal | ... | ... |
src/api/modules/dataCatalogService.ts
0 → 100644
This diff is collapsed.
Click to expand it.
| ... | @@ -172,6 +172,14 @@ export const getLargeCategoryList = (params) => request({ | ... | @@ -172,6 +172,14 @@ export const getLargeCategoryList = (params) => request({ |
| 172 | method: 'get', | 172 | method: 'get', |
| 173 | }) | 173 | }) |
| 174 | 174 | ||
| 175 | /** | ||
| 176 | * 获取字段类型 | ||
| 177 | */ | ||
| 178 | export const getFieldTypeList = (params) => request({ | ||
| 179 | url: `${import.meta.env.VITE_APP_CONFIG_URL}/dict/data/get-by-dictType?dictType=${params.dictType}`, | ||
| 180 | method: 'get', | ||
| 181 | }) | ||
| 182 | |||
| 175 | 183 | ||
| 176 | /** 分类分级模板数据 */ | 184 | /** 分类分级模板数据 */ |
| 177 | export const getTempleteClassifyData = (data) => request({ | 185 | export const getTempleteClassifyData = (data) => request({ |
| ... | @@ -595,7 +603,7 @@ export const getDictionary = (params) => request({ | ... | @@ -595,7 +603,7 @@ export const getDictionary = (params) => request({ |
| 595 | * @path /biz-rule-config/save | 603 | * @path /biz-rule-config/save |
| 596 | */ | 604 | */ |
| 597 | export const saveBizRuleConfig = (data) => request({ | 605 | export const saveBizRuleConfig = (data) => request({ |
| 598 | url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/biz-rule-config/save`, | 606 | url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/biz-rule-config/save-or-update`, |
| 599 | method: 'post', | 607 | method: 'post', |
| 600 | data | 608 | data |
| 601 | }) | 609 | }) |
| ... | @@ -644,15 +652,46 @@ export const getDbDirFieldPageList = (data) => request({ | ... | @@ -644,15 +652,46 @@ export const getDbDirFieldPageList = (data) => request({ |
| 644 | data | 652 | data |
| 645 | }) | 653 | }) |
| 646 | 654 | ||
| 655 | /** | ||
| 656 | * 数据库目录-表联动查询 | ||
| 657 | * @param data | ||
| 658 | * @returns | ||
| 659 | * @path /db-dir/table/select-list | ||
| 660 | */ | ||
| 661 | export const getDbDirTableSelectList = (data) => request({ | ||
| 662 | url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/table/select-list`, | ||
| 663 | method: 'post', | ||
| 664 | data | ||
| 665 | }) | ||
| 666 | |||
| 647 | 667 | ||
| 648 | 668 | ||
| 649 | /** 获取已有字段信息 */ | 669 | /** 获取已有字段信息 */ |
| 650 | export const getDsTableStructure= (data) => request({ | 670 | export const getDsTableStructure= (data) => request({ |
| 651 | url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/field/list-by-table-guid`, | 671 | url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/field/list-by-table-guid?tableGuid=${data.tableGuid}&execGuid=${data.execGuid}`, |
| 672 | method: 'post', | ||
| 673 | }); | ||
| 674 | |||
| 675 | /** 获取已有数据库目录字段信息 入参是数组 */ | ||
| 676 | export const getDsTableStructures= (data) => request({ | ||
| 677 | url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/field/list-by-table-guids`, | ||
| 652 | method: 'post', | 678 | method: 'post', |
| 653 | data | 679 | data |
| 654 | }); | 680 | }); |
| 655 | 681 | ||
| 682 | /** | ||
| 683 | * 数据库目录-字段查询分类分级 | ||
| 684 | * @param {Object} | ||
| 685 | * @path /db-dir/field/get-classify-and-grade | ||
| 686 | */ | ||
| 687 | export const getDbDirFieldClassifyAndGrade = (data) => request({ | ||
| 688 | url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/field/get-classify-and-grade`, | ||
| 689 | method: 'post', | ||
| 690 | data | ||
| 691 | }) | ||
| 692 | |||
| 693 | |||
| 694 | |||
| 656 | /** 根据选择的连接池获取表列表 */ | 695 | /** 根据选择的连接池获取表列表 */ |
| 657 | export const getDsTableByDs = (params) => request({ | 696 | export const getDsTableByDs = (params) => request({ |
| 658 | url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/table/list-by-datasource-guid`, | 697 | url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/table/list-by-datasource-guid`, | ... | ... |
src/api/modules/obsSerivice.ts
0 → 100644
| 1 | import request from "@/utils/request"; | ||
| 2 | //获取下载签名 | ||
| 3 | export const getDownFileSignByUrl = (params) => { | ||
| 4 | return request({ | ||
| 5 | url: `${ | ||
| 6 | import.meta.env.VITE_APP_COMMON_URL | ||
| 7 | }/obs/generate-download-file-signature?fileName=${params.fileName}`, | ||
| 8 | method: "get", | ||
| 9 | }); | ||
| 10 | }; | ||
| 11 | //obs下载 | ||
| 12 | export const obsDownloadRequest = (params) => { | ||
| 13 | return request({ | ||
| 14 | withCredentials: false, | ||
| 15 | headers: params.actualSignedRequestHeaders | ||
| 16 | ? { | ||
| 17 | "Content-Type": params.actualSignedRequestHeaders["Content-Type"], | ||
| 18 | } | ||
| 19 | : {}, | ||
| 20 | validateStatus: function (status) { | ||
| 21 | return status >= 200; | ||
| 22 | }, | ||
| 23 | url: params.signedUrl, | ||
| 24 | responseType: "blob", | ||
| 25 | maxRedirects: 0, | ||
| 26 | data: { unused: 0 }, | ||
| 27 | method: "get", | ||
| 28 | }); | ||
| 29 | }; | ||
| 30 | //获取上传签名 | ||
| 31 | export const getUpFileSignByUrl = (params) => { | ||
| 32 | return request({ | ||
| 33 | url: `${ | ||
| 34 | import.meta.env.VITE_APP_COMMON_URL | ||
| 35 | }/obs/generate-file-signature?fileName=${params.fileName}`, | ||
| 36 | method: "get", | ||
| 37 | }); | ||
| 38 | }; | ||
| 39 | //obs上传 | ||
| 40 | export const obsUploadRequest = (params) => { | ||
| 41 | return request({ | ||
| 42 | withCredentials: false, | ||
| 43 | headers: params.actualSignedRequestHeaders ? { | ||
| 44 | "Content-Type": params.actualSignedRequestHeaders[ | ||
| 45 | "Content-Type" | ||
| 46 | ] | ||
| 47 | } : {}, | ||
| 48 | validateStatus: function (status) { | ||
| 49 | return status >= 200; | ||
| 50 | }, | ||
| 51 | |||
| 52 | url: params.signedUrl, | ||
| 53 | method: "put", | ||
| 54 | data: params.file, | ||
| 55 | }); | ||
| 56 | }; | ||
| 57 | export const getImageContent = (params) => request({ | ||
| 58 | url: `${import.meta.env.VITE_APP_COMMON_URL}/obs/view-pic?filePath=${params.split("?")[0]}`, | ||
| 59 | method: 'get', | ||
| 60 | responseType: 'blob' | ||
| 61 | }); |
| ... | @@ -24,7 +24,8 @@ const props = defineProps({ | ... | @@ -24,7 +24,8 @@ const props = defineProps({ |
| 24 | 24 | ||
| 25 | const emits = defineEmits(["expand"]); | 25 | const emits = defineEmits(["expand"]); |
| 26 | 26 | ||
| 27 | const isExpanded = ref(true); | 27 | // const isExpanded = ref(true); |
| 28 | const isExpanded = ref(props.isExpand); | ||
| 28 | 29 | ||
| 29 | watch( | 30 | watch( |
| 30 | () => props.isExpand, | 31 | () => props.isExpand, |
| ... | @@ -46,14 +47,10 @@ const expandSwicthHandler = () => { | ... | @@ -46,14 +47,10 @@ const expandSwicthHandler = () => { |
| 46 | </script> | 47 | </script> |
| 47 | 48 | ||
| 48 | <template> | 49 | <template> |
| 49 | <ElCard | 50 | <ElCard class="v-content-wrap" shadow="never" :body-style="{ |
| 50 | class="v-content-wrap" | ||
| 51 | shadow="never" | ||
| 52 | :body-style="{ | ||
| 53 | padding: `0px`, | 51 | padding: `0px`, |
| 54 | height: `${isExpanded ? contentHeight + 28 : 0}px`, | 52 | height: `${isExpanded ? contentHeight + 28 : 0}px`, |
| 55 | }" | 53 | }"> |
| 56 | > | ||
| 57 | <template v-if="title" #header> | 54 | <template v-if="title" #header> |
| 58 | <div class="card-title" @click="expandSwicthHandler"> | 55 | <div class="card-title" @click="expandSwicthHandler"> |
| 59 | <span v-if="expandSwicth" style="padding-right: 5px; cursor: pointer"> | 56 | <span v-if="expandSwicth" style="padding-right: 5px; cursor: pointer"> | ... | ... |
| ... | @@ -19,10 +19,15 @@ import Schedule from "../Schedule/index.vue"; | ... | @@ -19,10 +19,15 @@ import Schedule from "../Schedule/index.vue"; |
| 19 | import { setFormFields, setItemsDisabled, getDownloadUrl, download } from '@/utils/common'; | 19 | import { setFormFields, setItemsDisabled, getDownloadUrl, download } from '@/utils/common'; |
| 20 | import { ElMessage, ElMessageBox } from 'element-plus'; | 20 | import { ElMessage, ElMessageBox } from 'element-plus'; |
| 21 | import useUserStore from "@/store/modules/user"; | 21 | import useUserStore from "@/store/modules/user"; |
| 22 | // import { | ||
| 23 | // getFileUrl, | ||
| 24 | // getImageContent | ||
| 25 | // } from '@/api/modules/queryService'; | ||
| 22 | import { | 26 | import { |
| 23 | getFileUrl, | 27 | getImageContent, |
| 24 | getImageContent | 28 | getUpFileSignByUrl, |
| 25 | } from '@/api/modules/queryService'; | 29 | obsUploadRequest |
| 30 | } from "@/api/modules/obsSerivice"; | ||
| 26 | import { Editor, EditorExpose } from '@/components/Editor' | 31 | import { Editor, EditorExpose } from '@/components/Editor' |
| 27 | 32 | ||
| 28 | const userStore = useUserStore() | 33 | const userStore = useUserStore() |
| ... | @@ -444,15 +449,20 @@ const uploadFile = (file, item) => { | ... | @@ -444,15 +449,20 @@ const uploadFile = (file, item) => { |
| 444 | return Promise.resolve(); | 449 | return Promise.resolve(); |
| 445 | } | 450 | } |
| 446 | ruleFormRef.value?.clearValidate([item.field]); | 451 | ruleFormRef.value?.clearValidate([item.field]); |
| 447 | let formData = new FormData(); | 452 | // let formData = new FormData(); |
| 448 | formData.append('file', file.file); | 453 | // formData.append('file', file.file); |
| 449 | formData.append('fileName', file.file.name); | 454 | // formData.append('fileName', file.file.name); |
| 450 | return getFileUrl(formData) | 455 | return getUpFileSignByUrl({ fileName: file.file.name }) |
| 451 | .then((res: any) => { | 456 | .then((res: any) => { |
| 457 | obsUploadRequest({ | ||
| 458 | signedUrl: res.data.signedUrl, | ||
| 459 | file: file.file, | ||
| 460 | actualsignedRequestHeaders: res.data.actualsignedRequestHeaders | ||
| 461 | }).then(() => { | ||
| 452 | if (res.code == '00000') { | 462 | if (res.code == '00000') { |
| 453 | let fileItem = { | 463 | let fileItem = { |
| 454 | name: file.file.name, | 464 | name: file.file.name, |
| 455 | url: res.data, | 465 | url: res.data.signedUrl, |
| 456 | file: file.file | 466 | file: file.file |
| 457 | }; | 467 | }; |
| 458 | if (item.limit === 1) { | 468 | if (item.limit === 1) { |
| ... | @@ -468,6 +478,7 @@ const uploadFile = (file, item) => { | ... | @@ -468,6 +478,7 @@ const uploadFile = (file, item) => { |
| 468 | ElMessage.error('上传失败,请重新上传!'); | 478 | ElMessage.error('上传失败,请重新上传!'); |
| 469 | } | 479 | } |
| 470 | }) | 480 | }) |
| 481 | }) | ||
| 471 | .catch(() => { | 482 | .catch(() => { |
| 472 | uploadRef.value['ref' + item.field].handleRemove(file); | 483 | uploadRef.value['ref' + item.field].handleRemove(file); |
| 473 | ElMessage.error('上传失败,请重新上传'); | 484 | ElMessage.error('上传失败,请重新上传'); | ... | ... |
| ... | @@ -99,8 +99,9 @@ onMounted(() => { | ... | @@ -99,8 +99,9 @@ onMounted(() => { |
| 99 | <el-form-item v-if="item.visible ?? true" :key="'item_' + index" | 99 | <el-form-item v-if="item.visible ?? true" :key="'item_' + index" |
| 100 | :class="{ 'width_auto': item.type == 'radio-button' }" :prop="item.field"> | 100 | :class="{ 'width_auto': item.type == 'radio-button' }" :prop="item.field"> |
| 101 | <template v-if="item.type == 'select'"> | 101 | <template v-if="item.type == 'select'"> |
| 102 | <el-select :class="{ 'is-multiple': item.multiple }" v-model="formInline[item.field]" | 102 | <el-select collapse-tags collapse-tags-tooltip :class="{ 'is-multiple': item.multiple }" |
| 103 | :placeholder="item.placeholder" :clearable="item.clearable" :filterable="item.filterable" | 103 | v-model="formInline[item.field]" :placeholder="item.placeholder" :clearable="item.clearable" |
| 104 | :filterable="item.filterable" :multiple="item.multiple" :max-collapse-tags="3" | ||
| 104 | :disabled="item.disabled ?? false" @change="(val) => selectChange(val, item)"> | 105 | :disabled="item.disabled ?? false" @change="(val) => selectChange(val, item)"> |
| 105 | <el-option v-for="opt in item.options" :label="item.props?.label ? opt[item.props.label] : opt.label" | 106 | <el-option v-for="opt in item.options" :label="item.props?.label ? opt[item.props.label] : opt.label" |
| 106 | :value="item.props?.value ? opt[item.props.value] : opt.value" /> | 107 | :value="item.props?.value ? opt[item.props.value] : opt.value" /> | ... | ... |
| ... | @@ -206,7 +206,7 @@ export const getDbDirTreeList = { | ... | @@ -206,7 +206,7 @@ export const getDbDirTreeList = { |
| 206 | return { | 206 | return { |
| 207 | code: '00000', | 207 | code: '00000', |
| 208 | message: '成功', | 208 | message: '成功', |
| 209 | 'data|10-30': [{ | 209 | 'data|10-30': { |
| 210 | cgDirName: '@cword(3, 5)', | 210 | cgDirName: '@cword(3, 5)', |
| 211 | 'children|1-3': [{ | 211 | 'children|1-3': [{ |
| 212 | databaseGuid: '@guid', | 212 | databaseGuid: '@guid', |
| ... | @@ -218,7 +218,7 @@ export const getDbDirTreeList = { | ... | @@ -218,7 +218,7 @@ export const getDbDirTreeList = { |
| 218 | tableChName: '@cword(3, 5)' | 218 | tableChName: '@cword(3, 5)' |
| 219 | }] | 219 | }] |
| 220 | }] | 220 | }] |
| 221 | }] | 221 | } |
| 222 | } | 222 | } |
| 223 | } | 223 | } |
| 224 | } | 224 | } |
| ... | @@ -616,8 +616,221 @@ export const createTableSql = { | ... | @@ -616,8 +616,221 @@ export const createTableSql = { |
| 616 | } | 616 | } |
| 617 | } | 617 | } |
| 618 | 618 | ||
| 619 | /** 获取已有数据库目录字段信息 入参是数组 | ||
| 620 | export const getDsTableStructures= (data) => request({ | ||
| 621 | url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/field/list-by-table-guids`, | ||
| 622 | method: 'post', | ||
| 623 | data | ||
| 624 | }); | ||
| 625 | * "data": [ | ||
| 626 | { | ||
| 627 | "guid": "string", | ||
| 628 | "sourceTableName": "string", | ||
| 629 | "sourceDatabase": "string", | ||
| 630 | "sourceFieldName": "string", | ||
| 631 | "sourceFieldChName": "string", | ||
| 632 | "fieldGuid": "string", | ||
| 633 | "fieldName": "string", | ||
| 634 | "fieldChName": "string", | ||
| 635 | "fieldType": "string", | ||
| 636 | "fieldLength": 0, | ||
| 637 | "fieldPrecision": 0, | ||
| 638 | "dimGuid": "string", | ||
| 639 | "dictionaryGuid": "string", | ||
| 640 | "sortValue": 0, | ||
| 641 | "isPrimary": "string", | ||
| 642 | "isFk": "string", | ||
| 643 | "isNotNull": "string", | ||
| 644 | "classifyDetailGuid": "string", | ||
| 645 | "classifyDetailName": "string", | ||
| 646 | "gradeDetailGuid": "string", | ||
| 647 | "gradeDetailName": "string" | ||
| 648 | } | ||
| 649 | ], | ||
| 650 | */ | ||
| 651 | |||
| 652 | // 模拟 getDsTableStructures 接口 | ||
| 653 | export const getDsTableStructures = { | ||
| 654 | url: '/mock/db-dir/field/list-by-table-guids', | ||
| 655 | method: 'post', | ||
| 656 | response: ({ body }: { body: any }) => { | ||
| 657 | return { | ||
| 658 | code: '00000', | ||
| 659 | message: '成功', | ||
| 660 | 'data|2-5': [ | ||
| 661 | { | ||
| 662 | guid: '@guid', | ||
| 663 | sourceTableName: '@cword(3, 5)', | ||
| 664 | sourceDatabase: '@cword(3, 5)', | ||
| 665 | sourceFieldName: '@cword(3, 5)', | ||
| 666 | sourceFieldChName: '@cword(3, 5)', | ||
| 667 | fieldGuid: '@guid', | ||
| 668 | fieldName: '@cword(3, 5)', | ||
| 669 | fieldChName: '@cword(3, 5)', | ||
| 670 | fieldType: '@cword(3, 5)', | ||
| 671 | fieldLength: '@integer(1, 100)', | ||
| 672 | fieldPrecision: '@integer(1, 100)', | ||
| 673 | dimGuid: '@guid', | ||
| 674 | dictionaryGuid: '@guid', | ||
| 675 | sortValue: '@integer(1, 100)', | ||
| 676 | isPrimary: 'Y', | ||
| 677 | isFk: 'Y', | ||
| 678 | isNotNull: 'Y', | ||
| 679 | classifyDetailGuid: () => { | ||
| 680 | return Math.floor(Math.random() * 2) + 3; // 随机生成 3 或 4 | ||
| 681 | }, | ||
| 682 | classifyDetailName: '@cword(3, 5)', | ||
| 683 | gradeDetailGuid: '@guid', | ||
| 684 | gradeDetailName: '@cword(3, 5)' | ||
| 685 | } | ||
| 686 | ] | ||
| 687 | }; | ||
| 688 | } | ||
| 689 | }; | ||
| 690 | |||
| 691 | // 模拟 getGradeDetails 接口 | ||
| 692 | export const getGradeDetails = { | ||
| 693 | url: '/mock/grade-details', | ||
| 694 | method: 'post', | ||
| 695 | response: ({ body }: { body: any }) => { | ||
| 696 | return { | ||
| 697 | code: '00000', | ||
| 698 | message: '成功', | ||
| 699 | data: [{ | ||
| 700 | |||
| 701 | }] | ||
| 702 | }; | ||
| 703 | } | ||
| 704 | }; | ||
| 705 | |||
| 706 | let currentGuid = 2; | ||
| 707 | // 模拟 getTaskExeTreeList 接口 | ||
| 708 | export const getTaskExeTreeList = { | ||
| 709 | url: '/mock/cg-task-exec/classify/tree-list', | ||
| 710 | method: 'get', | ||
| 711 | response: ({ body }: { body: any }) => { | ||
| 712 | return { | ||
| 713 | code: '00000', | ||
| 714 | message: '成功', | ||
| 715 | data: [{ | ||
| 716 | "guid": 1, | ||
| 717 | "classifyName": "听参我完", | ||
| 718 | "parentGuid": 1, | ||
| 719 | "gradeGuid":1, | ||
| 720 | "parentGuids": [ | ||
| 721 | "39Ec3B98-EA2F-f5FF-Fc3b-EfAfe1fce91C", | ||
| 722 | "14be757b-8f0e-3DB9-5AaE-8cfeC18B2322" | ||
| 723 | ], | ||
| 724 | "children": [ | ||
| 725 | { | ||
| 726 | "classifyName": "素新议白", | ||
| 727 | "parentGuid": 4, | ||
| 728 | "gradeGuid":2, | ||
| 729 | "parentGuids": [ | ||
| 730 | "de6A2ED4-Dc2f-DBf2-4d14-ceD8fd5BBa7C" | ||
| 731 | ], | ||
| 732 | "children": [ | ||
| 733 | { | ||
| 734 | "classifyName": "置表京革", | ||
| 735 | "parentGuid": 5, | ||
| 736 | "gradeGuid":3, | ||
| 737 | "parentGuids": [ | ||
| 738 | "E2FAe9b2-3bc3-B6f7-f99a-964C6ae9dFCE", | ||
| 739 | "18EA10f2-7f1a-4ADA-cEba-d1dF44ED74cB" | ||
| 740 | ], | ||
| 741 | "guid": 3 | ||
| 742 | } | ||
| 743 | ], | ||
| 744 | "guid": 10 | ||
| 745 | } | ||
| 746 | ], | ||
| 747 | }, | ||
| 748 | { | ||
| 749 | "guid": 7, | ||
| 750 | "classifyName": "大头儿子", | ||
| 751 | "parentGuid": 1, | ||
| 752 | "gradeGuid":4, | ||
| 753 | "parentGuids": [ | ||
| 754 | "39Ec3B98-EA2F-f5FF-Fc3b-EfAfe1fce91C", | ||
| 755 | "14be757b-8f0e-3DB9-5AaE-8cfeC18B2322" | ||
| 756 | ], | ||
| 757 | "children": [ | ||
| 758 | { | ||
| 759 | "classifyName": "小头把把", | ||
| 760 | "parentGuid": 4, | ||
| 761 | "gradeGuid":5, | ||
| 762 | "parentGuids": [ | ||
| 763 | "de6A2ED4-Dc2f-DBf2-4d14-ceD8fd5BBa7C" | ||
| 764 | ], | ||
| 765 | "children": [ | ||
| 766 | { | ||
| 767 | "classifyName": "喜羊羊", | ||
| 768 | "parentGuid": 5, | ||
| 769 | "gradeGuid":6, | ||
| 770 | "parentGuids": [ | ||
| 771 | "E2FAe9b2-3bc3-B6f7-f99a-964C6ae9dFCE", | ||
| 772 | "18EA10f2-7f1a-4ADA-cEba-d1dF44ED74cB" | ||
| 773 | ], | ||
| 774 | "guid": 9 | ||
| 775 | } | ||
| 776 | ], | ||
| 777 | "guid": 8 | ||
| 778 | } | ||
| 779 | ], | ||
| 780 | }, | ||
| 781 | ] | ||
| 782 | }; | ||
| 783 | } | ||
| 784 | }; | ||
| 785 | |||
| 786 | // 模拟 getGradeList 分级接口 用于获取分级列表 | ||
| 787 | |||
| 788 | export const getGradeList = { | ||
| 789 | url: '/mock/grade/page-list', | ||
| 790 | method: 'post', | ||
| 791 | response: ({ body }: { body: any }) => { | ||
| 792 | return { | ||
| 793 | code: '00000', | ||
| 794 | message: '成功', | ||
| 795 | data: { | ||
| 796 | records:[{ | ||
| 797 | "guid": '1', | ||
| 798 | "name": "一级", | ||
| 799 | "parentGuid": 0, | ||
| 800 | }, | ||
| 801 | { | ||
| 802 | "guid": '2', | ||
| 803 | "name": "二级", | ||
| 804 | "parentGuid": 1, | ||
| 805 | }, | ||
| 806 | { | ||
| 807 | "guid": '3', | ||
| 808 | "name": "三级", | ||
| 809 | "parentGuid": 2, | ||
| 810 | }, | ||
| 811 | { | ||
| 812 | "guid": '4', | ||
| 813 | "name": "四级", | ||
| 814 | "parentGuid": 3, | ||
| 815 | }, | ||
| 816 | { | ||
| 817 | "guid": '5', | ||
| 818 | "name": "五级", | ||
| 819 | "parentGuid": 4, | ||
| 820 | }, | ||
| 821 | { | ||
| 822 | "guid": '6', | ||
| 823 | "name": "六级", | ||
| 824 | "parentGuid": 5, | ||
| 825 | }, | ||
| 826 | ] | ||
| 827 | }} | ||
| 828 | } | ||
| 829 | }; | ||
| 830 | |||
| 831 | |||
| 619 | export default [getCgDirTreeList,getCgDirFieldPageList, | 832 | export default [getCgDirTreeList,getCgDirFieldPageList, |
| 620 | getDictionary,saveBizRuleConfig, getDbDirTreeList, | 833 | getDictionary,saveBizRuleConfig, getDbDirTreeList, |
| 621 | getDbDirTablePageList,getDbDirDataSourceList,getDsTableByDs, | 834 | getDbDirTablePageList,getDbDirDataSourceList,getDsTableByDs, |
| 622 | getDsTableStructure,getDbDirFieldPageList,getBizRuleConfigDetail, | 835 | getDsTableStructure,getDbDirFieldPageList,getBizRuleConfigDetail, |
| 623 | updateBizRuleConfig,saveDbDirTable,createTableSql,updateDbDirTable] as MockMethod[] | 836 | updateBizRuleConfig,saveDbDirTable,createTableSql,updateDbDirTable,getDsTableStructures,getGradeDetails,getTaskExeTreeList,getGradeList] as MockMethod[] | ... | ... |
| ... | @@ -82,7 +82,7 @@ const routes: RouteRecordRaw[] = [ | ... | @@ -82,7 +82,7 @@ const routes: RouteRecordRaw[] = [ |
| 82 | name: 'templateConfig', | 82 | name: 'templateConfig', |
| 83 | component: () => import('@/views/data_inventory/templateConfig.vue'), | 83 | component: () => import('@/views/data_inventory/templateConfig.vue'), |
| 84 | meta: { | 84 | meta: { |
| 85 | title: '分类分级标准', | 85 | title: '分类分级规则', |
| 86 | breadcrumb: false, | 86 | breadcrumb: false, |
| 87 | cache: true | 87 | cache: true |
| 88 | }, | 88 | }, | ... | ... |
This diff is collapsed.
Click to expand it.
| ... | @@ -6,8 +6,11 @@ | ... | @@ -6,8 +6,11 @@ |
| 6 | 6 | ||
| 7 | import router from "@/router"; | 7 | import router from "@/router"; |
| 8 | import { ref } from "vue"; | 8 | import { ref } from "vue"; |
| 9 | import { saveGrade, getGradeList, deleteGrade, getLargeCategoryList, updateGrade } from '@/api/modules/dataInventory'; | 9 | import { saveGrade, getGradeList, deleteGrade, getLargeCategoryList, updateGrade, updateClassifyGrad } from '@/api/modules/dataInventory'; |
| 10 | 10 | import useUserStore from "@/store/modules/user"; | |
| 11 | const userStore = useUserStore(); | ||
| 12 | const route = useRoute(); | ||
| 13 | const fullPath = route.fullPath; | ||
| 11 | onBeforeMount(() => { | 14 | onBeforeMount(() => { |
| 12 | getGradeListData(); | 15 | getGradeListData(); |
| 13 | getDataGrade(); | 16 | getDataGrade(); |
| ... | @@ -16,7 +19,6 @@ onBeforeMount(() => { | ... | @@ -16,7 +19,6 @@ onBeforeMount(() => { |
| 16 | 19 | ||
| 17 | // 获取分级列表 | 20 | // 获取分级列表 |
| 18 | const getGradeListData = async () => { | 21 | const getGradeListData = async () => { |
| 19 | console.log('调用了吗~~~'); | ||
| 20 | tableInfo.value.loading = true; | 22 | tableInfo.value.loading = true; |
| 21 | const params = { | 23 | const params = { |
| 22 | pageIndex: 1, | 24 | pageIndex: 1, |
| ... | @@ -111,7 +113,8 @@ const tableInfo = ref({ | ... | @@ -111,7 +113,8 @@ const tableInfo = ref({ |
| 111 | id: "data-class-standard-table", | 113 | id: "data-class-standard-table", |
| 112 | multiple: true, | 114 | multiple: true, |
| 113 | fields: [ | 115 | fields: [ |
| 114 | { label: "序号", field: 'orderNum', width: 56, align: "center" }, | 116 | { label: "序号", type: 'index', width: 56, align: "center" }, |
| 117 | // { label: "排序", field: 'orderNum', width: 56, align: "center" }, | ||
| 115 | { | 118 | { |
| 116 | label: "数据级别", field: "dataGrade", width: 120, getName: (scope) => { | 119 | label: "数据级别", field: "dataGrade", width: 120, getName: (scope) => { |
| 117 | let dataGrade = scope.row.dataGrade; | 120 | let dataGrade = scope.row.dataGrade; |
| ... | @@ -124,7 +127,7 @@ const tableInfo = ref({ | ... | @@ -124,7 +127,7 @@ const tableInfo = ref({ |
| 124 | return classDataRef.value.find((item: any) => item.value === dataClassify)?.label; | 127 | return classDataRef.value.find((item: any) => item.value === dataClassify)?.label; |
| 125 | } | 128 | } |
| 126 | }, | 129 | }, |
| 127 | { label: "分级描述", field: "gradeDesc", align: "left", width: 480 }, | 130 | { label: "规则描述", field: "gradeDesc", align: "left" }, |
| 128 | 131 | ||
| 129 | ], | 132 | ], |
| 130 | actionInfo: { | 133 | actionInfo: { |
| ... | @@ -137,7 +140,7 @@ const tableInfo = ref({ | ... | @@ -137,7 +140,7 @@ const tableInfo = ref({ |
| 137 | console.log(scope); | 140 | console.log(scope); |
| 138 | filterDataGradeEdit(scope.row.dataGrade); | 141 | filterDataGradeEdit(scope.row.dataGrade); |
| 139 | newCreateGradeStandardDialogInfo.value.visible = true; | 142 | newCreateGradeStandardDialogInfo.value.visible = true; |
| 140 | newCreateGradeStandardDialogInfo.value.title = '编辑分类'; | 143 | newCreateGradeStandardDialogInfo.value.title = '编辑规则'; |
| 141 | newCreateGradeFormItems.value.forEach(item => { | 144 | newCreateGradeFormItems.value.forEach(item => { |
| 142 | item.default = scope.row[item.field]; | 145 | item.default = scope.row[item.field]; |
| 143 | }) | 146 | }) |
| ... | @@ -228,7 +231,7 @@ const newCreateGradeFormItems = ref([{ | ... | @@ -228,7 +231,7 @@ const newCreateGradeFormItems = ref([{ |
| 228 | visible: true, | 231 | visible: true, |
| 229 | }, | 232 | }, |
| 230 | { | 233 | { |
| 231 | label: '序号', | 234 | label: '排序号', |
| 232 | type: 'input', | 235 | type: 'input', |
| 233 | maxlength: 19, | 236 | maxlength: 19, |
| 234 | placeholder: '请输入', | 237 | placeholder: '请输入', |
| ... | @@ -239,10 +242,10 @@ const newCreateGradeFormItems = ref([{ | ... | @@ -239,10 +242,10 @@ const newCreateGradeFormItems = ref([{ |
| 239 | regexp: /\D/g | 242 | regexp: /\D/g |
| 240 | }, | 243 | }, |
| 241 | { | 244 | { |
| 242 | label: '分级描述', | 245 | label: '规则描述', |
| 243 | type: 'textarea', | 246 | type: 'textarea', |
| 244 | maxlength: 500, | 247 | maxlength: 500, |
| 245 | placeholder: '分类分级的描述说明', | 248 | placeholder: '分级规则的描述说明', |
| 246 | field: 'gradeDesc', | 249 | field: 'gradeDesc', |
| 247 | default: '', | 250 | default: '', |
| 248 | clearable: true, | 251 | clearable: true, |
| ... | @@ -265,7 +268,7 @@ const newCreateGradeFormRules = ref({ | ... | @@ -265,7 +268,7 @@ const newCreateGradeFormRules = ref({ |
| 265 | const newCreateGradeStandardDialogInfo = ref({ | 268 | const newCreateGradeStandardDialogInfo = ref({ |
| 266 | visible: false, | 269 | visible: false, |
| 267 | size: 860, | 270 | size: 860, |
| 268 | title: "添加分类", | 271 | title: "新增规则", |
| 269 | type: "", | 272 | type: "", |
| 270 | formInfo: { | 273 | formInfo: { |
| 271 | id: "grade-form", | 274 | id: "grade-form", |
| ... | @@ -278,9 +281,8 @@ const newCreateGradeStandardDialogInfo = ref({ | ... | @@ -278,9 +281,8 @@ const newCreateGradeStandardDialogInfo = ref({ |
| 278 | newCreateGradeStandardDialogInfo.value.visible = false; | 281 | newCreateGradeStandardDialogInfo.value.visible = false; |
| 279 | }, | 282 | }, |
| 280 | submit: async (btn, info) => { | 283 | submit: async (btn, info) => { |
| 281 | console.log(info, guid); | ||
| 282 | newCreateGradeStandardDialogInfo.value.submitBtnLoading = true; | 284 | newCreateGradeStandardDialogInfo.value.submitBtnLoading = true; |
| 283 | if (newCreateGradeStandardDialogInfo.value.title === '编辑分类') { | 285 | if (newCreateGradeStandardDialogInfo.value.title === '编辑规则') { |
| 284 | const params = { | 286 | const params = { |
| 285 | ...info, | 287 | ...info, |
| 286 | guid: editClassifyGradeGuid.value, | 288 | guid: editClassifyGradeGuid.value, |
| ... | @@ -291,7 +293,7 @@ const newCreateGradeStandardDialogInfo = ref({ | ... | @@ -291,7 +293,7 @@ const newCreateGradeStandardDialogInfo = ref({ |
| 291 | if (res.code == proxy.$passCode) { | 293 | if (res.code == proxy.$passCode) { |
| 292 | proxy.$ElMessage({ | 294 | proxy.$ElMessage({ |
| 293 | type: 'success', | 295 | type: 'success', |
| 294 | message: '修改分类成功' | 296 | message: '编辑规则成功' |
| 295 | }) | 297 | }) |
| 296 | getGradeListData(); | 298 | getGradeListData(); |
| 297 | newCreateGradeStandardDialogInfo.value.submitBtnLoading = false; | 299 | newCreateGradeStandardDialogInfo.value.submitBtnLoading = false; |
| ... | @@ -309,7 +311,7 @@ const newCreateGradeStandardDialogInfo = ref({ | ... | @@ -309,7 +311,7 @@ const newCreateGradeStandardDialogInfo = ref({ |
| 309 | if (res.code == proxy.$passCode) { | 311 | if (res.code == proxy.$passCode) { |
| 310 | proxy.$ElMessage({ | 312 | proxy.$ElMessage({ |
| 311 | type: 'success', | 313 | type: 'success', |
| 312 | message: '新增分类成功' | 314 | message: '新增规则成功' |
| 313 | }) | 315 | }) |
| 314 | getGradeListData(); | 316 | getGradeListData(); |
| 315 | newCreateGradeStandardDialogInfo.value.submitBtnLoading = false; | 317 | newCreateGradeStandardDialogInfo.value.submitBtnLoading = false; |
| ... | @@ -324,23 +326,87 @@ const newCreateGradeStandardDialogInfo = ref({ | ... | @@ -324,23 +326,87 @@ const newCreateGradeStandardDialogInfo = ref({ |
| 324 | 326 | ||
| 325 | const newStandard = () => { | 327 | const newStandard = () => { |
| 326 | filterDataGrade(); | 328 | filterDataGrade(); |
| 329 | newCreateGradeStandardDialogInfo.value.title = '新增规则'; | ||
| 327 | newCreateGradeStandardDialogInfo.value.visible = true; | 330 | newCreateGradeStandardDialogInfo.value.visible = true; |
| 328 | newCreateGradeFormItems.value.forEach(item => item.default = ''); | 331 | newCreateGradeFormItems.value.forEach(item => item.default = ''); |
| 329 | } | 332 | } |
| 330 | 333 | ||
| 334 | const formRef = ref<any>(); | ||
| 335 | |||
| 336 | const classStandardFormItems = ref([{ | ||
| 337 | label: '分级名称', | ||
| 338 | type: 'input', | ||
| 339 | maxlength: 50, | ||
| 340 | placeholder: '请输入', | ||
| 341 | field: 'name', | ||
| 342 | default: router.currentRoute.value.query.classClassifyGradName, | ||
| 343 | block: false, | ||
| 344 | clearable: true, | ||
| 345 | required: true | ||
| 346 | }]); | ||
| 331 | 347 | ||
| 332 | 348 | ||
| 349 | const saveLoading = ref(false); | ||
| 350 | const saveUpdate = async () => { | ||
| 351 | console.log(formRef.value.formInline); | ||
| 352 | if (!formRef.value.formInline.name) { | ||
| 353 | proxy.$ElMessage.error('分级名称不能为空'); | ||
| 354 | return; | ||
| 355 | } | ||
| 356 | |||
| 357 | saveLoading.value = true; | ||
| 358 | const params = { | ||
| 359 | guid: router.currentRoute.value.query.guid, | ||
| 360 | name: formRef.value.formInline.name, | ||
| 361 | type: 'G', | ||
| 362 | } | ||
| 363 | console.log(params); | ||
| 364 | const res: any = await updateClassifyGrad(params); | ||
| 365 | if (res.code == proxy.$passCode) { | ||
| 366 | proxy.$ElMessage.success('修改分级成功'); | ||
| 367 | router.push({ | ||
| 368 | name: 'templateConfig' | ||
| 369 | }); | ||
| 370 | saveLoading.value = false; | ||
| 371 | } else { | ||
| 372 | saveLoading.value = false; | ||
| 373 | proxy.$ElMessage.error(res.msg); | ||
| 374 | } | ||
| 375 | } | ||
| 376 | |||
| 377 | const cancel = () => { | ||
| 378 | proxy.$openMessageBox("当前页面尚未保存,确定放弃修改吗?", () => { | ||
| 379 | userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath)); | ||
| 380 | router.push({ | ||
| 381 | name: 'templateConfig' | ||
| 382 | }); | ||
| 383 | }, () => { | ||
| 384 | proxy.$ElMessage.info("已取消"); | ||
| 385 | }); | ||
| 386 | } | ||
| 387 | |||
| 333 | </script> | 388 | </script> |
| 334 | 389 | ||
| 335 | <template> | 390 | <template> |
| 336 | <div class="container_wrap" v-loading="fullscreenLoading"> | 391 | <div class="container_wrap"> |
| 337 | <div class="content_main"> | 392 | <div class="content_main"> |
| 393 | <ContentWrap id="id-baseInfo" title="基础信息" description="" style="margin-top: 8px;"> | ||
| 394 | <Form ref="formRef" :itemList="classStandardFormItems" formId="main-model-edit" col="col3" /> | ||
| 395 | </ContentWrap> | ||
| 396 | <ContentWrap id="id-grade-info" title="分级规则" class="detail-content" description="" style="margin-top: 8px;"> | ||
| 397 | <div class="content" v-loading="fullscreenLoading"> | ||
| 338 | <div class="table-top-btns"> | 398 | <div class="table-top-btns"> |
| 339 | <el-button type="primary" @click="newStandard">新增标准</el-button> | 399 | <el-button type="primary" @click="newStandard">新增规则</el-button> |
| 340 | <el-button @click="batchRemobe">批量删除</el-button> | 400 | <el-button @click="batchRemobe">批量删除</el-button> |
| 341 | </div> | 401 | </div> |
| 342 | <Table ref="tableRef" :tableInfo="tableInfo" @tableSelectionChange="onTableSelectChange" /> | 402 | <Table ref="tableRef" :tableInfo="tableInfo" @tableSelectionChange="onTableSelectChange" /> |
| 343 | </div> | 403 | </div> |
| 404 | </ContentWrap> | ||
| 405 | </div> | ||
| 406 | <div class="bottom_tool_wrap"> | ||
| 407 | <el-button @click="cancel">取消</el-button> | ||
| 408 | <el-button type="primary" @click="saveUpdate" :loading="saveLoading">保存修改</el-button> | ||
| 409 | </div> | ||
| 344 | <Dialog_form :dialogConfigInfo="newCreateGradeStandardDialogInfo" /> | 410 | <Dialog_form :dialogConfigInfo="newCreateGradeStandardDialogInfo" /> |
| 345 | </div> | 411 | </div> |
| 346 | </template> | 412 | </template> |
| ... | @@ -351,11 +417,49 @@ const newStandard = () => { | ... | @@ -351,11 +417,49 @@ const newStandard = () => { |
| 351 | 417 | ||
| 352 | .content_main { | 418 | .content_main { |
| 353 | height: calc(100% - 44px); | 419 | height: calc(100% - 44px); |
| 354 | padding: 17px 16px 10px 16px; | 420 | padding: 10px 16px; |
| 421 | overflow: auto; | ||
| 355 | 422 | ||
| 356 | .table-top-btns { | 423 | .table-top-btns { |
| 357 | display: flex; | ||
| 358 | margin-bottom: 12px; | 424 | margin-bottom: 12px; |
| 359 | } | 425 | } |
| 360 | } | 426 | } |
| 427 | |||
| 428 | .bottom_tool_wrap { | ||
| 429 | height: 44px; | ||
| 430 | padding: 0 16px; | ||
| 431 | border-top: 1px solid #d9d9d9; | ||
| 432 | display: flex; | ||
| 433 | justify-content: center; | ||
| 434 | align-items: center; | ||
| 435 | } | ||
| 436 | |||
| 437 | :deep(.detail-content) { | ||
| 438 | |||
| 439 | .el-card__body { | ||
| 440 | height: calc(100% - 50px) !important; | ||
| 441 | |||
| 442 | .card-body-content { | ||
| 443 | height: 100%; | ||
| 444 | } | ||
| 445 | } | ||
| 446 | } | ||
| 447 | |||
| 448 | .tools_btns { | ||
| 449 | position: relative; | ||
| 450 | margin-bottom: 16px; | ||
| 451 | |||
| 452 | .show-change-btn { | ||
| 453 | position: absolute; | ||
| 454 | right: 0px; | ||
| 455 | } | ||
| 456 | } | ||
| 457 | |||
| 458 | .shape-main { | ||
| 459 | height: calc(100% - 40px); | ||
| 460 | } | ||
| 461 | |||
| 462 | .table_panel { | ||
| 463 | height: calc(100% - 40px) !important; | ||
| 464 | } | ||
| 361 | </style> | 465 | </style> | ... | ... |
This diff is collapsed.
Click to expand it.
| ... | @@ -6,7 +6,6 @@ | ... | @@ -6,7 +6,6 @@ |
| 6 | import { ref } from "vue"; | 6 | import { ref } from "vue"; |
| 7 | import router from "@/router"; | 7 | import router from "@/router"; |
| 8 | import { getBizRuleConfigDetail, updateBizRuleConfig } from '@/api/modules/dataInventory' | 8 | import { getBizRuleConfigDetail, updateBizRuleConfig } from '@/api/modules/dataInventory' |
| 9 | |||
| 10 | const { proxy } = getCurrentInstance() as any; | 9 | const { proxy } = getCurrentInstance() as any; |
| 11 | const bizRuleConfigData = ref<any>() | 10 | const bizRuleConfigData = ref<any>() |
| 12 | const getBizRuleConfigDetailData = async () => { | 11 | const getBizRuleConfigDetailData = async () => { |
| ... | @@ -105,9 +104,25 @@ const moveDown = () => { | ... | @@ -105,9 +104,25 @@ const moveDown = () => { |
| 105 | // 编辑行 | 104 | // 编辑行 |
| 106 | const editRow = (row) => { | 105 | const editRow = (row) => { |
| 107 | if (!row.isEdit) { | 106 | if (!row.isEdit) { |
| 107 | // 编辑fieldLengthCondition | ||
| 108 | if (row.fieldLengthCondition) { | ||
| 108 | const [symbol, value] = row.fieldLengthCondition.split('#'); | 109 | const [symbol, value] = row.fieldLengthCondition.split('#'); |
| 109 | row.lengthSymbol = symbol; // 初始化符号部分 | 110 | row.lengthSymbol = symbol; // 初始化符号部分 |
| 110 | row.lengthValue = value; // 初始化数值部分 | 111 | row.lengthValue = value; // 初始化数值部分 |
| 112 | } else { | ||
| 113 | row.lengthSymbol = ''; // 默认值 | ||
| 114 | row.lengthValue = ''; // 默认值 | ||
| 115 | } | ||
| 116 | //编辑fieldValueRange | ||
| 117 | if (row.fieldValueRange) { | ||
| 118 | const [start, end] = row.fieldValueRange.split('-'); | ||
| 119 | row.rangeStart = start; // 初始化符号部分 | ||
| 120 | row.rangeEnd = end; // 初始化数值部分 | ||
| 121 | } else { | ||
| 122 | row.rangeStart = ''; // 默认值 | ||
| 123 | row.rangeEnd = ''; // 默认值 | ||
| 124 | } | ||
| 125 | |||
| 111 | row.isEdit = true; // 进入编辑模式 | 126 | row.isEdit = true; // 进入编辑模式 |
| 112 | } | 127 | } |
| 113 | }; | 128 | }; |
| ... | @@ -115,6 +130,7 @@ const editRow = (row) => { | ... | @@ -115,6 +130,7 @@ const editRow = (row) => { |
| 115 | // 保存数据 | 130 | // 保存数据 |
| 116 | const saveRow = (row) => { | 131 | const saveRow = (row) => { |
| 117 | row.fieldLengthCondition = `${row.lengthSymbol}#${row.lengthValue}`; | 132 | row.fieldLengthCondition = `${row.lengthSymbol}#${row.lengthValue}`; |
| 133 | row.fieldValueRange = [row.rangeStart || '', row.rangeEnd || '']; | ||
| 118 | row.isEdit = false | 134 | row.isEdit = false |
| 119 | } | 135 | } |
| 120 | 136 | ||
| ... | @@ -213,19 +229,23 @@ const saveData = async () => { | ... | @@ -213,19 +229,23 @@ const saveData = async () => { |
| 213 | "isNotNull": "string", | 229 | "isNotNull": "string", |
| 214 | "fieldValueRange": "string" | 230 | "fieldValueRange": "string" |
| 215 | */ | 231 | */ |
| 216 | const params = tableData.value.map((item: any) => { | 232 | const inParams = [] as any |
| 217 | return { | 233 | tableData.value.forEach((item: any) => { |
| 218 | guid: item.guid, | 234 | const obj = { |
| 235 | guid: router.currentRoute.value.query.tableGuid, | ||
| 219 | fieldGuid: item.fieldGuid, | 236 | fieldGuid: item.fieldGuid, |
| 220 | fieldLengthCondition: item.fieldLengthCondition, | 237 | fieldLengthCondition: item.fieldLengthCondition, |
| 221 | fieldPrecision: item.fieldPrecision, | 238 | fieldPrecision: item.fieldPrecision, |
| 222 | dictionaryGuid: item.dictionaryGuid, | 239 | dictionaryGuid: item.dictionaryGuid, |
| 223 | isUnique: item.isUnique, | 240 | isUnique: item.isUnique, |
| 224 | isNotNull: item.isNotNull, | 241 | isNotNull: item.isRequired, |
| 225 | fieldValueRange: item.fieldValueRange | 242 | fieldValueRange: item.fieldValueRange |
| 226 | } | 243 | } |
| 244 | inParams.push(obj) | ||
| 227 | }) | 245 | }) |
| 228 | const res: any = await updateBizRuleConfig(params) | 246 | |
| 247 | console.log('finalParams', inParams) | ||
| 248 | const res: any = await updateBizRuleConfig(inParams) | ||
| 229 | if (res.code === proxy.$passCode) { | 249 | if (res.code === proxy.$passCode) { |
| 230 | proxy.$message.success('修改配置规则成功!') | 250 | proxy.$message.success('修改配置规则成功!') |
| 231 | router.back() | 251 | router.back() |
| ... | @@ -270,29 +290,29 @@ const cancel = () => { | ... | @@ -270,29 +290,29 @@ const cancel = () => { |
| 270 | <!-- 排序列(不可编辑) --> | 290 | <!-- 排序列(不可编辑) --> |
| 271 | <el-table-column type="index" label="排序" width="80" align="center" /> | 291 | <el-table-column type="index" label="排序" width="80" align="center" /> |
| 272 | <!-- 字段中文名(不可编辑)fieldChName --> | 292 | <!-- 字段中文名(不可编辑)fieldChName --> |
| 273 | <el-table-column prop="fieldName" label="字段中文名" width="120"> | 293 | <el-table-column prop="fieldChName" label="字段中文名" width="120"> |
| 274 | <template #default="scope"> | 294 | <template #default="scope"> |
| 275 | {{ scope.row.fieldName ? scope.row.fieldName : '--' }} | 295 | {{ scope.row.fieldChName ? scope.row.fieldChName : '--' }} |
| 276 | </template> | 296 | </template> |
| 277 | </el-table-column> | 297 | </el-table-column> |
| 278 | <!-- 字段英文名(不可编辑) --> | 298 | <!-- 字段英文名(不可编辑) --> |
| 279 | <el-table-column prop="fieldEnglish" label="字段英文名" width="120"> | 299 | <el-table-column prop="fieldName" label="字段英文名" width="120"> |
| 280 | <template #default="scope"> | 300 | <template #default="scope"> |
| 281 | {{ scope.row.fieldEnglish ? scope.row.fieldEnglish : '--' }} | 301 | {{ scope.row.fieldName ? scope.row.fieldName : '--' }} |
| 282 | </template> | 302 | </template> |
| 283 | </el-table-column> | 303 | </el-table-column> |
| 284 | <!-- 分类(不可编辑)classifyName --> | 304 | <!-- 分类(不可编辑)classifyName --> |
| 285 | <el-table-column prop="fieldEnglish" label="分类" width="120"> | 305 | <!-- <el-table-column prop="fieldEnglish" label="分类" width="120"> |
| 286 | <template #default="scope"> | 306 | <template #default="scope"> |
| 287 | {{ scope.row.fieldEnglish ? scope.row.fieldEnglish : '--' }} | 307 | {{ scope.row.fieldEnglish ? scope.row.fieldEnglish : '--' }} |
| 288 | </template> | 308 | </template> |
| 289 | </el-table-column> | 309 | </el-table-column> --> |
| 290 | <!-- 分级(不可编辑) --> | 310 | <!-- 分级(不可编辑) --> |
| 291 | <el-table-column prop="gradeDetailName" label="分级" width="120" align="center"> | 311 | <!-- <el-table-column prop="gradeDetailName" label="分级" width="120" align="center"> |
| 292 | <template #default="scope"> | 312 | <template #default="scope"> |
| 293 | {{ scope.row.gradeDetailName ? scope.row.gradeDetailName : '--' }} | 313 | {{ scope.row.gradeDetailName ? scope.row.gradeDetailName : '--' }} |
| 294 | </template> | 314 | </template> |
| 295 | </el-table-column> | 315 | </el-table-column> --> |
| 296 | <!-- 字段类型fieldType (不可编辑) --> | 316 | <!-- 字段类型fieldType (不可编辑) --> |
| 297 | <el-table-column prop="fieldType" label="字段类型" width="150" align="center"> | 317 | <el-table-column prop="fieldType" label="字段类型" width="150" align="center"> |
| 298 | <template #default="scope"> | 318 | <template #default="scope"> |
| ... | @@ -367,11 +387,20 @@ const cancel = () => { | ... | @@ -367,11 +387,20 @@ const cancel = () => { |
| 367 | </el-select> | 387 | </el-select> |
| 368 | </template> | 388 | </template> |
| 369 | </el-table-column> | 389 | </el-table-column> |
| 390 | |||
| 370 | <!-- 字段取值范围 fieldValueRange(可编辑)--> | 391 | <!-- 字段取值范围 fieldValueRange(可编辑)--> |
| 371 | <el-table-column prop="fieldValueRange" label="字段取值范围" width="150" align="center"> | 392 | <el-table-column prop="fieldValueRange" label="字段取值范围" width="260" align="center"> |
| 372 | <template #default="scope"> | 393 | <template #default="scope"> |
| 373 | <span v-if="!scope.row.isEdit">{{ scope.row.fieldValueRange ? scope.row.fieldValueRange : '--' }}</span> | 394 | <!-- 非编辑模式,展示取值范围 --> |
| 374 | <el-input v-else v-model="scope.row.fieldValueRange" placeholder="请输入字段取值范围" /> | 395 | <span v-if="!scope.row.isEdit"> |
| 396 | {{ scope.row.fieldValueRange ? scope.row.fieldValueRange.join('-') : '--' }} | ||
| 397 | </span> | ||
| 398 | <!-- 编辑模式,显示两个输入框 --> | ||
| 399 | <div v-else style="display: flex; gap: 5px; align-items: center;"> | ||
| 400 | <el-input v-model="scope.row.rangeStart" placeholder="最小值" style="width: 45%;" type="number" /> | ||
| 401 | <span>-</span> | ||
| 402 | <el-input v-model="scope.row.rangeEnd" placeholder="最大值" style="width: 45%;" type="number" /> | ||
| 403 | </div> | ||
| 375 | </template> | 404 | </template> |
| 376 | </el-table-column> | 405 | </el-table-column> |
| 377 | 406 | ... | ... |
| ... | @@ -9,6 +9,7 @@ import { getLabelList, getClassifyGradeTreeList, saveLabel, getLabelPageList, de | ... | @@ -9,6 +9,7 @@ import { getLabelList, getClassifyGradeTreeList, saveLabel, getLabelPageList, de |
| 9 | import { CirclePlus, Delete } from "@element-plus/icons-vue"; | 9 | import { CirclePlus, Delete } from "@element-plus/icons-vue"; |
| 10 | 10 | ||
| 11 | 11 | ||
| 12 | |||
| 12 | const { proxy } = getCurrentInstance() as any; | 13 | const { proxy } = getCurrentInstance() as any; |
| 13 | const dialogLabelFormRef = ref(); | 14 | const dialogLabelFormRef = ref(); |
| 14 | 15 | ||
| ... | @@ -74,6 +75,7 @@ const transformDataForTree = (data: any[]) => { | ... | @@ -74,6 +75,7 @@ const transformDataForTree = (data: any[]) => { |
| 74 | const labelPageList = ref<any>() | 75 | const labelPageList = ref<any>() |
| 75 | 76 | ||
| 76 | const getLabelPageData = async () => { | 77 | const getLabelPageData = async () => { |
| 78 | refCount.value++; | ||
| 77 | tableInfo.value.loading = true; | 79 | tableInfo.value.loading = true; |
| 78 | const params = { | 80 | const params = { |
| 79 | pageIndex: page.value.curr, | 81 | pageIndex: page.value.curr, |
| ... | @@ -111,7 +113,7 @@ const getLabelListData = async () => { | ... | @@ -111,7 +113,7 @@ const getLabelListData = async () => { |
| 111 | } | 113 | } |
| 112 | } | 114 | } |
| 113 | 115 | ||
| 114 | onMounted(async () => { | 116 | onBeforeMount(async () => { |
| 115 | await getClassifyGradeTree(); | 117 | await getClassifyGradeTree(); |
| 116 | await getLabelPageData(); | 118 | await getLabelPageData(); |
| 117 | await getLabelListData(); | 119 | await getLabelListData(); |
| ... | @@ -136,8 +138,46 @@ const treeInfo = ref<any>({ | ... | @@ -136,8 +138,46 @@ const treeInfo = ref<any>({ |
| 136 | loading: false | 138 | loading: false |
| 137 | }); | 139 | }); |
| 138 | // 点击树节点修改分类guid 和 分类明细guid | 140 | // 点击树节点修改分类guid 和 分类明细guid |
| 139 | const nodeClick = (data: any) => { | 141 | // 存储大类的数据。 |
| 140 | console.log('nodeClick', data); | 142 | const findNodeDetails = ref<any>(''); |
| 143 | const isLastLayer = ref<boolean>(false); | ||
| 144 | // 所在层级的info | ||
| 145 | const atGradeinfo = ref<any>(''); | ||
| 146 | |||
| 147 | const findTopParentNode = (node: any) => { | ||
| 148 | if (!node) return; | ||
| 149 | |||
| 150 | // 判断是否为最后一层 | ||
| 151 | isLastLayer.value = node.childNodes.length === 0; | ||
| 152 | if (isLastLayer.value) { | ||
| 153 | atGradeinfo.value = node.data; | ||
| 154 | } | ||
| 155 | |||
| 156 | // 递归向上查找符合条件的祖先节点 | ||
| 157 | const findCParent = (currentNode: any): any => { | ||
| 158 | if (!currentNode?.parent) return null; // 没有父节点,停止递归 | ||
| 159 | if (currentNode.parent.data?.type === 'C') { | ||
| 160 | return currentNode.parent; // 找到符合条件的节点 | ||
| 161 | } | ||
| 162 | return findCParent(currentNode.parent); // 继续向上查找 | ||
| 163 | }; | ||
| 164 | |||
| 165 | // 查找最接近的符合条件的祖先节点 | ||
| 166 | const topParent = findCParent(node); | ||
| 167 | |||
| 168 | // 更新结果 | ||
| 169 | if (topParent) { | ||
| 170 | findNodeDetails.value = topParent.data; | ||
| 171 | } | ||
| 172 | }; | ||
| 173 | |||
| 174 | |||
| 175 | |||
| 176 | const nodeClick = (data, node) => { | ||
| 177 | |||
| 178 | findTopParentNode(node); | ||
| 179 | newCreateGradeFormItems.value[1].options = transformDataForTree([findNodeDetails.value]) | ||
| 180 | |||
| 141 | // 分类guid | 181 | // 分类guid |
| 142 | if (Object.keys(data).includes("type")) { | 182 | if (Object.keys(data).includes("type")) { |
| 143 | classifyGuid.value = data.guid; | 183 | classifyGuid.value = data.guid; |
| ... | @@ -180,8 +220,13 @@ const tableInfo = ref({ | ... | @@ -180,8 +220,13 @@ const tableInfo = ref({ |
| 180 | fixedSelection: true, | 220 | fixedSelection: true, |
| 181 | fields: [ | 221 | fields: [ |
| 182 | { label: "序号", type: "index", width: 56, align: "center" }, | 222 | { label: "序号", type: "index", width: 56, align: "center" }, |
| 183 | { label: "标签名", field: "label", type: 'text_btn', class: 'drawer-detail-cell', width: 120, value: 'detail', columClass: 'text_btn' }, | 223 | { label: "标签名", field: "label", type: 'text_btn', class: 'drawer-detail-cell', width: 160, value: 'detail', columClass: 'text_btn' }, |
| 184 | { label: "分类", field: "classifyDetailName", width: 140 }, | 224 | { |
| 225 | label: "分类", field: "classifyNames", getName: (scope) => { | ||
| 226 | let tempInfo = scope.row.classifyNames; | ||
| 227 | return tempInfo.join('/') | ||
| 228 | }, | ||
| 229 | }, | ||
| 185 | { label: "分级", field: "gradeDetailName", width: 140 }, | 230 | { label: "分级", field: "gradeDetailName", width: 140 }, |
| 186 | { | 231 | { |
| 187 | label: '状态', field: 'bizState', type: 'switch', activeText: '启用', inactiveText: '停用', activeValue: 'Y', inactiveValue: 'N', switchWidth: 56, width: 100, align: 'center' | 232 | label: '状态', field: 'bizState', type: 'switch', activeText: '启用', inactiveText: '停用', activeValue: 'Y', inactiveValue: 'N', switchWidth: 56, width: 100, align: 'center' |
| ... | @@ -280,7 +325,6 @@ const batchRemobe = async () => { | ... | @@ -280,7 +325,6 @@ const batchRemobe = async () => { |
| 280 | message: '已取消删除' | 325 | message: '已取消删除' |
| 281 | }); | 326 | }); |
| 282 | }); | 327 | }); |
| 283 | |||
| 284 | }; | 328 | }; |
| 285 | 329 | ||
| 286 | const tableSwitchBeforeChange = (scope, field, callback) => { | 330 | const tableSwitchBeforeChange = (scope, field, callback) => { |
| ... | @@ -410,7 +454,7 @@ const newCreateGradeFormItems = ref<any>([{ | ... | @@ -410,7 +454,7 @@ const newCreateGradeFormItems = ref<any>([{ |
| 410 | { | 454 | { |
| 411 | label: '精确匹配', | 455 | label: '精确匹配', |
| 412 | type: 'textarea', | 456 | type: 'textarea', |
| 413 | maxlength: 500, | 457 | maxlength: 260, |
| 414 | placeholder: '请输入字段中文,中间用英文“,”分号隔开', | 458 | placeholder: '请输入字段中文,中间用英文“,”分号隔开', |
| 415 | field: 'matchChValue', | 459 | field: 'matchChValue', |
| 416 | default: '', | 460 | default: '', |
| ... | @@ -421,7 +465,7 @@ const newCreateGradeFormItems = ref<any>([{ | ... | @@ -421,7 +465,7 @@ const newCreateGradeFormItems = ref<any>([{ |
| 421 | { | 465 | { |
| 422 | label: '', | 466 | label: '', |
| 423 | type: 'textarea', | 467 | type: 'textarea', |
| 424 | maxlength: 500, | 468 | maxlength: 260, |
| 425 | placeholder: '请输入字段中文,中间用英文“,”分号隔开', | 469 | placeholder: '请输入字段中文,中间用英文“,”分号隔开', |
| 426 | field: 'matchEnValue', | 470 | field: 'matchEnValue', |
| 427 | default: '', | 471 | default: '', |
| ... | @@ -459,7 +503,18 @@ const newCreateGradeStandardDialogInfo = ref({ | ... | @@ -459,7 +503,18 @@ const newCreateGradeStandardDialogInfo = ref({ |
| 459 | newCreateGradeStandardDialogInfo.value.submitBtnLoading = false; | 503 | newCreateGradeStandardDialogInfo.value.submitBtnLoading = false; |
| 460 | }, | 504 | }, |
| 461 | submit: async (btn, info) => { | 505 | submit: async (btn, info) => { |
| 462 | console.log(info); | 506 | |
| 507 | for (let i = 0; i < formRows.value.length; i++) { | ||
| 508 | const row = formRows.value[i]; | ||
| 509 | // 如果某一条数据的 matchValue, position, name 都为空,则跳过,不校验 | ||
| 510 | if (!row.matchValue && !row.position && !row.name) { | ||
| 511 | continue; // 如果全为空,跳过这一行的校验 | ||
| 512 | } | ||
| 513 | if (!row.matchValue || !row.position || !row.name) { | ||
| 514 | proxy.$ElMessage.error('请填写完整的模糊匹配规则'); | ||
| 515 | return; | ||
| 516 | } | ||
| 517 | } | ||
| 463 | newCreateGradeStandardDialogInfo.value.submitBtnLoading = true; | 518 | newCreateGradeStandardDialogInfo.value.submitBtnLoading = true; |
| 464 | if (newCreateGradeStandardDialogInfo.value.title === "添加标签") { | 519 | if (newCreateGradeStandardDialogInfo.value.title === "添加标签") { |
| 465 | const tempParams = formRows.value.map((item) => ({ | 520 | const tempParams = formRows.value.map((item) => ({ |
| ... | @@ -482,6 +537,7 @@ const newCreateGradeStandardDialogInfo = ref({ | ... | @@ -482,6 +537,7 @@ const newCreateGradeStandardDialogInfo = ref({ |
| 482 | getLabelPageData(); | 537 | getLabelPageData(); |
| 483 | getLabelListData(); | 538 | getLabelListData(); |
| 484 | } else { | 539 | } else { |
| 540 | newCreateGradeStandardDialogInfo.value.submitBtnLoading = false; | ||
| 485 | proxy.$ElMessage.error(res.msg); | 541 | proxy.$ElMessage.error(res.msg); |
| 486 | } | 542 | } |
| 487 | } | 543 | } |
| ... | @@ -508,6 +564,7 @@ const newCreateGradeStandardDialogInfo = ref({ | ... | @@ -508,6 +564,7 @@ const newCreateGradeStandardDialogInfo = ref({ |
| 508 | getLabelPageData(); | 564 | getLabelPageData(); |
| 509 | getLabelListData(); | 565 | getLabelListData(); |
| 510 | } else { | 566 | } else { |
| 567 | newCreateGradeStandardDialogInfo.value.submitBtnLoading = false; | ||
| 511 | proxy.$ElMessage.error(res.msg); | 568 | proxy.$ElMessage.error(res.msg); |
| 512 | } | 569 | } |
| 513 | } | 570 | } |
| ... | @@ -516,30 +573,63 @@ const newCreateGradeStandardDialogInfo = ref({ | ... | @@ -516,30 +573,63 @@ const newCreateGradeStandardDialogInfo = ref({ |
| 516 | }) | 573 | }) |
| 517 | 574 | ||
| 518 | // 新增标签 | 575 | // 新增标签 |
| 519 | const addNewLabel = () => { | 576 | const addNewLabel = async () => { |
| 520 | console.log('addNewLabel'); | 577 | newCreateGradeStandardDialogInfo.value.submitBtnLoading = false; |
| 521 | newCreateGradeFormItems.value.forEach(item => { | 578 | newCreateGradeFormItems.value.forEach(item => { |
| 522 | item.default = ''; | 579 | item.default = ''; |
| 523 | item.disabled = false; | 580 | item.disabled = false; |
| 524 | }); | 581 | }); |
| 525 | formRows.value = [{ matchValue: '', position: '', name: '', disabled: false }]; | 582 | formRows.value = [{ matchValue: '', position: '', name: '', disabled: false }]; |
| 583 | |||
| 584 | // | ||
| 585 | if (isLastLayer.value) { | ||
| 586 | // 选择了最后一级 | ||
| 587 | newCreateGradeFormItems.value[1].default = atGradeinfo.value.guid; | ||
| 588 | treeInfo.value.expandedKey = []; | ||
| 589 | treeInfo.value.currentNodeKey = atGradeinfo.value.guid; | ||
| 590 | treeInfo.value.expandedKey.push(atGradeinfo.value.classifyGradeGuid); | ||
| 591 | if (atGradeinfo.value?.classifyGradeGuid) { | ||
| 592 | classifyGuid.value = atGradeinfo.value.classifyGradeGuid; | ||
| 593 | tempName.value = atGradeinfo.value.name; | ||
| 594 | classifyDetailGuid.value = atGradeinfo.value.guid; | ||
| 595 | } | ||
| 596 | // 遍历classGradeTreeData 找到对应的guid item的refGradeGuid | ||
| 597 | classGradeTreeData.value.forEach((element: any) => { | ||
| 598 | if (element.guid === classifyGuid.value) { | ||
| 599 | tempRefGradeGuid.value = element.refGradeGuid; | ||
| 600 | } | ||
| 601 | }); | ||
| 602 | |||
| 603 | if (tempRefGradeGuid.value) { | ||
| 604 | await getGradeListData(tempRefGradeGuid.value); | ||
| 605 | const matchedGrade = gradeListData.value.find( | ||
| 606 | (element: any) => element.name === tempName.value | ||
| 607 | ); | ||
| 608 | if (matchedGrade) { | ||
| 609 | newCreateGradeFormItems.value[2].default = matchedGrade.guid; | ||
| 610 | } | ||
| 611 | } | ||
| 612 | } | ||
| 613 | |||
| 526 | newCreateGradeStandardDialogInfo.value.title = '添加标签'; | 614 | newCreateGradeStandardDialogInfo.value.title = '添加标签'; |
| 527 | newCreateGradeStandardDialogInfo.value.visible = true; | 615 | newCreateGradeStandardDialogInfo.value.visible = true; |
| 616 | newCreateGradeStandardDialogInfo.value.submitBtnLoading = false; | ||
| 528 | } | 617 | } |
| 529 | 618 | ||
| 530 | 619 | ||
| 531 | const classSearchItemList = ref<any>([ | 620 | const classSearchItemList = ref<any>([ |
| 532 | { | 621 | { |
| 533 | type: 'select-slots', | 622 | type: 'select', |
| 534 | multiple: true, | 623 | multiple: true, |
| 535 | label: '', | 624 | label: '', |
| 536 | field: 'labelName', | 625 | field: 'labelName', |
| 537 | default: [], | 626 | default: [], |
| 538 | options: [], | 627 | options: [], |
| 539 | placeholder: '请选择标签名称', | 628 | placeholder: '请选择标签名称', |
| 540 | clearable: false, | 629 | clearable: true, |
| 541 | filterable: true, | 630 | filterable: true, |
| 542 | visible: true | 631 | visible: true |
| 632 | |||
| 543 | } | 633 | } |
| 544 | ]); | 634 | ]); |
| 545 | 635 | ||
| ... | @@ -551,6 +641,7 @@ const selectChange = async (val: any, row: any) => { | ... | @@ -551,6 +641,7 @@ const selectChange = async (val: any, row: any) => { |
| 551 | }; | 641 | }; |
| 552 | 642 | ||
| 553 | /** 搜索查询分类标准 */ | 643 | /** 搜索查询分类标准 */ |
| 644 | const refCount = ref(0); | ||
| 554 | const searchClass = async (val: any, clear: boolean = false) => { | 645 | const searchClass = async (val: any, clear: boolean = false) => { |
| 555 | console.log('searchClass', val, clear); | 646 | console.log('searchClass', val, clear); |
| 556 | if (clear) { | 647 | if (clear) { |
| ... | @@ -559,7 +650,7 @@ const searchClass = async (val: any, clear: boolean = false) => { | ... | @@ -559,7 +650,7 @@ const searchClass = async (val: any, clear: boolean = false) => { |
| 559 | getLabelPageData(); | 650 | getLabelPageData(); |
| 560 | return; | 651 | return; |
| 561 | } | 652 | } |
| 562 | if (val?.labelName?.length !== 0) { | 653 | if (val?.labelName?.length !== 0 || refCount.value >= 1) { |
| 563 | tableInfo.value.loading = true; | 654 | tableInfo.value.loading = true; |
| 564 | const params = { | 655 | const params = { |
| 565 | pageIndex: page.value.curr, | 656 | pageIndex: page.value.curr, |
| ... | @@ -579,7 +670,6 @@ const searchClass = async (val: any, clear: boolean = false) => { | ... | @@ -579,7 +670,6 @@ const searchClass = async (val: any, clear: boolean = false) => { |
| 579 | } | 670 | } |
| 580 | } | 671 | } |
| 581 | 672 | ||
| 582 | |||
| 583 | }; | 673 | }; |
| 584 | 674 | ||
| 585 | 675 | ||
| ... | @@ -601,12 +691,13 @@ const handleSelectChange = async (val, row, info) => { | ... | @@ -601,12 +691,13 @@ const handleSelectChange = async (val, row, info) => { |
| 601 | newCreateGradeFormItems.value[2].default = matchedGrade.guid; | 691 | newCreateGradeFormItems.value[2].default = matchedGrade.guid; |
| 602 | newCreateGradeFormItems.value[0].default = tempFormData.value.label; | 692 | newCreateGradeFormItems.value[0].default = tempFormData.value.label; |
| 603 | newCreateGradeFormItems.value[1].default = tempFormData.value.classifyDetailGuid; | 693 | newCreateGradeFormItems.value[1].default = tempFormData.value.classifyDetailGuid; |
| 694 | newCreateGradeFormItems.value[3].default = tempFormData.value.matchChValue; | ||
| 695 | newCreateGradeFormItems.value[4].default = tempFormData.value.matchEnValue; | ||
| 604 | } | 696 | } |
| 605 | } | 697 | } |
| 606 | }; | 698 | }; |
| 607 | 699 | ||
| 608 | const handleTreeSelectNodeChange = (node, item, nodeObj) => { | 700 | const handleTreeSelectNodeChange = (node, item, nodeObj) => { |
| 609 | console.log('handleTreeSelectNodeChange', node, item, nodeObj); | ||
| 610 | treeInfo.value.expandedKey = []; | 701 | treeInfo.value.expandedKey = []; |
| 611 | treeInfo.value.currentNodeKey = node.guid; | 702 | treeInfo.value.currentNodeKey = node.guid; |
| 612 | treeInfo.value.expandedKey.push(node.classifyGradeGuid); | 703 | treeInfo.value.expandedKey.push(node.classifyGradeGuid); |
| ... | @@ -702,8 +793,8 @@ const deleteRow = (index: number) => { | ... | @@ -702,8 +793,8 @@ const deleteRow = (index: number) => { |
| 702 | </div> | 793 | </div> |
| 703 | <div> | 794 | <div> |
| 704 | <el-button type="primary" class="v-add" @click="addNewLabel">新增</el-button> | 795 | <el-button type="primary" class="v-add" @click="addNewLabel">新增</el-button> |
| 705 | <el-button class="v-import">导入</el-button> | 796 | <!-- <el-button class="v-import">导入</el-button> |
| 706 | <el-button>导出</el-button> | 797 | <el-button>导出</el-button> --> |
| 707 | </div> | 798 | </div> |
| 708 | <div class="table_panel_wrap"> | 799 | <div class="table_panel_wrap"> |
| 709 | <Table :tableInfo="tableInfo" @tableSwitchBeforeChange="tableSwitchBeforeChange" | 800 | <Table :tableInfo="tableInfo" @tableSwitchBeforeChange="tableSwitchBeforeChange" |
| ... | @@ -868,6 +959,11 @@ const deleteRow = (index: number) => { | ... | @@ -868,6 +959,11 @@ const deleteRow = (index: number) => { |
| 868 | line-height: 24px; | 959 | line-height: 24px; |
| 869 | font-weight: 600; | 960 | font-weight: 600; |
| 870 | } | 961 | } |
| 962 | |||
| 963 | .el-dialog__body { | ||
| 964 | height: 510px; | ||
| 965 | overflow: auto; | ||
| 966 | } | ||
| 871 | } | 967 | } |
| 872 | } | 968 | } |
| 873 | </style> | 969 | </style> | ... | ... |
| ... | @@ -196,13 +196,16 @@ const getPreviewData = () => { | ... | @@ -196,13 +196,16 @@ const getPreviewData = () => { |
| 196 | 196 | ||
| 197 | const getTableStructure = () => { | 197 | const getTableStructure = () => { |
| 198 | let tableName = currDatasourceSelect.value.tableName; | 198 | let tableName = currDatasourceSelect.value.tableName; |
| 199 | console.log('tableName', currDatasourceSelect.value); | ||
| 199 | currDsTableStructureLoading.value = true; | 200 | currDsTableStructureLoading.value = true; |
| 200 | currDsTableStructure.value = []; | 201 | currDsTableStructure.value = []; |
| 201 | getDsTableStructure({ | 202 | getDsTableStructure({ |
| 202 | tableName: tableName, | 203 | // tableName: tableName, |
| 203 | dataSourceGuid: databaseInfo.value.guid, | 204 | // dataSourceGuid: databaseInfo.value.guid, |
| 204 | database: databaseInfo.value.databaseNameEn, | 205 | // database: databaseInfo.value.databaseNameEn, |
| 205 | databaseType: databaseInfo.value.databaseType | 206 | // databaseType: databaseInfo.value.databaseType, |
| 207 | tableGuid: currDatasourceSelect.value.tableGuid, | ||
| 208 | execGuid: props.execGuid | ||
| 206 | }).then((res: any) => { | 209 | }).then((res: any) => { |
| 207 | currDsTableStructureLoading.value = false; | 210 | currDsTableStructureLoading.value = false; |
| 208 | if (res.code == proxy.$passCode) { | 211 | if (res.code == proxy.$passCode) { |
| ... | @@ -318,7 +321,7 @@ watch( | ... | @@ -318,7 +321,7 @@ watch( |
| 318 | if (val?.length && !currDatasourceSelect.value?.tableName) { | 321 | if (val?.length && !currDatasourceSelect.value?.tableName) { |
| 319 | currDatasourceSelect.value = val[0]; | 322 | currDatasourceSelect.value = val[0]; |
| 320 | } | 323 | } |
| 321 | emits("datasourceSelectedChange", val); | 324 | emits("datasourceSelectedChange", val, databaseGuid.value); |
| 322 | }, | 325 | }, |
| 323 | { | 326 | { |
| 324 | deep: true, | 327 | deep: true, | ... | ... |
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
This diff is collapsed.
Click to expand it.
| ... | @@ -57,9 +57,18 @@ const getClassifyGradListData = async () => { | ... | @@ -57,9 +57,18 @@ const getClassifyGradListData = async () => { |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | //获取分类列表 | 59 | //获取分类列表 |
| 60 | const getClassListData = async () => { | 60 | const getClassListData = async (params = {}) => { |
| 61 | const inParams = { | ||
| 62 | type: 'C', | ||
| 63 | pageIndex: 1, | ||
| 64 | pageSize: -1 | ||
| 65 | } | ||
| 66 | const finalParams = { | ||
| 67 | ...inParams, | ||
| 68 | ...params | ||
| 69 | } | ||
| 61 | classListDataLoading.value = true; | 70 | classListDataLoading.value = true; |
| 62 | const res: any = await getClassifyGradList(refClassifyPageParams.value); | 71 | const res: any = await getClassifyGradList(finalParams); |
| 63 | if (res.code == proxy.$passCode) { | 72 | if (res.code == proxy.$passCode) { |
| 64 | classListData.value = res.data.records || []; | 73 | classListData.value = res.data.records || []; |
| 65 | classListDataLoading.value = false; | 74 | classListDataLoading.value = false; |
| ... | @@ -70,7 +79,7 @@ const getClassListData = async () => { | ... | @@ -70,7 +79,7 @@ const getClassListData = async () => { |
| 70 | 79 | ||
| 71 | onMounted(() => { | 80 | onMounted(() => { |
| 72 | getClassifyGradListData(); | 81 | getClassifyGradListData(); |
| 73 | getClassListData(); | 82 | // getClassListData(); |
| 74 | }) | 83 | }) |
| 75 | 84 | ||
| 76 | 85 | ||
| ... | @@ -108,24 +117,30 @@ const cardBtnVisible: any = ref(false); | ... | @@ -108,24 +117,30 @@ const cardBtnVisible: any = ref(false); |
| 108 | 117 | ||
| 109 | /** 搜索查询分类标准 */ | 118 | /** 搜索查询分类标准 */ |
| 110 | const searchClass = async (val: any, clear: boolean = false) => { | 119 | const searchClass = async (val: any, clear: boolean = false) => { |
| 120 | console.log(val, 'val'); | ||
| 121 | |||
| 111 | if (clear) { | 122 | if (clear) { |
| 112 | classSearchItemList.value.map(item => item.default = '') | 123 | classSearchItemList.value.map(item => item.default = '') |
| 113 | getClassListData(); | 124 | getClassListData(); |
| 114 | return; | 125 | return; |
| 115 | } | 126 | } |
| 116 | const params = { | 127 | // const params = { |
| 117 | type: 'C', | 128 | // type: 'C', |
| 118 | name: val.classStandardName, | 129 | // name: val.classStandardName, |
| 119 | pageIndex: 1, | 130 | // pageIndex: 1, |
| 120 | pageSize: -1 | 131 | // pageSize: -1 |
| 121 | } | 132 | // } |
| 122 | const res: any = await getClassifyGradList(params); | 133 | // const res: any = await getClassifyGradList(params); |
| 123 | if (res.code == proxy.$passCode) { | 134 | // if (res.code == proxy.$passCode) { |
| 124 | classListData.value = res.data.records || []; | 135 | // classListData.value = res.data.records || []; |
| 125 | } else { | 136 | // } else { |
| 126 | proxy.$ElMessage.error(res.msg); | 137 | // proxy.$ElMessage.error(res.msg); |
| 138 | // } | ||
| 139 | getClassListData( | ||
| 140 | { | ||
| 141 | name: val.classStandardName | ||
| 127 | } | 142 | } |
| 128 | 143 | ); | |
| 129 | }; | 144 | }; |
| 130 | 145 | ||
| 131 | /** 编辑分类 */ | 146 | /** 编辑分类 */ |
| ... | @@ -149,6 +164,7 @@ const handleClassDataEdit = (params) => { | ... | @@ -149,6 +164,7 @@ const handleClassDataEdit = (params) => { |
| 149 | 164 | ||
| 150 | // 配置分类 | 165 | // 配置分类 |
| 151 | const handleClassDataClick = (item, des = '') => { | 166 | const handleClassDataClick = (item, des = '') => { |
| 167 | console.log(item, 'i111tem'); | ||
| 152 | // 获取分级标准 | 168 | // 获取分级标准 |
| 153 | router.push({ | 169 | router.push({ |
| 154 | name: 'classStandardEdit', | 170 | name: 'classStandardEdit', |
| ... | @@ -156,7 +172,9 @@ const handleClassDataClick = (item, des = '') => { | ... | @@ -156,7 +172,9 @@ const handleClassDataClick = (item, des = '') => { |
| 156 | guid: item.guid, | 172 | guid: item.guid, |
| 157 | type: des === '' ? '配置' : des, | 173 | type: des === '' ? '配置' : des, |
| 158 | classStandardName: item.name, | 174 | classStandardName: item.name, |
| 159 | refGradeGuid: item.refGradeGuid | 175 | refGradeGuid: item.refGradeGuid, |
| 176 | description: item.description, | ||
| 177 | isExpand: item.isExpand || false | ||
| 160 | } | 178 | } |
| 161 | }); | 179 | }); |
| 162 | } | 180 | } |
| ... | @@ -229,7 +247,7 @@ const classStandardFormItems = ref([{ | ... | @@ -229,7 +247,7 @@ const classStandardFormItems = ref([{ |
| 229 | 247 | ||
| 230 | const classStandardFormRules = ref({ | 248 | const classStandardFormRules = ref({ |
| 231 | classStandardName: [required('请填写分类名称')], | 249 | classStandardName: [required('请填写分类名称')], |
| 232 | gradeStandard: [required('请选择分级标准')] | 250 | refGradeGuid: [required('请选择分级标准')] |
| 233 | }); | 251 | }); |
| 234 | 252 | ||
| 235 | const newCreateClassStandardDialogInfo = ref({ | 253 | const newCreateClassStandardDialogInfo = ref({ |
| ... | @@ -248,6 +266,7 @@ const newCreateClassStandardDialogInfo = ref({ | ... | @@ -248,6 +266,7 @@ const newCreateClassStandardDialogInfo = ref({ |
| 248 | newCreateClassStandardDialogInfo.value.visible = false; | 266 | newCreateClassStandardDialogInfo.value.visible = false; |
| 249 | }, | 267 | }, |
| 250 | submit: async (btn, info) => { | 268 | submit: async (btn, info) => { |
| 269 | |||
| 251 | if (newCreateClassStandardDialogInfo.value.title === '新增分类') { | 270 | if (newCreateClassStandardDialogInfo.value.title === '新增分类') { |
| 252 | newCreateClassStandardDialogInfo.value.submitBtnLoading = true; | 271 | newCreateClassStandardDialogInfo.value.submitBtnLoading = true; |
| 253 | const params = { | 272 | const params = { |
| ... | @@ -263,9 +282,26 @@ const newCreateClassStandardDialogInfo = ref({ | ... | @@ -263,9 +282,26 @@ const newCreateClassStandardDialogInfo = ref({ |
| 263 | type: 'success', | 282 | type: 'success', |
| 264 | message: '新增分类成功' | 283 | message: '新增分类成功' |
| 265 | }) | 284 | }) |
| 285 | |||
| 286 | nextTick(() => { | ||
| 287 | // 拿到新增的分类数据,跳转到配置页面 | ||
| 288 | const item = classListData.value.find(item => item.name === info.classStandardName); | ||
| 289 | console.log(item, 'item---------------'); | ||
| 290 | if (item) { | ||
| 291 | const params = { | ||
| 292 | name: item.name, | ||
| 293 | guid: item.guid, | ||
| 294 | refGradeGuid: item.refGradeGuid, | ||
| 295 | description: item.description, | ||
| 296 | isExpand: true | ||
| 297 | } | ||
| 298 | handleClassDataClick(params, ''); | ||
| 299 | } | ||
| 300 | }) | ||
| 266 | newCreateClassStandardDialogInfo.value.submitBtnLoading = false; | 301 | newCreateClassStandardDialogInfo.value.submitBtnLoading = false; |
| 267 | newCreateClassStandardDialogInfo.value.visible = false; | 302 | newCreateClassStandardDialogInfo.value.visible = false; |
| 268 | } else { | 303 | } else { |
| 304 | newCreateClassStandardDialogInfo.value.submitBtnLoading = false; | ||
| 269 | proxy.$ElMessage.error(res.msg); | 305 | proxy.$ElMessage.error(res.msg); |
| 270 | } | 306 | } |
| 271 | } else { | 307 | } else { |
| ... | @@ -293,6 +329,7 @@ const newCreateClassStandardDialogInfo = ref({ | ... | @@ -293,6 +329,7 @@ const newCreateClassStandardDialogInfo = ref({ |
| 293 | }) | 329 | }) |
| 294 | 330 | ||
| 295 | const newCreateClass = () => { | 331 | const newCreateClass = () => { |
| 332 | newCreateClassStandardDialogInfo.value.submitBtnLoading = false; | ||
| 296 | newCreateClassStandardDialogInfo.value.visible = true; | 333 | newCreateClassStandardDialogInfo.value.visible = true; |
| 297 | classStandardFormItems.value.forEach(item => item.default = ''); | 334 | classStandardFormItems.value.forEach(item => item.default = ''); |
| 298 | } | 335 | } |
| ... | @@ -343,12 +380,10 @@ const newCreateGradeStandardDialogInfo = ref({ | ... | @@ -343,12 +380,10 @@ const newCreateGradeStandardDialogInfo = ref({ |
| 343 | await getClassifyGradListData(); | 380 | await getClassifyGradListData(); |
| 344 | proxy.$ElMessage({ | 381 | proxy.$ElMessage({ |
| 345 | type: 'success', | 382 | type: 'success', |
| 346 | message: '新增分类成功' | 383 | message: '新增分级成功' |
| 347 | }) | 384 | }) |
| 348 | |||
| 349 | // 拿到新增的分级数据,跳转到配置页面 | 385 | // 拿到新增的分级数据,跳转到配置页面 |
| 350 | const item = classifyGradListData.value.find(item => item.name === info.name); | 386 | const item = classifyGradListData.value.find(item => item.name === info.name); |
| 351 | |||
| 352 | if (item) { | 387 | if (item) { |
| 353 | const params = { | 388 | const params = { |
| 354 | name: item.name, | 389 | name: item.name, |
| ... | @@ -359,6 +394,7 @@ const newCreateGradeStandardDialogInfo = ref({ | ... | @@ -359,6 +394,7 @@ const newCreateGradeStandardDialogInfo = ref({ |
| 359 | newCreateGradeStandardDialogInfo.value.submitBtnLoading = false; | 394 | newCreateGradeStandardDialogInfo.value.submitBtnLoading = false; |
| 360 | newCreateGradeStandardDialogInfo.value.visible = false; | 395 | newCreateGradeStandardDialogInfo.value.visible = false; |
| 361 | } else { | 396 | } else { |
| 397 | newCreateGradeStandardDialogInfo.value.submitBtnLoading = false; | ||
| 362 | proxy.$ElMessage.error(res.msg); | 398 | proxy.$ElMessage.error(res.msg); |
| 363 | } | 399 | } |
| 364 | } else { | 400 | } else { |
| ... | @@ -372,7 +408,7 @@ const newCreateGradeStandardDialogInfo = ref({ | ... | @@ -372,7 +408,7 @@ const newCreateGradeStandardDialogInfo = ref({ |
| 372 | getClassifyGradListData(); | 408 | getClassifyGradListData(); |
| 373 | proxy.$ElMessage({ | 409 | proxy.$ElMessage({ |
| 374 | type: 'success', | 410 | type: 'success', |
| 375 | message: '修改分类成功' | 411 | message: '修改分级成功' |
| 376 | }) | 412 | }) |
| 377 | newCreateGradeStandardDialogInfo.value.visible = false; | 413 | newCreateGradeStandardDialogInfo.value.visible = false; |
| 378 | } else { | 414 | } else { |
| ... | @@ -437,6 +473,7 @@ const handleClassifyGradDataClick = (item) => { | ... | @@ -437,6 +473,7 @@ const handleClassifyGradDataClick = (item) => { |
| 437 | } | 473 | } |
| 438 | 474 | ||
| 439 | const newCreateGrade = () => { | 475 | const newCreateGrade = () => { |
| 476 | newCreateGradeStandardDialogInfo.value.submitBtnLoading = false; | ||
| 440 | newCreateGradeStandardDialogInfo.value.visible = true; | 477 | newCreateGradeStandardDialogInfo.value.visible = true; |
| 441 | newCreateGradeFormItems.value.forEach(item => item.default = ''); | 478 | newCreateGradeFormItems.value.forEach(item => item.default = ''); |
| 442 | } | 479 | } |
| ... | @@ -538,8 +575,8 @@ const newCreateGrade = () => { | ... | @@ -538,8 +575,8 @@ const newCreateGrade = () => { |
| 538 | </el-icon> | 575 | </el-icon> |
| 539 | </template> | 576 | </template> |
| 540 | <div class="levitation-ul"> | 577 | <div class="levitation-ul"> |
| 541 | <span class="levitation-li" @click="handleClassDataClick(item)">配置</span> | 578 | <span class="levitation-li" @click="handleClassDataClick(item)">编辑</span> |
| 542 | <span class="levitation-li" @click="handleClassDataEdit(item)">编辑</span> | 579 | <!-- <span class="levitation-li" @click="handleClassDataEdit(item)">编辑</span> --> |
| 543 | <span class="levitation-li" @click="handleClassDataDel(item)">删除</span> | 580 | <span class="levitation-li" @click="handleClassDataDel(item)">删除</span> |
| 544 | </div> | 581 | </div> |
| 545 | </el-popover> | 582 | </el-popover> |
| ... | @@ -571,8 +608,8 @@ const newCreateGrade = () => { | ... | @@ -571,8 +608,8 @@ const newCreateGrade = () => { |
| 571 | </el-icon> | 608 | </el-icon> |
| 572 | </template> | 609 | </template> |
| 573 | <div class="levitation-ul"> | 610 | <div class="levitation-ul"> |
| 574 | <span class="levitation-li" @click="handleClassifyGradDataClick(item)">配置</span> | 611 | <span class="levitation-li" @click="handleClassifyGradDataClick(item)">编辑</span> |
| 575 | <span class="levitation-li" @click="handleClassifyGradDataEdit(item)">编辑</span> | 612 | <!-- <span class="levitation-li" @click="handleClassifyGradDataEdit(item)">编辑</span> --> |
| 576 | <span class="levitation-li" @click="handleClassifyGradDataDel(item)">删除</span> | 613 | <span class="levitation-li" @click="handleClassifyGradDataDel(item)">删除</span> |
| 577 | </div> | 614 | </div> |
| 578 | </el-popover> | 615 | </el-popover> | ... | ... |
-
Please register or sign in to post a comment