mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-12 12:26:47 +08:00
fix:修改投票
This commit is contained in:
@@ -110,7 +110,7 @@
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_item">
|
||||
<div class="main_item" style="margin-bottom: 24px; margin-left: 29px">
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<img
|
||||
@@ -118,17 +118,11 @@
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<span style="margin-right: 3px">基础投票数:</span>
|
||||
<span style="margin-right: 3px">基础投票数设置</span>
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<!-- <a-upload
|
||||
@change="handleChange"
|
||||
:before-upload="beforeUpload"
|
||||
:multiple="true"
|
||||
:max-count="1"
|
||||
action="/manageApi/vote/baseVoteupload"
|
||||
v-model:file-list="fileList"
|
||||
> -->
|
||||
|
||||
<!-- <div class="btnbox">
|
||||
|
||||
<a-upload :before-upload="beforeUpload" :max-count="1">
|
||||
<button class="xkbtn">点击上传</button>
|
||||
<template #itemRender="{ file, actions }">
|
||||
@@ -155,14 +149,75 @@
|
||||
</div>
|
||||
<button class="xkbtn" @click="downloadTemplate">下载模板
|
||||
</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 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="btnbox">
|
||||
<span style="color: #999999">支持:xls.xlsx</span>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="main_item2">
|
||||
<div class="signbox">
|
||||
<span style="margin-right: 3px">投票说明:</span>
|
||||
@@ -272,15 +327,23 @@ export default {
|
||||
fileList: [],
|
||||
voteCount: null,
|
||||
projectTemplateId: null,
|
||||
|
||||
partakeNum: 0, //参与数
|
||||
totalVoteNum: 0, //总票数
|
||||
browseNum: 0, //浏览数
|
||||
});
|
||||
const closeDrawer = () => {
|
||||
(state.inputV1 = ""),
|
||||
(state.textV1 = ""),
|
||||
(state.time = undefined),
|
||||
(state.basevote = ""),
|
||||
(state.ballotId = ""),
|
||||
ctx.emit("update:addvoteVisible", false);
|
||||
state.inputV1 = "";
|
||||
state.textV1 = "";
|
||||
state.time = undefined;
|
||||
state.basevote = "";
|
||||
state.ballotId = "";
|
||||
ctx.emit("update:addvoteVisible", false);
|
||||
ctx.emit("update:edit", false);
|
||||
|
||||
state.partakeNum = 0; //参与数
|
||||
state.totalVoteNum = 0; //总票数
|
||||
state.browseNum = 0; //浏览数
|
||||
};
|
||||
const afterVisibleChange = (bool) => {
|
||||
if (props.edit && bool) {
|
||||
@@ -337,6 +400,9 @@ export default {
|
||||
dayjs(res.data.data.voteStartTime, "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) => {
|
||||
console.log("获取投票信息失败", err);
|
||||
@@ -411,9 +477,9 @@ export default {
|
||||
message.destroy();
|
||||
return message.warning("请输入直播时间");
|
||||
}
|
||||
if (!state.basevote) {
|
||||
return message.warning("请上传投票基数");
|
||||
}
|
||||
// if (!state.basevote) {
|
||||
// return message.warning("请上传投票基数");
|
||||
// }
|
||||
if (state.time != undefined) {
|
||||
state.startTime = dayjs(state.time[0]).format("YYYY-MM-DD");
|
||||
state.endTime = dayjs(state.time[1]).format("YYYY-MM-DD");
|
||||
@@ -427,6 +493,9 @@ export default {
|
||||
ballotId: state.ballotId,
|
||||
baseVote: state.basevote,
|
||||
voteExplain: state.textV1,
|
||||
votesTotal: state.totalVoteNum, //总票数
|
||||
numberOfInvolved: state.partakeNum, //参与数
|
||||
numberOfBrowse: state.browseNum, //浏览数
|
||||
};
|
||||
if (props.edit) {
|
||||
api
|
||||
@@ -469,7 +538,7 @@ export default {
|
||||
};
|
||||
|
||||
function downloadTemplate() {
|
||||
window.open('/manageApi/投票基础数据模版.xlsx')
|
||||
window.open("/manageApi/投票基础数据模版.xlsx");
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user