浏览代码

新增处理日志

seimin 2 年之前
父节点
当前提交
66cbfddffb
共有 1 个文件被更改,包括 59 次插入17 次删除
  1. 59 17
      src/components/showModel/showModel.vue

+ 59 - 17
src/components/showModel/showModel.vue

@@ -22,16 +22,29 @@
22 22
           <cube-select
23 23
             v-model="selectGroupId"
24 24
             :options="selectDataGroup"
25
-            placeholder="请选择工作组" @change="changeGroup($event)"
25
+            placeholder="请选择工作组"
26
+            @change="changeGroup($event)"
26 27
           ></cube-select>
27 28
           <cube-select
28 29
             v-model="selectUserId"
29 30
             :options="selectDataUser"
30
-            placeholder="请选择指派对象" style="margin-top:0.5rem;"
31
+            placeholder="请选择指派对象"
32
+            style="margin-top:0.5rem;"
31 33
           ></cube-select>
32 34
         </div>
33 35
         <div v-if="textName === 'textarea'">
34
-          <cube-textarea autofocus :maxlength="255" v-model="textareaData" placeholder="请填写处理日志" style="border:1px solid #ececec;height:2rem;resize:none;"></cube-textarea>
36
+          <div class="tipsAll">
37
+            <div class="tips" v-for="item in logs" :key="item.id" @click="copyTo(item.value)">
38
+              {{ item.value }}
39
+            </div>
40
+          </div>
41
+          <cube-textarea
42
+            autofocus
43
+            :maxlength="255"
44
+            v-model="textareaData"
45
+            placeholder="请填写处理日志"
46
+            style="border:1px solid #ececec;height:2rem;resize:none;"
47
+          ></cube-textarea>
35 48
         </div>
36 49
       </div>
37 50
       <div class="showModel__footer">
@@ -60,6 +73,7 @@
60 73
 export default {
61 74
   data() {
62 75
     return {
76
+      logs: [],
63 77
       time: 5, //5秒后自动关闭
64 78
       timer: null, //5秒后自动关闭,定时器
65 79
       timerFlag: true, //是否显示取消自动关闭按钮
@@ -67,7 +81,7 @@ export default {
67 81
       selectUserId: 0, //select选中的数据-用户
68 82
       selectDataGroup: [], //select数据-工作组
69 83
       selectGroupId: 0, //select选中的数据-工作组
70
-      textareaData: '', //textarea的数据
84
+      textareaData: "" //textarea的数据
71 85
     };
72 86
   },
73 87
   watch: {
@@ -77,7 +91,7 @@ export default {
77 91
         this.selectUserId = 0;
78 92
       }
79 93
       if (newValue && this.textName === "textarea") {
80
-        this.textareaData = '';
94
+        this.textareaData = "";
81 95
       }
82 96
       if (newValue && this.operate.know == "知道了") {
83 97
         this.time = 5;
@@ -138,8 +152,20 @@ export default {
138 152
     }
139 153
   },
140 154
   methods: {
155
+    copyTo(value){
156
+      this.textareaData += value;
157
+    },
158
+    getLogs() {
159
+      var postData = { idx: 0, sum: 999, dictionary: { key: "processingLog" } };
160
+      this.$http
161
+        .post("service/bpm/data/fetchDataList/dictionary", postData)
162
+        .then(res => {
163
+          res.data.list = res.data.list || [];
164
+          this.logs = res.data.list.slice(0,2);
165
+        });
166
+    },
141 167
     //选择组
142
-    changeGroup(groupId){
168
+    changeGroup(groupId) {
143 169
       this.getZpUser(groupId);
144 170
     },
145 171
     // 获取指派对象
@@ -152,19 +178,19 @@ export default {
152 178
           roledata: { rolecode: "first-line support" },
153 179
           roledata2: { rolecode: "second-line support" },
154 180
           selectType: "1",
155
-          selectDetails:1
181
+          selectDetails: 1
156 182
         }
157 183
       };
158
-      if(groupId){
159
-        postData.user.groupdata = {id:groupId}
184
+      if (groupId) {
185
+        postData.user.groupdata = { id: groupId };
160 186
       }
161 187
       this.$http
162 188
         .post("service/user/data/fetchDataList/user", postData)
163 189
         .then(res => {
164 190
           res.data.list = res.data.list || [];
165
-          this.selectDataUser = res.data.list.map((v) => {
191
+          this.selectDataUser = res.data.list.map(v => {
166 192
             return {
167
-              text: v.name+'【'+v.taskCount+'】',
193
+              text: v.name + "【" + v.taskCount + "】",
168 194
               value: v.id
169 195
             };
170 196
           });
@@ -181,8 +207,8 @@ export default {
181 207
       this.$http
182 208
         .post("service/user/data/fetchDataList/group", postData)
183 209
         .then(res => {
184
-          res.data.list = res.data.list||[];
185
-          this.selectDataGroup = res.data.list.map((v) => {
210
+          res.data.list = res.data.list || [];
211
+          this.selectDataGroup = res.data.list.map(v => {
186 212
             return {
187 213
               text: v.groupName,
188 214
               value: v.id
@@ -196,9 +222,9 @@ export default {
196 222
     },
197 223
     // 确定
198 224
     ok() {
199
-      if (this.selectName === 'user') {
225
+      if (this.selectName === "user") {
200 226
         this.$emit("ok", this.selectUserId);
201
-      }else if (this.textName === 'textarea') {
227
+      } else if (this.textName === "textarea") {
202 228
         this.$emit("ok", this.textareaData);
203 229
       } else {
204 230
         this.$emit("ok");
@@ -224,6 +250,9 @@ export default {
224 250
       this.getZpGroup();
225 251
       this.getZpUser();
226 252
     }
253
+    if (this.textName === "textarea") {
254
+      this.getLogs();
255
+    }
227 256
   }
228 257
 };
229 258
 </script>
@@ -238,6 +267,19 @@ export default {
238 267
   background-color: rgba(0, 0, 0, 0.2);
239 268
   z-index: 99;
240 269
 
270
+  .tipsAll {
271
+    display: flex;
272
+    flex-wrap: wrap;
273
+    .tips {
274
+      word-break: break-all;
275
+      margin-bottom: 0.1rem;
276
+      margin-left: 0.2rem;
277
+      &:first-of-type {
278
+        margin-left: 0;
279
+      }
280
+    }
281
+  }
282
+
241 283
   .showModel__wrap {
242 284
     width: 5.6rem;
243 285
     position: absolute;
@@ -257,9 +299,9 @@ export default {
257 299
     }
258 300
 
259 301
     .showModel__article {
260
-      margin: 0.4rem auto 0.25rem;
302
+      margin: 0.2rem auto;
261 303
       width: 4.88rem;
262
-      padding: 0.6rem 0;
304
+      padding: 0.2rem;
263 305
       background-color: rgb(249, 250, 251);
264 306
       border: 0.02rem solid rgb(229, 233, 237);
265 307
       border-radius: 0.12rem;