clay : 退回做了一半 #31

Merged
clay merged 2 commits from master into pro 2023-03-01 07:57:07 +00:00
19 changed files with 620 additions and 51 deletions

View File

@ -0,0 +1,70 @@
import request from '@/api/request.js'
// 查询万能查询列表
export function listQuery(query) {
return request({
url: '/custom-query/uni/query',
method: 'get',
params: query
})
}
// 查询万能查询详细
export function getQuery(id) {
return request({
url: '/custom-query/uni/query/' + id,
method: 'get'
})
}
// 新增万能查询
export function addQuery(data) {
return request({
url: '/custom-query/uni/query',
method: 'post',
data: data
})
}
// 修改万能查询
export function updateQuery(data) {
return request({
url: '/custom-query/uni/query',
method: 'put',
data: data
})
}
// 删除万能查询
export function delQuery(id) {
return request({
url: '/custom-query/uni/query/' + id,
method: 'delete'
})
}
// 导出万能查询
export function exportQuery(query) {
return request({
url: '/custom-query/uni/query/export',
method: 'get',
params: query
})
}
// 获取条件
export function getQueryInfo(id) {
return request({
url: '/query/'+id,
method: 'get',
})
}
// 修改条件
export function editQueryInfo(data) {
return request({
url: '/query',
method: 'put',
data: data
})
}

View File

@ -0,0 +1,94 @@
<template>
<div :class="{'hidden':hidden}" class="pagination-container">
<el-pagination
:background="background"
:current-page.sync="currentPage"
:page-size.sync="pageSize"
:layout="layout"
:page-sizes="pageSizes"
:total="total"
v-bind="$attrs"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
/>
</div>
</template>
<script>
export default {
name: 'Pagination',
props: {
total: {
required: true,
type: Number
},
page: {
type: Number,
default: 1
},
limit: {
type: Number,
default: 20
},
pageSizes: {
type: Array,
default() {
return [10, 20, 30, 50]
}
},
layout: {
type: String,
default: 'total, sizes, prev, pager, next, jumper'
},
background: {
type: Boolean,
default: true
},
autoScroll: {
type: Boolean,
default: true
},
hidden: {
type: Boolean,
default: false
}
},
computed: {
currentPage: {
get() {
return this.page
},
set(val) {
this.$emit('update:page', val)
}
},
pageSize: {
get() {
return this.limit
},
set(val) {
this.$emit('update:limit', val)
}
}
},
methods: {
handleSizeChange(val) {
this.$emit('pagination', { page: this.currentPage, limit: val })
},
handleCurrentChange(val) {
this.$emit('pagination', { page: val, limit: this.pageSize })
}
}
}
</script>
<style scoped>
.pagination-container {
background: #fff;
padding: 32px 16px;
}
.pagination-container.hidden {
display: none;
}
</style>

View File

@ -0,0 +1,38 @@
<!-- @author Shiyn/ huangmx 20200807优化-->
<template>
<div class="top-right-btn">
<el-row>
<el-tooltip class="item" effect="dark" :content="showSearch ? '隐藏搜索' : '显示搜索'" placement="top">
<el-button size="mini" circle icon="el-icon-search" @click="toggleSearch()" />
</el-tooltip>
<el-tooltip class="item" effect="dark" content="刷新" placement="top">
<el-button size="mini" circle icon="el-icon-refresh" @click="refresh()" />
</el-tooltip>
</el-row>
</div>
</template>
<script>
export default {
name: "RightToolbar",
data() {
return {};
},
props: {
showSearch: {
type: Boolean,
default: true,
},
},
methods: {
//
toggleSearch() {
this.$emit("update:showSearch", !this.showSearch);
},
//
refresh() {
this.$emit("queryTable");
},
},
};
</script>

View File

