agilebuilder-ui 1.0.69 → 1.0.71-temp8

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 (33) hide show
  1. package/lib/super-ui.css +1 -1
  2. package/lib/super-ui.js +44667 -42821
  3. package/lib/super-ui.umd.cjs +94 -86
  4. package/package.json +4 -2
  5. package/packages/department-tree/src/department-tree.vue +28 -10
  6. package/packages/department-tree-mobile/src/department-tree-app.vue +6 -6
  7. package/packages/department-user-tree/src/department-user-tree.vue +16 -2
  8. package/packages/department-user-tree-mobile/src/department-user-tree-app.vue +6 -6
  9. package/packages/fs-upload-new/src/file-upload-mobile/file-upload-app.vue +410 -0
  10. package/packages/fs-upload-new/src/file-upload-mobile/file-upload-browser.vue +484 -0
  11. package/packages/fs-upload-new/src/file-upload-mobile/file-upload-component.vue +140 -0
  12. package/packages/fs-upload-new/src/file-upload-mobile/file-upload-input.vue +220 -0
  13. package/packages/fs-upload-new/src/file-upload-mobile/file-upload.vue +249 -0
  14. package/packages/fs-upload-new/src/fs-button-upload.vue +9 -13
  15. package/packages/fs-upload-new/src/fs-drag-upload.vue +4 -8
  16. package/packages/fs-upload-new/src/fs-preview-new.vue +103 -36
  17. package/packages/fs-upload-new/src/fs-upload-new.vue +88 -8
  18. package/packages/super-grid/src/apis.js +6 -6
  19. package/packages/super-grid/src/custom-formatter.js +2 -1
  20. package/packages/super-grid/src/search-button.vue +18 -14
  21. package/packages/super-grid/src/search-form-mobile.vue +250 -0
  22. package/packages/super-grid/src/search-form.vue +159 -82
  23. package/packages/super-grid/src/super-grid.vue +21 -5
  24. package/src/api/sso-service.js +25 -14
  25. package/src/i18n/langs/cn.js +4 -1
  26. package/src/i18n/langs/en.js +4 -1
  27. package/src/permission.js +108 -122
  28. package/src/styles/theme/green/sidebar.scss +11 -0
  29. package/src/utils/common-util.js +217 -124
  30. package/src/utils/i18n-util.js +127 -0
  31. package/src/utils/jump-page-utils.js +34 -13
  32. package/src/utils/permissionAuth.js +47 -8
  33. package/src/utils/util.js +1 -1
