Bläddra i källkod

首页修改完毕

1
mo 4 år sedan
förälder
incheckning
84c4591ca5

+ 3 - 3
src/components/Auth/index.vue

@@ -71,8 +71,8 @@
 <style scoped lang="less">
   .auth {
     display: inline-block;
-    & + .auth {
-      margin-left: 10px;
-    }
+    // & + .auth {
+    //   margin-left: 10px;
+    // }
   }
 </style>

+ 10 - 3
src/layout/components/AppMain.vue

@@ -3,10 +3,17 @@
     <!--   -->
     <transition name="fade-transform" mode="out-in">
       <div>
-        <keep-alive >
+        <router-view v-slot="{ Component }">
+          <keep-alive>
+            <component v-if="!keep" :is="Component" />
+          </keep-alive>
+          <component v-if="keep" :is="Component" />
+        </router-view>
+
+        <!-- <keep-alive exclude="nocatch">
           <router-view :key="key" v-if="needKeep" />
         </keep-alive>
-        <router-view v-if="!needKeep" :key="key" />
+        <router-view v-if="!needKeep" :key="key" /> -->
       </div>
     </transition>
   </section>
@@ -27,7 +34,7 @@ export default {
       return this.$store.state.tagsView.cachedViews;
     },
     keep() {
-      return this.$route.meta.noCache;
+      return this.$route.meta.noCache*1;   // 0是缓存 1是不缓存
     },
   },
 };

+ 1 - 1
src/router/notKeepAliveList.js

@@ -26,7 +26,7 @@ export default [
   '/business/studentDetail', // 学员管理详情
   // '/operateManager/HumanResources'
   '/business/attendanceList',
-  '/business/returnVisitList',
+  '/userManager/studentManager/returnVisitList', // 回访记录
   '/business/levelManager',
   '/matchManager/matchManager',
   '/luckyDraw/lotteryManager', // 抽奖活动管理

+ 2 - 19
src/store/modules/permission.js

@@ -15,13 +15,11 @@ function generateAsyncRouter (asyncRoutes, data) {
   }
 
   data.forEach((item) => {
-
     item.component = asyncRoutes[item.component]
     if (item.children && item.children.length > 0) {
       generateAsyncRouter(asyncRoutes, item.children)
     }
   })
-  console.log(data)
   return data
 }
 
@@ -59,6 +57,7 @@ function recursionRouter (arr) {
       }
       let obj = {};
       obj.component = arr[i].component;
+      obj.name = arr[i].component;
       // if (item.type != '1' && item.component) {
       //   if (!item.path.startsWith('/') && item.component != 'Layout') {
       //     obj.names = item.name
@@ -72,24 +71,9 @@ function recursionRouter (arr) {
       if (arr[i].sysMenus && arr[i].sysMenus.length > 0) {
         obj.children = recursionRouter(arr[i].sysMenus);
       }
+
       newArr.push(obj)
     }
-    // newArr = arr.map(item => {
-    //   let obj = {};
-    //   obj.component = item.component;
-    //   // if (item.type != '1' && item.component) {
-    //   //   if (!item.path.startsWith('/') && item.component != 'Layout') {
-    //   //     obj.names = item.name
-    //   //   }
-    //   // }
-    //   item.hid == 0 ? obj.hidden = false : obj.hidden = true
-    //   obj.path = item.path;
-    //   obj.meta = { 'title': item.name, 'icon': item.icon }
-    //   if (item.sysMenus && item.sysMenus.length > 0) {
-    //     obj.children = recursionRouter(item.sysMenus);
-    //   }
-    //   return obj
-    // })
     return newArr
   }
 }
