e12d0c17 by lihua

fix

1 parent 5ef564c4
...@@ -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,12 +1985,19 @@ const submitNormCheck = () => { ...@@ -1972,12 +1985,19 @@ const submitNormCheck = () => {
1972 ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,但未选择操作符`); 1985 ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,但未选择操作符`);
1973 return; 1986 return;
1974 } 1987 }
1988 if (!field.value) {
1989 if (dialogSelectSubjectTable.value.enName != table) {
1990 normCheckFormListRef.value.setSelectList(table, 'enName');
1991 }
1992 ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,但未填写长度值`);
1993 return;
1994 }
1975 if (field.operator == 'between') { 1995 if (field.operator == 'between') {
1976 if (!field.value1 && !field.value) { 1996 if (!field.value1) {
1977 if (dialogSelectSubjectTable.value.enName != table) { 1997 if (dialogSelectSubjectTable.value.enName != table) {
1978 normCheckFormListRef.value.setSelectList(table, 'enName'); 1998 normCheckFormListRef.value.setSelectList(table, 'enName');
1979 } 1999 }
1980 ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,但长度值未填写完整`); 2000 ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,但长度范围值未填写完整`);
1981 return; 2001 return;
1982 } 2002 }
1983 if (parseInt(field.value) >= parseInt(field.value1)) { 2003 if (parseInt(field.value) >= parseInt(field.value1)) {
...@@ -1987,15 +2007,8 @@ const submitNormCheck = () => { ...@@ -1987,15 +2007,8 @@ const submitNormCheck = () => {
1987 ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,介于操作符对应的数值需符合后者大于前者`); 2007 ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,介于操作符对应的数值需符合后者大于前者`);
1988 return; 2008 return;
1989 } 2009 }
1990 field.configValue = field.operator + '#' + (field.value ?? "") + '#' + (field.value1 ?? ""); 2010 field.configValue = field.operator + '#' + field.value + '#' + field.value1;
1991 } else { 2011 } else {
1992 if (!field.value) {
1993 if (dialogSelectSubjectTable.value.enName != table) {
1994 normCheckFormListRef.value.setSelectList(table, 'enName');
1995 }
1996 ElMessage.error(`表【${table}】的字段【${field.enName}】设置了长度检验,但未填写长度值`);
1997 return;
1998 }
1999 field.configValue = field.operator + '#' + field.value; 2012 field.configValue = field.operator + '#' + field.value;
2000 } 2013 }
2001 } 2014 }
...@@ -2246,22 +2259,30 @@ defineExpose({ ...@@ -2246,22 +2259,30 @@ 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">
2249 <el-input 2262 <span v-if="props.readonly">{{ (!scope.row.dataType || scope.row.dataType == 'varchar' ||
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'" 2263 scope.row.dataType == 'char' || scope.row.dataType == 'bit' || scope.row.dataType == 'json' ||
2251 v-model.trim="scope.row.dataRange" clearable placeholder="多值按照分号;分隔"> </el-input> 2264 scope.row.dataType == 'text' || !scope.row.dataType || scope.row.dataType == 'string' ||
2252 <!-- <div class="range-sum" v-show="scope.row.dataType == 'datetime' || scope.row.dataType == 'date'"> 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>
2269 <el-input
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'"
2271 v-model.trim="scope.row.dataRange" clearable placeholder="多值按照分号;分隔"> </el-input>
2272 <!-- <div class="range-sum" v-show="scope.row.dataType == 'datetime' || scope.row.dataType == 'date'">
2253 <el-date-picker v-model="scope.row.dateValueRange" type="daterange" range-separator="至" 2273 <el-date-picker v-model="scope.row.dateValueRange" type="daterange" range-separator="至"
2254 start-placeholder="开始日期" end-placeholder="结束日期" format="YYYY-MM-DD" value-format="YYYY-MM-DD" 2274 start-placeholder="开始日期" end-placeholder="结束日期" format="YYYY-MM-DD" value-format="YYYY-MM-DD"
2255 :unlink-panels="false" :disabled="props.readonly" /> 2275 :unlink-panels="false" :disabled="props.readonly" />
2256 </div> --> 2276 </div> -->
2257 <div class="range-sum" 2277 <div class="range-sum"
2258 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'"> 2278 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'">
2259 <el-input :disabled="props.readonly" v-model.trim="scope.row.startValue" placeholder="请输入" clearable> 2279 <el-input :disabled="props.readonly" v-model.trim="scope.row.startValue" placeholder="请输入" clearable>
2260 </el-input> 2280 </el-input>
2261 <span class="text"></span> 2281 <span class="text"> </span>
2262 <el-input :disabled="props.readonly" v-model.trim="scope.row.endValue" placeholder="请输入" clearable> 2282 <el-input :disabled="props.readonly" v-model.trim="scope.row.endValue" placeholder="请输入" clearable>
2263 </el-input> 2283 </el-input>
2264 </div> 2284 </div>
2285 </template>
2265 </template> 2286 </template>
2266 </el-table-column> 2287 </el-table-column>
2267 </el-table> 2288 </el-table>
...@@ -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,19 +253,23 @@ onBeforeMount(() => { ...@@ -253,19 +253,23 @@ 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 {
260 ElMessage.error(res.msg);
261 }
262 })
263 getLargeCategoryList().then((res: any) => {
264 if (res.code == proxy.$passCode) {
265 largeCategoryList.value = res.data || [];
266 } else { 259 } else {
267 ElMessage.error(res.msg); 260 ElMessage.error(res.msg);
268 } 261 }
262 });
263 let ps2 = getSmallCategoryList().then((res: any) => {
264 if (res.code == proxy.$passCode) {
265 return res.data || [];
266 } else {
267 ElMessage.error(res.msg);
268 }
269 })
270 Promise.all([ps1, ps2]).then((res: any[]) => {
271 largeCategoryList.value = res[0];
272 smallCategoryList.value = res[1];
269 }) 273 })
270 }) 274 })
271 275
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!