cloud-web-corejs 1.0.70 → 1.0.72

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.
@@ -130,10 +130,14 @@
130
130
  </span> -->
131
131
  </el-dialog>
132
132
 
133
- <infoIframeDialog v-if="showInfoIframeDialog" :visiable.sync="showInfoIframeDialog"
134
- :dataId="userInfo.id"></infoIframeDialog>
135
- <userInfo v-if="showUserInfoDialog" :visiable.sync="showUserInfoDialog" :_dataId="userInfo.id" topValue="128px"
136
- @reload="userInfoReload"></userInfo>
133
+ <!-- <infoIframeDialog v-if="showInfoIframeDialog" :visiable.sync="showInfoIframeDialog"
134
+ :dataId="userInfo.id"></infoIframeDialog> -->
135
+ <userInfo v-if="!isFormDev && showUserInfoDialog" :visiable.sync="showUserInfoDialog" :_dataId="userInfo.id"
136
+ topValue="128px"
137
+ @reload="userInfoReload"></userInfo>
138
+ <userFormInfo v-if="isFormDev && showUserInfoDialog" :visiable.sync="showUserInfoDialog" :_dataId="userInfo.id"
139
+ topValue="128px"
140
+ @reload="userInfoReload"></userFormInfo>
137
141
 
138
142
  <onlineTalk></onlineTalk>
139
143
  </div>
@@ -143,6 +147,7 @@
143
147
  import {mapGetters} from 'vuex';
144
148
  import variables from '@/styles/variables.scss';
145
149
  import userInfo from '@base/views/user/user/info.vue';
150
+ import userFormInfo from '@base/views/user/user/form_info.vue';
146
151
  import onlineTalk from "@base/components/onlineTalk";
147
152
  import {
148
153
  getToken
@@ -182,11 +187,12 @@ export default {
182
187
  menuModules: [],
183
188
  firstMenuHeight: 0, // 第一个菜单的高度
184
189
  eveyMenuHeight: 48, // 每一个菜单的高度
190
+ isFormDev: false,
185
191
  };
186
192
  },
