许成详 6 anni fa
parent
commit
9fa6be65c2

+ 1
- 1
dist/index.html Vedi File

@@ -1 +1 @@
1
-<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel=stylesheet href=//at.alicdn.com/t/font_775069_dwqa9wy3lkh.css><title>城的空间后台管理系统</title><link href=./static/css/app.2cdb845c0d5d55c26614acbd6458e5d7.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.992319e39e0ff64940a3.js></script><script type=text/javascript src=./static/js/app.7d24608c728c729ad3a2.js></script></body></html>
1
+<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><link rel=stylesheet href=//at.alicdn.com/t/font_775069_dwqa9wy3lkh.css><title>城的空间后台管理系统</title><link href=./static/css/app.ff0e02729d87310579d4fae50c2b29bb.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=./static/js/manifest.3ad1d5771e9b13dbdad2.js></script><script type=text/javascript src=./static/js/vendor.992319e39e0ff64940a3.js></script><script type=text/javascript src=./static/js/app.77e7f2bfbe3f1089b6ab.js></script></body></html>

+ 1
- 0
index.html Vedi File

@@ -4,6 +4,7 @@
4 4
     <meta charset="utf-8">
5 5
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
6 6
     <link rel="stylesheet" href="//at.alicdn.com/t/font_775069_dwqa9wy3lkh.css">
7
+    <link rel="shortcut icon" href="favorite.ico">
7 8
     <title>城的空间后台管理系统</title>
8 9
   </head>
9 10
   <body>

+ 1
- 16
src/pages/login/index.vue Vedi File

@@ -26,21 +26,6 @@
26 26
         <i class="iconfont" :class="{'icon-ic_check_box_outline_blank': !remberAccount, 'icon-md-checkbox-outline': remberAccount, 'active': remberAccount}" @click="triggerRember"></i>
27 27
       </div>
28 28
       <a class="btn" @click="toLogin">登 录</a>
29
-      <!-- <div class="top">
30
-        <i class="iconfont icon-yinchenglogo"></i>
31
-        <span>城的空间 · 登录</span>
32
-      </div>
33
-      <div class="login">
34
-        <input type="text" v-model="account" placeholder="请输入账号">
35
-        <input type="password" v-model="password" placeholder="请输入密码">
36
-        <div>
37
-          <label :class="{'active':remberAccount}" @click="triggerRember">
38
-            <i class="iconfont icon-gouxuan"></i>
39
-            <span onselectstart="return false">记住账号密码</span>
40
-          </label>
41
-        </div>
42
-        <a class="btn" @click="toLogin">登 录</a>
43
-      </div> -->
44 29
     </div>
45 30
   </div>
46 31
 </template>
@@ -100,7 +85,7 @@ export default {
100 85
         document.onkeydown = function (event) {}
101 86
         this.saveToken(res.token)
102 87
         this.$message({
103
-          message: '登成功',
88
+          message: '登成功',
104 89
           type: 'success',
105 90
           duration: 1000
106 91
         })

+ 15
- 3
src/pages/system/cardAndCouponManager/cardManager/edit.vue Vedi File

@@ -110,7 +110,7 @@
110 110
                   :disabled="item.Status !== 1">
111 111
                 </el-option>
112 112
               </el-select>
113
-              <span v-else>{{cardInfo.Targets[0].TargetName}}</span>
113
+              <span v-else style="line-height: 40px;">{{cardInfo.Targets[0].TargetName}}</span>
114 114
             </div>
115 115
           </div>
116 116
         </li>
@@ -279,6 +279,10 @@ export default {
279 279
                   pagesize: 10000
280 280
                 }).then((res) => {
281 281
                   this.cardInfo = aRes.Card
282
+                  if (aRes.Card.StartDate === '0001-01-01T00:00:00Z' || aRes.Card.StartDate === '') {
283
+                    this.cardInfo.StartDate = ''
284
+                    this.cardInfo.EndDate = ''
285
+                  }
282 286
                   if (aRes.Card.VideoUrl) {
283 287
                     this.videoOff = true
284 288
                   }
@@ -287,12 +291,18 @@ export default {
287 291
                       CardImageUrl: ''
288 292
                     }]
289 293
                   }
290
-                  if (aRes.Card.StartDate) {
294
+                  if (aRes.Card.StartDate !== '0001-01-01T00:00:00Z' && aRes.Card.StartDate !== '') {
291 295
                     this.date = [aRes.Card.StartDate, aRes.Card.EndDate]
296
+                  } else {
297
+                    this.date = ['', '']
292 298
                   }
293 299
                 })
