Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
vue-flow-editor
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2023-11-29 14:01:41 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
7e4a850ab43891998a343e8bd277ce24d86b671d
7e4a850a
1 parent
eef11d37
fix 细节调整
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
32 deletions
doc/App.vue
doc/App.vue
View file @
7e4a850
...
...
@@ -319,7 +319,7 @@
<div style="position: absolute; top:20px; right: 15px;">
<el-dropdown trigger="click">
<div style="margin-left: 15px;">
<div v-if="state.flow_version === state.current_
version_code
" style="width: 10px; height: 10px; background-color: #009688; border-radius: 50%; display: inline-block; margin-right: 8px;"></div>
<div v-if="state.flow_version === state.current_
enable_version
" style="width: 10px; height: 10px; background-color: #009688; border-radius: 50%; display: inline-block; margin-right: 8px;"></div>
<div v-else style="width: 10px; height: 10px; background-color: #f0a800; border-radius: 50%; display: inline-block; margin-right: 8px;"></div>
<span style="font-size: 13px;">流程版本 (V{{ state.flow_version }})</span>
</div>
...
...
@@ -329,7 +329,7 @@
<i v-if="item.code === state.flow_version" class="el-icon-check" style="color: #009688; margin-right: 8px;"></i>
<div v-else style="width: 15px; height: 15px;display: inline-block; margin-right: 8px;"></div>
<span>流程版本 (V{{ item.code }})</span>
<span v-if="item.code === state.current_
version_code
" style="background: #edf9f1; border-color: #46c26f; color: #46c26f;font-size: 10px; padding: 0 5px; border-radius: 3px; margin-left: 8px;">启用中</span>
<span v-if="item.code === state.current_
enable_version
" style="background: #edf9f1; border-color: #46c26f; color: #46c26f;font-size: 10px; padding: 0 5px; border-radius: 3px; margin-left: 8px;">启用中</span>
<!-- <span @click="showEditFlowVersion(item.id, item.code, item.note)" style="margin-left: 10px;">
<i class="el-icon-edit-outline"></i>
</span> -->
...
...
@@ -358,7 +358,7 @@
<template #footer>
<span class="dialog-footer">
<el-popconfirm
v-if="state.current_
version_code
!== state.versionForm.code"
v-if="state.current_
enable_version
!== state.versionForm.code"
title="是否确认启用该版本流程?"
width="220px"
confirm-button-text="确认"
...
...
@@ -369,7 +369,7 @@
</template>
</el-popconfirm>
<el-popconfirm
v-if="state.current_
version_code
!== state.versionForm.code"
v-if="state.current_
enable_version
!== state.versionForm.code"
title="是否确认删除该版本流程?"
width="220px"
confirm-button-text="确认"
...
...
@@ -571,7 +571,7 @@ export default {
auth_all_edit: false,
field_auths: [],
field_extend: [],
current_
version_code
: 0,
current_
enable_version
: 0,
flow_version: 0,
flow_version_list: [],
version_list: [],
...
...
@@ -654,39 +654,35 @@ export default {
axios.get('/admin/?a=flow_version&form_id=' + form_id)
.then(res => {
if (res.data.code) {
// 启用的版本号
res.data.data.forEach((ele) => {
if (ele.status === '1') {
flow_id = ele.id;
updateUrl(flow_id); // 更新url
// 版本显示信息
state.flow_version = ele.code;
state.current_version_code = ele.code;
state.versionForm = { // 当前版本信息
code: ele.code,
id: ele.id,
note: ele.note,
type: null,
}
}
});
// 版本列表
state.version_list = res.data.data;
// 版本列表不含有启用的版本
state.flow_version_list = res.data.data.filter((ele) => {
return ele.status !== '1';
});
// 如果列表里没有启用的版本
if (state.version_list.length && !state.flow_version_list) {
if (flow_id) {
if (state.version_list.length) {
// 启用的版本号
state.version_list.forEach((ele) => {
if (ele.id === +flow_id) {
// 流程版本显示信息
state.flow_version = ele.code;
}
if (ele.status === '1') {
// 流程版本列表显示启用项
state.current_enable_version = ele.code;
}
});
}
} else {
// 如果列表里没有启用的版本获取flow_id不存在时,默认选中第一个
if (state.version_list.length) {
if (!state.flow_version_list) {
let ele = state.version_list[0];
flow_id = ele.id;
updateUrl(flow_id); // 更新url
state.flow_version = ele.code;
state.versionForm = { // 当前版本信息
code: ele.code,
id: ele.id,
note: ele.note,
type: null,
}
}
}
// 没有默认版本列表,自动新增流程
...
...
@@ -722,7 +718,7 @@ export default {
// TAG: 接口获取流程图数据
const flowData = ref<any>(null);
const getFlowData = (flow_id) => {
const getFlowData = (flow_id
: any
) => {
flowData.value = null;
axios.get('/admin/?a=flow_nodes&flow_id=' + flow_id)
.then(res => {
...
...
@@ -813,12 +809,12 @@ export default {
// 版本列表
state.version_list = res.data.data;
state.version_list.forEach((ele) => {
if (ele.id === flow_id) {
if (ele.id ===
+
flow_id) {
// 选中新增的版本
state.flow_version = ele.code;
}
if (ele.status === '1') {
state.current_
version_code
= ele.code;
state.current_
enable_version
= ele.code;
}
});
} else {
...
...
@@ -843,7 +839,7 @@ export default {
axios.post('/admin/?a=enable_flow_version', qs.stringify(state.versionForm))
.then(res => {
if (res.data.code) {
state.current_
version_code
= state.versionForm.code;
state.current_
enable_version
= state.versionForm.code;
state.dialogVersionFormVisible = false;
ElMessage({
type: 'success',
...
...
@@ -904,6 +900,7 @@ export default {
type: 'success',
message: '保存成功',
});
getVersionList(); // 刷新版本列表
} else {
ElMessage({
type: 'error',
...
...
Please
register
or
login
to post a comment