Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
02fa679
feat:菜单列表改为虚拟化树形控件实现
Jason0z Dec 24, 2024
d815c60
feat: add hiddenSearch function to manage search visibility in Router…
AhJindeg Dec 26, 2024
74b62bf
【功能完善】文件列表: 添加复制链接功能
jinmh716 Dec 28, 2024
b932646
update src/components/Echart/src/Echart.vue.
luzhoulu Dec 28, 2024
2436075
修复菜单显示 Please set titile 的问题
moon6967 Jan 2, 2025
7faea8c
修复菜单总是显示无效的问题
moon6967 Jan 2, 2025
739e43a
升级 element-plus,修复 el-table-v2 滚动条 bug
moon6967 Jan 2, 2025
700efd7
feat: ✨ add current year calculation to footer component
AhJindeg Jan 3, 2025
39486d6
!644 feat: ✨ add current year calculation to footer component
YunaiV Jan 4, 2025
166e952
!634 修复菜单显示 Please set titile 的问题
YunaiV Jan 4, 2025
69f7670
!637 升级 element-plus,修复 el-table-v2 滚动条 bug
YunaiV Jan 4, 2025
5fce1af
!636 修复菜单总是显示无效的问题
YunaiV Jan 4, 2025
6b6d2ff
!632 update src/components/Echart/src/Echart.vue.
YunaiV Jan 4, 2025
e508da7
632 【轻量级 PR】:update src/components/Echart/src/Echart.vue.
YunaiV Jan 4, 2025
7b7ce96
!631 【功能完善】文件列表: 添加复制链接功能
YunaiV Jan 4, 2025
452d602
【功能完善】文件列表: 添加复制链接功能
YunaiV Jan 4, 2025
48e7e7e
!629 feat: add hiddenSearch function to manage search visibility in R…
YunaiV Jan 4, 2025
101ed36
Merge branch 'dev' of https://gitee.com/yudaocode/yudao-ui-admin-vue3
YunaiV Jan 4, 2025
ea133da
!627 菜单管理使用虚拟化树形控件实现
YunaiV Jan 4, 2025
ce60f63
【功能优化】菜单管理:使用 el-table-v2 解决菜单过多后,存在卡顿的问题
YunaiV Jan 4, 2025
09da657
【功能移除】菜单管理:全部展开/关闭,没有使用场景,所以清理掉
YunaiV Jan 4, 2025
791d590
【功能优化】菜单管理:调整宽度,避免过窄
YunaiV Jan 4, 2025
65924bb
!617 feat: 支持通过短信重置后台密码
YYQHoro Jan 4, 2025
2a9290c
【代码优化】支持通过短信重置后台密码
YunaiV Jan 4, 2025
49fc9b5
Merge branch 'feature/bpm' of https://gitee.com/yudaocode/yudao-ui-ad…
YunaiV Jan 4, 2025
63c9b8d
🐞 fix:修复 npm 流程模拟插件 bpmn-js-token-simulation
halfpreschooler Jan 5, 2025
e995092
!647 【修复】修复 npm 流程模拟插件 bpmn-js-token-simulation
YunaiV Jan 5, 2025
3d8f129
perf: bpm 流程模型表单代码优化. 去掉大量watch 代码. 用依赖注入替换props 传递流程数据. 增加导入导出
zws-code Jan 14, 2025
99fe894
Merge remote-tracking branch 'refs/remotes/git-origin/master' into ma…
zws-code Jan 14, 2025
4fe158b
perf: bpm 修复bpmn设计器不显示问题
zws-code Jan 14, 2025
e76eda8
fix: 修复组件在keepAlive下刷新不触发onActivated钩子问题
zws-code Jan 15, 2025
8df285a
fix: bpm 用onActivated替换onMounted
zws-code Jan 15, 2025
b117431
feat: bpm 添加流程模型复制功能
zws-code Jan 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"animate.css": "^4.1.1",
"axios": "^1.6.8",
"benz-amr-recorder": "^1.1.5",
"bpmn-js-token-simulation": "^0.10.0",
"bpmn-js-token-simulation": "^0.36.0",
"camunda-bpmn-moddle": "^7.0.1",
"cropperjs": "^1.6.1",
"crypto-js": "^4.2.0",
Expand All @@ -47,7 +47,7 @@
"driver.js": "^1.3.1",
"echarts": "^5.5.0",
"echarts-wordcloud": "^2.1.0",
"element-plus": "2.8.4",
"element-plus": "2.9.1",
"fast-xml-parser": "^4.3.2",
"highlight.js": "^11.9.0",
"jsencrypt": "^3.3.2",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions src/api/login/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ export const register = (data: RegisterVO) => {
return request.post({ url: '/system/auth/register', data })
}

// 刷新访问令牌
export const refreshToken = () => {
return request.post({ url: '/system/auth/refresh-token?refreshToken=' + getRefreshToken() })
}

