Browse Source

Merge branch 'dev' of http://git.ycjcjy.com/SpaceOfCheng/admin into dev

yuantianjiao 6 years ago
parent
commit
1e9c54582f

+ 593
- 75
package-lock.json
File diff suppressed because it is too large
View File


+ 3
- 0
package.json View File

@@ -14,14 +14,17 @@
14 14
     "build": "node build/build.js"
15 15
   },
16 16
   "dependencies": {
17
+    "@antv/g2": "^3.2.7",
17 18
     "axios": "^0.18.0",
18 19
     "element-ui": "^2.4.5",
20
+    "g2-vue": "^1.0.1",
19 21
     "js-base64": "^2.4.8",
20 22
     "js-md5": "^0.7.3",
21 23
     "vue": "^2.5.2",
22 24
     "vue-amap": "^0.5.8",
23 25
     "vue-cookie": "^1.1.4",
24 26
     "vue-fullcalendar": "^1.0.9",
27
+    "vue-morris": "0.0.13",
25 28
     "vue-router": "^3.0.1",
26 29
     "vuex": "^3.0.1"
27 30
   },

+ 61
- 0
src/components/brokenLineGraph/index.vue View File

@@ -0,0 +1,61 @@
1
+<template>
2
+  <div class="component">
3
+    <h6 class="title">{{data.title}}</h6>
4
+    <div id="brokenLineGraph" ref="box"></div>
5
+  </div>
6
+</template>
7
+
8
+<script>
9
+import G2 from '@antv/g2'
10
+
11
+export default {
12
+  name: '',
13
+  props: ['data'],
14
+  data () {
15
+    return {
16
+    }
17
+  },
18
+  components: {
19
+    G2,
20
+  },
21
+  mounted () {
22
+    this.$nextTick(function () {
23
+      this.init()
24
+    })
25
+  },
26
+  methods: {
27
+    init () {
28
+      var _that = this
29
+      var chart = new G2.Chart({
30
+        container: 'brokenLineGraph',
31
+        forceFit: true,
32
+        width: _that.$refs.box.clientWidth,
33
+        height: 400
34
+      })
35
+      chart.source(_that.data.list)
36
+      chart.scale('y', {
37
+        min: 0
38
+      })
39
+      chart.scale('x', {
40
+        range: [0, 1]
41
+      })
42
+      chart.tooltip({
43
+        crosshairs: {
44
+          type: 'line'
45
+        }
46
+      })
47
+      chart.line().position('x*y')
48
+      chart.point().position('x*y').size(4).shape('circle').style({
49
+        stroke: '#fff',
50
+        lineWidth: 1
51
+      })
52
+      chart.render()
53
+    },
54
+  }
55
+}
56
+</script>
57
+
58
+<!-- Add "scoped" attribute to limit CSS to this component only -->
59
+<style lang="scss" scoped>
60
+@import "page.scss"
61
+</style>

+ 28
- 0
src/components/brokenLineGraph/page.scss View File

@@ -0,0 +1,28 @@
1
+
2
+.component{
3
+  
4
+}
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+

+ 36
- 0
src/components/dashboardList/index.vue View File

@@ -0,0 +1,36 @@
1
+<template>
2
+  <div class="dashboardList">
3
+    <ul class="flex-h">
4
+      <li class="flex-item" v-for="(item,index) in data.list" :key="index">
5
+        <div>
6
+          <div class="centerLabel">
7
+            <span>{{item.name}}</span>
8
+            <span>{{item.value}}</span>
9
+          </div>
10
+        </div>
11
+      </li>
12
+    </ul>
13
+  </div>
14
+</template>
15
+
16
+<script>
17
+export default {
18
+  name: '',
19
+  props: ['data'],
20
+  data () {
21
+    return {
22
+
23
+    }
24
+  },
25
+  mounted () {
26
+    this.$nextTick(function () {})
27
+  },
28
+  methods: {
29
+  }
30
+}
31
+</script>
32
+
33
+<!-- Add "scoped" attribute to limit CSS to this component only -->
34
+<style lang="scss" scoped>
35
+@import "page.scss";
36
+</style>

