923dcb90 by xukangle

Merge branch 'dev_20241202_xukangle' into develop

2 parents 2549571b f278ba6b
...@@ -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
......
...@@ -644,15 +644,46 @@ export const getDbDirFieldPageList = (data) => request({ ...@@ -644,15 +644,46 @@ export const getDbDirFieldPageList = (data) => request({
644 data 644 data
645 }) 645 })
646 646
647 /**
648 * 数据库目录-表联动查询
649 * @param data
650 * @returns
651 * @path /db-dir/table/select-list
652 */
653 export const getDbDirTableSelectList = (data) => request({
654 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/table/select-list`,
655 method: 'post',
656 data
657 })
658
647 659
648 660
649 /** 获取已有字段信息 */ 661 /** 获取已有字段信息 */
650 export const getDsTableStructure= (data) => request({ 662 export const getDsTableStructure= (data) => request({
651 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/field/list-by-table-guid`, 663 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/field/list-by-table-guid?tableGuid=${data.tableGuid}&execGuid=${data.execGuid}`,
652 method: 'post', 664 method: 'post',
653 data
654 }); 665 });
655 666
667 /** 获取已有数据库目录字段信息 入参是数组 */
668 export const getDsTableStructures= (data) => request({
669 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/field/list-by-table-guids`,
670 method: 'post',
671 data
672 });
673
674 /**
675 * 数据库目录-字段查询分类分级
676 * @param {Object}
677 * @path /db-dir/field/get-classify-and-grade
678 */
679 export const getDbDirFieldClassifyAndGrade = (data) => request({
680 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/field/get-classify-and-grade`,
681 method: 'post',
682 data
683 })
684
685
686
656 /** 根据选择的连接池获取表列表 */ 687 /** 根据选择的连接池获取表列表 */
657 export const getDsTableByDs = (params) => request({ 688 export const getDsTableByDs = (params) => request({
658 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/table/list-by-datasource-guid`, 689 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/table/list-by-datasource-guid`,
......
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 });
...@@ -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,29 +449,35 @@ const uploadFile = (file, item) => { ...@@ -444,29 +449,35 @@ 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) => {
452 if (res.code == '00000') { 457 obsUploadRequest({
453 let fileItem = { 458 signedUrl: res.data.signedUrl,
454 name: file.file.name, 459 file: file.file,
455 url: res.data, 460 actualsignedRequestHeaders: res.data.actualsignedRequestHeaders
456 file: file.file 461 }).then(() => {
457 }; 462 if (res.code == '00000') {
458 if (item.limit === 1) { 463 let fileItem = {
459 formInline.value[item.field] = [fileItem]; 464 name: file.file.name,
465 url: res.data.signedUrl,
466 file: file.file
467 };
468 if (item.limit === 1) {
469 formInline.value[item.field] = [fileItem];
470 } else {
471 formInline.value[item.field].push(fileItem);
472 }
473 ruleFormRef.value?.validateField([item.field]);
474 ElMessage.success('上传成功');
475 emits("uploadFileChange", formInline.value[item.field]);
460 } else { 476 } else {
461 formInline.value[item.field].push(fileItem); 477 uploadRef.value['ref' + item.field].handleRemove(file);
478 ElMessage.error('上传失败,请重新上传!');
462 } 479 }
463 ruleFormRef.value?.validateField([item.field]); 480 })
464 ElMessage.success('上传成功');
465 emits("uploadFileChange", formInline.value[item.field]);
466 } else {
467 uploadRef.value['ref' + item.field].handleRemove(file);
468 ElMessage.error('上传失败,请重新上传!');
469 }
470 }) 481 })
471 .catch(() => { 482 .catch(() => {
472 uploadRef.value['ref' + item.field].handleRemove(file); 483 uploadRef.value['ref' + item.field].handleRemove(file);
......
...@@ -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[]
......
...@@ -6,10 +6,9 @@ ...@@ -6,10 +6,9 @@
6 import { ref, onMounted } from "vue"; 6 import { ref, onMounted } from "vue";
7 import useUserStore from "@/store/modules/user"; 7 import useUserStore from "@/store/modules/user";
8 import { useValidator } from '@/hooks/useValidator'; 8 import { useValidator } from '@/hooks/useValidator';
9 import { TableColumnWidth } from '@/utils/enum';
10 import G6 from '@antv/g6'; 9 import G6 from '@antv/g6';
11 import { IGroup, ModelConfig } from '@antv/g6'; 10 import { IGroup, ModelConfig } from '@antv/g6';
12 import { getClassifyGradList, getClassifyTreeList, getGradeList, saveClassify, updateClassify, deleteClassify } from "@/api/modules/dataInventory"; 11 import { getClassifyGradList, getClassifyTreeList, getGradeList, saveClassify, updateClassify, deleteClassify, updateClassifyGrad } from "@/api/modules/dataInventory";
13 12
14 13
15 const { required, orderNum } = useValidator(); 14 const { required, orderNum } = useValidator();
...@@ -30,19 +29,43 @@ const classStandardFormItems = ref([{ ...@@ -30,19 +29,43 @@ const classStandardFormItems = ref([{
30 field: 'classStandardName', 29 field: 'classStandardName',
31 default: router.currentRoute.value.query.classStandardName, 30 default: router.currentRoute.value.query.classStandardName,
32 clearable: true, 31 clearable: true,
33 disabled: true, 32 disabled: false,
34 required: true 33 required: true
35 }, { 34 }, {
35 // label: '分级标准',
36 // type: 'input',
37 // placeholder: '请选择',
38 // field: 'gradeStandard',
39 // default: '',
40 // required: true,
41 // filterable: true,
42 // clearable: true,
43 // disabled: false,
44 // visible: true,
36 label: '分级标准', 45 label: '分级标准',
37 type: 'input', 46 type: 'select',
38 placeholder: '请选择', 47 placeholder: '请选择',
39 field: 'gradeStandard', 48 field: 'gradeStandard',
49 options: [],
50 props: {
51 label: "name",
52 value: "guid",
53 },
54 filterable: true,
55 clearable: true,
40 default: '', 56 default: '',
41 required: true, 57 required: true,
42 filterable: true, 58 block: false,
59 },
60 {
61 label: '分类描述',
62 type: 'textarea',
63 placeholder: '请输入',
64 field: 'description',
65 default: '',
43 clearable: true, 66 clearable: true,
44 disabled: true, 67 required: false,
45 visible: true, 68 block: true
46 }]); 69 }]);
47 70
48 // 定义层级映射1->一级,2->二级,3->三级,4->四级 71 // 定义层级映射1->一级,2->二级,3->三级,4->四级
...@@ -77,7 +100,7 @@ const tableInfo = ref({ ...@@ -77,7 +100,7 @@ const tableInfo = ref({
77 { 100 {
78 label: "最低安全级别参考", field: "name", width: 140, getName: (scope) => { 101 label: "最低安全级别参考", field: "name", width: 140, getName: (scope) => {
79 let dataGrade = scope.row.dataGrade; 102 let dataGrade = scope.row.dataGrade;
80 return dataGrade + '级'; 103 return dataGrade ? dataGrade + '级' : '--';
81 } 104 }
82 }, 105 },
83 { label: "修改人", field: "updateUserName", width: 140 }, 106 { label: "修改人", field: "updateUserName", width: 140 },
...@@ -165,7 +188,7 @@ const classEditFormItems = ref([{ ...@@ -165,7 +188,7 @@ const classEditFormItems = ref([{
165 type: 'select', 188 type: 'select',
166 placeholder: '请选择', 189 placeholder: '请选择',
167 field: 'gradeGuid', 190 field: 'gradeGuid',
168 default: 1, 191 default: '',
169 options: [], //TODO 192 options: [], //TODO
170 props: { 193 props: {
171 label: "name", 194 label: "name",
...@@ -322,7 +345,9 @@ const drawerBtnClick = async (btn, info) => { ...@@ -322,7 +345,9 @@ const drawerBtnClick = async (btn, info) => {
322 const params = { 345 const params = {
323 ...info, 346 ...info,
324 classifyGradeGuid: router.currentRoute.value.query.guid, 347 classifyGradeGuid: router.currentRoute.value.query.guid,
325 guid: currTableInfo.value.guid 348 guid: currTableInfo.value.guid,
349 gradeGuid: info.gradeGuid || '',
350 parentGuid: info.parentGuid || '',
326 } 351 }
327 const res: any = await updateClassify(params); 352 const res: any = await updateClassify(params);
328 if (res.code == proxy.$passCode) { 353 if (res.code == proxy.$passCode) {
...@@ -350,8 +375,10 @@ const getClassifyGradListData = async () => { ...@@ -350,8 +375,10 @@ const getClassifyGradListData = async () => {
350 const res: any = await getClassifyGradList(refGradePageParams.value); 375 const res: any = await getClassifyGradList(refGradePageParams.value);
351 if (res.code == proxy.$passCode) { 376 if (res.code == proxy.$passCode) {
352 classifyGradListData.value = res.data.records || []; 377 classifyGradListData.value = res.data.records || [];
353 const gradeName = findStandardName(router.currentRoute.value.query.refGradeGuid as any); 378 classStandardFormItems.value[1].options = classifyGradListData.value;
354 classStandardFormItems.value[1].default = gradeName; 379 // const gradeName = findStandardName(router.currentRoute.value.query.refGradeGuid as any);
380 classStandardFormItems.value[1].default = router.currentRoute.value.query.refGradeGuid;
381 classStandardFormItems.value[2].default = router.currentRoute.value.query.description;
355 } else { 382 } else {
356 proxy.$ElMessage.error(res.msg); 383 proxy.$ElMessage.error(res.msg);
357 } 384 }
...@@ -445,6 +472,39 @@ const newCreateClass = () => { ...@@ -445,6 +472,39 @@ const newCreateClass = () => {
445 }) 472 })
446 } 473 }
447 474
475
476 const saveLoading = ref(false);
477 const saveUpdate = async () => {
478 console.log(formRef.value.formInline);
479 if (!formRef.value.formInline.classStandardName) {
480 proxy.$ElMessage.error('分类名称不能为空');
481 return;
482 }
483 if (!formRef.value.formInline.gradeStandard) {
484 proxy.$ElMessage.error('分级标准不能为空');
485 return;
486 }
487 saveLoading.value = true;
488 const params = {
489 guid: router.currentRoute.value.query.guid,
490 name: formRef.value.formInline.classStandardName,
491 refGradeGuid: formRef.value.formInline.gradeStandard,
492 type: 'C',
493 description: formRef.value.formInline.description
494 }
495 console.log(params);
496 const res: any = await updateClassifyGrad(params);
497 if (res.code == proxy.$passCode) {
498 proxy.$ElMessage.success('修改成功');
499 router.push({
500 name: 'templateConfig'
501 });
502 saveLoading.value = false;
503 } else {
504 proxy.$ElMessage.error(res.msg);
505 }
506 }
507
448 /** 导入分类。 */ 508 /** 导入分类。 */
449 const importClass = () => { 509 const importClass = () => {
450 510
...@@ -778,6 +838,7 @@ onMounted(() => { ...@@ -778,6 +838,7 @@ onMounted(() => {
778 </div> 838 </div>
779 <div class="bottom_tool_wrap"> 839 <div class="bottom_tool_wrap">
780 <el-button @click="cancel">取消</el-button> 840 <el-button @click="cancel">取消</el-button>
841 <el-button type="primary" @click="saveUpdate" :loading="saveLoading">保存修改</el-button>
781 </div> 842 </div>
782 <Drawer :drawerInfo="drawerInfo" @drawerBtnClick="drawerBtnClick" ref="drawerRef" /> 843 <Drawer :drawerInfo="drawerInfo" @drawerBtnClick="drawerBtnClick" ref="drawerRef" />
783 </div> 844 </div>
...@@ -824,11 +885,11 @@ onMounted(() => { ...@@ -824,11 +885,11 @@ onMounted(() => {
824 } 885 }
825 886
826 .shape-main { 887 .shape-main {
827 height: calc(100% - 58px); 888 height: calc(100% - 160px);
828 } 889 }
829 890
830 .table_panel { 891 .table_panel {
831 height: calc(100% - 58px) !important; 892 height: calc(100% - 160px) !important;
832 } 893 }
833 894
834 .node-details-popup { 895 .node-details-popup {
......
...@@ -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.query.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: {
...@@ -328,18 +331,80 @@ const newStandard = () => { ...@@ -328,18 +331,80 @@ const newStandard = () => {
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 }]);
347
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 }
331 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 proxy.$ElMessage.error(res.msg);
373 }
374 }
375
376 const cancel = () => {
377 proxy.$openMessageBox("当前页面尚未保存,确定放弃修改吗?", () => {
378 userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
379 router.push({
380 name: 'templateConfig'
381 });
382 }, () => {
383 proxy.$ElMessage.info("已取消");
384 });
385 }
332 386
333 </script> 387 </script>
334 388
335 <template> 389 <template>
336 <div class="container_wrap" v-loading="fullscreenLoading"> 390 <div class="container_wrap">
337 <div class="content_main"> 391 <div class="content_main">
338 <div class="table-top-btns"> 392 <ContentWrap id="id-baseInfo" title="基础信息" description="" style="margin-top: 8px;">
339 <el-button type="primary" @click="newStandard">新增标准</el-button> 393 <Form ref="formRef" :itemList="classStandardFormItems" formId="main-model-edit" col="col3" />
340 <el-button @click="batchRemobe">批量删除</el-button> 394 </ContentWrap>
341 </div> 395 <ContentWrap id="id-grade-info" title="分级标准" class="detail-content" description="" style="margin-top: 8px;">
342 <Table ref="tableRef" :tableInfo="tableInfo" @tableSelectionChange="onTableSelectChange" /> 396 <div class="content" v-loading="fullscreenLoading">
397 <div class="table-top-btns">
398 <el-button type="primary" @click="newStandard">新增标准</el-button>
399 <el-button @click="batchRemobe">批量删除</el-button>
400 </div>
401 <Table ref="tableRef" :tableInfo="tableInfo" @tableSelectionChange="onTableSelectChange" />
402 </div>
403 </ContentWrap>
404 </div>
405 <div class="bottom_tool_wrap">
406 <el-button @click="cancel">取消</el-button>
407 <el-button type="primary" @click="saveUpdate" :loading="saveLoading">保存修改</el-button>
343 </div> 408 </div>
344 <Dialog_form :dialogConfigInfo="newCreateGradeStandardDialogInfo" /> 409 <Dialog_form :dialogConfigInfo="newCreateGradeStandardDialogInfo" />
345 </div> 410 </div>
...@@ -351,11 +416,48 @@ const newStandard = () => { ...@@ -351,11 +416,48 @@ const newStandard = () => {
351 416
352 .content_main { 417 .content_main {
353 height: calc(100% - 44px); 418 height: calc(100% - 44px);
354 padding: 17px 16px 10px 16px; 419 padding: 10px 16px;
355 420
356 .table-top-btns { 421 .table-top-btns {
357 display: flex;
358 margin-bottom: 12px; 422 margin-bottom: 12px;
359 } 423 }
360 } 424 }
425
426 .bottom_tool_wrap {
427 height: 44px;
428 padding: 0 16px;
429 border-top: 1px solid #d9d9d9;
430 display: flex;
431 justify-content: center;
432 align-items: center;
433 }
434
435 :deep(.detail-content) {
436
437 .el-card__body {
438 height: calc(100% - 50px) !important;
439
440 .card-body-content {
441 height: 100%;
442 }
443 }
444 }
445
446 .tools_btns {
447 position: relative;
448 margin-bottom: 16px;
449
450 .show-change-btn {
451 position: absolute;
452 right: 0px;
453 }
454 }
455
456 .shape-main {
457 height: calc(100% - 40px);
458 }
459
460 .table_panel {
461 height: calc(100% - 40px) !important;
462 }
361 </style> 463 </style>
......
...@@ -90,6 +90,10 @@ const getExecGuid = async () => { ...@@ -90,6 +90,10 @@ const getExecGuid = async () => {
90 } 90 }
91 91
92 92
93 //
94
95
96
93 onMounted(() => { 97 onMounted(() => {
94 getCgDirTreeData(); 98 getCgDirTreeData();
95 getCgDirFieldPage(); 99 getCgDirFieldPage();
...@@ -364,9 +368,9 @@ const dataBaseTableInfo = ref({ ...@@ -364,9 +368,9 @@ const dataBaseTableInfo = ref({
364 fixedSelection: true, 368 fixedSelection: true,
365 fields: [ 369 fields: [
366 { label: "序号", type: "index", width: 56, align: "center" }, 370 { label: "序号", type: "index", width: 56, align: "center" },
367 { label: "数据源", field: "cgDirName", width: 140 }, 371 { label: "数据源", field: "databaseChName", width: 140 },
368 { label: "表名称", field: "tableName", width: 180 }, 372 { label: "表名称", field: "tableChName", width: 180 },
369 { label: "数据库表", field: "tableChName", width: 120 }, 373 { label: "数据库表", field: "tableName", width: 120 },
370 { 374 {
371 label: "新建方式", field: "foundMode", width: 140, getName: (scope) => { 375 label: "新建方式", field: "foundMode", width: 140, getName: (scope) => {
372 let dataGrade = scope.row.foundMode; 376 let dataGrade = scope.row.foundMode;
...@@ -380,7 +384,7 @@ const dataBaseTableInfo = ref({ ...@@ -380,7 +384,7 @@ const dataBaseTableInfo = ref({
380 return status == 0 ? '草稿中' : status == 1 ? '已建表' : '已有默认表'; 384 return status == 0 ? '草稿中' : status == 1 ? '已建表' : '已有默认表';
381 } 385 }
382 }, 386 },
383 { label: "任务修改人", field: "damName", width: 120 }, 387 { label: "任务修改人", field: "updateUserName", width: 120 },
384 { label: "修改时间", field: "updateTime", width: TableColumnWidth.DATETIME }, 388 { label: "修改时间", field: "updateTime", width: TableColumnWidth.DATETIME },
385 { label: "描述", field: "description", width: 120, align: 'center' }, 389 { label: "描述", field: "description", width: 120, align: 'center' },
386 { label: "规划数据资产", field: "isDataAsset", type: 'switch', activeText: '是', inactiveText: '否', activeValue: 'Y', inactiveValue: 'N', switchWidth: 56, width: 120, align: 'center' }, 390 { label: "规划数据资产", field: "isDataAsset", type: 'switch', activeText: '是', inactiveText: '否', activeValue: 'Y', inactiveValue: 'N', switchWidth: 56, width: 120, align: 'center' },
...@@ -397,31 +401,35 @@ const dataBaseTableInfo = ref({ ...@@ -397,31 +401,35 @@ const dataBaseTableInfo = ref({
397 type: "btn", 401 type: "btn",
398 width: 300, 402 width: 300,
399 fixed: 'right', 403 fixed: 'right',
400 btns: [ 404 btns: (scope) => {
401 { 405 return [
402 label: "配置业务规则", value: "edit", click: (scope) => { 406 {
403 console.log('编辑', scope); 407 label: "配置业务规则", value: "edit", click: (scope) => {
404 // 路由跳转configure-rules 408 console.log('编辑', scope);
405 router.push({ 409 // 路由跳转configure-rules
406 name: 'configureRules', 410 router.push({
407 query: { 411 name: 'configureRules',
408 cgDirName: scope.row.cgDirName, 412 query: {
409 tableName: scope.row.tableName, 413 cgDirName: scope.row.cgDirName,
410 tableChName: scope.row.tableChName, 414 tableName: scope.row.tableName,
411 tableGuid: scope.row.tableGuid, 415 tableChName: scope.row.tableChName,
412 description: scope.row.description, 416 tableGuid: scope.row.tableGuid,
413 execGuid: execGuidInfo.value.execGuid 417 description: scope.row.description,
414 } 418 execGuid: execGuidInfo.value.execGuid
415 }); 419 }
420 });
421 }
422 },
423 {
424 label: "编辑表结构", value: "edit", click: (scope) => {
425 console.log('复制', scope);
426 },
427 disabled: scope.row.state !== 2 ? false : true
416 } 428 }
417 }, 429 ]
430 }
431
418 432
419 {
420 label: "编辑表结构", value: "copy", click: (scope) => {
421 console.log('复制', scope);
422 }
423 }
424 ]
425 433
426 }, 434 },
427 loading: false 435 loading: false
...@@ -687,7 +695,7 @@ const getDataBaseTableData = async (params = {}) => { ...@@ -687,7 +695,7 @@ const getDataBaseTableData = async (params = {}) => {
687 pageIndex: 1, 695 pageIndex: 1,
688 pageSize: 10, 696 pageSize: 10,
689 databaseGuid: "", 697 databaseGuid: "",
690 isDataAsset: checked.value ? 'Y' : 'N', 698 isDataAsset: '',
691 execGuid: execGuidInfo.value.execGuid, 699 execGuid: execGuidInfo.value.execGuid,
692 }; 700 };
693 const finalParams = { ...dataBaseParams, ...params }; 701 const finalParams = { ...dataBaseParams, ...params };
...@@ -727,7 +735,9 @@ const getDataBaseFieldData = async (params = {}) => { ...@@ -727,7 +735,9 @@ const getDataBaseFieldData = async (params = {}) => {
727 tableGuid: "", 735 tableGuid: "",
728 execGuid: execGuidInfo.value.execGuid, 736 execGuid: execGuidInfo.value.execGuid,
729 databaseGuid: "", 737 databaseGuid: "",
730 isDataAsset: checked.value ? 'Y' : 'N', 738 isDataAsset: '',
739 fieldName: '',
740 gradeDetailName: '',
731 }; 741 };
732 const finalParams = { ...dataBaseParams, ...params }; 742 const finalParams = { ...dataBaseParams, ...params };
733 743
...@@ -773,11 +783,14 @@ const tableFieldsDataInfo = ref({ ...@@ -773,11 +783,14 @@ const tableFieldsDataInfo = ref({
773 783
774 784
775 const showTableOrDatabase = ref(true); 785 const showTableOrDatabase = ref(true);
786 const isShowCreateBtn = ref(false);
776 // 定义tableGuid 787 // 定义tableGuid
777 const tableGuid = ref(''); 788 const tableGuid = ref('');
778 const dataBaseGuid = ref(''); 789 const dataBaseGuid = ref('');
790 const dataBaseInfo = ref<any>({});
779 791
780 const dataBasenodeClick = (data: any) => { 792 const dataBasenodeClick = (data: any) => {
793 isShowCreateBtn.value = false;
781 console.log('dataBasenodeClick', data); 794 console.log('dataBasenodeClick', data);
782 if (data.cgDirName) { 795 if (data.cgDirName) {
783 tableGuid.value = ''; 796 tableGuid.value = '';
...@@ -786,7 +799,9 @@ const dataBasenodeClick = (data: any) => { ...@@ -786,7 +799,9 @@ const dataBasenodeClick = (data: any) => {
786 getDataBaseTableData(); 799 getDataBaseTableData();
787 } 800 }
788 if (data.databaseGuid) { 801 if (data.databaseGuid) {
802 dataBaseInfo.value = data;
789 dataBaseGuid.value = data.databaseGuid; 803 dataBaseGuid.value = data.databaseGuid;
804 isShowCreateBtn.value = true;
790 tableGuid.value = ''; 805 tableGuid.value = '';
791 getDataBaseFieldData({ 806 getDataBaseFieldData({
792 databaseGuid: data.databaseGuid 807 databaseGuid: data.databaseGuid
...@@ -801,9 +816,9 @@ const dataBasenodeClick = (data: any) => { ...@@ -801,9 +816,9 @@ const dataBasenodeClick = (data: any) => {
801 getDataBaseFieldData({ 816 getDataBaseFieldData({
802 tableGuid: data.tableGuid 817 tableGuid: data.tableGuid
803 }); 818 });
804 getDataBaseTableData({ 819 // getDataBaseTableData({
805 tableGuid: data.tableGuid 820 // tableGuid: data.tableGuid
806 }); 821 // });
807 } 822 }
808 823
809 if (data.databaseGuid || data.cgDirName) { 824 if (data.databaseGuid || data.cgDirName) {
...@@ -826,7 +841,8 @@ const handleSubjectTableCommand = (command: string) => { ...@@ -826,7 +841,8 @@ const handleSubjectTableCommand = (command: string) => {
826 router.push({ 841 router.push({
827 name: 'tableCreateFile', 842 name: 'tableCreateFile',
828 query: { 843 query: {
829 type: 'tableCreateFile' 844 type: 'tableCreateFile',
845 foundMode: 2
830 } 846 }
831 }); 847 });
832 } else if (command === 'existingCreate') { 848 } else if (command === 'existingCreate') {
...@@ -834,7 +850,11 @@ const handleSubjectTableCommand = (command: string) => { ...@@ -834,7 +850,11 @@ const handleSubjectTableCommand = (command: string) => {
834 router.push({ 850 router.push({
835 name: 'tableCreateExisting', 851 name: 'tableCreateExisting',
836 query: { 852 query: {
837 execGuid: execGuidInfo.value.execGuid 853 execGuid: execGuidInfo.value.execGuid,
854 foundMode: 1,
855 database: dataBaseInfo.value.database,
856 databaseChName: dataBaseInfo.value.databaseChName,
857 databaseGuid: dataBaseInfo.value.databaseGuid,
838 } 858 }
839 }); 859 });
840 } 860 }
...@@ -1033,7 +1053,7 @@ loadOptionsA(); ...@@ -1033,7 +1053,7 @@ loadOptionsA();
1033 1053
1034 <div class="btns-area" v-if="!tableGuid && activeTab === 'table'"> 1054 <div class="btns-area" v-if="!tableGuid && activeTab === 'table'">
1035 <div class="left-btns"> 1055 <div class="left-btns">
1036 <div class="dropdown_btn"> 1056 <div class="dropdown_btn" v-if="isShowCreateBtn">
1037 <el-dropdown popper-class="table-create-menu" @command="handleSubjectTableCommand" 1057 <el-dropdown popper-class="table-create-menu" @command="handleSubjectTableCommand"
1038 placement="bottom-start" trigger="click"> 1058 placement="bottom-start" trigger="click">
1039 <span class="el-dropdown-link"> 1059 <span class="el-dropdown-link">
......
...@@ -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) {
108 const [symbol, value] = row.fieldLengthCondition.split('#'); 107 // 编辑fieldLengthCondition
109 row.lengthSymbol = symbol; // 初始化符号部分 108 if (row.fieldLengthCondition) {
110 row.lengthValue = value; // 初始化数值部分 109 const [symbol, value] = row.fieldLengthCondition.split('#');
110 row.lengthSymbol = symbol; // 初始化符号部分
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
......
...@@ -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,
......
...@@ -149,6 +149,7 @@ const handleClassDataEdit = (params) => { ...@@ -149,6 +149,7 @@ const handleClassDataEdit = (params) => {
149 149
150 // 配置分类 150 // 配置分类
151 const handleClassDataClick = (item, des = '') => { 151 const handleClassDataClick = (item, des = '') => {
152 console.log(item, 'i111tem');
152 // 获取分级标准 153 // 获取分级标准
153 router.push({ 154 router.push({
154 name: 'classStandardEdit', 155 name: 'classStandardEdit',
...@@ -156,7 +157,8 @@ const handleClassDataClick = (item, des = '') => { ...@@ -156,7 +157,8 @@ const handleClassDataClick = (item, des = '') => {
156 guid: item.guid, 157 guid: item.guid,
157 type: des === '' ? '配置' : des, 158 type: des === '' ? '配置' : des,
158 classStandardName: item.name, 159 classStandardName: item.name,
159 refGradeGuid: item.refGradeGuid 160 refGradeGuid: item.refGradeGuid,
161 description: item.description
160 } 162 }
161 }); 163 });
162 } 164 }
...@@ -248,6 +250,7 @@ const newCreateClassStandardDialogInfo = ref({ ...@@ -248,6 +250,7 @@ const newCreateClassStandardDialogInfo = ref({
248 newCreateClassStandardDialogInfo.value.visible = false; 250 newCreateClassStandardDialogInfo.value.visible = false;
249 }, 251 },
250 submit: async (btn, info) => { 252 submit: async (btn, info) => {
253
251 if (newCreateClassStandardDialogInfo.value.title === '新增分类') { 254 if (newCreateClassStandardDialogInfo.value.title === '新增分类') {
252 newCreateClassStandardDialogInfo.value.submitBtnLoading = true; 255 newCreateClassStandardDialogInfo.value.submitBtnLoading = true;
253 const params = { 256 const params = {
...@@ -263,6 +266,22 @@ const newCreateClassStandardDialogInfo = ref({ ...@@ -263,6 +266,22 @@ const newCreateClassStandardDialogInfo = ref({
263 type: 'success', 266 type: 'success',
264 message: '新增分类成功' 267 message: '新增分类成功'
265 }) 268 })
269
270 nextTick(() => {
271 // 拿到新增的分类数据,跳转到配置页面
272 const item = classListData.value.find(item => item.name === info.classStandardName);
273 console.log(item, 'item---------------');
274 if (item) {
275 const params = {
276 name: item.name,
277 guid: item.guid,
278 refGradeGuid: item.refGradeGuid,
279 description: item.description
280 }
281 handleClassDataClick(params, '');
282 }
283 })
284
266 newCreateClassStandardDialogInfo.value.submitBtnLoading = false; 285 newCreateClassStandardDialogInfo.value.submitBtnLoading = false;
267 newCreateClassStandardDialogInfo.value.visible = false; 286 newCreateClassStandardDialogInfo.value.visible = false;
268 } else { 287 } else {
...@@ -343,7 +362,7 @@ const newCreateGradeStandardDialogInfo = ref({ ...@@ -343,7 +362,7 @@ const newCreateGradeStandardDialogInfo = ref({
343 await getClassifyGradListData(); 362 await getClassifyGradListData();
344 proxy.$ElMessage({ 363 proxy.$ElMessage({
345 type: 'success', 364 type: 'success',
346 message: '新增分成功' 365 message: '新增分成功'
347 }) 366 })
348 367
349 // 拿到新增的分级数据,跳转到配置页面 368 // 拿到新增的分级数据,跳转到配置页面
...@@ -372,7 +391,7 @@ const newCreateGradeStandardDialogInfo = ref({ ...@@ -372,7 +391,7 @@ const newCreateGradeStandardDialogInfo = ref({
372 getClassifyGradListData(); 391 getClassifyGradListData();
373 proxy.$ElMessage({ 392 proxy.$ElMessage({
374 type: 'success', 393 type: 'success',
375 message: '修改分成功' 394 message: '修改分成功'
376 }) 395 })
377 newCreateGradeStandardDialogInfo.value.visible = false; 396 newCreateGradeStandardDialogInfo.value.visible = false;
378 } else { 397 } else {
...@@ -437,6 +456,7 @@ const handleClassifyGradDataClick = (item) => { ...@@ -437,6 +456,7 @@ const handleClassifyGradDataClick = (item) => {
437 } 456 }
438 457
439 const newCreateGrade = () => { 458 const newCreateGrade = () => {
459 newCreateGradeStandardDialogInfo.value.submitBtnLoading = false;
440 newCreateGradeStandardDialogInfo.value.visible = true; 460 newCreateGradeStandardDialogInfo.value.visible = true;
441 newCreateGradeFormItems.value.forEach(item => item.default = ''); 461 newCreateGradeFormItems.value.forEach(item => item.default = '');
442 } 462 }
...@@ -539,7 +559,7 @@ const newCreateGrade = () => { ...@@ -539,7 +559,7 @@ const newCreateGrade = () => {
539 </template> 559 </template>
540 <div class="levitation-ul"> 560 <div class="levitation-ul">
541 <span class="levitation-li" @click="handleClassDataClick(item)">配置</span> 561 <span class="levitation-li" @click="handleClassDataClick(item)">配置</span>
542 <span class="levitation-li" @click="handleClassDataEdit(item)">编辑</span> 562 <!-- <span class="levitation-li" @click="handleClassDataEdit(item)">编辑</span> -->
543 <span class="levitation-li" @click="handleClassDataDel(item)">删除</span> 563 <span class="levitation-li" @click="handleClassDataDel(item)">删除</span>
544 </div> 564 </div>
545 </el-popover> 565 </el-popover>
...@@ -572,7 +592,7 @@ const newCreateGrade = () => { ...@@ -572,7 +592,7 @@ const newCreateGrade = () => {
572 </template> 592 </template>
573 <div class="levitation-ul"> 593 <div class="levitation-ul">
574 <span class="levitation-li" @click="handleClassifyGradDataClick(item)">配置</span> 594 <span class="levitation-li" @click="handleClassifyGradDataClick(item)">配置</span>
575 <span class="levitation-li" @click="handleClassifyGradDataEdit(item)">编辑</span> 595 <!-- <span class="levitation-li" @click="handleClassifyGradDataEdit(item)">编辑</span> -->
576 <span class="levitation-li" @click="handleClassifyGradDataDel(item)">删除</span> 596 <span class="levitation-li" @click="handleClassifyGradDataDel(item)">删除</span>
577 </div> 597 </div>
578 </el-popover> 598 </el-popover>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!