|
|
@ -17,7 +17,7 @@ |
|
|
@input="onInputChange" @change="onInputChange" /> |
|
|
@input="onInputChange" @change="onInputChange" /> |
|
|
<el-select v-else-if="type === 'select'" class="flex1" :multiple="item.multiple" |
|
|
<el-select v-else-if="type === 'select'" class="flex1" :multiple="item.multiple" |
|
|
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" v-model="inputValue" :disabled="getDisabled()" |
|
|
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" v-model="inputValue" :disabled="getDisabled()" |
|
|
:placeholder="getPlaceholder()" @change="onCommonHandleSaveRecord"> |
|
|
|
|
|
|
|
|
:placeholder="getPlaceholder()" @change="onInputChange"> |
|
|
<el-option v-for="op in item.options" :key="op.value" :label="op.label" :value="op.value"> |
|
|
<el-option v-for="op in item.options" :key="op.value" :label="op.label" :value="op.value"> |
|
|
</el-option> |
|
|
</el-option> |
|
|
</el-select> |
|
|
</el-select> |
|
|
@ -190,19 +190,21 @@ export default { |
|
|
// 用户输入密码并点击确定,保存修改 |
|
|
// 用户输入密码并点击确定,保存修改 |
|
|
this.oldValue = this.inputValue; // 更新旧值 |
|
|
this.oldValue = this.inputValue; // 更新旧值 |
|
|
this.$emit("blur", val); |
|
|
this.$emit("blur", val); |
|
|
|
|
|
this.$emit('input', this.inputValue); |
|
|
this.$emit("change", val); |
|
|
this.$emit("change", val); |
|
|
// 调用后端接口记录修改记录 |
|
|
// 调用后端接口记录修改记录 |
|
|
await this.saveModificationRecord(); |
|
|
await this.saveModificationRecord(); |
|
|
} catch { |
|
|
} catch { |
|
|
// 用户点击取消,还原数据 |
|
|
// 用户点击取消,还原数据 |
|
|
this.inputValue = this.oldValue; |
|
|
this.inputValue = this.oldValue; |
|
|
this.$emit('input', this.oldValue); // 触发 v-model 更新 |
|
|
|
|
|
|
|
|
this.$emit('input', this.inputValue); // 触发 v-model 更新 |
|
|
this.$emit("blur", this.oldValue); |
|
|
this.$emit("blur", this.oldValue); |
|
|
this.$emit("change", this.oldValue); |
|
|
this.$emit("change", this.oldValue); |
|
|
} |
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
// 值没有变化,正常触发 blur和change 事件 |
|
|
// 值没有变化,正常触发 blur和change 事件 |
|
|
this.$emit("blur", val) |
|
|
this.$emit("blur", val) |
|
|
|
|
|
// this.$emit('input', val); |
|
|
this.$emit("change", val) |
|
|
this.$emit("change", val) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
@ -339,7 +341,6 @@ export default { |
|
|
|
|
|
|
|
|
// 生成唯一字段ID (id + key值) |
|
|
// 生成唯一字段ID (id + key值) |
|
|
getFieldId() { |
|
|
getFieldId() { |
|
|
// 使用写死的id作为示例,后续您可以用实际的id替换 |
|
|
|
|
|
const templateId = 'template_123'; // 这里是写死的id |
|
|
const templateId = 'template_123'; // 这里是写死的id |
|
|
const fieldKey = this.item.key || this.item.prop || this.item.label || 'default_key'; |
|
|
const fieldKey = this.item.key || this.item.prop || this.item.label || 'default_key'; |
|
|
|
|
|
|
|
|
|