agilebuilder-ui 1.0.63 → 1.0.65

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,6 +1,6 @@
1
1
  {
2
2
  "name": "agilebuilder-ui",
3
- "version": "1.0.63",
3
+ "version": "1.0.65",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "main": "./lib/super-ui.js",
@@ -74,7 +74,7 @@
74
74
  </div>
75
75
  </template>
76
76
  </el-table-column>
77
- <el-table-column
77
+ <!-- <el-table-column
78
78
  v-if="multiple"
79
79
  :label="$t('superGrid.index')"
80
80
  align="center"
@@ -83,25 +83,32 @@
83
83
  <template v-slot="scope">
84
84
  {{ scope.$index + 1 }}
85
85
  </template>
86
- </el-table-column>
86
+ </el-table-column> -->
87
87
  <el-table-column
88
88
  :label="$t('departmentUserTreeInline.name')"
89
89
  :width="130"
90
90
  prop="name"
91
91
  >
92
92
  <template v-slot="scope">
93
- <span
94
- v-if="scope.row.enName && scope.row.enName.trim() !== ''"
95
- :title="scope.row.name + '(' + scope.row.enName + ')'"
96
- class="ellipsis cell--span"
97
- >{{ scope.row.name + '(' + scope.row.enName + ')' }}</span
98
- >
99
- <span v-else :title="scope.row.name" class="ellipsis cell--span">{{
100
- scope.row.name
101
- }}</span>
93
+ <div v-if="scope.row.enName && scope.row.enName.trim() !== ''">
94
+ <div :title="scope.row.name +'('+scope.row.enName+')' +'['+scope.row.loginName+']'">
95
+ <span>{{ scope.row.name+'('+scope.row.enName+')' }}[{{ scope.row.loginName }}]</span>
96
+ </div>
97
+ <div style="color:#ccc" :title="getDeptName(scope.row)">
98
+ {{ getDeptName(scope.row) }}
99
+ </div>
100
+ </div>
101
+ <div v-else>
102
+ <div :title="scope.row.name +'['+scope.row.loginName+']'">
103
+ <span>{{ scope.row.name }}[{{ scope.row.loginName }}]</span>
104
+ </div>
105
+ <div style="color:#ccc" :title="getDeptName(scope.row)">
106
+ {{ getDeptName(scope.row) }}
107
+ </div>
108
+ </div>
102
109
  </template>
103
110
  </el-table-column>
104
- <el-table-column
111
+ <!-- <el-table-column
105
112
  :label="$t('departmentUserTreeInline.loginName')"
106
113
  :width="110"
107
114
  prop="loginName"
@@ -132,7 +139,7 @@
132
139
  }}</span
133
140
  >
134
141
  </template>
135
- </el-table-column>
142
+ </el-table-column> -->
136
143
  <!--由于保密要求,邮箱不能显示,需要脱敏处理,暂时注释掉,不显示-->
137
144
  <!-- <el-table-column
138
145
  :label="$t('departmentUserTreeInline.email')"
@@ -143,27 +150,6 @@
143
150
  <span class="ellipsis cell--span" :title="scope.row.email">{{ scope.row.email }}</span>
144
151
  </template>
145
152
  </el-table-column> -->
146
- <el-table-column
147
- :label="$t('departmentUserTreeInline.superiorDeptNameFullPath')"
148
- :width="130"
149
- prop="superiorDeptNameFullPath"
150
- >
151
- <template v-slot="scope">
152
- <span :title="scope.row.superiorDeptNameFullPath" class="ellipsis cell--span">{{ scope.row.superiorDeptNameFullPath }}</span>
153
- </template>
154
- </el-table-column>
155
- <el-table-column
156
- v-if="containBranch"
157
- :label="$t('departmentUserTreeInline.branch')"
158
- :width="130"
159
- prop="subCompanyName"
160
- >
161
- <template v-slot="scope">
162
- <span :title="scope.row.subCompanyName" class="ellipsis cell--span">{{
163
- scope.row.subCompanyName
164
- }}</span>
165
- </template>
166
- </el-table-column>
167
153
  </el-table>