187
- components: {userInfo, onlineTalk, langTool},
193
+ components: {userInfo, userFormInfo, onlineTalk, langTool},
188
194
  computed: {
189
- ...mapGetters(['permission_routes', 'sidebar', 'sidebarRouters', 'isBdAdmin']),
195
+ ...mapGetters(['permission_routes', 'sidebar', 'sidebarRouters', 'isBdAdmin', 'userFlag']),
190
196
  activeMenu() {
191
197
  const route = this.$route;
192
198
  const {meta, path} = route;
@@ -229,8 +235,13 @@ export default {
229
235
  if (query && query.flag == 1) {
230
236
  this.showCompanyDialog = true;
231
237
  }
238
+ this.initIsFormDev();
232
239
  },
233
240
  methods: {
241
+ initIsFormDev() {
242
+ let userFlag = this.userFlag
243
+ this.isFormDev = userFlag == 6 || userFlag == 7 || userFlag == 8;
244
+ },
234
245
  getMenuFlag() {
235
246
  return !this.isBdAdmin;
236
247
  },
@@ -0,0 +1,210 @@
1
+ <template>
2
+ <el-dialog
3
+ :title="$t1('个人设置')"
4
+ :append-to-body="true"
5
+ :modal-append-to-body="falseValue"
6
+ :close-on-click-modal="falseValue"
7
+ :visible.sync="showDialog"
8
+ :modal="falseValue"
9
+ custom-class="dialog-style list-dialog demo-sty_2"
10
+ width="500px"
11
+ @close="dialogClose"
12
+ v-el-drag-dialog
13
+ v-el-dialog-center
14
+ >
15
+ <div id="containt" style="height: 300px">
16
+ <div class="detail-wrap">
17
+ <el-form ref="editForm" :model="user">
18
+ <div class="d-header clearfix">
19
+ <div class="fl">
20
+ <i class="el-icon-info"/>
21
+ {{ dataId ? $t1('查看用户') : $t1('新增用户') }}
22
+ </div>
23
+ <div class="fr">
24
+ <el-button type="primary" plain class="button-sty" @click="reloadContent" icon="el-icon-refresh-right">
25
+ {{ $t1('重置') }}
26
+ </el-button>
27
+ <el-button type="primary" class="button-sty" icon="el-icon-check" @click="saveData">{{ $t1('保存') }}
28
+ </el-button>
29
+ </div>
30
+ </div>
31
+ <div class="d-cont" style="height: auto">
32
+ <div class="d-item" style="padding-right: 0">
33
+ <div class="title first"><b>{{ $t1('基本信息') }}</b></div>
34
+ <table class="table-detail">
35
+ <tbody>
36
+ <tr>
37
+ <th>
38
+ <em class="f-red">*</em>
39
+ {{ $t1('登录名') }}
40
+ </th>
41
+ <td colspan="3">
42
+ {{ user.loginAccount }}
43
+ </td>
44
+ </tr>
45
+ <tr>
46
+ <th>
47
+ <em class="f-red">*</em>
48
+ {{ $t1('姓名') }}
49
+ </th>
50
+ <td colspan="3">
51
+ <el-form-item prop="nickName" :rules="[{ required: true, trigger: 'blur' }]">
52
+ <el-input size="small" v-model="user.nickName" maxlength="200" lay-verify="required" required=""
53
+ clearable/>
54
+ </el-form-item>
55
+ </td>
56
+ </tr>
57
+ <tr>
58
+ <th>{{ $t1('密码') }}</th>
59
+ <td colspan="3">
60
+ <el-form-item prop="password" :rules="passRules">
61
+ <el-input
62
+ size="small"
63
+ type="password"
64
+ v-model="user.password"
65
+ show-password
66
+ maxlength="255"
67
+ autocomplete="off"
68
+ auto-complete="new-password"
69
+ clearable
70
+ />
71
+ </el-form-item>
72
+ </td>
73
+ </tr>
74
+ <tr>
75
+ <th>{{ $t1('确认密码') }}</th>
76
+ <td colspan="3">
77
+ <el-form-item prop="rePassword" :rules="pass2Rules">
78
+ <el-input
79
+ size="small"
80
+ type="password"
81
+ v-model="user.rePassword"
82
+ show-password
83
+ maxlength="255"
84
+ autocomplete="off"
85
+ auto-complete="new-password"
86
+ lay-verify="confirmPass"
87
+ clearable
88
+ />
89
+ </el-form-item>
90
+ </td>
91
+ </tr>
92
+ </tbody>
93
+ </table>
94
+ </div>
95
+ </div>
96
+ </el-form>
97
+ </div>
98
+ </div>
99
+ </el-dialog>
100
+ </template>
101
+
102
+ <script>
103
+ export default {
104
+ name: 'userInfo',
105
+ components: {},
106
+ props: ['_dataId'],
107
+ created() {
108
+ if (this._dataId && !isNaN(this._dataId)) this.dataId = this._dataId;
109
+ },
110
+ mounted() {
111
+ this.getData();
112
+ },
113
+ data() {
114
+ var validatePass = (rule, value, callback) => {
115
+ const isPassRequired = !this.dataId;
116
+ if (isPassRequired && (value == '' || value == undefined)) {
117
+ callback(new Error(this.$t1('密码不能为空')));
118
+ } else {
119
+ callback();
120
+ }
121
+ this.$refs.editForm.validateField('rePassword');
122
+ };
123
+ var validatePass2 = (rule, value, callback) => {
124
+ const isPassRequired = !this.dataId;
125
+ const rePassword = value != undefined ? value : '';
126
+ const password = this.user.password != undefined ? this.user.password : '';
127
+
128
+ if (isPassRequired && rePassword == '') {
129
+ callback(new Error(this.$t1('确认密码不能为空')));
130
+ } else if (rePassword != password) {
131
+ callback(new Error(this.$t1('两次输入密码不一致!')));
132
+ } else {
133
+ callback();
134
+ }
135
+ };
136
+ return {
137
+ showDialog: true,
138
+ falseValue: false,
139
+ dataId: '',
140
+ hBtn: true,
141
+ user: {},
142
+ vxeOption: {},
143
+ companyInfoOption: {},
144
+ userRoleOption: {},
145
+ showContent: true,
146
+ passRules: [{validator: validatePass, trigger: 'blur', required: false}],
147
+ pass2Rules: [{validator: validatePass2, trigger: 'blur', required: false}]
148
+ };
149
+ },
150
+ methods: {
151
+ getData() {
152
+ let t = this._dataId;
153
+ if (this.dataId && !isNaN(this.dataId)) {
154
+ this.isEdit = true;
155
+ this.$commonHttp({
156
+ url: USER_PREFIX + `/user/get`,
157
+ method: `post`,
158
+ data: {
159
+ id: this.dataId
160
+ },
161
+ isLoading: true,
162
+ modalStrictly: true,
163
+ success: res => {
164
+ var user = res.objx || {};
165
+ this.user = res.objx || {};
166
+ this.user.password = '';
167
+ }
168
+ });
169
+ } else {
170
+ this.isEdit = false;
171
+ this.user = {
172
+ enabled: true
173
+ };
174
+ }
175
+ },
176
+ saveData() {
177
+ this.$refs.editForm.$baseValidate(valid => {
178
+ if (valid) {
179
+ this.$baseConfirm(this.$t1('您确定要保存吗?')).then(() => {
180
+ var url = USER_PREFIX + '/user/updateUserInfo';
181
+ this.$http({
182
+ url: url,
183
+ method: `post`,
184
+ data: this.user,
185
+ isLoading: true,
186
+ success: res => {
187
+ this.$message({
188
+ message: res.content,
189
+ type: 'success',
190
+ duration: 500,
191
+ onClose: t => {
192
+ this.reloadContent();
193
+ }
194
+ });
195
+ }
196
+ });
197
+ });
198
+ }
199
+ });
200
+ },
201
+ dialogClose() {
202
+ this.$emit('update:visiable', false);
203
+ },
204
+ reloadContent() {
205
+ this.user = {};
206
+ this.getData();
207
+ }
208
+ }
209
+ };
210
+ </script>
@@ -7,12 +7,12 @@
7
7
  :visible.sync="showDialog"
8
8
  :modal="falseValue"
9
9
  custom-class="dialog-style list-dialog demo-sty_2"
10
- width="500px"
10
+ width="1000px"
11
11
  @close="dialogClose"
12
12
  v-el-drag-dialog
13
13
  v-el-dialog-center
14
14
  >
15
- <div id="containt" style="height: 300px">
15
+ <div id="containt">
16
16
  <div class="detail-wrap">
17
17
  <el-form ref="editForm" :model="user">
18
18
  <div class="d-header clearfix">
@@ -29,7 +29,7 @@
29
29
  </div>
30
30
  </div>
31
31
  <div class="d-cont" style="height: auto">
32
- <div class="d-item" style="padding-right: 0">
32
+ <div class="d-item">
33
33
  <div class="title first"><b>{{ $t1('基本信息') }}</b></div>
34
34
  <table class="table-detail">
35
35
  <tbody>
@@ -38,25 +38,41 @@
38
38
  <em class="f-red">*</em>
39
39
  {{ $t1('登录名') }}
40
40
  </th>
41
- <td colspan="3">
42
- {{ user.loginAccount }}
41
+ <td>
42
+ <el-form-item prop="loginAccount" :rules="[{ required: true, trigger: 'blur' }]">
43
+ <template v-if="dataId">
44
+ <el-input
45
+ size="small"
46
+ v-model="user.loginAccount"
47
+ maxlength="255"
48
+ autocomplete="off"
49
+ lay-verify="required"
50
+ required=""
51
+ :readonly="true"
52
+ />
53
+ </template>
54
+ <template v-else>
55
+ <el-input
56
+ size="small"
57
+ v-model="user.loginAccount"
58
+ maxlength="255"
59
+ autocomplete="off"
60
+ lay-verify="required"
61
+ required=""
62
+ clearable
63
+ />
64
+ </template>
65
+ </el-form-item>
43
66
  </td>
44
- </tr>
45
- <tr>
46
- <th>
47
- <em class="f-red">*</em>
48
- {{ $t1('姓名') }}
49
- </th>
50
- <td colspan="3">
51
- <el-form-item prop="nickName" :rules="[{ required: true, trigger: 'blur' }]">
52
- <el-input size="small" v-model="user.nickName" maxlength="200" lay-verify="required" required=""
53
- clearable/>
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/>
54
72
  </el-form-item>
55
73
  </td>
56
- </tr>
57
- <tr>
58
74
  <th>{{ $t1('密码') }}</th>
59
- <td colspan="3">
75
+ <td>
60
76
  <el-form-item prop="password" :rules="passRules">
61
77
  <el-input
62
78
  size="small"
@@ -70,10 +86,8 @@
70
86
  />
71
87
  </el-form-item>
72
88
  </td>
73
- </tr>
74
- <tr>
75
89
  <th>{{ $t1('确认密码') }}</th>
76
- <td colspan="3">
90
+ <td>
77
91
  <el-form-item prop="rePassword" :rules="pass2Rules">
78
92
  <el-input
79
93
  size="small"
@@ -89,6 +103,62 @@
89
103
  </el-form-item>
90
104
  </td>
91
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>
92
162
  </tbody>
93
163
  </table>
94
164
  </div>