@@ -0,0 +1,220 @@
1
+ <template>
2
+ <div>
3
+ <el-input
4
+ ref="item"
5
+ :disabled="disabled"
6
+ v-model="fileNames"
7
+ :placeholder="$t('imatrixUIMessage.fileUpload')"
8
+ :readonly="true"
9
+ >
10
+ <template v-slot:append>
11
+ <el-button v-if="!disabled" :icon="Upload" size="default" @click="openAnnexUpload" />
12
+ </template>
13
+ </el-input>
14
+
15
+ <el-dialog
16
+ v-model="annexUploadFlag"
17
+ :append-to-body="true"
18
+ :show-close="true"
19
+ :title="$t('imatrixUIMessage.upload')"
20
+ width="80%"
21
+ @close="annexUploadFlag=false"
22
+ >
23
+ <FileUploadMobile
24
+ :disabled="disabled"
25
+ :fileInfo="fileInfo"
26
+ :systemCode="systemCode"
27
+ :accept="accept"
28
+ :multiple="multiple"
29
+ :limit="limit"
30
+ :limitFileSize="limitFileSize"
31
+ :placeholder="placeholder"
32
+ :action="action"
33
+ :headers="headers"
34
+ :file-list="fileList"
35
+ :beforeUpload="beforeUpload"
36
+ :onSuccess="onSuccess"
37
+ :beforeRemove="beforeRemove"
38
+ :onRemove="onRemove"
39
+ :beforeDownload="beforeDownload"
40
+ :pageContext="pageContext"
41
+ :configure="configure"
42
+ :openFsUpload="openFsUpload"
43
+ @uploadend="uploadendMobile"
44
+ @remove="removeMobileFile"
45
+ />
46
+ </el-dialog>
47
+ </div>
48
+ </template>
49
+
50
+ <script lang="ts" setup>
51
+ import { ref, defineEmits } from 'vue'
52
+ import { ElMessage } from 'element-plus'
53
+ import FileUploadMobile from './file-upload.vue'
54
+ import {
55
+ Upload
56
+ } from '@element-plus/icons-vue'
57
+
58
+ const props = defineProps({
59
+ openFsUpload: {
60
+ type: Object,
61
+ default: true
62
+ },
63
+ entity: {
64
+ type: Object,
65
+ default: () => {
66
+ return null
67
+ }
68
+ },
69
+ fileInfo: {
70
+ type: Object,
71
+ default: () => ({})
72
+ },
73
+ systemCode: {
74
+ type: String,
75
+ default: ''
76
+ },
77
+ displayType: {
78
+ type: String,
79
+ default: 'input'
80
+ },
81
+ // 是否禁止编辑,为true只能下载,不能删除和上传
82
+ disabled: {
83
+ type: Boolean,
84
+ default: false
85
+ },
86
+ accept: {
87
+ type: String,
88
+ default: ''
89
+ },
90
+ multiple: {
91
+ type: Boolean,
92
+ default: false
93
+ },
94
+ limit: {
95
+ type: Number,
96
+ default: 1
97
+ },
98
+ // 文件大小限制,单位是M,默认是30M
99
+ limitFileSize: {
100
+ type: Number,
101
+ default: 30
102
+ },
103
+ placeholder: {
104
+ type: String,
105
+ default: '拖拽文件 或 点击上传'
106
+ },
107
+ action: {
108
+ type: String,
109
+ default: ''
110
+ },
111
+ headers: {
112
+ type: Object,
113
+ default: () => ({ Authorization: null })
114
+ },
115
+ // 已上传文件列表
116
+ fileList: {
117
+ type: Array,
118
+ default: () => []
119
+ },
120
+ onSuccess: {
121
+ type: Function,
122
+ default: () => {}
123
+ },
124
+ beforeRemove: {
125
+ type: Function,
126
+ default: () => {}
127
+ },
128
+ onRemove: {
129
+ type: Function,
130
+ default: () => {}
131
+ },
132
+ beforeDownload: {
133
+ type: Function,
134
+ default: () => {}
135
+ },
136
+ pageContext: {
137
+ type: Object,
138
+ default: () => ({})
139
+ },
140
+ configure: {
141
+ type: Object,
142
+ default: () => ({})
143
+ },
144
+ // 组件id,在表单或列表中应该唯一,一般传字段名即可
145
+ componentId: {
146
+ type: String,
147
+ default: function () {
148
+ return 'file-upload'
149
+ }
150
+ },
151
+ // 组件名称,一般是字段label
152
+ componentName: {
153
+ type: String,
154
+ default: function () {
155
+ return 'file-upload'
156
+ }
157
+ },
158
+ options: {
159
+ type: Object,
160
+ default: null
161
+ },
162
+ // 列表编码
163
+ listCode: {
164
+ type: String,
165
+ default: null
166
+ },
167
+ // 打开相机和相册选项,默认是都可以打开
168
+ openCameraOrChoosePhoto: {
169
+ type: String,
170
+ default: 'openCameraAndChoosePhoto'
171
+ },
172
+ beforeUpload: {
173
+ type: Function,
174
+ default: () => {}
175
+ }
176
+ })
177
+
178
+ const emits = defineEmits(['remove', 'uploadend'])
179
+ const annexUploadFlag = ref(false)
180
+ const fileNames = ref(null)
181
+
182
+ const openAnnexUpload = ()=>{
183
+ console.log('点击选择文件按钮---')
184
+ annexUploadFlag.value = true
185
+ }
186
+
187
+ function uploadendMobile(fileList) {
188
+ const fileServerPaths = Array.from(props.fileList,({serverPath})=>serverPath)
189
+ // console.log('uploadendMobile---props.fileList=', props.fileList,'fileServerPaths=',fileServerPaths, 'fileList=', fileList)
190
+ fileList.forEach(file=>{
191
+ // 如果已经存在就不要重复添加到fileList中了
192
+ if(fileServerPaths.indexOf(file.serverPath) < 0){
193
+ props.fileList.push({
194
+ showName: file.name,
195
+ serverPath: file.serverPath
196
+ })
197
+ }
198
+ })
199
+ fileNames.value =props.fileList.map((item: any) => item.showName).join(',')
200
+ props.onSuccess()
201
+ }
202
+
203
+
204
+ function removeMobileFile(param) {
205
+ // console.log('removeMobileFile---props.fileList=', props.fileList, 'param=', param)
206
+ const deleteFile = param.rmFiles && param.rmFiles.length > 0 ? param.rmFiles[0] : null
207
+ if(deleteFile){
208
+ let index = props.fileList.findIndex((item: any) => item.serverPath === deleteFile.serverPath)
209
+ if (index > -1) {
210
+ // eslint-disable-next-line vue/no-mutating-props
211
+ props.fileList.splice(index, 1)
212
+ }
213
+ }
214
+ fileNames.value =props.fileList.map((item: any) => item.showName).join(',')
215
+ props.onRemove()
216
+ }
217
+
218
+ </script>
219
+
220
+ <style lang="scss" scoped></style>
@@ -0,0 +1,249 @@
1
+ <template>
2
+ <div>
3
+ <!-- <file-upload-app
4
+ v-if="userAgent === 'app'"
5
+ ref="fileUploadRef"
6
+ :file-lis="fileList"
7
+ :system-code="systemCode"
8
+ :multiple="multiple"
9
+ :disabled="disabled"
10
+ :limit-file-size="limitFileSize"
11
+ :component-id="componentId"
12
+ :component-name="componentName"
13
+ :options="options"
14
+ :list-code="listCode"
15
+ @uploadend="uploadedFile"
16
+ @remove="removeFile"
17
+ @pickup-file="pickupFiles"
18
+ @close="$emit('close')"
19
+ /> -->
20
+ <!-- v-if="userAgent === 'browser'" -->
21
+ <file-upload-browser
22
+ ref="fileUploadRef"
23
+ :file-list="fileList"
24
+ :multiple="multiple"
25
+ :disabled="disabled"
26
+ :open-camera-or-choose-photo="openCameraOrChoosePhoto"
27
+ :options="options"
28
+ :fileInfo="fileInfo"
29
+ :systemCode="systemCode"
30
+ :accept="accept"
31
+ :limit="limit"
32
+ :limitFileSize="limitFileSize"
33
+ :placeholder="placeholder"
34
+ :action="action"
35
+ :headers="headers"
36
+ :beforeUpload="beforeUpload"
37
+ :onSuccess="onSuccess"
38
+ :beforeRemove="beforeRemove"
39
+ :onRemove="onRemove"
40
+ :beforeDownload="beforeDownload"
41
+ :pageContext="pageContext"
42
+ :configure="configure"
43
+ :openFsUpload="openFsUpload"
44
+ @pickup-file="pickupFiles"
45
+ @uploadend="uploadedFile"
46
+ @remove="removeFile"
47
+ />
48
+ </div>
49
+ </template>
50
+ <script lang="ts" setup>
51
+ import { ref, defineEmits } from 'vue'
52
+ import { ElMessage } from 'element-plus'
53
+ import { useI18n } from 'vue-i18n'
54
+ // import FileUploadApp from './file-upload-app.vue'
55
+ import FileUploadBrowser from './file-upload-browser.vue'
56
+ import apis from './api.js'
57
+
58
+ const props = defineProps({
59
+ openFsUpload: {
60
+ type: Object,
61
+ default: true
62
+ },
63
+ entity: {
64
+ type: Object,
65
+ default: () => {
66
+ return null
67
+ }
68
+ },
69
+ fileInfo: {
70
+ type: Object,
71
+ default: () => ({})
72
+ },
73
+ systemCode: {
74
+ type: String,
75
+ default: ''
76
+ },
77
+ displayType: {
78
+ type: String,
79
+ default: 'input'
80
+ },
81
+ // 是否禁止编辑,为true只能下载,不能删除和上传
82
+ disabled: {
83
+ type: Boolean,
84
+ default: false
85
+ },
86
+ accept: {
87
+ type: String,
88
+ default: ''
89
+ },
90
+ multiple: {
91
+ type: Boolean,
92
+ default: false
93
+ },
94
+ limit: {
95
+ type: Number,
96
+ default: 1
97
+ },
98
+ // 文件大小限制,单位是M,默认是30M
99
+ limitFileSize: {
100
+ type: Number,
101
+ default: 30
102
+ },
103
+ placeholder: {
104
+ type: String,
105
+ default: '拖拽文件 或 点击上传'
106
+ },
107
+ action: {
108
+ type: String,
109
+ default: ''
110
+ },
111
+ headers: {
112
+ type: Object,
113
+ default: () => ({ Authorization: null })
114
+ },
115
+ // 已上传文件列表
116
+ fileList: {
117
+ type: Array,
118
+ default: () => []
119
+ },
120
+ onSuccess: {
121
+ type: Function,
122
+ default: () => {}
123
+ },
124
+ beforeRemove: {
125
+ type: Function,
126
+ default: () => {}
127
+ },
128
+ onRemove: {
129
+ type: Function,
130
+ default: () => {}
131
+ },
132
+ beforeDownload: {
133
+ type: Function,
134
+ default: () => {}
135
+ },
136
+ pageContext: {
137
+ type: Object,
138
+ default: () => ({})
139
+ },
140
+ configure: {
141
+ type: Object,
142
+ default: () => ({})
143
+ },
144
+ // 组件id,在表单或列表中应该唯一,一般传字段名即可
145
+ componentId: {
146
+ type: String,
147
+ default: function () {
148
+ return 'file-upload'
149
+ }
150
+ },
151
+ // 组件名称,一般是字段label
152
+ componentName: {
153
+ type: String,
154
+ default: function () {
155
+ return 'file-upload'
156
+ }
157
+ },
158
+ options: {
159
+ type: Object,
160
+ default: null
161
+ },
162
+ // 列表编码
163
+ listCode: {
164
+ type: String,
165
+ default: null
166
+ },
167
+ // 打开相机和相册选项,默认是都可以打开
168
+ openCameraOrChoosePhoto: {
169
+ type: String,
170
+ default: 'openCameraAndChoosePhoto'
171
+ },
172
+ beforeUpload: {
173
+ type: Function,
174
+ default: () => {}
175
+ }
176
+ })
177
+ const baseAPI = window.$vueApp.config.globalProperties.baseAPI
178
+ const deleteServerFileUrl = baseAPI + '/component/super-form/deleteFile'
179
+ const emits = defineEmits(['uploadend', 'remove', 'pickup-file', 'close'])
180
+ const { t } = useI18n()
181
+
182
+ const userAgent = ref(null)
183
+ const userAgentDetail = ref(null)
184
+ const rmFileServerPaths = ref([])
185
+ const fileUploadRef = ref(null)
186
+
187
+ const userAgentOrg = navigator.userAgent
188
+ userAgentDetail.value = userAgentOrg
189
+ if (userAgentOrg.indexOf(' uni-app ') > 0) {
190
+ // 表示uni-app中访问的
191
+ userAgent.value = 'app'
192
+ } else {
193
+ // 表示手机浏览器访问的
194
+ userAgent.value = 'browser'
195
+ }
196
+
197
+ // 点击确定(上传)按钮的回调方法
198
+ function uploadedFile(fileList) {
199
+ emits('uploadend', fileList)
200
+ }
201
+ function deleteServerFiles() {
202
+ return window.$vueApp.config.globalProperties.$http.post(deleteServerFileUrl, rmFileServerPaths.value)
203
+ }
204
+
205
+ function removeFile({ rmFiles, serverFiles, newFiles }) {
206
+ if (rmFiles && rmFiles.length > 0) {
207
+ rmFiles.forEach((item) => {
208
+ if (item.serverPath && rmFileServerPaths.value && rmFileServerPaths.value.indexOf(item.serverPath) < 0) {
209
+ rmFileServerPaths.value.push(item.serverPath)
210
+ }
211
+ })
212
+ if (rmFileServerPaths.value && rmFileServerPaths.value.length > 0) {
213
+ // 删除minio等服务器上的附件
214
+ deleteServerFiles().then(() => {
215
+ // 更新字段的值
216
+ ElMessage({
217
+ showClose: true,
218
+ message: t('fileUpload.updateSuccess'),
219
+ type: 'success'
220
+ })
221
+ })
222
+ }
223
+ emits('remove', { rmFiles, serverFiles, newFiles })
224
+ }
225
+ }
226
+ // 选择文件之后的事件
227
+ function pickupFiles(files) {
228
+ emits('pickup-file', files)
229
+ }
230
+ // 移动端选择文件结束
231
+ function pickFileDone(data) {
232
+ if (userAgent.value === 'app') {
233
+ fileUploadRef.value.pickFileDone(data)
234
+ }
235
+ }
236
+ // 移动端上传文件结束
237
+ function uploadFileDone(data) {
238
+ if (userAgent.value === 'app') {
239
+ fileUploadRef.value.uploadFileDone(data)
240
+ }
241
+ }
242
+ function clearTempFile() {
243
+ if (fileUploadRef.value) {
244
+ fileUploadRef.value.clearQueenFile()
245
+ }
246
+ }
247
+ </script>
248
+
249
+ <style lang="scss" scoped></style>
@@ -7,7 +7,7 @@
7
7
  :show-file-list="false"
