zx 3 years ago
parent 8f24bed04a
commit d7cf961734

@ -12,3 +12,6 @@
.el-table {
width: 100%;
}
.main-content {
padding: 24px !important
}

@ -1,4 +1,4 @@
//外框
.main-content {
padding: 24px;
padding: 24px !important
}

@ -112,7 +112,6 @@ export default defineComponent({
let obj = Object.assign({pageNum: this.pagination.current,pageSize: this.pagination.pageSize})
this.proxy.$post("/reference/list", obj).then(res => {
const data = res.data
console.log(data.records)
this.tableData.data = data.records;
this.pagination.total = data.total
}).catch(() => {});

@ -91,10 +91,12 @@ export default defineComponent({
if(this.$route.params.id) {
this.proxy.$post("/reference/detail", {id: this.$route.params.id}).then(res => {
this.form.groupId = res.data.groupId;
this.form.brandList = res.data.brandList;
this.form.type = res.data.type;
this.form.tagList = res.data.tagList;
this.form.title = res.data.title;
res.data.brandList.forEach(ele => {this.form.brandList.push(ele.id)});
res.data.tagList.forEach(ele => {this.form.tagList.push(ele.id)});
this.form.fileUrl = res.data.fileUrl;
this.form.coverUrl = res.data.coverUrl;
}).catch(() => {});
}
},

@ -3,15 +3,20 @@
<div class="area-form">
</div>
<div class="button-tab">
<el-popover v-model:visible="visible" placement="bottom" :width="180">
<el-popover v-model:visible="visible" placement="bottom" :width="360">
<h5>添加分组</h5>
<el-form>
<el-form-item style="width:80%">
<el-form-item style="width:80%" label="分组名">
<el-input v-model="setForm.name" placeholder="请输入分组名"></el-input>
</el-form-item>
<el-form-item style="width:80%" label="封面">
<uploadFile @change="handlerUpload" :config="{ limit: 1, accept: '.jpg, .jpeg, .png, .gif'}">
<el-button>点击上传</el-button>
</uploadFile>
</el-form-item>
<el-form-item>
<el-button @click="addConfirm" type="primary">确定</el-button>
<el-button @click="visible = false">取消</el-button>
<el-button @click="visible = false; setForm.name=''">取消</el-button>
</el-form-item>
</el-form>
<template #reference>
@ -49,7 +54,7 @@
<el-dialog v-model="editVisible" width="30%" title="重命名">
<el-input v-model="setForm.name" placeholder="请输入分组名"></el-input>
<template #footer>
<el-button @click="editVisible = false;setForm=''">取消</el-button>
<el-button @click="editVisible = false;setForm.name = ''">取消</el-button>
<el-button @click="editConfirm" type="primary">确定</el-button>
</template>
</el-dialog>
@ -77,7 +82,8 @@ export default defineComponent({
});
const { proxy } = getCurrentInstance();
const setForm = reactive({
name: ''
name: '',
coverUrl: '',
})
const visible = ref(false);
const editVisible = ref(false);
@ -117,7 +123,7 @@ export default defineComponent({
},
editConfirm() {
let obj = Object.assign(this.setForm, {id: this.activeId})
this.proxy.$post("/referencegroup/upd", obj).then(res => {
this.proxy.$post("/referenceGroup/upd", obj).then(res => {
this.getData();
this.editVisible = false;
this.$message.success(res.data)
@ -125,7 +131,7 @@ export default defineComponent({
},
//
addConfirm() {
this.proxy.$post("/referencegroup/add", this.setForm).then(res => {
this.proxy.$post("/referenceGroup/add", this.setForm).then(res => {
this.getData();
this.visible = false;
this.$message.success(res.data)
@ -138,11 +144,15 @@ export default defineComponent({
'删除', //
{type: 'warning'}
).then(() => {
this.proxy.$post("/referencegroup/del", {id: id}).then(res => {
this.proxy.$post("/referenceGroup/del", {id: id}).then(res => {
this.getData();
this.$message.success(res.data)
}).catch(() => {});
}).catch(() => {})
},
//
handlerUpload(data) {
this.setForm.coverUrl = data.fileUrl
}
}
})

Loading…
Cancel
Save