cloud-web-corejs 1.0.54-dev.623 → 1.0.54-dev.625

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cloud-web-corejs",
3
3
  "private": false,
4
- "version": "1.0.54-dev.623",
4
+ "version": "1.0.54-dev.625",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
package/src/utils/vab.js CHANGED
@@ -1229,7 +1229,7 @@ install = (Vue, opts = {}) => {
1229
1229
  if(!i18n.te(path)){
1230
1230
  return i18n._t(path, lang, {zh: {[path]: path}}, null, values);
1231
1231
  }else{
1232
- return i18n.t(path, values);
1232
+ return i18n.t(path, values) || i18n._t(path, lang, {zh: {[path]: path}}, null, values);
1233
1233
  }
1234
1234
  }
1235
1235
  };
@@ -17,148 +17,237 @@
17
17
  <el-form ref="editForm" :model="user">
18
18
  <div class="d-header clearfix">
19
19
  <div class="fl">
20
- <i class="el-icon-info"/>
21
- {{ dataId ? $t1('查看用户') : $t1('新增用户') }}
20
+ <i class="el-icon-info" />
21
+ {{ dataId ? $t1("查看用户") : $t1("新增用户") }}
22
22
  </div>
23
23
  <div class="fr">
24
- <el-button type="primary" plain class="button-sty" @click="reloadContent" icon="el-icon-refresh-right">
25
- {{ $t1('重置') }}
24
+ <el-button
25
+ type="primary"
26
+ plain
27
+ class="button-sty"
28
+ @click="reloadContent"
29
+ icon="el-icon-refresh-right"
30
+ >
31
+ {{ $t1("重置") }}
26
32
  </el-button>
27
- <el-button type="primary" class="button-sty" icon="el-icon-check" @click="saveData">{{ $t1('保存') }}
33
+ <el-button
34
+ type="primary"
35
+ class="button-sty"
36
+ icon="el-icon-check"
37
+ @click="saveData"
38
+ >{{ $t1("保存") }}
28
39
  </el-button>
29
40
  </div>
30
41
  </div>
31
42
  <div class="d-cont" style="height: auto">
32
43
  <div class="d-item">
33
- <div class="title first"><b>{{ $t1('基本信息') }}</b></div>
44
+ <div class="title first">
45
+ <b>{{ $t1("基本信息") }}</b>
46
+ </div>
34
47
  <table class="table-detail">
35
48
  <tbody>
36
- <tr>
37
- <th>
38
- <em class="f-red">*</em>
39
- {{ $t1('登录名') }}
40
- </th>
41
- <td>
42
- <el-form-item prop="loginAccount" :rules="[{ required: true, trigger: 'blur' }]">
43
- <template v-if="dataId">
49
+ <tr>
50
+ <th>
51
+ <em class="f-red">*</em>
52
+ {{ $t1("登录名") }}
53
+ </th>
54
+ <td>
55
+ <el-form-item
56
+ prop="loginAccount"
57
+ :rules="[{ required: true, trigger: 'blur' }]"
58
+ >
59
+ <template v-if="dataId">
60
+ <el-input
61
+ size="small"
62
+ v-model="user.loginAccount"
63
+ maxlength="255"
64
+ autocomplete="off"
65
+ lay-verify="required"
66
+ required=""
67
+ :readonly="true"
68
+ />
69
+ </template>
70
+ <template v-else>
71
+ <el-input
72
+ size="small"
73
+ v-model="user.loginAccount"
74
+ maxlength="255"
75
+ autocomplete="off"
76
+ lay-verify="required"
77
+ required=""
78
+ clearable
79
+ />
80
+ </template>
81
+ </el-form-item>
82
+ </td>
83
+ <th>{{ $t1("手机") }}</th>
84
+ <td>
85
+ <el-form-item
86
+ prop="mobile"
87
+ :rules="[{ required: false, trigger: 'blur' }]"
88
+ >
44
89
  <el-input
45
90
  size="small"
46
- v-model="user.loginAccount"
91
+ v-model="user.mobile"
92
+ type="text"
47
93
  maxlength="255"
48
94
  autocomplete="off"
49
- lay-verify="required"
50
- required=""
51
- :readonly="true"
95
+ lay-verify="required|phone"
96
+ clearable
97
+ />
98
+ </el-form-item>
99
+ </td>
100
+ <th>{{ $t1("密码") }}</th>
101
+ <td>
102
+ <el-form-item prop="password" :rules="passRules">
103
+ <el-input
104
+ size="small"
105
+ type="password"
106
+ v-model="user.password"
107
+ show-password
108
+ maxlength="255"
109
+ autocomplete="off"
110
+ auto-complete="new-password"
111
+ clearable
52
112
  />
