cloud-web-corejs 1.0.54-dev.624 → 1.0.54-dev.626
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 +1 -1
- package/src/views/user/user/edit.vue +18 -15
- package/src/views/user/user/info.vue +253 -140
package/package.json
CHANGED
|
@@ -632,7 +632,7 @@ export default {
|
|
|
632
632
|
storageType: "user",
|
|
633
633
|
data: () => {
|
|
634
634
|
this.handleData();
|
|
635
|
-
return this.
|
|
635
|
+
return this.getReqFormData();
|
|
636
636
|
},
|
|
637
637
|
chooseConfirm: (tempStorageData) => {
|
|
638
638
|
this.user = tempStorageData;
|
|
@@ -696,6 +696,22 @@ export default {
|
|
|
696
696
|
this.showExtendedProperties = true;
|
|
697
697
|
}
|
|
698
698
|
},
|
|
699
|
+
getReqFormData() {
|
|
700
|
+
let userCompanyInfoDTOs = this.user.userCompanyInfoDTOs.map((item) => {
|
|
701
|
+
return {
|
|
702
|
+
...item,
|
|
703
|
+
saleOrgGridOption: null,
|
|
704
|
+
roleGridOption: null,
|
|
705
|
+
saleOrgData: null,
|
|
706
|
+
roleData: null,
|
|
707
|
+
};
|
|
708
|
+
});
|
|
709
|
+
let formData = {
|
|
710
|
+
...this.user,
|
|
711
|
+
userCompanyInfoDTOs,
|
|
712
|
+
};
|
|
713
|
+
return formData;
|
|
714
|
+
},
|
|
699
715
|
saveData() {
|
|
700
716
|
let companyCode = this.companyInfo.companyCode;
|
|
701
717
|
this.handleData();
|
|
@@ -718,20 +734,7 @@ export default {
|
|
|
718
734
|
if (valid) {
|
|
719
735
|
this.$baseConfirm(this.$t1("您确定要保存吗?")).then(() => {
|
|
720
736
|
var url = USER_PREFIX + (this.isEdit ? "/user/update" : "/user/save");
|
|
721
|
-
let
|
|
722
|
-
return {
|
|
723
|
-
...item,
|
|
724
|
-
saleOrgGridOption: null,
|
|
725
|
-
roleGridOption: null,
|
|
726
|
-
saleOrgData: null,
|
|
727
|
-
roleData: null,
|
|
728
|
-
};
|
|
729
|
-
});
|
|
730
|
-
let formData = {
|
|
731
|
-
...this.user,
|
|
732
|
-
userCompanyInfoDTOs,
|
|
733
|
-
};
|
|
734
|
-
|
|
737
|
+
let formData = this.getReqFormData();
|
|
735
738
|
this.$http({
|
|
736
739
|
url: url,
|
|
737
740
|
method: `post`,
|
|
@@ -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(
|
|
20
|
+
<i class="el-icon-info" />
|
|
21
|
+
{{ dataId ? $t1("查看用户") : $t1("新增用户") }}
|
|
22
22
|
</div>
|
|
23
23
|
<div class="fr">
|
|
24
|
-
<el-button
|
|
25
|
-
|
|
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
|
|
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"
|
|
44
|
+
<div class="title first">
|
|
45
|
+
<b>{{ $t1("基本信息") }}</b>
|
|
46
|
+
</div>
|
|
34
47
|
<table class="table-detail">
|
|
35
48
|
<tbody>
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
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.
|
|
91
|
+
v-model="user.mobile"
|
|
92
|
+
type="text"
|
|
47
93
|
maxlength="255"
|
|
48
94
|
autocomplete="off"
|
|
49
|
-
lay-verify="required"
|
|
50
|
-
|
|
51
|
-
|
|
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
|
-
</
|
|
54
|
-
|
|
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
|
-
|
|
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
|
-
</
|
|
65
|
-
</
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
</
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
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
|
-
|
|
80
|
-
v-model="user.
|
|
81
|
-
|
|
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
|
-
</
|
|
88
|
-
</
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
<
|
|
180
|
+
</td>
|
|
181
|
+
</tr>
|
|
182
|
+
<tr>
|
|
183
|
+
<th>{{ $t1("地址") }}</th>
|
|
184
|
+
<td colspan="3">
|
|
92
185
|
<el-input
|
|
93
186
|
size="small"
|
|
94
|
-
|
|
95
|
-
|
|
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
|
-
</
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
</
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
</
|
|
140
|
-
<
|
|
141
|
-
|
|
142
|
-
<
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
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:
|
|
175
|
-
components: {
|
|
176
|
-
|
|
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 ==
|
|
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(
|
|
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 =
|
|
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: [
|
|
217
|
-
|
|
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(
|
|
250
|
-
var url = USER_PREFIX +
|
|
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:
|
|
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(
|
|
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>
|