smith_du hace 2 años
padre
commit
ae0efef0e0

+ 140 - 120
src/components/cloudDialog/cloudDialog.vue

@@ -1,142 +1,162 @@
 <template>
-    <div v-if="visible">
-        <el-dialog v-dialogDrag :class="className" top="10vh" v-bind="attributes" :visible.sync="visible" :before-close="beClose"
-            append-to-body :close-on-click-modal="false" v-on="on">
-            <slot v-if="visibleSlot"></slot>
-            <div slot="footer">
-                <el-button @click="confirm" type="primary" v-if="btnTxt[1]">{{btnTxt[1]}}</el-button>
-                <el-button @click="cancel" plain>{{btnTxt[0]}}</el-button>
-            </div>
-        </el-dialog>
-    </div>
+  <div v-if="visible">
+    <el-dialog
+      v-dialogDrag
+      :class="className"
+      top="10vh"
+      v-bind="attributes"
+      :visible="visible"
+      :before-close="beClose"
+      append-to-body
+      :close-on-click-modal="false"
+      v-on="on"
+    >
+      <slot v-if="visibleSlot"></slot>
+      <div slot="footer">
+        <el-button @click="confirm" type="primary" v-if="btnTxt[1]">{{
+          btnTxt[1]
+        }}</el-button>
+        <el-button @click="cancel" plain>{{ btnTxt[0] }}</el-button>
+      </div>
+    </el-dialog>
+  </div>
 </template>
 
 <script>
-    export default {
-        inheritAttrs: false,
-        props: {
-            config: Object,
-            autoClose: {
-                type: Boolean,
-                default: true,
-            },
-            beforeClose: {
-                type: Function,
-                default: () => {},
-            },
-            className:{
-                type:String,
-                default:"el-dialog-cus"
-            }
-        },
-        data() {
-            const {
-                top = '20vh', width = '420px', title = '提示', center = false, btnTxt = ["取消", "确定"]
-            } = this.config || {};
-            return {
-                visible: false,
-                attributes: {
-                    top,
-                    width,
-                    title,
-                    center,
-                },
-                btnTxt,
-                on: this.getDialogEvents(),
-                visibleSlot: false,
-            };
-        },
-        methods: {
-            open(ok) {
-                this.ok = ok;
-                this.visible = true;
-                this.visibleSlot = true;
-                this.attributes.title = this.config.title
-                // return this.$nextTick();
-            },
-            cancel() {
-                this.visible = false;
-            },
-            confirm() {
-                let cancel = () => this.cancel();
-                this.ok(cancel);
-                // this.autoClose && cancel();
-            },
+export default {
+  inheritAttrs: false,
+  props: {
+    config: Object,
+    autoClose: {
+      type: Boolean,
+      default: true,
+    },
+    beforeClose: {
+      type: Function,
+      default: () => {},
+    },
+    className: {
+      type: String,
+      default: "el-dialog-cus",
+    },
+  },
+  watch:{
+      visible(val){
+          this.$emit("visibleVal", val);
+      }
+  },
+  data() {
+    const {
+      top = "20vh",
+      width = "420px",
+      title = "提示",
+      center = false,
+      btnTxt = ["取消", "确定"],
+    } = this.config || {};
+    return {
+      visible: false,
+      attributes: {
+        top,
+        width,
+        title,
+        center,
+      },
+      btnTxt,
+      on: this.getDialogEvents(),
+      visibleSlot: false,
+    };
+  },
+  methods: {
+    open(ok) {
+      this.ok = ok;
+      this.visible = true;
+      this.visibleSlot = true;
+      this.attributes.title = this.config.title;
+      
+      // return this.$nextTick();
+    },
+    cancel() {
+      this.visible = false;
+    },
+    confirm() {
+      let cancel = () => this.cancel();
+      this.ok(cancel);
+      // this.autoClose && cancel();
+    },
 
-            beClose(done) {
-                done();
-                this.beforeClose();
-                this.cancel();
-            },
-            getDialogEvents() {
-                // closed: () => this.visibleSlot = false是为了防止弹窗中的内容先于弹窗消失而造成弹窗在关闭时有一个突然向上缩小的情况
-                let {
-                    close
-                } = this.config || {}, events = {
-                    closed: () => this.visibleSlot = false
-                };
+    beClose(done) {
+      done();
+      this.beforeClose();
+      this.cancel();
+    },
+    getDialogEvents() {
+      // closed: () => this.visibleSlot = false是为了防止弹窗中的内容先于弹窗消失而造成弹窗在关闭时有一个突然向上缩小的情况
+      let { close } = this.config || {},
+        events = {
+          closed: () => (this.visibleSlot = false),
+        };
 
-                if (close && typeof close == 'function') {
-                    Object.assign(events, {
-                        close,
-                    })
-                }
+      if (close && typeof close == "function") {
+        Object.assign(events, {
+          close,
+        });
+      }
 
-                return events
-            },
-        },
-    };
+      return events;
+    },
+  },
+};
 </script>
 
 <style lang="scss">