+ 57
- 0
src/components/dashboardList/page.scss View File

@@ -0,0 +1,57 @@
1
+
2
+.dashboardList{
3
+  >ul{
4
+    >li{
5
+      margin-left: 20px;
6
+      position: relative;
7
+      overflow: hidden;
8
+      &:first-child{
9
+        margin-left: 0;
10
+      }
11
+      >div{
12
+        width: 100%;
13
+        position: relative;
14
+        overflow: hidden;
15
+        padding-bottom: 30%;
16
+        border-radius: 10px;
17
+        background: #ccc;
18
+        >div{
19
+          width: 100%;
20
+          >*{
21
+            width: 100%;
22
+            display: block;
23
+            text-align: center;
24
+            font-size: 18px;
25
+            color: #fff;
26
+            font-weight: bolder;
27
+            line-height: 1.6;
28
+          }
29
+        }
30
+      }
31
+    }
32
+  }
33
+}
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+

+ 49
- 0
src/components/histogram/index.vue View File

@@ -0,0 +1,49 @@
1
+<template>
2
+  <div class="component">
3
+    <h6 class="title">{{data.title}}</h6>
4
+    <div id="histogram" ref="box"></div>
5
+  </div>
6
+</template>
7
+
8
+<script>
9
+import G2 from '@antv/g2'
10
+
11
+export default {
12
+  name: '',
13
+  props: ['data'],
14
+  data () {
15
+    return {
16
+    }
17
+  },
18
+  components: {
19
+    G2,
20
+  },
21
+  mounted () {
22
+    this.$nextTick(function () {
23
+      this.init()
24
+    })
25
+  },
26
+  methods: {
27
+    init () {
28
+      var _that = this
29
+      var chart = new G2.Chart({
30
+        container: 'histogram',
31
+        forceFit: true,
32
+        width: _that.$refs.box.clientWidth,
33
+        height: 400
34
+      })
35
+      chart.source(_that.data.list)
36
+      chart.scale('y', {
37
+        tickInterval: 20
38
+      })
39
+      chart.interval().position('x*y')
40
+      chart.render()
41
+    },
42
+  }
43
+}
44
+</script>
45
+
46
+<!-- Add "scoped" attribute to limit CSS to this component only -->
47
+<style lang="scss" scoped>
48
+@import "page.scss";
49
+</style>

+ 28
- 0
src/components/histogram/page.scss View File

@@ -0,0 +1,28 @@
1
+
2
+.component{
3
+  
4
+}
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+

+ 73
- 0
src/components/pieDiagram/index.vue View File

@@ -0,0 +1,73 @@
1
+<template>
2
+  <div class="component">
3
+    <h6 class="title">{{data.title}}</h6>
4
+    <div id="pieDiagram" ref="box"></div>
5
+  </div>
6
+</template>
7
+
8
+<script>
9
+import G2 from '@antv/g2'
10
+
11
+export default {
12
+  name: '',
13
+  props: ['data'],
14
+  data () {
15
+    return {
16
+    }
17
+  },
18
+  components: {
19
+    G2,
20
+  },
21
+  mounted () {
22
+    this.$nextTick(function () {
23
+      this.init()
24
+    })
25
+  },
26
+  methods: {
27
+    init () {
28
+      var _that = this
29
+      var chart = new G2.Chart({
30
+        container: 'pieDiagram',
31
+        forceFit: true,
32
+        width: _that.$refs.box.clientWidth,
33
+        height: 400
34
+      })
35
+      chart.source(_that.data.list, {
36
+        percent: {
37
+          formatter: function formatter (val) {
38
+            val = val * 100 + '%'
39
+            return val
40
+          }
41
+        }
42
+      })
43
+      chart.coord('theta', {
44
+        radius: 0.75
45
+      })
46
+      chart.tooltip({
47
+        showTitle: false,
48
+        itemTpl: '<li><span style="background-color:{color}" class="g2-tooltip-marker"></span>{name}: {value}</li>'
49
+      })
50
+      chart.intervalStack().position('percent').color('item').label('percent', {
51
+        formatter: (val, item) => {
52
+          return item.point.item + ': ' + val
53
+        }
54
+      }).tooltip('item*percent', function (item, percent) {
55
+        percent = percent * 100 + '%'
56
+        return {
57
+          name: item,
58
+          value: percent
59
+        }
60
+      }).style({
61
+        lineWidth: 1,
62
+        stroke: '#fff'
63
+      })
64
+      chart.render()
65
+    },
66
+  }
67
+}
68
+</script>
69
+
70
+<!-- Add "scoped" attribute to limit CSS to this component only -->
71
+<style lang="scss" scoped>
72
+@import "page.scss";
73
+</style>

