eoss-mobiles 0.2.13 → 0.2.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19,8 +19,6 @@ var _qs2 = _interopRequireDefault(_qs);
19
19
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
20
20
 
21
21
  var apiUrl = _util2.default.getStorage('host');
22
- // import Vue from 'vue';
23
-
24
22
  var http = _axios2.default.create({
25
23
  baseURL: apiUrl,
26
24
  timeout: 60000,
@@ -113,6 +111,7 @@ http.interceptors.request.use(function (config) {
113
111
  return Promise.error(error);
114
112
  });
115
113
  // 响应拦截器
114
+
116
115
  http.interceptors.response.use(function (response) {
117
116
  if (response.status === 200) {
118
117
  if (response.data.rCode === 64 || response.data.rCode === 27) {
@@ -121,7 +120,7 @@ http.interceptors.response.use(function (response) {
121
120
  return Promise.resolve(response.data);
122
121
  }
123
122
  } else {
124
- return Promise.reject(response);
123
+ return Promise.reject(response.data);
125
124
  }
126
125
  }, function (error) {
127
126
  if (error && error.response) {
package/lib/utils/util.js CHANGED
@@ -1211,6 +1211,23 @@ var openAttachment = function openAttachment(data) {
1211
1211
  }
1212
1212
  }
1213
1213
  };
1214
+ /**
1215
+ * jsGoPayrollIndexAct
1216
+ * @desc:原生app打开工资条页面
1217
+ * @date 2024年1月11日
1218
+ * @author liufan
1219
+ */
1220
+ var jsGoPayrollIndexAct = function jsGoPayrollIndexAct(id) {
1221
+ var u = navigator.userAgent;
1222
+ var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1; // android终端
1223
+ var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/); // ios终端
1224
+ if (isAndroid) {
1225
+ window.AndroidWebView.jsGoPayrollIndexAct(id);
1226
+ } else if (isiOS) {
1227
+ window.webkit.messageHandlers.jsGoPayrollIndexAct.postMessage(id);
1228
+ }
1229
+ };
1230
+
1214
1231
  /**
1215
1232
  * deepClone
1216
1233
  * @desc:深拷贝
@@ -1268,6 +1285,21 @@ var exclAttribute = function exclAttribute(_ref4) {
1268
1285
  }
1269
1286
  return obj;
1270
1287
  };
1288
+ /**
1289
+ * 获取UUID
1290
+ * @desc:generateUUID
1291
+ * @author liufan
1292
+ * @date 2024年1月12日
1293
+ **/
1294
+ var generateUUID = function generateUUID() {
1295
+ var d = new Date().getTime();
1296
+ var uuid = 'xxxxxxxxxxxxxxxyxxxxxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
1297
+ var r = (d + Math.random() * 16) % 16 | 0;
1298
+ d = Math.floor(d / 16);
1299
+ return (c === 'x' ? r : r & 0x3 | 0x8).toString(16);
1300
+ });
1301
+ return uuid;
1302
+ };
1271
1303
  exports.default = {
1272
1304
  esEncrypt: esEncrypt,
1273
1305
  esDecode: esDecode,
@@ -1311,5 +1343,7 @@ exports.default = {
1311
1343
  getTypeName: getTypeName,
1312
1344
  replenish: replenish,
1313
1345
  identical: identical,
1314
- exportXls: exportXls
1346
+ jsGoPayrollIndexAct: jsGoPayrollIndexAct,
1347
+ exportXls: exportXls,
1348
+ generateUUID: generateUUID
1315
1349
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eoss-mobiles",
3
- "version": "0.2.13",
3
+ "version": "0.2.14",
4
4
  "description": "eoss内部移动端业务组件",
5
5
  "main": "lib/eoss-mobile.common.js",
6
6
  "files": [
@@ -21,6 +21,8 @@
21
21
  :isOpinionRequired="isOpinionRequired"
22
22
  :disabled="isBanInputOpinion != 0"
23
23
  :baseUrl="baseUrl"
24
+ :isForceDisplayDefaultOptionForPrefix="isForceDisplayDefaultOptionForPrefix"
25
+ :nodeDefaultSubmitOpinion="nodeDefaultSubmitOpinion"
24
26
  :nodeFixedOpinionSelectList="nodeFixedOpinionSelectList"
25
27
  :isHiddenOftenOpinion="isHiddenOftenOpinion == 1 ? false : true"
26
28
  ></Opinion>
@@ -295,7 +297,6 @@
295
297
  v-model="nextReadUserSelectList"
296
298
  multiple
297
299
  :objType="objType"
298
- required
299
300
  :param="{
300
301
  pid: pid
301
302
  }"
@@ -479,6 +480,7 @@ export default {
479
480
  objType: 'enterprise', //树点击对象
480
481
  selectType: 'employee', // 树 选择类型
481
482
  isNextBox: true, // 是否展开隐藏下步操作
483
+ isForceDisplayDefaultOptionForPrefix:false,
482
484
  isOtherUnit: true, //是否是外单位
483
485
  isShowNode: false,
484
486
  subProcessInfo: '',
@@ -1281,6 +1283,7 @@ export default {
1281
1283
  // that.isChooseNextNode = nodeInfoMap.nodeExtAttr.isChooseNextNode;
1282
1284
  that.isBanInputOpinion =
1283
1285
  nodeInfoMap.nodeExtAttr.isBanInputOpinion;
1286
+ that.isForceDisplayDefaultOptionForPrefix = nodeInfoMap.nodeExtAttr.isForceDisplayDefaultOptionForPrefix == 1;
1284
1287
  }
1285
1288
  that.choiceOrgId = choiceOrgId;
1286
1289
  that.choiceDeptId = choiceDeptId;
@@ -32,7 +32,7 @@
32
32
  />
33
33
  <span
34
34
  class="em-flow-opion"
35
- v-if="opinionList.length > 0 && isHiddenOftenOpinion"
35
+ v-if="isHiddenOftenOpinion"
36
36
  @click="showPicker = true"
37
37
  >常用意见 <i class="iconfont icon-em-more"
38
38
  /></span>
@@ -88,7 +88,7 @@
88
88
  :columns="opinionList"
89
89
  valueKey="content"
90
90
  @cancel="handleClose"
91
- @confirm="onInput"
91
+ @confirm="onInput($event, true)"
92
92
  >
93
93
  </van-picker>
94
94
  </van-popup>
@@ -139,6 +139,14 @@ export default {
139
139
  userId: {
140
140
  type: String,
141
141
  default: ''
142
+ },
143
+ isForceDisplayDefaultOptionForPrefix: {
144
+ type: Boolean,
145
+ default: false
146
+ },
147
+ nodeDefaultSubmitOpinion: {
148
+ type: String,
149
+ default: ''
142
150
  }
143
151
  },
144
152
  // components: {
@@ -147,6 +155,7 @@ export default {
147
155
  data() {
148
156
  return {
149
157
  opinion: '',
158
+ newOpinion: '',
150
159
  fixedDisabled: false,
151
160
  showPicker: false,
152
161
  esignPath: '',
@@ -159,6 +168,17 @@ export default {
159
168
  opinionList: [] //意见列表
160
169
  };
161
170
  },
171
+ watch: {
172
+ isForceDisplayDefaultOptionForPrefix: {
173
+ handler(val) {
174
+ if (val) {
175
+ this.opinion = this.nodeDefaultSubmitOpinion;
176
+ }
177
+ },
178
+ deep: true,
179
+ immediate: true
180
+ }
181
+ },
162
182
  created() {
163
183
  if (this.nodeFixedOpinionSelectList.length > 0) {
164
184
  this.opinionList = this.nodeFixedOpinionSelectList;
@@ -202,9 +222,25 @@ export default {
202
222
  });
203
223
  },
204
224
  // 将input的值传递到父组件
205
- onInput(val) {
225
+ onInput(val, isSelect) {
206
226
  const { isImageOpinion, file } = this;
207
227
  this.opinion = typeof val === 'string' ? val : val.content;
228
+ if (
229
+ this.isForceDisplayDefaultOptionForPrefix &&
230
+ !this.opinion.startsWith(this.nodeDefaultSubmitOpinion) &&
231
+ !isSelect
232
+ ) {
233
+ this.opinion = this.nodeDefaultSubmitOpinion + this.newOpinion;
234
+ } else if (this.isForceDisplayDefaultOptionForPrefix && !isSelect) {
235
+ this.newOpinion = this.opinion.replace(
236
+ this.nodeDefaultSubmitOpinion,
237
+ ''
238
+ );
239
+ }
240
+ if (this.isForceDisplayDefaultOptionForPrefix && isSelect) {
241
+ this.newOpinion = this.opinion;
242
+ this.opinion = this.nodeDefaultSubmitOpinion + this.opinion;
243
+ }
208
244
  this.$emit('onInputOpintion', {
209
245
  opinion: this.opinion,
210
246
  isImageOpinion,
@@ -22,9 +22,9 @@
22
22
  <div class="input-box">
23
23
  <!-- 下一步所有相关操作-->
24
24
  <div>
25
- <div @click="isNextBox = !isNextBox" class="shrink-btn">
25
+ <!-- <div @click="isNextBox = !isNextBox" class="shrink-btn">
26
26
  {{ isNextBox ? '收起下一步操作和节点' : '展开下一步操作和节点' }}
27
- </div>
27
+ </div> -->
28
28
  <div class="next-box" v-show="isNextBox">
29
29
  <!-- 下一步操作 -->
30
30
  <div class="item">
@@ -164,7 +164,7 @@ export default {
164
164
  isChooseNextNode: 0,
165
165
  isOpinionRequired: 0, //办理意见是否必填
166
166
  isBanInputOpinion: 0, //是否禁用意见
167
- isNextBox: false, // 是否展开隐藏下步操作
167
+ isNextBox: true, // 是否展开隐藏下步操作
168
168
  defaultNotificationType: [], //选中消息数组
169
169
  // showAppUser: false, // 办理人遮罩层
170
170
  showNextList: false, // 下一步遮罩层
@@ -61,6 +61,12 @@ export default {
61
61
  },
62
62
  data() {
63
63
  return {};
64
+ },
65
+ mounted(){
66
+ for(let i=0;i<10;i++){
67
+ if(i == 2) return
68
+ console.log(i)
69
+ }
64
70
  }
65
71
  };
66
72
  </script>
@@ -0,0 +1,5 @@
1
+ import EmRetrialAuth from './src/main';
2
+
3
+ EmRetrialAuth.install = Vue => Vue.component(EmRetrialAuth.name, EmRetrialAuth);
4
+
5
+ export default EmRetrialAuth;
@@ -0,0 +1,257 @@
1
+ <template>
2
+ <div class="em-retrial-auth" v-if="show">
3
+ <div class="em-retrial-auth-box">
4
+ 验证码将发送至{{
5
+ active == 'WEB_SMS' ? `手机号:${phoneText}` : `邮箱:${emailText}`
6
+ }}
7
+ <em-input
8
+ style="margin:10px 0px"
9
+ v-model="formData.verificationCode"
10
+ center
11
+ clearable
12
+ hide-label
13
+ placeholder="请输入验证码"
14
+ >
15
+ <template slot="button">
16
+ <em-button
17
+ size="small"
18
+ type="primary"
19
+ :disabled="disabled"
20
+ @click.stop="getCode"
21
+ >{{ btnText }}</em-button
22
+ >
23
+ </template>
24
+ </em-input>
25
+ <em-button style="width:100%" type="primary" @click="handleAuth"
26
+ >提交验证</em-button
27
+ >
28
+ <div class="em-retrial-auth-icon-box" v-if="newType.length > 1">
29
+ <div
30
+ class="em-retrial-auth-icon-box-item"
31
+ :class="{ active: active === item }"
32
+ v-for="item in newType"
33
+ :key="item"
34
+ @click="active = item"
35
+ >
36
+ <van-icon
37
+ :name="item === 'WEB_SMS' ? 'phone-o' : 'envelop-o'"
38
+ color="#fff"
39
+ />
40
+ </div>
41
+ </div>
42
+ </div>
43
+ </div>
44
+ </template>
45
+
46
+ <script>
47
+ import request from '../../../src/utils/http.js';
48
+ import utils from '../../../src/utils/util';
49
+ import {
50
+ initRetrialAuth,
51
+ getRetrialAuthCode,
52
+ codeRetrialAuth
53
+ } from '../../../src/config/api';
54
+
55
+ export default {
56
+ name: 'EmRetrialAuth',
57
+ props: {
58
+ reload: {
59
+ type: String,
60
+ default: ''
61
+ },
62
+ group: {
63
+ type: String,
64
+ default: ''
65
+ },
66
+ type: {
67
+ type: [String, Array],
68
+ default: () => []
69
+ },
70
+ url: {
71
+ type: String,
72
+ default: ''
73
+ },
74
+ params: {
75
+ type: Object,
76
+ default: () => {}
77
+ },
78
+ method: {
79
+ type: String,
80
+ default: 'get'
81
+ }
82
+ },
83
+ data() {
84
+ return {
85
+ active: 0,
86
+ newReload: '',
87
+ newData: '',
88
+ show: false,
89
+ newGroup: '',
90
+ newType: '',
91
+ emailText: '',
92
+ retrialAuthGroupId: utils.generateUUID(),
93
+ formData: {
94
+ verificationCode: ''
95
+ },
96
+ phoneText: '',
97
+ btnText: '获取验证码',
98
+ disabled: false,
99
+ countdown: 0,
100
+ submit: false,
101
+ uuid: null,
102
+ timer:null
103
+ };
104
+ },
105
+ mounted() {
106
+ if (this.url) {
107
+ this.reqUrl();
108
+ } else {
109
+ this.newGroup = this.group;
110
+ this.newReload = this.reload;
111
+ this.newType = this.type.filter(item => item != 'SCANCODE');
112
+ if (this.newType.length > 0) {
113
+ this.active = this.newType[0];
114
+ }
115
+ }
116
+ },
117
+ methods: {
118
+ handleAuth() {
119
+ if (this.submit) {
120
+ return false;
121
+ }
122
+ if (!this.formData.verificationCode) return this.$toast('请输入验证码');
123
+ this.submit = true;
124
+ let params = {
125
+ retrialAuthGroupIds: this.newGroup,
126
+ targetType: this.active === 'WEB_SMS' ? 'SMS' : 'EMAIL',
127
+ verificationCode: this.formData.verificationCode
128
+ };
129
+ this.$toast.loading({
130
+ message: '加载中...',
131
+ forbidClick: true,
132
+ loadingType: 'spinner',
133
+ overlay: true,
134
+ duration: 0
135
+ });
136
+ request({
137
+ url: codeRetrialAuth,
138
+ type: 'post',
139
+ params: params
140
+ })
141
+ .then(res => {
142
+ let { rCode, msg } = res;
143
+ this.$toast.clear();
144
+ if (rCode == 0) {
145
+ this.$toast('认证成功');
146
+ this.$emit('success',this.retrialAuthGroupId);
147
+ } else {
148
+ this.$toast(msg);
149
+ this.$emit('error');
150
+ this.submit = false;
151
+ }
152
+ })
153
+ .catch();
154
+ },
155
+ getCode() {
156
+ if (this.countdown) {
157
+ return false;
158
+ }
159
+ let params = { targetType: this.active === 'WEB_SMS' ? 'SMS' : 'EMAIL' };
160
+ this.countdown = 60;
161
+ this.timer = setInterval(() => {
162
+ if (this.countdown > 0) {
163
+ this.countdown--;
164
+ this.disabled = true;
165
+ this.btnText = '重新获取' + this.countdown + 's';
166
+ } else {
167
+ this.btnText = '重新获取';
168
+ this.disabled = false;
169
+ this.submit = false;
170
+ clearInterval(this.timer);
171
+ }
172
+ }, 1000);
173
+ this.$toast.loading({
174
+ message: '加载中...',
175
+ forbidClick: true,
176
+ loadingType: 'spinner',
177
+ overlay: true,
178
+ duration: 0
179
+ });
180
+ request({
181
+ url: getRetrialAuthCode,
182
+ type: 'post',
183
+ params: params
184
+ })
185
+ .then(res => {
186
+ let { rCode, msg } = res;
187
+ this.$toast.clear();
188
+ if (rCode == 0) {
189
+ this.$toast(
190
+ '验证码已发送至' +
191
+ (this.active === 'WEB_SMS' ? '手机' : '邮箱') +
192
+ ',请注意查收!'
193
+ );
194
+ } else {
195
+ this.$toast(msg);
196
+ this.$emit('error');
197
+ }
198
+ })
199
+ .catch();
200
+ },
201
+ init() {
202
+ request({
203
+ url: initRetrialAuth
204
+ })
205
+ .then(res => {
206
+ let { rCode, results } = res;
207
+ this.$toast.clear();
208
+ if (rCode == 0) {
209
+ this.uuid = results.uuid;
210
+ // this.qrImg = results.qrImg;
211
+ this.emailText = results.emailText;
212
+ this.phoneText = results.phoneText;
213
+ // if (this.active === 'SCANCODE') {
214
+ // this.handleScanCodeRetrialAuth();
215
+ // }
216
+ }
217
+ })
218
+ .catch();
219
+ },
220
+ reqUrl() {
221
+ this.$toast.loading({
222
+ message: '加载中...',
223
+ forbidClick: true,
224
+ loadingType: 'spinner',
225
+ overlay: true,
226
+ duration: 0
227
+ });
228
+ request({
229
+ url: this.url,
230
+ params: { ...this.params, retrialAuthGroupId: this.retrialAuthGroupId },
231
+ type: this.method
232
+ }).then(res => {
233
+ const { rCode, results, msg } = res;
234
+ if (rCode == 61) {
235
+ if (results) {
236
+ this.newReload = results.reload || results.refresh;
237
+ this.newGroup = results.retrialAuthGroupIds;
238
+ this.newType = results.retrialAuthType.filter(
239
+ item => item != 'SCANCODE'
240
+ );
241
+ this.init();
242
+ if (this.newType.length > 0) {
243
+ this.active = this.newType[0];
244
+ }
245
+ }
246
+ this.show = true;
247
+ } else {
248
+ this.$toast(msg);
249
+ this.$emit('error');
250
+ }
251
+ });
252
+ }
253
+ }
254
+ };
255
+ </script>
256
+
257
+ <style></style>