|  | @@ -13,7 +13,7 @@
 | 
	
		
			
				|  |  |          @submit="search"
 | 
	
		
			
				|  |  |          @reset="onReSet"
 | 
	
		
			
				|  |  |        >
 | 
	
		
			
				|  |  | -        <el-form-item>
 | 
	
		
			
				|  |  | +        <el-form-item prop="search">
 | 
	
		
			
				|  |  |            <el-input
 | 
	
		
			
				|  |  |              v-model.trim="searchForm.search"
 | 
	
		
			
				|  |  |              clearable
 | 
	
	
		
			
				|  | @@ -21,11 +21,13 @@
 | 
	
		
			
				|  |  |              placeholder="请输入编号、名称"
 | 
	
		
			
				|  |  |            ></el-input>
 | 
	
		
			
				|  |  |          </el-form-item>
 | 
	
		
			
				|  |  | -        <el-form-item>
 | 
	
		
			
				|  |  | +        <el-form-item prop="parentSubjectId">
 | 
	
		
			
				|  |  |            <el-select
 | 
	
		
			
				|  |  |              v-model="searchForm.parentSubjectId"
 | 
	
		
			
				|  |  |              placeholder="选择声部分类"
 | 
	
		
			
				|  |  |              prop="parentSubjectId"
 | 
	
		
			
				|  |  | +            clearable
 | 
	
		
			
				|  |  | +            filterable
 | 
	
		
			
				|  |  |            >
 | 
	
		
			
				|  |  |              <el-option
 | 
	
		
			
				|  |  |                v-for="item in fatherList"
 | 
	
	
		
			
				|  | @@ -41,7 +43,7 @@
 | 
	
		
			
				|  |  |            <el-button native-type="reset" type="danger">重置</el-button>
 | 
	
		
			
				|  |  |          </el-form-item>
 | 
	
		
			
				|  |  |        </save-form>
 | 
	
		
			
				|  |  | -      <auth auths="subject/upset/insert" style="margin-bottom:20px;">
 | 
	
		
			
				|  |  | +      <auth auths="subject/upset/insert" style="margin-bottom: 20px">
 | 
	
		
			
				|  |  |          <el-button @click="addCategory" type="primary">添加</el-button>
 | 
	
		
			
				|  |  |        </auth>
 | 
	
		
			
				|  |  |        <div class="tableWrap">
 | 
	
	
		
			
				|  | @@ -53,13 +55,30 @@
 | 
	
		
			
				|  |  |            <el-table-column
 | 
	
		
			
				|  |  |              align="center"
 | 
	
		
			
				|  |  |              prop="id"
 | 
	
		
			
				|  |  | -            label="分类编号"
 | 
	
		
			
				|  |  | +            label="编号"
 | 
	
		
			
				|  |  |            ></el-table-column>
 | 
	
		
			
				|  |  |            <el-table-column
 | 
	
		
			
				|  |  |              align="center"
 | 
	
		
			
				|  |  |              prop="name"
 | 
	
		
			
				|  |  | -            label="分类名称"
 | 
	
		
			
				|  |  | +            label="声部名称"
 | 
	
		
			
				|  |  |            ></el-table-column>
 | 
	
		
			
				|  |  | +          <el-table-column
 | 
	
		
			
				|  |  | +            align="center"
 | 
	
		
			
				|  |  | +            prop="parentSubjectName"
 | 
	
		
			
				|  |  | +            label="所属分类"
 | 
	
		
			
				|  |  | +          ></el-table-column>
 | 
	
		
			
				|  |  | +          <el-table-column align="center" prop="name" label="分类图片">
 | 
	
		
			
				|  |  | +            <template slot-scope="scope">
 | 
	
		
			
				|  |  | +              <el-image
 | 
	
		
			
				|  |  | +                v-if="scope.row.img"
 | 
	
		
			
				|  |  | +                style="width: 60px; height: 60px"
 | 
	
		
			
				|  |  | +                fit="cover"
 | 
	
		
			
				|  |  | +                :src="scope.row.img.split(',')[0]"
 | 
	
		
			
				|  |  | +                :previewSrcList="scope.row.img.split(',')"
 | 
	
		
			
				|  |  | +              >
 | 
	
		
			
				|  |  | +              </el-image>
 | 
	
		
			
				|  |  | +            </template>
 | 
	
		
			
				|  |  | +          </el-table-column>
 | 
	
		
			
				|  |  |            <el-table-column align="center" prop="name" label="操作">
 | 
	
		
			
				|  |  |              <template slot-scope="scope">
 | 
	
		
			
				|  |  |                <div>
 | 
	
	
		
			
				|  | @@ -81,18 +100,6 @@
 | 
	
		
			
				|  |  |                </div>
 | 
	
		
			
				|  |  |              </template>
 | 
	
		
			
				|  |  |            </el-table-column>
 | 
	
		
			
				|  |  | -          <el-table-column align="center" prop="name" label="分类图片">
 | 
	
		
			
				|  |  | -            <template slot-scope="scope">
 | 
	
		
			
				|  |  | -              <el-image
 | 
	
		
			
				|  |  | -                v-if="scope.row.img"
 | 
	
		
			
				|  |  | -                style="width: 60px; height: 60px"
 | 
	
		
			
				|  |  | -                fit="cover"
 | 
	
		
			
				|  |  | -                :src="scope.row.img.split(',')[0]"
 | 
	
		
			
				|  |  | -                :previewSrcList="scope.row.img.split(',')"
 | 
	
		
			
				|  |  | -              >
 | 
	
		
			
				|  |  | -              </el-image>
 | 
	
		
			
				|  |  | -            </template>
 | 
	
		
			
				|  |  | -          </el-table-column>
 | 
	
		
			
				|  |  |          </el-table>
 | 
	
		
			
				|  |  |          <pagination
 | 
	
		
			
				|  |  |            :total.sync="rules.total"
 | 
	
	
		
			
				|  | @@ -110,16 +117,51 @@
 | 
	
		
			
				|  |  |        v-if="categoryVisible"
 | 
	
		
			
				|  |  |      >
 | 
	
		
			
				|  |  |        <el-form :model="form" :inline="true" ref="form">
 | 
	
		
			
				|  |  | +        <el-form-item prop="parentSubjectId"  label="所属分类" :rules="[{ required: true, message: '请选择声部分类' }]">
 | 
	
		
			
				|  |  | +          <el-select
 | 
	
		
			
				|  |  | +            v-model="form.parentSubjectId"
 | 
	
		
			
				|  |  | +            placeholder="所属分类"
 | 
	
		
			
				|  |  | +            prop="parentSubjectId"
 | 
	
		
			
				|  |  | +            style="width:365px!important"
 | 
	
		
			
				|  |  | +            clearable
 | 
	
		
			
				|  |  | +            filterable
 | 
	
		
			
				|  |  | +          >
 | 
	
		
			
				|  |  | +            <el-option
 | 
	
		
			
				|  |  | +              v-for="item in fatherList"
 | 
	
		
			
				|  |  | +              :key="item.id"
 | 
	
		
			
				|  |  | +              :label="item.name"
 | 
	
		
			
				|  |  | +              :value="item.id"
 | 
	
		
			
				|  |  | +            >
 | 
	
		
			
				|  |  | +            </el-option>
 | 
	
		
			
				|  |  | +          </el-select>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |          <el-form-item
 | 
	
		
			
				|  |  |            prop="name"
 | 
	
		
			
				|  |  | -          label="分类名称"
 | 
	
		
			
				|  |  | +          label="声部名称"
 | 
	
		
			
				|  |  |            :rules="{
 | 
	
		
			
				|  |  |              required: true,
 | 
	
		
			
				|  |  | -            message: '请输入分类名称',
 | 
	
		
			
				|  |  | +            message: '请输入声部名称',
 | 
	
		
			
				|  |  |              trigger: 'change,blur',
 | 
	
		
			
				|  |  |            }"
 | 
	
		
			
				|  |  |          >
 | 
	
		
			
				|  |  | -          <el-input v-model="form.name"></el-input>
 | 
	
		
			
				|  |  | +          <el-input v-model="form.name"   style="width:365px!important"></el-input>
 | 
	
		
			
				|  |  | +        </el-form-item>
 | 
	
		
			
				|  |  | +        <el-form-item
 | 
	
		
			
				|  |  | +          label="声部图标"
 | 
	
		
			
				|  |  | +          prop="img"
 | 
	
		
			
				|  |  | +          :rules="[{ required: true, message: '请上传声部图标' }]"
 | 
	
		
			
				|  |  | +        >
 | 
	
		
			
				|  |  | +          <!-- v-if="!addDisabled" -->
 | 
	
		
			
				|  |  | +          <upload
 | 
	
		
			
				|  |  | +            v-model="form.img"
 | 
	
		
			
				|  |  | +            :imageWidthM="260"
 | 
	
		
			
				|  |  | +            :imageHeightM="260"
 | 
	
		
			
				|  |  | +          ></upload>
 | 
	
		
			
				|  |  | +          <!-- <img v-else :src="form.img" alt="" width="120px" height="120px" /> -->
 | 
	
		
			
				|  |  | +          <p style="color: red" >
 | 
	
		
			
				|  |  | +            请上传260*260像素,大小2M以内,格式为jpg、png、gif图片
 | 
	
		
			
				|  |  | +          </p>
 | 
	
		
			
				|  |  |          </el-form-item>
 | 
	
		
			
				|  |  |        </el-form>
 | 
	
		
			
				|  |  |        <span slot="footer" class="dialog-footer">
 | 
	
	
		
			
				|  | @@ -134,10 +176,15 @@
 | 
	
		
			
				|  |  |  import axios from "axios";
 | 
	
		
			
				|  |  |  import { getToken } from "@/utils/auth";
 | 
	
		
			
				|  |  |  import pagination from "@/components/Pagination/index";
 | 
	
		
			
				|  |  | +import Upload from "@/components/Upload/index";
 | 
	
		
			
				|  |  |  import load from "@/utils/loading";
 | 
	
		
			
				|  |  | -import { subjectListTree, subjectUpset,subSubjectList } from "@/api/specialSetting";
 | 
	
		
			
				|  |  | +import {
 | 
	
		
			
				|  |  | +  subjectListTree,
 | 
	
		
			
				|  |  | +  subjectUpset,
 | 
	
		
			
				|  |  | +  subSubjectList,
 | 
	
		
			
				|  |  | +} from "@/api/specialSetting";
 | 
	
		
			
				|  |  |  export default {
 | 
	
		
			
				|  |  | -  components: { pagination },
 | 
	
		
			
				|  |  | +  components: { pagination, Upload },
 | 
	
		
			
				|  |  |    data() {
 | 
	
		
			
				|  |  |      return {
 | 
	
		
			
				|  |  |        searchForm: {
 | 
	
	
		
			
				|  | @@ -147,6 +194,9 @@ export default {
 | 
	
		
			
				|  |  |        form: {
 | 
	
		
			
				|  |  |          name: null,
 | 
	
		
			
				|  |  |          id: null,
 | 
	
		
			
				|  |  | +        img:null,
 | 
	
		
			
				|  |  | +        parentSubjectId:null
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |        },
 | 
	
		
			
				|  |  |        tableList: [],
 | 
	
		
			
				|  |  |        organList: [],
 | 
	
	
		
			
				|  | @@ -172,7 +222,7 @@ export default {
 | 
	
		
			
				|  |  |    methods: {
 | 
	
		
			
				|  |  |      init() {
 | 
	
		
			
				|  |  |        this.getList();
 | 
	
		
			
				|  |  | -      this.getFatherList()
 | 
	
		
			
				|  |  | +      this.getFatherList();
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      getFatherList() {
 | 
	
		
			
				|  |  |        subjectListTree({
 | 
	
	
		
			
				|  | @@ -186,26 +236,29 @@ export default {
 | 
	
		
			
				|  |  |        });
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      getList() {
 | 
	
		
			
				|  |  | -      subSubjectList({...this.searchForm}).then(res=>{
 | 
	
		
			
				|  |  | -
 | 
	
		
			
				|  |  | -      })
 | 
	
		
			
				|  |  | +      subSubjectList({ ...this.searchForm,page:this.rules.page,rows:this.rules.limit }).then((res) => {
 | 
	
		
			
				|  |  | +        this.tableList = res.data.rows;
 | 
	
		
			
				|  |  | +        this.rules.total = res.data.total
 | 
	
		
			
				|  |  | +      });
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      search() {
 | 
	
		
			
				|  |  |        this.rules.page = 1;
 | 
	
		
			
				|  |  |        this.getList();
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      onReSet() {
 | 
	
		
			
				|  |  | -      this.$nextTick(()=>{
 | 
	
		
			
				|  |  | -        this.search()
 | 
	
		
			
				|  |  | -      })
 | 
	
		
			
				|  |  | +      this.$nextTick(() => {
 | 
	
		
			
				|  |  | +        this.search();
 | 
	
		
			
				|  |  | +      });
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      resetSubjectCategory(row) {
 | 
	
		
			
				|  |  |        this.form.name = row.name;
 | 
	
		
			
				|  |  |        this.form.id = row.id;
 | 
	
		
			
				|  |  | +      this.form.parentSubjectId = row.parentSubjectId;
 | 
	
		
			
				|  |  | +      this.form.img = row.img;
 | 
	
		
			
				|  |  |        this.categoryVisible = true;
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |      removeSubjectCategory(row) {
 | 
	
		
			
				|  |  | -      this.$confirm("是否确认删除分类", "提示", {
 | 
	
		
			
				|  |  | +      this.$confirm("是否确认删除声部", "提示", {
 | 
	
		
			
				|  |  |          confirmButtonText: "确定",
 | 
	
		
			
				|  |  |          cancelButtonText: "取消",
 | 
	
		
			
				|  |  |          type: "warning",
 | 
	
	
		
			
				|  | @@ -230,10 +283,8 @@ export default {
 | 
	
		
			
				|  |  |        this.$refs.form.validate((valid) => {
 | 
	
		
			
				|  |  |          if (valid) {
 | 
	
		
			
				|  |  |            subjectUpset({
 | 
	
		
			
				|  |  | -            parentSubjectId: 0,
 | 
	
		
			
				|  |  |              tenantId: 1,
 | 
	
		
			
				|  |  | -            name: this.form.name,
 | 
	
		
			
				|  |  | -            id: this.form.id,
 | 
	
		
			
				|  |  | +            ...this.form
 | 
	
		
			
				|  |  |            }).then((res) => {
 | 
	
		
			
				|  |  |              if (res.code == 200) {
 | 
	
		
			
				|  |  |                this.messageTips("修改", res);
 | 
	
	
		
			
				|  | @@ -247,6 +298,8 @@ export default {
 | 
	
		
			
				|  |  |      addCategory() {
 | 
	
		
			
				|  |  |        this.form.id = null;
 | 
	
		
			
				|  |  |        this.form.name = null;
 | 
	
		
			
				|  |  | +      this.form.parentSubjectId = null;
 | 
	
		
			
				|  |  | +      this.form.img = null;
 | 
	
		
			
				|  |  |        this.categoryVisible = true;
 | 
	
		
			
				|  |  |      },
 | 
	
		
			
				|  |  |    },
 |