8
8
  auto-upload
9
9
  :headers="headers"
10
- :disabled="!openFsUpload"
10
+ :disabled="!openFsUpload"
11
11
  :action="defaultAction"
12
12
  :multiple="multiple"
13
13
  :before-upload="handleBeforeUpload"
@@ -16,11 +16,11 @@
16
16
  >
17
17
  <el-button size="small" type="primary">{{ placeholder }}</el-button>
18
18
  <template #tip>
19
- <el-text size="small"> {{ accept }} 上传的文件不超过{{ limitFileSize }}M</el-text>
19
+ <el-text size="small"> {{ accept }} {{$t('imatrixUIMessage.uploadFileTip',{fileSzie: limitFileSize})}}</el-text>
20
20
  </template>
21
21
  </el-upload>
22
22
  <template v-if="fileList && fileList.length > 0">
23
- <fs-preview-new :disabled="disabled" :file-list="fileList" :system-code="systemCode" />
23
+ <fs-preview-new :disabled="disabled" :file-list="fileList" :system-code="systemCode" :before-remove="beforeRemove" :on-remove="onRemove" :before-download="beforeDownload"/>
24
24
  </template>
25
25
  </template>
26
26
 
@@ -31,10 +31,10 @@ import { getToken } from '../../../src/utils/auth'
31
31
  import type { UploadFile, UploadFiles } from 'element-plus'
