agilebuilder-ui 1.1.36-tmp4 → 1.1.37

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.
Files changed (67) hide show
  1. package/lib/{401-c55bdcf2.js → 401-9314ce87.js} +1 -1
  2. package/lib/{404-c1dbd5e1.js → 404-572d631d.js} +1 -1
  3. package/lib/{iframe-page-917912ae.js → iframe-page-87c9c0d0.js} +1 -1
  4. package/lib/{index-6ec53ef7.js → index-79b98485.js} +12729 -12671
  5. package/lib/super-ui.css +1 -1
  6. package/lib/super-ui.js +1 -1
  7. package/lib/super-ui.umd.cjs +99 -99
  8. package/lib/{tab-content-iframe-index-46a76242.js → tab-content-iframe-index-070ce653.js} +1 -1
  9. package/lib/{tab-content-index-132379e6.js → tab-content-index-3b98efb4.js} +1 -1
  10. package/lib/{tache-subprocess-history-384455d6.js → tache-subprocess-history-46442012.js} +1 -1
  11. package/package.json +2 -2
  12. package/packages/department-tree/src/department-tree.vue +130 -123
  13. package/packages/department-tree-inline/src/department-multi-tree-inline.vue +435 -466
  14. package/packages/department-tree-inline/src/department-single-tree-inline.vue +335 -342
  15. package/packages/department-tree-inline/src/department-tree-inline.vue +18 -11
  16. package/packages/department-tree-inline/src/department-tree-service.js +10 -11
  17. package/packages/department-tree-mobile/src/department-tree-app.vue +103 -75
  18. package/packages/department-tree-mobile/src/department-tree-inline-app.vue +256 -225
  19. package/packages/department-tree-mobile/src/department-tree-service.ts +98 -75
  20. package/packages/department-user-tree/src/department-user-multiple-tree.vue +112 -115
  21. package/packages/department-user-tree/src/department-user-single-tree.vue +85 -88
  22. package/packages/department-user-tree/src/department-user-tree.vue +127 -119
  23. package/packages/department-user-tree-inline/src/department-user-multiple-tree-inline.vue +6 -1
  24. package/packages/department-user-tree-inline/src/department-user-single-tree-inline.vue +5 -0
  25. package/packages/department-user-tree-inline/src/department-user-tree-inline.vue +18 -11
  26. package/packages/department-user-tree-inline/src/department-user-tree-multi-service.js +26 -51
  27. package/packages/department-user-tree-inline/src/department-user-tree-single-service.js +25 -45
  28. package/packages/department-user-tree-inline/src/group-user/group-list.vue +97 -90
  29. package/packages/department-user-tree-inline/src/group-user/group-user.vue +28 -32
  30. package/packages/department-user-tree-mobile/src/department-user-tree-app.vue +103 -75
  31. package/packages/department-user-tree-mobile/src/department-user-tree-inline-app.vue +282 -224
  32. package/packages/department-user-tree-mobile/src/department-user-tree-service.ts +58 -51
  33. package/packages/fs-preview/src/fs-preview.vue +20 -2
  34. package/packages/fs-upload-list/src/fs-upload-list.vue +30 -7
  35. package/packages/fs-upload-new/src/file-upload-mobile/file-upload-browser.vue +1 -1
  36. package/packages/fs-upload-new/src/fs-preview-new.vue +27 -15
  37. package/packages/index.js +4 -4
  38. package/packages/organization-input/src/organization-input.vue +34 -12
  39. package/packages/super-grid/src/apis.js +21 -4
  40. package/packages/super-grid/src/dynamic-input.vue +58 -13
  41. package/packages/super-grid/src/normal-column-content.vue +1 -1
  42. package/packages/super-grid/src/row-operation.vue +10 -4
  43. package/packages/super-grid/src/super-grid.vue +51 -42
  44. package/packages/super-grid/src/utils.js +13 -8
  45. package/packages/super-icon/src/index.vue +4 -1
  46. package/packages/workgroup-tree/src/workgroup-tree.vue +117 -110
  47. package/packages/workgroup-tree-inline/src/workgroup-tree-inline.vue +6 -1
  48. package/packages/workgroup-tree-mobile/src/workgroup-tree-app.vue +103 -75
  49. package/packages/workgroup-tree-mobile/src/workgroup-tree-inline-app.vue +229 -208
  50. package/src/api/sso-service.js +6 -5
  51. package/src/directives/permission/index.js +4 -4
  52. package/src/index.js +71 -2
  53. package/src/store/modules/table.js +0 -1
  54. package/src/styles/theme/dark-blue/sidebar.scss +9 -0
  55. package/src/styles/theme/gray/sidebar.scss +9 -8
  56. package/src/styles/theme/green/sidebar.scss +10 -0
  57. package/src/styles/theme/ocean-blue/sidebar.scss +9 -0
  58. package/src/styles/theme/tiffany-blue-mobile/sidebar.scss +9 -0
  59. package/src/utils/insert_css.js +1 -1
  60. package/src/utils/util.js +19 -0
  61. package/src/views/dsc-component/Sidebar/SidebarItem.vue +2 -2
  62. package/src/views/dsc-component/Sidebar/index.vue +36 -18
  63. package/src/views/layout/components/Menubar/Item.vue +0 -9
  64. package/src/views/layout/components/Menubar/SidebarItem.vue +2 -2
  65. package/src/views/layout/components/Sidebar/Item.vue +4 -1
  66. package/src/views/layout/components/Sidebar/SidebarItem.vue +2 -2
  67. package/vite.config.js +1 -1
