Commit 3bbe8ed8 by linjinhong Committed by qinjianhui

fix:修改物流方式回显问题

parent 49dd2cce
......@@ -185,6 +185,45 @@ const platformList = ref([])
const ruleNameList = ref([])
const uniuniList = ref([])
const logisticsCompanyList = ref([])
watch(
() => JSON.parse(JSON.stringify(editForm.value.platformList)),
(newValue, oldValue) => {
if (oldValue.length && newValue.length) {
// 遍历旧值数组
oldValue.forEach(
(
oldItem: { logisticsName: string; showPlatform: string[] },
index: number,
) => {
// 检查旧值项是否符合条件
if (
Array.isArray(oldItem.showPlatform) &&
oldItem.showPlatform.length === 1 &&
oldItem.showPlatform[0] === 'TIKTOK' &&
oldItem.logisticsName
) {
// 获取对应的新值项
const newItem = newValue[index]
// 检查新值项是否不再满足条件
if (
newItem &&
(!Array.isArray(newItem.showPlatform) ||
newItem.showPlatform.length === 0 ||
!newItem.showPlatform.includes('TIKTOK') ||
newItem.showPlatform.length > 1)
) {
// 清除 logisticsName
editForm.value.platformList[index].logisticsName = ''
}
}
},
)
}
},
{ deep: true },
)
const formConfig = computed<IFormConfig[]>(() => [
{ title: '物流基础信息' },
{
......@@ -373,9 +412,7 @@ const formConfig = computed<IFormConfig[]>(() => [
{
title: '平台物流名称',
fixed: 'last',
render: (item, formData) => {
console.log(283, item, formData)
render: (_, formData) => {
return (formData?.platformList as platformObj[])?.map(
(item: platformObj, index: number) => (
<div style="display: flex; width:100%">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment