投票导出

This commit is contained in:
lpq
2023-02-19 01:39:58 +08:00
parent 20aa37fe5f
commit 018032bfa3
3 changed files with 62 additions and 63 deletions

View File

@@ -23,7 +23,7 @@
v-if="datasource.type !== 6 && datasource.type !== 9" v-if="datasource.type !== 6 && datasource.type !== 9"
class="endtime" class="endtime"
> >
<!-- 起止时间--> <!-- 起止时间-->
</div> </div>
<div v-else class="endtime"> <div v-else class="endtime">
@@ -48,7 +48,7 @@
placeholder="请选择" placeholder="请选择"
:options="projectNameList" :options="projectNameList"
@change="selectProjectName" @change="selectProjectName"
></a-select> ></a-select>
</div> </div>
</div> </div>
@@ -112,13 +112,13 @@
</div>--> </div>-->
</div> </div>
</a-drawer> </a-drawer>
<CVote <CVote
v-model:CVvisible="CVvisible" v-model:CVvisible="CVvisible"
:voteID="voteID" :voteID="voteID"
:courseID="courseID" :courseID="courseID"
/> />
</template> </template>
<script> <script>
import { toRefs, reactive, onMounted, onUnmounted } from "vue"; import { toRefs, reactive, onMounted, onUnmounted } from "vue";
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
@@ -159,7 +159,7 @@
}, },
}, },
}, },
setup(props, ctx) { setup(props, ctx) {
const state = reactive({ const state = reactive({
visible: props.ProjectVoteModelVisible, visible: props.ProjectVoteModelVisible,
@@ -170,7 +170,7 @@
tableDataTotal: 0, tableDataTotal: 0,
projectName: undefined, projectName: undefined,
projectNameList: [ projectNameList: [
{ {
id: 1, id: 1,
value: "1", value: "1",
@@ -238,7 +238,7 @@
key: "studentDepartName", key: "studentDepartName",
width: "20%", width: "20%",
align: "center", align: "center",
className: "h", className: "h",
ellipsis: true, ellipsis: true,
customRender: (text) => { customRender: (text) => {
@@ -332,7 +332,7 @@
]; ];
return columns; return columns;
}; };
const closeDrawer = () => { const closeDrawer = () => {
ctx.emit("update:ProjectVoteModelVisible", false); ctx.emit("update:ProjectVoteModelVisible", false);
state.currentPage = 1; state.currentPage = 1;
@@ -358,7 +358,7 @@
const onChange = (pageNumber) => { const onChange = (pageNumber) => {
console.log("Page: ", pageNumber); console.log("Page: ", pageNumber);
}; };
// 获取数据 // 获取数据
function getData() { function getData() {
if(props.datasource.type == 12){ if(props.datasource.type == 12){
@@ -390,9 +390,9 @@
// 处理在线课字段和表格中字段保持一致 // 处理在线课字段和表格中字段保持一致
let obj = { let obj = {
studentUserNo: res.data.data.rows[i].studentCode, studentUserNo: res.data.data.rows[i].studentCode,
studentName: res.data.data.rows[i].studentName, studentName: res.data.data.rows[i].studentName,
studentDepartName: res.data.data.rows[i].studentDepartName, studentDepartName: res.data.data.rows[i].studentDepartName,
studentJobName: res.data.data.rows[i].studentJobName, studentJobName: res.data.data.rows[i].studentJobName,
lastStudyTime: res.data.data.rows[i].submitTime, lastStudyTime: res.data.data.rows[i].submitTime,
finishStatus: res.data.data.rows[i].status?res.data.data.rows[i].status:0, finishStatus: res.data.data.rows[i].status?res.data.data.rows[i].status:0,
voteSubmitId: res.data.data.rows[i].voteSubmitId voteSubmitId: res.data.data.rows[i].voteSubmitId
@@ -412,7 +412,7 @@
state.tabledata = []; state.tabledata = [];
} }
} }
// 搜索按钮 // 搜索按钮
function searchTaskList() { function searchTaskList() {
state.currentPage = 1; state.currentPage = 1;
@@ -427,20 +427,21 @@
state.projectName = undefined; state.projectName = undefined;
getData(); getData();
} }
//分页 //分页
const changePaginationStu = (page) => { const changePaginationStu = (page) => {
state.tableDataTotalLoading = true; state.tableDataTotalLoading = true;
state.currentPage = page; state.currentPage = page;
getData(); getData();
}; };
// 导出数据 // 导出数据
function exportTaskStu() { function exportTaskStu() {
console.log(`${process.env.VUE_APP_BASE_API}/admin/vote/manage/export/vote?type=${2}&voteId=${props.datasource.projectTaskId}`) console.log("导出数据")
console.log(`${process.env.VUE_APP_BASE_API}/admin/vote/manage/export/vote?type=${2}&voteId=${props.datasource.projectTaskId}`)
window.open(`${process.env.VUE_APP_BASE_API}/admin/vote/manage/export/vote?type=${2}&voteId=${props.datasource.projectTaskId}`) window.open(`${process.env.VUE_APP_BASE_API}/admin/vote/manage/export/vote?type=${2}&voteId=${props.datasource.projectTaskId}`)
} }
return { return {
...toRefs(state), ...toRefs(state),
selectProjectName, selectProjectName,
@@ -459,7 +460,7 @@
}, },
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
// .drawerStyle { // .drawerStyle {
// .ant-drawer-content-wrapper { // .ant-drawer-content-wrapper {
@@ -531,7 +532,7 @@
flex-wrap: wrap; flex-wrap: wrap;
margin-top: 20px; margin-top: 20px;
justify-content: space-between; justify-content: space-between;
.sealeft { .sealeft {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
@@ -548,7 +549,7 @@
.btns { .btns {
display: flex; display: flex;
flex-wrap: nowrap; flex-wrap: nowrap;
.btn { .btn {
cursor: pointer; cursor: pointer;
width: 100px; width: 100px;
@@ -572,15 +573,15 @@
margin-right: 7px; margin-right: 7px;
} }
} }
.btn1 { .btn1 {
background: #4ea6ff; background: #4ea6ff;
color: #ffffff; color: #ffffff;
} }
.btn2 { .btn2 {
background: #ffffff; background: #ffffff;
color: #4ea6ff; color: #4ea6ff;
border: 1px solid #4ea6ff; border: 1px solid #4ea6ff;
} }
@@ -589,7 +590,7 @@
.btnss { .btnss {
display: flex; display: flex;
flex-wrap: nowrap; flex-wrap: nowrap;
.btn { .btn {
cursor: pointer; cursor: pointer;
width: 130px; width: 130px;
@@ -613,15 +614,15 @@
margin-right: 7px; margin-right: 7px;
} }
} }
.btn1 { .btn1 {
background: #4ea6ff; background: #4ea6ff;
color: #ffffff; color: #ffffff;
} }
.btn2 { .btn2 {
background: #ffffff; background: #ffffff;
color: #4ea6ff; color: #4ea6ff;
border: 1px solid #4ea6ff; border: 1px solid #4ea6ff;
} }
@@ -630,7 +631,7 @@
th.h { th.h {
background-color: #eff4fc !important; background-color: #eff4fc !important;
} }
.ant-table-tbody .ant-table-tbody
> tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) > tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected)
> td { > td {
@@ -657,7 +658,7 @@
} }
} }
} }
.btnn { .btnn {
height: 72px; height: 72px;
width: 100%; width: 100%;
@@ -692,5 +693,4 @@
} }
} }
</style> </style>

View File

@@ -23,7 +23,7 @@
v-if="datasource.type !== 6 && datasource.type !== 9" v-if="datasource.type !== 6 && datasource.type !== 9"
class="endtime" class="endtime"
> >
<!-- 起止时间--> <!-- 起止时间-->
</div> </div>
<div v-else class="endtime"> <div v-else class="endtime">
@@ -48,7 +48,7 @@
placeholder="请选择" placeholder="请选择"
:options="projectNameList" :options="projectNameList"
@change="selectProjectName" @change="selectProjectName"
></a-select> ></a-select>
</div> </div>
</div> </div>
@@ -112,13 +112,13 @@
</div>--> </div>-->
</div> </div>
</a-drawer> </a-drawer>
<CVote <CVote
v-model:CVvisible="CVvisible" v-model:CVvisible="CVvisible"
:voteID="voteID" :voteID="voteID"
:courseID="courseID" :courseID="courseID"
/> />
</template> </template>
<script> <script>
import { toRefs, reactive, onMounted, onUnmounted } from "vue"; import { toRefs, reactive, onMounted, onUnmounted } from "vue";
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
@@ -163,7 +163,7 @@
default: null, default: null,
}, },
}, },
setup(props, ctx) { setup(props, ctx) {
const state = reactive({ const state = reactive({
visible: props.VoteModelVisible, visible: props.VoteModelVisible,
@@ -174,7 +174,7 @@
tableDataTotal: 0, tableDataTotal: 0,
projectName: undefined, projectName: undefined,
projectNameList: [ projectNameList: [
{ {
id: 1, id: 1,
value: "1", value: "1",
@@ -242,7 +242,7 @@
key: "studentDepartName", key: "studentDepartName",
width: "20%", width: "20%",
align: "center", align: "center",
className: "h", className: "h",
ellipsis: true, ellipsis: true,
customRender: (text) => { customRender: (text) => {
@@ -352,7 +352,7 @@
]; ];
return columns; return columns;
}; };
const closeDrawer = () => { const closeDrawer = () => {
ctx.emit("update:VoteModelVisible", false); ctx.emit("update:VoteModelVisible", false);
state.currentPage = 1; state.currentPage = 1;
@@ -378,7 +378,7 @@
const onChange = (pageNumber) => { const onChange = (pageNumber) => {
console.log("Page: ", pageNumber); console.log("Page: ", pageNumber);
}; };
// 获取数据 // 获取数据
function getData() { function getData() {
if(props.datasource.type == 12){ if(props.datasource.type == 12){
@@ -410,9 +410,9 @@
// 处理在线课字段和表格中字段保持一致 // 处理在线课字段和表格中字段保持一致
let obj = { let obj = {
studentUserNo: res.data.data.rows[i].studentCode, studentUserNo: res.data.data.rows[i].studentCode,
studentName: res.data.data.rows[i].studentName, studentName: res.data.data.rows[i].studentName,
studentDepartName: res.data.data.rows[i].studentDepartName, studentDepartName: res.data.data.rows[i].studentDepartName,
studentJobName: res.data.data.rows[i].studentJobName, studentJobName: res.data.data.rows[i].studentJobName,
lastStudyTime: res.data.data.rows[i].submitTime, lastStudyTime: res.data.data.rows[i].submitTime,
finishStatus: res.data.data.rows[i].status?res.data.data.rows[i].status:0, finishStatus: res.data.data.rows[i].status?res.data.data.rows[i].status:0,
voteSubmitId: res.data.data.rows[i].voteSubmitId voteSubmitId: res.data.data.rows[i].voteSubmitId
@@ -432,7 +432,7 @@
state.tabledata = []; state.tabledata = [];
} }
} }
// 搜索按钮 // 搜索按钮
function searchTaskList() { function searchTaskList() {
state.currentPage = 1; state.currentPage = 1;
@@ -447,20 +447,20 @@
state.projectName = undefined; state.projectName = undefined;
getData(); getData();
} }
//分页 //分页
const changePaginationStu = (page) => { const changePaginationStu = (page) => {
state.tableDataTotalLoading = true; state.tableDataTotalLoading = true;
state.currentPage = page; state.currentPage = page;
getData(); getData();
}; };
// 导出数据 // 导出数据
function exportTaskStu() { function exportTaskStu() {
console.log(`${process.env.VUE_APP_BASE_API}/admin/vote/manage/export/vote?type=${1}&voteId=${props.datasource.routerTaskId}`) console.log(`${process.env.VUE_APP_BASE_API}/admin/vote/manage/export/vote?type=${1}&voteId=${props.datasource.courseId}`)
window.open(`${process.env.VUE_APP_BASE_API}/admin/vote/manage/export/vote?type=${1}&voteId=${props.datasource.routerTaskId}`) window.open(`${process.env.VUE_APP_BASE_API}/admin/vote/manage/export/vote?type=${1}&voteId=${props.datasource.courseId}`)
} }
return { return {
...toRefs(state), ...toRefs(state),
selectProjectName, selectProjectName,
@@ -479,7 +479,7 @@
}, },
}; };
</script> </script>
<style lang="scss"> <style lang="scss">
// .drawerStyle { // .drawerStyle {
// .ant-drawer-content-wrapper { // .ant-drawer-content-wrapper {
@@ -551,7 +551,7 @@
flex-wrap: wrap; flex-wrap: wrap;
margin-top: 20px; margin-top: 20px;
justify-content: space-between; justify-content: space-between;
.sealeft { .sealeft {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
@@ -568,7 +568,7 @@
.btns { .btns {
display: flex; display: flex;
flex-wrap: nowrap; flex-wrap: nowrap;
.btn { .btn {
cursor: pointer; cursor: pointer;
width: 100px; width: 100px;
@@ -592,15 +592,15 @@
margin-right: 7px; margin-right: 7px;
} }
} }
.btn1 { .btn1 {
background: #4ea6ff; background: #4ea6ff;
color: #ffffff; color: #ffffff;
} }
.btn2 { .btn2 {
background: #ffffff; background: #ffffff;
color: #4ea6ff; color: #4ea6ff;
border: 1px solid #4ea6ff; border: 1px solid #4ea6ff;
} }
@@ -609,7 +609,7 @@
.btnss { .btnss {
display: flex; display: flex;
flex-wrap: nowrap; flex-wrap: nowrap;
.btn { .btn {
cursor: pointer; cursor: pointer;
width: 130px; width: 130px;
@@ -633,15 +633,15 @@
margin-right: 7px; margin-right: 7px;
} }
} }
.btn1 { .btn1 {
background: #4ea6ff; background: #4ea6ff;
color: #ffffff; color: #ffffff;
} }
.btn2 { .btn2 {
background: #ffffff; background: #ffffff;
color: #4ea6ff; color: #4ea6ff;
border: 1px solid #4ea6ff; border: 1px solid #4ea6ff;
} }
@@ -650,7 +650,7 @@
th.h { th.h {
background-color: #eff4fc !important; background-color: #eff4fc !important;
} }
.ant-table-tbody .ant-table-tbody
> tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) > tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected)
> td { > td {
@@ -677,7 +677,7 @@
} }
} }
} }
.btnn { .btnn {
height: 72px; height: 72px;
width: 100%; width: 100%;
@@ -712,4 +712,3 @@
} }
} }
</style> </style>

View File

@@ -547,7 +547,7 @@ function exportTaskStu() {
window.open( window.open(
`${ `${
process.env.VUE_APP_BASE_API process.env.VUE_APP_BASE_API
}/admin/student/exportTaskStudent?type=${1}&pid=${props.id}` }/admin/student/exportTaskStudent?type=${1}&pid=${props.targetId}`
); );
} }