Jelajahi Sumber

添加帮助中心

lex-xin 5 tahun lalu
induk
melakukan
3e091804b8

File diff ditekan karena terlalu besar
+ 0 - 0
dist/index.html


+ 0 - 0
dist/static/css/chunk-068081b9.bfab12cd.css → dist/static/css/chunk-068081b9.ca53240b.css


+ 1 - 0
dist/static/css/chunk-1ea7fbf2.5c1a750d.css

@@ -0,0 +1 @@
+.pagination-container[data-v-31cb099a]{background:#fff;padding:32px 16px;width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.pagination-container.hidden[data-v-31cb099a]{display:none}.el-button--primary[data-v-ce7aaa42],.el-button--primary[data-v-ce7aaa42]:active,.el-button--primary[data-v-ce7aaa42]:focus,.el-button--primary[data-v-ce7aaa42]:hover{background:#14928a;border-color:#14928a;color:#fff}[data-v-ce7aaa42] .el-date-editor.el-input,[data-v-ce7aaa42] .el-select{width:100%!important}[data-v-ce7aaa42] .el-table .cell{display:-webkit-box;overflow:hidden;text-overflow:ellipsis;-webkit-line-clamp:3;-webkit-box-orient:vertical}[data-v-ce7aaa42] .el-dialog__body{padding:10px 20px}

+ 0 - 0
dist/static/css/chunk-2eb5c4a8.8ee77068.css → dist/static/css/chunk-2eb5c4a8.0fdd4e14.css


+ 0 - 0
dist/static/css/chunk-787f95c4.fa622574.css → dist/static/css/chunk-787f95c4.1867f5be.css


+ 1 - 1
dist/static/css/chunk-1547e888.5fa1704e.css → dist/static/css/chunk-7e661642.7233ec40.css

@@ -1 +1 @@
-.pagination-container[data-v-31cb099a]{background:#fff;padding:32px 16px;width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.pagination-container.hidden[data-v-31cb099a]{display:none}.el-button--primary[data-v-fa5fd522],.el-button--primary[data-v-fa5fd522]:active,.el-button--primary[data-v-fa5fd522]:focus,.el-button--primary[data-v-fa5fd522]:hover{background:#14928a;border-color:#14928a;color:#fff}[data-v-fa5fd522] .el-date-editor.el-input,[data-v-fa5fd522] .el-select{width:100%!important}
+.pagination-container[data-v-31cb099a]{background:#fff;padding:32px 16px;width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.pagination-container.hidden[data-v-31cb099a]{display:none}.el-button--primary[data-v-a21bd0fa],.el-button--primary[data-v-a21bd0fa]:active,.el-button--primary[data-v-a21bd0fa]:focus,.el-button--primary[data-v-a21bd0fa]:hover{background:#14928a;border-color:#14928a;color:#fff}[data-v-a21bd0fa] .el-date-editor.el-input,[data-v-a21bd0fa] .el-select{width:100%!important}

File diff ditekan karena terlalu besar
+ 0 - 0
dist/static/js/app.2760fa07.js


File diff ditekan karena terlalu besar
+ 0 - 0
dist/static/js/chunk-1547e888.d394f03e.js


File diff ditekan karena terlalu besar
+ 0 - 0
dist/static/js/chunk-1ea7fbf2.a0c8606d.js


File diff ditekan karena terlalu besar
+ 0 - 0
dist/static/js/chunk-5f0549de.2423e8a6.js


File diff ditekan karena terlalu besar
+ 0 - 0
dist/static/js/chunk-5f0549de.43a35807.js


File diff ditekan karena terlalu besar
+ 0 - 0
dist/static/js/chunk-7e661642.a8757fc5.js


File diff ditekan karena terlalu besar
+ 0 - 0
dist/static/js/chunk-a2ed6810.3ba730d9.js


File diff ditekan karena terlalu besar
+ 0 - 0
dist/static/js/chunk-a2ed6810.9e7ba412.js


+ 36 - 0
src/api/appTenant.js

@@ -50,10 +50,46 @@ export function helpCenterCatalogList(data) {
 export function helpCenterCatalogModify(data) {
   return request({
     url: '/api-cms/helpCenterCatalog/modify',
+    method: 'post',
+    data: qs.stringify(data)
+  })
+}
+
+// 帮助中心分类列表 删除
+export function helpCenterCatalogDelete(data) {
+  return request({
+    url: '/api-cms/helpCenterCatalog/delete',
+    method: 'post',
+    data: qs.stringify(data)
+  })
+}
+
+// 帮助中心内容列表
+export function helpCenterContentList(data) {
+  return request({
+    url: '/api-cms/helpCenterContent/list',
     method: 'get',
     params: data
   })
 }
 
+// 帮助中心内容 添加或修改
+export function helpCenterContentModify(data) {
+  return request({
+    url: '/api-cms/helpCenterContent/modify',
+    method: 'post',
+    data: qs.stringify(data)
+  })
+}
+
+// 帮助中心内容 删除
+export function helpCenterContentDelete(data) {
+  return request({
+    url: '/api-cms/helpCenterContent/delete',
+    method: 'post',
+    data: qs.stringify(data)
+  })
+}
+
 
   

+ 3 - 1
src/router/index.js

@@ -259,7 +259,9 @@ export const asyncRoutes = {
   entryActivities:()=>import('@/views/app/entryActivities'),
   // 添加或修改
   entryOperation:()=>import('@/views/app/entryOperation'),
-  // 添加或修改
+  // 帮助分类
   helpCategory:()=>import('@/views/helpCenter/helpCategory'),
+  // 帮助内容
+  helpContent:()=>import('@/views/helpCenter/helpContent'),
 }
 export default router

+ 142 - 123
src/views/helpCenter/helpCategory.vue

@@ -5,24 +5,20 @@
       <div class="squrt"></div>帮助中心分类
     </h2>
     <div class="m-core">
-      <div class="newBand" v-permission="'category/upset'" @click="openTypes('create')">添加</div>
+      <div class="newBand" v-permission="'helpCenterCatalog/modify'" @click="openTypes('create')">添加</div>
       <!-- 列表 -->
       <div class="tableWrap">
-        <el-table :data="tableList" :header-cell-style="{background:'#EDEEF0',color:'#444'}">
-          <el-table-column align="center" prop="id" label="分类编号"></el-table-column>
+        <el-table :data="tableList" 
+          :header-cell-style="{background:'#EDEEF0',color:'#444'}"
+          row-key="id"
+          :tree-props="{children: 'children', hasChildren: 'hasChildren'}">>
+          <el-table-column width="120px" align="center" prop="id" label="分类编号"></el-table-column>
           <el-table-column align="center" prop="text" label="分类名称"></el-table-column>
           <el-table-column align="center" label="操作">
             <template slot-scope="scope">
-              <el-button
-                @click="openTypes('update', scope.row)"
-                v-permission="'category/upset'"
-                type="text"
-              >修改</el-button>
-              <el-button
-                @click="onTypesDelOpeation(scope.row)"
-                v-permission="'category/del'"
-                type="text"
-              >删除</el-button>
+              <el-button v-permission="'helpCenterCatalog/modify'" @click="openTypes('add', scope.row)" type="text">添加</el-button>
+              <el-button v-permission="'helpCenterCatalog/modify'" @click="openTypes('update', scope.row)" type="text">修改</el-button>
+              <el-button v-permission="'helpCenterCatalog/delete'" @click="onTypeDelOpeation(scope.row)" type="text">删除</el-button>
             </template>
           </el-table-column>
         </el-table>
@@ -42,25 +38,13 @@
       width="500px"
     >
       <el-form :model="form" :rules="rules" ref="ruleForm">
-        <el-form-item
-          label="父级分类"
-          :label-width="formLabelWidth">
-          <el-select v-model.trim="form.parentId" clearable filterable>
-             <el-option
-                v-for="item in tableList"
-                :key="item.id"
-                :label="item.text"
-                :value="item.id"
-              ></el-option>
-          </el-select>
-        </el-form-item>
         <el-form-item label="分类名称" prop="text" :label-width="formLabelWidth">
           <el-input v-model.trim="form.text" autocomplete="off"></el-input>
         </el-form-item>
       </el-form>
       <span slot="footer" class="dialog-footer">
         <el-button @click="typeStatus = false">取 消</el-button>
-        <el-button type="primary" @click="onTypesSubmit('ruleForm')">确 定</el-button>
+        <el-button type="primary" @click="onTypeSubmit('ruleForm')">确 定</el-button>
       </span>
     </el-dialog>
   </div>
@@ -68,114 +52,149 @@
 <script>
 import pagination from "@/components/Pagination/index";
 // import store from '@/store'
-import { helpCenterCatalogList } from "@/api/appTenant";
+import {
+  helpCenterCatalogList,
+  helpCenterCatalogModify,
+  helpCenterCatalogDelete
+} from "@/api/appTenant";
 export default {
-    components: { pagination },
-    name: "helpCategory",
-    data() {
-        return {
-        tableList: [],
-        subjectList: [], // 声部列表
-        formActionTitle: "create",
-        formTitle: {
-            create: "添加帮助中心分类",
-            update: "修改帮助中心分类"
-        },
-        typeStatus: false, // 添加教学点
-        formLabelWidth: "120px",
-        form: {
-            text: null, // 作业模块名称
-            parentId: null
-        },
-        rules: {
-            text: [{ required: true, message: "请输入类型名称", trigger: "blur" }],
-            // subjectIds: [{ required: true, message: "请选择声部组合", trigger: "change" }]
-        },
-        pageInfo: {
-            // 分页规则
-            limit: 10, // 限制显示条数
-            page: 1, // 当前页
-            total: 0, // 总条数
-            page_size: [10, 20, 40, 50] // 选择限制显示条数
+  components: { pagination },
+  name: "helpCategory",
+  data() {
+    return {
+      tableList: [],
+      subjectList: [], // 声部列表
+      formActionTitle: "create",
+      formTitle: {
+        create: "添加帮助中心分类",
+        add: "添加帮助中心分类",
+        update: "修改帮助中心分类"
+      },
+      typeStatus: false, // 添加教学点
+      formLabelWidth: "120px",
+      form: {
+        text: null, // 作业模块名称
+        parentId: 0
+      },
+      rules: {
+        text: [{ required: true, message: "请输入类型名称", trigger: "blur" }]
+        // subjectIds: [{ required: true, message: "请选择声部组合", trigger: "change" }]
+      },
+      pageInfo: {
+        // 分页规则
+        limit: 10, // 限制显示条数
+        page: 1, // 当前页
+        total: 0, // 总条数
+        page_size: [10, 20, 40, 50] // 选择限制显示条数
+      }
+    };
+  },
+  mounted() {
+    this.getList();
+  },
+  methods: {
+    onTypeDelOpeation(row) {
+      this.$confirm('您是否删除该分类?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        helpCenterCatalogDelete({ id: row.id }).then(res => {
+          this.messageTips('删除', res)
+        })
+      }).catch(() => {         
+      })
+      
+    },
+    onTypeSubmit(formName) {
+      // 添加数据
+      this.$refs[formName].validate(valid => {
+        if (valid) {
+          if (this.formActionTitle == "create" || this.formActionTitle == "add") {
+            if (this.form.id) {
+              // 判断有没有Id,如果有则删除
+              delete this.form.id;
+            }
+            helpCenterCatalogModify(this.form).then(res => {
+              this.messageTips("添加", res);
+            });
+          } else if (this.formActionTitle == "update") {
+            helpCenterCatalogModify(this.form).then(res => {
+              this.messageTips("修改", res);
+            });
+          }
+        } else {
+          return false;
         }
-        };
+      });
     },
-    mounted() {
+
+    messageTips(title, res) {
+      if (res.code == 200) {
+        this.$message.success(title + "成功");
+        this.typeStatus = false;
         this.getList();
+      } else {
+        this.$message.error(res.msg);
+      }
     },
-    methods: {
-        onTypesDelOpeation(row) {
-        //   categoryUpSetDel({ id: row.id }).then(res => {
-        //     this.messageTips('删除', res)
-        //   })
-        },
-        onTypesSubmit(formName) {
-        // 添加数据
-        this.$refs[formName].validate(valid => {
-            if (valid) {
-            if (this.formActionTitle == "create") {
-                if (this.form.id) {
-                // 判断有没有Id,如果有则删除
-                delete this.form.id;
-                }
-                categoryUpSet(this.form).then(res => {
-                this.messageTips("添加", res);
-                });
-            } else if (this.formActionTitle == "update") {
-                categoryUpSet(this.form).then(res => {
-                this.messageTips("修改", res);
-                });
-            }
-            } else {
-            return false;
-            }
-        });
-        },
-
-        messageTips(title, res) {
+    getList() {
+      // {
+      //   delFlag: 0
+      //   rows: this.pageInfo.limit,
+      //   page: this.pageInfo.page
+      // }
+      helpCenterCatalogList({
+        parentId: 0
+      }).then(res => {
+        let result = res.data;
         if (res.code == 200) {
-            this.$message.success(title + "成功");
-            this.typeStatus = false;
-            this.getList();
-        } else {
-            this.$message.error(res.msg);
+          this.tableList = this.setTableData(result);
+          
         }
-        },
-        getList() {
-            helpCenterCatalogList({
-                delFlag: 0,
-                rows: this.pageInfo.limit,
-                page: this.pageInfo.page
-            }).then(res => {
-                let result = res.data;
-                if (res.code == 200) {
-                    console.log(result)
-                    this.tableList = result;
-                    // this.pageInfo.total = result.total;
-                }
-            });
-        },
-        openTypes(type, row) {
-        this.typeStatus = true;
-        this.formActionTitle = type;
-        // 修改的时候赋值
-        if (type == "update") {
-            this.form = {
-            id: row.id,
-            name: row.name,
-            subjectIds: row.subjectIds
-            };
+      });
+    },
+    setTableData (result) {
+      let list = []
+      list = result.map(res => {
+        let tempList = {}
+        tempList = {
+          id: res.id,
+          text: res.text,
+        }
+        if (res.children && res.children.length > 0) {
+          tempList.children = this.setTableData(res.children)
         }
-        },
-        onFormClose(formName) {
-        // 关闭弹窗重置验证
+        return tempList
+      })
+      return list
+    },
+    openTypes(type, row) {
+      this.typeStatus = true;
+      this.formActionTitle = type;
+      if(type == 'create') {
+        // 添加时,默认添加一级分类
+        this.form.parentId = 0
+      } else if (type == "update") {
+        // 修改的时候赋值
         this.form = {
-            name: null, // 作业模块名称
-            subjectIds: []
+          id: row.id,
+          text: row.text, // 作业模块名称
+          parentId: 0
         };
-        this.$refs[formName].resetFields();
-        }
+      } else if(type == 'add') {
+        this.form.parentId = row.id
+      }
+    },
+    onFormClose(formName) {
+      // 关闭弹窗重置验证
+      this.form = {
+        name: null, // 作业模块名称
+        subjectIds: []
+      };
+      this.$refs[formName].resetFields();
     }
+  }
 };
 </script>
 <style lang="scss" scoped>

+ 275 - 0
src/views/helpCenter/helpContent.vue

@@ -0,0 +1,275 @@
+
+<template>
+  <div class="m-container">
+    <h2>
+      <div class="squrt"></div>帮助中心
+    </h2>
+    <div class="m-core">
+      <div class="newBand" v-permission="'helpCenterContent/modify'" @click="openTypes('create')">添加</div>
+      <!-- 搜索标题 -->
+      <el-form :inline="true" class="searchForm" v-model.trim="searchForm">
+        <el-form-item prop="hasPracticeCourse">
+          <el-cascader
+            :show-all-levels="false"
+            :options="treeList"
+            v-model="searchForm.catalogId"
+            :props="{ checkStrictly: true }"
+            clearable></el-cascader>
+        </el-form-item>
+        <el-form-item>
+          <el-button @click="getList" type="danger">搜索</el-button>
+        </el-form-item>
+      </el-form>
+      <div class="tableWrap">
+        <el-table :data="tableList" 
+          :header-cell-style="{background:'#EDEEF0',color:'#444'}">>
+          <el-table-column width="120px" align="center" prop="id" label="编号"></el-table-column>
+          <el-table-column align="center" prop="title" label="标题"></el-table-column>
+          <el-table-column align="center" prop="content" label="内容"></el-table-column>
+          <el-table-column align="center" prop="catalog.text" label="分类名"></el-table-column>
+          <el-table-column align="center" label="操作">
+            <template slot-scope="scope">
+              <el-button v-permission="'helpCenterContent/modify'" @click="openTypes('update', scope.row)" type="text">修改</el-button>
+              <el-button @click="onTypeDelOpeation(scope.row)"
+                v-permission="'helpCenterContent/delete'" type="text">删除</el-button>
+            </template>
+          </el-table-column>
+        </el-table>
+        <pagination
+          :total="pageInfo.total"
+          :page.sync="pageInfo.page"
+          :limit.sync="pageInfo.limit"
+          :page-sizes="pageInfo.page_size"
+          @pagination="getList"
+        />
+      </div>
+    </div>
+    <el-dialog
+      :title="formTitle[formActionTitle]"
+      :visible.sync="typeStatus"
+      @close="onFormClose('ruleForm')"
+      width="500px"
+    >
+      <el-form :model="form" :rules="rules" ref="ruleForm">
+        <el-form-item label="标题" prop="title" :label-width="formLabelWidth">
+          <el-input v-model.trim="form.title" autocomplete="off" placeholder="请输入标题"></el-input>
+        </el-form-item>
+        <el-form-item label="分类" prop="catalogId" :label-width="formLabelWidth">
+          <el-cascader style="width: 100%;"
+            :show-all-levels="false"
+            :options="treeList"
+            v-model="form.catalogId"
+            :props="{ checkStrictly: true }"
+            clearable></el-cascader>
+        </el-form-item>
+        <el-form-item label="内容" prop="content" :label-width="formLabelWidth">
+          <el-input
+            type="textarea"
+            :rows="3"
+            placeholder="请输入内容"
+            v-model="form.content">
+          </el-input>
+        </el-form-item>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="typeStatus = false">取 消</el-button>
+        <el-button type="primary" @click="onTypeSubmit('ruleForm')">确 定</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+<script>
+import pagination from "@/components/Pagination/index";
+// import store from '@/store'
+import {
+  helpCenterCatalogList,
+  helpCenterContentList,
+  helpCenterContentModify,
+  helpCenterContentDelete
+} from "@/api/appTenant";
+export default {
+  components: { pagination },
+  name: "helpCategory",
+  data() {
+    return {
+      searchForm: {
+        catalogId: null
+      },
+      treeList: [],
+      tableList: [],
+      formActionTitle: "create",
+      formTitle: {
+        create: "添加帮助中心",
+        update: "修改帮助中心"
+      },
+      typeStatus: false, // 添加教学点
+      formLabelWidth: "100px",
+      form: {
+        title: null, // 标题
+        content: null, // 内容
+        catalogId: null, // 分类编号
+      },
+      rules: {
+        title: [{ required: true, message: "请输入标题", trigger: "blur" }],
+        content: [{ required: true, message: "请输入内容", trigger: "blur" }],
+        catalogId: [{ required: true, message: "请输入选择分类", trigger: "blur" }]
+        // subjectIds: [{ required: true, message: "请选择声部组合", trigger: "change" }]
+      },
+      pageInfo: {
+        // 分页规则
+        limit: 10, // 限制显示条数
+        page: 1, // 当前页
+        total: 0, // 总条数
+        page_size: [10, 20, 40, 50] // 选择限制显示条数
+      }
+    };
+  },
+  mounted() {
+    this.getList();
+    this.getTreeList()
+  },
+  methods: {
+    onTypeDelOpeation(row) {
+      this.$confirm('您是否删除该内容?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
+      }).then(() => {
+        helpCenterContentDelete({ id: row.id }).then(res => {
+          this.messageTips('删除', res)
+        })
+      }).catch(() => {         
+      })
+      
+    },
+    onTypeSubmit(formName) {
+      // 添加数据
+      this.$refs[formName].validate(valid => {
+        if (valid) {
+          if (this.formActionTitle == "create") {
+            let params = {
+              title: this.form.title, // 标题
+              content: this.form.content, // 内容
+              catalogId: this.form.catalogId[0], // 分类编号
+            }
+            helpCenterContentModify(params).then(res => {
+              this.messageTips("添加", res);
+            });
+          } else if (this.formActionTitle == "update") {
+            let params = {
+              id: this.form.id,
+              title: this.form.title, // 标题
+              content: this.form.content, // 内容
+              catalogId: this.form.catalogId[0], // 分类编号
+            }
+            helpCenterContentModify(params).then(res => {
+              this.messageTips("修改", res);
+            });
+          }
+        } else {
+          return false;
+        }
+      });
+    },
+
+    messageTips(title, res) {
+      if (res.code == 200) {
+        this.$message.success(title + "成功");
+        this.typeStatus = false;
+        this.getList();
+      } else {
+        this.$message.error(res.msg);
+      }
+    },
+    getList() {
+      let params = {
+        catalogIds: this.searchForm.catalogId ? this.searchForm.catalogId[0] : null
+      }
+      helpCenterContentList(params).then(res => {
+        let result = res.data;
+        if (res.code == 200) {
+          this.tableList = result.rows;
+          this.pageInfo.total = result.total
+        }
+      });
+    },
+    getTreeList() {
+      helpCenterCatalogList({
+        parentId: 0
+      }).then(res => {
+        let result = res.data;
+        if (res.code == 200) {
+          this.treeList = this.setTableData(result);
+        }
+      });
+    },
+    setTableData (result) {
+      let list = []
+      list = result.map(res => {
+        let tempList = {}
+        tempList = {
+          value: res.id,
+          label: res.text,
+        }
+        if (res.children && res.children.length > 0) {
+          tempList.children = this.setTableData(res.children)
+        }
+        return tempList
+      })
+      return list
+    },
+    openTypes(type, row) {
+      this.typeStatus = true;
+      this.formActionTitle = type;
+      if (type == "update") {
+        // 修改的时候赋值
+        console.log(row)
+        this.form = {
+          id: row.id,
+          title: row.title, // 标题
+          content: row.content, // 内容
+          catalogId: [row.catalogId], // 分类编号
+        };
+      }
+    },
+    onFormClose(formName) {
+      // 关闭弹窗重置验证
+      this.form = {
+        name: null, // 作业模块名称
+        subjectIds: []
+      };
+      this.$refs[formName].resetFields();
+    }
+  }
+};
+</script>
+<style lang="scss" scoped>
+.el-button--primary {
+  background: #14928a;
+  border-color: #14928a;
+  color: #fff;
+  &:hover,
+  &:active,
+  &:focus {
+    background: #14928a;
+    border-color: #14928a;
+    color: #fff;
+  }
+}
+/deep/.el-date-editor.el-input {
+  width: 100% !important;
+}
+/deep/.el-select {
+  width: 100% !important;
+}
+/deep/.el-table .cell {
+    display: -webkit-box;
+    overflow: hidden;
+    text-overflow: ellipsis;
+    -webkit-line-clamp: 3;
+    -webkit-box-orient: vertical;
+}
+/deep/.el-dialog__body {
+  padding: 10px 20px;
+}
+</style>

Beberapa file tidak ditampilkan karena terlalu banyak file yang berubah dalam diff ini