@@ -111,7 +95,6 @@ const actions = {
       getSilder().then(res => {
         if (res.code == 200) {
           let newData = recursionRouter(res.data);
-          console.log(newData)
           recursionPermission(res.data)
           let accessedRoutes
 

+ 5 - 0
src/views/courseListManager/index.vue

@@ -3,3 +3,8 @@
      <router-view />
   </div>
 </template>
+<script>
+export default {
+  name:'nocatch'
+}
+</script>

+ 83 - 90
src/views/main/schedule-branch/index.vue

@@ -1,6 +1,12 @@
 <template>
   <div>
-    <save-form inline :model="search" @submit="submit" @reset="reset" saveKey="/main/main/schedule-branch">
+    <save-form
+      inline
+      :model="search"
+      @submit="submit"
+      @reset="reset"
+      saveKey="/main/main/schedule-branch"
+    >
       <el-form-item prop="organIds">
         <el-select
           clearable
@@ -8,87 +14,76 @@
           v-model="search.organId"
           placeholder="请选择分部"
         >
-          <el-option v-for="(item,index) in selects.branchs"
+          <el-option
+            v-for="(item, index) in selects.branchs"
             :key="index"
             :label="item.name"
-            :value="item.id"></el-option>
+            :value="item.id"
+          ></el-option>
         </el-select>
       </el-form-item>
       <el-form-item prop="userId">
-        <remote-search :commit='"setEducations"'  v-model='search.userId' />
+        <remote-search :commit="'setEducations'" v-model="search.userId" />
       </el-form-item>
       <el-form-item prop="month">
         <el-date-picker
           v-model="search.month"
           type="month"
-          placeholder="请选择月份">
+          placeholder="请选择月份"
+        >
         </el-date-picker>
       </el-form-item>
       <el-button native-type="submit" type="primary">搜索</el-button>
       <el-button native-type="reset" type="danger">重置</el-button>
     </save-form>
-    <el-button type="primary" @click="visible = true">添加任务</el-button>
+    <!-- inspection/add -->
+    <auth auths="inspection/add" style="margin-bottom: 20px">
+      <el-button type="primary" @click="visible = true">添加任务</el-button>
+    </auth>
+
     <el-table
       :data="list"
-      style="width: 100%;margin-top: 20px;"
+      style="width: 100%"
       :header-cell-style="{ background: '#EDEEF0', color: '#444' }"
     >
-      <el-table-column
-        label="分部"
-        prop="organName"
-      ></el-table-column>
-      <el-table-column
-        label="工作周期"
-        prop="month"
-      >
-        <span slot-scope="scope">{{$helpers.dayjs(scope.row.month).format('YYYY-MM')}}</span>
+      <el-table-column label="分部" prop="organName"></el-table-column>
+      <el-table-column label="工作周期" prop="month">
+        <span slot-scope="scope">{{
+          $helpers.dayjs(scope.row.month).format("YYYY-MM")
+        }}</span>
       </el-table-column>
-      <el-table-column
-        label="乐团主管"
-        prop="userName"
-      ></el-table-column>
-      <el-table-column
-        label="任务事项数量"
-        prop="itemNum"
-      ></el-table-column>
-      <el-table-column
-        label="任务总次数"
-        prop="times"
-      ></el-table-column>
-      <el-table-column
-        label="操作"
-        prop="操作"
-      >
+      <el-table-column label="乐团主管" prop="userName"></el-table-column>
+      <el-table-column label="任务事项数量" prop="itemNum"></el-table-column>
+      <el-table-column label="任务总次数" prop="times"></el-table-column>
+      <el-table-column label="操作" prop="操作">
         <template slot-scope="scope">
-          <el-button type="text" @click="view(scope.row)">查看</el-button>
-          <el-button type="text" @click="edit(scope.row)">修改任务</el-button>
-          <el-button type="text" @click="remove(scope.row.id)">删除</el-button>
+          <auth auths="inspection/getInfo">
+            <el-button type="text" @click="view(scope.row)">查看</el-button>
+          </auth>
+          <auth auths="inspection/update">
+            <el-button type="text" @click="edit(scope.row)">修改任务</el-button>
+          </auth>
+          <auth auths="inspection/delete">
+            <el-button type="text" @click="remove(scope.row.id)"
+              >删除</el-button
+            >
+          </auth>
         </template>
       </el-table-column>
     </el-table>
-    <pagination sync :total.sync="rules.total"
+    <pagination
+      sync
+      :total.sync="rules.total"
       :page.sync="rules.page"
       save-key="/main/main/schedule-branch"
       :limit.sync="rules.limit"
       :page-sizes="rules.page_size"
       @pagination="FetchList"
     />
-    <el-dialog
-      :visible.sync="visible"
-      title="创建任务"
-      width="800px"
-    >
-      <create
-        v-if="visible"
-        @close="visible = false"
-        @submited="FetchList"
-      />
+    <el-dialog :visible.sync="visible" title="创建任务" width="800px">
+      <create v-if="visible" @close="visible = false" @submited="FetchList" />
     </el-dialog>
-    <el-dialog
-      :visible.sync="editVisible"
-      title="修改任务"
-      width="800px"
-    >
+    <el-dialog :visible.sync="editVisible" title="修改任务" width="800px">
       <create
         v-if="editVisible && detail"
         :id="detail.id"
@@ -96,11 +91,7 @@
         @submited="FetchList"
       />
     </el-dialog>
-    <el-dialog
-      :visible.sync="viewVisible"
-      title="查看任务"
-      width="800px"
-    >
+    <el-dialog :visible.sync="viewVisible" title="查看任务" width="800px">
       <view-detail
         v-if="viewVisible && detail"
         :id="detail.id"
@@ -112,23 +103,23 @@
 </template>
 <script>
 import pagination from "@/components/Pagination/index";
-import { inspectionQueryPage, inspectionDelete } from '@/views/main/api'
-import create from './modals/create'
-import view from './modals/view'
+import { inspectionQueryPage, inspectionDelete } from "@/views/main/api";
+import create from "./modals/create";
+import view from "./modals/view";
 const initSearch = {
   organId: null,
   userId: null,
-  month: '',
-}
+  month: "",
+};
 export default {
   components: {
     create,
-    'view-detail': view,
+    "view-detail": view,
     pagination,
   },
   data() {
     return {
-      search: {...initSearch},
+      search: { ...initSearch },
       list: [],
       visible: false,
       viewVisible: false,
@@ -139,56 +130,58 @@ export default {
         limit: 10, // 限制显示条数
         page: 1, // 当前页
         total: 0, // 总条数
-        page_size: [10, 20, 40, 50] // 选择限制显示条数
+        page_size: [10, 20, 40, 50], // 选择限制显示条数
       },
-    }
+    };
   },
   mounted() {
-    this.FetchList()
-    this.$store.dispatch('setBranchs')
-    this.$store.dispatch('setTeachers')
+    this.FetchList();
+    this.$store.dispatch("setBranchs");
+    this.$store.dispatch("setTeachers");
   },
   methods: {
     submit() {
-      this.FetchList()
+      this.FetchList();
     },
     reset() {
-      this.rules.page = 1
-      this.search = {...initSearch}
-      this.FetchList()
+      this.rules.page = 1;
+      this.search = { ...initSearch };
+      this.FetchList();
     },
     view(row) {
-      this.viewVisible = true
-      this.detail = row
+      this.viewVisible = true;
+      this.detail = row;
     },
     edit(row) {
-      this.editVisible = true
-      this.detail = row
+      this.editVisible = true;
+      this.detail = row;
     },
     async remove(id) {
       try {
-        await this.$confirm('是否确认删除此条数据?', '提示', {
-          type: 'warning'
-        })
+        await this.$confirm("是否确认删除此条数据?", "提示", {
+          type: "warning",
+        });
         await inspectionDelete({
-          id
-        })
-        this.$message.success('删除成功')
-        this.FetchList()
+          id,
+        });
+        this.$message.success("删除成功");
+        this.FetchList();
       } catch (error) {}
     },
     async FetchList() {
       try {
         const res = await inspectionQueryPage({
           ...this.search,
-          month: this.search.month ? this.$helpers.dayjs(this.search.month).format('YYYY-MM') : undefined,
+          month: this.search.month
+            ? this.$helpers.dayjs(this.search.month).format("YYYY-MM")
+            : undefined,
           page: this.rules.page,
           rows: this.rules.limit,
-        })
-        this.list = res.data.rows
-        this.rules.total = res.data.total
+        });
+        this.list = res.data.rows;
+        this.rules.total = res.data.total;
       } catch (error) {}
-    }
-  }
-}
+    },
+  },
+};
 </script>

