de572cd5 by lxs

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

2 parents 8954b107 4a419fac
......@@ -3,7 +3,7 @@ VITE_APP_TITLE = 数据资产管理系统
# 接口域名
# VITE_API_BASEURL = https://www.zgsjzc.com/api
# VITE_API_BASEURL = https://swzl-test.csbr.cn/api
VITE_API_BASEURL = http://10.4.82.30:8052/
VITE_API_BASEURL = http://10.4.82.1:28052/
# 平台用户 接口请地址
VITE_APP_USER_API_BASEURL = gateway-server/user
# 系统管理 接口地址
......
......@@ -150,6 +150,13 @@ export const getSmallCategoryList = () => request({
data: { paramCode: "SMALL-CATEGORY" }
})
// 获取规范性检验规则。
export const getCheckRulesList = () => request({
url:`${import.meta.env.VITE_APP_API_BASEURL}/data-dict/get-data-list`,
method: 'post',
data: { paramCode: "REGULAR_RULE" }
})
// 根据规则guid获取规则的详情信息。
export const getRuleConfDetail = (param) => request({
url: `${import.meta.env.VITE_APP_QUALITY_BASEURL}/quality-model/conf/detail?ruleConfGuid=${param}`,
......
......@@ -47,7 +47,7 @@ export const getImageUrl = (params) => request({
/** 查看图片 */
export const getImageContent = (params) => request({
url: `${import.meta.env.VITE_APP_API_BASEURL}/obs/view-pic?filePath=${params}`,
url: `${import.meta.env.VITE_APP_API_BASEURL}/obs`,
method: 'get',
responseType: 'blob'
});
......
......@@ -146,11 +146,26 @@ defineExpose({
:max-collapse-tags="item.cascaderInfo.maxTags ?? 1" :filterable="item.cascaderInfo.filterable ?? false"
@change="cascaderChange" />
</div>
<div class="form_item" v-if="item.type == 'input'">
<div class="form_item" v-else-if="item.type == 'input'">
<span class="item_label" :class="{ required_mark: item.selectInfo.required }">{{ item.selectInfo.label
}}:</span>
<el-input v-model="extraParams[item.selectInfo.field]" :placeholder="item.selectInfo.placeholder"
:disabled="item.selectInfo.disabled" :clearable="item.selectInfo.disabled"> </el-input>
:disabled="item.selectInfo.disabled" :clearable="item.selectInfo.clearable"> </el-input>
</div>
<div class="group-con" v-else-if="item.type == 'group'">
<template v-for="formItem in (item.formItems || [])">
<div class="form_item" v-if="formItem.type == 'input'" style="margin-right: 15px;">
<span class="item_label" style="display: block;margin-bottom: 2px" :class="{ required_mark: formItem.required }">{{ formItem.label }}:</span>
<el-input v-model="extraParams[formItem.field]" :placeholder="formItem.placeholder"
:disabled="formItem.disabled" :clearable="formItem.clearable"> </el-input>
</div>
<div class="form_item" v-else-if="formItem.type == 'switch'">
<span class="item_label" style="display: block;margin-bottom: 2px" :class="{ required_mark: formItem.required }">{{ formItem.label }}:</span>
<el-switch inline-prompt v-model="extraParams[formItem.field]" :active-value="formItem.activeValue"
:inactive-value="formItem.inactiveValue" :active-text="formItem.activeText"
:inactive-text="formItem.inactiveText" :disabled="formItem.disabled" />
</div>
</template>
</div>
<div class="item_btn" v-else-if="item.type == 'btn_down'">
<el-button plain @click="toolBtnClick({ value: 'exoprt_model' })" v-preReClick>
......@@ -363,5 +378,11 @@ defineExpose({
}
}
}
.group-con {
display: flex;
flex-wrap: wrap;
margin-bottom: -12px;
}
}
</style>
......
......@@ -44,16 +44,13 @@ const routes: RouteRecordRaw[] = [
name: 'importFileMeta',
component: () => import('@/views/importFile.vue'),
meta: {
title: '导入数据',
title: '导入数据-采集任务',
sidebar: false,
breadcrumb: false,
cache: true,
reuse: true
},
beforeEnter: (to, from) => {
if (to.query.bizGuid) {
to.meta.title = `导入数据-采集任务`;
}
}
}
],
......
......@@ -598,7 +598,7 @@ onBeforeMount(() => {
<TableTools :searchItems="searchItemList" :searchId="'data-source-search'" @search="toSearch" :init="false" />
<div class="tools_btns">
<el-button type="primary" @click="loadDrawer">新建</el-button>
<el-button type="primary" @click="importMeta">导入</el-button>
<el-button @click="importMeta">导入</el-button>
</div>
</div>
<div class="table_panel_wrap">
......
......@@ -5,7 +5,8 @@ import {
validateCustomSql,
getSubjectFields,
getSubjectTableTree,
getSubjectTableByDomain
getSubjectTableByDomain,
getCheckRulesList
} from '@/api/modules/dataQuality';
import Table from "@/components/Table/index.vue";
import Form from "@/components/Form/index.vue";
......@@ -125,6 +126,9 @@ watch(() => props.largeCategoryList, (val) => {
}
})
/** 规范性检验规则 */
const checkRulesList: any = ref([]);
onBeforeMount(() => {
if (props.ruleTypeList?.length) {
if (props.ruleTypeValue) {
......@@ -159,6 +163,13 @@ onBeforeMount(() => {
if (Object.keys(props.value).length > 0) {
setPanelListValue(props.value, false, true);
}
getCheckRulesList().then((res: any) => {
if (res.code == proxy.$passCode) {
checkRulesList.value = res.data || [];
} else {
ElMessage.error(res.msg);
}
})
});
const getDefaultLargeCategory = (ruleCode) => {
......@@ -166,7 +177,7 @@ const getDefaultLargeCategory = (ruleCode) => {
return '3'; //准确性
} else if (ruleCode == 'volatility_check' || ruleCode == 'rows_check') {
return '5';
} else if (ruleCode == 'null_value_check') {
} else if (ruleCode == 'null_value_check' || ruleCode == 'ref_integrality') {
return '2';
} else {
return '1';
......@@ -180,7 +191,7 @@ const getDefaultSmallCategory = (ruleCode) => {
return '9';
} else if (ruleCode == 'volatility_check' || ruleCode == 'rows_check') {
return '17';
} else if (ruleCode == 'null_value_check') {
} else if (ruleCode == 'null_value_check' || ruleCode == 'ref_integrality') {
return '7';
} else {
return '1';
......@@ -383,6 +394,28 @@ const panelList: any = ref([
block: true,
visible: false
}, {
label: '规则设置',
type: 'input-dom',
placeholder: '请设置,可多选',
field: 'ruleSettings-ref-integrality', //13
default: '',//描述型的字段
defaultValue: [], //实际的表格数据值数组
readonly: true,
required: true,
block: true,
visible: false
}, {
label: '规则设置',
type: 'input-dom',
placeholder: '请设置,可多选',
field: 'ruleSettings-norm-check', //14
default: '',//描述型的字段
defaultValue: {},
readonly: true,
required: true,
block: true,
visible: false
}, {
label: '描述',
type: 'textarea',
placeholder: '请输入',
......@@ -468,6 +501,12 @@ const formRules = ref({
'ruleSettings-value-range': [
{ required: true, trigger: 'change', message: "请设置规则" }
],
'ruleSettings-ref-integrality': [
{ required: true, trigger: 'change', message: "请设置规则" }
],
'ruleSettings-norm-check': [
{ required: true, trigger: 'change', message: "请设置规则" }
],
orangeThreshold: [
{
trigger: 'blur', validator: (rule: any, value: any, callback: any) => {
......@@ -703,6 +742,54 @@ const formBtnClick = (btn) => {
}
})
}
} else if (ruleType.value == 'ref_integrality') {
if (!contrastSubjects.value?.length) {
getSubjectTableTreeData().then(res => {
return res;
})
}
tableRefIntegralityDialogVisible.value = true;
tableRefIntegralityRulesData.value = cloneDeep(panelList.value[13].defaultValue || []);
if (!tableRefIntegralityRulesData.value.length) {
tableRefIntegralityRulesData.value = [{}];
} else {
tableRefIntegralityRulesData.value.forEach((rule) => {
if (!mainTableFields.value[rule.mainTable]?.length) {
tableInteMainSelectChange(rule.mainTable)
}
if (!compareTableFields.value[rule.compareTableGuid]?.length) {
tableInteCompareSelectChange(rule.compareTableGuid);
}
})
}
} else if (ruleType.value == 'norm_check') {
normCheckDialogVisible.value = true;
tableListInfo.value.data = props.toSubjectTables;
dialogSelectSubjectTable.value = props.toSubjectTables[0];
let defaultValue = panelList.value[12].defaultValue;
normCheckTableListData.value[dialogSelectSubjectTable.value.enName] = [];
if (props.toSubjectTables[0]?.guid) {
normCheckTableListLoading.value[dialogSelectSubjectTable.value.enName] = true;
getSubjectFields(props.toSubjectTables[0]?.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];
Object.assign(f, field);
}
});
}
} else {
ElMessage.error(res.msg);
}
})
}
}
}
......@@ -814,12 +901,33 @@ const setPanelListValue = (item, isSelectChange = false, init = false, radioGrou
} else {
p.defaultValue = [];
}
} else if (ruleCode == 'ref_integrality' && p.field == 'ruleSettings-ref-integrality') {
if (!init) {
p.default = val[field];
return;
}
if (val.ruleField?.length) {
p.default = val.ruleField?.map(f => f.enName)?.join(';');
p.defaultValue = val.ruleField.map(field => {
return {
mainTable: val.subjectGuid,
mainTableName: val.subjectName,
mainTableZhName: val.subjectZhName,
mainTableField: field.enName,
compareTableGuid: field.compareTableGuid,
compareEnName: field.compareEnName,
}
})
} else {
p.default = '';
p.defaultValue = [];
}
} else if (ruleCode == 'value_of_range' && p.field == 'ruleSettings-value-range') {
if (!init) {
p.default = val[field];
return;
}
if (val.ruleField) {
if (val.ruleField?.length) {
p.default = val.ruleField?.map(f => f.enName)?.join(';');
let ruleFields = {};
ruleFields[val.subjectName] = val.ruleField || [];
......@@ -873,54 +981,54 @@ const radioGroupChange = (val, inlineValue, init) => {
list.forEach((item, index) => {
if (val == 'volatility_check') {//表行数波动率
item.visible = true
if (index == 7 || index == 8 || index == 9 || index == 10 || index == 11 || index == 12 || index === 14) {// 7是规则设置,9是联合不为空 : 9+4
if (index == 7 || index == 8 || index == 9 || index == 10 || index == 11 || index == 12 || index == 13 || index === 14 || index === 16) {// 7是规则设置,9是联合不为空 : 9+4
item.visible = false
}
} else if (val === 'null_value_check') {//空值检查
if (index === 3 || index === 4 || index === 5 || index === 6 || index == 7 || index == 8 || index == 9 || index == 11 || index == 12) {
if (index === 3 || index === 4 || index === 5 || index === 6 || index == 7 || index == 8 || index == 9 || index == 11 || index == 12 || index == 13 || index === 14) {
item.visible = false
} else { //index为10的显示
item.visible = true;
}
} else if (val === 'repeate_data_check') { //重复数据检查
item.visible = false
if (index === 3 || index === 4 || index === 5 || index === 6 || index == 8 || index == 9 || index == 10 || index == 11 || index == 12 || index === 14) {
if (index === 3 || index === 4 || index === 5 || index === 6 || index == 8 || index == 9 || index == 10 || index == 11 || index == 12 || index == 13 || index === 14 || index === 16) {
} else {
item.visible = true;
}
} else if (val === 'logic_check') { //逻辑检查
item.visible = false
if (index === 3 || index === 4 || index === 5 || index === 6 || index == 7 || index == 9 || index == 10 || index == 11 || index == 12 || index === 14) {
if (index === 3 || index === 4 || index === 5 || index === 6 || index == 7 || index == 9 || index == 10 || index == 11 || index == 12 || index == 13 || index === 14 || index === 16) {
} else {
item.visible = true;
}
} else if (val === 'value_of_range') { // 值域范围
item.visible = false
if (index === 3 || index === 4 || index === 5 || index === 6 || index == 7 || index == 8 || index == 9 || index == 10 || index == 11 || index === 14) {
if (index === 3 || index === 4 || index === 5 || index === 6 || index == 7 || index == 8 || index == 9 || index == 10 || index == 11 || index == 13 || index === 14 || index === 16) {
} else {
item.visible = true;
}
} else if (val === 'ref_integrality') { // 引用完整性
item.visible = false
if (index === 3 || index === 4 || index === 5 || index === 6 || index == 7 || index == 8 || index == 9 || index == 10 || index == 11 || index === 14) {
if (index === 3 || index === 4 || index === 5 || index === 6 || index == 7 || index == 8 || index == 9 || index == 10 || index == 11 || index == 12 || index === 14 || index === 16) {
} else {
item.visible = true;
}
} else if (val === 'norm_check') { // 规范校验
item.visible = false
if (index === 3 || index === 4 || index === 5 || index === 6 || index == 7 || index == 8 || index == 9 || index == 10 || index == 11 || index === 13) {
if (index === 3 || index === 4 || index === 5 || index === 6 || index == 7 || index == 8 || index == 9 || index == 10 || index == 11 || index == 12 || index == 13 || index === 16) {
} else {
item.visible = true;
}
} else if (val === 'custom_sql') {//自定义sql
item.visible = false
if (index === 3 || index === 4 || index === 5 || index === 6 || index == 7 || index == 8 || index == 10 || index == 11 || index == 12 || index === 14) {
if (index === 3 || index === 4 || index === 5 || index === 6 || index == 7 || index == 8 || index == 10 || index == 11 || index == 12 || index == 13 || index === 14 || index === 16) {
} else {
item.visible = true;
}
} else if (val === 'rows_check') { //表行数
item.visible = false
if (index === 3 || index === 4 || index === 5 || index === 6 || index == 7 || index == 8 || index == 9 || index == 10 || index == 12 || index === 14) {
if (index === 3 || index === 4 || index === 5 || index === 6 || index == 7 || index == 8 || index == 9 || index == 10 || index == 12 || index == 13 || index === 14 || index === 16) {
} else {
item.visible = true;
}
......@@ -1184,6 +1292,7 @@ const handleFilterChange = () => {
tableFilterValidates.value[dialogSelectSubjectTable.value.enName] = false;
}
/** ----------------- 表行数检查 --------------------------------- */
const tableRowDialogVisible = ref(false);
const tableRowRulesDataLoading = ref(false);
const tableRowRulesData: any = ref([{
......@@ -1585,6 +1694,112 @@ const submitValueRange = () => {
valueRangeDialogVisible.value = false;
}
/** ---------------------- 引用完整性 ------------------------------------ */
const tableRefIntegralityDialogVisible = ref(false);
const tableRefIntegralityRulesDataLoading = ref(false);
const tableRefIntegralityRulesData: any = ref([{}]);
const mainTableFields = ref({}); // 选择主表对应的字段列表
const compareTableFields = ref({}); //选择对比表对应的字段列表
/** 主表下拉选择变化 */
const tableInteMainSelectChange = (val) => {
mainTableFields.value[val] = [];
getSubjectFields(val).then((res: any) => {
if (res.code == proxy.$passCode) {
mainTableFields.value[val] = res.data?.map(d => {
return Object.assign({}, d, {
label: `${d.enName}(${d.chName})`
});
}) || [];
} else {
ElMessage.error(res.msg);
}
})
}
/** 对比表下拉选择变化 */
const tableInteCompareSelectChange = (val) => {
compareTableFields.value[val] = [];
getSubjectFields(val).then((res: any) => {
if (res.code == proxy.$passCode) {
compareTableFields.value[val] = res.data?.map(d => {
return Object.assign({}, d, {
label: `${d.enName}(${d.chName})`
});
}) || [];
} else {
ElMessage.error(res.msg);
}
})
}
const addIntegralityRules = () => {
tableRefIntegralityRulesData.value.push({
});
}
const deleteIntegralityRules = (scope) => {
tableRefIntegralityRulesData.value.splice(scope.$index, 1);
}
const cancelTableRefIntegralityDialog = () => {
tableRefIntegralityDialogVisible.value = false;
}
const submitTableRefIntegrality = () => {
let v: any = [];
if (!tableRefIntegralityRulesData.value.length) {
ElMessage.error('表行数检查规则不能为空');
return;
}
for (const rule of tableRefIntegralityRulesData.value) {
if (!rule.mainTable) {
ElMessage.error('主表不能为空');
return;
}
if (!rule.mainTableField) {
ElMessage.error('主表字段不能为空');
return;
}
if (!rule.compareTableGuid) {
ElMessage.error('对比表不能为空');
return;
}
if (!rule.compareEnName) {
ElMessage.error('对比表字段不能为空');
return;
}
v.push(rule.mainTableField);
}
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);
panelList.value[13].defaultValue = tableRefIntegralityRulesData.value;
formInline[`${panelList.value[13].field}`] = v.join(';');
setPanelListValue(formInline);
tableRefIntegralityDialogVisible.value = false;
}
/** ---------------------- 规范校验 ----------------------------------- */
const normCheckDialogVisible = ref(false);
const normCheckTableListLoading = ref({});
const normCheckTableListData = ref({});
const cancelNormCheckDialog = () => {
normCheckDialogVisible.value = false;
}
const submitNormCheck = () => {
}
const getFormInfo = () => {
let formInline = ruleFormRef.value.formInline;
let ruleName = props.ruleTypeList.find(option => option.ruleCode == formInline.ruleCode).ruleName;
......@@ -1621,7 +1836,14 @@ const getFormInfo = () => {
} else if (formInline.ruleCode == 'value_of_range') {
let v = panelList.value[12].defaultValue;
return Object.assign({}, formInline, v, {
ruleName: ruleName
ruleName: ruleName,
ruleFields: v
});
} else if (formInline.ruleCode == 'ref_integrality') {
let v = panelList.value[13].defaultValue;
return Object.assign({}, formInline, {
ruleName: ruleName,
ruleFields: v
});
}
}
......@@ -1812,6 +2034,141 @@ defineExpose({
</template>
</el-dialog>
<!-- 引用完整性 -->
<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
: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-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>
</template>
</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>
<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] : []"
:auto-expand-parent="true" :default-checked-keys="[scope.row['compareTableGuid']]"
:filter-node-method="contrastSubjectInputFilterMethod" :props="{
value: 'guid',
label: 'name',
children: 'children',
isLeaf: 'isLeaf'
}">
</el-tree-select>
<span v-else>{{ scope.row['compareTableName'] + `(${scope.row['compareTableZhName']})` }}</span>
</template>
</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>
<span v-else>{{ scope.row['compareEnName'] + `(${scope.row['compareZhName']})` }}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="100px" align="left" fixed="right" v-if="!props.readonly">
<template #default="scope">
<span class="text_btn" @click="deleteIntegralityRules(scope)" v-preReClick>删除</span>
</template>
</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>
</div>
</div>
<template #footer v-if="!props.readonly">
<div class="dialog-footer">
<el-button @click="cancelTableRefIntegralityDialog" v-preReClick>取消</el-button>
<el-button @click="submitTableRefIntegrality" type="primary" v-preReClick>确定</el-button>
</div>
</template>
</el-dialog>
<!-- 规范校验 -->
<el-dialog v-model="normCheckDialogVisible" title="规则设置" width="850" :modal="true" :close-on-click-modal="false"
destroy-on-close align-center>
<div class="filter-dialog-content" :style="{ height: '500px' }">
<div class="filter-table-list">
<div class="left-title">质检表</div>
<ListPanel class="list_unit" ref="normCheckFormListRef" :listInfo="tableListInfo" @itemClick="listItemClick" />
</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
: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>
<el-table-column prop="chName" label="注释" width="120px" align="left" show-overflow-tooltip>
</el-table-column>
<el-table-column prop="dataTypeChName" label="数据类型" width="100px" show-overflow-tooltip>
<template #default="scope">
<span>{{ scope.row["dataTypeChName"] || '--' }}</span>
</template>
</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>
<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>
<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>
</div>
</template>
</template>
</el-table-column>
</el-table>
</div>
</div>
<template #footer v-if="!props.readonly">
<div class="dialog-footer">
<el-button @click="cancelNormCheckDialog" v-preReClick>取消</el-button>
<el-button @click="submitNormCheck" type="primary" v-preReClick>确定</el-button>
</div>
</template>
</el-dialog>
<!-- 表行数检查 -->
<el-dialog v-model="tableRowDialogVisible" title="规则设置" width="750" :modal="true" :close-on-click-modal="false"
destroy-on-close align-center>
......
......@@ -332,6 +332,35 @@ const transformRulesInfo = (info: any) => {
})]
}));
}
} else if (info.ruleCode == 'ref_integrality') {
let subjectTables = toSubjectTables.value;
info.ruleFields.forEach(row => {
let tableInfo = subjectTables.find(t => t.guid === row.mainTable);
let modelRule = modelRules.find(m => m.subjectName == tableInfo.enName);
if (modelRule) {
modelRule.modelRuleConfList.ruleField.push({
enName: row.mainTableField,
compareTableGuid: row.compareTableGuid,
compareTableName: row.compareTableName,
compareEnName: row.compareEnName
});
} else {
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, {
enName: row.mainTableField,
compareTableGuid: row.compareTableGuid,
compareTableName: row.compareTableName,
compareEnName: row.compareEnName
})]
}));
}
})
}
return modelRules;
}
......@@ -382,7 +411,8 @@ const save = () => {
:transferOpenNode="true" width="70%" :defaultProps="{
label: 'name',
value: 'guid'
}" :lazyFn="handleSubjectTableLazyFn" @left-check-change="handleSubjectCheckedChange" height="calc(100% - 64px)">
}" :lazyFn="handleSubjectTableLazyFn" @left-check-change="handleSubjectCheckedChange"
height="calc(100% - 64px)">
</TreeTransfer>
</div>
</div>
......
......@@ -140,6 +140,21 @@ const transformRulesInfo = (info: any) => {
}),
ruleFields: ''
});
} else if (info.ruleCode == 'ref_integrality') {
return Object.assign({}, info, {
guid: ruleGuid,
qualityModelGuid: detailInfo.value.qualityModelGuid,
ruleCode: detailInfo.value.ruleCode,
ruleField: info.ruleFields.map(row => {
return {
enName: row.mainTableField,
compareTableGuid: row.compareTableGuid,
compareTableName: row.compareTableName,
compareEnName: row.compareEnName
}
}),
ruleFields: ''
});
}
}
......
......@@ -135,6 +135,22 @@ const transformRulesInfo = (info) => {
}),
ruleFields: ''
});
} else if (info.ruleCode == 'ref_integrality') {
return Object.assign({}, info, {
qualityModelGuid: modelGuid,
ruleCode: info.ruleCode,
ruleField: info.ruleFields.map(row => {
return {
// guid: row.mainTable,
enName: row.mainTableField,
//chName: row.chName,
compareTableGuid: row.compareTableGuid,
compareTableName: row.compareTableName,
compareEnName: row.compareEnName
}
}),
ruleFields: ''
});
}
}
......
......@@ -271,7 +271,7 @@ const batching = (type) => {
if (isfileImport == '2' || isfileImport == '4') {
dialogInfo.value.header.title = '导入数据'
dialogInfo.value.type = 'upload'
dialogInfo.value.size = 500
dialogInfo.value.size = isfileImport == '4' ? 600 : 500;
uploadFiles.value = []
uploadInfo.value.uploadInfo.steps = uploadSteps.value
const content: any = [uploadInfo.value]
......@@ -374,17 +374,24 @@ const importData = (info) => {
});
paramUrl = `${import.meta.env.VITE_API_ASSET_BASEURL}/dam-catalog-table/excel-by-subject-guid?staffGuid=${userData.staffGuid}&subjectGuid=${route.query.bizGuid}`
} else if (isfileImport == '4') {
if (!info.collectTaskName) {
if (!info.databaseNameZh) {
ElMessage({
type: 'error',
message: '请填写采集任务名称'
message: '请填写数据源名称'
})
return;
}
if (!info.databaseNameEn) {
ElMessage({
type: 'error',
message: '请填写数据库英文名'
})
return;
}
uploadFiles.value.forEach((item: any, index: number) => {
params.append("uploadFile", item.raw);
});
paramUrl = `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-collect-task/meta-collect-import?staffGuid=${userData.staffGuid}&collectTaskName=${info.collectTaskName}`
paramUrl = `${import.meta.env.VITE_APP_PLAN_BASEURL}/meta-collect-task/meta-collect-import?staffGuid=${userData.staffGuid}&databaseNameZh=${info.databaseNameZh}&databaseNameEn=${info.databaseNameEn}&isCover=${info.isCover}`
} else {
uploadFiles.value.forEach((item: any, index: number) => {
params.append("file", item.raw);
......@@ -562,17 +569,36 @@ const setUploadInfo = () => {
uploadSteps.value = [
{
title: '1、导入前请先录入以下内容',
type: 'group',
formItems: [{
type: 'input',
selectInfo: {
label: '采集任务名称',
label: '数据源名称',
placeholder: '请输入',
field: 'collectTaskName',
field: 'databaseNameZh',
default: '',
clearable: true,
maxlength: 50,
filterable: true,
required: true
}
}, {
type: 'input',
label: '数据库英文名',
placeholder: '请输入',
field: 'databaseNameEn',
default: '',
clearable: true,
maxlength: 50,
filterable: true,
required: true
}, {
label: '是否覆盖原有数据',
type: 'switch',
field: 'isCover',
activeValue: 'Y',
block: true,
required: true,
inactiveValue: 'N'
}]
},
{
title: '2、请下载最新的模板,并按照模板格式准备需要导入的数据',
......@@ -591,7 +617,7 @@ const setUploadInfo = () => {
}
}
]
uploadInfo.value.uploadInfo.extraParams = {}
uploadInfo.value.uploadInfo.extraParams = { isCover: 'Y' }
} else {
uploadSteps.value = [
{
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!