工作流增删改查功能完善

This commit is contained in:
QM303176530
2020-10-31 00:03:49 +08:00
parent 32abd69c16
commit d6bc0572c2
5 changed files with 314 additions and 334 deletions

View File

@@ -6,10 +6,7 @@
<el-input placeholder="搜索条件" v-model="searchInfo.name"></el-input>
</el-form-item>
<el-form-item label="流程标题">
<el-input
placeholder="搜索条件"
v-model="searchInfo.label"
></el-input>
<el-input placeholder="搜索条件" v-model="searchInfo.label"></el-input>
</el-form-item>
<el-form-item>
<el-button @click="onSubmit" type="primary">查询</el-button>
@@ -18,20 +15,10 @@
<el-popover placement="top" v-model="deleteVisible" width="160">
<p>确定要删除吗</p>
<div style="text-align: right; margin: 0">
<el-button @click="deleteVisible = false" size="mini" type="text"
>取消</el-button
>
<el-button @click="onDelete" size="mini" type="primary"
>确定</el-button
>
<el-button @click="deleteVisible = false" size="mini" type="text">取消</el-button>
<el-button @click="onDelete" size="mini" type="primary">确定</el-button>
</div>
<el-button
icon="el-icon-delete"
size="mini"
slot="reference"
type="danger"
>批量删除</el-button
>
<el-button icon="el-icon-delete" size="mini" slot="reference" type="danger">批量删除</el-button>
</el-popover>
</el-form-item>
</el-form>
@@ -46,72 +33,38 @@
tooltip-effect="dark"
>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column label="日期" width="180">
<el-table-column label="日期" width="180">
<template slot-scope="scope">{{scope.row.CreatedAt|formatDate}}</template>
</el-table-column>
<el-table-column
label="流程名称"
prop="name"
width="120"
></el-table-column>
<el-table-column label="流程名称" prop="name" width="120"></el-table-column>
<el-table-column
label="分类"
prop="category"
width="120"
></el-table-column>
<el-table-column label="分类" prop="category" width="120"></el-table-column>
<el-table-column label="类型" prop="clazz" width="120"></el-table-column>
<el-table-column
label="流程标题"
prop="label"
width="120"
></el-table-column>
<el-table-column label="流程标题" prop="label" width="120"></el-table-column>
<el-table-column label="是否隐藏图标" prop="hideIcon" width="120">
<template slot-scope="scope">{{
<template slot-scope="scope">
{{
scope.row.hideIcon | formatBoolean
}}</template>
}}
</template>
</el-table-column>
<el-table-column
label="详细介绍"
prop="description"
width="120"
></el-table-column>
<el-table-column label="详细介绍" prop="description" width="120"></el-table-column>
<el-table-column label="按钮组">
<template slot-scope="scope">
<el-button
@click="updateWorkflowProcess(scope.row)"
size="small"
type="primary"
>变更</el-button
>
<el-button class="table-button" @click="updateWorkflowProcess(scope.row)" size="small" type="primary">变更</el-button>
<el-button class="table-button" @click="viewWorkflowProcess(scope.row)" size="small" type="warning">查看</el-button>
<el-popover placement="top" width="160" v-model="scope.row.visible">
<p>确定要删除吗</p>
<div style="text-align: right; margin: 0">
<el-button
size="mini"
type="text"
@click="scope.row.visible = false"
>取消</el-button
>
<el-button
type="primary"
size="mini"
@click="deleteWorkflowProcess(scope.row)"
>确定</el-button
>
<el-button size="mini" type="text" @click="scope.row.visible = false">取消</el-button>
<el-button type="primary" size="mini" @click="deleteWorkflowProcess(scope.row)">确定</el-button>
</div>
<el-button
type="danger"
icon="el-icon-delete"
size="mini"
slot="reference"
>删除</el-button
>
<el-button type="danger" icon="el-icon-delete" size="mini" slot="reference">删除</el-button>
</el-popover>
</template>
</el-table-column>
@@ -132,12 +85,12 @@
<script>
import {
deleteWorkflowProcess,
deleteWorkflowProcessByIds,
getWorkflowProcessList
} from "@/api/workflowProcess"; // 此处请自行替换地址
deleteWorkflowProcess,
deleteWorkflowProcessByIds,
getWorkflowProcessList
} from "@/api/workflowProcess"; // 此处请自行替换地址
import { formatTimeToStr } from "@/utils/date";
import infoList from "@/components/mixins/infoList";
import infoList from "@/mixins/infoList";
export default {
name: "WorkflowProcess",
@@ -148,7 +101,7 @@ export default {
dialogFormVisible: false,
visible: false,
deleteVisible: false,
multipleSelection: [],
multipleSelection: []
};
},
filters: {
@@ -162,46 +115,58 @@ export default {
},
formatBoolean: function(bool) {
if (bool != null) {
return bool ? "是" :"否";
return bool ? "是" : "否";
} else {
return "";
}
}
},
methods: {
//条件搜索前端看此方法
onSubmit() {
this.page = 1
this.pageSize = 10
if (this.searchInfo.hideIcon==""){
this.searchInfo.hideIcon=null
}
this.getTableData()
},
handleSelectionChange(val) {
this.multipleSelection = val
},
async onDelete() {
const ids = []
this.multipleSelection &&
this.multipleSelection.map(item => {
ids.push(item.id)
})
const res = await deleteWorkflowProcessByIds({ ids })
if (res.code == 0) {
this.$message({
type: 'success',
message: '删除成功'
})
this.deleteVisible = false
this.getTableData()
}
},
//条件搜索前端看此方法
onSubmit() {
this.page = 1;
this.pageSize = 10;
if (this.searchInfo.hideIcon == "") {
this.searchInfo.hideIcon = null;
}
this.getTableData();
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
async onDelete() {
const ids = [];
this.multipleSelection &&
this.multipleSelection.map(item => {
ids.push(item.id);
});
const res = await deleteWorkflowProcessByIds({ ids });
if (res.code == 0) {
this.$message({
type: "success",
message: "删除成功"
});
this.deleteVisible = false;
this.getTableData();
}
},
async updateWorkflowProcess(row) {
this.$router.push({name:"workflowCreate",query:{
id:row.id,
type:'edit'
}})
this.$router.push({
name: "workflowCreate",
query: {
id: row.id,
type: "edit"
}
});
},
async viewWorkflowProcess(row) {
this.$router.push({
name: "workflowCreate",
query: {
id: row.id,
type: "view"
}
});
},
async deleteWorkflowProcess(row) {
this.visible = false;
@@ -219,7 +184,8 @@ export default {
}
},
async created() {
await this.getTableData();}
await this.getTableData();
}
};
</script>