|
@@ -26,8 +26,6 @@
|
|
|
class="multiple"
|
|
|
v-model.trim="searchForm.organId"
|
|
|
filterable
|
|
|
- multiple
|
|
|
- collapse-tags
|
|
|
clearable
|
|
|
placeholder="请选择分部"
|
|
|
>
|
|
@@ -56,7 +54,7 @@
|
|
|
</save-form>
|
|
|
<div class="btnList">
|
|
|
<auth auths="sysMusicScoreCategories/save">
|
|
|
- <el-button type="primary" @click="addTeachClass">新增教材</el-button>
|
|
|
+ <el-button type="primary" @click="operationTeachClass('create')">新增教材</el-button>
|
|
|
</auth>
|
|
|
</div>
|
|
|
<div class="tableWrap">
|
|
@@ -64,25 +62,30 @@
|
|
|
style="width: 100%"
|
|
|
:header-cell-style="{ background: '#EDEEF0', color: '#444' }"
|
|
|
:data="tableList"
|
|
|
- :tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
|
|
+ row-key="id"
|
|
|
+ :tree-props="{children: 'sysMusicScoreCategoriesList', hasChildren: 'hasChildren'}"
|
|
|
>
|
|
|
- <el-table-column
|
|
|
+ <!-- <el-table-column
|
|
|
align="center"
|
|
|
prop="id"
|
|
|
label="教材编号"
|
|
|
- ></el-table-column>
|
|
|
+ ></el-table-column> -->
|
|
|
<el-table-column
|
|
|
- align="center"
|
|
|
+ align="left"
|
|
|
prop="name"
|
|
|
label="教材名称"
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column align="center" prop="organNames" label="可见分部">
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ scope.row.name }}({{ scope.row.id }})
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column align="center" prop="organNames" label="可见分部">
|
|
|
<template slot-scope="scope">
|
|
|
<div>
|
|
|
<overflow-text :text="scope.row.organNames"></overflow-text>
|
|
|
</div>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
+ </el-table-column> -->
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
prop="musicScoreNum"
|
|
@@ -120,7 +123,7 @@
|
|
|
<auth auths="sysMusicScoreCategories/update">
|
|
|
<el-button
|
|
|
type="text"
|
|
|
- @click="resetTeach(scope.row)"
|
|
|
+ @click="operationTeachClass('create', scope.row)"
|
|
|
v-if="!scope.row.enable"
|
|
|
>添加</el-button
|
|
|
>
|
|
@@ -128,7 +131,7 @@
|
|
|
<auth auths="sysMusicScoreCategories/update">
|
|
|
<el-button
|
|
|
type="text"
|
|
|
- @click="resetTeach(scope.row)"
|
|
|
+ @click="operationTeachClass('update', scope.row)"
|
|
|
v-if="!scope.row.enable"
|
|
|
>修改</el-button
|
|
|
>
|
|
@@ -171,7 +174,7 @@
|
|
|
</div>
|
|
|
|
|
|
<el-dialog
|
|
|
- title="新增教材"
|
|
|
+ :title="type == 'create' ? '新增教材' : '修改教材'"
|
|
|
:visible.sync="teachClassVisible"
|
|
|
width="600px"
|
|
|
v-if="teachClassVisible"
|
|
@@ -180,43 +183,17 @@
|
|
|
@close="teachClassVisible = false"
|
|
|
@getList="getList"
|
|
|
ref="teachClass"
|
|
|
+ :type="type"
|
|
|
v-if="teachClassVisible"
|
|
|
:activeRow="activeRow"
|
|
|
/>
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="teachClassVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="submitAddClass">确 定</el-button>
|
|
|
- </span>
|
|
|
</el-dialog>
|
|
|
|
|
|
-
|
|
|
- <el-dialog
|
|
|
- title="新增教材"
|
|
|
- :visible.sync="teachVisible"
|
|
|
- width="600px"
|
|
|
- v-if="teachVisible"
|
|
|
- >
|
|
|
- <addTeach
|
|
|
- @close="teachVisible = false"
|
|
|
- @getList="getList"
|
|
|
- ref="addTeach"
|
|
|
- v-if="teachVisible"
|
|
|
- :activeRow="activeRow"
|
|
|
- />
|
|
|
- <span slot="footer" class="dialog-footer">
|
|
|
- <el-button @click="teachVisible = false">取 消</el-button>
|
|
|
- <el-button type="primary" @click="submitAdd">确 定</el-button>
|
|
|
- </span>
|
|
|
- </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import axios from "axios";
|
|
|
-import { getToken } from "@/utils/auth";
|
|
|
import pagination from "@/components/Pagination/index";
|
|
|
-import load from "@/utils/loading";
|
|
|
-import addTeach from "./modals/addTeach";
|
|
|
import teachClass from "./modals/addRoot";
|
|
|
import { queryTree } from '../accompaniment/api'
|
|
|
import {
|
|
@@ -225,24 +202,21 @@ import {
|
|
|
removeSysMusicScore,
|
|
|
} from "./api";
|
|
|
export default {
|
|
|
- components: { pagination, addTeach, teachClass },
|
|
|
+ components: { pagination, teachClass },
|
|
|
data() {
|
|
|
return {
|
|
|
searchForm: {
|
|
|
search: null,
|
|
|
enable: null,
|
|
|
+ organId: null,
|
|
|
},
|
|
|
-
|
|
|
tableList: [],
|
|
|
organList: [],
|
|
|
- teachVisible: false,
|
|
|
activeRow: null,
|
|
|
+ type: 'create',
|
|
|
teachClassVisible: false,
|
|
|
- activeClassRow: null,
|
|
|
};
|
|
|
},
|
|
|
- //生命周期 - 创建完成(可以访问当前this实例)
|
|
|
- created() {},
|
|
|
//生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
mounted() {
|
|
|
// 获取分部
|
|
@@ -265,40 +239,24 @@ export default {
|
|
|
try {
|
|
|
const res = await queryTree({
|
|
|
// organId:organId.join(','),
|
|
|
- ...rest,
|
|
|
- page: this.rules.page,
|
|
|
- rows: this.rules.limit,
|
|
|
+ ...rest
|
|
|
});
|
|
|
console.log(res)
|
|
|
this.tableList = res.data;
|
|
|
} catch (e) {}
|
|
|
},
|
|
|
search() {
|
|
|
- this.rules.page = 1;
|
|
|
this.getList();
|
|
|
},
|
|
|
onReSet() {
|
|
|
this.$refs.searchForm.resetFields();
|
|
|
this.search();
|
|
|
},
|
|
|
- addTeachClass() {
|
|
|
- this.activeRow = null;
|
|
|
+ operationTeachClass(type, row) {
|
|
|
+ this.type = type
|
|
|
+ this.activeRow = row || null;
|
|
|
this.teachClassVisible = true;
|
|
|
},
|
|
|
- submitAddClass() {
|
|
|
- this.$refs.teachClass.addSubmit();
|
|
|
- },
|
|
|
- addTeach() {
|
|
|
- this.activeRow = null;
|
|
|
- this.teachVisible = true;
|
|
|
- },
|
|
|
- submitAdd() {
|
|
|
- this.$refs.addTeach.addSubmit();
|
|
|
- },
|
|
|
- resetTeach(row) {
|
|
|
- this.activeRow = row;
|
|
|
- this.teachVisible = true;
|
|
|
- },
|
|
|
async stopTeach(row) {
|
|
|
let str = "";
|
|
|
if (row.enable) {
|