123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811 |
- <template>
- <div
- class="pb_content"
- style="
- background: unset;
- overflow: auto;
- padding: 20px;
- margin: 0;
- box-sizing: border-box;
- "
- >
- <div
- style="
- position: absolute;
- width: 100%;
- top: 0;
- height: 100%;
- overflow: auto;
- left: 50%;
- transform: translateX(-50%);
- "
- >
- <div
- class="pb_content_body"
- style="
- background: #fff;
- padding: 0px 21px;
- box-sizing: border-box;
- border-radius: 5px;
- "
- >
- <div class="pb_head">
- <!-- <span>备注:教师可以根据课程、班级条件筛选学生并查看该学生信息</span> -->
- <span
- v-if="type == '2'"
- @click="
- goTo(
- '/tcStudent?userid=' + userid + '&oid=' + oid + '&org=' + org
- )
- "
- >学生管理</span
- >
- <span
- v-else
- @click="
- goTo(
- '/course?userid=' +
- userid +
- '&oid=' +
- oid +
- '&org=' +
- org +
- '&role=' +
- role
- )
- "
- >课程管理</span
- >
- <span class="sub_head">评价管理</span>
- <span
- @click="
- goTo(
- '/worksReport?userid=' + userid + '&oid=' + oid + '&org=' + org
- )
- "
- >数据报告</span
- >
- </div>
- <div class="student_head">
- <div class="student_search">
- <div>班级筛选</div>
- <el-select v-model="classChoose" @change="search">
- <el-option label="全部" value="">全部</el-option>
- <el-option
- v-for="(c, cIndex) in classJuri"
- :key="cIndex"
- :value="c.id"
- :label="c.name"
- ></el-option>
- </el-select>
- <!-- <div
- style="
- line-height: 35px;
- font-size: 14px;
- min-width: 60px;
- margin-left: 10px;
- "
- >
- 目标筛选
- </div> -->
- <!-- <el-select v-model="eChoose" @change="search" clear="mbCss">
- <el-option label="全部" value="">全部</el-option>
- <el-option
- v-for="(e, eIndex) in evaJuri"
- :key="eIndex"
- :value="e.id"
- :label="e.title"
- ></el-option>
- </el-select> -->
- <el-input
- v-model="cn"
- placeholder="筛选课程名称"
- @input="search"
- ></el-input>
- </div>
- <!-- <div
- style="
- margin-left: 10px;
- cursor: pointer;
- float: right;
- min-width: 100px;
- "
- @click="
- goTo(
- '/studentWorks?userid=' + userid + '&oid=' + oid + '&org=' + org
- )
- "
- >
- 学生评价管理
- </div> -->
- </div>
- </div>
- <div class="pb_content_body">
- <div class="student_table">
- <el-table
- ref="table"
- :data="tableData1"
- border
- :height="tableHeight"
- :fit="true"
- v-loading="isLoading"
- style="width: 100%"
- :header-cell-style="{ background: '#f1f1f1', fontSize: '17px' }"
- :row-class-name="tableRowClassName"
- >
- <el-table-column
- prop="title"
- label="课程"
- min-width="30"
- align="center"
- ></el-table-column>
- <el-table-column label="班级" min-width="30" align="center">
- <template slot-scope="scope">
- {{
- tableData1[scope.$index].classJson.className
- ? tableData1[scope.$index].classJson.className
- : "-"
- }}
- </template>
- </el-table-column>
- <el-table-column
- prop="uname"
- label="创建人"
- min-width="30"
- align="center"
- ></el-table-column>
- <!-- <el-table-column
- prop="evaTitle"
- label="目标名称"
- min-width="30"
- align="center"
- >
- <template slot-scope="scope">
- {{ scope.row.evaTitle ? scope.row.evaTitle : "-" }}
- </template>
- </el-table-column>
- <el-table-column
- prop="time"
- label="时间"
- min-width="20"
- align="center"
- ></el-table-column> -->
- <el-table-column align="center" label="操作" width="200px">
- <template slot-scope="scope">
- <!-- <el-button
- type="primary"
- size="small"
- @click="
- goTo(
- '/worksDetail?cid=' +
- scope.row.courseId +
- '&userid=' +
- userid +
- '&oid=' +
- oid
- )
- "
- >查看学生</el-button>-->
- <!-- <el-button type="primary" size="small" @click="getWorkData(scope.row)">生成报告</el-button> -->
- <el-button
- type="primary"
- size="small"
- @click="getWorkData(scope.row)"
- >查看作业</el-button
- >
- <el-button
- type="primary"
- size="small"
- @click="getStudnet(scope.row)"
- >查看报告</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div class="student_page">
- <el-pagination
- background
- layout="prev, pager, next"
- :page-size="10"
- :total="total"
- v-if="page"
- @current-change="handleCurrentChange"
- ></el-pagination>
- </div>
- </div>
- </div>
- <!-- <el-dialog
- title="查看报告"
- :visible.sync="dialogVisible"
- :append-to-body="true"
- width="750px"
- :before-close="handleClose"
- class="dialog_diy"
- >
- <div>
- <div class="a_addBox">
- <WorkDate :dataJson="dataJson"></WorkDate>
- </div>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="dialogVisible = false">关 闭</el-button>
- </span>
- </el-dialog>-->
-
- <WorkDate
- :dataJson="dataJson"
- :uid="userid"
- :cid="dataJson.courseId"
- :ooid="oid"
- @cancel="cancel"
- :dialogVisibleBao.sync="dialogVisibleBao"
- :dialogVisible.sync="dialogVisible"
- v-if="dialogVisible"
- class="workdates"
- ></WorkDate>
-
-
- <el-dialog
- title="自定义导出报告"
- :visible.sync="dialogVisibleBao"
- :append-to-body="true"
- width="550px"
- :before-close="handleClose"
- class="dialog_diy r_diy"
- >
- <div>
- <div>
- <Report :cid="dataJson.courseId"></Report>
- </div>
- </div>
- <span slot="footer" class="dialog-footer"> </span>
- </el-dialog>
- <el-dialog
- title="选择学生"
- :visible.sync="signDialog"
- width="500px"
- :before-close="handleClose"
- class="dialog_diy check_diy"
- >
- <div>
- <div class="student_search" style="margin-bottom: 10px">
- <div>筛选</div>
- <div style="display: flex; width: 90%">
- <el-select
- class="r_select"
- v-model="uname"
- placeholder="请选择学生"
- filterable
- @change="searchWork2"
- >
- <el-option label="所有班级" value></el-option>
- <el-option
- v-for="item in userAarray"
- :key="item.id"
- :label="item.name"
- :value="item.id"
- ></el-option>
- </el-select>
- </div>
- </div>
- <div>
- <el-table
- v-loading="isLoading2"
- ref="table"
- :data="res2"
- border
- :height="400"
- :fit="true"
- style="width: 100%"
- :row-class-name="tableRowClassName"
- :header-cell-style="{ background: 'rgb(238,238,238)' }"
- >
- <el-table-column
- prop="sName"
- label="姓名"
- min-width="20"
- align="center"
- ></el-table-column>
- <el-table-column
- label="班级"
- min-width="20"
- show-overflow-tooltip
- align="center"
- >
- <template slot-scope="scope">
- <div>{{ scope.row.class ? scope.row.class : '-' }}</div>
- </template>
- </el-table-column>
- <el-table-column align="center" label="操作" min-width="20">
- <template slot-scope="scope">
- <el-button
- type="primary"
- size="small"
- @click="getReport(scope.row)"
- >查看报告</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- <div style="margin-top: 10px">
- <el-pagination
- background
- layout="prev, pager, next"
- :page-size="10"
- :total="total2"
- @current-change="handleCurrentChange2"
- ></el-pagination>
- </div>
- </div>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="signDialog = false">关闭</el-button>
- </span>
- </el-dialog>
- <div class="report_box" v-if="reportVisible">
- <studentReport
- :checkCourse="checkCourse"
- :checkStudent="checkStudent"
- @cancelR="cancelR"
- :oid="oid"
- ></studentReport>
- </div>
- <!-- <div class="cancelbox" v-if="reportVisible">
- <el-button @click="cancelR" type="primary" size="small">返回</el-button>
- </div> -->
- </div>
- </template>
- <script>
- import WorkDate from "./components/workData";
- import Report from "./components/report";
- import studentReport from "./components/studentReport";
- import "../../common/aws-sdk-2.235.1.min.js";
- export default {
- components: {
- WorkDate,
- Report,
- studentReport,
- },
- data() {
- return {
- tableHeight: "500px",
- isLoading: false,
- formLabelWidth: "100px",
- tableData1: [],
- subject: "",
- sClass: "",
- subjectJuri: [],
- projectJuri: [],
- classJuri: [],
- evaJuri: [],
- grade: [],
- projectchoose: "",
- page: 1,
- total: 0,
- groupA: "0",
- classChoose: "",
- eChoose: "",
- cn: "",
- userid: this.$route.query.userid,
- org: this.$route.query.org,
- role: this.$route.query.role,
- oid: this.$route.query.oid,
- type: this.$route.query.type,
- dialogVisible: false,
- dialogVisibleBao: false,
- dataJson: {},
- signDialog: false,
- isLoading2: false,
- page2: 1,
- total2: 0,
- res2: [],
- checkCourse: "",
- reportVisible: false,
- checkStudent: "",
- userAarray: [],
- uname: "",
- };
- },
- mounted() {
- this.$nextTick(function () {
- this.tableHeight =
- window.innerHeight - this.$refs.table.$el.offsetTop - 200;
- if (this.tableHeight <= 530) {
- this.tableHeight = 530;
- }
- // 监听窗口大小变化
- let self = this;
- window.onresize = function () {
- self.tableHeight =
- window.innerHeight - self.$refs.table.$el.offsetTop - 200;
- if (self.tableHeight <= 530) {
- self.tableHeight = 530;
- }
- };
- });
- },
- methods: {
- goTo(path) {
- this.$router.push(path);
- },
- tableRowClassName({ row, rowIndex }) {
- if ((rowIndex + 1) % 2 === 0) {
- return "even_row";
- } else {
- return "";
- }
- },
- handleClose(done) {
- done();
- },
- handleCurrentChange(val) {
- this.page = val;
- this.getProject();
- },
- handleCurrentChange2(val) {
- this.page2 = val;
- this.getStudnet();
- },
- //获取班级列表
- // getClass() {
- // this.isLoading = true;
- // let params = {
- // cu: "",
- // cn: this.sClass,
- // page: this.page,
- // };
- // this.ajax
- // .get(this.$store.state.api + "selectClass", params)
- // .then((res) => {
- // this.isLoading = false;
- // this.grade = res.data[0];
- // })
- // .catch((err) => {
- // this.isLoading = false;
- // console.error(err);
- // });
- // },
- getProject() {
- this.isLoading = true;
- let params = {
- uid: this.userid,
- cid: this.classChoose,
- eid: this.eChoose,
- cn: this.cn,
- page: this.page,
- };
- this.ajax
- .get(this.$store.state.api + "getProject1", params)
- .then((res) => {
- this.isLoading = false;
- this.total = res.data[0].length > 0 ? res.data[0][0].num : 0;
- this.tableData1 = res.data[0];
- this.classJuri = res.data[2];
- var cJuri = res.data[1];
- for (var j = 0; j < this.tableData1.length; j++) {
- this.tableData1[j].classJson = { className: "" };
- for (var i = 0; i < cJuri.length; i++) {
- if (this.tableData1[j].courseId == cJuri[i].courseId) {
- if (cJuri[i].cName != undefined && cJuri[i].cName != null) {
- if (this.tableData1[j].classJson.className == "") {
- this.tableData1[j].classJson.className += cJuri[i].cName;
- } else {
- this.tableData1[j].classJson.className +=
- "," + cJuri[i].cName;
- }
- }
- }
- }
- }
- })
- .catch((err) => {
- this.isLoading = false;
- console.error(err);
- });
- },
- search() {
- this.page = 1;
- this.getProject();
- },
- getWorkData(res) {
- this.dataJson = res;
- this.dialogVisible = true;
- },
- cancel() {
- this.dataJson = "";
- this.dialogVisible = false;
- },
- cancelR() {
- this.checkStudent = "";
- this.reportVisible = false;
- this.signDialog = true;
- },
- searchWork2() {
- (this.page2 = 1), this.getStudnet();
- },
- getStudnet(row) {
- //获取作业
- this.signDialog = true;
- this.isLoading2 = true;
- this.checkCourse = row ? row.courseId : this.checkCourse;
- this.getCourseDetail();
- let params = {
- cid: this.checkCourse,
- uname: this.uname,
- stage: "",
- task: "",
- page: this.page2,
- };
- this.ajax
- .get(this.$store.state.api + "getCourseWorks3Copy", params)
- .then((res) => {
- this.isLoading2 = false;
- this.total2 = res.data[0].length > 0 ? res.data[0][0].num : 0;
- this.res2 = res.data[0];
- })
- .catch((err) => {
- this.isLoading2 = false;
- console.error(err);
- });
- },
- downloadFile(url){
- var credentials = {
- accessKeyId: "AKIATLPEDU37QV5CHLMH",
- secretAccessKey: "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",
- }; //秘钥形式的登录上传
- window.AWS.config.update(credentials);
- window.AWS.config.region = "cn-northwest-1"; //设置区域
- let url2 = url;
- let _url2 = "";
- if (
- url2.indexOf("https://view.officeapps.live.com/op/view.aspx?src=") != -1
- ) {
- _url2 = url2.split(
- "https://view.officeapps.live.com/op/view.aspx?src="
- )[1];
- } else {
- _url2 = url2;
- }
- let _this = this;
- _this.downLoading = true
- var s3 = new window.AWS.S3({ params: { Bucket: "ccrb" } });
- let name = decodeURIComponent(_url2.split("https://ccrb.s3.cn-northwest-1.amazonaws.com.cn/")[1])
- var params = {
- Bucket: "ccrb",
- Key: name
- };
- s3.getObject(params, function (err, data) {
- _this.downLoading = false
- if (err) console.log(err, err.stack); // an error occurred
- else {
- let url = window.URL.createObjectURL(new Blob([data.Body]));
- let a = document.createElement("a");
- a.name = 'student01-学生成长报告.pdf';
- a.href = url;
- a.download = 'student01-学生成长报告.pdf';
- a.click();
- console.log(data);
- } // sxuccessful response
- });
- },
- getCourseDetail() {
- let params = {
- cid: this.checkCourse,
- };
- this.ajax
- .get(this.$store.state.api + "getCourseReportClassList", params)
- .then((res) => {
- this.userAarray = res.data[0];
- })
- .catch((err) => {
- console.error(err);
- });
- },
- getReport(row) {
- this.checkStudent = row.userid;
- this.reportVisible = true;
- this.signDialog = false;
- },
- // getClass() {
- // let params = {
- // oid: this.oid,
- // };
- // this.ajax
- // .get(this.$store.state.api + "selectClassBySchool", params)
- // .then((res) => {
- // this.classJuri = res.data[0];
- // })
- // .catch((err) => {
- // console.error(err);
- // });
- // },
- getEva() {
- let params = {
- oid: this.oid,
- };
- this.ajax
- .get(this.$store.state.api + "selectAllEvaluation", params)
- .then((res) => {
- this.evaJuri = res.data[0];
- })
- .catch((err) => {
- console.error(err);
- });
- },
- },
- created() {
- this.page = 1;
- // this.getClass();
- this.getEva();
- this.getProject();
- },
- };
- </script>
- <style scoped>
- .sub_head {
- position: relative;
- margin: 0 10px;
- }
- .sub_head::after {
- content: "";
- width: 100%;
- background: #5a9cea;
- height: 2px;
- position: absolute;
- left: 0;
- bottom: -12px;
- }
- .pb_head > span:nth-child(1),
- .pb_head > span:nth-child(3) {
- /* font-size: 16px; */
- font-size: 26px;
- cursor: pointer;
- /* color: #ab582f; */
- /* color: #409eff; */
- color: #999;
- }
- .pb_head > span:nth-child(1):hover,
- .pb_head > span:nth-child(3):hover {
- color: #000;
- }
- .pb_head {
- margin: 0 !important;
- width: 100% !important;
- }
- .student_page {
- margin-top: 10px;
- }
- .student_head {
- margin-top: 10px;
- padding-bottom: 15px;
- display: flex;
- justify-content: space-between;
- }
- .student_search {
- display: flex;
- flex-direction: row;
- align-items: center;
- }
- .student_search > div:nth-child(1) {
- line-height: 35px;
- font-size: 14px;
- min-width: 60px;
- }
- .student_search > div:nth-child(4) {
- min-width: 100px;
- margin-left: 10px;
- cursor: pointer;
- }
- .student_search >>> .el-input__inner {
- width: 190px;
- height: 35px;
- margin-left: 10px;
- }
- .student_table >>> .el-table--border td {
- border-right: 0px !important;
- }
- .student_page {
- margin-top: 10px;
- }
- .student_table >>> .el-table,
- .student_table >>> .el-table__body-wrapper {
- height: auto !important;
- }
- .el-table >>> .even_row {
- background-color: #f1f1f1 !important;
- }
- .dialog_diy >>> .el-dialog__header {
- padding: 9px 20px 10px;
- background: #32455b !important;
- }
- .dialog_diy >>> .el-dialog__title {
- color: #fff;
- font-size: 15px;
- }
- .dialog_diy >>> .el-dialog__headerbtn {
- top: 14px;
- }
- .dialog_diy >>> .el-dialog__headerbtn .el-dialog__close {
- color: #fff;
- }
- .dialog_diy >>> .el-dialog__headerbtn .el-dialog__close:hover {
- color: #fff;
- }
- .check_diy >>> .el-dialog__body {
- padding-bottom: 0;
- }
- .dialog_diy >>> .el-dialog__body,
- .dialog_diy >>> .el-dialog__footer {
- background: #fafafa;
- }
- .r_diy >>> .el-dialog__footer {
- padding: 0;
- }
- .a_addBox {
- height: 570px;
- overflow: auto;
- }
- .workdates {
- height: 100%;
- position: absolute;
- top: 0;
- background: #fff;
- overflow: auto;
- z-index: 1;
- width: 95%;
- left: 50%;
- transform: translateX(-50%);
- padding: 20px;
- box-sizing: border-box;
- }
- .cancelbox {
- position: absolute;
- z-index: 2;
- /* left: 50%; */
- right: 0;
- /* width: 95%; */
- transform: translateX(-50%);
- display: flex;
- justify-content: flex-end;
- /* padding: 0 90px 0px 0px; */
- box-sizing: border-box;
- }
- .report_box {
- height: 100%;
- position: absolute;
- top: 0;
- /* background: #fff; */
- background: rgb(231, 242, 252);
- overflow: auto;
- z-index: 1;
- width: 100%;
- left: 50%;
- transform: translateX(-50%);
- padding: 20px;
- box-sizing: border-box;
- }
- .mbCss >>> .el-input__inner {
- margin: 0 !important;
- }
- .student_search >>> .el-input {
- width: auto !important;
- }
- </style>
|