浏览代码

内容管理

1
mo 4 年之前
父节点
当前提交
da6dd4d4ca

+ 24 - 18
src/views/contentManager/components/activity.vue

@@ -2,7 +2,7 @@
   <div>
     <!-- 搜索标题 -->
     <auth auths="news/add">
-       <div @click="openTeaching('create')" class="newBand">新建</div>
+      <div @click="openTeaching('create')" class="newBand">新建</div>
     </auth>
 
     <!-- 搜索标题 -->
@@ -86,23 +86,29 @@
         </el-table-column>
         <el-table-column align="center" label="操作">
           <template slot-scope="scope">
-            <auth auths="news/update" style="margin-left: 10px">
-              <el-button @click="openTeaching('update', scope.row)" type="text"
-                >修改</el-button
-              >
-              <el-button
-                v-if="scope.row.status == 1"
-                @click="onStop(scope.row, 0)"
-                type="text"
-                >停用</el-button
-              >
-              <el-button v-else @click="onStop(scope.row, 1)" type="text"
-                >启用</el-button
-              >
-            </auth>
-            <auth auths="news/del" style="margin-left: 10px">
-              <el-button @click="onDel(scope.row)" type="text">删除</el-button>
-            </auth>
+            <div>
+              <auth auths="news/update" style="margin-left: 10px">
+                <el-button
+                  @click="openTeaching('update', scope.row)"
+                  type="text"
+                  >修改</el-button
+                >
+                <el-button
+                  v-if="scope.row.status == 1"
+                  @click="onStop(scope.row, 0)"
+                  type="text"
+                  >停用</el-button
+                >
+                <el-button v-else @click="onStop(scope.row, 1)" type="text"
+                  >启用</el-button
+                >
+              </auth>
+              <auth auths="news/del" style="margin-left: 10px">
+                <el-button @click="onDel(scope.row)" type="text"
+                  >删除</el-button
+                >
+              </auth>
+            </div>
           </template>
         </el-table-column>
       </el-table>

+ 23 - 17
src/views/contentManager/components/advert.vue

@@ -74,23 +74,29 @@
         <el-table-column align="center"
                          label="操作">
           <template slot-scope="scope">
-            <auth auths="news/update" style="margin-left: 10px">
-              <el-button @click="openTeaching('update', scope.row)" type="text"
-                >修改</el-button
-              >
-              <el-button
-                v-if="scope.row.status == 1"
-                @click="onStop(scope.row, 0)"
-                type="text"
-                >停用</el-button
-              >
-              <el-button v-else @click="onStop(scope.row, 1)" type="text"
-                >启用</el-button
-              >
-            </auth>
-            <auth auths="news/del" style="margin-left: 10px">
-              <el-button @click="onDel(scope.row)" type="text">删除</el-button>
-            </auth>
+              <div>
+              <auth auths="news/update" style="margin-left: 10px">
+                <el-button
+                  @click="openTeaching('update', scope.row)"
+                  type="text"
+                  >修改</el-button
+                >
+                <el-button
+                  v-if="scope.row.status == 1"
+                  @click="onStop(scope.row, 0)"
+                  type="text"
+                  >停用</el-button
+                >
+                <el-button v-else @click="onStop(scope.row, 1)" type="text"
+                  >启用</el-button
+                >
+              </auth>
+              <auth auths="news/del" style="margin-left: 10px">
+                <el-button @click="onDel(scope.row)" type="text"
+                  >删除</el-button
+                >
+              </auth>
+            </div>
           </template>
         </el-table-column>
       </el-table>

+ 132 - 125
src/views/contentManager/components/appPage.vue

@@ -1,26 +1,33 @@
 <template>
   <div>
     <!-- 搜索标题 -->
-       <auth auths="news/add">
-       <div @click="openTeaching('create')" class="newBand">新建</div>
+    <auth auths="news/add">
+      <div @click="openTeaching('create')" class="newBand">新建</div>
     </auth>
     <!-- 搜索标题 -->
-    <save-form :inline="true"
-             class="searchForm"
-             saveKey="contentAppPage"
-             @submit="search"
-             :model="searchForm">
+    <save-form
+      :inline="true"
+      class="searchForm"
+      saveKey="contentAppPage"
+      @submit="search"
+      :model="searchForm"
+    >
       <el-form-item prop="organIdList">
-        <select-all class="multiple"
-                   v-model.trim="searchForm.organIdList" clearable
-                   filterable
-                   collapse-tags
-                   multiple
-                   placeholder="请选择分部">
-          <el-option v-for="(item,index) in selects.branchs"
-                    :key="index"
-                    :label="item.name"
-                    :value="item.id"></el-option>
+        <select-all
+          class="multiple"
+          v-model.trim="searchForm.organIdList"
+          clearable
+          filterable
+          collapse-tags
+          multiple
+          placeholder="请选择分部"
+        >
+          <el-option
+            v-for="(item, index) in selects.branchs"
+            :key="index"
+            :label="item.name"
+            :value="item.id"
+          ></el-option>
         </select-all>
       </el-form-item>
       <el-form-item>
@@ -29,97 +36,92 @@
     </save-form>
     <!-- 列表 -->
     <div class="tableWrap">
-      <el-table :data='tableList'
-                :header-cell-style="{background:'#EDEEF0',color:'#444'}">
-        <el-table-column align='center'
-                         label="轮播图">
+      <el-table
+        :data="tableList"
+        :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+      >
+        <el-table-column align="center" label="轮播图">
           <template slot-scope="scope">
-            <img class="bannerImg"
-                 :src="scope.row.coverImage"
-                 alt="">
+            <img class="bannerImg" :src="scope.row.coverImage" alt="" />
           </template>
         </el-table-column>
-        <el-table-column align='center'
-                         prop="title"
-                         label="标题">
+        <el-table-column align="center" prop="title" label="标题">
         </el-table-column>
-        <el-table-column align='center'
-                         label="跳转链接">
+        <el-table-column align="center" label="跳转链接">
           <template slot-scope="scope">
             <overflow-text :text="scope.row.linkUrl"></overflow-text>
             <!-- {{ scope.row.linkUrl }} -->
           </template>
         </el-table-column>
-        <el-table-column align='center'
-                         prop="remark"
-                         label="是否使用">
+        <el-table-column align="center" prop="remark" label="是否使用">
           <template slot-scope="scope">
-            {{ scope.row.status == 1 ? '是' : '否' }}
+            {{ scope.row.status == 1 ? "是" : "否" }}
           </template>
         </el-table-column>
-        <el-table-column align='center'
-                         prop="memo"
-                         label="版本号">
+        <el-table-column align="center" prop="memo" label="版本号">
           <template slot-scope="scope">
-            {{ scope.row.memo ? scope.row.memo : '--' }}
+            {{ scope.row.memo ? scope.row.memo : "--" }}
           </template>
         </el-table-column>
-        <el-table-column align='center'
-                         prop="order"
-                         label="排序">
+        <el-table-column align="center" prop="order" label="排序">
         </el-table-column>
-        <el-table-column align="center"
-                         prop="remark"
-                         label="适用分部">
+        <el-table-column align="center" prop="remark" label="适用分部">
           <template slot-scope="scope">
             <overflow-text :text="scope.row.organNameList"></overflow-text>
           </template>
         </el-table-column>
-        <el-table-column align='center'
-                         label="操作">
+        <el-table-column align="center" label="操作">
           <template slot-scope="scope">
