🎉 1.2.7.RELEASE

main
ssc 4 years ago
parent 5f7de64686
commit 94221d6ca7
  1. 7
      src/api/plugin/workflow/category.js
  2. 8
      src/api/plugin/workflow/form.js
  3. 8
      src/api/plugin/workflow/model.js
  4. 147
      src/views/plugin/workflow/design/deployment.vue
  5. 131
      src/views/plugin/workflow/design/form-history.vue
  6. 208
      src/views/plugin/workflow/design/form.vue
  7. 131
      src/views/plugin/workflow/design/model-history.vue
  8. 185
      src/views/plugin/workflow/design/model.vue
  9. 1
      src/views/plugin/workflow/mixins/ex-form.js
  10. 95
      src/views/plugin/workflow/process/components/detail.vue
  11. 77
      src/views/plugin/workflow/process/components/form.vue
  12. 101
      src/views/plugin/workflow/process/start.vue

@ -2,6 +2,13 @@ import request from '@/router/axios';
const prefix = '/api/blade-workflow/design/category' const prefix = '/api/blade-workflow/design/category'
export const tree = () => {
return request({
url: `${prefix}/tree`,
method: 'get',
})
}
export const treeList = () => { export const treeList = () => {
return request({ return request({
url: `${prefix}/allTree`, url: `${prefix}/allTree`,

@ -53,3 +53,11 @@ export const listType = (params) => {
params params
}) })
} }
export const changeCategory = (row) => {
return request({
url: `${prefix}/changeCategory`,
method: 'post',
data: row
})
}

@ -47,3 +47,11 @@ export const deploy = (row) => {
data: row data: row
}) })
} }
export const changeCategory = (row) => {
return request({
url: `${prefix}/changeCategory`,
method: 'post',
data: row
})
}

