|
@@ -30,27 +30,29 @@
|
|
|
header-align="center"
|
|
header-align="center"
|
|
|
class-name="index-column"
|
|
class-name="index-column"
|
|
|
/>
|
|
/>
|
|
|
- <el-table-column prop="id" width="130" label="编号" align="center" header-align="center" />
|
|
|
|
|
- <el-table-column prop="name" width="130" label="名称" align="center" header-align="center" />
|
|
|
|
|
- <el-table-column prop="share_status" label="共享状态" align="center" header-align="center">
|
|
|
|
|
|
|
+ <el-table-column min-width="250" prop="id" label="编号" align="center" header-align="center" />
|
|
|
|
|
+ <el-table-column prop="name" label="名称" align="center" header-align="center" />
|
|
|
|
|
+ <el-table-column min-width="150" prop="share_status" label="共享状态" align="center" header-align="center">
|
|
|
<template slot-scope="{ row }">
|
|
<template slot-scope="{ row }">
|
|
|
{{ row.share_status === 0 ? '未共享' : '已共享' }}
|
|
{{ row.share_status === 0 ? '未共享' : '已共享' }}
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
|
|
|
- <el-table-column prop="status" label="发布状态" align="center" header-align="center">
|
|
|
|
|
|
|
+ <el-table-column min-width="150" prop="status" label="发布状态" align="center" header-align="center">
|
|
|
<template slot-scope="{ row }">
|
|
<template slot-scope="{ row }">
|
|
|
{{ status_list.find((item) => item.value === row.status).label }}
|
|
{{ status_list.find((item) => item.value === row.status).label }}
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
|
|
|
- <el-table-column prop="create_time" label="创建时间" align="center" width="170" header-align="center" />
|
|
|
|
|
|
|
+ <el-table-column prop="create_time" label="创建时间" align="center" width="180" header-align="center" />
|
|
|
|
|
|
|
|
<el-table-column prop="operation" label="操作" fixed="right" width="200" align="center" header-align="center">
|
|
<el-table-column prop="operation" label="操作" fixed="right" width="200" align="center" header-align="center">
|
|
|
<template slot-scope="{ row }">
|
|
<template slot-scope="{ row }">
|
|
|
- <span class="link" @click="setOrgManager(row)">{{
|
|
|
|
|
- row.is_org_manager === 'true' ? '取消机构管理员' : '设为机构管理员'
|
|
|
|
|
|
|
+ <span class="link" @click="previewTemplate(row)">预览</span>
|
|
|
|
|
+ <span class="link" @click="shareTemplate(row)">{{
|
|
|
|
|
+ row.share_status === 0 ? '共享到机构模板' : '取消共享'
|
|
|
}}</span>
|
|
}}</span>
|
|
|
|
|
+ <span class="link danger" @click="deleteTemplate(row)">删除</span>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
</el-table>
|
|
</el-table>
|
|
@@ -83,7 +85,7 @@ import MenuPage from '../common/menu.vue';
|
|
|
import PaginationPage from '@/components/PaginationPage.vue';
|
|
import PaginationPage from '@/components/PaginationPage.vue';
|
|
|
|
|
|
|
|
import { PageQueryTemplateListPersonal } from '@/api/list.js';
|
|
import { PageQueryTemplateListPersonal } from '@/api/list.js';
|
|
|
-import { createTemplatePersonal } from '@/api/template';
|
|
|
|
|
|
|
+import { CreateTemplatePersonal, UpdateTemplateShareStatus, DeleteTemplate } from '@/api/template';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'PersonalWorkbenchTemplate',
|
|
name: 'PersonalWorkbenchTemplate',
|
|
@@ -153,18 +155,6 @@ export default {
|
|
|
PageQueryTemplateListPersonal(this.form).then(({ total_count, template_list }) => {
|
|
PageQueryTemplateListPersonal(this.form).then(({ total_count, template_list }) => {
|
|
|
this.total = total_count;
|
|
this.total = total_count;
|
|
|
this.list = template_list;
|
|
this.list = template_list;
|
|
|
- this.list = [
|
|
|
|
|
- {
|
|
|
|
|
- id: '000001-111111111', //
|
|
|
|
|
- name: '生词模板', // 名称
|
|
|
|
|
- status: 1, // 状态、发布状态 0 【草稿】、1【申请发布】、2【已发布】、3【未发布】、4【驳回发布申请】"share_status":1, // 共享状态 0 【未共享】、1【已共享】
|
|
|
|
|
- use_scope: 1, // 使用范围 0【本机构】,1【全域】"org_id":"00000-0001", // 所属机构 ID
|
|
|
|
|
- org_name: '北语社', // 所属机构
|
|
|
|
|
- create_time: '2025-05-01 12:00:00', // 创建时间
|
|
|
|
|
- book_id: '000001-111111111', // 模板内部包含的教材 ID,每个模板内部实际是一个教材// 目前只有一个课件
|
|
|
|
|
- courseware_id: '000001-111111111', // 目前模板只有唯一一个课件}
|
|
|
|
|
- },
|
|
|
|
|
- ];
|
|
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
queryList() {
|
|
queryList() {
|
|
@@ -177,7 +167,7 @@ export default {
|
|
|
// 确定创建模板
|
|
// 确定创建模板
|
|
|
addTemplate() {
|
|
addTemplate() {
|
|
|
this.loading = true;
|
|
this.loading = true;
|
|
|
- createTemplatePersonal(this.data)
|
|
|
|
|
|
|
+ CreateTemplatePersonal(this.data)
|
|
|
.then((res) => {
|
|
.then((res) => {
|
|
|
this.loading = false;
|
|
this.loading = false;
|
|
|
this.visible = false;
|
|
this.visible = false;
|
|
@@ -197,6 +187,40 @@ export default {
|
|
|
this.loading = false;
|
|
this.loading = false;
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ // 预览模板
|
|
|
|
|
+ previewTemplate(row) {},
|
|
|
|
|
+ //共享/取消共享模板
|
|
|
|
|
+ shareTemplate(row) {
|
|
|
|
|
+ UpdateTemplateShareStatus({ share_status: row.share_status === 0 ? 1 : 0, id: row.id }).then((res) => {
|
|
|
|
|
+ if (res.status === 1) {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: '设置成功!',
|
|
|
|
|
+ });
|
|
|
|
|
+ this.queryTemplateList({ cur_page: this.form.cur_page, page_capacity: this.form.page_capacity });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ // 删除模板
|
|
|
|
|
+ deleteTemplate(row) {
|
|
|
|
|
+ this.$confirm('是否删除此模板?', '提示', {
|
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ type: 'warning',
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ DeleteTemplate({ id: row.id }).then((res) => {
|
|
|
|
|
+ if (res.status === 1) {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ type: 'success',
|
|
|
|
|
+ message: '删除成功!',
|
|
|
|
|
+ });
|
|
|
|
|
+ this.queryTemplateList({ cur_page: this.form.cur_page, page_capacity: this.form.page_capacity });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {});
|
|
|
|
|
+ },
|
|
|
},
|
|
},
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|