|
|
|
|
@ -1,12 +1,19 @@ |
|
|
|
|
<template> |
|
|
|
|
<basic-container> |
|
|
|
|
<avue-crud :option="option" |
|
|
|
|
<el-container> |
|
|
|
|
<el-aside width="200px"> |
|
|
|
|
<avue-tree :option="treeOption" |
|
|
|
|
:data="treeData" |
|
|
|
|
@node-click="nodeClick"></avue-tree> |
|
|
|
|
</el-aside> |
|
|
|
|
<el-main style="margin-left: 10px;"> |
|
|
|
|
<avue-crud ref="crud" |
|
|
|
|
:option="option" |
|
|
|
|
:table-loading="loading" |
|
|
|
|
:data="data" |
|
|
|
|
:page.sync="page" |
|
|
|
|
:search.sync="query" |
|
|
|
|
:permission="permissionList" |
|
|
|
|
:before-open="beforeOpen" |
|
|
|
|
v-model="form" |
|
|
|
|
@row-update="rowUpdate" |
|
|
|
|
@row-save="rowSave" |
|
|
|
|
@ -18,6 +25,14 @@ |
|
|
|
|
@size-change="sizeChange" |
|
|
|
|
@refresh-change="onLoad(page, query)" |
|
|
|
|
@on-load="onLoad"> |
|
|
|
|
<template #menuLeft> |
|
|
|
|
<el-button type="success" |
|
|
|
|
size="mini" |
|
|
|
|
icon="el-icon-connection" |
|
|
|
|
v-if="permission.wf_design_model_change_category" |
|
|
|
|
@click="handleChangeCategory"> 更改分类 |
|
|
|
|
</el-button> |
|
|
|
|
</template> |
|
|
|
|
<template slot="menu" |
|
|
|
|
slot-scope="{row}"> |
|
|
|
|
<el-button v-if="permission.wf_design_form_design" |
|
|
|
|
@ -37,7 +52,8 @@ |
|
|
|
|
@click="handleHistory(row)">历史</el-button> |
|
|
|
|
</template> |
|
|
|
|
</avue-crud> |
|
|
|
|
|
|
|
|
|
</el-main> |
|
|
|
|
</el-container> |
|
|
|
|
<el-dialog :visible.sync="formVisible" |
|
|
|
|
append-to-body |
|
|
|
|
title="表单设计" |
|
|
|
|
@ -68,11 +84,21 @@ |
|
|
|
|
@submit="handleCopySubmit"> |
|
|
|
|
</avue-form> |
|
|
|
|
</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> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<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 customFields from '../mixins/custom-fields' |
|
|
|
|
@ -126,10 +152,19 @@ export default { |
|
|
|
|
search: true |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '备注', |
|
|
|
|
prop: 'remark', |
|
|
|
|
type: 'textarea', |
|
|
|
|
span: 24 |
|
|
|
|
label: '分类', |
|
|
|
|
prop: 'categoryId', |
|
|
|
|
type: 'tree', |
|
|
|
|
props: { |
|
|
|
|
label: 'name', |
|
|
|
|
value: 'id' |
|
|
|
|
}, |
|
|
|
|
dicData: [], |
|
|
|
|
rules: [{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请选择分类", |
|
|
|
|
trigger: "change" |
|
|
|
|
}], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '版本', |
|
|
|
|
@ -140,6 +175,7 @@ export default { |
|
|
|
|
label: '状态', |
|
|
|
|
prop: 'status', |
|
|
|
|
type: 'select', |
|
|
|
|
value: 1, |
|
|
|
|
dicData: [{ |
|
|
|
|
label: '可用', |
|
|
|
|
value: 1 |
|
|
|
|
@ -154,6 +190,12 @@ export default { |
|
|
|
|
}], |
|
|
|
|
search: true |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '备注', |
|
|
|
|
prop: 'remark', |
|
|
|
|
type: 'textarea', |
|
|
|
|
span: 24 |
|
|
|
|
}, |
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
data: [], |
|
|
|
|
@ -178,15 +220,25 @@ export default { |
|
|
|
|
}], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '备注', |
|
|
|
|
prop: 'remark', |
|
|
|
|
type: 'textarea', |
|
|
|
|
span: 24 |
|
|
|
|
label: '分类', |
|
|
|
|
prop: 'categoryId', |
|
|
|
|
type: 'tree', |
|
|
|
|
props: { |
|
|
|
|
label: 'name', |
|
|
|
|
value: 'id' |
|
|
|
|
}, |
|
|
|
|
dicData: [], |
|
|
|
|
rules: [{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请选择分类", |
|
|
|
|
trigger: "change" |
|
|
|
|
}], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '状态', |
|
|
|
|
prop: 'status', |
|
|
|
|
type: 'select', |
|
|
|
|
value: 1, |
|
|
|
|
dicData: [{ |
|
|
|
|
label: '可用', |
|
|
|
|
value: 1 |
|
|
|
|
@ -199,11 +251,28 @@ export default { |
|
|
|
|
message: "请选择状态", |
|
|
|
|
trigger: "change" |
|
|
|
|
}], |
|
|
|
|
search: true |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '备注', |
|
|
|
|
prop: 'remark', |
|
|
|
|
type: 'textarea', |
|
|
|
|
span: 24 |
|
|
|
|
},] |
|
|
|
|
}, |
|
|
|
|
isNewVersion: false, |
|
|
|
|
isCopy: false, |
|
|
|
|
copyVisible: false |
|
|
|
|
copyVisible: false, |
|
|
|
|
categoryVisible: false, |
|
|
|
|
treeData: [], |
|
|
|
|
treeOption: { |
|
|
|
|
size: 'mini', |
|
|
|
|
addBtn: false, |
|
|
|
|
props: { |
|
|
|
|
label: 'name', |
|
|
|
|
value: 'id' |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
|
@ -226,8 +295,39 @@ export default { |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
this.getDefaultValues() |
|
|
|
|
this.getCategoryList() |
|
|
|
|
}, |
|
|
|
|
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() { |
|
|
|
|
this.$refs.formDesign.getData('string').then(data => { |
|
|
|
|
if (this.isCopy) { |
|
|
|
|
@ -388,12 +488,6 @@ export default { |
|
|
|
|
this.$refs.crud.toggleSelection(); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
beforeOpen(done, type) { |
|
|
|
|
if (["add"].includes(type)) { |
|
|
|
|
this.$set(this.form, 'status', 1) |
|
|
|
|
} |
|
|
|
|
done(); |
|
|
|
|
}, |
|
|
|
|
searchReset() { |
|
|
|
|
this.query = {}; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
@ -401,7 +495,7 @@ export default { |
|
|
|
|
searchChange(params, done) { |
|
|
|
|
this.query = params; |
|
|
|
|
this.onLoad(this.page, params); |
|
|
|
|
done() |
|
|
|
|
if (done) done() |
|
|
|
|
}, |
|
|
|
|
selectionChange(list) { |
|
|
|
|
this.selectionList = list; |
|
|
|
|
@ -414,6 +508,10 @@ export default { |
|
|
|
|
}, |
|
|
|
|
onLoad(page, params = {}) { |
|
|
|
|
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 => { |
|
|
|
|
const data = res.data.data; |
|
|
|
|
this.page.total = data.total; |
|
|
|
|
|