@ -1,48 +1,66 @@
<template> <template>
<basic-container> <basic-container>
<avue-crud :option="option" <el-container>
:table-loading="loading" <el-aside width="200px">
:data="data" <avue-tree :option="treeOption"
:page.sync="page" :data="treeData"
:permission="permissionList" @node-click="nodeClick"></avue-tree>
v-model="form" </el-aside>
@row-del="rowDel" <el-main style="margin-left: 10px;">
@search-change="searchChange" <avue-crud :option="option"
@search-reset="searchReset" :table-loading="loading"
@selection-change="selectionChange" :data="data"
@current-change="currentChange" :page.sync="page"
@size-change="sizeChange" :permission="permissionList"
@refresh-change="onLoad(page, query)" v-model="form"
@on-load="onLoad"> @row-del="rowDel"
<template slot="status" @search-change="searchChange"
slot-scope="{row}"> @search-reset="searchReset"
<el-tag size="small" @selection-change="selectionChange"
:type="row.status == 1? '': 'danger'">{{row.$status}}</el-tag> @current-change="currentChange"
</template> @size-change="sizeChange"
<template slot="menu" @refresh-change="onLoad(page, query)"
slot-scope="{row}"> @on-load="onLoad">
<el-button v-if="permission.wf_design_deployment_status && row.status == 1" <template #menuLeft>
type="text" <el-button type="success"
size="small" size="mini"
icon="el-icon-refresh-left" icon="el-icon-connection"
@click="handleChangeStatus(row, 'suspended')">挂起</el-button> v-if="permission.wf_design_deployment_category"
<el-button v-if="permission.wf_design_deployment_status && row.status == 2" @click="handleChangeCategory"> 更改分类
type="text" </el-button>
size="small" </template>
icon="el-icon-refresh-right" <template slot="status"
@click="handleChangeStatus(row, 'active')">激活</el-button> slot-scope="{row}">
<el-button v-if="permission.wf_design_deployment_category" <el-tag size="small"
type="text" :type="row.status == 1? '': 'danger'">{{row.$status}}</el-tag>
size="small" </template>
icon="el-icon-pie-chart" <template slot="menu"
@click="handleCategory(row)">更改分类</el-button> slot-scope="{row}">
</template> <el-button v-if="permission.wf_design_deployment_status && row.status == 1"
</avue-crud> type="text"
size="small"
icon="el-icon-refresh-left"
@click="handleChangeStatus(row, 'suspended')">挂起</el-button>
<el-button v-if="permission.wf_design_deployment_status && row.status == 2"
type="text"
size="small"
icon="el-icon-refresh-right"
@click="handleChangeStatus(row, 'active')">激活</el-button>
<el-button v-if="permission.wf_design_deployment_category"
type="text"
size="small"
icon="el-icon-pie-chart"
@click="handleCategory(row)">更改分类</el-button>
</template>
</avue-crud>
</el-main>
</el-container>
<el-dialog :visible.sync="categoryVisible" <el-dialog :visible.sync="categoryVisible"
append-to-body append-to-body
title="选择分类"> title="选择分类">
<avue-form v-model="form" <avue-form v-if="categoryVisible"
v-model="form"
:option="{column:[{type:'tree',label:'流程分类',span:24,props:{label:'name',value:'id'},prop:'category',dicUrl:'/api/blade-workflow/design/category/tree',required:true,rules:[{required:true,message:'请选择分类'}]}]}" :option="{column:[{type:'tree',label:'流程分类',span:24,props:{label:'name',value:'id'},prop:'category',dicUrl:'/api/blade-workflow/design/category/tree',required:true,rules:[{required:true,message:'请选择分类'}]}]}"
@submit="handleCategorySubmit"></avue-form> @submit="handleCategorySubmit"></avue-form>
</el-dialog> </el-dialog>
@ -51,6 +69,8 @@
<script> <script>
import { getList, changeStatus, changeCategory, remove } from "@/api/plugin/workflow/deployment"; import { getList, changeStatus, changeCategory, remove } from "@/api/plugin/workflow/deployment";
import { tree } from '@/api/plugin/workflow/category';
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
export default { export default {
@ -66,6 +86,8 @@ export default {
}, },
selectionList: [], selectionList: [],
option: { option: {
size: 'mini',
searchSize: 'mini',
height: 'auto', height: 'auto',
calcHeight: 30, calcHeight: 30,
tip: false, tip: false,
@ -98,9 +120,8 @@ export default {
label: "分类", label: "分类",
prop: "category", prop: "category",
overHidden: true, overHidden: true,
search: true,
type: 'tree', type: 'tree',
dicUrl: '/api/blade-workflow/design/category/tree', dicData: [],
props: { props: {
label: 'name', label: 'name',
value: 'id' value: 'id'
@ -133,7 +154,16 @@ export default {
}, },
data: [], data: [],
row: '', row: '',
categoryVisible: false categoryVisible: false,
treeData: [],
treeOption: {
size: 'mini',
addBtn: false,
props: {
label: 'name',
value: 'id'
}
}
}; };
}, },
computed: { computed: {
@ -149,17 +179,42 @@ export default {
ids() { ids() {
let ids = []; let ids = [];
this.selectionList.forEach(ele => { this.selectionList.forEach(ele => {
ids.push(ele.id); ids.push(ele.deploymentId);
}); });
return ids.join(","); return ids.join(",");
} }
}, },
mounted() {
this.getCategoryList()
},
methods: { methods: {
handleChangeCategory() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.categoryVisible = true
},
getCategoryList() {
tree().then(res => {
const data = res.data.data
this.findObject(this.option.column, 'category').dicData = this.deepClone(data)
this.treeData = data
this.treeData.unshift({ id: '', name: '全部' })
})
},
nodeClick({ id }) {
this.categoryId = id
this.searchChange(this.query)
},
handleCategorySubmit(form, done) { handleCategorySubmit(form, done) {
const { deploymentId, category } = form let { deploymentId, category } = form
if (!deploymentId) deploymentId = this.ids
changeCategory({ deploymentId, category }).then(() => { changeCategory({ deploymentId, category }).then(() => {
this.$message.success("操作成功") this.$message.success("操作成功")
done() done()
this.form = {}
this.categoryVisible = false this.categoryVisible = false
this.onLoad(this.page, this.query) this.onLoad(this.page, this.query)
}) })
@ -241,6 +296,10 @@ export default {
}, },
onLoad(page, params = {}) { onLoad(page, params = {}) {
this.loading = true; this.loading = true;
if (this.categoryId) params['category'] = this.categoryId
else delete params['category']
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data; const data = res.data.data;
this.page.total = data.total; this.page.total = data.total;

@ -1,41 +1,50 @@
<template> <template>
<basic-container> <basic-container>
<avue-crud :option="option" <el-container>
:table-loading="loading" <el-aside width="200px">
:data="data" <avue-tree :option="treeOption"
:page.sync="page" :data="treeData"
:search.sync="query" @node-click="nodeClick"></avue-tree>
v-model="form" </el-aside>
@row-del="rowDel" <el-main style="margin-left: 10px;">
@search-change="searchChange" <avue-crud :option="option"
@search-reset="searchReset" :table-loading="loading"
@selection-change="selectionChange" :data="data"
@current-change="currentChange" :page.sync="page"
@size-change="sizeChange" :search.sync="query"
@refresh-change="onLoad(page, query)"> v-model="form"
<template slot="menuLeft"> @row-del="rowDel"
<el-button type="danger" @search-change="searchChange"
size="mini" @search-reset="searchReset"
icon="el-icon-delete" @selection-change="selectionChange"
plain @current-change="currentChange"
v-if="permission.wf_design_form_history_delete" @size-change="sizeChange"
@click="handleDelete"> @refresh-change="onLoad(page, query)">
</el-button> <template slot="menuLeft">
</template> <el-button type="danger"
<template slot="menu" size="mini"
slot-scope="{row}"> icon="el-icon-delete"
<el-button v-if="permission.wf_design_form_history_view" plain
type="text" v-if="permission.wf_design_form_history_delete"
size="mini" @click="handleDelete">
icon="el-icon-view" </el-button>
@click="handlePreview(row)">预览</el-button> </template>
<el-button v-if="permission.wf_design_form_history_main" <template slot="menu"
type="text" slot-scope="{row}">
size="mini" <el-button v-if="permission.wf_design_form_history_view"
icon="el-icon-edit" type="text"
@click="handleMain(row)">设为主版本</el-button> size="mini"
</template> icon="el-icon-view"
</avue-crud> @click="handlePreview(row)">预览</el-button>
<el-button v-if="permission.wf_design_form_history_main"
type="text"
size="mini"
icon="el-icon-edit"
@click="handleMain(row)">设为主版本</el-button>
</template>
</avue-crud>
</el-main>
</el-container>
<el-drawer :visible.sync="viewVisible" <el-drawer :visible.sync="viewVisible"
title="表单预览" title="表单预览"
@ -53,6 +62,8 @@
<script> <script>
import { getList, remove, setMainVersion } from "@/api/plugin/workflow/form-history"; import { getList, remove, setMainVersion } from "@/api/plugin/workflow/form-history";
import { tree } from '@/api/plugin/workflow/category';
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
export default { export default {
@ -94,6 +105,21 @@ export default {
prop: "name", prop: "name",
search: true search: true
}, },
{
label: '分类',
prop: 'categoryId',
type: 'tree',
props: {
label: 'name',
value: 'id'
},
dicData: [],
rules: [{
required: true,
message: "请选择分类",
trigger: "change"
}],
},
{ {
label: '备注', label: '备注',
prop: 'remark', prop: 'remark',
@ -110,7 +136,16 @@ export default {
data: [], data: [],
viewVisible: false, viewVisible: false,
viewForm: {}, viewForm: {},
viewOption: {} viewOption: {},
treeData: [],
treeOption: {
size: 'mini',
addBtn: false,
props: {
label: 'name',
value: 'id'
}
}
}; };
}, },
watch: { watch: {
@ -132,7 +167,23 @@ export default {
return ids.join(","); return ids.join(",");
} }
}, },
mounted() {
this.getCategoryList()
},
methods: { methods: {
getCategoryList() {
tree().then(res => {
const data = res.data.data
this.findObject(this.option.column, 'categoryId').dicData = this.deepClone(data)
this.treeData = data
this.treeData.unshift({ id: '', name: '全部' })
})
},
nodeClick({ id }) {
this.categoryId = id
this.searchChange(this.query)
},
handleMain(row) { handleMain(row) {
this.$confirm("当前主版本会自动保存到历史,确定要将此版本设为主版本吗?", { this.$confirm("当前主版本会自动保存到历史,确定要将此版本设为主版本吗?", {
confirmButtonText: "确定", confirmButtonText: "确定",
@ -199,7 +250,7 @@ export default {
searchChange(params, done) { searchChange(params, done) {
this.query = params; this.query = params;
this.onLoad(this.page, params); this.onLoad(this.page, params);
done() if (done) done()
}, },
selectionChange(list) { selectionChange(list) {
this.selectionList = list; this.selectionList = list;
@ -215,6 +266,10 @@ export default {
onLoad(page, params = {}) { onLoad(page, params = {}) {
this.loading = true; this.loading = true;
params.formId = this.formId params.formId = this.formId
if (this.categoryId) params['categoryId'] = this.categoryId
else delete params['categoryId']
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data; const data = res.data.data;
this.page.total = data.total; this.page.total = data.total;

@ -1,43 +1,59 @@
<template> <template>
<basic-container> <basic-container>
<avue-crud :option="option" <el-container>
:table-loading="loading" <el-aside width="200px">
:data="data" <avue-tree :option="treeOption"
:page.sync="page" :data="treeData"
:search.sync="query" @node-click="nodeClick"></avue-tree>
:permission="permissionList" </el-aside>
:before-open="beforeOpen" <el-main style="margin-left: 10px;">
v-model="form" <avue-crud ref="crud"
@row-update="rowUpdate" :option="option"
@row-save="rowSave" :table-loading="loading"
@row-del="rowDel" :data="data"
@search-change="searchChange" :page.sync="page"
@search-reset="searchReset" :search.sync="query"
@selection-change="selectionChange" :permission="permissionList"
@current-change="currentChange" v-model="form"
@size-change="sizeChange" @row-update="rowUpdate"
@refresh-change="onLoad(page, query)" @row-save="rowSave"
@on-load="onLoad"> @row-del="rowDel"
<template slot="menu" @search-change="searchChange"
slot-scope="{row}"> @search-reset="searchReset"
<el-button v-if="permission.wf_design_form_design" @selection-change="selectionChange"
type="text" @current-change="currentChange"
size="mini" @size-change="sizeChange"
icon="el-icon-edit" @refresh-change="onLoad(page, query)"
@click="handleDesign(row)">设计</el-button> @on-load="onLoad">
<el-button v-if="permission.wf_design_form_copy" <template #menuLeft>
type="text" <el-button type="success"
size="mini" size="mini"
icon="el-icon-document-copy" icon="el-icon-connection"
@click="handleCopy(row)">拷贝</el-button> v-if="permission.wf_design_model_change_category"
<el-button v-if="permission.wf_design_form_history" @click="handleChangeCategory"> 更改分类
type="text" </el-button>
size="mini" </template>
icon="el-icon-time" <template slot="menu"
@click="handleHistory(row)">历史</el-button> slot-scope="{row}">
</template> <el-button v-if="permission.wf_design_form_design"
</avue-crud> type="text"
size="mini"
icon="el-icon-edit"
@click="handleDesign(row)">设计</el-button>
<el-button v-if="permission.wf_design_form_copy"
type="text"
size="mini"
icon="el-icon-document-copy"
@click="handleCopy(row)">拷贝</el-button>
<el-button v-if="permission.wf_design_form_history"
type="text"
size="mini"
icon="el-icon-time"
@click="handleHistory(row)">历史</el-button>
</template>
</avue-crud>
</el-main>
</el-container>
<el-dialog :visible.sync="formVisible" <el-dialog :visible.sync="formVisible"
append-to-body append-to-body
title="表单设计" title="表单设计"
@ -68,11 +84,21 @@
@submit="handleCopySubmit"> @submit="handleCopySubmit">
</avue-form> </avue-form>
</el-dialog> </el-dialog>
<el-dialog :visible.sync="categoryVisible"
append-to-body
title="选择分类">
<avue-form v-model="form"
:option="{column:[{type:'tree',label:'流程分类',span:24,props:{label:'name',value:'id'},prop:'category',dicUrl:'/api/blade-workflow/design/category/tree',required:true,rules:[{required:true,message:'请选择分类'}]}]}"
@submit="handleChangeCategorySubmit"></avue-form>
</el-dialog>
</basic-container> </basic-container>
</template> </template>
<script> <script>
import { getList, add, update, remove, listType } from "@/api/plugin/workflow/form"; import { getList, add, update, remove, listType, changeCategory } from "@/api/plugin/workflow/form";
import { tree } from '@/api/plugin/workflow/category';
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import customFields from '../mixins/custom-fields' import customFields from '../mixins/custom-fields'
@ -126,10 +152,19 @@ export default {
search: true search: true
}, },
{ {
label: '备注', label: '分类',
prop: 'remark', prop: 'categoryId',
type: 'textarea', type: 'tree',
span: 24 props: {
label: 'name',
value: 'id'
},
dicData: [],
rules: [{
required: true,
message: "请选择分类",
trigger: "change"
}],
}, },
{ {
label: '版本', label: '版本',
@ -140,6 +175,7 @@ export default {
label: '状态', label: '状态',
prop: 'status', prop: 'status',
type: 'select', type: 'select',
value: 1,
dicData: [{ dicData: [{
label: '可用', label: '可用',
value: 1 value: 1
@ -154,6 +190,12 @@ export default {
}], }],
search: true search: true
}, },
{
label: '备注',
prop: 'remark',
type: 'textarea',
span: 24
},
] ]
}, },
data: [], data: [],
@ -178,15 +220,25 @@ export default {
}], }],
}, },
{ {
label: '备注', label: '分类',
prop: 'remark', prop: 'categoryId',
type: 'textarea', type: 'tree',
span: 24 props: {
label: 'name',
value: 'id'
},
dicData: [],
rules: [{
required: true,
message: "请选择分类",
trigger: "change"
}],
}, },
{ {
label: '状态', label: '状态',
prop: 'status', prop: 'status',
type: 'select', type: 'select',
value: 1,
dicData: [{ dicData: [{
label: '可用', label: '可用',
value: 1 value: 1
@ -199,11 +251,28 @@ export default {
message: "请选择状态", message: "请选择状态",
trigger: "change" trigger: "change"
}], }],
search: true
},
{
label: '备注',
prop: 'remark',
type: 'textarea',
span: 24
},] },]
}, },
isNewVersion: false, isNewVersion: false,
isCopy: false, isCopy: false,
copyVisible: false copyVisible: false,
categoryVisible: false,
treeData: [],
treeOption: {
size: 'mini',
addBtn: false,
props: {
label: 'name',
value: 'id'
}
}
}; };
}, },
computed: { computed: {
@ -226,8 +295,39 @@ export default {
}, },
mounted() { mounted() {
this.getDefaultValues() this.getDefaultValues()
this.getCategoryList()
}, },
methods: { methods: {
handleChangeCategorySubmit(form, done) {
const { category } = form
changeCategory({ ids: this.ids, category }).then(() => {
this.$message.success('修改成功')
done()
this.categoryVisible = false
this.onLoad(this.page, this.query)
})
},
handleChangeCategory() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.categoryVisible = true
},
getCategoryList() {
tree().then(res => {
const data = res.data.data
this.findObject(this.option.column, 'categoryId').dicData = this.deepClone(data)
this.findObject(this.copyOption.column, 'categoryId').dicData = this.deepClone(data)
this.treeData = data
this.treeData.unshift({ id: '', name: '全部' })
})
},
nodeClick({ id }) {
this.categoryId = id
this.searchChange(this.query)
},
handleSubmit() { handleSubmit() {
this.$refs.formDesign.getData('string').then(data => { this.$refs.formDesign.getData('string').then(data => {
if (this.isCopy) { if (this.isCopy) {
@ -388,12 +488,6 @@ export default {
this.$refs.crud.toggleSelection(); this.$refs.crud.toggleSelection();
}); });
}, },
beforeOpen(done, type) {
if (["add"].includes(type)) {
this.$set(this.form, 'status', 1)
}
done();
},
searchReset() { searchReset() {
this.query = {}; this.query = {};
this.onLoad(this.page); this.onLoad(this.page);
@ -401,7 +495,7 @@ export default {
searchChange(params, done) { searchChange(params, done) {
this.query = params; this.query = params;
this.onLoad(this.page, params); this.onLoad(this.page, params);
done() if (done) done()
}, },
selectionChange(list) { selectionChange(list) {
this.selectionList = list; this.selectionList = list;
@ -414,6 +508,10 @@ export default {
}, },
onLoad(page, params = {}) { onLoad(page, params = {}) {
this.loading = true; this.loading = true;
if (this.categoryId) params['categoryId_equal'] = this.categoryId
else delete params['categoryId_equal']
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data; const data = res.data.data;
this.page.total = data.total; this.page.total = data.total;

@ -1,41 +1,50 @@
<template> <template>
<basic-container> <basic-container>
<avue-crud :option="option" <el-container>
:table-loading="loading" <el-aside width="200px">
:data="data" <avue-tree :option="treeOption"
:page.sync="page" :data="treeData"
:search.sync="query" @node-click="nodeClick"></avue-tree>
v-model="form" </el-aside>
@row-del="rowDel" <el-main style="margin-left: 10px;">
@search-change="searchChange" <avue-crud :option="option"
@search-reset="searchReset" :table-loading="loading"
@selection-change="selectionChange" :data="data"
@current-change="currentChange" :page.sync="page"
@size-change="sizeChange" :search.sync="query"
@refresh-change="onLoad(page, query)"> v-model="form"
<template slot="menuLeft"> @row-del="rowDel"
<el-button type="danger" @search-change="searchChange"
size="mini" @search-reset="searchReset"
icon="el-icon-delete" @selection-change="selectionChange"
plain @current-change="currentChange"
v-if="permission.wf_design_form_history_delete" @size-change="sizeChange"
@click="handleDelete"> @refresh-change="onLoad(page, query)">
</el-button> <template slot="menuLeft">
</template> <el-button type="danger"
<template slot="menu" size="mini"
slot-scope="{row}"> icon="el-icon-delete"
<el-button v-if="permission.wf_design_form_history_view" plain
type="text" v-if="permission.wf_design_form_history_delete"
size="mini" @click="handleDelete">
icon="el-icon-view" </el-button>
@click="handlePreview(row)">预览</el-button> </template>
<el-button v-if="permission.wf_design_form_history_main" <template slot="menu"
type="text" slot-scope="{row}">
size="mini" <el-button v-if="permission.wf_design_form_history_view"
icon="el-icon-edit" type="text"
@click="handleMain(row)">设为主版本</el-button> size="mini"
</template> icon="el-icon-view"
</avue-crud> @click="handlePreview(row)">预览</el-button>
<el-button v-if="permission.wf_design_form_history_main"
type="text"
size="mini"
icon="el-icon-edit"
@click="handleMain(row)">设为主版本</el-button>
</template>
</avue-crud>
</el-main>
</el-container>
<el-dialog :visible.sync="viewVisible" <el-dialog :visible.sync="viewVisible"
title="模型预览" title="模型预览"
@ -50,6 +59,8 @@
<script> <script>
import { getList, remove, setMainVersion } from "@/api/plugin/workflow/model-history"; import { getList, remove, setMainVersion } from "@/api/plugin/workflow/model-history";
import { tree } from '@/api/plugin/workflow/category';
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
export default { export default {
@ -93,6 +104,21 @@ export default {
overHidden: true, overHidden: true,
search: true search: true
}, },
{
label: '分类',
prop: 'categoryId',
type: 'tree',
props: {
label: 'name',
value: 'id'
},
dicData: [],
rules: [{
required: true,
message: "请选择分类",
trigger: "change"
}],
},
{ {
label: "描述", label: "描述",
prop: "description", prop: "description",
@ -107,7 +133,16 @@ export default {
}, },
data: [], data: [],
viewVisible: false, viewVisible: false,
viewOption: {} viewOption: {},
treeData: [],
treeOption: {
size: 'mini',
addBtn: false,
props: {
label: 'name',
value: 'id'
}
}
}; };
}, },
watch: { watch: {
@ -129,7 +164,23 @@ export default {
return ids.join(","); return ids.join(",");
} }
}, },
mounted() {
this.getCategoryList()
},
methods: { methods: {
getCategoryList() {
tree().then(res => {
const data = res.data.data
this.findObject(this.option.column, 'categoryId').dicData = this.deepClone(data)
this.treeData = data
this.treeData.unshift({ id: '', name: '全部' })
})
},
nodeClick({ id }) {
this.categoryId = id
this.searchChange(this.query)
},
handleMain(row) { handleMain(row) {
this.$confirm("当前主版本会自动保存到历史,确定要将此版本设为主版本吗?", { this.$confirm("当前主版本会自动保存到历史,确定要将此版本设为主版本吗?", {
confirmButtonText: "确定", confirmButtonText: "确定",
@ -196,7 +247,7 @@ export default {
searchChange(params, done) { searchChange(params, done) {
this.query = params; this.query = params;
this.onLoad(this.page, params); this.onLoad(this.page, params);
done() if (done) done()
}, },
selectionChange(list) { selectionChange(list) {
this.selectionList = list; this.selectionList = list;
@ -212,6 +263,10 @@ export default {
onLoad(page, params = {}) { onLoad(page, params = {}) {
this.loading = true; this.loading = true;
params.modelId = this.modelId params.modelId = this.modelId
if (this.categoryId) params['categoryId'] = this.categoryId
else delete params['categoryId']
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data; const data = res.data.data;
this.page.total = data.total; this.page.total = data.total;

@ -1,52 +1,67 @@
<template> <template>
<basic-container> <basic-container>
<avue-crud :option="option" <el-container>
:table-loading="loading" <el-aside width="200px">
:data="data" <avue-tree :option="treeOption"
ref="crud" :data="treeData"
v-model="form" @node-click="nodeClick"></avue-tree>
:page.sync="page" </el-aside>
:permission="permissionList" <el-main style="margin-left: 10px;">
@row-del="rowDel" <avue-crud :option="option"
@search-change="searchChange" :table-loading="loading"
@search-reset="searchReset" :data="data"
@selection-change="selectionChange" ref="crud"
@current-change="currentChange" v-model="form"
@size-change="sizeChange" :page.sync="page"
@refresh-change="onLoad(page, query)" :permission="permissionList"
@on-load="onLoad"> @row-del="rowDel"
<template slot="menuLeft"> @search-change="searchChange"
<el-button type="primary" @search-reset="searchReset"
size="mini" @selection-change="selectionChange"
icon="el-icon-plus" @current-change="currentChange"
v-if="permission.wf_design_model_add" @size-change="sizeChange"
@click="handleDesign({})"> @refresh-change="onLoad(page, query)"
</el-button> @on-load="onLoad">
</template> <template slot="menuLeft">
<template slot="menu" <el-button type="primary"
slot-scope="{row}"> size="mini"
<el-button v-if="permission.wf_design_model_design" icon="el-icon-plus"
type="text" v-if="permission.wf_design_model_add"
icon="el-icon-edit" @click="handleDesign({})">
size="small" </el-button>
@click="handleDesign(row)">设计</el-button> <el-button type="success"
<el-button v-if="permission.wf_design_model_deploy" size="mini"
type="text" icon="el-icon-connection"
icon="el-icon-s-promotion" v-if="permission.wf_design_model_change_category"
size="small" @click="handleChangeCategory"> 更改分类
@click="handleDeploy(row)">部署</el-button> </el-button>
<el-button v-if="permission.wf_design_model_history" </template>
type="text" <template slot="menu"
size="mini" slot-scope="{row}">
icon="el-icon-time" <el-button v-if="permission.wf_design_model_design"
@click="handleHistory(row)">历史</el-button> type="text"
<el-button v-if="permission.wf_design_model_scope" icon="el-icon-edit"
type="text" size="small"
size="mini" @click="handleDesign(row)">设计</el-button>
icon="el-icon-time" <el-button v-if="permission.wf_design_model_deploy"
@click="handleScope(row)">权限</el-button> type="text"
</template> icon="el-icon-s-promotion"
</avue-crud> size="small"
@click="handleDeploy(row)">部署</el-button>
<el-button v-if="permission.wf_design_model_history"
type="text"
size="mini"
icon="el-icon-time"
@click="handleHistory(row)">历史</el-button>
<el-button v-if="permission.wf_design_model_scope"
type="text"
size="mini"
icon="el-icon-time"
@click="handleScope(row)">权限</el-button>
</template>
</avue-crud>
</el-main>
</el-container>
<el-dialog :visible.sync="categoryVisible" <el-dialog :visible.sync="categoryVisible"
append-to-body append-to-body
@ -63,8 +78,10 @@
</template> </template>
<script> <script>
import { getList, remove, deploy } from "@/api/plugin/workflow/model"; import { getList, remove, deploy, changeCategory } from "@/api/plugin/workflow/model";
import { getList as scopeList, submit as scopeSubmit } from '@/api/plugin/workflow/model-scope' import { getList as scopeList, submit as scopeSubmit } from '@/api/plugin/workflow/model-scope'
import { tree } from '@/api/plugin/workflow/category';
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import UserOption from '../process/components/user-option.vue' import UserOption from '../process/components/user-option.vue'
@ -110,6 +127,21 @@ export default {
overHidden: true, overHidden: true,
search: true search: true
}, },
{
label: '分类',
prop: 'categoryId',
type: 'tree',
props: {
label: 'name',
value: 'id'
},
dicData: [],
rules: [{
required: true,
message: "请选择分类",
trigger: "change"
}],
},
{ {
label: "描述", label: "描述",
prop: "description", prop: "description",
@ -130,6 +162,15 @@ export default {
roleUrl: '/api/blade-system/search/role', roleUrl: '/api/blade-system/search/role',
deptUrl: '/api/blade-system/search/dept', deptUrl: '/api/blade-system/search/dept',
postUrl: '/api/blade-system/search/post', postUrl: '/api/blade-system/search/post',
},
treeData: [],
treeOption: {
size: 'mini',
addBtn: false,
props: {
label: 'name',
value: 'id'
}
} }
}; };
}, },
@ -151,7 +192,31 @@ export default {
return ids.join(","); return ids.join(",");
} }
}, },
mounted() {
this.getCategoryList()
},
methods: { methods: {
handleChangeCategory() {
if (this.selectionList.length === 0) {
this.$message.warning("请选择至少一条数据");
return;
}
this.categoryType = 'change'
this.categoryVisible = true
},
getCategoryList() {
tree().then(res => {
const data = res.data.data
this.findObject(this.option.column, 'categoryId').dicData = this.deepClone(data)
this.treeData = data
this.treeData.unshift({ id: '', name: '全部' })
})
},
nodeClick({ id }) {
this.categoryId = id
this.searchChange(this.query)
},
handleScopeSubmit(list) { handleScopeSubmit(list) {
list.forEach(l => l.val = l.value) list.forEach(l => l.val = l.value)
@ -179,11 +244,21 @@ export default {
}, },
handleDeploySubmit(form, done) { handleDeploySubmit(form, done) {
const { id, category } = form const { id, category } = form
deploy({ id, category }).then(() => { if (this.categoryType == 'change') {
this.$message.success("部署成功") changeCategory({ ids: this.ids, category }).then(() => {
done() this.$message.success('修改成功')
this.categoryVisible = false this.categoryType = ''
}) done()
this.categoryVisible = false
this.onLoad(this.page, this.query)
})
} else {
deploy({ id, category }).then(() => {
this.$message.success("部署成功")
done()
this.categoryVisible = false
})
}
}, },
handleDeploy(row) { handleDeploy(row) {
this.form.id = row.id this.form.id = row.id
@ -265,6 +340,10 @@ export default {
}, },
onLoad(page, params = {}) { onLoad(page, params = {}) {
this.loading = true; this.loading = true;
if (this.categoryId) params['categoryId_equal'] = this.categoryId
else delete params['categoryId_equal']
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data; const data = res.data.data;
this.page.total = data.total; this.page.total = data.total;

@ -23,6 +23,7 @@ export default {
bpmnOption: {}, // 流程图配置信息 bpmnOption: {}, // 流程图配置信息
watermarkText: '', //水印文字 watermarkText: '', //水印文字
defaultChecked: '', // 人员选择默认选中 defaultChecked: '', // 人员选择默认选中
waiting: true, // 骨架屏加载中
} }
}, },
mounted() { mounted() {

@ -1,53 +1,57 @@
<template> <template>
<basic-container> <basic-container>
<avue-affix id="avue-view" <avue-skeleton :loading="waiting"
:offset-top="116"> avatar
<div class="header"> :rows="8">
<avue-title :value="process.processDefinitionName"></avue-title> <avue-affix id="avue-view"
</div> :offset-top="116">
</avue-affix> <div class="header">
<el-tabs v-model="activeName"> <avue-title :value="process.processDefinitionName"></avue-title>
<el-tab-pane label="申请信息" </div>
name="first"> </avue-affix>
<el-card shadow="never"> <el-tabs v-model="activeName">
<div ref="printBody"> <el-tab-pane label="申请信息"
<avue-form v-if="option && ((option.column && option.column.length > 0) || (option.group && option.group.length > 0))" name="first">
v-model="form" <el-card shadow="never">
ref="form" <div ref="printBody">
:defaults.sync="defaults" <avue-form v-if="option && ((option.column && option.column.length > 0) || (option.group && option.group.length > 0))"
:option="option" v-model="form"
:upload-preview="handleUploadPreview"> ref="form"
</avue-form> :defaults.sync="defaults"
</div> :option="option"
</el-card> :upload-preview="handleUploadPreview">
<el-card shadow="never" </avue-form>
style="margin-top: 20px" </div>
v-if="process.status == 'todo'"> </el-card>
<wf-examine-form ref="examineForm" <el-card shadow="never"
:comment.sync="comment" style="margin-top: 20px"
:process="process" v-if="process.status == 'todo'">
@user-select="handleUserSelect"></wf-examine-form> <wf-examine-form ref="examineForm"
</el-card> :comment.sync="comment"
</el-tab-pane> :process="process"
<el-tab-pane label="流转信息" @user-select="handleUserSelect"></wf-examine-form>
name="second"> </el-card>
<el-card shadow="never" </el-tab-pane>
style="margin-top: 5px;"> <el-tab-pane label="流转信息"
<wf-flow :flow="flow"></wf-flow> name="second">
</el-card>
</el-tab-pane>
<el-tab-pane label="流程跟踪"
name="third">
<template v-if="activeName == 'third'">
<el-card shadow="never" <el-card shadow="never"
style="margin-top: 5px;"> style="margin-top: 5px;">
<wf-design ref="bpmn" <wf-flow :flow="flow"></wf-flow>
style="height: 500px;"
:options="bpmnOption"></wf-design>
</el-card> </el-card>
</template> </el-tab-pane>
</el-tab-pane> <el-tab-pane label="流程跟踪"
</el-tabs> name="third">
<template v-if="activeName == 'third'">
<el-card shadow="never"
style="margin-top: 5px;">
<wf-design ref="bpmn"
style="height: 500px;"
:options="bpmnOption"></wf-design>
</el-card>
</template>
</el-tab-pane>
</el-tabs>
</avue-skeleton>
<!-- 底部按钮 --> <!-- 底部按钮 -->
<template v-if="process.status == 'todo'"> <template v-if="process.status == 'todo'">
@ -166,6 +170,7 @@ export default {
this.option = option this.option = option
this.form = variables this.form = variables
this.waiting = false
} }
}) })
}, },

@ -1,45 +1,49 @@
<template> <template>
<basic-container> <basic-container>
<avue-title style="margin-bottom: 20px; " <avue-skeleton :loading="waiting"
:styles="{fontSize: '20px'}" avatar
:value="process.name"></avue-title> :rows="8">
<el-card shadow="never" <avue-title style="margin-bottom: 20px; "
style="margin-top: 20px"> :styles="{fontSize: '20px'}"
<avue-form v-if="option && ((option.column && option.column.length > 0) || (option.group && option.group.length > 0))" :value="process.name"></avue-title>
v-model="form" <el-card shadow="never"
ref="form" style="margin-top: 20px">
:option="option" <avue-form v-if="option && ((option.column && option.column.length > 0) || (option.group && option.group.length > 0))"
:defaults.sync="defaults" v-model="form"
@submit="handleSubmit" ref="form"
@error="loading = false" :option="option"
:upload-preview="handleUploadPreview"> :defaults.sync="defaults"
</avue-form> @submit="handleSubmit"
</el-card> @error="loading = false"
:upload-preview="handleUploadPreview">
</avue-form>
</el-card>
<el-card shadow="never" <el-card shadow="never"
style="margin-top: 20px" style="margin-top: 20px"
v-if="showExamForm"> v-if="showExamForm">
<wf-examine-form ref="examineForm" <wf-examine-form ref="examineForm"
:process="process" :process="process"
@user-select="handleUserSelect"></wf-examine-form> @user-select="handleUserSelect"></wf-examine-form>
</el-card> </el-card>
<div style="height: 120px;"></div> <div style="height: 120px;"></div>
<el-row class="foot-item avue-affix" <el-row class="foot-item avue-affix"
:style="{width: isCollapse? 'calc(100% - 80px)': 'calc(100% - 260px)' }" :style="{width: isCollapse? 'calc(100% - 80px)': 'calc(100% - 260px)' }"
id="avue-view"> id="avue-view">
<el-button type="primary" <el-button type="primary"
size="medium" size="medium"
v-loading="loading" v-loading="loading"
@click="() => { @click="() => {
loading = true; loading = true;
$refs.form.submit() $refs.form.submit()
}">发起</el-button> }">发起</el-button>
<el-button v-if="permission.wf_process_draft" <el-button v-if="permission.wf_process_draft"
type="success" type="success"
size="medium" size="medium"
v-loading="loading" v-loading="loading"
@click="handleDraft(process.id, process.formKey, form)">存为草稿</el-button> @click="handleDraft(process.id, process.formKey, form)">存为草稿</el-button>
</el-row> </el-row>
</avue-skeleton>
<!-- 人员选择弹窗 --> <!-- 人员选择弹窗 -->
<wf-user-select ref="user-select" <wf-user-select ref="user-select"
@ -122,6 +126,7 @@ export default {
}) })
} }
} }
this.waiting = false
}) })
}, },
handleSubmit(form, done) { handleSubmit(form, done) {

@ -1,38 +1,49 @@
<template> <template>
<basic-container> <basic-container>
<avue-crud :option="option" <el-container>
:table-loading="loading" <el-aside width="200px">
:data="data" <avue-tree :option="treeOption"
:page.sync="page" :data="treeData"
:permission="permissionList" @node-click="nodeClick"></avue-tree>
v-model="form" </el-aside>
@search-change="searchChange" <el-main style="margin-left: 10px;">
@search-reset="searchReset" <avue-crud :option="option"
@selection-change="selectionChange" :table-loading="loading"
@current-change="currentChange" :data="data"
@size-change="sizeChange" :page.sync="page"
@on-load="onLoad"> :permission="permissionList"
<template #menuLeft v-model="form"
v-if="isDev"> @search-change="searchChange"
<el-tag type="warning" @search-reset="searchReset"
effect="dark" @selection-change="selectionChange"
size="medium"><i class="el-icon-warning"></i> 部署的流程不显示请查看使用文档或到 模型设计 中配置权限 @current-change="currentChange"
</el-tag> @size-change="sizeChange"
</template> @on-load="onLoad">
<template slot="menu" <template #menuLeft
slot-scope="{row}"> v-if="isDev">
<el-button v-if="permission.wf_process_start_flow" <el-tag type="warning"
type="text" effect="dark"
size="small" size="medium"><i class="el-icon-warning"></i> 部署的流程不显示请查看使用文档或到 模型设计 中配置权限
icon="el-icon-video-play" </el-tag>
@click="dynamicRoute(row, 'start')">发起</el-button> </template>
</template> <template slot="menu"
</avue-crud> slot-scope="{row}">
<el-button v-if="permission.wf_process_start_flow"
type="text"
size="small"
icon="el-icon-video-play"
@click="dynamicRoute(row, 'start')">发起</el-button>
</template>
</avue-crud>
</el-main>
</el-container>
</basic-container> </basic-container>
</template> </template>
<script> <script>
import { processList as getList } from "@/api/plugin/workflow/process"; import { processList as getList } from "@/api/plugin/workflow/process";
import { tree } from '@/api/plugin/workflow/category';
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import exForm from '../mixins/ex-form' import exForm from '../mixins/ex-form'
@ -79,13 +90,12 @@ export default {
label: "流程分类", label: "流程分类",
row: true, row: true,
type: 'tree', type: 'tree',
dicUrl: '/api/blade-workflow/design/category/tree', dicData: [],
props: { props: {
label: 'name', label: 'name',
value: 'id' value: 'id'
}, },
prop: "category", prop: "category",
search: true,
}, },
{ {
label: '版本', label: '版本',
@ -107,7 +117,16 @@ export default {
}, },
data: [], data: [],
row: '', row: '',
categoryVisible: false categoryVisible: false,
treeData: [],
treeOption: {
size: 'mini',
addBtn: false,
props: {
label: 'name',
value: 'id'
}
}
}; };
}, },
computed: { computed: {
@ -131,7 +150,23 @@ export default {
return process.env.NODE_ENV === "development" return process.env.NODE_ENV === "development"
} }
}, },
mounted() {
this.getCategoryList()
},
methods: { methods: {
getCategoryList() {
tree().then(res => {
const data = res.data.data
this.findObject(this.option.column, 'category').dicData = this.deepClone(data)
this.treeData = data
this.treeData.unshift({ id: '', name: '全部' })
})
},
nodeClick({ id }) {
this.categoryId = id
this.searchChange(this.query)
},
searchReset() { searchReset() {
this.query = {}; this.query = {};
this.onLoad(this.page); this.onLoad(this.page);
@ -152,6 +187,10 @@ export default {
}, },
onLoad(page, params = {}) { onLoad(page, params = {}) {
this.loading = true; this.loading = true;
if (this.categoryId) params['category'] = this.categoryId
else delete params['category']
getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => { getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
const data = res.data.data; const data = res.data.data;
this.page.total = data.total; this.page.total = data.total;

Loading…
Cancel
Save