|
@@ -1,14 +1,25 @@
|
|
<template>
|
|
<template>
|
|
<div>
|
|
<div>
|
|
- <el-form ref="editPram" :model="editPram" label-width="80px">
|
|
|
|
|
|
+ <el-form
|
|
|
|
+ ref="editPram"
|
|
|
|
+ :model="editPram"
|
|
|
|
+ label-width="80px"
|
|
|
|
+ >
|
|
<el-form-item
|
|
<el-form-item
|
|
label="分类名称:"
|
|
label="分类名称:"
|
|
prop="name"
|
|
prop="name"
|
|
:rules="[{ required: true, message: '请输入分类名称', trigger: ['blur', 'change'] }]"
|
|
:rules="[{ required: true, message: '请输入分类名称', trigger: ['blur', 'change'] }]"
|
|
>
|
|
>
|
|
- <el-input v-model.trim="editPram.name" :maxlength="biztype.value === 1 ? 8 : 20" placeholder="分类名称" />
|
|
|
|
|
|
+ <el-input
|
|
|
|
+ v-model.trim="editPram.name"
|
|
|
|
+ :maxlength="biztype.value === 1 ? 8 : 20"
|
|
|
|
+ placeholder="分类名称"
|
|
|
|
+ />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="父级:" v-if="biztype.value !== 2">
|
|
|
|
|
|
+ <el-form-item
|
|
|
|
+ label="父级:"
|
|
|
|
+ v-if="biztype.value !== 2"
|
|
|
|
+ >
|
|
<el-cascader
|
|
<el-cascader
|
|
v-model="editPram.pid"
|
|
v-model="editPram.pid"
|
|
:disabled="isCreate === 1"
|
|
:disabled="isCreate === 1"
|
|
@@ -21,24 +32,70 @@
|
|
/>
|
|
/>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="分类图标:">
|
|
<el-form-item label="分类图标:">
|
|
- <div class="upLoadPicBox" @click="modalPicTap(false)">
|
|
|
|
- <div v-if="editPram.icon" class="pictrue">
|
|
|
|
|
|
+ <div
|
|
|
|
+ class="upLoadPicBox"
|
|
|
|
+ @click="modalPicTap(false)"
|
|
|
|
+ >
|
|
|
|
+ <div
|
|
|
|
+ v-if="editPram.icon"
|
|
|
|
+ class="pictrue"
|
|
|
|
+ >
|
|
<img :src="editPram.icon" />
|
|
<img :src="editPram.icon" />
|
|
</div>
|
|
</div>
|
|
- <div v-else class="upLoad">
|
|
|
|
|
|
+ <div
|
|
|
|
+ v-else
|
|
|
|
+ class="upLoad"
|
|
|
|
+ >
|
|
<i class="el-icon-camera cameraIconfont" />
|
|
<i class="el-icon-camera cameraIconfont" />
|
|
</div>
|
|
</div>
|
|
<div class="from-tips">建议尺寸(180*180)</div>
|
|
<div class="from-tips">建议尺寸(180*180)</div>
|
|
</div>
|
|
</div>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item class="mb30" label="排序:">
|
|
|
|
- <el-input-number v-model.trim="editPram.sort" :min="0" />
|
|
|
|
|
|
+ <el-form-item
|
|
|
|
+ label="是否高亮:"
|
|
|
|
+ prop="isHighLight"
|
|
|
|
+ >
|
|
|
|
+ <el-switch
|
|
|
|
+ v-model.trim="editPram.isHighLight"
|
|
|
|
+ active-text="是"
|
|
|
|
+ inactive-text="否"
|
|
|
|
+ >
|
|
|
|
+ </el-switch>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="扩展字段" v-if="biztype.value !== 1 && biztype.value !== 3 && biztype.value !== 5">
|
|
|
|
- <el-input v-model.trim="editPram.extra" type="textarea" placeholder="扩展字段" />
|
|
|
|
|
|
+ <el-form-item
|
|
|
|
+ label="链接地址:"
|
|
|
|
+ prop="link"
|
|
|
|
+ >
|
|
|
|
+ <el-input
|
|
|
|
+ v-model.trim="editPram.link"
|
|
|
|
+ :maxlength="biztype.value === 1 ? 8 : 20"
|
|
|
|
+ placeholder="链接地址"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item
|
|
|
|
+ class="mb30"
|
|
|
|
+ label="排序:"
|
|
|
|
+ >
|
|
|
|
+ <el-input-number
|
|
|
|
+ v-model.trim="editPram.sort"
|
|
|
|
+ :min="0"
|
|
|
|
+ />
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item
|
|
|
|
+ label="扩展字段"
|
|
|
|
+ v-if="biztype.value !== 1 && biztype.value !== 3 && biztype.value !== 5"
|
|
|
|
+ >
|
|
|
|
+ <el-input
|
|
|
|
+ v-model.trim="editPram.extra"
|
|
|
|
+ type="textarea"
|
|
|
|
+ placeholder="扩展字段"
|
|
|
|
+ />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
- <div slot="footer" class="dialog-footer-inner">
|
|
|
|
|
|
+ <div
|
|
|
|
+ slot="footer"
|
|
|
|
+ class="dialog-footer-inner"
|
|
|
|
+ >
|
|
<el-button @click="close">取消</el-button>
|
|
<el-button @click="close">取消</el-button>
|
|
<el-button
|
|
<el-button
|
|
type="primary"
|
|
type="primary"
|
|
@@ -54,8 +111,7 @@
|
|
'platform:category:update',
|
|
'platform:category:update',
|
|
'platform:category:save',
|
|
'platform:category:save',
|
|
]"
|
|
]"
|
|
- >确定</el-button
|
|
|
|
- >
|
|
|
|
|
|
+ >确定</el-button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
@@ -94,7 +150,7 @@ export default {
|
|
type: Array,
|
|
type: Array,
|
|
},
|
|
},
|
|
},
|
|
},
|
|
- data() {
|
|
|
|
|
|
+ data () {
|
|
return {
|
|
return {
|
|
loadingBtn: false,
|
|
loadingBtn: false,
|
|
constants: this.$constants,
|
|
constants: this.$constants,
|
|
@@ -103,6 +159,8 @@ export default {
|
|
name: null,
|
|
name: null,
|
|
pid: null,
|
|
pid: null,
|
|
sort: 0,
|
|
sort: 0,
|
|
|
|
+ link: '',
|
|
|
|
+ isHighLight: false,
|
|
// status: true,
|
|
// status: true,
|
|
type: this.biztype.value,
|
|
type: this.biztype.value,
|
|
url: null,
|
|
url: null,
|
|
@@ -119,22 +177,22 @@ export default {
|
|
parentOptions: [],
|
|
parentOptions: [],
|
|
};
|
|
};
|
|
},
|
|
},
|
|
- mounted() {
|
|
|
|
|
|
+ mounted () {
|
|
this.initEditData();
|
|
this.initEditData();
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- handleChange() {
|
|
|
|
|
|
+ handleChange () {
|
|
this.prent.level = this.$refs['cascader'].getCheckedNodes()[0].level;
|
|
this.prent.level = this.$refs['cascader'].getCheckedNodes()[0].level;
|
|
},
|
|
},
|
|
// 点击图标
|
|
// 点击图标
|
|
- addIcon() {
|
|
|
|
|
|
+ addIcon () {
|
|
const _this = this;
|
|
const _this = this;
|
|
_this.$modalIcon(function (icon) {
|
|
_this.$modalIcon(function (icon) {
|
|
_this.editPram.icon = icon;
|
|
_this.editPram.icon = icon;
|
|
});
|
|
});
|
|
},
|
|
},
|
|
// 点击商品图
|
|
// 点击商品图
|
|
- modalPicTap(multiple) {
|
|
|
|
|
|
+ modalPicTap (multiple) {
|
|
const _this = this;
|
|
const _this = this;
|
|
const attr = [];
|
|
const attr = [];
|
|
this.$modalUpload(
|
|
this.$modalUpload(
|
|
@@ -146,13 +204,13 @@ export default {
|
|
'store',
|
|
'store',
|
|
);
|
|
);
|
|
},
|
|
},
|
|
- close() {
|
|
|
|
|
|
+ close () {
|
|
this.$emit('hideEditDialog');
|
|
this.$emit('hideEditDialog');
|
|
},
|
|
},
|
|
- initEditData() {
|
|
|
|
|
|
+ initEditData () {
|
|
this.parentOptions = [...this.allTreeList];
|
|
this.parentOptions = [...this.allTreeList];
|
|
this.addTreeListLabelForCasCard(this.parentOptions, 'child');
|
|
this.addTreeListLabelForCasCard(this.parentOptions, 'child');
|
|
- const { icon, name, pid, sort, type, id, url, level } = this.editData;
|
|
|
|
|
|
+ const { icon, name, pid, sort, type, id, url, level, isHighLight, link } = this.editData;
|
|
if (this.isCreate === 1) {
|
|
if (this.isCreate === 1) {
|
|
this.editPram.icon = icon;
|
|
this.editPram.icon = icon;
|
|
this.editPram.name = name;
|
|
this.editPram.name = name;
|
|
@@ -162,18 +220,20 @@ export default {
|
|
this.editPram.url = url;
|
|
this.editPram.url = url;
|
|
this.editPram.id = id;
|
|
this.editPram.id = id;
|
|
this.editPram.level = level;
|
|
this.editPram.level = level;
|
|
|
|
+ this.editPram.isHighLight = isHighLight;
|
|
|
|
+ this.editPram.link = link;
|
|
} else {
|
|
} else {
|
|
this.editPram.pid = this.prent.id;
|
|
this.editPram.pid = this.prent.id;
|
|
this.editPram.type = this.biztype.value;
|
|
this.editPram.type = this.biztype.value;
|
|
this.editPram.level = parseInt(this.prent.level) + 1;
|
|
this.editPram.level = parseInt(this.prent.level) + 1;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- addTreeListLabelForCasCard(arr, child) {
|
|
|
|
|
|
+ addTreeListLabelForCasCard (arr, child) {
|
|
arr.forEach((item) => {
|
|
arr.forEach((item) => {
|
|
this.treeListCheckLevelLT3ForDisabled(item.children);
|
|
this.treeListCheckLevelLT3ForDisabled(item.children);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- treeListCheckLevelLT3ForDisabled(children) {
|
|
|
|
|
|
+ treeListCheckLevelLT3ForDisabled (children) {
|
|
if (!children) return;
|
|
if (!children) return;
|
|
children.forEach((j) => {
|
|
children.forEach((j) => {
|
|
if (j.level >= 3) {
|
|
if (j.level >= 3) {
|
|
@@ -181,13 +241,13 @@ export default {
|
|
} else this.treeListCheckLevelLT3ForDisabled(j.children);
|
|
} else this.treeListCheckLevelLT3ForDisabled(j.children);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- handlerSubmit(formName) {
|
|
|
|
|
|
+ handlerSubmit (formName) {
|
|
this.$refs[formName].validate((valid) => {
|
|
this.$refs[formName].validate((valid) => {
|
|
if (!valid) return;
|
|
if (!valid) return;
|
|
this.handlerSaveOrUpdate(this.isCreate === 0);
|
|
this.handlerSaveOrUpdate(this.isCreate === 0);
|
|
});
|
|
});
|
|
},
|
|
},
|
|
- handlerSaveOrUpdate(isSave) {
|
|
|
|
|
|
+ handlerSaveOrUpdate (isSave) {
|
|
if (isSave) {
|
|
if (isSave) {
|
|
// this.editPram.pid = this.prent.id
|
|
// this.editPram.pid = this.prent.id
|
|
this.loadingBtn = true;
|
|
this.loadingBtn = true;
|