|
|
@ -28,16 +28,18 @@
|
|
|
|
<el-table :data="tableData.data" size="default" border
|
|
|
|
<el-table :data="tableData.data" size="default" border
|
|
|
|
:header-cell-style="{background: '#EEE'}">
|
|
|
|
:header-cell-style="{background: '#EEE'}">
|
|
|
|
<el-table-column prop="name" label="分组名" width="360"></el-table-column>
|
|
|
|
<el-table-column prop="name" label="分组名" width="360"></el-table-column>
|
|
|
|
<!-- <el-table-column prop="sort" label="排序" width="160">
|
|
|
|
<el-table-column prop="sortWeight" label="排序" >
|
|
|
|
<template #default="scope">
|
|
|
|
<template #default="scope">
|
|
|
|
<span>{{scope.row.sort}}</span>
|
|
|
|
<el-input v-model="sortValue" @blur="editCancel" @change="handlerChangeSort(value)" style="width: 120px" v-if="isEditing && scope.row.id == editId"></el-input>
|
|
|
|
|
|
|
|
<span v-else>{{scope.row.sortWeight}}</span>
|
|
|
|
|
|
|
|
<el-icon @click="handlerSortEdit(scope.row)"><Edit /></el-icon>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column> -->
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column prop="creatAt" label="创建时间"></el-table-column>
|
|
|
|
<el-table-column prop="creatAt" label="创建时间"></el-table-column>
|
|
|
|
<el-table-column prop="updateAt" label="更新时间"></el-table-column>
|
|
|
|
<el-table-column prop="updateAt" label="更新时间"></el-table-column>
|
|
|
|
<el-table-column prop="action" label="操作" fixed="right" width="240">
|
|
|
|
<el-table-column prop="action" label="操作" fixed="right" width="240">
|
|
|
|
<template #default="scope">
|
|
|
|
<template #default="scope">
|
|
|
|
<el-link type="primary" @click="handlerEdit(scope.row.id)">重命名</el-link>
|
|
|
|
<el-link type="primary" @click="handlerEdit(scope.row.id)">编辑</el-link>
|
|
|
|
<el-link type="danger" @click="singleDel(scope.row.id)" style="margin-left: 8px">删除</el-link>
|
|
|
|
<el-link type="danger" @click="singleDel(scope.row.id)" style="margin-left: 8px">删除</el-link>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
@ -51,8 +53,17 @@
|
|
|
|
:total="pagination.total"
|
|
|
|
:total="pagination.total"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<el-dialog v-model="editVisible" width="30%" title="重命名">
|
|
|
|
<el-dialog v-model="editVisible" width="30%" title="编辑分组">
|
|
|
|
<el-input v-model="setForm.name" placeholder="请输入分组名"></el-input>
|
|
|
|
<el-form>
|
|
|
|
|
|
|
|
<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="handlerCoverUpload" :config="{ limit: 1, accept: '.jpg, .jpeg, .png, .gif'}">
|
|
|
|
|
|
|
|
<el-button>点击上传</el-button>
|
|
|
|
|
|
|
|
</uploadFile>
|
|
|
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
</el-form>
|
|
|
|
<template #footer>
|
|
|
|
<template #footer>
|
|
|
|
<el-button @click="editVisible = false;setForm.name = ''">取消</el-button>
|
|
|
|
<el-button @click="editVisible = false;setForm.name = ''">取消</el-button>
|
|
|
|
<el-button @click="editConfirm" type="primary">确定</el-button>
|
|
|
|
<el-button @click="editConfirm" type="primary">确定</el-button>
|
|
|
@ -88,12 +99,15 @@ export default defineComponent({
|
|
|
|
const visible = ref(false);
|
|
|
|
const visible = ref(false);
|
|
|
|
const editVisible = ref(false);
|
|
|
|
const editVisible = ref(false);
|
|
|
|
const activeId = ref(false);
|
|
|
|
const activeId = ref(false);
|
|
|
|
|
|
|
|
const editId = ref(undefined)
|
|
|
|
|
|
|
|
const isEditing = ref(false);
|
|
|
|
|
|
|
|
const sortValue = ref(undefined);
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
form,setForm,proxy,
|
|
|
|
form,setForm,proxy,
|
|
|
|
tableData,
|
|
|
|
tableData,
|
|
|
|
pagination,
|
|
|
|
pagination,
|
|
|
|
statusFormatter,
|
|
|
|
statusFormatter,
|
|
|
|
visible,editVisible,activeId
|
|
|
|
visible,editVisible,activeId,isEditing,sortValue,editId
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
mounted() {
|
|
|
@ -126,6 +140,8 @@ export default defineComponent({
|
|
|
|
this.proxy.$post("/referenceGroup/upd", obj).then(res => {
|
|
|
|
this.proxy.$post("/referenceGroup/upd", obj).then(res => {
|
|
|
|
this.getData();
|
|
|
|
this.getData();
|
|
|
|
this.editVisible = false;
|
|
|
|
this.editVisible = false;
|
|
|
|
|
|
|
|
this.setForm.name = '';
|
|
|
|
|
|
|
|
this.setForm.coverUrl = '';
|
|
|
|
this.$message.success(res.data)
|
|
|
|
this.$message.success(res.data)
|
|
|
|
}).catch(() => {});
|
|
|
|
}).catch(() => {});
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -134,6 +150,8 @@ export default defineComponent({
|
|
|
|
this.proxy.$post("/referenceGroup/add", this.setForm).then(res => {
|
|
|
|
this.proxy.$post("/referenceGroup/add", this.setForm).then(res => {
|
|
|
|
this.getData();
|
|
|
|
this.getData();
|
|
|
|
this.visible = false;
|
|
|
|
this.visible = false;
|
|
|
|
|
|
|
|
this.setForm.name = '';
|
|
|
|
|
|
|
|
this.setForm.coverUrl = '';
|
|
|
|
this.$message.success(res.data)
|
|
|
|
this.$message.success(res.data)
|
|
|
|
}).catch(() => {});
|
|
|
|
}).catch(() => {});
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -150,9 +168,30 @@ export default defineComponent({
|
|
|
|
}).catch(() => {});
|
|
|
|
}).catch(() => {});
|
|
|
|
}).catch(() => {})
|
|
|
|
}).catch(() => {})
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
//改变排序
|
|
|
|
|
|
|
|
handlerChangeSort(value) {
|
|
|
|
|
|
|
|
let obj = {id: this.editId,sortWeight: this.sortValue*1}
|
|
|
|
|
|
|
|
this.proxy.$post("/reference/updSort", obj).then(res => {
|
|
|
|
|
|
|
|
this.getData();
|
|
|
|
|
|
|
|
this.isEditing = false;
|
|
|
|
|
|
|
|
this.editId = undefined;
|
|
|
|
|
|
|
|
this.sortValue = undefined;
|
|
|
|
|
|
|
|
this.$message.success(res.data)
|
|
|
|
|
|
|
|
}).catch(() => {});
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
handlerSortEdit(value) {
|
|
|
|
|
|
|
|
this.editId = value.id;
|
|
|
|
|
|
|
|
this.isEditing = true;
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
editCancel() {
|
|
|
|
|
|
|
|
this.isEditing = false;
|
|
|
|
|
|
|
|
},
|
|
|
|
//上传图片
|
|
|
|
//上传图片
|
|
|
|
handlerUpload(data) {
|
|
|
|
handlerUpload(data) {
|
|
|
|
this.setForm.coverUrl = data.fileUrl
|
|
|
|
this.setForm.coverUrl = data.fileUrl
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
handlerCoverUpload(data) {
|
|
|
|
|
|
|
|
this.setForm.coverUrl = data.fileUrl
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|