d8c0a524 by xukangle

Merge branch 'develop' into dev_20241202_xukangle

2 parents 3dc89fb7 f9834367
......@@ -288,8 +288,8 @@ const getMsgCnt = () => {
}
onMounted(() => {
getMsgCnt();
createServerConnect();
//getMsgCnt();
//createServerConnect();
});
</script>
......
......@@ -24,6 +24,27 @@ const routes: RouteRecordRaw[] = [
},
},
{
path: 'task-edit',
name: 'taskEdit',
component: () => import('@/views/data_inventory/taskEdit.vue'),
meta: {
title: '编辑-',
sidebar: false,
breadcrumb: false,
cache: true,
reuse: true,
editPage: true,
activeMenu: '/data-inventory/classify-grade-manage/template-config'
},
beforeEnter: (to, from) => {
if (to.query.name) {
to.meta.title = `编辑-${to.query.name}`;
} else {
to.meta.title = '分类分级任务-新增';
}
}
},
{
path: 'template-config',
name: 'templateConfig',
component: () => import('@/views/data_inventory/templateConfig.vue'),
......
......@@ -31,6 +31,7 @@ service.interceptors.request.use(
* 为每一次请求生成一个cancleToken
*/
const source = axios.CancelToken.source();
config.headers.tenant = '6646dcad76c411eea911fa163e419da9'; //会员guid先写死
config.cancelToken = source.token;
if (config.method === "postfile") {
config.method = "post";
......
......@@ -3,14 +3,243 @@
</route>
<script lang="ts" setup name="taskConfig">
import { ref ,onMounted} from "vue";
import { ref, onMounted } from "vue";
import { useRouter, useRoute } from "vue-router";
import useUserStore from "@/store/modules/user";
import { ElMessage, ElMessageBox } from "element-plus";
import useDataAssetStore from "@/store/modules/dataAsset";
import { getListingList, listingDelete, listingUpdateStatus, filterVal, getParamsDataList } from "@/api/modules/dataProduct";
import { TableColumnWidth } from '@/utils/enum';
import Table from "@/components/Table/index.vue";
const { proxy } = getCurrentInstance() as any;
const router = useRouter();
const userStore = useUserStore();
const userData = JSON.parse(userStore.userData);
const assetStore = useDataAssetStore();
const page = ref({
limit: 50,
curr: 1,
sizes: [
{ label: "10", value: 10 },
{ label: "50", value: 50 },
{ label: "100", value: 100 },
{ label: "150", value: 150 },
{ label: "200", value: 200 },
],
});
const searchItemValue: any = ref({});
const currTableData: any = ref({});
const tableInfo = ref({
id: "mapping-table",
fields: [
{ label: "序号", type: "index", width: 56, align: "center", fixed: "left" },
{ label: "任务名称", field: "damCode", width: 96 },
{ label: "目录名称", field: "damName", width: 120 },
{ label: "分类分级模板", field: "damTypeName", width: 200 },
{ label: "元数据", field: "damTypeName", width: 200 },
// {
// label: "是否公共数据", field: "isPublicData", width: 120, getName: (scope) => {
// return scope.row.isPublicData == 'Y' ? '是' : '否';
// }
// },
{
label: "执行状态", field: "approveState", width: TableColumnWidth.STATE, align: 'center', type: "tag", getName: (scope) => {
return filterVal(scope.row.approveState, 'approveState');
}
},
{ label: "任务修改人", field: "damName", width: 120 },
{ label: "修改时间", field: "updateTime", width: TableColumnWidth.DATETIME },
{ label: "确认次数", field: "damName", width: 96, align: 'right' },
{ label: "结果确认人", field: "damName", width: 120 },
{ label: "确认时间", field: "updateTime", width: TableColumnWidth.DATETIME },
{
label: "结果状态", field: "approveState", width: TableColumnWidth.STATE, align: 'center', type: "tag", getName: (scope) => {
return filterVal(scope.row.approveState, 'approveState');
}
},
],
loading: false,
data: [],
page: {
type: "normal",
rows: 0,
...page.value,
},
actionInfo: {
label: "操作",
type: "btn",
width: 200,
btns: (scope) => {
let row = scope.row, btnArr: any = [];
if (row.approveState == 'Y') {
if (row.listingStatus == 'Y') {
btnArr.splice(0, 0, { label: "详情", value: "detail" });
} else {
btnArr.splice(0, 0, { label: "编辑", value: "edit" }, { label: "详情", value: "detail" }, { label: "删除", value: "delete" });
}
} else {
if (row.approveState == 'A') {
btnArr.splice(0, 0, { label: "详情", value: "detail" });
} else {
btnArr.splice(0, 0, { label: "编辑", value: "edit" }, { label: "详情", value: "detail" }, { label: "删除", value: "delete" });
}
}
return btnArr;
},
},
});
const getTableData = () => {
tableInfo.value.loading = true;
getListingList(
Object.assign({}, searchItemValue.value, {
pageIndex: page.value.curr,
pageSize: page.value.limit,
})
).then((res: any) => {
tableInfo.value.loading = false;
tableInfo.value.data = res.data.records || [];
tableInfo.value.page.curr = res.data.pageIndex;
tableInfo.value.page.limit = res.data.pageSize;
tableInfo.value.page.rows = res.data.totalRows;
})
.catch((res) => {
tableInfo.value.loading = false;
});
};
const tableBtnClick = (scope, btn) => {
const type = btn.value;
const row = scope.row;
currTableData.value = row;
if (type == "detail" || type === "edit") {
toPath(type);
} else if (type === "delete") {
open("此操作将永久删除,是否继续?", "warning");
}
};
const toPath = (type) => {
if (type == 'add') {
router.push({
name: "taskEdit",
query: {
type
},
});
} else {
router.push({
name: "taskEdit",
query: {
guid: currTableData.value.guid,
name: currTableData.value.damName,
type
},
});
}
}
const tablePageChange = (info) => {
page.value.curr = Number(info.curr);
page.value.limit = Number(info.limit);
tableInfo.value.page.limit = page.value.limit;
tableInfo.value.page.curr = page.value.curr;
getTableData();
};
const open = (msg, type, isBatch = false) => {
ElMessageBox.confirm(msg, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: type,
}).then(() => {
const guids = [currTableData.value.guid];
listingDelete(guids).then((res: any) => {
if (res.code == proxy.$passCode) {
getFirstPageData();
ElMessage({
type: "success",
message: "删除成功",
});
} else {
ElMessage({
type: "error",
message: res.msg,
});
}
}).catch((res) => {
tableInfo.value.loading = false;
});
});
};
const getFirstPageData = () => {
page.value.curr = 1
tableInfo.value.page.curr = 1;
getTableData();
}
onActivated(() => {
if (assetStore.isRefresh) {//如果是首次加载,则不需要调用
getFirstPageData();
assetStore.set(false);
}
})
onBeforeMount(() => {
})
</script>
<template>
<div>分类分级任务</div>
<div class="container_wrap" v-if="tableInfo.data.length">
<div class="table_tool_wrap">
<div class="table_title">分类分级任务</div>
</div>
<div class="table_panel_wrap">
<Table :tableInfo="tableInfo" @tableBtnClick="tableBtnClick" @tablePageChange="tablePageChange" />
</div>
</div>
<div class="container_wrap" v-else>
<div class="card-noData">
<img src="@/assets/images/no-data.png" :style="{ width: '96px', height: '96px' }" />
<p>暂无分类分级任务,<span class="text_btn" @click="toPath('add')">去新建</span></p>
</div>
</div>
</template>
<style lang="scss" scoped>
<style scoped lang="scss">
.table_tool_wrap {
width: 100%;
height: 40px !important;
padding: 0 8px;
.table_title {
height: 40px;
line-height: 40px;
font-weight: 600;
font-size: 16px;
color: #212121;
}
}
.table_panel_wrap {
width: 100%;
height: calc(100% - 40px);
padding: 0px 8px 0;
}
.card-noData {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: flex;
flex-direction: column;
align-items: center;
}
</style>
......
<route lang="yaml">
name: taskEdit //分类分级任务编辑
</route>
<script lang="ts" setup name="taskEdit">
import { ref, onMounted } from "vue";
import { useRouter, useRoute } from "vue-router";
import useUserStore from "@/store/modules/user";
import { ElMessage, ElMessageBox } from "element-plus";
import { Search } from "@element-plus/icons-vue";
import useDataAssetStore from "@/store/modules/dataAsset";
import { getListingList, listingDelete, listingUpdateStatus, filterVal, getParamsDataList } from "@/api/modules/dataProduct";
import { TableColumnWidth } from '@/utils/enum';
import Table from "@/components/Table/index.vue";
const { proxy } = getCurrentInstance() as any;
const router = useRouter();
const userStore = useUserStore();
const userData = JSON.parse(userStore.userData);
const assetStore = useDataAssetStore();
const step = ref(0);
const selectIndex = ref(0);
const asideSearchInput = ref("");
const permissionList: any = ref([])
const listLoading = ref(false)
const listPage = ref({
limit: 50,
curr: 1,
totalPages: 0
})
const currpermissionList: any = ref([
{
"guid": "62d01ad586774db2bb3955dfb2d18366",
"productGuid": null,
"productName": null,
"dataPermissionName": "当前用户",
"bizState": "Y",
"createUserName": "数往知来管理员",
"createTime": "2024-01-24 14:08:43",
"sqlScript": null,
"dataSourceGuid": null
},
{
"guid": "d68a27c1998540a2b8e8f22a2d5eebef",
"productGuid": null,
"productName": null,
"dataPermissionName": "组织权限",
"bizState": "Y",
"createUserName": "数往知来管理员",
"createTime": "2024-01-24 11:47:02",
"sqlScript": null,
"dataSourceGuid": null
}
])
const templateInfo = ref({
title: '医疗数据分类分级模板',
descGroup: [
{ label: '模型确认人', value: '管理员 ' },
{ label: '模型确认时间', value: '2021-12-12 09:12:13' },
],
tags: [
{ type: 'info', name: '医疗行业分类' },
{ type: 'success', name: '五级' },
{ type: 'primary', name: 'V5' },
],
desc: '适用于各级医疗机构、卫生健康管理部门、公共卫生服务机构、相关专项业务服务机构、相关信息技术服务机构等开展医疗健康数据分类分级。适用于各级医疗机构、卫生健康管理部门、公共卫生服务机构、相关专项业务服务机构、相关信息技术服务机构等开展医疗健康数据分类分级。适用于各级医疗机构、卫生健康。'
})
const treeIndex: any = ref({})
const treeInfo = ref({
id: "data-pickup-tree",
filter: true,
queryValue: "",
queryPlaceholder: "输入组织名称搜索",
props: {
label: "organisationName",
value: "guid",
},
nodeKey: 'guid',
expandedKey: [],
expandOnNodeClick: false,
data: [
{
"children": [
{
"children": null,
"parentGuids": [
"c32ddd77191ff4afe149538ef4b2e0c3"
],
"guid": "9c92df55a19cdce88f61e20a8e1e8a65",
"tenantGuid": "9e5b9d7bfd8c4f4f8079e05de19bf7e0",
"organisationCode": "11150001",
"organisationName": "链享供应链运营一部",
"bizState": "Y",
"createTime": "2023-10-25 14:23:31",
"createUserName": "测试",
"parentGuid": "c32ddd77191ff4afe149538ef4b2e0c3",
"orderNum": 1,
"level": 2,
"levelCode": "1.1",
"displayCreateTime": "2023-10-25 14:23:31"
}
],
"parentGuids": null,
"guid": "c32ddd77191ff4afe149538ef4b2e0c3",
"tenantGuid": "9e5b9d7bfd8c4f4f8079e05de19bf7e0",
"organisationCode": "1115004",
"organisationName": "链享供应链",
"bizState": "Y",
"createTime": "2023-08-15 12:59:10",
"createUserName": "测试",
"parentGuid": "",
"orderNum": 2,
"level": 0,
"levelCode": "1",
"displayCreateTime": "2023-08-15 12:59:10"
},
{
"children": [
{
"children": [
{
"children": null,
"parentGuids": [
"e10332122834077907cd5ea61fa576c1",
"cdae7bb3cafb560482cad1b89a1e4b78"
],
"guid": "16ea472a155c07433a63220f2ae1afe9",
"tenantGuid": "9e5b9d7bfd8c4f4f8079e05de19bf7e0",
"organisationCode": "11160011",
"organisationName": "链享运营一部1组",
"bizState": "S",
"createTime": "2023-10-25 13:15:57",
"createUserName": "测试",
"parentGuid": "cdae7bb3cafb560482cad1b89a1e4b78",
"orderNum": 1,
"level": 2,
"levelCode": "2.1.1",
"displayCreateTime": "2023-10-25 13:15:57"
}
],
"parentGuids": [
"e10332122834077907cd5ea61fa576c1"
],
"guid": "cdae7bb3cafb560482cad1b89a1e4b78",
"tenantGuid": "9e5b9d7bfd8c4f4f8079e05de19bf7e0",
"organisationCode": "1116001",
"organisationName": "链享运营一部",
"bizState": "S",
"createTime": "2023-10-25 13:14:15",
"createUserName": "测试",
"parentGuid": "e10332122834077907cd5ea61fa576c1",
"orderNum": 1,
"level": 1,
"levelCode": "2.1",
"displayCreateTime": "2023-10-25 13:14:15"
},
{
"children": null,
"parentGuids": [
"e10332122834077907cd5ea61fa576c1"
],
"guid": "d98b44ffb35e4d17cf68f9a922e1c7b7",
"tenantGuid": "9e5b9d7bfd8c4f4f8079e05de19bf7e0",
"organisationCode": null,
"organisationName": "二部",
"bizState": "Y",
"createTime": "2023-10-26 09:45:36",
"createUserName": "测试",
"parentGuid": "e10332122834077907cd5ea61fa576c1",
"orderNum": 2,
"level": 1,
"levelCode": "2.2",
"displayCreateTime": "2023-10-26 09:45:36"
}
],
"parentGuids": null,
"guid": "e10332122834077907cd5ea61fa576c1",
"tenantGuid": "9e5b9d7bfd8c4f4f8079e05de19bf7e0",
"organisationCode": "1115005",
"organisationName": "链享医药",
"bizState": "Y",
"createTime": "2023-09-12 15:59:35",
"createUserName": "测试",
"parentGuid": null,
"orderNum": 3,
"level": 0,
"levelCode": "2",
"displayCreateTime": "2023-09-12 15:59:35"
},
{
"children": [
{
"children": null,
"parentGuids": [
"9bd46f0f4fcf429518fae6ecb4849a9e"
],
"guid": "870f23ae47e036eb88b35f726c31959b",
"tenantGuid": "9e5b9d7bfd8c4f4f8079e05de19bf7e0",
"organisationCode": null,
"organisationName": "运用三部",
"bizState": "Y",
"createTime": "2024-04-28 16:33:24",
"createUserName": "数往知来管理员",
"parentGuid": "9bd46f0f4fcf429518fae6ecb4849a9e",
"orderNum": 3,
"level": 1,
"levelCode": "3.3",
"displayCreateTime": "2024-04-28 16:33:24"
},
{
"children": null,
"parentGuids": [
"9bd46f0f4fcf429518fae6ecb4849a9e"
],
"guid": "e06049046241dd71b153f227dbe7f801",
"tenantGuid": "9e5b9d7bfd8c4f4f8079e05de19bf7e0",
"organisationCode": null,
"organisationName": "运营二部",
"bizState": "Y",
"createTime": "2023-11-14 16:01:50",
"createUserName": "数往知来管理员",
"parentGuid": "9bd46f0f4fcf429518fae6ecb4849a9e",
"orderNum": 40,
"level": 1,
"levelCode": "3.2",
"displayCreateTime": "2023-11-14 16:01:50"
},
{
"children": null,
"parentGuids": [
"9bd46f0f4fcf429518fae6ecb4849a9e"
],
"guid": "731cd185c868da8af48b492068ffaed4",
"tenantGuid": "9e5b9d7bfd8c4f4f8079e05de19bf7e0",
"organisationCode": null,
"organisationName": "运营一部",
"bizState": "Y",
"createTime": "2023-11-14 15:19:35",
"createUserName": "测试",
"parentGuid": "9bd46f0f4fcf429518fae6ecb4849a9e",
"orderNum": 41,
"level": 1,
"levelCode": "3.1",
"displayCreateTime": "2023-11-14 15:19:35"
}
],
"parentGuids": null,
"guid": "9bd46f0f4fcf429518fae6ecb4849a9e",
"tenantGuid": "9e5b9d7bfd8c4f4f8079e05de19bf7e0",
"organisationCode": null,
"organisationName": "药企服务事业部1",
"bizState": "Y",
"createTime": "2023-11-14 14:49:14",
"createUserName": "数往知来管理员",
"parentGuid": "",
"orderNum": 4,
"level": 0,
"levelCode": "3",
"displayCreateTime": "2023-11-14 14:49:14"
},
{
"children": [
{
"children": null,
"parentGuids": [
"23be149ea3167a3f7f2d383023336efe"
],
"guid": "e5f2b4958ee2d99309a41e0c6e1447c8",
"tenantGuid": "9e5b9d7bfd8c4f4f8079e05de19bf7e0",
"organisationCode": null,
"organisationName": "智能存储装备部",
"bizState": "Y",
"createTime": "2023-11-14 16:09:36",
"createUserName": "数往知来管理员",
"parentGuid": "23be149ea3167a3f7f2d383023336efe",
"orderNum": 51,
"level": 1,
"levelCode": "4.1",
"displayCreateTime": "2023-11-14 16:09:36"
}
],
"parentGuids": null,
"guid": "23be149ea3167a3f7f2d383023336efe",
"tenantGuid": "9e5b9d7bfd8c4f4f8079e05de19bf7e0",
"organisationCode": null,
"organisationName": "医药物联网事业部",
"bizState": "Y",
"createTime": "2023-11-14 15:11:35",
"createUserName": "数往知来管理员",
"parentGuid": "",
"orderNum": 5,
"level": 0,
"levelCode": "4",
"displayCreateTime": "2023-11-14 15:11:35"
},
{
"children": null,
"parentGuids": null,
"guid": "1d82e875163749ca9ae45809ec432ae8",
"tenantGuid": "9e5b9d7bfd8c4f4f8079e05de19bf7e0",
"organisationCode": null,
"organisationName": "财务管理中心",
"bizState": "S",
"createTime": "2023-11-14 15:14:07",
"createUserName": "数往知来管理员",
"parentGuid": "",
"orderNum": 6,
"level": 0,
"levelCode": "6",
"displayCreateTime": "2023-11-14 15:14:07"
},
{
"children": null,
"parentGuids": null,
"guid": "cd9e6a0c76102364a9e88b79b28b0b32",
"tenantGuid": "9e5b9d7bfd8c4f4f8079e05de19bf7e0",
"organisationCode": null,
"organisationName": "资产服务",
"bizState": "Y",
"createTime": "2024-08-14 11:40:33",
"createUserName": "数往知来管理员",
"parentGuid": "",
"orderNum": 7,
"level": 0,
"levelCode": "9",
"displayCreateTime": "2024-08-14 11:40:33"
},
{
"children": [
{
"children": null,
"parentGuids": [
"dac448b77fa35f798bb4a06d8fd86334"
],
"guid": "cb76777efe69182cfb2c75d41944553c",
"tenantGuid": "9e5b9d7bfd8c4f4f8079e05de19bf7e0",
"organisationCode": null,
"organisationName": "审批1",
"bizState": "Y",
"createTime": "2024-01-17 14:28:36",
"createUserName": "数往知来管理员",
"parentGuid": "dac448b77fa35f798bb4a06d8fd86334",
"orderNum": 100,
"level": 1,
"levelCode": "8.1",
"displayCreateTime": "2024-01-17 14:28:36"
}
],
"parentGuids": null,
"guid": "dac448b77fa35f798bb4a06d8fd86334",
"tenantGuid": "9e5b9d7bfd8c4f4f8079e05de19bf7e0",
"organisationCode": null,
"organisationName": "审批组织",
"bizState": "Y",
"createTime": "2024-01-16 11:38:24",
"createUserName": "数往知来管理员",
"parentGuid": "",
"orderNum": 99,
"level": 0,
"levelCode": "8",
"displayCreateTime": "2024-01-16 11:38:24"
}
],
});
const expand1 = ref(true)
const expand2 = ref(true)
const taskFormItems: any = ref([
{
label: '任务名称',
type: 'input',
placeholder: '请输入',
field: 'taskName',
default: '',
maxlength: 50,
required: true
},
{
label: '分级分类目录名称',
type: 'input',
placeholder: '请输入',
field: 'catalogName',
default: '',
maxlength: 50,
required: true
},
])
const taskFormRules = ref({
taskName: [
{ required: true, trigger: 'blur', message: "请填写任务名称" }
],
catalogName: [
{ required: true, trigger: 'blur', message: "请填写分级分类目录名称" }
],
});
const page = ref({
limit: 50,
curr: 1,
sizes: [
{ label: "10", value: 10 },
{ label: "50", value: 50 },
{ label: "100", value: 100 },
{ label: "150", value: 150 },
{ label: "200", value: 200 },
],
});
const searchItemValue: any = ref({});
const currTableData: any = ref({});
const tableInfo = ref({
id: "mapping-table",
fields: [
{ label: "序号", type: "index", width: 56, align: "center", fixed: "left" },
{ label: "标签", field: "damCode", width: 96 },
{ label: "分类", field: "damTypeName", width: 380 },
{ label: "分级", field: "damName", width: 55 },
{ label: "规则", field: "damTypeName", width: 380 },
],
loading: false,
data: [],
page: {
type: "normal",
rows: 0,
...page.value,
},
actionInfo: {
show: false
},
});
const metadataTableInfo = ref({
id: "metadata-table",
fields: [
{ label: "序号", type: "index", width: 56, align: "center", fixed: "left" },
{ label: "数据库名称", field: "damCode", width: 200 },
{ label: "数据库名", field: "damTypeName", width: 200 },
{ label: "总表数", field: "damName", width: 120, align: "right" },
{ label: "存储量(约/MB)", field: "damTypeName", width: 200, align: "right" },
],
loading: false,
data: [],
page: {
type: "normal",
rows: 0,
...page.value,
},
actionInfo: {
show: false
},
})
const nodeClick = (data) => {
treeIndex.value = data
}
const getTableData = () => {
tableInfo.value.loading = true;
getListingList(
Object.assign({}, searchItemValue.value, {
pageIndex: page.value.curr,
pageSize: page.value.limit,
})
).then((res: any) => {
tableInfo.value.loading = false;
tableInfo.value.data = res.data.records || [];
tableInfo.value.page.curr = res.data.pageIndex;
tableInfo.value.page.limit = res.data.pageSize;
tableInfo.value.page.rows = res.data.totalRows;
})
.catch((res) => {
tableInfo.value.loading = false;
});
};
const tableBtnClick = (scope, btn) => {
const type = btn.value;
const row = scope.row;
currTableData.value = row;
if (type == "detail" || type === "edit") {
toPath(type);
} else if (type === "delete") {
open("此操作将永久删除,是否继续?", "warning");
}
};
const toPath = (type = null) => {
router.push({
name: "taskConfig",
query: {
type
},
});
}
const tablePageChange = (info) => {
page.value.curr = Number(info.curr);
page.value.limit = Number(info.limit);
tableInfo.value.page.limit = page.value.limit;
tableInfo.value.page.curr = page.value.curr;
getTableData();
};
const open = (msg, type, isBatch = false) => {
ElMessageBox.confirm(msg, "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: type,
}).then(() => {
const guids = [currTableData.value.guid];
listingDelete(guids).then((res: any) => {
if (res.code == proxy.$passCode) {
getFirstPageData();
ElMessage({
type: "success",
message: "删除成功",
});
} else {
ElMessage({
type: "error",
message: res.msg,
});
}
}).catch((res) => {
tableInfo.value.loading = false;
});
});
};
const getFirstPageData = () => {
page.value.curr = 1
tableInfo.value.page.curr = 1;
getTableData();
}
const querySearch = (queryString: string) => {
listLoading.value = true
const results = queryString
? currpermissionList.value.filter(item => item.dataPermissionName.indexOf(queryString) > -1)
: permissionList.value;
currpermissionList.value = results
listLoading.value = false
}
const btnClick = async (btn, bType = null) => {
const type = btn.value;
if (type == 'next') {
step.value++;
} else if (type == 'prev') {
step.value--;
} else {
toPath()
}
};
// 监听滚动事件
const handleScroll = () => {
if (listPage.value.curr < listPage.value.totalPages) {
listPage.value.curr++
getPermissionList({})
}
}
const changTable = () => {
// toSearch({})
};
const getPermissionList = (val, init = false) => {
let params: any = val ? { ...val } : {}
params.pageIndex = listPage.value.curr;
params.pageSize = listPage.value.limit;
listLoading.value = true
// getPermissionDictList(params).then((res: any) => {
// if (res.code == proxy.$passCode) {
// const data = res.data?.records || []
// if (init) {
// permissionList.value = JSON.parse(JSON.stringify(data))
// currpermissionList.value = JSON.parse(JSON.stringify(data))
// listPage.value.totalPages = res.data.totalPages
// toSearch({})
// } else {
// permissionList.value.push(...JSON.parse(JSON.stringify(data)))
// querySearch(asideSearchInput.value)
// }
// }
// listLoading.value = false
// }).catch(() => {
// listLoading.value = false
// })
}
onActivated(() => {
})
onBeforeMount(() => {
})
</script>
<template>
<div class="container_wrap full flex">
<div class="aside_wrap" v-show="step == 0">
<div class="aside_title">选择分类分级模板</div>
<div class="aside_search">
<el-input v-model.trim="asideSearchInput" placeholder="请输入关键字" :prefix-icon="Search" clearable
@change="querySearch" />
</div>
<div class="aside_list" v-loading="listLoading" v-infinite-scroll="handleScroll">
<div class="list_item" v-for="(item, i) in currpermissionList" :class="{ active: selectIndex == i }"
@click="selectIndex = i; changTable();" v-preReClick>{{ item.dataPermissionName }}</div>
</div>
</div>
<div class="main_wrap" :class="{ full: step == 1 }">
<div class="content_main" v-show="step == 0">
<div class="template_panel">
<div class="panel_title">
<span class="title_text">{{ templateInfo.title }}</span>
<div class="title_desc">
<div class="desc_group" v-for="desc in templateInfo.descGroup">
<span class="desc_label">{{ desc.label }}</span>
<span class="desc_value">{{ desc.value }}</span>
</div>
</div>
</div>
<div class="panel_tags">
<el-tag v-for="tag in templateInfo.tags" :type="tag.type">{{ tag.name }}</el-tag>
</div>
<p class="panel_desc">{{ templateInfo.desc }}</p>
</div>
<div class="panel_content">
<div class="box_left">
<div class="aside_title">分类分级目录</div>
<Tree :treeInfo="treeInfo" @nodeClick="nodeClick" />
</div>
<div class="box_right">
<el-breadcrumb separator="/">
<el-breadcrumb-item>全部</el-breadcrumb-item>
<el-breadcrumb-item>promotion management</el-breadcrumb-item>
<el-breadcrumb-item>promotion list</el-breadcrumb-item>
<el-breadcrumb-item>promotion detail</el-breadcrumb-item>
</el-breadcrumb>
<div class="table_panel_wrap">
<Table :tableInfo="tableInfo" @tableBtnClick="tableBtnClick" @tablePageChange="tablePageChange" />
</div>
</div>
</div>
</div>
<div class="content_main panel" v-show="step == 1">
<ContentWrap id="id-approveInfo" title="创建任务" expandSwicth style="margin-top: 15px" :isExpand="expand1"
@expand="(v) => expand1 = v">
<div class="form_panel">
<Form ref="taskFormRef" formId="edit-standard-form" :itemList="taskFormItems" :rules="taskFormRules"
col="col3" />
</div>
</ContentWrap>
<ContentWrap id="id-approveInfo" title="选择元数据" expandSwicth style="margin-top: 15px" :isExpand="expand2"
@expand="(v) => expand2 = v">
<Table :tableInfo="metadataTableInfo" />
</ContentWrap>
</div>
<div class="tool_btns">
<div class="btns">
<el-button @click="btnClick({ value: 'cancel' })" v-if="step == 0">取消</el-button>
<el-button @click="btnClick({ value: 'prev' })" v-if="step == 1">上一步</el-button>
<el-button type="primary" @click="btnClick({ value: 'next' })" v-if="step == 0">下一步</el-button>
<el-button type="primary" @click="btnClick({ value: 'path' })" v-if="step == 1">后台运行</el-button>
</div>
</div>
</div>
</div>
</template>
<style scoped lang="scss">
.container_wrap {
.aside_wrap {
width: 199px;
border-right: 1px solid #d9d9d9;
box-shadow: none;
.aside_title {
width: calc(100% - 32px);
display: inline-block;
}
.icon-add.el-icon {
width: 24px;
height: 24px;
vertical-align: middle;
cursor: pointer;
svg {
width: 24px;
height: 24px;
}
}
.tree_panel {
height: calc(100% - 72px);
padding-top: 0;
border-bottom: 1px solid #d9d9d9;
:deep(.el-tree) {
margin: 0;
height: calc(100% - 32px);
overflow: hidden auto;
}
}
.page_nav_wrap.concise {
justify-content: center;
}
}
}
.container_wrap {
overflow: hidden auto;
.main_wrap {
padding: 0;
&.full {
width: 100%;
}
.content_main {
display: flex;
flex-direction: column;
height: calc(100% - 45px);
overflow: hidden auto;
flex: 1;
&.panel {
padding: 0 16px;
}
.template_panel {
padding: 0 8px;
.panel_title {
display: flex;
justify-content: space-between;
align-items: center;
margin: 8px 0;
.title_text {
font-size: 16px;
color: #212121;
line-height: 24px;
font-weight: 600;
}
.title_desc {
display: flex;
.desc_group {
margin-left: 16px;
}
}
}
.panel_tags {
.el-tag {
margin-right: 8px;
}
}
.panel_desc {
margin: 8px 0;
font-size: 14px;
color: #666;
}
}
.panel_content {
height: 100%;
display: flex;
flex: 1;
border-top: 1px solid #d9d9d9;
.box_left {
width: 240px;
height: 100%;
border-right: 1px solid #d9d9d9;
.aside_title {
padding: 0 8px;
height: 40px;
line-height: 40px;
font-size: 14px;
color: #212121;
font-weight: 600;
}
.tree_panel {
padding: 0;
}
}
.box_right {
width: 100%;
.el-breadcrumb {
padding: 0 12px;
line-height: 40px;
}
}
}
.table_panel_wrap {
width: 100%;
height: calc(100% - 40px);
padding: 0 12px;
}
}
.tool_btns {
height: 44px;
margin: 0 -8px;
display: flex;
justify-content: center;
align-items: center;
border-top: 1px solid #d9d9d9;
}
}
}
</style>
......@@ -129,6 +129,27 @@ watch(() => props.largeCategoryList, (val) => {
/** 规范性检验规则 */
const checkRulesList: any = ref([]);
/** 根据不同的数据类型显示对应的规则 */
const rulesListByType: any = computed(() => {
if (!checkRulesList.value.length) {
return {};
}
return {
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'),
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'),
int: checkRulesList.value.filter(r => r.paramValue == 'length_rule' || r.paramValue == 'num_value_rule' || r.paramValue == 'custom_regular_rule'),
date: checkRulesList.value.filter(r => r.paramValue == 'date_format_rule' || r.paramValue == 'custom_regular_rule'),
datetime: checkRulesList.value.filter(r => r.paramValue == 'date_format_rule' || r.paramValue == 'custom_regular_rule'),
timestamp: checkRulesList.value.filter(r => r.paramValue == 'custom_regular_rule' || r.paramValue == 'custom_regular_rule'),
// text: checkRulesList.value.filter(r => r.paramValue == ''),
decimal: checkRulesList.value.filter(r => r.paramValue == 'length_rule' || r.paramValue == 'precision_rule' || r.paramValue == 'num_value_rule' || r.paramValue == 'custom_regular_rule'),
// json: checkRulesList.value.filter(r => r.paramValue == ''),
tinyint: checkRulesList.value.filter(r => r.paramValue == 'length_rule' || r.paramValue == 'num_value_rule' || r.paramValue == 'custom_regular_rule'),
time: checkRulesList.value.filter(r => r.paramValue == 'custom_regular_rule'),
bit: checkRulesList.value.filter(r => r.paramValue == 'ch_rule' || r.paramValue == 'en_rule' || r.paramValue == 'custom_regular_rule'),
}
});
onBeforeMount(() => {
if (props.ruleTypeList?.length) {
if (props.ruleTypeValue) {
......@@ -166,6 +187,7 @@ onBeforeMount(() => {
getCheckRulesList().then((res: any) => {
if (res.code == proxy.$passCode) {
checkRulesList.value = res.data || [];
} else {
ElMessage.error(res.msg);
}
......@@ -766,7 +788,7 @@ const formBtnClick = (btn) => {
normCheckDialogVisible.value = true;
tableListInfo.value.data = props.toSubjectTables;
dialogSelectSubjectTable.value = props.toSubjectTables[0];
let defaultValue = panelList.value[12].defaultValue;
let defaultValue = panelList.value[14].defaultValue;
normCheckTableListData.value[dialogSelectSubjectTable.value.enName] = [];
if (props.toSubjectTables[0]?.guid) {
normCheckTableListLoading.value[dialogSelectSubjectTable.value.enName] = true;
......@@ -781,7 +803,14 @@ const formBtnClick = (btn) => {
let fIndex = data.findIndex(d => d.enName == field.enName);
if (fIndex > -1) {
let f = normCheckTableListData.value[dialogSelectSubjectTable.value.enName][fIndex];
Object.assign(f, field);
f.checkRule = field.checkRule;
f.configValue = field.configValue;
if (f.checkRule == 'length_rule') {
let vSplit = f.configValue.split('#');
f.operator = vSplit[0];
f.value = vSplit[1];
f.value1 = vSplit[2];
}
}
});
}
......@@ -938,6 +967,22 @@ const setPanelListValue = (item, isSelectChange = false, init = false, radioGrou
p.default = '';
p.defaultValue = {};
}
} else if (ruleCode == 'norm_check' && p.field == 'ruleSettings-norm-check') {
if (!init) {
p.default = val[field];
return;
}
if (val.ruleField?.length) {
p.default = val.ruleField?.map(f => f.enName)?.join(';');
let ruleFields = {};
ruleFields[val.subjectName] = val.ruleField || [];
p.defaultValue = {
ruleFields: ruleFields
}
} else {
p.default = '';
p.defaultValue = {};
}
} else if (p.field == 'largeCategory') {
/** 此处有歧义,若是切换规则类型,修改默认值,可能会出现,用户先修改了规则大类,但是切换类型之后,被我还原了。 */
if (radioGroupChange && !init) {
......@@ -1127,6 +1172,42 @@ const listItemClick = (data) => {
ElMessage.error(res.msg);
}
})
} else if (ruleType.value == 'norm_check') {
if (normCheckTableListData.value[dialogSelectSubjectTable.value.enName]?.length) {
return;
}
let defaultValue = panelList.value[14].defaultValue;
normCheckTableListLoading.value[dialogSelectSubjectTable.value.enName] = true;
getSubjectFields(data.guid).then((res: any) => {
normCheckTableListLoading.value[dialogSelectSubjectTable.value.enName] = false;
if (res.code == proxy.$passCode) {
let data = res.data || [];
normCheckTableListData.value[dialogSelectSubjectTable.value.enName] = data;
let valueFields = defaultValue.ruleFields?.[dialogSelectSubjectTable.value.enName] || [];
if (valueFields.length) {
valueFields.forEach(field => {
let fIndex = data.findIndex(d => d.enName == field.enName);
if (fIndex > -1) {
let f = normCheckTableListData.value[dialogSelectSubjectTable.value.enName][fIndex];
if (field.checkRule) {
f.checkRule = field.dataRange;
f.configValue = field.configValue;
if (field.checkRule == 'length_rule') {
let vLen = f.configValue?.split('#');
if (vLen?.length > 1) {
f.operator = vLen[0];
f.value = vLen[1];
f.value1 = vLen[2]
}
}
}
}
});
}
} else {
ElMessage.error(res.msg);
}
})
}
}
......@@ -1634,6 +1715,8 @@ const valueRangeTableListLoading = ref({});
const valueRangeTableListData = ref({});
const valueCheckFormListRef = ref();
const cancelValueRangeDialog = () => {
valueRangeDialogVisible.value = false;
}
......@@ -1649,26 +1732,27 @@ const submitValueRange = () => {
let ruleFields: any = []
for (const field of valueTableFields) {
if (field.startValue != null && field.endValue == null || (field.endValue != null && field.startValue == null)) {
if (dialogSelectSubjectTable.value.enName != table) {
valueCheckFormListRef.value.setSelectList(table, 'enName');
}
ElMessage.error(`表【${table}】的字段【${field.enName}】设置了值域,但范围未填写完整`);
return;
}
if (field.startValue) {
ruleFields.push(field);
}
if (field.dataRange) {
} else if (field.dataRange) {
ruleFields.push(field);
}
if (field.dateValueRange?.length > 0) {
} else if (field.dateValueRange?.length > 0) {
field.startValue = field.dateValueRange[0];
field.endValue = field.dateValueRange[1];
ruleFields.push(field);
}
}
if (ruleFields.length) {
v.push(table);
ruleFieldsJson[table] = ruleFields;
}
}
}
if (!v.length) {
ElMessage.error('当前未给表字段设置值域!');
return;
......@@ -1792,12 +1876,97 @@ const normCheckTableListLoading = ref({});
const normCheckTableListData = ref({});
const normCheckFormListRef = ref();
const cancelNormCheckDialog = () => {
normCheckDialogVisible.value = false;
}
const submitNormCheck = () => {
let v: any = [];
let ruleFieldsJson: any = {};
for (const table in normCheckTableListData.value) {
if (!normCheckTableListData.value[table]?.length) {
continue;
}
let valueTableFields = normCheckTableListData.value[table];
let ruleFields: any = []
for (const field of valueTableFields) {
if (!field.checkRule) {
continue;
}
if ((field.checkRule == 'custom_regular_rule' || field.checkRule == 'precision_rule' || field.checkRule == 'date_format_rule') && field.configValue == null) {
if (dialogSelectSubjectTable.value.enName != table) {
normCheckFormListRef.value.setSelectList(table, 'enName');
}
ElMessage.error(`表【${table}】的字段【${field.enName}】设置了校验规则,但未填写配置项`);
return;
}
if (field.checkRule == 'length_rule') {
if (!field.operator) {
if (dialogSelectSubjectTable.value.enName != table) {
normCheckFormListRef.value.setSelectList(table, 'enName');
}
ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,但未选择操作符`);
return;
}
if (!field.value) {
if (dialogSelectSubjectTable.value.enName != table) {
normCheckFormListRef.value.setSelectList(table, 'enName');
}
ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,但未填写长度值`);
return;
}
if (field.operator == 'between') {
if (!field.value1) {
if (dialogSelectSubjectTable.value.enName != table) {
normCheckFormListRef.value.setSelectList(table, 'enName');
}
ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,但长度值未填写完整`);
return;
}
if (parseInt(field.value) >= parseInt(field.value1)) {
if (dialogSelectSubjectTable.value.enName != table) {
normCheckFormListRef.value.setSelectList(table, 'enName');
}
ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,介于操作符对应的数值需符合后者大于前者`);
return;
}
field.configValue = field.operator + '#' + field.value + '#' + field.value1;
} else {
field.configValue = field.operator + '#' + field.value;
}
}
ruleFields.push(field);
}
if (ruleFields.length) {
v.push(table);
ruleFieldsJson[table] = ruleFields;
}
}
if (!v.length) {
ElMessage.error('当前未给表字段设置规范检验规则!');
return;
}
let index = 14;
panelList.value[index].defaultValue = {
ruleFields: ruleFieldsJson
};
let str = "";
for (const key in ruleFieldsJson) {
let field = ruleFieldsJson[key];
str = str + (str ? ';' : '') + field.map(f => f.enName).join(',');;
}
let formInline = oldOriginValue.value = Object.assign({
qualityModelGuids: props.toSubjectTables.map(s => s.guid),
parity: 1,
compareWay: 1,
jointly: 'N',
bizState: 'Y'
}, oldOriginValue.value, ruleFormRef.value.formInline);
formInline[`${panelList.value[index].field}`] = str;
setPanelListValue(formInline);
normCheckDialogVisible.value = false;
}
const getFormInfo = () => {
......@@ -1836,8 +2005,7 @@ const getFormInfo = () => {
} else if (formInline.ruleCode == 'value_of_range') {
let v = panelList.value[12].defaultValue;
return Object.assign({}, formInline, v, {
ruleName: ruleName,
ruleFields: v
ruleName: ruleName
});
} else if (formInline.ruleCode == 'ref_integrality') {
let v = panelList.value[13].defaultValue;
......@@ -1845,6 +2013,11 @@ const getFormInfo = () => {
ruleName: ruleName,
ruleFields: v
});
} else if (formInline.ruleCode == 'norm_check') {
let v = panelList.value[14].defaultValue;
return Object.assign({}, formInline, v, {
ruleName: ruleName
});
}
}
......@@ -1984,8 +2157,9 @@ defineExpose({
</div>
<div class="table-field-right">
<div class="left-title">字段列表详情</div>
<el-table ref="rowTableRef" :data="valueRangeTableListData[dialogSelectSubjectTable.enName]" height="100%" :highlight-current-row="true" stripe
v-loading="valueRangeTableListLoading[dialogSelectSubjectTable.enName]" tooltip-effect="light" border
<el-table ref="rowTableRef" :data="valueRangeTableListData[dialogSelectSubjectTable.enName]" height="100%"
:highlight-current-row="true" stripe v-loading="valueRangeTableListLoading[dialogSelectSubjectTable.enName]"
tooltip-effect="light" border
:style="{ height: 'calc(100% - 32px)', width: '100%', display: 'inline-block' }">
<el-table-column prop="enName" label="字段名" width="140px" align="left" show-overflow-tooltip>
</el-table-column>
......@@ -1998,26 +2172,24 @@ defineExpose({
</el-table-column>
<el-table-column label="值域" width="280px" align="left" fixed="right">
<template #default="scope">
<span v-if="scope.row.dataType == 'json' || scope.row.dataType == 'text' || !scope.row.dataType || scope.row.dataType == 'string'">--</span>
<span
v-if="scope.row.dataType == 'json' || scope.row.dataType == 'text' || !scope.row.dataType || scope.row.dataType == 'string'">--</span>
<template v-else>
<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>
<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>
<div class="range-sum" v-show="scope.row.dataType == 'datetime' || scope.row.dataType == 'date'">
<el-date-picker
v-model="scope.row.dateValueRange"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
:unlink-panels="false"
:disabled="props.readonly"
/>
<el-date-picker v-model="scope.row.dateValueRange" type="daterange" range-separator="至"
start-placeholder="开始日期" end-placeholder="结束日期" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
:unlink-panels="false" :disabled="props.readonly" />
</div>
<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'">
<el-input :disabled="props.readonly" v-model.trim="scope.row.startValue" placeholder="请输入" clearable> </el-input>
<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'">
<el-input :disabled="props.readonly" v-model.trim="scope.row.startValue" placeholder="请输入" clearable>
</el-input>
<span class="text"></span>
<el-input :disabled="props.readonly" v-model.trim="scope.row.endValue" placeholder="请输入" clearable> </el-input>
<el-input :disabled="props.readonly" v-model.trim="scope.row.endValue" placeholder="请输入" clearable>
</el-input>
</div>
</template>
</template>
......@@ -2035,15 +2207,16 @@ defineExpose({
</el-dialog>
<!-- 引用完整性 -->
<el-dialog v-model="tableRefIntegralityDialogVisible" title="规则设置" width="750" :modal="true" :close-on-click-modal="false"
destroy-on-close align-center>
<el-dialog v-model="tableRefIntegralityDialogVisible" title="规则设置" width="750" :modal="true"
:close-on-click-modal="false" destroy-on-close align-center>
<div class="row-dialog-content">
<el-table ref="rowTableRef" :data="tableRefIntegralityRulesData" height="100%" :highlight-current-row="true" stripe
v-loading="tableRefIntegralityRulesDataLoading" tooltip-effect="light" border
<el-table ref="rowTableRef" :data="tableRefIntegralityRulesData" height="100%" :highlight-current-row="true"
stripe v-loading="tableRefIntegralityRulesDataLoading" tooltip-effect="light" border
:style="{ height: 'calc(100% - 28px)', width: 'auto', 'max-width': '100%', display: 'inline-block' }">
<el-table-column prop="mainTable" label="选择主表" width="180px" align="left" show-overflow-tooltip>
<template #default="scope">
<el-select v-if="!props.readonly" v-model="scope.row['mainTable']" placeholder="请选择" @change="tableInteMainSelectChange">
<el-select v-if="!props.readonly" v-model="scope.row['mainTable']" placeholder="请选择"
@change="tableInteMainSelectChange">
<el-option v-for="opt in toSubjectTables" :key="opt['guid']" :label="opt['label']" :value="opt['guid']" />
</el-select>
<span v-else>{{ scope.row['mainTableName'] + `(${scope.row['mainTableZhName']})` }}</span>
......@@ -2051,17 +2224,20 @@ defineExpose({
</el-table-column>
<el-table-column prop="mainTableField" label="选择主表字段" width="180px" align="left" show-overflow-tooltip>
<template #default="scope">
<el-select v-if="!props.readonly" v-model="scope.row['mainTableField']" placeholder="请选择" filterable clearable>
<el-option v-for="opt in (scope.row.mainTable ? mainTableFields[scope.row.mainTable] : [])" :key="opt['enName']" :label="opt['label']" :value="opt['enName']" />
<el-select v-if="!props.readonly" v-model="scope.row['mainTableField']" placeholder="请选择" filterable
clearable>
<el-option v-for="opt in (scope.row.mainTable ? mainTableFields[scope.row.mainTable] : [])"
:key="opt['enName']" :label="opt['label']" :value="opt['enName']" />
</el-select>
<span v-else>{{ scope.row['mainTableField'] + `(${scope.row['mainTableFieldZhName']})` }}</span>
</template>
</el-table-column>
<el-table-column prop="compareTableGuid" label="选择对比表" width="180px" align="left" show-overflow-tooltip>
<template #default="scope">
<el-tree-select v-if="!props.readonly" ref="compareTreeSelectRef" filterable clearable @change="tableInteCompareSelectChange"
v-model="scope.row['compareTableGuid']" node-key="guid" :data="contrastSubjects" placeholder="请选择" lazy
: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] : []"
<el-tree-select v-if="!props.readonly" ref="compareTreeSelectRef" filterable clearable
@change="tableInteCompareSelectChange" v-model="scope.row['compareTableGuid']" node-key="guid"
:data="contrastSubjects" placeholder="请选择" lazy :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] : []"
:auto-expand-parent="true" :default-checked-keys="[scope.row['compareTableGuid']]"
:filter-node-method="contrastSubjectInputFilterMethod" :props="{
value: 'guid',
......@@ -2075,8 +2251,11 @@ defineExpose({
</el-table-column>
<el-table-column prop="compareEnName" label="选择对比字段" width="180px" align="left" show-overflow-tooltip>
<template #default="scope">
<el-select v-if="!props.readonly" v-model="scope.row['compareEnName']" placeholder="请选择" filterable clearable>
<el-option v-for="opt in (scope.row.compareTableGuid ? compareTableFields[scope.row.compareTableGuid] : [])" :key="opt['enName']" :label="opt['label']" :value="opt['enName']" />
<el-select v-if="!props.readonly" v-model="scope.row['compareEnName']" placeholder="请选择" filterable
clearable>
<el-option
v-for="opt in (scope.row.compareTableGuid ? compareTableFields[scope.row.compareTableGuid] : [])"
:key="opt['enName']" :label="opt['label']" :value="opt['enName']" />
</el-select>
<span v-else>{{ scope.row['compareEnName'] + `(${scope.row['compareZhName']})` }}</span>
</template>
......@@ -2088,8 +2267,7 @@ defineExpose({
</el-table-column>
</el-table>
<div class="row-add-btn" v-if="!props.readonly">
<el-button link @click="addIntegralityRules"
:icon="CirclePlus" v-preReClick>添加规则</el-button>
<el-button link @click="addIntegralityRules" :icon="CirclePlus" v-preReClick>添加规则</el-button>
</div>
</div>
......@@ -2111,10 +2289,11 @@ defineExpose({
</div>
<div class="table-field-right">
<div class="left-title">字段列表详情</div>
<el-table ref="rowTableRef" :data="normCheckTableListData[dialogSelectSubjectTable.enName]" height="100%" :highlight-current-row="true" stripe
v-loading="normCheckTableListLoading[dialogSelectSubjectTable.enName]" tooltip-effect="light" border
<el-table ref="rowTableRef" :data="normCheckTableListData[dialogSelectSubjectTable.enName]" height="100%"
:highlight-current-row="true" stripe v-loading="normCheckTableListLoading[dialogSelectSubjectTable.enName]"
tooltip-effect="light" border
:style="{ height: 'calc(100% - 32px)', width: '100%', display: 'inline-block' }">
<el-table-column prop="enName" label="字段名" width="140px" align="left" show-overflow-tooltip>
<el-table-column prop="enName" label="字段名" width="140px" align="left" show-overflow-tooltip fixed>
</el-table-column>
<el-table-column prop="chName" label="注释" width="120px" align="left" show-overflow-tooltip>
</el-table-column>
......@@ -2125,34 +2304,46 @@ defineExpose({
</el-table-column>
<el-table-column prop="checkRule" label="选择检验规则" width="150px" align="left" show-overflow-tooltip>
<template #default="scope">
<el-select v-if="!props.readonly" v-model="scope.row['checkRule']" placeholder="请选择" filterable clearable>
<el-option v-for="opt in checkRulesList" :key="opt['paramValue']" :label="opt['paramName']" :value="opt['paramValue']" />
<el-select v-if="!props.readonly || (scope.row.dataType == 'text' || scope.row.dataType == 'json')"
v-model="scope.row['checkRule']" placeholder="请选择" filterable clearable>
<el-option v-for="opt in rulesListByType[scope.row.dataType]" :key="opt['paramValue']"
:label="opt['paramName']" :value="opt['paramValue']" />
</el-select>
<span v-else>{{ scope.row.checkRuleName ?? '--' }}</span>
</template>
</el-table-column>
<el-table-column label="填写配置项" width="200px" align="left">
<template #default="scope">
<span v-if="!scope.row.checkRule">--</span>
<span v-if="props.readonly">{{ scope.row.configValue ?? '--' }}</span>
<span
v-else-if="!scope.row.checkRule || ['id_card_rule', 'phone_number_rule', 'en_rule', 'ch_rule', 'num_value_rule'].includes(scope.row.checkRule)">--</span>
<template v-else>
<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>
<div class="range-sum" v-show="scope.row.dataType == 'datetime' || scope.row.dataType == 'date'">
<el-date-picker
v-model="scope.row.dateValueRange"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
format="YYYY-MM-DD"
value-format="YYYY-MM-DD"
:unlink-panels="false"
:disabled="props.readonly"
/>
</div>
<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'">
<el-input :disabled="props.readonly" v-model.trim="scope.row.startValue" placeholder="请输入" clearable> </el-input>
<span class="text"> </span>
<el-input :disabled="props.readonly" v-model.trim="scope.row.endValue" placeholder="请输入" clearable> </el-input>
<el-input v-show="scope.row.checkRule == 'custom_regular_rule'" v-model.trim="scope.row.configValue"
clearable placeholder="请输入"> </el-input>
<el-input v-show="scope.row.checkRule == 'precision_rule'" v-model.trim="scope.row.configValue"
clearable placeholder="请输入" @input="(val) => scope.row.configValue = val.replace(/\D/g, '')">
</el-input>
<el-select v-show="scope.row.checkRule == 'date_format_rule'" v-model="scope.row.configValue"
placeholder="请选择" filterable clearable>
<el-option
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' }]"
:value="opt['value']" />
</el-select>
<div class="range-sum" v-show="scope.row.checkRule == 'length_rule'">
<el-select v-model="scope.row.operator" placeholder="请选择" filterable clearable
:style="{ width: scope.row.operator == 'between' ? 'calc(33% - 2px)' : 'calc(50% - 4px)' }">
<el-option
v-for="opt in [{ value: '=' }, { value: '>' }, { value: '<' }, { value: '>=' }, { value: '<=' }, { value: 'between', label: '介于' }]"
:key="opt['value']" :label="opt['label']" :value="opt['value']" />
</el-select>
<el-input :disabled="props.readonly" v-model.trim="scope.row.value" placeholder="请输入" clearable
:style="{ width: scope.row.operator == 'between' ? 'calc(33% - 2px)' : 'calc(50% - 4px)' }"
@input="(val) => scope.row.value = val.replace(/\D/g, '')">
</el-input>
<el-input v-show="scope.row.operator == 'between'" :disabled="props.readonly"
v-model.trim="scope.row.value1" placeholder="请输入" clearable :style="{ width: 'calc(33% - 2px)' }"
@input="(val) => scope.row.value1 = val.replace(/\D/g, '')">
</el-input>
</div>
</template>
</template>
......@@ -2288,6 +2479,7 @@ defineExpose({
width: 100%;
display: inline-flex;
align-items: center;
justify-content: SPACE-BETWEEN;
.text {
margin: 0px 4px;
......
......@@ -332,6 +332,33 @@ const transformRulesInfo = (info: any) => {
})]
}));
}
} else if (info.ruleCode == 'norm_check') {
let subjectTables = toSubjectTables.value;
for (const ds in info.ruleFields) {
let fields = info.ruleFields[ds];
let tableInfo = subjectTables.find(t => t.enName === ds);
modelRules.push(Object.assign({}, {
modelGroupGuid: modelGroupGuid.value,
name: tableInfo.chName,
subjectName: tableInfo.enName,
subjectGuid: tableInfo.guid,
dataSourceGuid: tableInfo.dataSourceGuid,
databaseName: tableInfo.dataServerName,
modelRuleConfList: [Object.assign({}, info, {
ruleField: fields.map(f => {
return {
guid: f.guid,
enName: f.enName,
chName: f.chName,
dataType: f.dataType,
checkRule: f.checkRule,
configValue: f.configValue
}
}),
ruleFields: ''
})]
}));
}
} else if (info.ruleCode == 'ref_integrality') {
let subjectTables = toSubjectTables.value;
info.ruleFields.forEach(row => {
......
......@@ -140,6 +140,25 @@ const transformRulesInfo = (info: any) => {
}),
ruleFields: ''
});
} else if (info.ruleCode == 'norm_check') {
let subjectName = detailInfo.value.subjectName;
let fields = info.ruleFields[subjectName];
return Object.assign({}, info, {
guid: ruleGuid,
qualityModelGuid: detailInfo.value.qualityModelGuid,
ruleCode: detailInfo.value.ruleCode,
ruleField: fields.map(f => {
return {
guid: f.guid,
enName: f.enName,
chName: f.chName,
dataType: f.dataType,
checkRule: f.checkRule,
configValue: f.configValue
}
}),
ruleFields: ''
});
} else if (info.ruleCode == 'ref_integrality') {
return Object.assign({}, info, {
guid: ruleGuid,
......
......@@ -135,6 +135,24 @@ const transformRulesInfo = (info) => {
}),
ruleFields: ''
});
} else if (info.ruleCode == 'norm_check') {
let subjectName = modelDetailInfo.value.subjectName;
let fields = info.ruleFields[subjectName];
return Object.assign({}, info, {
qualityModelGuid: modelGuid,
ruleCode: info.ruleCode,
ruleField: fields.map(f => {
return {
guid: f.guid,
enName: f.enName,
chName: f.chName,
dataType: f.dataType,
checkRule: f.checkRule,
configValue: f.configValue
}
}),
ruleFields: ''
});
} else if (info.ruleCode == 'ref_integrality') {
return Object.assign({}, info, {
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!