-    .el-dialog-cus {
-        .el-dialog {
-            padding: 8px;
-        }
+.el-dialog-cus {
+  .el-dialog {
+    padding: 8px;
+  }
 
-        .el-dialog__title {
-            font-weight: bold;
-        }
+  .el-dialog__title {
+    font-weight: bold;
+  }
 
-        .el-dialog__header {
-            padding: 20px 0 12px;
-        }
+  .el-dialog__header {
+    padding: 20px 0 12px;
+  }
 
-        .el-dialog__headerbtn {
-            top: 8px;
-            right: 8px;
-        }
+  .el-dialog__headerbtn {
+    top: 8px;
+    right: 8px;
+  }
 
-        .el-dialog__body {
-            padding: 0 24px;
+  .el-dialog__body {
+    padding: 0 24px;
 
-            .el-select {
-                width: 100%;
-            }
-        }
+    .el-select {
+      width: 100%;
+    }
+  }
 
-        .el-dialog__footer {
-            padding: 20px;
+  .el-dialog__footer {
+    padding: 20px;
 
-            .el-button {
-                padding: 8px 20px;
+    .el-button {
+      padding: 8px 20px;
 
-                &+.el-button {
-                    margin-left: 40px;
-                }
+      & + .el-button {
+        margin-left: 40px;
+      }
 
-                &.el-button--primary {
-                    background-color: $menuActiveText;
-                    border-color: #DCDFE6
-                }
+      &.el-button--primary {
+        background-color: $menuActiveText;
+        border-color: #dcdfe6;
+      }
 
-                &.el-button.is-plain:focus,
-                &.el-button.is-plain:hover {
-                    background: #FFF;
-                    border-color: $menuActiveText;
-                    color: $menuActiveText;
-                }
-            }
-        }
+      &.el-button.is-plain:focus,
+      &.el-button.is-plain:hover {
+        background: #fff;
+        border-color: $menuActiveText;
+        color: $menuActiveText;
+      }
     }
+  }
+}
 </style>

+ 23 - 1
src/router/index.js

@@ -242,8 +242,30 @@ export const constantRoutes = [{
         meta: {
           title: '学生错题',
           icon: ''
-        }
+        },
+        children: [{
+          path: 'detail',
+          name: 'stu-detail',
+          component: () => import('@/views/menu6/menu6-2/detail.vue'),
+          meta: {
+            title: '学生错题列表',
+            icon: ''
+          },
+          hidden: true,
+          children: [{
+            path: 'detail2',
+            name: 'stu-detail2',
+            component: () => import('@/views/menu6/menu6-2/detail2.vue'),
+            meta: {
+              title: '学生错题详情',
+              icon: ''
+            },
+            hidden: true
+          }]
+        }]
       },
+
+
       {
         path: 'menu6-3',
         name: 'menu6-3',

+ 291 - 0
src/views/menu6/menu6-2/detail.vue

@@ -0,0 +1,291 @@
+<template>
+  <div class="menu6-2">
+    <cloudSearch :advance="false" @search="getList()" @reset="reset()">
+      <template slot="normal">
+        <div class="cloudSearch-item">
+          <div class="form-label">来源:</div>
+          <el-select
+            v-model="listQuery.src"
+            placeholder="请选择来源"
+            @change="srcChange"
+          >
+            <el-option
+              v-for="item in srcList"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            >
+            </el-option>
+          </el-select>
+        </div>
+      </template>
+    </cloudSearch>
+    <cloudTable
+      :table="dataTable"
+      @refresh-table="getList"
+      @handle="handle"
+      @handleSelectionChange="selRow"
+    >
+      <!-- <template slot="tableBtn">
+        <el-button size="small" @click="batchDel()">批量删除</el-button>
+        <el-button class="add" size="small" @click="add('add')">新增班级</el-button>
+      </template> -->
+    </cloudTable>
+  </div>
+</template>
+
+<script>
+import { WrongApi } from "@/api/wrong";
+
+import { DictsApi } from "@/api/dict";
+import store from "@/store";
+
+export default {
+  name: "menu6-2",
+  metaDataType: ["schools", "grades"],
+  computed: {},
+  data() {
+    return {
+      ctime: "",
+      listQuery: {},
+      num: 10,
+      checked: true,
+      dataTable: {
+        hasSelect: true,
+        columns: [
+          {
+            label: "姓名",
+            prop: "student_name",
+            show: true,
+          },
+          {
+            id: "1",
+            label: "学号",
+            prop: "student_sno",
+            show: true,
+          },
+          {
+            id: "2",
+            label: "错题数",
+            prop: "total_errors",
+            show: true,
+          },
+          {
+            id: "3",
+            label: "作业错题",
+            prop: "work_error_count",
+            show: true,
+          },
+          {
+            id: "4",
+            label: "考试错题",
+            prop: "exam_error_count",
+            show: true,
+          },
+          {
+            id: "5",
+            label: "综合错题率",
+            prop: "error_ratio",
+            show: true,
+          },
+        ],
+        data: [],
+        setColShow: false,
+        btnShow: true,
+        hasOperation: true,
+        operation: {
+          label: "操作",
+          width: "100",
+          className: "",
+          data: [
+            {
+              id: "1",
+              label: "查看",
+              FunName: "handleDetail",
+              size: "mini",
+              show: true,
+            },
+          ],
+        },
+        paginationShow: true,
+        paginationOpt: {
+          pageIndex: 1,
+          pageRows: 10,
+          total: 10,
+        },
+      },
+      dialogType: "",
+      dialogConfig: {
+        top: "20vh",
+        width: "800px",
+        title: "新增班级",
+        center: true,
+        btnTxt: ["取消", "保存"],
+      },
+      dialogForm: {
+        sid: null,
+        gid: null,
+        amount: 1,
+      },
+      gradesBySchool: [],
+      gradesBySchoolF: [],
+      selRows: "",
+    };
+  },
+  created() {
+    debugger;
+    // this.getList();
+  },
+  computed: {
+    srcList() {
+      return [
+        { id: "work", name: "作业" },
+        { id: "exam", name: "考试" },
+      ];
+    },
+  },
+  watch: {
+    ctime: function (val) {
+      if (val instanceof Array) {
+        this.listQuery.created_at = val.join(",");
+      } else {
+        this.listQuery.created_at = "";
+      }
+    },
+  },
+  methods: {
+    getList() {
+      WrongApi.getListS(
+        Object.assign(this.listQuery, {
+          page: this.dataTable.paginationOpt.pageIndex,
+          size: this.dataTable.paginationOpt.pageRows,
+        })
+      ).then((res) => {
+        this.dataTable.data = res.data;
+        this.dataTable.paginationOpt.total = res.total;
+      });
+    },
+    add(type) {
+      if (type == "add") {
+        this.dialogType = "add";
+        this.dialogForm = {};
+      }
+      this.$refs.dialog.open((cancel) => {
+        ClassApi.add(this.dialogForm).then((res) => {
+          this.getList();
+          cancel();
+        });
+      });
+    },
+    async handle(name, index, row) {
+      let _this = this;
+      switch (name) {
+        case "handleDetail":
+            debugger
+          this.$router.push({
+            name: "stu-detail2",
+            query: {
+              id: row.id,
+            },
+          });
+          break;
+        case "handleDel":
+          this.$confirm("此操作将删除班级, 是否继续?", "提示", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning",
+          })
+            .then(() => {
+              ClassApi.del(row.id).then((res) => {
+                this.$message({
+                  type: "success",
+                  message: "删除成功!",
+                });
+                this.getList();
+              });
+            })
+            .catch(() => {
+              this.$message({
+                type: "info",
+                message: "已取消删除",
+              });
+            });
+          break;
+      }
+    },
+    selRow(val) {
+      this.selRows = val.map((item) => item.id).join(",");
+    },
+    batchDel() {
+      if (!this.selRows) {
+        this.$message({
+          message: "请选择需要批量操作的数据!",
+          type: "warning",
+        });
+        return;
+      }
+      this.$confirm("此操作将删除班级, 是否继续?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          ClassApi.del(this.selRows).then((res) => {
+            this.$message({
+              type: "success",
+              message: "删除成功!",
+            });
+            this.getList();
+          });
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已取消删除",
+          });
+        });
+    },
+    beforeClose() {
+      this.resetForm();
+    },
+    resetForm() {},
+    reset() {
+      this.listQuery = {};
+      this.getList();
+      this.gradesBySchoolF = [];
+      this.ctime = "";
+      this.created_at = "";
+      // 这里可以写重置表单的实现
+    },
+    handleChange() {},
+    Schange(e, from) {
+      DictsApi.grades({ sid: e }).then((res) => {
+        this.metaData["grades"] = res.data;
+        if (from == "search") {
+          this.$set(this.listQuery, "cid", "");
+          this.$set(this.listQuery, "cid", "");
+        } else {
+          this.$set(this.dialogForm, "gid", "");
+          this.$set(this.dialogForm, "cid", "");
+        }
+      });
+    },
+    Gchange(e, from) {
+      DictsApi.classes({ gid: e }).then((res) => {
+        this.metaData["classes"] = res.data;
+        if (from == "search") {
+          this.$set(this.listQuery, "cid", "");
+        } else {
+          this.$set(this.dialogForm, "cid", "");
+        }
+      });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.menu6-2 {
+  display: block;
+}
+</style>

+ 301 - 0
src/views/menu6/menu6-2/detail2.vue

@@ -0,0 +1,301 @@
+<template>
+  <div class="menu6-2">
+    <cloudSearch :advance="false" @search="getList()" @reset="reset()">
+      <template slot="normal">
+        <div class="cloudSearch-item">
+          <div class="form-label">学校:</div>
+          <el-select v-model="listQuery.sid" filterable placeholder="请选择学校" @change="Schange($event, 'search')">
+            <el-option v-for="item in metaData['schools']" :key="item.value" :label="item.name" :value="item.id">
+            </el-option>
+          </el-select>
+        </div>
+        <div class="cloudSearch-item">
+          <div class="form-label">年级:</div>
+          <el-select v-model="listQuery.gid" filterable placeholder="请选择年级前先选学校" @change="Gchange($event, 'search')" :disabled="!listQuery.sid">
+            <el-option v-for="item in metaData['grades']" :key="item.value" :label="item.name" :value="item.id">
+            </el-option>
+          </el-select>
+        </div>
+        <div class="cloudSearch-item">
+          <div class="form-label">班级:</div>
+          <el-select v-model="listQuery.cid" filterable placeholder="请选择班级前先选年级" :disabled="!listQuery.gid">
+            <el-option v-for="item in metaData['classes']" :key="item.value" :label="item.name" :value="item.id">
+            </el-option>
+          </el-select>
+        </div>
+        <div class="cloudSearch-item">
+          <div class="form-label" style="width:90px">学生/学号:</div>
+          <el-input v-model="listQuery.op_content" placeholder="请输入学生/学号" size="small"></el-input>
+        </div>
+      </template>
+    </cloudSearch>
+    <cloudTable :table="dataTable" @refresh-table="getList" @handle="handle" @handleSelectionChange="selRow">
+      <!-- <template slot="tableBtn">
+        <el-button size="small" @click="batchDel()">批量删除</el-button>
+        <el-button class="add" size="small" @click="add('add')">新增班级</el-button>
+      </template> -->
+    </cloudTable>
+  </div>
+</template>
+
+<script>
+import { WrongApi } from "@/api/wrong";
+
+import { DictsApi } from "@/api/dict";
+import store from "@/store";
+
+export default {
+  name: "menu6-2",
+  metaDataType: ["schools", "grades"],
+  computed: {},
+  data() {
+    return {
+      ctime: "",
+      listQuery: {
+        // op_user_realname: "",
+        // op_user_name: "",
+        // op_user_ip: "",
+        // op_content: "",
+        // ctime: "",
+      },
+      num: 10,
+      checked: true,
+      dataTable: {
+        hasSelect: true,
+        columns: [
+          {
+            label: "姓名",
+            prop: "student_name",
+            show: true,
+          },
+          {
+            id: "1",
+            label: "学号",
+            prop: "student_sno",
+            show: true,
+          },
+          {
+            id: "2",
+            label: "错题数",
+            prop: "total_errors",
+            show: true,
+          },
+          {
+            id: "3",
+            label: "作业错题",
+            prop: "work_error_count",
+            show: true,
+          },
+          {
+            id: "4",
+            label: "考试错题",
+            prop: "exam_error_count",
+            show: true,
+          },
+          {
+            id: "5",
+            label: "综合错题率",
+            prop: "error_ratio",
+            show: true,
+          },
+        ],
+        data: [],
+        setColShow: false,
+        btnShow: true,
+        hasOperation: true,
+        operation: {
+          label: "操作",
+          width: "100",
+          className: "",
+          data: [
+            {
+              id: "1",
+              label: "查看",
+              FunName: "handleDetail",
+              size: "mini",
+              show: true,
+            },
+          ],
+        },
+        paginationShow: true,
+        paginationOpt: {
+          pageIndex: 1,
+          pageRows: 10,
+          total: 10,
+        },
+      },
+      dialogType: "",
+      dialogConfig: {
+        top: "20vh",
+        width: "800px",
+        title: "新增班级",
+        center: true,
+        btnTxt: ["取消", "保存"],
+      },
+      dialogForm: {
+        sid: null,
+        gid: null,
+        amount: 1,
+      },
+      gradesBySchool: [],
+      gradesBySchoolF: [],
+      selRows: "",
+    };
+  },
+  created() {
+    // this.getList();
+  },
+  watch: {
+    ctime: function (val) {
+      if (val instanceof Array) {
+        this.listQuery.created_at = val.join(",");
+      } else {
+        this.listQuery.created_at = "";
+      }
+    },
+  },
+  methods: {
+    getList() {
+      WrongApi.getListS(
+        Object.assign(this.listQuery, {
+          page: this.dataTable.paginationOpt.pageIndex,
+          size: this.dataTable.paginationOpt.pageRows,
+        })
+      ).then((res) => {
+        this.dataTable.data = res.data;
+        this.dataTable.paginationOpt.total = res.total;
+      });
+    },
+    add(type) {
+      if (type == "add") {
+        this.dialogType = "add";
+        this.dialogForm = {};
+      }
+      this.$refs.dialog.open((cancel) => {
+        ClassApi.add(this.dialogForm).then((res) => {
+          this.getList();
+          cancel();
+        });
+      });
+    },
+    async handle(name, index, row) {
+      let _this = this;
+      switch (name) {
+        case "handleDetail":
+          this.dialogType = "edit";
+          await ClassApi.getDetail(row.id).then((res) => {
+            this.dialogForm = {
+              sid: res.data.school_id,
+              gid: res.data.grade_id,
+              name: res.data.name,
+              id: res.data.id,
+            };
+            this.schoolChange();
+          });
+          await this.$refs.dialog.open((cancel) => {
+            ClassApi.edit(_this.dialogForm).then((res) => {
+              this.getList();
+              cancel();
+            });
+          });
+          break;
+        case "handleDel":
+          this.$confirm("此操作将删除班级, 是否继续?", "提示", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning",
+          })
+            .then(() => {
+              ClassApi.del(row.id).then((res) => {
+                this.$message({
+                  type: "success",
+                  message: "删除成功!",
+                });
+                this.getList();
+              });
+            })
+            .catch(() => {
+              this.$message({
+                type: "info",
+                message: "已取消删除",
+              });
+            });
+          break;
+      }
+    },
+    selRow(val) {
+      this.selRows = val.map((item) => item.id).join(",");
+    },
+    batchDel() {
+      if (!this.selRows) {
+        this.$message({
+          message: "请选择需要批量操作的数据!",
+          type: "warning",
+        });
+        return;
+      }
+      this.$confirm("此操作将删除班级, 是否继续?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          ClassApi.del(this.selRows).then((res) => {
+            this.$message({
+              type: "success",
+              message: "删除成功!",
+            });
+            this.getList();
+          });
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已取消删除",
+          });
+        });
+    },
+    beforeClose() {
+      this.resetForm();
+    },
+    resetForm() {},
+    reset() {
+      this.listQuery = {};
+      this.getList();
+      this.gradesBySchoolF = [];
+      this.ctime = "";
+      this.created_at = "";
+      // 这里可以写重置表单的实现
+    },
+    handleChange() {},
+    Schange(e, from) {
+      DictsApi.grades({ sid: e }).then((res) => {
+        this.metaData["grades"] = res.data;
+        if (from == "search") {
+          this.$set(this.listQuery, "cid", "");
+          this.$set(this.listQuery, "cid", "");
+        } else {
+          this.$set(this.dialogForm, "gid", "");
+          this.$set(this.dialogForm, "cid", "");
+        }
+      });
+    },
+    Gchange(e, from) {
+      DictsApi.classes({ gid: e }).then((res) => {
+        this.metaData["classes"] = res.data;
+        if (from == "search") {
+          this.$set(this.listQuery, "cid", "");
+        } else {
+          this.$set(this.dialogForm, "cid", "");
+        }
+      });
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.menu6-2 {
+  display: block;
+}
+</style>

+ 55 - 24
src/views/menu6/menu6-2/index.vue

@@ -4,32 +4,72 @@
       <template slot="normal">
         <div class="cloudSearch-item">
           <div class="form-label">学校:</div>
-          <el-select v-model="listQuery.sid" filterable placeholder="请选择学校" @change="Schange($event, 'search')">
-            <el-option v-for="item in metaData['schools']" :key="item.value" :label="item.name" :value="item.id">
+          <el-select
+            v-model="listQuery.sid"
+            filterable
+            placeholder="请选择学校"
+            @change="Schange($event, 'search')"
+          >
+            <el-option
+              v-for="item in metaData['schools']"
+              :key="item.value"
+              :label="item.name"
+              :value="item.id"
+            >
             </el-option>
           </el-select>
         </div>
         <div class="cloudSearch-item">
           <div class="form-label">年级:</div>
-          <el-select v-model="listQuery.gid" filterable placeholder="请选择年级前先选学校" @change="Gchange($event, 'search')" :disabled="!listQuery.sid">
-            <el-option v-for="item in metaData['grades']" :key="item.value" :label="item.name" :value="item.id">
+          <el-select
+            v-model="listQuery.gid"
+            filterable
+            placeholder="请选择年级前先选学校"
+            @change="Gchange($event, 'search')"
+            :disabled="!listQuery.sid"
+          >
+            <el-option
+              v-for="item in metaData['grades']"
+              :key="item.value"
+              :label="item.name"
+              :value="item.id"
+            >
             </el-option>
           </el-select>
         </div>
         <div class="cloudSearch-item">
           <div class="form-label">班级:</div>
-          <el-select v-model="listQuery.cid" filterable placeholder="请选择班级前先选年级" :disabled="!listQuery.gid">
-            <el-option v-for="item in metaData['classes']" :key="item.value" :label="item.name" :value="item.id">
+          <el-select
+            v-model="listQuery.cid"
+            filterable
+            placeholder="请选择班级前先选年级"
+            :disabled="!listQuery.gid"
+          >
+            <el-option
+              v-for="item in metaData['classes']"
+              :key="item.value"
+              :label="item.name"
+              :value="item.id"
+            >
             </el-option>
           </el-select>
         </div>
         <div class="cloudSearch-item">
-          <div class="form-label" style="width:90px">学生/学号:</div>
-          <el-input v-model="listQuery.op_content" placeholder="请输入学生/学号" size="small"></el-input>
+          <div class="form-label" style="width: 90px">学生/学号:</div>
+          <el-input
+            v-model="listQuery.op_content"
+            placeholder="请输入学生/学号"
+            size="small"
+          ></el-input>
         </div>
       </template>
     </cloudSearch>
-    <cloudTable :table="dataTable" @refresh-table="getList" @handle="handle" @handleSelectionChange="selRow">
+    <cloudTable
+      :table="dataTable"
+      @refresh-table="getList"
+      @handle="handle"
+      @handleSelectionChange="selRow"
+    >
       <!-- <template slot="tableBtn">
         <el-button size="small" @click="batchDel()">批量删除</el-button>
         <el-button class="add" size="small" @click="add('add')">新增班级</el-button>
@@ -182,21 +222,12 @@ export default {
       let _this = this;
       switch (name) {
         case "handleDetail":
-          this.dialogType = "edit";
-          await ClassApi.getDetail(row.id).then((res) => {
-            this.dialogForm = {
-              sid: res.data.school_id,
-              gid: res.data.grade_id,
-              name: res.data.name,
-              id: res.data.id,
-            };
-            this.schoolChange();
-          });
-          await this.$refs.dialog.open((cancel) => {
-            ClassApi.edit(_this.dialogForm).then((res) => {
-              this.getList();
-              cancel();
-            });
+          debugger
+          this.$router.push({
+            name: "stu-detail",
+            query: {
+              id: row.id,
+            },
           });
           break;
         case "handleDel":

+ 9 - 8
src/views/menu7/menu7-2/index.vue

@@ -48,10 +48,10 @@
         <el-form-item label="角色权限">
           <el-input
             placeholder="请选择"
-            @focus="showPermission=true"
+            @focus="showPermission = true"
           ></el-input>
           <el-tree
-            v-show="showPermission||dialogType=='edit'"
+            v-show="showPermission || dialogType == 'edit'"
             :data="roleList"
             show-checkbox
             default-expand-all
@@ -206,7 +206,6 @@ export default {
             this.dialogType = "edit";
             this.dialogConfig.title = "编辑角色";
             this.open("edit");
-
           });
           break;
         case "handleDel":
@@ -242,16 +241,18 @@ export default {
         this.$refs.dialogAdd.config.title = "新增角色";
       } else {
         this.$refs.dialogAdd.config.title = "编辑角色";
-        this.$refs.ptree.setCheckedKeys(this.form.permission_codes);
+        this.$nextTick(() => {
+          this.$refs.ptree.setCheckedKeys(this.form.permission_codes);
+        });
       }
       this.$refs.dialogAdd.open((cancel) => {
         this.$refs["form"].validate((valid) => {
           if (valid) {
             let selPer = this.$refs.ptree.getCheckedKeys();
-            let selNodes = []
-            this.$refs.ptree.getCheckedNodes().forEach((item)=>{
-              selNodes.push(item.name)
-            })
+            let selNodes = [];
+            this.$refs.ptree.getCheckedNodes().forEach((item) => {
+              selNodes.push(item.name);
+            });
             this.form.permission_codes = selPer.join(",");
             this.form.permission_names = selNodes.join(",");
             if (type == "edit") {