+ 26
- 0
src/components/pieDiagram/page.scss View File

@@ -0,0 +1,26 @@
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+

+ 86
- 0
src/components/ringChart/index.vue View File

@@ -0,0 +1,86 @@
1
+<template>
2
+  <div class="component">
3
+    <h6 class="title">{{data.title}}</h6>
4
+    <div id="ringChart" ref="box"></div>
5
+  </div>
6
+</template>
7
+
8
+<script>
9
+import G2 from '@antv/g2'
10
+
11
+export default {
12
+  name: '',
13
+  props: ['data'],
14
+  data () {
15
+    return {
16
+    }
17
+  },
18
+  components: {
19
+    G2,
20
+  },
21
+  mounted () {
22
+    this.$nextTick(function () {
23
+      this.init()
24
+    })
25
+  },
26
+  methods: {
27
+    init () {
28
+      var _that = this
29
+      var chart = new G2.Chart({
30
+        container: 'ringChart',
31
+        forceFit: true,
32
+        width: _that.$refs.box.clientWidth,
33
+        height: 400
34
+      })
35
+      chart.source(_that.data.list, {
36
+        percent: {
37
+          formatter: function formatter (val) {
38
+            val = val * 100 + '%'
39
+            return val
40
+          }
41
+        }
42
+      })
43
+      chart.coord('theta', {
44
+        radius: 0.75,
45
+        innerRadius: 0.6
46
+      })
47
+      chart.tooltip({
48
+        showTitle: false,
49
+        itemTpl: '<li><span style="background-color:{color};" class="g2-tooltip-marker"></span>{name}: {value}</li>'
50
+      })
51
+      var num = 0
52
+      for (var n = 0; n < _that.data.list.length; n++) {
53
+        num += _that.data.list[n].count
54
+      }
55
+      // 辅助文本
56
+      chart.guide().html({
57
+        position: ['50%', '50%'],
58
+        html: '<div style="color:#8c8c8c;font-size: 14px;text-align: center;width: 10em;">' + _that.data.title + '<br><span style="color:#8c8c8c;font-size:20px">' + num + '</span></div>',
59
+        alignX: 'middle',
60
+        alignY: 'middle'
61
+      })
62
+      var interval = chart.intervalStack().position('percent').color('item').label('percent', {
63
+        formatter: function formatter (val, item) {
64
+          return item.point.item + ': ' + val
65
+        }
66
+      }).tooltip('item*percent', function (item, percent) {
67
+        percent = percent * 100 + '%'
68
+        return {
69
+          name: item,
70
+          value: percent
71
+        }
72
+      }).style({
73
+        lineWidth: 1,
74
+        stroke: '#fff'
75
+      })
76
+      chart.render()
77
+      interval.setSelected(_that.data.list[0])
78
+    },
79
+  }
80
+}
81
+</script>
82
+
83
+<!-- Add "scoped" attribute to limit CSS to this component only -->
84
+<style lang="scss" scoped>
85
+@import "page.scss";
86
+</style>

