8e994be3 by xukangle

updata: 分类分级目录模块开发

1 parent 210b5eb5
...@@ -3,8 +3,8 @@ VITE_APP_TITLE = 数据资产管理系统 ...@@ -3,8 +3,8 @@ VITE_APP_TITLE = 数据资产管理系统
3 # 接口域名 3 # 接口域名
4 # VITE_API_BASEURL = https://www.zgsjzc.com/api 4 # VITE_API_BASEURL = https://www.zgsjzc.com/api
5 # VITE_API_BASEURL = https://swzl-test.csbr.cn/api 5 # VITE_API_BASEURL = https://swzl-test.csbr.cn/api
6 # VITE_API_BASEURL = http://localhost:9000 6 VITE_API_BASEURL = http://localhost:9000
7 VITE_API_BASEURL = http://10.4.82.1:28052/ 7 # VITE_API_BASEURL = http://10.4.82.1:28052/
8 # 平台用户 接口请地址 8 # 平台用户 接口请地址
9 VITE_APP_USER_API_BASEURL = gateway-server/user 9 VITE_APP_USER_API_BASEURL = gateway-server/user
10 # 系统管理 接口地址 10 # 系统管理 接口地址
...@@ -25,8 +25,8 @@ VITE_APP_PLAN_BASEURL = ms-daop-jgjf-data-plan-service ...@@ -25,8 +25,8 @@ VITE_APP_PLAN_BASEURL = ms-daop-jgjf-data-plan-service
25 VITE_APP_QUALITY_BASEURL = ms-daop-data-quality-service 25 VITE_APP_QUALITY_BASEURL = ms-daop-data-quality-service
26 26
27 #数据盘点接口地址ms-daop-zcgl-data-inventory 27 #数据盘点接口地址ms-daop-zcgl-data-inventory
28 # VITE_APP_CHECK_BASEURL = /mock 28 VITE_APP_CHECK_BASEURL = /mock
29 VITE_APP_CHECK_BASEURL = ms-daop-zcgl-data-inventory 29 # VITE_APP_CHECK_BASEURL = ms-daop-zcgl-data-inventory
30 30
31 #门户接口 31 #门户接口
32 VITE_API_PORTALURL = https://swzl-test.zgsjzc.com/portal 32 VITE_API_PORTALURL = https://swzl-test.zgsjzc.com/portal
......
...@@ -226,3 +226,45 @@ export const getCgDirFieldPageList = (data) => request({ ...@@ -226,3 +226,45 @@ export const getCgDirFieldPageList = (data) => request({
226 method: 'post', 226 method: 'post',
227 data 227 data
228 }) 228 })
229
230 /** 获取字典列表
231 * VITE_APP_PLAN_BASEURL 为环境变量 现在只是mock数据
232 */
233 export const getDictionary = (params) => request({
234 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/data-dictionary-general/list-all?state=1`,
235 method: 'post'
236 })
237
238
239
240 /** 业务规则配置-新增
241 * @param {Object}
242 * @path /biz-rule-config/save
243 */
244 export const saveBizRuleConfig = (data) => request({
245 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/biz-rule-config/save`,
246 method: 'post',
247 data
248 })
249
250
251 /**树形目录
252 * @param {Object}
253 * @path /db-dir/tree-list
254 */
255 export const getDbDirTreeList = (data) => request({
256 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/tree-list`,
257 method: 'post',
258 data
259 })
260
261 /**
262 * 数据库目录-表数据列表查询
263 * @param {Object}
264 * @path /db-dir/table/page-list
265 */
266 export const getDbDirTablePageList = (data) => request({
267 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/table/page-list`,
268 method: 'post',
269 data
270 })
......
...@@ -2,18 +2,296 @@ import type { MockMethod } from 'vite-plugin-mock' ...@@ -2,18 +2,296 @@ import type { MockMethod } from 'vite-plugin-mock'
2 import Mock from 'mockjs' 2 import Mock from 'mockjs'
3 3
4 4
5 export const confirmDelivery = { 5 /**
6 url: '/mock/youthBoost/admin/shipment', 6 * {
7 "children": [
8 {
9 "parentGuids": [
10 "string"
11 ]
12 }
13 ],
14 "parentGuids": [
15 "string"
16 ],
17 "guid": "string",
18 "tenantGuid": "string",
19 "cgDirName": "string",
20 "classifyName": "string",
21 "orderNum": 0,
22 "level": 0,
23 "levelCode": "string",
24 "parentGuid": "string"
25 }
26 */
27 export const getCgDirTreeList = {
28 url: '/mock/cg-dir/tree-list',
29 method: 'post',
30 response: ({body}:{body:any}) => {
31
32 return {
33 code: '00000',
34 message: '成功',
35 'data|10-30': [{
36 guid: '@guid',
37 tenantGuid: '@guid',
38 cgDirName: '@cword(3, 10)',
39 classifyName: '@cword(3, 5)',
40 orderNum: '@integer(1, 100)',
41 level: '@integer(1, 3)',
42 levelCode: '@string("number", 6)',
43 parentGuid: '@guid',
44 'parentGuids|1-2': ['@guid'],
45 'children|0-3': [{
46 guid: '@guid',
47 tenantGuid: '@guid',
48 cgDirName: '@cword(3, 5)',
49 classifyName: '@cword(3, 5)',
50 orderNum: '@integer(1, 100)',
51 level: '@integer(1, 3)',
52 levelCode: '@string("number", 6)',
53 parentGuid: '@guid',
54 'parentGuids|1-2': ['@guid']
55 }]
56 }]
57 }
58 }
59 }
60
61 /**
62 * "data": {
63 "totalRows": 0,
64 "totalPages": 0,
65 "pageSize": 0,
66 "pageIndex": 0,
67 "records": [
68 {
69 "guid": "string",
70 "tenantGuid": "string",
71 "cgDirName": "string",
72 "dirGuid": "string",
73 "classifyName": "string",
74 "gradeDetailName": "string",
75 "label": "string",
76 "fieldName": "string",
77 "fieldChName": "string",
78 "tableName": "string",
79 "tableChName": "string",
80 "database": "string",
81 "databaseChName": "string"
82 }
83 ],
84 export const getCgDirFieldPageList = (data) => request({
85 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/cg-dir/field/page-list`,
86 method: 'post',
87 data
88 })
89 */
90
91 export const getCgDirFieldPageList = {
92 url: '/mock/cg-dir/field/page-list',
93 method: 'post',
94 response: ({body}:{body:any}) => {
95 return {
96 code: '00000',
97 message: '成功',
98 'data': {
99 totalRows: '@integer(50, 100)',
100 totalPages: '@integer(1, 10)',
101 pageSize: 10,
102 pageIndex: 1,
103 'records|20-30': [{
104 guid: '@guid',
105 tenantGuid: '@guid',
106 cgDirName: '@cword(3, 5)',
107 dirGuid: '@guid',
108 classifyName: '@cword(3, 5)',
109 gradeDetailName: '@cword(3, 5)',
110 label: '@cword(3, 5)',
111 fieldName: '@cword(3, 5)',
112 fieldChName: '@cword(3, 5)',
113 tableName: '@cword(3, 5)',
114 tableChName: '@cword(3, 5)',
115 database: '@cword(3, 5)',
116 databaseChName: '@cword(3, 5)'
117 }]
118 }
119 }
120 }
121 }
122
123 /**
124 *
125 * export const getDictionary = (params) => request({
126 url: `${import.meta.env.VITE_APP_PLAN_BASEURL}/data-dictionary-general/list-all?state=1`,
127 method: 'post'
128 })
129 */
130
131 export const getDictionary = {
132 url: '/mock/data-dictionary-general/list-all',
133 method: 'post',
134 response: ({body}:{body:any}) => {
135 return {
136 code: '00000',
137 message: '成功',
138 'data|10-30': [{
139 guid: '@guid',
140 tenantGuid: '@guid',
141 chName: '@cword(3, 5)',
142 classifyName: '@cword(3, 5)',
143 orderNum: '@integer(1, 100)',
144 level: '@integer(1, 3)',
145 levelCode: '@string("number", 6)',
146 parentGuid: '@guid',
147 'parentGuids|1-2': ['@guid'],
148 'children|0-3': [{
149 guid: '@guid',
150 tenantGuid: '@guid',
151 chName: '@cword(3, 5)',
152 classifyName: '@cword(3, 5)',
153 orderNum: '@integer(1, 100)',
154 level: '@integer(1, 3)',
155 levelCode: '@string("number", 6)',
156 parentGuid: '@guid',
157 'parentGuids|1-2': ['@guid']
158 }]
159 }]
160 }
161 }
162 }
163
164 export const saveBizRuleConfig = {
165 url: '/mock/biz-rule-config/save',
7 method: 'post', 166 method: 'post',
8 response: ({body}:{body:any}) => { 167 response: ({body}:{body:any}) => {
168 return {
169 code: '00000',
170 message: '成功'
171 }
172 }
173 }
9 174
175 /**
176 * "data": [
177 {
178 "cgDirName": "string",
179 "childList": [
180 {
181 "databaseGuid": "string",
182 "database": "string",
183 "databaseChName": "string",
184 "childList": [
185 {
186 "tableGuid": "string",
187 "tableName": "string",
188 "tableChName": "string"
189 }
190 ]
191 }
192 ]
193 }
194 ],
195 export const getDbDirTreeList = (data) => request({
196 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/tree-list`,
197 method: 'post',
198 data
199 })
200 */
201
202 export const getDbDirTreeList = {
203 url: '/mock/db-dir/tree-list',
204 method: 'post',
205 response: ({body}:{body:any}) => {
10 return { 206 return {
11 code: 200, 207 code: '00000',
12 message: '成功', 208 message: '成功',
13 data: [] 209 'data|10-30': [{
210 cgDirName: '@cword(3, 5)',
211 'children|1-3': [{
212 databaseGuid: '@guid',
213 database: '@cword(3, 5)',
214 databaseChName: '@cword(3, 5)',
215 'children|1-3': [{
216 tableGuid: '@guid',
217 tableName: '@cword(3, 5)',
218 tableChName: '@cword(3, 5)'
219 }]
220 }]
221 }]
14 } 222 }
15 } 223 }
16 } 224 }
17 225
226 /**
227 * /**
228 * 数据库目录-表数据列表查询
229 * @param {Object}
230 * @path /db-dir/table/page-list
231 * export const getDbDirTablePageList = (data) => request({
232 url: `${import.meta.env.VITE_APP_CHECK_BASEURL}/db-dir/table/page-list`,
233 method: 'post',
234 data
235 })
236 "data": {
237 "totalRows": 0,
238 "totalPages": 0,
239 "pageSize": 0,
240 "pageIndex": 0,
241 "records": [
242 {
243 "guid": "string",
244 "tenantGuid": "string",
245 "cgDirName": "string",
246 "dirGuid": "string",
247 "tableGuid": "string",
248 "tableName": "string",
249 "tableChName": "string",
250 "databaseGuid": "string",
251 "database": "string",
252 "databaseChName": "string",
253 "foundMode": 0,
254 "state": 0,
255 "isDataAsset": "string"
256 }
257 ],
258 }
259 */
260
261 export const getDbDirTablePageList = {
262 url: '/mock/db-dir/table/page-list',
263 method: 'post',
264 response: ({body}:{body:any}) => {
265 const {pageIndex, pageSize} = body
266 return {
267 code: '00000',
268 message: '成功',
269 'data': {
270 totalRows: '@integer(50, 100)',
271 totalPages: '@integer(1, 10)',
272 pageSize,
273 pageIndex,
274 'records|20-30': [{
275 guid: '@guid',
276 tenantGuid: '@guid',
277 cgDirName: '@cword(3, 5)',
278 dirGuid: '@guid',
279 tableGuid: '@guid',
280 tableName: '@cword(3, 5)',
281 tableChName: '@cword(3, 5)',
282 databaseGuid: '@guid',
283 database: '@cword(3, 5)',
284 databaseChName: '@cword(3, 5)',
285 foundMode: '@integer(1, 3)',
286 state: '@integer(0,2)',
287 isDataAsset: 'Y'
288 }]
289 }
290 }
291 }
292 }
293
294
295
18 296
19 export default [confirmDelivery] as MockMethod[] 297 export default [getCgDirTreeList,getCgDirFieldPageList, getDictionary,saveBizRuleConfig, getDbDirTreeList, getDbDirTablePageList] as MockMethod[]
......
...@@ -176,6 +176,20 @@ const routes: RouteRecordRaw[] = [ ...@@ -176,6 +176,20 @@ const routes: RouteRecordRaw[] = [
176 cache: true 176 cache: true
177 }, 177 },
178 }, 178 },
179 {
180 path: 'configure-rules',
181 name: 'configureRules',
182 component: () => import('@/views/data_inventory/configureRules.vue'),
183 meta: {
184 title: '配置业务规则',
185 sidebar: false,
186 breadcrumb: false,
187 cache: true,
188 reuse: true,
189 editPage: true,
190 activeMenu: '/data-inventory/classify-grade-catalogue',
191 },
192 },
179 ], 193 ],
180 } 194 }
181 ] 195 ]
......
...@@ -3,54 +3,31 @@ ...@@ -3,54 +3,31 @@
3 </route> 3 </route>
4 4
5 <script lang="ts" setup name="classifyGradeCatalogue"> 5 <script lang="ts" setup name="classifyGradeCatalogue">
6 import { CirclePlus, Delete, 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 { getCgDirTreeList, getCgDirFieldPageList } from '@/api/modules/dataInventory'; 8 import { getCgDirTreeList, getCgDirFieldPageList, getDictionary, saveBizRuleConfig, getDbDirTreeList, getDbDirTablePageList } from '@/api/modules/dataInventory';
9 import { TableColumnWidth } from "@/utils/enum";
10 import router from "@/router";
9 11
10 const currentPath = ref<string[]>(['全部', '个人信息', '个人自然信息', '个人基本概况信息']);
11 12
12 const tempData = [ 13 const currentPath = ref<string[]>([]);
13 {
14 guid: '1',
15 standardName: '个人信息',
16 status: 'published',
17 children: [
18 {
19 guid: '1-1',
20 standardName: '个人自然信息',
21 status: 'published',
22 children: [
23 {
24 guid: '1-1-1',
25 standardName: '个人基本概况信息',
26 status: 'published',
27 },
28 {
29 guid: '1-1-2',
30 standardName: '个人财产信息',
31 status: 'published',
32 },
33 {
34 guid: '1-1-3',
35 standardName: '个人健康信息',
36 status: 'published',
37 },
38 ]
39 },
40 ]
41 },
42 ];
43 const { proxy } = getCurrentInstance() as any; 14 const { proxy } = getCurrentInstance() as any;
44 15
45 // 分级分类树形列表 16 // 分级分类树形列表
46 const CgDirTreeList = ref(); 17 const CgDirTreeList = ref();
47 const getCgDirTreeData = async () => { 18 const getCgDirTreeData = async () => {
19 treeInfo.value.loading = true;
48 const params = { 20 const params = {
49 classifyName: '', 21 classifyName: '',
50 } 22 }
51 const res: any = await getCgDirTreeList(params); 23 const res: any = await getCgDirTreeList(params);
52 if (res.code == proxy.$passCode) { 24 if (res.code == proxy.$passCode) {
53 CgDirTreeList.value = res.data; 25 CgDirTreeList.value = res.data;
26 treeInfo.value.data = res.data;
27 currentPath.value = [res.data[0].classifyName];
28 treeInfo.value.expandedKey = [res.data[0].guid];
29 treeInfo.value.currentNodeKey = res.data[0].guid;
30 treeInfo.value.loading = false;
54 } else { 31 } else {
55 proxy.$ElMessage.error(res.msg); 32 proxy.$ElMessage.error(res.msg);
56 } 33 }
...@@ -58,6 +35,7 @@ const getCgDirTreeData = async () => { ...@@ -58,6 +35,7 @@ const getCgDirTreeData = async () => {
58 // 分页列表 35 // 分页列表
59 const CgDirFieldPageList = ref(); 36 const CgDirFieldPageList = ref();
60 const getCgDirFieldPage = async (params = {}) => { 37 const getCgDirFieldPage = async (params = {}) => {
38 tableInfo.value.loading = true;
61 // 在这里你可以根据需要扩展或修改 params 39 // 在这里你可以根据需要扩展或修改 params
62 const defaultParams = { 40 const defaultParams = {
63 pageIndex: 1, 41 pageIndex: 1,
...@@ -74,165 +52,61 @@ const getCgDirFieldPage = async (params = {}) => { ...@@ -74,165 +52,61 @@ const getCgDirFieldPage = async (params = {}) => {
74 const finalParams = { ...defaultParams, ...params }; 52 const finalParams = { ...defaultParams, ...params };
75 const res: any = await getCgDirFieldPageList(finalParams); 53 const res: any = await getCgDirFieldPageList(finalParams);
76 if (res.code == proxy.$passCode) { 54 if (res.code == proxy.$passCode) {
77 CgDirFieldPageList.value = res.data; 55 CgDirFieldPageList.value = res.data.records;
56 tableInfo.value.page.rows = res.data.totalRows;
57 tableInfo.value.page.limit = res.data.pageSize
58 tableInfo.value.page.curr = res.data.pageIndex
59 tableInfo.value.data = res.data.records;
60 tableInfo.value.loading = false;
61 } else {
62 proxy.$ElMessage.error(res.msg);
63 }
64 };
65
66 const dictionaryList = ref([]);
67 const getDictionaryList = () => {
68 getDictionary({}).then((res: any) => {
69 dictionaryList.value = [];
70 if (res.code == proxy.$passCode) {
71 dictionaryList.value = res.data || [];
72 classEditFormItems.value[4].options = res.data || [];
78 } else { 73 } else {
79 proxy.$ElMessage.error(res.msg); 74 proxy.$ElMessage.error(res.msg);
80 } 75 }
76 })
81 }; 77 };
82 78
83 onMounted(() => { 79 onMounted(() => {
84 getCgDirTreeData(); 80 getCgDirTreeData();
85 getCgDirFieldPage(); 81 getCgDirFieldPage();
82 getDictionaryList();
86 }) 83 })
87 84
88 // 左侧tree-list 85 // 左侧tree-list
89 const treeInfo = ref({ 86 const treeInfo = ref({
90 id: "data-pickup-tree", 87 id: "data-pickup-tree",
91 filter: true, 88 filter: true,
92 editTreeItem: true, 89 editTreeItem: false,
93 queryValue: "", 90 queryValue: "",
94 className: 'tree-list', 91 className: 'tree-list',
95 queryPlaceholder: "输入标准集名称搜索", 92 queryPlaceholder: "输入标准集名称搜索",
96 props: { 93 props: {
97 label: "standardName", 94 label: "classifyName",
98 value: "guid", 95 value: "guid",
99 }, 96 },
100 nodeKey: 'guid', 97 nodeKey: 'guid',
101 expandedKey: ['0'], 98 expandedKey: ['0'],
102 currentNodeKey: '', 99 currentNodeKey: '',
103 expandOnNodeClick: false, 100 expandOnNodeClick: false,
104 data: tempData, 101 data: [],
105 loading: false 102 loading: false
106 }); 103 });
107 104
108 // 弹窗配置
109 const formItems: any = ref([
110 {
111 label: '标准集名称',
112 type: 'input',
113 maxlength: 50,
114 placeholder: '请输入',
115 field: 'standardName',
116 clearable: true,
117 required: true
118 }, {
119 label: '标准集编号',
120 type: 'input',
121 placeholder: '',
122 field: 'standardCode',
123 required: true,
124 disabled: true
125 }, {
126 label: "上级标准集",
127 type: 'tree-select',
128 placeholder: '请选择',
129 field: 'parentGuid',
130 default: '',
131 checkStrictly: true,
132 lazy: false,
133 clearable: true,
134 options: [],
135 props: {
136 label: 'standardName',
137 value: 'guid',
138 children: 'children',
139 isLeaf: 'isLeaf'
140 },
141 expandKeys: [],
142 filterable: true,
143 required: false
144 }, {
145 label: '排序',
146 type: 'input',
147 placeholder: '请输入',
148 field: 'orderNum',
149 maxlength: 6,
150 required: true,
151 clearable: true,
152 }, {
153 label: '描述',
154 type: 'textarea',
155 placeholder: '请输入',
156 field: 'description',
157 clearable: true,
158 required: false,
159 block: true
160 },
161 ])
162 const formRules: any = ref({
163 standardName: [
164 {
165 required: true,
166 message: '请输入标准集名称',
167 trigger: 'blur'
168 },
169 {
170 max: 50,
171 message: '长度在 50 个字符以内',
172 trigger: 'blur'
173 },
174 ],
175 orderNum: [{
176 validator: (rule: any, value: any, callback: any) => {
177 if (value === 0) {
178 callback();
179 return;
180 }
181 if (!value) {
182 callback(new Error('请填写排序'));
183 return;
184 }
185 const r = /(^[0-9]([0-9]*)$|^[0-9]$)/; // 正整数(可以以0打头)
186 if (value && !r.test(value)) {
187 callback(new Error('请填写大于或等于零整数'));
188 return;
189 }
190 callback();
191 },
192 trigger: "blur",
193 }],
194 })
195 const formInfo = ref({
196 type: "form",
197 title: "",
198 formInfo: {
199 id: "add-set-standard-form",
200 items: formItems.value,
201 rules: formRules.value
202 },
203 })
204 const standardSetDialogInfo: any = ref({
205 visible: false,
206 size: 700,
207 direction: "column",
208 header: {
209 title: "新建",
210 },
211 type: '',
212 contents: [formInfo.value],
213 footer: {
214 visible: true,
215 btns: [
216 { type: "default", label: "取消", value: "cancel" },
217 { type: "primary", label: "确定", value: "submit" },
218 ],
219 },
220 })
221
222 const addStandardSet = () => { 105 const addStandardSet = () => {
223 standardSetDialogInfo.value.visible = true;
224 console.log('addStandardSet'); 106 console.log('addStandardSet');
225 } 107 }
226 108
227 const standardSetDialogBtnClick = (btn: any, info: any) => { 109
228 console.log('standardSetDialogBtnClick', btn, info);
229 if (btn.value === 'submit') {
230 standardSetDialogInfo.value.visible = false;
231 }
232 if (btn.value === 'cancel') {
233 standardSetDialogInfo.value.visible = false;
234 }
235 }
236 110
237 // 右侧上方搜索tab配置 111 // 右侧上方搜索tab配置
238 const searchItemList = ref([ 112 const searchItemList = ref([
...@@ -336,14 +210,11 @@ const toSearch = (val: any, clear: boolean = false) => { ...@@ -336,14 +210,11 @@ const toSearch = (val: any, clear: boolean = false) => {
336 // params.standardSetLevelCode = standardSetLevelCode.value; 210 // params.standardSetLevelCode = standardSetLevelCode.value;
337 // return getTableData(params); 211 // return getTableData(params);
338 }; 212 };
339 const treeSelectNodeChange = (node: any) => {
340 console.log('treeSelectNodeChange', node);
341 const { guid, standardName } = node
342 treeInfo.value.currentNodeKey = guid;
343 console.log('nodeClick', guid, standardName);
344 213
214 const nodeClick = (data: any) => {
215 const { guid, classifyName } = data
345 // 递归tempData找到所有祖先元素的standardName,存入currentPath中 216 // 递归tempData找到所有祖先元素的standardName,存入currentPath中
346 const path = findPath(tempData, guid); 217 const path = findPath(CgDirTreeList.value, guid);
347 if (path) { 218 if (path) {
348 currentPath.value = path; 219 currentPath.value = path;
349 console.log('找到路径:', path); 220 console.log('找到路径:', path);
...@@ -351,31 +222,43 @@ const treeSelectNodeChange = (node: any) => { ...@@ -351,31 +222,43 @@ const treeSelectNodeChange = (node: any) => {
351 console.error('未找到路径'); 222 console.error('未找到路径');
352 } 223 }
353 } 224 }
225 const findPath = (data: any[], targetGuid: string, path: string[] = []) => {
226 for (const item of data) {
227 path.push(item.classifyName); // 添加当前节点名称
228 if (item.guid === targetGuid) {
229 return path; // 找到目标节点,返回路径
230 }
231 if (item.children && item.children.length > 0) {
232 const result = findPath(item.children, targetGuid, path);
233 if (result) return result; // 子节点找到目标节点,返回路径
234 }
235 path.pop(); // 回溯,移除当前节点
236 }
237 return null; // 未找到目标节点
238 };
239
354 240
355 // btns-area 241 // btns-area
356 const checked1 = ref(false); 242 const checked = ref(false);
243 const changeCheck = (val) => {
357 244
245 checked.value = val;
246 getDataBaseTableData();
247 }
358 248
359 //下方表格配置 249 //下方表格配置
360 const tableDataList = ref([{ 250 const tableDataList = ref();
361 fieldStandardCode: '个人基本概况信息', 251 const page = ref({
362 chName: '个人自然信息', 252 limit: 10,
363 enName: '个人信息', 253 curr: 1,
364 dataTypeValue: '规则', 254 sizes: [
365 approveState: 'Y', 255 { label: "10", value: 10 },
366 }, { 256 { label: "20", value: 20 },
367 fieldStandardCode: '个人财产信息', 257 { label: "100", value: 100 },
368 chName: '个人自然信息', 258 { label: "150", value: 150 },
369 enName: '个人信息', 259 { label: "200", value: 200 },
370 dataTypeValue: '规则', 260 ],
371 approveState: 'Y', 261 });
372 }, {
373 fieldStandardCode: '个人健康信息',
374 chName: '个人自然信息',
375 enName: '个人信息',
376 dataTypeValue: '规则',
377 approveState: 'Y',
378 }]);
379 const tableInfo = ref({ 262 const tableInfo = ref({
380 id: "role-manage-table", 263 id: "role-manage-table",
381 multiple: true, 264 multiple: true,
...@@ -384,20 +267,142 @@ const tableInfo = ref({ ...@@ -384,20 +267,142 @@ const tableInfo = ref({
384 { label: "序号", type: "index", width: 56, align: "center" }, 267 { label: "序号", type: "index", width: 56, align: "center" },
385 { label: "字段名", field: "fieldName", width: 140 }, 268 { label: "字段名", field: "fieldName", width: 140 },
386 { label: "分类", field: "classifyName", width: 180 }, 269 { label: "分类", field: "classifyName", width: 180 },
387 { label: "分级", field: "enName", width: 120 }, 270 { label: "分级", field: "gradeDetailName", width: 120 },
388 { label: "标签", field: "labelName", width: 140 }, 271 { label: "标签", field: "label", width: 140 },
389 { label: "规则", field: "rulesName", width: 180 }, 272 { label: "规则", field: "rulesName", width: 180 },
390 { label: "表名", field: "tableName", width: 120, align: 'center' }, 273 { label: "表名", field: "tableName", width: 120, align: 'center' },
391 { label: "表中文名", field: "tableCHName", width: 120, align: 'center' }, 274 { label: "表中文名", field: "tableChName", width: 120, align: 'center' },
392 { label: "数据库名", field: "databaseName", width: 120, align: 'center' }, 275 { label: "数据库名", field: "database", width: 120, align: 'center' },
393 { label: "数据类型", field: "databaseCHName", width: 120, align: 'center' }, 276 { label: "数据类型", field: "databaseChName", width: 120, align: 'center' },
394 277
395 ], 278 ],
396 data: tableDataList.value, 279 data: [],
397 page: { 280 page: {
398 type: "normal", 281 type: "normal",
399 rows: 0, 282 rows: 0,
400 // ...page.value, 283 ...page.value,
284 },
285 actionInfo: {
286 show: false,
287 },
288 loading: false
289 });
290 const tablePageChange = (info) => {
291 console.log('tablePageChange', info);
292 page.value.curr = Number(info.curr);
293 page.value.limit = Number(info.limit);
294 getCgDirFieldPage({
295 pageIndex: info.curr,
296 pageSize: info.limit
297 });
298 }
299
300 // 选中配置的业务规则
301 const selectedRulesData = ref();
302 const tableCheckboxSelectChange = (select, row) => {
303 // 遍历选中的数据,存入selectedRulesData
304 let rulesName: any = [];
305 let rulesGuid: any = [];
306 select.forEach((item: any) => {
307 rulesName.push(item.classifyName);
308 rulesGuid.push(item.guid);
309 });
310 selectedRulesData.value = {
311 rulesName: rulesName.join('、'),
312 guids: rulesGuid
313 };
314 }
315 const tableCheckboxAllSelectChange = (select) => {
316 // 遍历选中的数据,存入selectedRulesData
317 let rulesName: any = [];
318 let rulesGuid: any = [];
319 select.forEach((item: any) => {
320 rulesName.push(item.classifyName);
321 rulesGuid.push(item.guid);
322 });
323 selectedRulesData.value = {
324 rulesName: rulesName.join('、'),
325 guids: rulesGuid
326 };
327 }
328
329 // 批量配置业务规则
330 const batchControlRules = () => {
331 // 判断是否选中数据
332 if (!selectedRulesData.value || !selectedRulesData.value.guids || selectedRulesData.value.guids.length == 0) {
333 proxy.$ElMessage.warning('请选择数据');
334 return;
335 }
336 drawerInfo.value.visible = true;
337 classEditFormItems.value[0].default = selectedRulesData.value.rulesName;
338 }
339
340 // 数据库目录
341 // 左侧tree-list
342 const dataBaseTreeInfo = ref({
343 id: "data-pickup-tree",
344 filter: true,
345 editTreeItem: false,
346 queryValue: "",
347 className: 'tree-list',
348 queryPlaceholder: "输入标准集名称搜索",
349 props: {
350 label: "name",
351 value: "guid",
352 },
353 nodeKey: 'guid',
354 expandedKey: ['0'],
355 currentNodeKey: '',
356 expandOnNodeClick: false,
357 data: [],
358 loading: false
359 });
360
361 const dataBasePage = ref({
362 limit: 10,
363 curr: 1,
364 sizes: [
365 { label: "10", value: 10 },
366 { label: "20", value: 20 },
367 { label: "100", value: 100 },
368 { label: "150", value: 150 },
369 { label: "200", value: 200 },
370 ],
371 });
372
373 const dataBaseTableInfo = ref({
374 id: "data-base-table",
375 multiple: true,
376 fixedSelection: true,
377 fields: [
378 { label: "序号", type: "index", width: 56, align: "center" },
379 { label: "数据源", field: "databaseChName", width: 140 },
380 { label: "表名称", field: "tableChName", width: 180 },
381 { label: "数据库表", field: "enName", width: 120 },
382 {
383 label: "新建方式", field: "foundMode", width: 140, getName: (scope) => {
384 let dataGrade = scope.row.foundMode;
385 return dataGrade == 1 ? '根据文件新建' : '已有表新建';
386 }
387 },
388 {
389 label: "状态", field: "state", type: 'tag', width: 180, getName: (scope) => {
390 let status = scope.row.state;
391 // 0 草稿中 1 已建表 2 已有默认表
392 return status == 0 ? '草稿中' : status == 1 ? '已建表' : '已有默认表';
393 }
394 },
395 { label: "任务修改人", field: "damName", width: 120 },
396 { label: "修改时间", field: "updateTime", width: TableColumnWidth.DATETIME },
397 { label: "描述", field: "databaseName", width: 120, align: 'center' },
398 { label: "规划数据资产", field: "isDataAsset", type: 'switch', activeText: '是', inactiveText: '否', activeValue: 'Y', inactiveValue: 'N', switchWidth: 56, width: 120, align: 'center' },
399
400 ],
401 data: [],
402 page: {
403 type: "normal",
404 rows: 0,
405 ...dataBasePage.value,
401 }, 406 },
402 actionInfo: { 407 actionInfo: {
403 label: "操作", 408 label: "操作",
...@@ -406,22 +411,28 @@ const tableInfo = ref({ ...@@ -406,22 +411,28 @@ const tableInfo = ref({
406 fixed: 'right', 411 fixed: 'right',
407 btns: [ 412 btns: [
408 { 413 {
409 label: "编辑", value: "edit", click: (scope) => { 414 label: "配置业务规则", value: "edit", click: (scope) => {
410 console.log('编辑', scope); 415 console.log('编辑', scope);
411 drawerInfo.value.visible = true 416 // 路由跳转configure-rules
417 router.push({
418 name: 'configure-rules',
419 query: {
420 guid: scope.row.guid,
421 tableChName: scope.row.tableChName,
422 databaseChName: scope.row.databaseChName,
423 databaseGuid: scope.row.databaseGuid,
424 tableGuid: scope.row.guid,
425 }
426 });
427
412 } 428 }
413 }, 429 },
414 430
415 { 431 {
416 label: "复制", value: "copy", click: (scope) => { 432 label: "编辑表结构", value: "copy", click: (scope) => {
417 console.log('复制', scope); 433 console.log('复制', scope);
418 } 434 }
419 },
420 {
421 label: "删除 ", value: "delete", click: (scope) => {
422 console.log('删除', scope);
423 } 435 }
424 },
425 ] 436 ]
426 437
427 }, 438 },
...@@ -429,36 +440,17 @@ const tableInfo = ref({ ...@@ -429,36 +440,17 @@ const tableInfo = ref({
429 }); 440 });
430 441
431 442
432 const nodeClick = (data: any) => {
433 const { guid, standardName } = data
434 console.log('nodeClick', guid, standardName);
435 searchItemList.value[0].default = standardName;
436 // 递归tempData找到所有祖先元素的standardName,存入currentPath中
437 const path = findPath(tempData, guid);
438 if (path) {
439 currentPath.value = path;
440 console.log('找到路径:', path);
441 } else {
442 console.error('未找到路径');
443 }
444 443
445 }
446 const findPath = (data: any[], targetGuid: string, path: string[] = []) => {
447 for (const item of data) {
448 path.push(item.standardName); // 添加当前节点名称
449 if (item.guid === targetGuid) {
450 return path; // 找到目标节点,返回路径
451 }
452 if (item.children && item.children.length > 0) {
453 const result = findPath(item.children, targetGuid, path);
454 if (result) return result; // 子节点找到目标节点,返回路径
455 }
456 path.pop(); // 回溯,移除当前节点
457 }
458 return null; // 未找到目标节点
459 };
460 444
461 445
446 // 映射 大于,小于,等于 三种关系
447 const selectLength = ref([
448 { label: '大于', value: '>', },
449 { label: '小于', value: '<', },
450 { label: '等于', value: '=', },
451 ]
452 )
453
462 const classEditFormItems = ref([{ 454 const classEditFormItems = ref([{
463 label: '已选字段', 455 label: '已选字段',
464 type: 'input', 456 type: 'input',
...@@ -468,14 +460,14 @@ const classEditFormItems = ref([{ ...@@ -468,14 +460,14 @@ const classEditFormItems = ref([{
468 default: '', 460 default: '',
469 clearable: true, 461 clearable: true,
470 required: true, 462 required: true,
471 block: true 463 block: true,
464 disabled: true,
472 }, { 465 }, {
473 label: '长度', 466 label: '长度',
474 type: 'input', 467 type: 'select',
475 placeholder: '请选择', 468 placeholder: '请选择',
476 field: 'orderNum', 469 field: 'orderNumLength',
477 maxlength: 6, 470 options: selectLength.value,
478 regexp: /\D/g,
479 required: true, 471 required: true,
480 clearable: true, 472 clearable: true,
481 }, 473 },
...@@ -494,31 +486,21 @@ const classEditFormItems = ref([{ ...@@ -494,31 +486,21 @@ const classEditFormItems = ref([{
494 label: '精度', 486 label: '精度',
495 type: 'input', 487 type: 'input',
496 placeholder: '请选择', 488 placeholder: '请选择',
497 field: 'orderNum', 489 field: 'fieldPrecision',
498 maxlength: 6,
499 regexp: /\D/g,
500 required: true,
501 clearable: true,
502 },
503 {
504 label: '',
505 type: 'input',
506 placeholder: '请输入',
507 field: 'orderNum',
508 maxlength: 6, 490 maxlength: 6,
509 regexp: /\D/g, 491 regexp: /\D/g,
510 required: true, 492 required: true,
511 clearable: true, 493 clearable: true,
512 col: 'numberClass', 494 block: true,
513 }, { 495 }, {
514 label: '关联字典', 496 label: '关联字典',
515 field: 'parentGuid', 497 field: 'dictionaryGuid',
516 type: 'select', 498 type: 'select',
517 placeholder: '请选择', 499 placeholder: '请选择',
518 default: '', 500 default: '',
519 options: [], 501 options: [],
520 props: { 502 props: {
521 label: "classifyName", 503 label: "chName",
522 value: "guid", 504 value: "guid",
523 }, 505 },
524 filterable: true, 506 filterable: true,
...@@ -529,7 +511,7 @@ const classEditFormItems = ref([{ ...@@ -529,7 +511,7 @@ const classEditFormItems = ref([{
529 label: '字段取值范围', 511 label: '字段取值范围',
530 type: 'input-group', 512 type: 'input-group',
531 placeholder: '请输入', 513 placeholder: '请输入',
532 field: 'numberAround', 514 field: 'fieldValueRange',
533 default: '', 515 default: '',
534 children: [ 516 children: [
535 { 517 {
...@@ -555,26 +537,31 @@ const classEditFormItems = ref([{ ...@@ -555,26 +537,31 @@ const classEditFormItems = ref([{
555 { 537 {
556 label: '数据是否唯一', 538 label: '数据是否唯一',
557 type: "radio-group", 539 type: "radio-group",
558 field: "radioField", 540 field: "isUnique",
559 disabled: false, 541 disabled: false,
542 default: 'N',
560 options: [ 543 options: [
561 { label: "选项一", value: "option1", disabled: false }, 544 { label: "是", value: "Y", disabled: false },
562 { label: "选项二", value: "option2", disabled: false }, 545 { label: "否", value: "N", disabled: false },
563 ], 546 ],
564 }, 547 },
565 { 548 {
566 label: '是否必填', 549 label: '是否必填',
567 type: "radio-group", 550 type: "radio-group",
568 field: "radioField", 551 field: "isNotNull",
569 disabled: false, 552 disabled: false,
553 default: 'N',
570 options: [ 554 options: [
571 { label: "选项一", value: "option1", disabled: false }, 555 { label: "是", value: "Y", disabled: false },
572 { label: "选项二", value: "option2", disabled: false }, 556 { label: "否", value: "N", disabled: false },
573 ], 557 ],
574 } 558 }
575 ]); 559 ]);
576 const classEditFormRules = ref({ 560 const classEditFormRules = ref({
577 classifyName: [{ required: true, message: '请填写分类名称', trigger: 'blur' }], 561 classifyName: [{ required: true, message: '请填写分类名称', trigger: 'blur' }],
562 orderNumLength: [{ required: true, message: '请选择长度', trigger: 'blur' }],
563 orderNum: [{ required: true, message: '请填写长度', trigger: 'blur' }],
564 fieldPrecision: [{ required: true, message: '请填写精度', trigger: 'blur' }],
578 }); 565 });
579 /** 新增分类的form */ 566 /** 新增分类的form */
580 const classEditFormInfo = ref({ 567 const classEditFormInfo = ref({
...@@ -611,71 +598,145 @@ const drawerBtnClick = async (btn, info) => { ...@@ -611,71 +598,145 @@ const drawerBtnClick = async (btn, info) => {
611 if (btn.value == 'cancel') { 598 if (btn.value == 'cancel') {
612 drawerInfo.value.visible = false; 599 drawerInfo.value.visible = false;
613 } else { 600 } else {
614 // if (drawerInfo.value.header.title == '添加分类') { 601 btn.loading = true;
615 // const params = { 602 const { orderNumLength, orderNum, numberStart, numberEnd, fieldPrecision, dictionaryGuid, isUnique, isNotNull } = info;
616 // ...info, 603 let fieldLengthCondition = orderNumLength + '#' + orderNum;
617 // classifyGradeGuid: router.currentRoute.value.query.guid, 604 let fieldValueRange: any = [];
618 // } 605 if (numberStart && numberEnd) {
619 // const res: any = await saveClassify(params); 606 if (numberEnd < numberStart) {
620 // if (res.code == proxy.$passCode) { 607 proxy.$ElMessage.error('字段取值范围结束值不能小于开始值');
621 // proxy.$ElMessage.success('添加成功!'); 608 return;
622 // drawerInfo.value.visible = false; 609 }
623 // getTreeListData(); 610 fieldValueRange = [numberStart, numberEnd];
624 // } else { 611 }
625 // proxy.$ElMessage.error(res.msg); 612 const params = {
626 // } 613 fieldPrecision,
627 // } else { 614 dictionaryGuid,
628 // // 编辑分类 615 isUnique,
629 // const params = { 616 isNotNull,
630 // ...info, 617 fieldLengthCondition,
631 // classifyGradeGuid: router.currentRoute.value.query.guid, 618 fieldValueRange,
632 // guid: currTableInfo.value.guid 619 fieldGuid: selectedRulesData.value.guids
633 // } 620 }
634 // const res: any = await updateClassify(params); 621 const res: any = await saveBizRuleConfig(params);
635 // if (res.code == proxy.$passCode) { 622 if (res.code == proxy.$passCode) {
636 // proxy.$ElMessage.success('修改成功!'); 623 btn.loading = false;
637 // drawerInfo.value.visible = false; 624 proxy.$ElMessage.success('配置成功!');
638 // getTreeListData(); 625 drawerInfo.value.visible = false;
639 // } else { 626 getCgDirFieldPage();
640 // proxy.$ElMessage.error(res.msg); 627 } else {
641 // } 628 proxy.$ElMessage.error(res.msg);
642 // } 629 }
643 console.log('aaa') 630
631
644 } 632 }
645 } 633 }
646 634
647 const handleTreeItemMenuClick = (data: any, type) => { 635 const handleTreeItemMenuClick = (data: any, type) => {
648 console.log('handleTreeItemMenuClick', data, type); 636 console.log('handleTreeItemMenuClick', data, type);
649 } 637 }
650 const getItemStyle = (status: string) => {
651 const styles: { [key: string]: any } = {
652 published: {
653 color: '#1BA854',
654 background: '#F2FFF5',
655 border: '1px solid rgba(109, 209, 142, 1)',
656 },
657 running: {
658 color: '#FF991C',
659 background: '#FFFBF2',
660 border: '1px solid rgba(255, 203, 120, 1)',
661 },
662 pending: {
663 border: '1px solid rgba(217, 217, 217, 1)',
664 color: '#404040',
665 background: '#F5F5F5',
666 },
667 };
668 638
669 return styles[status] || {}; // 如果状态没有对应的样式,则返回空对象
670 }
671 639
672 640
641 // tab切换
673 const activeName = ref('first'); 642 const activeName = ref('first');
674 const handleClick = (tab: any) => { 643 const handleClick = (tab: any) => {
675 console.log(tab.props.name); 644 console.log(tab.props.name);
676 activeName.value = tab.props.name; 645 activeName.value = tab.props.name;
646 if (tab.props.name === 'second') {
647 getDataBaseTreeData();
648 getDataBaseTableData();
649 }
650 }
651
652 // 获取数据库树形列表 getDbDirTreeList
653 const dataBaseTreeData = ref<any>();
654 const getDataBaseTreeData = async () => {
655 dataBaseTreeInfo.value.loading = true;
656 try {
657 const res: any = await getDbDirTreeList({});
658 if (res.code == proxy.$passCode) {
659 res.data.forEach(addGuids);
660 dataBaseTreeData.value = res.data;
661 dataBaseTreeInfo.value.data = res.data;
662 } else {
663 proxy.$ElMessage.error(res.msg);
664 }
665 } catch (error) {
666 proxy.$ElMessage.error('请求失败');
667 } finally {
668 dataBaseTreeInfo.value.loading = false;
669 }
670 };
671
672 // 递归添加 GUID 的函数
673 const addGuids = (node) => {
674 if (node.databaseGuid) {
675 node.guid = node.databaseGuid;
676 node.name = node.databaseChName;
677 } else if (node.tableGuid) {
678 node.guid = node.tableGuid;
679 node.name = node.tableChName;
680 } else {
681 node.guid = crypto.randomUUID();
682 node.name = node.cgDirName;
683 }
684
685 if (node.children && Array.isArray(node.children)) {
686 node.children.forEach(addGuids);
687 }
688 };
689
690 // 获取数据列表
691 const dataBaseTableDataList = ref<any>();
692 const getDataBaseTableData = async (params = {}) => {
693 dataBaseTableInfo.value.loading = true;
694 const dataBaseParams = {
695 pageIndex: 1,
696 pageSize: 10,
697 databaseGuid: "",
698 isDataAsset: checked.value ? 'Y' : 'N',
699 };
700 const finalParams = { ...dataBaseParams, ...params };
701
702 const res: any = await getDbDirTablePageList(finalParams);
703 if (res.code == proxy.$passCode) {
704 dataBaseTableDataList.value = res.data.records;
705 dataBaseTableInfo.value.page.rows = res.data.totalRows;
706 dataBaseTableInfo.value.data = res.data.records;
707 dataBasePage.value.limit = res.data.pageSize
708 dataBasePage.value.curr = res.data.pageIndex
709 } else {
710 proxy.$ElMessage.error(res.msg);
711 }
712 dataBaseTableInfo.value.loading = false;
713 };
714
715 const dataBaseTablePageChange = (info) => {
716 console.log('dataBaseTablePageChange', info);
717 dataBasePage.value.curr = Number(info.curr);
718 dataBasePage.value.limit = Number(info.limit);
719 getDataBaseTableData({
720 pageIndex: info.curr,
721 pageSize: info.limit
722 });
677 } 723 }
678 724
725
726 const showTableOrDatabase = ref(true);
727 const dataBasenodeClick = (data: any) => {
728 console.log('dataBasenodeClick', data);
729 if (data.databaseGuid || data.cgDirName) {
730 showTableOrDatabase.value = true;
731 return;
732 }
733 if (data.tableGuid) {
734 showTableOrDatabase.value = false;
735 return;
736 }
737 }
738
739
679 const handleSubjectTableCommand = (command: string) => { 740 const handleSubjectTableCommand = (command: string) => {
680 console.log('handleSubjectTableCommand', command); 741 console.log('handleSubjectTableCommand', command);
681 } 742 }
...@@ -691,13 +752,20 @@ const addIsShowDatabaseTip = () => { ...@@ -691,13 +752,20 @@ const addIsShowDatabaseTip = () => {
691 isShowDatabaseTip.value = false; 752 isShowDatabaseTip.value = false;
692 } 753 }
693 754
755 // 表信息和字段信息切换
756 const activeTab = ref('table');
757
758 const setActiveTab = (tab) => {
759 console.log('setActiveTab', tab);
760 activeTab.value = tab;
761 };
762
694 </script> 763 </script>
695 764
696 <template> 765 <template>
697 <div class="classification-template-content"> 766 <div class="classification-template-content">
698 <div class="v-table-tools"> 767 <div class="v-table-tools">
699 <TableTools :searchItems="searchItemList" :init="false" :searchId="'files-standard-search'" @search="toSearch" 768 <TableTools :searchItems="searchItemList" :init="false" :searchId="'files-standard-search'" @search="toSearch" />
700 @treeSelectNodeChange="treeSelectNodeChange" />
701 </div> 769 </div>
702 <div class="container_wrap full flex"> 770 <div class="container_wrap full flex">
703 <div class="aside_wrap"> 771 <div class="aside_wrap">
...@@ -705,7 +773,9 @@ const addIsShowDatabaseTip = () => { ...@@ -705,7 +773,9 @@ const addIsShowDatabaseTip = () => {
705 <el-tab-pane label="分类分级目录" name="first"> 773 <el-tab-pane label="分类分级目录" name="first">
706 <Tree :treeInfo="treeInfo" @nodeClick="nodeClick" @itemMenuClick="handleTreeItemMenuClick" /> 774 <Tree :treeInfo="treeInfo" @nodeClick="nodeClick" @itemMenuClick="handleTreeItemMenuClick" />
707 </el-tab-pane> 775 </el-tab-pane>
708 <el-tab-pane label="数据库目录" name="second">Config</el-tab-pane> 776 <el-tab-pane label="数据库目录" name="second">
777 <Tree :treeInfo="dataBaseTreeInfo" @nodeClick="dataBasenodeClick" />
778 </el-tab-pane>
709 </el-tabs> 779 </el-tabs>
710 </div> 780 </div>
711 <div class="main_wrap" v-if="activeName === 'first'"> 781 <div class="main_wrap" v-if="activeName === 'first'">
...@@ -732,11 +802,13 @@ const addIsShowDatabaseTip = () => { ...@@ -732,11 +802,13 @@ const addIsShowDatabaseTip = () => {
732 <div class="left-btns"> 802 <div class="left-btns">
733 <el-button type="primary" @click="addStandardSet">查看已生产报告</el-button> 803 <el-button type="primary" @click="addStandardSet">查看已生产报告</el-button>
734 <el-button>导出</el-button> 804 <el-button>导出</el-button>
735 <el-button>批量配置业务规则</el-button> 805 <el-button @click="batchControlRules">批量配置业务规则</el-button>
736 </div> 806 </div>
737 </div> 807 </div>
738 <div class="table_panel_wrap"> 808 <div class="table_panel_wrap">
739 <Table :tableInfo="tableInfo" /> 809 <Table :tableInfo="tableInfo" @tablePageChange="tablePageChange"
810 @tableCheckboxSelectChange="tableCheckboxSelectChange"
811 @tableCheckboxAllSelectChange="tableCheckboxAllSelectChange" />
740 </div> 812 </div>
741 </div> 813 </div>
742 814
...@@ -755,6 +827,17 @@ const addIsShowDatabaseTip = () => { ...@@ -755,6 +827,17 @@ const addIsShowDatabaseTip = () => {
755 </el-button> 827 </el-button>
756 </div> 828 </div>
757 <div>全部</div> 829 <div>全部</div>
830 <div class="tab-btn">
831 内容信息:
832 <div v-if="showTableOrDatabase" class="table" :class="{ active: activeTab === 'table' }"
833 @click="setActiveTab('table')">
834 表信息
835 </div>
836 <div class="word" :class="{ active: activeTab === 'word' || !showTableOrDatabase }"
837 @click="setActiveTab('word')">
838 字段信息
839 </div>
840 </div>
758 <div class="btns-area"> 841 <div class="btns-area">
759 <div class="left-btns"> 842 <div class="left-btns">
760 <div class="dropdown_btn"> 843 <div class="dropdown_btn">
...@@ -792,15 +875,13 @@ const addIsShowDatabaseTip = () => { ...@@ -792,15 +875,13 @@ const addIsShowDatabaseTip = () => {
792 <el-button>查看质量规则</el-button> 875 <el-button>查看质量规则</el-button>
793 </div> 876 </div>
794 <div class="right-btns"> 877 <div class="right-btns">
795 <el-checkbox v-model="checked1" label="仅看规划数据资产表" size="large" /> 878 <el-checkbox v-model="checked" label="仅看规划数据资产表" size="large" @change="changeCheck" />
796 </div> 879 </div>
797 </div> 880 </div>
798 <div class="table_panel_wrap_database"> 881 <div class="table_panel_wrap_database">
799 <Table :tableInfo="tableInfo" /> 882 <Table :tableInfo="dataBaseTableInfo" @tablePageChange="dataBaseTablePageChange" />
800 </div> 883 </div>
801 </div> 884 </div>
802
803 <Dialog :dialogInfo="standardSetDialogInfo" @btnClick="standardSetDialogBtnClick" />
804 <Drawer :drawerInfo="drawerInfo" @drawerBtnClick="drawerBtnClick" class="v-drawer" /> 885 <Drawer :drawerInfo="drawerInfo" @drawerBtnClick="drawerBtnClick" class="v-drawer" />
805 886
806 </div> 887 </div>
...@@ -830,6 +911,17 @@ const addIsShowDatabaseTip = () => { ...@@ -830,6 +911,17 @@ const addIsShowDatabaseTip = () => {
830 border-right: 1px solid #d9d9d9; 911 border-right: 1px solid #d9d9d9;
831 box-shadow: none; 912 box-shadow: none;
832 913
914 .v-tabs {
915 height: 100%;
916
917 .el-tabs__content {
918 height: 100%;
919
920 .el-tab-pane {
921 height: 100%;
922 }
923 }
924
833 :deep(.v-tabs) { 925 :deep(.v-tabs) {
834 .el-tabs__item { 926 .el-tabs__item {
835 padding: 0 10px; 927 padding: 0 10px;
...@@ -842,11 +934,11 @@ const addIsShowDatabaseTip = () => { ...@@ -842,11 +934,11 @@ const addIsShowDatabaseTip = () => {
842 934
843 :deep(.el-tree) { 935 :deep(.el-tree) {
844 margin: 0; 936 margin: 0;
845 height: calc(100% - 68px); 937 height: calc(100% - 115px);
846 overflow: hidden auto; 938 overflow: hidden auto;
847 } 939 }
848 } 940 }
849 941 }
850 } 942 }
851 943
852 .main_wrap { 944 .main_wrap {
...@@ -915,17 +1007,59 @@ const addIsShowDatabaseTip = () => { ...@@ -915,17 +1007,59 @@ const addIsShowDatabaseTip = () => {
915 1007
916 .table_panel_wrap { 1008 .table_panel_wrap {
917 width: 100%; 1009 width: 100%;
918 height: calc(100% - 113px); 1010 height: calc(100% - 175px);
919 min-height: 210px; 1011 min-height: 210px;
920 overflow: visible; 1012 overflow: visible;
921 } 1013 }
922 1014
923 .table_panel_wrap_database { 1015 .table_panel_wrap_database {
924 width: 100%; 1016 width: 100%;
925 height: calc(100% - 113px); 1017 height: calc(100% - 215px);
926 min-height: 210px; 1018 min-height: 210px;
927 overflow: visible; 1019 overflow: visible;
928 } 1020 }
1021
1022 /* 外层容器 */
1023 .tab-btn {
1024 display: flex;
1025 align-items: center;
1026 font-size: 14px;
1027 margin-top: 6px;
1028 margin-bottom: 6px;
1029 }
1030
1031 /* Tab 按钮样式 */
1032 .tab-btn div {
1033 padding: 4px 12px;
1034 cursor: pointer;
1035 border: 1px solid #ccc;
1036
1037 background-color: #f7f7f7;
1038 transition: background-color 0.3s ease, color 0.3s ease;
1039 }
1040
1041 .tab-btn .table {
1042 border-top-left-radius: 2px;
1043 border-bottom-left-radius: 2px;
1044 }
1045
1046 .tab-btn .word {
1047 border-top-right-radius: 2px;
1048 border-bottom-right-radius: 2px;
1049 }
1050
1051
1052 /* 默认未选中样式 */
1053 .tab-btn div:not(.active):hover {
1054 background-color: #e0e0e0;
1055 }
1056
1057 /* 选中样式 */
1058 .tab-btn .active {
1059 background-color: #4FA1A4;
1060 color: white;
1061 border-color: #4FA1A4;
1062 }
929 } 1063 }
930 } 1064 }
931 1065
...@@ -954,7 +1088,7 @@ const addIsShowDatabaseTip = () => { ...@@ -954,7 +1088,7 @@ const addIsShowDatabaseTip = () => {
954 1088
955 :deep(.v-drawer) { 1089 :deep(.v-drawer) {
956 .numberClass { 1090 .numberClass {
957 margin-top: 12px; 1091 margin-top: 10px;
958 } 1092 }
959 } 1093 }
960 } 1094 }
......
1 <route lang="yaml">
2 name: configureRules //标签管理
3 </route>
4
5 <script lang="ts" setup name="configureRules"></script>
6
7
8 <template>
9 <div>111</div>
10 </template>
...@@ -7,7 +7,7 @@ import TableTools from '@/components/Tools/table_tools.vue'; ...@@ -7,7 +7,7 @@ import TableTools from '@/components/Tools/table_tools.vue';
7 import { getGradeList } from "@/api/modules/dataInventory"; 7 import { getGradeList } from "@/api/modules/dataInventory";
8 import { getLabelList, getClassifyGradeTreeList, saveLabel, getLabelPageList, deleteLabel, updateLabel } from "@/api/modules/dataLabel"; 8 import { getLabelList, getClassifyGradeTreeList, saveLabel, getLabelPageList, deleteLabel, updateLabel } from "@/api/modules/dataLabel";
9 import { CirclePlus, Delete } from "@element-plus/icons-vue"; 9 import { CirclePlus, Delete } from "@element-plus/icons-vue";
10 import { el, tr } from 'element-plus/es/locale'; 10
11 11
12 const { proxy } = getCurrentInstance() as any; 12 const { proxy } = getCurrentInstance() as any;
13 const dialogLabelFormRef = ref(); 13 const dialogLabelFormRef = ref();
...@@ -560,7 +560,6 @@ const searchClass = async (val: any, clear: boolean = false) => { ...@@ -560,7 +560,6 @@ const searchClass = async (val: any, clear: boolean = false) => {
560 return; 560 return;
561 } 561 }
562 if (val?.labelName?.length !== 0) { 562 if (val?.labelName?.length !== 0) {
563 console.log('调用了吗');
564 tableInfo.value.loading = true; 563 tableInfo.value.loading = true;
565 const params = { 564 const params = {
566 pageIndex: page.value.curr, 565 pageIndex: page.value.curr,
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!