Browse Source

Merge branch 'master' into 03/08netWorkReset

lex-xin 4 years ago
parent
commit
72112a3ab4

File diff suppressed because it is too large
+ 0 - 0
dist/index.html


+ 1 - 1
dist/static/css/chunk-43be6c96.c201d6f6.css → dist/static/css/chunk-18bd2700.9face53c.css

@@ -1 +1 @@
-.process[data-v-f049a426]{padding:10px;max-height:600px;overflow-y:auto}.dialog-footer[data-v-7a44cd83]{margin-top:20px;display:block;text-align:right}.select[data-v-4407b8ca]{font-size:14px}.btnList[data-v-4407b8ca]{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:start;-ms-flex-pack:start;justify-content:flex-start;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.btnList div[data-v-4407b8ca]{margin-right:15px}
+.process[data-v-f049a426]{padding:10px;max-height:600px;overflow-y:auto}.dialog-footer[data-v-7a44cd83]{margin-top:20px;display:block;text-align:right}.select[data-v-a9e5c25c]{font-size:14px}.btnList[data-v-a9e5c25c]{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:start;-ms-flex-pack:start;justify-content:flex-start;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.btnList div[data-v-a9e5c25c]{margin-right:15px}

File diff suppressed because it is too large
+ 0 - 0
dist/static/css/chunk-2c188afe.29778161.css


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.162d117f.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/app.6d617d3b.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-18bd2700.b99b2b4b.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-2c188afe.006d7f06.js


File diff suppressed because it is too large
+ 0 - 0
dist/static/js/chunk-43be6c96.00c4d50a.js


+ 61 - 79
src/components/remote-search/index.vue

@@ -1,45 +1,26 @@
 <template>
   <div>
-    <el-select v-if='!multiple'
-      v-bind="{...$attrs}"
+    <!--    @focus="onFocus" -->
+    <el-select
+      v-bind="{ ...$attrs }"
       :value="value"
       filterable
       remote
       reserve-keyword
+      collapse-tags
       clearable
       :multiple="multiple"
       :placeholder="placeholder"
       :remote-method="remoteMethod"
+      ref="select"
       :loading="loading"
+      @focus="onFocus"
       @change="changeValue"
       :style="{ width: this.selectWidt + 'px!important' }"
     >
       <el-option
-        v-for="(item, index) in options"
-        :key="index"
-        :label="item.userName"
-        :value="item.userId"
-      >
-      </el-option>
-    </el-select>
-
-
-        <el-select v-else
-      v-bind="{...$attrs}"
-      :value="value"
-      filterable
-      remote
-      reserve-keyword
-      clearable
-      :multiple="multiple"
-      :placeholder="placeholder"
-      :loading="loading"
-      @change="changeValue"
-      :style="{ width: this.selectWidt + 'px!important' }"
-    >
-      <el-option
-        v-for="(item, index) in options"
-        :key="index"
+        v-for="item in options"
+        :key="item.userId"
         :label="item.userName"
         :value="item.userId"
       >
@@ -72,75 +53,77 @@ export default {
   async mounted() {
     // this.getList();
     // console.log(this.value)
-    this.getOptions(this.value|| '' )
-    // console.log(this.multiple)
-
-
+    this.getOptions(this.value || "");
   },
   methods: {
     async getList() {
       await this.$store.dispatch(this.commit);
       this.list = this.selects[this.enumer[this.commit]];
-      const data = {}
+      const data = {};
       for (const item of this.list) {
-        data[item.userId] = item
+        data[item.userId] = item;
       }
-      this.listById = data
-    if(this.multiple){
-       this.options =this.list
-    }else{
-       this.options =
+      this.listById = data;
+
+      this.options =
         this.list.length <= this.constant
           ? this.list
           : slice(this.list, 0, this.constant);
-    }
-     
-
-            //  console.log(this.options)
+      this.options = uniqBy(this.options, "userId");
+      //  console.log(this.options)
     },
     remoteMethod(query) {
       // throttle
-      if(!this.multiple){
-         throttle(this.getOptions, 800)(query);
-      }
-     
+
+      throttle(this.getOptions, 800)(query);
     },
     async getOptions(query) {
-
-      if (query&&query.length>0) {
+      if (query && query.length > 0) {
         let flag;
-        this.options = this.list.filter((item) => {
-          flag =
-            item.userName.toLowerCase().indexOf(query.toString().toLowerCase()) > -1 ||
-            item.userId == query;
-          if (this.multiple) {
-            console.log(this.value,this.value.includes(item.userId),item.userId)
-            return flag || this.value.includes(item.userId);
-          } else {
-            // console.log(query,this.value)
-            return flag || item.userId == this.value;
-          }
-        });
-  
+        this.options = uniqBy(
+          this.list.filter((item) => {
+            flag =
+              item.userName
+                .toLowerCase()
+                .indexOf(query.toString().toLowerCase()) > -1 ||
+              item.userId == query;
+            if (this.multiple) {
+              return flag || this.value.includes(item.userId);
+            } else {
+              // console.log(query,this.value)
+              return flag || item.userId == this.value;
+            }
+          }),
+          "userId"
+        );
       } else {
-          try{
-             await this.getList()
-          const optionids = this.options.map(item => item.userId)
-          const valueItem = this.listById[this.value]
+        try {
+          await this.getList();
+          const optionids = this.options.map((item) => item.userId);
+
+          const valueItem = this.listById[this.value];
           if (!optionids.includes(this.value) && valueItem) {
-            this.options.push(valueItem)
-            this.options = uniqBy(this.options, 'userId')
-          }
-          }catch(e){
-            // console.log(e)
+            this.options.push(valueItem);
+            this.options = uniqBy(this.options, "userId");
           }
-
+        } catch (e) {
+          // console.log(e)
+        }
       }
     },
     changeValue(val) {
       this.isFirst = false;
       this.$emit("input", val);
       this.$emit("change", val);
+      // console.log('来了',this.$refs.select.query)
+      this.$nextTick((res) => {
+        this.getOptions(this.$refs.select.query);
+      });
+    },
+    onFocus() {
+      this.$nextTick((res) => {
+        this.getOptions(this.$refs.select.query);
+      });
     },
   },
   computed: {
@@ -156,17 +139,16 @@ export default {
       immediate: true,
       deep: true,
       handler(val) {
-
-        if (this.multiple) {
-          if (val?.length > 0 && this.isFirst) {
-
-           this.getOptions()
+        // && this.isFirst
+        if (this.multiple && this.isFirst) {
+          if (val?.length > 0) {
+            this.getOptions();
           }
         } else {
           if (val && this.isFirst) {
-            this.getOptions()
-          }else{
-             this.getOptions(val)
+            this.getOptions();
+          } else {
+            this.getOptions(val);
           }
         }
       },

+ 1 - 1
src/components/tab-router/index.vue

@@ -42,7 +42,7 @@ export default {
     getAllPanel() {
       const data = {};
       const routes = [];
-      this.panels = this.$slots.default.filter((item) => {
+      this.panels = (this.$slots.default || []).filter((item) => {
         const isPanel = item.tag && item.tag.indexOf("ElTabPane") > -1;
         if (isPanel && item.child) {
           data[item.child.name] = item.child;

+ 24 - 4
src/permission.js

@@ -38,6 +38,21 @@ router.onError((error) => {
   }
 });
 
+function getFirstMenu(routes) {
+  let firstMenu = null
+  routes.forEach(item => {
+    if(!firstMenu && item.children.length > 0) {
+      item.children.forEach(child => {
+        if(!firstMenu && !child.hidden) {
+          firstMenu = item.path + '/' + child.path
+        }
+      })
+    }
+  })
+  return firstMenu
+}
+
+
 router.beforeEach(async (to, from, next) => {
   // from.query = to.query
   // start progress bar
@@ -45,13 +60,13 @@ router.beforeEach(async (to, from, next) => {
   // set page title
   // document.title = getPageTitle(to.meta.title)
   document.title = getPageTitle()
-
   // determine whether the user has logged in
   const hasToken = getToken()
   if (hasToken) {
     if (to.path === '/login') {
       // 如果有tonken直接跳转到首页
-      next({ path: '/' })
+        next({ path: '/' })
+
       NProgress.done()
     } else {
       const hasGetUserInfo = store.getters.name
@@ -61,7 +76,7 @@ router.beforeEach(async (to, from, next) => {
 
         // 动态添加可访问的路由
         // router.addRoutes(accessRoutes)
-        next()
+          next()
       } else {
         try {
           // 异步获取用户信息
@@ -72,7 +87,12 @@ router.beforeEach(async (to, from, next) => {
           router.addRoutes(accessRoutes)
           // 确保addroutes完整的hack方法
           // 设置replace:true,这样导航就不会留下历史记录。
-          next({ ...to, replace: true })
+          let firstMenu = getFirstMenu(accessRoutes)
+          if(to.path == '/main/main') {
+            next({ path: firstMenu, replace: true })
+          } else {
+            next({ ...to, replace: true })
+          }
         } catch (error) {
           // remove token and go to login page to re-login
           await store.dispatch('user/resetToken')

+ 3 - 1
src/router/notKeepAliveList.js

@@ -93,5 +93,7 @@ export default [
   '/business/teamDraft',
   '/business/teamAudit',
   '/business/auditFailed',
-  // '/business/feeAudit', 
+  '/business/resetTeaming', // 进行中修改
+  '/business/teacherOperationUpdate',
+  // '/business/feeAudit',
 ]

+ 2 - 1
src/views/teamBuild/components/teamBaseInfo.vue

@@ -517,7 +517,8 @@ export default {
       if (this.$route.query.id) {
         // 单团修改
         this.teamid = this.$route.query.id;
-        let sotrage = JSON.parse(sessionStorage.getItem(`${this.$route.query.id}base`)) ;
+        let sotrage = JSON.parse(sessionStorage.getItem(`${this.$route.query.id}base`));
+        console.log(sotrage)
         if (!sotrage?.section) {
 
           getTeamBaseInfo({ musicGroupId: this.teamid }).then((res) => {

+ 19 - 24
src/views/teamDetail/teamList.vue

@@ -316,10 +316,7 @@
                 <!-- 审核中 编辑 -->
                 <el-button
                   type="text"
-                  v-if="
-                    scope.row.status == 'AUDIT' &&
-                    permission('/teamAudit')
-                  "
+                  v-if="scope.row.status == 'AUDIT' && permission('/teamAudit')"
                   @click="lookTeamDetail(scope.row)"
                   >审核</el-button
                 >
@@ -330,22 +327,19 @@
                 <!-- 编辑中 编辑 -->
                 <el-button
                   type="text"
-                  v-if="
-                    scope.row.status == 'DRAFT' &&
-                    permission('/teamDraft')
-                  "
+                  v-if="scope.row.status == 'DRAFT' && permission('/teamDraft')"
                   @click="lookTeamDetail(scope.row)"
                   >编辑</el-button
                 >
                 <el-button
                   type="text"
                   v-if="
-                    ((scope.row.status == 'DRAFT' ||
-                    scope.row.status == 'AUDIT' ||
-                    scope.row.status == 'FEE_AUDIT' ||
-                    scope.row.status == 'APPLY' ||
+                    (scope.row.status == 'DRAFT' ||
+                      scope.row.status == 'AUDIT' ||
+                      scope.row.status == 'FEE_AUDIT' ||
+                      scope.row.status == 'APPLY' ||
                       scope.row.status == 'PAY') &&
-                      permission('musicGroup/cancelMusicGroup'))
+                    permission('musicGroup/cancelMusicGroup')
                   "
                   @click="stopTeam(scope.row)"
                   >取消乐团</el-button
@@ -576,12 +570,16 @@ export default {
     },
     resetTeaming(row) {
       // 修改进行中的乐团
-      let search = JSON.stringify(this.topForm);
-      let rules = JSON.stringify(this.rules);
-      this.$router.push({
+      console.log(row.id)
+      sessionStorage.removeItem(`${row.id}base`);
+      sessionStorage.removeItem(`${row.id}sound`);
+      this.$nextTick(res=>{
+           this.$router.push({
         path: "/business/resetTeaming",
         query: { type: "resetTeam", id: row.id },
       });
+      })
+
     },
     setSearchList(obj) {
       //
@@ -689,16 +687,14 @@ export default {
     },
     lookTeamCourse(row) {
       // 查看课表
-      let search = JSON.stringify(this.topForm);
-      let rules = JSON.stringify(this.rules);
       this.$router.push({
         path: "/business/teamDetailCourse",
         query: { id: row.id, name: row.name },
       });
     },
     lookTeamDetail(row) {
-      let search = JSON.stringify(this.topForm);
-      let rules = JSON.stringify(this.rules);
+      sessionStorage.removeItem(`${row.id}base`);
+      sessionStorage.removeItem(`${row.id}sound`);
       switch (row.status) {
         case "DRAFT": {
           // 编辑中
@@ -849,8 +845,7 @@ export default {
       }
     },
     gotodetailList(row) {
-      let search = JSON.stringify(this.topForm);
-      let rules = JSON.stringify(this.rules);
+
       this.$router.push({
         path: "/business/teamDetailedList",
         query: { id: row.id },
@@ -858,8 +853,8 @@ export default {
     },
     //
     lookTeamInfo(row) {
-      let search = JSON.stringify(this.topForm);
-      let rules = JSON.stringify(this.rules);
+         sessionStorage.removeItem(`${row.id}base`);
+      sessionStorage.removeItem(`${row.id}sound`);
       this.$router.push({
         path: "/business/teamLookBase",
         query: { type: "look", id: row.id, name: row.name },

+ 1 - 1
vue.config.js

@@ -22,7 +22,7 @@ const name = defaultSettings.title || '管乐迷后台管理系统' // page titl
 // let target = 'http://192.168.3.38:8000' //邹璇
 // let target = 'http://192.168.3.57:8000' //勇哥
 let target = 'http://47.114.176.40:8000' // 测试服
-// let target = 'http://192.168.3.134' // 乔
+// let target = 'http://dev.dayaedu.com/' // 乔
 // All configuration item explanations can be find in https://cli.vuejs.org/config/
 module.exports = {
   /**

Some files were not shown because too many files changed in this diff