agilebuilder-ui 1.0.91 → 1.0.93-temp2

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.91",
3
+ "version": "1.0.93-temp2",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "main": "./lib/super-ui.js",
@@ -6,8 +6,7 @@ const departmentTreeService = {
6
6
  filterAppendNodes(value) {
7
7
  this.$http
8
8
  .post(
9
- window.$vueApp.config.globalProperties.baseAPI +
10
- '/component/organization-trees/search-pc-depts',
9
+ window.$vueApp.config.globalProperties.baseAPI + '/component/organization-trees/search-pc-depts',
11
10
  this.searchParam
12
11
  )
13
12
  .then((result) => {
@@ -17,7 +16,7 @@ const departmentTreeService = {
17
16
  this.$message({
18
17
  showClose: true,
19
18
  type: 'error',
20
- message: getI18n().t('imatrixUIMessage.queryResultIsEmpty'),
19
+ message: getI18n().t('imatrixUIMessage.queryResultIsEmpty')
21
20
  })
22
21
  return
23
22
  }
@@ -35,7 +34,7 @@ const departmentTreeService = {
35
34
  this.$message({
36
35
  showClose: true,
37
36
  type: 'error',
38
- message: getI18n().t('imatrixUIMessage.queryResultIsEmpty'),
37
+ message: getI18n().t('imatrixUIMessage.queryResultIsEmpty')
39
38
  })
40
39
  }
41
40
  })
@@ -55,11 +54,7 @@ const departmentTreeService = {
55
54
  // this.handleSelectUtil(item, localStorage)
56
55
  // 查询最新部门信息替换,缓存为历史数据 数据库可能发生变化
57
56
  this.$http
58
- .get(
59
- window.$vueApp.config.globalProperties.baseAPI +
60
- '/api/departments?departmentCode=' +
61
- item.code
62
- )
57
+ .get(window.$vueApp.config.globalProperties.baseAPI + '/api/departments?departmentCode=' + item.code)
63
58
  .then((departmentDTO) => {
64
59
  if (departmentDTO !== null) {
65
60
  for (const dtoKey in departmentDTO) {
@@ -72,9 +67,7 @@ const departmentTreeService = {
72
67
  this.searchValue = ''
73
68
  this.setMemoryCacheData(item, 'department')
74
69
  if (this.multiple) {
75
- const index = this.selectResult.findIndex(
76
- (selectEntity) => selectEntity.code === item.code
77
- )
70
+ const index = this.selectResult.findIndex((selectEntity) => selectEntity.code === item.code)
78
71
  if (index < 0) {
79
72
  this.selectResult.push(item)
80
73
  }
@@ -144,9 +137,7 @@ const departmentTreeService = {
144
137
  // 不是叶子节点,并且没有加载过该父节点的子节点时,需要走后台展开子节点
145
138
  this.$http
146
139
  .get(
147
- window.$vueApp.config.globalProperties.baseAPI +
148
- '/component/organization-trees/departments/' +
149
- data.id
140
+ window.$vueApp.config.globalProperties.baseAPI + '/component/organization-trees/departments/' + data.id
150
141
  )
151
142
  .then((result) => {
152
143
  // 更新当前点击的节点的子节点
@@ -193,21 +184,22 @@ const departmentTreeService = {
193
184
  if (this.$refs.deparmentTree) {
194
185
  checkedKeys = this.$refs.deparmentTree.getCheckedKeys()
195
186
  }
187
+ if (parentId === -1 && node.data.childDepartments && node.data.childDepartments.length > 0) {
188
+ // 表示初始化树时,展开公司节点
189
+ resolve(node.data.childDepartments)
190
+ return
191
+ }
196
192
  // 初始化部门树
197
193
  this.initLoadDepartment(parentId, node, resolve, checkedKeys)
198
194
  },
199
195
  // 初始化部门树
200
196
  initLoadDepartment(parentId, node, resolve, checkedKeys) {
201
197
  this.$http
202
- .get(
203
- window.$vueApp.config.globalProperties.baseAPI +
204
- '/component/organization-trees/departments/' +
205
- parentId
206
- )
198
+ .get(window.$vueApp.config.globalProperties.baseAPI + '/component/organization-trees/departments/' + parentId)
207
199
  .then((data) => {
208
200
  resolve(data)
209
201
  // 更新当前点击的节点的子节点
210
- this.$refs.deparmentTree.updateKeyChildren(parentId, data)
202
+ // this.$refs.deparmentTree.updateKeyChildren(parentId, data)
211
203
  if (parentId === 0) {
212
204
  // 初始化树时,展开公司节点
213
205
  const tenantData = data[0].data
@@ -242,11 +234,7 @@ const departmentTreeService = {
242
234
  loadDepartment(parentId, isSearch, searchValue) {
243
235
  return new Promise((resolve, reject) => {
244
236
  this.$http
245
- .get(
246
- window.$vueApp.config.globalProperties.baseAPI +
247
- '/component/organization-trees/departments/' +
248
- parentId
249
- )
237
+ .get(window.$vueApp.config.globalProperties.baseAPI + '/component/organization-trees/departments/' + parentId)
250
238
  .then((children) => {
251
239
  this.$refs.deparmentTree.updateKeyChildren(parentId, children)
252
240
  if (this.$refs.deparmentTree.store.nodesMap[parentId]) {
@@ -263,15 +251,13 @@ const departmentTreeService = {
263
251
  loadPointDepartments() {
264
252
  this.$http
265
253
  .post(
266
- window.$vueApp.config.globalProperties.baseAPI +
267
- '/component/organization-trees/point-departments',
254
+ window.$vueApp.config.globalProperties.baseAPI + '/component/organization-trees/point-departments',
268
255
  this.departmentInfo
269
256
  )
270
257
  .then((children) => {
271
258
  this.$refs.deparmentTree.updateKeyChildren(this.tenantNodeId, children)
272
259
  if (this.$refs.deparmentTree.store.nodesMap[this.tenantNodeId]) {
273
- this.$refs.deparmentTree.store.nodesMap[this.tenantNodeId].expanded =
274
- true
260
+ this.$refs.deparmentTree.store.nodesMap[this.tenantNodeId].expanded = true
275
261
  }
276
262
  })
277
263
  },
@@ -306,7 +292,7 @@ const departmentTreeService = {
306
292
  // 表示集合中不存在该用户,则封装该用户
307
293
  var allDept = {
308
294
  id: this.tenantNodeId,
309
- name: '所有部门',
295
+ name: '所有部门'
310
296
  }
311
297
  return allDept
312
298
  },
@@ -314,20 +300,13 @@ const departmentTreeService = {
314
300
  return new Promise((resolve, reject) => {
315
301
  const selectDepts = []
316
302
  if (this.selectDepartmentInfo) {
317
- if (
318
- this.selectDepartmentInfo === this.tenantNodeId ||
319
- this.selectDepartmentInfo === '所有部门'
320
- ) {
303
+ if (this.selectDepartmentInfo === this.tenantNodeId || this.selectDepartmentInfo === '所有部门') {
321
304
  // 表示已选择所有用户
322
305
  selectDepts.push(this.packageAllDept())
323
306
  resolve(selectDepts)
324
307
  } else {
325
308
  // 表示不是选择的所有用户
326
- this.getSelectDepts(
327
- this.searchField,
328
- this.selectDepartmentInfo,
329
- this.separator
330
- )
309
+ this.getSelectDepts(this.searchField, this.selectDepartmentInfo, this.separator)
331
310
  .then((departments) => {
332
311
  resolve(departments)
333
312
  })
@@ -339,6 +318,6 @@ const departmentTreeService = {
339
318
  resolve(selectDepts)
340
319
  }
341
320
  })
342
- },
321
+ }
343
322
  }
344
323
  export default departmentTreeService