cloud-web-corejs 1.0.54-dev.89 → 1.0.54-dev.90

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.89",
4
+ "version": "1.0.54-dev.90",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
@@ -130,11 +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"
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"
136
137
  @reload="userInfoReload"></userInfo>
137
-
138
+ <userFormInfo v-if="isFormDev && showUserInfoDialog" :visiable.sync="showUserInfoDialog" :_dataId="userInfo.id"
139
+ topValue="128px"
140
+ @reload="userInfoReload"></userFormInfo>
138
141
  <onlineTalk></onlineTalk>
139
142
  </div>
140
143
  </template>
@@ -143,6 +146,7 @@
143
146
  import {mapGetters} from 'vuex';
144
147
  import variables from '@/styles/variables.scss';
145
148
  import userInfo from '@base/views/user/user/info.vue';
149
+ import userFormInfo from '@base/views/user/user/form_info.vue';
146
150
  import onlineTalk from "@base/components/onlineTalk";
147
151
  import {
148
152
  getToken
@@ -183,11 +187,12 @@ export default {
183
187
  menuModules: [],
184
188
  firstMenuHeight: 0, // 第一个菜单的高度
185
189
  eveyMenuHeight: 48, // 每一个菜单的高度
190
+ isFormDev: false,
186
191
  };
187
192
  },
188
- components: {userInfo, onlineTalk, langTool},
193
+ components: {userInfo, userFormInfo, onlineTalk, langTool},
189
194
  computed: {
190
- ...mapGetters(['permission_routes', 'sidebar', 'sidebarRouters', 'isBdAdmin']),
195
+ ...mapGetters(['permission_routes', 'sidebar', 'sidebarRouters', 'isBdAdmin', 'userFlag']),
191
196
  activeMenu() {
192
197
  const route = this.$route;
193
198
  const {meta, path} = route;
@@ -231,8 +236,13 @@ export default {
231
236
  this.showCompanyDialog = true;
232
237
  }
233
238
  initPddLog();//初始化拼多多日志
239
+ this.initIsFormDev();
234
240
  },
235
241
  methods: {
242
+ initIsFormDev() {
243
+ let userFlag = this.userFlag
244
+ this.isFormDev = userFlag == 6 || userFlag == 7 || userFlag == 8;
245
+ },
236
246
  getMenuFlag() {
237
247
  return !this.isBdAdmin;
238
248
  },
@@ -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>
@@ -1,50 +0,0 @@
1
- import settingConfig from "@/settings";
2
-
3
- export function initPddLog(){
4
- if(!pddLogEnabled || !window.PDD_OPEN_init)return
5
- setInterval(function(){
6
- pddIntfHandle();
7
- },5000)
8
- }
9
-
10
- function getPageCode(callback) {
11
- return window.$vueRoot.$http({
12
- url: "/pdd_api/router",
13
- method: 'post',
14
- data: {"id": "pdd.cloud.isv.page.code"},
15
- success: res => {
16
- callback(res.objx)
17
- }
18
- });
19
- }
20
-
21
- function handlePati(pati) {
22
- return window.$vueRoot.$http({
23
- url: "/pdd_api/router",
24
- method: 'post',
25
- data: {"id": "pdd.cloud.isv.page.code",pati},
26
- success: res => {
27
-
28
- }
29
- });
30
- }
31
-
32
- async function pddIntfHandle() {
33
- getPageCode(async (pageCode)=>{
34
- PDD_OPEN_init({
35
- code: pageCode
36
- // 对于获取 code 接口或未登录态,可不传 code:PDD_OPEN_init({}, function () { ... })
37
- }, function () {
38
- // 初始化已完成
39
- window.PDD_OPEN_getPati().then(
40
- function (pati) {
41
- // 使用 pati
42
- handlePati(pati)
43
- }).catch(error => console.log(error))
44
- })
45
-
46
- })
47
- }
48
-
49
-
50
- export default modules