+ 28
- 0
src/components/ringChart/page.scss View File

@@ -0,0 +1,28 @@
1
+
2
+.component{
3
+  
4
+}
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+

+ 1
- 1
src/components/siderBar/index.vue View File

@@ -31,7 +31,7 @@
31 31
               </el-menu-item-group>
32 32
             </el-submenu>
33 33
             <el-menu-item v-else :index="String(index)" :key="index">
34
-              <span slot="title">{{item.MenuName}}</span>
34
+              <router-link :to="{name:item.Url,query:{}}" active-class="active">{{item.MenuName}}</router-link>
35 35
             </el-menu-item>
36 36
           </template>
37 37
         </el-menu>

+ 1
- 1
src/pages/login/index.vue View File

@@ -71,7 +71,7 @@ export default {
71 71
           duration: 1000
72 72
         })
73 73
         setTimeout(() => {
74
-          this.$router.push({ name: 'userManager' })
74
+          this.$router.push({ name: 'dashboard' })
75 75
         }, 1000)
76 76
       }).catch(msg => {
77 77
 

+ 45
- 23
src/pages/system/courseManager/courseList/index.vue View File

@@ -173,7 +173,7 @@
173 173
                 :action='$api.file.image.url'
174 174
                 :show-file-list="false"
175 175
                 :on-success="handleAvatarSuccess">
176
-                <img v-if="editCourseDetail.newImg" :src="editCourseDetail.newImg" class="avatar">
176
+                <img v-if="newImg" :src="newImg" class="avatar">
177 177
                 <i v-else class="el-icon-plus avatar-uploader-icon"></i>
178 178
               </el-upload>
179 179
             </div>
@@ -181,19 +181,19 @@
181 181
           <el-button
182 182
             size="mini"
183 183
             type="success"
184
-            v-if="editCourseDetail.newImg"
184
+            v-if="newImg"
185 185
             @click="addThisImg">确定添加图片</el-button>
186 186
         </li>
187 187
       </ul>
188 188
       <el-table
189
-        :data="currentCourseDetail"
189
+        :data="courseImgs"
190 190
         stripe
191 191
         style="width: 100%">
192 192
         <el-table-column
193 193
           prop="img"
194 194
           label="图片">
195 195
           <template slot-scope="scope">
196
-            <img :src="scope.row.img" alt="">
196
+            <img :src="scope.row.ImgUrl" style="width:100%" alt="">
197 197
           </template>
198 198
         </el-table-column>
199 199
         <el-table-column
@@ -202,8 +202,7 @@
202 202
           <template slot-scope="scope">
203 203
             <el-input
204 204
               placeholder="请输入内容"
205
-              v-model="scope.row.sort"
206
-              :disabled="scope.row.edit ? false : true">
205
+              v-model="scope.row.Sort">
207 206
             </el-input>
208 207
           </template>
209 208
         </el-table-column>
@@ -213,12 +212,6 @@
213 212
             <el-button
214 213
               size="mini"
215 214
               type="success"
216
-              v-if="!scope.row.edit"
217
-              @click="editItem(scope.$index, scope.row)">编辑</el-button>
218
-            <el-button
219
-              size="mini"
220
-              type="success"
221
-              v-if="scope.row.edit"
222 215
               @click="sureSort(scope.$index, scope.row)">确认</el-button>
223 216
             <el-button
224 217
               size="mini"
@@ -241,15 +234,13 @@ export default {
241 234
   name: '',
242 235
   data () {
243 236
     return {
237
+      selCourseId: '',
244 238
       currentCourseDetail: [{
245 239
         img: '',
246 240
         sort: 1,
247 241
         edit: false,
248 242
       }],
249
-      editCourseDetail: {
250
-        newImg: '',
251
-        list: [],
252
-      },
243
+      newImg: '',
253 244
       centerDialogVisible: false, // 课程详情弹窗显隐
254 245
       total: 0,
255 246
       postData: { // 表格搜索条件
@@ -275,6 +266,7 @@ export default {
275 266
     }),
276 267
     ...mapCourseState({
277 268
       courses: x => x.courseList,
269
+      courseImgs: x => x.courseImgs
278 270
     }),
279 271
     ...mapLocationState({
280 272
       location: x => x.location
@@ -290,21 +282,46 @@ export default {
290 282
   },
291 283
   methods: {
292 284
     deleteItem (index, item) { // 删除图片
293
-
285
+      this.$confirm('确认删除此课程?', '提示', {
286
+        confirmButtonText: '确定',
287
+        cancelButtonText: '取消',
288
+        type: 'warning'
289
+      })
290
+        .then(() => {
291
+          this.DelCourseImg({id: item.ImgId, callback: this.afterImgAction})
292
+        })
294 293
     },
295 294
     sureSort (index, item) { // 确认图片排序
296
-      this.currentCourseDetail[index].edit = false
295
+      this.UpdateCourseImg({...item, callback: this.afterImgAction})
297 296
     },
298 297
     editItem (index, item) { // 编辑图片排序
299
-      this.currentCourseDetail[index].edit = true
298
+      let imglist = {...this.courseImgs}
299
+      imglist[index].edit = true
300
+      this.UpdateImgList(imglist)
300 301
     },
301 302
     addThisImg () { // 添加图片到课程详情
302
-
303
+      const data = {
304
+        CourseId: this.selCourseId,
305
+        ImgUrl: this.newImg,
306
+        Sort: 0,
307
+        callback: this.afterImgAction
308
+      }
309
+      this.newImg = ''
310
+      this.AddCourseImg(data)
311
+    },
312
+    afterImgAction () {
313
+      this.$message({
314
+        type: 'success',
315
+        message: '操作成功!'
316
+      })
317
+      this.GetCourseImgs({id: this.selCourseId})
303 318
     },
304 319
     handleAvatarSuccess (res, file) {
305
-      this.editCourseDetail.newImg = res.result.url
320
+      this.newImg = res.result.url
306 321
     },
307
-    addDetail (val) { // 添加课程详情
322
+    addDetail (row) { // 添加课程详情
323
+      this.selCourseId = row.CourseId
324
+      this.GetCourseImgs({id: this.selCourseId})
308 325
       this.centerDialogVisible = true
309 326
     },
310 327
     ...mapCourseActions([
@@ -313,7 +330,12 @@ export default {
313 330
       'UnPublic',
314 331
       'DelCourse',
315 332
       'SetNull',
316
-      'GetCourseByID'
333
+      'GetCourseByID',
334
+      'GetCourseImgs',
335
+      'AddCourseImg',
336
+      'UpdateCourseImg',
337
+      'DelCourseImg',
338
+      'UpdateImgList'
317 339
     ]),
318 340
     ...mapLocationActions([
319 341
       'updateLocationInfo',

+ 2
- 2
src/pages/system/courseManager/scheduleManager/index.vue View File

@@ -79,7 +79,7 @@
79 79
                 </el-date-picker>
80 80
               </div>
81 81
             </div>
82
-            <span v-else>{{currentCourseItem.BeginDate}}</span>
82
+            <span v-else>{{this.toolClass.dateFormat(currentCourseItem.BeginDate, 'yyyy-MM-dd hh:mm')}}</span>
83 83
           </li>
84 84
           <li class="flex-h">
85 85
             <span>结束时间:</span>
@@ -92,7 +92,7 @@
92 92
                 </el-date-picker>
93 93
               </div>
94 94
             </div>
95
-            <span v-else>{{currentCourseItem.EndDate}}</span>
95
+            <span v-else>{{this.toolClass.dateFormat(currentCourseItem.EndDate, 'yyyy-MM-dd hh:mm')}}</span>
96 96
           </li>
97 97
         </ul>
98 98
       </div>

+ 105
- 0
src/pages/system/dashboard/index.vue View File

@@ -0,0 +1,105 @@
1
+<template>
2
+  <div class="subPage">
3
+    <div class="selectCase">
4
+      <el-select v-model="CaseId" placeholder="请选择">
5
+        <el-option
6
+          v-for="item in cases"
7
+          :key="item.CaseId"
8
+          :label="item.CaseName"
9
+          :value="item.CaseId">
10
+        </el-option>
11
+      </el-select>
12
+    </div>
13
+    <div class="flex-h" v-for="(item,index) in pageData" :key="index">
14
+      <div class="flex-item" v-for="(subItem,subIndex) in item" :key="subIndex">
15
+        <div v-if="subItem.type === 'dashboardList'">
16
+          <dashboardList :data="subItem.data"></dashboardList>
17
+        </div>
18
+        <div v-if="subItem.type === 'histogram'">
19
+          <histogram :data="subItem.data"></histogram>
20
+        </div>
21
+        <div v-if="subItem.type === 'pieDiagram'">
22
+          <pieDiagram :data="subItem.data"></pieDiagram>
23
+        </div>
24
+        <div v-if="subItem.type === 'brokenLineGraph'">
25
+          <brokenLineGraph :data="subItem.data"></brokenLineGraph>
26
+        </div>
27
+        <div v-if="subItem.type === 'ringChart'">
28
+          <ringChart :data="subItem.data"></ringChart>
29
+        </div>
30
+      </div>
31
+    </div>
32
+  </div>
33
+</template>
34
+
35
+<script>
36
+import { mapState } from 'vuex'
37
+import dashboardList from '../../../components/dashboardList/index'
38
+import histogram from '../../../components/histogram/index'
39
+import pieDiagram from '../../../components/pieDiagram/index'
40
+import brokenLineGraph from '../../../components/brokenLineGraph/index'
41
+import ringChart from '../../../components/ringChart/index'
42
+
43
+export default {
44
+  name: '',
45
+  data () {
46
+    return {
47
+      postData: {
48
+        caseid: ''
49
+      },
50
+      pageData: [
51
+        [
52
+          { type: 'dashboardList', remark: '列表面板', data: { title: '', list: [{ name: '会员总数', value: '1000', }, { name: '课程预约总量', value: '1000', }, { name: '饮品下单总量', value: '1000', }] } }
53
+        ],
54
+        [
55
+          { type: 'histogram', remark: '柱状图', data: { title: '今日数据', list: [{ x: '推荐会员新增', y: 38 }, { x: '课程数', y: 52 }, { x: '预约数', y: 61 }, { x: '到场人次', y: 145 }] } },
56
+          { type: 'pieDiagram', remark: '扇形图', data: { title: '明日课程预约数据', list: [{ item: '小小体验官', count: 40, percent: 0.4 }, { item: '哈他瑜伽', count: 52, percent: 0.52 }, { item: '小小飞行家', count: 8, percent: 0.08 }] } }
57
+        ],
58
+        [
59
+          { type: 'brokenLineGraph', remark: '折线图', data: { title: '下单饮品数据', list: [{ x: '09/05', y: 3 }, { x: '09/06', y: 4 }, { x: '09/07', y: 3.5 }, { x: '09/08', y: 5 }, { x: '09/09', y: 4.9 }, { x: '09/10', y: 6 }, { x: '09/11', y: 7 }, { x: '09/12', y: 9 }, { x: '09/13', y: 13 }] } },
60
+          { type: 'ringChart', remark: '环形图', data: { title: '本月课程预约', list: [{ item: '健身课程', count: 40, percent: 0.4 }, { item: '社交课程', count: 21, percent: 0.21 }, { item: '教育课程', count: 17, percent: 0.17 }, { item: '健康课程', count: 13, percent: 0.13 }, { item: '艺术课程', count: 9, percent: 0.09 }] } },
61
+        ],
62
+        [
63
+          { type: '', remark: '', data: { title: '', list: [] } },
64
+        ],
65
+      ],
66
+    }
67
+  },
68
+  components: {
69
+    dashboardList,
70
+    histogram,
71
+    pieDiagram,
72
+    brokenLineGraph,
73
+    ringChart,
74
+  },
75
+  computed: {
76
+    ...mapState({
77
+      cases: x => x.app.cases.list,
78
+      defaultCaseId: x => x.app.cases.default
79
+    }),
80
+    CaseId: {
81
+      get () {
82
+        return this.postData.caseid || this.defaultCaseId
83
+      },
84
+      set (val) {
85
+        this.postData.caseid = val
86
+      }
87
+    }
88
+  },
89
+  mounted () {
90
+    this.$nextTick(function () {
91
+      this.drawHistogram()
92
+    })
93
+  },
94
+  methods: {
95
+    drawHistogram () { // 绘制柱状图
96
+      // this.histogramInit.source(this.histogramParams)
97
+    },
98
+  }
99
+}
100
+</script>
101
+
102
+<!-- Add "scoped" attribute to limit CSS to this component only -->
103
+<style lang="scss" scoped>
104
+@import "page.scss";
105
+</style>

+ 54
- 0
src/pages/system/dashboard/page.scss View File

@@ -0,0 +1,54 @@
1
+
2
+.subPage{
3
+  >*{
4
+    width: calc(100% - 40px);
5
+    position: relative;
6
+    overflow: hidden;
7
+    margin: 20px auto 0;
8
+    >div{
9
+      >div{
10
+        >div{
11
+          
12
+        }
13
+      }
14
+    }
15
+  }
16
+  >*:last-child{
17
+    margin-bottom: 20px;
18
+  }
19
+  .selectCase{
20
+    text-align: right;
21
+  }
22
+  .top{
23
+    
24
+  }
25
+}
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+

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

@@ -1,6 +1,8 @@
1 1
 
2 2
 import system from './index' // 系统首页
3 3
 
4
+import dashboard from './dashboard/index' // 控制板
5
+
4 6
 import systemSet from './systemSet/index' // 系统设置
5 7
 import userManager from './systemSet/userManager/index' // 用户管理
6 8
 import addUser from './systemSet/userManager/add' // 添加用户
@@ -85,7 +87,12 @@ export default {
85 87
       path: '/system',
86 88
       name: 'system',
87 89
       component: system,
88
-      children: [{ // 系统设置
90
+      children: [{ // 首页控制板
91
+        path: 'dashboard',
92
+        name: 'dashboard',
93
+        component: dashboard,
94
+        children: []
95
+      }, { // 系统设置
89 96
         path: 'systemSet',
90 97
         name: 'systemSet',
91 98
         component: systemSet,

+ 4
- 2
src/pages/system/systemSet/roleManager/add.vue View File

@@ -75,10 +75,12 @@ export default {
75 75
       if ((this.detail.RoleId || '') === '') {
76 76
         this.detail.CaseId = this.caseid
77 77
         this.detail.OrgId = this.orgid
78
-        this.AddRole(this.detail)
78
+        this.AddRole({...this.detail, callback: this.afterSave})
79 79
       } else {
80
-        this.UpdateRole(this.detail)
80
+        this.UpdateRole({...this.detail, callback: this.afterSave})
81 81
       }
82
+    },
83
+    afterSave () {
82 84
       this.$message({
83 85
         type: 'success',
84 86
         message: '操作成功'

+ 66
- 1
src/store/course/course.js View File

@@ -6,6 +6,7 @@ export default {
6 6
   state: {
7 7
     courseList: [],
8 8
     courseInfo: {},
9
+    courseImgs: [],
9 10
   },
10 11
   mutations: {
11 12
     updateList (state, payload) {
@@ -14,6 +15,9 @@ export default {
14 15
     updateInfo (state, payload) {
15 16
       state.courseInfo = payload || {}
16 17
     },
18
+    updateImgList (state, payload) {
19
+      state.courseImgs = payload
20
+    }
17 21
   },
18 22
   actions: {
19 23
     GetCourseList ({ commit }, payload) {
@@ -44,6 +48,9 @@ export default {
44 48
         }
45 49
       }).then(res => {
46 50
         commit('updateInfo', res)
51
+        if (payload.callback) {
52
+          payload.callback()
53
+        }
47 54
       })
48 55
     },
49 56
     UpdateCourse ({ commit }, payload) {
@@ -56,6 +63,9 @@ export default {
56 63
           id: payload.GoodsId,
57 64
         }
58 65
       }).then(res => {
66
+        if (payload.callback) {
67
+          payload.callback()
68
+        }
59 69
       })
60 70
     },
61 71
     DelCourse ({ commit }, { id, callback }) {
@@ -99,6 +109,61 @@ export default {
99 109
     },
100 110
     UpdateInfo ({ commit }, payload) {
101 111
       commit('updateInfo', payload)
102
-    }
112
+    },
113
+    UpdateImgList ({ commit }, payload) {
114
+      commit('updateImgList', payload)
115
+    },
116
+    GetCourseImgs ({ commit }, {id, callback}) {
117
+      ajax(api.course.getimgs.url, {
118
+        method: api.course.getimgs.method,
119
+        urlData: {
120
+          id: id,
121
+        }
122
+      }).then(res => {
123
+        commit('updateImgList', res)
124
+        if (callback) {
125
+          callback()
126
+        }
127
+      })
128
+    },
129
+    AddCourseImg ({ commit }, payload) {
130
+      ajax(api.course.addimgs.url, {
131
+        method: api.course.addimgs.method,
132
+        data: {
133
+          ...payload
134
+        }
135
+      }).then(res => {
136
+        if (payload.callback) {
137
+          payload.callback()
138
+        }
139
+      })
140
+    },
141
+    UpdateCourseImg ({ commit }, payload) {
142
+      ajax(api.course.updateimgs.url, {
143
+        method: api.course.updateimgs.method,
144
+        data: {
145
+          ...payload
146
+        },
147
+        urlData: {
148
+          id: payload.id
149
+        }
150
+      }).then(res => {
151
+        if (payload.callback) {
152
+          payload.callback()
153
+        }
154
+      })
155
+    },
156
+    DelCourseImg ({ commit }, { id, callback }) {
157
+      ajax(api.course.deleteimgs.url, {
158
+        method: api.course.deleteimgs.method,
159
+        urlData: {
160
+          id: id,
161
+        }
162
+      }).then(res => {
163
+        if (callback) {
164
+          callback()
165
+        }
166
+      })
167
+    },
103 168
   }
104 169
 }

+ 6
- 0
src/store/system/role.js View File

@@ -48,6 +48,9 @@ export default {
48 48
         }
49 49
       }).then(res => {
50 50
         commit('updateInfo', res)
51
+        if (payload.callback) {
52
+          payload.callback()
53
+        }
51 54
       })
52 55
     },
53 56
     UpdateRole ({ commit }, payload) {
@@ -57,6 +60,9 @@ export default {
57 60
           ...payload
58 61
         }
59 62
       }).then(res => {
63
+        if (payload.callback) {
64
+          payload.callback()
65
+        }
60 66
       })
61 67
     },
62 68
     DelRole ({ commit }, { id, callback }) {

+ 9
- 0
src/style/main.css View File

@@ -388,6 +388,15 @@ select:focus {
388 388
   display: inline-block;
389 389
 }
390 390
 
391
+.component,
392
+.component>div,
393
+#mountNode>div{
394
+  width: 100%;
395
+  height: 100%;
396
+}
397
+
398
+
399
+
391 400
 
392 401
 
393 402