first commit
This commit is contained in:
@@ -0,0 +1,366 @@
|
||||
<!--#
|
||||
layout("/layouts/platform.html"){
|
||||
#-->
|
||||
|
||||
<style>
|
||||
.issueList > .el-table__header-wrapper {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.issueList .el-table__expanded-cell {
|
||||
background-color: rgb(250, 250, 250) !important;
|
||||
}
|
||||
|
||||
.el-table .last-row {
|
||||
background-color: rgb(250, 250, 250);
|
||||
}
|
||||
</style>
|
||||
|
||||
<div id="app" v-cloak>
|
||||
|
||||
<guava ref="guava">
|
||||
<template>
|
||||
<el-card shadow="never">
|
||||
<div class="search">
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">年度:</div>
|
||||
<div class="search-item-option">
|
||||
<el-date-picker
|
||||
style="width: 100%"
|
||||
:clearable="false"
|
||||
placeholder="选择年"
|
||||
type="year"
|
||||
v-model="pageForm.year"
|
||||
value-format="yyyy">
|
||||
</el-date-picker>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<div class="search-item-label">标题:</div>
|
||||
<div class="search-item-option">
|
||||
<el-input placeholder="请输入内容" v-model="pageForm.qtitle">
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="search-query">
|
||||
<el-button @click="doSearch" icon="el-icon-search" type="primary">搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-card>
|
||||
|
||||
<el-card shadow="never" class="mt20">
|
||||
<el-table :data="tableData" header-align="center" style="width: 100%">
|
||||
<el-table-column align="center" label="序号" type="index" :index="indexMethod"></el-table-column>
|
||||
<el-table-column align="center" label="标题" prop="qtitle"></el-table-column>
|
||||
<el-table-column align="center" label="说明" prop="qsm" show-overflow-tooltip="true">
|
||||
<template scope="scope">
|
||||
<div v-html="scope.row.qsm" v-if="scope.row.qsm">{{scope.row.qsm}}</div>
|
||||
<span v-else>暂无</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="创建人" prop="username"></el-table-column>
|
||||
<el-table-column align="center" label="调查时间" prop="qctime"></el-table-column>
|
||||
<el-table-column align="center" label="类型" prop="qlx">
|
||||
<template scope="scope">
|
||||
<span style="color: #67C23A" v-if="scope.row.qlx==1">在线调查</span>
|
||||
<span style="color: #67C23A" v-if="scope.row.qlx==2">在线答题</span>
|
||||
<span style="color: #67C23A" v-if="scope.row.qlx==3">购物问卷</span>
|
||||
<span style="color: #67C23A" v-if="scope.row.qlx==4">意向选择</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="状态" prop="qflag">
|
||||
<template scope="scope">
|
||||
<span style="color: #E6A23C" v-if="scope.row.qflag==1">未开启</span>
|
||||
<span style="color: #67C23A" v-if="scope.row.qflag==2">已开启</span>
|
||||
<span style="color: #F56C6C" v-if="scope.row.qflag==3">已关闭</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="操作" width="250px">
|
||||
<template scope="scope">
|
||||
<el-button @click="openAnswerView(scope.row.qid,scope.row.qtitle)" size="mini" type="primary">查看答题报告
|
||||
</el-button>
|
||||
<el-button @click="openView(scope.row.qid)" size="mini" type="primary">查看比例报告
|
||||
</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<!--#include("/layouts/pagination.html"){}#-->
|
||||
|
||||
</el-card>
|
||||
</template>
|
||||
|
||||
<template #edit_func>
|
||||
<el-button @click="doExport" icon="el-icon-printer" type="primary">导出</el-button>
|
||||
</template>
|
||||
<template #edit>
|
||||
<div class="pl10 pr10">
|
||||
<el-row class="text-center">
|
||||
<h2 style="margin: 0">{{viewData.q.qtitle}}</h2>
|
||||
</el-row>
|
||||
<el-row class="mb20">
|
||||
<div v-html="viewData.q.qsm"></div>
|
||||
</el-row>
|
||||
|
||||
<div id="issue-wrap" :style="{'height':issueWrapHeight+'px'}"
|
||||
style="overflow-y: scroll;transition-duration: .5s;transition-timing-function: ease-in-out">
|
||||
<el-row v-for="issue,idx in viewData.q.issues">
|
||||
<el-row>
|
||||
<span style="font-weight: bolder;color: rgb(120,120,120)">第 {{idx+1}} 题:</span>
|
||||
<div style="display: inline-block" v-html="issue.iname"></div>
|
||||
<span style="color: rgb(180,180,180)" v-if="issue.itx==1&&issue.iisdx">[单选题]</span>
|
||||
<span style="color: rgb(180,180,180)" v-if="issue.itx==1&&!issue.iisdx">[多选题]</span>
|
||||
<span style="color: rgb(180,180,180)" v-if="issue.itx==2">[填空题]</span>
|
||||
</el-row>
|
||||
|
||||
<el-row class="mt20 mb20">
|
||||
<el-table
|
||||
:data="issue.wors"
|
||||
header-align="center"
|
||||
style="width: 100%"
|
||||
v-if="issue.itx==1"
|
||||
>
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="选项"
|
||||
prop="wtxt">
|
||||
<template scope="scope">
|
||||
{{scope.row.wtxt}}
|
||||
<span @click="openTkView(scope.row.wid)"
|
||||
style="color: #409EFF;cursor:pointer;text-decoration: underline"
|
||||
v-if="scope.row.wistk">详细</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="小计"
|
||||
prop="xj">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="比例"
|
||||
prop="bl">
|
||||
<template scope="scope">
|
||||
<el-progress :percentage="scope.row.bl"
|
||||
v-if="scope.row.bl!=undefined"></el-progress>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-button @click="openTkView(issue.wors[0].wid)" size="small" type="primary"
|
||||
v-else>
|
||||
查看详细信息
|
||||
</el-button>
|
||||
</el-row>
|
||||
|
||||
</el-row>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #view>
|
||||
<div class="pl10 pr10">
|
||||
<el-row class="text-center">
|
||||
<h2 style="margin: 0">
|
||||
{{viewQuestionName}}
|
||||
<el-button @click="doExportAnswer" icon="el-icon-printer" type="primary" size="small">导出</el-button>
|
||||
</h2>
|
||||
</el-row>
|
||||
|
||||
<div style="overflow-y: scroll;transition-duration: .5s;transition-timing-function: ease-in-out">
|
||||
<el-row v-for="issue,idx in fullIssueAnswerInfo">
|
||||
<el-row>
|
||||
<span style="font-weight: bolder;color: rgb(120,120,120)">第 {{idx+1}} 题:</span>
|
||||
<div style="display: inline-block" v-html="issue.iname"></div>
|
||||
<span style="color: rgb(180,180,180)" v-if="issue.itx==1&&issue.iisdx">[单选题]</span>
|
||||
<span style="color: rgb(180,180,180)" v-if="issue.itx==1&&!issue.iisdx">[多选题]</span>
|
||||
<span style="color: rgb(180,180,180)" v-if="issue.itx==2">[填空题]</span>
|
||||
</el-row>
|
||||
|
||||
<el-row class="mt20 mb20">
|
||||
<el-table
|
||||
:data="issue.answerUsers"
|
||||
header-align="center"
|
||||
style="width: 100%">
|
||||
<el-table-column label="姓名" prop="username"></el-table-column>
|
||||
<el-table-column label="工号" prop="loginname"></el-table-column>
|
||||
<el-table-column label="单位" prop="unitname"></el-table-column>
|
||||
<el-table-column label="分工会" prop="unionname"></el-table-column>
|
||||
<el-table-column label="回答选项" prop="wtxt" sortable
|
||||
v-if="issue.itx===1"></el-table-column>
|
||||
<el-table-column label="回答内容" prop="rval" sortable
|
||||
v-if="issue.itx===2"></el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</guava>
|
||||
|
||||
<el-dialog
|
||||
:close-on-click-modal="false"
|
||||
:visible.sync="tkViewDialogVisible"
|
||||
custom-class="ViewDialogClass"
|
||||
title="详细信息"
|
||||
width="50%"
|
||||
>
|
||||
<el-row>
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-input placeholder="请输入内容" size="small" v-model="tkPageForm.searchKeyword">
|
||||
<template slot="prepend">文本</template>
|
||||
</el-input>
|
||||
</div>
|
||||
<div class="btn-group tool-button mt5">
|
||||
<el-button @click="doTkSearch" icon="el-icon-search" size="small" type="primary"></el-button>
|
||||
</div>
|
||||
</el-row>
|
||||
|
||||
<el-row class="el-table-container" style="margin-top: 20px;">
|
||||
<el-table
|
||||
:data="tkTableData"
|
||||
header-align="center"
|
||||
size="medium"
|
||||
style="width: 100%"
|
||||
>
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="序号"
|
||||
type="index"
|
||||
>
|
||||
<template scope="scope">
|
||||
<span>{{scope.$index+(tkPageForm.pageNumber - 1) * tkPageForm.pageSize + 1}} </span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
align="center"
|
||||
header-align="center"
|
||||
label="提交时间"
|
||||
prop="rtime"
|
||||
width="200px">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
header-align="center"
|
||||
label="文本"
|
||||
prop="rval">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-row>
|
||||
<el-row class="el-pagination-container">
|
||||
<el-pagination
|
||||
:current-page="tkPageForm.pageNumber"
|
||||
:page-size="tkPageForm.pageSize"
|
||||
:page-sizes="[10, 20, 30, 50]"
|
||||
:total="pageForm.totalCount"
|
||||
@current-change="(val)=>{tkPageForm.pageNumber = val;tkPageData();}"
|
||||
@size-change="(val)=>{tkPageForm.pageSize = val;tkPageData();}"
|
||||
layout="total, prev, pager, next">
|
||||
</el-pagination>
|
||||
</el-row>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
let vue = new Vue({
|
||||
el: '#app',
|
||||
mixins: [initTableMixins],
|
||||
data() {
|
||||
return {
|
||||
v: "index",
|
||||
tableData: [],
|
||||
tkTableData: [],
|
||||
pageForm: {
|
||||
searchName: "",
|
||||
searchKeyword: "",
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
pageOrderName: "",
|
||||
pageOrderBy: "",
|
||||
year: new Date().getFullYear() + ''
|
||||
},
|
||||
tkPageForm: {
|
||||
searchKeyword: "",
|
||||
pageNumber: 1,
|
||||
pageSize: 10,
|
||||
totalCount: 0,
|
||||
title: '',
|
||||
},
|
||||
viewData: {q: {issue: [{word: []}]}},
|
||||
tkViewDialogVisible: false,
|
||||
questionId: '',
|
||||
|
||||
issueWrapHeight: 0,
|
||||
|
||||
fullIssueAnswerInfo: [],
|
||||
|
||||
viewQuestionId: null,
|
||||
viewQuestionName: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
doExportAnswer() {
|
||||
window.open(loc() + '/exportAnswerView?id=' + this.viewQuestionId)
|
||||
},
|
||||
|
||||
async openAnswerView(id,qtitle) {
|
||||
this.$refs.guava.view()
|
||||
const {data} = await $.get(loc() + '/getAnswerView', {id})
|
||||
this.fullIssueAnswerInfo = data
|
||||
this.viewQuestionId = id
|
||||
this.viewQuestionName = qtitle
|
||||
},
|
||||
doExport() {
|
||||
location.href = loc() + '/doExport?questionId=' + this.questionId
|
||||
},
|
||||
openTkView(wid) {
|
||||
this.tkPageForm.wid = wid
|
||||
this.tkPageData()
|
||||
this.tkViewDialogVisible = true
|
||||
},
|
||||
doTkSearch() {
|
||||
this.tkPageForm.pageNumber = 1;
|
||||
this.tkPageData();
|
||||
},
|
||||
async tkPageData() {
|
||||
const {data} = await $.post(loc() + "/tkData", this.tkPageForm)
|
||||
this.tkTableData = data.list
|
||||
this.tkPageForm.totalCount = data.totalCount
|
||||
},
|
||||
async openView(qid) {
|
||||
this.issueWrapHeight = 0
|
||||
this.questionId = qid
|
||||
const {data} = await $.get(loc() + "/getReplyData", {qid: qid})
|
||||
data.q.issues.forEach(function (issue) {
|
||||
issue.wors.forEach(function (wor) {
|
||||
const xj = data[issue.iid].hasOwnProperty(wor.wid) ? data[issue.iid][wor.wid] : 0
|
||||
wor.xj = xj
|
||||
console.log(data[issue.iid].num)
|
||||
wor.bl = (xj / data[issue.iid].num).toFixed(2) * 100
|
||||
wor.bl = isNaN(wor.bl) ? 0 : wor.bl
|
||||
})
|
||||
}
|
||||
)
|
||||
this.viewData = data
|
||||
this.$refs.guava.edit()
|
||||
this.$nextTick(() => {
|
||||
setTimeout(() => {
|
||||
this.issueWrapHeight = window.innerHeight - 10 - 20 - document.getElementById('issue-wrap').getBoundingClientRect().top - 1
|
||||
}, 500)
|
||||
})
|
||||
},
|
||||
},
|
||||
created() {
|
||||
this.pageData()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<!--#
|
||||
}
|
||||
#-->
|
||||
Reference in New Issue
Block a user