fix:修改投票

This commit is contained in:
lixg
2022-12-08 14:32:53 +08:00
parent 819617a698
commit 25c220e84d
3 changed files with 111 additions and 33 deletions

View File

@@ -2,7 +2,7 @@
* @Author: lixg lixg@dongwu-inc.com * @Author: lixg lixg@dongwu-inc.com
* @Date: 2022-11-21 14:32:52 * @Date: 2022-11-21 14:32:52
* @LastEditors: lixg lixg@dongwu-inc.com * @LastEditors: lixg lixg@dongwu-inc.com
* @LastEditTime: 2022-12-08 08:48:26 * @LastEditTime: 2022-12-08 08:49:37
* @FilePath: /fe-manage/src/api/config.js * @FilePath: /fe-manage/src/api/config.js
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/ */
@@ -56,7 +56,7 @@ http.interceptors.response.use(
return response; return response;
} else { } else {
if (code === 1000) { if (code === 1000) {
window.open("https://u-pre.boe.com/web/", '_self'); // window.open("https://u-pre.boe.com/web/", '_self');
// window.open("http://111.231.196.214:12013/manage/login", '_self'); // window.open("http://111.231.196.214:12013/manage/login", '_self');
} }
console.log("api %o", msg); console.log("api %o", msg);

View File

@@ -110,7 +110,7 @@
/> />
</div> </div>
</div> </div>
<div class="main_item"> <div class="main_item" style="margin-bottom: 24px; margin-left: 29px">
<div class="signbox"> <div class="signbox">
<div class="sign"> <div class="sign">
<img <img
@@ -118,17 +118,11 @@
alt="" alt=""
/> />
</div> </div>
<span style="margin-right: 3px">基础投票数</span> <span style="margin-right: 3px">基础投票数设置</span>
</div> </div>
<div class="btnbox">
<!-- <a-upload <!-- <div class="btnbox">
@change="handleChange"
:before-upload="beforeUpload"
:multiple="true"
:max-count="1"
action="/manageApi/vote/baseVoteupload"
v-model:file-list="fileList"
> -->
<a-upload :before-upload="beforeUpload" :max-count="1"> <a-upload :before-upload="beforeUpload" :max-count="1">
<button class="xkbtn">点击上传</button> <button class="xkbtn">点击上传</button>
<template #itemRender="{ file, actions }"> <template #itemRender="{ file, actions }">
@@ -155,14 +149,75 @@
</div> </div>
<button class="xkbtn" @click="downloadTemplate">下载模板 <button class="xkbtn" @click="downloadTemplate">下载模板
</button> </button>
</div> -->
</div>
<div
style="
display: flex;
align-items: center;
margin-left: 64px;
margin-bottom: 24px;
"
>
<div>参与数</div>
<div style="width: 159px">
<a-input-number
style="width: 159px"
id="inputNumber"
v-model:value="partakeNum"
:min="0"
:max="99999"
:precision="0"
/>
</div> </div>
</div> </div>
<div class="main_item" style="margin-top: -25px"> <div
style="
display: flex;
align-items: center;
margin-left: 64px;
margin-bottom: 24px;
"
>
<div>总票数</div>
<div style="width: 159px">
<a-input-number
style="width: 159px"
id="inputNumber"
v-model:value="totalVoteNum"
:min="0"
:max="99999"
:precision="0"
/>
</div>
</div>
<div
style="
display: flex;
align-items: center;
margin-left: 64px;
margin-bottom: 24px;
"
>
<div>浏览数</div>
<div style="width: 159px">
<a-input-number
style="width: 159px"
id="inputNumber"
v-model:value="browseNum"
:min="0"
:max="99999"
:precision="0"
/>
</div>
</div>
<!-- <div class="main_item" style="margin-top: -25px">
<div class="signbox"></div> <div class="signbox"></div>
<div class="btnbox"> <div class="btnbox">
<span style="color: #999999">支持xls.xlsx</span> <span style="color: #999999">支持xls.xlsx</span>
</div> </div>
</div> </div> -->
<div class="main_item2"> <div class="main_item2">
<div class="signbox"> <div class="signbox">
<span style="margin-right: 3px">投票说明</span> <span style="margin-right: 3px">投票说明</span>
@@ -272,15 +327,23 @@ export default {
fileList: [], fileList: [],
voteCount: null, voteCount: null,
projectTemplateId: null, projectTemplateId: null,
partakeNum: 0, //参与数
totalVoteNum: 0, //总票数
browseNum: 0, //浏览数
}); });
const closeDrawer = () => { const closeDrawer = () => {
(state.inputV1 = ""), state.inputV1 = "";
(state.textV1 = ""), state.textV1 = "";
(state.time = undefined), state.time = undefined;
(state.basevote = ""), state.basevote = "";
(state.ballotId = ""), state.ballotId = "";
ctx.emit("update:addvoteVisible", false); ctx.emit("update:addvoteVisible", false);
ctx.emit("update:edit", false); ctx.emit("update:edit", false);
state.partakeNum = 0; //参与数
state.totalVoteNum = 0; //总票数
state.browseNum = 0; //浏览数
}; };
const afterVisibleChange = (bool) => { const afterVisibleChange = (bool) => {
if (props.edit && bool) { if (props.edit && bool) {
@@ -337,6 +400,9 @@ export default {
dayjs(res.data.data.voteStartTime, "YYYY-MM-DD"), dayjs(res.data.data.voteStartTime, "YYYY-MM-DD"),
dayjs(res.data.data.voteEndTime, "YYYY-MM-DD"), dayjs(res.data.data.voteEndTime, "YYYY-MM-DD"),
]; ];
state.totalVoteNum = res.data.data.votesTotal; //总票数
state.partakeNum = res.data.data.numberOfInvolved; //参与数
state.browseNum = res.data.data.numberOfBrowse; //浏览数
}) })
.catch((err) => { .catch((err) => {
console.log("获取投票信息失败", err); console.log("获取投票信息失败", err);
@@ -411,9 +477,9 @@ export default {
message.destroy(); message.destroy();
return message.warning("请输入直播时间"); return message.warning("请输入直播时间");
} }
if (!state.basevote) { // if (!state.basevote) {
return message.warning("请上传投票基数"); // return message.warning("请上传投票基数");
} // }
if (state.time != undefined) { if (state.time != undefined) {
state.startTime = dayjs(state.time[0]).format("YYYY-MM-DD"); state.startTime = dayjs(state.time[0]).format("YYYY-MM-DD");
state.endTime = dayjs(state.time[1]).format("YYYY-MM-DD"); state.endTime = dayjs(state.time[1]).format("YYYY-MM-DD");
@@ -427,6 +493,9 @@ export default {
ballotId: state.ballotId, ballotId: state.ballotId,
baseVote: state.basevote, baseVote: state.basevote,
voteExplain: state.textV1, voteExplain: state.textV1,
votesTotal: state.totalVoteNum, //总票数
numberOfInvolved: state.partakeNum, //参与数
numberOfBrowse: state.browseNum, //浏览数
}; };
if (props.edit) { if (props.edit) {
api api
@@ -469,7 +538,7 @@ export default {
}; };
function downloadTemplate() { function downloadTemplate() {
window.open('/manageApi/投票基础数据模版.xlsx') window.open("/manageApi/投票基础数据模版.xlsx");
} }
return { return {

View File

@@ -16,7 +16,16 @@
src="../../assets/images/leveladd/ma.png" src="../../assets/images/leveladd/ma.png"
@click="showCodeModel2()" @click="showCodeModel2()"
/> />
<div class="line" v-if="action == 1 || action == 0"></div> <div
class="line"
v-if="
action == 1 ||
action == 2 ||
action == 0 ||
action == 3 ||
action == -2
"
></div>
<!-- 显示发布图标 --> <!-- 显示发布图标 -->
<img <img
v-if="action == 2" v-if="action == 2"
@@ -27,11 +36,11 @@
<img <img
v-if="action == 3" v-if="action == 3"
class="img2" class="img2"
src="../../assets/images/leveladd/pub.png" src="../../assets/images/project/finish.png"
/> />
<!-- 显示审核图标 --> <!-- 显示审核图标 -->
<img <img
v-if="action == 0" v-if="action == 0 || action == -2"
class="img2" class="img2"
src="../../assets/images/project/reviewsubmit.png" src="../../assets/images/project/reviewsubmit.png"
/> />
@@ -46,8 +55,8 @@
<!-- 显示提交审核 --> <!-- 显示提交审核 -->
<div <div
class="pub" class="pub"
style="width: 56px" style="width: 56px; color: #a497ff"
v-if="action == 0" v-if="action == 0 || action == -2"
@click="submitExamine" @click="submitExamine"
> >
{{ act }} {{ act }}
@@ -55,7 +64,7 @@
<!-- 显示撤回审核 --> <!-- 显示撤回审核 -->
<div <div
class="pub" class="pub"
style="width: 56px" style="width: 56px; color: #a497ff"
v-if="action == 1" v-if="action == 1"
@click="showRecallReviewModal" @click="showRecallReviewModal"
> >
@@ -73,7 +82,7 @@
<!-- 显示撤回发布 --> <!-- 显示撤回发布 -->
<div <div
class="pub" class="pub"
style="width: 56px" style="width: 56px; color: #57c887"
v-if="action == 3" v-if="action == 3"
@click="showBackModal" @click="showBackModal"
> >
@@ -5170,7 +5179,7 @@ export default {
.img2 { .img2 {
width: 42px; width: 42px;
height: 42px; height: 42px;
margin-right: 22px; margin-right: 10px;
} }
.pub { .pub {