5ef564c4 by lxs

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

2 parents 8454b49c 73c42038
......@@ -382,7 +382,7 @@ const getQueryTreeData = ()=>{
currNodeInfo.value = {type:2,guid:dataSourceGuid,name:datasourceName}
}
nextTick(() => {
treeInfo.value.currentNodeKey = currentNodeKey.value
treeInfo.value.currentNodeKey = <string>route.query.tableGuid || currentNodeKey.value;
treeInfo.value.expandedKey = expandedKey.value
})
nodeClick({type:2,guid:dataSourceGuid,name:datasourceName})
......
......@@ -683,7 +683,6 @@ const download = () => {
<div v-show="!isWordStyle" class="header-detail">
<template v-if="detailInfo.analysisReportType == 1">
<span>{{ '表名称:' + (detailInfo.qualityModelName ?? '--') }}</span>
<span style="margin-left: 40px;">{{ '所属主题:' + (detailInfo.subjectDomainName ?? '--') }}</span>
<span style="margin-left: 40px;">{{ '所属数据源:' + (detailInfo.dataSourceName ?? '--') }}</span>
</template>
<span v-else-if="detailInfo.analysisReportType == 3">{{ '分组名称:' + (detailInfo.qualityModelGroupName ?? '--')
......@@ -787,7 +786,6 @@ const download = () => {
<div style=" height: 40px;line-height: 40px;font-size: 14px;color: #666666;">
<template v-if="detailInfo.analysisReportType == 1">
<span>{{ '表名称:' + (detailInfo.qualityModelName ?? '--') }}</span>
<span style="margin-left: 40px;">{{ '所属主题:' + (detailInfo.subjectDomainName ?? '--') }}</span>
<span style="margin-left: 40px;">{{ '所属数据源:' + (detailInfo.dataSourceName ?? '--') }}</span>
</template>
<span v-else-if="detailInfo.analysisReportType == 3">{{ '分组名称:' + (detailInfo.qualityModelGroupName ?? '--')
......
......@@ -331,7 +331,7 @@ onActivated(() => {
let tab: any = userStore.tabbar.find((tab: any) => tab.fullPath === fullPath);
if (tab) {
if (route.query.detail) {
tab.meta.title = `新建规则(${route.query.planName})`;
tab.meta.title = `方案详情-${route.query.planName}`;
if (fullPath === route.fullPath) {
document.title = tab.meta.title;
}
......
......@@ -28,10 +28,8 @@ import {
import useDataQualityStore from "@/store/modules/dataQuality";
import { useValidator } from '@/hooks/useValidator';
import { TableColumnWidth } from '@/utils/enum';
import useDataCatalogStore from "@/store/modules/dataCatalog";
const dataQualityStore = useDataQualityStore();
const dataCatalogStore = useDataCatalogStore();
const { proxy } = getCurrentInstance() as any;
const { orderNum, description } = useValidator();
......@@ -411,10 +409,27 @@ const tableBtnClick = (scope, btn) => {
} else if (type == "delete") {
open("此操作将永久删除, 是否继续?", "warning");
} else if (type == 'locateDataCatalog') {
dataCatalogStore.setLocateSubjectName(row.name);
router.push({
name: 'dataWarehouse'
});
// dataCatalogStore.setLocateSubjectName(row.name);
// router.push({
// name: 'dataWarehouse'
// });
if (row.dataSource == '4') {
router.push({
name: 'classifyGradeCatalogue',
query: {
databaseGuid: row.dataSourceGuid,
tableGuid: row.subjectGuid
}
});
} else {
router.push({
name: 'metadataQuery',
query: {
dataSourceGuid: row.dataSourceGuid,
tableGuid: row.subjectGuid
}
});
}
}
};
......
......@@ -10,7 +10,7 @@ import {
getInventoryDsDir
} from '@/api/modules/dataQuality';
import {
getMetaTreeData
getMetaTreeData
} from '@/api/modules/dataMetaService';
import Table from "@/components/Table/index.vue";
import Form from "@/components/Form/index.vue";
......@@ -178,7 +178,24 @@ onBeforeMount(() => {
formItems.value[0].children = panelList.value;
}
if (props.smallCategoryList?.length) {
panelList.value[2].options = props.smallCategoryList.slice(0, 6);
let p = formItems.value[0].default;
if (p) {
if (p.default == '1') {//规范性
panelList.value[2].options = props.smallCategoryList.slice(0, 6);
} else if (p.default == '2') {
panelList.value[2].options = props.smallCategoryList.slice(6, 8);
} else if (p.default == '3') {
panelList.value[2].options = props.smallCategoryList.slice(8, 13);
} else if (p.default == '4') {
panelList.value[2].options = props.smallCategoryList.slice(13, 15);
} else if (p.default == '5') {
panelList.value[2].options = props.smallCategoryList.slice(15, 18);
} else if (p.default == '6') {
panelList.value[2].options = props.smallCategoryList.slice(18, 20);
}
} else {
panelList.value[2].options = props.smallCategoryList.slice(0, 6);
}
panelList.value[2].default = getDefaultSmallCategory(formItems.value[0].default);
formItems.value[0].children = panelList.value;
}
......@@ -623,46 +640,46 @@ const submit = () => {
}
const getSubjectTableTreeData = () => {
if (props.dataSource == '4' || props.value.dataSource == '4') {
return getInventoryDsDir().then((res: any) => {
if (res.code == proxy.$passCode) {
contrastSubjects.value = res.data?.map(d => {
d.parentGuid = 0;
d.guid = d.databaseGuid;
d.name = d.databaseChName;
d.label = d.databaseChName + `(${d.database})`;
d.children = d.children?.map(child => {
child.parentGuid = d.guid;
child.label = child.tableChName + `(${child.tableName})`;
child.guid = child.tableGuid;
if (props.dataSource == '4' || props.value.dataSource == '4') {
return getInventoryDsDir().then((res: any) => {
if (res.code == proxy.$passCode) {
contrastSubjects.value = res.data?.map(d => {
d.parentGuid = 0;
d.guid = d.databaseGuid;
d.name = d.databaseChName;
d.label = d.databaseChName + `(${d.database})`;
d.children = d.children?.map(child => {
child.parentGuid = d.guid;
child.label = child.tableChName + `(${child.tableName})`;
child.guid = child.tableGuid;
child.isLeaf = true;
child.dataServerName = d.database;
child.dataSourceGuid = d.databaseGuid;
child.parentGuid = d.databaseGuid;
return child;
})
return d;
}) || [];
}
})
} else {
return child;
})
return d;
}) || [];
}
})
} else {
return getMetaTreeData({ isImportCreate: 'N' }).then((res: any) => {
if (res.code == proxy.$passCode) {
contrastSubjects.value = res.data?.children?.map(d => {
d.parentGuid = 0;
d.label = d.name;
d.children = d.children?.map(child => {
child.label = child.name + `(${child.tableName})`;
if (res.code == proxy.$passCode) {
contrastSubjects.value = res.data?.children?.map(d => {
d.parentGuid = 0;
d.label = d.name;
d.children = d.children?.map(child => {
child.label = child.name + `(${child.tableName})`;
child.isLeaf = true;
child.dataServerName = child.databaseName;
child.dataSourceGuid = d.guid;
return child;
})
return d;
}) || [];
}
})
}
return child;
})
return d;
}) || [];
}
})
}
// return getSubjectTableTree({}).then((res: any) => {
// if (res.code == proxy.$passCode) {
// contrastSubjects.value = res.data || [];
......@@ -796,12 +813,11 @@ const formBtnClick = (btn) => {
if (field.dataRange) {
f.dataRange = field.dataRange;
}
f.startValue = field.startValue;
f.endValue = field.endValue;
if (field.startValue) {
if (f.dataType == 'date' || f.dataType == 'datetime') {
f.dateValueRange = [field.startValue, field.endValue];
} else {
f.startValue = field.startValue;
f.endValue = field.endValue;
}
}
}
......@@ -1204,12 +1220,11 @@ const listItemClick = (data) => {
if (field.dataRange) {
f.dataRange = field.dataRange;
}
f.startValue = field.startValue;
f.endValue = field.endValue;
if (field.startValue) {
if (f.dataType == 'date' || f.dataType == 'datetime') {
f.dateValueRange = [field.startValue, field.endValue];
} else {
f.startValue = field.startValue;
f.endValue = field.endValue;
}
}
}
......@@ -1785,7 +1800,7 @@ const submitValueRange = () => {
// ElMessage.error(`表【${table}】的字段【${field.enName}】设置了值域,但范围未填写完整`);
// return;
// }
if (field.startValue != null || field.endValue != null) {
if (field.startValue || field.endValue) {
ruleFields.push(field);
} else if (field.dataRange) {
ruleFields.push(field);
......@@ -1957,15 +1972,8 @@ const submitNormCheck = () => {
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 (!field.value1 && !field.value) {
if (dialogSelectSubjectTable.value.enName != table) {
normCheckFormListRef.value.setSelectList(table, 'enName');
}
......@@ -1979,8 +1987,15 @@ const submitNormCheck = () => {
ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,介于操作符对应的数值需符合后者大于前者`);
return;
}
field.configValue = field.operator + '#' + field.value + '#' + field.value1;
field.configValue = field.operator + '#' + (field.value ?? "") + '#' + (field.value1 ?? "");
} else {
if (!field.value) {
if (dialogSelectSubjectTable.value.enName != table) {
normCheckFormListRef.value.setSelectList(table, 'enName');
}
ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,但未填写长度值`);
return;
}
field.configValue = field.operator + '#' + field.value;
}
}
......@@ -2016,6 +2031,18 @@ const submitNormCheck = () => {
normCheckDialogVisible.value = false;
}
/** 规范检验 长度和精度的数入 */
const validatePositiveInteger = (row: any, field: string) => {
row[field] = row[field].replace(/\D/g, '');
let value = row[field];
// 如果输入值为0,则将其设置为1
if (value == '0') {
row[field] = '1';
return;
}
};
const getFormInfo = () => {
let formInline = ruleFormRef.value.formInline;
let ruleName = props.ruleTypeList.find(option => option.ruleCode == formInline.ruleCode).ruleName;
......@@ -2220,21 +2247,21 @@ defineExpose({
<el-table-column label="值域" width="280px" align="left" fixed="right">
<template #default="scope">
<el-input
v-show="!scope.row.dataType || scope.row.dataType == 'varchar' || scope.row.dataType == 'char' || scope.row.dataType == 'bit' || scope.row.dataType == 'json' || scope.row.dataType == 'text' || !scope.row.dataType || scope.row.dataType == 'string' || scope.row.dataType == 'numeric'"
v-model.trim="scope.row.dataRange" clearable placeholder="多值按照分号;分隔"> </el-input>
<!-- <div class="range-sum" v-show="scope.row.dataType == 'datetime' || scope.row.dataType == 'date'">
v-show="!scope.row.dataType || scope.row.dataType == 'varchar' || scope.row.dataType == 'char' || scope.row.dataType == 'bit' || scope.row.dataType == 'json' || scope.row.dataType == 'text' || !scope.row.dataType || scope.row.dataType == 'string' || scope.row.dataType == 'numeric'"
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 == 'datetime' || scope.row.dataType == 'date' || scope.row.dataType == 'int' || scope.row.dataType == 'decimal' || scope.row.dataType == 'tinyint' || scope.row.dataType == 'timestamp' || scope.row.dataType == 'time'">
<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>
<div class="range-sum"
v-show="scope.row.dataType == 'datetime' || scope.row.dataType == 'date' || scope.row.dataType == 'int' || scope.row.dataType == 'decimal' || scope.row.dataType == 'tinyint' || scope.row.dataType == 'timestamp' || scope.row.dataType == 'time'">
<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>
</el-table-column>
</el-table>
......@@ -2355,7 +2382,7 @@ defineExpose({
<span v-else>{{ scope.row.checkRuleName ?? '--' }}</span>
</template>
</el-table-column>
<el-table-column label="填写配置项" width="200px" align="left">
<el-table-column label="填写配置项" width="240px" align="left">
<template #default="scope">
<span v-if="props.readonly">{{ scope.row.configValue ?? '--' }}</span>
<span
......@@ -2364,7 +2391,7 @@ defineExpose({
<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, '')">
clearable :maxlength="4" placeholder="请输入" @input="validatePositiveInteger(scope.row, 'configValue')">
</el-input>
<el-select v-show="scope.row.checkRule == 'date_format_rule'" v-model="scope.row.configValue"
placeholder="请选择" filterable clearable>
......@@ -2375,17 +2402,22 @@ defineExpose({
<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-option v-for="opt in [
{ label: '大于', value: '>', },
{ label: '小于', value: '<', },
{ label: '等于', value: '=', },
{ label: '大于等于', value: '>=', },
{ label: '小于等于', value: '<=', },
{ label: '介于', value: 'between', },
]" :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, '')">
:maxlength="4" @input="validatePositiveInteger(scope.row, 'value')">
</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, '')">
:maxlength="4" @input="validatePositiveInteger(scope.row, 'value1')">
</el-input>
</div>
</template>
......@@ -2421,8 +2453,9 @@ defineExpose({
<el-table-column prop="contrastSubjectGuid" label="选择对比表" width="200px" align="left" show-overflow-tooltip>
<template #default="scope">
<el-tree-select v-if="!props.readonly" ref="treeSelectRef" filterable clearable
v-model="scope.row['contrastSubjectGuid']" node-key="guid" :data="contrastSubjects" placeholder="请选择" :default-expanded-keys="defaultExpandedKeys"
:auto-expand-parent="true" :default-checked-keys="[props.value.contrastSubjectGuid]"
v-model="scope.row['contrastSubjectGuid']" node-key="guid" :data="contrastSubjects" placeholder="请选择"
:default-expanded-keys="defaultExpandedKeys" :auto-expand-parent="true"
:default-checked-keys="[props.value.contrastSubjectGuid]"
:filter-node-method="contrastSubjectInputFilterMethod" :props="{
value: 'guid',
label: 'name',
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!