982abf9d by lxs

Merge branch 'develop' of http://117.78.60.236:8000/csbr-daop/fe-data-asset-management into develop

2 parents 8d73b563 0cf12b6f
...@@ -73,8 +73,8 @@ VITE_API_MESSAGE = ms-swzl-message-notification-service ...@@ -73,8 +73,8 @@ VITE_API_MESSAGE = ms-swzl-message-notification-service
73 #新门户接口 73 #新门户接口
74 VITE_API_NEW_PORTAL = ms-daop-zcgl-asset-dam-service 74 VITE_API_NEW_PORTAL = ms-daop-zcgl-asset-dam-service
75 75
76 #企业信息接口 76 #人员服务
77 VITE_API_PERSONEL_SERVICE = ms-daop-personel-service 77 VITE_APP_PERSONAL_URL = 'ms-daop-personel-service'
78 78
79 # 是否在打包时生成 sourcemap 79 # 是否在打包时生成 sourcemap
80 VITE_BUILD_SOURCEMAP = false 80 VITE_BUILD_SOURCEMAP = false
......
...@@ -94,7 +94,11 @@ VITE_APP_CAMUNDA_URL = 'ms-daop-camunda-server' ...@@ -94,7 +94,11 @@ VITE_APP_CAMUNDA_URL = 'ms-daop-camunda-server'
94 94
95 #门户接口 95 #门户接口
96 VITE_API_PORTALURL = https://swzl-test.zgsjzc.com/portal 96 VITE_API_PORTALURL = https://swzl-test.zgsjzc.com/portal
97 #新门户接口
98 VITE_API_NEW_PORTAL = ms-daop-zcgl-asset-dam-service
97 99
100 #人员服务
101 VITE_APP_PERSONAL_URL = 'ms-daop-personel-service'
98 #数据资产接口地址 102 #数据资产接口地址
99 VITE_API_ASSET_BASEURL = ms-swzl-data-dam-service 103 VITE_API_ASSET_BASEURL = ms-swzl-data-dam-service
100 104
......
This diff could not be displayed because it is too large.
...@@ -756,7 +756,13 @@ export const updateDbDirTable = (data) => request({ ...@@ -756,7 +756,13 @@ export const updateDbDirTable = (data) => request({
756 export const createTableSql = (data) => request({ 756 export const createTableSql = (data) => request({
757 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/table/create-table-sql`, 757 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/table/create-table-sql`,
758 method: 'post', 758 method: 'post',
759 data 759 data,
760 responseType: 'blob',
761 })
762 /**删除新建表 */
763 export const deleteDbDirTable = (params) => request({
764 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/table/del?tableGuid=${params.tableGuid}`,
765 method: 'get',
760 }) 766 })
761 767
762 /** 768 /**
...@@ -788,7 +794,7 @@ export const exportDbDirTable = (params) => request({ ...@@ -788,7 +794,7 @@ export const exportDbDirTable = (params) => request({
788 * 794 *
789 */ 795 */
790 export const getDbDirDetail = (params) => request({ 796 export const getDbDirDetail = (params) => request({
791 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/detail?tableGuid=${params.tableGuid}`, 797 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/detail?tableGuid=${params.tableGuid}&execGuid=${params.execGuid}`,
792 method: 'get', 798 method: 'get',
793 }) 799 })
794 800
...@@ -834,3 +840,14 @@ export const getFidldEnName = (data) => request({ ...@@ -834,3 +840,14 @@ export const getFidldEnName = (data) => request({
834 method: 'post', 840 method: 'post',
835 data 841 data
836 }) 842 })
843
844 /**
845 * 数据库目录-查询字段分类分级
846 * @param {Object}
847 * @path /db-dir/field/get-classify-and-grade
848 */
849 export const getFieldClassifyAndGrade = (data) => request({
850 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/field/get-classify-and-grade`,
851 method: 'post',
852 data
853 })
......
...@@ -69,7 +69,7 @@ export const saveMetaReportAnalysis = (params) => request({ ...@@ -69,7 +69,7 @@ export const saveMetaReportAnalysis = (params) => request({
69 **/ 69 **/
70 // 树形数据 70 // 树形数据
71 export const getMetaTreeData = (params) => request({ 71 export const getMetaTreeData = (params) => request({
72 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-table/meta-tree-list`, 72 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-table/meta-tree-list?isImportCreate=${params.isImportCreate}`,
73 method: 'post', 73 method: 'post',
74 data: params 74 data: params
75 }) 75 })
......
...@@ -13,7 +13,7 @@ export const getProductList = (params) => request({ ...@@ -13,7 +13,7 @@ export const getProductList = (params) => request({
13 13
14 /** 获取已添加的数据产品列表 */ 14 /** 获取已添加的数据产品列表 */
15 export const getAddedProductList = (params) => request({ 15 export const getAddedProductList = (params) => request({
16 url: `${import.meta.env.VITE_API_ASSET_BASEURL}/product-grounding/list-select`, 16 url: `${import.meta.env.VITE_API_NEW_PORTAL}/product-grounding/list-select`,
17 method: 'post', 17 method: 'post',
18 data: params 18 data: params
19 }) 19 })
...@@ -27,35 +27,43 @@ export const getListingList = (params) => request({ ...@@ -27,35 +27,43 @@ export const getListingList = (params) => request({
27 27
28 /** 获取数据产品上架详情 */ 28 /** 获取数据产品上架详情 */
29 export const getListingDetail = (params) => request({ 29 export const getListingDetail = (params) => request({
30 url: `${import.meta.env.VITE_API_ASSET_BASEURL}/product-grounding/detail`, 30 url: `${import.meta.env.VITE_API_NEW_PORTAL}/product-grounding/detail`,
31 method: 'get', 31 method: 'get',
32 params 32 params
33 }) 33 })
34 34
35 /** 新增数据产品上架信息 */ 35 /** 新增数据产品上架信息 */
36 export const listingSave = (params) => request({ 36 export const listingSave = (params) => request({
37 url: `${import.meta.env.VITE_API_ASSET_BASEURL}/product-grounding/save`, 37 url: `${import.meta.env.VITE_API_NEW_PORTAL}/product-grounding/save`,
38 method: 'post',
39 data: params
40 });
41
42 /**数据产品上架新增门户/product-grounding/save-gateway */
43
44 export const listingSavePortal = (params) => request({
45 url: `${import.meta.env.VITE_API_NEW_PORTAL}/product-grounding/save-gateway`,
38 method: 'post', 46 method: 'post',
39 data: params 47 data: params
40 }); 48 });
41 49
42 /** 更新数据产品上架信息 */ 50 /** 更新数据产品上架信息 */
43 export const listingUpdate = (params) => request({ 51 export const listingUpdate = (params) => request({
44 url: `${import.meta.env.VITE_API_ASSET_BASEURL}/product-grounding/update`, 52 url: `${import.meta.env.VITE_API_NEW_PORTAL}/product-grounding/update`,
45 method: 'post', 53 method: 'post',
46 data: params 54 data: params
47 }); 55 });
48 56
49 /** 删除数据产品上架信息 */ 57 /** 删除数据产品上架信息 */
50 export const listingDelete = (params) => request({ 58 export const listingDelete = (params) => request({
51 url: `${import.meta.env.VITE_API_ASSET_BASEURL}/product-grounding/delete`, 59 url: `${import.meta.env.VITE_API_NEW_PORTAL}/product-grounding/delete`,
52 method: 'delete', 60 method: 'delete',
53 data: params 61 data: params
54 }); 62 });
55 63
56 /** 更新数据产品上架状态及上架平台 */ 64 /** 更新数据产品上架状态及上架平台 */
57 export const listingUpdateStatus = (params) => request({ 65 export const listingUpdateStatus = (params) => request({
58 url: `${import.meta.env.VITE_API_ASSET_BASEURL}/product-grounding/update-grounding-pick`, 66 url: `${import.meta.env.VITE_API_NEW_PORTAL}/product-grounding/update-grounding-pick`,
59 method: 'post', 67 method: 'post',
60 data: params 68 data: params
61 }); 69 });
...@@ -65,75 +73,75 @@ export const listingUpdateStatus = (params) => request({ ...@@ -65,75 +73,75 @@ export const listingUpdateStatus = (params) => request({
65 **/ 73 **/
66 /** 获取数据需求列表。 */ 74 /** 获取数据需求列表。 */
67 export const getDemandList = (params) => request({ 75 export const getDemandList = (params) => request({
68 url: `${import.meta.env.VITE_API_ASSET_BASEURL}/demand-release/page-list`, 76 url: `${import.meta.env.VITE_API_NEW_PORTAL}/demand-release/page-list`,
69 method: 'post', 77 method: 'post',
70 data: params 78 data: params
71 }) 79 })
72 80
73 /** 获取数据需求发布详情 */ 81 /** 获取数据需求发布详情 */
74 export const getDemandDetail = (params) => request({ 82 export const getDemandDetail = (params) => request({
75 url: `${import.meta.env.VITE_API_ASSET_BASEURL}/demand-release/detail`, 83 url: `${import.meta.env.VITE_API_NEW_PORTAL}/demand-release/detail`,
76 method: 'get', 84 method: 'get',
77 params 85 params
78 }) 86 })
79 87
80 /** 新增数据需求发布信息 */ 88 /** 新增数据需求发布信息 */
81 export const demandSave = (params) => request({ 89 export const demandSave = (params) => request({
82 url: `${import.meta.env.VITE_API_ASSET_BASEURL}/demand-release/save`, 90 url: `${import.meta.env.VITE_API_NEW_PORTAL}/demand-release/save`,
83 method: 'post', 91 method: 'post',
84 data: params 92 data: params
85 }); 93 });
86 94
87 /** 新增竞赛需求发布 */ 95 /** 新增竞赛需求发布 */
88 export const competitionSave = (params) => request({ 96 export const competitionSave = (params) => request({
89 url: `${import.meta.env.VITE_API_ASSET_BASEURL}/demand-release/competition-save`, 97 url: `${import.meta.env.VITE_API_NEW_PORTAL}/demand-release/competition-save`,
90 method: 'post', 98 method: 'post',
91 data: params 99 data: params
92 }); 100 });
93 101
94 /** 新增要素市场需求发布 */ 102 /** 新增要素市场需求发布 */
95 export const marketSave = (params) => request({ 103 export const marketSave = (params) => request({
96 url: `${import.meta.env.VITE_API_ASSET_BASEURL}/demand-release/market-save`, 104 url: `${import.meta.env.VITE_API_NEW_PORTAL}/demand-release/market-save`,
97 method: 'post', 105 method: 'post',
98 data: params 106 data: params
99 }); 107 });
100 108
101 /** 更新数据需求发布信息 */ 109 /** 更新数据需求发布信息 */
102 export const demandUpdate = (params) => request({ 110 export const demandUpdate = (params) => request({
103 url: `${import.meta.env.VITE_API_ASSET_BASEURL}/demand-release/update`, 111 url: `${import.meta.env.VITE_API_NEW_PORTAL}/demand-release/update`,
104 method: 'post', 112 method: 'post',
105 data: params 113 data: params
106 }); 114 });
107 115
108 /** 更新竞赛发布信息 */ 116 /** 更新竞赛发布信息 */
109 export const competitionUpdate = (params) => request({ 117 export const competitionUpdate = (params) => request({
110 url: `${import.meta.env.VITE_API_ASSET_BASEURL}/demand-release/competition-update`, 118 url: `${import.meta.env.VITE_API_NEW_PORTAL}/demand-release/competition-update`,
111 method: 'post', 119 method: 'post',
112 data: params 120 data: params
113 }); 121 });
114 /** 更新数据要素市场发布信息 */ 122 /** 更新数据要素市场发布信息 */
115 export const marketUpdate = (params) => request({ 123 export const marketUpdate = (params) => request({
116 url: `${import.meta.env.VITE_API_ASSET_BASEURL}/demand-release/market-update`, 124 url: `${import.meta.env.VITE_API_NEW_PORTAL}/demand-release/market-update`,
117 method: 'post', 125 method: 'post',
118 data: params 126 data: params
119 }); 127 });
120 /** 删除数据需求发布信息 */ 128 /** 删除数据需求发布信息 */
121 export const demandDelete = (params) => request({ 129 export const demandDelete = (params) => request({
122 url: `${import.meta.env.VITE_API_ASSET_BASEURL}/demand-release/delete`, 130 url: `${import.meta.env.VITE_API_NEW_PORTAL}/demand-release/delete`,
123 method: 'delete', 131 method: 'delete',
124 data: params 132 data: params
125 }); 133 });
126 134
127 /** 更新数据需求发布状态及上架平台 */ 135 /** 更新数据需求发布状态及上架平台 */
128 export const demandUpdateStatus = (params) => request({ 136 export const demandUpdateStatus = (params) => request({
129 url: `${import.meta.env.VITE_API_ASSET_BASEURL}/demand-release/update-listing-Status`, 137 url: `${import.meta.env.VITE_API_NEW_PORTAL}/demand-release/update-listing-Status`,
130 method: 'post', 138 method: 'post',
131 data: params 139 data: params
132 }); 140 });
133 141
134 /** 验证数据需求名称唯一性 */ 142 /** 验证数据需求名称唯一性 */
135 export const checkDemandName = (params) => request({ 143 export const checkDemandName = (params) => request({
136 url: `${import.meta.env.VITE_API_ASSET_BASEURL}/demand-release/verify-data-name?dataName=${params}`, 144 url: `${import.meta.env.VITE_API_NEW_PORTAL}/demand-release/verify-data-name?dataName=${params}`,
137 method: 'get' 145 method: 'get'
138 }) 146 })
139 147
......
...@@ -64,8 +64,7 @@ export const getQualityTableRule = (params) => request({ ...@@ -64,8 +64,7 @@ export const getQualityTableRule = (params) => request({
64 /** 删除质检表规则 */ 64 /** 删除质检表规则 */
65 export const deleteQualityTableRule = (params) => request({ 65 export const deleteQualityTableRule = (params) => request({
66 url: `${import.meta.env.VITE_APP_QUALITY_BASEURL}/quality-model/conf/del?ruleConfGuid=${params}`, 66 url: `${import.meta.env.VITE_APP_QUALITY_BASEURL}/quality-model/conf/del?ruleConfGuid=${params}`,
67 method: 'delete', 67 method: 'delete'
68 data: params
69 }) 68 })
70 69
71 /** 更新质检表规则的禁用和启用状态 */ 70 /** 更新质检表规则的禁用和启用状态 */
...@@ -76,11 +75,18 @@ export const updateRuleBizState = (params) => request({ ...@@ -76,11 +75,18 @@ export const updateRuleBizState = (params) => request({
76 75
77 /** 获取数据库表列表 */ 76 /** 获取数据库表列表 */
78 export const getDatabase = (params) => request({ 77 export const getDatabase = (params) => request({
79 url: `${import.meta.env.VITE_APP_API_BASEURL}/data-source/get-source-list`, 78 url: `${import.meta.env.VITE_APP_DATA_SOURCE_URL}/data-source/get-source-list`,
80 method: 'post', 79 method: 'post',
81 data: params 80 data: params
82 }) 81 })
83 82
83 /** 获取盘点的数据库目录 */
84 export const getInventoryDsDir = () => request({
85 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/tree-list`,
86 method: 'post',
87 data: {}
88 })
89
84 /** 新建质检表,获取主题域分层的主题表树结构 */ 90 /** 新建质检表,获取主题域分层的主题表树结构 */
85 export const getSubjectTableTree = (params) => request({ 91 export const getSubjectTableTree = (params) => request({
86 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-catalog-directory/directory-tree-list`, 92 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-catalog-directory/directory-tree-list`,
...@@ -95,10 +101,10 @@ export const getSubjectTableByDomain = (params) => request({ ...@@ -95,10 +101,10 @@ export const getSubjectTableByDomain = (params) => request({
95 data: params 101 data: params
96 }) 102 })
97 103
98 /** 获取主题表的字段列表 */ 104 /** 获取主题表的字段列表,目前应包括盘点目录和元数据目录的表及字段 */
99 export const getSubjectFields = (params) => request({ 105 export const getSubjectFields = (tableGuid, dataSource) => request({
100 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-catalog-subject/field/list?subjectGuid=${params}`, 106 url: `${import.meta.env.VITE_APP_QUALITY_BASEURL}/quality-model/field/list-by-subject-guid?tableGuid=${tableGuid}&dataSource=${dataSource}`,
101 method: 'get', 107 method: 'post',
102 }) 108 })
103 109
104 /** 表的逻辑条件和sql检验。 */ 110 /** 表的逻辑条件和sql检验。 */
...@@ -138,23 +144,20 @@ export const getRuleTypeList = () => request({ ...@@ -138,23 +144,20 @@ export const getRuleTypeList = () => request({
138 144
139 // 获取规则大类的接口 145 // 获取规则大类的接口
140 export const getLargeCategoryList = () => request({ 146 export const getLargeCategoryList = () => request({
141 url:`${import.meta.env.VITE_APP_API_BASEURL}/data-dict/get-data-list`, 147 url: `${import.meta.env.VITE_APP_CONFIG_URL}/dict/data/get-by-dictType?dictType=${'规则大类'}`,
142 method: 'post', 148 method: 'get',
143 data: { paramCode: "LARGE-CATEGORY" }
144 }) 149 })
145 150
146 // 获取规则小类的接口 151 // 获取规则小类的接口
147 export const getSmallCategoryList = () => request({ 152 export const getSmallCategoryList = () => request({
148 url:`${import.meta.env.VITE_APP_API_BASEURL}/data-dict/get-data-list`, 153 url: `${import.meta.env.VITE_APP_CONFIG_URL}/dict/data/get-by-dictType?dictType=${'规则小类'}`,
149 method: 'post', 154 method: 'get',
150 data: { paramCode: "SMALL-CATEGORY" }
151 }) 155 })
152 156
153 // 获取规范性检验规则。 157 // 获取规范性检验规则。
154 export const getCheckRulesList = () => request({ 158 export const getCheckRulesList = () => request({
155 url:`${import.meta.env.VITE_APP_API_BASEURL}/data-dict/get-data-list`, 159 url: `${import.meta.env.VITE_APP_CONFIG_URL}/dict/data/get-by-dictType?dictType=${'正则校验'}`,
156 method: 'post', 160 method: 'get',
157 data: { paramCode: "REGULAR_RULE" }
158 }) 161 })
159 162
160 // 根据规则guid获取规则的详情信息。 163 // 根据规则guid获取规则的详情信息。
......
...@@ -23,6 +23,7 @@ export const parseAndDecodeUrl = (url:string) => { ...@@ -23,6 +23,7 @@ export const parseAndDecodeUrl = (url:string) => {
23 23
24 // 返回去掉主机信息和开头斜杠后的解码部分以及最后一个斜杠后面的内容 24 // 返回去掉主机信息和开头斜杠后的解码部分以及最后一个斜杠后面的内容
25 return { 25 return {
26 fileName: pathname,
26 decodedPath: pathname + search + hash, 27 decodedPath: pathname + search + hash,
27 lastPart: lastPart 28 lastPart: lastPart
28 }; 29 };
......
...@@ -33,6 +33,13 @@ export const getSystemMenu = (params) => { ...@@ -33,6 +33,13 @@ export const getSystemMenu = (params) => {
33 }); 33 });
34 }; 34 };
35 35
36 export const getCurrentUserInfo = (tenantGuid) => {
37 return request({
38 url: `${import.meta.env.VITE_APP_PERSONAL_URL}/staff/data/get-current-staff?tenantGuid=${tenantGuid}`,
39 method: "post",
40 });
41 };
42
36 // 获取当前用户对应的产品和菜单 43 // 获取当前用户对应的产品和菜单
37 export const getUserInfo = () => { 44 export const getUserInfo = () => {
38 return request({ 45 return request({
......
...@@ -99,10 +99,16 @@ const onClickOutside = (e: any) => { ...@@ -99,10 +99,16 @@ const onClickOutside = (e: any) => {
99 }; 99 };
100 100
101 const getDrawerConRef = (refName) => { 101 const getDrawerConRef = (refName) => {
102 console.log(refName, '----------')
102 if (refName == 'drawerTableRef') { 103 if (refName == 'drawerTableRef') {
103 const dtf = drawerTableRef.value[0] || drawerTableRef.value 104 const dtf = drawerTableRef.value[0] || drawerTableRef.value
104 return dtf?.tableRef 105 return dtf?.tableRef
105 } 106 }
107 // const drawerForm = drawerFormRef.value[0] || drawerFormRef.value;
108 if (refName == 'drawerFormRef') {
109 const drawerForm = drawerFormRef.value[0] || drawerFormRef.value;
110 return drawerForm
111 }
106 } 112 }
107 113
108 defineExpose({ 114 defineExpose({
......
...@@ -205,6 +205,10 @@ const inputChange = (val, row) => { ...@@ -205,6 +205,10 @@ const inputChange = (val, row) => {
205 205
206 /** 输入框输入触发事件 */ 206 /** 输入框输入触发事件 */
207 const inputEventChange = (val, item) => { 207 const inputEventChange = (val, item) => {
208 if (val === '' && item.clearable) {
209 formInline.value[item.field] = '';
210 return;
211 }
208 if (item.regexp) { 212 if (item.regexp) {
209 formInline.value[item.field] = val.replace(item.regexp, ''); 213 formInline.value[item.field] = val.replace(item.regexp, '');
210 if (item.min != null && (formInline.value[item.field] < item.min)) { 214 if (item.min != null && (formInline.value[item.field] < item.min)) {
...@@ -337,7 +341,8 @@ const handlePictureCardPreview = (file, item) => { ...@@ -337,7 +341,8 @@ const handlePictureCardPreview = (file, item) => {
337 const onUploadFilePreview = async (file, item) => { 341 const onUploadFilePreview = async (file, item) => {
338 let f = formInline.value[item.field].find(i => i.name == file.name); 342 let f = formInline.value[item.field].find(i => i.name == file.name);
339 let url = f.url; 343 let url = f.url;
340 const refSignInfo: any = await getDownFileSignByUrl(parseAndDecodeUrl(url).decodedPath); 344 let fileName: string = parseAndDecodeUrl(url).fileName;
345 const refSignInfo: any = await getDownFileSignByUrl(fileName);
341 if (!refSignInfo?.data) { 346 if (!refSignInfo?.data) {
342 refSignInfo?.msg && ElMessage.error(refSignInfo?.msg); 347 refSignInfo?.msg && ElMessage.error(refSignInfo?.msg);
343 return; 348 return;
...@@ -360,7 +365,7 @@ const onUploadFilePreview = async (file, item) => { ...@@ -360,7 +365,7 @@ const onUploadFilePreview = async (file, item) => {
360 } 365 }
361 366
362 const downloadTemplate = async (url) => { 367 const downloadTemplate = async (url) => {
363 const refSignInfo: any = await getDownFileSignByUrl(parseAndDecodeUrl(url).decodedPath); 368 const refSignInfo: any = await getDownFileSignByUrl(parseAndDecodeUrl(url).fileName);
364 if (!refSignInfo?.data) { 369 if (!refSignInfo?.data) {
365 refSignInfo?.msg && ElMessage.error(refSignInfo?.msg); 370 refSignInfo?.msg && ElMessage.error(refSignInfo?.msg);
366 return; 371 return;
...@@ -379,7 +384,7 @@ const downloadTemplate = async (url) => { ...@@ -379,7 +384,7 @@ const downloadTemplate = async (url) => {
379 384
380 const onUploadFileDownload = async (file, item) => { 385 const onUploadFileDownload = async (file, item) => {
381 let url = file.url; 386 let url = file.url;
382 const refSignInfo: any = await getDownFileSignByUrl(parseAndDecodeUrl(url).decodedPath); 387 const refSignInfo: any = await getDownFileSignByUrl(parseAndDecodeUrl(url).fileName);
383 if (!refSignInfo?.data) { 388 if (!refSignInfo?.data) {
384 refSignInfo?.msg && ElMessage.error(refSignInfo?.msg); 389 refSignInfo?.msg && ElMessage.error(refSignInfo?.msg);
385 return; 390 return;
...@@ -1137,7 +1142,8 @@ const panelChange = (scope, row) => { ...@@ -1137,7 +1142,8 @@ const panelChange = (scope, row) => {
1137 :value="child.props?.value ? opts[child.props.value] : opts.value" :disabled="opts.disabled" /> 1142 :value="child.props?.value ? opts[child.props.value] : opts.value" :disabled="opts.disabled" />
1138 </el-select> 1143 </el-select>
1139 <el-input v-else v-model.trim="formInline[child.field]" :placeholder="child.placeholder" 1144 <el-input v-else v-model.trim="formInline[child.field]" :placeholder="child.placeholder"
1140 :clearable="child.clearable" :maxlength="child.maxlength ?? ''" /> 1145 :clearable="child.clearable" :maxlength="child.maxlength ?? ''"
1146 @change="(val) => inputChange(val, child)" @input="(val) => inputEventChange(val, child)" />
1141 </el-form-item> 1147 </el-form-item>
1142 </template> 1148 </template>
1143 </div> 1149 </div>
......
...@@ -90,6 +90,10 @@ const pageInfo = computed(() => { ...@@ -90,6 +90,10 @@ const pageInfo = computed(() => {
90 return props.tableInfo.page; 90 return props.tableInfo.page;
91 }); 91 });
92 92
93 // const expandRowKeys = computed(() => {
94 // return Array.isArray(props.tableInfo.expandedKey) ? props.tableInfo.expandedKey : [];;
95 // });
96
93 const tableRowClassName = (row, rowIndex) => { 97 const tableRowClassName = (row, rowIndex) => {
94 if (rowIndex === 1) { 98 if (rowIndex === 1) {
95 return "warning-row"; 99 return "warning-row";
...@@ -236,7 +240,7 @@ onMounted(() => { ...@@ -236,7 +240,7 @@ onMounted(() => {
236 :show-header="props.tableInfo.showHeader ?? true" stripe :border="props.tableInfo.border 240 :show-header="props.tableInfo.showHeader ?? true" stripe :border="props.tableInfo.border
237 ?? true" :height="props.tableInfo.height === null ? null : (props.tableInfo.height ?? '100%')" 241 ?? true" :height="props.tableInfo.height === null ? null : (props.tableInfo.height ?? '100%')"
238 :max-height="maxHeight" :row-key="rowKey" :current-row-key="currentRowKey" :row-class-name="rowClassName" 242 :max-height="maxHeight" :row-key="rowKey" :current-row-key="currentRowKey" :row-class-name="rowClassName"
239 :expand-row-keys="props.tableInfo.expandRowKeys" v-loading="tableDataLoading" @row-click="rowClick" 243 :expand-row-keys="props.tableInfo.expandedKey" v-loading="tableDataLoading" @row-click="rowClick"
240 @row-dblclick="rowDblClick" @selection-change="selectionChange" @select="tableCheckboxSelectChange" 244 @row-dblclick="rowDblClick" @selection-change="selectionChange" @select="tableCheckboxSelectChange"
241 @select-all="tableCheckboxAllSelectChange" style="width: 100%; display: inline-block" 245 @select-all="tableCheckboxAllSelectChange" style="width: 100%; display: inline-block"
242 :style="{ 'min-height': props.tableInfo.minHeight ?? '200px' }" tooltip-effect="light" 246 :style="{ 'min-height': props.tableInfo.minHeight ?? '200px' }" tooltip-effect="light"
......
...@@ -5,9 +5,15 @@ import useSettingsStore from '@/store/modules/settings' ...@@ -5,9 +5,15 @@ import useSettingsStore from '@/store/modules/settings'
5 import type { Menu } from '#/global' 5 import type { Menu } from '#/global'
6 import { getDownloadUrl, download } from "@/utils/common"; 6 import { getDownloadUrl, download } from "@/utils/common";
7 import { getImageContent } from "@/api/modules/queryService"; 7 import { getImageContent } from "@/api/modules/queryService";
8 import {createSVG } from "@/utils/common" 8 import { createSVG } from "@/utils/common"
9 import { onBeforeMount } from "vue" 9 import { onBeforeMount } from "vue"
10 import { resolve } from 'path-browserify'; 10 import { resolve } from 'path-browserify';
11 import { ElMessage } from "element-plus";
12 import {
13 parseAndDecodeUrl,
14 getDownFileSignByUrl,
15 obsDownloadRequest
16 } from '@/api/modules/obsService';
11 const props = defineProps({ 17 const props = defineProps({
12 item: { 18 item: {
13 type: Object as () => Menu.recordRaw, 19 type: Object as () => Menu.recordRaw,
...@@ -19,7 +25,7 @@ const props = defineProps({ ...@@ -19,7 +25,7 @@ const props = defineProps({
19 }, 25 },
20 }) 26 })
21 const settingsStore = useSettingsStore() 27 const settingsStore = useSettingsStore()
22 const item1:any = ref() 28 const item1: any = ref()
23 const hasChildren = computed(() => { 29 const hasChildren = computed(() => {
24 let flag = true 30 let flag = true
25 if (props.item.children) { 31 if (props.item.children) {
...@@ -32,70 +38,79 @@ const hasChildren = computed(() => { ...@@ -32,70 +38,79 @@ const hasChildren = computed(() => {
32 } 38 }
33 return flag 39 return flag
34 }) 40 })
35 onBeforeMount( async ()=>{ 41 onBeforeMount(async () => {
36 await getSvgElement(props.item) 42 await getSvgElement(props.item)
37 }) 43 })
38 const getSvgElement = async (item:any)=>{ 44 const getSvgElement = async (item: any) => {
45 console.log(item)
39 item1.value = item 46 item1.value = item
40 //// return new Promise( async (reslove,inject)=>{ 47 //// return new Promise( async (reslove,inject)=>{
41 if(item1.value.meta.icon && item1.value.meta.icon.indexOf("https")>-1) { 48 if (item1.value.meta.icon && item1.value.meta.icon.indexOf("https") > -1) {
42 const res1:any = await getImageContent(item1.value.meta?.icon) 49 const refSignInfo: any = await getDownFileSignByUrl(parseAndDecodeUrl(item1.value.meta.icon).fileName);
43 let ele:any 50 if (!refSignInfo?.data) {
44 if (res1 && !res1.msg) { 51 refSignInfo?.msg && ElMessage.error(refSignInfo?.msg);
45 let name = item1.value.meta?.icon; 52 return;
46 var fileSuffix = name ? name.substring(name.lastIndexOf('.') + 1) : ''; 53 }
47 if (fileSuffix === 'svg') { //浏览器可以支持图片和pdf预览 54 console.log(refSignInfo, '------')
48 let blob= getDownloadUrl(res1, name, fileSuffix,false) as Blob 55 const res1: any = await obsDownloadRequest(refSignInfo?.data)
49 ele = await createSVG(blob) 56 let ele: any
50 item1.value.meta.isEle = false 57 console.log(res1, '*********')
51 item1.value.meta.icon = ele 58 // if (res1 && !res1.msg) {
52 // reslove({}) 59 // ele = await createSVG(res1)
53 } 60 // item1.value.meta.isEle = false
54 } 61 // item1.value.meta.icon = ele
55 } 62 // // reslove({})
56 // reslove(122) 63 // }
64 }
65 }
66
67 // reslove(122)
57 // }) 68 // })
58 69
59 70
60 }
61 </script> 71 </script>
62 72
63 <template> 73 <template>
64 <div class="sidebar-item"> 74 <div class="sidebar-item">
65 <router-link v-if="!hasChildren" v-slot="{ href, navigate, isActive, isExactActive }" custom :to="resolveRoutePath(basePath, item1.path)"> 75 <router-link v-if="!hasChildren" v-slot="{ href, navigate, isActive, isExactActive }" custom
66 <a :href="item1.meta?.link ? item1.meta.link : href" :class="[isActive && 'router-link-active', isExactActive && 'router-link-exact-active']" :target="item.meta?.link ? '_blank' : '_self'" @click="navigate" v-preReClick> 76 :to="resolveRoutePath(basePath, item1.path)">
77 <a :href="item1.meta?.link ? item1.meta.link : href"
78 :class="[isActive && 'router-link-active', isExactActive && 'router-link-exact-active']"
79 :target="item.meta?.link ? '_blank' : '_self'" @click="navigate" v-preReClick>
67 <el-menu-item :title="item1.meta?.title ?? '[ 无标题 ]'" :index="resolveRoutePath(basePath, item1.path || '')"> 80 <el-menu-item :title="item1.meta?.title ?? '[ 无标题 ]'" :index="resolveRoutePath(basePath, item1.path || '')">
68 <el-icon v-if="item1.meta?.icon" class="title-icon" > 81 <el-icon v-if="item1.meta?.icon" class="title-icon">
69 <!-- <img :src="item.meta.icon" v-if="item.meta.icon.indexOf('http')>-1" alt=""> --> 82 <!-- <img :src="item.meta.icon" v-if="item.meta.icon.indexOf('http')>-1" alt=""> -->
70 83
71 <!-- {{ item.meta.icon }} --> 84 <!-- {{ item.meta.icon }} -->
72 <template v-if="item1.meta.icon.indexOf('svg')>-1"> 85 <template v-if="item1.meta.icon.indexOf('svg') > -1">
73 <i v-html="item1.meta.icon" :key="item1.meta.icon" v-if="!item1.meta.isEle"></i> 86 <i v-html="item1.meta.icon" :key="item1.meta.icon" v-if="!item1.meta.isEle"></i>
74 </template> 87 </template>
75 <template v-else> 88 <template v-else>
76 <svg-icon :name="item1.meta.icon"/> 89 <svg-icon :name="item1.meta.icon" />
77 </template> 90 </template>
78 </el-icon> 91 </el-icon>
79 <span class="title">{{ item1.meta?.title ?? '[ 无标题 ]' }}</span> 92 <span class="title">{{ item1.meta?.title ?? '[ 无标题 ]' }}</span>
80 </el-menu-item> 93 </el-menu-item>
81 </a> 94 </a>
82 </router-link> 95 </router-link>
83 <el-sub-menu v-else :title="item1.meta?.title ?? '[ 无标题 ]'" :index="settingsStore.settings.app.routeBaseOn !== 'filesystem' ? resolveRoutePath(basePath, item1.path) : JSON.stringify(item1)"> 96 <el-sub-menu v-else :title="item1.meta?.title ?? '[ 无标题 ]'"
97 :index="settingsStore.settings.app.routeBaseOn !== 'filesystem' ? resolveRoutePath(basePath, item1.path) : JSON.stringify(item1)">
84 <template #title> 98 <template #title>
85 <el-icon v-if="item1.meta?.icon" class="title-icon" > 99 <el-icon v-if="item1.meta?.icon" class="title-icon">
86 <!-- <img :src="item.meta.icon" v-if="item.meta.icon.indexOf('http')>-1" alt=""> 100 <!-- <img :src="item.meta.icon" v-if="item.meta.icon.indexOf('http')>-1" alt="">
87 <svg-icon :name="item.meta.icon" v-else /> --> 101 <svg-icon :name="item.meta.icon" v-else /> -->
88 <template v-if="item1.meta.icon.indexOf('svg')>-1"> 102 <template v-if="item1.meta.icon.indexOf('svg') > -1">
89 <i v-html="item1.meta.icon" :key="item1.meta.icon" v-if="!item1.meta.isEle"></i> 103 <i v-html="item1.meta.icon" :key="item1.meta.icon" v-if="!item1.meta.isEle"></i>
90 </template> 104 </template>
91 <template v-else> 105 <template v-else>
92 <svg-icon :name="item1.meta.icon"/> 106 <svg-icon :name="item1.meta.icon" />
93 </template> 107 </template>
94 </el-icon> 108 </el-icon>
95 <span class="title">{{ item.meta?.title ?? '[ 无标题 ]' }}</span> 109 <span class="title">{{ item.meta?.title ?? '[ 无标题 ]' }}</span>
96 </template> 110 </template>
97 <template v-for="route in (item1.children as Menu.recordRaw[])"> 111 <template v-for="route in (item1.children as Menu.recordRaw[])">
98 <SidebarItem v-if="route.meta?.sidebar !== false" :key="route.path" :item="route" :base-path="resolveRoutePath(basePath, item1.path)" /> 112 <SidebarItem v-if="route.meta?.sidebar !== false" :key="route.path" :item="route"
113 :base-path="resolveRoutePath(basePath, item1.path)" />
99 </template> 114 </template>
100 </el-sub-menu> 115 </el-sub-menu>
101 </div> 116 </div>
...@@ -128,7 +143,7 @@ const getSvgElement = async (item:any)=>{ ...@@ -128,7 +143,7 @@ const getSvgElement = async (item:any)=>{
128 color: #B2B2B2; 143 color: #B2B2B2;
129 } 144 }
130 145
131 .title-icon + .title { 146 .title-icon+.title {
132 margin-left: 10px; 147 margin-left: 10px;
133 } 148 }
134 149
...@@ -154,7 +169,7 @@ a { ...@@ -154,7 +169,7 @@ a {
154 } 169 }
155 170
156 .el-sub-menu__title { 171 .el-sub-menu__title {
157 > .badge { 172 >.badge {
158 &-dot { 173 &-dot {
159 right: 40px; 174 right: 40px;
160 } 175 }
...@@ -171,7 +186,7 @@ a { ...@@ -171,7 +186,7 @@ a {
171 background-color: var(--g-sub-sidebar-menu-bg) !important; 186 background-color: var(--g-sub-sidebar-menu-bg) !important;
172 187
173 .el-menu-item, 188 .el-menu-item,
174 .el-sub-menu > .el-sub-menu__title { 189 .el-sub-menu>.el-sub-menu__title {
175 color: var(--g-sub-sidebar-menu-color); 190 color: var(--g-sub-sidebar-menu-color);
176 background-color: var(--g-sub-sidebar-menu-bg) !important; 191 background-color: var(--g-sub-sidebar-menu-bg) !important;
177 192
...@@ -194,7 +209,7 @@ a { ...@@ -194,7 +209,7 @@ a {
194 } 209 }
195 210
196 .el-menu-item.is-active, 211 .el-menu-item.is-active,
197 .el-menu--collapse .el-sub-menu.is-active > .el-sub-menu__title, 212 .el-menu--collapse .el-sub-menu.is-active>.el-sub-menu__title,
198 .el-sub-menu .el-menu--inline .el-menu-item.is-active { 213 .el-sub-menu .el-menu--inline .el-menu-item.is-active {
199 color: var(--g-sub-sidebar-menu-active-color) !important; 214 color: var(--g-sub-sidebar-menu-active-color) !important;
200 background-color: var(--g-sub-sidebar-menu-active-bg) !important; 215 background-color: var(--g-sub-sidebar-menu-active-bg) !important;
...@@ -203,10 +218,12 @@ a { ...@@ -203,10 +218,12 @@ a {
203 .el-sub-menu__icon-arrow { 218 .el-sub-menu__icon-arrow {
204 color: unset; 219 color: unset;
205 } 220 }
221
206 .title-icon { 222 .title-icon {
207 color: var(--g-sub-sidebar-menu-active-color); 223 color: var(--g-sub-sidebar-menu-active-color);
208 } 224 }
209 } 225 }
226
210 svg { 227 svg {
211 g { 228 g {
212 fill: inherit !important; 229 fill: inherit !important;
......
...@@ -4,7 +4,7 @@ import router from '@/router' ...@@ -4,7 +4,7 @@ import router from '@/router'
4 import { ElMessage } from 'element-plus' 4 import { ElMessage } from 'element-plus'
5 import apiUser from '@/api/modules/user' 5 import apiUser from '@/api/modules/user'
6 import { getCurrentTime } from '@/utils/common' 6 import { getCurrentTime } from '@/utils/common'
7 import { getSystemMenu, getUserInfo, getTokenByCode, loginOut, refreshToken, editPasswordInterface, getCurrentUserInfo } from '@/api/modules/queryService' 7 import { getSystemMenu, getUserInfo, getTokenByCode, loginOut, refreshToken, editPasswordInterface, getCurrentUserInfo, getCurrentUserInfo } from '@/api/modules/queryService'
8 8
9 const useUserStore = defineStore( 9 const useUserStore = defineStore(
10 // 唯一ID 10 // 唯一ID
...@@ -52,21 +52,27 @@ const useUserStore = defineStore( ...@@ -52,21 +52,27 @@ const useUserStore = defineStore(
52 account.value = res.data.logonUser 52 account.value = res.data.logonUser
53 userId.value = res.data.userId 53 userId.value = res.data.userId
54 userName.value = res.data.userName 54 userName.value = res.data.userName
55 // userData.value = JSON.stringify(res.data.data);
55 currentTenantGuid.value = res.data.tenantInfoList && res.data.tenantInfoList.length ? res.data.tenantInfoList[0].guid : ''; 56 currentTenantGuid.value = res.data.tenantInfoList && res.data.tenantInfoList.length ? res.data.tenantInfoList[0].guid : '';
56 localStorage.setItem('currentTenantGuid', currentTenantGuid.value); 57 localStorage.setItem('currentTenantGuid', currentTenantGuid.value);
57 let currentTenant = res.data.tenantInfoList?.[0]; 58 let currentTenant = res.data.tenantInfoList?.[0];
58 return getCurrentUserInfo({ tenantGuid: currentTenantGuid.value }).then((result: any) => { 59 getCurrentUserInfo(currentTenantGuid.value).then((res: any) => {
60 console.log(res, 'getCurrentUserInfo');
61 if (res.code == '00000') {
62 localStorage.setItem('userData', JSON.stringify(res.data));
63 } else {
64 ElMessage.error(res.msg)
65 }
66 })
59 return getSystemMenu({ tenantGuid: currentTenantGuid.value }).then((info: any) => { 67 return getSystemMenu({ tenantGuid: currentTenantGuid.value }).then((info: any) => {
60 if (info.code == '00000') { 68 if (info.code == '00000') {
61 localStorage.setItem('userName', currentTenant?.name) 69 localStorage.setItem('userName', currentTenant?.name)
62 localStorage.setItem('userInfoData', JSON.stringify(info.data)); 70 localStorage.setItem('userInfoData', JSON.stringify(info.data));
63 userInfoData.value = info.data; 71 userInfoData.value = info.data;
64 localStorage.setItem('userData', JSON.stringify(result.data));
65 } else { 72 } else {
66 ElMessage.error(info.msg) 73 ElMessage.error(info.msg)
67 } 74 }
68 }) 75 })
69 })
70 } else { 76 } else {
71 isLogin.value = false; 77 isLogin.value = false;
72 // ElMessage.error(res.msg);//授权码被重复使用,不抛出异常。 78 // ElMessage.error(res.msg);//授权码被重复使用,不抛出异常。
......
...@@ -7,7 +7,8 @@ import { ref } from 'vue'; ...@@ -7,7 +7,8 @@ import { ref } from 'vue';
7 import { useRouter, useRoute } from "vue-router"; 7 import { useRouter, useRoute } from "vue-router";
8 import useUserStore from "@/store/modules/user"; 8 import useUserStore from "@/store/modules/user";
9 import { 9 import {
10 getAreaData 10 getAreaData,
11 getCurrentUserInfo
11 } from "@/api/modules/queryService"; 12 } from "@/api/modules/queryService";
12 import { 13 import {
13 getParamsList, 14 getParamsList,
...@@ -28,6 +29,7 @@ import importTableField from "./importTableField.vue"; ...@@ -28,6 +29,7 @@ import importTableField from "./importTableField.vue";
28 import { useValidator } from '@/hooks/useValidator'; 29 import { useValidator } from '@/hooks/useValidator';
29 import useDataAssetStore from "@/store/modules/dataAsset"; 30 import useDataAssetStore from "@/store/modules/dataAsset";
30 import { handleContentWrapView, scrollLastRowToView, changeNum } from '@/utils/common'; 31 import { handleContentWrapView, scrollLastRowToView, changeNum } from '@/utils/common';
32 import { ElMessage } from 'element-plus';
31 33
32 const { proxy } = getCurrentInstance() as any; 34 const { proxy } = getCurrentInstance() as any;
33 const { required, checkExistName } = useValidator(); 35 const { required, checkExistName } = useValidator();
...@@ -491,6 +493,15 @@ const addAssetTable = () => { ...@@ -491,6 +493,15 @@ const addAssetTable = () => {
491 } 493 }
492 494
493 onBeforeMount(() => { 495 onBeforeMount(() => {
496 // const currentTenantGuid = localStorage.getItem('currentTenantGuid');
497 // getCurrentUserInfo(currentTenantGuid).then((res: any) => {
498 // console.log(res, 'getCurrentUserInfo');
499 // if (res.code == '00000') {
500 // localStorage.setItem('userData', JSON.stringify(res.data));
501 // } else {
502 // ElMessage.error(res.msg)
503 // }
504 // })
494 getParentAreaPromise.value = getAreaData({ parentId: null }).then((res: any) => { 505 getParentAreaPromise.value = getAreaData({ parentId: null }).then((res: any) => {
495 if (res?.code == proxy.$passCode) { 506 if (res?.code == proxy.$passCode) {
496 parentAreaData.value = res.data ?? []; 507 parentAreaData.value = res.data ?? [];
...@@ -574,9 +585,8 @@ onBeforeMount(() => { ...@@ -574,9 +585,8 @@ onBeforeMount(() => {
574 }).then((res: any) => { 585 }).then((res: any) => {
575 if (res.code == proxy.$passCode) { 586 if (res.code == proxy.$passCode) {
576 damTypes.value = res.data || []; 587 damTypes.value = res.data || [];
577 baseInfoFormItems.value[1].options = damTypes.value; 588 let item = baseInfoFormItems.value.find(item => item.field == 'damType');
578 // let item = baseInfoFormItems.value.find(item => item.field == 'damType'); 589 item && (item.options = damTypes.value);
579 // item && (item.options = damTypes.value);
580 } else { 590 } else {
581 proxy.$ElMessage.error(res.msg); 591 proxy.$ElMessage.error(res.msg);
582 } 592 }
...@@ -585,11 +595,9 @@ onBeforeMount(() => { ...@@ -585,11 +595,9 @@ onBeforeMount(() => {
585 dictType: "数据资产目录主题名称", 595 dictType: "数据资产目录主题名称",
586 }).then((res: any) => { 596 }).then((res: any) => {
587 if (res.code == proxy.$passCode) { 597 if (res.code == proxy.$passCode) {
588 subjectDomainListData.value = res.data || []; 598 subjectDomainListData.value = replaceChildDictListKey(res.data) || [];
589 replaceChildDictListKey(subjectDomainListData.value); 599 let item = baseInfoFormItems.value.find(item => item.field == 'subjectDomain');
590 baseInfoFormItems.value[3].options = replaceChildDictListKey(subjectDomainListData.value); 600 item && (item.options = subjectDomainListData.value);
591 // let item = baseInfoFormItems.value.find(item => item.field == 'subjectDomain');
592 // item && (item.options = subjectDomainListData.value);
593 } else { 601 } else {
594 proxy.$ElMessage.error(res.msg); 602 proxy.$ElMessage.error(res.msg);
595 } 603 }
......
...@@ -25,7 +25,13 @@ const assetStore = useDataAssetStore(); ...@@ -25,7 +25,13 @@ const assetStore = useDataAssetStore();
25 const router = useRouter(); 25 const router = useRouter();
26 const { proxy } = getCurrentInstance() as any; 26 const { proxy } = getCurrentInstance() as any;
27 const damTypes: any = ref([]); 27 const damTypes: any = ref([]);
28 const dataSources: any = ref([]);
28 const subjectDomainListData: any = ref([]) 29 const subjectDomainListData: any = ref([])
30 // 登记状态 Y 已登记 N 未登记
31 const isRegisterOptions = ref<any>([
32 { label: "已登记", value: "Y" },
33 { label: "未登记", value: "N" },
34 ])
29 const searchItemList = ref([ 35 const searchItemList = ref([
30 { 36 {
31 type: "input", 37 type: "input",
...@@ -72,23 +78,37 @@ const searchItemList = ref([ ...@@ -72,23 +78,37 @@ const searchItemList = ref([
72 showCheckbox: true 78 showCheckbox: true
73 }, 79 },
74 { 80 {
75 type: "input", 81 type: "select",
76 label: "", 82 label: "",
77 field: "damName", 83 field: "dataSources",
78 default: "", 84 default: "",
79 placeholder: "来源", 85 placeholder: "数据来源",
80 clearable: true, 86 clearable: true,
87 filterable: true,
88 options: dataSources.value,
89 props: {
90 value: 'value',
91 label: 'label'
92 }
81 }, 93 },
82 { 94 {
83 type: "input", 95 type: "select",
84 label: "", 96 label: "",
85 field: "damName", 97 field: "isRegister",
86 default: "", 98 default: "",
87 placeholder: "登记状态", 99 placeholder: "登记状态",
88 clearable: true, 100 clearable: true,
101 filterable: true,
102 options: isRegisterOptions.value,
103 props: {
104 value: 'value',
105 label: 'label'
106 }
89 }, 107 },
90 ]); 108 ]);
91 109
110
111
92 const pageInfo = ref({ 112 const pageInfo = ref({
93 ...commonPageConfig, 113 ...commonPageConfig,
94 rows: 0, 114 rows: 0,
...@@ -216,14 +236,25 @@ onActivated(() => { ...@@ -216,14 +236,25 @@ onActivated(() => {
216 }); 236 });
217 237
218 onBeforeMount(() => { 238 onBeforeMount(() => {
219 getParamsList({ 239 getDamTypesList({
240 dictType: "数据来源",
241 }).then((res: any) => {
242 if (res.code == proxy.$passCode) {
243 dataSources.value = res.data || [];
244 let item = searchItemList.value.find(item => item.field == 'dataSources');
245 item && (item.options = dataSources.value);
246 } else {
247 proxy.$ElMessage.error(res.msg);
248 }
249 })
250
251 getDamTypesList({
220 dictType: "资产类型", 252 dictType: "资产类型",
221 }).then((res: any) => { 253 }).then((res: any) => {
222 if (res.code == proxy.$passCode) { 254 if (res.code == proxy.$passCode) {
223 damTypes.value = res.data || []; 255 damTypes.value = res.data || [];
224 searchItemList.value[1].options = damTypes.value; 256 let item = searchItemList.value.find(item => item.field == 'damType');
225 // let item = searchItemList.value.find(item => item.field == 'damType'); 257 item && (item.options = damTypes.value);
226 // item && (item.options = damTypes.value);
227 } else { 258 } else {
228 proxy.$ElMessage.error(res.msg); 259 proxy.$ElMessage.error(res.msg);
229 } 260 }
...@@ -232,11 +263,9 @@ onBeforeMount(() => { ...@@ -232,11 +263,9 @@ onBeforeMount(() => {
232 dictType: "数据资产目录主题名称", 263 dictType: "数据资产目录主题名称",
233 }).then((res: any) => { 264 }).then((res: any) => {
234 if (res.code == proxy.$passCode) { 265 if (res.code == proxy.$passCode) {
235 subjectDomainListData.value = res.data || []; 266 subjectDomainListData.value = replaceChildDictListKey(res.data) || [];
236 replaceChildDictListKey(subjectDomainListData.value); 267 let item = searchItemList.value.find(item => item.field == 'subjectDomain');
237 searchItemList.value[2].options = replaceChildDictListKey(subjectDomainListData.value); 268 item && (item.options = subjectDomainListData.value);
238 // let item = searchItemList.value.find(item => item.field == 'subjectDomain');
239 // item && (item.options = subjectDomainListData.value);
240 } else { 269 } else {
241 proxy.$ElMessage.error(res.msg); 270 proxy.$ElMessage.error(res.msg);
242 } 271 }
...@@ -286,6 +315,8 @@ const handleCreate = () => { ...@@ -286,6 +315,8 @@ const handleCreate = () => {
286 <div class="type-btn"> 315 <div class="type-btn">
287 <div class="type">{{ item.subjectDomainName || item.subjectDomain }}</div> 316 <div class="type">{{ item.subjectDomainName || item.subjectDomain }}</div>
288 <div class="type">{{ item.damTypeName || '--' }}</div> 317 <div class="type">{{ item.damTypeName || '--' }}</div>
318 <div class="type">{{ item.isRegister == 'Y' ? '已登记' : '未登记' }}</div>
319 <div class="type">{{ item.foundMode == '1' ? '自建' : '加工交付' }}</div>
289 </div> 320 </div>
290 <div class="desc">{{ item.propertyDescription }}</div> 321 <div class="desc">{{ item.propertyDescription }}</div>
291 <el-popover v-model="cardBtnVisible" placement="bottom" width="96" trigger="click" 322 <el-popover v-model="cardBtnVisible" placement="bottom" width="96" trigger="click"
......
...@@ -62,7 +62,7 @@ const parentAreaData: any = ref([]); ...@@ -62,7 +62,7 @@ const parentAreaData: any = ref([]);
62 const getArea1 = (node, resolve) => { 62 const getArea1 = (node, resolve) => {
63 const { level } = node 63 const { level } = node
64 let params = { 64 let params = {
65 parentId: node.value 65 parentGuid: node.value
66 } 66 }
67 if (!node.value) { 67 if (!node.value) {
68 if (getParentAreaPromise.value) { 68 if (getParentAreaPromise.value) {
...@@ -111,7 +111,7 @@ const getArea1 = (node, resolve) => { ...@@ -111,7 +111,7 @@ const getArea1 = (node, resolve) => {
111 const getArea = (node, resolve) => { 111 const getArea = (node, resolve) => {
112 const { level } = node 112 const { level } = node
113 let params = { 113 let params = {
114 parentId: node.value 114 parentGuid: node.value
115 } 115 }
116 if (!node.value) { 116 if (!node.value) {
117 if (getParentAreaPromise.value) { 117 if (getParentAreaPromise.value) {
...@@ -375,6 +375,18 @@ const getRegisterCatalogListData = () => { ...@@ -375,6 +375,18 @@ const getRegisterCatalogListData = () => {
375 dataScaleItem.disabled = false; 375 dataScaleItem.disabled = false;
376 } 376 }
377 } 377 }
378 if (draftDetailInfo.value.damGuid) {
379 let da = registerCatalogList.value.find(r => r.guid == draftDetailInfo.value.damGuid);
380 if (da && da.dataCount != null) {
381 dataScaleItem.disabled = true;
382 if (draftDetailInfo.value.dataScale == null) {
383 draftDetailInfo.value.dataScale = da.dataCount;
384 setBaseFormItemsValue(draftDetailInfo.value);
385 }
386 } else {
387 dataScaleItem.disabled = false;
388 }
389 }
378 } else { 390 } else {
379 ElMessage.error(res.msg); 391 ElMessage.error(res.msg);
380 } 392 }
...@@ -596,7 +608,7 @@ onBeforeMount(() => { ...@@ -596,7 +608,7 @@ onBeforeMount(() => {
596 }) 608 })
597 getParamsList({ dictType: '数据资产目录主题名称' }).then((res: any) => { 609 getParamsList({ dictType: '数据资产目录主题名称' }).then((res: any) => {
598 if (res.code == proxy.$passCode) { 610 if (res.code == proxy.$passCode) {
599 subjectDomainListData.value = res.data || []; 611 subjectDomainListData.value = replaceChildDictListKey(res.data) || [];
600 let item = baseFormItems.value.find(item => item.field == 'subjectDomain'); 612 let item = baseFormItems.value.find(item => item.field == 'subjectDomain');
601 item && (item.options = subjectDomainListData.value); 613 item && (item.options = subjectDomainListData.value);
602 } else { 614 } else {
...@@ -731,6 +743,14 @@ const baseFormItems: any = ref([ ...@@ -731,6 +743,14 @@ const baseFormItems: any = ref([
731 clearable: true, 743 clearable: true,
732 required: true, 744 required: true,
733 }, { 745 }, {
746 label: "数据时间范围",
747 type: "date-picker",
748 field: "dateRange",
749 default: null,
750 placeholder: "开始时间~结束时间",
751 clearable: true,
752 required: true,
753 }, {
734 label: '病例总数(例)', 754 label: '病例总数(例)',
735 type: 'input', 755 type: 'input',
736 placeholder: '请输入', 756 placeholder: '请输入',
...@@ -740,6 +760,7 @@ const baseFormItems: any = ref([ ...@@ -740,6 +760,7 @@ const baseFormItems: any = ref([
740 default: '', 760 default: '',
741 required: false 761 required: false
742 }, { 762 }, {
763 }, {
743 label: '数据覆盖地域', 764 label: '数据覆盖地域',
744 type: 'checkbox-select', 765 type: 'checkbox-select',
745 placeholder: '全国', 766 placeholder: '全国',
...@@ -783,6 +804,7 @@ const baseFormItems: any = ref([ ...@@ -783,6 +804,7 @@ const baseFormItems: any = ref([
783 field: 'exchangeGuid', 804 field: 'exchangeGuid',
784 default: '', 805 default: '',
785 // col: 'mr8', 806 // col: 'mr8',
807 // col: 'mr8',
786 options: currTenantChanged.value, 808 options: currTenantChanged.value,
787 props: { 809 props: {
788 // value: 'serviceTenantGuid', 810 // value: 'serviceTenantGuid',
......
...@@ -80,7 +80,7 @@ const drawerRef = ref<any>(''); ...@@ -80,7 +80,7 @@ const drawerRef = ref<any>('');
80 const heightlightRow = ref<any>(''); 80 const heightlightRow = ref<any>('');
81 const scopeRow = ref<any>(null); 81 const scopeRow = ref<any>(null);
82 const tableInfo = ref({ 82 const tableInfo = ref({
83 id: "data-class-standard-table", 83 id: "data-class-table",
84 multiple: false, 84 multiple: false,
85 fields: [ 85 fields: [
86 { label: "序号", type: "index", width: 56, align: "center" }, 86 { label: "序号", type: "index", width: 56, align: "center" },
...@@ -110,7 +110,7 @@ const tableInfo = ref({ ...@@ -110,7 +110,7 @@ const tableInfo = ref({
110 data: [], 110 data: [],
111 rowKey: 'guid', 111 rowKey: 'guid',
112 currentRowKey: '', 112 currentRowKey: '',
113 expandedKeys: [] as any, 113 expandedKey: [],
114 showPage: false, 114 showPage: false,
115 actionInfo: { 115 actionInfo: {
116 label: "操作", 116 label: "操作",
...@@ -119,6 +119,7 @@ const tableInfo = ref({ ...@@ -119,6 +119,7 @@ const tableInfo = ref({
119 btns: [ 119 btns: [
120 { 120 {
121 label: "编辑", value: "edit", click: (scope) => { 121 label: "编辑", value: "edit", click: (scope) => {
122 console.log(scope);
122 tableInfo.value.currentRowKey = scope.row.guid; 123 tableInfo.value.currentRowKey = scope.row.guid;
123 heightlightRow.value = scope.row.guid; 124 heightlightRow.value = scope.row.guid;
124 scopeRow.value = scope.row; 125 scopeRow.value = scope.row;
...@@ -823,11 +824,40 @@ const handleTableRowClick = (row, id) => { ...@@ -823,11 +824,40 @@ const handleTableRowClick = (row, id) => {
823 tableInfo.value.currentRowKey = row.guid; 824 tableInfo.value.currentRowKey = row.guid;
824 } 825 }
825 826
827 const findParentsGuids = (treeList, targetGuid) => {
828 let result = null;
829
830 const recursiveSearch = (nodes) => {
831 for (let node of nodes) {
832 if (node.guid === targetGuid) {
833 result = node.parentGuids;
834 return;
835 }
836 if (node.children) {
837 recursiveSearch(node.children);
838 }
839 }
840 };
841
842 recursiveSearch(treeList);
843 return result;
844 };
845
846
826 const drawerSelectChange = (val, row, info) => { 847 const drawerSelectChange = (val, row, info) => {
827 const tree = tableRef.value.tableRef; 848 if (row.field === 'gradeGuid') {
828 console.log(val, row, info, tree); 849 return;
829 tableInfo.value.expandedKeys.push(val); 850 }
830 console.log(tableInfo.value.expandedKeys); 851 tableInfo.value.expandedKey = [];
852 const parentGuids: any = findParentsGuids(treeListData.value, val);
853 if (parentGuids) {
854 tableInfo.value.expandedKey.push(val);
855 parentGuids.forEach((guid) => {
856 tableInfo.value.expandedKey.push(guid);
857 });
858 } else {
859 console.log('No matching item found.');
860 }
831 } 861 }
832 862
833 </script> 863 </script>
......
...@@ -6,16 +6,12 @@ ...@@ -6,16 +6,12 @@
6 import { Warning } from "@element-plus/icons-vue"; 6 import { Warning } from "@element-plus/icons-vue";
7 import TableTools from '@/components/Tools/table_tools.vue'; 7 import TableTools from '@/components/Tools/table_tools.vue';
8 import { 8 import {
9 getDictionary,
10 saveBizRuleConfig, 9 saveBizRuleConfig,
11 getDbDirTreeList, 10 getDbDirTreeList,
12 getDbDirTablePageList, 11 getDbDirTablePageList,
13 getDbDirFieldPageList, 12 getDbDirFieldPageList,
14 getExecGuidAndName, 13 getExecGuidAndName,
15 getClassifyTreeList,
16 getCgLabelPageList,
17 execTaskFieldList, 14 execTaskFieldList,
18 execTaskSheetList,
19 getTaskExeTreeList, 15 getTaskExeTreeList,
20 getDbFieldList, 16 getDbFieldList,
21 exportCgDir, 17 exportCgDir,
...@@ -25,13 +21,15 @@ import { ...@@ -25,13 +21,15 @@ import {
25 getDbDirTableSelectList, 21 getDbDirTableSelectList,
26 getDbDirFieldSelectList, 22 getDbDirFieldSelectList,
27 updateDataAsset, 23 updateDataAsset,
28 getDictionaryAll 24 getDictionaryAll,
25 getNewDataTypeList,
26 deleteDbDirTable
29 } from '@/api/modules/dataInventory'; 27 } from '@/api/modules/dataInventory';
30 import { TableColumnWidth } from "@/utils/enum"; 28 import { TableColumnWidth } from "@/utils/enum";
31 import router from "@/router"; 29 import router from "@/router";
32 import { download } from "@/utils/common"; 30 import { download } from "@/utils/common";
33 import { getLabelList } from "@/api/modules/dataLabel"; 31 import { da, sl } from "element-plus/es/locale";
34 import { de } from "element-plus/es/locale"; 32
35 33
36 const currentPath = ref<string[]>([]); 34 const currentPath = ref<string[]>([]);
37 const currentDatabasePath = ref<string[]>([]); 35 const currentDatabasePath = ref<string[]>([]);
...@@ -106,7 +104,7 @@ const getDictionaryList = () => { ...@@ -106,7 +104,7 @@ const getDictionaryList = () => {
106 dictionaryList.value = []; 104 dictionaryList.value = [];
107 if (res.code == proxy.$passCode) { 105 if (res.code == proxy.$passCode) {
108 dictionaryList.value = res.data || []; 106 dictionaryList.value = res.data || [];
109 classEditFormItems.value[4].options = res.data || []; 107 classEditFormItems.value[5].options = res.data || [];
110 } else { 108 } else {
111 proxy.$ElMessage.error(res.msg); 109 proxy.$ElMessage.error(res.msg);
112 } 110 }
...@@ -124,6 +122,22 @@ const getExecGuid = async () => { ...@@ -124,6 +122,22 @@ const getExecGuid = async () => {
124 } 122 }
125 } 123 }
126 124
125 // 获取字段类型
126 const optionsD = ref<any>();
127 const selectedD = ref<any>();
128 const fieldData = ref<any>();
129 const getFieldTypeData = async () => {
130 const params = {
131 dictType: "字段类型"
132 }
133 const res: any = await getNewDataTypeList(params);
134 if (res.code == proxy.$passCode) {
135 fieldData.value = res.data;
136 optionsD.value = res.data;
137 } else {
138 proxy.$ElMessage.error(res.msg);
139 }
140 }
127 141
128 onMounted(async () => { 142 onMounted(async () => {
129 await getExecGuid(); 143 await getExecGuid();
...@@ -136,6 +150,26 @@ onMounted(async () => { ...@@ -136,6 +150,26 @@ onMounted(async () => {
136 getSearchTableList(); 150 getSearchTableList();
137 // getLabelListData(); 151 // getLabelListData();
138 getGradeData(refGradeGuid.value); 152 getGradeData(refGradeGuid.value);
153 getFieldTypeData();
154 if (route.query.databaseGuid && route.query.tableGuid) {
155 activeName.value = 'second';
156 classifyDetailGuidInfo.value = '';
157 selectedA.value = route.query.databaseGuid;
158 selectedB.value = route.query.tableGuid;
159 selectedC.value = null;
160 optionsA.value = [];
161 optionsB.value = [];
162 optionsC.value = [];
163 await getDataBaseTreeData();
164 await getDbDirTableSelectData(1, {});
165 await getDataBaseTableData();
166 await getDataBaseFieldData();
167 await getDbDirTableSelectData(2, { databaseGuid: selectedA.value, condition: "2" });
168
169
170
171
172 }
139 173
140 }) 174 })
141 175
...@@ -215,14 +249,61 @@ const searchItemList = ref([ ...@@ -215,14 +249,61 @@ const searchItemList = ref([
215 // 搜索 249 // 搜索
216 const searchCount = ref(0); 250 const searchCount = ref(0);
217 const toSearch = (val: any, clear: boolean = false) => { 251 const toSearch = (val: any, clear: boolean = false) => {
252 console.log('toSearch', val, clear);
218 if (clear) { 253 if (clear) {
219 selectedA.value = null; 254 selectedA.value = null;
220 selectedB.value = null; 255 selectedB.value = null;
221 selectedC.value = null; 256 selectedC.value = null;
257 levelGuidInfo.value = '';
258 val.levelName = '';
259 val.classfiyName = '';
222 searchItemList.value.map(item => item.default = '') 260 searchItemList.value.map(item => item.default = '')
223 }
224 console.log('toSearch', val, classifyDetailGuidInfo.value);
225 if (activeName.value === 'first') { 261 if (activeName.value === 'first') {
262 treeInfo.value.expandedKey = [];
263 currentPath.value = [CgDirTreeList.value[0].classifyName];
264 treeInfo.value.expandedKey.push(CgDirTreeList.value[0].classifyDetailGuid);
265 treeInfo.value.currentNodeKey = CgDirTreeList.value[0].classifyDetailGuid;
266 getCgDirFieldPage({
267 execGuid: execGuidInfo.value.execGuid,
268 classifyDetail: CgDirTreeList.value[0].classifyDetailGuid,
269 });
270 }
271 if (activeName.value === 'second') {
272 dataBaseTreeInfo.value.expandedKey = [];
273 dataBaseTreeInfo.value.expandedKey.push(dataBaseTreeData.value[0].guid);
274 dataBaseTreeInfo.value.currentNodeKey = dataBaseTreeData.value[0].guid;
275 dataBaseGuid.value = dataBaseTreeData.value[0].databaseGuid;
276 currentDatabasePath.value = [dataBaseTreeData.value[0].name];
277 selectedA.value = dataBaseTreeData.value[0].databaseGuid;
278 getDbDirTableSelectData(2, { databaseGuid: selectedA.value, condition: "2" })
279 getDataBaseTableData({
280 pageIndex: 1,
281 pageSize: 50,
282 execGuid: execGuidInfo.value.execGuid,
283 tableGuid: '',
284 databaseGuid: selectedA.value || dataBaseGuid.value || '',
285 classifyDetailGuid: '',
286 gradeDetailGuid: '',
287 labelGuid: '',
288 });
289
290 getDataBaseFieldData({
291 pageIndex: 1,
292 pageSize: 50,
293 execGuid: execGuidInfo.value.execGuid,
294 tableGuid: '',
295 databaseGuid: selectedA.value || dataBaseGuid.value || '',
296 fieldGuid: '',
297 classifyDetailGuid: val.classifyName,
298 gradeDetailGuid: '',
299 labelGuid: '',
300 });
301
302 }
303 return;
304 }
305
306 if (activeName.value === 'first' && !clear) {
226 getCgDirFieldPage({ 307 getCgDirFieldPage({
227 pageIndex: 1, 308 pageIndex: 1,
228 pageSize: 50, 309 pageSize: 50,
...@@ -242,8 +323,8 @@ const toSearch = (val: any, clear: boolean = false) => { ...@@ -242,8 +323,8 @@ const toSearch = (val: any, clear: boolean = false) => {
242 execGuid: execGuidInfo.value.execGuid, 323 execGuid: execGuidInfo.value.execGuid,
243 tableGuid: selectedB.value || tableGuid.value || '', 324 tableGuid: selectedB.value || tableGuid.value || '',
244 databaseGuid: selectedA.value || dataBaseGuid.value || '', 325 databaseGuid: selectedA.value || dataBaseGuid.value || '',
245 classifyDetailGuid: val.classifyName, 326 classifyDetailGuid: val.classifyName || '',
246 gradeDetailGuid: val.levelName, 327 gradeDetailGuid: val.levelName || '',
247 labelGuid: val.labelName, 328 labelGuid: val.labelName,
248 }); 329 });
249 } 330 }
...@@ -255,8 +336,8 @@ const toSearch = (val: any, clear: boolean = false) => { ...@@ -255,8 +336,8 @@ const toSearch = (val: any, clear: boolean = false) => {
255 tableGuid: selectedB.value || tableGuid.value || '', 336 tableGuid: selectedB.value || tableGuid.value || '',
256 databaseGuid: selectedA.value || dataBaseGuid.value || '', 337 databaseGuid: selectedA.value || dataBaseGuid.value || '',
257 fieldGuid: selectedC.value || '', 338 fieldGuid: selectedC.value || '',
258 classifyDetailGuid: val.classifyName, 339 classifyDetailGuid: val.classifyName || '',
259 gradeDetailGuid: val.levelName, 340 gradeDetailGuid: val.levelName || '',
260 labelGuid: val.labelName, 341 labelGuid: val.labelName,
261 }); 342 });
262 } 343 }
...@@ -277,6 +358,10 @@ const nodeClick = async (data: any) => { ...@@ -277,6 +358,10 @@ const nodeClick = async (data: any) => {
277 await getCgDirFieldPage({ 358 await getCgDirFieldPage({
278 execGuid: execGuidInfo.value.execGuid, 359 execGuid: execGuidInfo.value.execGuid,
279 classifyDetail: classifyDetailGuid, 360 classifyDetail: classifyDetailGuid,
361 gradeDetailGuid: levelGuidInfo.value,
362 databaseGuid: selectedA.value,
363 tableGuid: selectedB.value,
364 fieldGuid: selectedC.value,
280 }); 365 });
281 // 递归tempData找到所有祖先元素的standardName,存入currentPath中 366 // 递归tempData找到所有祖先元素的standardName,存入currentPath中
282 const path = findPath(CgDirTreeList.value, guid); 367 const path = findPath(CgDirTreeList.value, guid);
...@@ -327,11 +412,8 @@ const getGradeData = async (refGradeGuid) => { ...@@ -327,11 +412,8 @@ const getGradeData = async (refGradeGuid) => {
327 // btns-area 412 // btns-area
328 const checked = ref(false); 413 const checked = ref(false);
329 const changeCheck = (val) => { 414 const changeCheck = (val) => {
330
331 checked.value = val; 415 checked.value = val;
332 getDataBaseTableData({ 416 getDataBaseTableData();
333 isDataAsset: val ? 'Y' : ''
334 });
335 } 417 }
336 418
337 //下方表格配置 419 //下方表格配置
...@@ -354,7 +436,8 @@ const tableInfo = ref({ ...@@ -354,7 +436,8 @@ const tableInfo = ref({
354 fields: [ 436 fields: [
355 { label: "序号", type: "index", width: 56, align: "center" }, 437 { label: "序号", type: "index", width: 56, align: "center" },
356 { label: "字段名", field: "fieldName", width: 140 }, 438 { label: "字段名", field: "fieldName", width: 140 },
357 { label: "字段中文名", field: "fieldChName", width: 180 }, 439 { label: "字段中文名", field: "fieldChName", width: 140 },
440 { label: "字段类型", field: "fieldTypeName", width: 120 },
358 { 441 {
359 label: "分类", field: "classifyDetailNameRoutes", width: 120, getName: (scope) => { 442 label: "分类", field: "classifyDetailNameRoutes", width: 120, getName: (scope) => {
360 return scope.row.classifyDetailNameRoutes.join('/'); 443 return scope.row.classifyDetailNameRoutes.join('/');
...@@ -392,9 +475,25 @@ const tablePageChange = (info) => { ...@@ -392,9 +475,25 @@ const tablePageChange = (info) => {
392 }); 475 });
393 } 476 }
394 477
478 // 判断是否为单文本框
479 const isSingleInput = (fieldType: string) => {
480 // 定义单文本框的字段类型
481 const singleInputTypes = ['text', 'varchar', 'json', 'bit', 'char'];
482 return singleInputTypes.includes(fieldType) || !fieldType; // 如果fieldType为空,默认为单文本框
483 };
484 //time tinyint decimal timestamp datetime date int varchar text json bit char
485 //剩下判断是为单文本框
486
487 const isDoubleInput = (fieldType: string) => {
488 // 定义单文本框的字段类型
489 const doubleInputTypes = ['time', 'decimal', 'tinyint', 'timestamp', 'datetime', 'date', 'int'];
490 return doubleInputTypes.includes(fieldType);
491 };
395 // 选中配置的业务规则 492 // 选中配置的业务规则
396 const selectedRulesData = ref(); 493 const selectedRulesData = ref();
494 const selectedRulesDataList = ref([]);
397 const tableCheckboxSelectChange = (select, row) => { 495 const tableCheckboxSelectChange = (select, row) => {
496 selectedRulesDataList.value = select;
398 // 遍历选中的数据,存入selectedRulesData 497 // 遍历选中的数据,存入selectedRulesData
399 let rulesName: any = []; 498 let rulesName: any = [];
400 let rulesGuid: any = []; 499 let rulesGuid: any = [];
...@@ -408,6 +507,7 @@ const tableCheckboxSelectChange = (select, row) => { ...@@ -408,6 +507,7 @@ const tableCheckboxSelectChange = (select, row) => {
408 }; 507 };
409 } 508 }
410 const tableCheckboxAllSelectChange = (select) => { 509 const tableCheckboxAllSelectChange = (select) => {
510 selectedRulesDataList.value = select;
411 // 遍历选中的数据,存入selectedRulesData 511 // 遍历选中的数据,存入selectedRulesData
412 let rulesName: any = []; 512 let rulesName: any = [];
413 let rulesGuid: any = []; 513 let rulesGuid: any = [];
...@@ -422,16 +522,70 @@ const tableCheckboxAllSelectChange = (select) => { ...@@ -422,16 +522,70 @@ const tableCheckboxAllSelectChange = (select) => {
422 } 522 }
423 523
424 // 批量配置业务规则 524 // 批量配置业务规则
525
425 const batchControlRules = () => { 526 const batchControlRules = () => {
426 console.log('selectedRulesData', selectedRulesData.value); 527 // 清空 classEditFormInfo.value.formInfo;
528 classEditFormItems.value.map(item => {
529 if (item.field == 'orderNum') {
530 item.visible = true;
531 }
532 if (item.field == 'orderNum1') {
533 item.visible = false;
534 }
535 item.default = '';
536 if (item.children) {
537 item.children.map(item => {
538 item.default = '';
539 })
540 }
541 });
542
427 // 判断是否选中数据 543 // 判断是否选中数据
428 if (!selectedRulesData.value || !selectedRulesData.value.guids || selectedRulesData.value.guids.length == 0) { 544 if (!selectedRulesData.value || !selectedRulesData.value.guids || selectedRulesData.value.guids.length == 0) {
429 proxy.$ElMessage.warning('请选择数据'); 545 proxy.$ElMessage.warning('请选择数据');
430 return; 546 return;
431 } 547 }
432 548 // 标志变量,分别用于存储单文本框和双文本框的字段
433 drawerInfo.value.visible = true; 549 let isSingleInputField = false;
550 let isDoubleInputField = false;
551 let isValid = true;
552 // 遍历 selectedRulesDataList,检查每个 fieldType 是否符合单文本框或双文本框
553 selectedRulesDataList.value.forEach((item: any) => {
554 if (isSingleInput(item.fieldType)) {
555 isSingleInputField = true; // 如果是单文本框,标记为单文本框
556 } else if (isDoubleInput(item.fieldType)) {
557 isDoubleInputField = true; // 如果是双文本框,标记为双文本框
558 } else {
559 // 如果不是单文本框也不是双文本框,标记为无效
560 isValid = false;
561 }
562 });
563 // 如果有无效的字段类型,则返回 false 并提示警告
564 if (!isValid) {
565 proxy.$ElMessage.warning('请选择单文本框或双文本框类型的字段');
566 return false;
567 }
568
569 // 判断字段类型是否一致
570 if (isSingleInputField && isDoubleInputField) {
571 // 如果既有单文本框也有双文本框,提示错误
572 proxy.$ElMessage.warning('请选择相同类型的字段');
573 return false;
574 }
575
576 console.log('isSingleInputField', isSingleInputField, 'isDoubleInputField', isDoubleInputField);
577 // 如果全都是单文本框或者全都是双文本框,则继续后续操作
578 if (isSingleInputField) {
579 classEditFormItems.value[4].visible = false;
580 classEditFormItems.value[6].visible = true;
581 classEditFormItems.value[7].visible = false;
582 } else if (isDoubleInputField) {
583 classEditFormItems.value[4].visible = true;
584 classEditFormItems.value[6].visible = false;
585 classEditFormItems.value[7].visible = true;
586 }
434 classEditFormItems.value[0].default = selectedRulesData.value.rulesName; 587 classEditFormItems.value[0].default = selectedRulesData.value.rulesName;
588 drawerInfo.value.visible = true;
435 } 589 }
436 590
437 // 数据库目录 591 // 数据库目录
...@@ -448,7 +602,7 @@ const dataBaseTreeInfo = ref<any>({ ...@@ -448,7 +602,7 @@ const dataBaseTreeInfo = ref<any>({
448 value: "guid", 602 value: "guid",
449 }, 603 },
450 nodeKey: 'guid', 604 nodeKey: 'guid',
451 expandedKey: ['0'], 605 expandedKey: [] as any,
452 currentNodeKey: '', 606 currentNodeKey: '',
453 expandOnNodeClick: false, 607 expandOnNodeClick: false,
454 data: [], 608 data: [],
...@@ -474,7 +628,7 @@ const dataBaseTableInfo = ref({ ...@@ -474,7 +628,7 @@ const dataBaseTableInfo = ref({
474 fields: [ 628 fields: [
475 { label: "序号", type: "index", width: 56, align: "center" }, 629 { label: "序号", type: "index", width: 56, align: "center" },
476 { label: "数据源", field: "databaseChName", width: 140 }, 630 { label: "数据源", field: "databaseChName", width: 140 },
477 { label: "表名称", field: "tableChName", width: 120 }, 631 { label: "主题表名称", field: "tableChName", width: 120 },
478 { label: "数据库表", field: "tableName", width: 120 }, 632 { label: "数据库表", field: "tableName", width: 120 },
479 { 633 {
480 label: "新建方式", field: "foundMode", width: 140, getName: (scope) => { 634 label: "新建方式", field: "foundMode", width: 140, getName: (scope) => {
...@@ -487,7 +641,7 @@ const dataBaseTableInfo = ref({ ...@@ -487,7 +641,7 @@ const dataBaseTableInfo = ref({
487 } 641 }
488 }, 642 },
489 { 643 {
490 label: "状态", field: "state", type: 'tag', width: 120, getName: (scope) => { 644 label: "状态", field: "state", type: 'tag', width: 120, align: "center", getName: (scope) => {
491 let status = scope.row.state; 645 let status = scope.row.state;
492 // 0 草稿中 1 已建表 2 已有默认表 646 // 0 草稿中 1 已建表 2 已有默认表
493 return status == 0 ? '草稿中' : status == 1 ? '已建表' : '已有默认表'; 647 return status == 0 ? '草稿中' : status == 1 ? '已建表' : '已有默认表';
...@@ -495,7 +649,7 @@ const dataBaseTableInfo = ref({ ...@@ -495,7 +649,7 @@ const dataBaseTableInfo = ref({
495 }, 649 },
496 { label: "修改人", field: "taskUpdateUserName", width: 100 }, 650 { label: "修改人", field: "taskUpdateUserName", width: 100 },
497 { label: "修改时间", field: "updateTime", width: TableColumnWidth.DATETIME }, 651 { label: "修改时间", field: "updateTime", width: TableColumnWidth.DATETIME },
498 { label: "描述", field: "description", width: 120, align: 'center' }, 652 { label: "描述", field: "description", width: 120, align: 'left' },
499 { label: "规划数据资产", field: "isDataAsset", type: 'switch', activeText: '是', inactiveText: '否', activeValue: 'Y', inactiveValue: 'N', switchWidth: 56, width: 120, align: 'center' }, 653 { label: "规划数据资产", field: "isDataAsset", type: 'switch', activeText: '是', inactiveText: '否', activeValue: 'Y', inactiveValue: 'N', switchWidth: 56, width: 120, align: 'center' },
500 654
501 ], 655 ],
...@@ -508,7 +662,7 @@ const dataBaseTableInfo = ref({ ...@@ -508,7 +662,7 @@ const dataBaseTableInfo = ref({
508 actionInfo: { 662 actionInfo: {
509 label: "操作", 663 label: "操作",
510 type: "btn", 664 type: "btn",
511 width: 200, 665 width: 240,
512 fixed: 'right', 666 fixed: 'right',
513 btns: (scope) => { 667 btns: (scope) => {
514 return [ 668 return [
...@@ -528,7 +682,8 @@ const dataBaseTableInfo = ref({ ...@@ -528,7 +682,8 @@ const dataBaseTableInfo = ref({
528 databaseChName: scope.row.databaseChName, 682 databaseChName: scope.row.databaseChName,
529 } 683 }
530 }); 684 });
531 } 685 },
686 disabled: scope.row.state == 0 ? true : false
532 }, 687 },
533 { 688 {
534 label: "编辑表结构", value: "edit", click: (scope) => { 689 label: "编辑表结构", value: "edit", click: (scope) => {
...@@ -547,6 +702,7 @@ const dataBaseTableInfo = ref({ ...@@ -547,6 +702,7 @@ const dataBaseTableInfo = ref({
547 database: scope.row.database, 702 database: scope.row.database,
548 databaseChName: scope.row.databaseChName, 703 databaseChName: scope.row.databaseChName,
549 databaseGuid: scope.row.databaseGuid, 704 databaseGuid: scope.row.databaseGuid,
705 state: scope.row.state,
550 } 706 }
551 }); 707 });
552 } else { 708 } else {
...@@ -561,11 +717,43 @@ const dataBaseTableInfo = ref({ ...@@ -561,11 +717,43 @@ const dataBaseTableInfo = ref({
561 database: scope.row.database, 717 database: scope.row.database,
562 databaseChName: scope.row.databaseChName, 718 databaseChName: scope.row.databaseChName,
563 databaseGuid: scope.row.databaseGuid, 719 databaseGuid: scope.row.databaseGuid,
720 state: scope.row.state,
564 } 721 }
565 }); 722 });
566 } 723 }
567 }, 724 },
568 disabled: scope.row.state !== 2 ? false : true 725 disabled: scope.row.state !== 2 ? false : true
726 },
727 {
728 //删除
729 label: "删除", value: "delete", click: (scope) => {
730 console.log('删除', scope);
731 proxy.$confirm('此操作将永久删除该表, 是否继续?', '提示', {
732 confirmButtonText: '确定',
733 cancelButtonText: '取消',
734 type: 'warning'
735 }).then(async () => {
736 const res: any = await deleteDbDirTable({ tableGuid: scope.row.tableGuid });
737 if (res.code == proxy.$passCode) {
738 proxy.$ElMessage.success('删除成功');
739 dataBaseTableInfo.value.loading = true;
740 await getDataBaseTableData({
741 pageIndex: dataBasePage.value.curr,
742 pageSize: dataBasePage.value.limit
743 });
744 dataBaseTableInfo.value.loading = false;
745
746 } else {
747 proxy.$ElMessage.error(res.msg);
748 }
749 }).catch(() => {
750 proxy.$ElMessage({
751 type: 'info',
752 message: '已取消删除'
753 });
754 });
755 },
756 disabled: scope.row.state == 2 ? true : false
569 } 757 }
570 ] 758 ]
571 } 759 }
...@@ -626,10 +814,13 @@ const selectLength = ref([ ...@@ -626,10 +814,13 @@ const selectLength = ref([
626 { label: '大于', value: '>', }, 814 { label: '大于', value: '>', },
627 { label: '小于', value: '<', }, 815 { label: '小于', value: '<', },
628 { label: '等于', value: '=', }, 816 { label: '等于', value: '=', },
817 { label: '大于等于', value: '>=', },
818 { label: '小于等于', value: '<=', },
819 { label: '介于', value: 'between', },
629 ] 820 ]
630 ) 821 )
631 822
632 const classEditFormItems = ref([{ 823 const classEditFormItems = ref<any>([{
633 label: '已选字段', 824 label: '已选字段',
634 type: 'input', 825 type: 'input',
635 maxlength: 50, 826 maxlength: 50,
...@@ -646,7 +837,8 @@ const classEditFormItems = ref([{ ...@@ -646,7 +837,8 @@ const classEditFormItems = ref([{
646 placeholder: '请选择', 837 placeholder: '请选择',
647 field: 'orderNumLength', 838 field: 'orderNumLength',
648 options: selectLength.value, 839 options: selectLength.value,
649 required: true, 840 default: '',
841 required: false,
650 clearable: true, 842 clearable: true,
651 }, 843 },
652 { 844 {
...@@ -656,9 +848,45 @@ const classEditFormItems = ref([{ ...@@ -656,9 +848,45 @@ const classEditFormItems = ref([{
656 field: 'orderNum', 848 field: 'orderNum',
657 maxlength: 6, 849 maxlength: 6,
658 regexp: /\D/g, 850 regexp: /\D/g,
659 required: true, 851 required: false,
852 clearable: true,
853 col: 'numberClass',
854 visible: true,
855 },
856 {
857 label: '',
858 type: 'input-group',
859 placeholder: '请输入',
860 field: 'orderNum1',
861 default: '',
862 children: [
863 {
864 type: 'input',
865 placeholder: '请输入',
866 field: 'startNumber',
867 default: '',
868 maxlength: 6,
869 min: 1,
870 regexp: /\D/g,
660 clearable: true, 871 clearable: true,
872 required: false,
873
874 },
875 {
876 type: 'input',
877 placeholder: '请输入',
878 field: 'endNumber',
879 default: '',
880 maxlength: 6,
881 min: 1,
882 regexp: /\D/g,
883 clearable: true,
884 required: false,
885 },
886 ],
661 col: 'numberClass', 887 col: 'numberClass',
888 clearable: true,
889 visible: false,
662 }, 890 },
663 { 891 {
664 label: '精度', 892 label: '精度',
...@@ -667,9 +895,11 @@ const classEditFormItems = ref([{ ...@@ -667,9 +895,11 @@ const classEditFormItems = ref([{
667 field: 'fieldPrecision', 895 field: 'fieldPrecision',
668 maxlength: 2, 896 maxlength: 2,
669 regexp: /\D/g, 897 regexp: /\D/g,
670 required: true, 898 min: 1,
899 required: false,
671 clearable: true, 900 clearable: true,
672 block: true, 901 block: true,
902 visible: true,
673 }, { 903 }, {
674 label: '关联字典', 904 label: '关联字典',
675 field: 'dictionaryGuid', 905 field: 'dictionaryGuid',
...@@ -687,59 +917,103 @@ const classEditFormItems = ref([{ ...@@ -687,59 +917,103 @@ const classEditFormItems = ref([{
687 }, 917 },
688 { 918 {
689 label: '字段取值范围', 919 label: '字段取值范围',
690 type: 'input-group', 920 type: 'input',
921 maxlength: 20,
691 placeholder: '请输入', 922 placeholder: '请输入',
692 field: 'fieldValueRange', 923 field: 'fieldValueRange',
693 default: '', 924 default: '',
925 clearable: true,
926 block: false,
927 disabled: false,
928 visible: false,
929 },
930 {
931 label: '字段取值范围',
932 type: 'input-group',
933 placeholder: '请输入',
934 field: 'fieldValueRange',
694 children: [ 935 children: [
695 { 936 {
696 type: 'input', 937 type: 'input',
697 placeholder: '请输入', 938 placeholder: '请输入',
698 field: 'numberStart', 939 field: 'startValue',
699 default: '', 940 default: '',
700 clearable: true, 941 clearable: true,
701 required: true, 942 required: false,
943 min: 1,
944 regexp: /\D/g,
702 }, 945 },
703 { 946 {
704 type: 'input', 947 type: 'input',
705 placeholder: '请输入', 948 placeholder: '请输入',
706 field: 'numberEnd', 949 field: 'endValue',
707 default: '', 950 default: '',
708 clearable: true, 951 clearable: true,
709 required: true, 952 min: 1,
953 required: false,
954 regexp: /\D/g,
710 }, 955 },
711 ], 956 ],
712 col: 'col2', 957 col: 'col2',
713 clearable: true, 958 clearable: true,
959 visible: true,
714 }, 960 },
961 // 替换为下拉
715 { 962 {
716 label: '数据是否唯一', 963 label: '数据是否唯一',
717 type: "radio-group", 964 type: "select",
718 field: "isUnique", 965 field: "isUnique",
719 disabled: false, 966 disabled: false,
720 default: 'N', 967 default: '',
721 options: [ 968 options: [
722 { label: "是", value: "Y", disabled: false }, 969 { label: "是", value: "Y", disabled: false },
723 { label: "否", value: "N", disabled: false }, 970 { label: "否", value: "N", disabled: false },
724 ], 971 ],
972 clearable: true,
725 }, 973 },
974
975 // {
976 // label: '数据是否唯一',
977 // type: "radio-group",
978 // field: "isUnique",
979 // disabled: false,
980 // default: 'N',
981 // options: [
982 // { label: "是", value: "Y", disabled: false },
983 // { label: "否", value: "N", disabled: false },
984 // ],
985 // },
726 { 986 {
727 label: '是否必填', 987 label: '是否必填',
728 type: "radio-group", 988 type: "select",
729 field: "isNotNull", 989 field: "notNull",
730 disabled: false, 990 disabled: false,
731 default: 'N', 991 default: '',
732 options: [ 992 options: [
733 { label: "是", value: "Y", disabled: false }, 993 { label: "是", value: "Y", disabled: false },
734 { label: "否", value: "N", disabled: false }, 994 { label: "否", value: "N", disabled: false },
735 ], 995 ],
996 clearable: true,
736 } 997 }
998
999 // ,
1000 // {
1001 // label: '是否必填',
1002 // type: "radio-group",
1003 // field: "isNotNull",
1004 // disabled: false,
1005 // default: 'N',
1006 // options: [
1007 // { label: "是", value: "Y", disabled: false },
1008 // { label: "否", value: "N", disabled: false },
1009 // ],
1010 // }
737 ]); 1011 ]);
738 const classEditFormRules = ref({ 1012 const classEditFormRules = ref({
739 classifyName: [{ required: true, message: '请填写分类名称', trigger: 'blur' }], 1013 // classifyName: [{ required: true, message: '请填写分类名称', trigger: 'blur' }],
740 orderNumLength: [{ required: true, message: '请选择长度', trigger: 'blur' }], 1014 // orderNumLength: [{ required: true, message: '请选择长度', trigger: 'blur' }],
741 orderNum: [{ required: true, message: '请填写长度', trigger: 'blur' }], 1015 // orderNum: [{ required: true, message: '请填写长度', trigger: 'blur' }],
742 fieldPrecision: [{ required: true, message: '请填写精度', trigger: 'blur' }], 1016 // fieldPrecision: [{ required: true, message: '请填写精度', trigger: 'blur' }],
743 }); 1017 });
744 /** 新增分类的form */ 1018 /** 新增分类的form */
745 const classEditFormInfo = ref({ 1019 const classEditFormInfo = ref({
...@@ -777,29 +1051,77 @@ const drawerBtnClick = async (btn, info) => { ...@@ -777,29 +1051,77 @@ const drawerBtnClick = async (btn, info) => {
777 drawerInfo.value.visible = false; 1051 drawerInfo.value.visible = false;
778 } else { 1052 } else {
779 btn.loading = true; 1053 btn.loading = true;
780 const { orderNumLength, orderNum, numberStart, numberEnd, fieldPrecision, dictionaryGuid, isUnique, isNotNull } = info; 1054 console.log('drawerBtnClick', info);
781 let fieldLengthCondition = orderNumLength + '#' + orderNum; 1055 const { orderNumLength, orderNum, startNumber, endNumber, fieldValueRange, startValue, endValue, fieldPrecision, dictionaryGuid, isUnique, notNull } = info;
782 let fieldValueRange: any = []; 1056 // 判断长度orderNumLength,orderNum 要么都有值,要么都没有值,不能只有一个有值,一个没有值精确提醒
783 if (numberStart && numberEnd) { 1057 let fieldLengthCondition: any = '';
784 if (numberEnd < numberStart) { 1058 if ((orderNumLength === 'between' && !startNumber) || (orderNumLength === 'between' && !endNumber)) {
785 proxy.$ElMessage.error('字段取值范围结束值不能小于开始值'); 1059 proxy.$ElMessage.error('请选择长度边界范围');
1060 btn.loading = false;
1061 return;
1062 } else {
1063 fieldLengthCondition = orderNumLength + '#' + startNumber + '#' + endNumber;
1064 }
1065
1066 if (orderNumLength !== 'between') {
1067 if (orderNumLength && !orderNum) {
1068 proxy.$ElMessage.error('请填写长度');
1069 btn.loading = false;
1070 return;
1071 }
1072 if (!orderNumLength && orderNum) {
1073 proxy.$ElMessage.error('请选择长度边界范围');
1074 btn.loading = false;
786 return; 1075 return;
787 } 1076 }
788 fieldValueRange = numberStart + '#' + numberEnd; 1077
1078 if (!orderNumLength && !orderNum) {
1079 fieldLengthCondition = '';
1080 }
1081 if (orderNumLength && orderNum) {
1082 fieldLengthCondition = orderNumLength + '#' + orderNum;
789 } 1083 }
1084 }
1085
790 const params: any = []; 1086 const params: any = [];
791 selectedRulesData.value.guids.forEach((item: any) => { 1087 selectedRulesData.value.guids.forEach((item: any) => {
792 params.push({ 1088 let param;
1089
1090 // 根据是否有 fieldValueRange 来决定如何构建参数对象
1091 if (fieldValueRange) {
1092 param = {
793 fieldPrecision, 1093 fieldPrecision,
794 dictionaryGuid, 1094 dictionaryGuid,
795 isUnique, 1095 isUnique,
796 isNotNull, 1096 notNull,
797 fieldLengthCondition, 1097 fieldLengthCondition,
798 fieldValueRange, 1098 fieldValueRange,
799 fieldGuid: item, 1099 fieldGuid: item,
800 execGuid: execGuidInfo.value.execGuid 1100 execGuid: execGuidInfo.value.execGuid
801 }) 1101 };
1102 } else {
1103 param = {
1104 fieldPrecision,
1105 dictionaryGuid,
1106 isUnique,
1107 notNull,
1108 fieldLengthCondition,
1109 fieldGuid: item,
1110 execGuid: execGuidInfo.value.execGuid,
1111 startValue,
1112 endValue
1113 };
1114 }
1115
1116 // 检查参数的有效性,如果无效则清空 params 数组
1117 if (isValidParam(param)) {
1118 params.push(param);
1119 } else {
1120 params.length = 0; // 清空数组
1121 }
802 }); 1122 });
1123
1124 try {
803 const res: any = await saveBizRuleConfig(params); 1125 const res: any = await saveBizRuleConfig(params);
804 if (res.code == proxy.$passCode) { 1126 if (res.code == proxy.$passCode) {
805 btn.loading = false; 1127 btn.loading = false;
...@@ -809,7 +1131,6 @@ const drawerBtnClick = async (btn, info) => { ...@@ -809,7 +1131,6 @@ const drawerBtnClick = async (btn, info) => {
809 execGuid: execGuidInfo.value.execGuid, 1131 execGuid: execGuidInfo.value.execGuid,
810 classifyDetail: classifyDetailGuidInfo.value, 1132 classifyDetail: classifyDetailGuidInfo.value,
811 gradeDetailGuid: levelGuidInfo.value, 1133 gradeDetailGuid: levelGuidInfo.value,
812 labelGuid: labelGuidInfo.value,
813 databaseGuid: selectedA.value, 1134 databaseGuid: selectedA.value,
814 tableGuid: selectedB.value, 1135 tableGuid: selectedB.value,
815 fieldGuid: selectedC.value, 1136 fieldGuid: selectedC.value,
...@@ -818,42 +1139,111 @@ const drawerBtnClick = async (btn, info) => { ...@@ -818,42 +1139,111 @@ const drawerBtnClick = async (btn, info) => {
818 btn.loading = false; 1139 btn.loading = false;
819 proxy.$ElMessage.error(res.msg); 1140 proxy.$ElMessage.error(res.msg);
820 } 1141 }
821 1142 } catch (error) {
1143 btn.loading = false;
1144 }
822 1145
823 } 1146 }
824 } 1147 }
825 1148 // 辅助函数:检查对象的除 `fieldGuid` 和 `execGuid` 外的字段是否为空
826 const handleTreeItemMenuClick = (data: any, type) => { 1149 const isValidParam = (param) => {
827 console.log('handleTreeItemMenuClick', data, type); 1150 const { fieldGuid, execGuid, ...rest } = param;
1151 return Object.values(rest).some(value => value !== null && value !== undefined && value !== '');
828 } 1152 }
829 1153
1154 const drawerRef = ref<any>();
1155 const drawerSelectChange = (val, row, info) => {
1156 const tempInfo = drawerRef.value.getDrawerConRef('drawerFormRef').formInline;
1157 if (val === 'between') {
1158 classEditFormItems.value.forEach(item => {
1159 if (item.field === 'orderNum') {
1160 item.visible = false;
1161 }
1162 if (item.field === 'orderNum1') {
1163 item.visible = true;
1164 }
1165 if (item.field === 'orderNumLength') {
1166 item.default = val;
1167 }
1168 });
1169 }
1170 if (val === '>' || val === '<' || val === '=' || val === '>=' || val === '<=') {
1171 {
1172 classEditFormItems.value.forEach(item => {
1173 if (item.field === 'orderNum') {
1174 item.visible = true;
1175 }
1176 if (item.field === 'orderNum1') {
1177 item.visible = false;
1178 }
1179 if (item.field === 'orderNumLength') {
1180 item.default = val;
1181 }
1182 });
1183 }
1184 }
1185 classEditFormItems.value.forEach(item => {
1186 if (item.field === 'orderNum') {
1187 item.default = tempInfo.orderNum;
1188 }
1189 if (item.field === 'dictionaryGuid') {
1190 item.default = tempInfo.dictionaryGuid;
1191 }
1192 if (item.field === 'isNotNull') {
1193 item.default = tempInfo.isNotNull;
1194 }
1195 if (item.field === 'isUnique') {
1196 item.default = tempInfo.isUnique;
1197 }
1198 if (item.field === 'fieldValueRange' && item.children) {
1199 item.children.forEach(item => {
1200 if (item.field === 'startValue') {
1201 item.default = tempInfo.startValue;
1202 }
1203 if (item.field === 'endValue') {
1204 item.default = tempInfo.endValue;
1205 }
1206 });
1207 }
1208 if (item.field === 'fieldValueRange' && !item.children) {
1209 item.default = tempInfo.fieldValueRange;
1210 }
1211 });
1212
1213 }
1214 // 记录切换时的信息记录
830 1215
831 1216
832 // tab切换 1217 // tab切换
833 const activeName = ref('first'); 1218 const activeName = ref('first');
834 const handleClick = (tab: any) => { 1219 const handleClick = async (tab: any) => {
835 // 切换时选中的配置业务规则清空 1220 // 切换时选中的配置业务规则清空
836 selectedRulesData.value = {}; 1221 selectedRulesData.value = {};
837 console.log(tab.props.name);
838 activeName.value = tab.props.name; 1222 activeName.value = tab.props.name;
839 if (tab.props.name === 'second') { 1223 if (tab.props.name === 'second') {
840 classifyDetailGuidInfo.value = ''; 1224 classifyDetailGuidInfo.value = '';
841 if (activeTab.value === 'table') { 1225 // if (activeTab.value === 'table') {
842 searchItemList.value[0].visible = false; 1226 // searchItemList.value[0].visible = false;
843 searchItemList.value[1].visible = false; 1227 // searchItemList.value[1].visible = false;
844 searchItemList.value[0].default = ''; 1228 // searchItemList.value[0].default = '';
845 searchItemList.value[1].default = ''; 1229 // searchItemList.value[1].default = '';
846 } 1230 // }
847 selectedA.value = null; 1231 selectedA.value = null;
848 selectedB.value = null; 1232 selectedB.value = null;
849 selectedC.value = null; 1233 selectedC.value = null;
850 optionsA.value = []; 1234 optionsA.value = [];
851 optionsB.value = []; 1235 optionsB.value = [];
852 optionsC.value = []; 1236 optionsC.value = [];
853 getDataBaseTreeData(); 1237 await getDataBaseTreeData();
854 getDataBaseTableData(); 1238 await getDbDirTableSelectData(1, {});
855 getDataBaseFieldData(); 1239 await getDataBaseTableData();
856 getDbDirTableSelectData(1, {}); 1240 await getDataBaseFieldData();
1241 await getDbDirTableSelectData(2, { databaseGuid: selectedA.value, condition: "2" });
1242 // if (activeTab.value === 'word') {
1243 // await getDbDirTableSelectData(1, {});
1244 // await getDbDirTableSelectData(2, { databaseGuid: selectedA.value, condition: "2" });
1245 // }
1246
857 } else { 1247 } else {
858 searchItemList.value[0].visible = true; 1248 searchItemList.value[0].visible = true;
859 searchItemList.value[1].visible = true; 1249 searchItemList.value[1].visible = true;
...@@ -879,14 +1269,47 @@ const getDataBaseTreeData = async () => { ...@@ -879,14 +1269,47 @@ const getDataBaseTreeData = async () => {
879 const dataArray = res.data; 1269 const dataArray = res.data;
880 // 遍历并添加 GUIDs 1270 // 遍历并添加 GUIDs
881 dataArray.forEach(addGuids); 1271 dataArray.forEach(addGuids);
1272 console.log('dataArray', dataArray, localStorage.getItem("onActiveInfo"));
882 // 更新到绑定的响应式数据 1273 // 更新到绑定的响应式数据
883 dataBaseTreeData.value = dataArray; 1274 dataBaseTreeData.value = dataArray;
884 dataBaseTreeInfo.value.data = dataArray; 1275 dataBaseTreeInfo.value.data = dataArray;
1276 if (localStorage.getItem("shouldReloadData")) {
1277 dataBaseTreeInfo.value.expandedKey = [];
1278 const info = JSON.parse(localStorage.getItem("onActiveInfo") || '{}');
1279 dataBaseTreeInfo.value.expandedKey.push(dataArray[info.dbindex].guid);
1280 dataBaseTreeInfo.value.currentNodeKey = dataArray[info.dbindex].guid;
1281 dataBaseGuid.value = dataArray[info?.dbindex].databaseGuid;
1282 currentDatabasePath.value = info?.path;
1283 if (dataArray[info?.dbindex].dicType === 1) {
1284 isShowCreateBtn.value = true;
1285 }
1286 if (dataArray[info?.dbindex].dicType === 2) {
1287 isShowCreateBtn.value = false;
1288 }
1289 dataBaseTreeInfo.value.loading = false;
1290 return;
1291 }
1292 if (route.query.databaseGuid && route.query.tableGuid) {
1293 dataBaseTreeInfo.value.expandedKey = [];
1294 dataBaseTreeInfo.value.expandedKey.push(route.query.tableGuid);
1295 dataBaseTreeInfo.value.currentNodeKey = route.query.tableGuid;
1296 dataBaseGuid.value = route.query.databaseGuid;
1297 currentDatabasePath.value = findDDatabasePath(dataBaseTreeData.value, route.query.tableGuid);
1298 const item = dataBaseTreeData.value.find(item => item.databaseGuid === route.query.databaseGuid);
1299 if (item === 1) {
1300 isShowCreateBtn.value = true;
1301 }
1302 if (item === 2) {
1303 isShowCreateBtn.value = false;
1304 }
1305 dataBaseTreeInfo.value.loading = false;
1306 return;
1307 }
885 dataBaseTreeInfo.value.expandedKey.push(dataArray[0].guid); 1308 dataBaseTreeInfo.value.expandedKey.push(dataArray[0].guid);
886 dataBaseTreeInfo.value.currentNodeKey = dataArray[0].guid; 1309 dataBaseTreeInfo.value.currentNodeKey = dataArray[0].guid;
887 dataBaseGuid.value = dataArray[0].databaseGuid; 1310 dataBaseGuid.value = dataArray[0].databaseGuid;
888 currentDatabasePath.value = [dataArray[0].name]; 1311 currentDatabasePath.value = [dataArray[0].name];
889 console.log('dataArray', dataArray); 1312 selectedA.value = dataArray[0].databaseGuid;
890 if (dataArray[0].dicType === 1) { 1313 if (dataArray[0].dicType === 1) {
891 isShowCreateBtn.value = true; 1314 isShowCreateBtn.value = true;
892 } 1315 }
...@@ -921,10 +1344,10 @@ const getDataBaseTableData = async (params = {}) => { ...@@ -921,10 +1344,10 @@ const getDataBaseTableData = async (params = {}) => {
921 const dataBaseParams = { 1344 const dataBaseParams = {
922 pageIndex: dataBasePage.value.curr, 1345 pageIndex: dataBasePage.value.curr,
923 pageSize: dataBasePage.value.limit, 1346 pageSize: dataBasePage.value.limit,
924 isDataAsset: '', 1347 isDataAsset: checked.value ? 'Y' : '',
925 execGuid: execGuidInfo.value.execGuid, 1348 execGuid: execGuidInfo.value.execGuid,
926 tableGuid: tableGuid.value, 1349 tableGuid: tableGuid.value || selectedB.value || '',
927 databaseGuid: dataBaseGuid.value, 1350 databaseGuid: dataBaseGuid.value || selectedA.value || '',
928 fieldGuid: "", 1351 fieldGuid: "",
929 labelGuid: "", 1352 labelGuid: "",
930 classifyDetailGuid: "", 1353 classifyDetailGuid: "",
...@@ -973,8 +1396,8 @@ const getDataBaseFieldData = async (params = {}) => { ...@@ -973,8 +1396,8 @@ const getDataBaseFieldData = async (params = {}) => {
973 pageIndex: dataFieldPage.value.curr, 1396 pageIndex: dataFieldPage.value.curr,
974 pageSize: dataFieldPage.value.limit, 1397 pageSize: dataFieldPage.value.limit,
975 execGuid: execGuidInfo.value.execGuid, 1398 execGuid: execGuidInfo.value.execGuid,
976 tableGuid: tableGuid.value || '', 1399 tableGuid: tableGuid.value || selectedB.value || '',
977 databaseGuid: dataBaseGuid.value || '', 1400 databaseGuid: dataBaseGuid.value || selectedA.value || '',
978 fieldGuid: "", 1401 fieldGuid: "",
979 labelGuid: "", 1402 labelGuid: "",
980 classifyDetailGuid: "", 1403 classifyDetailGuid: "",
...@@ -1019,7 +1442,12 @@ const tableFieldsDataInfo = ref({ ...@@ -1019,7 +1442,12 @@ const tableFieldsDataInfo = ref({
1019 { label: "表中文名", field: "tableChName", width: 140, }, 1442 { label: "表中文名", field: "tableChName", width: 140, },
1020 { label: "数据库名称", field: "database", width: 120 }, 1443 { label: "数据库名称", field: "database", width: 120 },
1021 { label: "数据库中文名", field: "databaseChName", width: TableColumnWidth.DATETIME }, 1444 { label: "数据库中文名", field: "databaseChName", width: TableColumnWidth.DATETIME },
1022 { label: "分类", field: "classifyDetailName", width: 120, align: 'left' }, 1445 {
1446 label: "分类", field: "classifyDetailNameRoutes", width: 120, align: 'left', getName: (scope) => {
1447 // 判断 Array.isArray(scope.row.classifyDetailNameRoutes)
1448 return Array.isArray(scope.row.classifyDetailNameRoutes) ? scope.row.classifyDetailNameRoutes.join('/') : '--';
1449 }
1450 },
1023 { label: "分级", field: "gradeDetailName", width: 120, align: 'left' }, 1451 { label: "分级", field: "gradeDetailName", width: 120, align: 'left' },
1024 // { label: "标签", field: "label", width: 120, align: 'center' }, 1452 // { label: "标签", field: "label", width: 120, align: 'center' },
1025 ], 1453 ],
...@@ -1041,18 +1469,27 @@ const showTableOrDatabase = ref(true); ...@@ -1041,18 +1469,27 @@ const showTableOrDatabase = ref(true);
1041 const isShowCreateBtn = ref(true); 1469 const isShowCreateBtn = ref(true);
1042 // 定义tableGuid 1470 // 定义tableGuid
1043 const tableGuid = ref(''); 1471 const tableGuid = ref('');
1044 const dataBaseGuid = ref(''); 1472 const dataBaseGuid = ref<any>('');
1045 const dataBaseInfo = ref<any>({}); 1473 const dataBaseInfo = ref<any>({});
1046 1474
1475 // 记录onActive的信息
1476 const onActiveInfo = ref<any>({});
1477
1047 const dataBasenodeClick = (data: any) => { 1478 const dataBasenodeClick = (data: any) => {
1048 isShowCreateBtn.value = false; 1479 isShowCreateBtn.value = false;
1049 console.log('dataBasenodeClick', data, dataBaseTreeData.value); 1480 // 找到data.databaseGuid 在dataBaseTreeData.value 中的下标索引,普通数组遍历就行
1481 const dbindex = dataBaseTreeData.value.findIndex((item) => {
1482 return item.guid === data.databaseGuid;
1483 });
1050 const path = findDDatabasePath(dataBaseTreeData.value, data.guid); 1484 const path = findDDatabasePath(dataBaseTreeData.value, data.guid);
1051 console.log('path', path); 1485 onActiveInfo.value = {
1486 dbindex,
1487 path
1488 }
1489 localStorage.setItem('onActiveInfo', JSON.stringify(onActiveInfo.value));
1490
1052 if (path) { 1491 if (path) {
1053 currentDatabasePath.value = path; 1492 currentDatabasePath.value = path;
1054 } else {
1055 console.error('未找到路径');
1056 } 1493 }
1057 if (data.databaseGuid) { 1494 if (data.databaseGuid) {
1058 dataBaseInfo.value = data; 1495 dataBaseInfo.value = data;
...@@ -1065,33 +1502,46 @@ const dataBasenodeClick = (data: any) => { ...@@ -1065,33 +1502,46 @@ const dataBasenodeClick = (data: any) => {
1065 } 1502 }
1066 tableGuid.value = ''; 1503 tableGuid.value = '';
1067 getDataBaseFieldData({ 1504 getDataBaseFieldData({
1068 databaseGuid: data.databaseGuid 1505 databaseGuid: data.databaseGuid,
1506 gradeDetailGuid: levelGuidInfo.value,
1507 tableGuid: tableGuid.value || selectedB.value || '',
1508 fieldGuid: selectedC.value || '',
1069 }); 1509 });
1070 getDataBaseTableData({ 1510 getDataBaseTableData({
1071 databaseGuid: data.databaseGuid 1511 gradeDetailGuid: levelGuidInfo.value,
1512 databaseGuid: data.databaseGuid || selectedA.value || '',
1513 tableGuid: tableGuid.value || selectedB.value || '',
1072 }); 1514 });
1073 } 1515 }
1074 if (data.tableGuid) { 1516 if (data.tableGuid) {
1075 tableGuid.value = data.tableGuid; 1517 tableGuid.value = data.tableGuid;
1076 dataBaseGuid.value = ''; 1518 dataBaseGuid.value = '';
1077 getDataBaseFieldData({ 1519 getDataBaseFieldData({
1078 tableGuid: data.tableGuid 1520 tableGuid: data.tableGuid,
1521 gradeDetailGuid: levelGuidInfo.value || '',
1522 databaseGuid: data.databaseGuid || selectedA.value || '',
1523 fieldGuid: data.fieldGuid || selectedC.value || '',
1524 });
1525 getDataBaseTableData({
1526 gradeDetailGuid: levelGuidInfo.value || '',
1527 databaseGuid: data.databaseGuid || selectedA.value || '',
1528 tableGuid: tableGuid.value || selectedB.value || '',
1079 }); 1529 });
1080 1530
1081 } 1531 }
1082 1532
1083 if (data.databaseGuid || data.cgDirName) { 1533 // if (data.databaseGuid || data.cgDirName) {
1084 showTableOrDatabase.value = true; 1534 // showTableOrDatabase.value = true;
1085 return; 1535 // return;
1086 } 1536 // }
1087 if (data.tableGuid) { 1537 // if (data.tableGuid) {
1088 showTableOrDatabase.value = false; 1538 // showTableOrDatabase.value = false;
1089 return; 1539 // return;
1090 } 1540 // }
1091 1541
1092 } 1542 }
1093 1543
1094 const findDDatabasePath = (data: any[], targetGuid: string, path: string[] = []) => { 1544 const findDDatabasePath = (data: any[], targetGuid: any, path: string[] = []) => {
1095 for (const item of data) { 1545 for (const item of data) {
1096 path.push(item.name); // 添加当前节点名称 1546 path.push(item.name); // 添加当前节点名称
1097 if (item.guid === targetGuid) { 1547 if (item.guid === targetGuid) {
...@@ -1106,8 +1556,38 @@ const findDDatabasePath = (data: any[], targetGuid: string, path: string[] = []) ...@@ -1106,8 +1556,38 @@ const findDDatabasePath = (data: any[], targetGuid: string, path: string[] = [])
1106 return null; // 未找到目标节点 1556 return null; // 未找到目标节点
1107 }; 1557 };
1108 1558
1109 const nodeSelectChange = (data: any) => { 1559 const nodeSelectChange = (node, checked, checkedChildren) => {
1110 console.log('nodeSelectChange', data); 1560 console.log('nodeSelectChange', node, node.parent.data, checkedChildren);
1561 if (node.parent.data.databaseGuid) {
1562 selectedA.value = node.parent.data.databaseGuid;
1563 selectedB.value = '';
1564 if (activeName.value == 'second') {
1565 if (activeTab.value === 'word') {
1566 getDbDirFieldSelectData(2, { databaseGuid: selectedA.value, condition: "2" });
1567 } else {
1568 getDbDirTableSelectData(2, { databaseGuid: selectedA.value, condition: "2" }); // 数据库搜索
1569 }
1570 }
1571 // 选中的是数据库
1572 }
1573 if (node.data.databaseGuid) {
1574 // 选中的是字段
1575 selectedA.value = node.data.databaseGuid;
1576 selectedB.value = '';
1577 if (activeName.value == 'second') {
1578 if (activeTab.value === 'word') {
1579 getDbDirFieldSelectData(2, { databaseGuid: selectedA.value, condition: "2" });
1580 } else {
1581 getDbDirTableSelectData(2, { databaseGuid: selectedA.value, condition: "2" }); // 数据库搜索
1582 }
1583 }
1584 }
1585 if (node.data.tableGuid) {
1586 // 选中的是表
1587 selectedB.value = node.data.tableGuid || '';
1588 getDbDirFieldSelectData(3, { tableGuid: selectedB.value, databaseGuid: selectedA.value, condition: "3" });
1589 }
1590
1111 } 1591 }
1112 1592
1113 const handleSubjectTableCommand = (command: string) => { 1593 const handleSubjectTableCommand = (command: string) => {
...@@ -1161,29 +1641,17 @@ const addIsShowDatabaseTip = () => { ...@@ -1161,29 +1641,17 @@ const addIsShowDatabaseTip = () => {
1161 const activeTab = ref('table'); 1641 const activeTab = ref('table');
1162 const isShowWordSearch = ref(true); 1642 const isShowWordSearch = ref(true);
1163 const setActiveTab = (tab) => { 1643 const setActiveTab = (tab) => {
1164 console.log('setActiveTab', tab);
1165 activeTab.value = tab; 1644 activeTab.value = tab;
1166 if (tab === 'word' && activeName.value === 'second') { 1645 // if (tab === 'word' && activeName.value === 'second') {
1167 searchItemList.value[0].visible = true; 1646 // searchItemList.value[0].visible = true;
1168 searchItemList.value[1].visible = true; 1647 // searchItemList.value[1].visible = true;
1169 searchItemList.value[0].default = ''; 1648 // searchItemList.value[0].default = '';
1170 searchItemList.value[1].default = ''; 1649 // searchItemList.value[1].default = '';
1171 isShowWordSearch.value = false; 1650 // isShowWordSearch.value = false;
1172 optionsA.value = []; 1651 // optionsA.value = [];
1173 optionsB.value = []; 1652 // optionsB.value = [];
1174 optionsC.value = []; 1653 // optionsC.value = [];
1175 getDbDirFieldSelectData(1); 1654 // }
1176 } else {
1177 searchItemList.value[0].visible = false;
1178 searchItemList.value[1].visible = false;
1179 searchItemList.value[0].default = '';
1180 searchItemList.value[1].default = '';
1181 isShowWordSearch.value = true;
1182 optionsA.value = [];
1183 optionsB.value = [];
1184 optionsC.value = [];
1185 getDbDirTableSelectData(1, {});
1186 }
1187 }; 1655 };
1188 1656
1189 // 数据库字段搜索联动 getDbDirFieldSelectList 1657 // 数据库字段搜索联动 getDbDirFieldSelectList
...@@ -1263,14 +1731,7 @@ const getDbDirTableSelectData = async (type, params = {}) => { ...@@ -1263,14 +1731,7 @@ const getDbDirTableSelectData = async (type, params = {}) => {
1263 })); 1731 }));
1264 } 1732 }
1265 if (type == 2) { 1733 if (type == 2) {
1266 if (activeTab.value === 'word') { 1734
1267 console.log('进来了吗', res.data);
1268 optionsC.value = res.data.map((item) => ({
1269 dbGuid: item.fieldName, // 字段标识
1270 name: item.fieldName, // 字段名称
1271 }));
1272 return;
1273 }
1274 optionsB.value = res.data.map((item) => ({ 1735 optionsB.value = res.data.map((item) => ({
1275 dbGuid: item.tableGuid, // 表标识 1736 dbGuid: item.tableGuid, // 表标识
1276 name: item.tableChName, // 表名称 1737 name: item.tableChName, // 表名称
...@@ -1289,6 +1750,7 @@ const getDbDirTableSelectData = async (type, params = {}) => { ...@@ -1289,6 +1750,7 @@ const getDbDirTableSelectData = async (type, params = {}) => {
1289 }; 1750 };
1290 1751
1291 1752
1753
1292 const selectedA = ref<any>(null); 1754 const selectedA = ref<any>(null);
1293 const selectedB = ref<any>(null); 1755 const selectedB = ref<any>(null);
1294 const selectedC = ref<any>(null); 1756 const selectedC = ref<any>(null);
...@@ -1297,6 +1759,7 @@ const optionsA = ref<any>([]); ...@@ -1297,6 +1759,7 @@ const optionsA = ref<any>([]);
1297 const optionsB = ref<any>([]); 1759 const optionsB = ref<any>([]);
1298 const optionsC = ref<any>([]); 1760 const optionsC = ref<any>([]);
1299 1761
1762 const dataBaseRef = ref<any>();
1300 // 第一个下拉框值改变时 1763 // 第一个下拉框值改变时
1301 const onAChange = async () => { 1764 const onAChange = async () => {
1302 selectedB.value = null; 1765 selectedB.value = null;
...@@ -1314,7 +1777,32 @@ const onAChange = async () => { ...@@ -1314,7 +1777,32 @@ const onAChange = async () => {
1314 await getDbDirTableSelectData(2, { databaseGuid: selectedA.value, condition: "2" }); // 数据库搜索 1777 await getDbDirTableSelectData(2, { databaseGuid: selectedA.value, condition: "2" }); // 数据库搜索
1315 } 1778 }
1316 } 1779 }
1317 1780 // nextTick(() => {
1781 // const nodeElement = dataBaseRef.value.treeRef.$el.querySelector(`[data-key="${String(selectedA.value)}"]`);
1782 // if (nodeElement) {
1783 // nodeElement.offsetTop - dataBaseRef.value.treeRef.$el.clientHeight > 0 && (dataBaseRef.value.treeRef.$el.scrollTop = nodeElement.offsetTop - dataBaseRef.value.treeRef.$el.clientHeight + 32);
1784 // }
1785 // });
1786
1787 nextTick(() => {
1788 setTimeout(() => {
1789 const nodeElement = dataBaseRef.value.treeRef.$el.querySelector(`[data-key="${String(selectedA.value)}"]`);
1790 if (nodeElement) {
1791 const rect = nodeElement.getBoundingClientRect();
1792 const treeRect = dataBaseRef.value.treeRef.$el.getBoundingClientRect();
1793 const offset = rect.top - treeRect.top;
1794 console.log('offset', rect, treeRect);
1795 // 这里的 32 是偏移量,可以调整为你需要的距离
1796 const targetScrollTop = dataBaseRef.value.treeRef.$el.scrollTop + offset
1797
1798 dataBaseRef.value.treeRef.$el.scrollTo({
1799 top: targetScrollTop,
1800 behavior: 'smooth'
1801 });
1802 }
1803 }, 200);
1804 });
1805 console.log('selectedA',);
1318 1806
1319 }; 1807 };
1320 1808
...@@ -1328,10 +1816,35 @@ const onBChange = async () => { ...@@ -1328,10 +1816,35 @@ const onBChange = async () => {
1328 await getSearchTableList(3, selectedB.value); // 分类分级搜索 1816 await getSearchTableList(3, selectedB.value); // 分类分级搜索
1329 } 1817 }
1330 if (activeName.value == 'second') { 1818 if (activeName.value == 'second') {
1819 await getDbDirFieldSelectData(3, { tableGuid: selectedB.value, databaseGuid: selectedA.value, condition: "3" });
1331 if (activeTab.value === 'word') { 1820 if (activeTab.value === 'word') {
1332 await getDbDirFieldSelectData(3, { tableGuid: selectedB.value, databaseGuid: selectedA.value, condition: "3" }); 1821 await getDbDirFieldSelectData(3, { tableGuid: selectedB.value, databaseGuid: selectedA.value, condition: "3" });
1333 } 1822 }
1334 } 1823 }
1824 // nextTick(() => {
1825 // const nodeElement = dataBaseRef.value.treeRef.$el.querySelector(`[data-key="${String(selectedB.value)}"]`);
1826 // if (nodeElement) {
1827 // nodeElement.offsetTop - dataBaseRef.value.treeRef.$el.clientHeight > 0 && (dataBaseRef.value.treeRef.$el.scrollTop = nodeElement.offsetTop - dataBaseRef.value.treeRef.$el.clientHeight + 32);
1828 // }
1829 // });
1830 nextTick(() => {
1831 setTimeout(() => {
1832 const nodeElement = dataBaseRef.value.treeRef.$el.querySelector(`[data-key="${String(selectedB.value)}"]`);
1833 if (nodeElement) {
1834 const rect = nodeElement.getBoundingClientRect();
1835 const treeRect = dataBaseRef.value.treeRef.$el.getBoundingClientRect();
1836 const offset = rect.top - treeRect.top;
1837 console.log('offset', rect, treeRect);
1838 // 这里的 32 是偏移量,可以调整为你需要的距离
1839 const targetScrollTop = dataBaseRef.value.treeRef.$el.scrollTop + offset
1840
1841 dataBaseRef.value.treeRef.$el.scrollTo({
1842 top: targetScrollTop,
1843 behavior: 'smooth'
1844 });
1845 }
1846 }, 200);
1847 });
1335 }; 1848 };
1336 1849
1337 // 导出 1850 // 导出
...@@ -1353,46 +1866,95 @@ const exportDB = async () => { ...@@ -1353,46 +1866,95 @@ const exportDB = async () => {
1353 } 1866 }
1354 1867
1355 1868
1356 // 标签guid 1869
1357 const labelGuidInfo = ref('');
1358 // 分级guid信息 1870 // 分级guid信息
1359 const levelGuidInfo = ref(''); 1871 const levelGuidInfo = ref('');
1360 // 标签选择 1872 // 标签选择
1361 const selectChange = (val, row, info) => { 1873 const selectChange = (val, row, info) => {
1362 console.log('selectChange', val, row, info);
1363 if (info.classifyName == undefined) {
1364 classifyDetailGuidInfo.value = '';
1365 }
1366 if (info) { 1874 if (info) {
1367 labelGuidInfo.value = info.labelName;
1368 levelGuidInfo.value = info.levelName; 1875 levelGuidInfo.value = info.levelName;
1369 } 1876 }
1370 } 1877 }
1371 1878
1372 // 这里应该是onActivated 钩子,路由从configure-路由从configure-rules跳转过来要重新请求数据、 1879 // 这里应该是onActivated 钩子,路由从configure-路由从configure-rules跳转过来要重新请求数据、
1373 onActivated(async () => { 1880 onActivated(async () => {
1374 if (route.query.reload === 'true') { 1881 if (localStorage.getItem('shouldReloadData') === 'true') {
1375 await getExecGuid(); 1882 await getDataBaseTableData({
1376 activeName.value = 'second';
1377 getDataBaseTreeData();
1378 getDataBaseTableData({
1379 exexGuid: execGuidInfo.value.execGuid 1883 exexGuid: execGuidInfo.value.execGuid
1380 }); 1884 });
1381 getDataBaseFieldData( 1885 localStorage.removeItem('shouldReloadData');
1382 {
1383 exexGuid: execGuidInfo.value.execGuid
1384 }
1385 );
1386 getDbDirTableSelectData(1, {});
1387 } 1886 }
1388 }); 1887 });
1389 1888
1889 const gradeTreeRef = ref<any>();
1390 const treeSelectNodeClick = (node, item) => { 1890 const treeSelectNodeClick = (node, item) => {
1891 classifyDetailGuidInfo.value = node.classifyDetailGuid;
1391 treeInfo.value.expandedKey = []; 1892 treeInfo.value.expandedKey = [];
1392 treeInfo.value.expandedKey.push(node.classifyDetailGuid); 1893 treeInfo.value.expandedKey.push(node.classifyDetailGuid);
1393 treeInfo.value.currentNodeKey = node.classifyDetailGuid; 1894 treeInfo.value.currentNodeKey = node.classifyDetailGuid;
1895 const path = findPath(CgDirTreeList.value, node.guid);
1896 if (path) {
1897 currentPath.value = path;
1898 console.log('找到路径:', path);
1899 } else {
1900 console.error('未找到路径');
1901 }
1902 if (activeName.value === 'second' && activeTab.value === 'word') {
1903 }
1904
1905
1906 nextTick(() => {
1907 setTimeout(() => {
1908 const nodeElement = gradeTreeRef.value.treeRef.$el.querySelector(`[data-key="${String(node.classifyDetailGuid)}"]`);
1909 if (nodeElement) {
1910 const rect = nodeElement.getBoundingClientRect();
1911 const treeRect = gradeTreeRef.value.treeRef.$el.getBoundingClientRect();
1912 const offset = rect.top - treeRect.top;
1913 console.log('offset', rect, treeRect);
1914 // 这里的 32 是偏移量,可以调整为你需要的距离
1915 const targetScrollTop = gradeTreeRef.value.treeRef.$el.scrollTop + offset
1916
1917 gradeTreeRef.value.treeRef.$el.scrollTo({
1918 top: targetScrollTop,
1919 behavior: 'smooth'
1920 });
1921 }
1922 }, 200);
1923 });
1924
1394 } 1925 }
1395 1926
1927 watchEffect(() => {
1928 console.log(`count 的值是: ${selectedA.value}`);
1929 if (activeName.value === 'second') {
1930 dataBaseTreeInfo.value.expandedKey = [];
1931 dataBaseTreeInfo.value.expandedKey.push(selectedA.value);
1932 dataBaseTreeInfo.value.currentNodeKey = selectedA.value;
1933 if (selectedB.value) {
1934 dataBaseTreeInfo.value.currentNodeKey = selectedB.value;
1935 }
1936 }
1937 if (activeName.value === 'second' && activeTab.value === 'table') {
1938 searchItemList.value[0].visible = false;
1939 searchItemList.value[1].visible = false;
1940 searchItemList.value[0].default = '';
1941 searchItemList.value[1].default = '';
1942 }
1943 if (activeName.value === 'first') {
1944 searchItemList.value[0].visible = true;
1945 searchItemList.value[1].visible = true;
1946 searchItemList.value[0].default = '';
1947 searchItemList.value[1].default = '';
1948 }
1949 if (activeName.value === 'second' && activeTab.value === 'word') {
1950 searchItemList.value[0].visible = true;
1951 searchItemList.value[1].visible = true;
1952 searchItemList.value[0].default = '';
1953 searchItemList.value[1].default = '';
1954 }
1955 });
1956
1957
1396 </script> 1958 </script>
1397 1959
1398 <template> 1960 <template>
...@@ -1410,6 +1972,10 @@ const treeSelectNodeClick = (node, item) => { ...@@ -1410,6 +1972,10 @@ const treeSelectNodeClick = (node, item) => {
1410 :clearable="true" v-if="!(activeTab === 'table' && activeName === 'second')"> 1972 :clearable="true" v-if="!(activeTab === 'table' && activeName === 'second')">
1411 <el-option v-for="item in optionsC" :key="item.dbGuid" :label="item.name" :value="item.dbGuid" /> 1973 <el-option v-for="item in optionsC" :key="item.dbGuid" :label="item.name" :value="item.dbGuid" />
1412 </el-select> 1974 </el-select>
1975 <!-- <el-select v-model="selectedD" placeholder="选择字段类型" style="width: 140px;margin-right: 8px" :clearable="true"
1976 v-if="activeName === 'first'">
1977 <el-option v-for="item in optionsD" :key="item.value" :label="item.label" :value="item.value" />
1978 </el-select> -->
1413 <TableTools :searchItems="searchItemList" :init="false" :searchId="'files-standard-search'" @search="toSearch" 1979 <TableTools :searchItems="searchItemList" :init="false" :searchId="'files-standard-search'" @search="toSearch"
1414 @selectChange="selectChange" @treeSelectNodeClick="treeSelectNodeClick" /> 1980 @selectChange="selectChange" @treeSelectNodeClick="treeSelectNodeClick" />
1415 </div> 1981 </div>
...@@ -1417,11 +1983,12 @@ const treeSelectNodeClick = (node, item) => { ...@@ -1417,11 +1983,12 @@ const treeSelectNodeClick = (node, item) => {
1417 <div class="aside_wrap"> 1983 <div class="aside_wrap">
1418 <el-tabs v-model="activeName" class="v-tabs" @tab-click="handleClick"> 1984 <el-tabs v-model="activeName" class="v-tabs" @tab-click="handleClick">
1419 <el-tab-pane label="分类分级目录" name="first"> 1985 <el-tab-pane label="分类分级目录" name="first">
1420 <Tree :treeInfo="treeInfo" @nodeClick="nodeClick" /> 1986 <Tree :treeInfo="treeInfo" @nodeClick="nodeClick" ref="gradeTreeRef" />
1421 <!-- <Tree ref="treeInfoRef" :treeInfo="treeInfo" @nodeClick="nodeClick" /> --> 1987 <!-- <Tree ref="treeInfoRef" :treeInfo="treeInfo" @nodeClick="nodeClick" /> -->
1422 </el-tab-pane> 1988 </el-tab-pane>
1423 <el-tab-pane label="数据库目录" name="second"> 1989 <el-tab-pane label="数据库目录" name="second">
1424 <Tree :treeInfo="dataBaseTreeInfo" @nodeClick="dataBasenodeClick" @nodeSelectChange='nodeSelectChange' /> 1990 <Tree :treeInfo="dataBaseTreeInfo" @nodeClick="dataBasenodeClick" @nodeSelectChange='nodeSelectChange'
1991 ref="dataBaseRef" />
1425 </el-tab-pane> 1992 </el-tab-pane>
1426 </el-tabs> 1993 </el-tabs>
1427 </div> 1994 </div>
...@@ -1491,8 +2058,8 @@ const treeSelectNodeClick = (node, item) => { ...@@ -1491,8 +2058,8 @@ const treeSelectNodeClick = (node, item) => {
1491 </div> 2058 </div>
1492 </div> 2059 </div>
1493 2060
1494 2061 <!-- v-if="!tableGuid && activeTab === 'table'" -->
1495 <div class="btns-area" v-if="!tableGuid && activeTab === 'table'"> 2062 <div class="btns-area" v-if="activeName === 'second' && activeTab === 'table'">
1496 <div class="left-btns"> 2063 <div class="left-btns">
1497 <div class="dropdown_btn" v-if="isShowCreateBtn"> 2064 <div class="dropdown_btn" v-if="isShowCreateBtn">
1498 <el-dropdown popper-class="table-create-menu" @command="handleSubjectTableCommand" 2065 <el-dropdown popper-class="table-create-menu" @command="handleSubjectTableCommand"
...@@ -1533,16 +2100,16 @@ const treeSelectNodeClick = (node, item) => { ...@@ -1533,16 +2100,16 @@ const treeSelectNodeClick = (node, item) => {
1533 </div> 2100 </div>
1534 </div> 2101 </div>
1535 <div class="table_panel_wrap_database" :style="{ height: `calc(100% - ${tipHeight1}px)` }" 2102 <div class="table_panel_wrap_database" :style="{ height: `calc(100% - ${tipHeight1}px)` }"
1536 v-if="!tableGuid && activeTab === 'table'"> 2103 v-if="activeTab === 'table'">
1537 <Table :tableInfo="dataBaseTableInfo" @tablePageChange="dataBaseTablePageChange" 2104 <Table :tableInfo="dataBaseTableInfo" @tablePageChange="dataBaseTablePageChange"
1538 @tableSwitchBeforeChange="tableSwitchBeforeChange" /> 2105 @tableSwitchBeforeChange="tableSwitchBeforeChange" />
1539 </div> 2106 </div>
1540 <div class="table_field" :style="{ height: `calc(100% - ${tipHeight2}px)` }" 2107 <div class="table_field" :style="{ height: `calc(100% - ${tipHeight2}px)` }" v-if="activeTab === 'word'">
1541 v-if="tableGuid || activeTab === 'word'">
1542 <Table :tableInfo="tableFieldsDataInfo" @tablePageChange="dataFieldTablePageChange" /> 2108 <Table :tableInfo="tableFieldsDataInfo" @tablePageChange="dataFieldTablePageChange" />
1543 </div> 2109 </div>
1544 </div> 2110 </div>
1545 <Drawer :drawerInfo="drawerInfo" @drawerBtnClick="drawerBtnClick" class="v-drawer" /> 2111 <Drawer :drawerInfo="drawerInfo" @drawerBtnClick="drawerBtnClick" class="v-drawer" ref="drawerRef"
2112 @drawerSelectChange="drawerSelectChange" />
1546 2113
1547 </div> 2114 </div>
1548 </div> 2115 </div>
......
...@@ -26,6 +26,31 @@ const getBizRuleConfigDetailData = async () => { ...@@ -26,6 +26,31 @@ const getBizRuleConfigDetailData = async () => {
26 item.isEdit = false 26 item.isEdit = false
27 }) 27 })
28 tableData.value = bizRuleConfigData.value 28 tableData.value = bizRuleConfigData.value
29 // 处理tableData,fieldLengthCondition,有值则不用加字段,如果没有值则加字段lengthSymbol 为''
30 tableData.value.forEach((item: any) => {
31 if (!item.fieldLengthCondition) {
32 item.lengthSymbol = ''
33 }
34 if (!isSingleInput(item.fieldType) && (item.startValue || item.endValue)) {
35 item.fieldValueRange = (item.startValue ? item.startValue : '') + '#' + (item.endValue ? item.endValue : '')
36 }
37 if (item.fieldLengthCondition) {
38 const arr = item.fieldLengthCondition.split('#'); // 按 '#' 分割
39 // 判断数组中是否包含 'between'
40 if (arr.includes('between')) {
41 // 如果包含 'between',则将对应的 start 和 end 值赋给相应的字段
42 item.lengthSymbol = 'between';
43 item.numberRangeStart = arr[1]; // start value
44 item.numberRangeEnd = arr[2]; // end value
45 } else {
46 // 否则处理其他符号条件,如 '>=', '<=', '>', '<', '=' 等
47 item.lengthSymbol = arr[0]; // 符号(如 '>', '<=', 等)
48 item.lengthValue = arr[1]; // 值(如 10,20 等)
49 }
50 }
51 })
52 console.log('tableData', tableData.value)
53
29 tableFieldsLoading.value = false 54 tableFieldsLoading.value = false
30 } else { 55 } else {
31 proxy.$message.error(res.msg) 56 proxy.$message.error(res.msg)
...@@ -165,130 +190,193 @@ const editRow = (row) => { ...@@ -165,130 +190,193 @@ const editRow = (row) => {
165 if (!tempRowData.value.find((item) => item.fieldGuid === row.fieldGuid)) { 190 if (!tempRowData.value.find((item) => item.fieldGuid === row.fieldGuid)) {
166 tempRowData.value.push({ ...row }); 191 tempRowData.value.push({ ...row });
167 } 192 }
168 if (row.fieldLengthCondition) { 193 console.log('tempRowData:', tempRowData.value);
169 const arr = row.fieldLengthCondition.split('#') 194 // console.log('tempRowData:', tempRowData.value);
170 row.lengthSymbol = arr[0] 195 // if (row.fieldLengthCondition) {
171 row.lengthValue = arr[1] 196 // const arr = row.fieldLengthCondition.split('#'); // 按 '#' 分割
172 } 197
173 if (row.fieldValueRange) { 198 // // 判断数组中是否包含 'between'
174 const arr = row.fieldValueRange.split('#') 199 // if (arr.includes('between')) {
175 row.rangeStart = arr[0] 200 // // 如果包含 'between',则将对应的 start 和 end 值赋给相应的字段
176 row.rangeEnd = arr[1] 201 // row.lengthSymbol = 'between';
177 } 202 // row.numberRangeStart = arr[1]; // start value
203 // row.numberRangeEnd = arr[2]; // end value
204 // } else {
205 // // 否则处理其他符号条件,如 '>=', '<=', '>', '<', '=' 等
206 // row.lengthSymbol = arr[0]; // 符号(如 '>', '<=', 等)
207 // row.lengthValue = arr[1]; // 值(如 10,20 等)
208 // }
209 // }
210 // if (row.fieldValueRange && !isSingleInput(row.fieldType)) {
211 // const arr = row.fieldValueRange.split('#')
212 // row.startValue = arr[0]
213 // row.endValue = arr[1]
214 // }
215
178 row.isEdit = true; // 进入编辑模式 216 row.isEdit = true; // 进入编辑模式
179 217
180 }; 218 };
181 219
182 // 保存数据 220 // 保存数据
183 const saveRow = (row) => { 221 const saveRow = (row) => {
222
223 console.log('保存:', row);
224 const tempRow = row;
225 let fieldLengthCondition = ''
226 let fieldValueRange = ''
227 if (row.lengthSymbol === 'between') {
228 // 校验不能为空,其中一个为空则提示
229 if (!row.numberRangeStart || !row.numberRangeStart) {
230 proxy.$message.error('请输入完整的长度范围');
231 return;
232 }
233 if (row.numberRangeStart && !row.numberRangeStart) {
234 proxy.$ElMessage.error('请输入完整的长度范围');
235 return
236 }
237 if (!row.numberRangeStart && row.numberRangeStart) {
238 proxy.$ElMessage.error('请输入完整的长度范围');
239 return
240 }
241 console.log(row.lengthSymbol + '#' + row.numberRangeStart + '#' + row.numberRangeEnd)
242 row.fieldLengthCondition = row.lengthSymbol + '#' + row.numberRangeStart + '#' + row.numberRangeEnd
243 fieldLengthCondition = row.lengthSymbol + '#' + row.numberRangeStart + '#' + row.numberRangeEnd
244 } else {
245 if (!row.lengthValue && row.lengthSymbol) {
246 proxy.$message.error('请输入完整的长度范围');
247 return;
248 }
249 if (!row.lengthSymbol && row.lengthValue) {
250 proxy.$message.error('请输入完整的长度范围');
251 return;
252 }
253 if (!row.lengthSymbol && !row.lengthValue) {
254 row.fieldLengthCondition = ''
255 fieldLengthCondition = ''
256 }
184 if (row.lengthSymbol && row.lengthValue) { 257 if (row.lengthSymbol && row.lengthValue) {
185 row.fieldLengthCondition = row.lengthSymbol + '#' + row.lengthValue 258 row.fieldLengthCondition = row.lengthSymbol + '#' + row.lengthValue
259 fieldLengthCondition = row.lengthSymbol + '#' + row.lengthValue
260 }
261 }
262 // 字段范围 双文本情况
263 if (!isSingleInput(row.fieldType)) {
264 if (row.startValue || row.endValue) {
265 row.fieldValueRange = (row.startValue ? row.startValue : '') + '#' + (row.endValue ? row.endValue : '')
266 fieldValueRange = (row.startValue ? row.startValue : '') + '#' + (row.endValue ? row.endValue : '')
267 } else {
268 row.fieldValueRange = ''
269 fieldValueRange = row.fieldValueRange
270 }
271 } else {
272 fieldValueRange = row.fieldValueRange
273 }
274
275 if (tableData.value.find((item: any) => item.fieldGuid === row.fieldGuid)) {
276 tableData.value.forEach(item => {
277 if (item.fieldGuid === row.fieldGuid) {
278 item.fieldLengthCondition = fieldLengthCondition
279 item.fieldValueRange = fieldValueRange
280 item.fieldGuid = tempRow.fieldGuid
281 item.fieldPrecision = tempRow.fieldPrecision
282 item.isUnique = tempRow.isUnique
283 item.notNull = tempRow.notNull
284 }
285 });
286 // 更新 tempRowData 中保存的数据
287 const tempRowIndex = tempRowData.value.findIndex((item) => item.fieldGuid === row.fieldGuid);
288 if (tempRowIndex !== -1) {
289 // 更新 tempRowData 为保存后的数据
290 tempRowData.value[tempRowIndex] = { ...row };
186 } 291 }
187 if (row.rangeStart && row.rangeEnd) {
188 row.fieldValueRange = row.rangeStart + '#' + row.rangeEnd
189 } 292 }
190 row.isEdit = false 293 row.isEdit = false
191 } 294 }
192 const data = [
193 {
194 value: '1',
195 label: 'Level one 1',
196 children: [
197 {
198 value: '1-1',
199 label: 'Level two 1-1',
200 children: [
201 {
202 value: '1-1-1',
203 label: 'Level three 1-1-1',
204 },
205 ],
206 },
207 ],
208 },
209 {
210 value: '2',
211 label: 'Level one 2',
212 children: [
213 {
214 value: '2-1',
215 label: 'Level two 2-1',
216 children: [
217 {
218 value: '2-1-1',
219 label: 'Level three 2-1-1',
220 },
221 ],
222 },
223 {
224 value: '2-2',
225 label: 'Level two 2-2',
226 children: [
227 {
228 value: '2-2-1',
229 label: 'Level three 2-2-1',
230 },
231 ],
232 },
233 ],
234 },
235 {
236 value: '3',
237 label: 'Level one 3',
238 children: [
239 {
240 value: '3-1',
241 label: 'Level two 3-1',
242 children: [
243 {
244 value: '3-1-1',
245 label: 'Level three 3-1-1',
246 },
247 ],
248 },
249 {
250 value: '3-2',
251 label: 'Level two 3-2',
252 children: [
253 {
254 value: '3-2-1',
255 label: 'Level three 3-2-1',
256 },
257 ],
258 },
259 ],
260 },
261 ]
262 295
263 const loading = ref(false) 296 const loading = ref(false)
264 const saveData = async () => { 297 const saveData = async () => {
265 loading.value = true 298 loading.value = true
266 /**入参 299 let inParams = [] as any
267 * "guid": "string", 300 console.log('tableData.value', tableData.value)
268 "fieldGuid": "string", 301 // 遍历tableData.value,校验
269 "fieldLengthCondition": "string", 302 for (let i = 0; i < tableData.value.length - 1; i++) {
270 "fieldPrecision": 0, 303 let item = tableData.value[i]
271 "dictionaryGuid": "string", 304 if (item.lengthSymbol == 'between') {
272 "isUnique": "string", 305 if ((!item.numberRangeStart && item.numberRangeEnd) || (item.numberRangeStart && !item.numberRangeEnd) || (!item.numberRangeStart && !item.numberRangeEnd)) {
273 "isNotNull": "string", 306 proxy.$message.error(`第${i + 1}行,请输入完整的长度范围!`);
274 "fieldValueRange": "string" 307 loading.value = false
275 */ 308 return
276 const inParams = [] as any 309 }
310 } else if (item.lengthSymbol === '>' || item.lengthSymbol === '<' || item.lengthSymbol === '=' || item.lengthSymbol === '>=' || item.lengthSymbol === '<=') {
311 if ((!item.lengthSymbol && item.lengthValue) || (item.lengthSymbol && !item.lengthValue)) {
312 proxy.$message.error(`第${i + 1}行,请输入完整的长度范围!`);
313 loading.value = false
314 return
315 }
316 }
317 }
318 console.log('tableData.value', tableData.value)
319
277 tableData.value.forEach((item: any) => { 320 tableData.value.forEach((item: any) => {
278 const obj = { 321 let fieldLengthCondition = ''
322 if (item.lengthSymbol == 'between') {
323 fieldLengthCondition = item.lengthSymbol + '#' + item.numberRangeStart + '#' + item.numberRangeEnd
324 } else if (item.lengthSymbol === '>' || item.lengthSymbol === '<' || item.lengthSymbol === '=' || item.lengthSymbol === '>=' || item.lengthSymbol === '<=') {
325 fieldLengthCondition = item.lengthSymbol + '#' + item.lengthValue
326 } else {
327 fieldLengthCondition = ''
328 }
329
330
331 if (isSingleInput(item.fieldType)) {
332 inParams.push(
333 {
279 fieldGuid: item.fieldGuid, 334 fieldGuid: item.fieldGuid,
280 execGuid: router.currentRoute.value.query.execGuid, 335 execGuid: router.currentRoute.value.query.execGuid,
281 fieldLengthCondition: item.fieldLengthCondition, 336 fieldLengthCondition: fieldLengthCondition,
282 fieldPrecision: item.fieldPrecision, 337 fieldPrecision: item.fieldPrecision,
283 dictionaryGuid: item.dictionaryGuid, 338 dictionaryGuid: item.dictionaryGuid,
284 isUnique: item.isUnique, 339 isUnique: item.isUnique,
285 notNull: item.notNull, 340 notNull: item.notNull,
286 fieldValueRange: item.fieldValueRange 341 fieldValueRange: item.fieldValueRange
287 } 342 }
288 inParams.push(obj) 343 )
344 } else {
345 inParams.push(
346 {
347 fieldGuid: item.fieldGuid,
348 execGuid: router.currentRoute.value.query.execGuid,
349 fieldLengthCondition: fieldLengthCondition,
350 fieldPrecision: item.fieldPrecision,
351 dictionaryGuid: item.dictionaryGuid,
352 isUnique: item.isUnique,
353 notNull: item.notNull,
354 startValue: item.startValue,
355 endValue: item.endValue
356 }
357 )
358 }
289 }) 359 })
290 360 // // 克隆一份 inParams,用于遍历
291 // console.log('finalParams', inParams) 361 const cloneInParams = JSON.parse(JSON.stringify(inParams));
362 // // 遍历 cloneInParams,检查每一项的字段
363 let allFieldsEmpty = true; // 标记所有字段是否都为空
364 for (let i = 0; i < cloneInParams.length; i++) {
365 // 判断每项中除 fieldGuid 和 execGuid 外的字段是否都为空
366 const item = cloneInParams[i];
367 const isEmpty = !item.notNull && !item.fieldValueRange && !item.isUnique && !item.dictionaryGuid && !item.fieldLengthCondition && !item.fieldPrecision && !item.startValue && !item.endValue;
368
369 // 如果有有效的字段,则不清空 inParams
370 if (!isEmpty) {
371 allFieldsEmpty = false;
372 break;
373 }
374 }
375 // 如果所有项的字段都为空,则清空 inParams
376 if (allFieldsEmpty) {
377 inParams = [];
378 }
379 try {
292 const res: any = await saveBizRuleConfig(inParams) 380 const res: any = await saveBizRuleConfig(inParams)
293 if (res.code === proxy.$passCode) { 381 if (res.code === proxy.$passCode) {
294 loading.value = false 382 loading.value = false
...@@ -301,6 +389,9 @@ const saveData = async () => { ...@@ -301,6 +389,9 @@ const saveData = async () => {
301 loading.value = false 389 loading.value = false
302 proxy.$message.error(res.msg) 390 proxy.$message.error(res.msg)
303 } 391 }
392 } catch (error) {
393 loading.value = false
394 }
304 } 395 }
305 396
306 397
...@@ -317,14 +408,108 @@ const cancel = () => { ...@@ -317,14 +408,108 @@ const cancel = () => {
317 408
318 // 点击取消 409 // 点击取消
319 const cancelEdit = (row) => { 410 const cancelEdit = (row) => {
320 console.log('取消编辑:', row); 411 // console.log('取消编辑:', row, tempRowData.value);
321 // 可在此恢复原始数据逻辑,要查找暂存的数据 tempRowData 中 fieldGuid 与当前行的 fieldGuid 相同的数据 412 // 可在此恢复原始数据逻辑,要查找暂存的数据 tempRowData 中 fieldGuid 与当前行的 fieldGuid 相同的数据
322 const tempRow = tempRowData.value.find((item) => item.fieldGuid === row.fieldGuid); 413 const tempRow = tempRowData.value.find((item) => item.fieldGuid === row.fieldGuid);
323 Object.assign(row, tempRow); 414
415 // 遍历tableData.value,找到当前行并恢复原始数据
416 tableData.value.forEach((item) => {
417 if (item.fieldGuid === tempRow.fieldGuid) {
418 // 恢复原始数据
419 item.fieldLengthCondition = tempRow.fieldLengthCondition;
420 item.fieldPrecision = tempRow.fieldPrecision;
421 item.isUnique = tempRow.isUnique;
422 item.notNull = tempRow.notNull;
423 item.fieldValueRange = tempRow.fieldValueRange;
424 }
425 });
324 426
325 row.isEdit = false; // 退出编辑状态 427 row.isEdit = false; // 退出编辑状态
326 } 428 }
327 429
430 // 判断是否为单文本框
431 const isSingleInput = (fieldType: string) => {
432 // 定义单文本框的字段类型
433 const singleInputTypes = ['string', 'text', 'varchar', 'json', 'bit', 'char'];
434 return singleInputTypes.includes(fieldType) || !fieldType; // 如果fieldType为空,默认为单文本框
435 };
436
437 const validatePositiveInteger = (row: any, field: string) => {
438 let value = row[field];
439
440 // 如果输入值为0,则将其设置为1
441 if (value === '0') {
442 row[field] = '1';
443 return;
444 }
445
446 // 判断输入是否符合正整数且在1到9999之间
447 if (value && !/^\d{1,4}$/.test(value)) {
448 // 如果不是1到4位的正整数,清空输入值
449 row[field] = '';
450 } else if (value && (parseInt(value) < 1 || parseInt(value) > 9999)) {
451 // 如果数字小于1或大于9999,清空输入值
452 row[field] = '';
453 }
454 };
455
456 function parseFieldLengthCondition(condition) {
457 // 如果 condition 为 null 或 undefined,直接返回默认值
458 if (!condition) {
459 return '--';
460 }
461 if (condition.includes('between')) {
462 const parts = condition.split('#').filter(Boolean); // 按 '#' 分割并去掉空值
463 return `介于${parts[1]}-${parts[2]}`; // 显示为 "10-20"
464 }
465 let symbol = '';
466 let value = '';
467 if (condition.startsWith('>=') || condition.startsWith('<=')) {
468 symbol = condition.slice(0, 2); // 取前两个字符 '>=', '<='
469 value = condition.substring(2); // 取从第三个字符开始的部分 '10'
470 } else {
471 symbol = condition[0];
472 value = condition.substring(1);
473 }
474 value = value.replace('#', '');
475 let displayText = '';
476 switch (symbol) {
477 case '>':
478 displayText = `大于${value}`;
479 break;
480 case '=':
481 displayText = `等于${value}`;
482 break;
483 case '<':
484 displayText = `小于${value}`;
485 break;
486 case '>=':
487 displayText = `大于等于${value}`;
488 break;
489 case '<=':
490 displayText = `小于等于${value}`;
491 break;
492 default:
493 displayText = `--`;
494 break;
495 }
496 return displayText;
497 }
498
499 const inputLengthKeyUp = (regexp, scope, field, max: any = null, min: any = null) => {
500 scope.row[field] = scope.row[field].replace(regexp, '');
501 if (field == 'fieldLength' && scope.row.dataType == 'decimal') {
502 max = 65;
503 }
504 /** 最大值设置2000 */
505 if (max && scope.row[field] > max) {
506 scope.row[field] = max;
507 }
508 if (min !== null && scope.row[field] != '' && scope.row[field] <= min) {
509 scope.row[field] = min;
510 }
511 }
512
328 </script> 513 </script>
329 <template> 514 <template>
330 <div class="configure-rules"> 515 <div class="configure-rules">
...@@ -335,9 +520,9 @@ const cancelEdit = (row) => { ...@@ -335,9 +520,9 @@ const cancelEdit = (row) => {
335 'max-height': 'calc(100% - 16px)', 520 'max-height': 'calc(100% - 16px)',
336 display: 'inline-block', 521 display: 'inline-block',
337 }"> 522 }">
338 <el-table-column prop="databaseChName" label="数据源" width="180" /> 523 <el-table-column prop="databaseChName" label="数据源" width="180" show-overflow-tooltip />
339 <el-table-column prop="tableName" label="表名称" width="180" /> 524 <el-table-column prop="tableName" label="表名称" width="180" show-overflow-tooltip />
340 <el-table-column prop="tableChName" label="数据库表" width="280" /> 525 <el-table-column prop="tableChName" label="数据库表" width="280" show-overflow-tooltip />
341 <el-table-column prop="description" label="描述" width="180" show-overflow-tooltip /> 526 <el-table-column prop="description" label="描述" width="180" show-overflow-tooltip />
342 </el-table> 527 </el-table>
343 </div> 528 </div>
...@@ -369,9 +554,10 @@ const cancelEdit = (row) => { ...@@ -369,9 +554,10 @@ const cancelEdit = (row) => {
369 </template> 554 </template>
370 </el-table-column> 555 </el-table-column>
371 <!-- 分类(不可编辑)classifyName --> 556 <!-- 分类(不可编辑)classifyName -->
372 <el-table-column prop="classifyDetailName" label="分类" width="120" show-overflow-tooltip> 557 <el-table-column prop="classifyDetailNameRoutes" label="分类" width="120" show-overflow-tooltip>
373 <template #default="scope"> 558 <template #default="scope">
374 {{ scope.row.classifyDetailName ? scope.row.classifyDetailName : '--' }} 559 {{ Array.isArray(scope.row.classifyDetailNameRoutes) ? scope.row.classifyDetailNameRoutes.join('/') : '--'
560 }}
375 </template> 561 </template>
376 </el-table-column> 562 </el-table-column>
377 <!-- 分级(不可编辑) --> 563 <!-- 分级(不可编辑) -->
...@@ -381,7 +567,7 @@ const cancelEdit = (row) => { ...@@ -381,7 +567,7 @@ const cancelEdit = (row) => {
381 </template> 567 </template>
382 </el-table-column> 568 </el-table-column>
383 <!-- 字段类型fieldType (不可编辑) --> 569 <!-- 字段类型fieldType (不可编辑) -->
384 <el-table-column prop="fieldType" label="字段类型" width="120" align="center"> 570 <el-table-column prop="fieldType" label="字段类型" width="120" align="center" show-overflow-tooltip>
385 <template #default="scope"> 571 <template #default="scope">
386 {{ 572 {{
387 573
...@@ -392,36 +578,60 @@ const cancelEdit = (row) => { ...@@ -392,36 +578,60 @@ const cancelEdit = (row) => {
392 </el-table-column> 578 </el-table-column>
393 579
394 <!-- 长度列 fieldLengthCondition: '>#10',--> 580 <!-- 长度列 fieldLengthCondition: '>#10',-->
395 <el-table-column prop="fieldLengthCondition" label="长度" width="240" align="center"> 581 <el-table-column prop="fieldLengthCondition" label="长度" width="270" align="left" show-overflow-tooltip>
396 <template #default="scope"> 582 <template #default="scope">
397 <span v-if="!scope.row.isEdit">{{ scope.row.fieldLengthCondition 583 <span v-if="!scope.row.isEdit">
398 ? scope.row.fieldLengthCondition.replace('#', '') : '--' }}</span> 584 {{ parseFieldLengthCondition(scope.row.fieldLengthCondition) || '--' }}
585 </span>
399 <div v-else> 586 <div v-else>
400 <el-select v-model="scope.row.lengthSymbol" placeholder="请选择" style="width: 50%;margin-right: 8px;"> 587 <div style="display: flex; align-items: center;">
588 <el-select v-model="scope.row.lengthSymbol" placeholder="请选择" style="width: 70%;margin-right: 8px;"
589 clearable>
401 <el-option label="大于" value=">"></el-option> 590 <el-option label="大于" value=">"></el-option>
402 <el-option label="等于" value="="></el-option> 591 <el-option label="等于" value="="></el-option>
403 <el-option label="小于" value="<"></el-option> 592 <el-option label="小于" value="<"></el-option>
404 <el-option label="大于等于" value=">="></el-option> 593 <el-option label="大于等于" value=">="></el-option>
405 <el-option label="小于等于" value="<="></el-option> 594 <el-option label="小于等于" value="<="></el-option>
595 <!-- 介于 -->
596 <el-option label="介于" value="between"></el-option>
406 </el-select> 597 </el-select>
407 <el-input v-model="scope.row.lengthValue" placeholder="请输入" style="width: 45%;" /> 598
599 <!-- 当选择"介于"时,显示两个输入框 -->
600 <div v-if="scope.row.lengthSymbol === 'between'" style="display: flex; gap: 5px; align-items: center;">
601 <el-input v-model="scope.row.numberRangeStart" placeholder="请输入" style="width: 45%;" type="number"
602 clearable @input="validatePositiveInteger(scope.row, 'numberRangeStart')" />
603 <span>-</span>
604 <el-input v-model="scope.row.numberRangeEnd" placeholder="请输入" style="width: 45%;" type="number"
605 clearable @input="validatePositiveInteger(scope.row, 'numberRangeEnd')" />
606 </div>
607
608 <!-- 其他符号时显示一个输入框 -->
609 <div v-else>
610 <el-input v-model="scope.row.lengthValue" placeholder="请输入" style="width: 70%;" clearable
611 @input="validatePositiveInteger(scope.row, 'lengthValue')" type="number" />
612 </div>
613 </div>
408 </div> 614 </div>
409 </template> 615 </template>
410 </el-table-column> 616 </el-table-column>
411 <el-table-column prop="fieldPrecision" label="精度" width="120" align="center"> 617
618 <el-table-column prop="fieldPrecision" label="精度" width="120" align="center" show-overflow-tooltip>
412 <template #default="scope"> 619 <template #default="scope">
413 <span v-if="!scope.row.isEdit || !editableFields.fieldPrecision">{{ 620 <!-- 判断是否是浮点型,并且当前行是否可编辑 -->
414 scope.row.fieldPrecision ? scope.row.fieldPrecision : '--' }}</span> 621 <span v-if="!scope.row.isEdit || !editableFields.fieldPrecision || scope.row.fieldType !== 'decimal'">
415 <el-input v-else v-model="scope.row.fieldPrecision" placeholder="请输入精度" /> 622 {{ scope.row.fieldPrecision ? scope.row.fieldPrecision : '--' }}
623 </span>
624 <el-input v-else v-model="scope.row.fieldPrecision" placeholder="请输入精度" clearable
625 @input="inputLengthKeyUp(/\D/g, scope, 'fieldPrecision', 30, 1)" />
416 </template> 626 </template>
417 </el-table-column> 627 </el-table-column>
418 628
419 <!-- 关联字典(可编辑)el-tree-select 形式下拉形式 --> 629 <!-- 关联字典(可编辑)el-tree-select 形式下拉形式 -->
420 <el-table-column prop="dictionaryGuid" label="关联字典" width="150" align="center"> 630 <el-table-column prop="dictionaryGuid" label="关联字典" width="150" align="left" show-overflow-tooltip>
421 <template #default="scope"> 631 <template #default="scope">
422 <span v-if="!scope.row.isEdit">{{ scope.row.dictionaryGuid 632 <span v-if="!scope.row.isEdit">{{ scope.row.dictionaryGuid
423 ? dictionaryList.find((item: any) => item.guid === scope.row.dictionaryGuid)?.chName : '--' }}</span> 633 ? dictionaryList.find((item: any) => item.guid === scope.row.dictionaryGuid)?.chName : '--' }}</span>
424 <el-select v-else v-model="scope.row.dictionaryGuid" placeholder="请选择"> 634 <el-select v-else v-model="scope.row.dictionaryGuid" placeholder="请选择" clearable>
425 <el-option v-for="item in dictionaryList" :key="item?.guid" :label="item.chName" :value="item.guid" /> 635 <el-option v-for="item in dictionaryList" :key="item?.guid" :label="item.chName" :value="item.guid" />
426 </el-select> 636 </el-select>
427 </template> 637 </template>
...@@ -429,23 +639,23 @@ const cancelEdit = (row) => { ...@@ -429,23 +639,23 @@ const cancelEdit = (row) => {
429 </el-table-column> 639 </el-table-column>
430 640
431 <!-- 数据是否唯一(可编辑) --> 641 <!-- 数据是否唯一(可编辑) -->
432 <el-table-column prop="isUnique" label="数据是否唯一" width="150" align="center"> 642 <el-table-column prop="isUnique" label="数据是否唯一" width="150" align="left" show-overflow-tooltip>
433 <template #default="scope"> 643 <template #default="scope">
434 <span v-if="!scope.row.isEdit || !editableFields.isUnique">{{ scope.row.isUnique ? (scope.row.isUnique === 644 <span v-if="!scope.row.isEdit || !editableFields.isUnique">{{ scope.row.isUnique ? (scope.row.isUnique ===
435 'Y' ? '是' : '否') : '--' 645 'Y' ? '是' : '否') : '--'
436 }}</span> 646 }}</span>
437 <el-select v-else v-model="scope.row.isUnique" placeholder="请选择"> 647 <el-select v-else v-model="scope.row.isUnique" placeholder="请选择" clearable>
438 <el-option label="是" value="Y" /> 648 <el-option label="是" value="Y" />
439 <el-option label="否" value="N" /> 649 <el-option label="否" value="N" />
440 </el-select> 650 </el-select>
441 </template> 651 </template>
442 </el-table-column> 652 </el-table-column>
443 <!-- 是否必填(可编辑) --> 653 <!-- 是否必填(可编辑) -->
444 <el-table-column prop="notNull" label="是否必填" width="120" align="center"> 654 <el-table-column prop="notNull" label="是否必填" width="120" align="left" show-overflow-tooltip>
445 <template #default="scope"> 655 <template #default="scope">
446 <span v-if="!scope.row.isEdit">{{ scope.row.notNull ? (scope.row.notNull === 'Y' ? '是' : '否') : '--' 656 <span v-if="!scope.row.isEdit">{{ scope.row.notNull ? (scope.row.notNull === 'Y' ? '是' : '否') : '--'
447 }}</span> 657 }}</span>
448 <el-select v-else v-model="scope.row.notNull" placeholder="请选择"> 658 <el-select v-else v-model="scope.row.notNull" placeholder="请选择" clearable>
449 <el-option label="是" value="Y" /> 659 <el-option label="是" value="Y" />
450 <el-option label="否" value="N" /> 660 <el-option label="否" value="N" />
451 </el-select> 661 </el-select>
...@@ -453,24 +663,34 @@ const cancelEdit = (row) => { ...@@ -453,24 +663,34 @@ const cancelEdit = (row) => {
453 </el-table-column> 663 </el-table-column>
454 664
455 <!-- 字段取值范围 fieldValueRange(可编辑)--> 665 <!-- 字段取值范围 fieldValueRange(可编辑)-->
456 <el-table-column prop="fieldValueRange" label="字段取值范围" width="260" align="center"> 666 <el-table-column prop="fieldValueRange" label="字段取值范围" width="260" align="left" show-overflow-tooltip>
457 <template #default="scope"> 667 <template #default="scope">
458 <!-- 非编辑模式,展示取值范围 --> 668 <!-- 非编辑模式,展示取值范围 -->
459 <span v-if="!scope.row.isEdit"> 669 <span v-if="!scope.row.isEdit">
460 {{ scope.row.fieldValueRange 670 {{ scope.row.fieldValueRange
461 ? scope.row.fieldValueRange.replace('#', '-') : '--' }} 671 ? scope.row.fieldValueRange.replace('#', '-') : '--' }}
462 </span> 672 </span>
463 <!-- 编辑模式,显示两个输入框 --> 673 <!-- 编辑模式,显示不同的输入框 -->
464 <div v-else style="display: flex; gap: 5px; align-items: center;"> 674 <div v-else style="display: flex; gap: 5px; align-items: center;">
465 <el-input v-model="scope.row.rangeStart" placeholder="最小值" style="width: 45%;" type="number" /> 675 <!-- 判断字段类型并渲染对应的输入框 -->
676 <template v-if="isSingleInput(scope.row.fieldType)">
677 <!-- 单文本框:字符型、大字段型、单字符型、JSON类型、布尔类型 -->
678 <el-input v-model="scope.row.fieldValueRange" placeholder="请输入" clearable maxlength="500" />
679 </template>
680 <template v-else>
681 <!-- 双文本框:整型、日期型、日期时间型、时间戳、浮点型、一字节整型、时间类型 -->
682 <el-input v-model="scope.row.startValue" placeholder="请输入开始值" style="width: 45%;" clearable
683 maxlength="200" />
466 <span>-</span> 684 <span>-</span>
467 <el-input v-model="scope.row.rangeEnd" placeholder="最大值" style="width: 45%;" type="number" /> 685 <el-input v-model="scope.row.endValue" placeholder="请输入结束值" style="width: 45%;" clearable
686 maxlength="200" />
687 </template>
468 </div> 688 </div>
469 </template> 689 </template>
470 </el-table-column> 690 </el-table-column>
471 691
472 <!-- 操作列 --> 692 <!-- 操作列 -->
473 <el-table-column label="操作" width="120" align="center" fixed="right"> 693 <el-table-column label="操作" width="120" align="center" fixed="right" show-overflow-tooltip>
474 <template #default="scope"> 694 <template #default="scope">
475 <span class="text_btn" v-if="!scope.row.isEdit" @click="editRow(scope.row)">编辑</span> 695 <span class="text_btn" v-if="!scope.row.isEdit" @click="editRow(scope.row)">编辑</span>
476 <span v-else> 696 <span v-else>
...@@ -484,8 +704,8 @@ const cancelEdit = (row) => { ...@@ -484,8 +704,8 @@ const cancelEdit = (row) => {
484 </el-table> 704 </el-table>
485 </div> 705 </div>
486 <div class="botton_btn"> 706 <div class="botton_btn">
487 <el-button type="primary" @click="saveData" :loading="loading">保存</el-button>
488 <el-button @click="cancel">取消</el-button> 707 <el-button @click="cancel">取消</el-button>
708 <el-button type="primary" @click="saveData" :loading="loading">保存</el-button>
489 </div> 709 </div>
490 </div> 710 </div>
491 711
...@@ -518,5 +738,11 @@ const cancelEdit = (row) => { ...@@ -518,5 +738,11 @@ const cancelEdit = (row) => {
518 height: 36px; 738 height: 36px;
519 } 739 }
520 } 740 }
741
742 .botton_btn {
743 display: flex;
744 justify-content: center;
745 align-items: center;
746 }
521 } 747 }
522 </style> 748 </style>
......
...@@ -145,7 +145,7 @@ const orginItems = [ ...@@ -145,7 +145,7 @@ const orginItems = [
145 { 145 {
146 label: '字典中文名', 146 label: '字典中文名',
147 type: 'input', 147 type: 'input',
148 maxlength: 50, 148 maxlength: 20,
149 placeholder: '请输入', 149 placeholder: '请输入',
150 field: 'chName', 150 field: 'chName',
151 clearable: true, 151 clearable: true,
...@@ -154,7 +154,7 @@ const orginItems = [ ...@@ -154,7 +154,7 @@ const orginItems = [
154 }, { 154 }, {
155 label: '字典英文名', 155 label: '字典英文名',
156 type: 'input', 156 type: 'input',
157 maxlength: 50, 157 maxlength: 20,
158 placeholder: '请输入', 158 placeholder: '请输入',
159 field: 'enName', 159 field: 'enName',
160 clearable: true, 160 clearable: true,
......
...@@ -7,7 +7,7 @@ import Moment from 'moment'; ...@@ -7,7 +7,7 @@ import Moment from 'moment';
7 import { 7 import {
8 getDsTableByDs, 8 getDsTableByDs,
9 getDsData, 9 getDsData,
10 getDsTableStructure, 10 getDsTableStructures,
11 } from "@/api/modules/dataInventory"; 11 } from "@/api/modules/dataInventory";
12 12
13 13
...@@ -199,14 +199,14 @@ const getTableStructure = () => { ...@@ -199,14 +199,14 @@ const getTableStructure = () => {
199 console.log('tableName'); 199 console.log('tableName');
200 currDsTableStructureLoading.value = true; 200 currDsTableStructureLoading.value = true;
201 currDsTableStructure.value = []; 201 currDsTableStructure.value = [];
202 getDsTableStructure({ 202 getDsTableStructures([{
203 // tableName: tableName, 203 // tableName: tableName,
204 // dataSourceGuid: databaseInfo.value.guid, 204 // dataSourceGuid: databaseInfo.value.guid,
205 // database: databaseInfo.value.databaseNameEn, 205 // database: databaseInfo.value.databaseNameEn,
206 // databaseType: databaseInfo.value.databaseType, 206 // databaseType: databaseInfo.value.databaseType,
207 tableGuid: currDatasourceSelect.value.tableGuid, 207 tableGuid: currDatasourceSelect.value.tableGuid,
208 execGuid: props.execGuid 208 execGuid: props.execGuid
209 }).then((res: any) => { 209 }]).then((res: any) => {
210 currDsTableStructureLoading.value = false; 210 currDsTableStructureLoading.value = false;
211 if (res.code == proxy.$passCode) { 211 if (res.code == proxy.$passCode) {
212 currDsTableStructure.value = res.data || []; 212 currDsTableStructure.value = res.data || [];
...@@ -438,6 +438,21 @@ const getTextAlign = (field) => { ...@@ -438,6 +438,21 @@ const getTextAlign = (field) => {
438 <el-table-column prop="fieldName" label="字段英文名" width="150px" align="left" header-align="left" 438 <el-table-column prop="fieldName" label="字段英文名" width="150px" align="left" header-align="left"
439 show-overflow-tooltip> 439 show-overflow-tooltip>
440 </el-table-column> 440 </el-table-column>
441 <!-- 分类 -->
442 <el-table-column prop="classifyDetailNameRoutes" label="分类" width="150px" align="left" header-align="left"
443 show-overflow-tooltip>
444 <template #default="scope">
445 {{ scope.row['classifyDetailNameRoutes'] ? scope.row['classifyDetailNameRoutes'].join('/') : '--' }}
446 </template>
447 </el-table-column>
448 <el-table-column prop="gradeDetailName" label="分级" width="80px" align="left" header-align="left"
449 show-overflow-tooltip>
450 <template #default="scope">
451 <span>{{ scope.row['gradeDetailName'] ?? '--' }}</span>
452 </template>
453 </el-table-column>
454
455
441 <el-table-column prop="fieldChName" label="字段名" width="150px" align="left" header-align="left" 456 <el-table-column prop="fieldChName" label="字段名" width="150px" align="left" header-align="left"
442 show-overflow-tooltip> 457 show-overflow-tooltip>
443 <template #default="scope"> 458 <template #default="scope">
...@@ -472,9 +487,9 @@ const getTextAlign = (field) => { ...@@ -472,9 +487,9 @@ const getTextAlign = (field) => {
472 <span>{{ scope.row['isPrimary'] ?? '--' }}</span> 487 <span>{{ scope.row['isPrimary'] ?? '--' }}</span>
473 </template> 488 </template>
474 </el-table-column> 489 </el-table-column>
475 <el-table-column prop="isNotNull" label="是否必填" width="100px" align="left" header-align="left" 490 <el-table-column prop="notNull" label="是否必填" width="100px" align="left" header-align="left"
476 show-overflow-tooltip> 491 show-overflow-tooltip>
477 <template #default="scope">{{ scope.row['isNotNull'] === 'Y' ? 'N' : 'Y' }}</template> 492 <template #default="scope">{{ scope.row['notNull'] ?? '--' }}</template>
478 </el-table-column> 493 </el-table-column>
479 <el-table-column prop="isFk" label="是否外键" width="100px" align="left" header-align="left" 494 <el-table-column prop="isFk" label="是否外键" width="100px" align="left" header-align="left"
480 show-overflow-tooltip> 495 show-overflow-tooltip>
......
...@@ -21,6 +21,7 @@ import { ...@@ -21,6 +21,7 @@ import {
21 } from "@/api/modules/dataInventory"; 21 } from "@/api/modules/dataInventory";
22 import existingTableSelect from "./existingTableSelect.vue"; 22 import existingTableSelect from "./existingTableSelect.vue";
23 import useUserStore from "@/store/modules/user"; 23 import useUserStore from "@/store/modules/user";
24 import { download } from "@/utils/common";
24 25
25 26
26 /** 草稿中未建表时就可以编辑表相关信息。如果建表之后就只能编辑字段。 不能修改字段英文名称,数据库修改英文名就相当于删除再添加。都可以直接跳转到*/ 27 /** 草稿中未建表时就可以编辑表相关信息。如果建表之后就只能编辑字段。 不能修改字段英文名称,数据库修改英文名就相当于删除再添加。都可以直接跳转到*/
...@@ -138,8 +139,10 @@ const findRefGradeGuid = (data, targetClassifyDetailGuid) => { ...@@ -138,8 +139,10 @@ const findRefGradeGuid = (data, targetClassifyDetailGuid) => {
138 }; 139 };
139 const refGradeGuid = ref<any>(''); 140 const refGradeGuid = ref<any>('');
140 const editRow = (row) => { 141 const editRow = (row) => {
142 console.log('row', row)
141 // 进入编辑模式时,查找classifyDetailGuid所在的refGradeGuid 143 // 进入编辑模式时,查找classifyDetailGuid所在的refGradeGuid
142 refGradeGuid.value = findRefGradeGuid(treeSelectOptions.value, row.classifyDetailGuid); 144 refGradeGuid.value = findRefGradeGuid(treeSelectOptions.value, row.classifyDetailGuid);
145 console.log('refGradeGuid', refGradeGuid.value)
143 if (refGradeGuid.value) { 146 if (refGradeGuid.value) {
144 getGradeList({ classifyGradeGuid: refGradeGuid.value.refGradeGuid, pageIndex: 1, pageSize: -1 }).then((res: any) => { 147 getGradeList({ classifyGradeGuid: refGradeGuid.value.refGradeGuid, pageIndex: 1, pageSize: -1 }).then((res: any) => {
145 if (res.code === proxy.$passCode) { 148 if (res.code === proxy.$passCode) {
...@@ -187,7 +190,8 @@ onMounted(async () => { ...@@ -187,7 +190,8 @@ onMounted(async () => {
187 tableFieldsLoading.value = true; 190 tableFieldsLoading.value = true;
188 stepsInfo.value.step = 1; 191 stepsInfo.value.step = 1;
189 getDbDirDetail({ 192 getDbDirDetail({
190 tableGuid: route.query.tableGuid 193 tableGuid: route.query.tableGuid,
194 execGuid: route.query.execGuid,
191 }).then((res: any) => { 195 }).then((res: any) => {
192 if (res.code == proxy.$passCode) { 196 if (res.code == proxy.$passCode) {
193 editInfoData.value = res.data; 197 editInfoData.value = res.data;
...@@ -225,6 +229,7 @@ const selectedDatabaseTableInfo = ref<any>([]); ...@@ -225,6 +229,7 @@ const selectedDatabaseTableInfo = ref<any>([]);
225 const datasourceSelectedRows: Ref<any> = ref([]); 229 const datasourceSelectedRows: Ref<any> = ref([]);
226 // 记录数据库databaseGuid 230 // 记录数据库databaseGuid
227 const handlDsSelectedChange = (v, curr) => { 231 const handlDsSelectedChange = (v, curr) => {
232 tableDataInfo.value[0].description = curr.description || '';
228 selectedDatabaseTableInfo.value = curr || ''; 233 selectedDatabaseTableInfo.value = curr || '';
229 datasourceSelectedRows.value = v || []; 234 datasourceSelectedRows.value = v || [];
230 const params: any = []; 235 const params: any = [];
...@@ -293,6 +298,7 @@ const findDDatabasePath = (data: any[], targetGuid: string, path: string[] = [], ...@@ -293,6 +298,7 @@ const findDDatabasePath = (data: any[], targetGuid: string, path: string[] = [],
293 // 存储分级数据 298 // 存储分级数据
294 const gradeInfo = ref<any>(); 299 const gradeInfo = ref<any>();
295 const handleClassifyChange = (row, value) => { 300 const handleClassifyChange = (row, value) => {
301 console.log('row2', row, value)
296 const pathInfo = findDDatabasePath(treeSelectOptions.value, value) 302 const pathInfo = findDDatabasePath(treeSelectOptions.value, value)
297 row.classifyDetailNameRoutes = pathInfo.path; 303 row.classifyDetailNameRoutes = pathInfo.path;
298 row.classifyDetailGuidRoutes = pathInfo.route; 304 row.classifyDetailGuidRoutes = pathInfo.route;
...@@ -301,7 +307,7 @@ const handleClassifyChange = (row, value) => { ...@@ -301,7 +307,7 @@ const handleClassifyChange = (row, value) => {
301 // row.gradeOptions = []; 307 // row.gradeOptions = [];
302 // return; 308 // return;
303 // } 309 // }
304 310 // if (gradeInfo.value) {
305 // refGradeGuid.value = findRefGradeGuid(treeSelectOptions.value, row.classifyDetailGuid); 311 // refGradeGuid.value = findRefGradeGuid(treeSelectOptions.value, row.classifyDetailGuid);
306 // row.classifyDetailName = refGradeGuid.value.classifyName; 312 // row.classifyDetailName = refGradeGuid.value.classifyName;
307 // getGradeList({ classifyGradeGuid: refGradeGuid.value.refGradeGuid, pageIndex: 1, pageSize: -1 }).then((res: any) => { 313 // getGradeList({ classifyGradeGuid: refGradeGuid.value.refGradeGuid, pageIndex: 1, pageSize: -1 }).then((res: any) => {
...@@ -311,15 +317,32 @@ const handleClassifyChange = (row, value) => { ...@@ -311,15 +317,32 @@ const handleClassifyChange = (row, value) => {
311 // ElMessage.error(res.msg); 317 // ElMessage.error(res.msg);
312 // } 318 // }
313 // }); 319 // });
320 // }
314 }; 321 };
315 322
316 const handleNodeClick = (row, node, data) => { 323 const handleNodeClick = (row, node, data) => {
324 console.log('row1', row, node, data)
317 // 在gradeInfo找到item.guid === row.gradeGuid 325 // 在gradeInfo找到item.guid === row.gradeGuid
326 if (gradeInfo.value) {
318 const matchedItem = gradeInfo.value.find((item) => item.guid === node.gradeGuid); 327 const matchedItem = gradeInfo.value.find((item) => item.guid === node.gradeGuid);
319 if (matchedItem) { 328 if (matchedItem) {
320 row.gradeDetailGuid = matchedItem.guid; 329 row.gradeDetailGuid = matchedItem.guid;
321 row.gradeDetailName = matchedItem.name; 330 row.gradeDetailName = matchedItem.name;
322 } 331 }
332 } else {
333 getGradeList({ classifyGradeGuid: node.refGradeGuid, pageIndex: 1, pageSize: -1 }).then((res: any) => {
334 if (res.code === proxy.$passCode) {
335 gradeInfo.value = res.data.records || [];
336 row.gradeOptions = res.data.records || [];
337 const matchedItem = gradeInfo.value.find((item) => item.guid === node.gradeGuid);
338 row.gradeDetailGuid = matchedItem.guid;
339 row.gradeDetailName = matchedItem.name;
340 } else {
341 ElMessage.error(res.msg);
342 }
343 });
344 }
345
323 } 346 }
324 347
325 const isPrevious = ref(false); 348 const isPrevious = ref(false);
...@@ -353,7 +376,7 @@ const editableFields = { ...@@ -353,7 +376,7 @@ const editableFields = {
353 classifyDetailGuid: true, // 分类可编辑 376 classifyDetailGuid: true, // 分类可编辑
354 fieldType: true, // 字段类型可编辑 377 fieldType: true, // 字段类型可编辑
355 fieldChName: true, // 字段中文名可编辑 378 fieldChName: true, // 字段中文名可编辑
356 379 sourceFieldChName: true, // 源字段中文名可编辑
357 } 380 }
358 381
359 const tableFieldsLoading = ref(false) 382 const tableFieldsLoading = ref(false)
...@@ -762,12 +785,14 @@ const saveOrUpdate = async (params: any = {}, type) => { ...@@ -762,12 +785,14 @@ const saveOrUpdate = async (params: any = {}, type) => {
762 if (params.isDraft === 'Y') { 785 if (params.isDraft === 'Y') {
763 proxy.$ElMessage.success('保存为草稿成功!'); 786 proxy.$ElMessage.success('保存为草稿成功!');
764 userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath)); 787 userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
765 router.push({ name: 'classifyGradeCatalogue', query: { reload: 'true' } }); 788 localStorage.setItem('shouldReloadData', 'true');
789 router.push({ name: 'classifyGradeCatalogue' });
766 return 790 return
767 } 791 }
768 proxy.$ElMessage.success('保存成功!'); 792 proxy.$ElMessage.success('保存成功!');
769 userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath)); 793 userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
770 router.push({ name: 'classifyGradeCatalogue', query: { reload: 'true' } }); 794 localStorage.setItem('shouldReloadData', 'true');
795 router.push({ name: 'classifyGradeCatalogue' });
771 } else { 796 } else {
772 saveBtn.value = false 797 saveBtn.value = false
773 proxy.$ElMessage.error(res.msg); 798 proxy.$ElMessage.error(res.msg);
...@@ -779,7 +804,8 @@ const saveOrUpdate = async (params: any = {}, type) => { ...@@ -779,7 +804,8 @@ const saveOrUpdate = async (params: any = {}, type) => {
779 if (res1.code === proxy.$passCode) { 804 if (res1.code === proxy.$passCode) {
780 proxy.$ElMessage.success('编辑成功!'); 805 proxy.$ElMessage.success('编辑成功!');
781 userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath)); 806 userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
782 router.push({ name: 'classifyGradeCatalogue', query: { reload: 'true' } }); 807 localStorage.setItem('shouldReloadData', 'true');
808 router.push({ name: 'classifyGradeCatalogue' });
783 } else { 809 } else {
784 saveBtn.value = false 810 saveBtn.value = false
785 proxy.$ElMessage.error(res1.msg); 811 proxy.$ElMessage.error(res1.msg);
...@@ -787,12 +813,12 @@ const saveOrUpdate = async (params: any = {}, type) => { ...@@ -787,12 +813,12 @@ const saveOrUpdate = async (params: any = {}, type) => {
787 break; 813 break;
788 case 2: 814 case 2:
789 // 生成建表语句 815 // 生成建表语句
790 const res2: any = await createTableSql(finalParams); 816 createTableSql(finalParams).then((res: any) => {
791 if (res2.code === proxy.$passCode) { 817 download(res, '分类分级目录数据.xlsx', 'excel')
792 proxy.$ElMessage.success('建表sql生成成功!'); 818 });
793 } else { 819
794 proxy.$ElMessage.error(res2.msg); 820
795 } 821
796 break; 822 break;
797 default: 823 default:
798 break; 824 break;
...@@ -948,18 +974,18 @@ onActivated(() => { ...@@ -948,18 +974,18 @@ onActivated(() => {
948 <!-- 表名称列 --> 974 <!-- 表名称列 -->
949 <el-table-column prop="tableName" label="表名称" width="180"> 975 <el-table-column prop="tableName" label="表名称" width="180">
950 <template #header> 976 <template #header>
951 <span>表名称</span> 977 <span>数据库表</span>
952 <span style="color:red;margin-left: 2px;">*</span> 978 <span style="color:red;margin-left: 2px;">*</span>
953 </template> 979 </template>
954 <template #default="scope"> 980 <template #default="scope">
955 <el-input v-model="scope.row.tableName" placeholder="请输入表名称" /> 981 <el-input v-model="scope.row.tableName" placeholder="请输入表名称" :disabled="route.query.state === '1'" />
956 </template> 982 </template>
957 </el-table-column> 983 </el-table-column>
958 984
959 <!-- 数据库表列 --> 985 <!-- 数据库表列 -->
960 <el-table-column prop="tableChName" label="数据库表" width="280"> 986 <el-table-column prop="tableChName" label="数据库表" width="280">
961 <template #header> 987 <template #header>
962 <span>数据库表</span> 988 <span>主题表名称</span>
963 <span style="color:red;margin-left: 2px;">*</span> 989 <span style="color:red;margin-left: 2px;">*</span>
964 </template> 990 </template>
965 <template #default="scope"> 991 <template #default="scope">
...@@ -982,7 +1008,7 @@ onActivated(() => { ...@@ -982,7 +1008,7 @@ onActivated(() => {
982 <el-button @click="batchDelete">批量删除</el-button> 1008 <el-button @click="batchDelete">批量删除</el-button>
983 <el-button @click="createNewSql">生成建表语句</el-button> 1009 <el-button @click="createNewSql">生成建表语句</el-button>
984 </div> 1010 </div>
985 <div class="bottom_table"> 1011 <div class="bottom_table" v-if="route.query.editOpt === '1'">
986 <el-table :data="tableDataDetailInfo" v-loading="tableFieldsLoading" :highlight-current-row="true" stripe 1012 <el-table :data="tableDataDetailInfo" v-loading="tableFieldsLoading" :highlight-current-row="true" stripe
987 border height="100%" row-key="guid" @selection-change="selectionFieldsChange" tooltip-effect="light" :style="{ 1013 border height="100%" row-key="guid" @selection-change="selectionFieldsChange" tooltip-effect="light" :style="{
988 width: '100%', 1014 width: '100%',
...@@ -993,10 +1019,12 @@ onActivated(() => { ...@@ -993,10 +1019,12 @@ onActivated(() => {
993 <!-- 排序列(不可编辑) --> 1019 <!-- 排序列(不可编辑) -->
994 <el-table-column type="index" label="排序" width="80" align="center" /> 1020 <el-table-column type="index" label="排序" width="80" align="center" />
995 <!-- 字段中文名(可编辑)fieldChName --> 1021 <!-- 字段中文名(可编辑)fieldChName -->
996 <el-table-column prop="fieldChName" label="目标字段中文名" width="150" show-overflow-tooltip> 1022 <el-table-column prop="fieldChName" label="字段中文名" width="150" show-overflow-tooltip>
997 <!-- 可以编辑 --> 1023 <!-- 可以编辑 -->
998 <template #default="scope"> 1024 <template #default="scope">
999 <span v-if="!scope.row.isEdit || !editableFields.fieldChName">{{ scope.row.fieldChName ? 1025 <span
1026 v-if="!scope.row.isEdit || !editableFields.fieldChName || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1' && route.query.state != '0')">{{
1027 scope.row.fieldChName ?
1000 scope.row.fieldChName 1028 scope.row.fieldChName
1001 : '--' }}</span> 1029 : '--' }}</span>
1002 <el-input v-else v-model="scope.row.fieldChName" placeholder="请输入" /> 1030 <el-input v-else v-model="scope.row.fieldChName" placeholder="请输入" />
...@@ -1004,9 +1032,11 @@ onActivated(() => { ...@@ -1004,9 +1032,11 @@ onActivated(() => {
1004 1032
1005 </el-table-column> 1033 </el-table-column>
1006 <!-- 字段英文名(可编辑) --> 1034 <!-- 字段英文名(可编辑) -->
1007 <el-table-column prop="fieldName" label="目标字段英文名" width="150" show-overflow-tooltip> 1035 <el-table-column prop="fieldName" label="字段英文名" width="150" show-overflow-tooltip>
1008 <template #default="scope"> 1036 <template #default="scope">
1009 <span v-if="!scope.row.isEdit || !editableFields.fieldName">{{ scope.row.fieldName ? 1037 <span
1038 v-if="!scope.row.isEdit || !editableFields.fieldName || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1' && route.query.state != '0')">{{
1039 scope.row.fieldName ?
1010 scope.row.fieldName 1040 scope.row.fieldName
1011 : '--' }}</span> 1041 : '--' }}</span>
1012 <el-input v-else v-model="scope.row.fieldName" placeholder="必填" 1042 <el-input v-else v-model="scope.row.fieldName" placeholder="必填"
...@@ -1014,25 +1044,29 @@ onActivated(() => { ...@@ -1014,25 +1044,29 @@ onActivated(() => {
1014 </template> 1044 </template>
1015 </el-table-column> 1045 </el-table-column>
1016 <!-- 源数据库 --> 1046 <!-- 源数据库 -->
1017 <el-table-column prop="sourceDatabase" label="源数据库" width="150" show-overflow-tooltip> 1047 <el-table-column prop="sourceDatabase" label="源数据库" width="150" show-overflow-tooltip
1048 v-if="route.query.editOpt != '1'">
1018 <template #default="scope"> 1049 <template #default="scope">
1019 {{ scope.row.sourceDatabase ? scope.row.sourceDatabase : '--' }} 1050 {{ scope.row.sourceDatabase ? scope.row.sourceDatabase : '--' }}
1020 </template> 1051 </template>
1021 </el-table-column> 1052 </el-table-column>
1022 <!-- 源数据表 --> 1053 <!-- 源数据表 -->
1023 <el-table-column prop="sourceTableName" label="源数据表" width="150" show-overflow-tooltip> 1054 <el-table-column prop="sourceTableName" label="源数据表" width="150" show-overflow-tooltip
1055 v-if="route.query.editOpt != '1'">
1024 <template #default="scope"> 1056 <template #default="scope">
1025 {{ scope.row.sourceTableName ? scope.row.sourceTableName : '--' }} 1057 {{ scope.row.sourceTableName ? scope.row.sourceTableName : '--' }}
1026 </template> 1058 </template>
1027 </el-table-column> 1059 </el-table-column>
1028 <!-- 源字段中文 --> 1060 <!-- 源字段中文 -->
1029 <el-table-column prop="sourceFieldName" label="源字段中文" width="150" show-overflow-tooltip> 1061 <el-table-column prop="sourceFieldName" label="源字段中文" width="150" show-overflow-tooltip
1062 v-if="route.query.editOpt != '1'">
1030 <template #default="scope"> 1063 <template #default="scope">
1031 {{ scope.row.sourceFieldName ? scope.row.sourceFieldName : '--' }} 1064 {{ scope.row.sourceFieldName ? scope.row.sourceFieldName : '--' }}
1032 </template> 1065 </template>
1033 </el-table-column> 1066 </el-table-column>
1034 <!-- 源字段英文 --> 1067 <!-- 源字段英文 -->
1035 <el-table-column prop="sourceFieldChName" label="源字段英文" width="120" show-overflow-tooltip> 1068 <el-table-column prop="sourceFieldChName" label="源字段英文" width="120" show-overflow-tooltip
1069 v-if="route.query.editOpt != '1'">
1036 <template #default="scope"> 1070 <template #default="scope">
1037 <!-- {{ scope.row.sourceFieldName ? scope.row.sourceFieldName : '--' }} --> 1071 <!-- {{ scope.row.sourceFieldName ? scope.row.sourceFieldName : '--' }} -->
1038 1072
...@@ -1042,7 +1076,206 @@ onActivated(() => { ...@@ -1042,7 +1076,206 @@ onActivated(() => {
1042 </template> 1076 </template>
1043 </el-table-column> 1077 </el-table-column>
1044 <!-- 源端字段 fieldType fieldTypeProps--> 1078 <!-- 源端字段 fieldType fieldTypeProps-->
1045 <el-table-column prop="fieldType" label="源端字段类型" width="120"> 1079 <el-table-column prop="fieldType" label="字段类型" width="120">
1080 <template #default="scope">
1081 <div
1082 v-if="scope.row.isEdit && !(scope.row.isPrimary === 'Y' && $route.query.editOpt === '1' && route.query.state != '0')">
1083 <el-select v-model="scope.row.fieldType" placeholder="选择类型" clearable filterable
1084 :props="fieldTypeProps">
1085 <el-option v-for="(item, index) in fieldData" :key="index" :label="item.label"
1086 :value="item.value"></el-option>
1087 </el-select>
1088 </div>
1089 <div v-else>
1090 {{ fieldData ? (fieldData.find(item => item.value === scope.row.fieldType)?.label || '--') : '--' }}
1091 </div>
1092 </template>
1093 </el-table-column>
1094
1095 <!-- 长度(可编辑) -->
1096 <el-table-column prop="fieldLength" label="长度" width="100" align="left">
1097 <template #default="scope">
1098 <!-- 非编辑状态 -->
1099 <span
1100 v-if="!scope.row.isEdit || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1' && route.query.state != '0')">
1101 {{ ['varchar', 'decimal', 'char'].includes(scope.row.fieldType) ? scope.row.fieldLength || '--' : '--'
1102 }}
1103 </span>
1104 <!-- 编辑状态 -->
1105 <div v-else>
1106 <el-input v-if="['varchar', 'decimal', 'char'].includes(scope.row.fieldType)"
1107 v-model="scope.row.fieldLength" placeholder="请输入长度"
1108 @input="inputLengthKeyUp(/\D/g, scope, 'fieldLength', 2000, 1)" />
1109 <span v-else>--</span>
1110 </div>
1111 </template>
1112 </el-table-column>
1113
1114 <!-- 精度(可编辑) -->
1115 <el-table-column prop="fieldPrecision" label="精度" width="100" align="left">
1116 <template #default="scope">
1117 <!-- 非编辑状态 -->
1118 <span v-if="!scope.row.isEdit">
1119 {{ scope.row.fieldType === 'decimal' ? scope.row.fieldPrecision || '--' : '--' }}
1120 </span>
1121 <!-- 编辑状态 -->
1122 <div v-else>
1123 <el-input v-if="scope.row.fieldType === 'decimal'" v-model="scope.row.fieldPrecision"
1124 placeholder="请输入精度" @input="inputLengthKeyUp(/\D/g, scope, 'fieldPrecision', 30, 1)" />
1125 <span v-else>--</span>
1126 </div>
1127 </template>
1128 </el-table-column>
1129 <!-- 关联字典(可编辑)el-tree-select 形式下拉形式 -->
1130 <el-table-column prop="dictionaryGuid" label="关联字典" width="120" align="left">
1131 <template #default="scope">
1132 <span v-if="!scope.row.isEdit">{{ scope.row.dictionaryGuid
1133 ? dictionaryList.find((item: any) => item.guid === scope.row.dictionaryGuid)?.chName : '--' }}</span>
1134 <el-select v-else v-model="scope.row.dictionaryGuid" placeholder="请选择">
1135 <el-option v-for="item in dictionaryList" :key="item?.guid" :label="item.chName" :value="item.guid" />
1136 </el-select>
1137 </template>
1138
1139 </el-table-column>
1140
1141 <!-- 数据是否唯一(可编辑) -->
1142 <el-table-column prop="isPrimary" label="是否主键" width="100" align="left">
1143 <template #default="scope">
1144 <span
1145 v-if="!scope.row.isEdit || !editableFields.isPrimary || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1' && route.query.state != '0')">{{
1146 scope.row.isPrimary || '--' }}</span>
1147 <el-select v-else v-model="scope.row.isPrimary" placeholder="请选择">
1148 <el-option label="Y" value="Y" />
1149 <el-option label="N" value="N" />
1150 </el-select>
1151 </template>
1152 </el-table-column>
1153 <!-- 是否必填(可编辑) -->
1154 <el-table-column prop="notNull" label="是否必填" width="100" align="left">
1155 <template #default="scope">
1156 <span
1157 v-if="!scope.row.isEdit || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1' && route.query.state != '0')">{{
1158 scope.row.notNull || '--' }}</span>
1159 <el-select v-else v-model="scope.row.notNull" placeholder="请选择">
1160 <el-option label="Y" value="Y" />
1161 <el-option label="N" value="N" />
1162 </el-select>
1163 </template>
1164 </el-table-column>
1165
1166 <!-- 分类(不可编辑)classifyName -->
1167
1168 <el-table-column prop="classifyDetailNameRoutes" label="分类" width="150" show-overflow-tooltip>
1169 <template #default="scope">
1170 <!-- 如果当前行是编辑状态,显示 tree-select -->
1171 <div v-if="scope.row.isEdit">
1172 <el-tree-select v-model="scope.row.classifyDetailGuid" :data="treeSelectOptions"
1173 :props="treeSelectProps" placeholder="请选择分类" clearable filterable
1174 @change="(value) => handleClassifyChange(scope.row, value)"
1175 @node-click="(node, data) => handleNodeClick(scope.row, node, data)">
1176 </el-tree-select>
1177 </div>
1178 <!-- 否则直接显示分类名称 -->
1179 <div v-else>
1180 {{ Array.isArray(scope.row?.classifyDetailNameRoutes) ? scope.row.classifyDetailNameRoutes.join('/') :
1181 '--' }}
1182 </div>
1183 </template>
1184 </el-table-column>
1185 <!-- 分级(不可编辑) -->
1186 <el-table-column prop="gradeDetailGuid" label="分级" width="100" align="left">
1187 <template #default="scope">
1188 <div v-if="scope.row.isEdit">
1189 <el-select v-model="scope.row.gradeDetailGuid" placeholder="请选择分级" clearable filterable
1190 :props="gradeSelectProps" @change="handleGradeChange(scope.row)">
1191 <el-option v-for="(item, index) in scope.row.gradeOptions || []" :key="index" :label="item.name"
1192 :value="item.guid"></el-option>
1193 </el-select>
1194 </div>
1195 <div v-else>
1196 {{ scope.row.gradeDetailName || '--' }}
1197 </div>
1198 </template>
1199 </el-table-column>
1200 <!-- 操作列 -->
1201 <el-table-column label="操作" width="100" align="center" fixed="right">
1202 <template #default="scope">
1203 <span class="text_btn" v-if="!scope.row.isEdit" @click="editRow(scope.row)">编辑</span>
1204 <span class="text_btn" v-else @click="saveRow(scope.row)">保存</span>
1205 <el-divider direction="vertical"
1206 v-if="(route.query.state == '0' ? route.query.state == '0' : scope.row.isPrimary != 'Y')" />
1207 <span class="text_btn" @click="deleteRow(scope.$index)"
1208 v-if="(route.query.state == '0' ? route.query.state == '0' : scope.row.isPrimary != 'Y')">删除</span>
1209 </template>
1210 </el-table-column>
1211 </el-table>
1212 </div>
1213 <div class="bottom_table" v-else>
1214 <el-table :data="tableDataDetailInfo" v-loading="tableFieldsLoading" :highlight-current-row="true" stripe
1215 border height="100%" row-key="guid" @selection-change="selectionFieldsChange" tooltip-effect="light" :style="{
1216 width: '100%',
1217 'max-height': 'calc(100% - 16px)',
1218 display: 'inline-block',
1219 }">
1220 <el-table-column type="selection" :width="32" align="center" />
1221 <!-- 排序列(不可编辑) -->
1222 <el-table-column type="index" label="排序" width="80" align="center" />
1223 <!-- 字段中文名(可编辑)fieldChName -->
1224 <el-table-column prop="fieldChName" label="字段中文名" width="150" show-overflow-tooltip>
1225 <!-- 可以编辑 -->
1226 <template #default="scope">
1227 <span v-if="!scope.row.isEdit || !editableFields.fieldChName">{{
1228 scope.row.fieldChName ?
1229 scope.row.fieldChName
1230 : '--' }}</span>
1231 <el-input v-else v-model="scope.row.fieldChName" placeholder="请输入" />
1232 </template>
1233
1234 </el-table-column>
1235 <!-- 字段英文名(可编辑) -->
1236 <el-table-column prop="fieldName" label="字段英文名" width="150" show-overflow-tooltip>
1237 <template #default="scope">
1238 <span v-if="!scope.row.isEdit || !editableFields.fieldName">{{
1239 scope.row.fieldName ?
1240 scope.row.fieldName
1241 : '--' }}</span>
1242 <el-input v-else v-model="scope.row.fieldName" placeholder="必填"
1243 @input="inputLengthKeyUp(/[^a-zA-Z0-9_]/g, scope, 'fieldName')" />
1244 </template>
1245 </el-table-column>
1246 <!-- 源数据库 -->
1247 <el-table-column prop="sourceDatabase" label="源数据库" width="150" show-overflow-tooltip
1248 v-if="route.query.editOpt != '1'">
1249 <template #default="scope">
1250 {{ scope.row.sourceDatabase ? scope.row.sourceDatabase : '--' }}
1251 </template>
1252 </el-table-column>
1253 <!-- 源数据表 -->
1254 <el-table-column prop="sourceTableName" label="源数据表" width="150" show-overflow-tooltip
1255 v-if="route.query.editOpt != '1'">
1256 <template #default="scope">
1257 {{ scope.row.sourceTableName ? scope.row.sourceTableName : '--' }}
1258 </template>
1259 </el-table-column>
1260 <!-- 源字段中文 -->
1261 <el-table-column prop="sourceFieldName" label="源字段中文" width="150" show-overflow-tooltip
1262 v-if="route.query.editOpt != '1'">
1263 <template #default="scope">
1264 {{ scope.row.sourceFieldName ? scope.row.sourceFieldName : '--' }}
1265 </template>
1266 </el-table-column>
1267 <!-- 源字段英文 -->
1268 <el-table-column prop="sourceFieldChName" label="源字段英文" width="120" show-overflow-tooltip
1269 v-if="route.query.editOpt != '1'">
1270 <template #default="scope">
1271 <!-- {{ scope.row.sourceFieldName ? scope.row.sourceFieldName : '--' }} -->
1272
1273 <span>{{ scope.row.sourceFieldChName ?
1274 scope.row.sourceFieldChName : '--' }}</span>
1275 </template>
1276 </el-table-column>
1277 <!-- 源端字段 fieldType fieldTypeProps-->
1278 <el-table-column prop="fieldType" label="字段类型" width="120">
1046 <template #default="scope"> 1279 <template #default="scope">
1047 <div v-if="scope.row.isEdit"> 1280 <div v-if="scope.row.isEdit">
1048 <el-select v-model="scope.row.fieldType" placeholder="选择类型" clearable filterable 1281 <el-select v-model="scope.row.fieldType" placeholder="选择类型" clearable filterable
...@@ -1105,9 +1338,8 @@ onActivated(() => { ...@@ -1105,9 +1338,8 @@ onActivated(() => {
1105 <!-- 数据是否唯一(可编辑) --> 1338 <!-- 数据是否唯一(可编辑) -->
1106 <el-table-column prop="isPrimary" label="是否主键" width="100" align="left"> 1339 <el-table-column prop="isPrimary" label="是否主键" width="100" align="left">
1107 <template #default="scope"> 1340 <template #default="scope">
1108 <span v-if="!scope.row.isEdit || !editableFields.isPrimary">{{ scope.row.isPrimary ? 1341 <span v-if="!scope.row.isEdit || !editableFields.isPrimary">{{
1109 (scope.row.isPrimary === 1342 scope.row.isPrimary || '--' }}</span>
1110 'Y' ? '是' : '否') : '--' }}</span>
1111 <el-select v-else v-model="scope.row.isPrimary" placeholder="请选择"> 1343 <el-select v-else v-model="scope.row.isPrimary" placeholder="请选择">
1112 <el-option label="Y" value="Y" /> 1344 <el-option label="Y" value="Y" />
1113 <el-option label="N" value="N" /> 1345 <el-option label="N" value="N" />
...@@ -1117,8 +1349,8 @@ onActivated(() => { ...@@ -1117,8 +1349,8 @@ onActivated(() => {
1117 <!-- 是否必填(可编辑) --> 1349 <!-- 是否必填(可编辑) -->
1118 <el-table-column prop="notNull" label="是否必填" width="100" align="left"> 1350 <el-table-column prop="notNull" label="是否必填" width="100" align="left">
1119 <template #default="scope"> 1351 <template #default="scope">
1120 <span v-if="!scope.row.isEdit">{{ scope.row.notNull ? (scope.row.notNull === 1352 <span v-if="!scope.row.isEdit">{{
1121 'Y' ? '是' : '否') : '--' }}</span> 1353 scope.row.notNull || '--' }}</span>
1122 <el-select v-else v-model="scope.row.notNull" placeholder="请选择"> 1354 <el-select v-else v-model="scope.row.notNull" placeholder="请选择">
1123 <el-option label="Y" value="Y" /> 1355 <el-option label="Y" value="Y" />
1124 <el-option label="N" value="N" /> 1356 <el-option label="N" value="N" />
......
...@@ -33,7 +33,7 @@ import { ...@@ -33,7 +33,7 @@ import {
33 getSubjectTableDetail, 33 getSubjectTableDetail,
34 checkSubjectTableData 34 checkSubjectTableData
35 } from "@/api/modules/dataCatalogService"; 35 } from "@/api/modules/dataCatalogService";
36 import { getDictionaryAll, getFidldEnName, getGradeList, getNewDataTypeList, getTaskExeTreeList, saveDbDirTable } from "@/api/modules/dataInventory"; 36 import { getDictionaryAll, getFidldEnName, getGradeList, getNewDataTypeList, getTaskExeTreeList, saveDbDirTable, getFieldClassifyAndGrade } from "@/api/modules/dataInventory";
37 import { useDefault } from "@/hooks/useDefault"; 37 import { useDefault } from "@/hooks/useDefault";
38 import uploadExcelFile from "./components/uploadExcelFile.vue"; 38 import uploadExcelFile from "./components/uploadExcelFile.vue";
39 import { add } from "lodash-es"; 39 import { add } from "lodash-es";
...@@ -115,7 +115,7 @@ const uploadFileRef = ref(); ...@@ -115,7 +115,7 @@ const uploadFileRef = ref();
115 115
116 const getSubjectField = () => { 116 const getSubjectField = () => {
117 tableFieldsLoading.value = true; 117 tableFieldsLoading.value = true;
118 getFidldEnName(fileTableFields.value.map(f => f.chName)).then((res: any) => { 118 getFidldEnName(fileTableFields.value.map(f => f.chName)).then(async (res: any) => {
119 tableFieldsLoading.value = false; 119 tableFieldsLoading.value = false;
120 if (res.code == proxy.$passCode) { 120 if (res.code == proxy.$passCode) {
121 tableCreateInfo.value.tableFields = res.data?.map((field, i) => { 121 tableCreateInfo.value.tableFields = res.data?.map((field, i) => {
...@@ -125,6 +125,55 @@ const getSubjectField = () => { ...@@ -125,6 +125,55 @@ const getSubjectField = () => {
125 !field.notNull && (field.notNull = 'N'); 125 !field.notNull && (field.notNull = 'N');
126 return field; 126 return field;
127 }) || []; 127 }) || [];
128 console.log(tableCreateInfo.value.tableFields, '7897987');
129 // 遍历 tableCreateInfo.value.tableFields,找到item.fieldName,组合成入参
130 let tempFileNames: any = []
131 tableCreateInfo.value.tableFields.forEach((item: any) => {
132 tempFileNames.push(item.fieldName);
133 });
134 const classify: any = await getFieldClassifyAndGrade({
135 fieldName: tempFileNames,
136 execGuid: execGuid.value,
137 type: 'C'
138 })
139 const grade: any = await getFieldClassifyAndGrade({
140 fieldName: tempFileNames,
141 execGuid: execGuid.value,
142 type: 'G'
143 })
144 // 通过分类数据和分级数据赋值给 tableFields 的每一项
145 tableCreateInfo.value.tableFields.forEach((item: any) => {
146 // 在分类数据中查找对应 fieldName 的项
147 const classifyItem = classify.find((classify: any) => classify.fieldName === item.fieldName);
148
149 // 在分级数据中查找对应 fieldName 的项
150 const gradeItem = grade.find((grade: any) => grade.fieldName === item.fieldName);
151
152 // 如果找到对应的分类数据,赋值给 tableFields 的相应项
153 if (classifyItem) {
154 item.classifyDetailGuid = classifyItem.classifyDetailGuid || null;
155 item.classifyDetailName = classifyItem.classifyDetailName || null;
156 item.classifyDetailGuidRoutes = classifyItem.classifyDetailGuidRoutes || null;
157 item.classifyDetailNameRoutes = classifyItem.classifyDetailNameRoutes || null;
158 }
159
160 // 如果找到对应的分级数据,赋值给 tableFields 的相应项
161 if (gradeItem) {
162 item.gradeDetailGuid = gradeItem.gradeDetailGuid || null;
163 item.gradeDetailName = gradeItem.gradeDetailName || null;
164 }
165 });
166
167 } else {
168 ElMessage.error(res.msg);
169 }
170 });
171 }
172
173 const getGradeClassifyInfo = (params) => {
174 getFieldClassifyAndGrade(params).then((res: any) => {
175 if (res.code === proxy.$passCode) {
176
128 } else { 177 } else {
129 ElMessage.error(res.msg); 178 ElMessage.error(res.msg);
130 } 179 }
...@@ -1459,7 +1508,7 @@ const saveTable = async () => { ...@@ -1459,7 +1508,7 @@ const saveTable = async () => {
1459 gradeDetailName: item.gradeDetailName, 1508 gradeDetailName: item.gradeDetailName,
1460 guid: item.guid, 1509 guid: item.guid,
1461 isFk: item.isFk, 1510 isFk: item.isFk,
1462 notNull: item.isNotNull, 1511 notNull: item.notNull,
1463 isPrimary: item.isPrimary, 1512 isPrimary: item.isPrimary,
1464 sortValue: item.sortValue, 1513 sortValue: item.sortValue,
1465 tableChName: addInfo.chName, 1514 tableChName: addInfo.chName,
...@@ -1487,7 +1536,8 @@ const saveTable = async () => { ...@@ -1487,7 +1536,8 @@ const saveTable = async () => {
1487 if (res.code === proxy.$passCode) { 1536 if (res.code === proxy.$passCode) {
1488 proxy.$ElMessage.success('保存成功!'); 1537 proxy.$ElMessage.success('保存成功!');
1489 userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath)); 1538 userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
1490 router.push({ name: 'classifyGradeCatalogue', query: { reload: 'true' } }); 1539 localStorage.setItem('shouldReloadData', 'true');
1540 router.push({ name: 'classifyGradeCatalogue' });
1491 } else { 1541 } else {
1492 proxy.$ElMessage.error(res.msg); 1542 proxy.$ElMessage.error(res.msg);
1493 } 1543 }
...@@ -1583,7 +1633,7 @@ const saveDraftTable = async () => { ...@@ -1583,7 +1633,7 @@ const saveDraftTable = async () => {
1583 gradeDetailName: item.gradeDetailName, 1633 gradeDetailName: item.gradeDetailName,
1584 guid: item.guid, 1634 guid: item.guid,
1585 isFk: item.isFk, 1635 isFk: item.isFk,
1586 isNotNull: item.isNotNull, 1636 isNotNull: item.notNull,
1587 isPrimary: item.isPrimary, 1637 isPrimary: item.isPrimary,
1588 sortValue: item.sortValue, 1638 sortValue: item.sortValue,
1589 tableChName: addInfo.chName, 1639 tableChName: addInfo.chName,
...@@ -1610,7 +1660,8 @@ const saveDraftTable = async () => { ...@@ -1610,7 +1660,8 @@ const saveDraftTable = async () => {
1610 if (res.code === proxy.$passCode) { 1660 if (res.code === proxy.$passCode) {
1611 proxy.$ElMessage.success('保存草稿成功!'); 1661 proxy.$ElMessage.success('保存草稿成功!');
1612 userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath)); 1662 userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
1613 router.push({ name: 'classifyGradeCatalogue', query: { reload: 'true' } }); 1663 localStorage.setItem('shouldReloadData', 'true');
1664 router.push({ name: 'classifyGradeCatalogue' });
1614 } else { 1665 } else {
1615 proxy.$ElMessage.error(res.msg); 1666 proxy.$ElMessage.error(res.msg);
1616 } 1667 }
......
...@@ -8,10 +8,14 @@ import { ElMessage, ElMessageBox } from "element-plus"; ...@@ -8,10 +8,14 @@ import { ElMessage, ElMessageBox } from "element-plus";
8 import Table from '@/components/Table/index.vue' 8 import Table from '@/components/Table/index.vue'
9 import TableTools from '@/components/Tools/table_tools.vue' 9 import TableTools from '@/components/Tools/table_tools.vue'
10 import {getAnalysisReportList,delAnalysisRepor,updateAnalysisRepor} from "@/api/modules/dataMetaService" 10 import {getAnalysisReportList,delAnalysisRepor,updateAnalysisRepor} from "@/api/modules/dataMetaService"
11 import { getImageContent } from "@/api/modules/queryService";
12 import Dialog from '@/components/Dialog/index.vue' 11 import Dialog from '@/components/Dialog/index.vue'
13 import { getDownloadUrl, download } from "@/utils/common"; 12 import { getDownloadUrl, download } from "@/utils/common";
14 import { useRouter } from 'vue-router'; 13 import { useRouter } from 'vue-router';
14 import {
15 parseAndDecodeUrl,
16 getDownFileSignByUrl,
17 obsDownloadRequest
18 } from "@/api/modules/obsService";
15 const router = useRouter() 19 const router = useRouter()
16 const page = ref({ 20 const page = ref({
17 limit: 50, 21 limit: 50,
...@@ -119,20 +123,25 @@ const tableSearchItemList: any = ref([{ ...@@ -119,20 +123,25 @@ const tableSearchItemList: any = ref([{
119 placeholder: '血缘关系名称', 123 placeholder: '血缘关系名称',
120 clearable: true 124 clearable: true
121 }]); 125 }]);
122 const tableBtnClick = (scope, btn) => { 126 const tableBtnClick = async (scope, btn) => {
123 const type = btn.value; 127 const type = btn.value;
124 let row = scope.row; 128 let row = scope.row;
125 rowData.value = row 129 rowData.value = row
126 currTableData.value = row; 130 currTableData.value = row;
127 if (type == 'view') { 131 if (type == 'view') {
128 getImageContent(row.analysisReportUrl).then((res: any) => { 132 let fileName: string = parseAndDecodeUrl(row.analysisReportUrl).fileName;
133 const refSignInfo: any = await getDownFileSignByUrl(fileName);
134 if (!refSignInfo?.data) {
135 refSignInfo?.msg && ElMessage.error(refSignInfo?.msg);
136 return;
137 }
138 obsDownloadRequest(refSignInfo?.data).then((res: any) => {
129 if (res && !res.msg) { 139 if (res && !res.msg) {
130 let name = row.analysisReportUrl; 140 var fileSuffix = fileName ? fileName.substring(fileName.lastIndexOf('.') + 1) : '';
131 var fileSuffix = name ? name.substring(name.lastIndexOf('.') + 1) : '';
132 if (fileSuffix === 'png') { //浏览器可以支持图片和pdf预览 141 if (fileSuffix === 'png') { //浏览器可以支持图片和pdf预览
133 let fileUrl = getDownloadUrl(res, name, fileSuffix); 142 let fileUrl = <string>getDownloadUrl(res, name, fileSuffix);
134 let win = window.open(fileUrl, name); 143 let win = window.open(fileUrl, row.analysisReportName + fileSuffix);
135 win && (win.document.title = name); 144 win && (win.document.title = row.analysisReportName + fileSuffix);
136 } else { 145 } else {
137 download(res, row.analysisReportName, fileSuffix); 146 download(res, row.analysisReportName, fileSuffix);
138 } 147 }
...@@ -141,10 +150,16 @@ const tableBtnClick = (scope, btn) => { ...@@ -141,10 +150,16 @@ const tableBtnClick = (scope, btn) => {
141 } 150 }
142 }); 151 });
143 } else if (type == 'export') { 152 } else if (type == 'export') {
144 getImageContent(row.analysisReportUrl).then((res: any) => { 153 let fileName: string = parseAndDecodeUrl(row.analysisReportUrl).fileName;
154 const refSignInfo: any = await getDownFileSignByUrl(fileName);
155 if (!refSignInfo?.data) {
156 refSignInfo?.msg && ElMessage.error(refSignInfo?.msg);
157 return;
158 }
159 obsDownloadRequest(refSignInfo?.data).then((res: any) => {
145 if (res && !res.msg) { 160 if (res && !res.msg) {
146 let name = row.analysisReportUrl; 161 // let name = row.analysisReportUrl;
147 var fileSuffix = name ? name.substring(name.lastIndexOf('.') + 1) : ''; 162 var fileSuffix = fileName ? fileName.substring(fileName.lastIndexOf('.') + 1) : '';
148 download(res, row.analysisReportName, fileSuffix); 163 download(res, row.analysisReportName, fileSuffix);
149 } else { 164 } else {
150 res?.msg && ElMessage.error(res?.msg); 165 res?.msg && ElMessage.error(res?.msg);
......
...@@ -22,7 +22,11 @@ import { ...@@ -22,7 +22,11 @@ import {
22 delLineAge, 22 delLineAge,
23 checkTableData 23 checkTableData
24 } from '@/api/modules/dataMetaService'; 24 } from '@/api/modules/dataMetaService';
25 import { getFileUrl } from "@/api/modules/queryService" 25 import {
26 parseAndDecodeUrl,
27 getUpFileSignByUrl,
28 obsUploadRequest
29 } from "@/api/modules/obsService";
26 import { useRouter, useRoute } from "vue-router"; 30 import { useRouter, useRoute } from "vue-router";
27 import useDataMetaStore from "@/store/modules/dataMeta" 31 import useDataMetaStore from "@/store/modules/dataMeta"
28 import { cloneDeep } from 'lodash-es' 32 import { cloneDeep } from 'lodash-es'
...@@ -857,17 +861,23 @@ const pageSave = () => { ...@@ -857,17 +861,23 @@ const pageSave = () => {
857 return 861 return
858 } 862 }
859 863
860 let formData = new FormData(); 864 dialogInfo1.value.footer.btns[1].loading = true;
861 formData.append('file', file.value); 865 return getUpFileSignByUrl({ fileName: `${analysisReportName}.png` })
862 formData.append('fileName', `${analysisReportName}.png`); 866 .then((res: any) => {
863 getFileUrl(formData).then((res) => { 867 obsUploadRequest({
868 signedUrl: res.data.signedUrl,
869 file: file.value,
870 actualSignedRequestHeaders: res.data.actualSignedRequestHeaders
871 }).then(() => {
872 if (res.code == '00000') {
864 saveMetaReportAnalysis({ 873 saveMetaReportAnalysis({
865 table: lastClickNode.value.tableName, 874 table: lastClickNode.value.tableName,
866 database: lastClickNode.value.databaseName, 875 database: lastClickNode.value.databaseName,
867 analysisReportUrl: res.data, 876 analysisReportUrl: res.data?.signedUrl,
868 analysisReportName: analysisReportName, 877 analysisReportName: analysisReportName,
869 databaseChName: lastClickNode.value.databaseChName 878 databaseChName: lastClickNode.value.databaseChName
870 }).then((res: any) => { 879 }).then((res: any) => {
880 dialogInfo1.value.footer.btns[1].loading = false;
871 if (res.code == proxy.$passCode) { 881 if (res.code == proxy.$passCode) {
872 ElMessage({ 882 ElMessage({
873 type: "success", 883 type: "success",
...@@ -883,9 +893,19 @@ const pageSave = () => { ...@@ -883,9 +893,19 @@ const pageSave = () => {
883 }) 893 })
884 } 894 }
885 }) 895 })
896 } else {
897 ElMessage({
898 type: "error",
899 message: res.msg,
900 appendTo: lineageGraph.value.containerRef
901 })
902 }
886 }).catch((res) => { 903 }).catch((res) => {
887 ElMessage.error(res.msg) 904 ElMessage.error(res.msg)
888 }) 905 });
906 }).catch((res) => {
907 ElMessage.error(res.msg)
908 });
889 } 909 }
890 910
891 const formItems1: any = ref([ 911 const formItems1: any = ref([
...@@ -933,7 +953,7 @@ const dialogInfo1 = ref({ ...@@ -933,7 +953,7 @@ const dialogInfo1 = ref({
933 footer: { 953 footer: {
934 btns: [ 954 btns: [
935 { type: "default", label: "取消", value: "cancel" }, 955 { type: "default", label: "取消", value: "cancel" },
936 { type: "primary", label: "保存", value: "submit" }, 956 { type: "primary", label: "保存", value: "submit", loading: false },
937 ], 957 ],
938 }, 958 },
939 }); 959 });
......
...@@ -144,7 +144,7 @@ const getMetaChangeTableData = () => { ...@@ -144,7 +144,7 @@ const getMetaChangeTableData = () => {
144 } 144 }
145 145
146 146
147 const activeTabName = ref('task'); 147 const activeTabName = ref('meta');
148 148
149 watch(() => activeTabName.value, (val) => { 149 watch(() => activeTabName.value, (val) => {
150 if(val==="task"){ 150 if(val==="task"){
...@@ -420,9 +420,7 @@ const metaChangeTableInfo = ref({ ...@@ -420,9 +420,7 @@ const metaChangeTableInfo = ref({
420 // { label: "状态", field: "changeTime", width: 180, }, 420 // { label: "状态", field: "changeTime", width: 180, },
421 // { label: "操作时间", field: "changeTime", width: 180, }, 421 // { label: "操作时间", field: "changeTime", width: 180, },
422 ], 422 ],
423 data: [{ 423 data: [],
424 guid: 1
425 }],
426 page: { 424 page: {
427 type: "normal", 425 type: "normal",
428 rows: 0, 426 rows: 0,
...@@ -486,6 +484,7 @@ onBeforeMount(() => { ...@@ -486,6 +484,7 @@ onBeforeMount(() => {
486 </div> 484 </div>
487 <div class="main_wrap"> 485 <div class="main_wrap">
488 <el-tabs v-model="activeTabName"> 486 <el-tabs v-model="activeTabName">
487 <!--
489 <el-tab-pane label="同步任务变更记录" name="task"> 488 <el-tab-pane label="同步任务变更记录" name="task">
490 <div class="table_tool_wrap"> 489 <div class="table_tool_wrap">
491 <TableTools :searchItems="tableSearchItemList" :init="false" searchId="detect-table-search" 490 <TableTools :searchItems="tableSearchItemList" :init="false" searchId="detect-table-search"
...@@ -496,6 +495,7 @@ onBeforeMount(() => { ...@@ -496,6 +495,7 @@ onBeforeMount(() => {
496 @tablePageChange="taskChangeTablePageChange" /> 495 @tablePageChange="taskChangeTablePageChange" />
497 </div> 496 </div>
498 </el-tab-pane> 497 </el-tab-pane>
498 -->
499 <el-tab-pane label="元数据变更记录" name="meta"> 499 <el-tab-pane label="元数据变更记录" name="meta">
500 <div class="table_tool_wrap"> 500 <div class="table_tool_wrap">
501 <TableTools :searchItems="metaTableSearchItemList" :init="false" searchId="meta-detect-table-search" 501 <TableTools :searchItems="metaTableSearchItemList" :init="false" searchId="meta-detect-table-search"
......
...@@ -26,9 +26,13 @@ import { ...@@ -26,9 +26,13 @@ import {
26 saveMetaReportAnalysis, 26 saveMetaReportAnalysis,
27 checkTableData 27 checkTableData
28 } from '@/api/modules/dataMetaService'; 28 } from '@/api/modules/dataMetaService';
29 import { getFileUrl } from "@/api/modules/queryService"
30 import useDataMetaStore from "@/store/modules/dataMeta" 29 import useDataMetaStore from "@/store/modules/dataMeta"
31 import { TableColumnWidth } from '@/utils/enum'; 30 import { TableColumnWidth } from '@/utils/enum';
31 import {
32 parseAndDecodeUrl,
33 getUpFileSignByUrl,
34 obsUploadRequest
35 } from "@/api/modules/obsService";
32 36
33 const { proxy } = getCurrentInstance() as any; 37 const { proxy } = getCurrentInstance() as any;
34 const router = useRouter(); 38 const router = useRouter();
...@@ -556,18 +560,24 @@ const pageSave = () => { ...@@ -556,18 +560,24 @@ const pageSave = () => {
556 }) 560 })
557 return 561 return
558 } 562 }
559 let formData = new FormData();
560 formData.append('file', file.value);
561 formData.append('fileName', `${analysisReportName}.png`);
562 console.log(formInline1.value.pageName) 563 console.log(formInline1.value.pageName)
563 getFileUrl(formData).then((res) => { 564 dialogInfo1.value.footer.btns[1].loading = true;
565 getUpFileSignByUrl({ fileName: `${analysisReportName}.png` })
566 .then((res: any) => {
567 obsUploadRequest({
568 signedUrl: res.data.signedUrl,
569 file: file.value,
570 actualSignedRequestHeaders: res.data.actualSignedRequestHeaders
571 }).then(() => {
572 if (res.code == '00000') {
564 saveMetaReportAnalysis({ 573 saveMetaReportAnalysis({
565 table: sheetInfo.value.tableName, 574 table: sheetInfo.value.tableName,
566 database: sheetInfo.value.databaseName, 575 database: sheetInfo.value.databaseName,
567 analysisReportUrl: res.data, 576 analysisReportUrl: res.data?.signedUrl,
568 analysisReportName: analysisReportName, 577 analysisReportName: analysisReportName,
569 databaseChName: sheetInfo.value.databaseChName 578 databaseChName: sheetInfo.value.databaseChName
570 }).then((res: any) => { 579 }).then((res: any) => {
580 dialogInfo1.value.footer.btns[1].loading = false;
571 if (res.code == proxy.$passCode) { 581 if (res.code == proxy.$passCode) {
572 // ElMessage.success("保存成功") 582 // ElMessage.success("保存成功")
573 ElMessage({ 583 ElMessage({
...@@ -584,13 +594,19 @@ const pageSave = () => { ...@@ -584,13 +594,19 @@ const pageSave = () => {
584 }) 594 })
585 } 595 }
586 }) 596 })
587 }).catch((res) => { 597 } else {
588 ElMessage({ 598 ElMessage({
589 type: "error", 599 type: "error",
590 message: res.msg, 600 message: res.msg,
591 appendTo: lineageGraph.value[0].containerRef 601 appendTo: lineageGraph.value.containerRef
592 })
593 }) 602 })
603 }
604 }).catch((res) => {
605 ElMessage.error(res.msg)
606 });
607 }).catch((res) => {
608 ElMessage.error(res.msg)
609 });
594 } 610 }
595 611
596 const formItems1: any = ref([ 612 const formItems1: any = ref([
...@@ -638,7 +654,7 @@ const dialogInfo1 = ref({ ...@@ -638,7 +654,7 @@ const dialogInfo1 = ref({
638 footer: { 654 footer: {
639 btns: [ 655 btns: [
640 { type: "default", label: "取消", value: "cancel" }, 656 { type: "default", label: "取消", value: "cancel" },
641 { type: "primary", label: "保存", value: "submit" }, 657 { type: "primary", label: "保存", value: "submit", loading: false },
642 ], 658 ],
643 }, 659 },
644 }); 660 });
......
...@@ -16,6 +16,9 @@ import TableTools from "@/components/Tools/table_tools.vue"; ...@@ -16,6 +16,9 @@ import TableTools from "@/components/Tools/table_tools.vue";
16 import Table from "@/components/Table/index.vue"; 16 import Table from "@/components/Table/index.vue";
17 import Dialog from "@/components/Dialog/index.vue"; 17 import Dialog from "@/components/Dialog/index.vue";
18 import { getParamsList } from "@/api/modules/dataAsset"; 18 import { getParamsList } from "@/api/modules/dataAsset";
19 import {
20 changeNum,
21 } from "@/utils/common";
19 22
20 const { proxy } = getCurrentInstance() as any; 23 const { proxy } = getCurrentInstance() as any;
21 const router = useRouter(); 24 const router = useRouter();
...@@ -212,7 +215,8 @@ const toPatn = (type) => { ...@@ -212,7 +215,8 @@ const toPatn = (type) => {
212 router.push({ 215 router.push({
213 name: "productListingDetail", 216 name: "productListingDetail",
214 query: { 217 query: {
215 type 218 type,
219 groundingPick: '门户数据专区'
216 }, 220 },
217 }); 221 });
218 } else { 222 } else {
...@@ -226,6 +230,17 @@ const toPatn = (type) => { ...@@ -226,6 +230,17 @@ const toPatn = (type) => {
226 }); 230 });
227 } 231 }
228 } 232 }
233 const toPatn1 = (type, type1) => {
234 if (type == 'add') {
235 router.push({
236 name: "productListingDetail",
237 query: {
238 type,
239 type1
240 },
241 });
242 }
243 }
229 244
230 const tablePageChange = (info) => { 245 const tablePageChange = (info) => {
231 page.value.curr = Number(info.curr); 246 page.value.curr = Number(info.curr);
...@@ -298,6 +313,16 @@ onBeforeMount(() => { ...@@ -298,6 +313,16 @@ onBeforeMount(() => {
298 }) 313 })
299 }) 314 })
300 315
316 const defaultItemLogo = new URL('@/assets/images/home-finance-product.png', import.meta.url).href
317 const demandListData: any = ref([
318 { companyName: '北数所', listedNum: 16, processNum: 1235 },
319 { companyName: '深数所', listedNum: 16, processNum: 1235 },
320 { companyName: '苏数所', listedNum: 16, processNum: 1235 },
321 ]);
322 const btnClick = (btn) => {
323 }
324
325
301 </script> 326 </script>
302 327
303 <template> 328 <template>
...@@ -306,6 +331,32 @@ onBeforeMount(() => { ...@@ -306,6 +331,32 @@ onBeforeMount(() => {
306 <TableTools :searchItems="searchItemList" :searchId="'data-source-search'" @search="toSearch" /> 331 <TableTools :searchItems="searchItemList" :searchId="'data-source-search'" @search="toSearch" />
307 <div class="tools_btns"> 332 <div class="tools_btns">
308 <el-button type="primary" @click="toPatn('add')" v-preReClick>新建</el-button> 333 <el-button type="primary" @click="toPatn('add')" v-preReClick>新建</el-button>
334 <el-button type="primary" @click="toPatn1('add', 'add1')" v-preReClick>新建</el-button>
335 </div>
336 </div>
337 <div class="list-content">
338 <div class="card-content" v-for="item in demandListData" :key="item.guid">
339 <div class="header">
340 <img class="left-img" :src="(item.picUrl && typeof item.picUrl == 'string') ? item.picUrl : defaultItemLogo"
341 alt="" />
342 <div class="right-main">
343 <div class="title">{{ item.companyName ?? '--' }}</div>
344 <div class="count-group">
345 <div class="count-item">
346 <div class="item-label">已上架产品数</div>
347 <div class="item-num">{{ changeNum(item.listedNum) }}</div>
348 </div>
349 <div class="count-item">
350 <div class="item-label">审批中产品数</div>
351 <div class="item-num">{{ changeNum(item.processNum) }}</div>
352 </div>
353 </div>
354 </div>
355 </div>
356 <div class="operator-btn">
357 <div class="left-btn borderRight" @click="btnClick(item)">更新模板</div>
358 <div class="left-btn" @click="btnClick(item)">资产登记</div>
359 </div>
309 </div> 360 </div>
310 </div> 361 </div>
311 <div class="table_panel_wrap"> 362 <div class="table_panel_wrap">
...@@ -328,7 +379,87 @@ onBeforeMount(() => { ...@@ -328,7 +379,87 @@ onBeforeMount(() => {
328 379
329 .table_panel_wrap { 380 .table_panel_wrap {
330 width: 100%; 381 width: 100%;
331 height: calc(100% - 84px); 382 height: calc(100% - 270px);
332 padding: 0px 8px 0; 383 padding: 0px 8px 0;
333 } 384 }
385
386 .list-content {
387 display: flex;
388 justify-content: space-between;
389 flex-wrap: wrap;
390 margin-bottom: 8px;
391 padding: 0 8px;
392
393 .card-content {
394 width: calc(33.33% - 10px);
395 padding: 16px;
396 box-shadow: 0 0 0 1px #d9d9d9;
397
398 .header {
399 display: flex;
400 margin-bottom: 16px;
401
402 img {
403 width: 80px;
404 margin-right: 16px;
405 }
406
407 .title {
408 font-size: 16px;
409 color: #212121;
410 font-weight: 600;
411 margin-bottom: 8px;
412 }
413
414 .right-main {
415 width: calc(100% - 96px);
416 display: flex;
417 flex-direction: column;
418 justify-content: space-between;
419
420 .count-group {
421 display: flex;
422 justify-content: space-between;
423
424 .item-num {
425 font-size: 20px;
426 font-weight: 600;
427 color: #212121;
428 margin-top: 8px;
429 }
430 }
431 }
432 }
433
434 .operator-btn {
435 display: flex;
436 justify-content: space-between;
437 align-items: center;
438 box-shadow: 0 0 0 1px #d9d9d9;
439 position: relative;
440
441 &::after {
442 content: '';
443 width: 0;
444 height: 100%;
445 border-left: 1px solid #d9d9d9;
446 position: absolute;
447 left: 50%;
448 transform: translateX(-50%);
449 }
450
451 >.left-btn {
452 width: 50%;
453 height: 40px;
454 line-height: 40px;
455 text-align: center;
456 cursor: pointer;
457
458 &:hover {
459 color: #4fa1a4;
460 }
461 }
462 }
463 }
464 }
334 </style> 465 </style>
......
...@@ -15,7 +15,7 @@ import { changeNum } from '@/utils/common'; ...@@ -15,7 +15,7 @@ import { changeNum } from '@/utils/common';
15 import { onUploadFilePreview, onUploadFileDownload } from '@/api/modules/common'; 15 import { onUploadFilePreview, onUploadFileDownload } from '@/api/modules/common';
16 import { getAreaData, getServiceTenants } from "@/api/modules/queryService"; 16 import { getAreaData, getServiceTenants } from "@/api/modules/queryService";
17 import { getApproveList, getTenantApprove, registerApproveAllow, registerApproveBackup, getParamsList, getServiceDetail } from "@/api/modules/dataAsset"; 17 import { getApproveList, getTenantApprove, registerApproveAllow, registerApproveBackup, getParamsList, getServiceDetail } from "@/api/modules/dataAsset";
18 import { getProductList, getAddedProductList, getListingDetail, listingSave, listingUpdate, getParamsDataList } from "@/api/modules/dataProduct"; 18 import { getProductList, getAddedProductList, getListingDetail, listingSave, listingUpdate, listingSavePortal, getParamsDataList } from "@/api/modules/dataProduct";
19 import { getMatchDetail } from "@/api/modules/dataFinance"; 19 import { getMatchDetail } from "@/api/modules/dataFinance";
20 import { useValidator } from '@/hooks/useValidator'; 20 import { useValidator } from '@/hooks/useValidator';
21 21
...@@ -153,20 +153,31 @@ const formInfo = ref({ ...@@ -153,20 +153,31 @@ const formInfo = ref({
153 clearable: true, 153 clearable: true,
154 required: true, 154 required: true,
155 }, { 155 }, {
156 label: "产品类型", 156 label: "资产类型",
157 type: "select", 157 type: "select",
158 placeholder: "请选择", 158 placeholder: "请选择",
159 field: "damType", 159 field: "damType",
160 default: '', 160 default: '',
161 options: damTypes.value, 161 options: damTypes.value,
162 props: { 162 props: {
163 value: 'paramValue', 163 value: 'value',
164 label: 'paramName' 164 label: 'label'
165 }, 165 },
166 disabled: true, 166 disabled: true,
167 required: true, 167 required: true,
168 }, 168 },
169 { 169 {
170 label: '证书编号',
171 type: 'input',
172 maxlength: 50,
173 placeholder: '请输入',
174 field: 'damCode',
175 default: '',
176 disabled: true,
177 required: true,
178 visible: true
179 },
180 {
170 label: "数据时间范围", 181 label: "数据时间范围",
171 type: "date-picker", 182 type: "date-picker",
172 field: "dateRange", 183 field: "dateRange",
...@@ -194,16 +205,7 @@ const formInfo = ref({ ...@@ -194,16 +205,7 @@ const formInfo = ref({
194 // default: '', 205 // default: '',
195 // required: true 206 // required: true
196 // }, 207 // },
197 // { 208
198 // label: '证书编号',
199 // type: 'input',
200 // maxlength: 50,
201 // placeholder: '请输入',
202 // field: 'damCode',
203 // default: '',
204 // disabled: true,
205 // required: true,
206 // },
207 { 209 {
208 label: '数据规模(条)', 210 label: '数据规模(条)',
209 type: 'input', 211 type: 'input',
...@@ -212,7 +214,7 @@ const formInfo = ref({ ...@@ -212,7 +214,7 @@ const formInfo = ref({
212 maxlength: 19, 214 maxlength: 19,
213 regexp: /\D/g, 215 regexp: /\D/g,
214 default: '', 216 default: '',
215 disabled: true, 217 disabled: false,
216 required: true 218 required: true
217 }, { 219 }, {
218 label: '病例总数(例)', 220 label: '病例总数(例)',
...@@ -220,7 +222,7 @@ const formInfo = ref({ ...@@ -220,7 +222,7 @@ const formInfo = ref({
220 placeholder: '请输入', 222 placeholder: '请输入',
221 field: 'caseNumber', 223 field: 'caseNumber',
222 default: '', 224 default: '',
223 disabled: true, 225 disabled: false,
224 required: false 226 required: false
225 }, { 227 }, {
226 label: '数据覆盖地域', 228 label: '数据覆盖地域',
...@@ -298,6 +300,7 @@ const formInfo = ref({ ...@@ -298,6 +300,7 @@ const formInfo = ref({
298 field: 'productPrice', 300 field: 'productPrice',
299 default: '', 301 default: '',
300 disabled: false, 302 disabled: false,
303 inputType: 'moneyNumber',
301 required: true 304 required: true
302 }, 305 },
303 { 306 {
...@@ -360,25 +363,26 @@ const formInfo = ref({ ...@@ -360,25 +363,26 @@ const formInfo = ref({
360 // clearable: false, 363 // clearable: false,
361 // required: true, 364 // required: true,
362 // }, 365 // },
363 // { 366 {
364 // label: "上架交易所", 367 label: "上架交易所",
365 // type: "select", 368 type: "select",
366 // placeholder: "请选择", 369 placeholder: "请选择",
367 // field: "exchangeGuids", 370 field: "exchangeGuids",
368 // default: [], 371 default: [],
369 // options: exchangeList.value, 372 options: exchangeList.value,
370 // props: { 373 props: {
371 // value: "guid", 374 value: "guid",
372 // label: "tenantName", 375 label: "tenantName",
373 // }, 376 },
374 // filterable: true, 377 filterable: true,
375 // clearable: true, 378 clearable: true,
376 // multiple: true, 379 multiple: true,
377 // tagsTooltip: true, 380 tagsTooltip: true,
378 // collapse: true, 381 collapse: true,
379 // disabled: false, 382 disabled: false,
380 // required: true, 383 required: true,
381 // }, 384 visible: true
385 },
382 { 386 {
383 label: '产品描述', 387 label: '产品描述',
384 type: 'textarea-rich', 388 type: 'textarea-rich',
...@@ -411,9 +415,125 @@ const formInfo = ref({ ...@@ -411,9 +415,125 @@ const formInfo = ref({
411 field: 'productImg', 415 field: 'productImg',
412 default: [], 416 default: [],
413 limit: 1, 417 limit: 1,
418 block: false,
419 required: false,
420 },
421 {
422 label: '登记证',
423 tip: '支持扩展名:.jpg .png .jpeg',
424 accept: '.jpg, .png, .jpeg ',
425 type: 'upload-file',
426 placeholder: '请选择',
427 field: 'registerImg',
428 default: [],
429 limit: 1,
430 block: false,
431 required: false,
432 visible: true
433 },
434 {
435 label: '质量评估报告',
436 tip: '支持扩展名:.png .pdf',
437 accept: '.png, .pdf',
438 type: 'upload-file',
439 placeholder: '请选择',
440 field: 'qualityReport',
441 default: [],
442 limit: 1,
443 block: false,
444 required: false,
445 visible: true
446 },
447 {
448 label: "质量评估机构",
449 type: "select",
450 placeholder: "请选择",
451 field: "qualityOrg",
452 default: '',
453 options: [],
454 props: {
455 value: 'value',
456 label: 'label'
457 },
458 filterable: true,
459 clearable: true,
460 disabled: false,
461 required: true,
462 visible: true
463 },
464 {
465 label: '价值评估报告',
466 tip: '支持扩展名:.png .pdf',
467 accept: '.png, .pdf',
468 type: 'upload-file',
469 placeholder: '请选择',
470 field: 'valueReport',
471 default: [],
472 limit: 1,
473 block: false,
474 required: false,
475 visible: true
476 },
477 {
478 label: "价值评估机构",
479 type: "select",
480 placeholder: "请选择",
481 field: "valueOrg",
482 default: '',
483 options: [],
484 props: {
485 value: 'value',
486 label: 'label'
487 },
488 filterable: true,
489 clearable: true,
490 disabled: false,
491 required: true,
492 visible: true
493 },
494 {
495 label: '承诺函',
496 tip: '支持扩展名:.png .pdf',
497 accept: '.png, .pdf',
498 type: 'upload-file',
499 placeholder: '请选择',
500 field: 'commitment',
501 templateUrl: 'http://www.baidu.com',
502 default: [],
503 limit: 1,
414 block: true, 504 block: true,
415 required: false, 505 required: false,
416 }, { 506 visible: true
507 },
508 {
509 label: '授权文件',
510 tip: '支持扩展名:.png .pdf',
511 accept: '.png, .pdf',
512 type: 'upload-file',
513 placeholder: '请选择',
514 field: 'authorization',
515 templateUrl: 'http://www.baidu.com',
516 default: [],
517 limit: 1,
518 block: true,
519 required: false,
520 visible: true
521 },
522 {
523 label: '商品详细介绍(签章版)',
524 tip: '支持扩展名:.png .pdf',
525 accept: '.png, .pdf',
526 type: 'upload-file',
527 placeholder: '请选择',
528 field: 'productDetail',
529 templateUrl: 'http://www.baidu.com',
530 default: [],
531 limit: 1,
532 block: true,
533 required: false,
534 visible: true
535 },
536 {
417 label: "", 537 label: "",
418 type: "input", 538 type: "input",
419 placeholder: "请输入", 539 placeholder: "请输入",
...@@ -669,11 +789,17 @@ const submitForm = (btn, formEl, tosub = false) => { ...@@ -669,11 +789,17 @@ const submitForm = (btn, formEl, tosub = false) => {
669 // if (params.content) { 789 // if (params.content) {
670 // params.productDesc = truncateHTML(params.content, 400); 790 // params.productDesc = truncateHTML(params.content, 400);
671 // } 791 // }
672 params.dataScale = formInfo.value.items.at(4).defaultValue; 792 console.log(params, formInfo.value.items.at(4).defaultValue, formInfo.value, '-----------------');
673 params.caseNumber = formInfo.value.items.at(5).defaultValue; 793 params.dataScale = formInfo.value.items.at(4).defaultValue || formInfo.value.items.at(4).default;
794 params.caseNumber = formInfo.value.items.at(5).defaultValue || formInfo.value.items.at(4).default;
795 params.timeAreaStart = params.dateRange ? params.dateRange[0] : '';
796 params.timeAreaEnd = params.dateRange ? params.dateRange[1] : '';
797 params.groundingPick = [route.query.groundingPick];
798 // 删除dateRange字段
799 delete params.dateRange;
674 flowDetailLoading.value = true; 800 flowDetailLoading.value = true;
675 if (detailType == 'add') { 801 if (detailType == 'add') {
676 listingSave(params).then((res: any) => { 802 listingSavePortal(params).then((res: any) => {
677 if (res.code == proxy.$passCode) { 803 if (res.code == proxy.$passCode) {
678 ElMessage({ 804 ElMessage({
679 type: "success", 805 type: "success",
...@@ -996,6 +1122,14 @@ onActivated(() => { ...@@ -996,6 +1122,14 @@ onActivated(() => {
996 }; 1122 };
997 }) 1123 })
998 onBeforeMount(() => { 1124 onBeforeMount(() => {
1125 if (route.query.type == 'add' && !route.query.type1) {
1126 formInfo.value.items.forEach(item => {
1127 if (item.field == 'damCode' || item.field == 'exchangeGuids' || item.field == 'registerImg' || item.field == 'qualityReport' || item.field == 'qualityOrg' || item.field == 'valueReport' || item.field == 'valueOrg' || item.field == 'commitment' || item.field == 'authorization' || item.field == 'productDetail') {
1128 item.visible = false;
1129 }
1130 })
1131 }
1132
999 getParentAreaPromise.value = getAreaData({ parentId: null }).then((res: any) => { 1133 getParentAreaPromise.value = getAreaData({ parentId: null }).then((res: any) => {
1000 if (res?.code == proxy.$passCode) { 1134 if (res?.code == proxy.$passCode) {
1001 parentAreaData.value = res.data ?? []; 1135 parentAreaData.value = res.data ?? [];
...@@ -1009,7 +1143,7 @@ onBeforeMount(() => { ...@@ -1009,7 +1143,7 @@ onBeforeMount(() => {
1009 } 1143 }
1010 } 1144 }
1011 getApproveData(); 1145 getApproveData();
1012 getParamsDataList({ dictType: '字段类型' }).then((res: any) => { 1146 getParamsDataList({ dictType: '资产类型' }).then((res: any) => {
1013 if (res.code == proxy.$passCode) { 1147 if (res.code == proxy.$passCode) {
1014 damTypes.value = res.data || []; 1148 damTypes.value = res.data || [];
1015 let item = formInfo.value.items.find(item => item.field == 'damType'); 1149 let item = formInfo.value.items.find(item => item.field == 'damType');
...@@ -1021,9 +1155,8 @@ onBeforeMount(() => { ...@@ -1021,9 +1155,8 @@ onBeforeMount(() => {
1021 getParamsDataList({ dictType: '交付方式' }).then((res: any) => { 1155 getParamsDataList({ dictType: '交付方式' }).then((res: any) => {
1022 if (res.code == proxy.$passCode) { 1156 if (res.code == proxy.$passCode) {
1023 deliveryWayList.value = res.data || []; 1157 deliveryWayList.value = res.data || [];
1024 // let item = formInfo.value.items.find(item => item.field == 'deliveryWay'); 1158 let item = formInfo.value.items.find(item => item.field == 'deliveryWay');
1025 // item && (item.options = deliveryWayList.value); 1159 item && (item.options = deliveryWayList.value);
1026 formInfo.value.items[6].options = res.data || [];
1027 } else { 1160 } else {
1028 proxy.$ElMessage.error(res.msg); 1161 proxy.$ElMessage.error(res.msg);
1029 } 1162 }
...@@ -1031,10 +1164,8 @@ onBeforeMount(() => { ...@@ -1031,10 +1164,8 @@ onBeforeMount(() => {
1031 getParamsDataList({ dictType: '定价方式' }).then((res: any) => { 1164 getParamsDataList({ dictType: '定价方式' }).then((res: any) => {
1032 if (res.code == proxy.$passCode) { 1165 if (res.code == proxy.$passCode) {
1033 pricingMethodList.value = res.data || []; 1166 pricingMethodList.value = res.data || [];
1034 formInfo.value.items[7].options = res.data || []; 1167 let item = formInfo.value.items.find(item => item.field == 'pricingWay');
1035 // let item = formInfo.value.items.find(item => item.field == 'deliveryWay'); 1168 item && (item.options = pricingMethodList.value);
1036 // item && (item.options = deliveryWayList.value);
1037 // formInfo.value.items[7].options = res.data || [];
1038 } else { 1169 } else {
1039 proxy.$ElMessage.error(res.msg); 1170 proxy.$ElMessage.error(res.msg);
1040 } 1171 }
...@@ -1042,10 +1173,8 @@ onBeforeMount(() => { ...@@ -1042,10 +1173,8 @@ onBeforeMount(() => {
1042 getParamsDataList({ dictType: '价格单位' }).then((res: any) => { 1173 getParamsDataList({ dictType: '价格单位' }).then((res: any) => {
1043 if (res.code == proxy.$passCode) { 1174 if (res.code == proxy.$passCode) {
1044 priceUnitList.value = res.data || []; 1175 priceUnitList.value = res.data || [];
1045 formInfo.value.items[9].options = res.data || []; 1176 let item = formInfo.value.items.find(item => item.field == 'priceUnit');
1046 // let item = formInfo.value.items.find(item => item.field == 'deliveryWay'); 1177 item && (item.options = priceUnitList.value);
1047 // item && (item.options = deliveryWayList.value);
1048 // formInfo.value.items[7].options = res.data || [];
1049 } else { 1178 } else {
1050 proxy.$ElMessage.error(res.msg); 1179 proxy.$ElMessage.error(res.msg);
1051 } 1180 }
......
...@@ -238,12 +238,12 @@ const rulesDetailTableBtnClick = (scope, btn) => { ...@@ -238,12 +238,12 @@ const rulesDetailTableBtnClick = (scope, btn) => {
238 label: row.ruleName 238 label: row.ruleName
239 }]; 239 }];
240 smallCategoryList.value = [{ 240 smallCategoryList.value = [{
241 paramValue: detailInfo.value.smallCategory, 241 value: detailInfo.value.smallCategory,
242 paramName: row.smallCategory 242 label: row.smallCategory
243 }]; 243 }];
244 largeCategoryList.value = [{ 244 largeCategoryList.value = [{
245 paramValue: detailInfo.value.largeCategory, 245 value: detailInfo.value.largeCategory,
246 paramName: row.largeCategory 246 label: row.largeCategory
247 }]; 247 }];
248 oneRulesDetailDialogVisible.value = true; 248 oneRulesDetailDialogVisible.value = true;
249 } else { 249 } else {
...@@ -268,12 +268,12 @@ const rulesDetailTableBtnClick = (scope, btn) => { ...@@ -268,12 +268,12 @@ const rulesDetailTableBtnClick = (scope, btn) => {
268 label: row.ruleName 268 label: row.ruleName
269 }]; 269 }];
270 smallCategoryList.value = [{ 270 smallCategoryList.value = [{
271 paramValue: detailInfo.value.smallCategory, 271 value: detailInfo.value.smallCategory,
272 paramName: row.smallCategory 272 label: row.smallCategory
273 }]; 273 }];
274 largeCategoryList.value = [{ 274 largeCategoryList.value = [{
275 paramValue: detailInfo.value.largeCategory, 275 value: detailInfo.value.largeCategory,
276 paramName: row.largeCategory 276 label: row.largeCategory
277 }]; 277 }];
278 } else { 278 } else {
279 ElMessage.error(res.msg); 279 ElMessage.error(res.msg);
......
...@@ -328,6 +328,20 @@ onBeforeMount(() => { ...@@ -328,6 +328,20 @@ onBeforeMount(() => {
328 }); 328 });
329 329
330 onActivated(() => { 330 onActivated(() => {
331 let tab: any = userStore.tabbar.find((tab: any) => tab.fullPath === fullPath);
332 if (tab) {
333 if (route.query.detail) {
334 tab.meta.title = `新建规则(${route.query.planName})`;
335 if (fullPath === route.fullPath) {
336 document.title = tab.meta.title;
337 }
338 } else if (route.query.planName) {
339 tab.meta.title = `方案编辑-${route.query.planName}`;
340 if (fullPath === route.fullPath) {
341 document.title = tab.meta.title;
342 }
343 }
344 }
331 if (modelGuid.value || groupGuid.value) { 345 if (modelGuid.value || groupGuid.value) {
332 return; 346 return;
333 } 347 }
......
...@@ -255,10 +255,12 @@ const groupTableInfo = ref({ ...@@ -255,10 +255,12 @@ const groupTableInfo = ref({
255 label: "操作", 255 label: "操作",
256 type: "btn", 256 type: "btn",
257 width: 92, 257 width: 92,
258 btns: [ 258 btns: (scope) => {
259 { label: "编辑", value: "edit" }, 259 return [
260 { label: "删除", value: "delete" }, 260 { label: "编辑", value: "edit", disabled: scope.row.dataSource != '5' },
261 ], 261 { label: "删除", value: "delete", disabled: scope.row.dataSource != '5' },
262 ]
263 },
262 } 264 }
263 }); 265 });
264 266
...@@ -402,7 +404,8 @@ const tableBtnClick = (scope, btn) => { ...@@ -402,7 +404,8 @@ const tableBtnClick = (scope, btn) => {
402 name: 'ruleTemplate', 404 name: 'ruleTemplate',
403 query: { 405 query: {
404 modelGuid: row.guid, 406 modelGuid: row.guid,
405 name: row.name 407 name: row.name,
408 dataSource: row.dataSource
406 } 409 }
407 }); 410 });
408 } else if (type == "delete") { 411 } else if (type == "delete") {
...@@ -429,9 +432,12 @@ const open = (msg, type, isBatch = false) => { ...@@ -429,9 +432,12 @@ const open = (msg, type, isBatch = false) => {
429 if (res.code == proxy.$passCode) { 432 if (res.code == proxy.$passCode) {
430 page.value.curr = 1; 433 page.value.curr = 1;
431 getTableData(); 434 getTableData();
435 getQualityGroupTreeData();
436 nextTick(() => {
432 let node = qualityModelTreeRef.value.treeRef.store.nodesMap[currTableData.value.modelGroupGuid]; 437 let node = qualityModelTreeRef.value.treeRef.store.nodesMap[currTableData.value.modelGroupGuid];
433 node.loaded = false; 438 node.loaded = false;
434 node.expand(); 439 node.expand();
440 })
435 ElMessage.success('删除成功'); 441 ElMessage.success('删除成功');
436 } else { 442 } else {
437 ElMessage.error(res.msg); 443 ElMessage.error(res.msg);
...@@ -489,6 +495,7 @@ const groupTableBtnClick = (scope, btn) => { ...@@ -489,6 +495,7 @@ const groupTableBtnClick = (scope, btn) => {
489 type: "success", 495 type: "success",
490 message: "删除分组成功", 496 message: "删除分组成功",
491 }); 497 });
498 getQualityGroupTreeData();
492 } else { 499 } else {
493 ElMessage({ 500 ElMessage({
494 type: "error", 501 type: "error",
...@@ -594,7 +601,7 @@ const ruleTableBtnClick = (scope, btn) => { ...@@ -594,7 +601,7 @@ const ruleTableBtnClick = (scope, btn) => {
594 } 601 }
595 }); 602 });
596 } else if (type == "delete") { 603 } else if (type == "delete") {
597 ruleOpen("此操作将永久删除该质检, 是否继续?", "warning"); 604 ruleOpen("此操作将永久删除该质检规则, 是否继续?", "warning");
598 } 605 }
599 }; 606 };
600 607
...@@ -611,7 +618,7 @@ const ruleOpen = (msg, type, isBatch = false) => { ...@@ -611,7 +618,7 @@ const ruleOpen = (msg, type, isBatch = false) => {
611 let node = qualityModelTreeRef.value.treeRef.store.nodesMap[lastSelectNode.value.data.guid]; 618 let node = qualityModelTreeRef.value.treeRef.store.nodesMap[lastSelectNode.value.data.guid];
612 node.loaded = false; 619 node.loaded = false;
613 node.expand(); 620 node.expand();
614 ElMessage.success('删除质检成功'); 621 ElMessage.success('删除质检规则成功');
615 } else { 622 } else {
616 ElMessage.error(res.msg); 623 ElMessage.error(res.msg);
617 } 624 }
...@@ -639,7 +646,8 @@ const clickCreateTable = () => { ...@@ -639,7 +646,8 @@ const clickCreateTable = () => {
639 name: 'ruleModel', 646 name: 'ruleModel',
640 query: { 647 query: {
641 groupGuid: page.value.modelGroupGuid, 648 groupGuid: page.value.modelGroupGuid,
642 name: lastSelectNode.value.data.name 649 name: lastSelectNode.value.data.name,
650 dataSource: lastSelectNode.value.data.dataSource
643 } 651 }
644 }); 652 });
645 } 653 }
...@@ -650,7 +658,8 @@ const clickCreateRule = () => { ...@@ -650,7 +658,8 @@ const clickCreateRule = () => {
650 name: 'ruleTemplate', 658 name: 'ruleTemplate',
651 query: { 659 query: {
652 modelGuid: lastSelectNode.value.data.guid, 660 modelGuid: lastSelectNode.value.data.guid,
653 name: lastSelectNode.value.data.name 661 name: lastSelectNode.value.data.name,
662 dataSource: lastSelectNode.value.parent.data.dataSource
654 } 663 }
655 }); 664 });
656 } 665 }
...@@ -744,6 +753,7 @@ let editSubmitPromise: any = ref(null); ...@@ -744,6 +753,7 @@ let editSubmitPromise: any = ref(null);
744 /** 新建分组对话框确定。 */ 753 /** 新建分组对话框确定。 */
745 const dialogBtnClick = (btn, info) => { 754 const dialogBtnClick = (btn, info) => {
746 if (btn.value == 'submit') { 755 if (btn.value == 'submit') {
756 info.dataSource = '5';
747 if (dialogInfo.value.type == 'add') { 757 if (dialogInfo.value.type == 'add') {
748 if (submitPromise.value) { 758 if (submitPromise.value) {
749 return; 759 return;
...@@ -753,6 +763,7 @@ const dialogBtnClick = (btn, info) => { ...@@ -753,6 +763,7 @@ const dialogBtnClick = (btn, info) => {
753 if (res.code == proxy.$passCode) { 763 if (res.code == proxy.$passCode) {
754 groupPage.value.curr = 1; 764 groupPage.value.curr = 1;
755 getGroupTableData(); 765 getGroupTableData();
766 getQualityGroupTreeData();
756 ElMessage({ 767 ElMessage({
757 type: 'success', 768 type: 'success',
758 message: '新建分组成功' 769 message: '新建分组成功'
...@@ -779,6 +790,7 @@ const dialogBtnClick = (btn, info) => { ...@@ -779,6 +790,7 @@ const dialogBtnClick = (btn, info) => {
779 type: 'success', 790 type: 'success',
780 message: '编辑分组成功' 791 message: '编辑分组成功'
781 }) 792 })
793 getQualityGroupTreeData();
782 dialogInfo.value.visible = false; 794 dialogInfo.value.visible = false;
783 } else { 795 } else {
784 ElMessage({ 796 ElMessage({
...@@ -862,8 +874,9 @@ onActivated(async () => { ...@@ -862,8 +874,9 @@ onActivated(async () => {
862 if (lastSelectNode.value && lastSelectNode.value.data.guid == dataQualityStore.modelGroupGuid) { 874 if (lastSelectNode.value && lastSelectNode.value.data.guid == dataQualityStore.modelGroupGuid) {
863 getTableData(); 875 getTableData();
864 } 876 }
865 let node = qualityModelTreeRef.value.treeRef.store.nodesMap[dataQualityStore.modelGroupGuid]; 877 // let node = qualityModelTreeRef.value.treeRef.store.nodesMap[dataQualityStore.modelGroupGuid];
866 node?.expand(); 878 // node?.expand();
879 getQualityGroupTreeData();
867 dataQualityStore.set(null); 880 dataQualityStore.set(null);
868 }); 881 });
869 } else { 882 } else {
...@@ -871,8 +884,11 @@ onActivated(async () => { ...@@ -871,8 +884,11 @@ onActivated(async () => {
871 if (lastSelectNode.value && lastSelectNode.value.data.guid == dataQualityStore.modelGroupGuid) { 884 if (lastSelectNode.value && lastSelectNode.value.data.guid == dataQualityStore.modelGroupGuid) {
872 getTableData(); 885 getTableData();
873 } 886 }
887 getQualityGroupTreeData();
888 nextTick(() => {
874 let node = qualityModelTreeRef.value.treeRef.store.nodesMap[dataQualityStore.modelGroupGuid]; 889 let node = qualityModelTreeRef.value.treeRef.store.nodesMap[dataQualityStore.modelGroupGuid];
875 node.expand(); 890 node.expand();
891 })
876 dataQualityStore.set(null); 892 dataQualityStore.set(null);
877 } 893 }
878 } 894 }
...@@ -908,7 +924,7 @@ onBeforeMount(() => { ...@@ -908,7 +924,7 @@ onBeforeMount(() => {
908 d.label = d.ruleName; 924 d.label = d.ruleName;
909 d.value = d.ruleCode; 925 d.value = d.ruleCode;
910 return d; 926 return d;
911 }) || []; 927 })?.filter(d => d.ruleCode != 'rows_check' && d.ruleCode != 'volatility_check') || [];
912 searchItemList.value[2].options = ruleTypeList.value; 928 searchItemList.value[2].options = ruleTypeList.value;
913 } else { 929 } else {
914 ElMessage.error(res.msg); 930 ElMessage.error(res.msg);
......
...@@ -6,8 +6,12 @@ import { ...@@ -6,8 +6,12 @@ import {
6 getSubjectFields, 6 getSubjectFields,
7 getSubjectTableTree, 7 getSubjectTableTree,
8 getSubjectTableByDomain, 8 getSubjectTableByDomain,
9 getCheckRulesList 9 getCheckRulesList,
10 getInventoryDsDir
10 } from '@/api/modules/dataQuality'; 11 } from '@/api/modules/dataQuality';
12 import {
13 getMetaTreeData
14 } from '@/api/modules/dataMetaService';
11 import Table from "@/components/Table/index.vue"; 15 import Table from "@/components/Table/index.vue";
12 import Form from "@/components/Form/index.vue"; 16 import Form from "@/components/Form/index.vue";
13 import { ElMessage } from "element-plus"; 17 import { ElMessage } from "element-plus";
...@@ -48,7 +52,11 @@ const props = defineProps({ ...@@ -48,7 +52,11 @@ const props = defineProps({
48 readonly: { 52 readonly: {
49 type: Boolean, 53 type: Boolean,
50 default: false 54 default: false
51 } 55 },
56 dataSource: {
57 type: String,
58 default: ''
59 },
52 }); 60 });
53 61
54 watch(() => props.toSubjectTables, (val: any[]) => { 62 watch(() => props.toSubjectTables, (val: any[]) => {
...@@ -135,18 +143,18 @@ const rulesListByType: any = computed(() => { ...@@ -135,18 +143,18 @@ const rulesListByType: any = computed(() => {
135 return {}; 143 return {};
136 } 144 }
137 return { 145 return {
138 char: checkRulesList.value.filter(r => r.paramValue == 'length_rule' || r.paramValue == 'ch_rule' || r.paramValue == 'en_rule' || r.paramValue == 'num_value_rule' || r.paramValue == 'custom_regular_rule'), 146 char: checkRulesList.value.filter(r => r.value == 'length_rule' || r.value == 'ch_rule' || r.value == 'en_rule' || r.value == 'num_value_rule' || r.value == 'custom_regular_rule'),
139 varchar: checkRulesList.value.filter(r => r.paramValue == 'length_rule' || r.paramValue == 'id_card_rule' || r.paramValue == 'phone_number_rule' || r.paramValue == 'ch_rule' || r.paramValue == 'en_rule' || r.paramValue == 'num_value_rule' || r.paramValue == 'custom_regular_rule'), 147 varchar: checkRulesList.value.filter(r => r.value == 'length_rule' || r.value == 'id_card_rule' || r.value == 'phone_number_rule' || r.value == 'ch_rule' || r.value == 'en_rule' || r.value == 'num_value_rule' || r.value == 'custom_regular_rule'),
140 int: checkRulesList.value.filter(r => r.paramValue == 'length_rule' || r.paramValue == 'num_value_rule' || r.paramValue == 'custom_regular_rule'), 148 int: checkRulesList.value.filter(r => r.value == 'length_rule' || r.value == 'num_value_rule' || r.value == 'custom_regular_rule'),
141 date: checkRulesList.value.filter(r => r.paramValue == 'date_format_rule' || r.paramValue == 'custom_regular_rule'), 149 date: checkRulesList.value.filter(r => r.value == 'length_rule' || r.value == 'date_format_rule' || r.value == 'custom_regular_rule'),
142 datetime: checkRulesList.value.filter(r => r.paramValue == 'date_format_rule' || r.paramValue == 'custom_regular_rule'), 150 datetime: checkRulesList.value.filter(r => r.value == 'length_rule' || r.value == 'date_format_rule' || r.value == 'custom_regular_rule'),
143 timestamp: checkRulesList.value.filter(r => r.paramValue == 'custom_regular_rule' || r.paramValue == 'custom_regular_rule'), 151 timestamp: checkRulesList.value.filter(r => r.value == 'length_rule' || r.value == 'custom_regular_rule' || r.value == 'custom_regular_rule'),
144 // text: checkRulesList.value.filter(r => r.paramValue == ''), 152 // text: checkRulesList.value.filter(r => r.value == ''),
145 decimal: checkRulesList.value.filter(r => r.paramValue == 'length_rule' || r.paramValue == 'precision_rule' || r.paramValue == 'num_value_rule' || r.paramValue == 'custom_regular_rule'), 153 decimal: checkRulesList.value.filter(r => r.value == 'length_rule' || r.value == 'precision_rule' || r.value == 'num_value_rule' || r.value == 'custom_regular_rule'),
146 // json: checkRulesList.value.filter(r => r.paramValue == ''), 154 // json: checkRulesList.value.filter(r => r.value == ''),
147 tinyint: checkRulesList.value.filter(r => r.paramValue == 'length_rule' || r.paramValue == 'num_value_rule' || r.paramValue == 'custom_regular_rule'), 155 tinyint: checkRulesList.value.filter(r => r.value == 'length_rule' || r.value == 'num_value_rule' || r.value == 'custom_regular_rule'),
148 time: checkRulesList.value.filter(r => r.paramValue == 'custom_regular_rule'), 156 time: checkRulesList.value.filter(r => r.value == 'length_rule' || r.value == 'custom_regular_rule'),
149 bit: checkRulesList.value.filter(r => r.paramValue == 'ch_rule' || r.paramValue == 'en_rule' || r.paramValue == 'custom_regular_rule'), 157 bit: checkRulesList.value.filter(r => r.value == 'length_rule' || r.value == 'ch_rule' || r.value == 'en_rule' || r.value == 'custom_regular_rule'),
150 } 158 }
151 }); 159 });
152 160
...@@ -238,8 +246,8 @@ const panelList: any = ref([ ...@@ -238,8 +246,8 @@ const panelList: any = ref([
238 default: '1', 246 default: '1',
239 options: props.largeCategoryList, 247 options: props.largeCategoryList,
240 props: { 248 props: {
241 label: 'paramName', 249 label: 'label',
242 value: 'paramValue' 250 value: 'value'
243 }, 251 },
244 required: true, 252 required: true,
245 visible: true 253 visible: true
...@@ -249,8 +257,8 @@ const panelList: any = ref([ ...@@ -249,8 +257,8 @@ const panelList: any = ref([
249 placeholder: '请选择', 257 placeholder: '请选择',
250 field: 'smallCategory', 258 field: 'smallCategory',
251 props: { 259 props: {
252 label: 'paramName', 260 label: 'label',
253 value: 'paramValue' 261 value: 'value'
254 }, 262 },
255 default: '', 263 default: '',
256 options: props.smallCategoryList.slice(6), 264 options: props.smallCategoryList.slice(6),
...@@ -615,12 +623,52 @@ const submit = () => { ...@@ -615,12 +623,52 @@ const submit = () => {
615 } 623 }
616 624
617 const getSubjectTableTreeData = () => { 625 const getSubjectTableTreeData = () => {
618 return getSubjectTableTree({}).then((res: any) => { 626 if (props.dataSource == '4' || props.value.dataSource == '4') {
627 return getInventoryDsDir().then((res: any) => {
628 if (res.code == proxy.$passCode) {
629 contrastSubjects.value = res.data?.map(d => {
630 d.parentGuid = 0;
631 d.guid = d.databaseGuid;
632 d.name = d.databaseChName;
633 d.label = d.databaseChName + `(${d.database})`;
634 d.children = d.children?.map(child => {
635 child.parentGuid = d.guid;
636 child.label = child.tableChName + `(${child.tableName})`;
637 child.guid = child.tableGuid;
638 child.isLeaf = true;
639 child.dataServerName = d.database;
640 child.dataSourceGuid = d.databaseGuid;
641 child.parentGuid = d.databaseGuid;
642 return child;
643 })
644 return d;
645 }) || [];
646 }
647 })
648 } else {
649 return getMetaTreeData({ isImportCreate: 'N' }).then((res: any) => {
619 if (res.code == proxy.$passCode) { 650 if (res.code == proxy.$passCode) {
620 contrastSubjects.value = res.data || []; 651 contrastSubjects.value = res.data?.children?.map(d => {
621 return res.data || []; 652 d.parentGuid = 0;
653 d.label = d.name;
654 d.children = d.children?.map(child => {
655 child.label = child.name + `(${child.tableName})`;
656 child.isLeaf = true;
657 child.dataServerName = d.name;
658 child.dataSourceGuid = d.guid;
659 return child;
660 })
661 return d;
662 }) || [];
622 } 663 }
623 }) 664 })
665 }
666 // return getSubjectTableTree({}).then((res: any) => {
667 // if (res.code == proxy.$passCode) {
668 // contrastSubjects.value = res.data || [];
669 // return res.data || [];
670 // }
671 // })
624 } 672 }
625 673
626 const formBtnClick = (btn) => { 674 const formBtnClick = (btn) => {
...@@ -633,7 +681,7 @@ const formBtnClick = (btn) => { ...@@ -633,7 +681,7 @@ const formBtnClick = (btn) => {
633 nullSelectFields.value = cloneDeep(panelList.value[index].defaultValue); 681 nullSelectFields.value = cloneDeep(panelList.value[index].defaultValue);
634 if (props.toSubjectTables[0]?.guid) { 682 if (props.toSubjectTables[0]?.guid) {
635 nullTableInfo.value.loading = true; 683 nullTableInfo.value.loading = true;
636 getSubjectFields(props.toSubjectTables[0]?.guid).then((res: any) => { 684 getSubjectFields(props.toSubjectTables[0]?.guid, props.dataSource || props.value.dataSource).then((res: any) => {
637 nullTableInfo.value.loading = false; 685 nullTableInfo.value.loading = false;
638 if (res.code == proxy.$passCode) { 686 if (res.code == proxy.$passCode) {
639 nullTableInfo.value.data = res.data || []; 687 nullTableInfo.value.data = res.data || [];
...@@ -673,7 +721,7 @@ const formBtnClick = (btn) => { ...@@ -673,7 +721,7 @@ const formBtnClick = (btn) => {
673 tableInfo.value.data = []; 721 tableInfo.value.data = [];
674 if (props.toSubjectTables[0]?.guid) { 722 if (props.toSubjectTables[0]?.guid) {
675 tableInfo.value.loading = true; 723 tableInfo.value.loading = true;
676 getSubjectFields(props.toSubjectTables[0]?.guid).then((res: any) => { 724 getSubjectFields(props.toSubjectTables[0]?.guid, props.dataSource || props.value.dataSource).then((res: any) => {
677 tableInfo.value.loading = false; 725 tableInfo.value.loading = false;
678 if (res.code == proxy.$passCode) { 726 if (res.code == proxy.$passCode) {
679 tableInfo.value.data = res.data || []; 727 tableInfo.value.data = res.data || [];
...@@ -704,7 +752,7 @@ const formBtnClick = (btn) => { ...@@ -704,7 +752,7 @@ const formBtnClick = (btn) => {
704 sqlTableFieldInfo.value.data = []; 752 sqlTableFieldInfo.value.data = [];
705 if (props.toSubjectTables[0]?.guid) { 753 if (props.toSubjectTables[0]?.guid) {
706 sqlTableFieldInfo.value.loading = true; 754 sqlTableFieldInfo.value.loading = true;
707 getSubjectFields(props.toSubjectTables[0]?.guid).then((res: any) => { 755 getSubjectFields(props.toSubjectTables[0]?.guid, props.dataSource || props.value.dataSource).then((res: any) => {
708 sqlTableFieldInfo.value.loading = false; 756 sqlTableFieldInfo.value.loading = false;
709 if (res.code == proxy.$passCode) { 757 if (res.code == proxy.$passCode) {
710 sqlTableFieldInfo.value.data = res.data || []; 758 sqlTableFieldInfo.value.data = res.data || [];
...@@ -734,7 +782,7 @@ const formBtnClick = (btn) => { ...@@ -734,7 +782,7 @@ const formBtnClick = (btn) => {
734 valueRangeTableListData.value[dialogSelectSubjectTable.value.enName] = []; 782 valueRangeTableListData.value[dialogSelectSubjectTable.value.enName] = [];
735 if (props.toSubjectTables[0]?.guid) { 783 if (props.toSubjectTables[0]?.guid) {
736 valueRangeTableListLoading.value[dialogSelectSubjectTable.value.enName] = true; 784 valueRangeTableListLoading.value[dialogSelectSubjectTable.value.enName] = true;
737 getSubjectFields(props.toSubjectTables[0]?.guid).then((res: any) => { 785 getSubjectFields(props.toSubjectTables[0]?.guid, props.dataSource || props.value.dataSource).then((res: any) => {
738 valueRangeTableListLoading.value[dialogSelectSubjectTable.value.enName] = false; 786 valueRangeTableListLoading.value[dialogSelectSubjectTable.value.enName] = false;
739 if (res.code == proxy.$passCode) { 787 if (res.code == proxy.$passCode) {
740 let data = res.data || []; 788 let data = res.data || [];
...@@ -792,7 +840,7 @@ const formBtnClick = (btn) => { ...@@ -792,7 +840,7 @@ const formBtnClick = (btn) => {
792 normCheckTableListData.value[dialogSelectSubjectTable.value.enName] = []; 840 normCheckTableListData.value[dialogSelectSubjectTable.value.enName] = [];
793 if (props.toSubjectTables[0]?.guid) { 841 if (props.toSubjectTables[0]?.guid) {
794 normCheckTableListLoading.value[dialogSelectSubjectTable.value.enName] = true; 842 normCheckTableListLoading.value[dialogSelectSubjectTable.value.enName] = true;
795 getSubjectFields(props.toSubjectTables[0]?.guid).then((res: any) => { 843 getSubjectFields(props.toSubjectTables[0]?.guid, props.dataSource || props.value.dataSource).then((res: any) => {
796 normCheckTableListLoading.value[dialogSelectSubjectTable.value.enName] = false; 844 normCheckTableListLoading.value[dialogSelectSubjectTable.value.enName] = false;
797 if (res.code == proxy.$passCode) { 845 if (res.code == proxy.$passCode) {
798 let data = res.data || []; 846 let data = res.data || [];
...@@ -1006,7 +1054,7 @@ const setPanelListValue = (item, isSelectChange = false, init = false, radioGrou ...@@ -1006,7 +1054,7 @@ const setPanelListValue = (item, isSelectChange = false, init = false, radioGrou
1006 } 1054 }
1007 } 1055 }
1008 if (isSelectChange) { 1056 if (isSelectChange) {
1009 val['smallCategory'] = panelList.value[2].options[0]?.paramValue; 1057 val['smallCategory'] = panelList.value[2].options[0]?.value;
1010 } else if (!val['smallCategory']) { 1058 } else if (!val['smallCategory']) {
1011 val['smallCategory'] = getDefaultSmallCategory(formItems.value[0].default); 1059 val['smallCategory'] = getDefaultSmallCategory(formItems.value[0].default);
1012 } else if (radioGroupChange && !init) {//切换规则类型。 1060 } else if (radioGroupChange && !init) {//切换规则类型。
...@@ -1017,7 +1065,6 @@ const setPanelListValue = (item, isSelectChange = false, init = false, radioGrou ...@@ -1017,7 +1065,6 @@ const setPanelListValue = (item, isSelectChange = false, init = false, radioGrou
1017 } 1065 }
1018 }); 1066 });
1019 formItems.value[0].children = panelList.value; 1067 formItems.value[0].children = panelList.value;
1020 console.log(panelList.value);
1021 } 1068 }
1022 1069
1023 const radioGroupChange = (val, inlineValue, init) => { 1070 const radioGroupChange = (val, inlineValue, init) => {
...@@ -1099,7 +1146,7 @@ const listItemClick = (data) => { ...@@ -1099,7 +1146,7 @@ const listItemClick = (data) => {
1099 if (ruleType.value === 'custom_sql') { 1146 if (ruleType.value === 'custom_sql') {
1100 sqlTableFilters.value[dialogSelectSubjectTable.value.enName] = sqlTableFilters.value[dialogSelectSubjectTable.value.enName] || ""; 1147 sqlTableFilters.value[dialogSelectSubjectTable.value.enName] = sqlTableFilters.value[dialogSelectSubjectTable.value.enName] || "";
1101 sqlTableFieldInfo.value.loading = true; 1148 sqlTableFieldInfo.value.loading = true;
1102 getSubjectFields(data.guid).then((res: any) => { 1149 getSubjectFields(data.guid, props.dataSource || props.value.dataSource).then((res: any) => {
1103 sqlTableFieldInfo.value.loading = false; 1150 sqlTableFieldInfo.value.loading = false;
1104 if (res.code == proxy.$passCode) { 1151 if (res.code == proxy.$passCode) {
1105 sqlTableFieldInfo.value.data = res.data || []; 1152 sqlTableFieldInfo.value.data = res.data || [];
...@@ -1110,7 +1157,7 @@ const listItemClick = (data) => { ...@@ -1110,7 +1157,7 @@ const listItemClick = (data) => {
1110 } else if (ruleType.value === 'logic_check') { 1157 } else if (ruleType.value === 'logic_check') {
1111 tableFilters.value[dialogSelectSubjectTable.value.enName] = tableFilters.value[dialogSelectSubjectTable.value.enName] || ""; 1158 tableFilters.value[dialogSelectSubjectTable.value.enName] = tableFilters.value[dialogSelectSubjectTable.value.enName] || "";
1112 tableInfo.value.loading = true; 1159 tableInfo.value.loading = true;
1113 getSubjectFields(data.guid).then((res: any) => { 1160 getSubjectFields(data.guid, props.dataSource || props.value.dataSource).then((res: any) => {
1114 tableInfo.value.loading = false; 1161 tableInfo.value.loading = false;
1115 if (res.code == proxy.$passCode) { 1162 if (res.code == proxy.$passCode) {
1116 tableInfo.value.data = res.data || []; 1163 tableInfo.value.data = res.data || [];
...@@ -1120,7 +1167,7 @@ const listItemClick = (data) => { ...@@ -1120,7 +1167,7 @@ const listItemClick = (data) => {
1120 }) 1167 })
1121 } else if (ruleType.value == 'null_value_check' || ruleType.value == 'repeate_data_check') { 1168 } else if (ruleType.value == 'null_value_check' || ruleType.value == 'repeate_data_check') {
1122 nullTableInfo.value.loading = true; 1169 nullTableInfo.value.loading = true;
1123 getSubjectFields(data.guid).then((res: any) => { 1170 getSubjectFields(data.guid, props.dataSource || props.value.dataSource).then((res: any) => {
1124 nullTableInfo.value.loading = false; 1171 nullTableInfo.value.loading = false;
1125 if (res.code == proxy.$passCode) { 1172 if (res.code == proxy.$passCode) {
1126 nullTableInfo.value.data = res.data || []; 1173 nullTableInfo.value.data = res.data || [];
...@@ -1143,7 +1190,7 @@ const listItemClick = (data) => { ...@@ -1143,7 +1190,7 @@ const listItemClick = (data) => {
1143 } 1190 }
1144 let defaultValue = panelList.value[12].defaultValue; 1191 let defaultValue = panelList.value[12].defaultValue;
1145 valueRangeTableListLoading.value[dialogSelectSubjectTable.value.enName] = true; 1192 valueRangeTableListLoading.value[dialogSelectSubjectTable.value.enName] = true;
1146 getSubjectFields(data.guid).then((res: any) => { 1193 getSubjectFields(data.guid, props.dataSource || props.value.dataSource).then((res: any) => {
1147 valueRangeTableListLoading.value[dialogSelectSubjectTable.value.enName] = false; 1194 valueRangeTableListLoading.value[dialogSelectSubjectTable.value.enName] = false;
1148 if (res.code == proxy.$passCode) { 1195 if (res.code == proxy.$passCode) {
1149 let data = res.data || []; 1196 let data = res.data || [];
...@@ -1178,7 +1225,7 @@ const listItemClick = (data) => { ...@@ -1178,7 +1225,7 @@ const listItemClick = (data) => {
1178 } 1225 }
1179 let defaultValue = panelList.value[14].defaultValue; 1226 let defaultValue = panelList.value[14].defaultValue;
1180 normCheckTableListLoading.value[dialogSelectSubjectTable.value.enName] = true; 1227 normCheckTableListLoading.value[dialogSelectSubjectTable.value.enName] = true;
1181 getSubjectFields(data.guid).then((res: any) => { 1228 getSubjectFields(data.guid, props.dataSource || props.value.dataSource).then((res: any) => {
1182 normCheckTableListLoading.value[dialogSelectSubjectTable.value.enName] = false; 1229 normCheckTableListLoading.value[dialogSelectSubjectTable.value.enName] = false;
1183 if (res.code == proxy.$passCode) { 1230 if (res.code == proxy.$passCode) {
1184 let data = res.data || []; 1231 let data = res.data || [];
...@@ -1226,7 +1273,7 @@ const tableInfo: any = ref({ ...@@ -1226,7 +1273,7 @@ const tableInfo: any = ref({
1226 fields: [ 1273 fields: [
1227 { label: "字段名", field: "enName", width: 140, type: 'text_btn', value: 'enName', columClass: 'text_btn' }, 1274 { label: "字段名", field: "enName", width: 140, type: 'text_btn', value: 'enName', columClass: 'text_btn' },
1228 { label: "注释", field: "chName", width: 120 }, 1275 { label: "注释", field: "chName", width: 120 },
1229 { label: "数据类型", field: "dataTypeChName", width: 100 }, 1276 { label: "数据类型", field: "dataTypeName", width: 100 },
1230 ], 1277 ],
1231 data: [], 1278 data: [],
1232 showPage: false, 1279 showPage: false,
...@@ -1440,7 +1487,7 @@ const sqlTableFieldInfo: any = ref({ ...@@ -1440,7 +1487,7 @@ const sqlTableFieldInfo: any = ref({
1440 fields: [ 1487 fields: [
1441 { label: "字段名", field: "enName", width: 140, type: 'text_btn', value: 'enName', columClass: 'text_btn' }, 1488 { label: "字段名", field: "enName", width: 140, type: 'text_btn', value: 'enName', columClass: 'text_btn' },
1442 { label: "注释", field: "chName", width: 120 }, 1489 { label: "注释", field: "chName", width: 120 },
1443 { label: "数据类型", field: "dataTypeChName", width: 100 }, 1490 { label: "数据类型", field: "dataTypeName", width: 100 },
1444 ], 1491 ],
1445 data: [], 1492 data: [],
1446 showPage: false, 1493 showPage: false,
...@@ -1584,7 +1631,7 @@ const nullTableInfo: any = ref({ ...@@ -1584,7 +1631,7 @@ const nullTableInfo: any = ref({
1584 fields: [ 1631 fields: [
1585 { label: "字段名", field: "enName", width: 140 }, 1632 { label: "字段名", field: "enName", width: 140 },
1586 { label: "注释", field: "chName", width: 120 }, 1633 { label: "注释", field: "chName", width: 120 },
1587 { label: "数据类型", field: "dataTypeChName", width: 100 }, 1634 { label: "数据类型", field: "dataTypeName", width: 100 },
1588 ], 1635 ],
1589 data: [], 1636 data: [],
1590 showPage: false, 1637 showPage: false,
...@@ -1680,7 +1727,7 @@ const getSubjectTableByDomainData = (guid) => { ...@@ -1680,7 +1727,7 @@ const getSubjectTableByDomainData = (guid) => {
1680 } 1727 }
1681 1728
1682 const defaultExpandedKeys = computed(() => { 1729 const defaultExpandedKeys = computed(() => {
1683 return props.value && contrastSubjects.value?.length ? [contrastSubjects.value.find(c => c.children?.some(cc => cc.guid == props.value.contrastSubjectDomainGuid)).guid, props.value.contrastSubjectDomainGuid] : []; 1730 return props.value && contrastSubjects.value?.length ? [props.value.contrastSubjectDomainGuid] : [];
1684 }) 1731 })
1685 1732
1686 const contrastSubjectInputFilterMethod = (v, data) => { 1733 const contrastSubjectInputFilterMethod = (v, data) => {
...@@ -1731,14 +1778,14 @@ const submitValueRange = () => { ...@@ -1731,14 +1778,14 @@ const submitValueRange = () => {
1731 let valueTableFields = valueRangeTableListData.value[table]; 1778 let valueTableFields = valueRangeTableListData.value[table];
1732 let ruleFields: any = [] 1779 let ruleFields: any = []
1733 for (const field of valueTableFields) { 1780 for (const field of valueTableFields) {
1734 if (field.startValue != null && field.endValue == null || (field.endValue != null && field.startValue == null)) { 1781 if (field.startValue == null && field.endValue == null) {
1735 if (dialogSelectSubjectTable.value.enName != table) { 1782 if (dialogSelectSubjectTable.value.enName != table) {
1736 valueCheckFormListRef.value.setSelectList(table, 'enName'); 1783 valueCheckFormListRef.value.setSelectList(table, 'enName');
1737 } 1784 }
1738 ElMessage.error(`表【${table}】的字段【${field.enName}】设置了值域,但范围未填写完整`); 1785 ElMessage.error(`表【${table}】的字段【${field.enName}】设置了值域,但范围未填写完整`);
1739 return; 1786 return;
1740 } 1787 }
1741 if (field.startValue) { 1788 if (field.startValue != null || field.endValue != null) {
1742 ruleFields.push(field); 1789 ruleFields.push(field);
1743 } else if (field.dataRange) { 1790 } else if (field.dataRange) {
1744 ruleFields.push(field); 1791 ruleFields.push(field);
...@@ -1788,7 +1835,7 @@ const compareTableFields = ref({}); //选择对比表对应的字段列表 ...@@ -1788,7 +1835,7 @@ const compareTableFields = ref({}); //选择对比表对应的字段列表
1788 /** 主表下拉选择变化 */ 1835 /** 主表下拉选择变化 */
1789 const tableInteMainSelectChange = (val) => { 1836 const tableInteMainSelectChange = (val) => {
1790 mainTableFields.value[val] = []; 1837 mainTableFields.value[val] = [];
1791 getSubjectFields(val).then((res: any) => { 1838 getSubjectFields(val, props.dataSource || props.value.dataSource).then((res: any) => {
1792 if (res.code == proxy.$passCode) { 1839 if (res.code == proxy.$passCode) {
1793 mainTableFields.value[val] = res.data?.map(d => { 1840 mainTableFields.value[val] = res.data?.map(d => {
1794 return Object.assign({}, d, { 1841 return Object.assign({}, d, {
...@@ -1804,7 +1851,7 @@ const tableInteMainSelectChange = (val) => { ...@@ -1804,7 +1851,7 @@ const tableInteMainSelectChange = (val) => {
1804 /** 对比表下拉选择变化 */ 1851 /** 对比表下拉选择变化 */
1805 const tableInteCompareSelectChange = (val) => { 1852 const tableInteCompareSelectChange = (val) => {
1806 compareTableFields.value[val] = []; 1853 compareTableFields.value[val] = [];
1807 getSubjectFields(val).then((res: any) => { 1854 getSubjectFields(val, props.dataSource || props.value.dataSource).then((res: any) => {
1808 if (res.code == proxy.$passCode) { 1855 if (res.code == proxy.$passCode) {
1809 compareTableFields.value[val] = res.data?.map(d => { 1856 compareTableFields.value[val] = res.data?.map(d => {
1810 return Object.assign({}, d, { 1857 return Object.assign({}, d, {
...@@ -2165,26 +2212,23 @@ defineExpose({ ...@@ -2165,26 +2212,23 @@ defineExpose({
2165 </el-table-column> 2212 </el-table-column>
2166 <el-table-column prop="chName" label="注释" width="120px" align="left" show-overflow-tooltip> 2213 <el-table-column prop="chName" label="注释" width="120px" align="left" show-overflow-tooltip>
2167 </el-table-column> 2214 </el-table-column>
2168 <el-table-column prop="dataTypeChName" label="数据类型" width="100px" show-overflow-tooltip> 2215 <el-table-column prop="dataTypeName" label="数据类型" width="100px" show-overflow-tooltip>
2169 <template #default="scope"> 2216 <template #default="scope">
2170 <span>{{ scope.row["dataTypeChName"] || '--' }}</span> 2217 <span>{{ scope.row["dataTypeName"] || '--' }}</span>
2171 </template> 2218 </template>
2172 </el-table-column> 2219 </el-table-column>
2173 <el-table-column label="值域" width="280px" align="left" fixed="right"> 2220 <el-table-column label="值域" width="280px" align="left" fixed="right">
2174 <template #default="scope"> 2221 <template #default="scope">
2175 <span
2176 v-if="scope.row.dataType == 'json' || scope.row.dataType == 'text' || !scope.row.dataType || scope.row.dataType == 'string'">--</span>
2177 <template v-else>
2178 <el-input 2222 <el-input
2179 v-show="scope.row.dataType == 'varchar' || scope.row.dataType == 'char' || scope.row.dataType == 'bit'" 2223 v-show="!scope.row.dataType || scope.row.dataType == 'varchar' || scope.row.dataType == 'char' || scope.row.dataType == 'bit' || scope.row.dataType == 'json' || scope.row.dataType == 'text' || !scope.row.dataType || scope.row.dataType == 'string' || scope.row.dataType == 'numeric'"
2180 v-model.trim="scope.row.dataRange" clearable placeholder="多值按照分号;分隔"> </el-input> 2224 v-model.trim="scope.row.dataRange" clearable placeholder="多值按照分号;分隔"> </el-input>
2181 <div class="range-sum" v-show="scope.row.dataType == 'datetime' || scope.row.dataType == 'date'"> 2225 <!-- <div class="range-sum" v-show="scope.row.dataType == 'datetime' || scope.row.dataType == 'date'">
2182 <el-date-picker v-model="scope.row.dateValueRange" type="daterange" range-separator="至" 2226 <el-date-picker v-model="scope.row.dateValueRange" type="daterange" range-separator="至"
2183 start-placeholder="开始日期" end-placeholder="结束日期" format="YYYY-MM-DD" value-format="YYYY-MM-DD" 2227 start-placeholder="开始日期" end-placeholder="结束日期" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
2184 :unlink-panels="false" :disabled="props.readonly" /> 2228 :unlink-panels="false" :disabled="props.readonly" />
2185 </div> 2229 </div> -->
2186 <div class="range-sum" 2230 <div class="range-sum"
2187 v-show="scope.row.dataType == 'int' || scope.row.dataType == 'decimal' || scope.row.dataType == 'tinyint' || scope.row.dataType == 'timestamp' || scope.row.dataType == 'time'"> 2231 v-show="scope.row.dataType == 'datetime' || scope.row.dataType == 'date' || scope.row.dataType == 'int' || scope.row.dataType == 'decimal' || scope.row.dataType == 'tinyint' || scope.row.dataType == 'timestamp' || scope.row.dataType == 'time'">
2188 <el-input :disabled="props.readonly" v-model.trim="scope.row.startValue" placeholder="请输入" clearable> 2232 <el-input :disabled="props.readonly" v-model.trim="scope.row.startValue" placeholder="请输入" clearable>
2189 </el-input> 2233 </el-input>
2190 <span class="text"></span> 2234 <span class="text"></span>
...@@ -2192,7 +2236,6 @@ defineExpose({ ...@@ -2192,7 +2236,6 @@ defineExpose({
2192 </el-input> 2236 </el-input>
2193 </div> 2237 </div>
2194 </template> 2238 </template>
2195 </template>
2196 </el-table-column> 2239 </el-table-column>
2197 </el-table> 2240 </el-table>
2198 </div> 2241 </div>
...@@ -2236,12 +2279,12 @@ defineExpose({ ...@@ -2236,12 +2279,12 @@ defineExpose({
2236 <template #default="scope"> 2279 <template #default="scope">
2237 <el-tree-select v-if="!props.readonly" ref="compareTreeSelectRef" filterable clearable 2280 <el-tree-select v-if="!props.readonly" ref="compareTreeSelectRef" filterable clearable
2238 @change="tableInteCompareSelectChange" v-model="scope.row['compareTableGuid']" node-key="guid" 2281 @change="tableInteCompareSelectChange" v-model="scope.row['compareTableGuid']" node-key="guid"
2239 :data="contrastSubjects" placeholder="请选择" lazy :load="(node, resolve) => treeSelectLoad(node, resolve)" 2282 :data="contrastSubjects" placeholder="请选择"
2240 :default-expanded-keys="contrastSubjects?.length ? [contrastSubjects.find(c => c.children?.some(cc => cc.guid == scope.row['compareSubjectDomainGuid'])).guid, scope.row.compareSubjectDomainGuid] : []" 2283 :default-expanded-keys="contrastSubjects?.length ? [scope.row.compareSubjectDomainGuid] : []"
2241 :auto-expand-parent="true" :default-checked-keys="[scope.row['compareTableGuid']]" 2284 :auto-expand-parent="true" :default-checked-keys="[scope.row['compareTableGuid']]"
2242 :filter-node-method="contrastSubjectInputFilterMethod" :props="{ 2285 :filter-node-method="contrastSubjectInputFilterMethod" :props="{
2243 value: 'guid', 2286 value: 'guid',
2244 label: 'name', 2287 label: 'label',
2245 children: 'children', 2288 children: 'children',
2246 isLeaf: 'isLeaf' 2289 isLeaf: 'isLeaf'
2247 }"> 2290 }">
...@@ -2297,17 +2340,17 @@ defineExpose({ ...@@ -2297,17 +2340,17 @@ defineExpose({
2297 </el-table-column> 2340 </el-table-column>
2298 <el-table-column prop="chName" label="注释" width="120px" align="left" show-overflow-tooltip> 2341 <el-table-column prop="chName" label="注释" width="120px" align="left" show-overflow-tooltip>
2299 </el-table-column> 2342 </el-table-column>
2300 <el-table-column prop="dataTypeChName" label="数据类型" width="100px" show-overflow-tooltip> 2343 <el-table-column prop="dataTypeName" label="数据类型" width="100px" show-overflow-tooltip>
2301 <template #default="scope"> 2344 <template #default="scope">
2302 <span>{{ scope.row["dataTypeChName"] || '--' }}</span> 2345 <span>{{ scope.row["dataTypeName"] || '--' }}</span>
2303 </template> 2346 </template>
2304 </el-table-column> 2347 </el-table-column>
2305 <el-table-column prop="checkRule" label="选择检验规则" width="150px" align="left" show-overflow-tooltip> 2348 <el-table-column prop="checkRule" label="选择检验规则" width="150px" align="left" show-overflow-tooltip>
2306 <template #default="scope"> 2349 <template #default="scope">
2307 <el-select v-if="!props.readonly || (scope.row.dataType == 'text' || scope.row.dataType == 'json')" 2350 <el-select v-if="!props.readonly || (scope.row.dataType == 'text' || scope.row.dataType == 'json')"
2308 v-model="scope.row['checkRule']" placeholder="请选择" filterable clearable> 2351 v-model="scope.row['checkRule']" placeholder="请选择" filterable clearable>
2309 <el-option v-for="opt in rulesListByType[scope.row.dataType]" :key="opt['paramValue']" 2352 <el-option v-for="opt in (rulesListByType[scope.row.dataType] || checkRulesList)" :key="opt['value']"
2310 :label="opt['paramName']" :value="opt['paramValue']" /> 2353 :label="opt['label']" :value="opt['value']" />
2311 </el-select> 2354 </el-select>
2312 <span v-else>{{ scope.row.checkRuleName ?? '--' }}</span> 2355 <span v-else>{{ scope.row.checkRuleName ?? '--' }}</span>
2313 </template> 2356 </template>
...@@ -2378,8 +2421,7 @@ defineExpose({ ...@@ -2378,8 +2421,7 @@ defineExpose({
2378 <el-table-column prop="contrastSubjectGuid" label="选择对比表" width="200px" align="left" show-overflow-tooltip> 2421 <el-table-column prop="contrastSubjectGuid" label="选择对比表" width="200px" align="left" show-overflow-tooltip>
2379 <template #default="scope"> 2422 <template #default="scope">
2380 <el-tree-select v-if="!props.readonly" ref="treeSelectRef" filterable clearable 2423 <el-tree-select v-if="!props.readonly" ref="treeSelectRef" filterable clearable
2381 v-model="scope.row['contrastSubjectGuid']" node-key="guid" :data="contrastSubjects" placeholder="请选择" lazy 2424 v-model="scope.row['contrastSubjectGuid']" node-key="guid" :data="contrastSubjects" placeholder="请选择" :default-expanded-keys="defaultExpandedKeys"
2382 :load="(node, resolve) => treeSelectLoad(node, resolve)" :default-expanded-keys="defaultExpandedKeys"
2383 :auto-expand-parent="true" :default-checked-keys="[props.value.contrastSubjectGuid]" 2425 :auto-expand-parent="true" :default-checked-keys="[props.value.contrastSubjectGuid]"
2384 :filter-node-method="contrastSubjectInputFilterMethod" :props="{ 2426 :filter-node-method="contrastSubjectInputFilterMethod" :props="{
2385 value: 'guid', 2427 value: 'guid',
......
...@@ -9,13 +9,16 @@ import { ElMessage, ElMessageBox } from "element-plus"; ...@@ -9,13 +9,16 @@ import { ElMessage, ElMessageBox } from "element-plus";
9 import StepBar from "@/components/StepBar/index.vue"; 9 import StepBar from "@/components/StepBar/index.vue";
10 import TreeTransfer from "@/components/TreeTransfer/index.vue"; 10 import TreeTransfer from "@/components/TreeTransfer/index.vue";
11 import { 11 import {
12 getSubjectTableTree, 12 getInventoryDsDir,
13 getSubjectTableByDomain, 13 getSubjectTableByDomain,
14 saveQualityTable, 14 saveQualityTable,
15 getRuleTypeList, 15 getRuleTypeList,
16 getSmallCategoryList, 16 getSmallCategoryList,
17 getLargeCategoryList, 17 getLargeCategoryList,
18 } from '@/api/modules/dataQuality'; 18 } from '@/api/modules/dataQuality';
19 import {
20 getMetaTreeData
21 } from '@/api/modules/dataMetaService';
19 import ruleForm from "../data_quality/ruleForm.vue"; 22 import ruleForm from "../data_quality/ruleForm.vue";
20 import useUserStore from "@/store/modules/user"; 23 import useUserStore from "@/store/modules/user";
21 import useDataQualityStore from "@/store/modules/dataQuality"; 24 import useDataQualityStore from "@/store/modules/dataQuality";
...@@ -60,15 +63,46 @@ const toSubjectTables: any = ref([]); ...@@ -60,15 +63,46 @@ const toSubjectTables: any = ref([]);
60 63
61 const getSubjectTableTreeData = () => { 64 const getSubjectTableTreeData = () => {
62 dsFromTreeDataLoading.value = true; 65 dsFromTreeDataLoading.value = true;
63 getSubjectTableTree({}).then((res: any) => { 66 if (route.query.dataSource == '4') {
67 getInventoryDsDir().then((res: any) => {
64 dsFromTreeDataLoading.value = false; 68 dsFromTreeDataLoading.value = false;
65 if (res.code == proxy.$passCode) { 69 if (res.code == proxy.$passCode) {
66 dsFromTreeData.value = res.data?.map(d => { 70 dsFromTreeData.value = res.data?.map(d => {
67 d.parentGuid = 0; 71 d.parentGuid = 0;
72 d.guid = d.databaseGuid;
73 d.name = d.databaseChName;
74 d.label = d.databaseChName + `(${d.database})`;
75 d.children = d.children?.map(child => {
76 child.parentGuid = d.guid;
77 child.label = child.tableChName + `(${child.tableName})`;
78 child.guid = child.tableGuid;
79 child.dataServerName = d.database;
80 child.dataSourceGuid = d.databaseGuid;
81 child.parentGuid = d.databaseGuid;
82 return child;
83 })
84 return d;
85 }) || [];
86 }
87 })
88 } else {
89 getMetaTreeData({ isImportCreate: 'N' }).then((res: any) => {
90 dsFromTreeDataLoading.value = false;
91 if (res.code == proxy.$passCode) {
92 dsFromTreeData.value = res.data?.children?.map(d => {
93 d.parentGuid = 0;
94 d.label = d.name;
95 d.children = d.children?.map(child => {
96 child.label = child.name + `(${child.tableName})`;
97 child.dataServerName = d.name;
98 child.dataSourceGuid = d.guid;
99 return child;
100 })
68 return d; 101 return d;
69 }) || []; 102 }) || [];
70 } 103 }
71 }) 104 })
105 }
72 } 106 }
73 107
74 const getSubjectTableByDomainData = (guid) => { 108 const getSubjectTableByDomainData = (guid) => {
...@@ -124,7 +158,7 @@ onBeforeMount(() => { ...@@ -124,7 +158,7 @@ onBeforeMount(() => {
124 d.label = d.ruleName; 158 d.label = d.ruleName;
125 d.value = d.ruleCode; 159 d.value = d.ruleCode;
126 return d; 160 return d;
127 }) || []; 161 })?.filter(d => d.ruleCode != 'rows_check' && d.ruleCode != 'volatility_check') || [];
128 } else { 162 } else {
129 ElMessage.error(res.msg); 163 ElMessage.error(res.msg);
130 } 164 }
...@@ -155,12 +189,14 @@ const changeStep = (val, skip = false) => { ...@@ -155,12 +189,14 @@ const changeStep = (val, skip = false) => {
155 } 189 }
156 toSubjectTables.value = []; 190 toSubjectTables.value = [];
157 dsToTreeData.value.forEach(d => { 191 dsToTreeData.value.forEach(d => {
158 d.children.forEach(c => { 192 d.children.forEach(child => {
159 c.children.forEach(child => { 193 child.guid = child.tableGuid || child.guid;
160 child.label = `${child.enName}(${child.chName})`; 194 child.enName = child.tableName;
195 child.chName = child.tableChName || child.name;
196 child.dataSourceGuid = child.parentGuid;
197 child.databaseName = child.databaseName,
161 toSubjectTables.value.push(child); 198 toSubjectTables.value.push(child);
162 }) 199 })
163 })
164 }); 200 });
165 step.value = val - 1; 201 step.value = val - 1;
166 stepsInfo.value.step = val - 1 202 stepsInfo.value.step = val - 1
...@@ -208,6 +244,7 @@ const transformRulesInfo = (info: any) => { ...@@ -208,6 +244,7 @@ const transformRulesInfo = (info: any) => {
208 subjectGuid: tableInfo.guid, 244 subjectGuid: tableInfo.guid,
209 dataSourceGuid: tableInfo.dataSourceGuid, 245 dataSourceGuid: tableInfo.dataSourceGuid,
210 databaseName: tableInfo.dataServerName, 246 databaseName: tableInfo.dataServerName,
247 dataSource: route.query.dataSource ? parseInt(<string>route.query.dataSource) : null,
211 modelRuleConfList: [Object.assign({}, info, { 248 modelRuleConfList: [Object.assign({}, info, {
212 qualityModelGuid: modelGuid 249 qualityModelGuid: modelGuid
213 })] 250 })]
...@@ -226,6 +263,7 @@ const transformRulesInfo = (info: any) => { ...@@ -226,6 +263,7 @@ const transformRulesInfo = (info: any) => {
226 subjectGuid: tableInfo.guid, 263 subjectGuid: tableInfo.guid,
227 dataSourceGuid: tableInfo.dataSourceGuid, 264 dataSourceGuid: tableInfo.dataSourceGuid,
228 databaseName: tableInfo.dataServerName, 265 databaseName: tableInfo.dataServerName,
266 dataSource: route.query.dataSource ? parseInt(<string>route.query.dataSource) : null,
229 modelRuleConfList: [Object.assign({}, info, { 267 modelRuleConfList: [Object.assign({}, info, {
230 ruleField: fields?.map(f => { 268 ruleField: fields?.map(f => {
231 return { 269 return {
...@@ -249,6 +287,7 @@ const transformRulesInfo = (info: any) => { ...@@ -249,6 +287,7 @@ const transformRulesInfo = (info: any) => {
249 subjectGuid: tableInfo.guid, 287 subjectGuid: tableInfo.guid,
250 dataSourceGuid: tableInfo.dataSourceGuid, 288 dataSourceGuid: tableInfo.dataSourceGuid,
251 databaseName: tableInfo.dataServerName, 289 databaseName: tableInfo.dataServerName,
290 dataSource: route.query.dataSource ? parseInt(<string>route.query.dataSource) : null,
252 modelRuleConfList: [Object.assign({}, info, { 291 modelRuleConfList: [Object.assign({}, info, {
253 ruleField: [{ 292 ruleField: [{
254 guid: fields.guid, 293 guid: fields.guid,
...@@ -273,6 +312,7 @@ const transformRulesInfo = (info: any) => { ...@@ -273,6 +312,7 @@ const transformRulesInfo = (info: any) => {
273 subjectGuid: tableInfo.guid, 312 subjectGuid: tableInfo.guid,
274 dataSourceGuid: tableInfo.dataSourceGuid, 313 dataSourceGuid: tableInfo.dataSourceGuid,
275 databaseName: tableInfo.dataServerName, 314 databaseName: tableInfo.dataServerName,
315 dataSource: route.query.dataSource ? parseInt(<string>route.query.dataSource) : null,
276 modelRuleConfList: [Object.assign({}, info, { 316 modelRuleConfList: [Object.assign({}, info, {
277 ruleField: fields?.map(f => { 317 ruleField: fields?.map(f => {
278 return { 318 return {
...@@ -297,6 +337,7 @@ const transformRulesInfo = (info: any) => { ...@@ -297,6 +337,7 @@ const transformRulesInfo = (info: any) => {
297 subjectGuid: tableInfo.guid, 337 subjectGuid: tableInfo.guid,
298 dataSourceGuid: tableInfo.dataSourceGuid, 338 dataSourceGuid: tableInfo.dataSourceGuid,
299 databaseName: tableInfo.dataServerName, 339 databaseName: tableInfo.dataServerName,
340 dataSource: route.query.dataSource ? parseInt(<string>route.query.dataSource) : null,
300 modelRuleConfList: [Object.assign({}, info, { 341 modelRuleConfList: [Object.assign({}, info, {
301 differenceRange: row.differenceRange, 342 differenceRange: row.differenceRange,
302 rows: [], 343 rows: [],
...@@ -316,6 +357,7 @@ const transformRulesInfo = (info: any) => { ...@@ -316,6 +357,7 @@ const transformRulesInfo = (info: any) => {
316 subjectGuid: tableInfo.guid, 357 subjectGuid: tableInfo.guid,
317 dataSourceGuid: tableInfo.dataSourceGuid, 358 dataSourceGuid: tableInfo.dataSourceGuid,
318 databaseName: tableInfo.dataServerName, 359 databaseName: tableInfo.dataServerName,
360 dataSource: route.query.dataSource ? parseInt(<string>route.query.dataSource) : null,
319 modelRuleConfList: [Object.assign({}, info, { 361 modelRuleConfList: [Object.assign({}, info, {
320 ruleField: fields.map(f => { 362 ruleField: fields.map(f => {
321 return { 363 return {
...@@ -344,6 +386,7 @@ const transformRulesInfo = (info: any) => { ...@@ -344,6 +386,7 @@ const transformRulesInfo = (info: any) => {
344 subjectGuid: tableInfo.guid, 386 subjectGuid: tableInfo.guid,
345 dataSourceGuid: tableInfo.dataSourceGuid, 387 dataSourceGuid: tableInfo.dataSourceGuid,
346 databaseName: tableInfo.dataServerName, 388 databaseName: tableInfo.dataServerName,
389 dataSource: route.query.dataSource ? parseInt(<string>route.query.dataSource) : null,
347 modelRuleConfList: [Object.assign({}, info, { 390 modelRuleConfList: [Object.assign({}, info, {
348 ruleField: fields.map(f => { 391 ruleField: fields.map(f => {
349 return { 392 return {
...@@ -379,11 +422,19 @@ const transformRulesInfo = (info: any) => { ...@@ -379,11 +422,19 @@ const transformRulesInfo = (info: any) => {
379 subjectGuid: tableInfo.guid, 422 subjectGuid: tableInfo.guid,
380 dataSourceGuid: tableInfo.dataSourceGuid, 423 dataSourceGuid: tableInfo.dataSourceGuid,
381 databaseName: tableInfo.dataServerName, 424 databaseName: tableInfo.dataServerName,
425 dataSource: route.query.dataSource ? parseInt(<string>route.query.dataSource) : null,
382 modelRuleConfList: [Object.assign({}, info, { 426 modelRuleConfList: [Object.assign({}, info, {
427 ruleField: info.ruleFields.map(row => {
428 return {
429 // guid: row.mainTable,
383 enName: row.mainTableField, 430 enName: row.mainTableField,
431 //chName: row.chName,
384 compareTableGuid: row.compareTableGuid, 432 compareTableGuid: row.compareTableGuid,
385 compareTableName: row.compareTableName, 433 compareTableName: row.compareTableName,
386 compareEnName: row.compareEnName 434 compareEnName: row.compareEnName
435 }
436 }),
437 ruleFields: ''
387 })] 438 })]
388 })); 439 }));
389 } 440 }
...@@ -428,18 +479,18 @@ const save = () => { ...@@ -428,18 +479,18 @@ const save = () => {
428 <div class="operator_panel is-block"> 479 <div class="operator_panel is-block">
429 <div class="panel_title"> 480 <div class="panel_title">
430 <div class="title_text"> 481 <div class="title_text">
431 <span>选择主题表</span> 482 <span>选择表</span>
432 <span class="tips_text">选择需要添加质检规则的主题表</span> 483 <span class="tips_text">{{ route.query.dataSource == '5' ?
484 '选择需要添加质检规则的表,请确保数据库为脱产环境,避免数据质检影响您的生产环境,且允许在该脱产环境建脏数据的库,请知晓!' : '选择需要添加质检规则的表' }}</span>
433 </div> 485 </div>
434 </div> 486 </div>
435 <TreeTransfer mode="transfer" :title="['主题表', '已选表']" pid="parentGuid" 487 <TreeTransfer mode="transfer" :title="[route.query.dataSource == '5' ? '可选元数据目录表' : '可选盘点数据库目录表', '已选表']"
436 :from-tree-data-loading="dsFromTreeDataLoading" :lazy="true" :checkOnClickNode="true" 488 pid="parentGuid" :from-tree-data-loading="dsFromTreeDataLoading" :checkOnClickNode="true"
437 :from_checked_all="false" :from_data="dsFromTreeData" :to_data="dsToTreeData" node_key="guid" 489 :from_checked_all="false" :from_data="dsFromTreeData" :to_data="dsToTreeData" node_key="guid"
438 :transferOpenNode="true" width="70%" :defaultProps="{ 490 :transferOpenNode="true" width="70%" :defaultProps="{
439 label: 'name', 491 label: 'label',
440 value: 'guid' 492 value: 'guid'
441 }" :lazyFn="handleSubjectTableLazyFn" @left-check-change="handleSubjectCheckedChange" 493 }" height="calc(100% - 64px)">
442 height="calc(100% - 64px)">
443 </TreeTransfer> 494 </TreeTransfer>
444 </div> 495 </div>
445 </div> 496 </div>
...@@ -454,7 +505,8 @@ const save = () => { ...@@ -454,7 +505,8 @@ const save = () => {
454 <div class="panel_content"> 505 <div class="panel_content">
455 <div class="form_panel"> 506 <div class="form_panel">
456 <ruleForm ref="ruleFormRef" :toSubjectTables="toSubjectTables" :ruleTypeList="ruleTypeList" 507 <ruleForm ref="ruleFormRef" :toSubjectTables="toSubjectTables" :ruleTypeList="ruleTypeList"
457 :largeCategoryList="largeCategoryList" :smallCategoryList="smallCategoryList"></ruleForm> 508 :data-source="route.query.dataSource as string" :largeCategoryList="largeCategoryList"
509 :smallCategoryList="smallCategoryList"></ruleForm>
458 </div> 510 </div>
459 </div> 511 </div>
460 </div> 512 </div>
......
...@@ -241,7 +241,7 @@ onBeforeMount(() => { ...@@ -241,7 +241,7 @@ onBeforeMount(() => {
241 d.label = d.ruleName; 241 d.label = d.ruleName;
242 d.value = d.ruleCode; 242 d.value = d.ruleCode;
243 return d; 243 return d;
244 }) || []; 244 })?.filter(d => d.ruleCode != 'rows_check' && d.ruleCode != 'volatility_check') || [];
245 } else { 245 } else {
246 ElMessage.error(res.msg); 246 ElMessage.error(res.msg);
247 } 247 }
...@@ -262,6 +262,16 @@ onBeforeMount(() => { ...@@ -262,6 +262,16 @@ onBeforeMount(() => {
262 }) 262 })
263 }) 263 })
264 264
265 onActivated(() => {
266 let tab: any = userStore.tabbar.find((tab: any) => tab.fullPath === fullPath);
267 if (tab && detailInfo.value?.ruleConfName) {
268 tab.meta.title = `编辑-${detailInfo.value.ruleConfName}(${detailInfo.value.subjectZhName})`
269 if (fullPath === route.fullPath) {
270 document.title = tab.meta.title;
271 }
272 }
273 });
274
265 </script> 275 </script>
266 276
267 <template> 277 <template>
......
...@@ -204,15 +204,14 @@ const save = () => { ...@@ -204,15 +204,14 @@ const save = () => {
204 subjectGuid: modelDetailInfo.value.subjectGuid, 204 subjectGuid: modelDetailInfo.value.subjectGuid,
205 subjectName: modelDetailInfo.value.subjectName, 205 subjectName: modelDetailInfo.value.subjectName,
206 dataSourceGuid: modelDetailInfo.value.dataSourceGuid, 206 dataSourceGuid: modelDetailInfo.value.dataSourceGuid,
207 modelRuleConfList: submitInfos 207 modelRuleConfList: submitInfos,
208 dataSource: route.query.dataSource ? parseInt(<string>route.query.dataSource) : null,
208 }]).then((res: any) => { 209 }]).then((res: any) => {
209 fullScreenLoading.value = false; 210 fullScreenLoading.value = false;
210 if (res.code == proxy.$passCode) { 211 if (res.code == proxy.$passCode) {
211 ElMessage.success('新建规则保存成功'); 212 ElMessage.success('新建规则保存成功');
212 router.push({
213 name: 'qualityRules'
214 });
215 userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath)); 213 userStore.setTabbar(userStore.tabbar.filter((tab: any) => tab.fullPath !== fullPath));
214 router.go(-1);
216 dataQualityStore.setModelGuid(modelGuid); 215 dataQualityStore.setModelGuid(modelGuid);
217 } else { 216 } else {
218 ElMessage.error(res.msg); 217 ElMessage.error(res.msg);
...@@ -249,7 +248,7 @@ onBeforeMount(() => { ...@@ -249,7 +248,7 @@ onBeforeMount(() => {
249 d.label = d.ruleName; 248 d.label = d.ruleName;
250 d.value = d.ruleCode; 249 d.value = d.ruleCode;
251 return d; 250 return d;
252 }) || []; 251 })?.filter(d => d.ruleCode != 'rows_check' && d.ruleCode != 'volatility_check') || []; //先隐藏掉表行数检查和表行数波动率
253 } else { 252 } else {
254 ElMessage.error(res.msg); 253 ElMessage.error(res.msg);
255 } 254 }
...@@ -270,6 +269,16 @@ onBeforeMount(() => { ...@@ -270,6 +269,16 @@ onBeforeMount(() => {
270 }) 269 })
271 }) 270 })
272 271
272 onActivated(() => {
273 let tab: any = userStore.tabbar.find((tab: any) => tab.fullPath === fullPath);
274 if (tab && route.query.name) {
275 tab.meta.title = `新建规则(${route.query.name})`;
276 if (fullPath === route.fullPath) {
277 document.title = tab.meta.title;
278 }
279 }
280 });
281
273 const cancel = () => { 282 const cancel = () => {
274 ElMessageBox.confirm( 283 ElMessageBox.confirm(
275 "当前页面尚未保存,确定放弃修改吗?", 284 "当前页面尚未保存,确定放弃修改吗?",
...@@ -317,7 +326,7 @@ const cancel = () => { ...@@ -317,7 +326,7 @@ const cancel = () => {
317 </div> 326 </div>
318 <div class="panel_content" v-show="item.open"> 327 <div class="panel_content" v-show="item.open">
319 <div class="form_panel"> 328 <div class="form_panel">
320 <ruleForm ref="ruleFormRef" :toSubjectTables="toSubjectTables" :ruleTypeList="ruleTypeList" 329 <ruleForm ref="ruleFormRef" :toSubjectTables="toSubjectTables" :ruleTypeList="ruleTypeList" :dataSource="route.query.dataSource as string"
321 :largeCategoryList="largeCategoryList" :smallCategoryList="smallCategoryList" :isSingle="true"> 330 :largeCategoryList="largeCategoryList" :smallCategoryList="smallCategoryList" :isSingle="true">
322 </ruleForm> 331 </ruleForm>
323 </div> 332 </div>
......
...@@ -221,7 +221,7 @@ const tableBtnClick = async (scope, btn) => { ...@@ -221,7 +221,7 @@ const tableBtnClick = async (scope, btn) => {
221 const row = scope.row; 221 const row = scope.row;
222 currTableData.value = row; 222 currTableData.value = row;
223 if (type == "export_file") { 223 if (type == "export_file") {
224 const refSignInfo: any = await getDownFileSignByUrl(parseAndDecodeUrl(row.filePath).decodedPath); 224 const refSignInfo: any = await getDownFileSignByUrl(parseAndDecodeUrl(row.filePath).fileName);
225 if (!refSignInfo?.data) { 225 if (!refSignInfo?.data) {
226 refSignInfo?.msg && ElMessage.error(refSignInfo?.msg); 226 refSignInfo?.msg && ElMessage.error(refSignInfo?.msg);
227 return; 227 return;
...@@ -236,7 +236,7 @@ const tableBtnClick = async (scope, btn) => { ...@@ -236,7 +236,7 @@ const tableBtnClick = async (scope, btn) => {
236 //downFile(row.filePath, row.fileName) 236 //downFile(row.filePath, row.fileName)
237 } else if (type == 'export_abnormal_data') { 237 } else if (type == 'export_abnormal_data') {
238 //downFile(row.errorFilePath, '') 238 //downFile(row.errorFilePath, '')
239 const refSignInfo: any = await getDownFileSignByUrl(parseAndDecodeUrl(row.errorFilePath).decodedPath); 239 const refSignInfo: any = await getDownFileSignByUrl(parseAndDecodeUrl(row.errorFilePath).fileName);
240 if (!refSignInfo?.data) { 240 if (!refSignInfo?.data) {
241 refSignInfo?.msg && ElMessage.error(refSignInfo?.msg); 241 refSignInfo?.msg && ElMessage.error(refSignInfo?.msg);
242 return; 242 return;
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!