Commit d3b7283d by cat

zd

parent ada8e8a2
{ {
"name": "ruoyi", "name": "ruoyi",
"version": "3.8.9", "version": "3.8.9",
"description": "系统", "description": "地震资料处理数字化验收支持平台",
"author": "若依", "author": "若依",
"license": "MIT", "license": "MIT",
"scripts": { "scripts": {
...@@ -36,8 +36,7 @@ ...@@ -36,8 +36,7 @@
"url": "https://gitee.com/y_project/RuoYi-Vue.git" "url": "https://gitee.com/y_project/RuoYi-Vue.git"
}, },
"dependencies": { "dependencies": {
"@jsonforms/core": "^3.6.0", "@mdi/font": "^7.4.47",
"@jsonforms/vue": "^3.6.0",
"@riophae/vue-treeselect": "0.4.0", "@riophae/vue-treeselect": "0.4.0",
"axios": "0.28.1", "axios": "0.28.1",
"clipboard": "2.0.8", "clipboard": "2.0.8",
......
import request from '@/utils/request'
// 查询分享管理列表
export function listFilerole(query) {
return request({
url: '/yscgFileRole/filerole/list',
method: 'get',
params: query,
})
}
// 查询分享管理详细
export function getFilerole(id) {
return request({
url: '/yscgFileRole/filerole/' + id,
method: 'get',
})
}
// 新增分享管理
export function addFilerole(data) {
return request({
url: '/yscgFileRole/filerole',
method: 'post',
data: data,
})
}
// 修改分享管理
export function updateFilerole(data) {
return request({
url: '/yscgFileRole/filerole',
method: 'put',
data: data,
})
}
// 删除分享管理
export function delFilerole(id) {
return request({
url: '/yscgFileRole/filerole/' + id,
method: 'delete',
})
}
// 批量添加分享管理
export function batchYscgFileRole(fileid, userIds) {
return request({
url: '/yscgFileRole/filerole/batchYscgFileRole',
method: 'put',
params: { fileid, userIds },
})
}
import request from '@/utils/request'
// 查询验收前期-项目信息-项目成员列表
export function listXmcy(query) {
return request({
url: '/ysqqXmxxXmcy/xmcy/list',
method: 'get',
params: query
})
}
// 查询验收前期-项目信息-项目成员详细
export function getXmcy(cyid) {
return request({
url: '/ysqqXmxxXmcy/xmcy/' + cyid,
method: 'get'
})
}
// 新增验收前期-项目信息-项目成员
export function addXmcy(data) {
return request({
url: '/ysqqXmxxXmcy/xmcy',
method: 'post',
data: data
})
}
// 修改验收前期-项目信息-项目成员
export function updateXmcy(data) {
return request({
url: '/ysqqXmxxXmcy/xmcy',
method: 'put',
data: data
})
}
// 删除验收前期-项目信息-项目成员
export function delXmcy(cyid) {
return request({
url: '/ysqqXmxxXmcy/xmcy/' + cyid,
method: 'delete'
})
}
import request from '@/utils/request'
// 查询资料列表
export function listZlcx(query) {
return request({
url: '/yscgWjscqk/wjscqk/list_My',
method: 'get',
params: query,
})
}
...@@ -37,7 +37,8 @@ export default { ...@@ -37,7 +37,8 @@ export default {
data() { data() {
return { return {
title: process.env.VUE_APP_TITLE, title: process.env.VUE_APP_TITLE,
// logo: logoImg logo: null
// logo: logoImg (如果需要使用logo图片,取消注释并引入logoImg)
} }
} }
} }
......
...@@ -128,6 +128,19 @@ export const constantRoutes = [ ...@@ -128,6 +128,19 @@ export const constantRoutes = [
], ],
}, },
{ {
path: '/ysqqXmxxXmcy/xmcy',
component: Layout,
hidden: true,
children: [
{
path: 'index',
component: () => import('@/views/ysqqXmxxXmcy/xmcy/index'),
name: 'XmcyIndex',
meta: { title: '项目成员管理', activeMenu: '/ysqqXmxx/ysqqXmxx' },
},
],
},
{
path: '/ysqqXmxx/ysgc', path: '/ysqqXmxx/ysgc',
component: Layout, component: Layout,
hidden: true, hidden: true,
...@@ -170,6 +183,45 @@ export const constantRoutes = [ ...@@ -170,6 +183,45 @@ export const constantRoutes = [
}, },
], ],
}, },
{
path: '/yscgFileRole',
component: Layout,
hidden: true,
children: [
{
path: 'filerole',
component: () => import('@/views/yscgFileRole/filerole/index'),
name: 'FileroleIndex',
meta: { title: '分享管理', activeMenu: '/yscgWjscqk/yscg' },
},
],
},
{
path: '/system/user',
component: Layout,
hidden: true,
children: [
{
path: '',
component: () => import('@/views/system/user/index'),
name: 'UserIndex',
meta: { title: '用户管理', activeMenu: '/system/user' },
},
],
},
// {
// path: '/zlcx',
// component: Layout,
// hidden: true,
// children: [
// {
// path: 'index',
// component: () => import('@/views/zlcx/index'),
// name: 'ZlcxIndex',
// meta: { title: '资料查询' },
// },
// ],
// },
] ]
// 动态路由,基于用户权限动态去加载 // 动态路由,基于用户权限动态去加载
......
...@@ -10,10 +10,10 @@ ...@@ -10,10 +10,10 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="用户名称" prop="userName"> <el-form-item label="统一账号" prop="userName">
<el-input <el-input
v-model="queryParams.userName" v-model="queryParams.userName"
placeholder="请输入用户名称" placeholder="请输入统一账号"
clearable clearable
style="width: 240px;" style="width: 240px;"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
...@@ -101,7 +101,7 @@ ...@@ -101,7 +101,7 @@
<el-table ref="tables" v-loading="loading" :data="list" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange"> <el-table ref="tables" v-loading="loading" :data="list" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="访问编号" align="center" prop="infoId" /> <el-table-column label="访问编号" align="center" prop="infoId" />
<el-table-column label="用户名称" align="center" prop="userName" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']" /> <el-table-column label="统一账号" align="center" prop="userName" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']" />
<el-table-column label="登录地址" align="center" prop="ipaddr" width="130" :show-overflow-tooltip="true" /> <el-table-column label="登录地址" align="center" prop="ipaddr" width="130" :show-overflow-tooltip="true" />
<el-table-column label="登录地点" align="center" prop="loginLocation" :show-overflow-tooltip="true" /> <el-table-column label="登录地点" align="center" prop="loginLocation" :show-overflow-tooltip="true" />
<el-table-column label="浏览器" align="center" prop="browser" :show-overflow-tooltip="true" /> <el-table-column label="浏览器" align="center" prop="browser" :show-overflow-tooltip="true" />
......
...@@ -9,10 +9,10 @@ ...@@ -9,10 +9,10 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="用户名称" prop="userName"> <el-form-item label="统一账号" prop="userName">
<el-input <el-input
v-model="queryParams.userName" v-model="queryParams.userName"
placeholder="请输入用户名称" placeholder="请输入统一账号"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
......
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
<el-form-item label="用户名称" prop="userName"> <el-form-item label="统一账号" prop="userName">
<el-input <el-input
v-model="queryParams.userName" v-model="queryParams.userName"
placeholder="请输入用户名称" placeholder="请输入统一账号"
clearable clearable
style="width: 240px" style="width: 240px"
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
...@@ -61,8 +61,8 @@ ...@@ -61,8 +61,8 @@
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="用户名称" prop="userName" :show-overflow-tooltip="true" /> <el-table-column label="统一账号" prop="userName" :show-overflow-tooltip="true" />
<el-table-column label="用户昵称" prop="nickName" :show-overflow-tooltip="true" /> <el-table-column label="用户姓名" prop="nickName" :show-overflow-tooltip="true" />
<el-table-column label="邮箱" prop="email" :show-overflow-tooltip="true" /> <el-table-column label="邮箱" prop="email" :show-overflow-tooltip="true" />
<el-table-column label="手机" prop="phonenumber" :show-overflow-tooltip="true" /> <el-table-column label="手机" prop="phonenumber" :show-overflow-tooltip="true" />
<el-table-column label="状态" align="center" prop="status"> <el-table-column label="状态" align="center" prop="status">
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
<!-- 授权用户 --> <!-- 授权用户 -->
<el-dialog title="选择用户" :visible.sync="visible" width="800px" top="5vh" append-to-body> <el-dialog title="选择用户" :visible.sync="visible" width="800px" top="5vh" append-to-body>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true">
<el-form-item label="用户名称" prop="userName"> <el-form-item label="统一账号" prop="userName">
<el-input <el-input
v-model="queryParams.userName" v-model="queryParams.userName"
placeholder="请输入用户名称" placeholder="请输入统一账号"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
...@@ -26,8 +26,8 @@ ...@@ -26,8 +26,8 @@
<el-row> <el-row>
<el-table @row-click="clickRow" ref="table" :data="userList" @selection-change="handleSelectionChange" height="260px"> <el-table @row-click="clickRow" ref="table" :data="userList" @selection-change="handleSelectionChange" height="260px">
<el-table-column type="selection" width="55"></el-table-column> <el-table-column type="selection" width="55"></el-table-column>
<el-table-column label="用户名称" prop="userName" :show-overflow-tooltip="true" /> <el-table-column label="统一账号" prop="userName" :show-overflow-tooltip="true" />
<el-table-column label="用户昵称" prop="nickName" :show-overflow-tooltip="true" /> <el-table-column label="用户姓名" prop="nickName" :show-overflow-tooltip="true" />
<el-table-column label="邮箱" prop="email" :show-overflow-tooltip="true" /> <el-table-column label="邮箱" prop="email" :show-overflow-tooltip="true" />
<el-table-column label="手机" prop="phonenumber" :show-overflow-tooltip="true" /> <el-table-column label="手机" prop="phonenumber" :show-overflow-tooltip="true" />
<el-table-column label="状态" align="center" prop="status"> <el-table-column label="状态" align="center" prop="status">
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<el-form ref="form" :model="form" label-width="80px"> <el-form ref="form" :model="form" label-width="80px">
<el-row> <el-row>
<el-col :span="8" :offset="2"> <el-col :span="8" :offset="2">
<el-form-item label="用户昵称" prop="nickName"> <el-form-item label="用户姓名" prop="nickName">
<el-input v-model="form.nickName" disabled /> <el-input v-model="form.nickName" disabled />
</el-form-item> </el-form-item>
</el-col> </el-col>
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
<el-col> <el-col>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
label-width="68px"> label-width="68px">
<el-form-item label="用户名称" prop="userName"> <el-form-item label="统一账号" prop="userName">
<el-input v-model="queryParams.userName" placeholder="请输入用户名称" clearable style="width: 240px" <el-input v-model="queryParams.userName" placeholder="请输入统一账号" clearable style="width: 240px"
@keyup.enter.native="handleQuery" /> @keyup.enter.native="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item label="手机号码" prop="phonenumber"> <el-form-item label="手机号码" prop="phonenumber">
...@@ -72,9 +72,9 @@ ...@@ -72,9 +72,9 @@
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" /> <el-table-column type="selection" width="50" align="center" />
<el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" /> <el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" />
<el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns[1].visible" <el-table-column label="统一账号" align="center" key="userName" prop="userName" v-if="columns[1].visible"
:show-overflow-tooltip="true" /> :show-overflow-tooltip="true" />
<el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" <el-table-column label="用户姓名" align="center" key="nickName" prop="nickName" v-if="columns[2].visible"
:show-overflow-tooltip="true" /> :show-overflow-tooltip="true" />
<el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" <el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible"
:show-overflow-tooltip="true" /> :show-overflow-tooltip="true" />
...@@ -123,8 +123,8 @@ ...@@ -123,8 +123,8 @@
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="用户昵称" prop="nickName"> <el-form-item label="用户姓名" prop="nickName">
<el-input v-model="form.nickName" placeholder="请输入用户昵称" maxlength="30" /> <el-input v-model="form.nickName" placeholder="请输入用户姓名" maxlength="30" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
...@@ -148,8 +148,8 @@ ...@@ -148,8 +148,8 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item v-if="form.userId == undefined" label="用户名称" prop="userName"> <el-form-item v-if="form.userId == undefined" label="统一账号" prop="userName">
<el-input v-model="form.userName" placeholder="请输入用户名称" maxlength="30" /> <el-input v-model="form.userName" placeholder="请输入统一账号" maxlength="30" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
...@@ -329,8 +329,8 @@ export default { ...@@ -329,8 +329,8 @@ export default {
// 列信息 // 列信息
columns: [ columns: [
{ key: 0, label: `用户编号`, visible: true }, { key: 0, label: `用户编号`, visible: true },
{ key: 1, label: `用户名称`, visible: true }, { key: 1, label: `统一账号`, visible: true },
{ key: 2, label: `用户昵称`, visible: true }, { key: 2, label: `用户姓名`, visible: true },
{ key: 3, label: `部门`, visible: true }, { key: 3, label: `部门`, visible: true },
{ key: 4, label: `手机号码`, visible: true }, { key: 4, label: `手机号码`, visible: true },
{ key: 5, label: `状态`, visible: true }, { key: 5, label: `状态`, visible: true },
...@@ -339,11 +339,11 @@ export default { ...@@ -339,11 +339,11 @@ export default {
// 表单校验 // 表单校验
rules: { rules: {
userName: [ userName: [
{ required: true, message: "用户名称不能为空", trigger: "blur" }, { required: true, message: "统一账号不能为空", trigger: "blur" },
{ min: 2, max: 20, message: '用户名称长度必须介于 2 和 20 之间', trigger: 'blur' } { min: 2, max: 20, message: '统一账号长度必须介于 2 和 20 之间', trigger: 'blur' }
], ],
nickName: [ nickName: [
{ required: true, message: "用户昵称不能为空", trigger: "blur" } { required: true, message: "用户姓名不能为空", trigger: "blur" }
], ],
password: [ password: [
{ required: true, message: "用户密码不能为空", trigger: "blur" }, { required: true, message: "用户密码不能为空", trigger: "blur" },
......
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
<el-col> <el-col>
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
label-width="68px"> label-width="68px">
<el-form-item label="用户名称" prop="userName"> <el-form-item label="统一账号" prop="userName">
<el-input v-model="queryParams.userName" placeholder="请输入用户名称" clearable style="width: 240px" <el-input v-model="queryParams.userName" placeholder="请输入统一账号" clearable style="width: 240px"
@keyup.enter.native="handleQuery" /> @keyup.enter.native="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item label="手机号码" prop="phonenumber"> <el-form-item label="手机号码" prop="phonenumber">
...@@ -72,9 +72,9 @@ ...@@ -72,9 +72,9 @@
<el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="userList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" /> <el-table-column type="selection" width="50" align="center" />
<el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" /> <el-table-column label="用户编号" align="center" key="userId" prop="userId" v-if="columns[0].visible" />
<el-table-column label="用户名称" align="center" key="userName" prop="userName" v-if="columns[1].visible" <el-table-column label="统一账号" align="center" key="userName" prop="userName" v-if="columns[1].visible"
:show-overflow-tooltip="true" /> :show-overflow-tooltip="true" />
<el-table-column label="用户昵称" align="center" key="nickName" prop="nickName" v-if="columns[2].visible" <el-table-column label="用户姓名" align="center" key="nickName" prop="nickName" v-if="columns[2].visible"
:show-overflow-tooltip="true" /> :show-overflow-tooltip="true" />
<el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible" <el-table-column label="部门" align="center" key="deptName" prop="dept.deptName" v-if="columns[3].visible"
:show-overflow-tooltip="true" /> :show-overflow-tooltip="true" />
...@@ -123,8 +123,8 @@ ...@@ -123,8 +123,8 @@
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="用户昵称" prop="nickName"> <el-form-item label="用户姓名" prop="nickName">
<el-input v-model="form.nickName" placeholder="请输入用户昵称" maxlength="30" /> <el-input v-model="form.nickName" placeholder="请输入用户姓名" maxlength="30" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
...@@ -148,8 +148,8 @@ ...@@ -148,8 +148,8 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item v-if="form.userId == undefined" label="用户名称" prop="userName"> <el-form-item v-if="form.userId == undefined" label="统一账号" prop="userName">
<el-input v-model="form.userName" placeholder="请输入用户名称" maxlength="30" /> <el-input v-model="form.userName" placeholder="请输入统一账号" maxlength="30" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
...@@ -312,8 +312,8 @@ export default { ...@@ -312,8 +312,8 @@ export default {
// 列信息 // 列信息
columns: [ columns: [
{ key: 0, label: `用户编号`, visible: true }, { key: 0, label: `用户编号`, visible: true },
{ key: 1, label: `用户名称`, visible: true }, { key: 1, label: `统一账号`, visible: true },
{ key: 2, label: `用户昵称`, visible: true }, { key: 2, label: `用户姓名`, visible: true },
{ key: 3, label: `部门`, visible: true }, { key: 3, label: `部门`, visible: true },
{ key: 4, label: `手机号码`, visible: true }, { key: 4, label: `手机号码`, visible: true },
{ key: 5, label: `状态`, visible: true }, { key: 5, label: `状态`, visible: true },
...@@ -322,11 +322,11 @@ export default { ...@@ -322,11 +322,11 @@ export default {
// 表单校验 // 表单校验
rules: { rules: {
userName: [ userName: [
{ required: true, message: "用户名称不能为空", trigger: "blur" }, { required: true, message: "统一账号不能为空", trigger: "blur" },
{ min: 2, max: 20, message: '用户名称长度必须介于 2 和 20 之间', trigger: 'blur' } { min: 2, max: 20, message: '统一账号长度必须介于 2 和 20 之间', trigger: 'blur' }
], ],
nickName: [ nickName: [
{ required: true, message: "用户昵称不能为空", trigger: "blur" } { required: true, message: "用户姓名不能为空", trigger: "blur" }
], ],
password: [ password: [
{ required: true, message: "用户密码不能为空", trigger: "blur" }, { required: true, message: "用户密码不能为空", trigger: "blur" },
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
</div> </div>
<ul class="list-group list-group-striped"> <ul class="list-group list-group-striped">
<li class="list-group-item"> <li class="list-group-item">
<svg-icon icon-class="user" />用户名称 <svg-icon icon-class="user" />统一账号
<div class="pull-right">{{ user.userName }}</div> <div class="pull-right">{{ user.userName }}</div>
</li> </li>
<li class="list-group-item"> <li class="list-group-item">
......
<template> <template>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="用户昵称" prop="nickName"> <el-form-item label="用户姓名" prop="nickName">
<el-input v-model="form.nickName" maxlength="30" /> <el-input v-model="form.nickName" maxlength="30" />
</el-form-item> </el-form-item>
<el-form-item label="手机号码" prop="phonenumber"> <el-form-item label="手机号码" prop="phonenumber">
...@@ -37,7 +37,7 @@ export default { ...@@ -37,7 +37,7 @@ export default {
// 表单校验 // 表单校验
rules: { rules: {
nickName: [ nickName: [
{ required: true, message: "用户昵称不能为空", trigger: "blur" } { required: true, message: "用户姓名不能为空", trigger: "blur" }
], ],
email: [ email: [
{ required: true, message: "邮箱地址不能为空", trigger: "blur" }, { required: true, message: "邮箱地址不能为空", trigger: "blur" },
......
<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="nickName">
<el-input
v-model="queryParams.nickName"
placeholder="请输入用户姓名"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="查看权限" prop="isshow">
<el-select v-model="queryParams.isshow" placeholder="请选择查看权限" clearable>
<el-option
v-for="dict in dict.type.sys_yes_no"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="编辑权限" prop="isedit">
<el-select v-model="queryParams.isedit" placeholder="请选择编辑权限" clearable>
<el-option
v-for="dict in dict.type.sys_yes_no"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="删除权限" prop="isdel">
<el-select v-model="queryParams.isdel" placeholder="请选择删除权限" clearable>
<el-option
v-for="dict in dict.type.sys_yes_no"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="创建时间" prop="createdTime">
<el-date-picker clearable
v-model="queryParams.createdTime"
type="date"
value-format="yyyy-MM-dd"
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"
v-hasPermi="['yscgFileRole:filerole:add']"
>新增</el-button>
</el-col>
<!-- <el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['yscgFileRole:filerole:edit']"
>修改</el-button>
</el-col> -->
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['yscgFileRole:filerole:remove']"
>删除</el-button>
</el-col>
<!-- <el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['yscgFileRole:filerole:export']"
>导出</el-button>
</el-col> -->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="fileroleList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="用户姓名" align="center" prop="nickName" />
<el-table-column label="查看权限" align="center" prop="isshow">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.isshow"/>
</template>
</el-table-column>
<!-- <el-table-column label="编辑权限" align="center" prop="isedit">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.isedit"/>
</template>
</el-table-column>
<el-table-column label="删除权限" align="center" prop="isdel">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_yes_no" :value="scope.row.isdel"/>
</template>
</el-table-column> -->
<el-table-column label="创建时间" align="center" prop="createdTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createdTime, '{y}-{m}-{d}') }}</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="['yscgFileRole:filerole:edit']"
>修改</el-button> -->
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['yscgFileRole:filerole: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="选择用户" :visible.sync="open" width="800px" top="5vh" append-to-body>
<el-form :model="userQueryParams" ref="userQueryForm" size="small" :inline="true">
<el-form-item label="统一账号" prop="userName">
<el-input
v-model="userQueryParams.userName"
placeholder="请输入统一账号"
clearable
@keyup.enter.native="handleUserQuery"
/>
</el-form-item>
<!-- <el-form-item label="手机号码" prop="phonenumber">
<el-input
v-model="userQueryParams.phonenumber"
placeholder="请输入手机号码"
clearable
@keyup.enter.native="handleUserQuery"
/>
</el-form-item> -->
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleUserQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetUserQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row>
<el-table
v-loading="userLoading"
@row-click="clickRow"
ref="userTable"
:data="userList"
@selection-change="handleUserSelectionChange"
height="260px"
>
<el-table-column type="selection" width="55"></el-table-column>
<el-table-column label="统一账号" prop="userName" :show-overflow-tooltip="true" />
<el-table-column label="用户姓名" prop="nickName" :show-overflow-tooltip="true" />
<el-table-column label="邮箱" prop="email" :show-overflow-tooltip="true" />
<el-table-column label="手机" prop="phonenumber" :show-overflow-tooltip="true" />
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
</el-table>
<pagination
v-show="userTotal>0"
:total="userTotal"
:page.sync="userQueryParams.pageNum"
:limit.sync="userQueryParams.pageSize"
@pagination="getUserList"
/>
</el-row>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="handleSelectUser"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listFilerole, getFilerole, delFilerole, addFilerole, updateFilerole, batchYscgFileRole } from "@/api/yscgFileRole/filerole"
import { listUser } from "@/api/system/user"
export default {
name: "Filerole",
dicts: ['sys_yes_no', 'sys_normal_disable'],
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 分享管理表格数据
fileroleList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
nickName: null,
isshow: null,
isedit: null,
isdel: null,
createdTime: null
},
// 表单参数
form: {},
// 表单校验
rules: {
},
// 用户列表相关
userLoading: false,
// 选中用户ID数组
selectedUserIds: [],
// 用户列表数据
userList: [],
// 用户列表总数
userTotal: 0,
// 用户查询参数
userQueryParams: {
pageNum: 1,
pageSize: 10,
userName: undefined,
phonenumber: undefined
}
}
},
created() {
this.getList()
},
methods: {
/** 查询分享管理列表 */
getList() {
this.loading = true
const fileid = this.$route.query.fileid || this.$route.query.fileId || this.$route.params.fileid || this.$route.params.fileId
listFilerole({ ...this.queryParams, fileid }).then(response => {
this.fileroleList = response.rows
this.total = response.total
this.loading = false
})
},
// 取消按钮
cancel() {
this.open = false
this.reset()
},
// 表单重置
reset() {
this.form = {
id: null,
nickName: null,
isshow: null,
isedit: null,
isdel: null,
createdTime: null,
updateBy: null,
updateTime: null
}
this.resetForm("form")
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm")
this.handleQuery()
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
// 重置用户查询参数
this.resetUserQuery()
this.selectedUserIds = []
// 获取用户列表
this.getUserList()
this.open = true
this.title = "添加分享管理"
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const id = row.id || this.ids
getFilerole(id).then(response => {
this.form = response.data
this.open = true
this.title = "修改分享管理"
})
},
/** 提交按钮 - 选择用户后确定 */
handleSelectUser() {
const userIds = this.selectedUserIds.join(",")
if (userIds == "") {
this.$modal.msgError("请选择要分配的用户")
return
}
// 获取fileid,优先从路由查询参数获取,如果没有则从路由参数获取
const fileid = this.$route.query.fileid || this.$route.query.fileId || this.$route.params.fileid || this.$route.params.fileId
if (!fileid) {
this.$modal.msgError("缺少文件ID参数")
return
}
batchYscgFileRole(fileid, userIds).then(response => {
this.$modal.msgSuccess(response.msg || "新增成功")
this.open = false
this.getList()
}).catch(() => {})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateFilerole(this.form).then(response => {
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addFilerole(this.form).then(response => {
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids
this.$modal.confirm('是否确认删除分享管理编号为"' + ids + '"的数据项?').then(function() {
return delFilerole(ids)
}).then(() => {
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
this.download('yscgFileRole/filerole/export', {
...this.queryParams
}, `filerole_${new Date().getTime()}.xlsx`)
},
/** 查询用户列表 */
getUserList() {
this.userLoading = true
listUser(this.userQueryParams).then(res => {
this.userList = res.rows
this.userTotal = res.total
this.userLoading = false
}).catch(() => {
this.userLoading = false
})
},
/** 用户搜索按钮操作 */
handleUserQuery() {
this.userQueryParams.pageNum = 1
this.getUserList()
},
/** 用户重置按钮操作 */
resetUserQuery() {
this.resetForm("userQueryForm")
this.userQueryParams = {
pageNum: 1,
pageSize: 10,
userName: undefined,
phonenumber: undefined
}
this.getUserList()
},
// 用户多选框选中数据
handleUserSelectionChange(selection) {
this.selectedUserIds = selection.map(item => item.userId)
},
// 点击行选中
clickRow(row) {
this.$refs.userTable.toggleRowSelection(row)
}
}
}
</script>
<!-- 成果列表 --> <!-- 成果列表 -->
<template> <template>
<div class="app-container"> <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="wjmc"> <div class="main-layout" :class="{ 'viewer-mode': isViewerRole }">
<el-input v-model="queryParams.wjmc" placeholder="请输入文件名称" clearable @keyup.enter.native="handleQuery" /> <!-- 左侧:文件上传情况 -->
</el-form-item> <div class="left-panel">
<el-form-item label="资料类型" prop="zllx"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-select v-model="queryParams.zllx" placeholder="请选择资料类型" clearable> <el-form-item label="文件名称" prop="wjmc">
<el-option <el-input v-model="queryParams.wjmc" placeholder="请输入文件名称" clearable @keyup.enter.native="handleQuery" />
v-for="item in zllxOptions" </el-form-item>
:key="item.id" <el-form-item label="资料类型" prop="zllx">
:label="item.lxmc" <el-select v-model="queryParams.zllx" placeholder="请选择资料类型" clearable>
:value="item.lxmc"> <el-option
</el-option> v-for="item in zllxOptions"
</el-select> :key="item.id"
:label="item.lxmc"
</el-form-item> :value="item.lxmc">
<el-form-item> </el-option>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> </el-select>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> </el-form-item>
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" <el-form-item>
v-hasPermi="['yscgWjscqk:wjscqk:add']">新增</el-button> <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
v-hasPermi="['yscgWjscqk:wjscqk:edit']">修改</el-button> <el-button v-if="!isViewerRole" type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['yscgWjscqk:wjscqk:add']">新增</el-button>
v-hasPermi="['yscgWjscqk:wjscqk:remove']">删除</el-button> <el-button v-if="!isViewerRole" type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['yscgWjscqk:wjscqk:edit']">修改</el-button>
v-hasPermi="['yscgWjscqk:wjscqk:export']">导出</el-button> <el-button v-if="!isViewerRole" type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
</el-form-item> v-hasPermi="['yscgWjscqk:wjscqk:remove']">删除</el-button>
</el-form> <el-button v-if="!isViewerRole" type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
v-hasPermi="['yscgWjscqk:wjscqk:export']">导出</el-button>
</el-form-item>
<el-table border v-loading="loading" :data="wjscqkList" @selection-change="handleSelectionChange"> </el-form>
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="文件名称" align="center" prop="wjmc" min-width="120" show-overflow-tooltip /> <el-table border v-loading="loading" :data="wjscqkList" @selection-change="handleSelectionChange">
<el-table-column label="资料类型" align="center" prop="zllx" min-width="100" show-overflow-tooltip /> <el-table-column v-if="!isViewerRole" type="selection" width="55" align="center" />
<el-table-column label="上传时间" align="center" prop="createdTime" min-width="170" show-overflow-tooltip /> <el-table-column label="文件名称" align="center" prop="wjmc" min-width="120" show-overflow-tooltip>
<el-table-column label="操作" min-width="110" align="center" class-name="small-padding fixed-width"> <template slot-scope="scope">
<template slot-scope="scope"> <el-button type="text" @click="handleDownload(scope.row)" style="padding: 0; color: #409EFF;">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" {{ scope.row.wjmc }}
v-hasPermi="['yscgWjscqk:wjscqk:edit']">修改</el-button> </el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" </template>
v-hasPermi="['yscgWjscqk:wjscqk:remove']">删除</el-button> </el-table-column>
</template> <el-table-column label="资料类型" align="center" prop="zllx" min-width="100" show-overflow-tooltip />
</el-table-column> <el-table-column label="上传时间" align="center" prop="createdTime" min-width="170" show-overflow-tooltip />
</el-table> <el-table-column v-if="!isViewerRole" label="操作" min-width="110" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
@pagination="getList" /> v-hasPermi="['yscgWjscqk:wjscqk:edit']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['yscgWjscqk:wjscqk:remove']">删除</el-button>
<el-button size="mini" type="text" icon="el-icon-share" @click="handleShare(scope.row)"
v-hasPermi="['yscgWjscqk:wjscqk:share']">分享</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" />
</div>
<!-- 右侧:项目成员 -->
<div v-if="!isViewerRole" class="right-panel">
<div class="xmcy-panel">
<!-- 标题和操作栏 -->
<div class="xmcy-header">
<h3 class="xmcy-title">项目成员 ({{ xmcyTotal }})</h3>
<div class="xmcy-actions">
<el-button
type="primary"
icon="el-icon-plus"
size="small"
@click="handleXmcyAdd"
class="invite-btn"
>邀请作成员</el-button>
<el-button
type="text"
icon="el-icon-search"
size="small"
@click="toggleSearch"
class="search-btn"
></el-button>
</div>
</div>
<!-- 搜索框 -->
<div v-show="showSearchBox" class="xmcy-search">
<el-input
v-model="xmcyQueryParams.nickName"
placeholder="搜索成员"
clearable
prefix-icon="el-icon-search"
@keyup.enter.native="handleXmcyQuery"
@clear="handleXmcyQuery"
size="small"
>
</el-input>
</div>
<!-- 项目成员列表 -->
<div class="xmcy-list" v-loading="xmcyLoading">
<div
v-for="item in xmcyList"
:key="item.cyid"
class="xmcy-item"
>
<div class="xmcy-item-left">
<!-- 头像图标 -->
<div class="xmcy-avatar avatar-member">
<i class="el-icon-user"></i>
</div>
<div class="xmcy-info">
<!-- 角色标签 -->
<div class="xmcy-role-tag">
<dict-tag :options="dict.type.xm_js" :value="item.xmjs"/>
</div>
<!-- 用户姓名 -->
<div class="xmcy-name">{{ item.nickName }}</div>
</div>
</div>
<div class="xmcy-item-right">
<el-dropdown trigger="click" @command="handleCommand">
<span class="el-dropdown-link">
<i class="el-icon-arrow-down"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{action: 'edit', row: item}">
<i class="el-icon-edit"></i> 修改
</el-dropdown-item>
<el-dropdown-item divided>
<el-popconfirm
title="是否确认删除该成员?"
@confirm="handleXmcyDelete(item)"
placement="top"
>
<span slot="reference" style="display: block; width: 100%;">
<i class="el-icon-delete"></i> 删除
</span>
</el-popconfirm>
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</div>
<!-- 空状态 -->
<div v-if="!xmcyLoading && xmcyList.length === 0" class="xmcy-empty">
<p>暂无成员</p>
</div>
</div>
</div>
</div>
</div>
<!-- 添加或修改成果管理对话框 --> <!-- 添加或修改成果管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
...@@ -94,6 +199,71 @@ ...@@ -94,6 +199,71 @@
<el-button @click="cancel">取 消</el-button> <el-button @click="cancel">取 消</el-button>
</div> </div>
</el-dialog> </el-dialog>
<!-- 添加或修改项目成员对话框 -->
<el-dialog :title="xmcyTitle" :visible.sync="xmcyOpen" width="500px" append-to-body>
<el-form ref="xmcyForm" :model="xmcyForm" :rules="xmcyRules" label-width="80px">
<el-form-item label="用户姓名" prop="nickName">
<el-input v-model="xmcyForm.nickName" placeholder="请选择用户" readonly>
<el-button slot="append" icon="el-icon-search" @click="openUserDialog"></el-button>
</el-input>
</el-form-item>
<el-form-item label="项目角色" prop="xmjs">
<el-select style="width: 100%;" v-model="xmcyForm.xmjs" placeholder="请选择项目角色">
<el-option
v-for="dict in dict.type.xm_js"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitXmcyForm">确 定</el-button>
<el-button @click="cancelXmcy">取 消</el-button>
</div>
</el-dialog>
<!-- 选择用户对话框 -->
<el-dialog title="选择用户" :visible.sync="userDialogVisible" width="800px" append-to-body>
<el-form :model="userQueryParams" ref="userQueryForm" size="small" :inline="true" label-width="80px">
<el-form-item label="统一账号" prop="userName">
<el-input
v-model="userQueryParams.userName"
placeholder="请输入统一账号"
clearable
size="small"
style="width: 200px"
@keyup.enter.native="handleUserSearch"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleUserSearch">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetUserQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table
v-loading="userLoading"
:data="userList"
@row-click="handleUserSelect"
highlight-current-row
style="cursor: pointer;"
>
<el-table-column label="统一账号" align="center" prop="userName" />
<el-table-column label="用户姓名" align="center" prop="nickName" />
<el-table-column label="部门" align="center" prop="dept.deptName" />
</el-table>
<pagination
v-show="userTotal>0"
:total="userTotal"
:page.sync="userQueryParams.pageNum"
:limit.sync="userQueryParams.pageSize"
@pagination="getUserList"
/>
</el-dialog>
</div> </div>
</template> </template>
...@@ -101,9 +271,12 @@ ...@@ -101,9 +271,12 @@
import { listWjscqk, getWjscqk, delWjscqk, addWjscqk, updateWjscqk } from "@/api/yscgWjscqk/wjscqk" import { listWjscqk, getWjscqk, delWjscqk, addWjscqk, updateWjscqk } from "@/api/yscgWjscqk/wjscqk"
import { selectZllx } from "@/api/yscgZllx/zllx" import { selectZllx } from "@/api/yscgZllx/zllx"
import { getToken } from "@/utils/auth" import { getToken } from "@/utils/auth"
import { listXmcy, getXmcy, delXmcy, addXmcy, updateXmcy } from "@/api/ysqqXmxxXmcy/xmcy"
import { listUser } from "@/api/system/user"
export default { export default {
name: "Wjscqk", name: "Wjscqk",
dicts: ['xm_js'],
data() { data() {
return { return {
// 遮罩层 // 遮罩层
...@@ -153,30 +326,116 @@ export default { ...@@ -153,30 +326,116 @@ export default {
uploadHeaders: { uploadHeaders: {
Authorization: "Bearer " + getToken() Authorization: "Bearer " + getToken()
}, },
uploadData: {} uploadData: {},
// 项目成员相关数据
// 项目成员列表加载状态
xmcyLoading: false,
// 项目成员列表
xmcyList: [],
// 项目成员总条数
xmcyTotal: 0,
// 项目成员查询参数
xmcyQueryParams: {
pageNum: 1,
pageSize: 9999,
nickName: null,
zbid: null
},
// 项目成员表单参数
xmcyForm: {},
// 项目成员表单校验
xmcyRules: {
nickName: [
{ required: true, message: "用户姓名不能为空", trigger: "change" }
],
xmjs: [
{ required: true, message: "项目角色不能为空", trigger: "change" }
]
},
// 项目成员弹出层标题
xmcyTitle: "",
// 是否显示项目成员弹出层
xmcyOpen: false,
// 选择用户对话框
userDialogVisible: false,
// 用户列表加载状态
userLoading: false,
// 用户列表
userList: [],
// 用户列表总条数
userTotal: 0,
// 用户查询参数
userQueryParams: {
pageNum: 1,
pageSize: 10,
userName: null
},
// 是否显示搜索框
showSearchBox: false,
// 当前用户的项目角色
currentUserRole: null,
// 是否为查看者角色
isViewerRole: false
} }
}, },
created() { created() {
// 获取路由参数中的id // 获取路由参数中的id和角色
if (this.$route.query.xmid) { if (this.$route.query.xmid) {
this.queryParams.xmid = this.$route.query.xmid this.queryParams.xmid = this.$route.query.xmid
// 设置项目成员查询的zbid(xmid对应zbid)
this.xmcyQueryParams.zbid = this.$route.query.xmid
}
// 获取路由参数中的项目角色
if (this.$route.query.xmjs) {
this.currentUserRole = this.$route.query.xmjs
} }
this.getList() this.getList()
this.getZllxOptions() this.getZllxOptions()
}, },
mounted() {
// 在字典加载完成后判断角色
this.$nextTick(() => {
if (this.dict && this.dict.type && this.dict.type.xm_js) {
this.checkViewerRole()
}
// 加载项目成员列表
if (this.xmcyQueryParams.zbid && !this.isViewerRole) {
this.getXmcyList()
}
})
},
watch: { watch: {
// 监听路由参数变化 // 监听路由参数变化
'$route.query.xmid'(newId) { '$route.query.xmid'(newId) {
if (newId) { if (newId) {
this.queryParams.xmid = newId this.queryParams.xmid = newId
this.xmcyQueryParams.zbid = newId
this.getList() this.getList()
if (!this.isViewerRole) {
this.getXmcyList()
}
}
},
// 监听路由参数中的角色变化
'$route.query.xmjs'(newRole) {
if (newRole) {
this.currentUserRole = newRole
}
},
// 监听字典数据变化,字典加载完成后再判断角色
'dict.type.xm_js'() {
if (this.dict && this.dict.type && this.dict.type.xm_js) {
this.checkViewerRole()
} }
},
// 监听当前用户角色变化
currentUserRole() {
this.checkViewerRole()
} }
}, },
methods: { methods: {
/** 查询成果管理列表 */ /** 查询成果管理列表 */
getList() { getList() {
console.log(this.queryParams.xmid,6666);
this.loading = true this.loading = true
listWjscqk(this.queryParams).then(response => { listWjscqk(this.queryParams).then(response => {
const mergedRows = this.mergeRowsById(response.rows || []) const mergedRows = this.mergeRowsById(response.rows || [])
...@@ -321,6 +580,18 @@ export default { ...@@ -321,6 +580,18 @@ export default {
this.$modal.msgSuccess("删除成功") this.$modal.msgSuccess("删除成功")
}).catch(() => { }) }).catch(() => { })
}, },
/** 分享按钮操作 */
handleShare(row) {
// 跳转到文件权限管理页面,传递文件ID
const fileId = row.id
this.$router.push({
path: '/yscgFileRole/filerole',
query: {
fileId: fileId,
wjmc: row.wjmc
}
})
},
/** 导出按钮操作 */ /** 导出按钮操作 */
handleExport() { handleExport() {
this.download('yscgWjscqk/wjscqk/export', { this.download('yscgWjscqk/wjscqk/export', {
...@@ -395,7 +666,530 @@ export default { ...@@ -395,7 +666,530 @@ export default {
this.form.wjmc = null this.form.wjmc = null
this.form.wjlj = null this.form.wjlj = null
} }
},
/** 下载文件 */
handleDownload(row) {
// 检查是否有文件链接
if (!row.wjlj) {
this.$modal.msgWarning('该文件没有下载链接')
return
}
// 处理多个文件的情况(逗号分隔)
const fileNames = row.wjmc ? String(row.wjmc).split(',').filter(Boolean) : []
const fileLinks = String(row.wjlj).split(',').filter(Boolean)
if (fileLinks.length === 0) {
this.$modal.msgWarning('该文件没有下载链接')
return
}
// 如果只有一个文件,直接下载
if (fileLinks.length === 1) {
this.downloadFile(fileLinks[0], fileNames[0] || '文件')
return
}
// 如果有多个文件,显示选择列表
const fileOptions = fileLinks.map((link, index) => {
return {
name: fileNames[index] || `文件${index + 1}`,
link: link
}
})
// 使用MessageBox选择要下载的文件
const h = this.$createElement
const fileListHtml = fileOptions.map((file, index) => {
return h('div', {
style: {
padding: '8px 0',
cursor: 'pointer',
color: '#409EFF'
},
on: {
click: () => {
this.downloadFile(file.link, file.name)
this.$msgbox.close()
}
}
}, file.name)
})
this.$msgbox({
title: '请选择要下载的文件',
message: h('div', null, fileListHtml),
showCancelButton: true,
confirmButtonText: '取消',
cancelButtonText: '',
showConfirmButton: true,
showCancelButton: false
}).catch(() => {})
},
/** 执行文件下载 */
downloadFile(url, fileName) {
if (!url) {
this.$modal.msgWarning('文件链接无效')
return
}
// 创建一个a标签进行下载
const link = document.createElement('a')
link.style.display = 'none'
link.href = url
link.setAttribute('download', fileName)
link.setAttribute('target', '_blank')
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
this.$modal.msgSuccess('开始下载文件')
},
/** 查询项目成员列表 */
getXmcyList() {
if (!this.xmcyQueryParams.zbid) {
return
}
this.xmcyLoading = true
listXmcy(this.xmcyQueryParams).then(response => {
this.xmcyList = response.rows || []
this.xmcyTotal = response.total || 0
this.xmcyLoading = false
}).catch(() => {
this.xmcyLoading = false
})
},
/** 搜索项目成员 */
handleXmcyQuery() {
this.xmcyQueryParams.pageNum = 1
this.getXmcyList()
},
/** 重置项目成员查询 */
resetXmcyQuery() {
this.xmcyQueryParams = {
pageNum: 1,
pageSize: 9999,
nickName: null,
zbid: this.queryParams.xmid
}
this.getXmcyList()
},
/** 项目成员表单重置 */
resetXmcyForm() {
this.xmcyForm = {
cyid: null,
zbid: this.queryParams.xmid,
userId: null,
nickName: null,
xmjs: null,
createdBy: null,
createdTime: null,
updateBy: null,
updateTime: null
}
this.resetForm("xmcyForm")
},
/** 新增项目成员按钮操作 */
handleXmcyAdd() {
this.resetXmcyForm()
this.xmcyOpen = true
this.xmcyTitle = "添加项目成员"
},
/** 修改项目成员按钮操作 */
handleXmcyUpdate(row) {
this.resetXmcyForm()
const cyid = row.cyid
getXmcy(cyid).then(response => {
this.xmcyForm = response.data
// 确保zbid被设置
this.xmcyForm.zbid = this.queryParams.xmid
this.xmcyOpen = true
this.xmcyTitle = "修改项目成员"
})
},
/** 提交项目成员表单 */
submitXmcyForm() {
this.$refs["xmcyForm"].validate(valid => {
if (valid) {
if (this.xmcyForm.cyid != null) {
updateXmcy(this.xmcyForm).then(response => {
this.$modal.msgSuccess("修改成功")
this.xmcyOpen = false
this.getXmcyList()
})
} else {
addXmcy(this.xmcyForm).then(response => {
this.$modal.msgSuccess("新增成功")
this.xmcyOpen = false
this.getXmcyList()
})
}
}
})
},
/** 删除项目成员按钮操作 */
handleXmcyDelete(row) {
const cyid = row.cyid
delXmcy(cyid).then(() => {
this.getXmcyList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 取消项目成员表单 */
cancelXmcy() {
this.xmcyOpen = false
this.resetXmcyForm()
},
/** 打开选择用户对话框 */
openUserDialog() {
// 重置查询参数
this.userQueryParams = {
pageNum: 1,
pageSize: 10,
userName: null
}
this.userList = []
this.userTotal = 0
this.userDialogVisible = true
this.getUserList()
},
/** 搜索用户 */
handleUserSearch() {
this.userQueryParams.pageNum = 1
this.getUserList()
},
/** 查询用户列表 */
getUserList() {
this.userLoading = true
listUser(this.userQueryParams).then(response => {
this.userList = response.rows || []
this.userTotal = response.total || 0
this.userLoading = false
}).catch(() => {
this.userLoading = false
})
},
/** 重置用户查询 */
resetUserQuery() {
this.userQueryParams = {
pageNum: 1,
pageSize: 10,
userName: null
}
this.userList = []
this.userTotal = 0
},
/** 选择用户 */
handleUserSelect(row) {
this.xmcyForm.userId = row.userId
this.xmcyForm.nickName = row.nickName
this.xmcyForm.phonenumber = row.phonenumber
this.userDialogVisible = false
},
/** 切换搜索框显示 */
toggleSearch() {
this.showSearchBox = !this.showSearchBox
if (this.showSearchBox) {
this.$nextTick(() => {
const searchInput = this.$el.querySelector('.xmcy-search input')
if (searchInput) {
searchInput.focus()
}
})
} else {
// 隐藏搜索框时重置查询
this.resetXmcyQuery()
}
},
/** 下拉菜单命令处理 */
handleCommand(command) {
if (command.action === 'edit') {
this.handleXmcyUpdate(command.row)
}
},
/** 获取头像样式类 */
getAvatarClass(item) {
// 根据角色返回不同的样式类,管理员用绿色,其他用蓝色
if (this.isOwner(item.xmjs)) {
return 'avatar-admin'
}
return 'avatar-member'
},
/** 获取头像图标 */
getAvatarIcon(item) {
if (this.isOwner(item.xmjs)) {
return 'el-icon-user-solid'
}
return 'el-icon-user'
},
/** 判断是否为所有者/管理员 */
isOwner(xmjs) {
// 查找字典中标签包含"管理员"或"所有者"的角色
if (!this.dict || !this.dict.type || !this.dict.type.xm_js) {
return false
}
const role = this.dict.type.xm_js.find(item => item.value === xmjs)
if (role && (role.label.includes('管理员') || role.label.includes('所有者'))) {
return true
}
// 如果字典值为'1'或'admin'等,也认为是管理员
return xmjs === '1' || xmjs === 'admin'
},
/** 判断是否为查看者角色 */
checkViewerRole() {
if (!this.currentUserRole || !this.dict || !this.dict.type || !this.dict.type.xm_js) {
this.isViewerRole = false
return
}
// 查找字典中标签包含"查看者"的角色
const role = this.dict.type.xm_js.find(item => item.value === this.currentUserRole)
if (role && role.label.includes('查看者')) {
this.isViewerRole = true
} else {
this.isViewerRole = false
}
} }
} }
} }
</script> </script>
<style lang="scss" scoped>
.main-layout {
display: flex;
gap: 20px;
height: calc(100vh - 150px);
}
.left-panel {
flex: 1;
min-width: 0;
overflow: hidden;
display: flex;
flex-direction: column;
}
// 查看者模式下,左侧面板占满整个宽度
.main-layout.viewer-mode .left-panel {
width: 100%;
}
.right-panel {
width: 410px;
flex-shrink: 0;
border-left: 1px solid #e8eaed;
padding-left: 20px;
padding-right: 20px;
}
.xmcy-panel {
height: 100%;
display: flex;
flex-direction: column;
}
.xmcy-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 14px;
padding-bottom: 10px;
border-bottom: 1px solid #e8eaed;
.xmcy-title {
margin: 0;
font-size: 15px;
font-weight: 600;
color: #212121;
letter-spacing: 0.1px;
}
.xmcy-actions {
display: flex;
align-items: center;
gap: 8px;
.invite-btn {
height: 28px;
padding: 0 12px;
font-size: 12px;
border-radius: 4px;
font-weight: 500;
}
.search-btn {
padding: 4px;
font-size: 16px;
color: #757575;
border-radius: 4px;
transition: all 0.2s;
&:hover {
color: #212121;
background: rgba(0, 0, 0, 0.04);
}
}
}
}
.xmcy-search {
margin-bottom: 12px;
}
.xmcy-list {
flex: 1;
overflow-y: auto;
padding-right: 6px;
padding-top: 2px;
border: 1px solid #e8eaed;
}
.xmcy-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 10px 12px;
margin-bottom: 8px;
background: #fafafa;
border-radius: 8px;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
transition: all 0.2s ease;
&:hover {
background: #f5f5f5;
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.xmcy-item-left {
display: flex;
align-items: center;
flex: 1;
min-width: 0;
}
.xmcy-avatar {
width: 32px;
height: 32px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin-right: 10px;
flex-shrink: 0;
background: #e3f2fd;
color: #1976d2;
i {
font-size: 18px;
}
&.avatar-admin {
background: #e3f2fd;
color: #1976d2;
}
&.avatar-member {
background: #e3f2fd;
color: #1976d2;
}
}
.xmcy-info {
flex: 1;
min-width: 0;
display: flex;
flex-direction: column;
gap: 4px;
}
.xmcy-role-tag {
margin: 0;
line-height: 1.2;
::v-deep .el-tag {
margin: 0;
border: none;
font-size: 10px;
padding: 0;
background: transparent;
color: #999;
height: auto;
line-height: 1.2;
font-weight: 400;
}
}
.xmcy-name {
font-size: 13px;
font-weight: 500;
color: #424242;
margin: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
line-height: 1.3;
}
.xmcy-item-right {
flex-shrink: 0;
margin-left: 8px;
.el-dropdown-link {
cursor: pointer;
color: #bbb;
font-size: 14px;
padding: 4px;
transition: color 0.2s;
display: flex;
align-items: center;
justify-content: center;
border-radius: 4px;
&:hover {
color: #666;
background: rgba(0, 0, 0, 0.04);
}
i {
font-size: 14px;
}
}
}
}
.xmcy-empty {
text-align: center;
padding: 60px 20px;
color: #9aa0a6;
p {
margin: 0;
font-size: 14px;
}
}
.xmcy-pagination {
margin-top: 14px;
padding-top: 12px;
border-top: 1px solid #e8eaed;
}
// 滚动条样式
.xmcy-list::-webkit-scrollbar {
width: 6px;
}
.xmcy-list::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: 3px;
}
.xmcy-list::-webkit-scrollbar-thumb {
background: #c1c1c1;
border-radius: 3px;
&:hover {
background: #a8a8a8;
}
}
</style>
<!-- 成果管理 -->
<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="xmmc">
<el-input v-model="queryParams.xmmc" placeholder="请输入项目名称" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="区块" prop="qk">
<el-input v-model="queryParams.qk" placeholder="请输入区块" clearable @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-table border v-loading="loading" :data="yscgList" :span-method="spanMethod">
<el-table-column label="项目名称" align="center" prop="xmmc" min-width="150" show-overflow-tooltip />
<el-table-column label="区块" align="center" prop="qk" min-width="120" show-overflow-tooltip />
<el-table-column label="资料类型" align="center" prop="zllxmc" min-width="120" show-overflow-tooltip />
<el-table-column label="上传情况" align="center" min-width="120">
<template slot-scope="scope">
<i :class="scope.row.zlsl > 0 ? 'el-icon-check' : 'el-icon-close'"
:style="{ color: scope.row.zlsl > 0 ? '#67C23A' : '#F56C6C', fontSize: '18px' }">
</i>
</template>
</el-table-column>
<el-table-column label="资料数量" align="center" prop="zlsl" min-width="120" show-overflow-tooltip />
<el-table-column label="成果" align="center" prop="id" min-width="100" show-overflow-tooltip>
<template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)">资料管理</el-button>
<el-button size="mini" type="text" icon="el-icon-user" @click="handleXmcyInfo(scope.row)">项目成员</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-drawer
title=""
:visible.sync="xmcyDrawerVisible"
direction="rtl"
size="500px"
:before-close="() => { xmcyDrawerVisible = false }"
:wrapperClosable="false"
>
<div class="xmcy-drawer-content">
<!-- 标题和操作栏 -->
<div class="xmcy-header">
<h3 class="xmcy-title">项目成员 ({{ xmcyTotal }})</h3>
<div class="xmcy-actions">
<el-button
type="primary"
icon="el-icon-plus"
size="small"
@click="handleXmcyAdd"
class="invite-btn"
>邀请作成员</el-button>
<el-button
type="text"
icon="el-icon-search"
size="small"
@click="toggleSearch"
class="search-btn"
></el-button>
</div>
</div>
<!-- 搜索框 -->
<div v-show="showSearchBox" class="xmcy-search">
<el-input
v-model="xmcyQueryParams.nickName"
placeholder="搜索成员"
clearable
prefix-icon="el-icon-search"
@keyup.enter.native="handleXmcyQuery"
@clear="handleXmcyQuery"
size="small"
>
</el-input>
</div>
<!-- 项目成员列表 -->
<div class="xmcy-list" v-loading="xmcyLoading">
<div
v-for="item in xmcyList"
:key="item.cyid"
class="xmcy-item"
>
<div class="xmcy-item-left">
<!-- 头像图标 -->
<div class="xmcy-avatar" :class="getAvatarClass(item)">
<i :class="getAvatarIcon(item)"></i>
</div>
<div class="xmcy-info">
<!-- 角色标签 -->
<div class="xmcy-role-tag">
<dict-tag :options="dict.type.xm_js" :value="item.xmjs"/>
</div>
<!-- 用户姓名和电话 -->
<div class="xmcy-name">{{ item.nickName }}</div>
<div class="xmcy-phone">{{ item.phonenumber || item.userName || '' }}</div>
<!-- 权限信息 -->
<div class="xmcy-permission" v-if="isOwner(item.xmjs)">所有者</div>
</div>
</div>
<div class="xmcy-item-right">
<el-dropdown trigger="click" @command="handleCommand">
<span class="el-dropdown-link">
<i class="el-icon-arrow-down"></i>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item :command="{action: 'edit', row: item}">
<i class="el-icon-edit"></i> 修改
</el-dropdown-item>
<el-dropdown-item :command="{action: 'delete', row: item}" divided>
<i class="el-icon-delete"></i> 删除
</el-dropdown-item>
</el-dropdown-menu>
</el-dropdown>
</div>
</div>
<!-- 空状态 -->
<div v-if="!xmcyLoading && xmcyList.length === 0" class="xmcy-empty">
<p>暂无成员</p>
</div>
</div>
<!-- 项目成员分页 -->
<div class="xmcy-pagination" v-show="xmcyTotal>0">
<pagination
:total="xmcyTotal"
:page.sync="xmcyQueryParams.pageNum"
:limit.sync="xmcyQueryParams.pageSize"
@pagination="getXmcyList"
/>
</div>
</div>
<!-- 添加或修改项目成员对话框 -->
<el-dialog :title="xmcyTitle" :visible.sync="xmcyOpen" width="500px" append-to-body>
<el-form ref="xmcyForm" :model="xmcyForm" :rules="xmcyRules" label-width="80px">
<el-form-item label="用户姓名" prop="nickName">
<el-input v-model="xmcyForm.nickName" placeholder="请选择用户" readonly>
<el-button slot="append" icon="el-icon-search" @click="openUserDialog"></el-button>
</el-input>
</el-form-item>
<el-form-item label="项目角色" prop="xmjs">
<el-select style="width: 100%;" v-model="xmcyForm.xmjs" placeholder="请选择项目角色">
<el-option
v-for="dict in dict.type.xm_js"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitXmcyForm">确 定</el-button>
<el-button @click="cancelXmcy">取 消</el-button>
</div>
</el-dialog>
<!-- 选择用户对话框 -->
<el-dialog title="选择用户" :visible.sync="userDialogVisible" width="800px" append-to-body>
<el-form :model="userQueryParams" ref="userQueryForm" size="small" :inline="true" label-width="80px">
<el-form-item label="统一账号" prop="userName">
<el-input
v-model="userQueryParams.userName"
placeholder="请输入统一账号"
clearable
size="small"
style="width: 200px"
@keyup.enter.native="handleUserSearch"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleUserSearch">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetUserQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table
v-loading="userLoading"
:data="userList"
@row-click="handleUserSelect"
highlight-current-row
style="cursor: pointer;"
>
<el-table-column label="统一账号" align="center" prop="userName" />
<el-table-column label="用户姓名" align="center" prop="nickName" />
<el-table-column label="部门" align="center" prop="dept.deptName" />
</el-table>
<pagination
v-show="userTotal>0"
:total="userTotal"
:page.sync="userQueryParams.pageNum"
:limit.sync="userQueryParams.pageSize"
@pagination="getUserList"
/>
</el-dialog>
</el-drawer>
</div>
</template>
<script>
import { listYscgList } from "@/api/yscgWjscqk/wjscqk"
import { listXmcy, getXmcy, delXmcy, addXmcy, updateXmcy } from "@/api/ysqqXmxxXmcy/xmcy"
import { listUser } from "@/api/system/user"
export default {
name: "Yscg",
dicts: ['xm_js'],
data() {
return {
// 遮罩层
loading: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 成果管理表格数据
yscgList: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
xmmc: null,
qk: null
},
// 项目成员抽屉显示状态
xmcyDrawerVisible: false,
// 项目成员列表加载状态
xmcyLoading: false,
// 项目成员列表
xmcyList: [],
// 项目成员总条数
xmcyTotal: 0,
// 项目成员查询参数
xmcyQueryParams: {
pageNum: 1,
pageSize: 10,
nickName: null,
zbid: null
},
// 项目成员表单参数
xmcyForm: {},
// 项目成员表单校验
xmcyRules: {
nickName: [
{ required: true, message: "用户姓名不能为空", trigger: "change" }
],
xmjs: [
{ required: true, message: "项目角色不能为空", trigger: "change" }
]
},
// 项目成员弹出层标题
xmcyTitle: "",
// 是否显示项目成员弹出层
xmcyOpen: false,
// 当前选中的项目id
currentZbid: null,
// 选择用户对话框
userDialogVisible: false,
// 用户列表加载状态
userLoading: false,
// 用户列表
userList: [],
// 用户列表总条数
userTotal: 0,
// 用户查询参数
userQueryParams: {
pageNum: 1,
pageSize: 10,
userName: null
},
// 是否显示搜索框
showSearchBox: false
}
},
created() {
this.getList()
},
methods: {
/** 查询成果管理列表 */
getList() {
this.loading = true
listYscgList(this.queryParams).then(response => {
this.yscgList = response.rows
this.total = response.total
this.loading = false
})
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm")
this.handleQuery()
},
/** 成果按钮操作 */
handleView(row) {
// 跳转到成果详情页面,传id
this.$router.push({
path: '/yscgWjscqk/wjscqk',
query: {
xmid: row.id
}
})
},
/** 项目成员按钮操作 */
handleXmcyInfo(row) {
// 设置当前选中的项目id
this.currentZbid = row.id
// 重置项目成员查询参数
this.xmcyQueryParams = {
pageNum: 1,
pageSize: 10,
nickName: null,
zbid: row.id
}
// 打开抽屉并加载项目成员列表
this.xmcyDrawerVisible = true
this.getXmcyList()
},
/** 表格行合并方法 */
spanMethod({ row, column, rowIndex, columnIndex }) {
// 项目名称列(第0列)、区块列(第1列)和成果列(第5列)需要合并
if (columnIndex === 0 || columnIndex === 1 || columnIndex === 5) {
let fieldName, currentValue
if (columnIndex === 0) {
// 项目名称列根据xmmc合并
fieldName = 'xmmc'
currentValue = row[fieldName]
} else if (columnIndex === 1) {
// 区块列根据qk合并
fieldName = 'xmmc'
currentValue = row[fieldName]
} else if (columnIndex === 5) {
// 成果列根据id合并
fieldName = 'id'
currentValue = row[fieldName]
}
// 如果当前值为空,不合并
if (!currentValue) {
return [1, 1]
}
// 如果当前值与上一行相同,则隐藏当前行
if (rowIndex > 0 && this.yscgList[rowIndex - 1][fieldName] === currentValue) {
return [0, 0]
}
// 计算需要合并的行数
let rowspan = 1
for (let i = rowIndex + 1; i < this.yscgList.length; i++) {
if (this.yscgList[i][fieldName] === currentValue) {
rowspan++
} else {
break
}
}
return [rowspan, 1]
}
// 其他列不合并
return [1, 1]
},
/** 查询项目成员列表 */
getXmcyList() {
this.xmcyLoading = true
listXmcy(this.xmcyQueryParams).then(response => {
this.xmcyList = response.rows
this.xmcyTotal = response.total
this.xmcyLoading = false
}).catch(() => {
this.xmcyLoading = false
})
},
/** 搜索项目成员 */
handleXmcyQuery() {
this.xmcyQueryParams.pageNum = 1
this.getXmcyList()
},
/** 重置项目成员查询 */
resetXmcyQuery() {
this.xmcyQueryParams = {
pageNum: 1,
pageSize: 10,
nickName: null,
zbid: this.currentZbid
}
this.getXmcyList()
},
/** 项目成员表单重置 */
resetXmcyForm() {
this.xmcyForm = {
cyid: null,
zbid: this.currentZbid,
userId: null,
nickName: null,
xmjs: null,
createdBy: null,
createdTime: null,
updateBy: null,
updateTime: null
}
this.resetForm("xmcyForm")
},
/** 新增项目成员按钮操作 */
handleXmcyAdd() {
this.resetXmcyForm()
this.xmcyOpen = true
this.xmcyTitle = "添加项目成员"
},
/** 修改项目成员按钮操作 */
handleXmcyUpdate(row) {
this.resetXmcyForm()
const cyid = row.cyid
getXmcy(cyid).then(response => {
this.xmcyForm = response.data
// 确保zbid被设置
this.xmcyForm.zbid = this.currentZbid
this.xmcyOpen = true
this.xmcyTitle = "修改项目成员"
})
},
/** 提交项目成员表单 */
submitXmcyForm() {
this.$refs["xmcyForm"].validate(valid => {
if (valid) {
if (this.xmcyForm.cyid != null) {
updateXmcy(this.xmcyForm).then(response => {
this.$modal.msgSuccess("修改成功")
this.xmcyOpen = false
this.getXmcyList()
})
} else {
addXmcy(this.xmcyForm).then(response => {
this.$modal.msgSuccess("新增成功")
this.xmcyOpen = false
this.getXmcyList()
})
}
}
})
},
/** 删除项目成员按钮操作 */
handleXmcyDelete(row) {
const cyid = row.cyid
this.$modal.confirm('是否确认删除项目成员编号为"' + cyid + '"的数据项?').then(function() {
return delXmcy(cyid)
}).then(() => {
this.getXmcyList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 取消项目成员表单 */
cancelXmcy() {
this.xmcyOpen = false
this.resetXmcyForm()
},
/** 打开选择用户对话框 */
openUserDialog() {
// 重置查询参数
this.userQueryParams = {
pageNum: 1,
pageSize: 10,
userName: null
}
this.userList = []
this.userTotal = 0
this.userDialogVisible = true
this.getUserList()
},
/** 搜索用户 */
handleUserSearch() {
this.userQueryParams.pageNum = 1
this.getUserList()
},
/** 查询用户列表 */
getUserList() {
this.userLoading = true
listUser(this.userQueryParams).then(response => {
this.userList = response.rows
this.userTotal = response.total
this.userLoading = false
}).catch(() => {
this.userLoading = false
})
},
/** 重置用户查询 */
resetUserQuery() {
this.userQueryParams = {
pageNum: 1,
pageSize: 10,
userName: null
}
this.userList = []
this.userTotal = 0
},
/** 选择用户 */
handleUserSelect(row) {
this.xmcyForm.userId = row.userId
this.xmcyForm.nickName = row.nickName
this.xmcyForm.phonenumber = row.phonenumber
this.userDialogVisible = false
},
/** 切换搜索框显示 */
toggleSearch() {
this.showSearchBox = !this.showSearchBox
if (this.showSearchBox) {
this.$nextTick(() => {
const searchInput = this.$el.querySelector('.xmcy-search input')
if (searchInput) {
searchInput.focus()
}
})
} else {
// 隐藏搜索框时重置查询
this.resetXmcyQuery()
}
},
/** 下拉菜单命令处理 */
handleCommand(command) {
if (command.action === 'edit') {
this.handleXmcyUpdate(command.row)
} else if (command.action === 'delete') {
this.handleXmcyDelete(command.row)
}
},
/** 获取头像样式类 */
getAvatarClass(item) {
// 根据角色返回不同的样式类,管理员用绿色,其他用蓝色
if (this.isOwner(item.xmjs)) {
return 'avatar-admin'
}
return 'avatar-member'
},
/** 获取头像图标 */
getAvatarIcon(item) {
if (this.isOwner(item.xmjs)) {
return 'el-icon-user-solid'
}
return 'el-icon-user'
},
/** 判断是否为所有者/管理员 */
isOwner(xmjs) {
// 查找字典中标签包含"管理员"或"所有者"的角色
if (!this.dict || !this.dict.type || !this.dict.type.xm_js) {
return false
}
const role = this.dict.type.xm_js.find(item => item.value === xmjs)
if (role && (role.label.includes('管理员') || role.label.includes('所有者'))) {
return true
}
// 如果字典值为'1'或'admin'等,也认为是管理员
return xmjs === '1' || xmjs === 'admin'
}
}
}
</script>
<style lang="scss" scoped>
.xmcy-drawer-content {
height: 100%;
display: flex;
flex-direction: column;
padding: 20px;
}
.xmcy-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
padding-bottom: 16px;
border-bottom: 1px solid #e8eaed;
.xmcy-title {
margin: 0;
font-size: 18px;
font-weight: 600;
color: #202124;
}
.xmcy-actions {
display: flex;
align-items: center;
gap: 8px;
.invite-btn {
height: 32px;
padding: 0 16px;
font-size: 14px;
}
.search-btn {
padding: 8px;
font-size: 18px;
}
}
}
.xmcy-search {
margin-bottom: 16px;
}
.xmcy-list {
flex: 1;
overflow-y: auto;
padding-right: 4px;
}
.xmcy-item {
display: flex;
justify-content: space-between;
align-items: flex-start;
padding: 16px;
margin-bottom: 12px;
background: #f8f9fa;
border-radius: 8px;
transition: all 0.2s;
&:hover {
background: #f1f3f5;
}
.xmcy-item-left {
display: flex;
align-items: flex-start;
flex: 1;
min-width: 0;
}
.xmcy-avatar {
width: 40px;
height: 40px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin-right: 12px;
flex-shrink: 0;
i {
font-size: 24px;
}
&.avatar-admin {
background: #e8f5e9;
color: #4caf50;
}
&.avatar-member {
background: #e3f2fd;
color: #2196f3;
}
}
.xmcy-info {
flex: 1;
min-width: 0;
}
.xmcy-role-tag {
margin-bottom: 4px;
::v-deep .el-tag {
margin-right: 8px;
border: none;
font-size: 12px;
padding: 2px 8px;
}
}
.xmcy-name {
font-size: 15px;
font-weight: 500;
color: #202124;
margin-bottom: 4px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.xmcy-phone {
font-size: 13px;
color: #5f6368;
margin-bottom: 4px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.xmcy-permission {
font-size: 12px;
color: #5f6368;
margin-top: 4px;
}
.xmcy-item-right {
flex-shrink: 0;
margin-left: 12px;
.el-dropdown-link {
cursor: pointer;
color: #5f6368;
font-size: 16px;
padding: 4px;
transition: color 0.2s;
&:hover {
color: #202124;
}
}
}
}
.xmcy-empty {
text-align: center;
padding: 60px 20px;
color: #9aa0a6;
p {
margin: 0;
font-size: 14px;
}
}
.xmcy-pagination {
margin-top: 20px;
padding-top: 16px;
border-top: 1px solid #e8eaed;
}
// 滚动条样式
.xmcy-list::-webkit-scrollbar {
width: 6px;
}
.xmcy-list::-webkit-scrollbar-track {
background: #f1f1f1;
border-radius: 3px;
}
.xmcy-list::-webkit-scrollbar-thumb {
background: #c1c1c1;
border-radius: 3px;
&:hover {
background: #a8a8a8;
}
}
</style>
...@@ -25,10 +25,15 @@ ...@@ -25,10 +25,15 @@
:style="{ color: scope.row.zlsl > 0 ? '#67C23A' : '#F56C6C', fontSize: '18px' }"> :style="{ color: scope.row.zlsl > 0 ? '#67C23A' : '#F56C6C', fontSize: '18px' }">
</i> </i>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="资料数量" align="center" prop="zlsl" min-width="120" show-overflow-tooltip />
<el-table-column label="成果" align="center" prop="id" min-width="100" show-overflow-tooltip> <el-table-column label="成果" align="center" prop="id" min-width="100" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)">查看成果</el-button> <!-- <el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)">资料管理</el-button>
<el-button size="mini" type="text" icon="el-icon-user" @click="handleXmcyInfo(scope.row)">项目成员</el-button> -->
<el-button size="mini" type="text" icon="el-icon-user" @click="handleXmcyInfo(scope.row)">资料管理</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -95,19 +100,33 @@ export default { ...@@ -95,19 +100,33 @@ export default {
} }
}) })
}, },
/** 项目成员按钮操作 */
handleXmcyInfo(row) {
// 跳转到文件上传情况页面(包含项目成员功能),传id和项目角色
this.$router.push({
path: '/yscgWjscqk/wjscqk',
query: {
xmid: row.id,
xmjs: row.xmjs || null
}
})
},
/** 表格行合并方法 */ /** 表格行合并方法 */
spanMethod({ row, column, rowIndex, columnIndex }) { spanMethod({ row, column, rowIndex, columnIndex }) {
// 项目名称列(第0列)、区块列(第1列)和成果列(第3列)需要合并 // 项目名称列(第0列)、区块列(第1列)和成果列(第5列)需要合并
if (columnIndex === 0 || columnIndex === 1 || columnIndex === 4) { if (columnIndex === 0 || columnIndex === 1 || columnIndex === 5) {
let fieldName, currentValue let fieldName, currentValue
if (columnIndex === 0) { if (columnIndex === 0) {
// 项目名称列根据xmmc合并
fieldName = 'xmmc' fieldName = 'xmmc'
currentValue = row[fieldName] currentValue = row[fieldName]
} else if (columnIndex === 1) { } else if (columnIndex === 1) {
fieldName = 'qk' // 区块列根据qk合并
fieldName = 'xmmc'
currentValue = row[fieldName] currentValue = row[fieldName]
} else if (columnIndex === 4) { } else if (columnIndex === 5) {
// 成果列根据id合并
fieldName = 'id' fieldName = 'id'
currentValue = row[fieldName] currentValue = row[fieldName]
} }
......
...@@ -55,10 +55,10 @@ ...@@ -55,10 +55,10 @@
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
v-hasPermi="['ysqqXmxx:ysqqXmxx:add']">新增</el-button> v-hasPermi="['ysqqXmxx:ysqqXmxx:add']">新增</el-button>
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" <!-- <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
v-hasPermi="['ysqqXmxx:ysqqXmxx:edit']">修改</el-button> v-hasPermi="['ysqqXmxx:ysqqXmxx:edit']">修改</el-button>
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete"
v-hasPermi="['ysqqXmxx:ysqqXmxx:remove']">删除</el-button> v-hasPermi="['ysqqXmxx:ysqqXmxx:remove']">删除</el-button> -->
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
v-hasPermi="['ysqqXmxx:ysqqXmxx:export']">导出</el-button> v-hasPermi="['ysqqXmxx:ysqqXmxx:export']">导出</el-button>
</el-form-item> </el-form-item>
...@@ -73,8 +73,8 @@ ...@@ -73,8 +73,8 @@
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> --> </el-row> -->
<el-table border v-loading="loading" :data="ysqqXmxxList" @selection-change="handleSelectionChange"> <el-table border v-loading="loading" :data="ysqqXmxxList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="50" align="center" /> <!-- <el-table-column type="selection" width="50" align="center" /> -->
<!-- <el-table-column label="主键" align="center" prop="id" /> --> <el-table-column label="序号" align="center" type="index"/>
<el-table-column label="项目名称" align="center" prop="xmmc" min-width="100" show-overflow-tooltip /> <el-table-column label="项目名称" align="center" prop="xmmc" min-width="100" show-overflow-tooltip />
<el-table-column label="项目日期" align="center" prop="xmrq" min-width="100" show-overflow-tooltip /> <el-table-column label="项目日期" align="center" prop="xmrq" min-width="100" show-overflow-tooltip />
<el-table-column label="区块" align="center" prop="qk" min-width="70" show-overflow-tooltip /> <el-table-column label="区块" align="center" prop="qk" min-width="70" show-overflow-tooltip />
...@@ -100,44 +100,56 @@ ...@@ -100,44 +100,56 @@
<el-table-column label="备用2" align="center" prop="ext2" /> <el-table-column label="备用2" align="center" prop="ext2" />
<el-table-column label="备用3" align="center" prop="ext3" /> --> <el-table-column label="备用3" align="center" prop="ext3" /> -->
<!-- <el-table-column label="项目状态" align="center" prop="xmzt" /> --> <!-- <el-table-column label="项目状态" align="center" prop="xmzt" /> -->
<el-table-column label="操作" min-width="200" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" min-width="260" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- 未提交状态:显示所有操作按钮 --> <!-- 判断是否为查看者 -->
<template v-if="scope.row.xmzt === '未提交'"> <template v-if="isViewer(scope.row.xmjs)">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" <!-- 查看者:只能查看 -->
v-hasPermi="['ysqqXmxx:ysqqXmxx:edit']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['ysqqXmxx:ysqqXmxx:remove']">删除</el-button>
<el-button size="mini" type="text" icon="el-icon-upload2" @click="handleSubmit(scope.row)"
v-hasPermi="['ysqqXmxx:ysqqXmxx:submit']">提交</el-button>
<el-button size="mini" type="text" icon="el-icon-odometer" @click="handleJxxInfo(scope.row)">井信息</el-button> <el-button size="mini" type="text" icon="el-icon-odometer" @click="handleJxxInfo(scope.row)">井信息</el-button>
<el-button size="mini" type="text" icon="el-icon-user" @click="handleXmcyInfo(scope.row)">项目成员</el-button>
<el-button size="mini" type="text" icon="el-icon-files" <el-button size="mini" type="text" icon="el-icon-files"
@click="handleSegyInfo(scope.row)">segy信息</el-button> @click="handleSegyInfo(scope.row)">segy信息</el-button>
<el-button size="mini" type="text" icon="el-icon-location" <el-button size="mini" type="text" icon="el-icon-location"
@click="handleYsgcInfo(scope.row)">导航图</el-button> @click="handleYsgcInfo(scope.row)">导航图</el-button>
</template> </template>
<!-- 待验收状态:显示查看、修改、删除、井信息、segy信息和撤回按钮 --> <!-- 管理者和协作者:根据项目状态显示不同操作 -->
<template v-else-if="scope.row.xmzt === '待验收'">
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)">查看</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['ysqqXmxx:ysqqXmxx:edit']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['ysqqXmxx:ysqqXmxx:remove']">删除</el-button>
<el-button size="mini" type="text" icon="el-icon-odometer" @click="handleJxxInfo(scope.row)">井信息</el-button>
<el-button size="mini" type="text" icon="el-icon-files"
@click="handleSegyInfo(scope.row)">segy信息</el-button>
<el-button size="mini" type="text" icon="el-icon-back" @click="handleWithdraw(scope.row)"
v-hasPermi="['ysqqXmxx:ysqqXmxx:withdraw']">撤回</el-button>
<el-button size="mini" type="text" icon="el-icon-location"
@click="handleYsgcInfo(scope.row)">导航图</el-button>
</template>
<!-- 已验收和已归档状态:只显示查看按钮 -->
<template v-else> <template v-else>
<el-button size="mini" type="text" icon="el-icon-odometer" @click="handleJxxInfo(scope.row)">井信息</el-button> <!-- 未提交状态:显示所有操作按钮 -->
<el-button size="mini" type="text" icon="el-icon-files" <template v-if="scope.row.xmzt === '未提交'">
@click="handleSegyInfo(scope.row)">segy信息</el-button> <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
<el-button size="mini" type="text" icon="el-icon-location" v-hasPermi="['ysqqXmxx:ysqqXmxx:edit']">修改</el-button>
@click="handleYsgcInfo(scope.row)">导航图</el-button> <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['ysqqXmxx:ysqqXmxx:remove']">删除</el-button>
<el-button size="mini" type="text" icon="el-icon-upload2" @click="handleSubmit(scope.row)"
v-hasPermi="['ysqqXmxx:ysqqXmxx:submit']">提交</el-button>
<el-button size="mini" type="text" icon="el-icon-odometer" @click="handleJxxInfo(scope.row)">井信息</el-button>
<el-button size="mini" type="text" icon="el-icon-user" @click="handleXmcyInfo(scope.row)">项目成员</el-button>
<el-button size="mini" type="text" icon="el-icon-files"
@click="handleSegyInfo(scope.row)">segy信息</el-button>
<el-button size="mini" type="text" icon="el-icon-location"
@click="handleYsgcInfo(scope.row)">导航图</el-button>
</template>
<!-- 待验收状态:显示查看、井信息、segy信息、撤回和导航图按钮 -->
<template v-else-if="scope.row.xmzt === '待验收'">
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)">查看</el-button>
<el-button size="mini" type="text" icon="el-icon-odometer" @click="handleJxxInfo(scope.row)">井信息</el-button>
<el-button size="mini" type="text" icon="el-icon-user" @click="handleXmcyInfo(scope.row)">项目成员</el-button>
<el-button size="mini" type="text" icon="el-icon-files"
@click="handleSegyInfo(scope.row)">segy信息</el-button>
<el-button size="mini" type="text" icon="el-icon-back" @click="handleWithdraw(scope.row)"
v-hasPermi="['ysqqXmxx:ysqqXmxx:submit']">撤回</el-button>
<el-button size="mini" type="text" icon="el-icon-location"
@click="handleYsgcInfo(scope.row)">导航图</el-button>
</template>
<!-- 已验收和已归档状态:只显示查看按钮 -->
<template v-else>
<el-button size="mini" type="text" icon="el-icon-odometer" @click="handleJxxInfo(scope.row)">井信息</el-button>
<el-button size="mini" type="text" icon="el-icon-user" @click="handleXmcyInfo(scope.row)">项目成员</el-button>
<el-button size="mini" type="text" icon="el-icon-files"
@click="handleSegyInfo(scope.row)">segy信息</el-button>
<el-button size="mini" type="text" icon="el-icon-location"
@click="handleYsgcInfo(scope.row)">导航图</el-button>
</template>
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
...@@ -247,7 +259,7 @@ import { listYsqqXmxx, getYsqqXmxx, delYsqqXmxx, addYsqqXmxx, updateYsqqXmxx, st ...@@ -247,7 +259,7 @@ import { listYsqqXmxx, getYsqqXmxx, delYsqqXmxx, addYsqqXmxx, updateYsqqXmxx, st
export default { export default {
name: "YsqqXmxx", name: "YsqqXmxx",
dicts: ['ys_xmzt'], dicts: ['ys_xmzt', 'xm_js'],
data() { data() {
return { return {
// 遮罩层 // 遮罩层
...@@ -443,6 +455,16 @@ export default { ...@@ -443,6 +455,16 @@ export default {
} }
}) })
}, },
/** 项目成员按钮操作 */
handleXmcyInfo(row) {
this.$router.push({
path: '/ysqqXmxxXmcy/xmcy/index',
query: {
zbid: row.id,
xmjs: row.xmjs // 传递当前用户在该项目中的角色
}
})
},
/** segy信息按钮操作 */ /** segy信息按钮操作 */
handleSegyInfo(row) { handleSegyInfo(row) {
this.$router.push({ this.$router.push({
...@@ -492,6 +514,18 @@ export default { ...@@ -492,6 +514,18 @@ export default {
this.getList() this.getList()
this.$modal.msgSuccess("撤回成功") this.$modal.msgSuccess("撤回成功")
}).catch(() => { }) }).catch(() => { })
},
/** 判断是否为查看者 */
isViewer(xmjs) {
if (!xmjs || !this.dict || !this.dict.type || !this.dict.type.xm_js) {
return false
}
// 查找字典中标签包含"查看者"的角色
const role = this.dict.type.xm_js.find(item => item.value === xmjs)
if (role && role.label.includes('查看者')) {
return true
}
return false
} }
} }
} }
......
...@@ -46,13 +46,13 @@ ...@@ -46,13 +46,13 @@
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <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-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button v-if="projectStatus === '未提交' || projectStatus === '待验收'" type="primary" plain icon="el-icon-plus" <el-button v-if="projectStatus === '未提交'" type="primary" plain icon="el-icon-plus"
size="mini" @click="handleAdd" v-hasPermi="['ysqqXmxxJxx:jxx:add']">新增</el-button> size="mini" @click="handleAdd" v-hasPermi="['ysqqXmxxJxx:jxx:add']">新增</el-button>
<el-button type="success" plain icon="el-icon-edit" size="mini" <el-button type="success" plain icon="el-icon-edit" size="mini"
:disabled="single || (projectStatus !== '未提交' && projectStatus !== '待验收')" @click="handleUpdate" :disabled="single || projectStatus !== '未提交'" @click="handleUpdate"
v-hasPermi="['ysqqXmxxJxx:jxx:edit']">修改</el-button> v-hasPermi="['ysqqXmxxJxx:jxx:edit']">修改</el-button>
<el-button type="danger" plain icon="el-icon-delete" size="mini" <el-button type="danger" plain icon="el-icon-delete" size="mini"
:disabled="multiple || (projectStatus !== '未提交' && projectStatus !== '待验收')" @click="handleDelete" :disabled="multiple || projectStatus !== '未提交'" @click="handleDelete"
v-hasPermi="['ysqqXmxxJxx:jxx:remove']">删除</el-button> v-hasPermi="['ysqqXmxxJxx:jxx:remove']">删除</el-button>
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
v-hasPermi="['ysqqXmxxJxx:jxx:export']">导出</el-button> v-hasPermi="['ysqqXmxxJxx:jxx:export']">导出</el-button>
...@@ -89,16 +89,16 @@ ...@@ -89,16 +89,16 @@
<el-table-column label="备用3" align="center" prop="ext3" /> --> <el-table-column label="备用3" align="center" prop="ext3" /> -->
<el-table-column label="操作" min-width="100" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" min-width="100" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- 未提交和待验收状态:显示修改和删除按钮 --> <!-- 未提交状态:显示修改和删除按钮 -->
<template v-if="projectStatus === '未提交' || projectStatus === '待验收'"> <template v-if="projectStatus === '未提交'">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['ysqqXmxxJxx:jxx:edit']">修改</el-button> v-hasPermi="['ysqqXmxxJxx:jxx:edit']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['ysqqXmxxJxx:jxx:remove']">删除</el-button> v-hasPermi="['ysqqXmxxJxx:jxx:remove']">删除</el-button>
</template> </template>
<!-- 其他状态(已验收、已归档):只显示查看按钮 --> <!-- 其他状态(待验收、已验收、已归档):只显示查看按钮 -->
<template v-else> <template v-else>
<el-button size="mini" type="text" icon="el-icon-view" @click="handleUpdate(scope.row)">查看</el-button> <el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)">查看</el-button>
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
...@@ -264,21 +264,26 @@ export default { ...@@ -264,21 +264,26 @@ export default {
this.open = true this.open = true
this.title = "添加验收前期-项目信息-井信息" this.title = "添加验收前期-项目信息-井信息"
}, },
/** 修改/查看按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset() this.reset()
const id = row.id || this.ids const id = row.id || this.ids
getJxx(id).then(response => { getJxx(id).then(response => {
this.form = response.data this.form = response.data
this.open = true this.open = true
// 根据项目状态决定是查看还是修改 this.title = "修改验收前期-项目信息-井信息"
if (this.projectStatus === '未提交' || this.projectStatus === '待验收') { this.isReadOnly = false
this.title = "修改验收前期-项目信息-井信息" })
this.isReadOnly = false },
} else { /** 查看按钮操作 */
this.title = "查看验收前期-项目信息-井信息" handleView(row) {
this.isReadOnly = true this.reset()
} const id = row.id || this.ids
getJxx(id).then(response => {
this.form = response.data
this.open = true
this.title = "查看验收前期-项目信息-井信息"
this.isReadOnly = true
}) })
}, },
/** 提交按钮 */ /** 提交按钮 */
......
...@@ -59,13 +59,13 @@ ...@@ -59,13 +59,13 @@
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <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-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
<el-button v-if="projectStatus === '未提交' || projectStatus === '待验收'" type="primary" plain icon="el-icon-plus" <el-button v-if="projectStatus === '未提交'" type="primary" plain icon="el-icon-plus"
size="mini" @click="handleAdd" v-hasPermi="['ysqqXmxxSegy:segy:add']">新增</el-button> size="mini" @click="handleAdd" v-hasPermi="['ysqqXmxxSegy:segy:add']">新增</el-button>
<el-button type="success" plain icon="el-icon-edit" size="mini" <el-button type="success" plain icon="el-icon-edit" size="mini"
:disabled="single || (projectStatus !== '未提交' && projectStatus !== '待验收')" @click="handleUpdate" :disabled="single || projectStatus !== '未提交'" @click="handleUpdate"
v-hasPermi="['ysqqXmxxSegy:segy:edit']">修改</el-button> v-hasPermi="['ysqqXmxxSegy:segy:edit']">修改</el-button>
<el-button type="danger" plain icon="el-icon-delete" size="mini" <el-button type="danger" plain icon="el-icon-delete" size="mini"
:disabled="multiple || (projectStatus !== '未提交' && projectStatus !== '待验收')" @click="handleDelete" :disabled="multiple || projectStatus !== '未提交'" @click="handleDelete"
v-hasPermi="['ysqqXmxxSegy:segy:remove']">删除</el-button> v-hasPermi="['ysqqXmxxSegy:segy:remove']">删除</el-button>
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" <el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport"
v-hasPermi="['ysqqXmxxSegy:segy:export']">导出</el-button> v-hasPermi="['ysqqXmxxSegy:segy:export']">导出</el-button>
...@@ -103,16 +103,16 @@ ...@@ -103,16 +103,16 @@
<el-table-column label="备用3" align="center" prop="ext3" /> --> <el-table-column label="备用3" align="center" prop="ext3" /> -->
<el-table-column label="操作" min-width="100" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" min-width="100" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<!-- 未提交和待验收状态:显示修改和删除按钮 --> <!-- 未提交状态:显示修改和删除按钮 -->
<template v-if="projectStatus === '未提交' || projectStatus === '待验收'"> <template v-if="projectStatus === '未提交'">
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['ysqqXmxxSegy:segy:edit']">修改</el-button> v-hasPermi="['ysqqXmxxSegy:segy:edit']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
v-hasPermi="['ysqqXmxxSegy:segy:remove']">删除</el-button> v-hasPermi="['ysqqXmxxSegy:segy:remove']">删除</el-button>
</template> </template>
<!-- 其他状态(已验收、已归档):只显示查看按钮 --> <!-- 其他状态(待验收、已验收、已归档):只显示查看按钮 -->
<template v-else> <template v-else>
<el-button size="mini" type="text" icon="el-icon-view" @click="handleUpdate(scope.row)">查看</el-button> <el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row)">查看</el-button>
</template> </template>
</template> </template>
</el-table-column> </el-table-column>
...@@ -319,7 +319,7 @@ export default { ...@@ -319,7 +319,7 @@ export default {
this.open = true this.open = true
this.title = "添加segy信息" this.title = "添加segy信息"
}, },
/** 修改/查看按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
this.reset() this.reset()
const id = row.id || this.ids const id = row.id || this.ids
...@@ -344,14 +344,37 @@ export default { ...@@ -344,14 +344,37 @@ export default {
} }
this.open = true this.open = true
// 根据项目状态决定是查看还是修改 this.title = "修改segy信息"
if (this.projectStatus === '未提交' || this.projectStatus === '待验收') { this.isReadOnly = false
this.title = "修改segy信息" })
this.isReadOnly = false },
} else { /** 查看按钮操作 */
this.title = "查看segy信息" handleView(row) {
this.isReadOnly = true this.reset()
const id = row.id || this.ids
getSegy(id).then(response => {
this.form = response.data
// 设置文件列表,显示已上传的文件
if (this.form.jbsegy) {
this.jbsegyFileList = [{
name: this.form.jbsegyName || this.getFileNameFromPath(this.form.jbsegy),
url: this.form.jbsegy,
status: 'success'
}]
}
if (this.form.xbsegy) {
this.xbsegyFileList = [{
name: this.form.xbsegyName || this.getFileNameFromPath(this.form.xbsegy),
url: this.form.xbsegy,
status: 'success'
}]
} }
this.open = true
this.title = "查看segy信息"
this.isReadOnly = true
}) })
}, },
/** 提交按钮 */ /** 提交按钮 */
......
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="80px">
<el-form-item label="用户姓名" prop="nickName">
<el-input
v-model="queryParams.nickName"
placeholder="请输入用户姓名"
clearable
@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" v-if="!isViewerRole">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['ysqqXmxxXmcy:xmcy:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['ysqqXmxxXmcy:xmcy:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['ysqqXmxxXmcy:xmcy:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['ysqqXmxxXmcy:xmcy:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table border v-loading="loading" :data="xmcyList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="用户姓名" align="center" prop="nickName" />
<el-table-column label="项目角色" align="center" prop="xmjs">
<template slot-scope="scope">
<dict-tag :options="dict.type.xm_js" :value="scope.row.xmjs"/>
</template>
</el-table-column>
<!-- <el-table-column label="创建人" align="center" prop="createdBy" /> -->
<el-table-column label="创建时间" align="center" prop="createdTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createdTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" v-if="!isViewerRole">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['ysqqXmxxXmcy:xmcy:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['ysqqXmxxXmcy:xmcy: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="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="用户姓名" prop="nickName">
<el-input v-model="form.nickName" placeholder="请选择用户" readonly>
<el-button slot="append" icon="el-icon-search" @click="openUserDialog"></el-button>
</el-input>
</el-form-item>
<el-form-item label="项目角色" prop="xmjs">
<el-select style="width: 100%;" v-model="form.xmjs" placeholder="请选择项目角色">
<el-option
v-for="dict in dict.type.xm_js"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="创建人" prop="createdBy">
<el-input v-model="form.createdBy" placeholder="请输入创建人" />
</el-form-item>
<el-form-item label="创建时间" prop="createdTime">
<el-date-picker clearable
v-model="form.createdTime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择创建时间">
</el-date-picker>
</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>
<!-- 选择用户对话框 -->
<el-dialog title="选择用户" :visible.sync="userDialogVisible" width="800px" append-to-body>
<el-form :model="userQueryParams" ref="userQueryForm" size="small" :inline="true" label-width="80px">
<el-form-item label="统一账号" prop="userName">
<el-input
v-model="userQueryParams.userName"
placeholder="请输入统一账号"
clearable
size="small"
style="width: 200px"
@keyup.enter.native="handleUserSearch"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleUserSearch">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetUserQuery">重置</el-button>
</el-form-item>
</el-form>
<el-table
v-loading="userLoading"
:data="userList"
@row-click="handleUserSelect"
highlight-current-row
style="cursor: pointer;"
>
<el-table-column label="统一账号" align="center" prop="userName" />
<el-table-column label="用户姓名" align="center" prop="nickName" />
<el-table-column label="部门" align="center" prop="dept.deptName" />
</el-table>
<pagination
v-show="userTotal>0"
:total="userTotal"
:page.sync="userQueryParams.pageNum"
:limit.sync="userQueryParams.pageSize"
@pagination="getUserList"
/>
</el-dialog>
</div>
</template>
<script>
import { listXmcy, getXmcy, delXmcy, addXmcy, updateXmcy } from "@/api/ysqqXmxxXmcy/xmcy"
import { listUser } from "@/api/system/user"
export default {
name: "Xmcy",
dicts: ['xm_js'],
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 验收前期-项目信息-项目成员表格数据
xmcyList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 项目主键id
zbid: null,
// 当前用户在该项目中的角色
currentUserRole: null,
// 是否为查看者角色
isViewerRole: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
nickName: null,
zbid: null
},
// 表单参数
form: {},
// 表单校验
rules: {
nickName: [
{ required: true, message: "用户姓名不能为空", trigger: "change" }
],
xmjs: [
{ required: true, message: "项目角色不能为空", trigger: "change" }
]
},
// 选择用户对话框
userDialogVisible: false,
// 用户列表加载状态
userLoading: false,
// 用户列表
userList: [],
// 用户列表总条数
userTotal: 0,
// 用户查询参数
userQueryParams: {
pageNum: 1,
pageSize: 10,
nickName: null
}
}
},
created() {
// 从路由参数中获取zbid和当前用户角色
this.zbid = this.$route.query.zbid
this.currentUserRole = this.$route.query.xmjs
this.queryParams.zbid = this.zbid
this.getList()
},
watch: {
// 监听字典数据变化,字典加载完成后再判断角色
'dict.type.xm_js'() {
if (this.dict && this.dict.type && this.dict.type.xm_js) {
this.checkViewerRole()
}
}
},
methods: {
/** 查询验收前期-项目信息-项目成员列表 */
getList() {
this.loading = true
listXmcy(this.queryParams).then(response => {
this.xmcyList = response.rows
this.total = response.total
this.loading = false
})
},
// 取消按钮
cancel() {
this.open = false
this.reset()
},
// 表单重置
reset() {
this.form = {
cyid: null,
zbid: this.zbid,
userId: null,
nickName: null,
xmjs: null,
createdBy: null,
createdTime: null,
updateBy: null,
updateTime: null
}
this.resetForm("form")
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm")
this.handleQuery()
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.cyid)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = "添加验收前期-项目信息-项目成员"
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const cyid = row.cyid || this.ids
getXmcy(cyid).then(response => {
this.form = response.data
// 确保zbid被设置
this.form.zbid = this.zbid
this.open = true
this.title = "修改验收前期-项目信息-项目成员"
})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.cyid != null) {
updateXmcy(this.form).then(response => {
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addXmcy(this.form).then(response => {
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const cyids = row.cyid || this.ids
this.$modal.confirm('是否确认删除验收前期-项目信息-项目成员编号为"' + cyids + '"的数据项?').then(function() {
return delXmcy(cyids)
}).then(() => {
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
this.download('ysqqXmxxXmcy/xmcy/export', {
...this.queryParams
}, `xmcy_${new Date().getTime()}.xlsx`)
},
/** 打开选择用户对话框 */
openUserDialog() {
// 重置查询参数
this.userQueryParams = {
pageNum: 1,
pageSize: 10,
nickName: null
}
this.userList = []
this.userTotal = 0
this.userDialogVisible = true
this.getUserList()
},
/** 搜索用户 */
handleUserSearch() {
this.userQueryParams.pageNum = 1
this.getUserList()
},
/** 查询用户列表 */
getUserList() {
// if (!this.userQueryParams.nickName) {
// this.$modal.msgWarning("请输入用户账号")
// return
// }
this.userLoading = true
listUser(this.userQueryParams).then(response => {
this.userList = response.rows
this.userTotal = response.total
this.userLoading = false
}).catch(() => {
this.userLoading = false
})
},
/** 重置用户查询 */
resetUserQuery() {
this.userQueryParams = {
pageNum: 1,
pageSize: 10,
nickName: null
}
this.userList = []
this.userTotal = 0
},
/** 选择用户 */
handleUserSelect(row) {
this.form.userId = row.userId
this.form.nickName = row.nickName
this.userDialogVisible = false
},
/** 判断是否为查看者角色 */
checkViewerRole() {
if (!this.currentUserRole || !this.dict || !this.dict.type || !this.dict.type.xm_js) {
this.isViewerRole = false
return
}
// 查找字典中标签包含"查看者"的角色
const role = this.dict.type.xm_js.find(item => item.value === this.currentUserRole)
if (role && role.label.includes('查看者')) {
this.isViewerRole = true
} else {
this.isViewerRole = false
}
}
}
}
</script>
<!-- 资料查询 -->
<template>
<div class="app-container">
<!-- start: 查询条件 -->
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="文件名称" prop="wjmc">
<el-input v-model="queryParams.wjmc" placeholder="请输入文件名称" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="资料类型" prop="zllx">
<el-select v-model="queryParams.zllx" placeholder="请选择资料类型" clearable>
<el-option
v-for="item in zllxOptions"
:key="item.id"
:label="item.lxmc"
:value="item.lxmc">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="项目名称" prop="xmmc">
<el-input v-model="queryParams.xmmc" placeholder="请输入项目名称" clearable @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>
<!-- end: 查询条件 -->
<!-- start: 数据表格 -->
<el-table border v-loading="loading" :data="zlcxList">
<el-table-column label="项目名称" align="center" prop="xmmc" min-width="150" show-overflow-tooltip />
<el-table-column label="文件名称" align="center" prop="wjmc" min-width="200" show-overflow-tooltip>
<template slot-scope="scope">
<el-button type="text" @click="handleDownload(scope.row)" style="padding: 0; color: #409EFF;">
{{ scope.row.wjmc }}
</el-button>
</template>
</el-table-column>
<el-table-column label="资料类型" align="center" prop="zllx" min-width="120" show-overflow-tooltip />
<el-table-column label="上传时间" align="center" prop="createdTime" min-width="170" show-overflow-tooltip />
<el-table-column label="修改时间" align="center" prop="updateTime" min-width="170" show-overflow-tooltip />
</el-table>
<!-- end: 数据表格 -->
<!-- start: 分页 -->
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" />
<!-- end: 分页 -->
</div>
</template>
<script>
import { listZlcx } from "@/api/zlcx/zlcx"
import { selectZllx } from "@/api/yscgZllx/zllx"
export default {
name: 'ZlcxIndex',
data() {
return {
// 遮罩层
loading: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 资料查询表格数据
zlcxList: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
wjmc: null,
zllx: null,
xmmc: null
},
// 资料类型选项
zllxOptions: []
}
},
created() {
// 初始化资料类型选项
this.getZllxOptions()
// 获取列表数据
this.getList()
},
methods: {
/** 查询资料列表 */
getList() {
this.loading = true
listZlcx(this.queryParams).then(response => {
this.zlcxList = response.rows || []
this.total = response.total || 0
this.loading = false
}).catch(() => {
this.loading = false
})
},
/** 获取资料类型选项 */
getZllxOptions() {
selectZllx().then(response => {
this.zllxOptions = response.rows || []
})
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.queryParams = {
pageNum: 1,
pageSize: 10,
wjmc: null,
zllx: null,
xmmc: null
}
this.handleQuery()
},
/** 下载文件 */
handleDownload(row) {
// 检查是否有文件链接
if (!row.wjlj) {
this.$modal.msgWarning('该文件没有下载链接')
return
}
// 处理多个文件的情况(逗号分隔)
const fileNames = row.wjmc ? String(row.wjmc).split(',').filter(Boolean) : []
const fileLinks = String(row.wjlj).split(',').filter(Boolean)
if (fileLinks.length === 0) {
this.$modal.msgWarning('该文件没有下载链接')
return
}
// 如果只有一个文件,直接下载
if (fileLinks.length === 1) {
this.downloadFile(fileLinks[0], fileNames[0] || '文件')
return
}
// 如果有多个文件,显示选择列表
const fileOptions = fileLinks.map((link, index) => {
return {
name: fileNames[index] || `文件${index + 1}`,
link: link
}
})
// 使用MessageBox选择要下载的文件
const h = this.$createElement
const fileListHtml = fileOptions.map((file, index) => {
return h('div', {
style: {
padding: '8px 0',
cursor: 'pointer',
color: '#409EFF'
},
on: {
click: () => {
this.downloadFile(file.link, file.name)
this.$msgbox.close()
}
}
}, file.name)
})
this.$msgbox({
title: '请选择要下载的文件',
message: h('div', null, fileListHtml),
showCancelButton: false,
confirmButtonText: '取消'
}).catch(() => {})
},
/** 执行文件下载 */
downloadFile(url, fileName) {
if (!url) {
this.$modal.msgWarning('文件链接无效')
return
}
// 如果wjlj是文件名(不含路径),使用download插件
// 如果wjlj是完整路径,直接下载
if (url.includes('/') || url.startsWith('http')) {
// 完整路径,创建a标签进行下载
const link = document.createElement('a')
link.style.display = 'none'
const fullUrl = url.startsWith('http') ? url : (process.env.VUE_APP_BASE_API + url)
link.href = fullUrl
link.setAttribute('download', fileName)
link.setAttribute('target', '_blank')
document.body.appendChild(link)
link.click()
document.body.removeChild(link)
this.$modal.msgSuccess('开始下载文件')
} else {
// 文件名,使用下载插件
this.$download.name(url)
}
}
}
}
</script>
<style lang="scss" scoped>
</style>
"use strict"; 'use strict'
const path = require("path"); const path = require('path')
function resolve(dir) { 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 baseUrl = "http://localhost:8080"; // 后端接口 const baseUrl = 'http://localhost:8080' // 后端接口
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 配置说明
//官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions //官方vue.config.js 参考文档 https://cli.vuejs.org/zh/config/#css-loaderoptions
...@@ -20,34 +20,35 @@ module.exports = { ...@@ -20,34 +20,35 @@ module.exports = {
// 部署生产环境和开发环境下的URL。 // 部署生产环境和开发环境下的URL。
// 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上 // 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。 // 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
publicPath: process.env.NODE_ENV === "production" ? "/" : "/", publicPath: process.env.NODE_ENV === 'production' ? '/' : '/',
// 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist) // 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
outputDir: "dist", outputDir: 'dist',
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下) // 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
assetsDir: "static", assetsDir: 'static',
// 是否开启eslint保存检测,有效值:ture | false | 'error' // 是否开启eslint保存检测,有效值:ture | false | 'error'
lintOnSave: process.env.NODE_ENV === "development", lintOnSave: process.env.NODE_ENV === 'development',
// 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。 // 如果你不需要生产环境的 source map,可以将其设置为 false 以加速生产环境构建。
productionSourceMap: false, productionSourceMap: false,
transpileDependencies: ["quill", "@jsonforms/core", "jsonforms-vue"], transpileDependencies: ['quill', '@jsonforms/core', 'jsonforms-vue'],
// webpack-dev-server 相关配置 // webpack-dev-server 相关配置
devServer: { devServer: {
host: "0.0.0.0", host: '0.0.0.0',
port: port, port: port,
open: true, open: true,
proxy: { proxy: {
// detail: https://cli.vuejs.org/config/#devserver-proxy // detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: { [process.env.VUE_APP_BASE_API]: {
// target: `http://localhost:8999`,
// target: `http://192.168.31.108:8999`, // target: `http://192.168.31.108:8999`,
target: `http://192.168.110.69:8999`, target: `http://192.168.31.12:8999`,
// target: `http://192.168.31.12:8999`, // target: `http://192.168.31.12:8999`,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
["^" + process.env.VUE_APP_BASE_API]: "", ['^' + process.env.VUE_APP_BASE_API]: '',
}, },
}, },
// springdoc proxy // springdoc proxy
"^/v3/api-docs/(.*)": { '^/v3/api-docs/(.*)': {
target: baseUrl, target: baseUrl,
changeOrigin: true, changeOrigin: true,
}, },
...@@ -57,7 +58,7 @@ module.exports = { ...@@ -57,7 +58,7 @@ module.exports = {
css: { css: {
loaderOptions: { loaderOptions: {
sass: { sass: {
sassOptions: { outputStyle: "expanded" }, sassOptions: { outputStyle: 'expanded' },
}, },
}, },
}, },
...@@ -65,7 +66,7 @@ module.exports = { ...@@ -65,7 +66,7 @@ module.exports = {
name: name, name: name,
resolve: { resolve: {
alias: { alias: {
"@": resolve("src"), '@': resolve('src'),
}, },
}, },
plugins: [ plugins: [
...@@ -73,67 +74,67 @@ module.exports = { ...@@ -73,67 +74,67 @@ module.exports = {
new CompressionPlugin({ new CompressionPlugin({
cache: false, // 不启用文件缓存 cache: false, // 不启用文件缓存
test: /\.(js|css|html|jpe?g|png|gif|svg)?$/i, // 压缩文件格式 test: /\.(js|css|html|jpe?g|png|gif|svg)?$/i, // 压缩文件格式
filename: "[path][base].gz[query]", // 压缩后的文件名 filename: '[path][base].gz[query]', // 压缩后的文件名
algorithm: "gzip", // 使用gzip压缩 algorithm: 'gzip', // 使用gzip压缩
minRatio: 0.8, // 压缩比例,小于 80% 的文件不会被压缩 minRatio: 0.8, // 压缩比例,小于 80% 的文件不会被压缩
deleteOriginalAssets: false, // 压缩后删除原文件 deleteOriginalAssets: false, // 压缩后删除原文件
}), }),
], ],
}, },
chainWebpack(config) { chainWebpack(config) {
config.plugins.delete("preload"); // TODO: need test config.plugins.delete('preload') // TODO: need test
config.plugins.delete("prefetch"); // TODO: need test config.plugins.delete('prefetch') // TODO: need test
// set svg-sprite-loader // 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 config.module
.rule("icons") .rule('icons')
.test(/\.svg$/) .test(/\.svg$/)
.include.add(resolve("src/assets/icons")) .include.add(resolve('src/assets/icons'))
.end() .end()
.use("svg-sprite-loader") .use('svg-sprite-loader')
.loader("svg-sprite-loader") .loader('svg-sprite-loader')
.options({ .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 config
.plugin("ScriptExtHtmlWebpackPlugin") .plugin('ScriptExtHtmlWebpackPlugin')
.after("html") .after('html')
.use("script-ext-html-webpack-plugin", [ .use('script-ext-html-webpack-plugin', [
{ {
// `runtime` must same as runtimeChunk name. default is `runtime` // `runtime` must same as runtimeChunk name. default is `runtime`
inline: /runtime\..*\.js$/, inline: /runtime\..*\.js$/,
}, },
]) ])
.end(); .end()
config.optimization.splitChunks({ config.optimization.splitChunks({
chunks: "all", chunks: 'all',
cacheGroups: { cacheGroups: {
libs: { libs: {
name: "chunk-libs", name: 'chunk-libs',
test: /[\\/]node_modules[\\/]/, test: /[\\/]node_modules[\\/]/,
priority: 10, priority: 10,
chunks: "initial", // only package third parties that are initially dependent chunks: 'initial', // only package third parties that are initially dependent
}, },
elementUI: { 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 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: { commons: {
name: "chunk-commons", name: 'chunk-commons',
test: resolve("src/components"), // can customize your rules test: resolve('src/components'), // can customize your rules
minChunks: 3, // minimum common number minChunks: 3, // minimum common number
priority: 5, priority: 5,
reuseExistingChunk: true, reuseExistingChunk: true,
}, },
}, },
}); })
config.optimization.runtimeChunk("single"); config.optimization.runtimeChunk('single')
}); })
}, },
}; }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment