|
|
|
|
@ -1,52 +1,67 @@ |
|
|
|
|
<template> |
|
|
|
|
<basic-container> |
|
|
|
|
<avue-crud :option="option" |
|
|
|
|
:table-loading="loading" |
|
|
|
|
:data="data" |
|
|
|
|
ref="crud" |
|
|
|
|
v-model="form" |
|
|
|
|
:page.sync="page" |
|
|
|
|
:permission="permissionList" |
|
|
|
|
@row-del="rowDel" |
|
|
|
|
@search-change="searchChange" |
|
|
|
|
@search-reset="searchReset" |
|
|
|
|
@selection-change="selectionChange" |
|
|
|
|
@current-change="currentChange" |
|
|
|
|
@size-change="sizeChange" |
|
|
|
|
@refresh-change="onLoad(page, query)" |
|
|
|
|
@on-load="onLoad"> |
|
|
|
|
<template slot="menuLeft"> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
size="mini" |
|
|
|
|
icon="el-icon-plus" |
|
|
|
|
v-if="permission.wf_design_model_add" |
|
|
|
|
@click="handleDesign({})"> 新 增 |
|
|
|
|
</el-button> |
|
|
|
|
</template> |
|
|
|
|
<template slot="menu" |
|
|
|
|
slot-scope="{row}"> |
|
|
|
|
<el-button v-if="permission.wf_design_model_design" |
|
|
|
|
type="text" |
|
|
|
|
icon="el-icon-edit" |
|
|
|
|
size="small" |
|
|
|
|
@click="handleDesign(row)">设计</el-button> |
|
|
|
|
<el-button v-if="permission.wf_design_model_deploy" |
|
|
|
|
type="text" |
|
|
|
|
icon="el-icon-s-promotion" |
|
|
|
|
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-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 :option="option" |
|
|
|
|
:table-loading="loading" |
|
|
|
|
:data="data" |
|
|
|
|
ref="crud" |
|
|
|
|
v-model="form" |
|
|
|
|
:page.sync="page" |
|
|
|
|
:permission="permissionList" |
|
|
|
|
@row-del="rowDel" |
|
|
|
|
@search-change="searchChange" |
|
|
|
|
@search-reset="searchReset" |
|
|
|
|
@selection-change="selectionChange" |
|
|
|
|
@current-change="currentChange" |
|
|
|
|
@size-change="sizeChange" |
|
|
|
|
@refresh-change="onLoad(page, query)" |
|
|
|
|
@on-load="onLoad"> |
|
|
|
|
<template slot="menuLeft"> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
size="mini" |
|
|
|
|
icon="el-icon-plus" |
|
|
|
|
v-if="permission.wf_design_model_add" |
|
|
|
|
@click="handleDesign({})"> 新 增 |
|
|
|
|
</el-button> |
|
|
|
|
<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_model_design" |
|
|
|
|
type="text" |
|
|
|
|
icon="el-icon-edit" |
|
|
|
|
size="small" |
|
|
|
|
@click="handleDesign(row)">设计</el-button> |
|
|
|
|
<el-button v-if="permission.wf_design_model_deploy" |
|
|
|
|
type="text" |
|
|
|
|
icon="el-icon-s-promotion" |
|
|
|
|
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" |
|
|
|
|
append-to-body |
|
|
|
|
@ -63,8 +78,10 @@ |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<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 { tree } from '@/api/plugin/workflow/category'; |
|
|
|
|
|
|
|
|
|
import { mapGetters } from "vuex"; |
|
|
|
|
|
|
|
|
|
import UserOption from '../process/components/user-option.vue' |
|
|
|
|
@ -110,6 +127,21 @@ export default { |
|
|
|
|
overHidden: true, |
|
|
|
|
search: true |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '分类', |
|
|
|
|
prop: 'categoryId', |
|
|
|
|
type: 'tree', |
|
|
|
|
props: { |
|
|
|
|
label: 'name', |
|
|
|
|
value: 'id' |
|
|
|
|
}, |
|
|
|
|
dicData: [], |
|
|
|
|
rules: [{ |
|
|
|
|
required: true, |
|
|
|
|
message: "请选择分类", |
|
|
|
|
trigger: "change" |
|
|
|
|
}], |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: "描述", |
|
|
|
|
prop: "description", |
|
|
|
|
@ -130,6 +162,15 @@ export default { |
|
|
|
|
roleUrl: '/api/blade-system/search/role', |
|
|
|
|
deptUrl: '/api/blade-system/search/dept', |
|
|
|
|
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(","); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
this.getCategoryList() |
|
|
|
|
}, |
|
|
|
|
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) { |
|
|
|
|
list.forEach(l => l.val = l.value) |
|
|
|
|
|
|
|
|
|
@ -179,11 +244,21 @@ export default { |
|
|
|
|
}, |
|
|
|
|
handleDeploySubmit(form, done) { |
|
|
|
|
const { id, category } = form |
|
|
|
|
deploy({ id, category }).then(() => { |
|
|
|
|
this.$message.success("部署成功") |
|
|
|
|
done() |
|
|
|
|
this.categoryVisible = false |
|
|
|
|
}) |
|
|
|
|
if (this.categoryType == 'change') { |
|
|
|
|
changeCategory({ ids: this.ids, category }).then(() => { |
|
|
|
|
this.$message.success('修改成功') |
|
|
|
|
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) { |
|
|
|
|
this.form.id = row.id |
|
|
|
|
@ -265,6 +340,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; |
|
|
|
|
|