Преглед изворни кода

Merge branch 'master' of http://git.ycjcjy.com/zhiyuxing/pc-admin

# Conflicts:
#	vue.config.js
傅行帆 пре 5 година
родитељ
комит
7faf6e69e2

+ 22
- 0
src/config/api.js Прегледај датотеку

@@ -140,6 +140,28 @@ const apis = {
140 140
       method: 'post',
141 141
       url: `${commPrefix}/customer/add`
142 142
     }
143
+  },
144
+  newsType: {
145
+    list: {
146
+      method: 'get',
147
+      url: `${commPrefix}/taNewsType`
148
+    },
149
+    add: {
150
+      method: 'post',
151
+      url: `${commPrefix}/taNewsType`
152
+    },
153
+    delete: {
154
+      method: 'delete',
155
+      url: `${commPrefix}/taNewsType/:id`
156
+    },
157
+    update: {
158
+      method: 'put',
159
+      url: `${commPrefix}/taNewsType/:id`
160
+    },
161
+    getById: {
162
+      method: 'get',
163
+      url: `${commPrefix}/taNewsType/:id`
164
+    }
143 165
   }
144 166
 }
145 167
 

+ 2
- 0
src/store/index.js Прегледај датотеку

@@ -2,6 +2,7 @@ import Vue from 'vue'
2 2
 import Vuex from 'vuex'
3 3
 import system from './system'
4 4
 import apartment from './modules/apartment'
5
+import news from './modules/news'
5 6
 Vue.use(Vuex)
6 7
 
