e12d0c17 by lihua

fix

1 parent 5ef564c4
......@@ -226,6 +226,7 @@ const rulesDetailTableBtnClick = (scope, btn) => {
if (type == 'ruleDetail') {
detailLoading.value = true;
if (detailJson.value[row.ruleConfGuid]) {
detailInfo.value = detailJson.value[row.ruleConfGuid];
ruleType.value = detailInfo.value.ruleCode;
toSubjectTables.value = [{
guid: detailInfo.value.subjectGuid,
......
......@@ -423,10 +423,10 @@ const tableBtnClick = (scope, btn) => {
});
} else {
router.push({
name: 'metadataQuery',
name: 'metaSheet',
query: {
dataSourceGuid: row.dataSourceGuid,
tableGuid: row.subjectGuid
id: row.subjectGuid,
name: row.name
}
});
}
......
......@@ -134,6 +134,15 @@ watch(() => props.largeCategoryList, (val) => {
}
})
const operationList: any = ref([
{ label: '大于', value: '>', },
{ label: '小于', value: '<', },
{ label: '等于', value: '=', },
{ label: '大于等于', value: '>=', },
{ label: '小于等于', value: '<=', },
{ label: '介于', value: 'between', },
]);
/** 规范性检验规则 */
const checkRulesList: any = ref([]);
......@@ -178,8 +187,8 @@ onBeforeMount(() => {
formItems.value[0].children = panelList.value;
}
if (props.smallCategoryList?.length) {
let p = formItems.value[0].default;
if (p) {
let p = panelList.value[1];
if (p.default) {
if (p.default == '1') {//规范性
panelList.value[2].options = props.smallCategoryList.slice(0, 6);
} else if (p.default == '2') {
......@@ -868,6 +877,7 @@ const formBtnClick = (btn) => {
if (fIndex > -1) {
let f = normCheckTableListData.value[dialogSelectSubjectTable.value.enName][fIndex];
f.checkRule = field.checkRule;
f.checkRuleName = field.checkRuleName;
f.configValue = field.configValue;
if (f.checkRule == 'length_rule') {
let vSplit = f.configValue.split('#');
......@@ -887,7 +897,7 @@ const formBtnClick = (btn) => {
}
const selectChange = (val, item, info) => {
setPanelListValue(info, true);
setPanelListValue(info, item.field == 'largeCategory');
};
/** 设置表单选项的值,防止largeCategory的options改变,重新赋值。 当radioGroupChange为true,init为false时,为用户手动切换,需要更新大类的默认值。 */
......@@ -1252,7 +1262,8 @@ const listItemClick = (data) => {
if (fIndex > -1) {
let f = normCheckTableListData.value[dialogSelectSubjectTable.value.enName][fIndex];
if (field.checkRule) {
f.checkRule = field.dataRange;
f.checkRule = field.checkRule;
f.checkRuleName = field.checkRuleName;
f.configValue = field.configValue;
if (field.checkRule == 'length_rule') {
let vLen = f.configValue?.split('#');
......@@ -1419,7 +1430,8 @@ const validateFilter = () => {
validateFilterBtnDisable.value = true;
validateSubjectTableRule({
subjectGuid: dialogSelectSubjectTable.value.guid,
condition: tableFilters.value[enName]
condition: tableFilters.value[enName],
dataSource: props.dataSource || props.value.dataSource
}).then((res: any) => {
validateFilterBtnDisable.value = false;
if (res.code == proxy.$passCode) {
......@@ -1617,7 +1629,8 @@ const validateSql = () => {
validateSqlBtnDisable.value = true;
validateCustomSql({
subjectGuid: dialogSelectSubjectTable.value.guid,
sqlScript: sqlTableFilters.value[enName]
sqlScript: sqlTableFilters.value[enName],
dataSource: props.dataSource || props.value.dataSource
}).then((res: any) => {
validateSqlBtnDisable.value = false;
if (res?.code == proxy.$passCode) {
......@@ -1972,30 +1985,30 @@ const submitNormCheck = () => {
ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,但未选择操作符`);
return;
}
if (field.operator == 'between') {
if (!field.value1 && !field.value) {
if (!field.value) {
if (dialogSelectSubjectTable.value.enName != table) {
normCheckFormListRef.value.setSelectList(table, 'enName');
}
ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,但长度值未填写完整`);
ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,但未填写长度值`);
return;
}
if (parseInt(field.value) >= parseInt(field.value1)) {
if (field.operator == 'between') {
if (!field.value1) {
if (dialogSelectSubjectTable.value.enName != table) {
normCheckFormListRef.value.setSelectList(table, 'enName');
}
ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,介于操作符对应的数值需符合后者大于前者`);
ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,但长度范围值未填写完整`);
return;
}
field.configValue = field.operator + '#' + (field.value ?? "") + '#' + (field.value1 ?? "");
} else {
if (!field.value) {
if (parseInt(field.value) >= parseInt(field.value1)) {
if (dialogSelectSubjectTable.value.enName != table) {
normCheckFormListRef.value.setSelectList(table, 'enName');
}
ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,但未填写长度值`);
ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,介于操作符对应的数值需符合后者大于前者`);
return;
}
field.configValue = field.operator + '#' + field.value + '#' + field.value1;
} else {
field.configValue = field.operator + '#' + field.value;
}
}
......@@ -2246,6 +2259,13 @@ defineExpose({
</el-table-column>
<el-table-column label="值域" width="280px" align="left" fixed="right">
<template #default="scope">
<span v-if="props.readonly">{{ (!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') ? (scope.row.dataRange || '--') : (scope.row.startValue &&
scope.row.endValue ? `${scope.row.startValue}~${scope.row.endValue}` : (scope.row.startValue != null ?
scope.row.startValue : (scope.row.endValue ?? '--'))) }}</span>
<template v-else>
<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>
......@@ -2263,6 +2283,7 @@ defineExpose({
</el-input>
</div>
</template>
</template>
</el-table-column>
</el-table>
</div>
......@@ -2384,7 +2405,9 @@ defineExpose({
</el-table-column>
<el-table-column label="填写配置项" width="240px" align="left">
<template #default="scope">
<span v-if="props.readonly">{{ scope.row.configValue ?? '--' }}</span>
<span v-if="props.readonly">{{ scope.row.configValue != null ? (scope.row.checkRule != 'length_rule' ? scope.row.configValue : (scope.row.configValue.split('#')?.length ?
(operationList.find(o => o.value == scope.row.configValue.split('#')[0]).label +
scope.row.configValue.split('#').slice(1).join('~')) : 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>
......@@ -2402,14 +2425,8 @@ 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 [
{ label: '大于', value: '>', },
{ label: '小于', value: '<', },
{ label: '等于', value: '=', },
{ label: '大于等于', value: '>=', },
{ label: '小于等于', value: '<=', },
{ label: '介于', value: 'between', },
]" :key="opt['value']" :label="opt['label']" :value="opt['value']" />
<el-option v-for="opt in operationList" :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)' }"
......
......@@ -253,20 +253,24 @@ onBeforeMount(() => {
ElMessage.error(res.msg);
}
})
getSmallCategoryList().then((res: any) => {
let ps1 = getLargeCategoryList().then((res: any) => {
if (res.code == proxy.$passCode) {
smallCategoryList.value = res.data || [];
return res.data || [];
} else {
ElMessage.error(res.msg);
}
})
getLargeCategoryList().then((res: any) => {
});
let ps2 = getSmallCategoryList().then((res: any) => {
if (res.code == proxy.$passCode) {
largeCategoryList.value = res.data || [];
return res.data || [];
} else {
ElMessage.error(res.msg);
}
})
Promise.all([ps1, ps2]).then((res: any[]) => {
largeCategoryList.value = res[0];
smallCategoryList.value = res[1];
})
})
onActivated(() => {
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!