-      <auth auths="news/update" style="margin-left: 10px">
-              <el-button @click="openTeaching('update', scope.row)" type="text"
-                >修改</el-button
-              >
-              <el-button
-                v-if="scope.row.status == 1"
-                @click="onStop(scope.row, 0)"
-                type="text"
-                >停用</el-button
-              >
-              <el-button v-else @click="onStop(scope.row, 1)" type="text"
-                >启用</el-button
-              >
-            </auth>
-            <auth auths="news/del" style="margin-left: 10px">
-              <el-button @click="onDel(scope.row)" type="text">删除</el-button>
-            </auth>
+            <div>
+              <auth auths="news/update" style="margin-left: 10px">
+                <el-button
+                  @click="openTeaching('update', scope.row)"
+                  type="text"
+                  >修改</el-button
+                >
+                <el-button
+                  v-if="scope.row.status == 1"
+                  @click="onStop(scope.row, 0)"
+                  type="text"
+                  >停用</el-button
+                >
+                <el-button v-else @click="onStop(scope.row, 1)" type="text"
+                  >启用</el-button
+                >
+              </auth>
+              <auth auths="news/del" style="margin-left: 10px">
+                <el-button @click="onDel(scope.row)" type="text"
+                  >删除</el-button
+                >
+              </auth>
+            </div>
           </template>
         </el-table-column>
       </el-table>
       <pagination
-       saveKey="contentAppPage"
-      sync :total.sync="pageInfo.total"
-                  :page.sync="pageInfo.page"
-                  :limit.sync="pageInfo.limit"
-                  :page-sizes="pageInfo.page_size"
-                  @pagination="getList" />
+        saveKey="contentAppPage"
+        sync
+        :total.sync="pageInfo.total"
+        :page.sync="pageInfo.page"
+        :limit.sync="pageInfo.limit"
+        :page-sizes="pageInfo.page_size"
+        @pagination="getList"
+      />
     </div>
   </div>
 </template>
 <script>
-import { newsList, newsUpdate, newsDel } from '@/api/contentManager'
-import pagination from '@/components/Pagination/index'
+import { newsList, newsUpdate, newsDel } from "@/api/contentManager";
+import pagination from "@/components/Pagination/index";
 export default {
-  name: 'training',
+  name: "training",
   components: {
-    pagination
+    pagination,
   },
-  data () {
+  data() {
     return {
       searchForm: {
-        organIdList: []
+        organIdList: [],
       },
       tableList: [],
       teacherId: this.$route.query.teacherId,
@@ -128,80 +130,85 @@ export default {
         limit: 10, // 限制显示条数
         page: 1, // 当前页
         total: 1, // 总条数
-        page_size: [10, 20, 40, 50] // 选择限制显示条数
-      }
-    }
+        page_size: [10, 20, 40, 50], // 选择限制显示条数
+      },
+    };
   },
-  mounted () {
+  mounted() {
     this.$store.dispatch("setBranchs");
-    this.getList()
+    this.getList();
   },
   methods: {
     search() {
-      this.pageInfo.page = 1
-      this.getList()
+      this.pageInfo.page = 1;
+      this.getList();
     },
-    getList () {
+    getList() {
       let params = {
-        clientName: 'manage',
-        organIdList: this.searchForm.organIdList ? this.searchForm.organIdList.join(',') : null,
+        clientName: "manage",
+        organIdList: this.searchForm.organIdList
+          ? this.searchForm.organIdList.join(",")
+          : null,
         rows: this.pageInfo.limit,
         page: this.pageInfo.page,
-        type: 6
-      }
-      newsList(params).then(res => {
+        type: 6,
+      };
+      newsList(params).then((res) => {
         if (res.code == 200) {
-          this.tableList = res.data.rows
-          this.pageInfo.total = res.data.total
+          this.tableList = res.data.rows;
+          this.pageInfo.total = res.data.total;
         }
-      })
+      });
     },
-    openTeaching (type, rows) {
-      let params = {}
-      if (type == 'update') {
-        params.id = rows.id
+    openTeaching(type, rows) {
+      let params = {};
+      if (type == "update") {
+        params.id = rows.id;
       }
-      params.type = 6
-      params.pageType = type
+      params.type = 6;
+      params.pageType = type;
       this.$router.push({
-        path: '/contentManager/contentOperation',
-        query: params
-      })
+        path: "/contentManager/contentOperation",
+        query: params,
+      });
     },
-    onDel (row) { // 删除
-      this.$confirm('确定是否删除?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        newsDel({ id: row.id }).then(res => {
-          if (res.code == 200) {
-            this.$message.success('删除成功')
-            this.getList()
-          } else {
-            this.$message.error(res.msg)
-          }
+    onDel(row) {
+      // 删除
+      this.$confirm("确定是否删除?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          newsDel({ id: row.id }).then((res) => {
+            if (res.code == 200) {
+              this.$message.success("删除成功");
+              this.getList();
+            } else {
+              this.$message.error(res.msg);
+            }
+          });
         })
-      }).catch(() => { })
-
+        .catch(() => {});
     },