@ -70,7 +70,7 @@ export default {
this.$set(user, "color", "#0bbd87")
}
//
if (state === 'process') {
if (state === 'running') {
this.$set(user, "icon", "el-icon-loading")
this.$set(user, "color", "#f78f5f")
}

View File

@ -9,7 +9,7 @@
<!--显示退回节点弹出框-->
<div v-if="type === 4" style="margin-bottom: 10px">
<span>回退节点</span>
<el-select v-if="userTaskOption.length >0 " v-model="backNode" slot="prepend" placeholder="选择要回退到的节点">
<el-select v-if="userTaskOption.length >0 " v-model="rollBackId" slot="prepend" placeholder="选择要回退到的节点">
<el-option v-for="(option,index) in userTaskOption" :key="index"
:label="option.label" :value="option.value"/>
</el-select>
@ -140,7 +140,7 @@ export default {
authorization: localStorage.getItem("token")
},
context: null,
backNode: null,
rollBackId: null,
dialogImageUrl: '',
dialogVisible: false
};
@ -196,7 +196,7 @@ export default {
deleteFile(file.id).then(res => {
if (res.code === 1000) {
this.$message.success("删除成功")
this.fileList.splice( this.fileList.findIndex((item)=>item.id===file.id),1)
this.fileList.splice(this.fileList.findIndex((item) => item.id === file.id), 1)
}
})
},
@ -222,7 +222,8 @@ export default {
})
let data = {
context: this.context,
attachments: fileList
attachments: fileList,
rollBackId: this.rollBackId,
}
this.$emit("ok", data, this.type)
this.visible = false;

View File

