@@ -91,64 +85,110 @@ export default {
},
data() {
return {
- formFields: {},//表单双休绑定字段
+ formFields: {},//表单绑定字段
allFieldsConfig: {},//包含config的所有字段,主要用于校验表单是否填写
};
},
watch: {
- immediate: true,
formData: {
+ immediate: true,
+ deep: true, // 深度监听,以便检测嵌套对象变化
handler(v) {
this.handleFormField();
}
}
},
+
mounted() {
this.handleFormField();
},
- filters: {
- getBorderType(type) {
- const typeObj = {
- orange: "orange-border",
- green: "green-border",
- blue: "blue-border",
- }
- return typeObj[type] || ""
- },
- },
methods: {
+ //根据span判断一行显示几列
+ getSpanClass(sItem){
+ const spanArr = ["full-row","","three-row"]
+ if(sItem.span){
+ return spanArr[sItem.span-1]
+ }
+ return ""
+ },
+ getOtherItem(sItem){
+ return {
+ label:"其他",
+ fillType: sItem.fillType,
+ }
+ },
isShowOther(v = []) {
- console.log(v, "vvv")
- return v.includes("-1");
+ // 确保v是数组类型,以避免类型错误
+ const arr = Array.isArray(v) ? v : [v];
+ return arr.map(val => String(val)).includes("-1");
},
- //根据formConifg回填form表单数据
+ // 根据formConfig回填form表单数据
handleFormField() {
const result = {};
let config = {};
- const { formConfig, formData } = this;
+ const { formConfig, formData, formFields } = this;
+
+ // 遍历配置
formConfig.forEach((item) => {
if (item.config) {
+ // 合并配置项
config = { ...config, ...item.config }
+
+ // 处理每个配置项
Object.keys(item.config).forEach(key => {
const currentConfig = item.config[key];
- result[key] = formData[key];
- if (currentConfig.otherCode) {//如果有其它的字段需要赋值给formData
+ let value = formData[key];
+
+ // 处理多选下拉框的默认值,确保数组类型
+ if (currentConfig.type === 'select' && currentConfig.multiple) {
+ if (!Array.isArray(value)) {
+ // 转换为数组格式,确保兼容性
+ value = value ? [value] : [];
+ }
+ }
+
+ // 处理null/undefined值,保持一致性
+ if (value === null || value === undefined) {
+ // 根据类型设置默认值
+ if (currentConfig.type === 'select' && currentConfig.multiple) {
+ value = [];
+ } else {
+ value = '';
+ }
+ }
+
+ // 如果formFields中已经有值,保持原值(用户输入或之前设置的值)
+ if (formFields[key] !== null &&
+ formFields[key] !== undefined &&
+ formFields[key] !== ''&&
+ typeof formFields[key] !== 'object'
+ ) {
+ // 保留原值,不使用formData中的值
+ result[key] = formFields[key];
+ } else {
+ // 使用formData中的值
+ result[key] = value;
+ }
+
+ // 处理特殊字段 - "其他"字段
+ if (currentConfig.otherCode) {
const { otherCode } = currentConfig;
- result[otherCode] = formData[otherCode]
+ result[otherCode] = formData[otherCode] || '';
config[otherCode] = { label: "其他", type: "input" }
}
});
- console.log(item.config, "config")
+
+ // 处理可能存在的直接otherCode字段
if (item.config?.otherCode) {
config[item.config?.otherCode] = item.config?.otherCode;
}
}
-
- })
+ });
+ console.log(result,"initResult")
+ // 更新表单字段
this.formFields = result;
this.allFieldsConfig = config;
- console.log(config, "allFieldsConfig")
},
getFormData() {
const { formFields, allFieldsConfig } = this;
@@ -176,7 +216,18 @@ export default {
this.$emit("input", { key, value: val });
},
onSelectChange(key, val) {
- this.formFields[key] = val;
+ // 获取对应的配置
+ const currentConfig = this.allFieldsConfig[key];
+
+ // 确保多选下拉框的值是数组类型
+ if (currentConfig && currentConfig.multiple) {
+ // 多选情况,确保值为数组类型
+ this.formFields[key] = Array.isArray(val) ? val : (val ? [val] : []);
+ } else {
+ // 单选情况
+ this.formFields[key] = val;
+ }
+
this.$emit("select", { key, value: val });
},
//复制
@@ -197,9 +248,12 @@ export default {
/* 默认2列 */
gap: 0 24px;
}
+.gap2{
+ gap:0 64px;
+}
.w-100 {
- width: 100% !important;
+ width: 100%;
}
.form-item {
@@ -217,13 +271,24 @@ export default {
.full-row {
grid-column: span 2;
}
+.three-row {
+ grid-column: span 3;
+}
+
.c-Item {
&:not(:last-child) {
margin-bottom: 16px;
}
}
-
+.eo{
+ &:nth-child(even) {
+ padding-left: 20px;
+ }
+ &:nth-child(odd) {
+ padding-right: 20px;
+ }
+}
.form-title {
margin-bottom: 12px;
font-size: 14px;
@@ -233,49 +298,8 @@ export default {
.p-r-20{
padding-right: 20px;
}
-.orange-border {
- input {
- border-color: #f9c588;
-
- &:focus {
- border-color: #f9c588;
- }
-
- &:hover {
- border-color: #f9c588;
- }
- }
-
-}
-
-.green-border {
- input {
- border-color: green;
-
- &:focus {
- border-color: green;
- }
-
- &:hover {
- border-color: green;
- }
- }
-
-}
-
-.blue-border {
- input {
- border-color: #4ea2ff;
-
- &:focus {
- border-color: #4ea2ff;
- }
-
- &:hover {
- border-color: #4ea2ff;
- }
- }
-
+.p-l-20{
+ padding-left: 20px;
}
.fs-16 {
diff --git a/src/components/Template/HandleFormItem.vue b/src/components/Template/HandleFormItem.vue
index 868c298..b6daccc 100644
--- a/src/components/Template/HandleFormItem.vue
+++ b/src/components/Template/HandleFormItem.vue
@@ -2,12 +2,13 @@
+ :class="item.fillType | getFillType"
+ :placeholder="item.placeholder ? item.placeholder : ('请输入' + item.label)"
+ v-model="inputValue" />
@@ -15,9 +16,17 @@
:value="op.value">
+
+
+
复制
稽查轨迹
@@ -31,7 +40,7 @@ export default {
type:String,
default:"input"
},
- borderType: {
+ fillType: {
type: String,
default: ""
},
@@ -46,28 +55,36 @@ export default {
}
}
},
+ // v-model 值
value: {
- type: String,
- value: "",
- }
+ type: [String, Number,Array],
+ default: ''
+ },
},
data() {
- return {}
+ return {
+ inputValue: this.value
+ }
},
- watch:{
- value:{
- immediate: true,
- handler(val){
- console.log(val,"watch")
+ watch: {
+ value(newVal) {
+ console.log(newVal,"value")
+ this.inputValue = newVal
+ },
+ inputValue(newVal) {
+ if(this.type === "input"){
+ this.$emit('input', newVal)
+ }else{
+ this.$emit('change', newVal)
}
}
},
filters: {
- getBorderType(type) {
+ getFillType(type) {
const typeObj = {
- orange: "orange-border",
+ actFill: "orange-border",//实际填写的边框颜色
green: "green-border",
- blue: "blue-border",
+ preFill: "blue-border",//预填写的边框颜色
}
return typeObj[type] || ""
},
@@ -77,8 +94,8 @@ export default {
onCopy() {
this.$emit("copy")
},
- onInput(val){
- this.$emit("input",val)
+ onBlur(val){
+ this.$emit("blur",val)
},
onSelectChange(val){
this.$emit("change",val)
@@ -87,7 +104,7 @@ export default {
}
-
\ No newline at end of file
diff --git a/src/components/Template/Input.vue b/src/components/Template/Input.vue
index 72b42e2..8f347de 100644
--- a/src/components/Template/Input.vue
+++ b/src/components/Template/Input.vue
@@ -1,111 +1,258 @@
-
-
-
-
+
\ No newline at end of file
diff --git a/src/components/Template/Step.vue b/src/components/Template/Step.vue
new file mode 100644
index 0000000..52ae962
--- /dev/null
+++ b/src/components/Template/Step.vue
@@ -0,0 +1,353 @@
+
+
+
+
+
+
+
+
+
+ 步骤{{ index + 1 }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/Template/StepComponents/AddSolutionStep.vue b/src/components/Template/StepComponents/AddSolutionStep.vue
new file mode 100644
index 0000000..3313f85
--- /dev/null
+++ b/src/components/Template/StepComponents/AddSolutionStep.vue
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/Template/StepComponents/AutoWeighStep.vue b/src/components/Template/StepComponents/AutoWeighStep.vue
new file mode 100644
index 0000000..e0c4f01
--- /dev/null
+++ b/src/components/Template/StepComponents/AutoWeighStep.vue
@@ -0,0 +1,89 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/Template/StepComponents/CentrifugeStep.vue b/src/components/Template/StepComponents/CentrifugeStep.vue
new file mode 100644
index 0000000..52d5b07
--- /dev/null
+++ b/src/components/Template/StepComponents/CentrifugeStep.vue
@@ -0,0 +1,62 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/Template/StepComponents/CoatStep.vue b/src/components/Template/StepComponents/CoatStep.vue
new file mode 100644
index 0000000..bc94107
--- /dev/null
+++ b/src/components/Template/StepComponents/CoatStep.vue
@@ -0,0 +1,152 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 被动吸附
+ 共价结合
+
+
+
+
+
+ 包被前洗涤
+ 包被后洗涤
+ 封闭前洗涤
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/Template/StepComponents/ContainerStep.vue b/src/components/Template/StepComponents/ContainerStep.vue
new file mode 100644
index 0000000..8618a62
--- /dev/null
+++ b/src/components/Template/StepComponents/ContainerStep.vue
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
diff --git a/src/components/Template/StepComponents/FiltrationStep.vue b/src/components/Template/StepComponents/FiltrationStep.vue
new file mode 100644
index 0000000..4dbf33c
--- /dev/null
+++ b/src/components/Template/StepComponents/FiltrationStep.vue
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/Template/StepComponents/ManualWeighStep.vue b/src/components/Template/StepComponents/ManualWeighStep.vue
new file mode 100644
index 0000000..cc471a5
--- /dev/null
+++ b/src/components/Template/StepComponents/ManualWeighStep.vue
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/Template/StepComponents/MixStep.vue b/src/components/Template/StepComponents/MixStep.vue
new file mode 100644
index 0000000..305bdb0
--- /dev/null
+++ b/src/components/Template/StepComponents/MixStep.vue
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/Template/StepComponents/PackageStep.vue b/src/components/Template/StepComponents/PackageStep.vue
new file mode 100644
index 0000000..fbf505c
--- /dev/null
+++ b/src/components/Template/StepComponents/PackageStep.vue
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 手动分装
+ 自动分装
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/Template/StepComponents/Seal2Step.vue b/src/components/Template/StepComponents/Seal2Step.vue
new file mode 100644
index 0000000..c7b68f6
--- /dev/null
+++ b/src/components/Template/StepComponents/Seal2Step.vue
@@ -0,0 +1,113 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 密封性检查
+ 外观检查
+ 标识检查
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/Template/StepComponents/Seal3Step.vue b/src/components/Template/StepComponents/Seal3Step.vue
new file mode 100644
index 0000000..ebc9cfd
--- /dev/null
+++ b/src/components/Template/StepComponents/Seal3Step.vue
@@ -0,0 +1,114 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 密封性检查
+ 外观检查
+ 标识检查
+ 批次检查
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/Template/StepComponents/StaticEndStep.vue b/src/components/Template/StepComponents/StaticEndStep.vue
new file mode 100644
index 0000000..a02c8dd
--- /dev/null
+++ b/src/components/Template/StepComponents/StaticEndStep.vue
@@ -0,0 +1,144 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 颜色变化
+ 沉淀形成
+ 相分离
+ 结晶
+ 无异常
+ 其他
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 直接进行下一步
+ 需要预处理
+ 需要检测
+ 需要储存
+ 需要转移
+
+
+
+
+
+ 静置成功
+ 部分成功
+ 静置失败
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/Template/StepComponents/StaticStartStep.vue b/src/components/Template/StepComponents/StaticStartStep.vue
new file mode 100644
index 0000000..3957a40
--- /dev/null
+++ b/src/components/Template/StepComponents/StaticStartStep.vue
@@ -0,0 +1,142 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 避光
+ 恒温
+ 静置
+ 无震动
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 颜色变化
+ 沉淀形成
+ 相分离
+ 结晶
+ 其他
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/Template/StepComponents/TakePlateStep.vue b/src/components/Template/StepComponents/TakePlateStep.vue
new file mode 100644
index 0000000..530065b
--- /dev/null
+++ b/src/components/Template/StepComponents/TakePlateStep.vue
@@ -0,0 +1,147 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 立即处理
+ 室温放置
+ 冷藏保存
+ 冷冻保存
+ 避光保存
+ 需要检测
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 立即处理
+ 延迟处理
+ 储存待处理
+ 丢弃
+
+
+
+
+
+ 外观检查
+ 标识检查
+ 完整性检查
+ 污染检查
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/Template/StepComponents/UltrasoundStep.vue b/src/components/Template/StepComponents/UltrasoundStep.vue
new file mode 100644
index 0000000..08eeece
--- /dev/null
+++ b/src/components/Template/StepComponents/UltrasoundStep.vue
@@ -0,0 +1,50 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/components/Template/StepComponents/VortexStep.vue b/src/components/Template/StepComponents/VortexStep.vue
new file mode 100644
index 0000000..8fe6df6
--- /dev/null
+++ b/src/components/Template/StepComponents/VortexStep.vue
@@ -0,0 +1,124 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 连续混匀
+ 间歇混匀
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/business/comps/template/comps/sp/SWYPFXRYPZB.vue b/src/views/business/comps/template/comps/sp/SWYPFXRYPZB.vue
index e2b5eb1..efff979 100644
--- a/src/views/business/comps/template/comps/sp/SWYPFXRYPZB.vue
+++ b/src/views/business/comps/template/comps/sp/SWYPFXRYPZB.vue
@@ -12,8 +12,9 @@
-
+
+