会签流程配置功能完善
This commit is contained in:
parent
95ba75749e
commit
7cc2763b38
|
|
@ -1,48 +1,116 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 会签配置管理列表接口
|
||||
export function getConfigListApi(query) {
|
||||
return request({
|
||||
url: '/material/sysWorkflowType/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
// 会签配置管理--新增
|
||||
export function addConfigApi(data) {
|
||||
return request({
|
||||
url: '/material/sysWorkflowType/add',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 会签配置管理--修改
|
||||
export function editConfigApi(data) {
|
||||
return request({
|
||||
url: '/material/sysWorkflowType/update',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 会签配置管理--删除
|
||||
export function deleteConfigApi(data) {
|
||||
return request({
|
||||
url: '/material/sysWorkflowType/delete',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 会签配置流程列表
|
||||
export function getConfigNodeListApi(query) {
|
||||
return request({
|
||||
url: '/material/sysWorkflowNode/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 会签配置流程--新增
|
||||
export function addConfigNodeApi(data) {
|
||||
return request({
|
||||
url: '/material/sysWorkflowNode/add',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 会签配置流程--修改
|
||||
export function editConfigNodeApi(data) {
|
||||
return request({
|
||||
url: '/material/sysWorkflowNode/update',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 会签配置流程--删除
|
||||
export function deleteConfigNodeApi(data) {
|
||||
return request({
|
||||
url: '/material/sysWorkflowNode/delete',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*****************************************************************************************************************************************************
|
||||
*
|
||||
*/
|
||||
|
||||
//会签配置管理列表信息
|
||||
export function getConfigList(query) {
|
||||
return request({
|
||||
url: '/material/sign_config/list',
|
||||
method: 'get',
|
||||
params: query,
|
||||
})
|
||||
return request({
|
||||
url: '/material/sign_config/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 会签配置管理--新增
|
||||
export function addConfig(data) {
|
||||
return request({
|
||||
url: '/material/sign_config/addConfig',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
return request({
|
||||
url: '/material/sign_config/addConfig',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//会签配置管理--详细信息
|
||||
export function getConfigDetail(id) {
|
||||
return request({
|
||||
url: '/material/sign_config/'+ id,
|
||||
method: 'get',
|
||||
})
|
||||
return request({
|
||||
url: '/material/sign_config/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 会签配置管理--修改
|
||||
export function editConfig(data) {
|
||||
return request({
|
||||
url: '/material/sign_config/editConfig',
|
||||
method: 'post',
|
||||
data: data,
|
||||
})
|
||||
return request({
|
||||
url: '/material/sign_config/editConfig',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
// 会签配置管理--删除
|
||||
export function delConfig(id) {
|
||||
return request({
|
||||
url: '/material/sign_config/delConfig/' + id,
|
||||
method: 'post',
|
||||
})
|
||||
return request({
|
||||
url: '/material/sign_config/delConfig/' + id,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -30,159 +30,190 @@ import Layout from '@/layout'
|
|||
|
||||
// 公共路由
|
||||
export const constantRoutes = [
|
||||
{
|
||||
path: '/redirect',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: '/redirect/:path(.*)',
|
||||
component: () => import('@/views/redirect')
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/login',
|
||||
component: () => import('@/views/login1'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/register',
|
||||
component: () => import('@/views/register1'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/404',
|
||||
component: () => import('@/views/error/404'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/401',
|
||||
component: () => import('@/views/error/401'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
component: Layout,
|
||||
redirect: 'index',
|
||||
children: [
|
||||
{
|
||||
path: 'index',
|
||||
component: () => import('@/views/index'),
|
||||
name: 'Index',
|
||||
meta: { title: '首页', icon: 'dashboard', affix: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/qrCode/qrCodePage',
|
||||
component: () => import('@/views/qrCode/qrCode'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/user',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
redirect: 'noredirect',
|
||||
children: [
|
||||
{
|
||||
path: 'profile',
|
||||
component: () => import('@/views/system/user/profile/index'),
|
||||
name: 'Profile',
|
||||
meta: { title: '个人中心', icon: 'user' }
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
path: '/redirect',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: '/redirect/:path(.*)',
|
||||
component: () => import('@/views/redirect')
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/login',
|
||||
component: () => import('@/views/login1'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/register',
|
||||
component: () => import('@/views/register1'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/404',
|
||||
component: () => import('@/views/error/404'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/401',
|
||||
component: () => import('@/views/error/401'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
component: Layout,
|
||||
redirect: 'index',
|
||||
children: [
|
||||
{
|
||||
path: 'index',
|
||||
component: () => import('@/views/index'),
|
||||
name: 'Index',
|
||||
meta: { title: '首页', icon: 'dashboard', affix: true }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/qrCode/qrCodePage',
|
||||
component: () => import('@/views/qrCode/qrCode'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/user',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
redirect: 'noredirect',
|
||||
children: [
|
||||
{
|
||||
path: 'profile',
|
||||
component: () => import('@/views/system/user/profile/index'),
|
||||
name: 'Profile',
|
||||
meta: { title: '个人中心', icon: 'user' }
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
// 动态路由,基于用户权限动态去加载
|
||||
export const dynamicRoutes = [
|
||||
{
|
||||
path: '/system/user-auth',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
permissions: ['system:user:edit'],
|
||||
children: [
|
||||
{
|
||||
path: 'role/:userId(\\d+)',
|
||||
component: () => import('@/views/system/user/authRole'),
|
||||
name: 'AuthRole',
|
||||
meta: { title: '分配角色', activeMenu: '/system/user' }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/system/role-auth',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
permissions: ['system:role:edit'],
|
||||
children: [
|
||||
{
|
||||
path: 'user/:roleId(\\d+)',
|
||||
component: () => import('@/views/system/role/authUser'),
|
||||
name: 'AuthUser',
|
||||
meta: { title: '分配用户', activeMenu: '/system/role' }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/system/dict-data',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
permissions: ['system:dict:list'],
|
||||
children: [
|
||||
{
|
||||
path: 'index/:dictId(\\d+)',
|
||||
component: () => import('@/views/system/dict/data'),
|
||||
name: 'Data',
|
||||
meta: { title: '字典数据', activeMenu: '/system/dict' }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/monitor/job-log',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
permissions: ['monitor:job:list'],
|
||||
children: [
|
||||
{
|
||||
path: 'index/:jobId(\\d+)',
|
||||
component: () => import('@/views/monitor/job/log'),
|
||||
name: 'JobLog',
|
||||
meta: { title: '调度日志', activeMenu: '/monitor/job' }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/tool/gen-edit',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
permissions: ['tool:gen:edit'],
|
||||
children: [
|
||||
{
|
||||
path: 'index/:tableId(\\d+)',
|
||||
component: () => import('@/views/tool/gen/editTable'),
|
||||
name: 'GenEdit',
|
||||
meta: { title: '修改生成配置', activeMenu: '/tool/gen' }
|
||||
}
|
||||
]
|
||||
}
|
||||
{
|
||||
path: '/system/user-auth',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
permissions: ['system:user:edit'],
|
||||
children: [
|
||||
{
|
||||
path: 'role/:userId(\\d+)',
|
||||
component: () => import('@/views/system/user/authRole'),
|
||||
name: 'AuthRole',
|
||||
meta: { title: '分配角色', activeMenu: '/system/user' }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/system/role-auth',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
permissions: ['system:role:edit'],
|
||||
children: [
|
||||
{
|
||||
path: 'user/:roleId(\\d+)',
|
||||
component: () => import('@/views/system/role/authUser'),
|
||||
name: 'AuthUser',
|
||||
meta: { title: '分配用户', activeMenu: '/system/role' }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/system/dict-data',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
permissions: ['system:dict:list'],
|
||||
children: [
|
||||
{
|
||||
path: 'index/:dictId(\\d+)',
|
||||
component: () => import('@/views/system/dict/data'),
|
||||
name: 'Data',
|
||||
meta: { title: '字典数据', activeMenu: '/system/dict' }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/monitor/job-log',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
permissions: ['monitor:job:list'],
|
||||
children: [
|
||||
{
|
||||
path: 'index/:jobId(\\d+)',
|
||||
component: () => import('@/views/monitor/job/log'),
|
||||
name: 'JobLog',
|
||||
meta: { title: '调度日志', activeMenu: '/monitor/job' }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/tool/gen-edit',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
permissions: ['tool:gen:edit'],
|
||||
children: [
|
||||
{
|
||||
path: 'index/:tableId(\\d+)',
|
||||
component: () => import('@/views/tool/gen/editTable'),
|
||||
name: 'GenEdit',
|
||||
meta: { title: '修改生成配置', activeMenu: '/tool/gen' }
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
// 会签配置
|
||||
{
|
||||
path: '/countersign/config-data',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
permissions: ['system:dict:list'], // 权限字符
|
||||
children: [
|
||||
{
|
||||
path: 'index/:processName(.*)/:id(.*)',
|
||||
component: () => import('@/views/material/countersign/config/config-data.vue'),
|
||||
name: 'config-data',
|
||||
meta: { title: '流程配置', activeMenu: '/countersign/config' }
|
||||
}
|
||||
]
|
||||
}
|
||||
// 业务详情
|
||||
// {
|
||||
// path: '/business-details',
|
||||
// component: Layout, // 后续单独拎出来时 要取消layout 直接是独立页面 类似于404页面配置即可
|
||||
// hidden: true,
|
||||
// permissions: ['system:dict:list'], // 权限字符
|
||||
// children: [
|
||||
// {
|
||||
// path: 'index',
|
||||
// name: 'business-details',
|
||||
// meta: { title: '业务详情', activeMenu: '/business-examine' },
|
||||
// component: () => import('@/views/business-examine/business-details.vue')
|
||||
// }
|
||||
// ]
|
||||
// }
|
||||
]
|
||||
|
||||
// 防止连续点击多次路由报错
|
||||
let routerPush = Router.prototype.push;
|
||||
let routerReplace = Router.prototype.replace;
|
||||
let routerPush = Router.prototype.push
|
||||
let routerReplace = Router.prototype.replace
|
||||
// push
|
||||
Router.prototype.push = function push(location) {
|
||||
return routerPush.call(this, location).catch(err => err)
|
||||
return routerPush.call(this, location).catch(err => err)
|
||||
}
|
||||
// replace
|
||||
Router.prototype.replace = function push(location) {
|
||||
return routerReplace.call(this, location).catch(err => err)
|
||||
return routerReplace.call(this, location).catch(err => err)
|
||||
}
|
||||
|
||||
export default new Router({
|
||||
mode: 'history', // 去掉url中的#
|
||||
scrollBehavior: () => ({ y: 0 }),
|
||||
routes: constantRoutes
|
||||
mode: 'history', // 去掉url中的#
|
||||
scrollBehavior: () => ({ y: 0 }),
|
||||
routes: constantRoutes
|
||||
})
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
<template>
|
||||
<div class="business-details-container">
|
||||
<el-row>
|
||||
<el-col :span="18">
|
||||
<div class="left-container">左侧</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="right-container">右侧</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.business-details-container {
|
||||
padding: 20px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,285 @@
|
|||
<template>
|
||||
<!-- 业务办理审核 -->
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
size="small"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item prop="keyWord">
|
||||
<el-input
|
||||
clearable
|
||||
maxlength="20"
|
||||
placeholder="请输入关键词"
|
||||
v-model="queryParams.keyWord"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</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> -->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="configList" ref="multipleTable">
|
||||
<el-table-column
|
||||
width="80"
|
||||
label="序号"
|
||||
type="index"
|
||||
align="center"
|
||||
:index="indexContinuation(queryParams.pageNum, queryParams.pageSize)"
|
||||
/>
|
||||
|
||||
<!-- 点击跳转到二级页面配置审核流程 -->
|
||||
<el-table-column label="流程名称" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
<router-link
|
||||
class="link-type"
|
||||
:to="`/countersign/config-data/index/${encodeURIComponent(row.typeName)}`"
|
||||
>
|
||||
<span>{{ row.typeName }}</span>
|
||||
</router-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="会签类型" align="center" prop="taskName" show-overflow-tooltip />
|
||||
<el-table-column label="操作" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-zoom-in"
|
||||
@click="handlePreview(scope.row)"
|
||||
v-hasPermi="['signConfig:info:edit']"
|
||||
>
|
||||
查看
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="warning"
|
||||
icon="el-icon-edit"
|
||||
@click="handleAuditing(scope.row)"
|
||||
v-hasPermi="['signConfig:info:remove']"
|
||||
>
|
||||
审核
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
:total="total"
|
||||
v-show="total > 0"
|
||||
@pagination="getList"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
/>
|
||||
|
||||
<!-- 新增或修改弹窗 -->
|
||||
<el-dialog :title="title" :visible.sync="showConfig" width="40%" append-to-body @close="onDialogClose">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="流程名称" prop="typeName">
|
||||
<el-input v-model="form.typeName" placeholder="请输入流程名称" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="会签类型" prop="taskType">
|
||||
<el-select
|
||||
filterable
|
||||
clearable
|
||||
style="width: 100%"
|
||||
v-model="form.taskType"
|
||||
placeholder="请选择会签类型"
|
||||
>
|
||||
<el-option
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
v-for="dict in dict.type.countersign_type_name"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getConfigListApi, addConfigApi, editConfigApi, deleteConfigApi } from '@/api/countersign/countersign'
|
||||
export default {
|
||||
name: 'signConfig',
|
||||
dicts: ['countersign_process_name', 'countersign_type_name'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
showConfig: false,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 会签配置表格数据
|
||||
configList: [],
|
||||
// 弹出层标题
|
||||
title: '',
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
keyWord: undefined
|
||||
},
|
||||
// 表单参数
|
||||
form: {
|
||||
typeName: '',
|
||||
taskType: ''
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
typeName: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入流程名称',
|
||||
trigger: 'blur'
|
||||
},
|
||||
{ max: 30, message: '长度不能超过30个字符', trigger: 'blur' }
|
||||
],
|
||||
taskType: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择会签类型',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.showConfig = false
|
||||
},
|
||||
|
||||
// 搜索
|
||||
handleQuery() {
|
||||
this.getList()
|
||||
},
|
||||
|
||||
// 弹框关闭时触发
|
||||
onDialogClose() {
|
||||
this.$refs.form.resetFields()
|
||||
},
|
||||
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
typeName: '',
|
||||
taskType: ''
|
||||
}
|
||||
this.resetForm('form')
|
||||
},
|
||||
|
||||
// 新增
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.showConfig = true
|
||||
this.title = '新增'
|
||||
},
|
||||
|
||||
// 重置
|
||||
resetQuery() {
|
||||
this.resetForm('queryForm')
|
||||
this.queryParams.keyWord = null
|
||||
this.queryParams.pageNum = 1
|
||||
this.queryParams.pageSize = 10
|
||||
this.handleQuery()
|
||||
},
|
||||
|
||||
// 编辑
|
||||
handleUpdate(row) {
|
||||
const { typeName, taskType, id } = row
|
||||
this.form.typeName = typeName
|
||||
this.form.taskType = taskType + ''
|
||||
this.form.id = id
|
||||
this.title = '编辑'
|
||||
this.showConfig = true
|
||||
},
|
||||
|
||||
// 查询列表
|
||||
async getList() {
|
||||
this.loading = true
|
||||
const res = await getConfigListApi(this.queryParams)
|
||||
this.configList = res.rows
|
||||
this.total = res.total
|
||||
this.loading = false
|
||||
},
|
||||
|
||||
// 删除
|
||||
handleDelete(row) {
|
||||
const id = row.id
|
||||
this.$modal
|
||||
.confirm('是否确认删除数据项?')
|
||||
.then(function () {
|
||||
return deleteConfigApi({ id })
|
||||
})
|
||||
.then(() => {
|
||||
this.$modal.msgSuccess('删除成功')
|
||||
this.getList()
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
|
||||
// 提交
|
||||
submitForm() {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != undefined) {
|
||||
editConfigApi(this.form).then(res => {
|
||||
this.$modal.msgSuccess('修改成功')
|
||||
this.showConfig = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addConfigApi(this.form).then(res => {
|
||||
this.$modal.msgSuccess('新增成功')
|
||||
this.showConfig = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询
|
||||
handlePreview() {
|
||||
this.$router.push({ name: 'business-details' }) // 跳转业务详情页面
|
||||
},
|
||||
// 审核
|
||||
handleAuditing() {}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<template>
|
||||
<div class="business-details-container">
|
||||
<el-row>
|
||||
<el-col :span="18">
|
||||
<div class="left-container">左侧</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="right-container">右侧</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.business-details-container {
|
||||
padding: 20px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,285 @@
|
|||
<template>
|
||||
<!-- 业务办理审核 -->
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
size="small"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item prop="keyWord">
|
||||
<el-input
|
||||
clearable
|
||||
maxlength="20"
|
||||
placeholder="请输入关键词"
|
||||
v-model="queryParams.keyWord"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</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> -->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="configList" ref="multipleTable">
|
||||
<el-table-column
|
||||
width="80"
|
||||
label="序号"
|
||||
type="index"
|
||||
align="center"
|
||||
:index="indexContinuation(queryParams.pageNum, queryParams.pageSize)"
|
||||
/>
|
||||
|
||||
<!-- 点击跳转到二级页面配置审核流程 -->
|
||||
<el-table-column label="流程名称" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
<router-link
|
||||
class="link-type"
|
||||
:to="`/countersign/config-data/index/${encodeURIComponent(row.typeName)}`"
|
||||
>
|
||||
<span>{{ row.typeName }}</span>
|
||||
</router-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="会签类型" align="center" prop="taskName" show-overflow-tooltip />
|
||||
<el-table-column label="操作" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-zoom-in"
|
||||
@click="handlePreview(scope.row)"
|
||||
v-hasPermi="['signConfig:info:edit']"
|
||||
>
|
||||
查看
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="warning"
|
||||
icon="el-icon-edit"
|
||||
@click="handleAuditing(scope.row)"
|
||||
v-hasPermi="['signConfig:info:remove']"
|
||||
>
|
||||
审核
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
:total="total"
|
||||
v-show="total > 0"
|
||||
@pagination="getList"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
/>
|
||||
|
||||
<!-- 新增或修改弹窗 -->
|
||||
<el-dialog :title="title" :visible.sync="showConfig" width="40%" append-to-body @close="onDialogClose">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="流程名称" prop="typeName">
|
||||
<el-input v-model="form.typeName" placeholder="请输入流程名称" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="会签类型" prop="taskType">
|
||||
<el-select
|
||||
filterable
|
||||
clearable
|
||||
style="width: 100%"
|
||||
v-model="form.taskType"
|
||||
placeholder="请选择会签类型"
|
||||
>
|
||||
<el-option
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
v-for="dict in dict.type.countersign_type_name"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getConfigListApi, addConfigApi, editConfigApi, deleteConfigApi } from '@/api/countersign/countersign'
|
||||
export default {
|
||||
name: 'signConfig',
|
||||
dicts: ['countersign_process_name', 'countersign_type_name'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
showConfig: false,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 会签配置表格数据
|
||||
configList: [],
|
||||
// 弹出层标题
|
||||
title: '',
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
keyWord: undefined
|
||||
},
|
||||
// 表单参数
|
||||
form: {
|
||||
typeName: '',
|
||||
taskType: ''
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
typeName: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入流程名称',
|
||||
trigger: 'blur'
|
||||
},
|
||||
{ max: 30, message: '长度不能超过30个字符', trigger: 'blur' }
|
||||
],
|
||||
taskType: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择会签类型',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.showConfig = false
|
||||
},
|
||||
|
||||
// 搜索
|
||||
handleQuery() {
|
||||
this.getList()
|
||||
},
|
||||
|
||||
// 弹框关闭时触发
|
||||
onDialogClose() {
|
||||
this.$refs.form.resetFields()
|
||||
},
|
||||
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
typeName: '',
|
||||
taskType: ''
|
||||
}
|
||||
this.resetForm('form')
|
||||
},
|
||||
|
||||
// 新增
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.showConfig = true
|
||||
this.title = '新增'
|
||||
},
|
||||
|
||||
// 重置
|
||||
resetQuery() {
|
||||
this.resetForm('queryForm')
|
||||
this.queryParams.keyWord = null
|
||||
this.queryParams.pageNum = 1
|
||||
this.queryParams.pageSize = 10
|
||||
this.handleQuery()
|
||||
},
|
||||
|
||||
// 编辑
|
||||
handleUpdate(row) {
|
||||
const { typeName, taskType, id } = row
|
||||
this.form.typeName = typeName
|
||||
this.form.taskType = taskType + ''
|
||||
this.form.id = id
|
||||
this.title = '编辑'
|
||||
this.showConfig = true
|
||||
},
|
||||
|
||||
// 查询列表
|
||||
async getList() {
|
||||
this.loading = true
|
||||
const res = await getConfigListApi(this.queryParams)
|
||||
this.configList = res.rows
|
||||
this.total = res.total
|
||||
this.loading = false
|
||||
},
|
||||
|
||||
// 删除
|
||||
handleDelete(row) {
|
||||
const id = row.id
|
||||
this.$modal
|
||||
.confirm('是否确认删除数据项?')
|
||||
.then(function () {
|
||||
return deleteConfigApi({ id })
|
||||
})
|
||||
.then(() => {
|
||||
this.$modal.msgSuccess('删除成功')
|
||||
this.getList()
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
|
||||
// 提交
|
||||
submitForm() {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != undefined) {
|
||||
editConfigApi(this.form).then(res => {
|
||||
this.$modal.msgSuccess('修改成功')
|
||||
this.showConfig = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addConfigApi(this.form).then(res => {
|
||||
this.$modal.msgSuccess('新增成功')
|
||||
this.showConfig = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询
|
||||
handlePreview() {
|
||||
this.$router.push({ name: 'business-details' }) // 跳转业务详情页面
|
||||
},
|
||||
// 审核
|
||||
handleAuditing() {}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
<template>
|
||||
<div class="business-details-container">
|
||||
<el-row>
|
||||
<el-col :span="18">
|
||||
<div class="left-container">左侧</div>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<div class="right-container">右侧</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.business-details-container {
|
||||
padding: 20px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,285 @@
|
|||
<template>
|
||||
<!-- 业务办理审核 -->
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
size="small"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item prop="keyWord">
|
||||
<el-input
|
||||
clearable
|
||||
maxlength="20"
|
||||
placeholder="请输入关键词"
|
||||
v-model="queryParams.keyWord"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</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> -->
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="configList" ref="multipleTable">
|
||||
<el-table-column
|
||||
width="80"
|
||||
label="序号"
|
||||
type="index"
|
||||
align="center"
|
||||
:index="indexContinuation(queryParams.pageNum, queryParams.pageSize)"
|
||||
/>
|
||||
|
||||
<!-- 点击跳转到二级页面配置审核流程 -->
|
||||
<el-table-column label="流程名称" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
<router-link
|
||||
class="link-type"
|
||||
:to="`/countersign/config-data/index/${encodeURIComponent(row.typeName)}`"
|
||||
>
|
||||
<span>{{ row.typeName }}</span>
|
||||
</router-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="会签类型" align="center" prop="taskName" show-overflow-tooltip />
|
||||
<el-table-column label="操作" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-zoom-in"
|
||||
@click="handlePreview(scope.row)"
|
||||
v-hasPermi="['signConfig:info:edit']"
|
||||
>
|
||||
查看
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="warning"
|
||||
icon="el-icon-edit"
|
||||
@click="handleAuditing(scope.row)"
|
||||
v-hasPermi="['signConfig:info:remove']"
|
||||
>
|
||||
审核
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
:total="total"
|
||||
v-show="total > 0"
|
||||
@pagination="getList"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
/>
|
||||
|
||||
<!-- 新增或修改弹窗 -->
|
||||
<el-dialog :title="title" :visible.sync="showConfig" width="40%" append-to-body @close="onDialogClose">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="流程名称" prop="typeName">
|
||||
<el-input v-model="form.typeName" placeholder="请输入流程名称" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="会签类型" prop="taskType">
|
||||
<el-select
|
||||
filterable
|
||||
clearable
|
||||
style="width: 100%"
|
||||
v-model="form.taskType"
|
||||
placeholder="请选择会签类型"
|
||||
>
|
||||
<el-option
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
v-for="dict in dict.type.countersign_type_name"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getConfigListApi, addConfigApi, editConfigApi, deleteConfigApi } from '@/api/countersign/countersign'
|
||||
export default {
|
||||
name: 'signConfig',
|
||||
dicts: ['countersign_process_name', 'countersign_type_name'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
showConfig: false,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 会签配置表格数据
|
||||
configList: [],
|
||||
// 弹出层标题
|
||||
title: '',
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
keyWord: undefined
|
||||
},
|
||||
// 表单参数
|
||||
form: {
|
||||
typeName: '',
|
||||
taskType: ''
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
typeName: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入流程名称',
|
||||
trigger: 'blur'
|
||||
},
|
||||
{ max: 30, message: '长度不能超过30个字符', trigger: 'blur' }
|
||||
],
|
||||
taskType: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择会签类型',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.showConfig = false
|
||||
},
|
||||
|
||||
// 搜索
|
||||
handleQuery() {
|
||||
this.getList()
|
||||
},
|
||||
|
||||
// 弹框关闭时触发
|
||||
onDialogClose() {
|
||||
this.$refs.form.resetFields()
|
||||
},
|
||||
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
typeName: '',
|
||||
taskType: ''
|
||||
}
|
||||
this.resetForm('form')
|
||||
},
|
||||
|
||||
// 新增
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.showConfig = true
|
||||
this.title = '新增'
|
||||
},
|
||||
|
||||
// 重置
|
||||
resetQuery() {
|
||||
this.resetForm('queryForm')
|
||||
this.queryParams.keyWord = null
|
||||
this.queryParams.pageNum = 1
|
||||
this.queryParams.pageSize = 10
|
||||
this.handleQuery()
|
||||
},
|
||||
|
||||
// 编辑
|
||||
handleUpdate(row) {
|
||||
const { typeName, taskType, id } = row
|
||||
this.form.typeName = typeName
|
||||
this.form.taskType = taskType + ''
|
||||
this.form.id = id
|
||||
this.title = '编辑'
|
||||
this.showConfig = true
|
||||
},
|
||||
|
||||
// 查询列表
|
||||
async getList() {
|
||||
this.loading = true
|
||||
const res = await getConfigListApi(this.queryParams)
|
||||
this.configList = res.rows
|
||||
this.total = res.total
|
||||
this.loading = false
|
||||
},
|
||||
|
||||
// 删除
|
||||
handleDelete(row) {
|
||||
const id = row.id
|
||||
this.$modal
|
||||
.confirm('是否确认删除数据项?')
|
||||
.then(function () {
|
||||
return deleteConfigApi({ id })
|
||||
})
|
||||
.then(() => {
|
||||
this.$modal.msgSuccess('删除成功')
|
||||
this.getList()
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
|
||||
// 提交
|
||||
submitForm() {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != undefined) {
|
||||
editConfigApi(this.form).then(res => {
|
||||
this.$modal.msgSuccess('修改成功')
|
||||
this.showConfig = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addConfigApi(this.form).then(res => {
|
||||
this.$modal.msgSuccess('新增成功')
|
||||
this.showConfig = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 查询
|
||||
handlePreview() {
|
||||
this.$router.push({ name: 'business-details' }) // 跳转业务详情页面
|
||||
},
|
||||
// 审核
|
||||
handleAuditing() {}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,356 @@
|
|||
<template>
|
||||
<!-- 会签配置 -->
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
size="small"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item label="节点名称" prop="nodeName">
|
||||
<el-input v-model="queryParams.nodeName" placeholder="请输入节点名称" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="会签类型" prop="nodeSignType" clearable>
|
||||
<el-select v-model="queryParams.nodeSignType">
|
||||
<el-option label="或签" :value="0" />
|
||||
<el-option label="会签" :value="1" />
|
||||
</el-select>
|
||||
</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"
|
||||
v-hasPermi="['system:dict:add']"
|
||||
>
|
||||
新增
|
||||
</el-button>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-close" size="mini" @click="handleClose">关闭</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table :data="dataList">
|
||||
<el-table-column label="流程类型" align="center">
|
||||
<template>
|
||||
{{ processName }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="流程节点" align="center" prop="nodeName" />
|
||||
<el-table-column label="流程顺序" align="center" prop="nodeSort" />
|
||||
<el-table-column label="会签类型" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
<el-tag size="mini" type="primary" v-if="row.nodeSignType === 0">或签</el-tag>
|
||||
<el-tag size="mini" type="warning" v-if="row.nodeSignType === 1">会签</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="角色/人员(审核)" align="center" :show-overflow-tooltip="true">
|
||||
<template slot-scope="{ row }">
|
||||
<span class="user-roles">
|
||||
{{ row.nodeSignConfig === 1 ? '用户' : '角色' }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['system:dict:edit']"
|
||||
>
|
||||
修改
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['system:dict:remove']"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</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="50%" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="流程类型">
|
||||
<el-input v-model="processName" :disabled="true" />
|
||||
</el-form-item>
|
||||
<el-form-item label="流程节点" prop="nodeName">
|
||||
<el-input v-model="form.nodeName" placeholder="请输入流程节点" />
|
||||
</el-form-item>
|
||||
<el-form-item label="流程顺序" prop="nodeSort">
|
||||
<el-input-number
|
||||
:min="1"
|
||||
:max="10"
|
||||
:precision="0"
|
||||
v-model="form.nodeSort"
|
||||
controls-position="right"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="会签类型" prop="nodeSignType">
|
||||
<el-radio-group v-model="form.nodeSignType">
|
||||
<el-radio :label="0">或签</el-radio>
|
||||
<el-radio :label="1">会签</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="审核角色 / 用户" prop="nodeSignConfig">
|
||||
<el-radio-group v-model="form.nodeSignConfig">
|
||||
<el-radio :label="0">角色</el-radio>
|
||||
<el-radio :label="1">用户</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="角色" prop="configValuesList" v-if="form.nodeSignConfig === 0">
|
||||
<el-select v-model="form.configValuesList" style="width: 100%" filterable multiple>
|
||||
<el-option
|
||||
:key="item.roleId"
|
||||
:value="item.roleId + ''"
|
||||
:label="item.roleName"
|
||||
v-for="item in roleList"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="人员" prop="configValuesList" v-if="form.nodeSignConfig === 1">
|
||||
<el-select v-model="form.configValuesList" style="width: 100%" filterable multiple>
|
||||
<el-option
|
||||
:key="item.userId"
|
||||
:value="item.userId + ''"
|
||||
:label="item.nickName"
|
||||
v-for="item in userList"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input>
|
||||
</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 { listData, getData, delData, addData, updateData } from '@/api/system/dict/data'
|
||||
import { optionselect as getDictOptionselect, getType } from '@/api/system/dict/type'
|
||||
|
||||
import { listRole } from '@/api/system/role'
|
||||
import { listUser } from '@/api/system/user'
|
||||
|
||||
import {
|
||||
getConfigNodeListApi,
|
||||
addConfigNodeApi,
|
||||
editConfigNodeApi,
|
||||
deleteConfigNodeApi
|
||||
} from '@/api/countersign/countersign'
|
||||
|
||||
export default {
|
||||
name: 'Data',
|
||||
dicts: ['sys_normal_disable'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 字典表格数据
|
||||
dataList: [],
|
||||
// 弹出层标题
|
||||
title: '',
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
typeId: '',
|
||||
nodeSignType: '',
|
||||
nodeName: ''
|
||||
},
|
||||
// 表单参数
|
||||
form: {
|
||||
nodeName: '', // 流程节点
|
||||
nodeSort: '', // 流程顺序
|
||||
nodeSignType: 1, // 会签类型
|
||||
nodeSignConfig: 1, // 审核人员类型
|
||||
configValues: '', // 审核人员类型
|
||||
configValuesList: []
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
nodeName: [{ required: true, message: '流程节点不能为空', trigger: 'blur' }],
|
||||
nodeSort: [{ required: true, message: '流程顺序不能为空', trigger: 'blur' }],
|
||||
nodeSignType: [{ required: true, message: '请选择会签类型', trigger: 'blur' }],
|
||||
nodeSignConfig: [{ required: true, message: '请选择审核人员类型', trigger: 'blur' }],
|
||||
configValuesList: [{ required: true, message: '请选择审核人员或用户', trigger: 'blur' }]
|
||||
},
|
||||
processName: '',
|
||||
roleList: [],
|
||||
userList: []
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.processName = this.$route.params && this.$route.params.processName
|
||||
this.queryParams.typeId = this.$route.params && this.$route.params.id
|
||||
this.getList()
|
||||
this.getRoleAndUserList()
|
||||
},
|
||||
methods: {
|
||||
// 获取角色列表
|
||||
async getRoleAndUserList() {
|
||||
const { rows: res } = await listRole({ pageNum: 1, pageSize: 999 })
|
||||
const { rows: result } = await listUser({ pageNum: 1, pageSize: 999 })
|
||||
this.roleList = res
|
||||
this.userList = result
|
||||
},
|
||||
/** 查询字典数据列表 */
|
||||
async getList() {
|
||||
this.loading = true
|
||||
const res = await getConfigNodeListApi(this.queryParams)
|
||||
this.dataList = res.rows
|
||||
this.total = res.total
|
||||
this.loading = false
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false
|
||||
this.reset()
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
nodeName: '',
|
||||
nodeSort: '',
|
||||
nodeSignType: 0,
|
||||
nodeSignConfig: 0
|
||||
}
|
||||
this.resetForm('form')
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
/** 返回按钮操作 */
|
||||
handleClose() {
|
||||
const obj = { path: '/countersign/config' }
|
||||
this.$tab.closeOpenPage(obj)
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm('queryForm')
|
||||
this.handleQuery()
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.open = true
|
||||
this.title = '添加'
|
||||
},
|
||||
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
const { nodeName, nodeSort, nodeSignType, nodeSignConfig, configValues, id } = row
|
||||
Object.assign(this.form, {
|
||||
nodeName,
|
||||
nodeSort,
|
||||
nodeSignType,
|
||||
nodeSignConfig,
|
||||
configValues,
|
||||
id
|
||||
})
|
||||
this.form.configValuesList = this.form.configValues.split(',')
|
||||
|
||||
this.title = '修改'
|
||||
this.open = true
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm: function () {
|
||||
this.$refs['form'].validate(async valid => {
|
||||
if (valid) {
|
||||
const SUBMIT_FUN = this.title === '添加' ? addConfigNodeApi : editConfigNodeApi
|
||||
const isSortPass = this.dataList.findIndex(e => e.nodeSort === this.form.nodeSort)
|
||||
|
||||
// 判断当前输入顺序是否存在
|
||||
if (isSortPass > -1) {
|
||||
this.$modal.msgError('当前输入的流程顺序已存在,请重新输入')
|
||||
return
|
||||
}
|
||||
// 组装参数
|
||||
this.form.configValues = this.form.configValuesList.join(',')
|
||||
|
||||
const addOrEditForm = JSON.parse(JSON.stringify(this.form))
|
||||
|
||||
this.$delete(addOrEditForm, 'configValuesList') // 确保参数都是后台所需要的 去除无关字段
|
||||
|
||||
if (this.title === '添加') {
|
||||
addOrEditForm.typeId = this.queryParams.typeId
|
||||
}
|
||||
|
||||
const res = await SUBMIT_FUN(addOrEditForm)
|
||||
if (res.code === 200) {
|
||||
this.$modal.msgSuccess(`${this.title}成功`)
|
||||
this.getList()
|
||||
this.open = false
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
this.$modal
|
||||
.confirm('是否确认删除该审核节点?')
|
||||
.then(function () {
|
||||
return deleteConfigNodeApi({ id: row.id })
|
||||
})
|
||||
.then(() => {
|
||||
this.getList()
|
||||
this.$modal.msgSuccess('删除成功')
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.user-roles {
|
||||
cursor: pointer;
|
||||
color: #409eff;
|
||||
font-size: 14px;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -1,382 +1,279 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
size="small"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item prop="keyWord">
|
||||
<el-input
|
||||
v-model="queryParams.keyWord"
|
||||
placeholder="请输入关键词"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
maxlength="20"
|
||||
<!-- 会签配置管理 列表页面 -->
|
||||
<div class="app-container">
|
||||
<el-form
|
||||
:model="queryParams"
|
||||
ref="queryForm"
|
||||
size="small"
|
||||
:inline="true"
|
||||
v-show="showSearch"
|
||||
label-width="68px"
|
||||
>
|
||||
<el-form-item prop="keyWord">
|
||||
<el-input
|
||||
clearable
|
||||
maxlength="20"
|
||||
placeholder="请输入关键词"
|
||||
v-model="queryParams.keyWord"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</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>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="configList" ref="multipleTable">
|
||||
<el-table-column
|
||||
width="80"
|
||||
label="序号"
|
||||
type="index"
|
||||
align="center"
|
||||
:index="indexContinuation(queryParams.pageNum, queryParams.pageSize)"
|
||||
/>
|
||||
|
||||
<!-- 点击跳转到二级页面配置审核流程 -->
|
||||
<el-table-column label="流程名称" align="center">
|
||||
<template slot-scope="{ row }">
|
||||
<router-link
|
||||
class="link-type"
|
||||
:to="`/countersign/config-data/index/${encodeURIComponent(row.typeName)}/${row.id}`"
|
||||
>
|
||||
<span>{{ row.typeName }}</span>
|
||||
</router-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="会签类型" align="center" prop="taskName" show-overflow-tooltip />
|
||||
<el-table-column label="操作" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['signConfig:info:edit']"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['signConfig:info:remove']"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
:total="total"
|
||||
v-show="total > 0"
|
||||
@pagination="getList"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
/>
|
||||
</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>
|
||||
<right-toolbar
|
||||
:showSearch.sync="showSearch"
|
||||
@queryTable="getList"
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
<!-- 新增或修改弹窗 -->
|
||||
<el-dialog :title="title" :visible.sync="showConfig" width="40%" append-to-body @close="onDialogClose">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="流程名称" prop="typeName">
|
||||
<el-input v-model="form.typeName" placeholder="请输入流程名称" clearable />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
:data="configList"
|
||||
ref="multipleTable"
|
||||
row-key="id"
|
||||
>
|
||||
<el-table-column label="序号" align="center" width="80" type="index">
|
||||
<template slot-scope="scope">
|
||||
<span>{{
|
||||
(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="流程名称"
|
||||
align="center"
|
||||
prop="processName"
|
||||
sortable
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="会签类型"
|
||||
align="center"
|
||||
prop="signTypeName"
|
||||
sortable
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-table-column
|
||||
label="配置人员"
|
||||
align="center"
|
||||
prop="peopleName"
|
||||
sortable
|
||||
show-overflow-tooltip
|
||||
/>
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="会签类型" prop="taskType">
|
||||
<el-select
|
||||
filterable
|
||||
clearable
|
||||
style="width: 100%"
|
||||
v-model="form.taskType"
|
||||
placeholder="请选择会签类型"
|
||||
>
|
||||
<el-option
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
v-for="dict in dict.type.countersign_type_name"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<el-table-column label="操作" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['signConfig:info:edit']"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['signConfig:info:remove']"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</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="showConfig"
|
||||
width="600px"
|
||||
append-to-body
|
||||
>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="流程名称" prop="processId">
|
||||
<el-select
|
||||
v-model="form.processId"
|
||||
placeholder="请选择流程名称"
|
||||
style="width: 100%;"
|
||||
filterable
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.countersign_process_name"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="会签类型" prop="signType">
|
||||
<el-select
|
||||
v-model="form.signType"
|
||||
placeholder="请选择会签类型"
|
||||
style="width: 100%;"
|
||||
filterable
|
||||
clearable
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.countersign_type_name"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="配置人员" prop="peopleId">
|
||||
<treeselect
|
||||
v-model="form.peopleId"
|
||||
:searchable="true"
|
||||
:disable-branch-nodes="true"
|
||||
:options="deptOptions"
|
||||
:show-count="true"
|
||||
placeholder="请选择配置人员"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
</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 {getConfigList,addConfig,getConfigDetail,editConfig,delConfig } from "@/api/countersign/countersign";
|
||||
import { getUserList,} from "@/api/basic/basic";
|
||||
import { deptTreeSelect } from "@/api/system/user";
|
||||
import Treeselect from "@riophae/vue-treeselect";
|
||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||
<script>
|
||||
import { getConfigListApi, addConfigApi, editConfigApi, deleteConfigApi } from '@/api/countersign/countersign'
|
||||
export default {
|
||||
name: "signConfig",
|
||||
dicts: ["countersign_process_name", "countersign_type_name"],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
showConfig: false,
|
||||
// 人员组织树选项
|
||||
deptOptions: undefined,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 会签配置表格数据
|
||||
configList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
keyWord: undefined,
|
||||
},
|
||||
|
||||
// 表单参数
|
||||
form: {
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
processId: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择流程名称",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
signType: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择会签类型",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
peopleId: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择配置人员",
|
||||
trigger: "blur",
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getUserList()
|
||||
this.getList();
|
||||
},
|
||||
components: { Treeselect },
|
||||
methods: {
|
||||
/** 查询人员列表 */
|
||||
getUserList() {
|
||||
getUserList({ userName: this.userName ,deptId:0}).then(response => {
|
||||
console.log('response',response)
|
||||
this.deptOptions = response.data
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
/** 查询岗位列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
getConfigList(this.queryParams).then((response) => {
|
||||
this.configList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.showConfig = true;
|
||||
this.title = "新增";
|
||||
},
|
||||
|
||||
/** 编辑按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const id = row.id;
|
||||
getConfigDetail(id).then((response) => {
|
||||
this.form = response.data;
|
||||
this.showConfig = true;
|
||||
this.title = "编辑";
|
||||
});
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {};
|
||||
this.resetForm("form");
|
||||
},
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1;
|
||||
this.getList();
|
||||
},
|
||||
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.queryParams.keyWord = null;
|
||||
this.handleQuery();
|
||||
},
|
||||
|
||||
//** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate((valid) => {
|
||||
if (valid) {
|
||||
if (this.form.id != undefined) {
|
||||
editConfig(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.showConfig = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addConfig(this.form).then((response) => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.showConfig = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
name: 'signConfig',
|
||||
dicts: ['countersign_process_name', 'countersign_type_name'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
showConfig: false,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 会签配置表格数据
|
||||
configList: [],
|
||||
// 弹出层标题
|
||||
title: '',
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
keyWord: undefined
|
||||
},
|
||||
// 表单参数
|
||||
form: {
|
||||
typeName: '',
|
||||
taskType: ''
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
typeName: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入流程名称',
|
||||
trigger: 'blur'
|
||||
},
|
||||
{ max: 30, message: '长度不能超过30个字符', trigger: 'blur' }
|
||||
],
|
||||
taskType: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择会签类型',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.showConfig = false;
|
||||
this.reset();
|
||||
},
|
||||
methods: {
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.showConfig = false
|
||||
},
|
||||
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const id = row.id;
|
||||
this.$modal
|
||||
.confirm("是否确认删除数据项?")
|
||||
.then(function () {
|
||||
return delConfig(id);
|
||||
})
|
||||
.then(() => {
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
this.getList();
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
// 搜索
|
||||
handleQuery() {
|
||||
this.getList()
|
||||
},
|
||||
|
||||
},
|
||||
};
|
||||
// 弹框关闭时触发
|
||||
onDialogClose() {
|
||||
this.$refs.form.resetFields()
|
||||
},
|
||||
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
typeName: '',
|
||||
taskType: ''
|
||||
}
|
||||
this.resetForm('form')
|
||||
},
|
||||
|
||||
// 新增
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.showConfig = true
|
||||
this.title = '新增'
|
||||
},
|
||||
|
||||
// 重置
|
||||
resetQuery() {
|
||||
this.resetForm('queryForm')
|
||||
this.queryParams.keyWord = null
|
||||
this.queryParams.pageNum = 1
|
||||
this.queryParams.pageSize = 10
|
||||
this.handleQuery()
|
||||
},
|
||||
|
||||
// 编辑
|
||||
handleUpdate(row) {
|
||||
const { typeName, taskType, id } = row
|
||||
this.form.typeName = typeName
|
||||
this.form.taskType = taskType + ''
|
||||
this.form.id = id
|
||||
this.title = '编辑'
|
||||
this.showConfig = true
|
||||
},
|
||||
|
||||
// 查询列表
|
||||
async getList() {
|
||||
this.loading = true
|
||||
const res = await getConfigListApi(this.queryParams)
|
||||
this.configList = res.rows
|
||||
this.total = res.total
|
||||
this.loading = false
|
||||
},
|
||||
|
||||
// 删除
|
||||
handleDelete(row) {
|
||||
const id = row.id
|
||||
this.$modal
|
||||
.confirm('是否确认删除数据项?')
|
||||
.then(function () {
|
||||
return deleteConfigApi({ id })
|
||||
})
|
||||
.then(() => {
|
||||
this.$modal.msgSuccess('删除成功')
|
||||
this.getList()
|
||||
})
|
||||
.catch(() => {})
|
||||
},
|
||||
|
||||
// 提交
|
||||
submitForm() {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != undefined) {
|
||||
editConfigApi(this.form).then(res => {
|
||||
this.$modal.msgSuccess('修改成功')
|
||||
this.showConfig = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addConfigApi(this.form).then(res => {
|
||||
this.$modal.msgSuccess('新增成功')
|
||||
this.showConfig = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.uploadImg {
|
||||
padding-top: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.deviceCode {
|
||||
margin-top: 10px;
|
||||
padding-bottom: 20px;
|
||||
font-size: 18px;
|
||||
}
|
||||
::v-deep.el-table .fixed-width .el-button--mini {
|
||||
width: 60px !important;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
//隐藏图片上传框的css
|
||||
::v-deep.disabled {
|
||||
.el-upload--picture-card {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,311 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item prop="keyWord">
|
||||
<el-input
|
||||
v-model="queryParams.keyWord"
|
||||
placeholder="请输入关键词"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
maxlength="20"
|
||||
/>
|
||||
</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>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="configList" ref="multipleTable" row-key="id">
|
||||
<el-table-column label="序号" align="center" width="80" type="index">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="流程名称" align="center" prop="processName" sortable show-overflow-tooltip />
|
||||
<el-table-column label="会签类型9996" align="center" prop="signTypeName" sortable show-overflow-tooltip />
|
||||
<el-table-column label="配置人员" align="center" prop="peopleName" sortable show-overflow-tooltip />
|
||||
|
||||
<el-table-column label="操作" align="center" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="primary"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['signConfig:info:edit']"
|
||||
>
|
||||
编辑
|
||||
</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['signConfig:info:remove']"
|
||||
>
|
||||
删除
|
||||
</el-button>
|
||||
</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="showConfig" width="600px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="流程名称" prop="processId">
|
||||
<el-select v-model="form.processId" placeholder="请选择流程名称" style="width: 100%" filterable clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.countersign_process_name"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="会签类型" prop="signType">
|
||||
<el-select v-model="form.signType" placeholder="请选择会签类型" style="width: 100%" filterable clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.countersign_type_name"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<el-row :gutter="24">
|
||||
<el-col :span="20">
|
||||
<el-form-item label="配置人员" prop="peopleId">
|
||||
<treeselect
|
||||
v-model="form.peopleId"
|
||||
:searchable="true"
|
||||
:disable-branch-nodes="true"
|
||||
:options="deptOptions"
|
||||
:show-count="true"
|
||||
placeholder="请选择配置人员"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</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 { getConfigList, addConfig, getConfigDetail, editConfig, delConfig } from '@/api/countersign/countersign'
|
||||
import { getUserList } from '@/api/basic/basic'
|
||||
import { deptTreeSelect } from '@/api/system/user'
|
||||
import Treeselect from '@riophae/vue-treeselect'
|
||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||
export default {
|
||||
name: 'signConfig',
|
||||
dicts: ['countersign_process_name', 'countersign_type_name'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: false,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
showConfig: false,
|
||||
// 人员组织树选项
|
||||
deptOptions: undefined,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 会签配置表格数据
|
||||
configList: [],
|
||||
// 弹出层标题
|
||||
title: '',
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
keyWord: undefined
|
||||
},
|
||||
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
processId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择流程名称',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
signType: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择会签类型',
|
||||
trigger: 'blur'
|
||||
}
|
||||
],
|
||||
peopleId: [
|
||||
{
|
||||
required: true,
|
||||
message: '请选择配置人员',
|
||||
trigger: 'blur'
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getUserList()
|
||||
this.getList()
|
||||
},
|
||||
components: { Treeselect },
|
||||
methods: {
|
||||
/** 查询人员列表 */
|
||||
getUserList() {
|
||||
getUserList({ userName: this.userName, deptId: 0 }).then(response => {
|
||||
console.log('response', response)
|
||||
this.deptOptions = response.data
|
||||
})
|
||||
},
|
||||
|
||||
/** 查询岗位列表 */
|
||||
getList() {
|
||||
this.loading = true
|
||||
getConfigList(this.queryParams).then(response => {
|
||||
this.configList = response.rows
|
||||
this.total = response.total
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset()
|
||||
this.showConfig = true
|
||||
this.title = '新增'
|
||||
},
|
||||
|
||||
/** 编辑按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset()
|
||||
const id = row.id
|
||||
getConfigDetail(id).then(response => {
|
||||
this.form = response.data
|
||||
this.showConfig = true
|
||||
this.title = '编辑'
|
||||
})
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {}
|
||||
this.resetForm('form')
|
||||
},
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm('queryForm')
|
||||
this.queryParams.keyWord = null
|
||||
this.handleQuery()
|
||||
},
|
||||
|
||||
//** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs['form'].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id != undefined) {
|
||||
editConfig(this.form).then(response => {
|
||||
this.$modal.msgSuccess('修改成功')
|
||||
this.showConfig = false
|
||||
this.getList()
|
||||
})
|
||||
} else {
|
||||
addConfig(this.form).then(response => {
|
||||
this.$modal.msgSuccess('新增成功')
|
||||
this.showConfig = false
|
||||
this.getList()
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.showConfig = false
|
||||
this.reset()
|
||||
},
|
||||
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const id = row.id
|
||||
this.$modal
|
||||
.confirm('是否确认删除数据项?')
|
||||
.then(function () {
|
||||
return delConfig(id)
|
||||
})
|
||||
.then(() => {
|
||||
this.$modal.msgSuccess('删除成功')
|
||||
this.getList()
|
||||
})
|
||||
.catch(() => {})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.uploadImg {
|
||||
padding-top: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.deviceCode {
|
||||
margin-top: 10px;
|
||||
padding-bottom: 20px;
|
||||
font-size: 18px;
|
||||
}
|
||||
::v-deep.el-table .fixed-width .el-button--mini {
|
||||
width: 60px !important;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
//隐藏图片上传框的css
|
||||
::v-deep.disabled {
|
||||
.el-upload--picture-card {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
126
vue.config.js
126
vue.config.js
|
|
@ -1,15 +1,15 @@
|
|||
"use strict";
|
||||
const path = require("path");
|
||||
'use strict'
|
||||
const path = require('path')
|
||||
|
||||
function resolve(dir) {
|
||||
return path.join(__dirname, dir);
|
||||
return path.join(__dirname, dir)
|
||||
}
|
||||
|
||||
const CompressionPlugin = require("compression-webpack-plugin");
|
||||
const CompressionPlugin = require('compression-webpack-plugin')
|
||||
|
||||
const name = process.env.VUE_APP_TITLE || "智能机具管理系统"; // 网页标题
|
||||
const name = process.env.VUE_APP_TITLE || '智能机具管理系统' // 网页标题
|
||||
|
||||
const port = process.env.port || process.env.npm_config_port || 80; // 端口
|
||||
const port = process.env.port || process.env.npm_config_port || 80 // 端口
|
||||
|
||||
// vue.config.js 配置说明
|
||||
//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
|
||||
|
|
@ -18,126 +18,128 @@ module.exports = {
|
|||
// 部署生产环境和开发环境下的URL。
|
||||
// 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
|
||||
// 例如 https://www.bonus.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.bonus.vip/admin/,则设置 baseUrl 为 /admin/。
|
||||
publicPath: process.env.NODE_ENV === "production" ? "/" : "/",
|
||||
publicPath: process.env.NODE_ENV === 'production' ? '/' : '/',
|
||||
// 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
|
||||
outputDir: "dist",
|
||||
outputDir: 'dist',
|
||||
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
|
||||
assetsDir: "static",
|
||||
assetsDir: 'static',
|
||||
// 是否开启eslint保存检测,有效值:ture | false | 'error'
|
||||
lintOnSave: process.env.NODE_ENV === "development",
|
||||
lintOnSave: process.env.NODE_ENV === 'development',
|
||||
// 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
|
||||
productionSourceMap: false,
|
||||
// webpack-dev-server 相关配置
|
||||
devServer: {
|
||||
host: "0.0.0.0",
|
||||
host: '0.0.0.0',
|
||||
port: port,
|
||||
open: true,
|
||||
proxy: {
|
||||
// detail: https://cli.vuejs.org/config/#devserver-proxy
|
||||
[process.env.VUE_APP_BASE_API]: {
|
||||
// target: `http://localhost:18080`,
|
||||
target: `http://192.168.0.15:18080`,//马
|
||||
// target: `http://192.168.0.244:18580`,//测试
|
||||
// target: `http://192.168.0.15:18080`,//马
|
||||
// target: `http://192.168.0.244:18580`,//测试
|
||||
// target: `http://192.168.2.223:18080`,//山
|
||||
// target: `http://192.168.2.23:18080`,//洪
|
||||
// target: `http://192.168.0.234:18080`,//阮
|
||||
// target: `http://192.168.137.1:18080`,//
|
||||
// target: `http://192.168.0.15:18080`,// 韩傲宇
|
||||
target: `http://192.168.2.209:18080`, // 赵福海
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
["^" + process.env.VUE_APP_BASE_API]: "",
|
||||
},
|
||||
['^' + process.env.VUE_APP_BASE_API]: ''
|
||||
}
|
||||
},
|
||||
"/api": {
|
||||
target: "http://192.168.0.21:17861",
|
||||
'/api': {
|
||||
target: 'http://192.168.0.21:17861',
|
||||
//设置允许跨域——此处我经过测试发现可有可无
|
||||
changeOrigin: true,
|
||||
pathRewrite: {
|
||||
"^/api": "",
|
||||
},
|
||||
},
|
||||
'^/api': ''
|
||||
}
|
||||
}
|
||||
},
|
||||
disableHostCheck: true,
|
||||
disableHostCheck: true
|
||||
},
|
||||
css: {
|
||||
loaderOptions: {
|
||||
sass: {
|
||||
sassOptions: { outputStyle: "expanded" },
|
||||
},
|
||||
},
|
||||
sassOptions: { outputStyle: 'expanded' }
|
||||
}
|
||||
}
|
||||
},
|
||||
configureWebpack: {
|
||||
name: name,
|
||||
resolve: {
|
||||
alias: {
|
||||
"@": resolve("src"),
|
||||
},
|
||||
'@': resolve('src')
|
||||
}
|
||||
},
|
||||
plugins: [
|
||||
// http://doc.bonus.vip/bonus-vue/other/faq.html#使用gzip解压缩静态文件
|
||||
new CompressionPlugin({
|
||||
cache: false, // 不启用文件缓存
|
||||
test: /\.(js|css|html|jpe?g|png|gif|svg)?$/i, // 压缩文件格式
|
||||
filename: "[path][base].gz[query]", // 压缩后的文件名
|
||||
algorithm: "gzip", // 使用gzip压缩
|
||||
filename: '[path][base].gz[query]', // 压缩后的文件名
|
||||
algorithm: 'gzip', // 使用gzip压缩
|
||||
minRatio: 0.8, // 压缩比例,小于 80% 的文件不会被压缩
|
||||
deleteOriginalAssets: false, // 压缩后删除原文件
|
||||
}),
|
||||
],
|
||||
deleteOriginalAssets: false // 压缩后删除原文件
|
||||
})
|
||||
]
|
||||
},
|
||||
chainWebpack(config) {
|
||||
config.plugins.delete("preload"); // TODO: need test
|
||||
config.plugins.delete("prefetch"); // TODO: need test
|
||||
config.plugins.delete('preload') // TODO: need test
|
||||
config.plugins.delete('prefetch') // TODO: need test
|
||||
|
||||
// set svg-sprite-loader
|
||||
config.module.rule("svg").exclude.add(resolve("src/assets/icons")).end();
|
||||
config.module.rule('svg').exclude.add(resolve('src/assets/icons')).end()
|
||||
config.module
|
||||
.rule("icons")
|
||||
.rule('icons')
|
||||
.test(/\.svg$/)
|
||||
.include.add(resolve("src/assets/icons"))
|
||||
.include.add(resolve('src/assets/icons'))
|
||||
.end()
|
||||
.use("svg-sprite-loader")
|
||||
.loader("svg-sprite-loader")
|
||||
.use('svg-sprite-loader')
|
||||
.loader('svg-sprite-loader')
|
||||
.options({
|
||||
symbolId: "icon-[name]",
|
||||
symbolId: 'icon-[name]'
|
||||
})
|
||||
.end();
|
||||
.end()
|
||||
|
||||
config.when(process.env.NODE_ENV !== "development", (config) => {
|
||||
config.when(process.env.NODE_ENV !== 'development', config => {
|
||||
config
|
||||
.plugin("ScriptExtHtmlWebpackPlugin")
|
||||
.after("html")
|
||||
.use("script-ext-html-webpack-plugin", [
|
||||
.plugin('ScriptExtHtmlWebpackPlugin')
|
||||
.after('html')
|
||||
.use('script-ext-html-webpack-plugin', [
|
||||
{
|
||||
// `runtime` must same as runtimeChunk name. default is `runtime`
|
||||
inline: /runtime\..*\.js$/,
|
||||
},
|
||||
inline: /runtime\..*\.js$/
|
||||
}
|
||||
])
|
||||
.end();
|
||||
.end()
|
||||
|
||||
config.optimization.splitChunks({
|
||||
chunks: "all",
|
||||
chunks: 'all',
|
||||
cacheGroups: {
|
||||
libs: {
|
||||
name: "chunk-libs",
|
||||
name: 'chunk-libs',
|
||||
test: /[\\/]node_modules[\\/]/,
|
||||
priority: 10,
|
||||
chunks: "initial", // only package third parties that are initially dependent
|
||||
chunks: 'initial' // only package third parties that are initially dependent
|
||||
},
|
||||
elementUI: {
|
||||
name: "chunk-elementUI", // split elementUI into a single package
|
||||
name: 'chunk-elementUI', // split elementUI into a single package
|
||||
test: /[\\/]node_modules[\\/]_?element-ui(.*)/, // in order to adapt to cnpm
|
||||
priority: 20, // the weight needs to be larger than libs and app or it will be packaged into libs or app
|
||||
priority: 20 // the weight needs to be larger than libs and app or it will be packaged into libs or app
|
||||
},
|
||||
commons: {
|
||||
name: "chunk-commons",
|
||||
test: resolve("src/components"), // can customize your rules
|
||||
name: 'chunk-commons',
|
||||
test: resolve('src/components'), // can customize your rules
|
||||
minChunks: 3, // minimum common number
|
||||
priority: 5,
|
||||
reuseExistingChunk: true,
|
||||
},
|
||||
},
|
||||
});
|
||||
config.optimization.runtimeChunk("single");
|
||||
});
|
||||
},
|
||||
};
|
||||
reuseExistingChunk: true
|
||||
}
|
||||
}
|
||||
})
|
||||
config.optimization.runtimeChunk('single')
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue