style(styles): 123
This commit is contained in:
parent
373c2d5bd0
commit
f6f8c0c77d
@ -24,23 +24,10 @@
|
|||||||
<div id="contentEditor"></div>
|
<div id="contentEditor"></div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label='标签' prop='tags'>
|
<el-form-item label='标签' prop='tags'>
|
||||||
<el-select
|
<el-select style="width: 100%;" v-model="productTags" multiple filterable allow-create default-first-option
|
||||||
style="width: 100%;"
|
remote :remote-method="remoteMethod" placeholder="请选择文章标签" :loading="loading"
|
||||||
v-model="productTags"
|
|
||||||
multiple
|
|
||||||
filterable
|
|
||||||
allow-create
|
|
||||||
default-first-option
|
|
||||||
remote
|
|
||||||
:remote-method="remoteMethod"
|
|
||||||
placeholder="请选择文章标签"
|
|
||||||
:loading="loading"
|
|
||||||
@change="setLocalstorage('tags', productTags)">
|
@change="setLocalstorage('tags', productTags)">
|
||||||
<el-option
|
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
|
||||||
v-for="item in options"
|
|
||||||
:key="item.value"
|
|
||||||
:label="item.label"
|
|
||||||
:value="item.value">
|
|
||||||
</el-option>
|
</el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -52,7 +39,8 @@
|
|||||||
<el-button :loading="doLoading" plain type="primary" @click="postProduct">发布</el-button>
|
<el-button :loading="doLoading" plain type="primary" @click="postProduct">发布</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col v-else style="margin-top: 1rem;padding-right:3rem;text-align: right;">
|
<el-col v-else style="margin-top: 1rem;padding-right:3rem;text-align: right;">
|
||||||
<el-button v-if="productInfo.status === 0" :loading="doLoading" plain type="danger" @click="updateStatus">下架</el-button>
|
<el-button v-if="productInfo.status === 0" :loading="doLoading" plain type="danger"
|
||||||
|
@click="updateStatus">下架</el-button>
|
||||||
<el-button v-else :loading="doLoading" plain type="danger" @click="updateStatus">上架</el-button>
|
<el-button v-else :loading="doLoading" plain type="danger" @click="updateStatus">上架</el-button>
|
||||||
<el-button v-if="productInfo.status === 0" :loading="doLoading" plain type="primary" @click="postProduct">更新
|
<el-button v-if="productInfo.status === 0" :loading="doLoading" plain type="primary" @click="postProduct">更新
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -120,17 +108,44 @@ export default {
|
|||||||
productImgUrl: '',
|
productImgUrl: '',
|
||||||
productImgType: 0
|
productImgType: 0
|
||||||
},
|
},
|
||||||
|
productInfo2: {
|
||||||
|
idProduct: 0,
|
||||||
|
productTitle: '',
|
||||||
|
productContent: '',
|
||||||
|
productType: 0,
|
||||||
|
tags: '',
|
||||||
|
status: 0,
|
||||||
|
productPrice: 0,
|
||||||
|
productImgUrl: '',
|
||||||
|
productImgType: 0
|
||||||
|
},
|
||||||
productTags: [],
|
productTags: [],
|
||||||
options: [],
|
options: [],
|
||||||
list: [],
|
list: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
doLoading: false,
|
doLoading: false,
|
||||||
isEdit: false,
|
isEdit: false,
|
||||||
notificationFlag: true,
|
notificationFlag: false,
|
||||||
cropperVisible: false,
|
cropperVisible: false,
|
||||||
rules: rules,
|
rules: rules,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
// watch监听 判断是否修改
|
||||||
|
productInfo: {
|
||||||
|
handler(val, oldVal) {
|
||||||
|
for (let i in this.editForm) {
|
||||||
|
if (val[i] != this.productInfo2[i]) {
|
||||||
|
this.notificationFlag = true;
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
this.notificationFlag = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
deep: true
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
updateProductImgUrl(data) {
|
updateProductImgUrl(data) {
|
||||||
this.productInfo.productImgUrl = data
|
this.productInfo.productImgUrl = data
|
||||||
@ -423,6 +438,7 @@ export default {
|
|||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
next();
|
next();
|
||||||
|
_ts.$set(_ts, 'notificationFlag', false);
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
return false
|
return false
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user