b6de3bf9 by xukangle

fix

1 parent 820266a3
......@@ -205,6 +205,10 @@ const inputChange = (val, row) => {
/** 输入框输入触发事件 */
const inputEventChange = (val, item) => {
if (val === '' && item.clearable) {
formInline.value[item.field] = '';
return;
}
if (item.regexp) {
formInline.value[item.field] = val.replace(item.regexp, '');
if (item.min != null && (formInline.value[item.field] < item.min)) {
......
......@@ -511,6 +511,22 @@ const tableCheckboxAllSelectChange = (select) => {
// 批量配置业务规则
const batchControlRules = () => {
// 清空 classEditFormInfo.value.formInfo;
classEditFormItems.value.map(item => {
if (item.field == 'orderNum') {
item.visible = true;
}
if (item.field == 'orderNum1') {
item.visible = false;
}
item.default = '';
if (item.children) {
item.children.map(item => {
item.default = '';
})
}
});
// 判断是否选中数据
if (!selectedRulesData.value || !selectedRulesData.value.guids || selectedRulesData.value.guids.length == 0) {
proxy.$ElMessage.warning('请选择数据');
......@@ -544,6 +560,7 @@ const batchControlRules = () => {
return false;
}
console.log('isSingleInputField', isSingleInputField, 'isDoubleInputField', isDoubleInputField);
// 如果全都是单文本框或者全都是双文本框,则继续后续操作
if (isSingleInputField) {
classEditFormItems.value[4].visible = false;
......@@ -836,6 +853,7 @@ const classEditFormItems = ref<any>([{
field: 'startNumber',
default: '',
maxlength: 6,
min: 1,
regexp: /\D/g,
clearable: true,
required: false,
......@@ -847,6 +865,7 @@ const classEditFormItems = ref<any>([{
field: 'endNumber',
default: '',
maxlength: 6,
min: 1,
regexp: /\D/g,
clearable: true,
required: false,
......@@ -863,6 +882,7 @@ const classEditFormItems = ref<any>([{
field: 'fieldPrecision',
maxlength: 2,
regexp: /\D/g,
min: 1,
required: false,
clearable: true,
block: true,
......@@ -906,6 +926,7 @@ const classEditFormItems = ref<any>([{
field: 'startValue',
clearable: true,
required: false,
min: 1,
regexp: /\D/g,
},
{
......@@ -913,6 +934,7 @@ const classEditFormItems = ref<any>([{
placeholder: '请输入',
field: 'endValue',
clearable: true,
min: 1,
required: false,
regexp: /\D/g,
},
......@@ -1129,6 +1151,21 @@ const drawerSelectChange = (val, row, info) => {
}
});
}
if (val === '>' || val === '<' || val === '=' || val === '>=' || val === '<=') {
{
classEditFormItems.value.forEach(item => {
if (item.field === 'orderNum') {
item.visible = true;
}
if (item.field === 'orderNum1') {
item.visible = false;
}
if (item.field === 'orderNumLength') {
item.default = val;
}
});
}
}
}
// tab切换
......@@ -1680,7 +1717,7 @@ const onAChange = async () => {
await getDbDirTableSelectData(2, { databaseGuid: selectedA.value, condition: "2" }); // 数据库搜索
}
}
console.log('selectedA',);
};
......@@ -1741,7 +1778,12 @@ onActivated(async () => {
const gradeTreeRef = ref<any>();
const treeSelectNodeClick = (node, item) => {
console.log('treeSelectNodeClick', gradeTreeRef.value.treeRef);
nextTick(() => {
const nodeElement = gradeTreeRef.value.treeRef.$el.querySelector(`[data-key="${String(node.classifyDetailGuid)}"]`);
if (nodeElement) {
nodeElement.offsetTop - gradeTreeRef.value.treeRef.$el.clientHeight > 0 && (gradeTreeRef.value.treeRef.$el.scrollTop = nodeElement.offsetTop - gradeTreeRef.value.treeRef.$el.clientHeight + 32);
}
});
classifyDetailGuidInfo.value = node.classifyDetailGuid;
treeInfo.value.expandedKey = [];
treeInfo.value.expandedKey.push(node.classifyDetailGuid);
......
......@@ -221,12 +221,14 @@ const saveRow = (row) => {
row.fieldLengthCondition = ''
}
if (row.lengthSymbol && row.lengthValue) {
console.log('row.lengthSymbol', row.lengthSymbol + '#' + row.lengthValue)
row.fieldLengthCondition = row.lengthSymbol + '#' + row.lengthValue
}
// 字段范围 双文本情况
if (!isSingleInput(row.fieldType)) {
row.fieldValueRange = (row.startValue ? row.startValue : '') + '#' + (row.endValue ? row.endValue : '')
}
row.isEdit = false
}
......@@ -412,7 +414,48 @@ const validatePositiveInteger = (row: any, field: string) => {
row[field] = '';
}
};
function parseFieldLengthCondition(condition) {
// 如果 condition 为 null 或 undefined,直接返回默认值
if (!condition) {
return '--';
}
if (condition.includes('between')) {
const parts = condition.split('#').filter(Boolean); // 按 '#' 分割并去掉空值
return `${parts[1]}-${parts[2]}`; // 显示为 "10-20"
}
let symbol = '';
let value = '';
if (condition.startsWith('>=') || condition.startsWith('<=')) {
symbol = condition.slice(0, 2); // 取前两个字符 '>=', '<='
value = condition.substring(2); // 取从第三个字符开始的部分 '10'
} else {
symbol = condition[0];
value = condition.substring(1);
}
value = value.replace('#', '');
let displayText = '';
switch (symbol) {
case '>':
displayText = `大于${value}`;
break;
case '=':
displayText = `等于${value}`;
break;
case '<':
displayText = `小于${value}`;
break;
case '>=':
displayText = `大于等于${value}`;
break;
case '<=':
displayText = `小于等于${value}`;
break;
default:
displayText = `--`;
break;
}
return displayText;
}
</script>
<template>
<div class="configure-rules">
......@@ -423,9 +466,9 @@ const validatePositiveInteger = (row: any, field: string) => {
'max-height': 'calc(100% - 16px)',
display: 'inline-block',
}">
<el-table-column prop="databaseChName" label="数据源" width="180" />
<el-table-column prop="tableName" label="表名称" width="180" />
<el-table-column prop="tableChName" label="数据库表" width="280" />
<el-table-column prop="databaseChName" label="数据源" width="180" show-overflow-tooltip />
<el-table-column prop="tableName" label="表名称" width="180" show-overflow-tooltip />
<el-table-column prop="tableChName" label="数据库表" width="280" show-overflow-tooltip />
<el-table-column prop="description" label="描述" width="180" show-overflow-tooltip />
</el-table>
</div>
......@@ -484,7 +527,7 @@ const validatePositiveInteger = (row: any, field: string) => {
<el-table-column prop="fieldLengthCondition" label="长度" width="340" align="center">
<template #default="scope">
<span v-if="!scope.row.isEdit">
{{ scope.row.fieldLengthCondition ? scope.row.fieldLengthCondition : '--' }}
{{ parseFieldLengthCondition(scope.row.fieldLengthCondition) || '--' }}
</span>
<div v-else>
<div style="display: flex; align-items: center;">
......
......@@ -1019,11 +1019,11 @@ onActivated(() => {
<!-- 排序列(不可编辑) -->
<el-table-column type="index" label="排序" width="80" align="center" />
<!-- 字段中文名(可编辑)fieldChName -->
<el-table-column prop="fieldChName" label="目标字段中文名" width="150" show-overflow-tooltip>
<el-table-column prop="fieldChName" label="字段中文名" width="150" show-overflow-tooltip>
<!-- 可以编辑 -->
<template #default="scope">
<span
v-if="!scope.row.isEdit || !editableFields.fieldChName || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1')">{{
v-if="!scope.row.isEdit || !editableFields.fieldChName || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1' && route.query.state != '0')">{{
scope.row.fieldChName ?
scope.row.fieldChName
: '--' }}</span>
......@@ -1032,10 +1032,10 @@ onActivated(() => {
</el-table-column>
<!-- 字段英文名(可编辑) -->
<el-table-column prop="fieldName" label="目标字段英文名" width="150" show-overflow-tooltip>
<el-table-column prop="fieldName" label="字段英文名" width="150" show-overflow-tooltip>
<template #default="scope">
<span
v-if="!scope.row.isEdit || !editableFields.fieldName || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1')">{{
v-if="!scope.row.isEdit || !editableFields.fieldName || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1' && route.query.state != '0')">{{
scope.row.fieldName ?
scope.row.fieldName
: '--' }}</span>
......@@ -1045,28 +1045,28 @@ onActivated(() => {
</el-table-column>
<!-- 源数据库 -->
<el-table-column prop="sourceDatabase" label="源数据库" width="150" show-overflow-tooltip
v-if="route.query.foundMode == '1'">
v-if="route.query.editOpt != '1'">
<template #default="scope">
{{ scope.row.sourceDatabase ? scope.row.sourceDatabase : '--' }}
</template>
</el-table-column>
<!-- 源数据表 -->
<el-table-column prop="sourceTableName" label="源数据表" width="150" show-overflow-tooltip
v-if="route.query.foundMode === '1'">
v-if="route.query.editOpt != '1'">
<template #default="scope">
{{ scope.row.sourceTableName ? scope.row.sourceTableName : '--' }}
</template>
</el-table-column>
<!-- 源字段中文 -->
<el-table-column prop="sourceFieldName" label="源字段中文" width="150" show-overflow-tooltip
v-if="route.query.foundMode === '1'">
v-if="route.query.editOpt != '1'">
<template #default="scope">
{{ scope.row.sourceFieldName ? scope.row.sourceFieldName : '--' }}
</template>
</el-table-column>
<!-- 源字段英文 -->
<el-table-column prop="sourceFieldChName" label="源字段英文" width="120" show-overflow-tooltip
v-if="route.query.foundMode === '1'">
v-if="route.query.editOpt != '1'">
<template #default="scope">
<!-- {{ scope.row.sourceFieldName ? scope.row.sourceFieldName : '--' }} -->
......@@ -1076,9 +1076,10 @@ onActivated(() => {
</template>
</el-table-column>
<!-- 源端字段 fieldType fieldTypeProps-->
<el-table-column prop="fieldType" label="源端字段类型" width="120">
<el-table-column prop="fieldType" label="字段类型" width="120">
<template #default="scope">
<div v-if="scope.row.isEdit && !(scope.row.isPrimary === 'Y' && $route.query.editOpt === '1')">
<div
v-if="scope.row.isEdit && !(scope.row.isPrimary === 'Y' && $route.query.editOpt === '1' && route.query.state != '0')">
<el-select v-model="scope.row.fieldType" placeholder="选择类型" clearable filterable
:props="fieldTypeProps">
<el-option v-for="(item, index) in fieldData" :key="index" :label="item.label"
......@@ -1140,7 +1141,7 @@ onActivated(() => {
<el-table-column prop="isPrimary" label="是否主键" width="100" align="left">
<template #default="scope">
<span
v-if="!scope.row.isEdit || !editableFields.isPrimary || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1')">{{
v-if="!scope.row.isEdit || !editableFields.isPrimary || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1' && route.query.state != '0')">{{
scope.row.isPrimary || '--' }}</span>
<el-select v-else v-model="scope.row.isPrimary" placeholder="请选择">
<el-option label="Y" value="Y" />
......@@ -1151,7 +1152,8 @@ onActivated(() => {
<!-- 是否必填(可编辑) -->
<el-table-column prop="notNull" label="是否必填" width="100" align="left">
<template #default="scope">
<span v-if="!scope.row.isEdit || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1')">{{
<span
v-if="!scope.row.isEdit || (scope.row.isPrimary === 'Y' && route.query.editOpt === '1' && route.query.state != '0')">{{
scope.row.notNull || '--' }}</span>
<el-select v-else v-model="scope.row.notNull" placeholder="请选择">
<el-option label="Y" value="Y" />
......@@ -1199,8 +1201,10 @@ onActivated(() => {
<template #default="scope">
<span class="text_btn" v-if="!scope.row.isEdit" @click="editRow(scope.row)">编辑</span>
<span class="text_btn" v-else @click="saveRow(scope.row)">保存</span>
<el-divider direction="vertical" v-if="scope.row.isPrimary != 'Y'" />
<span class="text_btn" @click="deleteRow(scope.$index)" v-if="scope.row.isPrimary != 'Y'">删除</span>
<el-divider direction="vertical"
v-if="(route.query.state == '0' ? route.query.state == '0' : scope.row.isPrimary != 'Y')" />
<span class="text_btn" @click="deleteRow(scope.$index)"
v-if="(route.query.state == '0' ? route.query.state == '0' : scope.row.isPrimary != 'Y')">删除</span>
</template>
</el-table-column>
</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!