7 8
 const store = new Vuex.Store({
@@ -14,6 +15,7 @@ const store = new Vuex.Store({
14 15
     building: require('./modules/building').default,
15 16
     img: require('./modules/img').default,
16 17
     goods: require('./modules/goods').default,
18
+    news
17 19
   }
18 20
 })
19 21
 

+ 76
- 0
src/store/modules/news.js Прегледај датотеку

@@ -0,0 +1,76 @@
1
+import apis from '../../config/api'
2
+import request from '../../utils/request'
3
+
4
+export default {
5
+    namespaced: true,
6
+    state: {
7
+        list: [],
8
+        detail: []
9
+    },
10
+    mutations: {
11
+
12
+    },
13
+    actions: {
14
+        getTypeList({ commit }, payload) { // 查询所有资迅类型
15
+           return  new Promise((resolve, reject) => {
16
+               request({
17
+                   ...apis.newsType.list,
18
+                   params: payload,
19
+               }).then((data) => {
20
+                   resolve(data)
21
+               }).catch((err) => {
22
+                   reject(err)
23
+               })
24
+           })
25
+        },
26
+        getTypeById({ commit }, payload) { // 根据Id查询资迅类型
27
+            return  new Promise((resolve, reject) => {
28
+                request({
29
+                    ...apis.newsType.getById,
30
+                    urlData: { id: payload.newsTypeId },
31
+                }).then((data) => {
32
+                    resolve(data)
33
+                }).catch((err) => {
34
+                    reject(err)
35
+                })
36
+            })
37
+        },
38
+        addType({ commit }, payload) { // 添加类型
39
+            return  new Promise((resolve, reject) => {
40
+                request({
41
+                    ...apis.newsType.add,
42
+                    data: payload,
43
+                }).then((data) => {
44
+                    resolve(data)
45
+                }).catch((err) => {
46
+                    reject(err)
47
+                })
48
+            })
49
+        },
50
+        updateType({ commit }, payload) { // 修改类型
51
+            return  new Promise((resolve, reject) => {
52
+                request({
53
+                    ...apis.newsType.update,
54
+                    urlData:{ id: payload.newsTypeId },
55
+                    data:payload
56
+                }).then((data) => {
57
+                    resolve(data)
58
+                }).catch((err) => {
59
+                    reject(err)
60
+                })
61
+            })
62
+        },
63
+        deleteType({ commit }, payload) { // 删除类型
64
+            return  new Promise((resolve, reject) => {
65
+                request({
66
+                    ...apis.newsType.delete,
67
+                    urlData: { id: payload.newsTypeId },
68
+                }).then((data) => {
69
+                    resolve(data)
70
+                }).catch((err) => {
71
+                    reject(err)
72
+                })
73
+            })
74
+        }
75
+    }
76
+}

+ 228
- 0
src/views/carouselFigure/advertisement.vue Прегледај датотеку

@@ -0,0 +1,228 @@
1
+<template>
2
+  <div>
3
+    <div class="system-table-search">
4
+      <div class="flex-h">
5
+        <div class="flex-item flex-h">
6
+          <el-button size="mini" type="success" @click='addDynamic'>新增</el-button>
7
+        </div>
8
+      </div>
9
+      <div class="moreFilter"></div>
10
+    </div>
11
+    <el-table
12
+      :data="dynamics.list || []"
13
+      >
14
+      <el-table-column
15
+        type="index">
16
+        <template slot-scope="scope">
17
+          <span>{{ GetIndex(scope.$index) }}</span>
18
+        </template>
19
+      </el-table-column>
20
+      <el-table-column
21
+        label="主图">
22
+        <template slot-scope="scope">
23
+          <div class="header">
24
+            <img :src="scope.row.imgUrl" alt="" />
25
+          </div>
26
+        </template>
27
+      </el-table-column>
28
+      <el-table-column
29
+        prop="title"
30
+        label="类型">
31
+      </el-table-column>
32
+      <el-table-column
33
+        prop="createDate"
34
+        label="发布时间">
35
+      </el-table-column>
36
+      <el-table-column
37
+        label="状态"
38
+        >
39
+        <template slot-scope="scope">
40
+          <span>{{scope.row.status == 1 ? '启用' : '停用'}}</span>
41
+        </template>
42
+      </el-table-column>
43
+      <el-table-column
44
+        fixed="right"
45
+        label="操作"
46
+        width="180">
47
+        <template slot-scope="scope">
48
+          <el-button type="text" @click="handleEdit(scope.row)" v-if="scope.row.status === 0" size="small">编辑</el-button>
49
+          <el-button type="text" @click="handlePulic(scope.row)" size="small" v-if="scope.row.status === 0">启用</el-button>
50
+          <el-button type="text" @click="handleUnPulic(scope.row)" size="small" v-if="scope.row.status === 1">禁用</el-button>
51
+
52
+        </template>
53
+      </el-table-column>
54
+    </el-table>
55
+    <el-pagination
56
+      small
57
+      style="margin-top:10px;"
58
+      layout="prev, pager, next"
59
+      :current-page.sync="currentPage"
60
+      :pageSize="pageSize"
61
+      :total="dynamics.total || 0"
62
+      @current-change="getList"
63
+    >
64
+    </el-pagination>
65
+  </div>
66
+</template>
67
+
68
+<script>
69
+import { createNamespacedHelpers } from 'vuex';
70
+
71
+const {mapState: mapDynamicState, mapActions: mapDynamicActions} = createNamespacedHelpers('dynamic')
72
+const {mapState: mapBuildingState, mapActions: mapBuildingActions} = createNamespacedHelpers('building')
73
+
74
+export default {
75
+  data() {
76
+    return {
77
+      pageSize: 20,
78
+      currentPage: 1,
79
+      name: '',
80
+      buildingId: '',
81
+    }
82
+  },
83
+  computed: {
84
+    ...mapDynamicState({
85
+      dynamics: x => x.dynamics
86
+    }),
87
+    ...mapBuildingState({
88
+      buildings: x => x.buildings
89
+    })
90
+  },
91
+  methods: {
92
+    ...mapDynamicActions([
93
+      'getDynamics',
94
+      'setDetailNull',
95
+      'deleteDynamics',
96
+      'publicDynamic',
97
+      'cancelDynamic'
98
+    ]),
99
+    ...mapBuildingActions([
100
+      'getBuildings',
101
+    ]),
102
+    GetIndex (inx) {
103
+      return (this.currentPage - 1) * this.pageSize + inx + 1
104
+    },
105
+    FormatDate (date) {
106
+      if (date) {
107
+        return dayjs(date).formate('yyyy-MM-DD HH:mm:ss')
108
+      } else {
109
+        return ''
110
+      }
111
+    },
112
+    getList () {
113
+      this.getDynamics({
114
+        pageNum: this.currentPage,
115
+        pageSize: this.pageSize,
116
+        name: this.name,
117
+        buildingId: this.buildingId
118
+      })
119
+    },
120
+    getBuildingName (id) {
121
+      return ((this.buildings.list || []).filter(x => x.buildingId === id)[0] || {}).buildingName || ''
122
+    },
123
+    search () {
124
+      this.currentPage = 1
125
+      this.getList()
126
+    },
127
+    handleEdit (row) {
128
+      this.setDetailNull()
129
+      this.$router.push({name: 'advertisementEdit', query: {id: row.dynamicId}})
130
+    },
131
+    handlePulic (row) {
132
+      this.$confirm('确认发布此数据?', '提示', {
133
+        confirmButtonText: '确定',
134
+        cancelButtonText: '取消',
135
+        type: 'warning'
136
+      }).then(() => {
137
+        this.publicDynamic({
138
+          id: row.dynamicId
139
+        }).then(() => {
140
+          this.getList()
141
+        })
142
+      })
143
+    },
144
+    handleUnPulic (row) {
145
+      this.$confirm('确认取消发布此数据?', '提示', {
146
+        confirmButtonText: '确定',
147
+        cancelButtonText: '取消',
148
+        type: 'warning'
149
+      }).then(() => {
150
+        this.cancelDynamic({
151
+          id: row.dynamicId}).then(() => {
152
+          this.getList()
153
+        })
154
+      })
155
+    },
156
+    handleDel (row) {
157
+      this.$confirm('确认删除此数据?', '提示', {
158
+        confirmButtonText: '确定',
159
+        cancelButtonText: '取消',
160
+        type: 'warning'
161
+      }).then(() => {
162
+        if (row.status === 1) {
163
+          this.$message.error('当前活动处于发布状态,不允许删除!')
164
+          return false
165
+        }
166
+        this.deleteDynamics({
167
+          id: row.dynamicId
168
+        }).then(() => {
169
+          this.getList()
170
+        })
171
+      })
172
+    },
173
+    addDynamic () {
174
+      this.setDetailNull()
175
+      this.$router.push({name: 'advertisementEdit'})
176
+    }
177
+  },
178
+  created () {
179
+    this.getBuildings({
180
+      pageNum: 1,
181
+      pageSize: 100,
182
+    }).then(() => {
183
+      this.getList()
184
+    })
185
+  }
186
+}
187
+</script>
188
+
189
+<style lang="scss" scoped>
190
+.header{
191
+  width: 50px;
192
+  height: 50px;
193
+  img{
194
+    width: 100%;
195
+    height: 100%;
196
+  }
197
+}
198
+
199
+.system-table-search{
200
+  width: calc(100% - 40px);
201
+  margin: 20px auto 0;
202
+}
203
+
204
+.system-table-search li{
205
+  margin-right: 20px;
206
+}
207
+
208
+.system-table-search ul{
209
+  font-size: 0;
210
+  white-space: nowrap;
211
+}
212
+
213
+.system-table-search ul>li{
214
+  display: inline-block;
215
+}
216
+
217
+.flex-h {
218
+  display: flex;
219
+  display: -webkit-flex;
220
+}
221
+
222
+.flex-item {
223
+  flex: 1;
224
+  -webkit-flex: 1;
225
+  position: relative;
226
+  overflow: hidden;
227
+}
228
+</style>

+ 454
- 0
src/views/carouselFigure/advertisementEdit.vue Прегледај датотеку

@@ -0,0 +1,454 @@
1
+<template>
2
+    <div class="edit-carousel">
3
+      <el-form ref="form" :model="building" label-width="180px">
4
+        <el-form-item label="所属项目:">
5
+          <el-select v-model="buildingProperty" multiple placeholder="请选择">
6
+            <el-option v-for="(t,i) in propertyType" :key="i" :label="t.name" :value="t.id"></el-option>
7
+          </el-select>
8
+        </el-form-item>
9
+        <el-form-item label="主图:">
10
+          <el-upload
11
+            :action="upFileUrl"
12
+            name='file'
13
+            list-type="picture-card"
14
+            :headers="uploadHeaders"
15
+            :file-list="imgList"
16
+            :show-file-list="true"
17
+            :before-upload="beforeImgUpload"
18
+            :on-success="handleAvatarSuccess"
19
+            :on-remove="handleRemove">
20
+            <i class="el-icon-plus"></i>
21
+          </el-upload>
22
+          <el-dialog :visible.sync="dialogVisible">
23
+            <img width="100%" :src="dialogImageUrl" alt="">
24
+          </el-dialog>
25
+        </el-form-item>
26
+        <el-form-item label="标题:">
27
+          <el-input v-model="building.tel"></el-input>
28
+        </el-form-item>
29
+        <el-form-item label="类型:">
30
+          <el-select v-model="buildingProperty" multiple placeholder="请选择">
31
+            <el-option v-for="(t,i) in propertyType" :key="i" :label="t.name" :value="t.id"></el-option>
32
+          </el-select>
33
+        </el-form-item>
34
+        <el-form-item label="发布内容:">
35
+          <div id="websiteEditorElem" style="height: 400px"></div>
36
+        </el-form-item>
37
+        <el-form-item label="发布内容:" class="publish">
38
+          <p>活动名称展示处<span class="choose" v-popover:popover4>{{showPlace?showPlace:'请选择'}}</span></p>
39
+          <el-popover ref="popover4"  placement="right"  width="560" v-model="popover4"  trigger="click">
40
+            <el-table :data="gridData">
41
+            <el-table-column width="360" property="name" label="标题"></el-table-column>
42
+            <el-table-column width="200" label="操作">
43
+              <template slot-scope="scope">
44
+                <el-button type="text" @click="handleEdit(scope.row)" size="small">选择</el-button>
45
+        </template>
46
+            </el-table-column>
47
+            </el-table>
48
+          </el-popover>
49
+        </el-form-item>
50
+        <el-form-item label="状态:">
51
+          <el-select v-model="buildingProperty" multiple placeholder="请选择">
52
+            <el-option v-for="(t,i) in propertyType" :key="i" :label="t.name" :value="t.id"></el-option>
53
+          </el-select>
54
+        </el-form-item>
55
+        <el-form-item>
56
+          <el-button type="primary" @click="onSubmit">保存</el-button>
57
+          <el-button @click="onCancel">取消</el-button>
58
+        </el-form-item>
59
+      </el-form>
60
+    </div>    
61
+</template>
62
+
63
+<script>
64
+import { createNamespacedHelpers } from "vuex";
65
+import apis from "../../config/api";
66
+import { mapState } from "vuex";
67
+import E from "wangeditor";
68
+
69
+const {
70
+  mapState: mapBuildingState,
71
+  mapActions: mapBuildingActions,
72
+  mapMutations: mapBuildingMutations
73
+} = createNamespacedHelpers("building");
74
+
75
+const { mapActions: mapApartmentActions } = createNamespacedHelpers(
76
+  "apartment"
77
+);
78
+
79
+const { mapActions: mapImgActions } = createNamespacedHelpers("img");
80
+
81
+export default {
82
+  data() {
83
+    var _self = this;
84
+    return {
85
+      popover4:false,//弹框
86
+      showPlace:'',//活动名称展示处
87
+      gridData: [
88
+        {
89
+          date: "2016-05-02",
90
+          name: "高奢生活,在遇到它之前你想象不到"
91
+        },
92
+        {
93
+          date: "2016-05-04",
94
+          name: "欢乐套圈圈,福利大放送"
95
+        },
96
+        {
97
+          date: "2016-05-01",
98
+          name: "上海市普陀区金沙江路 1518 弄"
99
+        }
100
+      ],
101
+      upFileUrl: apis.file.upload.url,
102
+      commPrefix: "",
103
+      imgurl: "",
104
+      loadingZm: false,
105
+      activeName: "detail",
106
+      dialogImageUrl: "",
107
+      dialogVisible: false,
108
+      dialogApartImageUrl: "",
109
+      dialogApartVisible: false,
110
+      showHx: false,
111
+      imgList: [],
112
+      tags: [],
113
+      buildingProperty: [],
114
+      aparments: [],
115
+      aparmentInfo: {},
116
+      aparmentImg: [],
117
+      saleType: [
118
+        {
119
+          id: 1,
120
+          name: "待定"
121
+        },
122
+        {
123
+          id: 2,
124
+          name: "售罄"
125
+        },
126
+        {
127
+          id: 3,
128
+          name: "在售"
129
+        }
130
+      ]
131
+    };
132
+  },
133
+  computed: {
134
+    ...mapBuildingState({
135
+      detail: x => x.detail
136
+    }),
137
+    ...mapState({
138
+      dicts: x => x.dicts
139
+    }),
140
+    building: {
141
+      get() {
142
+        return this.detail;
143
+      },
144
+      set(val) {
145
+        return this.updateDetail(val);
146
+      }
147
+    },
148
+    propertyType() {
149
+      return (this.dicts || []).filter(x => x.type === "propertyType");
150
+    },
151
+    uploadHeaders() {
152
+      const token = localStorage.getItem("x-token") || "";
153
+      return {
154
+        Authorization: `Bearer ${token}`
155
+      };
156
+    }
157
+  },
158
+  methods: {
159
+    ...mapBuildingMutations(["updateDetail"]),
160
+    ...mapBuildingActions(["getDetail", "addBuilding", "editBuilding"]),
161
+    ...mapApartmentActions([
162
+      "getApartments",
163
+      "getApartmentDetail",
164
+      "addApartment",
165
+      "editApartment",
166
+      "deleteApartment"
167
+    ]),
168
+    ...mapImgActions(["uploadImg"]),
169
+    getSaleTypeName(id) {
170
+      return (this.saleType.filter(x => x.id == id)[0] || {}).name;
171
+    },
172
+    onCancel() {
173
+      this.$router.push({ name: "buildinglist" });
174
+    },
175
+    handleRemove(file, fileList) {
176
+      this.imgList = fileList;
177
+    },
178
+    handleAparmentRemove(file, fileList) {
179
+      this.aparmentImg = fileList;
180
+    },
181
+
182
+    beforeImgUpload(file) {
183
+      if (file.type !== "image/jpeg" && file.type !== "image/png") {
184
+        this.$message.error("上传图片只能是 JPG 或 PNG 格式!");
185
+        return false;
186
+      }
187
+      // if (file.size / 1024 > 300) {
188
+      //   this.$message.error('图片大小不允许超过300k!')
189
+      //   return false
190
+      // }
191
+      this.loading = this.$loading({
192
+        lock: true,
193
+        text: "上传中...",
194
+        spinner: "el-icon-loading",
195
+        background: "rgba(0, 0, 0, 0.7)"
196
+      });
197
+
198
+      return true;
199
+    },
200
+    handleAvatarSuccess(res) {
201
+      this.imgList = [
202
+        ...this.imgList,
203
+        {
204
+          url: res.data
205
+        }
206
+      ];
207
+      this.loading.close();
208
+    },
209
+    handleMapImgSuccess(res) {
210
+      this.building = { ...this.building, mapImg: res.data };
211
+      this.loading.close();
212
+    },
213
+    handlePosterSuccess(res) {
214
+      this.building = { ...this.building, poster: res.data };
215
+      this.loading.close();
216
+    },
217
+    handleAparmentSuccess(res) {
218
+      this.aparmentImg = [
219
+        ...this.aparmentImg,
220
+        {
221
+          url: res.data
222
+        }
223
+      ];
224
+      this.loading.close();
225
+    },
226
+    onSubmit() {
227
+      const imgs = this.imgList.map((x, i) => {
228
+        return {
229
+          imgType: "banner",
230
+          url: x.url,
231
+          orderNo: i + 1
232
+        };
233
+      });
234
+      const tag = this.tags.map(x => {
235
+        return {
236
+          tagName: x
237
+        };
238
+      });
239
+      const building = {
240
+        ...this.building,
241
+        img: imgs,
242
+        propertyType: this.buildingProperty.join(","),
243
+        tag
244
+      };
245
+      if (!building.buildingId) {
246
+        // 新增
247
+        this.addBuilding({
248
+          onSuccess: this.onCancel,
249
+          detail: JSON.stringify(building)
250
+        });
251
+      } else {
252
+        // 修改
253
+        this.editBuilding({
254
+          onSuccess: this.onCancel,
255
+          detail: JSON.stringify(building)
256
+        });
257
+      }
258
+    },
259
+    FormatDate(date) {
260
+      return (date || "").split("T")[0] === "0001-01-01"
261
+        ? ""
262
+        : (date || "").split("T")[0];
263
+    },
264
+    saveAparment() {
265
+      const imgs = this.aparmentImg.map((x, i) => {
266
+        return {
267
+          imgType: "aparment",
268
+          url: x.url,
269
+          orderNo: i + 1
270
+        };
271
+      });
272
+      if (!this.aparmentInfo.apartmentId) {
273
+        this.addApartment(
274
+          JSON.stringify({
275
+            ...this.aparmentInfo,
276
+            img: imgs
277
+          })
278
+        ).then(() => {
279
+          this.getAparmentList();
280
+          this.showHx = false;
281
+        });
282
+      } else {
283
+        this.editApartment(
284
+          JSON.stringify({
285
+            ...this.aparmentInfo,
286
+            img: imgs
287
+          })
288
+        ).then(() => {
289
+          this.getAparmentList();
290
+          this.showHx = false;
291
+        });
292
+      }
293
+    },
294
+    addHx() {
295
+      this.aparmentImg = [];
296
+      this.aparmentInfo = { buildingId: this.building.buildingId };
297
+      this.showHx = true;
298
+    },
299
+    getAparmentList() {
300
+      this.getApartments({ buildingId: this.$route.query.id }).then(data => {
301
+        this.aparments = data;
302
+      });
303
+    },
304
+    handleEdit(row){
305
+      this.showPlace = row.name
306
+      this.popover4 = false
307
+
308
+
309
+    },
310
+    // handleEdit(row) {
311
+    //   this.aparmentImg = [];
312
+    //   this.getApartmentDetail({
313
+    //     id: row.apartmentId
314
+    //   }).then(data => {
315
+    //     console.log("...", data);
316
+    //     this.aparmentImg = data.buildingImgList.map(x => {
317
+    //       return {
318
+    //         name: x.imgId,
319
+    //         url: x.url
320
+    //       };
321
+    //     });
322
+    //     this.aparmentInfo = data;
323
+    //     this.showHx = true;
324
+    //   });
325
+    // },
326
+    handleDel(row) {
327
+      this.$confirm("确认删除此数据?", "提示", {
328
+        confirmButtonText: "确定",
329
+        cancelButtonText: "取消",
330
+        type: "warning"
331
+      }).then(() => {
332
+        if (this.building.status === 1) {
333
+          this.$message.error("当前楼盘处于发布状态,不允许删除!");
334
+          return false;
335
+        }
336
+        this.deleteApartment({
337
+          id: row.apartmentId
338
+        }).then(() => {
339
+          this.getAparmentList();
340
+        });
341
+      });
342
+    }
343
+  },
344
+  mounted() {
345
+    const _that = this;
346
+    const phoneEditor = new E("#websiteEditorElem");
347
+    phoneEditor.customConfig.onchange = function(html) {
348
+      _that.building = { ..._that.building, remark: html };
349
+    };
350
+    phoneEditor.customConfig.customUploadImg = function(files, insert) {
351
+      _that.uploadImg(files[0]).then(data => {
352
+        insert(data[0]);
353
+      });
354
+    };
355
+    phoneEditor.customConfig.menus = [
356
+      "head", // 标题
357
+      "bold", // 粗体
358
+      "fontSize", // 字号
359
+      "fontName", // 字体
360
+      "italic", // 斜体
361
+      "underline", // 下划线
362
+      "strikeThrough", // 删除线
363
+      "foreColor", // 文字颜色
364
+      "backColor", // 背景颜色
365
+      "justify", // 对齐方式
366
+      "image" // 插入图片
367
+    ];
368
+    phoneEditor.create();
369
+    if ((this.$route.query.id || "") !== "") {
370
+      this.getAparmentList();
371
+      window.console.log(this.getDetail);
372
+      this.getDetail({ id: this.$route.query.id }).then(data => {
373
+        this.buildingProperty = data.propertyType.split(",");
374
+        phoneEditor.txt.html(data.remark);
375
+        this.imgList = data.buildingImg.map(x => {
376
+          return {
377
+            name: x.imgId,
378
+            url: x.url
379
+          };
380
+        });
381
+        this.tags = data.buildingTag.map(x => x.tagName);
382
+      });
383
+    } else {
384
+      phoneEditor.txt.html("");
385
+    }
386
+  }
387
+};
388
+</script>
389
+
390
+<style lang="scss">
391
+.header {
392
+  width: 50px;
393
+  height: 50px;
394
+  img {
395
+    width: 100%;
396
+    height: 100%;
397
+  }
398
+}
399
+.avatar-uploader .el-upload {
400
+  border: 1px dashed #d9d9d9;
401
+  border-radius: 6px;
402
+  cursor: pointer;
403
+  position: relative;
404
+  overflow: hidden;
405
+}
406
+.avatar-uploader .el-upload:hover {
407
+  border-color: #409eff;
408
+}
409
+.avatar-uploader-icon {
410
+  font-size: 28px;
411
+  color: #8c939d;
412
+  width: 178px;
413
+  height: 178px;
414
+  line-height: 178px;
415
+  text-align: center;
416
+}
417
+.avatar {
418
+  width: 178px;
419
+  height: 178px;
420
+  display: block;
421
+}
422
+.edit-carousel {
423
+  .el-select {
424
+    max-width: 300px !important;
425
+  }
426
+  .el-input {
427
+    max-width: 400px;
428
+  }
429
+  .publish {
430
+    p {
431
+      margin: 0;
432
+      font-size: 15.4px;
433
+      .choose {
434
+        color: blue;
435
+        margin-left: 15px;
436
+      }
437
+    }
438
+  }
439
+}
440
+.el-popover {
441
+  z-index: 10004 !important;
442
+  .el-table .cell{
443
+    text-align: center;
444
+  }
445
+}
446
+
447
+.el-select-dropdown {
448
+  z-index: 10003 !important;
449
+}
450
+
451
+.el-date-picker {
452
+  z-index: 10002 !important;
453
+}
454
+</style>

+ 58
- 19
src/views/carouselFigure/edit.vue Прегледај датотеку

@@ -40,7 +40,17 @@
40 40
           <div id="websiteEditorElem" style="height: 400px"></div>
41 41
         </el-form-item>
42 42
         <el-form-item label="发布内容:" class="publish">
43
-          <p>活动名称展示处 <span class="choose">请选择</span></p>
43
+          <p>活动名称展示处<span class="choose" v-popover:popover4>{{showPlace?showPlace:'请选择'}}</span></p>
44
+          <el-popover ref="popover4"  placement="right"  width="560" v-model="popover4"  trigger="click">
45
+            <el-table :data="gridData">
46
+            <el-table-column width="360" property="name" label="标题"></el-table-column>
47
+            <el-table-column width="200" label="操作">
48
+              <template slot-scope="scope">
49
+                <el-button type="text" @click="handleEdit(scope.row)" size="small">选择</el-button>
50
+        </template>
51
+            </el-table-column>
52
+            </el-table>
53
+          </el-popover>
44 54
         </el-form-item>
45 55
         <el-form-item label="状态:">
46 56
           <el-select v-model="buildingProperty" multiple placeholder="请选择">
@@ -77,6 +87,22 @@ export default {
77 87
   data() {
78 88
     var _self = this;
79 89
     return {
90
+      popover4:false,//弹框
91
+      showPlace:'',//活动名称展示处
92
+      gridData: [
93
+        {
94
+          date: "2016-05-02",
95
+          name: "高奢生活,在遇到它之前你想象不到"
96
+        },
97
+        {
98
+          date: "2016-05-04",
99
+          name: "欢乐套圈圈,福利大放送"
100
+        },
101
+        {
102
+          date: "2016-05-01",
103
+          name: "上海市普陀区金沙江路 1518 弄"
104
+        }
105
+      ],
80 106
       upFileUrl: apis.file.upload.url,
81 107
       commPrefix: "",
82 108
       imgurl: "",
@@ -280,22 +306,28 @@ export default {
280 306
         this.aparments = data;
281 307
       });
282 308
     },
283
-    handleEdit(row) {
284
-      this.aparmentImg = [];
285
-      this.getApartmentDetail({
286
-        id: row.apartmentId
287
-      }).then(data => {
288
-        console.log("...", data);
289
-        this.aparmentImg = data.buildingImgList.map(x => {
290
-          return {
291
-            name: x.imgId,
292
-            url: x.url
293
-          };
294
-        });
295
-        this.aparmentInfo = data;
296
-        this.showHx = true;
297
-      });
309
+    handleEdit(row){
310
+      this.showPlace = row.name
311
+      this.popover4 = false
312
+
313
+
298 314
     },
315
+    // handleEdit(row) {
316
+    //   this.aparmentImg = [];
317
+    //   this.getApartmentDetail({
318
+    //     id: row.apartmentId
319
+    //   }).then(data => {
320
+    //     console.log("...", data);
321
+    //     this.aparmentImg = data.buildingImgList.map(x => {
322
+    //       return {
323
+    //         name: x.imgId,
324
+    //         url: x.url
325
+    //       };
326
+    //     });
327
+    //     this.aparmentInfo = data;
328
+    //     this.showHx = true;
329
+    //   });
330
+    // },
299 331
     handleDel(row) {
300 332
       this.$confirm("确认删除此数据?", "提示", {
301 333
         confirmButtonText: "确定",
@@ -399,16 +431,23 @@ export default {
399 431
   .el-input {
400 432
     max-width: 400px;
401 433
   }
402
-  .publish{
403
-    p{
434
+  .publish {
435
+    p {
404 436
       margin: 0;
405 437
       font-size: 15.4px;
406
-      .choose{
438
+      .choose {
407 439
         color: blue;
440
+        margin-left: 15px;
408 441
       }
409 442
     }
410 443
   }
411 444
 }
445
+.el-popover {
446
+  z-index: 10004 !important;
447
+  .el-table .cell{
448
+    text-align: center;
449
+  }
450
+}
412 451
 
413 452
 .el-select-dropdown {
414 453
   z-index: 10003 !important;

+ 1
- 1
src/views/carouselFigure/list.vue Прегледај датотеку

@@ -31,7 +31,7 @@
31 31
       </el-table-column>
32 32
       <el-table-column
33 33
         prop="desc"
34
-        label="发布位置2">
34
+        label="发布位置">
35 35
       </el-table-column>
36 36
       <el-table-column
37 37
         prop="createDate"

+ 235
- 0
src/views/customer/editCustomer.vue Прегледај датотеку

@@ -0,0 +1,235 @@
1
+<template>
2
+  <div>
3
+    <div class="form-wrapper">
4
+      <el-form label-width="200px" :model="detail">
5
+        <el-form-item label="意向项目:">
6
+          <el-input v-model="detail.name"></el-input>
7
+        </el-form-item>
8
+        <el-form-item label="客户照片:">
9
+        <el-upload
10
+            :action="upFileUrl"
11
+            name='file'
12
+            list-type="picture-card"
13
+            :headers="uploadHeaders"
14
+            :file-list="imgList"
15
+            :show-file-list="true"
16
+            :before-upload="beforeImgUpload"
17
+            :on-success="handleAvatarSuccess"
18
+            :on-remove="handleRemove">
19
+            <i class="el-icon-plus"></i>
20
+          </el-upload>
21
+          <el-dialog :visible.sync="dialogVisible">
22
+            <img width="100%" :src="dialogImageUrl" alt="">
23
+          </el-dialog>
24
+      </el-form-item>
25
+        <el-form-item label="客户姓名:">
26
+          <el-input v-model="detail.company"></el-input>
27
+        </el-form-item>
28
+        <el-form-item label="客户电话:">
29
+          <el-input v-model="detail.department"></el-input>
30
+        </el-form-item>
31
+        <el-form-item label="客户性别:">
32
+          <el-radio-group v-model="detail.isMain">
33
+            <el-radio :label="1">男</el-radio>
34
+            <el-radio :label="0">女</el-radio>
35
+          </el-radio-group>
36
+        </el-form-item>
37
+        <el-form-item label="预约到访时间:">
38
+          <el-input v-model="detail.department"></el-input>
39
+        </el-form-item>
40
+        <el-form-item label="到访人数:">
41
+          <el-input v-model="detail.department"></el-input>
42
+        </el-form-item>
43
+        <el-form-item label="客户描述:">
44
+            <el-input type="textarea" :rows="5"  v-model="detail.introduction"></el-input>
45
+        </el-form-item>
46
+        <el-form-item label="物业类型:">
47
+          <el-input v-model="detail.department"></el-input>
48
+        </el-form-item>
49
+        <el-form-item label="需求类型:">
50
+          <el-input v-model="detail.department"></el-input>
51
+        </el-form-item>
52
+        <el-form-item label="价格区间:">
53
+          <el-input v-model="detail.department"></el-input>
54
+        </el-form-item>
55
+        <el-form-item label="状态:">
56
+          <el-select v-model="detail.buildings" placeholder="请选择">
57
+            <el-option v-for="(build,i) in buildings.list || []" :key="i" :label="build.buildingName" :value="build.buildingId"></el-option>
58
+          </el-select>
59
+        </el-form-item>
60
+        <el-form-item>
61
+          <el-button type="primary" @click="submitForm">保存</el-button>
62
+          <el-button @click="$router.go(-1)">返回</el-button>
63
+        </el-form-item>
64
+      </el-form>
65
+    </div>
66
+  </div>
67
+</template>
68
+
69
+<script>
70
+import { createNamespacedHelpers } from "vuex";
71
+import apis from "../../config/api";
72
+import E from "wangeditor";
73
+
74
+const { mapActions: mapPersonActions } = createNamespacedHelpers("persons");
75
+const {
76
+  mapState: mapBuildingState,
77
+  mapActions: mapBuildingActions
78
+} = createNamespacedHelpers("building");
79
+export default {
80
+  name: "consultantEdit",
81
+  data() {
82
+    return {
83
+      upFileUrl: apis.file.upload.url,
84
+      detail: {
85
+        name: undefined,
86
+        company: undefined,
87
+        department: undefined,
88
+        post: undefined,
89
+        tel: undefined,
90
+        photo: undefined,
91
+        status: 1,
92
+        buildings: []
93
+      },
94
+      imgList: [],
95
+      dialogVisible: false,
96
+      dialogImageUrl: "",
97
+      
98
+    };
99
+  },
100
+  created() {
101
+    this.init();
102
+  },
103
+  computed: {
104
+    ...mapBuildingState({
105
+      buildings: x => x.buildings
106
+    }),
107
+    uploadHeaders() {
108
+      const token = localStorage.getItem("x-token") || "";
109
+      return {
110
+        Authorization: `Bearer ${token}`
111
+      };
112
+    }
113
+  },
114
+  methods: {
115
+    ...mapBuildingActions(["getBuildings"]),
116
+    ...mapPersonActions(["getConsultant", "editConsultant"]),
117
+
118
+    init() {
119
+      if (this.$route.params.id) {
120
+        this.getConsultant({ id: this.$route.params.id }).then(data => {
121
+          this.detail = data;
122
+        });
123
+      }
124
+    },
125
+
126
+    beforeImgUpload(file) {
127
+      if (file.type !== "image/jpeg" && file.type !== "image/png") {
128
+        this.$message.error("上传图片只能是 JPG 或 PNG 格式!");
129
+        return false;
130
+      }
131
+      // if (file.size / 1024 > 300) {
132
+      //   this.$message.error('图片大小不允许超过300k!')
133
+      //   return false
134
+      // }
135
+      this.loading = this.$loading({
136
+        lock: true,
137
+        text: "上传中...",
138
+        spinner: "el-icon-loading",
139
+        background: "rgba(0, 0, 0, 0.7)"
140
+      });
141
+
142
+      return true;
143
+    },
144
+    handleAvatarSuccess(res) {
145
+      this.imgList = [
146
+        ...this.imgList,
147
+        {
148
+          url: res.data
149
+        }
150
+      ];
151
+      this.hideLoadding();
152
+    },
153
+    handleRemove(file, fileList) {
154
+      this.imgList = fileList;
155
+    },
156
+    submitForm() {
157
+      this.showLoadding("保存中...");
158
+      this.editConsultant(this.detail)
159
+        .then(res => {
160
+          if (res.personId) {
161
+            this.detail = res;
162
+          }
163
+
164
+          this.hideLoadding();
165
+          this.$notify.info("保存成功");
166
+        })
167
+        .catch(err => {
168
+          this.hideLoadding();
169
+          this.$notify.error(err.message);
170
+        });
171
+    },
172
+
173
+    showLoadding(text) {
174
+      this.loading = this.$loading({
175
+        text,
176
+        lock: true,
177
+        spinner: "el-icon-loading",
178
+        background: "rgba(255, 255, 255, 0.7)"
179
+      });
180
+    },
181
+
182
+    hideLoadding() {
183
+      if (this.loading) this.loading.close();
184
+    }
185
+  },
186
+  mounted() {
187
+    const _that = this;
188
+
189
+    this.getBuildings({
190
+      pageNum: 1,
191
+      pageSize: 100
192
+    }).then(() => {
193
+      if ((this.$route.query.id || "") !== "") {
194
+        this.getDetail({ id: this.$route.query.id }).then(data => {});
195
+      }
196
+    });
197
+  }
198
+};
199
+</script>
200
+
201
+<style lang="scss" scoped>
202
+.form-wrapper {
203
+  width: 60%;
204
+}
205
+</style>
206
+
207
+<style lang="scss">
208
+.avatar-uploader .el-upload {
209
+  border: 1px dashed #d9d9d9;
210
+  border-radius: 6px;
211
+  cursor: pointer;
212
+  position: relative;
213
+  overflow: hidden;
214
+}
215
+.avatar-uploader .el-upload:hover {
216
+  border-color: #409eff;
217
+}
218
+.avatar-uploader-icon {
219
+  font-size: 28px;
220
+  color: #8c939d;
221
+  width: 178px;
222
+  height: 178px;
223
+  line-height: 178px;
224
+  text-align: center;
225
+}
226
+.avatar {
227
+  width: 178px;
228
+  height: 178px;
229
+  display: block;
230
+}
231
+.choose {
232
+  color: blue;
233
+  margin-left: 15px;
234
+}
235
+</style>

+ 293
- 0
src/views/customer/editRecommend.vue Прегледај датотеку

@@ -0,0 +1,293 @@
1
+<template>
2
+  <div>
3
+    <div class="form-wrapper">
4
+      <el-form label-width="200px" :model="detail">
5
+        <el-form-item label="意向项目:">
6
+          <el-input v-model="detail.name"></el-input>
7
+        </el-form-item>
8
+        <el-form-item label="客户照片:">
9
+        <el-upload
10
+            :action="upFileUrl"
11
+            name='file'
12
+            list-type="picture-card"
13
+            :headers="uploadHeaders"
14
+            :file-list="imgList"
15
+            :show-file-list="true"
16
+            :before-upload="beforeImgUpload"
17
+            :on-success="handleAvatarSuccess"
18
+            :on-remove="handleRemove">
19
+            <i class="el-icon-plus"></i>
20
+          </el-upload>
21
+          <el-dialog :visible.sync="dialogVisible">
22
+            <img width="100%" :src="dialogImageUrl" alt="">
23
+          </el-dialog>
24
+      </el-form-item>
25
+        <el-form-item label="客户姓名:">
26
+          <el-input v-model="detail.company"></el-input>
27
+        </el-form-item>
28
+        <el-form-item label="客户电话:">
29
+          <el-input v-model="detail.department"></el-input>
30
+        </el-form-item>
31
+        <el-form-item label="客户性别:">
32
+          <el-radio-group v-model="detail.isMain">
33
+            <el-radio :label="1">男</el-radio>
34
+            <el-radio :label="0">女</el-radio>
35
+          </el-radio-group>
36
+        </el-form-item>
37
+        <el-form-item label="预约到访时间:">
38
+          <el-input v-model="detail.department"></el-input>
39
+        </el-form-item>
40
+        <el-form-item label="到访人数:">
41
+          <el-input v-model="detail.department"></el-input>
42
+        </el-form-item>
43
+        <el-form-item label="客户描述:">
44
+            <el-input type="textarea" :rows="5"  v-model="detail.introduction"></el-input>
45
+        </el-form-item>
46
+        <el-form-item label="物业类型:">
47
+          <el-input v-model="detail.department"></el-input>
48
+        </el-form-item>
49
+        <el-form-item label="需求类型:">
50
+          <el-input v-model="detail.department"></el-input>
51
+        </el-form-item>
52
+        <el-form-item label="价格区间:">
53
+          <el-input v-model="detail.department"></el-input>
54
+        </el-form-item>
55
+        <el-form-item label="报备日期:">
56
+          <el-input v-model="detail.department"></el-input>
57
+        </el-form-item>
58
+        <el-form-item label="状态:">
59
+          <el-select v-model="detail.buildings" placeholder="请选择">
60
+            <el-option v-for="(build,i) in buildings.list || []" :key="i" :label="build.buildingName" :value="build.buildingId"></el-option>
61
+          </el-select>
62
+        </el-form-item>
63
+        <el-form-item label="归属置业顾问:">
64
+          <p style="margin:0">{{consultant}}<span @click="dialogTableVisible=true" class="choose">请选择</span></p>
65
+        </el-form-item>
66
+        <el-form-item>
67
+          <el-button type="primary" @click="submitForm">修改并审核通过</el-button>
68
+          <el-button @click="$router.go(-1)">驳回</el-button>
69
+        </el-form-item>
70
+        <el-dialog title="选择置业顾问" :visible.sync="dialogTableVisible">
71
+      <el-table :data="gridData">
72
+        <el-table-column property="date" label="姓名"></el-table-column>
73
+        <el-table-column property="name" label="电话"></el-table-column>
74
+        <el-table-column property="name" label="部门"></el-table-column>
75
+        <el-table-column property="name" label="岗位"></el-table-column>
76
+        <el-table-column fixed="right" label="操作">
77
+          <template slot-scope="scope">
78
+            <el-button type="text" @click="handleDel(scope.row)" size="small">选择</el-button>
79
+          </template>
80
+        </el-table-column>
81
+      </el-table>
82
+    </el-dialog>
83
+      </el-form>
84
+    </div>
85
+  </div>
86
+</template>
87
+
88
+<script>
89
+import { createNamespacedHelpers } from "vuex";
90
+import apis from "../../config/api";
91
+import E from "wangeditor";
92
+
93
+const { mapActions: mapPersonActions } = createNamespacedHelpers("persons");
94
+const {
95
+  mapState: mapBuildingState,
96
+  mapActions: mapBuildingActions
97
+} = createNamespacedHelpers("building");
98
+export default {
99
+  name: "consultantEdit",
100
+  data() {
101
+    return {
102
+      upFileUrl: apis.file.upload.url,
103
+      detail: {
104
+        name: undefined,
105
+        company: undefined,
106
+        department: undefined,
107
+        post: undefined,
108
+        tel: undefined,
109
+        photo: undefined,
110
+        status: 1,
111
+        buildings: []
112
+      },
113
+      imgList: [],
114
+      dialogVisible: false,
115
+      dialogImageUrl: "",
116
+      dialogTableVisible: false, //选择置业顾问弹框
117
+      consultant:"",
118
+      gridData: [
119
+        {
120
+          date: "2016-05-02",
121
+          name: "王小虎"
122
+        },
123
+        {
124
+          date: "2016-05-04",
125
+          name: "王小虎"
126
+        },
127
+        {
128
+          date: "2016-05-01",
129
+          name: "王小虎"
130
+        },
131
+        {
132
+          date: "2016-05-03",
133
+          name: "王小虎"
134
+        }
135
+      ]
136
+    };
137
+  },
138
+  created() {
139
+    this.init();
140
+  },
141
+  computed: {
142
+    ...mapBuildingState({
143
+      buildings: x => x.buildings
144
+    }),
145
+    uploadHeaders() {
146
+      const token = localStorage.getItem("x-token") || "";
147
+      return {
148
+        Authorization: `Bearer ${token}`
149
+      };
150
+    }
151
+  },
152
+  methods: {
153
+    ...mapBuildingActions(["getBuildings"]),
154
+    ...mapPersonActions(["getConsultant", "editConsultant"]),
155
+
156
+    init() {
157
+      if (this.$route.params.id) {
158
+        this.getConsultant({ id: this.$route.params.id }).then(data => {
159
+          this.detail = data;
160
+        });
161
+      }
162
+    },
163
+    handleDel(row) {
164
+      this.$confirm("确定选择此置业顾问?", "提示", {
165
+        confirmButtonText: "确定",
166
+        cancelButtonText: "取消",
167
+        type: "warning"
168
+      })
169
+        .then(() => {
170
+          this.$message({
171
+            type: "success",
172
+            message: "选择成功!"
173
+          });
174
+          this.consultant = row.name
175
+          this.dialogTableVisible = false;
176
+        })
177
+        .catch(() => {
178
+          this.$message({
179
+            type: "info",
180
+            message: "已取消选择"
181
+          });
182
+        });
183
+    },
184
+    beforeImgUpload(file) {
185
+      if (file.type !== "image/jpeg" && file.type !== "image/png") {
186
+        this.$message.error("上传图片只能是 JPG 或 PNG 格式!");
187
+        return false;
188
+      }
189
+      // if (file.size / 1024 > 300) {
190
+      //   this.$message.error('图片大小不允许超过300k!')
191
+      //   return false
192
+      // }
193
+      this.loading = this.$loading({
194
+        lock: true,
195
+        text: "上传中...",
196
+        spinner: "el-icon-loading",
197
+        background: "rgba(0, 0, 0, 0.7)"
198
+      });
199
+
200
+      return true;
201
+    },
202
+    handleAvatarSuccess(res) {
203
+      this.imgList = [
204
+        ...this.imgList,
205
+        {
206
+          url: res.data
207
+        }
208
+      ];
209
+      this.hideLoadding();
210
+    },
211
+    handleRemove(file, fileList) {
212
+      this.imgList = fileList;
213
+    },
214
+    submitForm() {
215
+      this.showLoadding("保存中...");
216
+      this.editConsultant(this.detail)
217
+        .then(res => {
218
+          if (res.personId) {
219
+            this.detail = res;
220
+          }
221
+
222
+          this.hideLoadding();
223
+          this.$notify.info("保存成功");
224
+        })
225
+        .catch(err => {
226
+          this.hideLoadding();
227
+          this.$notify.error(err.message);
228
+        });
229
+    },
230
+
231
+    showLoadding(text) {
232
+      this.loading = this.$loading({
233
+        text,
234
+        lock: true,
235
+        spinner: "el-icon-loading",
236
+        background: "rgba(255, 255, 255, 0.7)"
237
+      });
238
+    },
239
+
240
+    hideLoadding() {
241
+      if (this.loading) this.loading.close();
242
+    }
243
+  },
244
+  mounted() {
245
+    const _that = this;
246
+
247
+    this.getBuildings({
248
+      pageNum: 1,
249
+      pageSize: 100
250
+    }).then(() => {
251
+      if ((this.$route.query.id || "") !== "") {
252
+        this.getDetail({ id: this.$route.query.id }).then(data => {});
253
+      }
254
+    });
255
+  }
256
+};
257
+</script>
258
+
259
+<style lang="scss" scoped>
260
+.form-wrapper {
261
+  width: 60%;
262
+}
263
+</style>
264
+
265
+<style lang="scss">
266
+.avatar-uploader .el-upload {
267
+  border: 1px dashed #d9d9d9;
268
+  border-radius: 6px;
269
+  cursor: pointer;
270
+  position: relative;
271
+  overflow: hidden;
272
+}
273
+.avatar-uploader .el-upload:hover {
274
+  border-color: #409eff;
275
+}
276
+.avatar-uploader-icon {
277
+  font-size: 28px;
278
+  color: #8c939d;
279
+  width: 178px;
280
+  height: 178px;
281
+  line-height: 178px;
282
+  text-align: center;
283
+}
284
+.avatar {
285
+  width: 178px;
286
+  height: 178px;
287
+  display: block;
288
+}
289
+.choose {
290
+  color: blue;
291
+  margin-left: 15px;
292
+}
293
+</style>

+ 145
- 0
src/views/customer/integralRecord.vue Прегледај датотеку

@@ -0,0 +1,145 @@
1
+<template>
2
+  <div>
3
+    <h5>当前可用积分:200</h5>
4
+    <el-table
5
+      :data="dynamics.list || []"
6
+      >
7
+      <el-table-column
8
+        type="index">
9
+        <template slot-scope="scope">
10
+          <span>{{ GetIndex(scope.$index) }}</span>
11
+        </template>
12
+      </el-table-column>
13
+      <el-table-column
14
+        prop="title"
15
+        label="积分类型">
16
+      </el-table-column>
17
+      <el-table-column
18
+        prop="title"
19
+        label="积分变化">
20
+      </el-table-column>
21
+      <el-table-column
22
+        prop="createDate"
23
+        label="发生时间">
24
+      </el-table-column>
25
+    </el-table>
26
+    <el-pagination
27
+      small
28
+      style="margin-top:10px;"
29
+      layout="prev, pager, next"
30
+      :current-page.sync="currentPage"
31
+      :pageSize="pageSize"
32
+      :total="dynamics.total || 0"
33
+      @current-change="getList"
34
+    >
35
+    </el-pagination>
36
+  </div>
37
+</template>
38
+
39
+<script>
40
+import { createNamespacedHelpers } from "vuex";
41
+
42
+const {
43
+  mapState: mapDynamicState,
44
+  mapActions: mapDynamicActions
45
+} = createNamespacedHelpers("dynamic");
46
+const {
47
+  mapState: mapBuildingState,
48
+  mapActions: mapBuildingActions
49
+} = createNamespacedHelpers("building");
50
+
51
+export default {
52
+  data() {
53
+    return {
54
+      pageSize: 20,
55
+      currentPage: 1,
56
+      name: "",
57
+      buildingId: "",
58
+    };
59
+  },
60
+  computed: {
61
+    ...mapDynamicState({
62
+      dynamics: x => x.dynamics
63
+    }),
64
+    ...mapBuildingState({
65
+      buildings: x => x.buildings
66
+    })
67
+  },
68
+  methods: {
69
+    ...mapDynamicActions([
70
+      "getDynamics",
71
+      "setDetailNull",
72
+      "deleteDynamics",
73
+      "publicDynamic",
74
+      "cancelDynamic"
75
+    ]),
76
+    ...mapBuildingActions(["getBuildings"]),
77
+    GetIndex(inx) {
78
+      return (this.currentPage - 1) * this.pageSize + inx + 1;
79
+    },
80
+    FormatDate(date) {
81
+      if (date) {
82
+        return dayjs(date).formate("yyyy-MM-DD HH:mm:ss");
83
+      } else {
84
+        return "";
85
+      }
86
+    },
87
+    getList() {
88
+      this.getDynamics({
89
+        pageNum: this.currentPage,
90
+        pageSize: this.pageSize,
91
+        name: this.name,
92
+        buildingId: this.buildingId
93
+      });
94
+    },
95
+    getBuildingName(id) {
96
+      return (
97
+        ((this.buildings.list || []).filter(x => x.buildingId === id)[0] || {})
98
+          .buildingName || ""
99
+      );
100
+    },
101
+  
102
+  },
103
+  created() {
104
+    this.getBuildings({
105
+      pageNum: 1,
106
+      pageSize: 100
107
+    }).then(() => {
108
+      this.getList();
109
+    });
110
+  }
111
+};
112
+</script>
113
+
114
+<style lang="scss" scoped>
115
+.header {
116
+  width: 50px;
117
+  height: 50px;
118
+  img {
119
+    width: 100%;
120
+    height: 100%;
121
+  }
122
+}
123
+
124
+.el-dialog{
125
+  z-index: 9999!important;
126
+  .el-form-item__content{
127
+    p{
128
+      margin: 0;
129
+    }
130
+  }
131
+}
132
+
133
+
134
+.flex-h {
135
+  display: flex;
136
+  display: -webkit-flex;
137
+}
138
+
139
+.flex-item {
140
+  flex: 1;
141
+  -webkit-flex: 1;
142
+  position: relative;
143
+  overflow: hidden;
144
+}
145
+</style>

+ 145
- 74
src/views/customer/list.vue Прегледај датотеку

@@ -1,5 +1,5 @@
1 1
 <template>
2
-  <div>
2
+  <div class="list">
3 3
     <div class="system-table-search">
4 4
       <div class="flex-h">
5 5
         <ul>
@@ -22,10 +22,10 @@
22 22
         </ul>
23 23
         <el-button
24 24
           size="mini"
25
-          type="primary" @click="search">搜索</el-button>
25
+          type="primary" @click="search">查询</el-button>
26 26
       </div>
27 27
     </div>
28
-    <el-table style="width: 100%">
28
+    <el-table :data="dynamics.list || []" style="width: 100%">
29 29
       <el-table-column
30 30
         type="index"
31 31
         width="50">
@@ -37,12 +37,12 @@
37 37
         label="头像">
38 38
         <template slot-scope="scope">
39 39
           <div class="header">
40
-            <img :src="scope.row.picture" alt="" />
40
+            <img :src="scope.row.imgUrl" alt="" />
41 41
           </div>
42 42
         </template>
43 43
       </el-table-column>
44 44
       <el-table-column
45
-        prop="name"
45
+        prop="title"
46 46
         label="姓名">
47 47
       </el-table-column>
48 48
       <el-table-column
@@ -55,63 +55,44 @@
55 55
       </el-table-column>
56 56
       <el-table-column   label="置业顾问">
57 57
         <template slot-scope="scope">
58
-          <span>{{scope.row.name}}</span>
58
+          <span>{{scope.row.desc}}</span>
59 59
           <p>{{scope.row.tel}}</p>
60 60
         </template>
61 61
       </el-table-column>
62
-      <el-table-column fixed="right" label="操作">
62
+      <el-table-column fixed="right" width="300" label="操作">
63 63
         <template slot-scope="scope">
64
-          <el-button type="text"  @click="toDetail(scope.row)" size="small">编辑</el-button>
65
-          <el-button type="text" size="small">调整归属</el-button>
66
-          <el-button type="text" size="small">积分记录</el-button>
67
-          <el-button type="text" size="small">推荐客户</el-button>
64
+          <el-button type="text" @click="toEditCustomer(scope.row)"   size="small">编辑</el-button>
65
+          <el-button type="text" @click="adjustment(scope.row)" size="small">调整归属</el-button>
66
+          <el-button type="text" @click="toIntegralRecord(scope.row)" size="small">积分记录</el-button>
67
+          <el-button type="text" @click="recommend(scope.row)" size="small">推荐客户</el-button>
68
+          <el-button type="text" size="small" @click="toDetail(scope.row)">查看详情</el-button>
68 69
         </template>
69 70
       </el-table-column>
70
-      <!-- <el-table-column
71
-        prop="describe"
72
-        label="描述">
73
-      </el-table-column>
74
-      <el-table-column
75
-        prop="appointmentTime"
76
-        label="预约时间">
77
-      </el-table-column>
78
-      <el-table-column
79
-        prop="visiteNum"
80
-        label="到访人数">
81
-      </el-table-column>
82
-      <el-table-column
83
-        prop="intention"
84
-        label="意向项目">
85
-      </el-table-column>
86
-      <el-table-column
87
-        prop="buildingId"
88
-        label="项目ID">
89
-      </el-table-column>
90
-      <el-table-column
91
-        prop="realtyManageType"
92
-        label="物业类型">
93
-      </el-table-column>
94
-      <el-table-column
95
-        prop="demandType"
96
-        label="需求类型">
97
-      </el-table-column>
98
-      <el-table-column
99
-        prop="priceRange"
100
-        label="价格区间">
101
-      </el-table-column>
102
-      <el-table-column
103
-        prop="reportDate"
104
-        label="报备日期">
105
-      </el-table-column>
106
-      <el-table-column
107
-        prop="status"
108
-        label="状态">
109
-      </el-table-column>
110
-      <el-table-column
111
-        prop="personId"
112
-        label="推荐人">
113
-      </el-table-column> -->
114 71
     </el-table>
72
+    <el-dialog title="选择置业顾问" :visible.sync="dialogTableVisible">
73
+      <el-table :data="gridData">
74
+        <el-table-column property="date" label="姓名"></el-table-column>
75
+        <el-table-column property="name" label="电话"></el-table-column>
76
+        <el-table-column property="name" label="部门"></el-table-column>
77
+        <el-table-column property="name" label="岗位"></el-table-column>
78
+        <el-table-column fixed="right" label="操作">
79
+          <template slot-scope="scope">
80
+            <el-button type="text" @click="handleDel(scope.row)" size="small">选择</el-button>
81
+          </template>
82
+        </el-table-column>
83
+      </el-table>
84
+    </el-dialog>
85
+    <el-dialog title="推荐客户" :visible.sync="dialogRecommendVisible">
86
+      <el-table :data="gridData">
87
+        <el-table-column property="date" label="姓名"></el-table-column>
88
+        <el-table-column property="name" label="电话"></el-table-column>
89
+        <el-table-column property="name" label="性别"></el-table-column>
90
+        <el-table-column property="name" label="意向项目"></el-table-column>
91
+        <el-table-column property="name" label="推荐时间"></el-table-column>
92
+        <el-table-column property="name" label="状态"></el-table-column>
93
+      </el-table>
94
+       <el-button type="primary" class="close-btn"  @click="dialogRecommendVisible=false" >关闭</el-button>
95
+    </el-dialog>
115 96
     <el-pagination
116 97
       small
117 98
       style="margin-top:10px;"
@@ -125,6 +106,10 @@
125 106
 </template>
126 107
 <script>
127 108
 import { createNamespacedHelpers } from "vuex";
109
+const {
110
+  mapState: mapDynamicState,
111
+  mapActions: mapDynamicActions
112
+} = createNamespacedHelpers("dynamic");
128 113
 const {
129 114
   mapState: mapCustomerState,
130 115
   mapActions: mapCustomerActions
@@ -148,40 +133,123 @@ export default {
148 133
       priceRange: "",
149 134
       reportDate: "",
150 135
       status: "",
151
-      personId: ""
136
+      personId: "",
137
+      dialogTableVisible: false, //调整归属弹框
138
+      dialogRecommendVisible: false, //推荐客户弹框
139
+      gridData: [
140
+        {
141
+          date: "2016-05-02",
142
+          name: "王小虎"
143
+        },
144
+        {
145
+          date: "2016-05-04",
146
+          name: "王小虎"
147
+        },
148
+        {
149
+          date: "2016-05-01",
150
+          name: "王小虎"
151
+        },
152
+        {
153
+          date: "2016-05-03",
154
+          name: "王小虎"
155
+        }
156
+      ]
152 157
     };
153 158
   },
154 159
   computed: {
155 160
     ...mapCustomerState({
156 161
       customers: x => x.customers
162
+    }),
163
+    ...mapDynamicState({
164
+      dynamics: x => x.dynamics
157 165
     })
158 166
   },
167
+  created() {
168
+    this.getList();
169
+  },
159 170
   methods: {
160 171
     ...mapCustomerActions(["getCustomers", "getDetail"]),
172
+    ...mapDynamicActions([
173
+      "getDynamics",
174
+      "setDetailNull",
175
+      "deleteDynamics",
176
+      "publicDynamic",
177
+      "cancelDynamic"
178
+    ]),
161 179
     GetIndex(inx) {
162 180
       return (this.currentPage - 1) * this.pageSize + inx + 1;
163 181
     },
164 182
     getList() {
165
-      this.getCustomers({
183
+      this.getDynamics({
166 184
         pageNum: this.currentPage,
167 185
         pageSize: this.pageSize,
168 186
         name: this.name,
169
-        sex: this.sex,
170
-        phone: this.phone,
171
-        picture: this.picture,
172
-        describe: this.describe,
173
-        appointmentTime: this.appointmentTime,
174
-        visiteNum: this.visiteNum,
175
-        intention: this.intention,
176
-        buildingId: this.buildingId,
177
-        realtyManageType: this.realtyManageType,
178
-        demandType: this.demandType,
179
-        priceRange: this.priceRange,
180
-        reportDate: this.reportDate,
181
-        status: this.status,
182
-        personId: this.personId
187
+        buildingId: this.buildingId
188
+      });
189
+    },
190
+    // 进入编辑页
191
+    toEditCustomer(row) {
192
+      this.$router.push({
193
+        name: "editCustomer",
194
+        params: { id: row.personId }
195
+      });
196
+    },
197
+    // 进入积分记录页
198
+    toIntegralRecord(row) {
199
+      this.$router.push({
200
+        name: "integralRecord",
201
+        params: { id: row.personId }
183 202
       });
184 203
     },
204
+    // 调整归属
205
+    adjustment(row) {
206
+      this.dialogTableVisible = true;
207
+    },
208
+    // 推荐客户
209
+    recommend(row) {
210
+      this.dialogRecommendVisible = true;
211
+    },
212
+    handleDel(row) {
213
+      this.$confirm("确定选择此置业顾问?", "提示", {
214
+        confirmButtonText: "确定",
215
+        cancelButtonText: "取消",
216
+        type: "warning"
217
+      })
218
+        .then(() => {
219
+          this.$message({
220
+            type: "success",
221
+            message: "选择成功!"
222
+          });
223
+          this.dialogTableVisible = false;
224
+        })
225
+        .catch(() => {
226
+          this.$message({
227
+            type: "info",
228
+            message: "已取消选择"
229
+          });
230
+        });
231
+    },
232
+    // getList() {
233
+    // this.getCustomers({
234
+    // pageNum: this.currentPage,
235
+    // pageSize: this.pageSize,
236
+    // name: this.name,
237
+    // sex: this.sex,
238
+    // phone: this.phone,
239
+    // picture: this.picture,
240
+    // describe: this.describe,
241
+    // appointmentTime: this.appointmentTime,
242
+    // visiteNum: this.visiteNum,
243
+    // intention: this.intention,
244
+    // buildingId: this.buildingId,
245
+    // realtyManageType: this.realtyManageType,
246
+    // demandType: this.demandType,
247
+    // priceRange: this.priceRange,
248
+    // reportDate: this.reportDate,
249
+    // status: this.status,
250
+    // personId: this.personId
251
+    // });
252
+    // },
185 253
     search() {
186 254
       this.currentPage = 1;
187 255
       this.getList();
@@ -191,9 +259,6 @@ export default {
191 259
         name: "consultant.edit",
192 260
         params: { id: row.personId }
193 261
       });
194
-    },
195
-    created() {
196
-      this.getList();
197 262
     }
198 263
   }
199 264
 };
@@ -235,6 +300,12 @@ export default {
235 300
   display: flex;
236 301
   align-items: center;
237 302
 }
303
+.el-dialog__body{
304
+  text-align: center;
305
+  .close-btn{
306
+  margin:  20px auto 0 auto;
307
+}
308
+}
238 309
 
239 310
 .flex-item {
240 311
   flex: 1;

+ 274
- 0
src/views/customer/recommendCustomer.vue Прегледај датотеку

@@ -0,0 +1,274 @@
1
+<template>
2
+  <div class="list">
3
+    <div class="system-table-search">
4
+      <div class="flex-h">
5
+        <ul>
6
+          <li>
7
+            <span>姓名</span>
8
+            <el-input v-model="name" ></el-input>
9
+          </li>
10
+          <li>
11
+            <span>电话</span>
12
+            <el-input v-model="name" ></el-input>
13
+          </li>
14
+          <li>
15
+            <span>推荐人</span>
16
+            <el-input v-model="name" ></el-input>
17
+          </li>
18
+          <li>
19
+            <span>推荐人电话</span>
20
+            <el-input v-model="name" ></el-input>
21
+          </li>
22
+          <li>
23
+            <span>状态</span>
24
+            <el-select v-model="name" placeholder="请选择">
25
+              <el-option v-for="(item,i) in gridData || []" :key="i" :label="item.name" :value="item.id"></el-option>
26
+            </el-select>
27
+          </li>
28
+        </ul>
29
+        <el-button
30
+          size="mini"
31
+          type="primary" @click="search">查询</el-button>
32
+      </div>
33
+    </div>
34
+    <el-table :data="dynamics.list || []" style="width: 100%">
35
+      <el-table-column
36
+        type="index"
37
+        width="50">
38
+        <template slot-scope="scope">
39
+          <span>{{ GetIndex(scope.$index) }}</span>
40
+        </template>
41
+      </el-table-column>
42
+      <el-table-column
43
+        label="头像">
44
+        <template slot-scope="scope">
45
+          <div class="header">
46
+            <img :src="scope.row.imgUrl" alt="" />
47
+          </div>
48
+        </template>
49
+      </el-table-column>
50
+      <el-table-column
51
+        prop="title"
52
+        label="姓名">
53
+      </el-table-column>
54
+      <el-table-column
55
+        prop="phone"
56
+        label="电话">
57
+      </el-table-column>
58
+      <el-table-column
59
+        prop="sex"
60
+        width="100"
61
+        label="性别">
62
+      </el-table-column>
63
+      <el-table-column
64
+        prop="sex"
65
+        label="意向项目">
66
+      </el-table-column>
67
+      <el-table-column  label="推荐人">
68
+        <template slot-scope="scope">
69
+          <span>{{scope.row.name}}</span>
70
+          <p>{{scope.row.tel}}</p>
71
+        </template>
72
+      </el-table-column>
73
+      <el-table-column
74
+        prop="createDate"
75
+        label="推荐时间">
76
+      </el-table-column>
77
+      <el-table-column  label="状态">
78
+        <template slot-scope="scope">
79
+          <span>{{scope.row.status==1?'已通过':scope.row.status==0?'已驳回':'未审核'}}</span>
80
+        </template>
81
+      </el-table-column>
82
+      <el-table-column fixed="right" width="100" label="操作">
83
+        <template slot-scope="scope">
84
+          <el-button type="text" @click="toEditRecommend(scope.row)" size="small">{{scope.row.status==1?'查看详情':'审核'}}</el-button>
85
+        </template>
86
+      </el-table-column>
87
+    </el-table>
88
+    <el-pagination
89
+      small
90
+      style="margin-top:10px;"
91
+      layout="prev, pager, next"
92
+      :current-page.sync="currentPage"
93
+      :pageSize="pageSize"
94
+      @current-change="getList"
95
+    >
96
+    </el-pagination>
97
+  </div>
98
+</template>
99
+<script>
100
+import { createNamespacedHelpers } from "vuex";
101
+const {
102
+  mapState: mapDynamicState,
103
+  mapActions: mapDynamicActions
104
+} = createNamespacedHelpers("dynamic");
105
+const {
106
+  mapState: mapCustomerState,
107
+  mapActions: mapCustomerActions
108
+} = createNamespacedHelpers("customer");
109
+export default {
110
+  data() {
111
+    return {
112
+      pageSize: 20,
113
+      currentPage: 1,
114
+      name: "",
115
+      sex: "",
116
+      phone: "",
117
+      picture: "",
118
+      describe: "",
119
+      appointmentTime: "",
120
+      visiteNum: "",
121
+      intention: "",
122
+      buildingId: "",
123
+      realtyManageType: "",
124
+      demandType: "",
125
+      priceRange: "",
126
+      reportDate: "",
127
+      status: "",
128
+      personId: "",
129
+      gridData: [
130
+        {
131
+          date: "2016-05-02",
132
+          name: "王小虎",
133
+          id: "1"
134
+        },
135
+        {
136
+          date: "2016-05-04",
137
+          name: "王小虎",
138
+          id: "2"
139
+        },
140
+        {
141
+          date: "2016-05-01",
142
+          name: "王小虎",
143
+          id: "3"
144
+        },
145
+        {
146
+          date: "2016-05-03",
147
+          name: "王小虎",
148
+          id: "4"
149
+        }
150
+      ]
151
+    };
152
+  },
153
+  computed: {
154
+    ...mapCustomerState({
155
+      customers: x => x.customers
156
+    }),
157
+    ...mapDynamicState({
158
+      dynamics: x => x.dynamics
159
+    })
160
+  },
161
+  created() {
162
+    this.getList();
163
+  },
164
+  methods: {
165
+    ...mapCustomerActions(["getCustomers", "getDetail"]),
166
+    ...mapDynamicActions([
167
+      "getDynamics",
168
+      "setDetailNull",
169
+      "deleteDynamics",
170
+      "publicDynamic",
171
+      "cancelDynamic"
172
+    ]),
173
+    GetIndex(inx) {
174
+      return (this.currentPage - 1) * this.pageSize + inx + 1;
175
+    },
176
+    getList() {
177
+      this.getDynamics({
178
+        pageNum: this.currentPage,
179
+        pageSize: this.pageSize,
180
+        name: this.name,
181
+        buildingId: this.buildingId
182
+      });
183
+    },
184
+
185
+    // 进入积分记录页
186
+    toEditRecommend(row) {
187
+      this.$router.push({
188
+        name: "editRecommend",
189
+        params: { id: row.personId }
190
+      });
191
+    },
192
+
193
+    // getList() {
194
+    // this.getCustomers({
195
+    // pageNum: this.currentPage,
196
+    // pageSize: this.pageSize,
197
+    // name: this.name,
198
+    // sex: this.sex,
199
+    // phone: this.phone,
200
+    // picture: this.picture,
201
+    // describe: this.describe,
202
+    // appointmentTime: this.appointmentTime,
203
+    // visiteNum: this.visiteNum,
204
+    // intention: this.intention,
205
+    // buildingId: this.buildingId,
206
+    // realtyManageType: this.realtyManageType,
207
+    // demandType: this.demandType,
208
+    // priceRange: this.priceRange,
209
+    // reportDate: this.reportDate,
210
+    // status: this.status,
211
+    // personId: this.personId
212
+    // });
213
+    // },
214
+    search() {
215
+      this.currentPage = 1;
216
+      this.getList();
217
+    }
218
+  }
219
+};
220
+</script>
221
+<style lang="scss" scoped>
222
+.list {
223
+  .header {
224
+    width: 50px;
225
+    height: 50px;
226
+    img {
227
+      width: 100%;
228
+      height: 100%;
229
+    }
230
+  }
231
+}
232
+
233
+.system-table-search {
234
+  width: calc(100% - 40px);
235
+  margin: 16px auto 0;
236
+}
237
+
238
+.system-table-search ul > li {
239
+  margin-right: 20px;
240
+  display: flex;
241
+  float: left;
242
+  align-items: center;
243
+  margin-bottom: 10px;
244
+  span {
245
+    margin-right: 10px;
246
+  }
247
+}
248
+
249
+.system-table-search ul {
250
+  font-size: 15px;
251
+  white-space: nowrap;
252
+  padding: 0;
253
+}
254
+
255
+.flex-h {
256
+  display: flex;
257
+  align-items: center;
258
+}
259
+.el-dialog__body {
260
+  text-align: center;
261
+  .close-btn {
262
+    margin: 20px auto 0 auto;
263
+  }
264
+}
265
+
266
+.flex-item {
267
+  flex: 1;
268
+  -webkit-flex: 1;
269
+  position: relative;
270
+  overflow: hidden;
271
+}
272
+</style>
273
+
274
+

+ 104
- 7
src/views/index.js Прегледај датотеку

@@ -1,5 +1,5 @@
1 1
 
2
-const pages = [  
2
+const pages = [
3 3
   {
4 4
     path: 'dashboard',
5 5
     name: 'dashboard',
@@ -130,6 +130,42 @@ const pages = [
130 130
         meta: {
131 131
           menuShow: true,
132 132
           title: '客户列表',
133
+        }
134
+      },
135
+      {
136
+        path: 'recommendCustomer',
137
+        name: 'recommendCustomer',
138
+        component: () => import('./customer/recommendCustomer.vue'),
139
+        meta: {
140
+          menuShow: true,
141
+          title: '推荐客户',
142
+        }
143
+      },
144
+      {
145
+        path: 'editRecommend',
146
+        name: 'editRecommend',
147
+        component: () => import('./customer/editRecommend.vue'),
148
+        meta: {
149
+          menuShow: false,
150
+          title: '编辑',
151
+        },
152
+      },
153
+      {
154
+        path: 'integralRecord',
155
+        name: 'integralRecord',
156
+        component: () => import('./customer/integralRecord.vue'),
157
+        meta: {
158
+          menuShow: false,
159
+          title: '积分记录',
160
+        },
161
+      },
162
+      {
163
+        path: 'editCustomer',
164
+        name: 'editCustomer',
165
+        component: () => import('./customer/editCustomer.vue'),
166
+        meta: {
167
+          menuShow: false,
168
+          title: '编辑',
133 169
         },
134 170
       },
135 171
     ]
@@ -150,7 +186,7 @@ const pages = [
150 186
         meta: {
151 187
           menuShow: true,
152 188
           title: '轮播图列表',
153
-        },
189
+        }
154 190
       },
155 191
       {
156 192
         path: 'editCarousel',
@@ -160,7 +196,58 @@ const pages = [
160 196
           menuShow: false,
161 197
           title: '编辑轮播图',
162 198
         },
163
-      }
199
+      },
200
+      {
201
+        path: 'advertisement',
202
+        name: 'advertisement',
203
+        component: () => import('./carouselFigure/advertisement.vue'),
204
+        meta: {
205
+          menuShow: true,
206
+          title: '开屏广告',
207
+        }
208
+      },
209
+      {
210
+        path: 'advertisementEdit',
211
+        name: 'advertisementEdit',
212
+        component: () => import('./carouselFigure/advertisementEdit.vue'),
213
+        meta: {
214
+          menuShow: false,
215
+          title: '编辑开屏广告',
216
+        },
217
+
218
+
219
+      },
220
+
221
+    ]
222
+  },
223
+  {
224
+
225
+    path: 'systemManagement',
226
+    name: 'systemManagement',
227
+    component: () => import('./index.vue'),
228
+    meta: {
229
+      menuShow: true,
230
+      title: '系统管理',
231
+    },
232
+    children: [
233
+      {
234
+        path: 'pushMessage',
235
+        name: 'pushMessage',
236
+        component: () => import('./systemManagement/pushMessage.vue'),
237
+        meta: {
238
+          menuShow: true,
239
+          title: '推送消息',
240
+        },
241
+      },
242
+      {
243
+        path: 'keyWords',
244
+        name: 'keyWords',
245
+        component: () => import('./systemManagement/keyWords.vue'),
246
+        meta: {
247
+          menuShow: true,
248
+          title: '关键字维护',
249
+        },
250
+      },
164 251
     ]
165 252
   },
166 253
   {
@@ -169,16 +256,25 @@ const pages = [
169 256
     component: () => import('./index.vue'),
170 257
     meta: {
171 258
       menuShow: true,
172
-      title: '迅管理',
259
+      title: '迅管理',
173 260
     },
174 261
     children: [
175 262
       {
176 263
         path: '/news/type/list',
177 264
         name: 'news-type-list',
178
-        component: () => import('./news/index.vue'),
265
+        component: () => import('./news/type/index.vue'),
179 266
         meta: {
180 267
           menuShow: true,
181
-          title: '咨迅类型',
268
+          title: '资迅类型',
269
+        },
270
+      },
271
+      {
272
+        path: '/news/type/edi',
273
+        name: 'news-type-edi',
274
+        component: () => import('./news/type/edi/index.vue'),
275
+        meta: {
276
+          menuShow: false,
277
+          title: '编辑资迅类型',
182 278
         },
183 279
       }
184 280
     ]
@@ -240,13 +336,14 @@ const pages = [
240 336
       },
241 337
     ]
242 338
   },
339
+
243 340
 ]
244 341
 
245 342
 const flatten = (rts, parents = []) => {
246 343
   return rts.reduce((acc, rt) => {
247 344
     const chs = rt.children && rt.children.length ?
248 345
       flatten(rt.children, parents.concat(rt)) : []
249
-    
346
+
250 347
     return [...acc, { ...rt, parents }, ...chs]
251 348
   }, [])
252 349
 }

+ 156
- 0
src/views/news/type/edi/index.vue Прегледај датотеку

@@ -0,0 +1,156 @@
1
+<template>
2
+    <div id="root">
3
+        <el-form ref="form" :model="form" label-width="80px" class="form">
4
+            <el-form-item label="项目">
5
+                <el-select v-model="form.buildingId" placeholder="请选择">
6
+                    <el-option
7
+                            v-for="item in buildingList"
8
+                            :key="item.buildingId"
9
+                            :label="item.buildingName"
10
+                            :value="item.buildingId">
11
+                    </el-option>
12
+                </el-select>
13
+            </el-form-item>
14
+            <el-form-item label="图片">
15
+<!--                class="avatar-uploader"-->
16
+                <el-upload
17
+                        :headers="uploadHeaders"
18
+                        :action="upFileUrl"
19
+                        :show-file-list="false"
20
+                        :on-success="handleAvatarSuccess">
21
+                    <img v-if="imageUrl" :src="imageUrl" class="avatar">
22
+                    <i v-else class="el-icon-plus avatar-uploader-icon"></i>
23
+                </el-upload>
24
+            </el-form-item>
25
+            <el-form-item label="名称">
26
+                <el-input v-model="form.newsTypeName"></el-input>
27
+            </el-form-item>
28
+            <el-form-item>
29
+                <el-button type="primary" @click="submitNewsType">保存</el-button>
30
+                <el-button @click="cancel">取消</el-button>
31
+            </el-form-item>
32
+        </el-form>
33
+    </div>
34
+</template>
35
+
36
+<script>
37
+    import apis from '../../../../config/api'
38
+    export default {
39
+        name: "index",
40
+        data() {
41
+            return {
42
+                upFileUrl: apis.file.upload.url,
43
+                buildingList: [],
44
+                imageUrl: '',
45
+                form: {
46
+                    newsTypeId: '',
47
+                    newsTypeImg: '',
48
+                    newsTypeName: '',
49
+                    buildingId: ''
50
+                },
51
+                buildingForm: {
52
+                    pageNum: 1,
53
+                    pageSize: 100
54
+                },
55
+            }
56
+        },
57
+        created() {
58
+            this.getBuildList()
59
+            this.form.newsTypeId = this.$route.query.id
60
+            if (this.form.newsTypeId !== undefined) {
61
+                this.getById()
62
+            }
63
+        },
64
+        computed: {
65
+            uploadHeaders () {
66
+                const token = localStorage.getItem('x-token') || ''
67
+                return {
68
+                    Authorization: `Bearer ${token}`
69
+                }
70
+            }
71
+        },
72
+        methods: {
73
+            handleAvatarSuccess(res, file) {
74
+                this.imageUrl = URL.createObjectURL(file.raw);
75
+                // console.log(res)
76
+                this.form.newsTypeImg = res.data
77
+            },
78
+            getBuildList() {
79
+                this.$store.dispatch('building/getBuildings', this.buildingForm).then((res) => {
80
+                    this.buildingList = res.records
81
+                }).catch(() => {
82
+                    console.log('building/getBuildings err')
83
+                })
84
+            },
85
+            submitNewsType() {
86
+                console.log(this.form.newsTypeId)
87
+                if (this.form.newsTypeId === '' || this.form.newsTypeId === undefined) {
88
+                    console.log('添加')
89
+                    this.$store.dispatch('news/addType', this.form).then((res) => {
90
+                        this.$message.success('操作成功!')
91
+                        this.$router.go(-1)
92
+                        // console.log(res)
93
+                    }).catch(() => {
94
+                        console.log('news/addType err')
95
+                    })
96
+
97
+                    return;
98
+                }
99
+
100
+                // 修改
101
+                this.$store.dispatch('news/updateType', this.form).then((res) => {
102
+                    this.$message.success('操作成功!')
103
+                    this.$router.go(-1)
104
+                    // console.log(res)
105
+                }).catch(() => {
106
+                    console.log('news/updateType err')
107
+                })
108
+
109
+            },
110
+            cancel() {
111
+                this.$router.go(-1)
112
+            },
113
+            getById() {
114
+                this.$store.dispatch('news/getTypeById', this.form).then((res) => {
115
+                    this.form.newsTypeName = res.newsTypeName
116
+                    this.form.newsTypeImg = res.newsTypeImg
117
+                    this.imageUrl = res.newsTypeImg
118
+                    this.form.buildingId = res.buildingId
119
+                }).catch(() => {
120
+                    console.log('news/getTypeById err')
121
+                })
122
+            }
123
+        }
124
+    }
125
+</script>
126
+
127
+<style scoped>
128
+    .avatar-uploader .el-upload {
129
+        border: 1px dashed #d9d9d9;
130
+        border-radius: 6px;
131
+        cursor: pointer;
132
+        position: relative;
133
+        overflow: hidden;
134
+    }
135
+    .avatar-uploader .el-upload:hover {
136
+        border-color: #409EFF;
137
+    }
138
+    .avatar-uploader-icon {
139
+        font-size: 28px;
140
+        color: #8c939d;
141
+        width: 178px;
142
+        height: 178px;
143
+        line-height: 178px;
144
+        text-align: center;
145
+    }
146
+    .avatar {
147
+        width: 178px;
148
+        height: 178px;
149
+        display: block;
150
+    }
151
+    .form {
152
+        width: 300px;
153
+        margin-left: auto;
154
+        margin-right: auto;
155
+    }
156
+</style>

+ 115
- 5
src/views/news/type/index.vue Прегледај датотеку

@@ -1,8 +1,9 @@
1 1
 <template>
2 2
     <div id="root">
3 3
         <div class="operation-class">
4
-           <el-button type="primary">新增</el-button>
5
-            <el-select v-model="buildingId" placeholder="项目" style="margin-left: 20px;">
4
+           <el-button type="primary" @click="ediNewsType">新增</el-button>
5
+            &nbsp;
6
+            <el-select v-model="form.buildingId" placeholder="项目" @change="getList">
6 7
                 <el-option
7 8
                         v-for="item in buildingList"
8 9
                         :key="item.buildingId"
@@ -11,21 +12,130 @@
11 12
                 </el-option>
12 13
             </el-select>
13 14
         </div>
15
+        <div class="body">
16
+            <el-table
17
+                    :data="list"
18
+                    border
19
+                    style="width: 100%">
20
+                <el-table-column
21
+                        prop="date"
22
+                        label="类型图"
23
+                        align="center">
24
+                    <template slot-scope="scope">
25
+                        <img :src="scope.row.newsTypeImg" width="50" height="50"/>
26
+                    </template>
27
+                </el-table-column>
28
+                <el-table-column
29
+                        prop="newsTypeName"
30
+                        label="名称"
31
+                        align="center">
32
+                </el-table-column>
33
+                <el-table-column
34
+                        prop="newsTypeId"
35
+                        align="center"
36
+                        label="操作">
37
+                    <template slot-scope="scope">
38
+                        <router-link :to="{ name:'news-type-edi', query: { id: scope.row.newsTypeId } }">编辑</router-link>
39
+                        <a href="javascript:void(0);" @click="deleteNews(scope.row.newsTypeId)" class="delClass">删除</a>
40
+                    </template>
41
+                </el-table-column>
42
+            </el-table>
43
+        </div>
44
+        <div class="block">
45
+            <el-pagination
46
+                    @size-change="handleSizeChange"
47
+                    @current-change="handleCurrentChange"
48
+                    :current-page="form.pageNum"
49
+                    :page-sizes="[1, 10, 20, 30, 40]"
50
+                    :page-size="form.pageSize"
51
+                    layout="total, sizes, prev, pager, next, jumper"
52
+                    :total="total">
53
+            </el-pagination>
54
+        </div>
14 55
     </div>
15 56
 </template>
16 57
 
17 58
 <script>
18 59
     export default {
19
-        name: "newsTypeIndex",
60
+        name: "newsIndex",
20 61
         data() {
21 62
             return {
22 63
                 buildingList: [],
23
-                buildingId: ''
64
+                form: {
65
+                    buildingId: '',
66
+                    pageNum: 1,
67
+                    pageSize: 10
68
+                },
69
+                buildingForm: {
70
+                    pageNum: 1,
71
+                    pageSize: 100
72
+                },
73
+                total: 0,
74
+                list: []
75
+            }
76
+        },
77
+        created() {
78
+          this.getList()
79
+          this.getBuildList()
80
+        },
81
+        methods: {
82
+            deleteNews(id) {
83
+                // 删除操作
84
+                const data = { newsTypeId: id }
85
+                this.$store.dispatch('news/deleteType', data).then((res) => {
86
+                    this.getList()
87
+                }).catch(() => {
88
+                    console.log('news/deleteType err');
89
+                })
90
+            },
91
+            handleSizeChange(val) {
92
+                console.log(`每页 ${val} 条`);
93
+                this.form.pageSize = val
94
+                this.form.pageNum = 1
95
+                this.getList()
96
+            },
97
+            handleCurrentChange(val) {
98
+                console.log(`当前页: ${val}`);
99
+                this.form.pageNum = val
100
+                this.getList()
101
+            },
102
+            getList() {
103
+              this.$store.dispatch('news/getTypeList', this.form).then((res) => {
104
+                this.list = res.records
105
+                this.form.pageNum = res.current
106
+                this.form.pageSize = res.size
107
+                this.total = res.total
108
+              }).catch(() => {
109
+                  console.log('news/getTypeList err')
110
+              })
111
+            },
112
+            getBuildList() {
113
+                this.$store.dispatch('building/getBuildings', this.buildingForm).then((res) => {
114
+                    this.buildingList = res.records
115
+                }).catch(() => {
116
+                    console.log('building/getBuildings err')
117
+                })
118
+            },
119
+            ediNewsType() {
120
+                this.$router.push({ name: 'news-type-edi' })
24 121
             }
25 122
         }
26 123
     }
27 124
 </script>
28 125
 
29 126
 <style scoped>
30
-
127
+.operation-class {
128
+    margin-left: 20px;
129
+}
130
+.body {
131
+    margin-top: 10px;
132
+}
133
+.block {
134
+    display: flex;
135
+    justify-content: flex-end;
136
+}
137
+.delClass {
138
+    padding-left: 10px;
139
+    padding-right: 10px;
140
+}
31 141
 </style>

+ 237
- 0
src/views/systemManagement/keyWords.vue Прегледај датотеку

@@ -0,0 +1,237 @@
1
+<template>
2
+  <div>
3
+    <div class="system-table-search">
4
+      <div class="flex-h">
5
+        <div class="flex-item flex-h">
6
+          <el-button size="mini" type="success" @click='addDynamic'>新增</el-button>
7
+        </div>
8
+      </div>
9
+    </div>
10
+    <el-table :data="dynamics.list || []" >
11
+      <el-table-column
12
+        type="index">
13
+        <template slot-scope="scope">
14
+          <span>{{ GetIndex(scope.$index) }}</span>
15
+        </template>
16
+      </el-table-column>
17
+      <el-table-column
18
+        prop="title"
19
+        label="关键字">
20
+      </el-table-column>
21
+      <el-table-column
22
+        prop="createDate"
23
+        label="操作时间">
24
+      </el-table-column>
25
+      <el-table-column
26
+        fixed="right"
27
+        label="操作">
28
+        <template slot-scope="scope">
29
+          <el-button type="text" @click="handleDel(scope.row)" size="small">删除</el-button>
30
+        </template>
31
+      </el-table-column>
32
+    </el-table>
33
+      <el-dialog title="新增" :modal-append-to-body='false' :visible.sync="dialogFormVisible">
34
+          <el-form :model="form"  >
35
+              <el-form-item label="所属项目:" :label-width="formLabelWidth">
36
+                <el-select v-model="form.region" placeholder="请选择所属项目">
37
+                  <el-option label="区域一" value="shanghai"></el-option>
38
+                  <el-option label="区域二" value="beijing"></el-option>
39
+                </el-select>
40
+            </el-form-item>
41
+            <el-form-item label="关键字:" :label-width="formLabelWidth">
42
+                <el-input v-model="form.name" auto-complete="off"></el-input>
43
+              </el-form-item>
44
+          </el-form>
45
+          <div slot="footer" class="dialog-footer">
46
+            <el-button type="primary" @click="dialogFormVisible = false">保 存</el-button>
47
+            <el-button @click="dialogFormVisible = false">取 消</el-button>
48
+          </div>
49
+      </el-dialog>
50
+    <el-pagination
51
+      small
52
+      style="margin-top:10px;"
53
+      layout="prev, pager, next"
54
+      :current-page.sync="currentPage"
55
+      :pageSize="pageSize"
56
+      :total="dynamics.total || 0"
57
+      @current-change="getList"
58
+    >
59
+    </el-pagination>
60
+  </div>
61
+</template>
62
+
63
+<script>
64
+import { createNamespacedHelpers } from "vuex";
65
+
66
+const {
67
+  mapState: mapDynamicState,
68
+  mapActions: mapDynamicActions
69
+} = createNamespacedHelpers("dynamic");
70
+const {
71
+  mapState: mapBuildingState,
72
+  mapActions: mapBuildingActions
73
+} = createNamespacedHelpers("building");
74
+
75
+export default {
76
+  data() {
77
+    return {
78
+      dialogFormVisible: false, //新增弹框
79
+      pageSize: 20,
80
+      currentPage: 1,
81
+      name: "",
82
+      buildingId: "",
83
+      form: {
84
+        name: "",
85
+        region: ""
86
+      },
87
+      formLabelWidth: "150px"
88
+    };
89
+  },
90
+  computed: {
91
+    ...mapDynamicState({
92
+      dynamics: x => x.dynamics
93
+    }),
94
+    ...mapBuildingState({
95
+      buildings: x => x.buildings
96
+    })
97
+  },
98
+  methods: {
99
+    ...mapDynamicActions([
100
+      "getDynamics",
101
+      "setDetailNull",
102
+      "deleteDynamics",
103
+      "publicDynamic",
104
+      "cancelDynamic"
105
+    ]),
106
+    ...mapBuildingActions(["getBuildings"]),
107
+    GetIndex(inx) {
108
+      return (this.currentPage - 1) * this.pageSize + inx + 1;
109
+    },
110
+    FormatDate(date) {
111
+      if (date) {
112
+        return dayjs(date).formate("yyyy-MM-DD HH:mm:ss");
113
+      } else {
114
+        return "";
115
+      }
116
+    },
117
+    getList() {
118
+      this.getDynamics({
119
+        pageNum: this.currentPage,
120
+        pageSize: this.pageSize,
121
+        name: this.name,
122
+        buildingId: this.buildingId
123
+      });
124
+    },
125
+    getBuildingName(id) {
126
+      return (
127
+        ((this.buildings.list || []).filter(x => x.buildingId === id)[0] || {})
128
+          .buildingName || ""
129
+      );
130
+    },
131
+    search() {
132
+      this.currentPage = 1;
133
+      this.getList();
134
+    },
135
+    handleDel(row) {
136
+      this.setDetailNull();
137
+       this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
138
+          confirmButtonText: '确定',
139
+          cancelButtonText: '取消',
140
+          type: 'warning'
141
+        }).then(() => {
142
+          this.$message({
143
+            type: 'success',
144
+            message: '删除成功!'
145
+          });
146
+        }).catch(() => {
147
+          this.$message({
148
+            type: 'info',
149
+            message: '已取消删除'
150
+          });          
151
+        });
152
+    },
153
+    handlePulic(row) {
154
+      this.$confirm("确认发布此数据?", "提示", {
155
+        confirmButtonText: "确定",
156
+        cancelButtonText: "取消",
157
+        type: "warning"
158
+      }).then(() => {
159
+        this.publicDynamic({
160
+          id: row.dynamicId
161
+        }).then(() => {
162
+          this.getList();
163
+        });
164
+      });
165
+    },
166
+    handleUnPulic(row) {
167
+      this.$confirm("确认取消发布此数据?", "提示", {
168
+        confirmButtonText: "确定",
169
+        cancelButtonText: "取消",
170
+        type: "warning"
171
+      }).then(() => {
172
+        this.cancelDynamic({
173
+          id: row.dynamicId
174
+        }).then(() => {
175
+          this.getList();
176
+        });
177
+      });
178
+    },
179
+    // handleDel(row) {
180
+    //   this.$confirm("确认删除此数据?", "提示", {
181
+    //     confirmButtonText: "确定",
182
+    //     cancelButtonText: "取消",
183
+    //     type: "warning"
184
+    //   }).then(() => {
185
+    //     if (row.status === 1) {
186
+    //       this.$message.error("当前活动处于发布状态,不允许删除!");
187
+    //       return false;
188
+    //     }
189
+    //     this.deleteDynamics({
190
+    //       id: row.dynamicId
191
+    //     }).then(() => {
192
+    //       this.getList();
193
+    //     });
194
+    //   });
195
+    // },
196
+    addDynamic() {
197
+      this.dialogFormVisible = true;
198
+    }
199
+  },
200
+  created() {
201
+    this.getBuildings({
202
+      pageNum: 1,
203
+      pageSize: 100
204
+    }).then(() => {
205
+      this.getList();
206
+    });
207
+  }
208
+};
209
+</script>
210
+
211
+<style lang="scss" scoped>
212
+.header {
213
+  width: 50px;
214
+  height: 50px;
215
+  img {
216
+    width: 100%;
217
+    height: 100%;
218
+  }
219
+}
220
+
221
+.system-table-search {
222
+  width: calc(100% - 40px);
223
+  margin: 20px auto 0;
224
+}
225
+
226
+.flex-h {
227
+  display: flex;
228
+  display: -webkit-flex;
229
+}
230
+
231
+.flex-item {
232
+  flex: 1;
233
+  -webkit-flex: 1;
234
+  position: relative;
235
+  overflow: hidden;
236
+}
237
+</style>

+ 224
- 0
src/views/systemManagement/pushMessage.vue Прегледај датотеку

@@ -0,0 +1,224 @@
1
+<template>
2
+  <div>
3
+    <el-table
4
+      :data="dynamics.list || []"
5
+      >
6
+      <el-table-column
7
+        type="index">
8
+        <template slot-scope="scope">
9
+          <span>{{ GetIndex(scope.$index) }}</span>
10
+        </template>
11
+      </el-table-column>
12
+      <el-table-column
13
+        prop="title"
14
+        label="标题">
15
+      </el-table-column>
16
+      <el-table-column
17
+        prop="createDate"
18
+        label="提示内容">
19
+      </el-table-column>
20
+      <el-table-column
21
+        fixed="right"
22
+        label="操作"
23
+        width="180">
24
+        <template slot-scope="scope">
25
+          <el-button type="text" @click="handleEdit(scope.row)" size="small">编辑</el-button>
26
+        </template>
27
+      </el-table-column>
28
+    </el-table>
29
+    <el-pagination
30
+      small
31
+      style="margin-top:10px;"
32
+      layout="prev, pager, next"
33
+      :current-page.sync="currentPage"
34
+      :pageSize="pageSize"
35
+      :total="dynamics.total || 0"
36
+      @current-change="getList"
37
+    >
38
+    </el-pagination>
39
+    <el-dialog title="编辑" :modal-append-to-body='false' :visible.sync="dialogFormVisible">
40
+          <el-form :model="form"  >
41
+              <el-form-item label="所属项目:" :label-width="formLabelWidth">
42
+                <el-select v-model="form.region" placeholder="请选择所属项目">
43
+                  <el-option label="区域一" value="shanghai"></el-option>
44
+                  <el-option label="区域二" value="beijing"></el-option>
45
+                </el-select>
46
+            </el-form-item>
47
+            <el-form-item label="标题:" :label-width="formLabelWidth">
48
+                <p>用户来访提醒</p>
49
+              </el-form-item>
50
+            <el-form-item label="提示内容:" :label-width="formLabelWidth">
51
+                <el-input v-model="form.name" auto-complete="off"></el-input>
52
+              </el-form-item>
53
+          </el-form>
54
+          <div slot="footer" class="dialog-footer">
55
+            <el-button type="primary" @click="dialogFormVisible = false">保 存</el-button>
56
+            <el-button @click="dialogFormVisible = false">取 消</el-button>
57
+          </div>
58
+      </el-dialog>
59
+  </div>
60
+</template>
61
+
62
+<script>
63
+import { createNamespacedHelpers } from "vuex";
64
+
65
+const {
66
+  mapState: mapDynamicState,
67
+  mapActions: mapDynamicActions
68
+} = createNamespacedHelpers("dynamic");
69
+const {
70
+  mapState: mapBuildingState,
71
+  mapActions: mapBuildingActions
72
+} = createNamespacedHelpers("building");
73
+
74
+export default {
75
+  data() {
76
+    return {
77
+      pageSize: 20,
78
+      currentPage: 1,
79
+      name: "",
80
+      buildingId: "",
81
+      dialogFormVisible:false,//编辑弹框
82
+      form: {
83
+          name: '',
84
+          region: ''
85
+        },
86
+        formLabelWidth: '150px'
87
+    };
88
+  },
89
+  computed: {
90
+    ...mapDynamicState({
91
+      dynamics: x => x.dynamics
92
+    }),
93
+    ...mapBuildingState({
94
+      buildings: x => x.buildings
95
+    })
96
+  },
97
+  methods: {
98
+    ...mapDynamicActions([
99
+      "getDynamics",
100
+      "setDetailNull",
101
+      "deleteDynamics",
102
+      "publicDynamic",
103
+      "cancelDynamic"
104
+    ]),
105
+    ...mapBuildingActions(["getBuildings"]),
106
+    GetIndex(inx) {
107
+      return (this.currentPage - 1) * this.pageSize + inx + 1;
108
+    },
109
+    FormatDate(date) {
110
+      if (date) {
111
+        return dayjs(date).formate("yyyy-MM-DD HH:mm:ss");
112
+      } else {
113
+        return "";
114
+      }
115
+    },
116
+    getList() {
117
+      this.getDynamics({
118
+        pageNum: this.currentPage,
119
+        pageSize: this.pageSize,
120
+        name: this.name,
121
+        buildingId: this.buildingId
122
+      });
123
+    },
124
+    getBuildingName(id) {
125
+      return (
126
+        ((this.buildings.list || []).filter(x => x.buildingId === id)[0] || {})
127
+          .buildingName || ""
128
+      );
129
+    },
130
+    search() {
131
+      this.currentPage = 1;
132
+      this.getList();
133
+    },
134
+    handleEdit(row) {
135
+      this.setDetailNull();
136
+      this.dialogFormVisible = true;
137
+    },
138
+    handlePulic(row) {
139
+      this.$confirm("确认发布此数据?", "提示", {
140
+        confirmButtonText: "确定",
141
+        cancelButtonText: "取消",
142
+        type: "warning"
143
+      }).then(() => {
144
+        this.publicDynamic({
145
+          id: row.dynamicId
146
+        }).then(() => {
147
+          this.getList();
148
+        });
149
+      });
150
+    },
151
+    handleUnPulic(row) {
152
+      this.$confirm("确认取消发布此数据?", "提示", {
153
+        confirmButtonText: "确定",
154
+        cancelButtonText: "取消",
155
+        type: "warning"
156
+      }).then(() => {
157
+        this.cancelDynamic({
158
+          id: row.dynamicId
159
+        }).then(() => {
160
+          this.getList();
161
+        });
162
+      });
163
+    },
164
+    handleDel(row) {
165
+      this.$confirm("确认删除此数据?", "提示", {
166
+        confirmButtonText: "确定",
167
+        cancelButtonText: "取消",
168
+        type: "warning"
169
+      }).then(() => {
170
+        if (row.status === 1) {
171
+          this.$message.error("当前活动处于发布状态,不允许删除!");
172
+          return false;
173
+        }
174
+        this.deleteDynamics({
175
+          id: row.dynamicId
176
+        }).then(() => {
177
+          this.getList();
178
+        });
179
+      });
180
+    }
181
+  },
182
+  created() {
183
+    this.getBuildings({
184
+      pageNum: 1,
185
+      pageSize: 100
186
+    }).then(() => {
187
+      this.getList();
188
+    });
189
+  }
190
+};
191
+</script>
192
+
193
+<style lang="scss" scoped>
194
+.header {
195
+  width: 50px;
196
+  height: 50px;
197
+  img {
198
+    width: 100%;
199
+    height: 100%;
200
+  }
201
+}
202
+
203
+.el-dialog{
204
+  z-index: 9999!important;
205
+  .el-form-item__content{
206
+    p{
207
+      margin: 0;
208
+    }
209
+  }
210
+}
211
+
212
+
213
+.flex-h {
214
+  display: flex;
215
+  display: -webkit-flex;
216
+}
217
+
218
+.flex-item {
219
+  flex: 1;
220
+  -webkit-flex: 1;
221
+  position: relative;
222
+  overflow: hidden;
223
+}
224
+</style>

+ 1
- 1
vue.config.js Прегледај датотеку

@@ -3,7 +3,7 @@ module.exports = {
3 3
   devServer: {
4 4
     proxy: {
5 5
       '/api': {
6
-        target: 'http://localhost:8080',
6
+        target: 'http://192.168.0.11:8080',
7 7
         changeOrigin: true,
8 8
         // pathRewrite: {
9 9
         //   '^/api': '/'