// 使用租户名,获得租户编号
export const getTenantIdByName = (name: string) => {
return request.get({ url: '/system/tenant/get-id-by-name?name=' + name })
Expand Down Expand Up @@ -76,12 +71,17 @@ export const socialAuthRedirect = (type: number, redirectUri: string) => {
})
}
// 获取验证图片以及 token
export const getCode = (data) => {
export const getCode = (data: any) => {
debugger
return request.postOriginal({ url: 'system/captcha/get', data })
}

// 滑动或者点选验证
export const reqCheck = (data) => {
export const reqCheck = (data: any) => {
return request.postOriginal({ url: 'system/captcha/check', data })
}

// 通过短信重置密码
export const smsResetPassword = (data: any) => {
return request.post({ url: '/system/auth/sms-reset-password', data })
}
4 changes: 4 additions & 0 deletions src/components/Echart/src/Echart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import { useAppStore } from '@/store/modules/app'
import { isString } from '@/utils/is'
import { useDesign } from '@/hooks/web/useDesign'

import 'echarts/lib/component/markPoint'
import 'echarts/lib/component/markLine'
import 'echarts/lib/component/markArea'

defineOptions({ name: 'EChart' })

const { getPrefixCls, variables } = useDesign()
Expand Down
5 changes: 5 additions & 0 deletions src/components/RouterSearch/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,14 @@ function remoteMethod(data) {
function handleChange(path) {
router.push({ path })
hiddenSearch()
hiddenTopSearch()
}
function hiddenSearch() {
showSearch.value = false
}
function hiddenTopSearch() {
showTopSearch.value = false
}
Expand Down
118 changes: 9 additions & 109 deletions src/components/SimpleProcessDesignerV2/src/SimpleProcessDesigner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ defineOptions({
name: 'SimpleProcessDesigner'
})

const emits = defineEmits(['success', 'init-finished']) // 保存成功事件
const emits = defineEmits(['success']) // 保存成功事件

const props = defineProps({
modelId: {
Expand All @@ -59,13 +59,12 @@ const props = defineProps({
startUserIds : {
type: Array,
required: false
},
value: {
type: [String, Object],
required: false
}
})

const processData = inject('processData') as Ref


const loading = ref(false)
const formFields = ref<string[]>([])
const formType = ref(20)
Expand All @@ -76,9 +75,6 @@ const deptOptions = ref<DeptApi.DeptVO[]>([]) // 部门列表
const deptTreeOptions = ref()
const userGroupOptions = ref<UserGroupApi.UserGroupVO[]>([]) // 用户组列表

// 添加当前值的引用
const currentValue = ref<SimpleFlowNode | undefined>()

provide('formFields', formFields)
provide('formType', formType)
provide('roleList', roleOptions)
Expand All @@ -88,7 +84,8 @@ provide('deptList', deptOptions)
provide('userGroupList', userGroupOptions)
provide('deptTree', deptTreeOptions)
provide('startUserIds', props.startUserIds)

provide('tasks', [])
provide('processInstance', {})
const message = useMessage() // 国际化
const processNodeTree = ref<SimpleFlowNode | undefined>()
const errorDialogVisible = ref(false)
Expand All @@ -112,70 +109,14 @@ const updateModel = () => {
}
}

// 加载流程数据
const loadProcessData = async (data: any) => {
try {
if (data) {
const parsedData = typeof data === 'string' ? JSON.parse(data) : data
processNodeTree.value = parsedData
currentValue.value = parsedData
// 确保数据加载后刷新视图
await nextTick()
if (simpleProcessModelRef.value?.refresh) {
await simpleProcessModelRef.value.refresh()
}
}
} catch (error) {
console.error('加载流程数据失败:', error)
}
}

// 监听属性变化
watch(
() => props.value,
async (newValue, oldValue) => {
if (newValue && newValue !== oldValue) {
await loadProcessData(newValue)
}
},
{ immediate: true, deep: true }
)

// 监听流程节点树变化,自动保存
watch(
() => processNodeTree.value,
async (newValue, oldValue) => {
if (newValue && oldValue && JSON.stringify(newValue) !== JSON.stringify(oldValue)) {
await saveSimpleFlowModel(newValue)
}
},
{ deep: true }
)

const saveSimpleFlowModel = async (simpleModelNode: SimpleFlowNode) => {
if (!simpleModelNode) {
return
}

// 校验节点
errorNodes = []
validateNode(simpleModelNode, errorNodes)
if (errorNodes.length > 0) {
errorDialogVisible.value = true
return
}

try {
if (props.modelId) {
// 编辑模式
const data = {
id: props.modelId,
simpleModel: simpleModelNode
}
await updateBpmSimpleModel(data)
}
// 无论是编辑还是新建模式,都更新当前值并触发事件
currentValue.value = simpleModelNode
processData.value = simpleModelNode
emits('success', simpleModelNode)
} catch (error) {
console.error('保存失败:', error)
Expand Down Expand Up @@ -246,61 +187,20 @@ onMounted(async () => {
deptTreeOptions.value = handleTree(deptOptions.value as DeptApi.DeptVO[], 'id')
// 获取用户组列表
userGroupOptions.value = await UserGroupApi.getUserGroupSimpleList()

// 加载流程数据
if (props.modelId) {
// 获取 SIMPLE 设计器模型
const result = await getBpmSimpleModel(props.modelId)
if (result) {
await loadProcessData(result)
} else {
updateModel()
}
} else if (props.value) {
await loadProcessData(props.value)
if (processData.value) {
processNodeTree.value = processData?.value
} else {
updateModel()
}
} finally {
loading.value = false
emits('init-finished')
}
})

const simpleProcessModelRef = ref()

/** 获取当前流程数据 */
const getCurrentFlowData = async () => {
try {
if (simpleProcessModelRef.value) {
const data = await simpleProcessModelRef.value.getCurrentFlowData()
if (data) {
currentValue.value = data
return data
}
}
return currentValue.value
} catch (error) {
console.error('获取流程数据失败:', error)
return currentValue.value
}
}

// 刷新方法
const refresh = async () => {
try {
if (currentValue.value) {
await loadProcessData(currentValue.value)
}
} catch (error) {
console.error('刷新失败:', error)
}
}

defineExpose({
getCurrentFlowData,
updateModel,
loadProcessData,
refresh
})
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,31 @@
<div class="position-absolute top-0px right-0px bg-#fff">
<el-row type="flex" justify="end">
<el-button-group key="scale-control" size="default">
<el-button size="default" @click="exportJson()"><Icon icon="ep:download" />导出</el-button>
<el-button size="default" @click="importJson()"><Icon icon="ep:upload" />导入</el-button>
<!-- 用于打开本地文件-->
<input
type="file"
id="files"
ref="refFile"
style="display: none"
accept=".json"
@change="importLocalFile"
/>
<el-button size="default" :icon="ScaleToOriginal" @click="processReZoom()" />
<el-button size="default" :plain="true" :icon="ZoomOut" @click="zoomOut()" />
<el-button size="default" class="w-80px"> {{ scaleValue }}% </el-button>
<el-button size="default" :plain="true" :icon="ZoomIn" @click="zoomIn()" />
</el-button-group>
<!-- <el-button-->
<!-- v-if="!readonly"-->
<!-- size="default"-->
<!-- class="ml-4px"-->
<!-- type="primary"-->
<!-- :icon="Select"-->
<!-- @click="saveSimpleFlowModel"-->
<!-- >保存模型</el-button-->
<!-- >-->
</el-row>
</div>
<div class="simple-process-model" :style="`transform: scale(${scaleValue / 100});`">
Expand All @@ -33,7 +53,8 @@
import ProcessNodeTree from './ProcessNodeTree.vue'
import { SimpleFlowNode, NodeType, NODE_DEFAULT_TEXT } from './consts'
import { useWatchNode } from './node'
import { ZoomOut, ZoomIn, ScaleToOriginal } from '@element-plus/icons-vue'
import { ZoomOut, ZoomIn, ScaleToOriginal, Select } from '@element-plus/icons-vue'
import { isString } from '@/utils/is'

defineOptions({
name: 'SimpleProcessModel'
Expand Down Expand Up @@ -85,6 +106,16 @@ const processReZoom = () => {
const errorDialogVisible = ref(false)
let errorNodes: SimpleFlowNode[] = []

const saveSimpleFlowModel = async () => {
errorNodes = []
validateNode(processNodeTree.value, errorNodes)
if (errorNodes.length > 0) {
errorDialogVisible.value = true
return
}
emits('save', processNodeTree.value)
}

// 校验节点设置。 暂时以 showText 为空 未节点错误配置
const validateNode = (node: SimpleFlowNode | undefined, errorNodes: SimpleFlowNode[]) => {
if (node) {
Expand Down Expand Up @@ -143,6 +174,36 @@ const getCurrentFlowData = async () => {
defineExpose({
getCurrentFlowData
})

const exportJson = () => {
const blob = new Blob([JSON.stringify(processNodeTree.value)]);
const tempLink = document.createElement('a'); // 创建a标签
const href = window.URL.createObjectURL(blob); // 创建下载的链接
//filename
const fileName = `model.json`;
tempLink.href = href;
tempLink.target = '_blank';
tempLink.download = fileName;
document.body.appendChild(tempLink);
tempLink.click(); // 点击下载
document.body.removeChild(tempLink); // 下载完成移除元素
window.URL.revokeObjectURL(href); // 释放掉blob对象
}
const importJson = () => {
refFile.value.click()
}
const refFile = ref()
// 加载本地文件
const importLocalFile = () => {
const file = refFile.value.files[0]
const reader = new FileReader()
reader.readAsText(file)
reader.onload = function () {
if (isString(this.result)) {
processNodeTree.value = JSON.parse(this.result)
}
}
}
</script>

<style lang="scss" scoped></style>
Loading