168
154
  </div>
169
155
  </template>
@@ -269,6 +255,19 @@ export default {
269
255
  return dept.id === queryDept.id
270
256
  }
271
257
  },
258
+ getDeptName(row) {
259
+ let deptName = row.superiorDeptNameFullPath
260
+ if (deptName) {
261
+ return deptName
262
+ }
263
+ if (this.language && this.language !== 'cn') {
264
+ deptName = row.mainDepartmentEnName
265
+ }
266
+ if (deptName) {
267
+ return deptName
268
+ }
269
+ return row.mainDepartmentName
270
+ }
272
271
  },
273
272
  emits: ['removeUser', 'addUser', 'selectResult', 'resultRowDblclick'],
274
273
  }
@@ -26,6 +26,10 @@
26
26
  >
27
27
  <template v-if="descriptionAttribute">
28
28
  <div v-if="optionWidth > 0" :style="{ width: optionWidth + 'px' }">
29
+ <el-option
30
+ v-if="baseProps.multiple !== undefined && baseProps.multiple === true && optionItems && optionItems.length > 0 "
31
+ :label="$t('superGrid.selectAll')" value="saveAll"
32
+ />
29
33
  <el-option
30
34
  v-for="item in optionItems"
31
35
  :key="item.value"
@@ -42,31 +46,40 @@
42
46
  </div>
43
47
  </el-option>
44
48
  </div>
45
- <el-option
46
- v-for="item in optionItems"
47
- :key="item.value"
48
- v-else
49
- :label="item._label_"
50
- :title="item._label_ + item._description_"
51
- :value="item[valueAttribute]"
52
- >
53
- <span style="float: left">{{ item._label_ }}</span>
54
- <span
55
- style="
56
- float: right;
57
- color: #8492a6;
58
- font-size: 13px;
59
- margin-left: 30px;
60
- "
61
- >{{ item._description_ }}</span
62
- >
63
- </el-option>
49
+ <div v-else>
50
+ <el-option
51
+ v-if="baseProps.multiple !== undefined && baseProps.multiple === true && optionItems && optionItems.length > 0 "
52
+ :label="$t('superGrid.selectAll')" value="saveAll"
53
+ />
54
+ <el-option
55
+ v-for="item in optionItems"
56
+ :key="item.value"
57
+ :label="item._label_"
58
+ :title="item._label_ + item._description_"
59
+ :value="item[valueAttribute]"
60
+ >
61
+ <span style="float: left">{{ item._label_ }}</span>
62
+ <span
63
+ style="
64
+ float: right;
65
+ color: #8492a6;
66
+ font-size: 13px;
67
+ margin-left: 30px;
68
+ "
69
+ >{{ item._description_ }}</span
70
+ >
71
+ </el-option>
72
+ </div>
64
73
  </template>
65
74
  <template v-else>
66
75
  <div
67
76
  v-if="optionWidth > 0"
68
77
  :style="{ width: optionWidth + 'px', position: 'relative' }"
69
78
  >
79
+ <el-option
80
+ v-if="baseProps.multiple !== undefined && baseProps.multiple === true && optionItems && optionItems.length > 0 "
81
+ :label="$t('superGrid.selectAll')" value="saveAll"
82
+ />
70
83
  <el-option
71
84
  v-for="item in optionItems"
72
85
  :key="item.value"
@@ -74,13 +87,18 @@
74
87
  :value="item[valueAttribute]"
75
88
  />
76
89
  </div>
77
- <el-option
78
- v-for="item in optionItems"
79
- :key="item.value"
80
- v-else
81
- :label="item._label_"
82
- :value="item[valueAttribute]"
83
- />
90
+ <div v-else>
91
+ <el-option
92
+ v-if="baseProps.multiple !== undefined && baseProps.multiple === true && optionItems && optionItems.length > 0 "
93
+ :label="$t('superGrid.selectAll')" value="saveAll"
94
+ />
95
+ <el-option
96
+ v-for="item in optionItems"
97
+ :key="item.value"
98
+ :label="item._label_"
99
+ :value="item[valueAttribute]"
100
+ />
101
+ </div>
84
102
  </template>
