Przeglądaj źródła

修复 页面 和 后端Bug

weiximei 6 lat temu
rodzic
commit
6e3023bcba
17 zmienionych plików z 225 dodań i 47 usunięć
  1. 6
    1
      CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TicketController.java
  2. 10
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpMessageMapper.java
  3. 11
    0
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpMessage.java
  4. 3
    3
      CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTicket.java
  5. 49
    13
      CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TicketServiceImpl.java
  6. 28
    4
      CODE/smart-community/app-api/src/main/resources/mapper/TpMessageMapper.xml
  7. 1
    1
      CODE/smart-community/operate-api/src/main/java/com/community/huiju/controller/CodeController.java
  8. 1
    1
      CODE/smart-community/operate-api/src/main/resources/mapper/ToBannerMapper.xml
  9. 8
    2
      CODE/smart-community/zuul/src/main/java/com/community/huiju/filter/DomainZuulPostFilter.java
  10. 49
    0
      CODE/smart-community/zuul/src/main/java/com/community/huiju/filter/IgnoreZuulPreFilter.java
  11. 1
    1
      VUECODE/smart-operate-manage/src/components/Wangeditor/index.vue
  12. 3
    2
      VUECODE/smart-operate-manage/src/store/modules/user.js
  13. 10
    1
      VUECODE/smart-operate-manage/src/views/banner/addBanner/index.vue
  14. 10
    1
      VUECODE/smart-operate-manage/src/views/banner/ediBanner/index.vue
  15. 2
    1
      VUECODE/smart-operate-manage/src/views/banner/index.vue
  16. 13
    3
      VUECODE/smart-operate-manage/src/views/banner/infoBanner/index.vue
  17. 20
    13
      VUECODE/smart-operate-manage/src/views/login/index.vue

+ 6
- 1
CODE/smart-community/app-api/src/main/java/com/community/huiju/controller/TicketController.java Wyświetl plik

@@ -81,7 +81,12 @@ public class TicketController extends BaseController {
81 81
         }
82 82
 
83 83
         TpTicket ticket = iTicketService.getTicketSchedule(String.valueOf(communityId), ticketId);
84
-        responseBean.addSuccess(ticket);
84
+        if (null != ticket) {
85
+            responseBean.addSuccess(ticket);
86
+        }else {
87
+            responseBean.addError("没有该工单!");
88
+        }
89
+
85 90
         return responseBean;
86 91
     }
87 92
 

+ 10
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/dao/TpMessageMapper.java Wyświetl plik

@@ -26,4 +26,14 @@ public interface TpMessageMapper {
26 26
     List<TpMessage> getMessages(@Param(value = "userId") Integer userId,@Param(value = "communityId") Integer communityId, @Param(value = "modelType") Integer modelType);
27 27
 
28 28
     void updateReadStatus(@Param(value = "communityId")Integer communityId, @Param(value = "userId")Integer userId);
29
+
30
+    /**
31
+     * 查询工单消息
32
+     *
33
+     *  根据工单ID,模板类型 进行查询
34
+     *
35
+     * @param tpMessage
36
+     * @return
37
+     */
38
+    TpMessage selectTicketMessage(TpMessage tpMessage);
29 39
 }

+ 11
- 0
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpMessage.java Wyświetl plik