@@ -1,64 +1,71 @@
1
- export function getTenant () {
1
+ export function getTenant() {
2
2
  const parentId = 0
3
- return window['$vueApp'].config.globalProperties.$http.get(window['$vueApp'].config.globalProperties.baseAPI + '/component/organization-trees/departments/' + parentId)
3
+ return window['$vueApp'].config.globalProperties.$http.get(
4
+ window['$vueApp'].config.globalProperties.baseAPI + '/component/organization-trees/departments/' + parentId
5
+ )
4
6
  }
5
7
 
6
8
  // 获得公司节点的孩子节点
7
- export function getTenantChildren (departmentInfo, tenantNodeId) {
8
- if (departmentInfo && departmentInfo.length > 0) {
9
- // 加载指定部门时,展开公司节点
10
- return loadPointDepartments(departmentInfo)
11
- } else {
12
- // 加载整个组织结构树时,展开公司节点
13
- return loadDepartment(tenantNodeId, null)
14
- }
15
-
9
+ export function getTenantChildren(departmentInfo, tenantNodeId, limitFilterColumn) {
10
+ if (departmentInfo && departmentInfo.length > 0) {
11
+ // 加载指定部门时,展开公司节点
12
+ return loadPointDepartments(departmentInfo, limitFilterColumn)
13
+ } else {
14
+ // 加载整个组织结构树时,展开公司节点
15
+ return loadDepartment(tenantNodeId, null)
16
+ }
16
17
  }
17
18
 
18
-
19
- // 加载指定部门节点
20
- export function loadPointDepartments (departmentInfo) {
21
- return new Promise((resolve,reject)=>{
22
- window['$vueApp'].config.globalProperties.$http.post(window['$vueApp'].config.globalProperties.baseAPI + '/component/organization-trees/point-department-users', departmentInfo).then(children => {
19
+ // 加载指定部门节点
20
+ export function loadPointDepartments(departmentInfo, limitFilterColumn) {
21
+ return new Promise((resolve, reject) => {
22
+ let url = window['$vueApp'].config.globalProperties.baseAPI + '/component/organization-trees/point-department-users'
23
+ if (limitFilterColumn) {
24
+ url += '/' + limitFilterColumn
25
+ }
26
+ window['$vueApp'].config.globalProperties.$http.post(url, departmentInfo).then((children) => {
23
27
  resolve(children)
24
28
  })
25
29
  })
26
30
  }
27
31
 
28
-
29
- // 加载当前节点的子节点
30
- export function loadDepartment (parentId, branchId) {
31
- let param = {
32
- parentId: parentId,
33
- needVirtualUser: false,
34
- branchId: null
35
- }
36
- if (branchId) {
37
- param.branchId = branchId
38
- }
39
- return new Promise((resolve,reject)=>{
40
- window['$vueApp'].config.globalProperties.$http.post(window['$vueApp'].config.globalProperties.baseAPI + '/component/organization-trees/department-users', param)
41
- .then(children => {
42
- resolve(children)
43
- })
44
- })
32
+ // 加载当前节点的子节点
33
+ export function loadDepartment(parentId, branchId) {
34
+ let param = {
35
+ parentId: parentId,
36
+ needVirtualUser: false,
37
+ branchId: null
45
38
  }
46
- export function checkedDeptDefault (selectDepts, defaultCheckedKeys) {
47
- defaultCheckedKeys = []
48
- selectDepts.forEach(dept => {
49
- defaultCheckedKeys.push(dept.nodeId)
50
- })
51
- }
52
- // ,
53
- // isDeptOrUser (item, dept) {
54
- // return item.id === dept.id && item.nodeType && dept.nodeType && item.nodeType === dept.nodeType
55
- // },
56
- export function getUserInDepartments (departmentIds) {
57
- return window['$vueApp'].config.globalProperties.$http.post(window['$vueApp'].config.globalProperties.baseAPI + '/component/organization-trees/user-only-in-departments', departmentIds)
39
+ if (branchId) {
40
+ param.branchId = branchId
58
41
  }
59
- // getTenantNoDeptUsers () {
60
- // return this.$http.get(window['$vueApp'].config.globalProperties.baseAPI + '/component/organization-trees/tenant-no-dept-users')
61
- // },
62
- // getBranchNoDeptUsers (branchId) {
63
- // return this.$http.get(window['$vueApp'].config.globalProperties.baseAPI + '/component/organization-trees/branch-no-dept-users/' + branchId)
64
- // }
42
+ return new Promise((resolve, reject) => {
43
+ window['$vueApp'].config.globalProperties.$http
44
+ .post(window['$vueApp'].config.globalProperties.baseAPI + '/component/organization-trees/department-users', param)
45
+ .then((children) => {
46
+ resolve(children)
47
+ })
48
+ })
49
+ }
50
+ export function checkedDeptDefault(selectDepts, defaultCheckedKeys) {
51
+ defaultCheckedKeys = []
52
+ selectDepts.forEach((dept) => {
53
+ defaultCheckedKeys.push(dept.nodeId)
54
+ })
55
+ }
56
+ // ,
57
+ // isDeptOrUser (item, dept) {
58
+ // return item.id === dept.id && item.nodeType && dept.nodeType && item.nodeType === dept.nodeType
59
+ // },
60
+ export function getUserInDepartments(departmentIds) {
61
+ return window['$vueApp'].config.globalProperties.$http.post(
62
+ window['$vueApp'].config.globalProperties.baseAPI + '/component/organization-trees/user-only-in-departments',
63
+ departmentIds
64
+ )
65
+ }
66
+ // getTenantNoDeptUsers () {
67
+ // return this.$http.get(window['$vueApp'].config.globalProperties.baseAPI + '/component/organization-trees/tenant-no-dept-users')
68
+ // },
69
+ // getBranchNoDeptUsers (branchId) {
70
+ // return this.$http.get(window['$vueApp'].config.globalProperties.baseAPI + '/component/organization-trees/branch-no-dept-users/' + branchId)
71
+ // }
@@ -37,7 +37,16 @@
37
37
  </span>
38
38
  </template>
39
39
  <el-table :show-header="false" :data="fileList" max-height="60vh">
40
- <el-table-column prop="showName" show-overflow-tooltip />
40
+ <el-table-column prop="showName" show-overflow-tooltip>
41
+ <template v-slot="scope">
42
+ <div style="display: flex; align-items: center">
43
+ <super-icon :iconValue="getFileIconByName(scope.row.showName)" />
44
+ <span style="margin-left: 10px; cursor: pointer" @click="previewSingle(scope.row)">
45
+ {{ scope.row.showName }}
46
+ </span>
47
+ </div>
48
+ </template>
49
+ </el-table-column>
41
50
  <el-table-column width="80" align="center">
42
51
  <template v-slot="scope">
43
52
  <div style="margin: -10px 0">
@@ -69,6 +78,7 @@ import { isPlateSys, getSystemFrontendUrl } from '../../../src/utils/common-util
69
78
  import { isImage, getEntityFieldValue } from '../../../src/utils/util'
70
79
  import { packageFile } from '../../super-grid/src/utils'
71
80
  import { getToken } from '../../../src/utils/auth'
81
+ import { getFileIconByName } from '../../../src/utils/file-util'
72
82
  import { Base64 } from 'js-base64'
73
83
  export default {
74
84
  components: {
@@ -284,10 +294,18 @@ export default {
284
294
  },
285
295
  formatFileName(fileName) {
286
296
  return fileName.replace('#', '~~').replace('?', '~$').replace('&', '$')
297
+ },
298
+ getFileIconByName(fileName) {
299
+ return getFileIconByName(fileName)
287
300
  }
288
301
  },
289
302
  emits: ['close']
290
303
  }
291
304
  </script>
292
305
 
293
- <style lang="scss" scoped></style>
306
+ <style lang="scss" scoped>
307
+ .amb-color-iconfont {
308
+ width: 30px;
309
+ height: 30px;
310
+ }
311
+ </style>
@@ -82,22 +82,35 @@
82
82
  </span>
83
83
  </template>
84
84
  <el-table :data="showFileList" :show-header="false">
85
- <el-table-column prop="showName" width="300" />
85
+ <el-table-column prop="showName" width="300" show-overflow-tooltip>
86
+ <template v-slot="scope">
87
+ <div style="display: flex; align-items: center">
88
+ <super-icon :iconValue="getFileIconByName(scope.row.showName)" />
89
+ <span style="margin-left: 10px; cursor: pointer" @click="previewSingle(scope.row)">
90
+ {{ scope.row.showName }}
91
+ </span>
92
+ </div>
93
+ </template>
94
+ </el-table-column>
86
95
  <el-table-column align="right">
87
96
  <template v-slot="scope">
88
97
  <el-tooltip :content="$t('imatrixUIPublicModel.preview')" class="item" effect="dark" placement="top">
89
- <el-icon style="cursor: pointer" @click="previewSingle(scope.row)">
90
- <el-icon-view />
91
- </el-icon>
98
+ <el-button type="text" @click="previewSingle(scope.row)">
99
+ <el-icon style="cursor: pointer">
100
+ <el-icon-view />
101
+ </el-icon>
102
+ </el-button>
92
103
  </el-tooltip>
93
104
  </template>
94
105
  </el-table-column>
95
106
  <el-table-column v-if="!disabled">
96
107
  <template v-slot="scope">
97
108
  <el-tooltip :content="$t('imatrixUIPublicModel.delete')" class="item" effect="dark" placement="top">
98
- <el-icon style="cursor: pointer" @click="deleteRow(scope.$index)">
99
- <el-icon-delete />
100
- </el-icon>
109
+ <el-button type="text" @click="deleteRow(scope.$index)">
110
+ <el-icon style="cursor: pointer">
111
+ <el-icon-delete />
112
+ </el-icon>
113
+ </el-button>
101
114
  </el-tooltip>
102
115
  </template>
103
116
  </el-table-column>
@@ -144,6 +157,7 @@ import FsPreview from '../../fs-preview/src/fs-preview.vue'
144
157
  import { packageFile } from '../../super-grid/src/utils'
145
158
  import FileUploadInputMobile from '../../fs-upload-new/src/file-upload-mobile/file-upload-input.vue'
146
159
  import { Base64 } from 'js-base64'
160
+ import { getFileIconByName } from '../../../src/utils/file-util'
147
161
  export default {
148
162
  name: 'FsUploadList',
149
163
  props: {
@@ -418,8 +432,17 @@ export default {
418
432
  },
419
433
  uploadFileDone(data) {
420
434
  this.$refs.fileUploadRef.uploadFileDone(data)
435
+ },
436
+ getFileIconByName(fileName) {
437
+ return getFileIconByName(fileName)
421
438
  }
422
439
  },
423
440
  emits: ['close', 'upload-success', 'delete-success', 'delete', 'update:value', 'close', 'update:value']
424
441
  }
425
442
  </script>
443
+ <style lang="scss" scoped>
444
+ .amb-color-iconfont {
445
+ width: 30px;
446
+ height: 30px;
447
+ }
448
+ </style>
@@ -362,7 +362,7 @@ function validateCanUploadFile(file, limitFileSize) {
362
362
  ElMessage({
363
363
  showClose: true,
364
364
  type: 'warning',
365
- message: t('fileUpload.exceedFileSize', { fileName: file.name, fileSize: limitFileSize })
365
+ message: t('imatrixUIMessage.exceedFileSize', { fileName: file.name, fileSize: limitFileSize })
366
366
  })
367
367
  // 返回false停止上传
368
368
  isCanUpload = false
@@ -2,21 +2,26 @@
2
2
  <div>
3
3
  <div v-if="!isMobile">
4
4
  <div v-for="(file, index) in fileList" :key="index" style="width: 100%">
5
- <el-tag>
6
- <el-tooltip content="预览" placement="top">
7
- <span style="cursor: pointer" @click="preview(file.showName, file.serverPath)">
8
- <el-icon><Paperclip /></el-icon>
9
- <span style="margin-left: 6.5px">{{ file.showName }}</span>
10
- </span>
11
- </el-tooltip>
12
- <el-tooltip v-if="!disabled" content="下载" placement="top">
13
- <el-icon @click="handleDownload(file)">
14
- <Download />
15
- </el-icon>
16
- </el-tooltip>
17
- <el-tooltip v-if="!disabled" content="移除" placement="top">
18
- <el-icon @click="handleOnRemove(file)"><Close /></el-icon>
19
- </el-tooltip>
5
+ <el-tag color="white" size="large">
6
+ <template #default>
7
+ <div style="display: flex; align-items: center">
8
+ <!-- 'amb-color-icon-XLS' -->
9
+ <super-icon :iconValue="getFileIconByName(file.showName)" />
10
+ <el-tooltip content="预览" placement="top">
11
+ <span style="cursor: pointer" @click="preview(file.showName, file.serverPath)">
12
+ <span style="margin-left: 6.5px">{{ file.showName }}</span>
13
+ </span>
14
+ </el-tooltip>
15
+ <el-tooltip v-if="!disabled" content="下载" placement="top">
16
+ <el-icon style="margin-left: 10px" @click="handleDownload(file)">
17
+ <Download />
18
+ </el-icon>
19
+ </el-tooltip>
20
+ <el-tooltip v-if="!disabled" content="移除" placement="top">
21
+ <el-icon @click="handleOnRemove(file)"><Close /></el-icon>
22
+ </el-tooltip>
23
+ </div>
24
+ </template>
20
25
  </el-tag>
21
26
  </div>
22
27
  </div>
@@ -53,6 +58,7 @@ import { getSystemFrontendUrl, isPlateSys, isMobileBrowser, getReplaceUrlDomain
53
58
  import { getToken } from '../../../src/utils/auth'
54
59
  import { isImage } from '../../../src/utils/util'
55
60
  import { Base64 } from 'js-base64'
61
+ import { getFileIconByName } from '../../../src/utils/file-util'
56
62
  const props = defineProps({
57
63
  systemCode: {
58
64
  type: String,
@@ -264,3 +270,9 @@ const isPreview = (fileName: string) => {
264
270
  return false
265
271
  }
266
272
  </script>
273
+ <style lang="scss" scoped>
274
+ .amb-color-iconfont {
275
+ width: 30px;
276
+ height: 30px;
277
+ }
278
+ </style>
package/packages/index.js CHANGED
@@ -110,10 +110,10 @@ const install = function (Vue) {
110
110
  if(Vue.config.globalProperties) Vue.config.globalProperties.$agilebuilderUIStore = store;
111
111
  }
112
112
 
113
- // // 判断是否是直接引入vue的js文件,即全局引用可自动安装所有组件
114
- // if (typeof window !== 'undefined' && window.Vue) {
115
- // install(window.Vue)
116
- // }
113
+ // 判断是否是直接引入vue的js文件,即全局引用可自动安装所有组件
114
+ if (typeof window !== 'undefined' && window.Vue) {
115
+ install(window.Vue)
116
+ }
117
117
  export {
118
118
  Breadcrumb,
119
119
  DepartmentTree,
@@ -39,6 +39,7 @@
39
39
  :search-field="searchField"
40
40
  :select-user-info="selectOrganizationInfo"
41
41
  :separator="separator"
42
+ :limit-filter-column="limitFilterColumn"
42
43
  @close="closeOrganizationTree"
43
44
  />
44
45
  <!-- 部门树 -->
@@ -47,8 +48,10 @@
47
48
  :check-strictly="typeof checkStrictly === 'undefined' ? false : checkStrictly"
48
49
  :multiple="typeof multiple === 'undefined' ? false : multiple"
49
50
  :search-field="searchField"
51
+ :department-info="departmentInfo"
50
52
  :select-department-info="selectOrganizationInfo"
51
53
  :separator="separator"
54
+ :limit-filter-column="limitFilterColumn"
52
55
  width="30%"
53
56
  @close="closeOrganizationTree"
54
57
  />
@@ -60,6 +63,7 @@
60
63
  :search-field="searchField"
61
64
  :select-workgroup-info="selectOrganizationInfo"
62
65
  :separator="separator"
66
+ :limit-filter-column="limitFilterColumn"
63
67
  width="30%"
64
68
  @close="closeOrganizationTree"
65
69
  />
@@ -71,6 +75,7 @@
71
75
  :search-field="searchField"
72
76
  :select-user-info="selectOrganizationInfo"
73
77
  :separator="separator"
78
+ :limit-filter-column="limitFilterColumn"
74
79
  width="30%"
75
80
  @close="closeOrganizationTree"
76
81
  />
@@ -102,11 +107,14 @@
102
107
  import { Delete as ElIconDelete, Search as ElIconSearch } from '@element-plus/icons-vue'
103
108
  // import Vue from 'vue'
104
109
  import { getPropNameWhenJoinTable, setEntityFieldValue } from '../../../src/utils/util'
105
-
110
+ import DepartmentUserTree from '../../department-user-tree/src/department-user-tree.vue'
111
+ import DepartmentTree from '../../department-tree/src/department-tree.vue'
106
112
  export default {
107
113
  components: {
108
114
  ElIconSearch,
109
- ElIconDelete
115
+ ElIconDelete,
116
+ DepartmentUserTree,
117
+ DepartmentTree
110
118
  },
111
119
  name: 'OrganizationInput',
112
120
  model: {
@@ -184,6 +192,11 @@ export default {
184
192
  pageModels: {
185
193
  type: Object,
186
194
  default: null
195
+ },
196
+ // 根据变量限制部门时,根据部门表的哪个字段进行过滤,默认是code
197
+ limitFilterColumn: {
198
+ type: String,
199
+ default: 'code'
187
200
  }
188
201
  },
189
202
  data() {
@@ -369,20 +382,24 @@ export default {
369
382
  }
370
383
  }
371
384
  return mainDeptIds.join(this.separator)
372
- } else if (orgDataType === 'mainDeptCode') {
373
- // 正职部门code
374
- const mainDeptCodes = []
385
+ } else if (orgDataType === 'mainDeptCode' || orgDataType === 'mainDeptName') {
386
+ // 正职部门code或名称
387
+ // 这里的orgDataType是mainDeptCode或mainDeptName
388
+ // 需要根据orgDataType来判断返回的值
389
+ // 如果是mainDeptCode,则返回mainDepartmentCode,如果是mainDeptName,则返回mainDepartmentName
390
+ const mainDeptColumn = []
391
+ const key = orgDataType === 'mainDeptCode' ? 'mainDepartmentCode' : 'mainDepartmentName'
375
392
  if (isUserTree) {
376
393
  const users = selectNodeInfo.users
377
394
  if (users) {
378
395
  users.forEach((user) => {
379
- if (user.mainDepartmentCode) {
380
- mainDeptCodes.push(user.mainDepartmentCode)
396
+ if (user[key]) {
397
+ mainDeptColumn.push(user[key])
381
398
  }
382
399
  })
383
400
  }
384
401
  }
385
- return mainDeptCodes.join(this.separator)
402
+ return mainDeptColumn.join(this.separator)
386
403
  } else if (orgDataType === 'subCompanyName') {
387
404
  // 分支名称
388
405
  const branchNames = []
@@ -445,16 +462,21 @@ export default {
445
462
  }
446
463
  }
447
464
  return mainDeptId
448
- } else if (orgDataType === 'mainDeptCode') {
465
+ } else if (orgDataType === 'mainDeptCode' || orgDataType === 'mainDeptName') {
466
+ // 正职部门code或名称
467
+ // 这里的orgDataType是mainDeptCode或mainDeptName
468
+ // 需要根据orgDataType来判断返回的值
469
+ // 如果是mainDeptCode,则返回mainDepartmentCode,如果是mainDeptName,则返回mainDepartmentName
470
+ const key = orgDataType === 'mainDeptCode' ? 'mainDepartmentCode' : 'mainDepartmentName'
449
471
  // 正职部门code
450
- let mainDeptCode = null
472
+ let mainDeptColumn = null
451
473
  if (isUserTree) {
452
474
  const user = selectNodeInfo.user
453
475
  if (user) {
454
- mainDeptCode = user.mainDepartmentCode
476
+ mainDeptColumn = user[key]
455
477
  }
456
478
  }
457
- return mainDeptCode
479
+ return mainDeptColumn
458
480
  } else if (orgDataType === 'subCompanyName') {
459
481
  // 分支名称
460
482
  let branchName = null
@@ -134,7 +134,12 @@ const apis = {
134
134
  }
135
135
  },
136
136
  // 新建行
137
- createRow(listCode, row, options) {
137
+ createRow(listCode, row, options, event) {
138
+ // addRowIndex 表示新建行插入到第几行后面,默认是-1表示添加到最后面
139
+ let addRowIndex = -1
140
+ if (event && event.rowIndex > -1) {
141
+ addRowIndex = event.rowIndex + 1
142
+ }
138
143
  return new Promise((resolve, reject) => {
139
144
  if (!listCode) {
140
145
  listCode = store.get('_list_code')
@@ -257,10 +262,18 @@ const apis = {
257
262
  if (gridParams.isSubTableShowPage !== undefined && gridParams.isSubTableShowPage === true) {
258
263
  // 子表集合添加该新建的行。会触发watch subTableData的监控
259
264
  gridParams.isChangePage = true
260
- gridParams.subTableData.splice(gridParams.subTableData.length, 0, row)
265
+ if (addRowIndex >= 0) {
266
+ gridParams.subTableData.splice(addRowIndex, 0, row)
267
+ } else {
268
+ gridParams.subTableData.splice(gridParams.subTableData.length, 0, row)
269
+ }
261
270
  } else {
262
271
  // 子表不分页
263
- gridData.splice(gridData.length, 0, row)
272
+ if (addRowIndex >= 0) {
273
+ gridData.splice(addRowIndex, 0, row)
274
+ } else {
275
+ gridData.splice(gridData.length, 0, row)
276
+ }
264
277
  if (gridParams.lineEdit.editingCell) {
265
278
  gridParams.lineEdit.editingCell.row = gridData.length
266
279
  }
@@ -284,7 +297,11 @@ const apis = {
284
297
  // console.log('创建行所属的list2', gridData)
285
298
  // console.log('创建行所属的打印gridParams.gridData', gridParams.gridData)
286
299
  const orgRow = Object.assign({}, row)
287
- gridParams.orgGridData.splice(0, 0, orgRow)
300
+ if (addRowIndex >= 0) {
301
+ gridParams.orgGridData.splice(addRowIndex, 0, orgRow)
302
+ } else {
303
+ gridParams.orgGridData.splice(0, 0, orgRow)
304
+ }
288
305
  if (!gridParams.lineEdit.editingCell) {
289
306
  gridParams.lineEdit.editingCell = {}
290
307
  gridParams.lineEdit.validateErrorField = ''
@@ -468,6 +468,7 @@
468
468
  :check-strictly="isCheckStrictly"
469
469
  :department-info="departmentInfo"
470
470
  :disabled="disabled"
471
+ :limit-filter-column="controlConfig?.limitFilterColumn"
471
472
  :fields="fields"
472
473
  :is-join-table="isJoinTable"
473
474
  :models="row"
@@ -528,10 +529,15 @@ import {
528
529
  getControlConfig
529
530
  } from './utils'
530
531
  import dynamicSourceSelect from '../../dynamic-source-select/src/dynamic-source-select.vue'
531
- import { getEntityFieldValue, setEntityFieldValue } from '../../../src/utils/util'
532
+ import {
533
+ getEntityFieldValue,
534
+ setEntityFieldValue,
535
+ getPropValueNew,
536
+ watchPageContextDynamicVariable
537
+ } from '../../../src/utils/util'
532
538
  import { getToken } from '../../../src/utils/auth'
533
539
  import apis from './apis'
534
- import ViewImageDialog from './view-image-dialog'
540
+ import ViewImageDialog from './view-image-dialog.vue'
535
541
  import { $emit } from '../../utils/gogocodeTransfer'
536
542
  import eventBus from './eventBus'
537
543
  import { isMobileBrowser, getAuthSource } from '../../../src/utils/common-util'
@@ -664,7 +670,6 @@ export default {
664
670
  // 表示手机浏览器访问的
665
671
  userAgent = 'browser'
666
672
  }
667
- console.log('superGrid----window.location.protocol---', window.location.protocol)
668
673
  const isDingTalk = getAuthSource() === 'dingtalk' ? true : false
669
674
  const isApk = isMobile && userAgent && userAgent === 'app' ? true : false
670
675
  const isShowScanIcon =
@@ -677,14 +682,6 @@ export default {
677
682
  const colConfigure = gridParams.colConfigureMap ? gridParams.colConfigureMap[this.column.prop] : null
678
683
  const runtimeInfo = colConfigure && colConfigure.runtime ? colConfigure.runtime : {}
679
684
  const designProperty = runtimeInfo.props ? runtimeInfo.props : {}
680
- console.log(
681
- 'super-grid-dynamicInput--designProperty=',
682
- designProperty,
683
- 'colConfigure=',
684
- colConfigure,
685
- 'gridParams.colConfigureMap=',
686
- gridParams.colConfigureMap
687
- )
688
685
  return {
689
686
  deptManTree: false, // 是否是部门人员树
690
687
  isMultiTree: false, // 是否是多选树
@@ -840,6 +837,7 @@ export default {
840
837
  }
841
838
  }
842
839
  }
840
+
843
841
  if (this.column.orgTreeSet) {
844
842
  const orgTreeSet = JSON.parse(this.column.orgTreeSet)
845
843
  if (this.type.indexOf('DeptTree') > 0 && orgTreeSet.checkStrictly) {
@@ -1041,6 +1039,7 @@ export default {
1041
1039
  // 说明是工作组树
1042
1040
  this.wgTree = true
1043
1041
  }
1042
+ this.deptScopeLimit()
1044
1043
  }
1045
1044
  },
1046
1045
  orgTreeSetSort() {
@@ -1133,7 +1132,6 @@ export default {
1133
1132
  this.blurEvent()
1134
1133
  isInputVal = true
1135
1134
  if (this.innerValue && this.isInputControl() && this.column.dataType === 'TEXT') {
1136
- console.log('trim value', this.innerValue)
1137
1135
  this.innerValue = this.innerValue.trim()
1138
1136
  }
1139
1137
  }
@@ -1977,7 +1975,6 @@ export default {
1977
1975
  this.blurEvent()
1978
1976
  },
1979
1977
  packageCustomRules(columnRule) {
1980
- console.log('packageCustomRules---columnRule=', columnRule)
1981
1978
  if (!columnRule) {
1982
1979
  return
1983
1980
  }
@@ -2021,6 +2018,54 @@ export default {
2021
2018
  // 表示没有跳转页面配置
2022
2019
  this.callCustomEvent(eventName)
2023
2020
  }
2021
+ },
2022
+ deptScopeLimit() {
2023
+ debugger
2024
+ if (this.controlConfig && this.controlConfig.deptScope) {
2025
+ // 表示有部门范围限制
2026
+ if (this.controlConfig.deptScope == 'field' && this.controlConfig.deptScopeField) {
2027
+ if (this.controlConfig.deptScopeField.indexOf('${row.') === 0) {
2028
+ // 表示是行记录的字段
2029
+ const fieldName = this.controlConfig.deptScopeField.replace('${row.', '').replace('}', '')
2030
+ if (this.row[fieldName]) {
2031
+ this.departmentInfo = this.row[fieldName].split(',')
2032
+ } else {
2033
+ this.departmentInfo = []
2034
+ }
2035
+ this.$watch('row.' + fieldName, (newVal, oldVal) => {
2036
+ if (newVal) {
2037
+ this.departmentInfo = newVal.split(',')
2038
+ } else {
2039
+ this.departmentInfo = []
2040
+ }
2041
+ })
2042
+ } else {
2043
+ // 表示是页面pageContext的字段
2044
+ this.setLimitDepartmentInfo()
2045
+ if (!this.controlConfig.deptScopeField.indexOf('${fixed.') === 0) {
2046
+ watchPageContextDynamicVariable(
2047
+ this,
2048
+ this.pageContext,
2049
+ this.controlConfig.deptScopeField,
2050
+ (newVal, oldVal) => {
2051
+ this.setLimitDepartmentInfo()
2052
+ }
2053
+ )
2054
+ }
2055
+ }
2056
+ } else if (this.controlConfig.deptScope == 'depts' && this.controlConfig.deptScopeCodes) {
2057
+ // 表示固定部门范围
2058
+ this.departmentInfo = this.controlConfig.deptScopeCodes.split(',')
2059
+ }
2060
+ }
2061
+ },
2062
+ setLimitDepartmentInfo() {
2063
+ const deptScopeFieldValue = getPropValueNew(this.controlConfig.deptScopeField, this.pageContext, this.row)
2064
+ if (deptScopeFieldValue) {
2065
+ this.departmentInfo = deptScopeFieldValue.split(',')
2066
+ } else {
2067
+ this.departmentInfo = []
2068
+ }
2024
2069
  }
2025
2070
  }
2026
2071
  }
@@ -108,6 +108,7 @@
108
108
  :on-click="operation.onClick"
109
109
  :operation-index="operationIndex"
110
110
  :operation-setting="operation.props"
111
+ :event-name="operation.eventName"
111
112
  :row-index="rowIndex"
112
113
  :list-code="listCode"
113
114
  :parent-form-data="parentFormData"
@@ -1184,7 +1185,6 @@ export default {
1184
1185
  return 'primary'
1185
1186
  },
1186
1187
  changeDisabled(state) {
1187
- debugger
1188
1188
  this.disabled = state
1189
1189
  },
1190
1190
  refreshList() {