85
103
  </el-select>
86
104
  </span>
@@ -405,11 +423,28 @@ export default {
405
423
  },
406
424
  // 必须有该方法,否则无法给字段赋值
407
425
  inputValue(newValue) {
426
+ let isClickSaveAll = false
427
+ if (this.baseProps.multiple !== undefined && this.baseProps.multiple === true && newValue && newValue.indexOf('saveAll') >= 0) {
428
+ // 表示点击了全选选项
429
+ isClickSaveAll = true
430
+ if (newValue.length - 1 >= this.optionItems.length) {
431
+ // 表示需要取消全选
432
+ newValue = []
433
+ } else {
434
+ // 表示需要全选
435
+ const allValues = []
436
+ for (let i = 0; i < this.optionItems.length; i++) {
437
+ const item = this.optionItems[i]
438
+ allValues.push(item[this.valueAttribute])
439
+ }
440
+ newValue = allValues
441
+ }
442
+ }
408
443
  this.$emit('update:value', newValue)
409
444
  if (this.remote && (newValue === null || newValue === undefined || newValue === '')) {
410
445
  this.remoteQueryMethod(newValue)
411
446
  }
412
- this.setValues(newValue)
447
+ this.setValues(newValue, isClickSaveAll)
413
448
  },
414
449
  packageDynamicDataSourceInfo(dynamicDataSourceCode, param) {
415
450
  return new Promise((resolve, reject) => {
@@ -594,11 +629,11 @@ export default {
594
629
  ? '_label_'
595
630
  : this.valueAttribute
596
631
  },
597
- setValues(newValue) {
632
+ setValues(newValue, isClickSaveAll) {
598
633
  if (this.valueSetOptions && this.valueSetOptions.length > 0) {
599
634
  if (this.baseProps.multiple !== undefined && this.baseProps.multiple === true) {
600
635
  // 多选时
601
- this.setColumnValueWhenMulti(newValue)
636
+ this.setColumnValueWhenMulti(newValue, isClickSaveAll)
602
637
  } else {
603
638
  // 单选时
604
639
  this.valueSetOptions.forEach((columnInfo) => {
@@ -673,7 +708,7 @@ export default {
673
708
  })
674
709
  },
675
710
  // 多选下拉框时处理增加tag、减少tag时,映射字段赋值问题
676
- setColumnValueWhenMulti(newValue) {
711
+ setColumnValueWhenMulti(newValue, isClickSaveAll) {
677
712
  // 是否添加tag
678
713
  let isAddTag = false
679
714
  let removeTag
@@ -709,19 +744,89 @@ export default {
709
744
  if (isAddTag) {
710
745
  // 表示是增加tag
711
746
  const isRemove = false
712
- const lastSelectTag = newValue[newValue.length - 1]
713
- const items = this.optionItems.filter(
747
+ if (isClickSaveAll) {
748
+ // 全选
749
+ this.setAllTagValue(isRemove)
750
+ } else {
751
+ const lastSelectTag = newValue[newValue.length - 1]
752
+ const items = this.optionItems.filter(
714
753
  item => item[this.valueAttribute] === lastSelectTag
715
- )
716
- if (items && items.length > 0) {
717
- this.setTagValue(null, isRemove, items[0])
754
+ )
755
+ if (items && items.length > 0) {
756
+ this.setTagValue(null, isRemove, items[0])
757
+ }
718
758
  }
719
759
  } else {
720
760
  // 表示是减少tag
721
761
  const isRemove = true
722
- this.setTagValue(removeTag, isRemove)
762
+ if (isClickSaveAll) {
763
+ this.setAllTagValue(isRemove)
764
+ } else {
765
+ this.setTagValue(removeTag, isRemove)
766
+ }
723
767
  }
724
768
  },
769
+ setAllTagValue(isRemove) {
770
+ if (this.valueSetOptions && this.valueSetOptions.length > 0) {
771
+ this.valueSetOptions.forEach(columnInfo => {
772
+ const sourceColumnName = columnInfo.columnName
773
+ if (sourceColumnName !== this.valueAttribute) {
774
+ let targetColumnName = null
775
+ const targetColumnInfo = columnInfo.valueColumn
776
+ if (targetColumnInfo) {
777
+ targetColumnName = targetColumnInfo.name
778
+ if (this.isSql === true) {
779
+ targetColumnName = targetColumnInfo.dbColumnName
780
+ targetColumnName = getPropNameWhenJoinTable(
781
+ targetColumnName,
782
+ this.isJoinTable,
783
+ this.tableName
784
+ )
785
+ }
786
+ }
787
+ let value
788
+ if (targetColumnName) {
789
+ if (isRemove) {
790
+ // 移除tag
791
+ value = null
792
+ } else {
793
+ // 添加tag
794
+ let originalValue = ''
795
+ if (this.optionItems && this.optionItems.length > 0) {
796
+ this.optionItems.forEach(selectItem => {
797
+ const addValue = selectItem[sourceColumnName]
798
+ if (originalValue !== undefined && originalValue !== null && originalValue !== '') {
799
+ originalValue = originalValue + ',' + addValue
800
+ } else {
801
+ originalValue = addValue
802
+ }
803
+ })
804
+ value = originalValue
805
+ }
806
+ }
807
+ }
808
+ this.setTargetColumnValue(sourceColumnName, targetColumnName, value)
809
+ }
810
+ })
811
+ }
812
+ },
813
+ setTargetColumnValue(sourceColumnName, targetColumnName, value) {
814
+ if (
815
+ this.entity &&
816
+ targetColumnName &&
817
+ targetColumnName !== null &&
818
+ targetColumnName !== ''
819
+ ) {
820
+ setEntityFieldValue(this.entity, targetColumnName, value)
821
+ }
822
+ this.$emit('set-value', {
823
+ value: value,
824
+ sourceColumnName: sourceColumnName,
825
+ targetColumnName: targetColumnName,
826
+ options: this.optionItems,
827
+ valueAttribute: this.valueAttribute
828
+ })
829
+ },
725
830
  // 根据tag参数设置映射字段的值
726
831
  setTagValue(tag, isRemove, selectItem) {
727
832
  if (this.valueSetOptions && this.valueSetOptions.length > 0) {
@@ -765,21 +870,7 @@ export default {
765
870
  }
766
871
  }
767
872
  }
768
- if (
769
- this.entity &&
770
- targetColumnName &&
771
- targetColumnName !== null &&
772
- targetColumnName !== ''
773
- ) {
774
- setEntityFieldValue(this.entity, targetColumnName, value)
775
- }
776
- this.$emit('set-value', {
777
- value: value,
778
- sourceColumnName: sourceColumnName,
779
- targetColumnName: targetColumnName,
780
- options: this.optionItems,
781
- valueAttribute: this.valueAttribute
782
- })
873
+ this.setTargetColumnValue(sourceColumnName, targetColumnName, value)
783
874
  }
784
875
  })
785
876
  }
@@ -1379,7 +1379,7 @@ export default {
1379
1379
  // console.log('multiselectChange1---arr=', arr)
1380
1380
  this.extendParams = selectedItem
1381
1381
  let isSaveAll = false
1382
- if (arr && arr.length > 0) {
1382
+ if (arr && arr.length > 0 && this.type === 'multiselect' && !this.isDynamicDataSourceSource()) {
1383
1383
  const saveAll = 'saveAll'
1384
1384
  if (arr.indexOf(saveAll) !== -1) {
1385
1385
  const length = arr.length
@@ -142,6 +142,7 @@
142
142
  :show-value="$escapeHtml(getLabel(pageGridData[scope.$index], scope.$index))"
143
143
  :value="getCellValue(pageGridData[scope.$index])"
144
144
  :additional-param-map="additionalParamMap"
145
+ @prohibitToEdit="prohibitToEdit"
145
146
  /></span>
146
147
  <span
147
148
  v-else-if="
@@ -3062,6 +3062,7 @@ export default {
3062
3062
  if (entity) {
3063
3063
  if (entity.isForceUpdate) {
3064
3064
  this.$emit('fn-prohibit-to-edit', entity)
3065
+ this.$emit('prohibitToEdit', entity)
3065
3066
  }
3066
3067
  for (const key in entity) {
3067
3068
  // console.log('key', key)
@@ -89,6 +89,20 @@ function isPasswordExpired(username, password) {
89
89
  )
90
90
  }
91
91
 
92
+ function isPasswordExpiredWithValidateCode(username, password, validateCode, imageCodeKey) {
93
+ const usernamePasswordToken = {
94
+ username,
95
+ password,
96
+ validateCode,
97
+ imageCodeKey
98
+ }
99
+ return request.post(
100
+ window.$vueApp.config.globalProperties.baseAPI + '/sso/is-password-expired-with-validate-code',
101
+ usernamePasswordToken
102
+ )
103
+ }
104
+
105
+
92
106
  /** 更新密码 */
93
107
  function updatePassword(data) {
94
108
  return request.put(
@@ -213,5 +227,6 @@ export default {
213
227
  isLoginTimeOut,
214
228
  getUserPermissionMenusBySystemCode,
215
229
  loginWithValidateCode,
216
- getDevPlatformPermissions
230
+ getDevPlatformPermissions,
231
+ isPasswordExpiredWithValidateCode
217
232
  }
@@ -162,7 +162,8 @@ const cn = {
162
162
  removeUser: '移除用户',
163
163
  email: '邮箱',
164
164
  loginName: '登录名',
165
- superiorDeptNameFullPath: '组织全路径'
165
+ superiorDeptNameFullPath: '组织全路径',
166
+ user: '用户'
166
167
  },
167
168
  // 工作组树
168
169
  workgroupTree: {
@@ -164,7 +164,8 @@ const en = {
164
164
  removeUser: 'Remove User',
165
165
  email: 'Email',
166
166
  loginName: 'Login Name',
167
- superiorDeptNameFullPath: 'Department full path'
167
+ superiorDeptNameFullPath: 'Department full path',
168
+ user: 'User'
168
169
  },
169
170
  // 工作组树
170
171
  workgroupTree: {
@@ -1,19 +1,13 @@
1
1
  import ssoService from '../../api/sso-service'
2
2
  import {
3
3
  getUsername,
4
- removeAllLanguages,
4
+ setUsername, removeUsername, removeCurrentUser, clearPermission,
5
5
  removeAllThemes,
6
- removeCurrentUser,
7
6
  removeDevpPermissions,
8
- removeLanguage,
9
7
  removeTheme,
10
- removePublishControl,
11
- removeToken,
12
- removeUsername,
13
8
  setCurrentUser,
14
9
  setLanguage,
15
10
  setToken,
16
- setUsername,
17
11
  removeProjectSettings,
18
12
  removeProjectCode,
19
13
  setTheme
@@ -22,10 +16,9 @@ import {
22
16
  import {
23
17
  getMenus,
24
18
  getPermissions,
25
- removeMenus,
26
- removePermissions,
27
19
  setMenus,
28
- setPermissions
20
+ setPermissions,
21
+ removeAllSystemPermissions
29
22
  } from '../../utils/permissionAuth'
30
23
 
31
24
  import {isPlateSys} from '../../utils/common-util'
@@ -53,6 +46,8 @@ const user = {
53
46
  actions: {
54
47
  // 登录
55
48
  login({ commit }, userInfo) {
49
+ // 登录时先清除缓存的登录信息和权限信息
50
+ clearPermission()
56
51
  const username = userInfo.username.trim()
57
52
  return new Promise((resolve, reject) => {
58
53
  ssoService
@@ -140,6 +135,8 @@ const user = {
140
135
  })
141
136
  }
142
137
  if (loginName) {
138
+ // 登录时清除缓存的资源
139
+ removeAllSystemPermissions()
143
140
  // setToken(tokenInfo.jwt)
144
141
  // commit('setToken', tokenInfo.jwt)
145
142
  ssoService
@@ -198,20 +195,11 @@ const user = {
198
195
  .logout(state.token)
199
196
  .then((data) => {
200
197
  commit('setToken', '')
201
- removeToken()
202
- removeLanguage()
203
198
  removeTheme()
204
- removeAllLanguages()
205
199
  removeAllThemes()
206
200
 
207
201
  commit('setName', '')
208
- removeUsername()
209
- removeCurrentUser()
210
-
211
- removePermissions()
212
-
213
- removeMenus()
214
- removePublishControl()
202
+ clearPermission()
215
203
  removeDevpPermissions()
216
204
  removeProjectSettings()
217
205
  removeProjectCode()
@@ -227,20 +215,11 @@ const user = {
227
215
  clearToken({ commit }) {
228
216
  return new Promise((resolve) => {
229
217
  commit('setToken', '')
230
- removeToken()
231
- removeLanguage()
232
218
  removeTheme()
233
- removeAllLanguages()
234
219
  removeAllThemes()
235
220
 
236
221
  commit('setName', '')
237
- removeUsername()
238
- removeCurrentUser()
239
-
240
- removePermissions()
241
-
242
- removeMenus()
243
- removePublishControl()
222
+ clearPermission()
244
223
  removeDevpPermissions()
245
224
  removeProjectSettings()
246
225
  removeProjectCode()
@@ -323,6 +302,21 @@ const user = {
323
302
  })
324
303
  },
325
304
 
305
+ // 判断当前用户密码是否过期
306
+ isPasswordExpiredWithValidateCode({ commit }, userInfo) {
307
+ const username = userInfo.username.trim()
308
+ return new Promise((resolve, reject) => {
309
+ ssoService
310
+ .isPasswordExpiredWithValidateCode(username, userInfo.password, userInfo.validCode, userInfo.imageCodeKey )
311
+ .then((message) => {
312
+ resolve(message)
313
+ })
314
+ .catch((error) => {
315
+ reject(error)
316
+ })
317
+ })
318
+ },
319
+
326
320
  updatePassword({ commit }, map) {
327
321
  return new Promise((resolve, reject) => {
328
322
  ssoService
package/src/utils/auth.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import authApi from './auth-api'
2
+ import { removeAllSystemPermissions } from './permissionAuth'
2
3
 
3
4
  export function getToken() {
4
5
  return authApi.getToken()
@@ -68,7 +69,7 @@ export function setLanguage(language) {
68
69
  authApi.setLanguage(language)
69
70
  }
70
71
 
71
- export function removeLanguage() {
72
+ function removeLanguage() {
72
73
  authApi.removeLanguage()
73
74
  }
74
75
 
@@ -80,7 +81,7 @@ export function setAllLanguages(langs) {
80
81
  authApi.setAllLanguages(langs)
81
82
  }
82
83
 
83
- export function removeAllLanguages() {
84
+ function removeAllLanguages() {
84
85
  authApi.removeAllLanguages()
85
86
  }
86
87
 
@@ -113,7 +114,7 @@ export function removeAllThemes() {
113
114
  authApi.removeAllThemes()
114
115
  }
115
116
 
116
- export function removePublishControl() {
117
+ function removePublishControl() {
117
118
  authApi.removePublishControl()
118
119
  }
119
120
  /**
@@ -140,4 +141,17 @@ export function removeProjectSettings() {
140
141
 
141
142
  export function removeProjectCode() {
142
143
  authApi.removeCookieCache('_PROJECT_CDOE')
144
+ }
145
+
146
+ // 清空token时需要清除的缓存信息
147
+ export function clearPermission() {
148
+ removeToken()
149
+ removeLanguage()
150
+ removeAllLanguages()
151
+
152
+ removeUsername()
153
+ removeCurrentUser()
154
+
155
+ removeAllSystemPermissions()
156
+ removePublishControl()
143
157
  }