-    onStop (row, status) { // 停止
+    onStop(row, status) {
+      // 停止
       // newsUpdate
-      let tempStr = ['停用', '启用']
+      let tempStr = ["停用", "启用"];
       newsUpdate({
         id: row.id,
-        status: status
-      }).then(res => {
+        status: status,
+      }).then((res) => {
         if (res.code == 200) {
-          this.$message.success(tempStr[status] + '成功')
-          this.getList()
+          this.$message.success(tempStr[status] + "成功");
+          this.getList();
         } else {
-          this.$message.error(res.msg)
+          this.$message.error(res.msg);
         }
-      })
-    }
-  }
-}
+      });
+    },
+  },
+};
 </script>
 <style lang="scss" scoped>
 .bannerImg {

+ 145 - 127
src/views/contentManager/components/banner.vue

@@ -1,26 +1,33 @@
 <template>
   <div>
     <!-- 搜索标题 -->
-      <auth auths="news/add">
-       <div @click="openTeaching('create')" class="newBand">新建</div>
+    <auth auths="news/add">
+      <div @click="openTeaching('create')" class="newBand">新建</div>
     </auth>
     <!-- 搜索标题 -->
-    <save-form :inline="true"
-             class="searchForm"
-             saveKey="contentBanner"
-             @submit="search"
-             :model="searchForm">
+    <save-form
+      :inline="true"
+      class="searchForm"
+      saveKey="contentBanner"
+      @submit="search"
+      :model="searchForm"
+    >
       <el-form-item prop="organIdList">
-        <select-all class="multiple" clearable
-                   filterable
-                   collapse-tags
-                   multiple
-                   v-model.trim="searchForm.organIdList"
-                   placeholder="请选择分部">
-          <el-option v-for="(item,index) in selects.branchs"
-                    :key="index"
-                    :label="item.name"
-                    :value="item.id"></el-option>
+        <select-all
+          class="multiple"
+          clearable
+          filterable
+          collapse-tags
+          multiple
+          v-model.trim="searchForm.organIdList"
+          placeholder="请选择分部"
+        >
+          <el-option
+            v-for="(item, index) in selects.branchs"
+            :key="index"
+            :label="item.name"
+            :value="item.id"
+          ></el-option>
         </select-all>
       </el-form-item>
       <el-form-item>
@@ -29,97 +36,104 @@
     </save-form>
     <!-- 列表 -->
     <div class="tableWrap">
-      <el-table :data='tableList'
-                :header-cell-style="{background:'#EDEEF0',color:'#444'}">
-        <el-table-column align='center'
-                         label="轮播图">
+      <el-table
+        :data="tableList"
+        :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+      >
+        <el-table-column align="center" label="轮播图">
           <template slot-scope="scope">
-            <img class="bannerImg"
-                 :src="scope.row.coverImage"
-                 alt="">
+            <img class="bannerImg" :src="scope.row.coverImage" alt="" />
           </template>
         </el-table-column>
-        <el-table-column align='center'
-                         prop="title"
-                         label="标题">
+        <el-table-column align="center" prop="title" label="标题">
         </el-table-column>
-        <el-table-column align='center'
-                         label="跳转链接">
+        <el-table-column align="center" label="跳转链接">
           <template slot-scope="scope">
-            <overflow-text :text="scope.row.linkUrl + '/' + scope.row.id"></overflow-text>
+            <overflow-text
+              :text="scope.row.linkUrl + '/' + scope.row.id"
+            ></overflow-text>
             <!-- {{ scope.row.linkUrl + '/' + scope.row.id }} -->
           </template>
         </el-table-column>
-        <el-table-column align='center'
-                         prop="remark"
-                         label="是否使用">
+        <el-table-column align="center" prop="remark" label="是否使用">
           <template slot-scope="scope">
-            {{ scope.row.status == 1 ? '是' : '否' }}
+            {{ scope.row.status == 1 ? "是" : "否" }}
           </template>
         </el-table-column>
-        <el-table-column align='center'
-                         prop="memo"
-                         label="版本号">
+        <el-table-column align="center" prop="memo" label="版本号">
           <template slot-scope="scope">
-            {{ scope.row.memo ? scope.row.memo : '--' }}
+            {{ scope.row.memo ? scope.row.memo : "--" }}
           </template>
         </el-table-column>
-        <el-table-column align='center'
-                         prop="order"
-                         label="排序">
+        <el-table-column align="center" prop="order" label="排序">
         </el-table-column>
-        <el-table-column align="center"
-                         prop="remark"
-                         label="适用分部">
+        <el-table-column align="center" prop="remark" label="适用分部">
           <template slot-scope="scope">
             <overflow-text :text="scope.row.organNameList"></overflow-text>
           </template>
         </el-table-column>
-        <el-table-column align='center'
-                         label="操作">
+        <el-table-column align="center" label="操作">
           <template slot-scope="scope">
-            <el-button @click="openTeaching('update', scope.row)"
-                       v-if="!scope.row.memo || permission('banner/copyrightbtn')"
-                       type="text">修改</el-button>
-            <div style="display: inline-block"
-                 v-if="!scope.row.memo || permission('banner/copyrightbtn')">
-              <el-button v-if="scope.row.status == 1"
-                         @click="onStop(scope.row, 0)"
-                         type="text">停用</el-button>
-              <el-button v-else
-                         @click="onStop(scope.row, 1)"
-                         type="text">启用</el-button>
+            <div>
+              <auth auths="news/update" style="margin-left: 10px">
+                <el-button
+                  @click="openTeaching('update', scope.row)"
+                  v-if="!scope.row.memo || permission('banner/copyrightbtn')"
+                  type="text"
+                  >修改</el-button
+                >
+                <div
+                  style="display: inline-block"
+                  v-if="!scope.row.memo || permission('banner/copyrightbtn')"
+                >
+                  <el-button
+                    v-if="scope.row.status == 1"
+                    @click="onStop(scope.row, 0)"
+                    type="text"
+                    >停用</el-button
+                  >
+                  <el-button v-else @click="onStop(scope.row, 1)" type="text"
+                    >启用</el-button
+                  >
+                </div>
+              </auth>
+              <auth auths="news/del" style="margin-left: 10px">
+                <el-button
+                  @click="onDel(scope.row)"
+                  v-if="!scope.row.memo || permission('banner/copyrightbtn')"
+                  type="text"
+                  >删除</el-button
+                >
+              </auth>
             </div>
-
-            <el-button @click="onDel(scope.row)"
-                       v-if="!scope.row.memo || permission('banner/copyrightbtn')"
-                       type="text">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
       <pagination
         saveKey="contentBanner"
-      sync :total.sync="pageInfo.total"
-                  :page.sync="pageInfo.page"
-                  :limit.sync="pageInfo.limit"
-                  :page-sizes="pageInfo.page_size"
-                  @pagination="getList" />
+        sync
+        :total.sync="pageInfo.total"
+        :page.sync="pageInfo.page"
+        :limit.sync="pageInfo.limit"
+        :page-sizes="pageInfo.page_size"
+        @pagination="getList"
+      />
     </div>
   </div>
 </template>
 <script>
-import { newsList, newsUpdate, newsDel } from '@/api/contentManager'
-import pagination from '@/components/Pagination/index'
-import { permission } from '@/utils/directivePage'
+import { newsList, newsUpdate, newsDel } from "@/api/contentManager";
+import pagination from "@/components/Pagination/index";
+import { permission } from "@/utils/directivePage";
 export default {
-  name: 'banner',
+  name: "banner",
   components: {
-    pagination
+    pagination,
   },
-  data () {
+  data() {
     return {
       searchForm: {
-        organIdList: []
+        organIdList: [],
       },
       tableList: [],
       teacherId: this.$route.query.teacherId,
@@ -128,84 +142,88 @@ export default {
         limit: 10, // 限制显示条数
         page: 1, // 当前页
         total: 1, // 总条数
-        page_size: [10, 20, 40, 50] // 选择限制显示条数
-      }
-    }
+        page_size: [10, 20, 40, 50], // 选择限制显示条数
+      },
+    };
   },
-  mounted () {
+  mounted() {
     this.$store.dispatch("setBranchs");
-    this.getList()
+    this.getList();
   },
   methods: {
     search() {
-      this.pageInfo.page = 1
-      this.getList()
+      this.pageInfo.page = 1;
+      this.getList();
     },
-    permission (str) {
-      return permission(str)
+    permission(str) {
+      return permission(str);
     },
-    getList () {
+    getList() {
       let params = {
-        clientName: 'manage',
-        organIdList: this.searchForm.organIdList ? this.searchForm.organIdList.join(',') : null,
+        clientName: "manage",
+        organIdList: this.searchForm.organIdList
+          ? this.searchForm.organIdList.join(",")
+          : null,
         rows: this.pageInfo.limit,
         page: this.pageInfo.page,
-        type: 3
-      }
-      newsList(params).then(res => {
+        type: 3,
+      };
+      newsList(params).then((res) => {
         if (res.code == 200) {
-          this.tableList = res.data.rows
-          this.pageInfo.total = res.data.total
+          this.tableList = res.data.rows;
+          this.pageInfo.total = res.data.total;
         }
-      })
+      });
     },
-    openTeaching (type, rows) {
-      let params = {}
-      if (type == 'update') {
-        params.id = rows.id
+    openTeaching(type, rows) {
+      let params = {};
+      if (type == "update") {
+        params.id = rows.id;
       }
-      params.type = 3
-      params.pageType = type
+      params.type = 3;
+      params.pageType = type;
       this.$router.push({
-        path: '/contentManager/contentOperation',
-        query: params
-      })
+        path: "/contentManager/contentOperation",
+        query: params,
+      });
     },
-    onDel (row) { // 删除
-      this.$confirm('确定是否删除?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        newsDel({ id: row.id }).then(res => {
-
-          if (res.code == 200) {
-            this.$message.success('删除成功')
-            this.getList()
-          } else {
-            this.$message.error(res.msg)
-          }
+    onDel(row) {
+      // 删除
+      this.$confirm("确定是否删除?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          newsDel({ id: row.id }).then((res) => {
+            if (res.code == 200) {
+              this.$message.success("删除成功");
+              this.getList();
+            } else {
+              this.$message.error(res.msg);
+            }
+          });
         })
-      }).catch(() => { })
-
+        .catch(() => {});
     },
-    onStop (row, status) { // 停止
+    onStop(row, status) {
+      // 停止
       // newsUpdate
-      let tempStr = ['停用', '启用']
+      let tempStr = ["停用", "启用"];
       newsUpdate({
         id: row.id,
-        status: status
-      }).then(res => {
+        status: status,
+      }).then((res) => {
         if (res.code == 200) {
-          this.$message.success(tempStr[status] + '成功')
-          this.getList()
+          this.$message.success(tempStr[status] + "成功");
+          this.getList();
         } else {
-          this.$message.error(res.msg)
+          this.$message.error(res.msg);
         }
-      })
-    }
-  }
-}
+      });
+    },
+  },
+};
 </script>
 <style lang="scss" scoped>
 .bannerImg {

+ 129 - 121
src/views/contentManager/components/flashPage.vue

@@ -2,25 +2,32 @@
   <div>
     <!-- 搜索标题 -->
     <auth auths="news/add">
-       <div @click="openTeaching('create')" class="newBand">新建</div>
+      <div @click="openTeaching('create')" class="newBand">新建</div>
     </auth>
     <!-- 搜索标题 -->
-    <save-form :inline="true"
-             class="searchForm"
-             saveKey="contentFlashPage"
-             @submit="search"
-             :model="searchForm">
+    <save-form
+      :inline="true"
+      class="searchForm"
+      saveKey="contentFlashPage"
+      @submit="search"
+      :model="searchForm"
+    >
       <el-form-item prop="organIdList">
-        <select-all class="multiple" clearable
-                   filterable
-                   collapse-tags
-                   multiple
-                   v-model.trim="searchForm.organIdList"
-                   placeholder="请选择分部">
-          <el-option v-for="(item,index) in selects.branchs"
-                    :key="index"
-                    :label="item.name"
-                    :value="item.id"></el-option>
+        <select-all
+          class="multiple"
+          clearable
+          filterable
+          collapse-tags
+          multiple
+          v-model.trim="searchForm.organIdList"
+          placeholder="请选择分部"
+        >
+          <el-option
+            v-for="(item, index) in selects.branchs"
+            :key="index"
+            :label="item.name"
+            :value="item.id"
+          ></el-option>
         </select-all>
       </el-form-item>
       <el-form-item>
@@ -29,90 +36,87 @@
     </save-form>
     <!-- 列表 -->
     <div class="tableWrap">
-      <el-table :data='tableList'
-                :header-cell-style="{background:'#EDEEF0',color:'#444'}">
-        <el-table-column align='center'
-                         label="轮播图">
+      <el-table
+        :data="tableList"
+        :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+      >
+        <el-table-column align="center" label="轮播图">
           <template slot-scope="scope">
-            <img class="bannerImg"
-                 :src="scope.row.coverImage"
-                 alt="">
+            <img class="bannerImg" :src="scope.row.coverImage" alt="" />
           </template>
         </el-table-column>
-        <el-table-column align='center'
-                         prop="title"
-                         label="标题">
+        <el-table-column align="center" prop="title" label="标题">
         </el-table-column>
-        <el-table-column align='center'
-                         label="跳转链接">
+        <el-table-column align="center" label="跳转链接">
           <template slot-scope="scope">
             <overflow-text :text="scope.row.linkUrl"></overflow-text>
             <!-- {{ scope.row.linkUrl }} -->
           </template>
         </el-table-column>
-        <el-table-column align='center'
-                         prop="remark"
-                         label="是否使用">
+        <el-table-column align="center" prop="remark" label="是否使用">
           <template slot-scope="scope">
-            {{ scope.row.status == 1 ? '是' : '否' }}
+            {{ scope.row.status == 1 ? "是" : "否" }}
           </template>
         </el-table-column>
-        <el-table-column align='center'
-                         prop="order"
-                         label="排序">
+        <el-table-column align="center" prop="order" label="排序">
         </el-table-column>
-        <el-table-column align="center"
-                         prop="remark"
-                         label="适用分部">
+        <el-table-column align="center" prop="remark" label="适用分部">
           <template slot-scope="scope">
             <overflow-text :text="scope.row.organNameList"></overflow-text>
           </template>
         </el-table-column>
-        <el-table-column align='center'
-                         label="操作">
+        <el-table-column align="center" label="操作">
           <template slot-scope="scope">
- <auth auths="news/update" style="margin-left: 10px">
-              <el-button @click="openTeaching('update', scope.row)" type="text"
-                >修改</el-button
-              >
-              <el-button
-                v-if="scope.row.status == 1"
-                @click="onStop(scope.row, 0)"
-                type="text"
-                >停用</el-button
-              >
-              <el-button v-else @click="onStop(scope.row, 1)" type="text"
-                >启用</el-button
-              >
-            </auth>
-            <auth auths="news/del" style="margin-left: 10px">
-              <el-button @click="onDel(scope.row)" type="text">删除</el-button>
-            </auth>
+            <div>
+              <auth auths="news/update" style="margin-left: 10px">
+                <el-button
+                  @click="openTeaching('update', scope.row)"
+                  type="text"
+                  >修改</el-button
+                >
+                <el-button
+                  v-if="scope.row.status == 1"
+                  @click="onStop(scope.row, 0)"
+                  type="text"
+                  >停用</el-button
+                >
+                <el-button v-else @click="onStop(scope.row, 1)" type="text"
+                  >启用</el-button
+                >
+              </auth>
+              <auth auths="news/del" style="margin-left: 10px">
+                <el-button @click="onDel(scope.row)" type="text"
+                  >删除</el-button
+                >
+              </auth>
+            </div>
           </template>
         </el-table-column>
       </el-table>
       <pagination
-      saveKey="contentFlashPage"
-      sync :total.sync="pageInfo.total"
-                  :page.sync="pageInfo.page"
-                  :limit.sync="pageInfo.limit"
-                  :page-sizes="pageInfo.page_size"
-                  @pagination="getList" />
+        saveKey="contentFlashPage"
+        sync
+        :total.sync="pageInfo.total"
+        :page.sync="pageInfo.page"
+        :limit.sync="pageInfo.limit"
+        :page-sizes="pageInfo.page_size"
+        @pagination="getList"
+      />
     </div>
   </div>
 </template>
 <script>
-import { newsList, newsUpdate, newsDel } from '@/api/contentManager'
-import pagination from '@/components/Pagination/index'
+import { newsList, newsUpdate, newsDel } from "@/api/contentManager";
+import pagination from "@/components/Pagination/index";
 export default {
-  name: 'banner',
+  name: "banner",
   components: {
-    pagination
+    pagination,
   },
-  data () {
+  data() {
     return {
       searchForm: {
-        organIdList: []
+        organIdList: [],
       },
       tableList: [],
       teacherId: this.$route.query.teacherId,
@@ -121,81 +125,85 @@ export default {
         limit: 10, // 限制显示条数
         page: 1, // 当前页
         total: 1, // 总条数
-        page_size: [10, 20, 40, 50] // 选择限制显示条数
-      }
-    }
+        page_size: [10, 20, 40, 50], // 选择限制显示条数
+      },
+    };
   },
-  mounted () {
+  mounted() {
     this.$store.dispatch("setBranchs");
-    this.getList()
+    this.getList();
   },
   methods: {
     search() {
-      this.pageInfo.page = 1
-      this.getList()
+      this.pageInfo.page = 1;
+      this.getList();
     },
-    getList () {
+    getList() {
       let params = {
-        clientName: 'manage',
-        organIdList: this.searchForm.organIdList ? this.searchForm.organIdList.join(',') : null,
+        clientName: "manage",
+        organIdList: this.searchForm.organIdList
+          ? this.searchForm.organIdList.join(",")
+          : null,
         rows: this.pageInfo.limit,
         page: this.pageInfo.page,
-        type: 5
-      }
-      newsList(params).then(res => {
+        type: 5,
+      };
+      newsList(params).then((res) => {
         if (res.code == 200) {
-          this.tableList = res.data.rows
-          this.pageInfo.total = res.data.total
+          this.tableList = res.data.rows;
+          this.pageInfo.total = res.data.total;
         }
-      })
+      });
     },
-    openTeaching (type, rows) {
-      let params = {}
-      if (type == 'update') {
-        params.id = rows.id
+    openTeaching(type, rows) {
+      let params = {};
+      if (type == "update") {
+        params.id = rows.id;
       }
-      params.type = 5
-      params.pageType = type
+      params.type = 5;
+      params.pageType = type;
       this.$router.push({
-        path: '/contentManager/contentOperation',
-        query: params
-      })
+        path: "/contentManager/contentOperation",
+        query: params,
+      });
     },
-    onDel (row) { // 删除
-      this.$confirm('确定是否删除?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        newsDel({ id: row.id }).then(res => {
-
-          if (res.code == 200) {
-            this.$message.success('删除成功')
-            this.getList()
-          } else {
-            this.$message.error(res.msg)
-          }
+    onDel(row) {
+      // 删除
+      this.$confirm("确定是否删除?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          newsDel({ id: row.id }).then((res) => {
+            if (res.code == 200) {
+              this.$message.success("删除成功");
+              this.getList();
+            } else {
+              this.$message.error(res.msg);
+            }
+          });
         })
-      }).catch(() => { })
-
+        .catch(() => {});
     },
