Commit caa30521 by zhaopanyu

zpy

parent 17740b25
......@@ -5,4 +5,4 @@ VUE_APP_TITLE = 投选活动
ENV = 'production'
# 投选活动/生产环境
VUE_APP_BASE_API = '/prod-api'
VUE_APP_BASE_API = '/tp-api'
......@@ -3,7 +3,7 @@ import request from "@/utils/request";
//提交投票
export function addTp(data) {
return request({
url: "/system/tpInfo/add",
url: "/system/tpRyInfo/tp",
method: "post",
data: data,
});
......
import request from '@/utils/request'
import request from "@/utils/request";
// 查询投票单位列表
export function listTpDept(query) {
return request({
url: '/system/tpDept/list',
method: 'get',
params: query
})
url: "/system/tpDept/list",
method: "get",
params: query,
});
}
// 查询投票单位列表
export function listTpDeptjg(query) {
return request({
url: '/system/tpDept/listjg',
method: 'get',
params: query
})
url: "/system/tpDept/listjg",
method: "get",
params: query,
});
}
// 查询人员统计
export function listRytj(query) {
return request({
url: "/system/tpRyInfo/tplist",
method: "get",
params: query,
});
}
// 查询投票单位详细
export function getTpDept(id) {
return request({
url: '/system/tpDept/' + id,
method: 'get'
})
url: "/system/tpDept/" + id,
method: "get",
});
}
// 新增投票单位
export function addTpDept(data) {
return request({
url: '/system/tpDept',
method: 'post',
data: data
})
url: "/system/tpDept",
method: "post",
data: data,
});
}
// 修改投票单位
export function updateTpDept(data) {
return request({
url: '/system/tpDept',
method: 'put',
data: data
})
url: "/system/tpDept",
method: "put",
data: data,
});
}
// 删除投票单位
export function delTpDept(id) {
return request({
url: '/system/tpDept/' + id,
method: 'delete'
})
url: "/system/tpDept/" + id,
method: "delete",
});
}
import request from '@/utils/request'
import request from "@/utils/request";
// 查询投票信息列表
export function listTpInfo(query) {
return request({
url: '/system/tpInfo/list',
method: 'get',
params: query
})
url: "/system/tpInfo/list",
method: "get",
params: query,
});
}
// 查询投票信息列表
export function listTpInfoJg(query) {
return request({
url: '/system/tpInfo/listjg',
method: 'get',
params: query
})
url: "/system/tpInfo/listjg",
method: "get",
params: query,
});
}
export function listTpInfoJgs(query) {
return request({
url: "/system/tpRyInfo/list",
method: "get",
params: query,
});
}
// 查询投票信息详细
export function getTpInfo(id) {
return request({
url: '/system/tpInfo/' + id,
method: 'get'
})
url: "/system/tpInfo/" + id,
method: "get",
});
}
// 新增投票信息
export function addTpInfo(data) {
return request({
url: '/system/tpInfo',
method: 'post',
data: data
})
url: "/system/tpInfo",
method: "post",
data: data,
});
}
// 修改投票信息
export function updateTpInfo(data) {
return request({
url: '/system/tpInfo',
method: 'put',
data: data
})
url: "/system/tpInfo",
method: "put",
data: data,
});
}
// 删除投票信息
export function delTpInfo(id) {
return request({
url: '/system/tpInfo/' + id,
method: 'delete'
})
url: "/system/tpInfo/" + id,
method: "delete",
});
}
<template>
<div class="navbar">
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" />
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container"
@toggleClick="toggleSideBar" />
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav"/>
<top-nav id="topmenu-container" class="topmenu-container" v-if="topNav"/>
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" v-if="!topNav" />
<top-nav id="topmenu-container" class="topmenu-container" v-if="topNav" />
<div class="right-menu">
<template v-if="device!=='mobile'">
<template v-if="device !== 'mobile'">
<search id="header-search" class="right-menu-item" />
<el-tooltip content="源码地址" effect="dark" placement="bottom">
......@@ -102,9 +103,9 @@ export default {
type: 'warning'
}).then(() => {
this.$store.dispatch('LogOut').then(() => {
location.href = '/index';
location.href = '/tp/index';
})
}).catch(() => {});
}).catch(() => { });
}
}
}
......@@ -116,7 +117,7 @@ export default {
overflow: hidden;
position: relative;
background: #fff;
box-shadow: 0 1px 4px rgba(0,21,41,.08);
box-shadow: 0 1px 4px rgba(0, 21, 41, .08);
.hamburger-container {
line-height: 46px;
......@@ -124,7 +125,7 @@ export default {
float: left;
cursor: pointer;
transition: background .3s;
-webkit-tap-highlight-color:transparent;
-webkit-tap-highlight-color: transparent;
&:hover {
background: rgba(0, 0, 0, .025)
......
......@@ -50,16 +50,17 @@ export const constantRoutes = [
path: "/tp",
component: () => import("@/views/benchmarkVoting"),
hidden: true,
}, {
},
{
path: "/rytp",
component: () => import("@/views/rytp"),
hidden: true,
},
{
path: '/info',
path: "/info",
// component: (resolve) => require(['@/views/remotelogin'], resolve),
component:() => import('@/views/info'),
hidden: true
component: () => import("@/views/info"),
hidden: true,
},
{
path: "/register",
......@@ -194,5 +195,6 @@ Router.prototype.replace = function push(location) {
export default new Router({
mode: "history", // 去掉url中的#
scrollBehavior: () => ({ y: 0 }),
base: "/tp",
routes: constantRoutes,
});
<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="ssbk">
<el-select v-model="queryParams.ssbk" clearable>
<el-option v-for="dict in dict.type.ry_tp_ssbk" :key="dict.value" :label="dict.label"
:value="dict.value" />
</el-select>
</el-form-item>
<el-form-item label="单位名称" prop="dwmc">
<el-input v-model="queryParams.dwmc" 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 v-loading="loading" border :data="tpDeptList" @selection-change="handleSelectionChange">
<el-table-column label="所属板块" min-width="180px" align="center" prop="ssbk" />
<el-table-column label="姓名" min-width="180px" align="center" prop="tprymc" />
<el-table-column label="投票数量" min-width="180px" align="center" prop="sl" />
</el-table>
<!-- <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" /> -->
</div>
</template>
<script>
import { listTpDept, listTpDeptjg, getTpDept, delTpDept, addTpDept, updateTpDept, listRytj } from "@/api/tp/tpDept";
export default {
name: "TpDept",
dicts: ['ry_tp_ssbk'],
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
// total: 0,
// 投票单位表格数据
tpDeptList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
ssbk: null,
dwmc: null,
yl1: null,
yl2: null,
yl3: null,
yl4: null,
yl5: null
},
// 表单参数
form: {},
// 表单校验
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询投票单位列表 */
getList() {
this.loading = true;
listRytj(this.queryParams).then(response => {
this.tpDeptList = response.rows;
// this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
ssbk: null,
dwmc: null,
remark: null,
yl1: null,
yl2: null,
yl3: null,
yl4: null,
yl5: 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.open = true;
this.title = "添加投票单位";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getTpDept(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改投票单位";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateTpDept(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addTpDept(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 delTpDept(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => { });
},
/** 导出按钮操作 */
handleExport() {
this.download('system/tpDept/export', {
...this.queryParams
}, `tpDept_${new Date().getTime()}.xlsx`)
}
}
};
</script>
<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="name">
<el-input v-model="queryParams.name" placeholder="请输入姓名" clearable @keyup.enter.native="handleQuery" />
</el-form-item>
<el-form-item label="AD账号" prop="ipdz">
<el-input v-model="queryParams.ipdz" placeholder="请输入AD账号" 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 v-loading="loading" border :data="tpInfoList" @selection-change="handleSelectionChange">
<el-table-column label="姓名" align="center" width="100px" prop="name" />
<el-table-column label="二级单位名称" align="center" prop="ejdwmc" width="140px" />
<el-table-column label="单位名称" align="center" prop="dwmc" width="140px" />
<el-table-column label="AD账号" align="center" prop="adzh" width="140px" />
<el-table-column label="统一账号" align="center" prop="username" width="140px" />
<el-table-column label="投票时间" align="center" prop="createTime" width="155px" />
<el-table-column prop="tpry" label="投票人" align="left">
<!-- <template slot-scope="scope">-->
<!-- <el-tooltip popper-class="table-tooltip" :content="scope.row.dwmc" placement="top">-->
<!-- <div class="long_title">-->
<!-- <span>{{scope.row.dwmc}}</span>-->
<!-- </div>-->
<!-- </el-tooltip>-->
<!-- </template>-->
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" @pagination="getList" />
</div>
</template>
<script>
import { listTpInfo, listTpInfoJgs, getTpInfo, delTpInfo, addTpInfo, updateTpInfo } from "@/api/tp/tpInfo";
export default {
name: "TpInfo",
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 子表选中数据
checkedTpInfoCb: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 投票信息表格数据
tpInfoList: [],
// 投票信息从表格数据
tpInfoCbList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
name: null,
sfzh: null,
ipdz: null,
yl1: null,
yl2: null,
yl3: null,
yl4: null,
yl5: null
},
// 表单参数
form: {},
// 表单校验
rules: {
createTime: [
{ required: true, message: "录入时间不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询投票信息列表 */
getList() {
this.loading = true;
listTpInfoJgs(this.queryParams).then(response => {
this.tpInfoList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
id: null,
name: null,
sfzh: null,
ipdz: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
remark: null,
yl1: null,
yl2: null,
yl3: null,
yl4: null,
yl5: null
};
this.tpInfoCbList = [];
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.open = true;
this.title = "添加投票信息";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getTpInfo(id).then(response => {
this.form = response.data;
this.tpInfoCbList = response.data.tpInfoCbList;
this.open = true;
this.title = "修改投票信息";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.form.tpInfoCbList = this.tpInfoCbList;
if (this.form.id != null) {
updateTpInfo(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addTpInfo(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 delTpInfo(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => { });
},
/** 投票信息从序号 */
rowTpInfoCbIndex({ row, rowIndex }) {
row.index = rowIndex + 1;
},
/** 投票信息从添加按钮操作 */
handleAddTpInfoCb() {
let obj = {};
obj.ssbk = "";
obj.dwid = "";
obj.dwmc = "";
this.tpInfoCbList.push(obj);
},
/** 投票信息从删除按钮操作 */
handleDeleteTpInfoCb() {
if (this.checkedTpInfoCb.length == 0) {
this.$modal.msgError("请先选择要删除的投票信息从数据");
} else {
const tpInfoCbList = this.tpInfoCbList;
const checkedTpInfoCb = this.checkedTpInfoCb;
this.tpInfoCbList = tpInfoCbList.filter(function (item) {
return checkedTpInfoCb.indexOf(item.index) == -1
});
}
},
/** 复选框选中数据 */
handleTpInfoCbSelectionChange(selection) {
this.checkedTpInfoCb = selection.map(item => item.index)
},
/** 导出按钮操作 */
handleExport() {
this.download('system/tpInfo/export', {
...this.queryParams
}, `tpInfo_${new Date().getTime()}.xlsx`)
}
}
};
</script>
<style>
.table-tooltip {
max-width: 500px;
}
.long_title {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
</style>
......@@ -18,7 +18,7 @@ module.exports = {
// 部署生产环境和开发环境下的URL。
// 默认情况下,Vue CLI 会假设你的应用是被部署在一个域名的根路径上
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
publicPath: process.env.NODE_ENV === "production" ? "/" : "/",
publicPath: process.env.NODE_ENV === "production" ? "/tp" : "/tp",
// 在npm run build 或 yarn build 时 ,生成文件的目录名称(要和baseUrl的生产环境路径一致)(默认dist)
outputDir: "dist",
// 用于放置生成的静态资源 (js、css、img、fonts) 的;(项目打包之后,静态资源会放在这个文件夹下)
......@@ -36,7 +36,7 @@ module.exports = {
// detail: https://cli.vuejs.org/config/#devserver-proxy
[process.env.VUE_APP_BASE_API]: {
// target: `http://localhost:8080`,
target: `http://192.168.31.108:8889`,
target: `http://192.168.31.22:8889`,
changeOrigin: true,
pathRewrite: {
["^" + process.env.VUE_APP_BASE_API]: "",
......
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