53
- </template>
54
- <template v-else>
113
+ </el-form-item>
114
+ </td>
115
+ <th>{{ $t1("确认密码") }}</th>
116
+ <td>
117
+ <el-form-item prop="rePassword" :rules="pass2Rules">
55
118
  <el-input
56
119
  size="small"
57
- v-model="user.loginAccount"
120
+ type="password"
121
+ v-model="user.rePassword"
122
+ show-password
58
123
  maxlength="255"
59
124
  autocomplete="off"
125
+ auto-complete="new-password"
126
+ lay-verify="confirmPass"
127
+ clearable
128
+ />
129
+ </el-form-item>
130
+ </td>
131
+ </tr>
132
+ <tr>
133
+ <th>
134
+ <em class="f-red">*</em>
135
+ {{ $t1("姓名") }}
136
+ </th>
137
+ <td>
138
+ <el-form-item
139
+ prop="nickName"
140
+ :rules="[{ required: true, trigger: 'blur' }]"
141
+ >
142
+ <el-input
143
+ size="small"
144
+ v-model="user.nickName"
145
+ maxlength="200"
60
146
  lay-verify="required"
61
147
  required=""
62
148
  clearable
63
149
  />
64
- </template>
65
- </el-form-item>
66
- </td>
67
- <th>{{ $t1('手机') }}</th>
68
- <td>
69
- <el-form-item prop="mobile" :rules="[{ required: false, trigger: 'blur' }]">
70
- <el-input size="small" v-model="user.mobile" type="text" maxlength="255" autocomplete="off"
71
- lay-verify="required|phone" clearable/>
72
- </el-form-item>
73
- </td>
74
- <th>{{ $t1('密码') }}</th>
75
- <td>
76
- <el-form-item prop="password" :rules="passRules">
150
+ </el-form-item>
151
+ </td>
152
+ <th>{{ $t1("性别") }}</th>
153
+ <td>
154
+ <el-radio-group v-model="user.gender">
155
+ <el-radio :label="1">{{ $t1("男") }}</el-radio>
156
+ <el-radio :label="2">{{ $t1("") }}</el-radio>
157
+ </el-radio-group>
158
+ </td>
159
+ <th>{{ $t1("出生日期") }}</th>
160
+ <td>
161
+ <el-date-picker
162
+ size="small"
163
+ v-model="user.birth"
164
+ type="date"
165
+ placeholder="选择日期"
166
+ value-format="yyyy-MM-dd"
167
+ clearable
168
+ />
169
+ </td>
170
+ <th>{{ $t1("邮编") }}</th>
171
+ <td>
77
172
  <el-input
78
173
  size="small"
79
- type="password"
80
- v-model="user.password"
81
- show-password
174
+ id="zipCode"
175
+ v-model="user.zipCode"
176
+ name="zipCode"
82
177
  maxlength="255"
83
- autocomplete="off"
84
- auto-complete="new-password"
85
178
  clearable
86
179
  />
87
- </el-form-item>
88
- </td>
89
- <th>{{ $t1('确认密码') }}</th>
90
- <td>
91
- <el-form-item prop="rePassword" :rules="pass2Rules">
180
+ </td>
181
+ </tr>
182
+ <tr>
183
+ <th>{{ $t1("地址") }}</th>
184
+ <td colspan="3">
92
185
  <el-input
93
186
  size="small"
94
- type="password"
95
- v-model="user.rePassword"
96
- show-password
187
+ v-model="user.address"
188
+ class="b"
97
189
  maxlength="255"
98
- autocomplete="off"
99
- auto-complete="new-password"
100
- lay-verify="confirmPass"
101
190
  clearable
102
191
  />
