b6de3bf9 by xukangle

fix

1 parent 820266a3
...@@ -205,6 +205,10 @@ const inputChange = (val, row) => { ...@@ -205,6 +205,10 @@ const inputChange = (val, row) => {
205 205
206 /** 输入框输入触发事件 */ 206 /** 输入框输入触发事件 */
207 const inputEventChange = (val, item) => { 207 const inputEventChange = (val, item) => {
208 if (val === '' && item.clearable) {
209 formInline.value[item.field] = '';
210 return;
211 }
208 if (item.regexp) { 212 if (item.regexp) {
209 formInline.value[item.field] = val.replace(item.regexp, ''); 213 formInline.value[item.field] = val.replace(item.regexp, '');
210 if (item.min != null && (formInline.value[item.field] < item.min)) { 214 if (item.min != null && (formInline.value[item.field] < item.min)) {
......
...@@ -511,6 +511,22 @@ const tableCheckboxAllSelectChange = (select) => { ...@@ -511,6 +511,22 @@ const tableCheckboxAllSelectChange = (select) => {
511 // 批量配置业务规则 511 // 批量配置业务规则
512 512
513 const batchControlRules = () => { 513 const batchControlRules = () => {
514 // 清空 classEditFormInfo.value.formInfo;
515 classEditFormItems.value.map(item => {
516 if (item.field == 'orderNum') {
517 item.visible = true;
518 }
519 if (item.field == 'orderNum1') {
520 item.visible = false;
521 }
522 item.default = '';
523 if (item.children) {
524 item.children.map(item => {
525 item.default = '';
526 })
527 }
528 });
529
514 // 判断是否选中数据 530 // 判断是否选中数据
515 if (!selectedRulesData.value || !selectedRulesData.value.guids || selectedRulesData.value.guids.length == 0) { 531 if (!selectedRulesData.value || !selectedRulesData.value.guids || selectedRulesData.value.guids.length == 0) {
516 proxy.$ElMessage.warning('请选择数据'); 532 proxy.$ElMessage.warning('请选择数据');
...@@ -544,6 +560,7 @@ const batchControlRules = () => { ...@@ -544,6 +560,7 @@ const batchControlRules = () => {
544 return false; 560 return false;
545 } 561 }
546 562
563 console.log('isSingleInputField', isSingleInputField, 'isDoubleInputField', isDoubleInputField);
547 // 如果全都是单文本框或者全都是双文本框,则继续后续操作 564 // 如果全都是单文本框或者全都是双文本框,则继续后续操作
548 if (isSingleInputField) { 565 if (isSingleInputField) {
549 classEditFormItems.value[4].visible = false; 566 classEditFormItems.value[4].visible = false;
...@@ -836,6 +853,7 @@ const classEditFormItems = ref<any>([{ ...@@ -836,6 +853,7 @@ const classEditFormItems = ref<any>([{
836 field: 'startNumber', 853 field: 'startNumber',
837 default: '', 854 default: '',
838 maxlength: 6, 855 maxlength: 6,
856 min: 1,
839 regexp: /\D/g, 857 regexp: /\D/g,
840 clearable: true, 858 clearable: true,
841 required: false, 859 required: false,
...@@ -847,6 +865,7 @@ const classEditFormItems = ref<any>([{ ...@@ -847,6 +865,7 @@ const classEditFormItems = ref<any>([{
847 field: 'endNumber', 865 field: 'endNumber',
848 default: '', 866 default: '',
849 maxlength: 6, 867 maxlength: 6,
868 min: 1,
850 regexp: /\D/g, 869 regexp: /\D/g,
851 clearable: true, 870 clearable: true,
852 required: false, 871 required: false,
...@@ -863,6 +882,7 @@ const classEditFormItems = ref<any>([{ ...@@ -863,6 +882,7 @@ const classEditFormItems = ref<any>([{
863 field: 'fieldPrecision', 882 field: 'fieldPrecision',
864 maxlength: 2, 883 maxlength: 2,
865 regexp: /\D/g, 884 regexp: /\D/g,
885 min: 1,
866 required: false, 886 required: false,
867 clearable: true, 887 clearable: true,
868 block: true, 888 block: true,
...@@ -906,6 +926,7 @@ const classEditFormItems = ref<any>([{ ...@@ -906,6 +926,7 @@ const classEditFormItems = ref<any>([{
906 field: 'startValue', 926 field: 'startValue',
907 clearable: true, 927 clearable: true,
908 required: false, 928 required: false,
929 min: 1,
909 regexp: /\D/g, 930 regexp: /\D/g,
910 }, 931 },
911 { 932 {
...@@ -913,6 +934,7 @@ const classEditFormItems = ref<any>([{ ...@@ -913,6 +934,7 @@ const classEditFormItems = ref<any>([{
913 placeholder: '请输入', 934 placeholder: '请输入',
914 field: 'endValue', 935 field: 'endValue',
915 clearable: true, 936 clearable: true,
937 min: 1,
916 required: false, 938 required: false,
917 regexp: /\D/g, 939 regexp: /\D/g,
918 }, 940 },
...@@ -1129,6 +1151,21 @@ const drawerSelectChange = (val, row, info) => { ...@@ -1129,6 +1151,21 @@ const drawerSelectChange = (val, row, info) => {
1129 } 1151 }
1130 }); 1152 });
1131 } 1153 }
1154 if (val === '>' || val === '<' || val === '=' || val === '>=' || val === '<=') {
1155 {
1156 classEditFormItems.value.forEach(item => {
1157 if (item.field === 'orderNum') {
1158 item.visible = true;
1159 }
1160 if (item.field === 'orderNum1') {
1161 item.visible = false;
1162 }
1163 if (item.field === 'orderNumLength') {
1164 item.default = val;
1165 }
1166 });
1167 }
1168 }
1132 } 1169 }
1133 1170
1134 // tab切换 1171 // tab切换
...@@ -1680,7 +1717,7 @@ const onAChange = async () => { ...@@ -1680,7 +1717,7 @@ const onAChange = async () => {
1680 await getDbDirTableSelectData(2, { databaseGuid: selectedA.value, condition: "2" }); // 数据库搜索 1717 await getDbDirTableSelectData(2, { databaseGuid: selectedA.value, condition: "2" }); // 数据库搜索
1681 } 1718 }
1682 } 1719 }
1683 1720 console.log('selectedA',);
1684 1721
1685 }; 1722 };
1686 1723
...@@ -1741,7 +1778,12 @@ onActivated(async () => { ...@@ -1741,7 +1778,12 @@ onActivated(async () => {
1741 1778
1742 const gradeTreeRef = ref<any>(); 1779 const gradeTreeRef = ref<any>();
1743 const treeSelectNodeClick = (node, item) => { 1780 const treeSelectNodeClick = (node, item) => {
1744 console.log('treeSelectNodeClick', gradeTreeRef.value.treeRef); 1781 nextTick(() => {
1782 const nodeElement = gradeTreeRef.value.treeRef.$el.querySelector(`[data-key="${String(node.classifyDetailGuid)}"]`);
1783 if (nodeElement) {
1784 nodeElement.offsetTop - gradeTreeRef.value.treeRef.$el.clientHeight > 0 && (gradeTreeRef.value.treeRef.$el.scrollTop = nodeElement.offsetTop - gradeTreeRef.value.treeRef.$el.clientHeight + 32);
1785 }
1786 });
1745 classifyDetailGuidInfo.value = node.classifyDetailGuid; 1787 classifyDetailGuidInfo.value = node.classifyDetailGuid;
1746 treeInfo.value.expandedKey = []; 1788 treeInfo.value.expandedKey = [];
1747 treeInfo.value.expandedKey.push(node.classifyDetailGuid); 1789 treeInfo.value.expandedKey.push(node.classifyDetailGuid);
......
...@@ -221,12 +221,14 @@ const saveRow = (row) => { ...@@ -221,12 +221,14 @@ const saveRow = (row) => {
221 row.fieldLengthCondition = '' 221 row.fieldLengthCondition = ''
222 } 222 }
223 if (row.lengthSymbol && row.lengthValue) { 223 if (row.lengthSymbol && row.lengthValue) {
224 console.log('row.lengthSymbol', row.lengthSymbol + '#' + row.lengthValue)
224 row.fieldLengthCondition = row.lengthSymbol + '#' + row.lengthValue 225 row.fieldLengthCondition = row.lengthSymbol + '#' + row.lengthValue
225 } 226 }
226 // 字段范围 双文本情况 227 // 字段范围 双文本情况
227 228
228 if (!isSingleInput(row.fieldType)) { 229 if (!isSingleInput(row.fieldType)) {
229 row.fieldValueRange = (row.startValue ? row.startValue : '') + '#' + (row.endValue ? row.endValue : '') 230 row.fieldValueRange = (row.startValue ? row.startValue : '') + '#' + (row.endValue ? row.endValue : '')
231
230 } 232 }
231 row.isEdit = false 233 row.isEdit = false
232 } 234 }
...@@ -412,7 +414,48 @@ const validatePositiveInteger = (row: any, field: string) => { ...@@ -412,7 +414,48 @@ const validatePositiveInteger = (row: any, field: string) => {
412 row[field] = ''; 414 row[field] = '';
413 } 415 }
414 }; 416 };
415 417 function parseFieldLengthCondition(condition) {
418 // 如果 condition 为 null 或 undefined,直接返回默认值
419 if (!condition) {
420 return '--';
421 }
422 if (condition.includes('between')) {
423 const parts = condition.split('#').filter(Boolean); // 按 '#' 分割并去掉空值
424 return `${parts[1]}-${parts[2]}`; // 显示为 "10-20"
425 }
426 let symbol = '';
427 let value = '';
428 if (condition.startsWith('>=') || condition.startsWith('<=')) {
429 symbol = condition.slice(0, 2); // 取前两个字符 '>=', '<='
430 value = condition.substring(2); // 取从第三个字符开始的部分 '10'
431 } else {
432 symbol = condition[0];
433 value = condition.substring(1);
434 }
435 value = value.replace('#', '');
436 let displayText = '';
437 switch (symbol) {
438 case '>':
439 displayText = `大于${value}`;
440 break;
441 case '=':
442 displayText = `等于${value}`;
443 break;
444 case '<':
445 displayText = `小于${value}`;
446 break;
447 case '>=':
448 displayText = `大于等于${value}`;
449 break;
450 case '<=':
451 displayText = `小于等于${value}`;
452 break;
453 default:
454 displayText = `--`;
455 break;
456 }
457 return displayText;
458 }
416 </script> 459 </script>
417 <template> 460 <template>
418 <div class="configure-rules"> 461 <div class="configure-rules">
...@@ -423,9 +466,9 @@ const validatePositiveInteger = (row: any, field: string) => { ...@@ -423,9 +466,9 @@ const validatePositiveInteger = (row: any, field: string) => {
423 'max-height': 'calc(100% - 16px)', 466 'max-height': 'calc(100% - 16px)',
424 display: 'inline-block', 467 display: 'inline-block',
425 }"> 468 }">
426 <el-table-column prop="databaseChName" label="数据源" width="180" /> 469 <el-table-column prop="databaseChName" label="数据源" width="180" show-overflow-tooltip />
427 <el-table-column prop="tableName" label="表名称" width="180" /> 470 <el-table-column prop="tableName" label="表名称" width="180" show-overflow-tooltip />
428 <el-table-column prop="tableChName" label="数据库表" width="280" /> 471 <el-table-column prop="tableChName" label="数据库表" width="280" show-overflow-tooltip />
429 <el-table-column prop="description" label="描述" width="180" show-overflow-tooltip /> 472 <el-table-column prop="description" label="描述" width="180" show-overflow-tooltip />
430 </el-table> 473 </el-table>
431 </div> 474 </div>
...@@ -484,7 +527,7 @@ const validatePositiveInteger = (row: any, field: string) => { ...@@ -484,7 +527,7 @@ const validatePositiveInteger = (row: any, field: string) => {
484 <el-table-column prop="fieldLengthCondition" label="长度" width="340" align="center"> 527 <el-table-column prop="fieldLengthCondition" label="长度" width="340" align="center">
485 <template #default="scope"> 528 <template #default="scope">
486 <span v-if="!scope.row.isEdit"> 529 <span v-if="!scope.row.isEdit">
487 {{ scope.row.fieldLengthCondition ? scope.row.fieldLengthCondition : '--' }} 530 {{ parseFieldLengthCondition(scope.row.fieldLengthCondition) || '--' }}
488 </span> 531 </span>
489 <div v-else> 532 <div v-else>
490 <div style="display: flex; align-items: center;"> 533 <div style="display: flex; align-items: center;">
......
...@@ -1019,11 +1019,11 @@ onActivated(() => { ...@@ -1019,11 +1019,11 @@ onActivated(() => {
1019 <!-- 排序列(不可编辑) --> 1019 <!-- 排序列(不可编辑) -->
1020 <el-table-column type="index" label="排序" width="80" align="center" /> 1020 <el-table-column type="index" label="排序" width="80" align="center" />
1021 <!-- 字段中文名(可编辑)fieldChName --> 1021 <!-- 字段中文名(可编辑)fieldChName -->
1022 <el-table-column prop="fieldChName" label="目标字段中文名" width="150" show-overflow-tooltip> 1022 <el-table-column prop="fieldChName" label="字段中文名" width="150" show-overflow-tooltip>
1023 <!-- 可以编辑 --> 1023 <!-- 可以编辑 -->
1024 <template #default="scope"> 1024 <template #default="scope">
1025 <span 1025 <span
1026 v-if="!scope.row.isEdit || !editableFields.fieldChName || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1')">{{ 1026 v-if="!scope.row.isEdit || !editableFields.fieldChName || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1' && route.query.state != '0')">{{
1027 scope.row.fieldChName ? 1027 scope.row.fieldChName ?
1028 scope.row.fieldChName 1028 scope.row.fieldChName
1029 : '--' }}</span> 1029 : '--' }}</span>
...@@ -1032,10 +1032,10 @@ onActivated(() => { ...@@ -1032,10 +1032,10 @@ onActivated(() => {
1032 1032
1033 </el-table-column> 1033 </el-table-column>
1034 <!-- 字段英文名(可编辑) --> 1034 <!-- 字段英文名(可编辑) -->
1035 <el-table-column prop="fieldName" label="目标字段英文名" width="150" show-overflow-tooltip> 1035 <el-table-column prop="fieldName" label="字段英文名" width="150" show-overflow-tooltip>
1036 <template #default="scope"> 1036 <template #default="scope">
1037 <span 1037 <span
1038 v-if="!scope.row.isEdit || !editableFields.fieldName || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1')">{{ 1038 v-if="!scope.row.isEdit || !editableFields.fieldName || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1' && route.query.state != '0')">{{
1039 scope.row.fieldName ? 1039 scope.row.fieldName ?
1040 scope.row.fieldName 1040 scope.row.fieldName
1041 : '--' }}</span> 1041 : '--' }}</span>
...@@ -1045,28 +1045,28 @@ onActivated(() => { ...@@ -1045,28 +1045,28 @@ onActivated(() => {
1045 </el-table-column> 1045 </el-table-column>
1046 <!-- 源数据库 --> 1046 <!-- 源数据库 -->
1047 <el-table-column prop="sourceDatabase" label="源数据库" width="150" show-overflow-tooltip 1047 <el-table-column prop="sourceDatabase" label="源数据库" width="150" show-overflow-tooltip
1048 v-if="route.query.foundMode == '1'"> 1048 v-if="route.query.editOpt != '1'">
1049 <template #default="scope"> 1049 <template #default="scope">
1050 {{ scope.row.sourceDatabase ? scope.row.sourceDatabase : '--' }} 1050 {{ scope.row.sourceDatabase ? scope.row.sourceDatabase : '--' }}
1051 </template> 1051 </template>
1052 </el-table-column> 1052 </el-table-column>
1053 <!-- 源数据表 --> 1053 <!-- 源数据表 -->
1054 <el-table-column prop="sourceTableName" label="源数据表" width="150" show-overflow-tooltip 1054 <el-table-column prop="sourceTableName" label="源数据表" width="150" show-overflow-tooltip
1055 v-if="route.query.foundMode === '1'"> 1055 v-if="route.query.editOpt != '1'">
1056 <template #default="scope"> 1056 <template #default="scope">
1057 {{ scope.row.sourceTableName ? scope.row.sourceTableName : '--' }} 1057 {{ scope.row.sourceTableName ? scope.row.sourceTableName : '--' }}
1058 </template> 1058 </template>
1059 </el-table-column> 1059 </el-table-column>
1060 <!-- 源字段中文 --> 1060 <!-- 源字段中文 -->
1061 <el-table-column prop="sourceFieldName" label="源字段中文" width="150" show-overflow-tooltip 1061 <el-table-column prop="sourceFieldName" label="源字段中文" width="150" show-overflow-tooltip
1062 v-if="route.query.foundMode === '1'"> 1062 v-if="route.query.editOpt != '1'">
1063 <template #default="scope"> 1063 <template #default="scope">
1064 {{ scope.row.sourceFieldName ? scope.row.sourceFieldName : '--' }} 1064 {{ scope.row.sourceFieldName ? scope.row.sourceFieldName : '--' }}
1065 </template> 1065 </template>
1066 </el-table-column> 1066 </el-table-column>
1067 <!-- 源字段英文 --> 1067 <!-- 源字段英文 -->
1068 <el-table-column prop="sourceFieldChName" label="源字段英文" width="120" show-overflow-tooltip 1068 <el-table-column prop="sourceFieldChName" label="源字段英文" width="120" show-overflow-tooltip
1069 v-if="route.query.foundMode === '1'"> 1069 v-if="route.query.editOpt != '1'">
1070 <template #default="scope"> 1070 <template #default="scope">
1071 <!-- {{ scope.row.sourceFieldName ? scope.row.sourceFieldName : '--' }} --> 1071 <!-- {{ scope.row.sourceFieldName ? scope.row.sourceFieldName : '--' }} -->
1072 1072
...@@ -1076,9 +1076,10 @@ onActivated(() => { ...@@ -1076,9 +1076,10 @@ onActivated(() => {
1076 </template> 1076 </template>
1077 </el-table-column> 1077 </el-table-column>
1078 <!-- 源端字段 fieldType fieldTypeProps--> 1078 <!-- 源端字段 fieldType fieldTypeProps-->
1079 <el-table-column prop="fieldType" label="源端字段类型" width="120"> 1079 <el-table-column prop="fieldType" label="字段类型" width="120">
1080 <template #default="scope"> 1080 <template #default="scope">
1081 <div v-if="scope.row.isEdit && !(scope.row.isPrimary === 'Y' && $route.query.editOpt === '1')"> 1081 <div
1082 v-if="scope.row.isEdit && !(scope.row.isPrimary === 'Y' && $route.query.editOpt === '1' && route.query.state != '0')">
1082 <el-select v-model="scope.row.fieldType" placeholder="选择类型" clearable filterable 1083 <el-select v-model="scope.row.fieldType" placeholder="选择类型" clearable filterable
1083 :props="fieldTypeProps"> 1084 :props="fieldTypeProps">
1084 <el-option v-for="(item, index) in fieldData" :key="index" :label="item.label" 1085 <el-option v-for="(item, index) in fieldData" :key="index" :label="item.label"
...@@ -1140,7 +1141,7 @@ onActivated(() => { ...@@ -1140,7 +1141,7 @@ onActivated(() => {
1140 <el-table-column prop="isPrimary" label="是否主键" width="100" align="left"> 1141 <el-table-column prop="isPrimary" label="是否主键" width="100" align="left">
1141 <template #default="scope"> 1142 <template #default="scope">
1142 <span 1143 <span
1143 v-if="!scope.row.isEdit || !editableFields.isPrimary || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1')">{{ 1144 v-if="!scope.row.isEdit || !editableFields.isPrimary || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1' && route.query.state != '0')">{{
1144 scope.row.isPrimary || '--' }}</span> 1145 scope.row.isPrimary || '--' }}</span>
1145 <el-select v-else v-model="scope.row.isPrimary" placeholder="请选择"> 1146 <el-select v-else v-model="scope.row.isPrimary" placeholder="请选择">
1146 <el-option label="Y" value="Y" /> 1147 <el-option label="Y" value="Y" />
...@@ -1151,7 +1152,8 @@ onActivated(() => { ...@@ -1151,7 +1152,8 @@ onActivated(() => {
1151 <!-- 是否必填(可编辑) --> 1152 <!-- 是否必填(可编辑) -->
1152 <el-table-column prop="notNull" label="是否必填" width="100" align="left"> 1153 <el-table-column prop="notNull" label="是否必填" width="100" align="left">
1153 <template #default="scope"> 1154 <template #default="scope">
1154 <span v-if="!scope.row.isEdit || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1')">{{ 1155 <span
1156 v-if="!scope.row.isEdit || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1' && route.query.state != '0')">{{
1155 scope.row.notNull || '--' }}</span> 1157 scope.row.notNull || '--' }}</span>
1156 <el-select v-else v-model="scope.row.notNull" placeholder="请选择"> 1158 <el-select v-else v-model="scope.row.notNull" placeholder="请选择">
1157 <el-option label="Y" value="Y" /> 1159 <el-option label="Y" value="Y" />
...@@ -1199,8 +1201,10 @@ onActivated(() => { ...@@ -1199,8 +1201,10 @@ onActivated(() => {
1199 <template #default="scope"> 1201 <template #default="scope">
1200 <span class="text_btn" v-if="!scope.row.isEdit" @click="editRow(scope.row)">编辑</span> 1202 <span class="text_btn" v-if="!scope.row.isEdit" @click="editRow(scope.row)">编辑</span>
1201 <span class="text_btn" v-else @click="saveRow(scope.row)">保存</span> 1203 <span class="text_btn" v-else @click="saveRow(scope.row)">保存</span>
1202 <el-divider direction="vertical" v-if="scope.row.isPrimary != 'Y'" /> 1204 <el-divider direction="vertical"
1203 <span class="text_btn" @click="deleteRow(scope.$index)" v-if="scope.row.isPrimary != 'Y'">删除</span> 1205 v-if="(route.query.state == '0' ? route.query.state == '0' : scope.row.isPrimary != 'Y')" />
1206 <span class="text_btn" @click="deleteRow(scope.$index)"
1207 v-if="(route.query.state == '0' ? route.query.state == '0' : scope.row.isPrimary != 'Y')">删除</span>
1204 </template> 1208 </template>
1205 </el-table-column> 1209 </el-table-column>
1206 </el-table> 1210 </el-table>
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!