update 破碎

This commit is contained in:
lb
2023-02-28 15:38:35 +08:00
parent b1adcec01c
commit f093cf413c
4 changed files with 238 additions and 6 deletions

View File

@@ -12,7 +12,7 @@
>
<el-input v-if="opt.input" v-model="dataForm[opt.prop]" v-bind="opt.bind" clearable size="small" />
<el-select v-if="opt.select" v-model="dataForm[opt.prop]" v-bind="opt.bind" clearable size="small">
<el-option v-for="item in opt.select" :key="item.value" :label="item.label" :value="item.value" />
<el-option v-for="item in opt.select" :key="item.value + Math.random().toString()" :label="item.label" :value="item.value" />
</el-select>
<el-date-picker v-if="opt.timerange" v-model="dataForm[opt.prop]" v-bind="opt.bind" clearable size="small" />
<el-upload
@@ -83,6 +83,7 @@ export default {
// 更新选项列表
if (!field.watch && field.fn && typeof field.fn === "function") {
const optionLabel = field.fieldOptionLabel;
const optionValue = field.fieldOptionValue;
// 设置自身的选项列表
field.fn().then(({ data: res }) => {
if (res.code === 0 && res.data) {
@@ -91,7 +92,10 @@ export default {
this.$set(
field,
"select",
res.data.list.map((item) => ({ label: optionLabel ? item[optionLabel] : item.name, value: item.id }))
res.data.list.map((item) => ({
label: optionLabel ? item[optionLabel] : item.name,
value: optionValue ? item[optionValue] : item.id,
}))
);
}
} else {

View File

@@ -137,7 +137,7 @@ export default {
this.$set(
col,
"options",
res.data.list.map((i) => ({ label: i.name, value: i.id }))
res.data.list.map((i) => ({ label: i.name, value: col.optionValue ? i[col.optionValue] : i.id }))
);
// col.options = res.data.list;
} else {
@@ -325,12 +325,21 @@ export default {
/** 针对时间段设置 payload */
if ("startTime" in this.dataForm && "endTime" in this.dataForm) {
const {startTime, endTime} = this.dataForm;
const { startTime, endTime } = this.dataForm;
httpPayload = {
...httpPayload,
startTime: startTime ? moment(startTime).format("YYYY-MM-DDTHH:mm:ss") : moment().format("YYYY-MM-DDTHH:mm:ss"),
endTime: endTime ? moment(endTime).format("YYYY-MM-DDTHH:mm:ss") : moment().format("YYYY-MM-DDTHH:mm:ss")
}
endTime: endTime ? moment(endTime).format("YYYY-MM-DDTHH:mm:ss") : moment().format("YYYY-MM-DDTHH:mm:ss"),
};
}
/** 针对时间段设置 payload */
if ("updateTime" in this.dataForm) {
const { updateTime } = this.dataForm;
httpPayload = {
...httpPayload,
updateTime: updateTime ? moment(updateTime).format("YYYY-MM-DDTHH:mm:ss") : moment().format("YYYY-MM-DDTHH:mm:ss")
};
}
/** 发送 */