103
- </el-form-item>
104
- </td>
105
- </tr>
106
- <tr>
107
- <th>
108
- <em class="f-red">*</em>
109
- {{ $t1('姓名') }}
110
- </th>
111
- <td>
112
- <el-form-item prop="nickName" :rules="[{ required: true, trigger: 'blur' }]">
113
- <el-input size="small" v-model="user.nickName" maxlength="200" lay-verify="required" required=""
114
- clearable/>
115
- </el-form-item>
116
- </td>
117
- <th>{{ $t1('性别') }}</th>
118
- <td>
119
- <el-radio-group v-model="user.gender">
120
- <el-radio :label="1">{{ $t1('男') }}</el-radio>
121
- <el-radio :label="2">{{ $t1('女') }}</el-radio>
122
- </el-radio-group>
123
- </td>
124
- <th>{{ $t1('出生日期') }}</th>
125
- <td>
126
- <el-date-picker size="small" v-model="user.birth" type="date" placeholder="选择日期"
127
- value-format="yyyy-MM-dd" clearable/>
128
- </td>
129
- <th>{{ $t1('邮编') }}</th>
130
- <td>
131
- <el-input size="small" id="zipCode" v-model="user.zipCode" name="zipCode" maxlength="255"
132
- clearable/>
133
- </td>
134
- </tr>
135
- <tr>
136
- <th>{{ $t1('地址') }}</th>
137
- <td colspan="3">
138
- <el-input size="small" v-model="user.address" class="b" maxlength="255" clearable/>
139
- </td>
140
- <th>{{ $t1('设置') }}</th>
141
- <td colspan="3">
142
- <el-checkbox label="是否启用" v-model="user.enabled"></el-checkbox>
143
- </td>
144
- </tr>
145
- <tr>
146
- <th>{{ $t1('头像') }}</th>
147
- <td colspan="7">
148
- <baseUpload :limit="1" accept="image/png, image/jpeg" multi="false" :file.sync="user.headPhotoUrl"
149
- dataType="medium"></baseUpload>
150
- </td>
151
- </tr>
152
- <tr>
153
- <th>{{ $t1('创建人') }}</th>
154
- <td>{{ user.createBy }}</td>
155
- <th>{{ $t1('创建时间') }}</th>
156
- <td>{{ user.createDate }}</td>
157
- <th>{{ $t1('更新人') }}</th>
158
- <td>{{ user.modifyBy }}</td>
159
- <th>{{ $t1('更新时间') }}</th>
160
- <td>{{ user.modifyDate }}</td>
161
- </tr>
192
+ </td>
193
+ <th>{{ $t1("设置") }}</th>
194
+ <td colspan="3">
195
+ <el-checkbox
196
+ label="是否启用"
197
+ v-model="user.enabled"
198
+ ></el-checkbox>
199
+ </td>
200
+ </tr>
201
+ <tr>
202
+ <th>
203
+ {{ $t1("地区") }}
204
+ </th>
205
+ <td colspan="3">
206
+ <el-form-item
207
+ prop="areaName"
208
+ :rules="[{ required: false, trigger: 'blur' }]"
209
+ >
210
+ <el-input
211
+ class="search-input"
212
+ v-model="user.areaName"
213
+ clearable
214
+ @clear="
215
+ user.areaName = null;
216
+ user.areaId = null;
217
+ "
218
+ v-el-readonly
219
+ >
220
+ <i
221
+ slot="suffix"
222
+ class="el-input__icon el-icon-search"
223
+ @click="showAreaDialog = true"
224
+ ></i>
225
+ </el-input>
226
+ </el-form-item>
227
+ </td>
228
+ </tr>
229
+ <tr>
230
+ <th>{{ $t1("头像") }}</th>
231
+ <td colspan="7">
232
+ <baseUpload
233
+ :limit="1"
234
+ accept="image/png, image/jpeg"
235
+ multi="false"
236
+ :file.sync="user.headPhotoUrl"
237
+ dataType="medium"
238
+ ></baseUpload>
239
+ </td>
240
+ </tr>
241
+ <tr>
242
+ <th>{{ $t1("创建人") }}</th>
243
+ <td>{{ user.createBy }}</td>
244
+ <th>{{ $t1("创建时间") }}</th>
245
+ <td>{{ user.createDate }}</td>
246
+ <th>{{ $t1("更新人") }}</th>
247
+ <td>{{ user.modifyBy }}</td>
248
+ <th>{{ $t1("更新时间") }}</th>
249
+ <td>{{ user.modifyDate }}</td>
250
+ </tr>
162
251
  </tbody>
163
252
  </table>
164
253
  </div>
@@ -166,14 +255,22 @@
166
255
  </el-form>
167
256
  </div>
168
257
  </div>
258
+ <areaDialog
259
+ v-if="showAreaDialog"
260
+ :visiable.sync="showAreaDialog"
261
+ @confirm="confirmArea"
262
+ multi="false"
263
+ />
169
264
  </el-dialog>
170
265
  </template>
171
266
 
172
267
  <script>
