fix: eslint

This commit is contained in:
xingyu
2023-07-29 12:55:51 +08:00
parent 3f36b57363
commit 8e78975521
10 changed files with 54 additions and 32 deletions

View File

@@ -443,14 +443,15 @@ const generateTableData = (propertyList: any[]) => {
*/
const validateData = (propertyList: any[]) => {
const skuPropertyIds: number[] = []
formData.value!.skus!.forEach((sku) =>
sku.properties
?.map((property) => property.propertyId)
?.forEach((propertyId) => {
if (skuPropertyIds.indexOf(propertyId!) === -1) {
skuPropertyIds.push(propertyId!)
}
})
formData.value!.skus!.forEach(
(sku) =>
sku.properties
?.map((property) => property.propertyId)
?.forEach((propertyId) => {
if (skuPropertyIds.indexOf(propertyId!) === -1) {
skuPropertyIds.push(propertyId!)
}
})
)
const propertyIds = propertyList.map((item) => item.id)
return skuPropertyIds.length === propertyIds.length

View File

@@ -134,11 +134,7 @@ const open = async (type: string, id?: number) => {
const data = (await CombinationActivityApi.getCombinationActivity(
id
)) as CombinationActivityApi.CombinationActivityVO
await getSpuDetails(
data.spuId!,
data.products?.map((sku) => sku.skuId),
data.products
)
await getSpuDetails(data.spuId!, data.products?.map((sku) => sku.skuId), data.products)
formRef.value.setValues(data)
} finally {
formLoading.value = false

View File

@@ -144,11 +144,7 @@ const open = async (type: string, id?: number) => {
const data = (await SeckillActivityApi.getSeckillActivity(
id
)) as SeckillActivityApi.SeckillActivityVO
await getSpuDetails(
data.spuId!,
data.products?.map((sku) => sku.skuId),
data.products
)
await getSpuDetails(data.spuId!, data.products?.map((sku) => sku.skuId), data.products)
formRef.value.setValues(data)
} finally {
formLoading.value = false

View File

@@ -12,7 +12,7 @@
<el-select class="!w-280px" v-model="queryParams.status" clearable placeholder="全部">
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.TRADE_ORDER_STATUS)"
:key="(dict.value as string)"
:key="dict.value as string"
:label="dict.label"
:value="dict.value"
/>
@@ -27,7 +27,7 @@
>
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.PAY_CHANNEL_CODE_TYPE)"
:key="(dict.value as string)"
:key="dict.value as string"
:label="dict.label"
:value="dict.value"
/>
@@ -48,7 +48,7 @@
<el-select class="!w-280px" v-model="queryParams.terminal" clearable placeholder="全部">
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.TERMINAL)"
:key="(dict.value as string)"
:key="dict.value as string"
:label="dict.label"
:value="dict.value"
/>
@@ -58,7 +58,7 @@
<el-select class="!w-280px" v-model="queryParams.type" clearable placeholder="全部">
<el-option
v-for="dict in getStrDictOptions(DICT_TYPE.TRADE_ORDER_TYPE)"
:key="(dict.value as string)"
:key="dict.value as string"
:label="dict.label"
:value="dict.value"
/>