yuantianjiao 6 anni fa
parent
commit
000362449a

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

@@ -64,7 +64,7 @@ export default {
64 64
   data () {
65 65
     return {
66 66
       postData: {
67
-        currentPage: 0, // 当前页码
67
+        currentPage: 1, // 当前页码
68 68
         pageSize: 10,
69 69
         total: 0,
70 70
       },

+ 76
- 92
src/pages/system/courseManager/fiveA/add.vue Vedi File

@@ -2,27 +2,13 @@
2 2
   <div class="subPage">
3 3
     <form class="mainForm">
4 4
       <ul>
5
-        <li class="flex-h">
6
-          <span>上级课程类型:</span>
7
-          <div class="flex-item">
8
-            <div style="width:50%">
9
-              <el-input
10
-                placeholder="请输入内容"
11
-                v-model="postData.label"
12
-                @focus="showTree"
13
-                readonly
14
-                clearable>
15
-              </el-input>
16
-            </div>
17
-          </div>
18
-        </li>
19 5
         <li class="flex-h">
20 6
           <span>名称:</span>
21 7
           <div class="flex-item">
22 8
             <div style="width:50%">
23 9
               <el-input
24 10
                 placeholder="请输入名称"
25
-                v-model="postData.name"
11
+                v-model="postData.LocationName"
26 12
                 clearable>
27 13
               </el-input>
28 14
             </div>
@@ -34,7 +20,7 @@
34 20
             <div style="width:50%">
35 21
               <el-input
36 22
                 placeholder="请输入标题"
37
-                v-model="postData.title"
23
+                v-model="postData.Title"
38 24
                 clearable>
39 25
               </el-input>
40 26
             </div>
@@ -46,7 +32,7 @@
46 32
             <div style="width:50%">
47 33
               <el-input
48 34
                 placeholder="请输入咨询分类"
49
-                v-model="postData.class"
35
+                v-model="postData.Consult"
50 36
                 clearable>
51 37
               </el-input>
52 38
             </div>
@@ -58,19 +44,7 @@
58 44
             <div style="width:50%">
59 45
               <el-input
60 46
                 placeholder="请输入编码"
61
-                v-model="postData.coding"
62
-                clearable>
63
-              </el-input>
64
-            </div>
65
-          </div>
66
-        </li>
67
-        <li class="flex-h">
68
-          <span>序号:</span>
69
-          <div class="flex-item">
70
-            <div style="width:50%">
71
-              <el-input
72
-                placeholder="请输入序号"
73
-                v-model="postData.number"
47
+                v-model="postData.LocationCode"
74 48
                 clearable>
75 49
               </el-input>
76 50
             </div>
@@ -79,13 +53,19 @@
79 53
         <li class="flex-h">
80 54
           <span>课程图片:</span>
81 55
           <div class="flex-item">
82
-            <div>
83
-              <a class="formImg">
84
-                <img src="" class="centerLabel contain" alt="">
85
-                <i class="iconfont icon-quxiao"></i>
86
-              </a>
87
-              <el-button type="success" size="mini">上传图片</el-button>
88
-            </div>
56
+            <el-upload
57
+              :action="$api.file.image.url"
58
+              :limit='limit'
59
+              list-type="picture-card"
60
+              :file-list='imgsArr'
61
+              :on-success="handlePictureCardPreview"
62
+              :on-remove="handleRemove"
63
+              :on-exceed="exceed">
64
+              <i class="el-icon-plus"></i>
65
+            </el-upload>
66
+            <el-dialog :visible.sync="dialogVisible">
67
+              <img width="100%" :src="imgs" alt="">
68
+            </el-dialog>
89 69
           </div>
90 70
         </li>
91 71
         <li style="text-align:center">
@@ -94,83 +74,87 @@
94 74
         </li>
95 75
       </ul>
96 76
     </form>
97
-    <el-dialog title="请选择机构" :visible.sync="dialogTableVisible">
98
-      <el-tree
99
-        class="flxe-h"
100
-        :data="treeData"
101
-        :default-expand-all="true"
102
-        :expand-on-click-node="false"
103
-        @node-click="handleNodeClick"></el-tree>
104
-    </el-dialog>
105 77
   </div>
106 78
 </template>
107 79
 
108 80
 <script>
109 81
 
82
+import { mapState, mapActions } from 'vuex'
110 83
 export default {
111 84
   name: '',
112 85
   data () {
113 86
     return {
114 87
       postData: {
115
-        label: '', // 父页面带入的上级类型
116
-        name: '', // 名称
117
-        title: '', // 标题
118
-        class: '', // 咨询分类
119
-        coding: '', // 编码
88
+        LocationName: '', // 名称
89
+        Title: '', // 标题
90
+        Consult: '', // 咨询分类
91
+        LocationCode: '', // 编码
120 92
         number: '', // 序号
93
+        OrgId: '',
94
+        CaseId: '',
95
+        TypeImg: ''
121 96
       },
122
-      dialogTableVisible: false,
123
-      treeData: [{
124
-        label: '根目录',
125
-        rank: '0',
126
-        img: '',
127
-        children: [{
128
-          label: '共享课程&书吧',
129
-          rank: '0',
130
-          img: '',
131
-          children: [{
132
-            label: '健身',
133
-            rank: '0',
134
-            img: 'http://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/upload/163306109741.png',
135
-          }, {
136
-            label: '健康',
137
-            rank: '0',
138
-            img: 'http://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/upload/163325263583.png',
139
-          }, {
140
-            label: '艺术',
141
-            rank: '0',
142
-            img: 'http://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/upload/104118813781.png',
143
-          }, {
144
-            label: '社交',
145
-            rank: '0',
146
-            img: 'http://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/upload/163339496588.png',
147
-          }, {
148
-            label: '教育',
149
-            rank: '0',
150
-            img: 'http://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/upload/163351586373.png',
151
-          }]
152
-        }]
153
-      }]
97
+      dialogVisible: false,
98
+      imgs: '',
99
+      imgsArr: [],
100
+      limit: 1
154 101
     }
155 102
   },
156 103
   components: {},
104
+  created () {
105
+    this.updateSystemInfo().then(() => {
106
+      this.postData.CaseId = this.defaultCaseId
107
+    })
108
+  },
109
+  computed: {
110
+    ...mapState({
111
+      OrgId: x => x.app.user.OrgId,
112
+      defaultCaseId: x => x.app.cases.default
113
+    })
114
+  },
157 115
   methods: {
158
-    showTree () {
159
-      this.dialogTableVisible = true
160
-    },
161
-    handleNodeClick (node) {
162
-      this.postData.label = node.label
163
-      this.dialogTableVisible = false
164
-    },
116
+    ...mapActions(['updateSystemInfo']),
165 117
     submit () {
118
+      this.postData.OrgId = this.OrgId
119
+      this.postData.TypeImg = ''
120
+      for (let i = 0; i < this.imgsArr.length; i++) {
121
+        this.postData.TypeImg += this.imgsArr[i].response.result.url + ','
122
+      }
123
+      if (this.postData.TypeImg) {
124
+        this.postData.TypeImg = this.postData.TypeImg.substr(0, this.postData.TypeImg.length - 1)
125
+      }
166 126
       console.log(this.postData)
127
+      this.$ajax(this.$api.cms.addLocation.url, {
128
+        method: this.$api.cms.addLocation.method,
129
+        data: this.postData
130
+      }).then(res => {
131
+        this.$message({
132
+          type: 'success',
133
+          message: '新增成功'
134
+        })
135
+        this.$router.push({ name: 'fiveA' })
136
+      }).catch(msg => {
137
+
138
+      })
167 139
     },
168 140
     cancel () {
169 141
       this.$router.go(-1)
142
+    },
143
+    handlePictureCardPreview (res, file, fileList) {
144
+      this.imgs = res.result.url
145
+      this.dialogVisible = true
146
+      this.imgsArr = fileList
147
+    },
148
+    handleRemove (file, fileList) {
149
+      this.imgsArr = fileList
150
+    },
151
+    exceed () {
152
+      this.$message({
153
+        message: '超过可传的图片上限',
154
+        type: 'info',
155
+        duration: 1000
156
+      })
170 157
     }
171
-  },
172
-  mounted () {
173
-    this.postData.label = this.$route.query.label
174 158
   }
175 159
 }
176 160
 </script>

+ 104
- 97
src/pages/system/courseManager/fiveA/edit.vue Vedi File

@@ -2,27 +2,13 @@
2 2
   <div class="subPage">
3 3
     <form class="mainForm">
4 4
       <ul>
5
-        <li class="flex-h">
6
-          <span>上级课程类型:</span>
7
-          <div class="flex-item">
8
-            <div style="width:50%">
9
-              <el-input
10
-                placeholder="请输入内容"
11
-                v-model="postData.label"
12
-                @focus="showTree"
13
-                readonly
14
-                clearable>
15
-              </el-input>
16
-            </div>
17
-          </div>
18
-        </li>
19 5
         <li class="flex-h">
20 6
           <span>名称:</span>
21 7
           <div class="flex-item">
22 8
             <div style="width:50%">
23 9
               <el-input
24 10
                 placeholder="请输入名称"
25
-                v-model="postData.name"
11
+                v-model="postData.LocationName"
26 12
                 clearable>
27 13
               </el-input>
28 14
             </div>
@@ -34,7 +20,7 @@
34 20
             <div style="width:50%">
35 21
               <el-input
36 22
                 placeholder="请输入标题"
37
-                v-model="postData.title"
23
+                v-model="postData.Title"
38 24
                 clearable>
39 25
               </el-input>
40 26
             </div>
@@ -46,7 +32,7 @@
46 32
             <div style="width:50%">
47 33
               <el-input
48 34
                 placeholder="请输入咨询分类"
49
-                v-model="postData.class"
35
+                v-model="postData.Consult"
50 36
                 clearable>
51 37
               </el-input>
52 38
             </div>
@@ -58,19 +44,7 @@
58 44
             <div style="width:50%">
59 45
               <el-input
60 46
                 placeholder="请输入编码"
61
-                v-model="postData.coding"
62
-                clearable>
63
-              </el-input>
64
-            </div>
65
-          </div>
66
-        </li>
67
-        <li class="flex-h">
68
-          <span>序号:</span>
69
-          <div class="flex-item">
70
-            <div style="width:50%">
71
-              <el-input
72
-                placeholder="请输入序号"
73
-                v-model="postData.number"
47
+                v-model="postData.LocationCode"
74 48
                 clearable>
75 49
               </el-input>
76 50
             </div>
@@ -79,13 +53,19 @@
79 53
         <li class="flex-h">
80 54
           <span>课程图片:</span>
81 55
           <div class="flex-item">
82
-            <div>
83
-              <a class="formImg">
84
-                <img src="" class="centerLabel contain" alt="">
85
-                <i class="iconfont icon-quxiao"></i>
86
-              </a>
87
-              <el-button type="success" size="mini">上传图片</el-button>
88
-            </div>
56
+            <el-upload
57
+              :action="$api.file.image.url"
58
+              :limit='limit'
59
+              list-type="picture-card"
60
+              :file-list='imgsArr'
61
+              :on-success="handlePictureCardPreview"
62
+              :on-remove="handleRemove"
63
+              :on-exceed="exceed">
64
+              <i class="el-icon-plus"></i>
65
+            </el-upload>
66
+            <el-dialog :visible.sync="dialogVisible">
67
+              <img width="100%" :src="imgs" alt="">
68
+            </el-dialog>
89 69
           </div>
90 70
         </li>
91 71
         <li style="text-align:center">
@@ -94,87 +74,114 @@
94 74
         </li>
95 75
       </ul>
96 76
     </form>
97
-    <el-dialog title="请选择机构" :visible.sync="dialogTableVisible">
98
-      <el-tree
99
-        class="flxe-h"
100
-        :data="treeData"
101
-        :default-expand-all="true"
102
-        :expand-on-click-node="false"
103
-        @node-click="handleNodeClick"></el-tree>
104
-    </el-dialog>
105 77
   </div>
106 78
 </template>
107 79
 
108 80
 <script>
109 81
 
82
+import { mapState, mapActions } from 'vuex'
110 83
 export default {
111 84
   name: '',
112 85
   data () {
113 86
     return {
114 87
       postData: {
115
-        label: '', // 父页面带入的上级类型
116
-        name: '', // 名称
117
-        title: '', // 标题
118
-        class: '', // 咨询分类
119
-        coding: '', // 编码
88
+        LocationName: '', // 名称
89
+        Title: '', // 标题
90
+        Consult: '', // 咨询分类
91
+        LocationCode: '', // 编码
120 92
         number: '', // 序号
93
+        OrgId: '',
94
+        CaseId: '',
95
+        TypeImg: ''
121 96
       },
122
-      dialogTableVisible: false,
123
-      treeData: [{
124
-        label: '根目录',
125
-        rank: '0',
126
-        img: '',
127
-        children: [{
128
-          label: '共享课程&书吧',
129
-          rank: '0',
130
-          img: '',
131
-          children: [{
132
-            label: '健身',
133
-            rank: '0',
134
-            img: 'http://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/upload/163306109741.png',
135
-          }, {
136
-            label: '健康',
137
-            rank: '0',
138
-            img: 'http://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/upload/163325263583.png',
139
-          }, {
140
-            label: '艺术',
141
-            rank: '0',
142
-            img: 'http://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/upload/104118813781.png',
143
-          }, {
144
-            label: '社交',
145
-            rank: '0',
146
-            img: 'http://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/upload/163339496588.png',
147
-          }, {
148
-            label: '教育',
149
-            rank: '0',
150
-            img: 'http://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/upload/163351586373.png',
151
-          }]
152
-        }]
153
-      }]
97
+      dialogVisible: false,
98
+      imgs: '',
99
+      imgsArr: [],
100
+      limit: 1
154 101
     }
155 102
   },
156 103
   components: {},
104
+  created () {
105
+    this.updateSystemInfo().then(() => {
106
+      this.postData.CaseId = this.defaultCaseId
107
+    })
108
+    this.getDetail()
109
+  },
110
+  computed: {
111
+    ...mapState({
112
+      OrgId: x => x.app.user.OrgId,
113
+      defaultCaseId: x => x.app.cases.default
114
+    })
115
+  },
157 116
   methods: {
158
-    showTree () {
159
-      this.dialogTableVisible = true
160
-    },
161
-    handleNodeClick (node) {
162
-      this.postData.label = node.label
163
-      this.dialogTableVisible = false
164
-    },
165
-    init () {
166
-      console.log('请求初始化数据')
167
-    },
117
+    ...mapActions(['updateSystemInfo']),
168 118
     submit () {
169
-      console.log(this.postData)
119
+      this.postData.OrgId = this.OrgId
120
+      this.postData.TypeImg = ''
121
+      for (let i = 0; i < this.imgsArr.length; i++) {
122
+        this.postData.TypeImg += this.imgsArr[i].response.result.url + ','
123
+      }
124
+      if (this.postData.TypeImg) {
125
+        this.postData.TypeImg = this.postData.TypeImg.substr(0, this.postData.TypeImg.length - 1)
126
+      }
127
+      this.$ajax(this.$api.cms.editLocation.url, {
128
+        method: this.$api.cms.editLocation.method,
129
+        urlData: {
130
+          id: this.$route.query.id
131
+        },
132
+        data: this.postData
133
+      }).then(res => {
134
+        this.$message({
135
+          type: 'success',
136
+          message: '编辑成功'
137
+        })
138
+        this.$router.push({ name: 'fiveA' })
139
+      }).catch(msg => {
140
+
141
+      })
170 142
     },
171 143
     cancel () {
172 144
       this.$router.go(-1)
145
+    },
146
+    getDetail () {
147
+      this.$ajax(this.$api.cms.locationDetail.url, {
148
+        method: this.$api.cms.locationDetail.method,
149
+        urlData: {
150
+          id: this.$route.query.id
151
+        }
152
+      }).then(res => {
153
+        console.log(res)
154
+        let imgsArr = []
155
+        let item = {
156
+          url: res.ImageUrl,
157
+          response: {
158
+            result: {
159
+              url: res.ImageUrl
160
+            }
161
+          }
162
+        }
163
+        imgsArr.push(item)
164
+        this.imgsArr = imgsArr
165
+        this.postData = res
166
+      }).catch(msg => {
167
+
168
+      })
169
+    },
170
+    handlePictureCardPreview (res, file, fileList) {
171
+      this.imgs = res.result.url
172
+      this.dialogVisible = true
173
+      this.imgsArr = fileList
174
+    },
175
+    handleRemove (file, fileList) {
176
+      this.imgsArr = fileList
177
+    },
178
+    exceed () {
179
+      this.$message({
180
+        message: '超过可传的图片上限',
181
+        type: 'info',
182
+        duration: 1000
183
+      })
173 184
     }
174
-  },
175
-  mounted () {
176
-    this.postData.label = this.$route.query.label
177
-    this.init()
178 185
   }
179 186
 }
180 187
 </script>

+ 147
- 110
src/pages/system/courseManager/fiveA/index.vue Vedi File

@@ -2,153 +2,190 @@
2 2
   <div class="subPage">
3 3
     <div class="system-table-search">
4 4
       <div class="flex-h">
5
+        <div class="flex-item flex-h">
6
+          <el-button size="mini" type="success" @click="addFiveA">新增五A</el-button>
7
+        </div>
8
+        <!-- <tableSearch @exportSearchKey="searchList"></tableSearch> -->
5 9
       </div>
6 10
       <div class="moreFilter"></div>
7 11
     </div>
8 12
     <div class="system-table-box">
9
-      <div class="flex-h table-title">
10
-        <span style="width:20px"></span>
11
-        <div class="flex-item">标题</div>
12
-        <div class="flex-item">排序</div>
13
-        <div class="flex-item">类型图片</div>
14
-        <div class="flex-item">操作</div>
15
-      </div>
16
-      <el-tree
17
-      class="flxe-h"
18
-      :data="data"
19
-      :default-expand-all="true"
20
-      :expand-on-click-node="false"
21
-      :render-content="renderContent"
22
-      :indent="0"></el-tree>
13
+      <el-table
14
+        :data="tableData"
15
+        stripe
16
+        style="width: 100%">
17
+        <el-table-column
18
+          prop="LocationName"
19
+          label="标题">
20
+        </el-table-column>
21
+        <el-table-column
22
+          prop="OrderNo"
23
+          label="排序">
24
+        </el-table-column>
25
+        <el-table-column
26
+          prop="TypeImg"
27
+          label="类型图片">
28
+          <template slot-scope="scope">
29
+            <a class="tableImg">
30
+              <img :src="scope.row.TypeImg" class="centerLabel contain" alt="">
31
+            </a>
32
+          </template>
33
+        </el-table-column>
34
+        <el-table-column label="操作">
35
+          <template slot-scope="scope">
36
+            <el-button
37
+              size="mini"
38
+              type="warning"
39
+              @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
40
+            <el-button
41
+              size="mini"
42
+              type="danger"
43
+              @click="handleDelete(scope.$index, scope.row)">删除</el-button>
44
+              <el-button
45
+              size="mini"
46
+              type="primary"
47
+              v-if="scope.row.OrderNo !== 1 && tableData.length > 1"
48
+              @click="orderChange(scope.$index, scope.row, 'up')">上移</el-button>
49
+              <el-button
50
+              size="mini"
51
+              type="success"
52
+              v-if="scope.row.OrderNo !== tableData.length && tableData.length > 1"
53
+              @click="orderChange(scope.$index, scope.row, 'down')">下移</el-button>
54
+          </template>
55
+        </el-table-column>
56
+      </el-table>
23 57
     </div>
58
+    <el-pagination
59
+      @current-change="handleCurrentChange"
60
+      :current-page.sync="postData.currentPage"
61
+      :page-size="postData.pageSize"
62
+      layout="prev, pager, next, jumper"
63
+      :total="postData.total">
64
+    </el-pagination>
24 65
   </div>
25 66
 </template>
26 67
 
27 68
 <script>
28 69
 import tableSearch from '@/components/tableSearch/index'
29
-import { createNamespacedHelpers } from 'vuex'
30
-
31
-const { mapState: mapCaseState } = createNamespacedHelpers('case')
32
-
70
+import { mapState, createNamespacedHelpers, mapActions } from 'vuex'
71
+const { mapActions: mapCmsActions } = createNamespacedHelpers('cms')
33 72
 export default {
34 73
   name: '',
35 74
   data () {
36 75
     return {
37
-      data: [{
38
-        label: '根目录',
39
-        rank: '0',
40
-        img: '',
41
-        deleteCancel: true,
42
-        children: [{
43
-          label: '共享课程&书吧',
44
-          rank: '1',
45
-          deleteCancel: true,
46
-          img: '',
47
-          children: [{
48
-            label: '健身',
49
-            rank: '2',
50
-            img: 'http://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/upload/163306109741.png',
51
-          }, {
52
-            label: '健康',
53
-            rank: '3',
54
-            img: 'http://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/upload/163325263583.png',
55
-          }, {
56
-            label: '艺术',
57
-            rank: '4',
58
-            img: 'http://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/upload/104118813781.png',
59
-          }, {
60
-            label: '社交',
61
-            rank: '5',
62
-            img: 'http://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/upload/163339496588.png',
63
-          }, {
64
-            label: '教育',
65
-            rank: '6',
66
-            img: 'http://jingcheng-resourceplat.oss-cn-shanghai.aliyuncs.com/upload/163351586373.png',
67
-          }]
68
-        }]
69
-      }]
76
+      postData: {
77
+        currentPage: 1, // 当前页码
78
+        pageSize: 10,
79
+        total: 0,
80
+      },
81
+      tableData: []
70 82
     }
71 83
   },
72 84
   computed: {
73
-    ...mapCaseState({
74
-      caseList: x => x.caseList,
85
+    ...mapState({
86
+      positionList: x => x.cms.location
75 87
     })
76 88
   },
77 89
   components: {
78 90
     tableSearch,
79 91
   },
92
+  created () {
93
+    this.updateSystemInfo().then(() => {
94
+      this.getList()
95
+    })
96
+    this.updateLocationInfo()
97
+  },
80 98
   methods: {
81
-    handleNodeClick (node, data) { // 添加下级课程类型
82
-      console.log(node, data)
83
-      this.$router.push({ name: 'addFiveA', query: { label: data.label } })
99
+    ...mapCmsActions(['updateLocationInfo']),
100
+    ...mapActions(['updateSystemInfo']),
101
+    handleCurrentChange (val) {
102
+      this.postData.currentPage = val
103
+      this.getList()
84 104
     },
85
-    handleEdit (node, data) { // 编辑
86
-      console.log(node, data)
87
-      this.$router.push({ name: 'editFiveA', query: { label: data.label } })
105
+    handleEdit (index, row) { // 编辑
106
+      this.$router.push({ name: 'editFiveA', query: { id: row.LocationId } })
88 107
     },
89
-    handleDelete (node, data) { // 删除
90
-      console.log(node, data)
91
-      this.$confirm('确认删除此数据?', '提示', {
108
+    handleDelete (index, row) { // 删除
109
+      this.$confirm('确认删除此消息?', '提示', {
92 110
         confirmButtonText: '确定',
93 111
         cancelButtonText: '取消',
94 112
         type: 'warning'
95
-      }).then(() => {
96
-        this.$message({
97
-          type: 'success',
98
-          message: '删除成功!'
99
-        })
100
-      }).catch(() => {
113
+      }).then((res) => {
114
+        this.deleteLocation(row.LocationId)
115
+      }).catch((res) => {
101 116
         this.$message({
102 117
           type: 'info',
103 118
           message: '已取消删除'
104 119
         })
105 120
       })
106 121
     },
107
-    renderContent (h, { node, data, store }) {
108
-      // console.log(node)
109
-      return (
110
-        <span class="custom-tree-node">
111
-          <div class='tree-node-item'>{node.label}</div>
112
-          <div class='tree-node-item'>{node.data.rank}</div>
113
-          <div class='tree-node-item'>
114
-            <div class='tableImg'>
115
-              <img src={node.data.img}></img>
116
-            </div>
117
-          </div>
118
-          <div class='tree-node-item'>
119
-            <el-button size="mini" type="primary" on-click={() => this.handleNodeClick(node, data)}>添加下级课程类型</el-button>
120
-            <el-button size="mini" type="warning" on-click={() => this.handleEdit(node, data)}>编辑</el-button>
121
-            {node.data.deleteCancel ? (<div></div>) : (<el-button size="mini" type="danger" on-click={() => this.handleDelete(node, data)}>删除</el-button>)}
122
-          </div>
123
-        </span>)
122
+    addFiveA () {
123
+      this.$router.push({ name: 'addFiveA' })
124
+    },
125
+    getList () {
126
+      this.tableData = []
127
+      this.$ajax(this.$api.cms.location.url, {
128
+        method: this.$api.cms.location.method,
129
+        queryData: {
130
+          page: this.postData.currentPage,
131
+          pagesize: this.postData.pageSize,
132
+          issys: 0
133
+        }
134
+      }).then(res => {
135
+        console.log(res)
136
+        this.tableData = res
137
+      }).catch(msg => {
138
+
139
+      })
140
+    },
141
+    deleteLocation (id) {
142
+      this.$ajax(this.$api.cms.deleteLocation.url, {
143
+        method: this.$api.cms.deleteLocation.method,
144
+        urlData: {
145
+          id: id
146
+        }
147
+      }).then(res => {
148
+        console.log(res)
149
+        this.$message({
150
+          type: 'success',
151
+          message: '删除成功!'
152
+        })
153
+        this.getList()
154
+      }).catch(msg => {
155
+
156
+      })
157
+    },
158
+    orderChange (index, row, direction) {
159
+      let data
160
+      if (direction === 'up') {
161
+        let down = this.tableData[index - 1].LocationId
162
+        data = {
163
+          locations: row.LocationId + ':' + index + ',' + down + ':' + (index + 1)
164
+        }
165
+      } else {
166
+        let down = this.tableData[index + 1].LocationId
167
+        data = {
168
+          locations: row.LocationId + ':' + (index + 2) + ',' + down + ':' + (index + 1)
169
+        }
170
+      }
171
+      console.log(data)
172
+      this.$ajax(this.$api.cms.orderChange.url, {
173
+        method: this.$api.cms.orderChange.method,
174
+        urlData: {
175
+          id: row.LocationId
176
+        },
177
+        data: data
178
+      }).then(res => {
179
+        console.log(res)
180
+        this.getList()
181
+      }).catch(msg => {
182
+
183
+      })
124 184
     }
125 185
   }
126 186
 }
127 187
 </script>
128 188
 
129
-<style lang="scss">
130
-.custom-tree-node {
131
-  flex: 1;
132
-  display: flex;
133
-  align-items: center;
134
-  justify-content: space-around;
135
-  font-size: 14px;
136
-  padding-right: 8px;
137
-  .tree-node-item {
138
-    width: 20%;
139
-    text-align: center;
140
-  }
141
-  .tree-node-item:nth-of-type(4) {
142
-    min-width: 22rem;
143
-  }
144
-}
145
-.el-tree-node__content {
146
-  height: auto;
147
-}
148
-.table-title {
149
-  div {
150
-    padding: 1rem;
151
-    text-align: center;
152
-  }
153
-}
189
+<!-- Add "scoped" attribute to limit CSS to this component only -->
190
+<style lang="scss" scoped>
154 191
 </style>

+ 21
- 1
src/util/api.js Vedi File

@@ -204,10 +204,30 @@ const $api = {
204 204
     },
205 205
   },
206 206
   cms: {
207
-    location: { // 图片位置
207
+    location: { // 图片位置(5A)
208 208
       method: 'get',
209 209
       url: `${baseUrl}${common}/cms/location`
210 210
     },
211
+    locationDetail: { // 5A详情
212
+      method: 'get',
213
+      url: `${baseUrl}${common}/cms/location/:id`
214
+    },
215
+    addLocation: { // 添加5A
216
+      method: 'post',
217
+      url: `${baseUrl}${common}/cms/location`
218
+    },
219
+    editLocation: { // 编辑5A
220
+      method: 'put',
221
+      url: `${baseUrl}${common}/cms/location/:id`
222
+    },
223
+    deleteLocation: { // 删除5A
224
+      method: 'delete',
225
+      url: `${baseUrl}${common}/cms/location/:id`
226
+    },
227
+    orderChange: {
228
+      method: 'put',
229
+      url: `${baseUrl}${common}/cms/location/:id/sort`
230
+    },
211 231
     imageList: { // 轮播图列表
212 232
       method: 'get',
213 233
       url: `${baseUrl}${common}/cms/image`