@ -82,7 +82,6 @@ export default {
//
getRole() {
getRole().then(res => {
console.log('系统角色',res.data);
this.roleList= res.data.map(function (val){
return {roleId:val.value,roleName:val.label}
})

View File

@ -48,6 +48,13 @@ Vue.prototype.$deepCopy = function (obj) {
return JSON.parse(JSON.stringify(obj))
}
import Pagination from "@/components/Pagination";
//自定义表格工具扩展
import RightToolbar from "@/components/RightToolbar"
// 全局组件挂载
Vue.component('Pagination', Pagination)
Vue.component('RightToolbar', RightToolbar)
new Vue({
router,

View File

@ -33,6 +33,12 @@ const router = new Router({
component: () => import("@/views/admin/FormsPanel.vue"),
meta: {title: '表单列表', viewport: viewport}
},
{
path: "/query",
name: "query",
component: () => import("@/views/query/index.vue"),
meta: {title: '自定义查询', viewport: viewport}
},
{
path: "/admin/design",
name: "design",

View File

@ -14,6 +14,8 @@ export default new Vuex.Store({
runningList: [],
endList: [],
noTakeList: [],
refuseList: [],
passList: [],
design:{},
},
mutations: {

View File

@ -32,21 +32,27 @@ export default {
dom() {
return this.$store.state.design.process;
},
viewer(){
viewer() {
return this.$store.state.diagramMode === 'viewer'
},
preview(){
preview() {
return this.$store.state.preview;
},
runningList(){
runningList() {
return this.$store.state.runningList
},
endList(){
endList() {
return this.$store.state.endList
},
noTakeList(){
noTakeList() {
return this.$store.state.noTakeList
},
refuseList() {
return this.$store.state.refuseList
},
passList() {
return this.$store.state.passList
},
},
render(h, ctx) {
this.nodeMap.clear()
@ -66,12 +72,14 @@ export default {
let headerBgc = '#ff943e'
if (this.runningList.includes(node.id)) {
headerBgc = '#1e90ff'
}
else if (this.endList.includes(node.id)) {
} else if (this.endList.includes(node.id)) {
headerBgc = '#20b2aa'
}
else if (this.noTakeList.includes(node.id)) {
} else if (this.noTakeList.includes(node.id)) {
headerBgc = '#909399'
} else if (this.refuseList.includes(node.id)) {
headerBgc = '#f56c6c'
} else if (this.passList.includes(node.id)) {
headerBgc = '#ff943e'
}
node.props.headerBgc = headerBgc
}
@ -160,7 +168,7 @@ export default {
this.nodeMap.set(nodeItem.id, nodeItem)
this.parentMap.set(nodeItem.parentId, nodeItem)
})
}catch (e){
} catch (e) {
}
},
//idmap

View File

@ -88,9 +88,7 @@ export default {
});
},
loadFormConfig(formItems) {
console.log(formItems)
formItems.forEach(item => {
console.log(item.perm === 'E',item,"item")
if (item.name === 'SpanLayout') {
this.loadFormConfig(item.props.items)
} else {
@ -98,11 +96,8 @@ export default {
if (this.isPreview) {
this.$set(item, 'perm', this.model)
}
console.log(item.perm === 'E',item,"item")
if (item.perm === 'E') {
console.log("进去了")
if (item.props.required) {
console.log("开始制作权限了")
this.$set(this.rules, item.id, [{
type: item.valueType === 'Array' ? 'array' : undefined,
required: true,
@ -112,7 +107,6 @@ export default {
}
}
})
console.log(this.rules)
}
}
}

View File

@ -82,7 +82,6 @@ export default {
}
},
created() {
console.log(this.operationList)
this.init()
},
methods: {
@ -120,22 +119,18 @@ export default {
break
}
// let operationListNew = []
console.log(this.operationList.length, "sdjshjdhasjds")
for (let i = 0;i<this.operationList.length;i++) {
let operationNew = this.initOperationFun(this.operationList[i])
console.log(operationNew, "sdjshjdhasjds")
let userList = []
for (let user of operationNew.userInfo) {
let userNew = this.initUser(user)
userList.push(userNew)
}
console.log(userList, "userList")
operationNew.userInfo = userList
// operationListNew.push(operationNew)
// this.operationList.push(operationNew)
this.operationList[i] = operationNew
}
console.log(this.operationList, "operationListNew")
},
//
getAttachmentList(attachments, image) {
@ -160,7 +155,7 @@ export default {
this.$set(user, "color", "#0bbd87")
}
//
if (state === 'process') {
if (state === 'running') {
this.$set(user, "icon", "el-icon-loading")
this.$set(user, "color", "#f78f5f")
}
@ -176,7 +171,6 @@ export default {
return user;
},
initOperationFun(operation) {
console.log("开始处理内容了")
let state = operation.state
let type = operation.operation
//
@ -196,7 +190,7 @@ export default {
this.$set(operation, "color", "#c0c4cc")
}
//
if (state === 'process') {
if (state === 'running') {
this.$set(operation, "icon", "el-icon-loading")
this.$set(operation, "color", "#f78f5f")
this.$set(operation, "remark", operation.userInfo.name + ' (处理中)')

View File

@ -1,7 +1,7 @@
<template>
<div class="node">
<!-- 并行分支选择后右侧出现操作面板,占时不需要 <div class="node-body" @click="$emit('selected')">-->
<div class="node-body" @click="$emit('selected')">
<div v-if="designStart()" class="node-body" @click="$emit('selected')">
<div class="node-body-left" @click.stop="$emit('leftMove')" v-if="level > 1 && designStart() ">
<i class="el-icon-arrow-left"></i>
</div>
@ -27,7 +27,7 @@
</div>
</div>
<div class="node-footer">
<div class="btn">
<div class="btn" :style="(designStart() ? '' : 'height:0px')">
<insert-button v-if="designStart()" @insertNode="type => $emit('insertNode', type)"></insert-button>
</div>
</div>

View File

@ -0,0 +1,352 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="名称" prop="uqName">
<el-input
v-model="queryParams.uqName"
placeholder="请输入名称"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="描述" prop="uqDescribe">
<el-input
v-model="queryParams.uqDescribe"
placeholder="请输入描述"
clearable
size="small"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="创建时间">
<el-date-picker
v-model="daterangeCreateTime"
size="small"
style="width: 240px"
value-format="yyyy-MM-dd"
type="daterange"
range-separator="-"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
>修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出
</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="queryList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"/>
<el-table-column type="index" width="50"></el-table-column>
<el-table-column label="名称" align="center" prop="uqName"/>
<el-table-column label="描述" align="center" prop="uqDescribe"/>
<el-table-column label="创建时间" align="center" prop="createTime">
<template slot-scope="scope">
<span>{{ scope.row.createTime }}</span>
</template>
</el-table-column>
<el-table-column label="更新时间" align="center" prop="updateTime">
<template slot-scope="scope">
<span>{{ scope.row.updateTime }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<span v-if="scope.row.isRelease===2">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
type="text"
size="small"
icon="el-icon-edit-outline"
@click="handleEditTable(scope.row)"
>设计</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
</span>
<span v-if="scope.row.isRelease===1">
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handRelease(scope.row.id)"
>撤销</el-button>
</span>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改万能查询对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="名称" prop="uqName">
<el-input v-model="form.uqName" placeholder="请输入名称"/>
</el-form-item>
<el-form-item label="描述" prop="uqDescribe">
<el-input v-model="form.uqDescribe" placeholder="请输入描述"/>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {listQuery, getQuery, delQuery, addQuery, updateQuery, exportQuery, Release} from "@/api/query";
import {Message} from "element-ui";
export default {
name: "Query",
components: {},
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
queryList: [],
//
title: "",
//
open: false,
//
daterangeCreateTime: [],
//
queryParams: {
pageNum: 1,
pageSize: 10,
uqName: null,
uqDescribe: null,
type: 1
},
//
form: {},
//
rules: {
uqName: [
{required: true, message: "名称不能为空}", trigger: "blur"},
],
uqDescribe: [
{required: true, message: "描述不能为空}", trigger: "blur"},
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询万能查询列表 */
getList() {
this.loading = true;
listQuery(this.queryParams).then(response => {
let data = response.data
this.queryList = data.rows;
this.total = data.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
uqName: null,
uqDescribe: null,
};
// this.$refs['form'].resetFields()
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
handleEditTable(row) {
this.$router.push("/query/edit/" + row.id);
},
/** 发布与撤销 */
handRelease(id) {
let that = this
this.$confirm('是否确认撤销该查询?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function () {
let data = {
id: id,
isRelease: 2
}
Release(data).then(res => {
Message({
message: res.msg,
type: 'success'
})
that.getList()
})
})
},
/** 重置按钮操作 */
resetQuery() {
this.daterangeCreateTime = [];
this.$refs.queryForm.resetFields()
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length !== 1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加自定义查询";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getQuery(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改自定义查询";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
this.form.type = 1
if (valid) {
if (this.form.id != null) {
updateQuery(this.form).then(response => {
Message({
message: "修改成功",
type: 'success'
})
this.open = false;
this.getList();
});
} else {
addQuery(this.form).then(response => {
Message({
message: "新增成功",
type: 'success'
})
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$confirm('是否确认删除自定义查询编号为"' + ids + '"的数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function () {
return delQuery(ids);
}).then(() => {
this.getList();
this.msgSuccess("删除成功");
})
},
/** 导出按钮操作 */
handleExport() {
const queryParams = this.queryParams;
this.$confirm('是否确认导出所有自定义查询数据项?', "警告", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
}).then(function () {
return exportQuery(queryParams);
}).then(response => {
this.download(response.msg);
})
}
}
};
</script>

View File

@ -133,6 +133,8 @@ export default {
that.$store.state.runningList = data.runningList;
that.$store.state.endList = data.endList;
that.$store.state.noTakeList = data.noTakeList;
that.$store.state.refuseList = data.refuseList;
that.$store.state.passList = data.passList;
this.loading = false;
console.log(data, "获取到的结果数据")
})
@ -144,7 +146,6 @@ export default {
formData: {},
formItems: [],
processList: [],
operationList: [],
};
this.loading = true;
@ -152,6 +153,8 @@ export default {
this.$store.state.runningList = [];
this.$store.state.endList = [];
this.$store.state.noTakeList = [];
this.$store.state.refuseList = [];
this.$store.state.passList = [];
this.$store.state.diagramMode = "viewer";
this.$store.state.preview = false;
},

View File

@ -172,11 +172,12 @@ export default {
that.taskData = res.data;
that.$store.state.design = that.taskData;
that.$store.state.userTaskOption = that.taskData.userTaskOption;
console.log(that.taskData.userTaskOption,"that.taskData.userTaskOption")
this.loading = false;
});
},
submitTask() {
console.log("wqeqwqewqe")
this.$refs.taskViewForm.validate(valid =>{
if (valid){
let params = {

View File

@ -74,7 +74,6 @@ export default {
});
},
validate(call) {
console.log("我被调用了")
this.$refs.initiateForm.validate(call);
}
}

View File

@ -132,6 +132,8 @@ export default {
that.$store.state.runningList = data.runningList;
that.$store.state.endList = data.endList;
that.$store.state.noTakeList = data.noTakeList;
that.$store.state.refuseList = data.refuseList;
that.$store.state.passList = data.passList;
this.loading = false;
})
},
@ -143,13 +145,14 @@ export default {
formData: {},
formItems: [],
processList: [],
operationList: [],
};
this.loading = true;
this.$store.state.design = this.taskData;
this.$store.state.runningList = [];
this.$store.state.endList = [];
this.$store.state.noTakeList = [];
this.$store.state.refuseList = [];
this.$store.state.passList = [];
this.$store.state.diagramMode = "viewer";
this.$store.state.preview = false;
},

View File

@ -51,9 +51,7 @@ export default {
taskId: this.taskId,
formData : JSON.stringify(that.taskData.formData)
}
console.log(params,"需要提交的数据")
completeTask(params).then(res =>{
console.log(res)
that.$parent.approveOpen = false
that.$parent.getList()
that.$message.success(res.msg)