diff --git a/.gitignore b/.gitignore index 868a1cbc..848638a9 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ node_modules .DS_Store dist dist-ssr -*.local /dist* pnpm-debug auto-*.d.ts diff --git a/package.json b/package.json index 1a44d6e6..48d16a27 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "yudao-ui-admin-vue3", - "version": "2.1.0-snapshot", + "version": "2.2.0-snapshot", "description": "基于vue3、vite4、element-plus、typesScript", "author": "xingyu", "private": false, diff --git a/src/api/bpm/definition/index.ts b/src/api/bpm/definition/index.ts index cb6d4271..caedba14 100644 --- a/src/api/bpm/definition/index.ts +++ b/src/api/bpm/definition/index.ts @@ -1,6 +1,6 @@ import request from '@/config/axios' -export const getProcessDefinition = async (id: number, key: string) => { +export const getProcessDefinition = async (id?: string, key?: string) => { return await request.get({ url: '/bpm/process-definition/get', params: { id, key } diff --git a/src/api/bpm/model/index.ts b/src/api/bpm/model/index.ts index 2e1d4e64..2b484a61 100644 --- a/src/api/bpm/model/index.ts +++ b/src/api/bpm/model/index.ts @@ -5,6 +5,7 @@ export type ProcessDefinitionVO = { version: number deploymentTIme: string suspensionState: number + formType?: number } export type ModelVO = { diff --git a/src/api/bpm/processInstance/index.ts b/src/api/bpm/processInstance/index.ts index 81640625..9122b2b9 100644 --- a/src/api/bpm/processInstance/index.ts +++ b/src/api/bpm/processInstance/index.ts @@ -1,4 +1,5 @@ import request from '@/config/axios' +import { ProcessDefinitionVO } from '@/api/bpm/model' export type Task = { id: string @@ -18,17 +19,7 @@ export type ProcessInstanceVO = { businessKey: string createTime: string endTime: string -} - -export type ProcessInstanceCopyVO = { - type: number - taskName: string - taskKey: string - processInstanceName: string - processInstanceKey: string - startUserId: string - options: string[] - reason: string + processDefinition?: ProcessDefinitionVO } export const getProcessInstanceMyPage = async (params: any) => { diff --git a/src/components/ConfigGlobal/src/ConfigGlobal.vue b/src/components/ConfigGlobal/src/ConfigGlobal.vue index 5bd90cf1..af543df2 100644 --- a/src/components/ConfigGlobal/src/ConfigGlobal.vue +++ b/src/components/ConfigGlobal/src/ConfigGlobal.vue @@ -54,7 +54,7 @@ const currentLocale = computed(() => localeStore.currentLocale) diff --git a/src/components/DictTag/src/DictTag.vue b/src/components/DictTag/src/DictTag.vue index db37f714..1d075a1b 100644 --- a/src/components/DictTag/src/DictTag.vue +++ b/src/components/DictTag/src/DictTag.vue @@ -22,8 +22,8 @@ export default defineComponent({ const dictOptions = getDictOptions(dictType) dictOptions.forEach((dict: DictDataType) => { if (dict.value === value) { - if (dict.colorType + '' === 'primary' || dict.colorType + '' === 'default') { - dict.colorType = '' + if (dict.colorType + '' === 'default') { + dict.colorType = 'info' } dictData.value = dict } diff --git a/src/components/DiyEditor/components/ComponentLibrary.vue b/src/components/DiyEditor/components/ComponentLibrary.vue index b8bd1ec3..fdb0b1de 100644 --- a/src/components/DiyEditor/components/ComponentLibrary.vue +++ b/src/components/DiyEditor/components/ComponentLibrary.vue @@ -95,6 +95,7 @@ const handleCloneComponent = (component: DiyComponent) => { .editor-left { z-index: 1; flex-shrink: 0; + user-select: none; box-shadow: 8px 0 8px -8px rgb(0 0 0 / 12%); :deep(.el-collapse) { diff --git a/src/components/Editor/src/Editor.vue b/src/components/Editor/src/Editor.vue index eff82745..8dd06456 100644 --- a/src/components/Editor/src/Editor.vue +++ b/src/components/Editor/src/Editor.vue @@ -96,11 +96,6 @@ const editorConfig = computed((): IEditorConfig => { // 选择文件时的类型限制,默认为 ['image/*'] 。如不想限制,则设置为 [] allowedFileTypes: ['image/*'], - // 自定义上传参数,例如传递验证的 token 等。参数会被添加到 formData 中,一起上传到服务端。 - meta: { updateSupport: 0 }, - // 将 meta 拼接到 url 参数中,默认 false - metaWithUrl: true, - // 自定义增加 http header headers: { Accept: '*', @@ -108,9 +103,6 @@ const editorConfig = computed((): IEditorConfig => { 'tenant-id': getTenantId() }, - // 跨域是否传递 cookie ,默认为 false - withCredentials: true, - // 超时时间,默认为 10 秒 timeout: 5 * 1000, // 5 秒 @@ -119,7 +111,7 @@ const editorConfig = computed((): IEditorConfig => { // 上传之前触发 onBeforeUpload(file: File) { - console.log(file) + // console.log(file) return file }, // 上传进度的回调函数 @@ -142,6 +134,54 @@ const editorConfig = computed((): IEditorConfig => { customInsert(res: any, insertFn: InsertFnType) { insertFn(res.data, 'image', res.data) } + }, + ['uploadVideo']: { + server: import.meta.env.VITE_UPLOAD_URL, + // 单个文件的最大体积限制,默认为 10M + maxFileSize: 10 * 1024 * 1024, + // 最多可上传几个文件,默认为 100 + maxNumberOfFiles: 10, + // 选择文件时的类型限制,默认为 ['video/*'] 。如不想限制,则设置为 [] + allowedFileTypes: ['video/*'], + + // 自定义增加 http header + headers: { + Accept: '*', + Authorization: 'Bearer ' + getAccessToken(), + 'tenant-id': getTenantId() + }, + + // 超时时间,默认为 30 秒 + timeout: 15 * 1000, // 15 秒 + + // form-data fieldName,后端接口参数名称,默认值wangeditor-uploaded-image + fieldName: 'file', + + // 上传之前触发 + onBeforeUpload(file: File) { + // console.log(file) + return file + }, + // 上传进度的回调函数 + onProgress(progress: number) { + // progress 是 0-100 的数字 + console.log('progress', progress) + }, + onSuccess(file: File, res: any) { + console.log('onSuccess', file, res) + }, + onFailed(file: File, res: any) { + alert(res.message) + console.log('onFailed', file, res) + }, + onError(file: File, err: any, res: any) { + alert(err.message) + console.error('onError', file, err, res) + }, + // 自定义插入图片 + customInsert(res: any, insertFn: InsertFnType) { + insertFn(res.data, 'mp4', res.data) + } } }, uploadImgShowBase64: true diff --git a/src/components/UploadFile/src/UploadFile.vue b/src/components/UploadFile/src/UploadFile.vue index 4459e69e..3beb3775 100644 --- a/src/components/UploadFile/src/UploadFile.vue +++ b/src/components/UploadFile/src/UploadFile.vue @@ -32,6 +32,7 @@ 格式为 {{ fileType.join('/') }} 的文件 + @@ -167,6 +167,8 @@ import { dateFormatter, formatPast2 } from '@/utils/formatTime' import { ElMessageBox } from 'element-plus' import * as ProcessInstanceApi from '@/api/bpm/processInstance' import { CategoryApi } from '@/api/bpm/category' +import { ProcessInstanceVO } from '@/api/bpm/processInstance' +import * as DefinitionApi from '@/api/bpm/definition' defineOptions({ name: 'BpmProcessInstanceMy' }) @@ -214,10 +216,22 @@ const resetQuery = () => { } /** 发起流程操作 **/ -const handleCreate = (id) => { - router.push({ +const handleCreate = async (row?: ProcessInstanceVO) => { + // 如果是【业务表单】,不支持重新发起 + if (row?.id) { + const processDefinitionDetail = await DefinitionApi.getProcessDefinition( + row.processDefinitionId + ) + debugger + if (processDefinitionDetail.formType === 20) { + message.error('重新发起流程失败,原因:该流程使用业务表单,不支持重新发起') + return + } + } + // 跳转发起流程界面 + await router.push({ name: 'BpmProcessInstanceCreate', - query: { processInstanceId: id } + query: { processInstanceId: row?.id } }) } diff --git a/src/views/infra/fileConfig/index.vue b/src/views/infra/fileConfig/index.vue index a9c001a9..3eea1062 100644 --- a/src/views/infra/fileConfig/index.vue +++ b/src/views/infra/fileConfig/index.vue @@ -206,7 +206,8 @@ const handleMaster = async (id) => { const handleTest = async (id) => { try { const response = await FileConfigApi.testFileConfig(id) - message.alert('测试通过,上传文件成功!访问地址:' + response) + await message.confirm('是否要访问该文件?', '测试上传成功') + window.open(response, '_blank') } catch {} } diff --git a/src/views/infra/webSocket/index.vue b/src/views/infra/webSocket/index.vue index d83327d4..a794344d 100644 --- a/src/views/infra/webSocket/index.vue +++ b/src/views/infra/webSocket/index.vue @@ -86,7 +86,7 @@ const getTagColor = computed(() => (getIsOpen.value ? 'success' : 'red')) // Web /** 发起 WebSocket 连接 */ const { status, data, send, close, open } = useWebSocket(server.value, { - autoReconnect: false, + autoReconnect: true, heartbeat: true }) diff --git a/src/views/mall/product/category/index.vue b/src/views/mall/product/category/index.vue index b801cb2b..a47684b5 100644 --- a/src/views/mall/product/category/index.vue +++ b/src/views/mall/product/category/index.vue @@ -56,7 +56,7 @@ width="180" :formatter="dateFormatter" /> - +