+ 7 - 5
src/views/main/teamSchedule/index.vue

@@ -1,5 +1,6 @@
 <template>
   <div>
+
     <save-form
       :inline="true"
       :model="searchForm"
@@ -107,15 +108,16 @@
       <el-table-column align="center" prop="studentId" label="操作">
         <template slot-scope="scope">
           <div>
-            <auth v-if="scope.row.item == 'INSPECT'" auths="/main/scheduleDetail">
+            <auth v-if="scope.row.item == 'INSPECT'" auths="/teamSchedule/scheduleDetail">
               <el-button type="text" @click="gotoHander(scope.row)"
                 >安排日程</el-button
               >
             </auth>
-
-            <el-button type="text" v-else @click="gotoHander(scope.row)"
+            <auth v-else  auths="/returnVisitList">
+            <el-button type="text"  @click="gotoHander(scope.row)"
               >回访记录</el-button
             >
+            </auth>
             <auth :auths="['inspectionItem/update']">
               <el-button
                 type="text"
@@ -244,13 +246,13 @@ export default {
         // 学员回访
         // 跳到回访页面 搜索条件 教务老师 时间范围
         this.$router.push({
-          path: "/business/returnVisitList",
+          path: "/userManager/studentManager/returnVisitList",
           query: { teacher: row.userName, timer: [startTime, endTime] },
         });
       } else {
         // 下校巡查
         this.$router.push({
-          path: "scheduleDetail",
+          path: "/main/scheduleDetail",
           query: {
             teacher: row.userId,
             startTime,

+ 1 - 0
src/views/main/teamSchedule/scheduleDetail.vue

@@ -94,6 +94,7 @@ import {
   getWeekDay,
 } from "@/utils/date";
 export default {
+  name:'scheduleDetail',
   components: {
     taskinfo,
     taskList,