|
|
@ -33,25 +33,10 @@ |
|
|
{{ option.label }} |
|
|
{{ option.label }} |
|
|
</el-radio> |
|
|
</el-radio> |
|
|
</el-radio-group> |
|
|
</el-radio-group> |
|
|
<div v-else-if="type === 'checkboxList'" class="flex1 checkbox-list-container" |
|
|
|
|
|
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')"> |
|
|
|
|
|
<el-checkbox-group v-model="checkboxListValue.checkboxValues" @change="onCheckboxListChange"> |
|
|
|
|
|
<div v-for="option in item.options" :key="option.value" class="checkbox-item"> |
|
|
|
|
|
<el-checkbox :label="option.value" :disabled="getDisabled()"> |
|
|
|
|
|
{{ option.label }} |
|
|
|
|
|
</el-checkbox> |
|
|
|
|
|
<div v-if="isShowCheckboxListOther(option)"> |
|
|
|
|
|
<el-input v-model="checkboxListValue.otherValues[option.otherCode]" |
|
|
|
|
|
:class="{ 'error-border': isOtherInputError(option.otherCode) }" |
|
|
|
|
|
:placeholder="option.otherPlaceholder || '请输入'" |
|
|
|
|
|
@blur="onCheckboxListOtherBlur($event, option.otherCode)" /> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</el-checkbox-group> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div v-else-if="type === 'checkboxTree'" class="flex1 checkbox-list-container" |
|
|
<div v-else-if="type === 'checkboxTree'" class="flex1 checkbox-list-container" |
|
|
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')"> |
|
|
|
|
|
<div v-for="group in item.options" :key="group.value" class="checkbox-tree-group" :class="{'item-center': isShowOtherByCheckboxTree(group.value)}"> |
|
|
|
|
|
|
|
|
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '') + (error ? ' form-error-border' : '')"> |
|
|
|
|
|
<div v-for="group in item.options" :key="group.value" class="checkbox-tree-group" |
|
|
|
|
|
:class="{ 'item-center': isShowOtherByCheckboxTree(group.value) }"> |
|
|
<el-checkbox :label="group.value" :disabled="getDisabled()" |
|
|
<el-checkbox :label="group.value" :disabled="getDisabled()" |
|
|
:value="getCheckboxTreeChecked(group.value)" |
|
|
:value="getCheckboxTreeChecked(group.value)" |
|
|
:indeterminate="getCheckboxTreeIndeterminate(group.value)" |
|
|
:indeterminate="getCheckboxTreeIndeterminate(group.value)" |
|
|
@ -67,27 +52,26 @@ |
|
|
</el-checkbox> |
|
|
</el-checkbox> |
|
|
<div v-if="isShowOtherByCheckboxTree(child.value) && isCheckboxTreeChecked(child.value)" |
|
|
<div v-if="isShowOtherByCheckboxTree(child.value) && isCheckboxTreeChecked(child.value)" |
|
|
class="checkbox-tree-input-container"> |
|
|
class="checkbox-tree-input-container"> |
|
|
<el-input maxlength = "100" v-model="inputValue.otherValues[child.value]" |
|
|
|
|
|
placeholder="请输入" @blur="onCheckboxTreeOtherBlur(child.value, $event)" /> |
|
|
|
|
|
|
|
|
<el-input maxlength="100" v-model="inputValue.otherValues[child.value]" |
|
|
|
|
|
:disabled="getDisabled()" placeholder="请输入" |
|
|
|
|
|
@blur="onCheckboxTreeOtherBlur(child.value, $event)" /> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<div v-if="isShowOtherByCheckboxTree(group.value) && isCheckboxTreeChecked(group.value)" |
|
|
<div v-if="isShowOtherByCheckboxTree(group.value) && isCheckboxTreeChecked(group.value)" |
|
|
class="checkbox-tree-input-container"> |
|
|
class="checkbox-tree-input-container"> |
|
|
<el-input maxlength = "100" v-model="inputValue.otherValues[group.value]" |
|
|
|
|
|
placeholder="请输入" @blur="onCheckboxTreeOtherBlur(group.value, $event)" /> |
|
|
|
|
|
|
|
|
<el-input maxlength="100" v-model="inputValue.otherValues[group.value]" |
|
|
|
|
|
:disabled="getDisabled()" placeholder="请输入" |
|
|
|
|
|
@blur="onCheckboxTreeOtherBlur(group.value, $event)" /> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
<el-date-picker v-else-if="type === 'dateTime'" type="datetime" class="flex1" |
|
|
|
|
|
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" v-model="inputValue" |
|
|
|
|
|
:disabled="getDisabled()" format="yyyy/MM/dd HH:mm:ss" :placeholder="getPlaceholder()" |
|
|
|
|
|
@change="(val) => onDateChange(val, 'yyyy/MM/DD HH:mm:ss')"> |
|
|
|
|
|
</el-date-picker> |
|
|
|
|
|
<el-date-picker v-else-if="type === 'datePicker'" class="flex1" |
|
|
|
|
|
|
|
|
<el-date-picker v-else-if="type === 'dateTime' || type === 'datePicker'" |
|
|
|
|
|
:type="type === 'dateTime' ? 'datetime' : 'date'" class="flex1" |
|
|
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" v-model="inputValue" |
|
|
:class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" v-model="inputValue" |
|
|
:disabled="getDisabled()" format="yyyy/MM/dd" :placeholder="getPlaceholder()" |
|
|
|
|
|
@change="(val) => onDateChange(val, 'yyyy/MM/DD')"> |
|
|
|
|
|
|
|
|
:picker-options="pickerOptions" :disabled="getDisabled()" |
|
|
|
|
|
:format="type === 'dateTime' ? 'yyyy/MM/dd HH:mm:ss' : 'yyyy/MM/dd'" :placeholder="getPlaceholder()" |
|
|
|
|
|
@change="(val) => onDateChange(val, type === 'dateTime' ? 'yyyy/MM/DD HH:mm:ss' : 'yyyy/MM/DD')"> |
|
|
</el-date-picker> |
|
|
</el-date-picker> |
|
|
<el-button v-else-if="type === 'button'" :class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" |
|
|
<el-button v-else-if="type === 'button'" :class="getFillTypeStyle() + (orangeBg ? ' orange-bg' : '')" |
|
|
:disabled="getDisabled()" type="primary" @click="handleClickButton(item)"> |
|
|
:disabled="getDisabled()" type="primary" @click="handleClickButton(item)"> |
|
|
@ -229,7 +213,7 @@ import Question from "./icons/Question.vue"; |
|
|
import DecimalInput from "./DecimalInput.vue"; |
|
|
import DecimalInput from "./DecimalInput.vue"; |
|
|
import { EventBus } from "@/utils/eventBus"; |
|
|
import { EventBus } from "@/utils/eventBus"; |
|
|
import moment from "moment"; |
|
|
import moment from "moment"; |
|
|
import { getuuid,isEqual ,deepClone,getDefaultValueByOptions,isValueEmpty} from "@/utils/index.js"; |
|
|
|
|
|
|
|
|
import { getuuid, isEqual, deepClone, getDefaultValueByOptions, isValueEmpty } from "@/utils/index.js"; |
|
|
import { getToken } from "@/utils/auth"; |
|
|
import { getToken } from "@/utils/auth"; |
|
|
import { isShowOtherByCheckboxTree } from "@/utils/formPackageCommon"; |
|
|
import { isShowOtherByCheckboxTree } from "@/utils/formPackageCommon"; |
|
|
|
|
|
|
|
|
@ -293,13 +277,7 @@ export default { |
|
|
console.log(this.value, "check value"); |
|
|
console.log(this.value, "check value"); |
|
|
let initialOtherValues = {}, checkboxTagList = []; |
|
|
let initialOtherValues = {}, checkboxTagList = []; |
|
|
|
|
|
|
|
|
if (this.type === 'checkboxList' && !this.value) { |
|
|
|
|
|
initialValue = { |
|
|
|
|
|
checkboxValues: [], |
|
|
|
|
|
otherValues: {} |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
} else if (this.type === 'checkboxTag' && Array.isArray(this.value)) { |
|
|
|
|
|
|
|
|
if (this.type === 'checkboxTag' && Array.isArray(this.value)) { |
|
|
// checkboxTag类型,value是数组格式 |
|
|
// checkboxTag类型,value是数组格式 |
|
|
checkboxTagList = this.value.map(tag => ({ |
|
|
checkboxTagList = this.value.map(tag => ({ |
|
|
checked: tag.checked, |
|
|
checked: tag.checked, |
|
|
@ -327,8 +305,6 @@ export default { |
|
|
oldCheckboxTagList: JSON.parse(JSON.stringify(checkboxTagList)), // 记录上一次的checkboxTagList |
|
|
oldCheckboxTagList: JSON.parse(JSON.stringify(checkboxTagList)), // 记录上一次的checkboxTagList |
|
|
fqyqValue: initialValue, // fqyq类型的值 |
|
|
fqyqValue: initialValue, // fqyq类型的值 |
|
|
oldFqyqValue: { ...initialValue }, // 记录上一次的fqyq值 |
|
|
oldFqyqValue: { ...initialValue }, // 记录上一次的fqyq值 |
|
|
checkboxListValue: initialValue, // checkboxList类型的值 |
|
|
|
|
|
oldCheckboxListValue: JSON.parse(JSON.stringify(initialValue)), // 记录上一次的checkboxList值 |
|
|
|
|
|
uuid: getuuid(), // 唯一标识符,用于EventBus事件匹配 |
|
|
uuid: getuuid(), // 唯一标识符,用于EventBus事件匹配 |
|
|
regentType: ['sj', 'gsp', 'mix', 'xj', 'xb', 'gyzj', 'mjy', 'yq', 'jcb', 'qxbd'], //试剂/仪器/供试品等类型 |
|
|
regentType: ['sj', 'gsp', 'mix', 'xj', 'xb', 'gyzj', 'mjy', 'yq', 'jcb', 'qxbd'], //试剂/仪器/供试品等类型 |
|
|
selectRegentInfo: {},//选择的试剂/仪器/供试品等信息 |
|
|
selectRegentInfo: {},//选择的试剂/仪器/供试品等信息 |
|
|
@ -343,17 +319,26 @@ export default { |
|
|
currentHandleType: '',//当前操作的类型 |
|
|
currentHandleType: '',//当前操作的类型 |
|
|
currentOtherCode: '',//当前操作的otherCode |
|
|
currentOtherCode: '',//当前操作的otherCode |
|
|
currentCheckboxTreeValue: '',//当前操作的checkboxTree值 |
|
|
currentCheckboxTreeValue: '',//当前操作的checkboxTree值 |
|
|
isShowOtherByCheckboxTree |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
isShowOtherByCheckboxTree, |
|
|
|
|
|
pickerOptions: { |
|
|
|
|
|
disabledDate(time) { |
|
|
|
|
|
return time.getTime() > Date.now(); |
|
|
|
|
|
}, |
|
|
|
|
|
shortcuts: [{ |
|
|
|
|
|
text: '今天', |
|
|
|
|
|
onClick(picker) { |
|
|
|
|
|
picker.$emit('pick', new Date()); |
|
|
|
|
|
} |
|
|
|
|
|
}] |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
watch: { |
|
|
watch: { |
|
|
value(newVal) { |
|
|
value(newVal) { |
|
|
console.log(newVal, "newVal") |
|
|
console.log(newVal, "newVal") |
|
|
|
|
|
|
|
|
if (this.type === 'checkboxList' && newVal && typeof newVal === 'object') { |
|
|
|
|
|
this.checkboxListValue = JSON.parse(JSON.stringify(newVal)); |
|
|
|
|
|
} else if (this.type === 'checkboxTag' && Array.isArray(newVal)) { |
|
|
|
|
|
|
|
|
if (this.type === 'checkboxTag' && Array.isArray(newVal)) { |
|
|
// checkboxTag类型,value是数组格式 |
|
|
// checkboxTag类型,value是数组格式 |
|
|
this.checkboxTagList = newVal.map(tag => ({ |
|
|
this.checkboxTagList = newVal.map(tag => ({ |
|
|
checked: tag.checked, |
|
|
checked: tag.checked, |
|
|
@ -864,20 +849,6 @@ export default { |
|
|
this.emitCheckboxTagValue(); |
|
|
this.emitCheckboxTagValue(); |
|
|
this.onCommonHandleSaveRecord(); |
|
|
this.onCommonHandleSaveRecord(); |
|
|
}, |
|
|
}, |
|
|
// 检查是否显示显示checkboxList的其他输入框 |
|
|
|
|
|
isShowCheckboxListOther(option) { |
|
|
|
|
|
const { checkboxValues } = this.checkboxListValue |
|
|
|
|
|
if (!checkboxValues) { |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
return option.otherCode && checkboxValues.includes(option.value); |
|
|
|
|
|
}, |
|
|
|
|
|
// checkboxList的checkbox变化处理 |
|
|
|
|
|
onCheckboxListChange(val) { |
|
|
|
|
|
this.currentHandleType = 'checkboxListValue'; |
|
|
|
|
|
this.checkboxListValue.checkboxValues = val; |
|
|
|
|
|
this.onCommonHandleSaveRecord(); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// tag输入框失去焦点 |
|
|
// tag输入框失去焦点 |
|
|
onTagBlur(tagIndex) { |
|
|
onTagBlur(tagIndex) { |
|
|
@ -918,13 +889,6 @@ export default { |
|
|
onBlur(e) { |
|
|
onBlur(e) { |
|
|
this.onCommonHandleSaveRecord(e.target.value); |
|
|
this.onCommonHandleSaveRecord(e.target.value); |
|
|
}, |
|
|
}, |
|
|
// checkboxList的其他输入框失去焦点处理 |
|
|
|
|
|
onCheckboxListOtherBlur(e, otherCode) { |
|
|
|
|
|
this.currentHandleType = "checkboxListOther"; |
|
|
|
|
|
this.currentOtherCode = otherCode; |
|
|
|
|
|
this.checkboxListValue.otherValues[otherCode] = e.target.value; |
|
|
|
|
|
this.onCommonHandleSaveRecord(e.target.value); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 检查checkboxTree的某个值是否被选中 |
|
|
// 检查checkboxTree的某个值是否被选中 |
|
|
isCheckboxTreeChecked(value) { |
|
|
isCheckboxTreeChecked(value) { |
|
|
@ -964,11 +928,11 @@ export default { |
|
|
onCheckboxTreeParentChange(group, checked) { |
|
|
onCheckboxTreeParentChange(group, checked) { |
|
|
this.currentHandleType = 'checkboxTreeCheckbox'; |
|
|
this.currentHandleType = 'checkboxTreeCheckbox'; |
|
|
this.currentCheckboxTreeValue = group.value; |
|
|
this.currentCheckboxTreeValue = group.value; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 设置父级状态 |
|
|
// 设置父级状态 |
|
|
const parentItem = this.getOrCreateCheckedItem(group.value); |
|
|
const parentItem = this.getOrCreateCheckedItem(group.value); |
|
|
parentItem.checked = checked; |
|
|
parentItem.checked = checked; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 同步所有子级状态 |
|
|
// 同步所有子级状态 |
|
|
if (group.children && group.children.length > 0) { |
|
|
if (group.children && group.children.length > 0) { |
|
|
group.children.forEach(child => { |
|
|
group.children.forEach(child => { |
|
|
@ -980,7 +944,7 @@ export default { |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.onCommonHandleSaveRecord(); |
|
|
this.onCommonHandleSaveRecord(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
@ -988,40 +952,40 @@ export default { |
|
|
onCheckboxTreeChildChange(group, childValue, checked) { |
|
|
onCheckboxTreeChildChange(group, childValue, checked) { |
|
|
this.currentHandleType = 'checkboxTreeCheckbox'; |
|
|
this.currentHandleType = 'checkboxTreeCheckbox'; |
|
|
this.currentCheckboxTreeValue = childValue; |
|
|
this.currentCheckboxTreeValue = childValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 设置子级状态 |
|
|
// 设置子级状态 |
|
|
const childItem = this.getOrCreateCheckedItem(childValue); |
|
|
const childItem = this.getOrCreateCheckedItem(childValue); |
|
|
childItem.checked = checked; |
|
|
childItem.checked = checked; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 如果取消选中,清除otherValues |
|
|
// 如果取消选中,清除otherValues |
|
|
if (!checked) { |
|
|
if (!checked) { |
|
|
delete this.inputValue.otherValues[childValue]; |
|
|
delete this.inputValue.otherValues[childValue]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 更新父级状态 |
|
|
// 更新父级状态 |
|
|
this.updateParentState(group); |
|
|
this.updateParentState(group); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.onCommonHandleSaveRecord(); |
|
|
this.onCommonHandleSaveRecord(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 更新父级状态(根据子级状态) |
|
|
// 更新父级状态(根据子级状态) |
|
|
updateParentState(group) { |
|
|
updateParentState(group) { |
|
|
if (!group.children || group.children.length === 0) return; |
|
|
if (!group.children || group.children.length === 0) return; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const parentItem = this.getOrCreateCheckedItem(group.value); |
|
|
const parentItem = this.getOrCreateCheckedItem(group.value); |
|
|
const childValues = group.children.map(child => child.value); |
|
|
const childValues = group.children.map(child => child.value); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 统计子级选中状态 |
|
|
// 统计子级选中状态 |
|
|
let checkedCount = 0; |
|
|
let checkedCount = 0; |
|
|
let totalCount = childValues.length; |
|
|
let totalCount = childValues.length; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
childValues.forEach(childValue => { |
|
|
childValues.forEach(childValue => { |
|
|
const childItem = this.inputValue.checkedValues.find(item => item.label === childValue); |
|
|
const childItem = this.inputValue.checkedValues.find(item => item.label === childValue); |
|
|
if (childItem && childItem.checked) { |
|
|
if (childItem && childItem.checked) { |
|
|
checkedCount++; |
|
|
checkedCount++; |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 根据子级状态设置父级状态 |
|
|
// 根据子级状态设置父级状态 |
|
|
if (checkedCount === 0) { |
|
|
if (checkedCount === 0) { |
|
|
// 全部未选中,父级取消选中 |
|
|
// 全部未选中,父级取消选中 |
|
|
@ -1038,23 +1002,23 @@ export default { |
|
|
if (!this.inputValue || !this.inputValue.checkedValues) { |
|
|
if (!this.inputValue || !this.inputValue.checkedValues) { |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 找到对应的group |
|
|
// 找到对应的group |
|
|
const group = this.item.options.find(opt => opt.value === groupValue); |
|
|
const group = this.item.options.find(opt => opt.value === groupValue); |
|
|
if (!group || !group.children || group.children.length === 0) { |
|
|
if (!group || !group.children || group.children.length === 0) { |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const childValues = group.children.map(child => child.value); |
|
|
const childValues = group.children.map(child => child.value); |
|
|
let checkedCount = 0; |
|
|
let checkedCount = 0; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
childValues.forEach(childValue => { |
|
|
childValues.forEach(childValue => { |
|
|
const childItem = this.inputValue.checkedValues.find(item => item.label === childValue); |
|
|
const childItem = this.inputValue.checkedValues.find(item => item.label === childValue); |
|
|
if (childItem && childItem.checked) { |
|
|
if (childItem && childItem.checked) { |
|
|
checkedCount++; |
|
|
checkedCount++; |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 半选状态:有子级被选中但不是全部 |
|
|
// 半选状态:有子级被选中但不是全部 |
|
|
return checkedCount > 0 && checkedCount < childValues.length; |
|
|
return checkedCount > 0 && checkedCount < childValues.length; |
|
|
}, |
|
|
}, |
|
|
@ -1095,15 +1059,6 @@ export default { |
|
|
this.visible = true; |
|
|
this.visible = true; |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
getCheckboxListInfo() { |
|
|
|
|
|
const { otherValues, checkboxValues } = this.checkboxListValue; |
|
|
|
|
|
const { otherValues: oldOtherValues, checkboxValues: oldCheckboxValues } = this.oldCheckboxListValue; |
|
|
|
|
|
const o = { |
|
|
|
|
|
"checkboxListValue": { oldValue: oldCheckboxValues, newValue: checkboxValues, des: "" }, |
|
|
|
|
|
"checkboxListOther": { oldValue: oldOtherValues[this.currentOtherCode], newValue: otherValues[this.currentOtherCode], des: "样品信息:" }, |
|
|
|
|
|
} |
|
|
|
|
|
return o[this.currentHandleType]; |
|
|
|
|
|
}, |
|
|
|
|
|
getFqyqInfo() { |
|
|
getFqyqInfo() { |
|
|
const { mainRadio, inputValue, subRadio } = this.fqyqValue; |
|
|
const { mainRadio, inputValue, subRadio } = this.fqyqValue; |
|
|
const { mainRadio: oldMainRadio, inputValue: oldInputValue, subRadio: oldSubRadio } = this.oldFqyqValue; |
|
|
const { mainRadio: oldMainRadio, inputValue: oldInputValue, subRadio: oldSubRadio } = this.oldFqyqValue; |
|
|
@ -1172,17 +1127,12 @@ export default { |
|
|
// 值发生了变化,需要弹出密码输入框 |
|
|
// 值发生了变化,需要弹出密码输入框 |
|
|
let isSame = true, isOldValueEmpty = true; |
|
|
let isSame = true, isOldValueEmpty = true; |
|
|
const { currentHandleType } = this; |
|
|
const { currentHandleType } = this; |
|
|
// 如果是checkboxList类型,需要同时比较otherValues |
|
|
|
|
|
if (this.type === 'checkboxList') { |
|
|
|
|
|
const current = this.getCheckboxListInfo(); |
|
|
|
|
|
isSame = isEqual(current.oldValue, current.newValue); |
|
|
|
|
|
isOldValueEmpty = isValueEmpty(current.oldValue); |
|
|
|
|
|
} else if (this.type === "checkboxTag") { |
|
|
|
|
|
|
|
|
if (this.type === "checkboxTag") { |
|
|
// checkboxTag类型,只比较当前tagIndex的数据 |
|
|
// checkboxTag类型,只比较当前tagIndex的数据 |
|
|
const currentTag = this.checkboxTagList[this.currentTagIndex]; |
|
|
const currentTag = this.checkboxTagList[this.currentTagIndex]; |
|
|
const oldTag = this.oldCheckboxTagList[this.currentTagIndex] || {}; |
|
|
const oldTag = this.oldCheckboxTagList[this.currentTagIndex] || {}; |
|
|
isSame = isEqual(oldTag.checked, currentTag.checked); |
|
|
isSame = isEqual(oldTag.checked, currentTag.checked); |
|
|
isOldValueEmpty = oldTag.checked===undefined; |
|
|
|
|
|
|
|
|
isOldValueEmpty = oldTag.checked === undefined; |
|
|
} else if (this.type === "fqyq") { |
|
|
} else if (this.type === "fqyq") { |
|
|
const current = this.getFqyqInfo(); |
|
|
const current = this.getFqyqInfo(); |
|
|
isSame = isEqual(current.oldValue, current.newValue); |
|
|
isSame = isEqual(current.oldValue, current.newValue); |
|
|
@ -1192,7 +1142,7 @@ export default { |
|
|
const { oldValue, newValue } = current; |
|
|
const { oldValue, newValue } = current; |
|
|
if (currentHandleType === "checkboxTreeCheckbox") { |
|
|
if (currentHandleType === "checkboxTreeCheckbox") { |
|
|
isSame = isEqual(oldValue.checked, newValue.checked); |
|
|
isSame = isEqual(oldValue.checked, newValue.checked); |
|
|
isOldValueEmpty = oldValue.checked===undefined; |
|
|
|
|
|
|
|
|
isOldValueEmpty = oldValue.checked === undefined; |
|
|
} else { |
|
|
} else { |
|
|
isSame = isEqual(current.oldValue, current.newValue); |
|
|
isSame = isEqual(current.oldValue, current.newValue); |
|
|
isOldValueEmpty = isValueEmpty(current.oldValue); |
|
|
isOldValueEmpty = isValueEmpty(current.oldValue); |
|
|
@ -1219,12 +1169,7 @@ export default { |
|
|
resetRecord() { |
|
|
resetRecord() { |
|
|
// 用户点击取消,还原数据 |
|
|
// 用户点击取消,还原数据 |
|
|
let oldValue = this.oldValue; |
|
|
let oldValue = this.oldValue; |
|
|
if (this.type === 'checkboxList') { |
|
|
|
|
|
oldValue = { |
|
|
|
|
|
checkboxValues: this.oldCheckboxListValue.checkboxValues, |
|
|
|
|
|
otherValues: this.oldCheckboxListValue.otherValues |
|
|
|
|
|
}; |
|
|
|
|
|
} else if (this.type === "checkboxTag") { |
|
|
|
|
|
|
|
|
if (this.type === "checkboxTag") { |
|
|
// checkboxTag类型,只回退当前tagIndex的数据 |
|
|
// checkboxTag类型,只回退当前tagIndex的数据 |
|
|
if (this.currentTagIndex >= 0 && this.currentTagIndex < this.oldCheckboxTagList.length) { |
|
|
if (this.currentTagIndex >= 0 && this.currentTagIndex < this.oldCheckboxTagList.length) { |
|
|
const oldTag = this.oldCheckboxTagList[this.currentTagIndex]; |
|
|
const oldTag = this.oldCheckboxTagList[this.currentTagIndex]; |
|
|
@ -1269,11 +1214,6 @@ export default { |
|
|
recordOldVlaue = `${current.des + current.oldValue}`; |
|
|
recordOldVlaue = `${current.des + current.oldValue}`; |
|
|
recordValue = `${current.des + current.newValue}`; |
|
|
recordValue = `${current.des + current.newValue}`; |
|
|
isModify = !!this.oldFqyqValue.mainRadio |
|
|
isModify = !!this.oldFqyqValue.mainRadio |
|
|
} else if (this.type === "checkboxList") { |
|
|
|
|
|
const current = this.getCheckboxListInfo(); |
|
|
|
|
|
recordOldVlaue = `${current.des + (current.oldValue || '')}`; |
|
|
|
|
|
recordValue = `${current.des + (current.newValue || '')}`; |
|
|
|
|
|
isModify = !!current.oldValue; |
|
|
|
|
|
} else if (this.type === "checkboxTree") { |
|
|
} else if (this.type === "checkboxTree") { |
|
|
// checkboxTree类型,记录当前操作的值变化 |
|
|
// checkboxTree类型,记录当前操作的值变化 |
|
|
const current = this.getCheckboxTreeInfo(); |
|
|
const current = this.getCheckboxTreeInfo(); |
|
|
@ -1283,7 +1223,7 @@ export default { |
|
|
recordValue = `${newValue.label || ''}:${newValue.checked ? '勾选' : '未勾选'}`; |
|
|
recordValue = `${newValue.label || ''}:${newValue.checked ? '勾选' : '未勾选'}`; |
|
|
isModify = newValue.checked !== undefined; |
|
|
isModify = newValue.checked !== undefined; |
|
|
} else { |
|
|
} else { |
|
|
recordOldVlaue = `${current.des +( current.oldValue || '')}`; |
|
|
|
|
|
|
|
|
recordOldVlaue = `${current.des + (current.oldValue || '')}`; |
|
|
recordValue = `${current.des + (current.newValue || '')}`; |
|
|
recordValue = `${current.des + (current.newValue || '')}`; |
|
|
isModify = !!current.oldValue; |
|
|
isModify = !!current.oldValue; |
|
|
} |
|
|
} |
|
|
@ -1306,9 +1246,7 @@ export default { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 更新oldValue和oldOtherValues |
|
|
// 更新oldValue和oldOtherValues |
|
|
if (this.type === 'checkboxList') { |
|
|
|
|
|
this.oldCheckboxListValue = JSON.parse(JSON.stringify(this.checkboxListValue)); |
|
|
|
|
|
} else if (this.type === "checkboxTag") { |
|
|
|
|
|
|
|
|
if (this.type === "checkboxTag") { |
|
|
// checkboxTag类型,只更新当前tagIndex的数据 |
|
|
// checkboxTag类型,只更新当前tagIndex的数据 |
|
|
if (this.currentTagIndex >= 0 && this.currentTagIndex < this.checkboxTagList.length) { |
|
|
if (this.currentTagIndex >= 0 && this.currentTagIndex < this.checkboxTagList.length) { |
|
|
this.oldCheckboxTagList[this.currentTagIndex] = { ...this.checkboxTagList[this.currentTagIndex] }; |
|
|
this.oldCheckboxTagList[this.currentTagIndex] = { ...this.checkboxTagList[this.currentTagIndex] }; |
|
|
@ -1321,12 +1259,7 @@ export default { |
|
|
this.oldFqyqValue = JSON.parse(JSON.stringify(this.fqyqValue)); |
|
|
this.oldFqyqValue = JSON.parse(JSON.stringify(this.fqyqValue)); |
|
|
} |
|
|
} |
|
|
let value = this.inputValue; |
|
|
let value = this.inputValue; |
|
|
if (this.type === 'checkboxList') { |
|
|
|
|
|
value = { |
|
|
|
|
|
checkboxValues: this.checkboxListValue.checkboxValues, |
|
|
|
|
|
otherValues: this.checkboxListValue.otherValues |
|
|
|
|
|
}; |
|
|
|
|
|
} else if (this.type === "checkboxTag") { |
|
|
|
|
|
|
|
|
if (this.type === "checkboxTag") { |
|
|
value = [...this.checkboxTagList]; |
|
|
value = [...this.checkboxTagList]; |
|
|
} else if (this.type === "fqyq") { |
|
|
} else if (this.type === "fqyq") { |
|
|
value = { ...this.fqyqValue }; |
|
|
value = { ...this.fqyqValue }; |
|
|
@ -1380,14 +1313,6 @@ export default { |
|
|
} |
|
|
} |
|
|
return commonInfo; |
|
|
return commonInfo; |
|
|
}, |
|
|
}, |
|
|
// 判断checkboxList中特定otherCode输入框是否有错误 |
|
|
|
|
|
isOtherInputError(otherCode) { |
|
|
|
|
|
if (!this.error) { |
|
|
|
|
|
return false; |
|
|
|
|
|
} |
|
|
|
|
|
// 检查该otherCode对应的输入框是否为空 |
|
|
|
|
|
return isValueEmpty(this.otherValues[otherCode]); |
|
|
|
|
|
}, |
|
|
|
|
|
handleClickable(item, event) { |
|
|
handleClickable(item, event) { |
|
|
if (this.templateFillType !== 'actFill') { |
|
|
if (this.templateFillType !== 'actFill') { |
|
|
return |
|
|
return |
|
|
@ -1443,7 +1368,7 @@ export default { |
|
|
return this.$t("template.common.pleaseSelect") |
|
|
return this.$t("template.common.pleaseSelect") |
|
|
} |
|
|
} |
|
|
let prex = "template.common.pleaseFillIn" |
|
|
let prex = "template.common.pleaseFillIn" |
|
|
if (type === "select" || type === "dateTime") { |
|
|
|
|
|
|
|
|
if (type === "select" || type === "dateTime" || type === "datePicker") { |
|
|
prex = "template.common.pleaseSelect" |
|
|
prex = "template.common.pleaseSelect" |
|
|
} |
|
|
} |
|
|
return placeholder ? this.$t(placeholder) : (this.$t(prex) + this.$t(label)) |
|
|
return placeholder ? this.$t(placeholder) : (this.$t(prex) + this.$t(label)) |
|
|
@ -1938,6 +1863,11 @@ export default { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.el-checkbox__input.is-indeterminate .el-checkbox__inner { |
|
|
|
|
|
background-color: #f9c588; |
|
|
|
|
|
border-color: #f9c588; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
.el-radio { |
|
|
.el-radio { |
|
|
&.is-checked { |
|
|
&.is-checked { |
|
|
.el-radio__label { |
|
|
.el-radio__label { |
|
|
@ -2038,12 +1968,25 @@ export default { |
|
|
display: flex; |
|
|
display: flex; |
|
|
align-items: center; |
|
|
align-items: center; |
|
|
} |
|
|
} |
|
|
.checkbox-tree-input-container{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.checkbox-tree-input-container { |
|
|
margin-left: 10px; |
|
|
margin-left: 10px; |
|
|
width: 500px; |
|
|
width: 500px; |
|
|
} |
|
|
} |
|
|
.item-center{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.item-center { |
|
|
display: flex; |
|
|
display: flex; |
|
|
align-items: center; |
|
|
align-items: center; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.checkbox-tree-group { |
|
|
|
|
|
padding: 5px 0; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
.form-error-border { |
|
|
|
|
|
box-shadow: 0 0 6px #ffc3c3; |
|
|
|
|
|
padding: 8px; |
|
|
|
|
|
border-radius: 4px; |
|
|
|
|
|
border: 1px solid #ff5d5d; |
|
|
|
|
|
} |
|
|
</style> |
|
|
</style> |