|
@@ -126,7 +126,7 @@
|
|
<el-button
|
|
<el-button
|
|
type="text"
|
|
type="text"
|
|
@click="operationTeachClass('create', scope.row)"
|
|
@click="operationTeachClass('create', scope.row)"
|
|
- v-if="!scope.row.enable && formatParentId(scope.row.id, tableList).length < 4"
|
|
|
|
|
|
+ v-if="!scope.row.enable && scope.row.level < 4"
|
|
>添加</el-button
|
|
>添加</el-button
|
|
>
|
|
>
|
|
</auth>
|
|
</auth>
|
|
@@ -203,6 +203,15 @@ import {
|
|
enableSysMusicScore,
|
|
enableSysMusicScore,
|
|
removeSysMusicScore,
|
|
removeSysMusicScore,
|
|
} from "./api";
|
|
} from "./api";
|
|
|
|
+const formatList = (list, level = 1) => {
|
|
|
|
+ for (let item of list) {
|
|
|
|
+ item.level = level;
|
|
|
|
+ if (item.sysMusicScoreCategoriesList && item.sysMusicScoreCategoriesList.length) {
|
|
|
|
+ formatList(item.sysMusicScoreCategoriesList, level + 1)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ return list
|
|
|
|
+}
|
|
export default {
|
|
export default {
|
|
components: { pagination, teachClass },
|
|
components: { pagination, teachClass },
|
|
data() {
|
|
data() {
|
|
@@ -245,7 +254,9 @@ export default {
|
|
...rest
|
|
...rest
|
|
});
|
|
});
|
|
console.log(res)
|
|
console.log(res)
|
|
- this.tableList = res.data;
|
|
|
|
|
|
+ const result = formatList(res.data)
|
|
|
|
+ console.log(result)
|
|
|
|
+ this.tableList = result
|
|
} catch (e) {}
|
|
} catch (e) {}
|
|
},
|
|
},
|
|
search() {
|
|
search() {
|