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