|
|
@@ -32,7 +32,7 @@
|
|
|
/>
|
|
|
<el-table-column prop="sn" width="140" label="编号" align="center" header-align="center" />
|
|
|
<el-table-column prop="name" min-width="140" label="名称" align="center" header-align="center" />
|
|
|
- <el-table-column prop="label_list" label="标签" align="center" header-align="center"
|
|
|
+ <el-table-column prop="label_list" min-width="140" label="标签" align="center" header-align="center"
|
|
|
><template slot-scope="{ row }">
|
|
|
{{ row.label_list.join('、') }}
|
|
|
</template>
|
|
|
@@ -105,7 +105,12 @@
|
|
|
default-first-option
|
|
|
placeholder="请选择或输入模板标签"
|
|
|
>
|
|
|
- <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> </el-option>
|
|
|
+ <el-option v-for="(item, index) in options" :key="item.id" :label="item.name" :value="item.name">
|
|
|
+ <span style="float: left">{{ item.name }}</span>
|
|
|
+ <span style="float: right; font-size: 12px; color: #8492a6" @click.stop="handleDeleteLabel(item, index)"
|
|
|
+ >删除</span
|
|
|
+ >
|
|
|
+ </el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="模板描述" prop="memo">
|
|
|
@@ -124,7 +129,7 @@
|
|
|
import MenuPage from '../common/menu.vue';
|
|
|
import PaginationPage from '@/components/PaginationPage.vue';
|
|
|
|
|
|
-import { PageQueryTemplateListPersonal } from '@/api/list.js';
|
|
|
+import { PageQueryTemplateListPersonal, QueryLabelList } from '@/api/list.js';
|
|
|
import {
|
|
|
CreateTemplatePersonal,
|
|
|
UpdateTemplateShareStatus,
|
|
|
@@ -132,6 +137,7 @@ import {
|
|
|
GetTemplateInfo,
|
|
|
TemplateAuditOperate,
|
|
|
TemplateRequestOperate,
|
|
|
+ DeleteTemplateLabel,
|
|
|
} from '@/api/template';
|
|
|
|
|
|
export default {
|
|
|
@@ -188,16 +194,7 @@ export default {
|
|
|
},
|
|
|
visible: false,
|
|
|
loading: false,
|
|
|
- options: [
|
|
|
- {
|
|
|
- label: '小学',
|
|
|
- value: '小学',
|
|
|
- },
|
|
|
- {
|
|
|
- label: '阅读',
|
|
|
- value: '阅读',
|
|
|
- },
|
|
|
- ],
|
|
|
+ options: [],
|
|
|
operate_button: {
|
|
|
1: '申请机构共享',
|
|
|
3: '申请发布',
|
|
|
@@ -208,6 +205,9 @@ export default {
|
|
|
},
|
|
|
};
|
|
|
},
|
|
|
+ created() {
|
|
|
+ this.queryLabelList();
|
|
|
+ },
|
|
|
mounted() {
|
|
|
this.tableHeight =
|
|
|
document.getElementsByClassName('app-container')[0].clientHeight -
|
|
|
@@ -216,6 +216,14 @@ export default {
|
|
|
10;
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 查询标签列表
|
|
|
+ queryLabelList() {
|
|
|
+ QueryLabelList({ name: '' }).then((res) => {
|
|
|
+ if (res.status === 1) {
|
|
|
+ this.options = res.label_list;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
queryTemplateList(data) {
|
|
|
this.form.page_capacity = data.page_capacity;
|
|
|
this.form.cur_page = data.cur_page;
|
|
|
@@ -250,6 +258,7 @@ export default {
|
|
|
};
|
|
|
|
|
|
this.queryList();
|
|
|
+ this.queryLabelList();
|
|
|
}
|
|
|
})
|
|
|
.catch(() => {
|
|
|
@@ -328,6 +337,23 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ // 删除标签
|
|
|
+ handleDeleteLabel(item, index) {
|
|
|
+ this.$confirm('确定要删除此条标签吗?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning',
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ DeleteTemplateLabel({ id: item.id }).then((res) => {
|
|
|
+ if (res.status === 1) {
|
|
|
+ this.$message.success('删除成功!');
|
|
|
+ this.options.splice(index, 1);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {});
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|