feat: 调整自动化代码富文本模式下的可选查询条件
This commit is contained in:
parent
f608bfa191
commit
a8e706a395
|
|
@ -386,20 +386,22 @@
|
|||
}
|
||||
|
||||
const canSelect = (item) => {
|
||||
const fieldType = middleDate.value.fieldType
|
||||
if (fieldType !== 'string' && item === 'LIKE') {
|
||||
return true
|
||||
const fieldType = middleDate.value.fieldType;
|
||||
|
||||
if (fieldType === 'richtext') {
|
||||
return item !== 'LIKE';
|
||||
}
|
||||
|
||||
if (
|
||||
fieldType !== 'int' &&
|
||||
fieldType !== 'time.Time' &&
|
||||
fieldType !== 'float64' &&
|
||||
(item === 'BETWEEN' || item === 'NOT BETWEEN')
|
||||
) {
|
||||
return true
|
||||
if (fieldType !== 'string' && item === 'LIKE') {
|
||||
return true;
|
||||
}
|
||||
return false
|
||||
|
||||
const nonNumericTypes = ['int', 'time.Time', 'float64'];
|
||||
if (!nonNumericTypes.includes(fieldType) && ['BETWEEN', 'NOT BETWEEN'].includes(item)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
const clearOther = () => {
|
||||
|
|
|
|||
|
|
@ -703,14 +703,7 @@
|
|||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
:disabled="
|
||||
(row.fieldType !== 'string' && item.value === 'LIKE') ||
|
||||
(row.fieldType !== 'int' &&
|
||||
row.fieldType !== 'time.Time' &&
|
||||
row.fieldType !== 'float64' &&
|
||||
(item.value === 'BETWEEN' ||
|
||||
item.value === 'NOT BETWEEN'))
|
||||
"
|
||||
:disabled="canSelect(row.fieldType,item.value)"
|
||||
/>
|
||||
</el-select>
|
||||
</template>
|
||||
|
|
@ -1652,6 +1645,23 @@
|
|||
}
|
||||
}
|
||||
)
|
||||
|
||||
const canSelect = (fieldType,item) => {
|
||||
if (fieldType === 'richtext') {
|
||||
return item !== 'LIKE';
|
||||
}
|
||||
|
||||
if (fieldType !== 'string' && item === 'LIKE') {
|
||||
return true;
|
||||
}
|
||||
|
||||
const nonNumericTypes = ['int', 'time.Time', 'float64'];
|
||||
if (!nonNumericTypes.includes(fieldType) && ['BETWEEN', 'NOT BETWEEN'].includes(item)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
|
|
|||
Loading…
Reference in New Issue