173
268
  export default {
174
- name: 'userInfo',
175
- components: {},
176
- props: ['_dataId'],
269
+ name: "userInfo",
270
+ components: {
271
+ areaDialog: () => import("../../../views/user/area/dialog.vue"),
272
+ },
273
+ props: ["_dataId"],
177
274
  created() {
178
275
  if (this._dataId && !isNaN(this._dataId)) this.dataId = this._dataId;
179
276
  },
@@ -183,22 +280,23 @@ export default {
183
280
  data() {
184
281
  var validatePass = (rule, value, callback) => {
185
282
  const isPassRequired = !this.dataId;
186
- if (isPassRequired && (value == '' || value == undefined)) {
187
- callback(new Error(this.$t1('密码不能为空')));
283
+ if (isPassRequired && (value == "" || value == undefined)) {
284
+ callback(new Error(this.$t1("密码不能为空")));
188
285
  } else {
189
286
  callback();
190
287
  }
191
- this.$refs.editForm.validateField('rePassword');
288
+ this.$refs.editForm.validateField("rePassword");
192
289
  };
193
290
  var validatePass2 = (rule, value, callback) => {
194
291
  const isPassRequired = !this.dataId;
195
- const rePassword = value != undefined ? value : '';
196
- const password = this.user.password != undefined ? this.user.password : '';
292
+ const rePassword = value != undefined ? value : "";
293
+ const password =
294
+ this.user.password != undefined ? this.user.password : "";
197
295
 
198
- if (isPassRequired && rePassword == '') {
199
- callback(new Error(this.$t1('确认密码不能为空')));
296
+ if (isPassRequired && rePassword == "") {
297
+ callback(new Error(this.$t1("确认密码不能为空")));
200
298
  } else if (rePassword != password) {
201
- callback(new Error(this.$t1('两次输入密码不一致!')));
299
+ callback(new Error(this.$t1("两次输入密码不一致!")));
202
300
  } else {
203
301
  callback();
204
302
  }
@@ -206,15 +304,23 @@ export default {
206
304
  return {
207
305
  showDialog: true,
208
306
  falseValue: false,
209
- dataId: '',
307
+ dataId: "",
210
308
  hBtn: true,
211
- user: {},
309
+ user: {
310
+ areaName: null,
311
+ areaId: null,
312
+ },
212
313
  vxeOption: {},
213
314
  companyInfoOption: {},
214
315
  userRoleOption: {},
215
316
  showContent: true,
216
- passRules: [{validator: validatePass, trigger: 'blur', required: false}],
217
- pass2Rules: [{validator: validatePass2, trigger: 'blur', required: false}]
317
+ passRules: [
318
+ { validator: validatePass, trigger: "blur", required: false },
319
+ ],
320
+ pass2Rules: [
321
+ { validator: validatePass2, trigger: "blur", required: false },
322
+ ],
323
+ showAreaDialog: false,
218
324
  };
219
325
  },
220
326
  methods: {
@@ -226,55 +332,62 @@ export default {
226
332
  url: USER_PREFIX + `/user/get`,
227
333
  method: `post`,
228
334
  data: {
229
- id: this.dataId
335
+ id: this.dataId,
230
336
  },
231
337
  isLoading: true,
232
338
  modalStrictly: true,
233
- success: res => {
339
+ success: (res) => {
234
340
  var user = res.objx || {};
235
341
  this.user = res.objx || {};
236
- this.user.password = '';
237
- }
342
+ this.user.password = "";
343
+ },
238
344
  });
239
345
  } else {
240
346
  this.isEdit = false;
241
347
  this.user = {
242
- enabled: true
348
+ enabled: true,
243
349
  };
244
350
  }
245
351
  },
246
352
  saveData() {
247
- this.$refs.editForm.$baseValidate(valid => {
353
+ this.$refs.editForm.$baseValidate((valid) => {
248
354
  if (valid) {
249
- this.$baseConfirm(this.$t1('您确定要保存吗?')).then(() => {
250
- var url = USER_PREFIX + '/user/updateUserInfo';
355
+ this.$baseConfirm(this.$t1("您确定要保存吗?")).then(() => {
356
+ var url = USER_PREFIX + "/user/updateUserInfo";
251
357
  this.$http({
252
358
  url: url,
253
359
  method: `post`,
254
360
  data: this.user,
255
361
  isLoading: true,
256
- success: res => {
362
+ success: (res) => {
257
363
  this.$message({
258
364
  message: res.content,
259
- type: 'success',
365
+ type: "success",
260
366
  duration: 500,
261
- onClose: t => {
367
+ onClose: (t) => {
262
368
  this.reloadContent();
263
- }
369
+ },
264
370
  });
265
- }
371
+ },
266
372
  });
267
373
  });
268
374
  }
269
375
  });
270
376
  },
271
377
  dialogClose() {
272
- this.$emit('update:visiable', false);
378
+ this.$emit("update:visiable", false);
273
379
  },
274
380
  reloadContent() {
275
381
  this.user = {};
276
382
  this.getData();
277
- }
278
- }
383
+ },
384
+ confirmArea(rows) {
385
+ if (rows.length) {
386
+ let row = rows[0];
387
+ this.user.areaId = row.id;
388
+ this.user.areaName = row.fullName;
389
+ }
390
+ },
391
+ },
279
392
  };
280
393
  </script>