diff --git a/src/views/business/measure/item/components/eleventh/templateDetail.vue b/src/views/business/measure/item/components/eleventh/templateDetail.vue index 3a39183..cad73e2 100644 --- a/src/views/business/measure/item/components/eleventh/templateDetail.vue +++ b/src/views/business/measure/item/components/eleventh/templateDetail.vue @@ -41,7 +41,7 @@ watch(() => props.form, (newVal) => { form.value = newVal }) -const list = ref([]) +const dataList = ref([]) // ----------------------------------------表头------------------------------------------------ const columns = ref([ // 衰减量 { text: '检定项目', value: 'params', align: 'center', required: false, type: 'text' }, @@ -82,7 +82,7 @@ technicalIndexSymbol: '±', // 技术指标符号 technicalIndexUnit: 'dB', // 技术指标单位 } - list.value.length ? list.value.push(JSON.parse(JSON.stringify(list.value[list.value.length - 1]))) : list.value.push(data) + dataList.value.length ? dataList.value.push(JSON.parse(JSON.stringify(dataList.value[dataList.value.length - 1]))) : dataList.value.push(data) break } } @@ -101,7 +101,7 @@ data = differenceArray(list1, checkoutList) switch (title) { case '衰减量': // 衰减量 - list.value = data + dataList.value = data break } } @@ -112,17 +112,17 @@ return useCheckList(list, columns, title) } function checkAllList() { - if (!list.value.length) { + if (!dataList.value.length) { ElMessage.warning('鉴定项列表不能为空') return false } - return useCheckList(list.value, columns.value, '衰减量') + return useCheckList(dataList.value, columns.value, '衰减量') } watch(() => props.list, (newVal) => { // 检定项表格 if (newVal) { - list.value = [...newVal] - list.value = list.value.map((item: any) => ({ ...item, params: '衰减量' })) + dataList.value = JSON.parse(JSON.stringify(newVal)).map((item: any) => ({ ...item, params: '衰减量' })) + // dataList.value = dataList.value } }) const frequencyUnit = ref<{ value: string;name: string;id: string }[]>([]) // 频率单位 @@ -147,8 +147,12 @@ 组合方式: composition.value, } } +const getList = () => { + console.log(dataList.value, 'getList') + return JSON.parse(JSON.stringify(dataList.value)) +} fecthDict() -defineExpose({ list, checkAllList, form }) +defineExpose({ dataList, checkAllList, form, getList })