32
32
  import fsPreviewNew from './fs-preview-new.vue'
33
33
  const props = defineProps({
34
- openFsUpload:{
35
- type: Boolean,
36
- default: true
37
- },
34
+ openFsUpload: {
35
+ type: Boolean,
36
+ default: true
37
+ },
38
38
  systemCode: {
39
39
  type: String,
40
40
  default: ''
@@ -75,10 +75,6 @@ const props = defineProps({
75
75
  type: Array<{ showName: string; serverPath: string }>,
76
76
  default: () => []
77
77
  },
78
- handleBeforeUpload: {
79
- type: Function,
80
- default: () => {}
81
- },
82
78
  onSuccess: {
83
79
  type: Function,
84
80
  default: () => {}
@@ -116,7 +112,7 @@ if (props.action) {
116
112
  defaultAction.value = props.action
117
113
  } else {
118
114
  let tempAction = baseURL + '/common/fs-upload'
119
- if (!isPlateSys(props.systemCode)) {
115
+ if (isPlateSys(props.systemCode)) {
120
116
  tempAction = baseAPI + '/component/super-form/uploads'
121
117
  }
122
118
  defaultAction.value = tempAction
@@ -126,7 +122,7 @@ if (!props.headers || !props.headers['Authorization']) {
126
122
  props.headers.Authorization = getToken()
127
123
  }
128
124
  const handleBeforeUpload = (file: File) => {
129
- return props.handleBeforeUpload(file)
125
+ return props.beforeUpload(file)
130
126
  }
131
127
  const onSuccess = (response: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => {
132
128
  // eslint-disable-next-line vue/no-mutating-props
@@ -18,11 +18,11 @@
18
18
  <el-icon class="el-icon--upload"><upload-filled /></el-icon>
19
19
  <div class="el-upload__text">{{ placeholder }}</div>
20
20
  <template #tip>
21
- <el-text size="small"> {{ accept }} 上传的文件不超过{{ limitFileSize }}M</el-text>
21
+ <el-text size="small"> {{ accept }} {{$t('imatrixUIMessage.uploadFileTip',{fileSzie: limitFileSize})}}</el-text>
22
22
  </template>
23
23
  </el-upload>
24
24
  <template v-if="fileList && fileList.length > 0">
25
- <fs-preview-new :disabled="disabled" :file-list="fileList" :system-code="systemCode" />
25
+ <fs-preview-new :disabled="disabled" :file-list="fileList" :system-code="systemCode" :before-remove="beforeRemove" :on-remove="onRemove" :before-download="beforeDownload" />
26
26
  </template>
27
27
  </template>
28
28
 
@@ -78,10 +78,6 @@ const props = defineProps({
78
78
  type: Array<{ showName: string; serverPath: string }>,
79
79
  default: () => []
80
80
  },
81
- handleBeforeUpload: {
82
- type: Function,
83
- default: () => {}
84
- },
85
81
  onSuccess: {
86
82
  type: Function,
87
83
  default: () => {}
@@ -119,7 +115,7 @@ if (props.action) {
119
115
  defaultAction.value = props.action
120
116
  } else {
121
117
  let tempAction = baseURL + '/common/fs-upload'
122
- if (!isPlateSys(props.systemCode)) {
118
+ if (isPlateSys(props.systemCode)) {
123
119
  tempAction = baseAPI + '/component/super-form/uploads'
124
120
  }
125
121
  defaultAction.value = tempAction
@@ -129,7 +125,7 @@ if (!props.headers || !props.headers['Authorization']) {
129
125
  props.headers.Authorization = getToken()
130
126
  }
131
127
  const handleBeforeUpload = (file: File) => {
132
- return props.handleBeforeUpload(file)
128
+ return props.beforeUpload(file)
133
129
  }
134
130
  const onSuccess = (response: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => {
135
131
  // eslint-disable-next-line vue/no-mutating-props