294 300
               } else {
295 301
                 this.cardInfo = res.Card
302
+                if (aRes.Card.StartDate === '0001-01-01T00:00:00Z' || aRes.Card.StartDate === '') {
303
+                  this.cardInfo.StartDate = ''
304
+                  this.cardInfo.EndDate = ''
305
+                }
296 306
                 if (res.Card.VideoUrl) {
297 307
                   this.videoOff = true
298 308
                 }
@@ -301,8 +311,10 @@ export default {
301 311
                     CardImageUrl: ''
302 312
                   }]
303 313
                 }
304
-                if (res.Card.StartDate) {
314
+                if (aRes.Card.StartDate !== '0001-01-01T00:00:00Z' && aRes.Card.StartDate !== '') {
305 315
                   this.date = [res.Card.StartDate, res.Card.EndDate]
316
+                } else {
317
+                  this.date = ['', '']
306 318
                 }
307 319
               }
308 320
             })

+ 46
- 12
src/pages/system/cardAndCouponManager/couponManager/edit.vue Vedi File

@@ -117,8 +117,8 @@
117 117
           <span>目标商品:<em>*</em></span>
118 118
           <div class="flex-item">
119 119
             <div>
120
-              <el-radio v-model="couponInfo.IsAll" label="1" :disabled="isEdit">全部商品</el-radio>
121
-              <el-radio v-model="couponInfo.IsAll" label="0" :disabled="isEdit">指定商品</el-radio>
120
+              <el-radio v-model="couponInfo.IsAll" :label="1" :disabled="isEdit">全部商品</el-radio>
121
+              <el-radio v-model="couponInfo.IsAll" :label="0" :disabled="isEdit">指定商品</el-radio>
122 122
             </div>
123 123
           </div>
124 124
         </li>
@@ -160,7 +160,7 @@
160 160
           <div class="flex-item">
161 161
             <div>
162 162
               <div class="addLine flex-h" style="align-item:center;margin-bottom:20px;">
163
-                <el-radio v-model="postData.TimeType" label="1" :disabled="isEdit">固定时间</el-radio>
163
+                <el-radio v-model="TimeType" :label="1" :disabled="isEdit">固定时间</el-radio>
164 164
                 <el-date-picker
165 165
                   value-format="yyyy-MM-ddT00:00:00+08:00"
166 166
                   :disabled="isEdit"
@@ -180,7 +180,7 @@
180 180
                 </el-date-picker>
181 181
               </div>
182 182
               <div class="addLine flex-h" style="align-item:center;">
183
-                <el-radio v-model="postData.TimeType" label="2" :disabled="isEdit">领取后</el-radio>
183
+                <el-radio v-model="TimeType" :label="2" :disabled="isEdit">领取后</el-radio>
184 184
                 <span style="width:100px;">
185 185
                   <el-input
186 186
                     :disabled="isEdit"
@@ -396,13 +396,14 @@ export default {
396 396
         Name: 'ccc',
397 397
         Type: 'xxx'
398 398
       }], // 指定商品数据
399
+      TimeType: 1,
399 400
       couponInfo: {
400 401
         CaseId: '',
401 402
         CouponName: '',
402 403
         CouponType: '',
403 404
         Price: '',
404 405
         TotalCount: '',
405
-        SendType: '',
406
+        SendType: 'system',
406 407
         IsAll: 1,
407 408
         StartDate: '',
408 409
         EndDate: '',
@@ -446,18 +447,28 @@ export default {
446 447
                   page: 1,
447 448
                   pagesize: 10000
448 449
                 }).then((res) => {
449
-                  aRes.coupon.IsAll = String(aRes.coupon.IsAll)
450 450
                   if (aRes.coupon.VideoUrl !== '') {
451 451
                     this.videoOff = true
452 452
                   }
453 453
                   this.couponInfo = aRes.coupon
454
+                  if (aRes.coupon.StartDate === '0001-01-01T00:00:00Z' || aRes.coupon.StartDate === '') {
455
+                    this.couponInfo.StartDate = ''
456
+                  }
457
+                  if (aRes.coupon.EndDate === '0001-01-01T00:00:00Z' || aRes.coupon.EndDate === '') {
458
+                    this.couponInfo.EndDate = ''
459
+                  }
454 460
                 })
