|
|
@ -23,11 +23,30 @@ |
|
|
|
<!-- 数字输入框 --> |
|
|
|
<el-input-number v-else-if="getInputType(item.column) == 'inputNumber'" v-model="item.value" :precision="getInputPrecision(item.column)" :disabled="item.disabled"/> |
|
|
|
<!-- 下拉框 --> |
|
|
|
<el-select v-else-if="getInputType(item.column) == 'select'" v-model="item.value1" :placeholder="t('ts.请选择内容')" :filterable="getFilterable(item.column)" clearable :disabled="item.disabled" :multiple="item.action=='in' || item.action=='notIn' ? true : false" collapse-tags collapse-tags-tooltip :key="item.action"> |
|
|
|
<el-select v-else-if="getInputType(item.column) == 'select' && !getFilterable(item.column)" v-model="item.value1" :placeholder="t('ts.请选择内容')" :filterable="!getFilterable(item.column)" clearable :disabled="item.disabled" :multiple="item.action=='in' || item.action=='notIn' ? true : false" collapse-tags collapse-tags-tooltip :key="item.action"> |
|
|
|
<el-option v-for="dict in allDictOptions[item.column]" :key="dict.value" :label="t(`ts.${dict.label}`).replace('ts.','')" |
|
|
|
:value="dict.value" /> |
|
|
|
<!-- <el-option v-for="(op, index) in initSelectOptions(item.column)" :label="op[item.optionsLabel] || op.label" |
|
|
|
:value="op[item.optionsValue] || op.value" :key="index" /> --> |
|
|
|
</el-select> |
|
|
|
<el-select |
|
|
|
v-else-if="getInputType(item.column) == 'select' && getFilterable(item.column)" |
|
|
|
v-model="item.value1" |
|
|
|
:multiple="item.action == 'in' || item.action == 'notIn' ? true : false" |
|
|
|
collapse-tags |
|
|
|
collapse-tags-tooltip |
|
|
|
filterable |
|
|
|
remote |
|
|
|
reserve-keyword |
|
|
|
:placeholder="t('ts.请选择内容')" |
|
|
|
remote-show-suffix |
|
|
|
:remote-method="remoteMethod" |
|
|
|
:loading="loading" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="item in options" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value" |
|
|
|
/> |
|
|
|
</el-select> |
|
|
|
<!-- 时间 --> |
|
|
|
<el-time-picker v-else-if="getInputType(item.column) == 'time'" range-separator="-" :start-placeholder="t('ts.开始时间')" :end-placeholder="t('ts.结束时间')" v-model="item.value1" style="width: calc(100% - 20px);margin-right: 10px;" :disabled="item.disabled"/> |
|
|
@ -68,6 +87,12 @@ UserApi.getUserListAll().then((res) => { |
|
|
|
value: item.id |
|
|
|
} |
|
|
|
}) |
|
|
|
options.value = res.map((item) => { |
|
|
|
return { |
|
|
|
label: item.nickname, |
|
|
|
value: item.id |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
const props = defineProps({ |
|
|
@ -171,9 +196,9 @@ const getFilterable = (val) => { |
|
|
|
const type = searchOption_high.value.find(item => (item.field == val)) |
|
|
|
// 下拉列表过长,去掉筛选功能 |
|
|
|
if (type?.field == 'creator' || type?.field == 'updater' || type?.field == 'worker') { |
|
|
|
return false |
|
|
|
}else{ |
|
|
|
return true |
|
|
|
}else{ |
|
|
|
return false |
|
|
|
} |
|
|
|
} |
|
|
|
// 判断数字输入框小数点位数 |
|
|
@ -330,6 +355,21 @@ const changeDateTimePicker = (e, val,from) =>{ |
|
|
|
val.value = e.join(',') |
|
|
|
} |
|
|
|
} |
|
|
|
const loading = ref(false) |
|
|
|
const options = ref([]) |
|
|
|
const remoteMethod = (query, array) => { |
|
|
|
if (query) { |
|
|
|
loading.value = true |
|
|
|
setTimeout(() => { |
|
|
|
loading.value = false |
|
|
|
options.value = userListAll.value.filter((item) => { |
|
|
|
return item.label.toLowerCase().includes(query.toLowerCase()) |
|
|
|
}) |
|
|
|
}, 200) |
|
|
|
} else { |
|
|
|
options.value = userListAll.value |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
defineExpose({ |
|
|
|
popoverVisible |
|
|
|