|
@@ -30,15 +30,8 @@
|
|
<template #tags="{ item }">
|
|
<template #tags="{ item }">
|
|
<el-cascader v-model="form[item.model]" :options="tagsList" :props="props" clearable filterable :show-all-levels="false"></el-cascader>
|
|
<el-cascader v-model="form[item.model]" :options="tagsList" :props="props" clearable filterable :show-all-levels="false"></el-cascader>
|
|
</template>
|
|
</template>
|
|
- <template #act_tags="{ item }">
|
|
|
|
- <el-cascader
|
|
|
|
- v-model="form[item.model]"
|
|
|
|
- :options="act_tagsList"
|
|
|
|
- :props="act_tagsProps"
|
|
|
|
- clearable
|
|
|
|
- filterable
|
|
|
|
- :show-all-levels="false"
|
|
|
|
- ></el-cascader>
|
|
|
|
|
|
+ <template #act_tags>
|
|
|
|
+ <el-option v-for="i in act_tagsList" :key="i.value" :label="i.label" :value="i.value"></el-option>
|
|
</template>
|
|
</template>
|
|
<template #status>
|
|
<template #status>
|
|
<el-option v-for="i in goodsStatusList" :key="i.value" :label="i.label" :value="i.value"></el-option>
|
|
<el-option v-for="i in goodsStatusList" :key="i.value" :label="i.label" :value="i.value"></el-option>
|
|
@@ -90,7 +83,7 @@ export default {
|
|
infoFields: [
|
|
infoFields: [
|
|
{ label: '商品名称', model: 'name' },
|
|
{ label: '商品名称', model: 'name' },
|
|
{ label: '商品分类', model: 'tags', custom: true },
|
|
{ label: '商品分类', model: 'tags', custom: true },
|
|
- { label: '活动标签', model: 'act_tags', custom: true },
|
|
|
|
|
|
+ { label: '活动标签', model: 'act_tags', type: 'selectMany' },
|
|
{ label: '简短简介', model: 'shot_brief', maxLength: 50 },
|
|
{ label: '简短简介', model: 'shot_brief', maxLength: 50 },
|
|
{ label: '预计发货时间', model: 'send_time' },
|
|
{ label: '预计发货时间', model: 'send_time' },
|
|
{ label: '商品图片', model: 'file', type: 'upload', url: '/files/point/goods/upload' },
|
|
{ label: '商品图片', model: 'file', type: 'upload', url: '/files/point/goods/upload' },
|
|
@@ -104,10 +97,8 @@ export default {
|
|
props: { multiple: true, label: 'label', value: 'code' },
|
|
props: { multiple: true, label: 'label', value: 'code' },
|
|
// 活动标签
|
|
// 活动标签
|
|
act_tagsList: [],
|
|
act_tagsList: [],
|
|
- act_tagsProps: { multiple: true, label: 'label', value: 'value' },
|
|
|
|
|
|
|
|
goodsStatusList: [],
|
|
goodsStatusList: [],
|
|
-
|
|
|
|
shop: {},
|
|
shop: {},
|
|
};
|
|
};
|
|
},
|
|
},
|
|
@@ -152,24 +143,16 @@ export default {
|
|
if (res) return res.label;
|
|
if (res) return res.label;
|
|
return '';
|
|
return '';
|
|
},
|
|
},
|
|
- getTags(data) {
|
|
|
|
- let list = this.tagsList;
|
|
|
|
- const getChildren = (list) =>
|
|
|
|
- list.map((i) => {
|
|
|
|
- if (i.children) return getChildren(i.children);
|
|
|
|
- return i;
|
|
|
|
- });
|
|
|
|
- list = _.flattenDeep(getChildren(list));
|
|
|
|
|
|
+ getAct_tags(data) {
|
|
const arr = [];
|
|
const arr = [];
|
|
- for (const ts of data) {
|
|
|
|
- const last = _.last(ts);
|
|
|
|
- const r = list.find((f) => f.code === last);
|
|
|
|
|
|
+ for (const val of data) {
|
|
|
|
+ const r = this.act_tagsList.find((f) => f.value === val);
|
|
if (r) arr.push(r.label);
|
|
if (r) arr.push(r.label);
|
|
}
|
|
}
|
|
return arr.join(';');
|
|
return arr.join(';');
|
|
},
|
|
},
|
|
- getAct_tags(data) {
|
|
|
|
- let list = this.act_tagsList;
|
|
|
|
|
|
+ getTags(data) {
|
|
|
|
+ let list = this.tagsList;
|
|
const getChildren = (list) =>
|
|
const getChildren = (list) =>
|
|
list.map((i) => {
|
|
list.map((i) => {
|
|
if (i.children) return getChildren(i.children);
|
|
if (i.children) return getChildren(i.children);
|
|
@@ -179,7 +162,7 @@ export default {
|
|
const arr = [];
|
|
const arr = [];
|
|
for (const ts of data) {
|
|
for (const ts of data) {
|
|
const last = _.last(ts);
|
|
const last = _.last(ts);
|
|
- const r = list.find((f) => f.value === last);
|
|
|
|
|
|
+ const r = list.find((f) => f.code === last);
|
|
if (r) arr.push(r.label);
|
|
if (r) arr.push(r.label);
|
|
}
|
|
}
|
|
return arr.join(';');
|
|
return arr.join(';');
|