agilebuilder-ui 1.1.41-sit2 → 1.1.41-sit3

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.
@@ -1,5 +1,5 @@
1
1
  import { openBlock as r, createElementBlock as t, createCommentVNode as o } from "vue";
2
- import { _ as s } from "./index-fd478b0b.js";
2
+ import { _ as s } from "./index-2aba4e9d.js";
3
3
  const u = ["src"], f = s({ data: () => ({ src: null }), watch: { $route(n, c) {
4
4
  this.src = this.$route.query.src;
5
5
  } }, mounted() {
@@ -1,4 +1,4 @@
1
- import { _ as f, c as _, g as x, b as P, s as h, m as M, M as O, i as I } from "./index-fd478b0b.js";
1
+ import { _ as f, c as _, g as x, b as P, s as h, m as M, M as O, i as I } from "./index-2aba4e9d.js";
2
2
  import { resolveComponent as u, openBlock as l, createBlock as b, withCtx as g, createVNode as v, TransitionGroup as L, createElementBlock as p, Fragment as C, renderList as T, createElementVNode as m, toDisplayString as w, normalizeClass as S, createCommentVNode as y } from "vue";
3
3
  const k = { class: "no-redirect" }, A = f({ name: "Breadcrumb", data: () => ({ levelList: null }), computed: { levelListWithTitle() {
4
4
  return this.levelList.filter((e) => e.meta.title !== void 0 && e.meta.title !== null);
@@ -1,5 +1,5 @@
1
1
  import { resolveComponent as t, openBlock as a, createElementBlock as s, createElementVNode as y, createVNode as l, withCtx as r, createTextVNode as n, toDisplayString as p, createCommentVNode as c, createBlock as h } from "vue";
2
- import { _ as I } from "./index-fd478b0b.js";
2
+ import { _ as I } from "./index-2aba4e9d.js";
3
3
  const g = { style: { "padding-bottom": "10px" } }, k = { key: 0, class: "graphDiv" }, N = I({ name: "TacheSubprocessHistory", data: () => ({ type: "graph", workflowId: null }), created() {
4
4
  const o = this.$route.query.workflowId;
5
5
  o && (this.workflowId = parseInt(o));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agilebuilder-ui",
3
- "version": "1.1.41-sit2",
3
+ "version": "1.1.41-sit3",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "main": "./lib/super-ui.js",
@@ -46,6 +46,8 @@ import { getToken } from '../../../src/utils/auth'
46
46
  import type { UploadFile, UploadFiles } from 'element-plus'
47
47
  import fsPreviewNew from './fs-preview-new.vue'
48
48
  import { ElMessage } from 'element-plus'
49
+ import { useI18n } from 'vue-i18n'
50
+ const { t } = useI18n()
49
51
  const props = defineProps({
50
52
  openFsUpload: {
51
53
  type: Boolean,
@@ -129,12 +131,18 @@ const props = defineProps({
129
131
  disabledNoDownload: {
130
132
  type: Boolean,
131
133
  default: false
134
+ },
135
+ // limit
136
+ limit: {
137
+ type: Number,
138
+ default: 0
132
139
  }
133
140
  })
134
141
  const baseURL = window.$vueApp.config.globalProperties.baseURL
135
142
  const baseAPI = window.$vueApp.config.globalProperties.baseAPI
136
143
  const defaultAction = ref<string>('')
137
144
  const buttonUploadRef = ref()
145
+ const innerLimitFileSize = ref(props.limitFileSize)
138
146
  if (props.action) {
139
147
  defaultAction.value = props.action
140
148
  } else {
@@ -149,6 +157,31 @@ if (!props.headers || !props.headers['Authorization']) {
149
157
  props.headers.Authorization = getToken()
150
158
  }
151
159
  const handleBeforeUpload = (file: File) => {
160
+ if (props.fileList?.length !== 0 && props.limit > 0 && props.fileList.length >= props.limit) {
161
+ ElMessage({
162
+ type: 'warning',
163
+ message: t('fsUpload.theNumberOfUploadsExceedsTheLimitTheLimitIs') + ': ' + props.limit,
164
+ showClose: true
165
+ })
166
+ return false
167
+ }
168
+ if (!innerLimitFileSize.value) {
169
+ // 默认是30M
170
+ innerLimitFileSize.value = 30
171
+ }
172
+ if (file.size > innerLimitFileSize.value * 1024 * 1024) {
173
+ // 超过最大限制
174
+ ElMessage({
175
+ type: 'warning',
176
+ message: t('imatrixUIMessage.exceedFileSize', {
177
+ fileSize: innerLimitFileSize.value
178
+ }),
179
+ showClose: true
180
+ })
181
+ // 返回false停止上传
182
+ return false
183
+ }
184
+
152
185
  const isMobile = false
153
186
  return props.beforeUpload({
154
187
  fileObj: file,
@@ -159,7 +192,7 @@ const handleBeforeUpload = (file: File) => {
159
192
  })
160
193
  }
161
194
  const onSuccess = (response: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => {
162
- ElMessage.success('上传成功')
195
+ ElMessage.success(t('fsUpload.uploadSucceeded'))
163
196
  // eslint-disable-next-line vue/no-mutating-props
164
197
  props.fileList.push({
165
198
  showName: response.name,
@@ -9,6 +9,7 @@
9
9
  :headers="headers"
10
10
  :action="defaultAction"
11
11
  :multiple="multiple"
12
+ :before-upload="handleBeforeUpload"
12
13
  :on-success="onUploadSuccess"
13
14
  :before-remove="beforeRemove"
14
15
  >
@@ -43,6 +44,8 @@ import { getToken } from '../../../src/utils/auth'
43
44
  import type { UploadFile, UploadFiles } from 'element-plus'
44
45
  import fsPreviewNew from './fs-preview-new.vue'
45
46
  import { ElMessage } from 'element-plus'
47
+ import { useI18n } from 'vue-i18n'
48
+ const { t } = useI18n()
46
49
  const props = defineProps({
47
50
  openFsUpload: {
48
51
  type: Boolean,
@@ -126,11 +129,17 @@ const props = defineProps({
126
129
  disabledNoDownload: {
127
130
  type: Boolean,
128
131
  default: false
132
+ },
133
+ // limit
134
+ limit: {
135
+ type: Number,
136
+ default: 0
129
137
  }
130
138
  })
131
139
  const baseURL = window.$vueApp.config.globalProperties.baseURL
132
140
  const baseAPI = window.$vueApp.config.globalProperties.baseAPI
133
141
  const defaultAction = ref<string>('')
142
+ const innerLimitFileSize = ref(props.limitFileSize)
134
143
  if (props.action) {
135
144
  defaultAction.value = props.action
136
145
  } else {
@@ -145,10 +154,42 @@ if (!props.headers || !props.headers['Authorization']) {
145
154
  props.headers.Authorization = getToken()
146
155
  }
147
156
  const handleBeforeUpload = (file: File) => {
148
- return props.beforeUpload(file)
157
+ if (props.fileList?.length !== 0 && props.limit > 0 && props.fileList.length >= props.limit) {
158
+ ElMessage({
159
+ type: 'warning',
160
+ message: t('fsUpload.theNumberOfUploadsExceedsTheLimitTheLimitIs') + ': ' + props.limit,
161
+ showClose: true
162
+ })
163
+ return false
164
+ }
165
+ if (!innerLimitFileSize.value) {
166
+ // 默认是30M
167
+ innerLimitFileSize.value = 30
168
+ }
169
+ if (file.size > innerLimitFileSize.value * 1024 * 1024) {
170
+ // 超过最大限制
171
+ ElMessage({
172
+ type: 'warning',
173
+ message: t('imatrixUIMessage.exceedFileSize', {
174
+ fileSize: innerLimitFileSize.value
175
+ }),
176
+ showClose: true
177
+ })
178
+ // 返回false停止上传
179
+ return false
180
+ }
181
+
182
+ const isMobile = false
183
+ return props.beforeUpload({
184
+ fileObj: file,
185
+ files: [file],
186
+ isMobile,
187
+ pageContext: props.pageContext,
188
+ configureObj: props.configure
189
+ })
149
190
  }
150
191
  const onUploadSuccess = (response: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => {
151
- ElMessage.success('上传成功')
192
+ ElMessage.success(t('fsUpload.uploadSucceeded'))
152
193
  // eslint-disable-next-line vue/no-mutating-props
153
194
  props.fileList.push({
154
195
  showName: response.name,
@@ -13,18 +13,18 @@
13
13
  </span>
14
14
  </template>
15
15
  <template v-if="!disabled || !disabledNoPreview">
16
- <el-tooltip content="预览" placement="top">
16
+ <el-tooltip :content="t('fsUpload.preview')" placement="top">
17
17
  <span style="cursor: pointer" @click="preview(file.showName, file.serverPath)">
18
18
  <span style="margin-left: 6.5px">{{ file.showName }}</span>
19
19
  </span>
20
20
  </el-tooltip>
21
21
  </template>
22
- <el-tooltip v-if="!disabled || !disabledNoDownload" content="下载" placement="top">
22
+ <el-tooltip v-if="!disabled || !disabledNoDownload" :content="t('fsUpload.download')" placement="top">
23
23
  <el-icon style="margin-left: 10px" @click="handleDownload(file)">
24
24
  <Download />
25
25
  </el-icon>
26
26
  </el-tooltip>
27
- <el-tooltip v-if="!disabled" content="移除" placement="top">
27
+ <el-tooltip v-if="!disabled" :content="t('fsUpload.delete')" placement="top">
28
28
  <el-icon @click="handleOnRemove(file)"><Close /></el-icon>
29
29
  </el-tooltip>
30
30
  </div>
@@ -47,7 +47,7 @@
47
47
  <el-icon><Delete /></el-icon>
48
48
  </span>
49
49
  </span>
50
- <el-dialog v-model="dialogVisible" title="预览" width="500">
50
+ <el-dialog v-model="dialogVisible" :title="t('fsUpload.preview')" width="500">
51
51
  <el-image :preview-src-list="previewSrcList" :src="previewImageInfo.src" />
52
52
  </el-dialog>
53
53
  </div>
@@ -66,6 +66,8 @@ import { getToken } from '../../../src/utils/auth'
66
66
  import { isImage } from '../../../src/utils/util'
67
67
  import { Base64 } from 'js-base64'
68
68
  import { getFileIconByName } from '../../../src/utils/file-util'
69
+ import { useI18n } from 'vue-i18n'
70
+ const { t } = useI18n()
69
71
  const props = defineProps({
70
72
  systemCode: {
71
73
  type: String,