d8c0a524 by xukangle

Merge branch 'develop' into dev_20241202_xukangle

2 parents 3dc89fb7 f9834367
...@@ -288,8 +288,8 @@ const getMsgCnt = () => { ...@@ -288,8 +288,8 @@ const getMsgCnt = () => {
288 } 288 }
289 289
290 onMounted(() => { 290 onMounted(() => {
291 getMsgCnt(); 291 //getMsgCnt();
292 createServerConnect(); 292 //createServerConnect();
293 }); 293 });
294 294
295 </script> 295 </script>
......
...@@ -24,6 +24,27 @@ const routes: RouteRecordRaw[] = [ ...@@ -24,6 +24,27 @@ const routes: RouteRecordRaw[] = [
24 }, 24 },
25 }, 25 },
26 { 26 {
27 path: 'task-edit',
28 name: 'taskEdit',
29 component: () => import('@/views/data_inventory/taskEdit.vue'),
30 meta: {
31 title: '编辑-',
32 sidebar: false,
33 breadcrumb: false,
34 cache: true,
35 reuse: true,
36 editPage: true,
37 activeMenu: '/data-inventory/classify-grade-manage/template-config'
38 },
39 beforeEnter: (to, from) => {
40 if (to.query.name) {
41 to.meta.title = `编辑-${to.query.name}`;
42 } else {
43 to.meta.title = '分类分级任务-新增';
44 }
45 }
46 },
47 {
27 path: 'template-config', 48 path: 'template-config',
28 name: 'templateConfig', 49 name: 'templateConfig',
29 component: () => import('@/views/data_inventory/templateConfig.vue'), 50 component: () => import('@/views/data_inventory/templateConfig.vue'),
......
...@@ -31,6 +31,7 @@ service.interceptors.request.use( ...@@ -31,6 +31,7 @@ service.interceptors.request.use(
31 * 为每一次请求生成一个cancleToken 31 * 为每一次请求生成一个cancleToken
32 */ 32 */
33 const source = axios.CancelToken.source(); 33 const source = axios.CancelToken.source();
34 config.headers.tenant = '6646dcad76c411eea911fa163e419da9'; //会员guid先写死
34 config.cancelToken = source.token; 35 config.cancelToken = source.token;
35 if (config.method === "postfile") { 36 if (config.method === "postfile") {
36 config.method = "post"; 37 config.method = "post";
......
...@@ -3,14 +3,243 @@ ...@@ -3,14 +3,243 @@
3 </route> 3 </route>
4 4
5 <script lang="ts" setup name="taskConfig"> 5 <script lang="ts" setup name="taskConfig">
6 import { ref ,onMounted} from "vue"; 6 import { ref, onMounted } from "vue";
7 import { useRouter, useRoute } from "vue-router";
8 import useUserStore from "@/store/modules/user";
9 import { ElMessage, ElMessageBox } from "element-plus";
10
11 import useDataAssetStore from "@/store/modules/dataAsset";
12 import { getListingList, listingDelete, listingUpdateStatus, filterVal, getParamsDataList } from "@/api/modules/dataProduct";
13 import { TableColumnWidth } from '@/utils/enum';
14
15 import Table from "@/components/Table/index.vue";
16
17 const { proxy } = getCurrentInstance() as any;
18 const router = useRouter();
19 const userStore = useUserStore();
20 const userData = JSON.parse(userStore.userData);
21 const assetStore = useDataAssetStore();
22 const page = ref({
23 limit: 50,
24 curr: 1,
25 sizes: [
26 { label: "10", value: 10 },
27 { label: "50", value: 50 },
28 { label: "100", value: 100 },
29 { label: "150", value: 150 },
30 { label: "200", value: 200 },
31 ],
32 });
33 const searchItemValue: any = ref({});
34 const currTableData: any = ref({});
35 const tableInfo = ref({
36 id: "mapping-table",
37 fields: [
38 { label: "序号", type: "index", width: 56, align: "center", fixed: "left" },
39 { label: "任务名称", field: "damCode", width: 96 },
40 { label: "目录名称", field: "damName", width: 120 },
41 { label: "分类分级模板", field: "damTypeName", width: 200 },
42 { label: "元数据", field: "damTypeName", width: 200 },
43 // {
44 // label: "是否公共数据", field: "isPublicData", width: 120, getName: (scope) => {
45 // return scope.row.isPublicData == 'Y' ? '是' : '否';
46 // }
47 // },
48 {
49 label: "执行状态", field: "approveState", width: TableColumnWidth.STATE, align: 'center', type: "tag", getName: (scope) => {
50 return filterVal(scope.row.approveState, 'approveState');
51 }
52 },
53 { label: "任务修改人", field: "damName", width: 120 },
54 { label: "修改时间", field: "updateTime", width: TableColumnWidth.DATETIME },
55 { label: "确认次数", field: "damName", width: 96, align: 'right' },
56 { label: "结果确认人", field: "damName", width: 120 },
57 { label: "确认时间", field: "updateTime", width: TableColumnWidth.DATETIME },
58 {
59 label: "结果状态", field: "approveState", width: TableColumnWidth.STATE, align: 'center', type: "tag", getName: (scope) => {
60 return filterVal(scope.row.approveState, 'approveState');
61 }
62 },
63 ],
64 loading: false,
65 data: [],
66 page: {
67 type: "normal",
68 rows: 0,
69 ...page.value,
70 },
71 actionInfo: {
72 label: "操作",
73 type: "btn",
74 width: 200,
75 btns: (scope) => {
76 let row = scope.row, btnArr: any = [];
77 if (row.approveState == 'Y') {
78 if (row.listingStatus == 'Y') {
79 btnArr.splice(0, 0, { label: "详情", value: "detail" });
80 } else {
81 btnArr.splice(0, 0, { label: "编辑", value: "edit" }, { label: "详情", value: "detail" }, { label: "删除", value: "delete" });
82 }
83 } else {
84 if (row.approveState == 'A') {
85 btnArr.splice(0, 0, { label: "详情", value: "detail" });
86 } else {
87 btnArr.splice(0, 0, { label: "编辑", value: "edit" }, { label: "详情", value: "detail" }, { label: "删除", value: "delete" });
88 }
89 }
90 return btnArr;
91 },
92 },
93 });
94
95 const getTableData = () => {
96 tableInfo.value.loading = true;
97 getListingList(
98 Object.assign({}, searchItemValue.value, {
99 pageIndex: page.value.curr,
100 pageSize: page.value.limit,
101 })
102 ).then((res: any) => {
103 tableInfo.value.loading = false;
104 tableInfo.value.data = res.data.records || [];
105 tableInfo.value.page.curr = res.data.pageIndex;
106 tableInfo.value.page.limit = res.data.pageSize;
107 tableInfo.value.page.rows = res.data.totalRows;
108 })
109 .catch((res) => {
110 tableInfo.value.loading = false;
111 });
112 };
113
114 const tableBtnClick = (scope, btn) => {
115 const type = btn.value;
116 const row = scope.row;
117 currTableData.value = row;
118 if (type == "detail" || type === "edit") {
119 toPath(type);
120 } else if (type === "delete") {
121 open("此操作将永久删除,是否继续?", "warning");
122 }
123 };
124
125 const toPath = (type) => {
126 if (type == 'add') {
127 router.push({
128 name: "taskEdit",
129 query: {
130 type
131 },
132 });
133 } else {
134 router.push({
135 name: "taskEdit",
136 query: {
137 guid: currTableData.value.guid,
138 name: currTableData.value.damName,
139 type
140 },
141 });
142 }
143 }
144
145 const tablePageChange = (info) => {
146 page.value.curr = Number(info.curr);
147 page.value.limit = Number(info.limit);
148 tableInfo.value.page.limit = page.value.limit;
149 tableInfo.value.page.curr = page.value.curr;
150 getTableData();
151 };
152
153 const open = (msg, type, isBatch = false) => {
154 ElMessageBox.confirm(msg, "提示", {
155 confirmButtonText: "确定",
156 cancelButtonText: "取消",
157 type: type,
158 }).then(() => {
159 const guids = [currTableData.value.guid];
160 listingDelete(guids).then((res: any) => {
161 if (res.code == proxy.$passCode) {
162 getFirstPageData();
163 ElMessage({
164 type: "success",
165 message: "删除成功",
166 });
167 } else {
168 ElMessage({
169 type: "error",
170 message: res.msg,
171 });
172 }
173 }).catch((res) => {
174 tableInfo.value.loading = false;
175 });
176 });
177 };
178
179 const getFirstPageData = () => {
180 page.value.curr = 1
181 tableInfo.value.page.curr = 1;
182 getTableData();
183 }
184
185 onActivated(() => {
186 if (assetStore.isRefresh) {//如果是首次加载,则不需要调用
187 getFirstPageData();
188 assetStore.set(false);
189 }
190 })
191
192 onBeforeMount(() => {
193
194 })
7 195
8 </script> 196 </script>
9 197
10 <template> 198 <template>
11 <div>分类分级任务</div> 199 <div class="container_wrap" v-if="tableInfo.data.length">
200 <div class="table_tool_wrap">
201 <div class="table_title">分类分级任务</div>
202 </div>
203 <div class="table_panel_wrap">
204 <Table :tableInfo="tableInfo" @tableBtnClick="tableBtnClick" @tablePageChange="tablePageChange" />
205 </div>
206 </div>
207 <div class="container_wrap" v-else>
208 <div class="card-noData">
209 <img src="@/assets/images/no-data.png" :style="{ width: '96px', height: '96px' }" />
210 <p>暂无分类分级任务,<span class="text_btn" @click="toPath('add')">去新建</span></p>
211 </div>
212 </div>
12 </template> 213 </template>
13 214
14 <style lang="scss" scoped> 215 <style scoped lang="scss">
216 .table_tool_wrap {
217 width: 100%;
218 height: 40px !important;
219 padding: 0 8px;
220
221 .table_title {
222 height: 40px;
223 line-height: 40px;
224 font-weight: 600;
225 font-size: 16px;
226 color: #212121;
227 }
228 }
229
230 .table_panel_wrap {
231 width: 100%;
232 height: calc(100% - 40px);
233 padding: 0px 8px 0;
234 }
15 235
236 .card-noData {
237 position: absolute;
238 top: 50%;
239 left: 50%;
240 transform: translate(-50%, -50%);
241 display: flex;
242 flex-direction: column;
243 align-items: center;
244 }
16 </style> 245 </style>
......
1 <route lang="yaml">
2 name: taskEdit //分类分级任务编辑
3 </route>
4
5 <script lang="ts" setup name="taskEdit">
6 import { ref, onMounted } from "vue";
7 import { useRouter, useRoute } from "vue-router";
8 import useUserStore from "@/store/modules/user";
9 import { ElMessage, ElMessageBox } from "element-plus";
10 import { Search } from "@element-plus/icons-vue";
11 import useDataAssetStore from "@/store/modules/dataAsset";
12 import { getListingList, listingDelete, listingUpdateStatus, filterVal, getParamsDataList } from "@/api/modules/dataProduct";
13 import { TableColumnWidth } from '@/utils/enum';
14
15 import Table from "@/components/Table/index.vue";
16
17 const { proxy } = getCurrentInstance() as any;
18 const router = useRouter();
19 const userStore = useUserStore();
20 const userData = JSON.parse(userStore.userData);
21 const assetStore = useDataAssetStore();
22
23 const step = ref(0);
24 const selectIndex = ref(0);
25 const asideSearchInput = ref("");
26 const permissionList: any = ref([])
27 const listLoading = ref(false)
28 const listPage = ref({
29 limit: 50,
30 curr: 1,
31 totalPages: 0
32 })
33 const currpermissionList: any = ref([
34 {
35 "guid": "62d01ad586774db2bb3955dfb2d18366",
36 "productGuid": null,
37 "productName": null,
38 "dataPermissionName": "当前用户",
39 "bizState": "Y",
40 "createUserName": "数往知来管理员",
41 "createTime": "2024-01-24 14:08:43",
42 "sqlScript": null,
43 "dataSourceGuid": null
44 },
45 {
46 "guid": "d68a27c1998540a2b8e8f22a2d5eebef",
47 "productGuid": null,
48 "productName": null,
49 "dataPermissionName": "组织权限",
50 "bizState": "Y",
51 "createUserName": "数往知来管理员",
52 "createTime": "2024-01-24 11:47:02",
53 "sqlScript": null,
54 "dataSourceGuid": null
55 }
56 ])
57 const templateInfo = ref({
58 title: '医疗数据分类分级模板',
59 descGroup: [
60 { label: '模型确认人', value: '管理员 ' },
61 { label: '模型确认时间', value: '2021-12-12 09:12:13' },
62 ],
63 tags: [
64 { type: 'info', name: '医疗行业分类' },
65 { type: 'success', name: '五级' },
66 { type: 'primary', name: 'V5' },
67 ],
68 desc: '适用于各级医疗机构、卫生健康管理部门、公共卫生服务机构、相关专项业务服务机构、相关信息技术服务机构等开展医疗健康数据分类分级。适用于各级医疗机构、卫生健康管理部门、公共卫生服务机构、相关专项业务服务机构、相关信息技术服务机构等开展医疗健康数据分类分级。适用于各级医疗机构、卫生健康。'
69 })
70 const treeIndex: any = ref({})
71
72 const treeInfo = ref({
73 id: "data-pickup-tree",
74 filter: true,
75 queryValue: "",
76 queryPlaceholder: "输入组织名称搜索",
77 props: {
78 label: "organisationName",
79 value: "guid",
80 },
81 nodeKey: 'guid',
82 expandedKey: [],
83 expandOnNodeClick: false,
84 data: [
85 {
86 "children": [
87 {
88 "children": null,
89 "parentGuids": [
90 "c32ddd77191ff4afe149538ef4b2e0c3"
91 ],
92 "guid": "9c92df55a19cdce88f61e20a8e1e8a65",
93 "tenantGuid": "9e5b9d7bfd8c4f4f8079e05de19bf7e0",
94 "organisationCode": "11150001",
95 "organisationName": "链享供应链运营一部",
96 "bizState": "Y",
97 "createTime": "2023-10-25 14:23:31",
98 "createUserName": "测试",
99 "parentGuid": "c32ddd77191ff4afe149538ef4b2e0c3",
100 "orderNum": 1,
101 "level": 2,
102 "levelCode": "1.1",
103 "displayCreateTime": "2023-10-25 14:23:31"
104 }
105 ],
106 "parentGuids": null,
107 "guid": "c32ddd77191ff4afe149538ef4b2e0c3",
108 "tenantGuid": "9e5b9d7bfd8c4f4f8079e05de19bf7e0",
109 "organisationCode": "1115004",
110 "organisationName": "链享供应链",
111 "bizState": "Y",
112 "createTime": "2023-08-15 12:59:10",
113 "createUserName": "测试",
114 "parentGuid": "",
115 "orderNum": 2,
116 "level": 0,
117 "levelCode": "1",
118 "displayCreateTime": "2023-08-15 12:59:10"
119 },
120 {
121 "children": [
122 {
123 "children": [
124 {
125 "children": null,
126 "parentGuids": [
127 "e10332122834077907cd5ea61fa576c1",
128 "cdae7bb3cafb560482cad1b89a1e4b78"
129 ],
130 "guid": "16ea472a155c07433a63220f2ae1afe9",
131 "tenantGuid": "9e5b9d7bfd8c4f4f8079e05de19bf7e0",
132 "organisationCode": "11160011",
133 "organisationName": "链享运营一部1组",
134 "bizState": "S",
135 "createTime": "2023-10-25 13:15:57",
136 "createUserName": "测试",
137 "parentGuid": "cdae7bb3cafb560482cad1b89a1e4b78",
138 "orderNum": 1,
139 "level": 2,
140 "levelCode": "2.1.1",
141 "displayCreateTime": "2023-10-25 13:15:57"
142 }
143 ],
144 "parentGuids": [
145 "e10332122834077907cd5ea61fa576c1"
146 ],
147 "guid": "cdae7bb3cafb560482cad1b89a1e4b78",
148 "tenantGuid": "9e5b9d7bfd8c4f4f8079e05de19bf7e0",
149 "organisationCode": "1116001",
150 "organisationName": "链享运营一部",
151 "bizState": "S",
152 "createTime": "2023-10-25 13:14:15",
153 "createUserName": "测试",
154 "parentGuid": "e10332122834077907cd5ea61fa576c1",
155 "orderNum": 1,
156 "level": 1,
157 "levelCode": "2.1",
158 "displayCreateTime": "2023-10-25 13:14:15"
159 },
160 {
161 "children": null,
162 "parentGuids": [
163 "e10332122834077907cd5ea61fa576c1"
164 ],
165 "guid": "d98b44ffb35e4d17cf68f9a922e1c7b7",
166 "tenantGuid": "9e5b9d7bfd8c4f4f8079e05de19bf7e0",
167 "organisationCode": null,
168 "organisationName": "二部",
169 "bizState": "Y",
170 "createTime": "2023-10-26 09:45:36",
171 "createUserName": "测试",
172 "parentGuid": "e10332122834077907cd5ea61fa576c1",
173 "orderNum": 2,
174 "level": 1,
175 "levelCode": "2.2",
176 "displayCreateTime": "2023-10-26 09:45:36"
177 }
178 ],
179 "parentGuids": null,
180 "guid": "e10332122834077907cd5ea61fa576c1",
181 "tenantGuid": "9e5b9d7bfd8c4f4f8079e05de19bf7e0",
182 "organisationCode": "1115005",
183 "organisationName": "链享医药",
184 "bizState": "Y",
185 "createTime": "2023-09-12 15:59:35",
186 "createUserName": "测试",
187 "parentGuid": null,
188 "orderNum": 3,
189 "level": 0,
190 "levelCode": "2",
191 "displayCreateTime": "2023-09-12 15:59:35"
192 },
193 {
194 "children": [
195 {
196 "children": null,
197 "parentGuids": [
198 "9bd46f0f4fcf429518fae6ecb4849a9e"
199 ],
200 "guid": "870f23ae47e036eb88b35f726c31959b",
201 "tenantGuid": "9e5b9d7bfd8c4f4f8079e05de19bf7e0",
202 "organisationCode": null,
203 "organisationName": "运用三部",
204 "bizState": "Y",
205 "createTime": "2024-04-28 16:33:24",
206 "createUserName": "数往知来管理员",
207 "parentGuid": "9bd46f0f4fcf429518fae6ecb4849a9e",
208 "orderNum": 3,
209 "level": 1,
210 "levelCode": "3.3",
211 "displayCreateTime": "2024-04-28 16:33:24"
212 },
213 {
214 "children": null,
215 "parentGuids": [
216 "9bd46f0f4fcf429518fae6ecb4849a9e"
217 ],
218 "guid": "e06049046241dd71b153f227dbe7f801",
219 "tenantGuid": "9e5b9d7bfd8c4f4f8079e05de19bf7e0",
220 "organisationCode": null,
221 "organisationName": "运营二部",
222 "bizState": "Y",
223 "createTime": "2023-11-14 16:01:50",
224 "createUserName": "数往知来管理员",
225 "parentGuid": "9bd46f0f4fcf429518fae6ecb4849a9e",
226 "orderNum": 40,
227 "level": 1,
228 "levelCode": "3.2",
229 "displayCreateTime": "2023-11-14 16:01:50"
230 },
231 {
232 "children": null,
233 "parentGuids": [
234 "9bd46f0f4fcf429518fae6ecb4849a9e"
235 ],
236 "guid": "731cd185c868da8af48b492068ffaed4",
237 "tenantGuid": "9e5b9d7bfd8c4f4f8079e05de19bf7e0",
238 "organisationCode": null,
239 "organisationName": "运营一部",
240 "bizState": "Y",
241 "createTime": "2023-11-14 15:19:35",
242 "createUserName": "测试",
243 "parentGuid": "9bd46f0f4fcf429518fae6ecb4849a9e",
244 "orderNum": 41,
245 "level": 1,
246 "levelCode": "3.1",
247 "displayCreateTime": "2023-11-14 15:19:35"
248 }
249 ],
250 "parentGuids": null,
251 "guid": "9bd46f0f4fcf429518fae6ecb4849a9e",
252 "tenantGuid": "9e5b9d7bfd8c4f4f8079e05de19bf7e0",
253 "organisationCode": null,
254 "organisationName": "药企服务事业部1",
255 "bizState": "Y",
256 "createTime": "2023-11-14 14:49:14",
257 "createUserName": "数往知来管理员",
258 "parentGuid": "",
259 "orderNum": 4,
260 "level": 0,
261 "levelCode": "3",
262 "displayCreateTime": "2023-11-14 14:49:14"
263 },
264 {
265 "children": [
266 {
267 "children": null,
268 "parentGuids": [
269 "23be149ea3167a3f7f2d383023336efe"
270 ],
271 "guid": "e5f2b4958ee2d99309a41e0c6e1447c8",
272 "tenantGuid": "9e5b9d7bfd8c4f4f8079e05de19bf7e0",
273 "organisationCode": null,
274 "organisationName": "智能存储装备部",
275 "bizState": "Y",
276 "createTime": "2023-11-14 16:09:36",
277 "createUserName": "数往知来管理员",
278 "parentGuid": "23be149ea3167a3f7f2d383023336efe",
279 "orderNum": 51,
280 "level": 1,
281 "levelCode": "4.1",
282 "displayCreateTime": "2023-11-14 16:09:36"
283 }
284 ],
285 "parentGuids": null,
286 "guid": "23be149ea3167a3f7f2d383023336efe",
287 "tenantGuid": "9e5b9d7bfd8c4f4f8079e05de19bf7e0",
288 "organisationCode": null,
289 "organisationName": "医药物联网事业部",
290 "bizState": "Y",
291 "createTime": "2023-11-14 15:11:35",
292 "createUserName": "数往知来管理员",
293 "parentGuid": "",
294 "orderNum": 5,
295 "level": 0,
296 "levelCode": "4",
297 "displayCreateTime": "2023-11-14 15:11:35"
298 },
299 {
300 "children": null,
301 "parentGuids": null,
302 "guid": "1d82e875163749ca9ae45809ec432ae8",
303 "tenantGuid": "9e5b9d7bfd8c4f4f8079e05de19bf7e0",
304 "organisationCode": null,
305 "organisationName": "财务管理中心",
306 "bizState": "S",
307 "createTime": "2023-11-14 15:14:07",
308 "createUserName": "数往知来管理员",
309 "parentGuid": "",
310 "orderNum": 6,
311 "level": 0,
312 "levelCode": "6",
313 "displayCreateTime": "2023-11-14 15:14:07"
314 },
315 {
316 "children": null,
317 "parentGuids": null,
318 "guid": "cd9e6a0c76102364a9e88b79b28b0b32",
319 "tenantGuid": "9e5b9d7bfd8c4f4f8079e05de19bf7e0",
320 "organisationCode": null,
321 "organisationName": "资产服务",
322 "bizState": "Y",
323 "createTime": "2024-08-14 11:40:33",
324 "createUserName": "数往知来管理员",
325 "parentGuid": "",
326 "orderNum": 7,
327 "level": 0,
328 "levelCode": "9",
329 "displayCreateTime": "2024-08-14 11:40:33"
330 },
331 {
332 "children": [
333 {
334 "children": null,
335 "parentGuids": [
336 "dac448b77fa35f798bb4a06d8fd86334"
337 ],
338 "guid": "cb76777efe69182cfb2c75d41944553c",
339 "tenantGuid": "9e5b9d7bfd8c4f4f8079e05de19bf7e0",
340 "organisationCode": null,
341 "organisationName": "审批1",
342 "bizState": "Y",
343 "createTime": "2024-01-17 14:28:36",
344 "createUserName": "数往知来管理员",
345 "parentGuid": "dac448b77fa35f798bb4a06d8fd86334",
346 "orderNum": 100,
347 "level": 1,
348 "levelCode": "8.1",
349 "displayCreateTime": "2024-01-17 14:28:36"
350 }
351 ],
352 "parentGuids": null,
353 "guid": "dac448b77fa35f798bb4a06d8fd86334",
354 "tenantGuid": "9e5b9d7bfd8c4f4f8079e05de19bf7e0",
355 "organisationCode": null,
356 "organisationName": "审批组织",
357 "bizState": "Y",
358 "createTime": "2024-01-16 11:38:24",
359 "createUserName": "数往知来管理员",
360 "parentGuid": "",
361 "orderNum": 99,
362 "level": 0,
363 "levelCode": "8",
364 "displayCreateTime": "2024-01-16 11:38:24"
365 }
366 ],
367 });
368
369 const expand1 = ref(true)
370 const expand2 = ref(true)
371
372 const taskFormItems: any = ref([
373 {
374 label: '任务名称',
375 type: 'input',
376 placeholder: '请输入',
377 field: 'taskName',
378 default: '',
379 maxlength: 50,
380 required: true
381 },
382 {
383 label: '分级分类目录名称',
384 type: 'input',
385 placeholder: '请输入',
386 field: 'catalogName',
387 default: '',
388 maxlength: 50,
389 required: true
390 },
391 ])
392
393 const taskFormRules = ref({
394 taskName: [
395 { required: true, trigger: 'blur', message: "请填写任务名称" }
396 ],
397 catalogName: [
398 { required: true, trigger: 'blur', message: "请填写分级分类目录名称" }
399 ],
400 });
401
402 const page = ref({
403 limit: 50,
404 curr: 1,
405 sizes: [
406 { label: "10", value: 10 },
407 { label: "50", value: 50 },
408 { label: "100", value: 100 },
409 { label: "150", value: 150 },
410 { label: "200", value: 200 },
411 ],
412 });
413 const searchItemValue: any = ref({});
414 const currTableData: any = ref({});
415
416 const tableInfo = ref({
417 id: "mapping-table",
418 fields: [
419 { label: "序号", type: "index", width: 56, align: "center", fixed: "left" },
420 { label: "标签", field: "damCode", width: 96 },
421 { label: "分类", field: "damTypeName", width: 380 },
422 { label: "分级", field: "damName", width: 55 },
423 { label: "规则", field: "damTypeName", width: 380 },
424 ],
425 loading: false,
426 data: [],
427 page: {
428 type: "normal",
429 rows: 0,
430 ...page.value,
431 },
432 actionInfo: {
433 show: false
434 },
435 });
436
437 const metadataTableInfo = ref({
438 id: "metadata-table",
439 fields: [
440 { label: "序号", type: "index", width: 56, align: "center", fixed: "left" },
441 { label: "数据库名称", field: "damCode", width: 200 },
442 { label: "数据库名", field: "damTypeName", width: 200 },
443 { label: "总表数", field: "damName", width: 120, align: "right" },
444 { label: "存储量(约/MB)", field: "damTypeName", width: 200, align: "right" },
445 ],
446 loading: false,
447 data: [],
448 page: {
449 type: "normal",
450 rows: 0,
451 ...page.value,
452 },
453 actionInfo: {
454 show: false
455 },
456 })
457
458 const nodeClick = (data) => {
459 treeIndex.value = data
460 }
461
462 const getTableData = () => {
463 tableInfo.value.loading = true;
464 getListingList(
465 Object.assign({}, searchItemValue.value, {
466 pageIndex: page.value.curr,
467 pageSize: page.value.limit,
468 })
469 ).then((res: any) => {
470 tableInfo.value.loading = false;
471 tableInfo.value.data = res.data.records || [];
472 tableInfo.value.page.curr = res.data.pageIndex;
473 tableInfo.value.page.limit = res.data.pageSize;
474 tableInfo.value.page.rows = res.data.totalRows;
475 })
476 .catch((res) => {
477 tableInfo.value.loading = false;
478 });
479 };
480
481 const tableBtnClick = (scope, btn) => {
482 const type = btn.value;
483 const row = scope.row;
484 currTableData.value = row;
485 if (type == "detail" || type === "edit") {
486 toPath(type);
487 } else if (type === "delete") {
488 open("此操作将永久删除,是否继续?", "warning");
489 }
490 };
491
492 const toPath = (type = null) => {
493 router.push({
494 name: "taskConfig",
495 query: {
496 type
497 },
498 });
499 }
500
501 const tablePageChange = (info) => {
502 page.value.curr = Number(info.curr);
503 page.value.limit = Number(info.limit);
504 tableInfo.value.page.limit = page.value.limit;
505 tableInfo.value.page.curr = page.value.curr;
506 getTableData();
507 };
508
509 const open = (msg, type, isBatch = false) => {
510 ElMessageBox.confirm(msg, "提示", {
511 confirmButtonText: "确定",
512 cancelButtonText: "取消",
513 type: type,
514 }).then(() => {
515 const guids = [currTableData.value.guid];
516 listingDelete(guids).then((res: any) => {
517 if (res.code == proxy.$passCode) {
518 getFirstPageData();
519 ElMessage({
520 type: "success",
521 message: "删除成功",
522 });
523 } else {
524 ElMessage({
525 type: "error",
526 message: res.msg,
527 });
528 }
529 }).catch((res) => {
530 tableInfo.value.loading = false;
531 });
532 });
533 };
534
535 const getFirstPageData = () => {
536 page.value.curr = 1
537 tableInfo.value.page.curr = 1;
538 getTableData();
539 }
540
541 const querySearch = (queryString: string) => {
542 listLoading.value = true
543 const results = queryString
544 ? currpermissionList.value.filter(item => item.dataPermissionName.indexOf(queryString) > -1)
545 : permissionList.value;
546 currpermissionList.value = results
547 listLoading.value = false
548 }
549
550 const btnClick = async (btn, bType = null) => {
551 const type = btn.value;
552 if (type == 'next') {
553 step.value++;
554 } else if (type == 'prev') {
555 step.value--;
556 } else {
557 toPath()
558 }
559 };
560
561 // 监听滚动事件
562 const handleScroll = () => {
563 if (listPage.value.curr < listPage.value.totalPages) {
564 listPage.value.curr++
565 getPermissionList({})
566 }
567 }
568
569 const changTable = () => {
570 // toSearch({})
571 };
572
573 const getPermissionList = (val, init = false) => {
574 let params: any = val ? { ...val } : {}
575 params.pageIndex = listPage.value.curr;
576 params.pageSize = listPage.value.limit;
577 listLoading.value = true
578 // getPermissionDictList(params).then((res: any) => {
579 // if (res.code == proxy.$passCode) {
580 // const data = res.data?.records || []
581 // if (init) {
582 // permissionList.value = JSON.parse(JSON.stringify(data))
583 // currpermissionList.value = JSON.parse(JSON.stringify(data))
584 // listPage.value.totalPages = res.data.totalPages
585 // toSearch({})
586 // } else {
587 // permissionList.value.push(...JSON.parse(JSON.stringify(data)))
588 // querySearch(asideSearchInput.value)
589 // }
590 // }
591 // listLoading.value = false
592 // }).catch(() => {
593 // listLoading.value = false
594 // })
595 }
596
597 onActivated(() => {
598
599 })
600
601 onBeforeMount(() => {
602
603 })
604
605 </script>
606
607 <template>
608 <div class="container_wrap full flex">
609 <div class="aside_wrap" v-show="step == 0">
610 <div class="aside_title">选择分类分级模板</div>
611 <div class="aside_search">
612 <el-input v-model.trim="asideSearchInput" placeholder="请输入关键字" :prefix-icon="Search" clearable
613 @change="querySearch" />
614 </div>
615 <div class="aside_list" v-loading="listLoading" v-infinite-scroll="handleScroll">
616 <div class="list_item" v-for="(item, i) in currpermissionList" :class="{ active: selectIndex == i }"
617 @click="selectIndex = i; changTable();" v-preReClick>{{ item.dataPermissionName }}</div>
618 </div>
619 </div>
620 <div class="main_wrap" :class="{ full: step == 1 }">
621 <div class="content_main" v-show="step == 0">
622 <div class="template_panel">
623 <div class="panel_title">
624 <span class="title_text">{{ templateInfo.title }}</span>
625 <div class="title_desc">
626 <div class="desc_group" v-for="desc in templateInfo.descGroup">
627 <span class="desc_label">{{ desc.label }}</span>
628 <span class="desc_value">{{ desc.value }}</span>
629 </div>
630 </div>
631 </div>
632 <div class="panel_tags">
633 <el-tag v-for="tag in templateInfo.tags" :type="tag.type">{{ tag.name }}</el-tag>
634 </div>
635 <p class="panel_desc">{{ templateInfo.desc }}</p>
636 </div>
637 <div class="panel_content">
638 <div class="box_left">
639 <div class="aside_title">分类分级目录</div>
640 <Tree :treeInfo="treeInfo" @nodeClick="nodeClick" />
641 </div>
642 <div class="box_right">
643 <el-breadcrumb separator="/">
644 <el-breadcrumb-item>全部</el-breadcrumb-item>
645 <el-breadcrumb-item>promotion management</el-breadcrumb-item>
646 <el-breadcrumb-item>promotion list</el-breadcrumb-item>
647 <el-breadcrumb-item>promotion detail</el-breadcrumb-item>
648 </el-breadcrumb>
649 <div class="table_panel_wrap">
650 <Table :tableInfo="tableInfo" @tableBtnClick="tableBtnClick" @tablePageChange="tablePageChange" />
651 </div>
652 </div>
653 </div>
654 </div>
655 <div class="content_main panel" v-show="step == 1">
656 <ContentWrap id="id-approveInfo" title="创建任务" expandSwicth style="margin-top: 15px" :isExpand="expand1"
657 @expand="(v) => expand1 = v">
658 <div class="form_panel">
659 <Form ref="taskFormRef" formId="edit-standard-form" :itemList="taskFormItems" :rules="taskFormRules"
660 col="col3" />
661 </div>
662 </ContentWrap>
663 <ContentWrap id="id-approveInfo" title="选择元数据" expandSwicth style="margin-top: 15px" :isExpand="expand2"
664 @expand="(v) => expand2 = v">
665 <Table :tableInfo="metadataTableInfo" />
666 </ContentWrap>
667 </div>
668 <div class="tool_btns">
669 <div class="btns">
670 <el-button @click="btnClick({ value: 'cancel' })" v-if="step == 0">取消</el-button>
671 <el-button @click="btnClick({ value: 'prev' })" v-if="step == 1">上一步</el-button>
672 <el-button type="primary" @click="btnClick({ value: 'next' })" v-if="step == 0">下一步</el-button>
673 <el-button type="primary" @click="btnClick({ value: 'path' })" v-if="step == 1">后台运行</el-button>
674 </div>
675 </div>
676 </div>
677 </div>
678 </template>
679
680 <style scoped lang="scss">
681 .container_wrap {
682 .aside_wrap {
683 width: 199px;
684 border-right: 1px solid #d9d9d9;
685 box-shadow: none;
686
687 .aside_title {
688 width: calc(100% - 32px);
689 display: inline-block;
690 }
691
692 .icon-add.el-icon {
693 width: 24px;
694 height: 24px;
695 vertical-align: middle;
696 cursor: pointer;
697
698 svg {
699 width: 24px;
700 height: 24px;
701 }
702 }
703
704 .tree_panel {
705 height: calc(100% - 72px);
706 padding-top: 0;
707 border-bottom: 1px solid #d9d9d9;
708
709 :deep(.el-tree) {
710 margin: 0;
711 height: calc(100% - 32px);
712 overflow: hidden auto;
713 }
714 }
715
716 .page_nav_wrap.concise {
717 justify-content: center;
718 }
719
720 }
721 }
722
723 .container_wrap {
724 overflow: hidden auto;
725
726 .main_wrap {
727 padding: 0;
728
729 &.full {
730 width: 100%;
731 }
732
733 .content_main {
734 display: flex;
735 flex-direction: column;
736 height: calc(100% - 45px);
737 overflow: hidden auto;
738 flex: 1;
739
740 &.panel {
741 padding: 0 16px;
742 }
743
744 .template_panel {
745 padding: 0 8px;
746
747 .panel_title {
748 display: flex;
749 justify-content: space-between;
750 align-items: center;
751 margin: 8px 0;
752
753 .title_text {
754 font-size: 16px;
755 color: #212121;
756 line-height: 24px;
757 font-weight: 600;
758 }
759
760 .title_desc {
761 display: flex;
762
763 .desc_group {
764 margin-left: 16px;
765 }
766 }
767 }
768
769 .panel_tags {
770 .el-tag {
771 margin-right: 8px;
772 }
773 }
774
775 .panel_desc {
776 margin: 8px 0;
777 font-size: 14px;
778 color: #666;
779 }
780 }
781
782 .panel_content {
783 height: 100%;
784 display: flex;
785 flex: 1;
786 border-top: 1px solid #d9d9d9;
787
788 .box_left {
789 width: 240px;
790 height: 100%;
791 border-right: 1px solid #d9d9d9;
792
793 .aside_title {
794 padding: 0 8px;
795 height: 40px;
796 line-height: 40px;
797 font-size: 14px;
798 color: #212121;
799 font-weight: 600;
800 }
801
802 .tree_panel {
803 padding: 0;
804 }
805 }
806
807 .box_right {
808 width: 100%;
809
810 .el-breadcrumb {
811 padding: 0 12px;
812 line-height: 40px;
813 }
814 }
815 }
816
817 .table_panel_wrap {
818 width: 100%;
819 height: calc(100% - 40px);
820 padding: 0 12px;
821 }
822 }
823
824 .tool_btns {
825 height: 44px;
826 margin: 0 -8px;
827 display: flex;
828 justify-content: center;
829 align-items: center;
830 border-top: 1px solid #d9d9d9;
831 }
832 }
833 }
834 </style>
...@@ -129,6 +129,27 @@ watch(() => props.largeCategoryList, (val) => { ...@@ -129,6 +129,27 @@ watch(() => props.largeCategoryList, (val) => {
129 /** 规范性检验规则 */ 129 /** 规范性检验规则 */
130 const checkRulesList: any = ref([]); 130 const checkRulesList: any = ref([]);
131 131
132 /** 根据不同的数据类型显示对应的规则 */
133 const rulesListByType: any = computed(() => {
134 if (!checkRulesList.value.length) {
135 return {};
136 }
137 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'),
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'),
140 int: checkRulesList.value.filter(r => r.paramValue == 'length_rule' || r.paramValue == 'num_value_rule' || r.paramValue == 'custom_regular_rule'),
141 date: checkRulesList.value.filter(r => r.paramValue == 'date_format_rule' || r.paramValue == 'custom_regular_rule'),
142 datetime: checkRulesList.value.filter(r => r.paramValue == 'date_format_rule' || r.paramValue == 'custom_regular_rule'),
143 timestamp: checkRulesList.value.filter(r => r.paramValue == 'custom_regular_rule' || r.paramValue == 'custom_regular_rule'),
144 // text: checkRulesList.value.filter(r => r.paramValue == ''),
145 decimal: checkRulesList.value.filter(r => r.paramValue == 'length_rule' || r.paramValue == 'precision_rule' || r.paramValue == 'num_value_rule' || r.paramValue == 'custom_regular_rule'),
146 // json: checkRulesList.value.filter(r => r.paramValue == ''),
147 tinyint: checkRulesList.value.filter(r => r.paramValue == 'length_rule' || r.paramValue == 'num_value_rule' || r.paramValue == 'custom_regular_rule'),
148 time: checkRulesList.value.filter(r => r.paramValue == 'custom_regular_rule'),
149 bit: checkRulesList.value.filter(r => r.paramValue == 'ch_rule' || r.paramValue == 'en_rule' || r.paramValue == 'custom_regular_rule'),
150 }
151 });
152
132 onBeforeMount(() => { 153 onBeforeMount(() => {
133 if (props.ruleTypeList?.length) { 154 if (props.ruleTypeList?.length) {
134 if (props.ruleTypeValue) { 155 if (props.ruleTypeValue) {
...@@ -166,6 +187,7 @@ onBeforeMount(() => { ...@@ -166,6 +187,7 @@ onBeforeMount(() => {
166 getCheckRulesList().then((res: any) => { 187 getCheckRulesList().then((res: any) => {
167 if (res.code == proxy.$passCode) { 188 if (res.code == proxy.$passCode) {
168 checkRulesList.value = res.data || []; 189 checkRulesList.value = res.data || [];
190
169 } else { 191 } else {
170 ElMessage.error(res.msg); 192 ElMessage.error(res.msg);
171 } 193 }
...@@ -766,7 +788,7 @@ const formBtnClick = (btn) => { ...@@ -766,7 +788,7 @@ const formBtnClick = (btn) => {
766 normCheckDialogVisible.value = true; 788 normCheckDialogVisible.value = true;
767 tableListInfo.value.data = props.toSubjectTables; 789 tableListInfo.value.data = props.toSubjectTables;
768 dialogSelectSubjectTable.value = props.toSubjectTables[0]; 790 dialogSelectSubjectTable.value = props.toSubjectTables[0];
769 let defaultValue = panelList.value[12].defaultValue; 791 let defaultValue = panelList.value[14].defaultValue;
770 normCheckTableListData.value[dialogSelectSubjectTable.value.enName] = []; 792 normCheckTableListData.value[dialogSelectSubjectTable.value.enName] = [];
771 if (props.toSubjectTables[0]?.guid) { 793 if (props.toSubjectTables[0]?.guid) {
772 normCheckTableListLoading.value[dialogSelectSubjectTable.value.enName] = true; 794 normCheckTableListLoading.value[dialogSelectSubjectTable.value.enName] = true;
...@@ -781,7 +803,14 @@ const formBtnClick = (btn) => { ...@@ -781,7 +803,14 @@ const formBtnClick = (btn) => {
781 let fIndex = data.findIndex(d => d.enName == field.enName); 803 let fIndex = data.findIndex(d => d.enName == field.enName);
782 if (fIndex > -1) { 804 if (fIndex > -1) {
783 let f = normCheckTableListData.value[dialogSelectSubjectTable.value.enName][fIndex]; 805 let f = normCheckTableListData.value[dialogSelectSubjectTable.value.enName][fIndex];
784 Object.assign(f, field); 806 f.checkRule = field.checkRule;
807 f.configValue = field.configValue;
808 if (f.checkRule == 'length_rule') {
809 let vSplit = f.configValue.split('#');
810 f.operator = vSplit[0];
811 f.value = vSplit[1];
812 f.value1 = vSplit[2];
813 }
785 } 814 }
786 }); 815 });
787 } 816 }
...@@ -938,6 +967,22 @@ const setPanelListValue = (item, isSelectChange = false, init = false, radioGrou ...@@ -938,6 +967,22 @@ const setPanelListValue = (item, isSelectChange = false, init = false, radioGrou
938 p.default = ''; 967 p.default = '';
939 p.defaultValue = {}; 968 p.defaultValue = {};
940 } 969 }
970 } else if (ruleCode == 'norm_check' && p.field == 'ruleSettings-norm-check') {
971 if (!init) {
972 p.default = val[field];
973 return;
974 }
975 if (val.ruleField?.length) {
976 p.default = val.ruleField?.map(f => f.enName)?.join(';');
977 let ruleFields = {};
978 ruleFields[val.subjectName] = val.ruleField || [];
979 p.defaultValue = {
980 ruleFields: ruleFields
981 }
982 } else {
983 p.default = '';
984 p.defaultValue = {};
985 }
941 } else if (p.field == 'largeCategory') { 986 } else if (p.field == 'largeCategory') {
942 /** 此处有歧义,若是切换规则类型,修改默认值,可能会出现,用户先修改了规则大类,但是切换类型之后,被我还原了。 */ 987 /** 此处有歧义,若是切换规则类型,修改默认值,可能会出现,用户先修改了规则大类,但是切换类型之后,被我还原了。 */
943 if (radioGroupChange && !init) { 988 if (radioGroupChange && !init) {
...@@ -1127,6 +1172,42 @@ const listItemClick = (data) => { ...@@ -1127,6 +1172,42 @@ const listItemClick = (data) => {
1127 ElMessage.error(res.msg); 1172 ElMessage.error(res.msg);
1128 } 1173 }
1129 }) 1174 })
1175 } else if (ruleType.value == 'norm_check') {
1176 if (normCheckTableListData.value[dialogSelectSubjectTable.value.enName]?.length) {
1177 return;
1178 }
1179 let defaultValue = panelList.value[14].defaultValue;
1180 normCheckTableListLoading.value[dialogSelectSubjectTable.value.enName] = true;
1181 getSubjectFields(data.guid).then((res: any) => {
1182 normCheckTableListLoading.value[dialogSelectSubjectTable.value.enName] = false;
1183 if (res.code == proxy.$passCode) {
1184 let data = res.data || [];
1185 normCheckTableListData.value[dialogSelectSubjectTable.value.enName] = data;
1186 let valueFields = defaultValue.ruleFields?.[dialogSelectSubjectTable.value.enName] || [];
1187 if (valueFields.length) {
1188 valueFields.forEach(field => {
1189 let fIndex = data.findIndex(d => d.enName == field.enName);
1190 if (fIndex > -1) {
1191 let f = normCheckTableListData.value[dialogSelectSubjectTable.value.enName][fIndex];
1192 if (field.checkRule) {
1193 f.checkRule = field.dataRange;
1194 f.configValue = field.configValue;
1195 if (field.checkRule == 'length_rule') {
1196 let vLen = f.configValue?.split('#');
1197 if (vLen?.length > 1) {
1198 f.operator = vLen[0];
1199 f.value = vLen[1];
1200 f.value1 = vLen[2]
1201 }
1202 }
1203 }
1204 }
1205 });
1206 }
1207 } else {
1208 ElMessage.error(res.msg);
1209 }
1210 })
1130 } 1211 }
1131 } 1212 }
1132 1213
...@@ -1634,6 +1715,8 @@ const valueRangeTableListLoading = ref({}); ...@@ -1634,6 +1715,8 @@ const valueRangeTableListLoading = ref({});
1634 1715
1635 const valueRangeTableListData = ref({}); 1716 const valueRangeTableListData = ref({});
1636 1717
1718 const valueCheckFormListRef = ref();
1719
1637 const cancelValueRangeDialog = () => { 1720 const cancelValueRangeDialog = () => {
1638 valueRangeDialogVisible.value = false; 1721 valueRangeDialogVisible.value = false;
1639 } 1722 }
...@@ -1649,26 +1732,27 @@ const submitValueRange = () => { ...@@ -1649,26 +1732,27 @@ const submitValueRange = () => {
1649 let ruleFields: any = [] 1732 let ruleFields: any = []
1650 for (const field of valueTableFields) { 1733 for (const field of valueTableFields) {
1651 if (field.startValue != null && field.endValue == null || (field.endValue != null && field.startValue == null)) { 1734 if (field.startValue != null && field.endValue == null || (field.endValue != null && field.startValue == null)) {
1735 if (dialogSelectSubjectTable.value.enName != table) {
1736 valueCheckFormListRef.value.setSelectList(table, 'enName');
1737 }
1652 ElMessage.error(`表【${table}】的字段【${field.enName}】设置了值域,但范围未填写完整`); 1738 ElMessage.error(`表【${table}】的字段【${field.enName}】设置了值域,但范围未填写完整`);
1653 return; 1739 return;
1654 } 1740 }
1655 if (field.startValue) { 1741 if (field.startValue) {
1656 ruleFields.push(field); 1742 ruleFields.push(field);
1657 } 1743 } else if (field.dataRange) {
1658 if (field.dataRange) {
1659 ruleFields.push(field); 1744 ruleFields.push(field);
1660 } 1745 } else if (field.dateValueRange?.length > 0) {
1661 if (field.dateValueRange?.length > 0) {
1662 field.startValue = field.dateValueRange[0]; 1746 field.startValue = field.dateValueRange[0];
1663 field.endValue = field.dateValueRange[1]; 1747 field.endValue = field.dateValueRange[1];
1664 ruleFields.push(field); 1748 ruleFields.push(field);
1665 } 1749 }
1750 }
1666 if (ruleFields.length) { 1751 if (ruleFields.length) {
1667 v.push(table); 1752 v.push(table);
1668 ruleFieldsJson[table] = ruleFields; 1753 ruleFieldsJson[table] = ruleFields;
1669 } 1754 }
1670 } 1755 }
1671 }
1672 if (!v.length) { 1756 if (!v.length) {
1673 ElMessage.error('当前未给表字段设置值域!'); 1757 ElMessage.error('当前未给表字段设置值域!');
1674 return; 1758 return;
...@@ -1792,12 +1876,97 @@ const normCheckTableListLoading = ref({}); ...@@ -1792,12 +1876,97 @@ const normCheckTableListLoading = ref({});
1792 1876
1793 const normCheckTableListData = ref({}); 1877 const normCheckTableListData = ref({});
1794 1878
1879 const normCheckFormListRef = ref();
1880
1795 const cancelNormCheckDialog = () => { 1881 const cancelNormCheckDialog = () => {
1796 normCheckDialogVisible.value = false; 1882 normCheckDialogVisible.value = false;
1797 } 1883 }
1798 1884
1799 const submitNormCheck = () => { 1885 const submitNormCheck = () => {
1800 1886 let v: any = [];
1887 let ruleFieldsJson: any = {};
1888 for (const table in normCheckTableListData.value) {
1889 if (!normCheckTableListData.value[table]?.length) {
1890 continue;
1891 }
1892 let valueTableFields = normCheckTableListData.value[table];
1893 let ruleFields: any = []
1894 for (const field of valueTableFields) {
1895 if (!field.checkRule) {
1896 continue;
1897 }
1898 if ((field.checkRule == 'custom_regular_rule' || field.checkRule == 'precision_rule' || field.checkRule == 'date_format_rule') && field.configValue == null) {
1899 if (dialogSelectSubjectTable.value.enName != table) {
1900 normCheckFormListRef.value.setSelectList(table, 'enName');
1901 }
1902 ElMessage.error(`表【${table}】的字段【${field.enName}】设置了校验规则,但未填写配置项`);
1903 return;
1904 }
1905 if (field.checkRule == 'length_rule') {
1906 if (!field.operator) {
1907 if (dialogSelectSubjectTable.value.enName != table) {
1908 normCheckFormListRef.value.setSelectList(table, 'enName');
1909 }
1910 ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,但未选择操作符`);
1911 return;
1912 }
1913 if (!field.value) {
1914 if (dialogSelectSubjectTable.value.enName != table) {
1915 normCheckFormListRef.value.setSelectList(table, 'enName');
1916 }
1917 ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,但未填写长度值`);
1918 return;
1919 }
1920 if (field.operator == 'between') {
1921 if (!field.value1) {
1922 if (dialogSelectSubjectTable.value.enName != table) {
1923 normCheckFormListRef.value.setSelectList(table, 'enName');
1924 }
1925 ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,但长度值未填写完整`);
1926 return;
1927 }
1928 if (parseInt(field.value) >= parseInt(field.value1)) {
1929 if (dialogSelectSubjectTable.value.enName != table) {
1930 normCheckFormListRef.value.setSelectList(table, 'enName');
1931 }
1932 ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,介于操作符对应的数值需符合后者大于前者`);
1933 return;
1934 }
1935 field.configValue = field.operator + '#' + field.value + '#' + field.value1;
1936 } else {
1937 field.configValue = field.operator + '#' + field.value;
1938 }
1939 }
1940 ruleFields.push(field);
1941 }
1942 if (ruleFields.length) {
1943 v.push(table);
1944 ruleFieldsJson[table] = ruleFields;
1945 }
1946 }
1947 if (!v.length) {
1948 ElMessage.error('当前未给表字段设置规范检验规则!');
1949 return;
1950 }
1951 let index = 14;
1952 panelList.value[index].defaultValue = {
1953 ruleFields: ruleFieldsJson
1954 };
1955 let str = "";
1956 for (const key in ruleFieldsJson) {
1957 let field = ruleFieldsJson[key];
1958 str = str + (str ? ';' : '') + field.map(f => f.enName).join(',');;
1959 }
1960 let formInline = oldOriginValue.value = Object.assign({
1961 qualityModelGuids: props.toSubjectTables.map(s => s.guid),
1962 parity: 1,
1963 compareWay: 1,
1964 jointly: 'N',
1965 bizState: 'Y'
1966 }, oldOriginValue.value, ruleFormRef.value.formInline);
1967 formInline[`${panelList.value[index].field}`] = str;
1968 setPanelListValue(formInline);
1969 normCheckDialogVisible.value = false;
1801 } 1970 }
1802 1971
1803 const getFormInfo = () => { 1972 const getFormInfo = () => {
...@@ -1836,8 +2005,7 @@ const getFormInfo = () => { ...@@ -1836,8 +2005,7 @@ const getFormInfo = () => {
1836 } else if (formInline.ruleCode == 'value_of_range') { 2005 } else if (formInline.ruleCode == 'value_of_range') {
1837 let v = panelList.value[12].defaultValue; 2006 let v = panelList.value[12].defaultValue;
1838 return Object.assign({}, formInline, v, { 2007 return Object.assign({}, formInline, v, {
1839 ruleName: ruleName, 2008 ruleName: ruleName
1840 ruleFields: v
1841 }); 2009 });
1842 } else if (formInline.ruleCode == 'ref_integrality') { 2010 } else if (formInline.ruleCode == 'ref_integrality') {
1843 let v = panelList.value[13].defaultValue; 2011 let v = panelList.value[13].defaultValue;
...@@ -1845,6 +2013,11 @@ const getFormInfo = () => { ...@@ -1845,6 +2013,11 @@ const getFormInfo = () => {
1845 ruleName: ruleName, 2013 ruleName: ruleName,
1846 ruleFields: v 2014 ruleFields: v
1847 }); 2015 });
2016 } else if (formInline.ruleCode == 'norm_check') {
2017 let v = panelList.value[14].defaultValue;
2018 return Object.assign({}, formInline, v, {
2019 ruleName: ruleName
2020 });
1848 } 2021 }
1849 } 2022 }
1850 2023
...@@ -1984,8 +2157,9 @@ defineExpose({ ...@@ -1984,8 +2157,9 @@ defineExpose({
1984 </div> 2157 </div>
1985 <div class="table-field-right"> 2158 <div class="table-field-right">
1986 <div class="left-title">字段列表详情</div> 2159 <div class="left-title">字段列表详情</div>
1987 <el-table ref="rowTableRef" :data="valueRangeTableListData[dialogSelectSubjectTable.enName]" height="100%" :highlight-current-row="true" stripe 2160 <el-table ref="rowTableRef" :data="valueRangeTableListData[dialogSelectSubjectTable.enName]" height="100%"
1988 v-loading="valueRangeTableListLoading[dialogSelectSubjectTable.enName]" tooltip-effect="light" border 2161 :highlight-current-row="true" stripe v-loading="valueRangeTableListLoading[dialogSelectSubjectTable.enName]"
2162 tooltip-effect="light" border
1989 :style="{ height: 'calc(100% - 32px)', width: '100%', display: 'inline-block' }"> 2163 :style="{ height: 'calc(100% - 32px)', width: '100%', display: 'inline-block' }">
1990 <el-table-column prop="enName" label="字段名" width="140px" align="left" show-overflow-tooltip> 2164 <el-table-column prop="enName" label="字段名" width="140px" align="left" show-overflow-tooltip>
1991 </el-table-column> 2165 </el-table-column>
...@@ -1998,26 +2172,24 @@ defineExpose({ ...@@ -1998,26 +2172,24 @@ defineExpose({
1998 </el-table-column> 2172 </el-table-column>
1999 <el-table-column label="值域" width="280px" align="left" fixed="right"> 2173 <el-table-column label="值域" width="280px" align="left" fixed="right">
2000 <template #default="scope"> 2174 <template #default="scope">
2001 <span v-if="scope.row.dataType == 'json' || scope.row.dataType == 'text' || !scope.row.dataType || scope.row.dataType == 'string'">--</span> 2175 <span
2176 v-if="scope.row.dataType == 'json' || scope.row.dataType == 'text' || !scope.row.dataType || scope.row.dataType == 'string'">--</span>
2002 <template v-else> 2177 <template v-else>
2003 <el-input v-show="scope.row.dataType == 'varchar' || scope.row.dataType == 'char' || scope.row.dataType == 'bit'" v-model.trim="scope.row.dataRange" clearable placeholder="多值按照分号;分隔"> </el-input> 2178 <el-input
2179 v-show="scope.row.dataType == 'varchar' || scope.row.dataType == 'char' || scope.row.dataType == 'bit'"
2180 v-model.trim="scope.row.dataRange" clearable placeholder="多值按照分号;分隔"> </el-input>
2004 <div class="range-sum" v-show="scope.row.dataType == 'datetime' || scope.row.dataType == 'date'"> 2181 <div class="range-sum" v-show="scope.row.dataType == 'datetime' || scope.row.dataType == 'date'">
2005 <el-date-picker 2182 <el-date-picker v-model="scope.row.dateValueRange" type="daterange" range-separator="至"
2006 v-model="scope.row.dateValueRange" 2183 start-placeholder="开始日期" end-placeholder="结束日期" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
2007 type="daterange" 2184 :unlink-panels="false" :disabled="props.readonly" />
2008 range-separator="至"
2009 start-placeholder="开始日期"
2010 end-placeholder="结束日期"
2011 format="YYYY-MM-DD"
2012 value-format="YYYY-MM-DD"
2013 :unlink-panels="false"
2014 :disabled="props.readonly"
2015 />
2016 </div> 2185 </div>
2017 <div class="range-sum" v-show="scope.row.dataType == 'int' || scope.row.dataType == 'decimal' || scope.row.dataType == 'tinyint' || scope.row.dataType == 'timestamp' || scope.row.dataType == 'time'"> 2186 <div class="range-sum"
2018 <el-input :disabled="props.readonly" v-model.trim="scope.row.startValue" placeholder="请输入" clearable> </el-input> 2187 v-show="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>
2189 </el-input>
2019 <span class="text"></span> 2190 <span class="text"></span>
2020 <el-input :disabled="props.readonly" v-model.trim="scope.row.endValue" placeholder="请输入" clearable> </el-input> 2191 <el-input :disabled="props.readonly" v-model.trim="scope.row.endValue" placeholder="请输入" clearable>
2192 </el-input>
2021 </div> 2193 </div>
2022 </template> 2194 </template>
2023 </template> 2195 </template>
...@@ -2035,15 +2207,16 @@ defineExpose({ ...@@ -2035,15 +2207,16 @@ defineExpose({
2035 </el-dialog> 2207 </el-dialog>
2036 2208
2037 <!-- 引用完整性 --> 2209 <!-- 引用完整性 -->
2038 <el-dialog v-model="tableRefIntegralityDialogVisible" title="规则设置" width="750" :modal="true" :close-on-click-modal="false" 2210 <el-dialog v-model="tableRefIntegralityDialogVisible" title="规则设置" width="750" :modal="true"
2039 destroy-on-close align-center> 2211 :close-on-click-modal="false" destroy-on-close align-center>
2040 <div class="row-dialog-content"> 2212 <div class="row-dialog-content">
2041 <el-table ref="rowTableRef" :data="tableRefIntegralityRulesData" height="100%" :highlight-current-row="true" stripe 2213 <el-table ref="rowTableRef" :data="tableRefIntegralityRulesData" height="100%" :highlight-current-row="true"
2042 v-loading="tableRefIntegralityRulesDataLoading" tooltip-effect="light" border 2214 stripe v-loading="tableRefIntegralityRulesDataLoading" tooltip-effect="light" border
2043 :style="{ height: 'calc(100% - 28px)', width: 'auto', 'max-width': '100%', display: 'inline-block' }"> 2215 :style="{ height: 'calc(100% - 28px)', width: 'auto', 'max-width': '100%', display: 'inline-block' }">
2044 <el-table-column prop="mainTable" label="选择主表" width="180px" align="left" show-overflow-tooltip> 2216 <el-table-column prop="mainTable" label="选择主表" width="180px" align="left" show-overflow-tooltip>
2045 <template #default="scope"> 2217 <template #default="scope">
2046 <el-select v-if="!props.readonly" v-model="scope.row['mainTable']" placeholder="请选择" @change="tableInteMainSelectChange"> 2218 <el-select v-if="!props.readonly" v-model="scope.row['mainTable']" placeholder="请选择"
2219 @change="tableInteMainSelectChange">
2047 <el-option v-for="opt in toSubjectTables" :key="opt['guid']" :label="opt['label']" :value="opt['guid']" /> 2220 <el-option v-for="opt in toSubjectTables" :key="opt['guid']" :label="opt['label']" :value="opt['guid']" />
2048 </el-select> 2221 </el-select>
2049 <span v-else>{{ scope.row['mainTableName'] + `(${scope.row['mainTableZhName']})` }}</span> 2222 <span v-else>{{ scope.row['mainTableName'] + `(${scope.row['mainTableZhName']})` }}</span>
...@@ -2051,17 +2224,20 @@ defineExpose({ ...@@ -2051,17 +2224,20 @@ defineExpose({
2051 </el-table-column> 2224 </el-table-column>
2052 <el-table-column prop="mainTableField" label="选择主表字段" width="180px" align="left" show-overflow-tooltip> 2225 <el-table-column prop="mainTableField" label="选择主表字段" width="180px" align="left" show-overflow-tooltip>
2053 <template #default="scope"> 2226 <template #default="scope">
2054 <el-select v-if="!props.readonly" v-model="scope.row['mainTableField']" placeholder="请选择" filterable clearable> 2227 <el-select v-if="!props.readonly" v-model="scope.row['mainTableField']" placeholder="请选择" filterable
2055 <el-option v-for="opt in (scope.row.mainTable ? mainTableFields[scope.row.mainTable] : [])" :key="opt['enName']" :label="opt['label']" :value="opt['enName']" /> 2228 clearable>
2229 <el-option v-for="opt in (scope.row.mainTable ? mainTableFields[scope.row.mainTable] : [])"
2230 :key="opt['enName']" :label="opt['label']" :value="opt['enName']" />
2056 </el-select> 2231 </el-select>
2057 <span v-else>{{ scope.row['mainTableField'] + `(${scope.row['mainTableFieldZhName']})` }}</span> 2232 <span v-else>{{ scope.row['mainTableField'] + `(${scope.row['mainTableFieldZhName']})` }}</span>
2058 </template> 2233 </template>
2059 </el-table-column> 2234 </el-table-column>
2060 <el-table-column prop="compareTableGuid" label="选择对比表" width="180px" align="left" show-overflow-tooltip> 2235 <el-table-column prop="compareTableGuid" label="选择对比表" width="180px" align="left" show-overflow-tooltip>
2061 <template #default="scope"> 2236 <template #default="scope">
2062 <el-tree-select v-if="!props.readonly" ref="compareTreeSelectRef" filterable clearable @change="tableInteCompareSelectChange" 2237 <el-tree-select v-if="!props.readonly" ref="compareTreeSelectRef" filterable clearable
2063 v-model="scope.row['compareTableGuid']" node-key="guid" :data="contrastSubjects" placeholder="请选择" lazy 2238 @change="tableInteCompareSelectChange" v-model="scope.row['compareTableGuid']" node-key="guid"
2064 :load="(node, resolve) => treeSelectLoad(node, resolve)" :default-expanded-keys="contrastSubjects?.length ? [contrastSubjects.find(c => c.children?.some(cc => cc.guid == scope.row['compareSubjectDomainGuid'])).guid, scope.row.compareSubjectDomainGuid] : []" 2239 :data="contrastSubjects" placeholder="请选择" lazy :load="(node, resolve) => treeSelectLoad(node, resolve)"
2240 :default-expanded-keys="contrastSubjects?.length ? [contrastSubjects.find(c => c.children?.some(cc => cc.guid == scope.row['compareSubjectDomainGuid'])).guid, scope.row.compareSubjectDomainGuid] : []"
2065 :auto-expand-parent="true" :default-checked-keys="[scope.row['compareTableGuid']]" 2241 :auto-expand-parent="true" :default-checked-keys="[scope.row['compareTableGuid']]"
2066 :filter-node-method="contrastSubjectInputFilterMethod" :props="{ 2242 :filter-node-method="contrastSubjectInputFilterMethod" :props="{
2067 value: 'guid', 2243 value: 'guid',
...@@ -2075,8 +2251,11 @@ defineExpose({ ...@@ -2075,8 +2251,11 @@ defineExpose({
2075 </el-table-column> 2251 </el-table-column>
2076 <el-table-column prop="compareEnName" label="选择对比字段" width="180px" align="left" show-overflow-tooltip> 2252 <el-table-column prop="compareEnName" label="选择对比字段" width="180px" align="left" show-overflow-tooltip>
2077 <template #default="scope"> 2253 <template #default="scope">
2078 <el-select v-if="!props.readonly" v-model="scope.row['compareEnName']" placeholder="请选择" filterable clearable> 2254 <el-select v-if="!props.readonly" v-model="scope.row['compareEnName']" placeholder="请选择" filterable
2079 <el-option v-for="opt in (scope.row.compareTableGuid ? compareTableFields[scope.row.compareTableGuid] : [])" :key="opt['enName']" :label="opt['label']" :value="opt['enName']" /> 2255 clearable>
2256 <el-option
2257 v-for="opt in (scope.row.compareTableGuid ? compareTableFields[scope.row.compareTableGuid] : [])"
2258 :key="opt['enName']" :label="opt['label']" :value="opt['enName']" />
2080 </el-select> 2259 </el-select>
2081 <span v-else>{{ scope.row['compareEnName'] + `(${scope.row['compareZhName']})` }}</span> 2260 <span v-else>{{ scope.row['compareEnName'] + `(${scope.row['compareZhName']})` }}</span>
2082 </template> 2261 </template>
...@@ -2088,8 +2267,7 @@ defineExpose({ ...@@ -2088,8 +2267,7 @@ defineExpose({
2088 </el-table-column> 2267 </el-table-column>
2089 </el-table> 2268 </el-table>
2090 <div class="row-add-btn" v-if="!props.readonly"> 2269 <div class="row-add-btn" v-if="!props.readonly">
2091 <el-button link @click="addIntegralityRules" 2270 <el-button link @click="addIntegralityRules" :icon="CirclePlus" v-preReClick>添加规则</el-button>
2092 :icon="CirclePlus" v-preReClick>添加规则</el-button>
2093 </div> 2271 </div>
2094 </div> 2272 </div>
2095 2273
...@@ -2111,10 +2289,11 @@ defineExpose({ ...@@ -2111,10 +2289,11 @@ defineExpose({
2111 </div> 2289 </div>
2112 <div class="table-field-right"> 2290 <div class="table-field-right">
2113 <div class="left-title">字段列表详情</div> 2291 <div class="left-title">字段列表详情</div>
2114 <el-table ref="rowTableRef" :data="normCheckTableListData[dialogSelectSubjectTable.enName]" height="100%" :highlight-current-row="true" stripe 2292 <el-table ref="rowTableRef" :data="normCheckTableListData[dialogSelectSubjectTable.enName]" height="100%"
2115 v-loading="normCheckTableListLoading[dialogSelectSubjectTable.enName]" tooltip-effect="light" border 2293 :highlight-current-row="true" stripe v-loading="normCheckTableListLoading[dialogSelectSubjectTable.enName]"
2294 tooltip-effect="light" border
2116 :style="{ height: 'calc(100% - 32px)', width: '100%', display: 'inline-block' }"> 2295 :style="{ height: 'calc(100% - 32px)', width: '100%', display: 'inline-block' }">
2117 <el-table-column prop="enName" label="字段名" width="140px" align="left" show-overflow-tooltip> 2296 <el-table-column prop="enName" label="字段名" width="140px" align="left" show-overflow-tooltip fixed>
2118 </el-table-column> 2297 </el-table-column>
2119 <el-table-column prop="chName" label="注释" width="120px" align="left" show-overflow-tooltip> 2298 <el-table-column prop="chName" label="注释" width="120px" align="left" show-overflow-tooltip>
2120 </el-table-column> 2299 </el-table-column>
...@@ -2125,34 +2304,46 @@ defineExpose({ ...@@ -2125,34 +2304,46 @@ defineExpose({
2125 </el-table-column> 2304 </el-table-column>
2126 <el-table-column prop="checkRule" label="选择检验规则" width="150px" align="left" show-overflow-tooltip> 2305 <el-table-column prop="checkRule" label="选择检验规则" width="150px" align="left" show-overflow-tooltip>
2127 <template #default="scope"> 2306 <template #default="scope">
2128 <el-select v-if="!props.readonly" v-model="scope.row['checkRule']" placeholder="请选择" filterable clearable> 2307 <el-select v-if="!props.readonly || (scope.row.dataType == 'text' || scope.row.dataType == 'json')"
2129 <el-option v-for="opt in checkRulesList" :key="opt['paramValue']" :label="opt['paramName']" :value="opt['paramValue']" /> 2308 v-model="scope.row['checkRule']" placeholder="请选择" filterable clearable>
2309 <el-option v-for="opt in rulesListByType[scope.row.dataType]" :key="opt['paramValue']"
2310 :label="opt['paramName']" :value="opt['paramValue']" />
2130 </el-select> 2311 </el-select>
2131 <span v-else>{{ scope.row.checkRuleName ?? '--' }}</span> 2312 <span v-else>{{ scope.row.checkRuleName ?? '--' }}</span>
2132 </template> 2313 </template>
2133 </el-table-column> 2314 </el-table-column>
2134 <el-table-column label="填写配置项" width="200px" align="left"> 2315 <el-table-column label="填写配置项" width="200px" align="left">
2135 <template #default="scope"> 2316 <template #default="scope">
2136 <span v-if="!scope.row.checkRule">--</span> 2317 <span v-if="props.readonly">{{ scope.row.configValue ?? '--' }}</span>
2318 <span
2319 v-else-if="!scope.row.checkRule || ['id_card_rule', 'phone_number_rule', 'en_rule', 'ch_rule', 'num_value_rule'].includes(scope.row.checkRule)">--</span>
2137 <template v-else> 2320 <template v-else>
2138 <el-input v-show="scope.row.dataType == 'varchar' || scope.row.dataType == 'char' || scope.row.dataType == 'bit'" v-model.trim="scope.row.dataRange" clearable placeholder="多值按照分号;分隔"> </el-input> 2321 <el-input v-show="scope.row.checkRule == 'custom_regular_rule'" v-model.trim="scope.row.configValue"
2139 <div class="range-sum" v-show="scope.row.dataType == 'datetime' || scope.row.dataType == 'date'"> 2322 clearable placeholder="请输入"> </el-input>
2140 <el-date-picker 2323 <el-input v-show="scope.row.checkRule == 'precision_rule'" v-model.trim="scope.row.configValue"
2141 v-model="scope.row.dateValueRange" 2324 clearable placeholder="请输入" @input="(val) => scope.row.configValue = val.replace(/\D/g, '')">
2142 type="daterange" 2325 </el-input>
2143 range-separator="至" 2326 <el-select v-show="scope.row.checkRule == 'date_format_rule'" v-model="scope.row.configValue"
2144 start-placeholder="开始日期" 2327 placeholder="请选择" filterable clearable>
2145 end-placeholder="结束日期" 2328 <el-option
2146 format="YYYY-MM-DD" 2329 v-for="opt in scope.row.dataType == 'date' ? [{ value: 'YYYY-MM-DD' }, { value: 'YYYY/MM/DD' }] : [{ value: 'YYYY-MM-DD HH:MM:SS' }, { value: 'YYYY-MM-DD HH:MM:SS.SSS' }]"
2147 value-format="YYYY-MM-DD" 2330 :value="opt['value']" />
2148 :unlink-panels="false" 2331 </el-select>
2149 :disabled="props.readonly" 2332 <div class="range-sum" v-show="scope.row.checkRule == 'length_rule'">
2150 /> 2333 <el-select v-model="scope.row.operator" placeholder="请选择" filterable clearable
2151 </div> 2334 :style="{ width: scope.row.operator == 'between' ? 'calc(33% - 2px)' : 'calc(50% - 4px)' }">
2152 <div class="range-sum" v-show="scope.row.dataType == 'int' || scope.row.dataType == 'decimal' || scope.row.dataType == 'tinyint' || scope.row.dataType == 'timestamp' || scope.row.dataType == 'time'"> 2335 <el-option
2153 <el-input :disabled="props.readonly" v-model.trim="scope.row.startValue" placeholder="请输入" clearable> </el-input> 2336 v-for="opt in [{ value: '=' }, { value: '>' }, { value: '<' }, { value: '>=' }, { value: '<=' }, { value: 'between', label: '介于' }]"
2154 <span class="text"> </span> 2337 :key="opt['value']" :label="opt['label']" :value="opt['value']" />
2155 <el-input :disabled="props.readonly" v-model.trim="scope.row.endValue" placeholder="请输入" clearable> </el-input> 2338 </el-select>
2339 <el-input :disabled="props.readonly" v-model.trim="scope.row.value" placeholder="请输入" clearable
2340 :style="{ width: scope.row.operator == 'between' ? 'calc(33% - 2px)' : 'calc(50% - 4px)' }"
2341 @input="(val) => scope.row.value = val.replace(/\D/g, '')">
2342 </el-input>
2343 <el-input v-show="scope.row.operator == 'between'" :disabled="props.readonly"
2344 v-model.trim="scope.row.value1" placeholder="请输入" clearable :style="{ width: 'calc(33% - 2px)' }"
2345 @input="(val) => scope.row.value1 = val.replace(/\D/g, '')">
2346 </el-input>
2156 </div> 2347 </div>
2157 </template> 2348 </template>
2158 </template> 2349 </template>
...@@ -2288,6 +2479,7 @@ defineExpose({ ...@@ -2288,6 +2479,7 @@ defineExpose({
2288 width: 100%; 2479 width: 100%;
2289 display: inline-flex; 2480 display: inline-flex;
2290 align-items: center; 2481 align-items: center;
2482 justify-content: SPACE-BETWEEN;
2291 2483
2292 .text { 2484 .text {
2293 margin: 0px 4px; 2485 margin: 0px 4px;
......
...@@ -332,6 +332,33 @@ const transformRulesInfo = (info: any) => { ...@@ -332,6 +332,33 @@ const transformRulesInfo = (info: any) => {
332 })] 332 })]
333 })); 333 }));
334 } 334 }
335 } else if (info.ruleCode == 'norm_check') {
336 let subjectTables = toSubjectTables.value;
337 for (const ds in info.ruleFields) {
338 let fields = info.ruleFields[ds];
339 let tableInfo = subjectTables.find(t => t.enName === ds);
340 modelRules.push(Object.assign({}, {
341 modelGroupGuid: modelGroupGuid.value,
342 name: tableInfo.chName,
343 subjectName: tableInfo.enName,
344 subjectGuid: tableInfo.guid,
345 dataSourceGuid: tableInfo.dataSourceGuid,
346 databaseName: tableInfo.dataServerName,
347 modelRuleConfList: [Object.assign({}, info, {
348 ruleField: fields.map(f => {
349 return {
350 guid: f.guid,
351 enName: f.enName,
352 chName: f.chName,
353 dataType: f.dataType,
354 checkRule: f.checkRule,
355 configValue: f.configValue
356 }
357 }),
358 ruleFields: ''
359 })]
360 }));
361 }
335 } else if (info.ruleCode == 'ref_integrality') { 362 } else if (info.ruleCode == 'ref_integrality') {
336 let subjectTables = toSubjectTables.value; 363 let subjectTables = toSubjectTables.value;
337 info.ruleFields.forEach(row => { 364 info.ruleFields.forEach(row => {
......
...@@ -140,6 +140,25 @@ const transformRulesInfo = (info: any) => { ...@@ -140,6 +140,25 @@ const transformRulesInfo = (info: any) => {
140 }), 140 }),
141 ruleFields: '' 141 ruleFields: ''
142 }); 142 });
143 } else if (info.ruleCode == 'norm_check') {
144 let subjectName = detailInfo.value.subjectName;
145 let fields = info.ruleFields[subjectName];
146 return Object.assign({}, info, {
147 guid: ruleGuid,
148 qualityModelGuid: detailInfo.value.qualityModelGuid,
149 ruleCode: detailInfo.value.ruleCode,
150 ruleField: fields.map(f => {
151 return {
152 guid: f.guid,
153 enName: f.enName,
154 chName: f.chName,
155 dataType: f.dataType,
156 checkRule: f.checkRule,
157 configValue: f.configValue
158 }
159 }),
160 ruleFields: ''
161 });
143 } else if (info.ruleCode == 'ref_integrality') { 162 } else if (info.ruleCode == 'ref_integrality') {
144 return Object.assign({}, info, { 163 return Object.assign({}, info, {
145 guid: ruleGuid, 164 guid: ruleGuid,
......
...@@ -135,6 +135,24 @@ const transformRulesInfo = (info) => { ...@@ -135,6 +135,24 @@ const transformRulesInfo = (info) => {
135 }), 135 }),
136 ruleFields: '' 136 ruleFields: ''
137 }); 137 });
138 } else if (info.ruleCode == 'norm_check') {
139 let subjectName = modelDetailInfo.value.subjectName;
140 let fields = info.ruleFields[subjectName];
141 return Object.assign({}, info, {
142 qualityModelGuid: modelGuid,
143 ruleCode: info.ruleCode,
144 ruleField: fields.map(f => {
145 return {
146 guid: f.guid,
147 enName: f.enName,
148 chName: f.chName,
149 dataType: f.dataType,
150 checkRule: f.checkRule,
151 configValue: f.configValue
152 }
153 }),
154 ruleFields: ''
155 });
138 } else if (info.ruleCode == 'ref_integrality') { 156 } else if (info.ruleCode == 'ref_integrality') {
139 return Object.assign({}, info, { 157 return Object.assign({}, info, {
140 qualityModelGuid: modelGuid, 158 qualityModelGuid: modelGuid,
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!