@@ -38,6 +38,9 @@ public class TpMessage {
38 38
     private Integer updateUser;
39 39
 
40 40
     private Date updateDate;
41
+
42
+    /** 缴费项ID **/
43
+    private Integer billId;
41 44
     
42 45
     /**
43 46
      * 工单状态
@@ -257,4 +260,12 @@ public class TpMessage {
257 260
     public void setMessageIconTitle(String messageIconTitle) {
258 261
         this.messageIconTitle = messageIconTitle;
259 262
     }
263
+
264
+    public Integer getBillId() {
265
+        return billId;
266
+    }
267
+
268
+    public void setBillId(Integer billId) {
269
+        this.billId = billId;
270
+    }
260 271
 }

+ 3
- 3
CODE/smart-community/app-api/src/main/java/com/community/huiju/model/TpTicket.java Wyświetl plik

@@ -39,7 +39,7 @@ public class TpTicket {
39 39
 
40 40
     private Date updateDate;
41 41
 
42
-    private List<TdImages> tdImagesList;
42
+    private String [] tdImagesList;
43 43
 
44 44
     private List<TpTicketRecord> ticketRecordList;
45 45
 
@@ -180,11 +180,11 @@ public class TpTicket {
180 180
         this.ticketRecordList = ticketRecordList;
181 181
     }
182 182
 
183
-    public List<TdImages> getTdImagesList() {
183
+    public String[] getTdImagesList() {
184 184
         return tdImagesList;
185 185
     }
186 186
 
187
-    public void setTdImagesList(List<TdImages> tdImagesList) {
187
+    public void setTdImagesList(String[] tdImagesList) {
188 188
         this.tdImagesList = tdImagesList;
189 189
     }
190 190
 }

+ 49
- 13
CODE/smart-community/app-api/src/main/java/com/community/huiju/service/impl/TicketServiceImpl.java Wyświetl plik

@@ -197,6 +197,7 @@ public class TicketServiceImpl implements ITicketService {
197 197
      * @return
198 198
      */
199 199
     @Override
200
+    @Transactional(rollbackFor = Exception.class)
200 201
     public TpTicket getTicketSchedule(String communityId, Integer ticketId) {
201 202
         //查看工单详情
202 203
         TpTicket ticket = tpTicketMapper.selectByTicketId(communityId, ticketId);
@@ -214,9 +215,27 @@ public class TicketServiceImpl implements ITicketService {
214 215
             map.put("type","service");
215 216
             List<TdImages> tdImagesList = tdImagesMapper.getByUUIDAndByType(map);
216 217
 
217
-            ticket.setTdImagesList(tdImagesList);
218
+            // 图片数组
219
+            String [] imgageArr = new String[tdImagesList.size()];
220
+
221
+            for (int i=0;i < tdImagesList.size(); i++) {
222
+                imgageArr[i]=tdImagesList.get(i).getImageUrl();
223
+            }
224
+
225
+            ticket.setTdImagesList(imgageArr);
218 226
             ticket.setTicketRecordList(ticketRecordList);
219 227
 
228
+            // 把该工单的消息变为 已读
229
+            TpMessage tpMessage = new TpMessage();
230
+            tpMessage.setTicketId(ticket.getId());
231
+            tpMessage.setModelType("1");
232
+
233
+            tpMessage = tpMessageMapper.selectTicketMessage(tpMessage);
234
+            tpMessage.setReadStatus("1");
235
+
236
+            //  变为已读
237
+            tpMessageMapper.updateByPrimaryKeySelective(tpMessage);
238
+
220 239
         }
221 240
         return ticket;
222 241
     }
@@ -283,16 +302,21 @@ public class TicketServiceImpl implements ITicketService {
283 302
      * @throws IOException
284 303
      */
285 304
     private void insertTdImage(TpTicket tpTicket, String imageUrl, Integer userId) throws IOException {
286
-        TdImages tdImages = new TdImages();
287
-        Integer uuId = tpTicket.getId();
288
-        tdImages.setImageUrl(imageUrl);
289
-        tdImages.setType(Constant.SERVICE);
290
-        tdImages.setUuid(uuId);
291
-        tdImages.setCreateUser(userId);
292
-        tdImages.setCreateTime(new Date());
293
-        tdImagesMapper.insertSelective(tdImages);
305
+        String [] imgArr = imageUrl.split(",");
306
+        for (String img : imgArr) {
307
+            TdImages tdImages = new TdImages();
308
+            Integer uuId = tpTicket.getId();
309
+            tdImages.setImageUrl(img);
310
+            tdImages.setType(Constant.SERVICE);
311
+            tdImages.setUuid(uuId);
312
+            tdImages.setCreateUser(userId);
313
+            tdImages.setCreateTime(new Date());
314
+            tdImagesMapper.insertSelective(tdImages);
315
+        }
316
+
294 317
     }
295 318
 
319
+
296 320
     /**
297 321
      * 回复工单
298 322
      * @param tpTicketRecordComment
@@ -324,13 +348,24 @@ public class TicketServiceImpl implements ITicketService {
324 348
         tdImagesMapper.deleteByUuidAndType(map);
325 349
 
326 350
         // 获取图片
327
-        List<TdImages> tdImagesList = tpTicket.getTdImagesList();
328
-        if (null != tdImagesList && tdImagesList.size() > 0) {
329
-            tdImagesList.stream().forEach(e->e.setCreateUser(userId));
351
+        String [] tdImagesArr = tpTicket.getTdImagesList();
352
+        List<TdImages> tdImagesList = Lists.newArrayList();
353
+        if (null != tdImagesArr && tdImagesArr.length > 0) {
354
+            for (String img : tdImagesArr) {
355
+                TdImages tdImages = new TdImages();
356
+                tdImages.setImageUrl(img);
357
+                tdImages.setCreateTime(new Date());
358
+                tdImages.setCreateUser(userId);
359
+                tdImages.setType("service");
360
+                tdImages.setUuid(ticketId);
361
+
362
+                tdImagesList.add(tdImages);
363
+            }
330 364
             // 插入图片链接
331 365
             tdImagesMapper.insertBatch(tdImagesList);
332 366
         }
333 367
 
368
+
334 369
         TpTicket ticket = tpTicketMapper.selectByPrimaryKey(ticketId);
335 370
         ticket.setTicketTitle(tpTicket.getTicketTitle());
336 371
         ticket.setTicketContent(tpTicket.getTicketContent());
@@ -378,7 +413,8 @@ public class TicketServiceImpl implements ITicketService {
378 413
         TpMessage tpMessage = new TpMessage();
379 414
         tpMessage.setCommunityId(tpTicket.getCommunityId());
380 415
         tpMessage.setTicketId(tpTicket.getId());
381
-        tpMessage.setMessageType(tpTicket.getType());
416
+        // 消息类型  1:工单类型  2:认证类型  3:管理类型  4: 下载类型
417
+        tpMessage.setMessageType("1");
382 418
         // 通知方式: APP 内通知
383 419
         tpMessage.setAdviceType("1");
384 420
         // 模板类型为 消息模板

+ 28
- 4
CODE/smart-community/app-api/src/main/resources/mapper/TpMessageMapper.xml Wyświetl plik

@@ -26,11 +26,12 @@
26 26
     <result column="unread_message_icon" property="unreadMessageIcon" jdbcType="VARCHAR" />
27 27
     <result column="message_detail_url" property="messageDetailUrl" jdbcType="VARCHAR" />
28 28
     <result column="message_icon_title" property="messageIconTitle" jdbcType="VARCHAR" />
29
+    <result column="bill_id" property="billId" jdbcType="INTEGER" />
29 30
   </resultMap>
30 31
   <sql id="Base_Column_List" >
31 32
     id, ticket_id,community_id, message_type, advice_type, model_type, uuid, uuid_type, source,
32 33
     message_content, status, result, meaasge_type_id, read_status, create_user, create_date, 
33
-    update_user, update_date
34
+    update_user, update_date, bill_id
34 35
   </sql>
35 36
   <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
36 37
     select 
@@ -48,13 +49,13 @@
48 49
       uuid_type, source, message_content, 
49 50
       status, result, meaasge_type_id, 
50 51
       read_status, create_user, create_date, 
51
-      update_user, update_date)
52
+      update_user, update_date, bill_id)
52 53
     values (#{id,jdbcType=INTEGER}, #{ticketId,jdbcType=INTEGER},#{communityId,jdbcType=INTEGER}, #{messageType,jdbcType=CHAR},
53 54
       #{adviceType,jdbcType=CHAR}, #{modelType,jdbcType=CHAR}, #{uuid,jdbcType=INTEGER}, 
54 55
       #{uuidType,jdbcType=CHAR}, #{source,jdbcType=CHAR}, #{messageContent,jdbcType=VARCHAR}, 
55 56
       #{status,jdbcType=CHAR}, #{result,jdbcType=VARCHAR}, #{meaasgeTypeId,jdbcType=VARCHAR}, 
56 57
       #{readStatus,jdbcType=CHAR}, #{createUser,jdbcType=INTEGER}, #{createDate,jdbcType=TIMESTAMP}, 
57
-      #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP})
58
+      #{updateUser,jdbcType=INTEGER}, #{updateDate,jdbcType=TIMESTAMP}, #{billId,jdbcType=INTEGER})
58 59
   </insert>
59 60
   <insert id="insertSelective" parameterType="com.community.huiju.model.TpMessage" useGeneratedKeys="true" keyProperty="id" >
60 61
     insert into tp_message
@@ -113,6 +114,9 @@
113 114
       <if test="updateDate != null" >
114 115
         update_date,
115 116
       </if>
117
+      <if test="billId != null">
118
+        bill_id,
119
+      </if>
116 120
     </trim>
117 121
     <trim prefix="values (" suffix=")" suffixOverrides="," >
118 122
       <if test="id != null" >
@@ -169,6 +173,9 @@
169 173
       <if test="updateDate != null" >
170 174
         #{updateDate,jdbcType=TIMESTAMP},
171 175
       </if>
176
+      <if test="billId != null">
177
+        #{billId,jdbcType=INTEGER},
178
+      </if>
172 179
     </trim>
173 180
   </insert>
174 181
   <update id="updateByPrimaryKeySelective" parameterType="com.community.huiju.model.TpMessage" >
@@ -225,6 +232,9 @@
225 232
       <if test="updateDate != null" >
226 233
         update_date = #{updateDate,jdbcType=TIMESTAMP},
227 234
       </if>
235
+      <if test="billId != null">
236
+        bill_id = #{billId,jdbcType=INTEGER}
237
+      </if>
228 238
     </set>
229 239
     where id = #{id,jdbcType=INTEGER}
230 240
   </update>
@@ -246,7 +256,8 @@
246 256
       create_user = #{createUser,jdbcType=INTEGER},
247 257
       create_date = #{createDate,jdbcType=TIMESTAMP},
248 258
       update_user = #{updateUser,jdbcType=INTEGER},
249
-      update_date = #{updateDate,jdbcType=TIMESTAMP}
259
+      update_date = #{updateDate,jdbcType=TIMESTAMP},
260
+      bill_id = #{billId,jdbcType=INTEGER}
250 261
     where id = #{id,jdbcType=INTEGER}
251 262
   </update>
252 263
 
@@ -320,4 +331,17 @@
320 331
     and uuid = #{userId}
321 332
   </update>
322 333
 
334
+  <select id="selectTicketMessage" resultMap="BaseResultMap" parameterType="com.community.huiju.model.TpMessage">
335
+    select
336
+    <include refid="Base_Column_List"/>
337
+    from tp_message
338
+    where message_type=1
339
+    <if test="ticketId != null and ticketId !=''">
340
+        and ticket_id=#{ticketId}
341
+    </if>
342
+    <if test="modelType != null and modelType !=''">
343
+        and model_type=#{modelType}
344
+    </if>
345
+  </select>
346
+
323 347
 </mapper>

+ 1
- 1
CODE/smart-community/operate-api/src/main/java/com/community/huiju/controller/CodeController.java Wyświetl plik

@@ -41,7 +41,7 @@ public class CodeController {
41 41
 
42 42
         log.info("{} 手机号校验结果: {}",phone, AccountValidatorUtil.isPhone(phone));
43 43
         if (!AccountValidatorUtil.isPhone(phone)){
44
-            response.addError("请输入正的手机号!");
44
+            response.addError("请输入正的手机号!");
45 45
             return response;
46 46
         }
47 47
 

+ 1
- 1
CODE/smart-community/operate-api/src/main/resources/mapper/ToBannerMapper.xml Wyświetl plik

@@ -12,7 +12,7 @@
12 12
     <result column="eff_time" property="effTime" jdbcType="TIMESTAMP" />
13 13
     <result column="exp_time" property="expTime" jdbcType="TIMESTAMP" />
14 14
     <result column="banner_type" property="bannerType" jdbcType="CHAR" />
15
-    <result column="external_link" property="externalLink" jdbcType="VARCHAR" />
15
+    <result column="external_link" property="externalLink" jdbcType="LONGVARCHAR" />
16 16
     <result column="banner_title" property="bannerTitle" jdbcType="VARCHAR" />
17 17
     <result column="create_user" property="createUser" jdbcType="INTEGER" />
18 18
     <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />

CODE/smart-community/zuul/src/main/java/com/community/huiju/filter/DomainZuulPreFilter.java → CODE/smart-community/zuul/src/main/java/com/community/huiju/filter/DomainZuulPostFilter.java Wyświetl plik

@@ -10,6 +10,7 @@ import com.netflix.zuul.ZuulFilter;
10 10
 import com.netflix.zuul.context.RequestContext;
11 11
 import com.netflix.zuul.exception.ZuulException;
12 12
 import org.apache.commons.lang.StringUtils;
13
+import org.springframework.http.HttpMethod;
13 14
 import org.springframework.http.MediaType;
14 15
 import org.springframework.stereotype.Component;
15 16
 
@@ -17,11 +18,11 @@ import javax.servlet.http.HttpServletRequest;
17 18
 import javax.servlet.http.HttpServletResponse;
18 19
 
19 20
 /**
20
- * 跨域
21
+ * 拦截Token
21 22
  * @author weiximei
22 23
  */
23 24
 //@Component
24
-public class DomainZuulPreFilter extends ZuulFilter {
25
+public class DomainZuulPostFilter extends ZuulFilter {
25 26
 
26 27
     @Override
27 28
     public String filterType() {
@@ -35,6 +36,11 @@ public class DomainZuulPreFilter extends ZuulFilter {
35 36
 
36 37
     @Override
37 38
     public boolean shouldFilter() {
39
+        RequestContext ctx = RequestContext.getCurrentContext();
40
+        HttpServletRequest request = ctx.getRequest();
41
+        if (request.getMethod().equals("OPTIONS")) {
42
+            return false;
43
+        }
38 44
         return true;
39 45
     }
40 46
 

+ 49
- 0
CODE/smart-community/zuul/src/main/java/com/community/huiju/filter/IgnoreZuulPreFilter.java Wyświetl plik

@@ -0,0 +1,49 @@
1
+package com.community.huiju.filter;
2
+
3
+import com.alibaba.fastjson.JSONObject;
4
+import com.community.commom.constant.Constant;
5
+import com.community.commom.mode.ResponseBean;
6
+import com.community.commom.session.UserElement;
7
+import com.community.huiju.constant.Header;
8
+import com.netflix.zuul.ZuulFilter;
9
+import com.netflix.zuul.context.RequestContext;
10
+import com.netflix.zuul.exception.ZuulException;
11
+import org.apache.commons.lang.StringUtils;
12
+import org.springframework.stereotype.Component;
13
+
14
+import javax.servlet.http.HttpServletRequest;
15
+import javax.servlet.http.HttpServletResponse;
16
+
17
+/**
18
+ * 忽略拦截
19
+ * @author weiximei
20
+ */
21
+//@Component
22
+public class IgnoreZuulPreFilter extends ZuulFilter {
23
+
24
+    @Override
25
+    public String filterType() {
26
+        return "pre";
27
+    }
28
+
29
+    @Override
30
+    public int filterOrder() {
31
+        return 0;
32
+    }
33
+
34
+    @Override
35
+    public boolean shouldFilter() {
36
+        RequestContext ctx = RequestContext.getCurrentContext();
37
+        HttpServletRequest request = ctx.getRequest();
38
+        System.out.println(request.getMethod());
39
+        if (request.getMethod().equals("OPTIONS") || request.getMethod().equals("PUT")) {
40
+            return false;
41
+        }
42
+        return true;
43
+    }
44
+
45
+    @Override
46
+    public Object run() throws ZuulException {
47
+        return null;
48
+    }
49
+}

+ 1
- 1
VUECODE/smart-operate-manage/src/components/Wangeditor/index.vue Wyświetl plik

@@ -9,7 +9,7 @@ import E from 'wangeditor'
9 9
 import { mapGetters } from 'vuex'
10 10
 export default {
11 11
   name: 'EditorElem',
12
-  props:['content'], // 接收父组件的方法
12
+  props: ['content'], // 接收父组件的方法
13 13
   data() {
14 14
     return {
15 15
       editorContent: this.content, // 内容

+ 3
- 2
VUECODE/smart-operate-manage/src/store/modules/user.js Wyświetl plik

@@ -68,8 +68,9 @@ const user = {
68 68
     SendCode({ commit, state }, userName) {
69 69
       return new Promise((resolve, reject) => {
70 70
         sendCode(userName).then(response => {
71
-          const data = response.message
72
-          resolve(data)
71
+          //const data = response.message
72
+          // resolve(data)
73
+          resolve(response)
73 74
         }).catch(error => {
74 75
           reject(error)
75 76
         })

+ 10
- 1
VUECODE/smart-operate-manage/src/views/banner/addBanner/index.vue Wyświetl plik

@@ -124,6 +124,15 @@ export default {
124 124
       listLoading: true,
125 125
       importanceOptions: [1, 2, 3],
126 126
       calendarTypeOptions,
127
+      communityQuery: {
128
+        pageNum: 1,
129
+        pageSize: 300,
130
+        communityId: undefined,
131
+        communityName: undefined,
132
+        provinceId: undefined,
133
+        cityId: undefined,
134
+        districtId: undefined
135
+      },
127 136
       imageUrl: '', // 图片预览
128 137
       listQuery: [], // 接收查询参数,在返回给首页
129 138
       addForm: {
@@ -228,7 +237,7 @@ export default {
228 237
     },
229 238
     getCommuniryList() {
230 239
       this.listLoading = true
231
-      this.FetchCommunityList().then(() => {
240
+      this.FetchCommunityList(this.communityQuery).then(() => {
232 241
         this.listLoading = false
233 242
       }).catch(() => {
234 243
         this.loading = false

+ 10
- 1
VUECODE/smart-operate-manage/src/views/banner/ediBanner/index.vue Wyświetl plik

@@ -127,6 +127,15 @@ export default {
127 127
       imageUrl: '', // 图片预览
128 128
       importanceOptions: [1, 2, 3],
129 129
       calendarTypeOptions,
130
+      communityQuery: {
131
+        pageNum: 1,
132
+        pageSize: 300,
133
+        communityId: undefined,
134
+        communityName: undefined,
135
+        provinceId: undefined,
136
+        cityId: undefined,
137
+        districtId: undefined
138
+      },
130 139
       listQuery: [],
131 140
       form: {
132 141
         id: '',
@@ -242,7 +251,7 @@ export default {
242 251
     },
243 252
     getCommuniryList() {
244 253
       this.listLoading = true
245
-      this.FetchCommunityList().then(() => {
254
+      this.FetchCommunityList(this.communityQuery).then(() => {
246 255
         this.listLoading = false
247 256
       }).catch(() => {
248 257
         this.loading = false

+ 2
- 1
VUECODE/smart-operate-manage/src/views/banner/index.vue Wyświetl plik

@@ -37,7 +37,8 @@
37 37
       <el-table-column label="标题" align="center" min-width="250px">
38 38
         <template slot-scope="scope">
39 39
           <!-- <span class="link-type" @click="handleUpdate(scope.row)">{{ scope.row.title }}</span> -->
40
-          <span class="link-type title-span" @click="infoBanner(scope.row.id)">{{ scope.row.title }}</span>
40
+          <!-- style="color: #409EFF;cursor: pointer" -->
41
+          <span class="link-type" style="color: #409EFF;cursor: pointer" @click="infoBanner(scope.row.id)">{{ scope.row.title }}</span>
41 42
         </template>
42 43
       </el-table-column>
43 44
       <el-table-column label="适用社区" align="center">

+ 13
- 3
VUECODE/smart-operate-manage/src/views/banner/infoBanner/index.vue Wyświetl plik

@@ -35,7 +35,7 @@
35 35
         <span v-show="showContentVisible" label="2" @change="showContent">自写文章</span>
36 36
       </el-form-item>
37 37
       <el-form-item v-if="showURLVisible" :label-width="formLabelWidth" label="跳转链接">
38
-        <span><a :href="form.externalLink" target="_blank">{{ form.externalLink }}</a></span>
38
+        <span><a :href="form.externalLink" style="color: #409EFF;cursor: pointer" target="_blank">{{ form.externalLink }}</a></span>
39 39
       </el-form-item>
40 40
       <div v-if="showContentVisible">
41 41
         <el-form-item :label-width="formLabelWidth" label="内容标题">
@@ -44,7 +44,7 @@
44 44
         <!-- <el-form-item :label-width="formLabelWidth" label="内容详情">
45 45
           <el-input v-model="form.bannerContent" placeholder="内容详情"/>
46 46
         </el-form-item> -->
47
-        <el-form-item :label-width="formLabelWidth" label="内容详情">
47
+        <el-form-item :label-width="formLabelWidth" label="内容详情" id="bannerContent">
48 48
           <div id="father" v-html="this.form.bannerContent"></div>
49 49
         </el-form-item>
50 50
       </div>
@@ -99,6 +99,15 @@ export default {
99 99
       imageUrl: '', // 图片预览
100 100
       importanceOptions: [1, 2, 3],
101 101
       calendarTypeOptions,
102
+      communityQuery: {
103
+        pageNum: 1,
104
+        pageSize: 300,
105
+        communityId: undefined,
106
+        communityName: undefined,
107
+        provinceId: undefined,
108
+        cityId: undefined,
109
+        districtId: undefined
110
+      },
102 111
       listQuery: [],
103 112
       form: {
104 113
         id: '',
@@ -234,7 +243,7 @@ export default {
234 243
     },
235 244
     getCommuniryList() {
236 245
       this.listLoading = true
237
-      this.FetchCommunityList().then(() => {
246
+      this.FetchCommunityList(this.communityQuery).then(() => {
238 247
         this.listLoading = false
239 248
       }).catch(() => {
240 249
         this.loading = false
@@ -292,6 +301,7 @@ export default {
292 301
   height: 178px;
293 302
   display: block;
294 303
 }
304
+
295 305
 </style>
296 306
 
297 307
 

+ 20
- 13
VUECODE/smart-operate-manage/src/views/login/index.vue Wyświetl plik

@@ -39,7 +39,7 @@
39 39
           />
40 40
         </el-form-item>
41 41
         <el-button type="primary" @click="sendCode();" v-if="isCodeNum == false">发送验证码</el-button>
42
-        <el-button type="primary" disabled v-else>{{ codeNum }}</el-button>
42
+        <el-button type="primary" disabled v-else>{{ codeNum + '秒后重新获取' }}</el-button>
43 43
       </div>
44 44
       <el-button
45 45
         :loading="loading"
@@ -61,7 +61,7 @@ export default {
61 61
   data () {
62 62
     const validateUsername = (rule, value, callback) => {
63 63
       if (!isvalidUsername(value)) {
64
-        callback(new Error('该手机号不合法'))
64
+        callback(new Error('请输入正确的手机号'))
65 65
       } else {
66 66
         callback()
67 67
       }
@@ -121,21 +121,27 @@ export default {
121 121
       // this.$router.push({ path: this.redirect || '/index' })
122 122
     },
123 123
     sendCode () {
124
+      // 默认为1, 1表示不成功
125
+      let resCode = 1;
124 126
       this.$store.dispatch('SendCode', this.loginForm.username).then((res) => {
127
+        // 成功则为 0 
128
+        resCode = res.code
129
+        // 为0发送成功
130
+        if (resCode === '0') {
131
+          this.codeNum = 60
132
+          this.isCodeNum = true
133
+          let time = setInterval(()=> {
134
+            if (this.codeNum === 1) {
135
+              clearInterval(time)
136
+              this.isCodeNum = false
137
+            }
138
+            this.codeNum --
139
+          }, 1000)
140
+        }
125 141
       }).catch(() => {
126 142
         console.log('error sendcode')
127 143
       })
128 144
 
129
-      this.codeNum = 60
130
-      this.isCodeNum = true
131
-      let time = setInterval(()=> {
132
-        if (this.codeNum === 1) {
133
-          clearInterval(time)
134
-          this.isCodeNum = false
135
-        }
136
-        this.codeNum --
137
-      }, 1000)
138
-
139 145
     }
140 146
   }
141 147
 }
@@ -220,12 +226,13 @@ $light_gray: #eee;
220 226
       float: left;
221 227
       .el-form-item {
222 228
         float: left;
229
+        width: 158px;
223 230
         .el-input {
224 231
           float: left;
225 232
         }
226 233
       }
227 234
       .el-button {
228
-        margin-left: 20px;
235
+        margin-left: 10px;
229 236
       }
230 237
     }
231 238
   }