diff --git a/CHANGELOG.md b/CHANGELOG.md index 66d48158c42367fc9bf10a8623def9e0093a7516..a190a92a28046bc848bf07a0ce24ac66ef091f28 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,13 @@ +# 1.3.1 + +**Feature** + +系统主题切换功能(重磅登场!) + +**Bug Fixed** + +暂时降级@Unocss到0.58.9版本 更高版本报错无法运行 + # 1.3.0 合并最新vben依赖 diff --git a/README.md b/README.md index 16cf94eb4f23bb03cfcbd68f61a486488fb1347a..2cdc0058b28b2cdb3ec3cc395292a217e42f0a18 100644 --- a/README.md +++ b/README.md @@ -33,9 +33,9 @@ admin 账号: admin admin123 [预览地址点这里](http://117.72.10.31) -## 微信群 +## WX Group - +广告佬g远点, 正常人从演示站加 ## 文档 diff --git a/internal/vite-config/package.json b/internal/vite-config/package.json index 6d20f8d80f5dcdcd66a8bbaa2b14e6341a24b2f7..5dcc5db4a240f2c598c8c1b608c2f75f84738a5f 100644 --- a/internal/vite-config/package.json +++ b/internal/vite-config/package.json @@ -48,7 +48,7 @@ "pkg-types": "^1.1.0", "rollup-plugin-visualizer": "^5.12.0", "sass": "^1.75.0", - "unocss": "0.59.4", + "unocss": "0.58.9", "vite-plugin-compression": "^0.5.1", "vite-plugin-dts": "^3.9.0", "vite-plugin-html": "^3.2.2", diff --git a/package.json b/package.json index 419933d5a76cfe6d755f36496b6e4a7691ff0173..1c17e67dbef0168e605381775ea99871e9445b0f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ruoyi-plus-vben", - "version": "1.3.0", + "version": "1.3.1-beta", "homepage": "https://gitee.com/dapppp/ruoyi-plus-vben.git", "bugs": { "url": "https://gitee.com/dapppp/ruoyi-plus-vben/issues" @@ -104,6 +104,7 @@ "sortablejs": "^1.15.2", "tiny-svg": "^4.0.0", "tinymce": "^5.10.9", + "unocss": "~0.58.9", "vditor": "^3.10.4", "vue": "^3.4.25", "vue-i18n": "^9.13.1", @@ -149,7 +150,6 @@ "turbo": "^1.13.2", "typescript": "^5.4.5", "unbuild": "^2.0.0", - "unocss": "~0.59.4", "vite": "^5.2.10", "vite-plugin-vue-devtools": "^7.2.0", "vue-tsc": "^2.0.14" diff --git a/src/App.vue b/src/App.vue index bbe54f90477166fe2616aa298f61a59cbb7e07fc..eb23df9e3eb16ee3f77c40c82644cf704248d843 100644 --- a/src/App.vue +++ b/src/App.vue @@ -14,22 +14,26 @@ import { useDarkModeTheme } from '@/hooks/setting/useDarkModeTheme'; import 'dayjs/locale/zh-cn'; - import { computed } from 'vue'; + import { computed, toValue } from 'vue'; + import { useThemeStore } from './store/modules/theme'; + import { storeToRefs } from 'pinia'; // support Multi-language const { getAntdLocale } = useLocale(); const { isDark, darkTheme } = useDarkModeTheme(); + const themeStore = useThemeStore(); + const { primaryColor } = storeToRefs(themeStore); const themeConfig = computed(() => Object.assign( { token: { - colorPrimary: '#1677FF', + colorPrimary: toValue(primaryColor), colorSuccess: '#55D187', colorWarning: '#EFBD47', colorError: '#ED6F6F', - colorInfo: '#1677FF', + colorInfo: toValue(primaryColor), }, }, isDark.value ? darkTheme : {}, diff --git a/src/api/workflow/processInstance/index.ts b/src/api/workflow/processInstance/index.ts index 4fcdf6a5c79077139c4421c5de932efeb7f0e86c..c34d846d3eca43b1185d897162bff68d4c73d3bd 100644 --- a/src/api/workflow/processInstance/index.ts +++ b/src/api/workflow/processInstance/index.ts @@ -28,18 +28,18 @@ export function getPageByFinish(params?: PageQuery) { } // 通过流程实例id获取历史流程图 -export function getHistoryImage(processInstanceId: string) { - return defHttp.get({ url: Api.getHistoryImage + '/' + processInstanceId }); +export function getHistoryImage(businessKey: string) { + return defHttp.get({ url: Api.getHistoryImage + '/' + businessKey }); } // 通过流程实例id获取历史流程图运行中,历史等节点 -export function getHistoryList(processInstanceId: string) { - return defHttp.get({ url: Api.getHistoryList + '/' + processInstanceId }); +export function getHistoryList(businessKey: string) { + return defHttp.get({ url: Api.getHistoryList + '/' + businessKey }); } // 获取审批记录 -export function getHistoryRecord(processInstanceId: string) { - return defHttp.get({ url: Api.getHistoryRecord + '/' + processInstanceId }); +export function getHistoryRecord(businessKey: string) { + return defHttp.get({ url: Api.getHistoryRecord + '/' + businessKey }); } // 作废流程实例,不会删除历史记录(删除运行中的实例) @@ -48,22 +48,22 @@ export function deleteRunInstance(data: CancelProcessInstanceReq) { } // 运行中的实例 删除程实例,删除历史记录,删除业务与流程关联信息 -export function deleteRunAndHisInstance(processInstanceIds: string[]) { +export function deleteRunAndHisInstance(businessKeys: string[]) { return defHttp.deleteWithMsg({ - url: `${Api.deleteRunAndHisInstance}/${processInstanceIds.join(',')}`, + url: `${Api.deleteRunAndHisInstance}/${businessKeys.join(',')}`, }); } // 已完成的实例 删除程实例,删除历史记录,删除业务与流程关联信息 -export function deleteFinishAndHisInstance(processInstanceIds: string[]) { +export function deleteFinishAndHisInstance(businessKeys: string[]) { return defHttp.deleteWithMsg({ - url: `${Api.deleteFinishAndHisInstance}/${processInstanceIds.join(',')}`, + url: `${Api.deleteFinishAndHisInstance}/${businessKeys.join(',')}`, }); } // 撤销流程申请 -export function cancelProcessApply(processInstanceId: string) { - return defHttp.postWithMsg({ url: Api.cancelProcessApply + '/' + processInstanceId }); +export function cancelProcessApply(businessKey: string) { + return defHttp.postWithMsg({ url: Api.cancelProcessApply + '/' + businessKey }); } // 分页查询当前登录人单据 diff --git a/src/components/BpmnViewer/src/index.less b/src/components/BpmnViewer/src/index.less index 8568125d939b2cd2b2e2ca561c67630c8460e1de..e3ca571e159bfdb0daf927a5fc023c542c87743e 100644 --- a/src/components/BpmnViewer/src/index.less +++ b/src/components/BpmnViewer/src/index.less @@ -20,6 +20,7 @@ background-image: linear-gradient(90deg, hsl(0deg 0% 78.4% / 15%) 10%, transparent 0), linear-gradient(hsl(0deg 0% 78.4% / 15%) 10%, transparent 0); background-size: 15px 15px; + cursor: grab; } .bpmn-viewer { diff --git a/src/components/BpmnViewer/src/index.vue b/src/components/BpmnViewer/src/index.vue index 96f5002ee0fe91cecb56268a777c4a7a86e520d8..027a75fc2cb8f095f8c5837e3403c886f59fdbb5 100644 --- a/src/components/BpmnViewer/src/index.vue +++ b/src/components/BpmnViewer/src/index.vue @@ -1,7 +1,7 @@ +
+ 自定义颜色: + +
diff --git a/src/layouts/default/setting/handler.ts b/src/layouts/default/setting/handler.ts index 8028cb2c7a0dafe7dca501a20f9ee6f56301fb1a..e6763a9b1e829352b611fc4894b006f6adbedcb9 100644 --- a/src/layouts/default/setting/handler.ts +++ b/src/layouts/default/setting/handler.ts @@ -9,6 +9,7 @@ import { ProjectConfig } from '#/config'; import { updateDarkTheme } from '@/logics/theme/dark'; import { useRootSetting } from '@/hooks/setting/useRootSetting'; import projectSetting from '@/settings/projectSetting'; +import { useThemeStore } from '@/store/modules/theme'; export function baseHandler(event: HandlerEnum, value: any) { const appStore = useAppStore(); @@ -22,6 +23,7 @@ export function baseHandler(event: HandlerEnum, value: any) { export function handler(event: HandlerEnum, value: any): DeepPartial { const appStore = useAppStore(); + const themeStore = useThemeStore(); const { getThemeColor, getDarkMode } = useRootSetting(); const { menuSetting } = projectSetting; @@ -49,7 +51,8 @@ export function handler(event: HandlerEnum, value: any): DeepPartial import('@/components/SimpleMenu/src/SimpleMenuTag.vue'), ); @@ -313,6 +315,8 @@ openMenu.value = false; } } + + const { token } = theme.useToken(); diff --git a/src/layouts/local/about/index.vue b/src/layouts/local/about/index.vue index c9347698f0f4384f0d78b46ec3311fdbef3b72b9..ab71f0fe2ee6c4297447e23dd6e9a001291e2b87 100644 --- a/src/layouts/local/about/index.vue +++ b/src/layouts/local/about/index.vue @@ -35,12 +35,12 @@ { label: '版本', field: 'version', - render: commonTagRender('blue'), + render: commonTagRender('processing'), }, { label: '最后编译时间', field: 'lastBuildTime', - render: commonTagRender('blue'), + render: commonTagRender('processing'), }, { label: '文档地址', @@ -79,20 +79,20 @@ title: '生产环境依赖', data: dependencies, schema: schema, - column: 3, + column: { xs: 1, sm: 1, md: 2, lg: 3 }, }); const [registerDev] = useDescription({ title: '开发环境依赖', data: devDependencies, schema: devSchema, - column: 3, + column: { xs: 1, sm: 1, md: 2, lg: 3 }, }); const [infoRegister] = useDescription({ title: '项目信息', data: infoData, schema: infoSchema, - column: 2, + column: { xs: 1, sm: 1, md: 1, lg: 2 }, }); diff --git a/src/router/routes/modules/local.ts b/src/router/routes/modules/local.ts index 60378092089dcdd7b157864dc7e06f4943aeae17..2d18515da71bf49b09e84faa22be965ec7854142 100644 --- a/src/router/routes/modules/local.ts +++ b/src/router/routes/modules/local.ts @@ -36,14 +36,14 @@ export const localRoutes: AppRouteModule[] = [ }, { component: LAYOUT, - path: '/demo/leaveEdit', - name: 'DemoLeave', + path: '/workflow/leaveEdit', + name: 'WorkflowLeave', meta: { title: '请假信息' }, children: [ { path: 'index', component: () => import('@/views/workflow/leave/LeaveFormTest.vue'), - name: 'DemoLeaveIndex', + name: 'WorkflowLeaveIndex', meta: { hidden: true, title: '请假信息', @@ -132,26 +132,6 @@ export const localRoutes: AppRouteModule[] = [ }, ], }, - { - component: LAYOUT, - path: '/workflow/records', - name: 'WorkflowRecord', - redirect: '/:id', - meta: { - hideMenu: true, - title: '审批记录', - }, - children: [ - { - path: ':id', - name: 'WorkflowRecordPage', - component: () => import('@/views/workflow/redirect/records/index.vue'), - meta: { - title: '审批记录', - }, - }, - ], - }, { component: LAYOUT, path: '/workflow/definition/history', @@ -165,7 +145,7 @@ export const localRoutes: AppRouteModule[] = [ { path: ':key', name: 'WorkflowDefinitionHistoryPage', - component: () => import('@/views/workflow/redirect/history/index.vue'), + component: () => import('@/views/workflow/processDefinition/history/index.vue'), meta: { title: '历史记录', currentActiveMenu: '/workflow/processDefinition', @@ -176,7 +156,7 @@ export const localRoutes: AppRouteModule[] = [ { component: LAYOUT, path: '/workflow/design', - name: 'WorkflowDesign', + name: 'BpmnDesign', redirect: '/:id', meta: { hideMenu: true, @@ -185,8 +165,8 @@ export const localRoutes: AppRouteModule[] = [ children: [ { path: ':id', - name: 'WorkflowDesignPage', - component: () => import('@/views/workflow/redirect/design/index.vue'), + name: 'BpmnDesignPage', + component: () => import('@/views/workflow/components/BpmnDesign/index.vue'), meta: { title: '流程设计', currentActiveMenu: '/workflow/model', diff --git a/src/settings/designSetting.ts b/src/settings/designSetting.ts index ede11d446ee3cc67e371315434f067a4a650db79..46ed581e5dacbbed9d4f235b90d71e552c529549 100644 --- a/src/settings/designSetting.ts +++ b/src/settings/designSetting.ts @@ -15,8 +15,8 @@ export const layoutMultipleHeadePlaceholderTime = 0.6; // app theme preset color export const APP_PRESET_COLOR_LIST: string[] = [ + '#1677ff', '#0960bd', - '#0084f4', '#009688', '#536dfe', '#ff5c93', diff --git a/src/store/modules/theme.ts b/src/store/modules/theme.ts new file mode 100644 index 0000000000000000000000000000000000000000..cd0aa63ba7ef2ff82f6e9e985681402214663724 --- /dev/null +++ b/src/store/modules/theme.ts @@ -0,0 +1,22 @@ +import { defineStore } from 'pinia'; +import { ref } from 'vue'; + +export const useThemeStore = defineStore( + 'app-theme', + () => { + const primaryColor = ref('#1677ff'); + + function setPrimaryColor(color: string) { + if (color === primaryColor.value) { + return; + } + primaryColor.value = color; + } + + return { + primaryColor, + setPrimaryColor, + }; + }, + { persist: true }, +); diff --git a/src/views/demo/subform/SubFormTest.vue b/src/views/demo/subform/SubFormTest.vue index 8a24cec54e4d92562163054cc4a4948e2836347d..14346efc7192510c3adfc0c5b7fd6661c16b358b 100644 --- a/src/views/demo/subform/SubFormTest.vue +++ b/src/views/demo/subform/SubFormTest.vue @@ -45,8 +45,8 @@ /> -
- +
+
(); @@ -109,7 +109,7 @@ await setProps({ disabled: type === 'preview' || type === 'approval' }); /** 赋值 */ const data = await purchaseInfo(id); - previewInstanceId.value = data.processInstanceVo.id; + previewBusinessKey.value = data.id as string; await setFieldsValue(omit(data, 'subForm')); data.subForm = JSON.parse(data.subForm); diff --git a/src/views/demo/subform/index.vue b/src/views/demo/subform/index.vue index ad6ef8c900c256dba273d78a0ae0074a29582cc4..e4272fa4013fce2bfd85951c96303785e6ec62f0 100644 --- a/src/views/demo/subform/index.vue +++ b/src/views/demo/subform/index.vue @@ -29,26 +29,24 @@ auth: 'demo:leave:edit', onClick: handleEdit.bind(null, record), ifShow: - record.processInstanceVo.businessStatus !== 'invalid' && - record.processInstanceVo.businessStatus !== 'finish' && - record.processInstanceVo.businessStatus !== 'waiting' && - record.processInstanceVo.businessStatus !== 'termination', + record.status !== 'invalid' && + record.status !== 'finish' && + record.status !== 'waiting' && + record.status !== 'termination', }, { label: '记录', icon: IconEnum.PREVIEW, auth: 'demo:leave:list', onClick: handleToApproveRecord.bind(null, record), - ifShow: - record.processInstanceVo.businessStatus !== 'draft' && - record.processInstanceVo.businessStatus !== 'cancel', + ifShow: record.status !== 'draft' && record.status !== 'cancel', }, { label: '撤销', icon: IconEnum.EDIT, danger: true, auth: 'demo:leave:edit', - ifShow: record.processInstanceVo.businessStatus === 'waiting', + ifShow: record.status === 'waiting', popConfirm: { placement: 'left', title: `是否撤销当前申请?`, @@ -61,10 +59,10 @@ danger: true, auth: 'demo:leave:remove', ifShow: - record.processInstanceVo.businessStatus !== 'invalid' && - record.processInstanceVo.businessStatus !== 'finish' && - record.processInstanceVo.businessStatus !== 'waiting' && - record.processInstanceVo.businessStatus !== 'termination', + record.status !== 'invalid' && + record.status !== 'finish' && + record.status !== 'waiting' && + record.status !== 'termination', popConfirm: { placement: 'left', title: `是否删除请假[${record.id}]?`, @@ -95,6 +93,14 @@ const [registerTable, { reload, multipleRemove, selected }] = useTable({ rowSelection: { type: 'checkbox', + getCheckboxProps: (record: Recordable) => ({ + // 撤销/草稿 可删除 + disabled: + record.status === 'invalid' || + record.status === 'finish' || + record.status === 'waiting' || + record.status === 'termination', + }), }, title: '采购申请列表', api: purchaseList, @@ -142,7 +148,7 @@ // 撤销 async function handleRevoke(record: Recordable) { - await cancelProcessApply(record.processInstanceVo.id); + await cancelProcessApply(record.id); await reload(); } diff --git a/src/views/demo/subform/purchase.data.tsx b/src/views/demo/subform/purchase.data.tsx index 406a62b0e92e7c62e03f94504cb5620606a6c593..c312dd24158a5ded57d80905f546c6907442262a 100644 --- a/src/views/demo/subform/purchase.data.tsx +++ b/src/views/demo/subform/purchase.data.tsx @@ -3,7 +3,8 @@ import { FormSchema } from '@/components/Form'; import { VxeGridPropTypes, VxeTablePropTypes } from 'vxe-table'; import { Input, InputNumber } from 'ant-design-vue'; import { useRender } from '@/hooks/component/useRender'; -import { businessStatusOptions } from '@/views/workflow/common'; +// import { businessStatusOptions } from '@/views/workflow/common'; +import { DictEnum } from '@/enums/dictEnum'; export const formSchemas: FormSchema[] = [ { @@ -13,7 +14,7 @@ export const formSchemas: FormSchema[] = [ }, ]; -const { renderTag } = useRender(); +const { renderDict } = useRender(); export const columns: BasicColumn[] = [ { title: '主键', @@ -29,15 +30,9 @@ export const columns: BasicColumn[] = [ }, { title: '流程状态', - dataIndex: 'processInstanceVo', - customRender({ record }) { - const { processInstanceVo = '' } = record; - const label = processInstanceVo.businessStatusName; - const found = businessStatusOptions.find((item) => item.label === label); - if (found) { - return renderTag(label, found.color); - } - return renderTag(label); + dataIndex: 'status', + customRender({ value }) { + return renderDict(value, DictEnum.WF_BUSINESS_STATUS); }, }, ]; diff --git a/src/views/system/role/role.data.ts b/src/views/system/role/role.data.ts index 15b8030c52ee88ad7091cb2160895ec406d1d5d4..eece1e9376b5ea3396ed6c4d513e0a167e929dde 100644 --- a/src/views/system/role/role.data.ts +++ b/src/views/system/role/role.data.ts @@ -179,6 +179,7 @@ export const authSchemas: FormSchema[] = [ componentProps: { allowClear: false, options: authScopeOptions, + getPopupContainer: (triggerNode) => triggerNode.parentNode, }, }, { diff --git a/src/views/workflow/redirect/design/index.vue b/src/views/workflow/components/BpmnDesign/index.vue similarity index 97% rename from src/views/workflow/redirect/design/index.vue rename to src/views/workflow/components/BpmnDesign/index.vue index cfa24ba892574d0060e9865307e7851e9a8389ce..ef55813b1c40d966d421bd9ae6911e832945c979 100644 --- a/src/views/workflow/redirect/design/index.vue +++ b/src/views/workflow/components/BpmnDesign/index.vue @@ -20,7 +20,7 @@ import { useTabs } from '@/hooks/web/useTabs'; import { Space } from 'ant-design-vue'; - defineOptions({ name: 'WorkflowDesignPage' }); + defineOptions({ name: 'BpmnDesignPage' }); /** 拿到路由的id */ const route = useRoute(); diff --git a/src/views/workflow/components/WorkFlowPreview/index.vue b/src/views/workflow/components/WorkFlowPreview/index.vue index 6c85cb51ae46323eacad770d38c2ba25222b2780..03c6538669172652705db19b52a0300a19af9f30 100644 --- a/src/views/workflow/components/WorkFlowPreview/index.vue +++ b/src/views/workflow/components/WorkFlowPreview/index.vue @@ -1,5 +1,5 @@ @@ -68,7 +68,8 @@ import { CollapseContainer } from '@/components/Container'; const props = defineProps({ - instanceId: { + /** 表的id */ + businessKey: { type: String, required: true, }, @@ -79,7 +80,7 @@ /** 时间轴data */ const historyRecordList = ref([]); onMounted(async () => { - const list = await getHistoryRecord(props.instanceId); + const list = await getHistoryRecord(props.businessKey); historyRecordList.value = list; loading.value = false; diff --git a/src/views/workflow/leave/LeaveFormTest.vue b/src/views/workflow/leave/LeaveFormTest.vue index 4a395c94fc8ad03dc2ec85c7312dda05e027c0b5..26a2262f327f84c1495a4c5e2626f6254f5cc121 100644 --- a/src/views/workflow/leave/LeaveFormTest.vue +++ b/src/views/workflow/leave/LeaveFormTest.vue @@ -34,8 +34,8 @@ /> -
- +
+
(); const loading = ref(false); @@ -94,7 +94,7 @@ if (type === 'preview' || type === 'update' || type === 'approval') { await setProps({ disabled: type === 'preview' || type === 'approval' }); const ret = await getInfo(id); - previewInstanceId.value = ret.processInstanceVo.id; + previewBusinessKey.value = ret.id; /** 预览 */ previewData.value = ret; /** diff --git a/src/views/workflow/leave/api.ts b/src/views/workflow/leave/api.ts index bd10cb2914eb57b7dc54e874c43484dd251f1028..1aa1a0a0e0d3d3a39a9d7817297d1f8a854cc0eb 100644 --- a/src/views/workflow/leave/api.ts +++ b/src/views/workflow/leave/api.ts @@ -3,9 +3,9 @@ import { defHttp } from '@/utils/http/axios'; import { Dayjs } from 'dayjs'; enum Api { - root = '/demo/leave', - list = '/demo/leave/list', - export = '/demo/leave/export', + root = '/workflow/leave', + list = '/workflow/leave/list', + export = '/workflow/leave/export', } export interface Leave { diff --git a/src/views/workflow/leave/index.vue b/src/views/workflow/leave/index.vue index 0274541ab376eebe7d0e8f9596681761d057b088..e06b7c5849135151a0a180e10fae1a759f243c9f 100644 --- a/src/views/workflow/leave/index.vue +++ b/src/views/workflow/leave/index.vue @@ -5,7 +5,7 @@ 导出 删除 - 新增 + 新增