|
|
@ -33,7 +33,7 @@ |
|
|
</div> |
|
|
</div> |
|
|
<!-- qc才能操作 --> |
|
|
<!-- qc才能操作 --> |
|
|
<div class="handle-row" v-if="isShowHandle()"> |
|
|
<div class="handle-row" v-if="isShowHandle()"> |
|
|
<el-checkbox class="ml-5"></el-checkbox> |
|
|
|
|
|
|
|
|
<el-checkbox class="ml-5" @change="onCheckboxChange"></el-checkbox> |
|
|
<div @mouseenter="onMouseEnter" @mouseleave="onMouseLeave"> |
|
|
<div @mouseenter="onMouseEnter" @mouseleave="onMouseLeave"> |
|
|
<Question class="handle-icon" :class="getQuestionColor()" /> |
|
|
<Question class="handle-icon" :class="getQuestionColor()" /> |
|
|
</div> |
|
|
</div> |
|
|
@ -75,6 +75,7 @@ |
|
|
<script> |
|
|
<script> |
|
|
import Question from "./icons/Question.vue"; |
|
|
import Question from "./icons/Question.vue"; |
|
|
import DecimalInput from "./DecimalInput.vue"; |
|
|
import DecimalInput from "./DecimalInput.vue"; |
|
|
|
|
|
import { EventBus } from "@/utils/eventBus" |
|
|
export default { |
|
|
export default { |
|
|
components: { |
|
|
components: { |
|
|
Question, |
|
|
Question, |
|
|
@ -152,6 +153,17 @@ export default { |
|
|
//gray 灰色 green 绿色 orange 橙色 |
|
|
//gray 灰色 green 绿色 orange 橙色 |
|
|
return "green" |
|
|
return "green" |
|
|
}, |
|
|
}, |
|
|
|
|
|
// 复选框变化处理 |
|
|
|
|
|
onCheckboxChange(val) { |
|
|
|
|
|
// 触发修改记录事件 |
|
|
|
|
|
EventBus.$emit('onModifyRecord', { |
|
|
|
|
|
timestamp: new Date().toLocaleString(), |
|
|
|
|
|
oldValue: this.oldValue, |
|
|
|
|
|
newValue: val, |
|
|
|
|
|
}); |
|
|
|
|
|
// this.$emit('input', val); |
|
|
|
|
|
// this.$emit('change', val); |
|
|
|
|
|
}, |
|
|
// 统一处理输入变化 |
|
|
// 统一处理输入变化 |
|
|
onInputChange(val) { |
|
|
onInputChange(val) { |
|
|
const value = val !== undefined ? val : this.inputValue; |
|
|
const value = val !== undefined ? val : this.inputValue; |
|
|
@ -180,24 +192,33 @@ export default { |
|
|
} |
|
|
} |
|
|
const {templateStatus} = this.$store.state.template; |
|
|
const {templateStatus} = this.$store.state.template; |
|
|
// 检查值是否发生变化 |
|
|
// 检查值是否发生变化 |
|
|
if (this.inputValue !== this.oldValue && templateStatus === "actFill") { |
|
|
|
|
|
|
|
|
if (templateStatus === "actFill") { |
|
|
// 值发生了变化,需要弹出密码输入框 |
|
|
// 值发生了变化,需要弹出密码输入框 |
|
|
try { |
|
|
try { |
|
|
// const passwordResult = await this.$prompt('请输入密码以确认修改', '密码验证', { |
|
|
|
|
|
// confirmButtonText: '确定', |
|
|
|
|
|
// cancelButtonText: '取消', |
|
|
|
|
|
// inputType: 'password', |
|
|
|
|
|
// inputPattern: /.+/, |
|
|
|
|
|
// inputErrorMessage: '请输入密码', |
|
|
|
|
|
// zIndex: 10000, |
|
|
|
|
|
// }); |
|
|
|
|
|
// 用户输入密码并点击确定,保存修改 |
|
|
|
|
|
|
|
|
if(this.oldValue && this.oldValue !== this.inputValue){ |
|
|
|
|
|
const passwordResult = await this.$prompt('请输入密码以确认修改', '密码验证', { |
|
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
|
inputType: 'password', |
|
|
|
|
|
inputPattern: /.+/, |
|
|
|
|
|
inputErrorMessage: '请输入密码', |
|
|
|
|
|
zIndex: 10000, |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
this.$emit("onModifyRecord", { |
|
|
|
|
|
timestamp: new Date().toLocaleString(), |
|
|
|
|
|
oldValue: this.oldValue, |
|
|
|
|
|
value: this.inputValue, |
|
|
|
|
|
title:this.oldValue?"修改记录":"填写", |
|
|
|
|
|
field:"试验基本信息-其他信息" |
|
|
|
|
|
}) |
|
|
|
|
|
//用户输入密码并点击确定,保存修改 |
|
|
this.oldValue = this.inputValue; // 更新旧值 |
|
|
this.oldValue = this.inputValue; // 更新旧值 |
|
|
this.$emit("blur", val); |
|
|
this.$emit("blur", val); |
|
|
this.$emit('input', this.inputValue); |
|
|
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; |
|
|
|