Преглед изворни кода

fix(work/edit):补卡类型选择器

HMY пре 1 година
родитељ
комит
f6e5a93b00
1 измењених фајлова са 8 додато и 11 уклоњено
  1. 8 11
      pages/work/edit/index.vue

+ 8 - 11
pages/work/edit/index.vue

@@ -426,16 +426,15 @@ function formatDict(dict) {
 //数据选择器
 function formatCheckbox(elem){
 	let dict = elem.typeDetail.enum
-	elem['checkBox'] = true
+	// elem['checkBox'] = ''
 	return dict.map((item, index) => ({
 		text: item.enumVname,
 		value: item.enumVname 
 	}));
 }
-const testValue=ref('')
+
 function changeDataCheckBox(e,elem){
-	// elem.checkBox=e.detail.value.join(",")
-	testValue.value=e.detail.value.join(",")
+	elem['checkBox']=e.detail.value.join(",")
 }
 
 // 新增重复表表单
@@ -710,13 +709,11 @@ function submitProcess() { // 提交表单
 	
 		formElements.value.forEach(({ checkBox, tableField, defaultValue }) => {
 			if (checkBox) {
-				if (testValue.value) {
-					const items = testValue.value.split(",").filter(item => item.trim() !== '');
-					items.forEach(item => {
-						formArray.push({ name: `${tableField}_showfxx`, value: item.trim() });
-					});
-				}
-				formArray.push({ name: tableField, value: testValue.value });
+				const items = checkBox.split(",").filter(item => item.trim() !== '');
+				items.forEach(item => {
+					formArray.push({ name: `${tableField}_showfxx`, value: item.trim() });
+				});
+				formArray.push({ name: tableField, value: checkBox });
 			} else {
 				formArray.push({ name: tableField, value: defaultValue });
 			}