455 461
               } else {
456
-                res.coupon.IsAll = String(res.coupon.IsAll)
457 462
                 if (res.coupon.VideoUrl !== '') {
458 463
                   this.videoOff = true
459 464
                 }
460 465
                 this.couponInfo = res.coupon
466
+                if (aRes.coupon.StartDate === '0001-01-01T00:00:00Z' || aRes.coupon.StartDate === '') {
467
+                  this.couponInfo.StartDate = ''
468
+                }
469
+                if (aRes.coupon.EndDate === '0001-01-01T00:00:00Z' || aRes.coupon.EndDate === '') {
470
+                  this.couponInfo.EndDate = ''
471
+                }
461 472
               }
462 473
             })
463 474
           }
@@ -594,6 +605,9 @@ export default {
594 605
     },
595 606
     couponTypeChange () {
596 607
       this.couponInfo.Targets = []
608
+      if (this.couponInfo.CouponType === 'course') {
609
+        this.TimeType = 1
610
+      }
597 611
     },
598 612
     addGoods () { // 添加指定商品
599 613
       if (this.couponInfo.CouponType === 'goods') {
@@ -698,6 +712,27 @@ export default {
698 712
         })
699 713
         return false
700 714
       }
715
+      if (this.couponInfo.CouponType === 'goods') {
716
+        if (this.TimeType === 1 && this.couponInfo.StartDate === '') {
717
+          this.$message({
718
+            type: 'error',
719
+            message: '开始时间不能为空'
720
+          })
721
+          return false
722
+        } else if (this.TimeType === 1 && this.couponInfo.EndDate === '') {
723
+          this.$message({
724
+            type: 'error',
725
+            message: '截止时间不能为空'
726
+          })
727
+          return false
728
+        } else if (this.TimeType === 2 && this.couponInfo.ValidDays === '') {
729
+          this.$message({
730
+            type: 'error',
731
+            message: '领取后天数不能为空'
732
+          })
733
+          return false
734
+        }
735
+      }
701 736
       if (this.couponInfo.Share.CouponShareInfo === '') {
702 737
         this.$message({
703 738
           type: 'error',
@@ -736,12 +771,11 @@ export default {
736 771
           TotalCount: this.couponInfo.TotalCount - 0,
737 772
           ValidDays: this.couponInfo.ValidDays - 0 || 0
738 773
         }).then((res) => {
739
-          this.$alert('操作成功', '提示', {
740
-            confirmButtonText: '确定',
741
-            callback: action => {
742
-              this.$router.push({ name: 'couponList' })
743
-            }
774
+          this.$message({
775
+            type: 'success',
776
+            message: '操作成功'
744 777
           })
778
+          this.$router.push({ name: 'couponList' })
745 779
         })
746 780
       } else {
747 781
         if (!this.checkInfo()) {

+ 10
- 9
src/pages/system/dashboard/index.vue Vedi File

@@ -10,27 +10,27 @@
10 10
         </el-option>
11 11
       </el-select>
12 12
     </div>
13
-    <div class="flex-h" v-for="(item,index) in pageData" v-if="pageData.length" :key="index">
13
+    <div class="flex-h" v-for="(item,index) in pageData" v-if="(pageData || []).length" :key="index">
14 14
       <div class="flex-item" v-for="(subItem,subIndex) in item" :key="subIndex" :class="{'listMargin' : subItem.type === 'dashboardList'}">
15 15
         <div v-if="subItem.type === 'dashboardList'">
16 16
           <dashboardList :data="subItem" :index="subIndex"></dashboardList>
17 17
         </div>
18
-        <div v-if="subItem.type === 'histogram' && typeof(subItem.value) === 'object' && subItem.value.length">
18
+        <div v-if="subItem.type === 'histogram' && typeof(subItem.value) === 'object' && (subItem.value || []).length">
19 19
           <histogram :data="subItem" :index="index + '-' + subIndex"></histogram>
20 20
         </div>
21
-        <div v-if="subItem.type === 'pieDiagram' && typeof(subItem.value) === 'object' && subItem.value.length">
21
+        <div v-if="subItem.type === 'pieDiagram' && typeof(subItem.value) === 'object' && (subItem.value || []).length">
22 22
           <pieDiagram :data="subItem" :index="index + '-' + subIndex"></pieDiagram>
23 23
         </div>
24
-        <div v-if="subItem.type === 'brokenLineGraph' && typeof(subItem.value) === 'object' && subItem.value.length">
24
+        <div v-if="subItem.type === 'brokenLineGraph' && typeof(subItem.value) === 'object' && (subItem.value || []).length">
25 25
           <brokenLineGraph :data="subItem" :index="index + '-' + subIndex"></brokenLineGraph>
26 26
         </div>
27
-        <div v-if="subItem.type === 'ringChart' && typeof(subItem.value) === 'object' && subItem.value.length">
27
+        <div v-if="subItem.type === 'ringChart' && typeof(subItem.value) === 'object' && (subItem.value || []).length">
28 28
           <ringChart :data="subItem" :index="index + '-' + subIndex"></ringChart>
29 29
         </div>
30
-        <div v-if="subItem.type === 'dashboard' && typeof(subItem.value) === 'object' && subItem.value.length">
30
+        <div v-if="subItem.type === 'dashboard' && typeof(subItem.value) === 'object' && (subItem.value || []).length">
31 31
           <dashboard :data="subItem" :index="index + '-' + subIndex"></dashboard>
32 32
         </div>
33
-        <div v-if="subItem.type === 'brokenLineGraphGroup' && typeof(subItem.value) === 'object' && subItem.value.length">
33
+        <div v-if="subItem.type === 'brokenLineGraphGroup' && typeof(subItem.value) === 'object' && (subItem.value || []).length">
34 34
           <brokenLineGraphGroup :data="subItem" :index="index + '-' + subIndex"></brokenLineGraphGroup>
35 35
         </div>
36 36
       </div>
@@ -53,7 +53,7 @@
53 53
         <li v-for="(item,index) in bottomNav" :key="index" :class="{'active': bottomActive === index}" @click="bottomActive = index">{{item}}</li>
54 54
       </ul>
55 55
       <div style="height: 400px;" v-if="bottomData.length">
56
-        <div v-for="(item,index) in bottomData" :key="index" v-if="bottomActive === index && bottomData.length">
56
+        <div v-for="(item,index) in bottomData" :key="index" v-if="bottomActive === index && (bottomData || []).length">
57 57
           <brokenLineGraph :data="item.data" :index="'bottomData-' + index"></brokenLineGraph>
58 58
         </div>
59 59
       </div>
@@ -174,7 +174,7 @@ export default {
174 174
         res = res || []
175 175
         for (var n = 0; n < res.length; n++) {
176 176
           this.pageData.push([])
177
-          for (var a = 0; a < res[n].length; a++) {
177
+          for (var a = 0; a < (res[n] || []).length; a++) {
178 178
             if (res[n][a].type !== 'dashboardList' && res[n][a].value === null) res[n][a].value = []
179 179
             this.pageData[n].push(res[n][a])
180 180
           }
@@ -188,6 +188,7 @@ export default {
188 188
         caseid: id,
189 189
         statype: type
190 190
       }).then((res) => {
191
+        res = res || []
191 192
         for (var n = 0; n < res.length; n++) {
192 193
           this.bottomData.push({
193 194
             type: 'brokenLineGraph',

+ 1
- 1
src/pages/system/dataStatistics/cardCouponUsedList/index.vue Vedi File

@@ -133,7 +133,7 @@
133 133
           label="使用时间"
134 134
           width="140px">
135 135
           <template slot-scope="scope">
136
-            {{toolClass.dateFormat(scope.row.UsedDate)}}
136
+            {{scope.row.UsedDate === '0001-01-01T00:00:00Z' ? '-' : toolClass.dateFormat(scope.row.UsedDate)}}
137 137
           </template>
138 138
         </el-table-column>
139 139
         <el-table-column

+ 6
- 1
src/pages/system/index.vue Vedi File

@@ -79,7 +79,12 @@ export default {
79 79
     siderBar,
80 80
   },
81 81
   created () {
82
-    this.updateSystemInfo().then(() => this.updateBread({ routerData, Url: this.$route.name }))
82
+    this.updateSystemInfo().then(() => {
83
+      this.updateBread({ routerData, Url: this.$route.name })
84
+      if (!this.pageMenu.length) {
85
+        this.$router.push({name: 'noAccessRight'})
86
+      }
87
+    })
83 88
   },
84 89
   methods: {
85 90
     submitPasswd () { // 修改密码

+ 4
- 22
src/pages/system/marketingActivities/activitiesList/index.vue Vedi File

@@ -5,23 +5,6 @@
5 5
         <div class="flex-item flex-h">
6 6
           <el-button size="mini" type="success" @click="redirection('addActivities')">新增活动</el-button>
7 7
         </div>
8
-        <!-- <ul>
9
-          <li>
10
-            <el-select v-model="CaseId" placeholder="请选择">
11
-              <el-option
12
-                key=""
13
-                label="所有案场"
14
-                value="">
15
-              </el-option>
16
-              <el-option
17
-                v-for="item in cases"
18
-                :key="item.CaseId"
19
-                :label="item.CaseName"
20
-                :value="item.CaseId">
21
-              </el-option>
22
-            </el-select>
23
-          </li>
24
-        </ul> -->
25 8
         <el-button
26 9
           size="mini"
27 10
           type="primary" @click="clickList">搜索</el-button>
@@ -139,10 +122,10 @@ export default {
139 122
       return descjson.giftNum
140 123
     },
141 124
     getActivitName (desc) { // 根据活动类型编号,获取活动名称
142
-      if (desc === '1') {
143
-        return '注册类型'
125
+      if (desc === '1' || desc === 'reigste') {
126
+        return '注册'
144 127
       }
145
-      return '未知类型'
128
+      return '未知'
146 129
     },
147 130
     getGiftLabel (desc) {
148 131
       if (desc === '') {
@@ -152,10 +135,9 @@ export default {
152 135
       return descjson.giftLabel
153 136
     },
154 137
     handleSizeChange (val) {
155
-      console.log(`每页 ${val} 条`)
138
+      // console.log(`每页 ${val} 条`)
156 139
     },
157 140
     handleCurrentChange (val) {
158
-      console.log(`当前页: ${val}`)
159 141
       this.$data.postData.page = val
160 142
       this.getList()
161 143
     },

+ 31
- 4
src/pages/system/marketingActivities/addActivities/index.vue Vedi File

@@ -26,6 +26,21 @@
26 26
           </div>
27 27
         </li>
28 28
         <li class="flex-h">
29
+          <span>活动方式:<em>*</em></span>
30
+          <div class="flex-item">
31
+            <div>
32
+              <el-select v-model="activeType" placeholder="请选择">
33
+                <el-option
34
+                  v-for="item in activeTypeList"
35
+                  :key="item.id"
36
+                  :label="item.value"
37
+                  :value="item.id">
38
+                </el-option>
39
+              </el-select>
40
+            </div>
41
+          </div>
42
+        </li>
43
+        <li class="flex-h" v-if="activeType === 'giveCoupon'">
29 44
           <span>赠券卡券:<em>*</em></span>
30 45
           <div class="flex-item">
31 46
             <div>
@@ -40,7 +55,7 @@
40 55
             </div>
41 56
           </div>
42 57
         </li>
43
-        <li class="flex-h">
58
+        <li class="flex-h" v-if="activeType === 'giveCoupon'">
44 59
           <span>赠券数量:<em>*</em></span>
45 60
           <div class="flex-item">
46 61
             <div style="width:50%">
@@ -85,9 +100,14 @@ export default {
85 100
         Order: '', // 排序
86 101
       },
87 102
       regOptions: [{
88
-        regValue: '1',
89
-        label: '注册类型'
103
+        regValue: 'reigste',
104
+        label: '注册'
105
+      }],
106
+      activeTypeList: [{
107
+        value: '送券',
108
+        id: 'giveCoupon'
90 109
       }],
110
+      activeType: '',
91 111
       regValue: '',
92 112
       giftOptions: [], // [{giftValue: '1',label: '饮品通用券'}, {giftValue: '2',label: '课程通用券'}, {giftValue: '3',label: '小小外交官体验券'}]
93 113
       giftValue: '',
@@ -142,6 +162,13 @@ export default {
142 162
         })
143 163
         return false
144 164
       }
165
+      if (this.activeType === '') {
166
+        this.$message({
167
+          type: 'error',
168
+          message: '活动方式不能为空'
169
+        })
170
+        return false
171
+      }
145 172
       if (this.giftValue === '') {
146 173
         this.$message({
147 174
           type: 'error',
@@ -167,7 +194,7 @@ export default {
167 194
       let jsonString = '{"giftValue":"' + this.$data.giftValue + '","giftLabel":"' + this.$data.giftLabel + '","giftNum":"' + this.$data.giftNum + '","desc":"' + this.$data.desc + '"}'
168 195
       this.$ajax(this.$api.marketingActivities.addMarketing.url, {
169 196
         method: this.$api.marketingActivities.addMarketing.method,
170
-        queryData: { activityName: this.$data.activityName, activityType: this.$data.regValue, resourceDesc: jsonString, CaseId: this.defaultCaseId }
197
+        queryData: { activityName: this.$data.activityName, activityType: this.$data.regValue, activeType: this.activeType, resourceDesc: jsonString, CaseId: this.defaultCaseId }
171 198
       }).then(res => {
172 199
         // console.log(res)
173 200
         this.$message({

+ 23
- 0
src/pages/system/noAccessRight/index.vue Vedi File

@@ -0,0 +1,23 @@
1
+<template>
2
+  <div class="mainPage flex-v">
3
+    <h1 class="centerLabel">暂无菜单权限</h1>
4
+  </div>
5
+</template>
6
+
7
+<script>
8
+export default {
9
+  name: '',
10
+  data () {
11
+    return {}
12
+  },
13
+  methods: {}
14
+}
15
+</script>
16
+
17
+<!-- Add "scoped" attribute to limit CSS to this component only -->
18
+<style lang="scss" scoped>
19
+h1{
20
+  font-size: 30px;
21
+  color: #ccc;
22
+}
23
+</style>

+ 8
- 1
src/pages/system/page.js Vedi File

@@ -1,6 +1,8 @@
1 1
 
2 2
 import system from './index' // 系统首页
3 3
 
4
+import noAccessRight from './noAccessRight/index' // 暂无菜单权限
5
+
4 6
 import dashboard from './dashboard/index' // 控制板
5 7
 
6 8
 import systemSet from './systemSet/index' // 系统设置
@@ -121,7 +123,12 @@ export default {
121 123
       path: '/system',
122 124
       name: 'system',
123 125
       component: system,
124
-      children: [{ // 首页控制板
126
+      children: [{ // 暂无菜单权限
127
+        path: 'noAccessRight',
128
+        name: 'noAccessRight',
129
+        component: noAccessRight,
130
+        children: []
131
+      }, { // 首页控制板
125 132
         path: 'dashboard',
126 133
         name: 'dashboard',
127 134
         component: dashboard,

+ 1
- 2
src/router/index.js Vedi File

@@ -9,7 +9,7 @@ const flatten = (parent, data) => {
9 9
   return data.reduce((acc, { path, name, component, MenuName, children }) => {
10 10
     const pth = [parent, path].join('/').replace('//', '/')
11 11
     const item = { path: pth, name, component, MenuName, children: [] }
12
-
12
+    // console.log('children:', children)
13 13
     if (children && children.length) {
14 14
       return acc.concat(item, flatten(pth, children))
15 15
     }
@@ -21,7 +21,6 @@ const flatten = (parent, data) => {
21 21
 // route 数据, 展平二级路由
22 22
 const routes = routerData.reduce((acc, r) => {
23 23
   const { children, ...rest } = r
24
-
25 24
   if (children && children.length) {
26 25
     return acc.concat({ ...rest, children: flatten('', children) })
27 26
   }

+ 3
- 3
src/store/app.js Vedi File

@@ -1,12 +1,12 @@
1 1
 
2 2
 function flatten (parent, data = [], menusRaw = []) {
3 3
   return data.reduce((acc, { name, children }) => {
4
-    const menu = menusRaw.filter(x => x.Url === name)[0]
4
+    // console.log('menusRaw:', menusRaw)
5
+    const menu = (menusRaw || []).filter(x => x.Url === name)[0]
5 6
     if (!menu) return acc
6 7
 
7 8
     const MenuName = menu.MenuName
8 9
     const item = { Url: name, MenuName, parent }
9
-
10 10
     if (children && children.length) {
11 11
       const p = parent.concat({ Url: name, MenuName })
12 12
       return acc.concat(item, flatten(p, children, menusRaw))
@@ -65,7 +65,7 @@ export default {
65 65
       state.menusRaw = data.menus
66 66
       state.roles = data.roles
67 67
       state.user = data.user
68
-      state.menus = packChildren(data.menus)
68
+      state.menus = packChildren(data.menus || [])
69 69
       state.clientUrl = data.clienturl
70 70
       let defaultCase = ''
71 71
       for (let i = 0; i < data.cases.length; i++) {

static/yinchengLogo.ico → static/favorite.ico Vedi File