diff --git a/src/components/Template/BaseInfoFormPcakge.vue b/src/components/Template/BaseInfoFormPcakge.vue
index 1c90393..7a362cf 100644
--- a/src/components/Template/BaseInfoFormPcakge.vue
+++ b/src/components/Template/BaseInfoFormPcakge.vue
@@ -8,7 +8,7 @@
:key="key">
{{ sItem.label }}
-
@@ -30,7 +30,7 @@
+
@@ -136,6 +144,15 @@ export default {
immediate: true,
deep: true, // 深度监听,以便检测嵌套对象变化
handler(v) {
+ if(v){
+ this.handleFormField();
+ }
+ }
+ },
+ formConfig: {
+ immediate: true,
+ deep: true, // 深度监听,以便检测嵌套对象变化
+ handler(v) {
this.handleFormField();
}
}
@@ -146,6 +163,21 @@ export default {
},
methods: {
+ onInputNumberChange(key, val){
+ if(val === 0){
+ this.formFields[key] = null;
+ return;
+ }
+ this.formFields[key] = val;
+ },
+ updateFormField(key, value){
+ this.formFields[key] = value;
+ },
+ batchUpdateFormFields(data){
+ Object.keys(data).forEach(key => {
+ this.formFields[key] = data[key];
+ })
+ },
handleClickable(sItem){
console.log(sItem)
this.$emit("clickable",sItem)
@@ -163,11 +195,12 @@ export default {
return {
label:"其他",
fillType: sItem.fillType,
+ maxlength: sItem.otherMaxlength || 50,
}
},
getSubItem(sItem){
return {
- label: sItem.label,
+ label: "",
options: sItem.subOptions || [],
fillType: sItem.subFillType || sItem.fillType,
}
@@ -182,7 +215,6 @@ export default {
const result = {};
let config = {};
const { formConfig, formData, formFields } = this;
-
// 遍历配置
formConfig.forEach((item) => {
if (item.config) {
@@ -194,30 +226,13 @@ export default {
const currentConfig = item.config[key];
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'
) {
+ console.log(key,formData,formFields[key],"kkk")
// 保留原值,不使用formData中的值
result[key] = formFields[key];
} else {
@@ -276,9 +291,8 @@ export default {
})
},
- onInput(key, val) {
- this.formFields[key] = val;
- this.$emit("input", { key, value: val });
+ onBlur(key, val) {
+ this.$emit("blur", { key, value: val ,...this.formFields});
},
onSelectChange(key, val) {
// 获取对应的配置
@@ -292,7 +306,6 @@ export default {
// 单选情况
this.formFields[key] = val;
// }
-
this.$emit("select", { key, value: val });
},
//复制
diff --git a/src/components/Template/HandleFormItem.vue b/src/components/Template/HandleFormItem.vue
index a768751..9f14ea8 100644
--- a/src/components/Template/HandleFormItem.vue
+++ b/src/components/Template/HandleFormItem.vue
@@ -3,6 +3,7 @@
@@ -115,6 +119,12 @@ export default {
this.$emit('input', value);
this.$emit('change', value);
},
+ //判断是否显示复制按钮
+ getIsShowCopyIcon(){
+ const {copyFrom} = this.item;
+ const {templateStatus} = this.$store.state.template;
+ return copyFrom && templateStatus=== "actFill";
+ },
//判断是否显示操作按钮
isShowHandle(){
const {fillType} = this.item;
diff --git a/src/components/Template/Step.vue b/src/components/Template/Step.vue
index 421571d..cd60912 100644
--- a/src/components/Template/Step.vue
+++ b/src/components/Template/Step.vue
@@ -11,19 +11,14 @@