提交 81a945e6 编写于 作者: 刘英杰's avatar 刘英杰

V20241010 优化保存

上级 5589801b
流水线 #29755 已通过 ,包含阶段
in 35 second
...@@ -141,17 +141,19 @@ ...@@ -141,17 +141,19 @@
:error-message="init.commodityTextError" :error-message="init.commodityTextError"
/> />
<van-cell v-if="init.radio === '1'"> <van-cell v-if="init.radio === '1'">
<!-- {{ init.commodityText }}--> <!-- {{ init.commodityText }}-->
<van-tag class="mx-1" color="#EEF9FF" text-color="#2D8FFF" v-for="(item,index) in init.commoditySelectArray" :key="index" closeable size="medium" type="primary" @close="closeTag(item,index)"> <van-tag class="mx-1" color="#EEF9FF" text-color="#2D8FFF" v-for="(item,index) in init.commoditySelectArray"
{{item.commodity_name}} :key="index" closeable size="medium" type="primary" @close="closeTag(item,index)">
{{ item.commodity_name }}
</van-tag> </van-tag>
</van-cell> </van-cell>
<cs-pop-up :show="init.commodity" position="bottom"> <cs-pop-up :show="init.commodity" position="bottom">
<template #content> <template #content>
<div class="w-full h-[90%] bg-gray-100 overflow-y-auto "> <div class="w-full h-[90%] bg-gray-100 overflow-y-auto ">
<Tree :key="asc" :data="init.commodityArray" show-checkbox @on-check-change="checkChange"></Tree> {{ init.commodityArray }}
<Tree :data="init.commodityArray" show-checkbox @on-check-change="checkChange"></Tree>
</div> </div>
<div class="w-full h-[10%] flex items-center justify-center p-3 shadow-gray-600 shadow"> <div class="w-full h-[10%] flex items-center justify-center p-3 shadow-gray-600 shadow">
<van-button class="w-[95%]" round @click="init.commodity = false">关闭</van-button> <van-button class="w-[95%]" round @click="init.commodity = false">关闭</van-button>
...@@ -324,35 +326,35 @@ function checkChange(all, item) { ...@@ -324,35 +326,35 @@ function checkChange(all, item) {
formValidate.data.commodity_list = array formValidate.data.commodity_list = array
} }
init.commoditySelectArray = all init.commoditySelectArray = all
console.log("🚀🚀🚀,",init.commoditySelectArray) console.log("🚀🚀🚀,", init.commoditySelectArray)
console.log("🚀all🚀🚀,",all); console.log("🚀all🚀🚀,", all);
console.log("🚀🚀🚀,",formValidate.data.commodity_list); console.log("🚀🚀🚀,", formValidate.data.commodity_list);
} }
function closeTag(item,index){ function closeTag(item, index) {
//关闭物资标签 //关闭物资标签
function recursiveMethod(array1) {
function recursiveMethod(array1){ return array1.map((cur, ind) => {
return array1.map((cur, ind) => { if (cur.children.length !== 0) cur.children = recursiveMethod(cur.children);
if (cur.children.length !==0)cur.children = recursiveMethod(cur.children);
if (item.id === cur.id) delete cur.checked if (item.id === cur.id) delete cur.checked
return { return {
...cur, ...cur,
} }
}) })
} }
console.log("🚀🚀recursiveMethod(init.commodityArray)🚀,",recursiveMethod(init.commodityArray)) console.log("🚀🚀recursiveMethod(init.commodityArray)🚀,", recursiveMethod(init.commodityArray))
let a= recursiveMethod(init.commodityArray) let a = recursiveMethod(init.commodityArray)
console.log("🚀init.commodityArray🚀🚀,",a) console.log("🚀init.commodityArray🚀🚀,", a)
init.commodityArray = JSON.parse(JSON.stringify(a)) init.commodityArray = a;
console.log("🚀🚀init.comm11odityArray🚀,",init.commodityArray) console.log("🚀🚀init.comm11odityArray🚀,", init.commodityArray)
} }
function aaa(e, i) { function aaa(e, i) {
if (String(e.occupy_flag) === String(0)) { if (String(e.occupy_flag) === String(0)) {
......
Markdown 格式
0% or
您添加了 0 人 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册 或