|
@@ -0,0 +1,340 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <el-dialog
|
|
|
+ :center="true"
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
+ width="800px"
|
|
|
+ class="bindingFormDialog"
|
|
|
+ >
|
|
|
+ <div class="a-d-top">
|
|
|
+ <div class="a-d-topTit">
|
|
|
+ <div>绑定表单</div>
|
|
|
+ </div>
|
|
|
+ <div class="a_d_t_input">
|
|
|
+ <el-input
|
|
|
+ placeholder="请输入标题"
|
|
|
+ prefix-icon="el-icon-search"
|
|
|
+ v-model="text"
|
|
|
+ @submit.native.prevent="search()"
|
|
|
+ clearable
|
|
|
+ >
|
|
|
+ </el-input>
|
|
|
+ <el-button
|
|
|
+ size="mini"
|
|
|
+ :disabled="loading"
|
|
|
+ style="margin-left: 10px"
|
|
|
+ @click="search()"
|
|
|
+ type="primary"
|
|
|
+ >搜索</el-button
|
|
|
+ >
|
|
|
+ </div>
|
|
|
+ <div class="a-d-t-right">
|
|
|
+ <span @click.stop="dialogVisible = false">×</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="bfd_box" v-loading="loading">
|
|
|
+ <el-table :data="list" border>
|
|
|
+ <el-table-column
|
|
|
+ prop="title"
|
|
|
+ label="标题"
|
|
|
+ style="width: 33%"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="uname"
|
|
|
+ label="创建人"
|
|
|
+ style="width: 33%"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="uname"
|
|
|
+ label="操作"
|
|
|
+ style="width: 33%"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-button
|
|
|
+ type="info"
|
|
|
+ size="small"
|
|
|
+ :disabled="true"
|
|
|
+ v-if="scope.row.courseId == chooseForm.testId"
|
|
|
+ >已绑定</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-else
|
|
|
+ size="small"
|
|
|
+ type="primary"
|
|
|
+ @click.stop="choose(scope.row)"
|
|
|
+ >绑定</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <div class="bfd_bottom">
|
|
|
+ <div class="bfd_b_left">
|
|
|
+ <el-pagination
|
|
|
+ background
|
|
|
+ :current-page="pageData.nowPage"
|
|
|
+ layout="prev, pager, next"
|
|
|
+ @current-change="currentChange"
|
|
|
+ :page-size="pageData.pageSize"
|
|
|
+ :total="pageData.total"
|
|
|
+ >
|
|
|
+ </el-pagination>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+export default {
|
|
|
+ emits: ["success"],
|
|
|
+ props: {
|
|
|
+ tid: {
|
|
|
+ type: String,
|
|
|
+ default: "",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ loading: false,
|
|
|
+ dialogVisible: false,
|
|
|
+ userId: this.$route.query["userid"],
|
|
|
+ oid: this.$route.query["oid"],
|
|
|
+ org: this.$route.query["org"],
|
|
|
+ chooseForm: {
|
|
|
+ testId: "",
|
|
|
+ checkUrl: "",
|
|
|
+ doUrl: "",
|
|
|
+ },
|
|
|
+ list: [],
|
|
|
+ pageData: {
|
|
|
+ nowPage: 1,
|
|
|
+ total: 0,
|
|
|
+ pageSize: 20,
|
|
|
+ },
|
|
|
+ text: "",
|
|
|
+ };
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ open(_json) {
|
|
|
+ if (_json.testData) {
|
|
|
+ this.chooseForm = _json.testData;
|
|
|
+ } else {
|
|
|
+ this.chooseForm = {};
|
|
|
+ }
|
|
|
+ this.text = "";
|
|
|
+ this.pageData.nowPage = 1;
|
|
|
+ this.loading = false;
|
|
|
+ this.dialogVisible = true;
|
|
|
+ this.getData();
|
|
|
+ },
|
|
|
+ close() {
|
|
|
+ this.text = "";
|
|
|
+ this.dialogVisible = false;
|
|
|
+ this.chooseForm = {
|
|
|
+ testId: "",
|
|
|
+ checkUrl: "",
|
|
|
+ doUrl: "",
|
|
|
+ };
|
|
|
+ this.pageData.nowPage = 1;
|
|
|
+ this.list = [];
|
|
|
+ this.pageData.total = 0;
|
|
|
+ },
|
|
|
+ search(){
|
|
|
+ this.pageData.nowPage = 1
|
|
|
+ this.getData();
|
|
|
+ },
|
|
|
+ choose(row) {
|
|
|
+ this.$confirm("确定绑定该表单吗?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ let _result = {
|
|
|
+ testId: row.courseId,
|
|
|
+ checkUrl: `https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/#/checkToTest?cid=${row.courseId}&userid=${this.userId}&oid=${this.oid}&org=${this.org}&tid=${this.tid}&isN=1&role=0&type=2,`,
|
|
|
+ doUrl: `https://beta.pbl.cocorobo.cn/pbl-teacher-table/dist/#/doTest?cid=${row.courseId}&userid=${this.userId}&oid=${this.oid}&org=${this.org}&tid=${this.tid}&isN=1&role=0&type=2`,
|
|
|
+ };
|
|
|
+ this.loading = true;
|
|
|
+ this.submitBtn(_result);
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: "info",
|
|
|
+ message: "已取消绑定",
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ submitBtn(_data) {
|
|
|
+ if (!_data.testId) return this.$message.error("未选择表单");
|
|
|
+ this.$emit("success", _data);
|
|
|
+ },
|
|
|
+ currentChange(page) {
|
|
|
+ this.pageData.nowPage = page;
|
|
|
+ this.getData();
|
|
|
+ },
|
|
|
+ getData() {
|
|
|
+ if (this.loading) return this.$message.info("请稍等...");
|
|
|
+ this.loading = true;
|
|
|
+
|
|
|
+ this.list = [];
|
|
|
+ let params = {
|
|
|
+ type: 4,
|
|
|
+ uid: this.userId,
|
|
|
+ oid: this.oid,
|
|
|
+ org: this.org,
|
|
|
+ typea: "",
|
|
|
+ typeb: "",
|
|
|
+ typec: "",
|
|
|
+ typed: "",
|
|
|
+ typef: "",
|
|
|
+ typeE: "",
|
|
|
+ cu: "",
|
|
|
+ cn: this.text,
|
|
|
+ page: this.pageData.nowPage,
|
|
|
+ pageSize: this.pageData.pageSize,
|
|
|
+ };
|
|
|
+ this.ajax
|
|
|
+ .get(this.$store.state.api + "selectTesttCourse", params)
|
|
|
+ .then((res) => {
|
|
|
+ let _data = res.data[0];
|
|
|
+ this.pageData.total = 0
|
|
|
+ if (_data.length > 0) {
|
|
|
+ this.list = _data;
|
|
|
+ this.pageData.total = _data[0].num;
|
|
|
+ }
|
|
|
+ this.loading = false;
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ console.log(err);
|
|
|
+ this.$message.error("获取表单失败");
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.bindingFormDialog >>> .el-dialog {
|
|
|
+ min-width: 800px;
|
|
|
+
|
|
|
+ height: 700px;
|
|
|
+ box-shadow: 0px 0 8px 0px #555555;
|
|
|
+ border-radius: 8px;
|
|
|
+ background-color: #fff;
|
|
|
+ /* top: 0px; */
|
|
|
+ /* margin: 0 auto; */
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+.bindingFormDialog >>> .el-dialog__body {
|
|
|
+ height: 100%;
|
|
|
+ min-width: 800px;
|
|
|
+ flex-shrink: 0;
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding-bottom: 50px;
|
|
|
+ padding-top: 10px;
|
|
|
+}
|
|
|
+.bindingFormDialog >>> .el-dialog__header {
|
|
|
+ display: none !important;
|
|
|
+}
|
|
|
+
|
|
|
+.a-d-top {
|
|
|
+ /* background: #adadad; */
|
|
|
+ display: flex;
|
|
|
+ flex-direction: row;
|
|
|
+ flex-wrap: nowrap;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ height: 54px;
|
|
|
+ border-radius: 8px 8px 0 0;
|
|
|
+ user-select: none;
|
|
|
+ border-bottom: 1px #ccc solid;
|
|
|
+}
|
|
|
+.a-d-top >>> .el-input__inner {
|
|
|
+ width: 320px;
|
|
|
+ height: 32px;
|
|
|
+}
|
|
|
+.a-d-top >>> .el-input__icon {
|
|
|
+ line-height: 32px;
|
|
|
+}
|
|
|
+
|
|
|
+.a-d-topTit {
|
|
|
+ /* width: 171px; */
|
|
|
+ /* margin-left: 20px; */
|
|
|
+ height: 32px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ font-family: PingFang SC;
|
|
|
+ box-sizing: border-box;
|
|
|
+ padding: 5px;
|
|
|
+ line-height: 22px;
|
|
|
+ justify-content: center;
|
|
|
+ /* text-align: left; */
|
|
|
+}
|
|
|
+
|
|
|
+.a-d-t-right {
|
|
|
+ width: 40px;
|
|
|
+ height: 40px;
|
|
|
+ margin-right: 10px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+ align-items: center;
|
|
|
+ color: black !important;
|
|
|
+}
|
|
|
+
|
|
|
+.a-d-t-right > span {
|
|
|
+ width: 25px;
|
|
|
+ height: 25px;
|
|
|
+ border-radius: 25px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ /* align-items: center; */
|
|
|
+ font-size: 22px;
|
|
|
+ color: #fff;
|
|
|
+ /* background-color: #adadad; */
|
|
|
+ cursor: pointer;
|
|
|
+ /* background-color: #e6e6e6; */
|
|
|
+ color: #adadad;
|
|
|
+}
|
|
|
+
|
|
|
+.bfd_box {
|
|
|
+ width: 100%;
|
|
|
+ height: calc(100% - 80px);
|
|
|
+ overflow: auto;
|
|
|
+}
|
|
|
+
|
|
|
+.bfd_bottom {
|
|
|
+ width: 100%;
|
|
|
+ height: calc(70px);
|
|
|
+ margin-top: 10px;
|
|
|
+ display: flex;
|
|
|
+}
|
|
|
+
|
|
|
+.bfd_b_left {
|
|
|
+ flex: 1;
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+
|
|
|
+.a_d_t_input {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+
|
|
|
+/* .bfd_b_right {
|
|
|
+ width: 200px;
|
|
|
+ height: 100%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: flex-end;
|
|
|
+} */
|
|
|
+</style>
|