fix
Showing
4 changed files
with
54 additions
and
32 deletions
| ... | @@ -226,6 +226,7 @@ const rulesDetailTableBtnClick = (scope, btn) => { | ... | @@ -226,6 +226,7 @@ const rulesDetailTableBtnClick = (scope, btn) => { |
| 226 | if (type == 'ruleDetail') { | 226 | if (type == 'ruleDetail') { |
| 227 | detailLoading.value = true; | 227 | detailLoading.value = true; |
| 228 | if (detailJson.value[row.ruleConfGuid]) { | 228 | if (detailJson.value[row.ruleConfGuid]) { |
| 229 | detailInfo.value = detailJson.value[row.ruleConfGuid]; | ||
| 229 | ruleType.value = detailInfo.value.ruleCode; | 230 | ruleType.value = detailInfo.value.ruleCode; |
| 230 | toSubjectTables.value = [{ | 231 | toSubjectTables.value = [{ |
| 231 | guid: detailInfo.value.subjectGuid, | 232 | guid: detailInfo.value.subjectGuid, | ... | ... |
| ... | @@ -423,10 +423,10 @@ const tableBtnClick = (scope, btn) => { | ... | @@ -423,10 +423,10 @@ const tableBtnClick = (scope, btn) => { |
| 423 | }); | 423 | }); |
| 424 | } else { | 424 | } else { |
| 425 | router.push({ | 425 | router.push({ |
| 426 | name: 'metadataQuery', | 426 | name: 'metaSheet', |
| 427 | query: { | 427 | query: { |
| 428 | dataSourceGuid: row.dataSourceGuid, | 428 | id: row.subjectGuid, |
| 429 | tableGuid: row.subjectGuid | 429 | name: row.name |
| 430 | } | 430 | } |
| 431 | }); | 431 | }); |
| 432 | } | 432 | } | ... | ... |
| ... | @@ -134,6 +134,15 @@ watch(() => props.largeCategoryList, (val) => { | ... | @@ -134,6 +134,15 @@ watch(() => props.largeCategoryList, (val) => { |
| 134 | } | 134 | } |
| 135 | }) | 135 | }) |
| 136 | 136 | ||
| 137 | const operationList: any = ref([ | ||
| 138 | { label: '大于', value: '>', }, | ||
| 139 | { label: '小于', value: '<', }, | ||
| 140 | { label: '等于', value: '=', }, | ||
| 141 | { label: '大于等于', value: '>=', }, | ||
| 142 | { label: '小于等于', value: '<=', }, | ||
| 143 | { label: '介于', value: 'between', }, | ||
| 144 | ]); | ||
| 145 | |||
| 137 | /** 规范性检验规则 */ | 146 | /** 规范性检验规则 */ |
| 138 | const checkRulesList: any = ref([]); | 147 | const checkRulesList: any = ref([]); |
| 139 | 148 | ||
| ... | @@ -178,8 +187,8 @@ onBeforeMount(() => { | ... | @@ -178,8 +187,8 @@ onBeforeMount(() => { |
| 178 | formItems.value[0].children = panelList.value; | 187 | formItems.value[0].children = panelList.value; |
| 179 | } | 188 | } |
| 180 | if (props.smallCategoryList?.length) { | 189 | if (props.smallCategoryList?.length) { |
| 181 | let p = formItems.value[0].default; | 190 | let p = panelList.value[1]; |
| 182 | if (p) { | 191 | if (p.default) { |
| 183 | if (p.default == '1') {//规范性 | 192 | if (p.default == '1') {//规范性 |
| 184 | panelList.value[2].options = props.smallCategoryList.slice(0, 6); | 193 | panelList.value[2].options = props.smallCategoryList.slice(0, 6); |
| 185 | } else if (p.default == '2') { | 194 | } else if (p.default == '2') { |
| ... | @@ -868,6 +877,7 @@ const formBtnClick = (btn) => { | ... | @@ -868,6 +877,7 @@ const formBtnClick = (btn) => { |
| 868 | if (fIndex > -1) { | 877 | if (fIndex > -1) { |
| 869 | let f = normCheckTableListData.value[dialogSelectSubjectTable.value.enName][fIndex]; | 878 | let f = normCheckTableListData.value[dialogSelectSubjectTable.value.enName][fIndex]; |
| 870 | f.checkRule = field.checkRule; | 879 | f.checkRule = field.checkRule; |
| 880 | f.checkRuleName = field.checkRuleName; | ||
| 871 | f.configValue = field.configValue; | 881 | f.configValue = field.configValue; |
| 872 | if (f.checkRule == 'length_rule') { | 882 | if (f.checkRule == 'length_rule') { |
| 873 | let vSplit = f.configValue.split('#'); | 883 | let vSplit = f.configValue.split('#'); |
| ... | @@ -887,7 +897,7 @@ const formBtnClick = (btn) => { | ... | @@ -887,7 +897,7 @@ const formBtnClick = (btn) => { |
| 887 | } | 897 | } |
| 888 | 898 | ||
| 889 | const selectChange = (val, item, info) => { | 899 | const selectChange = (val, item, info) => { |
| 890 | setPanelListValue(info, true); | 900 | setPanelListValue(info, item.field == 'largeCategory'); |
| 891 | }; | 901 | }; |
| 892 | 902 | ||
| 893 | /** 设置表单选项的值,防止largeCategory的options改变,重新赋值。 当radioGroupChange为true,init为false时,为用户手动切换,需要更新大类的默认值。 */ | 903 | /** 设置表单选项的值,防止largeCategory的options改变,重新赋值。 当radioGroupChange为true,init为false时,为用户手动切换,需要更新大类的默认值。 */ |
| ... | @@ -1252,7 +1262,8 @@ const listItemClick = (data) => { | ... | @@ -1252,7 +1262,8 @@ const listItemClick = (data) => { |
| 1252 | if (fIndex > -1) { | 1262 | if (fIndex > -1) { |
| 1253 | let f = normCheckTableListData.value[dialogSelectSubjectTable.value.enName][fIndex]; | 1263 | let f = normCheckTableListData.value[dialogSelectSubjectTable.value.enName][fIndex]; |
| 1254 | if (field.checkRule) { | 1264 | if (field.checkRule) { |
| 1255 | f.checkRule = field.dataRange; | 1265 | f.checkRule = field.checkRule; |
| 1266 | f.checkRuleName = field.checkRuleName; | ||
| 1256 | f.configValue = field.configValue; | 1267 | f.configValue = field.configValue; |
| 1257 | if (field.checkRule == 'length_rule') { | 1268 | if (field.checkRule == 'length_rule') { |
| 1258 | let vLen = f.configValue?.split('#'); | 1269 | let vLen = f.configValue?.split('#'); |
| ... | @@ -1419,7 +1430,8 @@ const validateFilter = () => { | ... | @@ -1419,7 +1430,8 @@ const validateFilter = () => { |
| 1419 | validateFilterBtnDisable.value = true; | 1430 | validateFilterBtnDisable.value = true; |
| 1420 | validateSubjectTableRule({ | 1431 | validateSubjectTableRule({ |
| 1421 | subjectGuid: dialogSelectSubjectTable.value.guid, | 1432 | subjectGuid: dialogSelectSubjectTable.value.guid, |
| 1422 | condition: tableFilters.value[enName] | 1433 | condition: tableFilters.value[enName], |
| 1434 | dataSource: props.dataSource || props.value.dataSource | ||
| 1423 | }).then((res: any) => { | 1435 | }).then((res: any) => { |
| 1424 | validateFilterBtnDisable.value = false; | 1436 | validateFilterBtnDisable.value = false; |
| 1425 | if (res.code == proxy.$passCode) { | 1437 | if (res.code == proxy.$passCode) { |
| ... | @@ -1617,7 +1629,8 @@ const validateSql = () => { | ... | @@ -1617,7 +1629,8 @@ const validateSql = () => { |
| 1617 | validateSqlBtnDisable.value = true; | 1629 | validateSqlBtnDisable.value = true; |
| 1618 | validateCustomSql({ | 1630 | validateCustomSql({ |
| 1619 | subjectGuid: dialogSelectSubjectTable.value.guid, | 1631 | subjectGuid: dialogSelectSubjectTable.value.guid, |
| 1620 | sqlScript: sqlTableFilters.value[enName] | 1632 | sqlScript: sqlTableFilters.value[enName], |
| 1633 | dataSource: props.dataSource || props.value.dataSource | ||
| 1621 | }).then((res: any) => { | 1634 | }).then((res: any) => { |
| 1622 | validateSqlBtnDisable.value = false; | 1635 | validateSqlBtnDisable.value = false; |
| 1623 | if (res?.code == proxy.$passCode) { | 1636 | if (res?.code == proxy.$passCode) { |
| ... | @@ -1972,30 +1985,30 @@ const submitNormCheck = () => { | ... | @@ -1972,30 +1985,30 @@ const submitNormCheck = () => { |
| 1972 | ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,但未选择操作符`); | 1985 | ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,但未选择操作符`); |
| 1973 | return; | 1986 | return; |
| 1974 | } | 1987 | } |
| 1975 | if (field.operator == 'between') { | 1988 | if (!field.value) { |
| 1976 | if (!field.value1 && !field.value) { | ||
| 1977 | if (dialogSelectSubjectTable.value.enName != table) { | 1989 | if (dialogSelectSubjectTable.value.enName != table) { |
| 1978 | normCheckFormListRef.value.setSelectList(table, 'enName'); | 1990 | normCheckFormListRef.value.setSelectList(table, 'enName'); |
| 1979 | } | 1991 | } |
| 1980 | ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,但长度值未填写完整`); | 1992 | ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,但未填写长度值`); |
| 1981 | return; | 1993 | return; |
| 1982 | } | 1994 | } |
| 1983 | if (parseInt(field.value) >= parseInt(field.value1)) { | 1995 | if (field.operator == 'between') { |
| 1996 | if (!field.value1) { | ||
| 1984 | if (dialogSelectSubjectTable.value.enName != table) { | 1997 | if (dialogSelectSubjectTable.value.enName != table) { |
| 1985 | normCheckFormListRef.value.setSelectList(table, 'enName'); | 1998 | normCheckFormListRef.value.setSelectList(table, 'enName'); |
| 1986 | } | 1999 | } |
| 1987 | ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,介于操作符对应的数值需符合后者大于前者`); | 2000 | ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,但长度范围值未填写完整`); |
| 1988 | return; | 2001 | return; |
| 1989 | } | 2002 | } |
| 1990 | field.configValue = field.operator + '#' + (field.value ?? "") + '#' + (field.value1 ?? ""); | 2003 | if (parseInt(field.value) >= parseInt(field.value1)) { |
| 1991 | } else { | ||
| 1992 | if (!field.value) { | ||
| 1993 | if (dialogSelectSubjectTable.value.enName != table) { | 2004 | if (dialogSelectSubjectTable.value.enName != table) { |
| 1994 | normCheckFormListRef.value.setSelectList(table, 'enName'); | 2005 | normCheckFormListRef.value.setSelectList(table, 'enName'); |
| 1995 | } | 2006 | } |
| 1996 | ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,但未填写长度值`); | 2007 | ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,介于操作符对应的数值需符合后者大于前者`); |
| 1997 | return; | 2008 | return; |
| 1998 | } | 2009 | } |
| 2010 | field.configValue = field.operator + '#' + field.value + '#' + field.value1; | ||
| 2011 | } else { | ||
| 1999 | field.configValue = field.operator + '#' + field.value; | 2012 | field.configValue = field.operator + '#' + field.value; |
| 2000 | } | 2013 | } |
| 2001 | } | 2014 | } |
| ... | @@ -2246,6 +2259,13 @@ defineExpose({ | ... | @@ -2246,6 +2259,13 @@ defineExpose({ |
| 2246 | </el-table-column> | 2259 | </el-table-column> |
| 2247 | <el-table-column label="值域" width="280px" align="left" fixed="right"> | 2260 | <el-table-column label="值域" width="280px" align="left" fixed="right"> |
| 2248 | <template #default="scope"> | 2261 | <template #default="scope"> |
| 2262 | <span v-if="props.readonly">{{ (!scope.row.dataType || scope.row.dataType == 'varchar' || | ||
| 2263 | scope.row.dataType == 'char' || scope.row.dataType == 'bit' || scope.row.dataType == 'json' || | ||
| 2264 | scope.row.dataType == 'text' || !scope.row.dataType || scope.row.dataType == 'string' || | ||
| 2265 | scope.row.dataType == 'numeric') ? (scope.row.dataRange || '--') : (scope.row.startValue && | ||
| 2266 | scope.row.endValue ? `${scope.row.startValue}~${scope.row.endValue}` : (scope.row.startValue != null ? | ||
| 2267 | scope.row.startValue : (scope.row.endValue ?? '--'))) }}</span> | ||
| 2268 | <template v-else> | ||
| 2249 | <el-input | 2269 | <el-input |
| 2250 | 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'" | 2270 | 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'" |
| 2251 | v-model.trim="scope.row.dataRange" clearable placeholder="多值按照分号;分隔"> </el-input> | 2271 | v-model.trim="scope.row.dataRange" clearable placeholder="多值按照分号;分隔"> </el-input> |
| ... | @@ -2263,6 +2283,7 @@ defineExpose({ | ... | @@ -2263,6 +2283,7 @@ defineExpose({ |
| 2263 | </el-input> | 2283 | </el-input> |
| 2264 | </div> | 2284 | </div> |
| 2265 | </template> | 2285 | </template> |
| 2286 | </template> | ||
| 2266 | </el-table-column> | 2287 | </el-table-column> |
| 2267 | </el-table> | 2288 | </el-table> |
| 2268 | </div> | 2289 | </div> |
| ... | @@ -2384,7 +2405,9 @@ defineExpose({ | ... | @@ -2384,7 +2405,9 @@ defineExpose({ |
| 2384 | </el-table-column> | 2405 | </el-table-column> |
| 2385 | <el-table-column label="填写配置项" width="240px" align="left"> | 2406 | <el-table-column label="填写配置项" width="240px" align="left"> |
| 2386 | <template #default="scope"> | 2407 | <template #default="scope"> |
| 2387 | <span v-if="props.readonly">{{ scope.row.configValue ?? '--' }}</span> | 2408 | <span v-if="props.readonly">{{ scope.row.configValue != null ? (scope.row.checkRule != 'length_rule' ? scope.row.configValue : (scope.row.configValue.split('#')?.length ? |
| 2409 | (operationList.find(o => o.value == scope.row.configValue.split('#')[0]).label + | ||
| 2410 | scope.row.configValue.split('#').slice(1).join('~')) : scope.row.configValue)) : '--' }}</span> | ||
| 2388 | <span | 2411 | <span |
| 2389 | v-else-if="!scope.row.checkRule || ['id_card_rule', 'phone_number_rule', 'en_rule', 'ch_rule', 'num_value_rule'].includes(scope.row.checkRule)">--</span> | 2412 | v-else-if="!scope.row.checkRule || ['id_card_rule', 'phone_number_rule', 'en_rule', 'ch_rule', 'num_value_rule'].includes(scope.row.checkRule)">--</span> |
| 2390 | <template v-else> | 2413 | <template v-else> |
| ... | @@ -2402,14 +2425,8 @@ defineExpose({ | ... | @@ -2402,14 +2425,8 @@ defineExpose({ |
| 2402 | <div class="range-sum" v-show="scope.row.checkRule == 'length_rule'"> | 2425 | <div class="range-sum" v-show="scope.row.checkRule == 'length_rule'"> |
| 2403 | <el-select v-model="scope.row.operator" placeholder="请选择" filterable clearable | 2426 | <el-select v-model="scope.row.operator" placeholder="请选择" filterable clearable |
| 2404 | :style="{ width: scope.row.operator == 'between' ? 'calc(33% - 2px)' : 'calc(50% - 4px)' }"> | 2427 | :style="{ width: scope.row.operator == 'between' ? 'calc(33% - 2px)' : 'calc(50% - 4px)' }"> |
| 2405 | <el-option v-for="opt in [ | 2428 | <el-option v-for="opt in operationList" :key="opt['value']" :label="opt['label']" |
| 2406 | { label: '大于', value: '>', }, | 2429 | :value="opt['value']" /> |
| 2407 | { label: '小于', value: '<', }, | ||
| 2408 | { label: '等于', value: '=', }, | ||
| 2409 | { label: '大于等于', value: '>=', }, | ||
| 2410 | { label: '小于等于', value: '<=', }, | ||
| 2411 | { label: '介于', value: 'between', }, | ||
| 2412 | ]" :key="opt['value']" :label="opt['label']" :value="opt['value']" /> | ||
| 2413 | </el-select> | 2430 | </el-select> |
| 2414 | <el-input :disabled="props.readonly" v-model.trim="scope.row.value" placeholder="请输入" clearable | 2431 | <el-input :disabled="props.readonly" v-model.trim="scope.row.value" placeholder="请输入" clearable |
| 2415 | :style="{ width: scope.row.operator == 'between' ? 'calc(33% - 2px)' : 'calc(50% - 4px)' }" | 2432 | :style="{ width: scope.row.operator == 'between' ? 'calc(33% - 2px)' : 'calc(50% - 4px)' }" | ... | ... |
| ... | @@ -253,20 +253,24 @@ onBeforeMount(() => { | ... | @@ -253,20 +253,24 @@ onBeforeMount(() => { |
| 253 | ElMessage.error(res.msg); | 253 | ElMessage.error(res.msg); |
| 254 | } | 254 | } |
| 255 | }) | 255 | }) |
| 256 | getSmallCategoryList().then((res: any) => { | 256 | let ps1 = getLargeCategoryList().then((res: any) => { |
| 257 | if (res.code == proxy.$passCode) { | 257 | if (res.code == proxy.$passCode) { |
| 258 | smallCategoryList.value = res.data || []; | 258 | return res.data || []; |
| 259 | } else { | 259 | } else { |
| 260 | ElMessage.error(res.msg); | 260 | ElMessage.error(res.msg); |
| 261 | } | 261 | } |
| 262 | }) | 262 | }); |
| 263 | getLargeCategoryList().then((res: any) => { | 263 | let ps2 = getSmallCategoryList().then((res: any) => { |
| 264 | if (res.code == proxy.$passCode) { | 264 | if (res.code == proxy.$passCode) { |
| 265 | largeCategoryList.value = res.data || []; | 265 | return res.data || []; |
| 266 | } else { | 266 | } else { |
| 267 | ElMessage.error(res.msg); | 267 | ElMessage.error(res.msg); |
| 268 | } | 268 | } |
| 269 | }) | 269 | }) |
| 270 | Promise.all([ps1, ps2]).then((res: any[]) => { | ||
| 271 | largeCategoryList.value = res[0]; | ||
| 272 | smallCategoryList.value = res[1]; | ||
| 273 | }) | ||
| 270 | }) | 274 | }) |
| 271 | 275 | ||
| 272 | onActivated(() => { | 276 | onActivated(() => { | ... | ... |
-
Please register or sign in to post a comment