-    onStop (row, status) { // 停止
+    onStop(row, status) {
+      // 停止
       // newsUpdate
-      let tempStr = ['停用', '启用']
+      let tempStr = ["停用", "启用"];
       newsUpdate({
         id: row.id,
-        status: status
-      }).then(res => {
+        status: status,
+      }).then((res) => {
         if (res.code == 200) {
-          this.$message.success(tempStr[status] + '成功')
-          this.getList()
+          this.$message.success(tempStr[status] + "成功");
+          this.getList();
         } else {
-          this.$message.error(res.msg)
+          this.$message.error(res.msg);
         }
-      })
-    }
-  }
-}
+      });
+    },
+  },
+};
 </script>
 <style lang="scss" scoped>
 .bannerImg {

+ 156 - 135
src/views/contentManager/components/information.vue

@@ -2,32 +2,46 @@
   <div>
     <!-- 搜索标题 -->
     <auth auths="news/add">
-       <div @click="openTeaching('create')" class="newBand">新建</div>
+      <div @click="openTeaching('create')" class="newBand">新建</div>
     </auth>
     <!-- 搜索标题 -->
-    <save-form :inline="true"
-             class="searchForm"
-             :saveKey="'contentInformation'"
-             @submit="search"
-             :model="searchForm">
+    <save-form
+      :inline="true"
+      class="searchForm"
+      :saveKey="'contentInformation'"
+      @submit="search"
+      :model="searchForm"
+    >
       <el-form-item prop="organIdList">
-        <select-all class="multiple" clearable
-                   filterable
-                   collapse-tags
-                   multiple
-                   v-model.trim="searchForm.organIdList"
-                   placeholder="请选择分部">
-          <el-option v-for="(item,index) in selects.branchs"
-                    :key="index"
-                    :label="item.name"
-                    :value="item.id"></el-option>
+        <select-all
+          class="multiple"
+          clearable
+          filterable
+          collapse-tags
+          multiple
+          v-model.trim="searchForm.organIdList"
+          placeholder="请选择分部"
+        >
+          <el-option
+            v-for="(item, index) in selects.branchs"
+            :key="index"
+            :label="item.name"
+            :value="item.id"
+          ></el-option>
         </select-all>
       </el-form-item>
       <el-form-item prop="subType">
-        <el-select v-model="searchForm.subType"
-                   clearable
-                   placeholder="请选择资讯类别">
-          <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id"></el-option>
+        <el-select
+          v-model="searchForm.subType"
+          clearable
+          placeholder="请选择资讯类别"
+        >
+          <el-option
+            v-for="item in typeList"
+            :key="item.id"
+            :label="item.name"
+            :value="item.id"
+          ></el-option>
         </el-select>
       </el-form-item>
       <el-form-item>
@@ -36,94 +50,96 @@
     </save-form>
     <!-- 列表 -->
     <div class="tableWrap">
-      <el-table :data='tableList'
-                :header-cell-style="{background:'#EDEEF0',color:'#444'}">
-        <el-table-column align='center'
-                         label="轮播图">
+      <el-table
+        :data="tableList"
+        :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+      >
+        <el-table-column align="center" label="轮播图">
           <template slot-scope="scope">
-            <img class="bannerImg"
-                 :src="scope.row.coverImage"
-                 alt="">
+            <img class="bannerImg" :src="scope.row.coverImage" alt="" />
           </template>
         </el-table-column>
-        <el-table-column align='center'
-                         prop="title"
-                         label="标题">
+        <el-table-column align="center" prop="title" label="标题">
         </el-table-column>
-        <el-table-column align='center'
-                         label="跳转链接">
+        <el-table-column align="center" label="跳转链接">
           <template slot-scope="scope">
-            <overflow-text :text="scope.row.linkUrl + '/' + scope.row.id"></overflow-text>
+            <overflow-text
+              :text="scope.row.linkUrl + '/' + scope.row.id"
+            ></overflow-text>
             <!-- {{ scope.row.linkUrl + '/' + scope.row.id }} -->
           </template>
         </el-table-column>
-        <el-table-column align='center'
-                         prop="subType"
-                         label="资讯类别">
+        <el-table-column align="center" prop="subType" label="资讯类别">
           <template slot-scope="scope">
             {{ formatSubType(scope.row.subType) }}
           </template>
         </el-table-column>
-        <el-table-column align='center'
-                         prop="remark"
-                         label="是否使用">
+        <el-table-column align="center" prop="remark" label="是否使用">
           <template slot-scope="scope">
-            {{ scope.row.status == 1 ? '是' : '否' }}
+            {{ scope.row.status == 1 ? "是" : "否" }}
           </template>
         </el-table-column>
-        <el-table-column align='center'
-                         prop="order"
-                         label="排序">
+        <el-table-column align="center" prop="order" label="排序">
         </el-table-column>
-        <el-table-column align="center"
-                         prop="remark"
-                         label="适用分部">
+        <el-table-column align="center" prop="remark" label="适用分部">
           <template slot-scope="scope">
             <overflow-text :text="scope.row.organNameList"></overflow-text>
           </template>
         </el-table-column>
-        <el-table-column align='center'
-                         label="操作">
+        <el-table-column align="center" label="操作">
           <template slot-scope="scope">
-  <auth auths="news/update" style="margin-left: 10px">
-              <el-button @click="openTeaching('update', scope.row)" type="text"
-                >修改</el-button
-              >
-              <el-button
-                v-if="scope.row.status == 1"
-                @click="onStop(scope.row, 0)"
-                type="text"
-                >停用</el-button
-              >
-              <el-button v-else @click="onStop(scope.row, 1)" type="text"
-                >启用</el-button
-              >
-            </auth>
-            <auth auths="news/del" style="margin-left: 10px">
-              <el-button @click="onDel(scope.row)" type="text">删除</el-button>
-            </auth>
+            <div>
+              <auth auths="news/update" style="margin-left: 10px">
+                <el-button
+                  @click="openTeaching('update', scope.row)"
+                  type="text"
+                  >修改</el-button
+                >
+                <el-button
+                  v-if="scope.row.status == 1"
+                  @click="onStop(scope.row, 0)"
+                  type="text"
+                  >停用</el-button
+                >
+                <el-button v-else @click="onStop(scope.row, 1)" type="text"
+                  >启用</el-button
+                >
+              </auth>
+              <auth auths="news/del" style="margin-left: 10px">
+                <el-button @click="onDel(scope.row)" type="text"
+                  >删除</el-button
+                >
+              </auth>
+            </div>
           </template>
         </el-table-column>
       </el-table>
       <pagination
-      :saveKey="'contentInformation'"
-      sync :total.sync="pageInfo.total"
-                  :page.sync="pageInfo.page"
-                  :limit.sync="pageInfo.limit"
-                  :page-sizes="pageInfo.page_size"
-                  @pagination="getList" />
+        :saveKey="'contentInformation'"
+        sync
+        :total.sync="pageInfo.total"
+        :page.sync="pageInfo.page"
+        :limit.sync="pageInfo.limit"
+        :page-sizes="pageInfo.page_size"
+        @pagination="getList"
+      />
     </div>
   </div>
 </template>
 <script>
-import { newsList, newsUpdate, newsDel, newsTypeList } from '@/api/contentManager'
-import pagination from '@/components/Pagination/index'
+import {
+  newsList,
+  newsUpdate,
+  newsDel,
+  newsTypeList,
+} from "@/api/contentManager";
+import pagination from "@/components/Pagination/index";
 export default {
-  name: 'information',
+  name: "information",
   components: {
-    pagination
+    pagination,
   },
-  data () {
+  data() {
     return {
       searchForm: {
         organIdList: [],
@@ -136,96 +152,101 @@ export default {
         limit: 10, // 限制显示条数
         page: 1, // 当前页
         total: 1, // 总条数
-        page_size: [10, 20, 40, 50] // 选择限制显示条数
+        page_size: [10, 20, 40, 50], // 选择限制显示条数
       },
       typeList: [], // 子分类
-    }
+    };
   },
-  async mounted () {
-    await newsTypeList({ parentId: 2 }).then(res => {
-      if(res.code == 200) {
-        this.typeList = res.data
+  async mounted() {
+    await newsTypeList({ parentId: 2 }).then((res) => {
+      if (res.code == 200) {
+        this.typeList = res.data;
       }
-    })
+    });
     this.$store.dispatch("setBranchs");
-    this.getList()
+    this.getList();
   },
   methods: {
     search() {
-      this.pageInfo.page = 1
-      this.getList()
+      this.pageInfo.page = 1;
+      this.getList();
     },
-    getList () {
+    getList() {
       let params = {
-        clientName: 'manage',
-        organIdList: this.searchForm.organIdList ? this.searchForm.organIdList.join(',') : null,
+        clientName: "manage",
+        organIdList: this.searchForm.organIdList
+          ? this.searchForm.organIdList.join(",")
+          : null,
         subType: this.searchForm.subType,
         rows: this.pageInfo.limit,
         page: this.pageInfo.page,
-        type: 2
-      }
-      newsList(params).then(res => {
+        type: 2,
+      };
+      newsList(params).then((res) => {
         if (res.code == 200) {
-          this.tableList = res.data.rows
-          this.pageInfo.total = res.data.total
+          this.tableList = res.data.rows;
+          this.pageInfo.total = res.data.total;
         }
-      })
+      });
     },
-    openTeaching (type, rows) {
-      let params = {}
-      if (type == 'update') {
-        params.id = rows.id
+    openTeaching(type, rows) {
+      let params = {};
+      if (type == "update") {
+        params.id = rows.id;
       }
-      params.type = 2
-      params.pageType = type
+      params.type = 2;
+      params.pageType = type;
       this.$router.push({
-        path: '/contentManager/contentOperation',
-        query: params
-      })
+        path: "/contentManager/contentOperation",
+        query: params,
+      });
     },
-    onDel (row) { // 删除
-      this.$confirm('确定是否删除?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        newsDel({ id: row.id }).then(res => {
-          if (res.code == 200) {
-            this.$message.success('删除成功')
-            this.getList()
-          } else {
-            this.$message.error(res.msg)
-          }
+    onDel(row) {
+      // 删除
+      this.$confirm("确定是否删除?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          newsDel({ id: row.id }).then((res) => {
+            if (res.code == 200) {
+              this.$message.success("删除成功");
+              this.getList();
+            } else {
+              this.$message.error(res.msg);
+            }
+          });
         })
-      }).catch(() => { })
-
+        .catch(() => {});
     },
-    onStop (row, status) { // 停止
+    onStop(row, status) {
+      // 停止
       // newsUpdate
-      let tempStr = ['停用', '启用']
+      let tempStr = ["停用", "启用"];
       newsUpdate({
         id: row.id,
-        status: status
-      }).then(res => {
+        status: status,
+      }).then((res) => {
         if (res.code == 200) {
-          this.$message.success(tempStr[status] + '成功')
-          this.getList()
+          this.$message.success(tempStr[status] + "成功");
+          this.getList();
         } else {
-          this.$message.error(res.msg)
+          this.$message.error(res.msg);
         }
-      })
+      });
     },
     formatSubType(val) {
-      let tempName = null
-      this.typeList.forEach(item => {
-        if(item.id == val) {
-          tempName = item.name
+      let tempName = null;
+      this.typeList.forEach((item) => {
+        if (item.id == val) {
+          tempName = item.name;
         }
-      })
-      return tempName
+      });
+      return tempName;
     },
-  }
-}
+  },
+};
 </script>
 <style lang="scss" scoped>
 .bannerImg {

+ 191 - 153
src/views/contentManager/components/knowledge.vue

@@ -1,33 +1,47 @@
 <template>
   <div>
     <!-- 搜索标题 -->
-     <auth auths="news/add">
-       <div @click="openTeaching('create')" class="newBand">新建</div>
+    <auth auths="news/add">
+      <div @click="openTeaching('create')" class="newBand">新建</div>
     </auth>
     <!-- 搜索标题 -->
-    <save-form :inline="true"
-             class="searchForm"
-             saveKey="contentKnowledge"
-             @submit="search"
-             :model="searchForm">
+    <save-form
+      :inline="true"
+      class="searchForm"
+      saveKey="contentKnowledge"
+      @submit="search"
+      :model="searchForm"
+    >
       <el-form-item prop="organIdList">
-        <select-all class="multiple" clearable
-                   filterable
-                   collapse-tags
-                   multiple
-                   v-model.trim="searchForm.organIdList"
-                   placeholder="请选择分部">
-          <el-option v-for="(item,index) in selects.branchs"
-                    :key="index"
-                    :label="item.name"
-                    :value="item.id"></el-option>
+        <select-all
+          class="multiple"
+          clearable
+          filterable
+          collapse-tags
+          multiple
+          v-model.trim="searchForm.organIdList"
+          placeholder="请选择分部"
+        >
+          <el-option
+            v-for="(item, index) in selects.branchs"
+            :key="index"
+            :label="item.name"
+            :value="item.id"
+          ></el-option>
         </select-all>
       </el-form-item>
       <el-form-item prop="subType">
-        <el-select v-model="searchForm.subType"
-                   clearable
-                   placeholder="请选择知识类别">
-          <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id"></el-option>
+        <el-select
+          v-model="searchForm.subType"
+          clearable
+          placeholder="请选择知识类别"
+        >
+          <el-option
+            v-for="item in typeList"
+            :key="item.id"
+            :label="item.name"
+            :value="item.id"
+          ></el-option>
           <!-- <el-option label="演奏小技巧"
                      :value="1"></el-option>
           <el-option label="乐理基础"
@@ -39,120 +53,141 @@
         </el-select>
       </el-form-item>
       <el-form-item prop="subjectId">
-          <el-select v-model="searchForm.subjectId" clearable filterable placeholder="请选择声部">
-            <el-option v-for="item in selects.subjects" :value="item.id" :label="item.name" :key="item.id"></el-option>
-          </el-select>
-        </el-form-item>
+        <el-select
+          v-model="searchForm.subjectId"
+          clearable
+          filterable
+          placeholder="请选择声部"
+        >
+          <el-option
+            v-for="item in selects.subjects"
+            :value="item.id"
+            :label="item.name"
+            :key="item.id"
+          ></el-option>
+        </el-select>
+      </el-form-item>
       <el-form-item>
         <el-button native-type="submit" type="danger">搜索</el-button>
       </el-form-item>
     </save-form>
     <!-- 列表 -->
     <div class="tableWrap">
-      <el-table :data='tableList'
-                :header-cell-style="{background:'#EDEEF0',color:'#444'}">
-        <el-table-column align='center'
-                         label="轮播图">
+      <el-table
+        :data="tableList"
+        :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
+      >
+        <el-table-column align="center" label="轮播图">
           <template slot-scope="scope">
-            <img class="bannerImg"
-                 :src="scope.row.coverImage"
-                 alt="">
+            <img class="bannerImg" :src="scope.row.coverImage" alt="" />
           </template>
         </el-table-column>
-        <el-table-column align='center'
-                         prop="title"
-                         label="标题">
+        <el-table-column align="center" prop="title" label="标题">
         </el-table-column>
-        <el-table-column align='center'
-                         label="跳转链接">
+        <el-table-column align="center" label="跳转链接">
           <template slot-scope="scope">
-            <overflow-text width="100%" :text="scope.row.linkUrl + '/' + scope.row.id"></overflow-text>
+            <overflow-text
+              width="100%"
+              :text="scope.row.linkUrl + '/' + scope.row.id"
+            ></overflow-text>
             <!-- {{ scope.row.linkUrl + '/' + scope.row.id }} -->
           </template>
         </el-table-column>
-        <el-table-column align='center'
-                         prop="remark"
-                         label="是否使用">
+        <el-table-column align="center" prop="remark" label="是否使用">
           <template slot-scope="scope">
-            {{ scope.row.status == 1 ? '是' : '否' }}
+            {{ scope.row.status == 1 ? "是" : "否" }}
           </template>
         </el-table-column>
-        <el-table-column align='center'
-                         prop="createTime"
-                         label="创建时间">
+        <el-table-column align="center" prop="createTime" label="创建时间">
           <template slot-scope="scope">
-            {{ scope.row.createTime ? scope.row.createTime.split(' ')[0] : '--' }}
+            {{
+              scope.row.createTime ? scope.row.createTime.split(" ")[0] : "--"
+            }}
           </template>
         </el-table-column>
-        <el-table-column align='center'
-                         prop="subType"
-                         label="知识类别">
+        <el-table-column align="center" prop="subType" label="知识类别">
           <template slot-scope="scope">
             {{ formatSubType(scope.row.subType) }}
           </template>
         </el-table-column>
-        <el-table-column align='center'
-                         prop="subjectName"
-                         label="所属声部">
+        <el-table-column align="center" prop="subjectName" label="所属声部">
           <template slot-scope="scope">
             {{ scope.row.subjectName }}
           </template>
         </el-table-column>
-        <el-table-column align='center'
-                         prop="order"
-                         label="排序">
+        <el-table-column align="center" prop="order" label="排序">
         </el-table-column>
-        <el-table-column align="center"
-                         prop="remark"
-                         label="适用分部">
+        <el-table-column align="center" prop="remark" label="适用分部">
           <template slot-scope="scope">
             <overflow-text :text="scope.row.organNameList"></overflow-text>
           </template>
         </el-table-column>
-        <el-table-column align='center'
-                         label="操作">
+        <el-table-column align="center" label="操作">
           <template slot-scope="scope">
-            <el-button @click="openTeaching('update', scope.row)"
-                       v-if="!scope.row.memo || permission('banner/copyrightbtn')"
-                       type="text">修改</el-button>
-            <div style="display: inline-block"
-                 v-if="!scope.row.memo || permission('banner/copyrightbtn')">
-              <el-button v-if="scope.row.status == 1"
-                         @click="onStop(scope.row, 0)"
-                         type="text">停用</el-button>
-              <el-button v-else
-                         @click="onStop(scope.row, 1)"
-                         type="text">启用</el-button>
+            <div>
+              <auth auths="news/update" style="margin-left: 10px">
+                <el-button
+                  @click="openTeaching('update', scope.row)"
+                  v-if="!scope.row.memo || permission('banner/copyrightbtn')"
+                  type="text"
+                  >修改</el-button
+                >
+                <div
+                  style="display: inline-block"
+                  v-if="!scope.row.memo || permission('banner/copyrightbtn')"
+                >
+                  <el-button
+                    v-if="scope.row.status == 1"
+                    @click="onStop(scope.row, 0)"
+                    type="text"
+                    >停用</el-button
+                  >
+                  <el-button v-else @click="onStop(scope.row, 1)" type="text"
+                    >启用</el-button
+                  >
+                </div>
+              </auth>
+              <auth auths="news/del" style="margin-left: 10px">
+                <el-button
+                  @click="onDel(scope.row)"
+                  v-if="!scope.row.memo || permission('banner/copyrightbtn')"
+                  type="text"
+                  >删除</el-button
+                >
+              </auth>
             </div>
-
-            <el-button @click="onDel(scope.row)"
-                       v-if="!scope.row.memo || permission('banner/copyrightbtn')"
-                       type="text">删除</el-button>
           </template>
         </el-table-column>
       </el-table>
       <pagination
-       saveKey="contentKnowledge"
-      sync :total.sync="pageInfo.total"
-                  :page.sync="pageInfo.page"
-                  :limit.sync="pageInfo.limit"
-                  :page-sizes="pageInfo.page_size"
-                  @pagination="getList" />
+        saveKey="contentKnowledge"
+        sync
+        :total.sync="pageInfo.total"
+        :page.sync="pageInfo.page"
+        :limit.sync="pageInfo.limit"
+        :page-sizes="pageInfo.page_size"
+        @pagination="getList"
+      />
     </div>
   </div>
 </template>
 <script>
-import { newsList, newsUpdate, newsDel, newsTypeList } from '@/api/contentManager'
-import pagination from '@/components/Pagination/index'
-import store from '@/store'
-import cleanDeep from 'clean-deep'
-import { permission } from '@/utils/directivePage'
+import {
+  newsList,
+  newsUpdate,
+  newsDel,
+  newsTypeList,
+} from "@/api/contentManager";
+import pagination from "@/components/Pagination/index";
+import store from "@/store";
+import cleanDeep from "clean-deep";
+import { permission } from "@/utils/directivePage";
 export default {
-  name: 'knowledge',
+  name: "knowledge",
   components: {
-    pagination
+    pagination,
   },
-  data () {
+  data() {
     return {
       searchForm: {
         organIdList: [],
@@ -166,100 +201,104 @@ export default {
         limit: 10, // 限制显示条数
         page: 1, // 当前页
         total: 1, // 总条数
-        page_size: [10, 20, 40, 50] // 选择限制显示条数
+        page_size: [10, 20, 40, 50], // 选择限制显示条数
       },
       typeList: [], // 子分类
-    }
+    };
   },
-  async mounted () {
-    this.$store.dispatch('setSubjects')
-    await newsTypeList({ parentId: 7 }).then(res => {
-      if(res.code == 200) {
-        this.typeList = res.data
+  async mounted() {
+    this.$store.dispatch("setSubjects");
+    await newsTypeList({ parentId: 7 }).then((res) => {
+      if (res.code == 200) {
+        this.typeList = res.data;
       }
-    })
+    });
     this.$store.dispatch("setBranchs");
-    this.getList()
+    this.getList();
   },
   methods: {
     search() {
-      this.pageInfo.page = 1
-      this.getList()
+      this.pageInfo.page = 1;
+      this.getList();
     },
-    permission (str) {
-      return permission(str)
+    permission(str) {
+      return permission(str);
     },
-    getList () {
+    getList() {
       let params = {
-        clientName: 'manage',
-        organIdList: this.searchForm.organIdList ? this.searchForm.organIdList.join(',') : null,
+        clientName: "manage",
+        organIdList: this.searchForm.organIdList
+          ? this.searchForm.organIdList.join(",")
+          : null,
         subType: this.searchForm.subType,
         subjectId: this.searchForm.subjectId,
         rows: this.pageInfo.limit,
         page: this.pageInfo.page,
-        type: 7
-      }
-      newsList(cleanDeep(params)).then(res => {
+        type: 7,
+      };
+      newsList(cleanDeep(params)).then((res) => {
         if (res.code == 200) {
-          this.tableList = res.data.rows
-          this.pageInfo.total = res.data.total
+          this.tableList = res.data.rows;
+          this.pageInfo.total = res.data.total;
         }
-      })
+      });
     },
-    openTeaching (type, rows) {
-      let params = {}
-      if (type == 'update') {
-        params.id = rows.id
+    openTeaching(type, rows) {
+      let params = {};
+      if (type == "update") {
+        params.id = rows.id;
       }
-      params.type = 7
-      params.pageType = type
+      params.type = 7;
+      params.pageType = type;
       this.$router.push({
-        path: '/contentManager/contentOperation',
-        query: params
-      })
+        path: "/contentManager/contentOperation",
+        query: params,
+      });
     },
-    onDel (row) { // 删除
-      this.$confirm('确定是否删除?', '提示', {
-        confirmButtonText: '确定',
-        cancelButtonText: '取消',
-        type: 'warning'
-      }).then(() => {
-        newsDel({ id: row.id }).then(res => {
-
-          if (res.code == 200) {
-            this.$message.success('删除成功')
-            this.getList()
-          } else {
-            this.$message.error(res.msg)
-          }
+    onDel(row) {
+      // 删除
+      this.$confirm("确定是否删除?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          newsDel({ id: row.id }).then((res) => {
+            if (res.code == 200) {
+              this.$message.success("删除成功");
+              this.getList();
+            } else {
+              this.$message.error(res.msg);
+            }
+          });
         })
-      }).catch(() => { })
-
+        .catch(() => {});
     },
-    onStop (row, status) { // 停止
+    onStop(row, status) {
+      // 停止
       // newsUpdate
-      let tempStr = ['停用', '启用']
+      let tempStr = ["停用", "启用"];
       newsUpdate({
         id: row.id,
-        status: status
-      }).then(res => {
+        status: status,
+      }).then((res) => {
         if (res.code == 200) {
-          this.$message.success(tempStr[status] + '成功')
-          this.getList()
+          this.$message.success(tempStr[status] + "成功");
+          this.getList();
         } else {
-          this.$message.error(res.msg)
+          this.$message.error(res.msg);
         }
-      })
+      });
     },
 
     formatSubType(val) {
-      let tempName = null
-      this.typeList.forEach(item => {
-        if(item.id == val) {
-          tempName = item.name
+      let tempName = null;
+      this.typeList.forEach((item) => {
+        if (item.id == val) {
+          tempName = item.name;
         }
-      })
-      return tempName
+      });
+      return tempName;
     },
   },
   filters: {
@@ -270,11 +309,10 @@ export default {
     //     3: '乐器保养',
     //     4: '乐曲演奏展示'
     //   }
-
     //   return template[val]
     // }
-  }
-}
+  },
+};
 </script>
 <style lang="scss" scoped>
 .bannerImg {

+ 23 - 17
src/views/contentManager/components/training.vue

@@ -75,23 +75,29 @@
         </el-table-column>
         <el-table-column align="center" label="操作">
           <template slot-scope="scope">
-            <auth auths="news/update" style="margin-left: 10px">
-              <el-button @click="openTeaching('update', scope.row)" type="text"
-                >修改</el-button
-              >
-              <el-button
-                v-if="scope.row.status == 1"
-                @click="onStop(scope.row, 0)"
-                type="text"
-                >停用</el-button
-              >
-              <el-button v-else @click="onStop(scope.row, 1)" type="text"
-                >启用</el-button
-              >
-            </auth>
-            <auth auths="news/del" style="margin-left: 10px">
-              <el-button @click="onDel(scope.row)" type="text">删除</el-button>
-            </auth>
+              <div>
+              <auth auths="news/update" style="margin-left: 10px">
+                <el-button
+                  @click="openTeaching('update', scope.row)"
+                  type="text"
+                  >修改</el-button
+                >
+                <el-button
+                  v-if="scope.row.status == 1"
+                  @click="onStop(scope.row, 0)"
+                  type="text"
+                  >停用</el-button
+                >
+                <el-button v-else @click="onStop(scope.row, 1)" type="text"
+                  >启用</el-button
+                >
+              </auth>
+              <auth auths="news/del" style="margin-left: 10px">
+                <el-button @click="onDel(scope.row)" type="text"
+                  >删除</el-button
+                >
+              </auth>
+            </div>
           </template>
         </el-table-column>
       </el-table>