“a307420929” 2 лет назад
Родитель
Сommit
9134a34b27

+ 11 - 1
src/router/index.js

@@ -202,7 +202,7 @@ export const asyncRoutes = [{
         name: 'menu5-1',
         component: () => import('@/views/menu5/menu5-1/index'),
         meta: {
-          title: '试卷管理',
+          title: '作业管理',
           icon: '',
           roles: "menu5.menu5-1"
         }
@@ -218,6 +218,16 @@ export const asyncRoutes = [{
         },
       },
       {
+        path: 'menu5-4',
+        name: 'menu5-4',
+        component: () => import('@/views/menu5/menu5-4/index'),
+        meta: {
+          title: '试卷管理',
+          icon: '',
+          roles: "menu5.menu5-4"
+        },
+      },
+      {
         path: 'menu5-3',
         name: 'menu5-3',
         component: () => import('@/views/menu5/menu5-3/index'),

+ 19 - 17
src/views/menu5/menu5-1/index.vue

@@ -56,18 +56,18 @@
       <cloudSearch :advance="false" @search="getItems()" @reset="reset()">
         <template slot="normal">
           <div class="cloudSearch-item">
-            <div class="form-label">试卷名称:</div>
+            <div class="form-label">作业名称:</div>
             <el-input
               v-model="listQuery.name"
-              placeholder="请输入试卷名称"
+              placeholder="请输入作业名称"
               size="small"
             ></el-input>
           </div>
           <div class="cloudSearch-item">
-            <div class="form-label">试卷编号:</div>
+            <div class="form-label">作业编号:</div>
             <el-input
               v-model="listQuery.pno"
-              placeholder="请输入试卷编号"
+              placeholder="请输入作业编号"
               size="small"
             ></el-input>
           </div>
@@ -77,7 +77,7 @@
         <template slot="tableBtn">
           <el-button size="small" @click="open2()">批量导入</el-button>
           <el-button class="add" size="small" @click="addItems()"
-            >新增试卷</el-button
+            >新增作业</el-button
           >
           <el-button class="add" size="small" @click="paperTemp()"
             >下载试卷模板</el-button
@@ -163,24 +163,24 @@
         label-width="80px"
         :rules="dialogFormRules"
       >
-        <el-form-item label="试卷名称" prop="name">
+        <el-form-item label="作业名称" prop="name">
           <el-input
             v-model="dialogForm.name"
             placeholder="请输入名称"
           ></el-input>
         </el-form-item>
-        <el-form-item label="试卷编号" prop="pno">
+        <el-form-item label="作业编号" prop="pno">
           <el-input
             v-model="dialogForm.pno"
             placeholder="请输入编号"
           ></el-input>
         </el-form-item>
-        <el-form-item label="试卷页数" prop="pages">
+        <el-form-item label="作业页数" prop="pages">
           <el-input-number
             v-model="dialogForm.pages"
             :min="1"
             :max="50"
-            label="试卷页数"
+            label="作业页数"
           ></el-input-number>
         </el-form-item>
         <el-form-item label="试卷大小" prop="size">
@@ -318,21 +318,21 @@ export default {
         columns: [
           {
             id: "0",
-            label: "试卷名称",
+            label: "作业名称",
             prop: "name",
             width: 280,
             show: true,
           },
           {
             id: "1",
-            label: "试卷编号",
+            label: "作业编号",
             prop: "pno",
             width: 180,
             show: true,
           },
           {
             id: "2",
-            label: "试卷页数",
+            label: "作业页数",
             prop: "pages",
             show: true,
           },
@@ -409,7 +409,7 @@ export default {
       dialogConfig1: {
         top: "8vh",
         width: "600px",
-        title: "新增试卷",
+        title: "新增作业",
         center: true,
         btnTxt: ["取消", "保存"],
       },
@@ -424,7 +424,7 @@ export default {
       dialogConfig: {
         top: "8vh",
         width: "600px",
-        title: "新增试卷信息",
+        title: "新增作业信息",
         center: true,
         btnTxt: ["取消", "保存"],
       },
@@ -471,7 +471,7 @@ export default {
       dialogFormRules: {
         name: [{ required: true, message: "请输入名称", trigger: "blur" }],
         pno: [{ required: true, message: "请输入编号", trigger: "blur" }],
-        pages: [{ required: true, message: "请输入试卷页数", trigger: "blur" }],
+        pages: [{ required: true, message: "请输入作业页数", trigger: "blur" }],
         size: [
           { required: true, message: "请输入试卷大小", trigger: "change" },
         ],
@@ -674,6 +674,7 @@ export default {
         ctgid: this.curID,
         page: this.dataTable.paginationOpt.pageIndex,
         size: this.dataTable.paginationOpt.pageRows,
+        ptype:'work'
       };
       paperApi.getPapers(params).then((res) => {
         this.dataTable.data = res.data;
@@ -697,13 +698,14 @@ export default {
         });
         return;
       }
-      this.$refs.dialog.config.title = "新增试卷信息";
+      this.$refs.dialog.config.title = "新增作业信息";
       this.resetForm();
       let that = this;
       let params = {
         ctgid: this.curID,
         ctype: "work",
         imgs: this.dialogForm.imgs,
+        ptype:'work'
       };
       this.$refs.dialog.open((cancel) => {
         this.$refs["dialogForm"].validate((valid) => {
@@ -734,7 +736,7 @@ export default {
           });
           break;
         case "edit":
-          this.$refs.dialog.config.title = "编辑试卷信息";
+          this.$refs.dialog.config.title = "编辑作业信息";
           row.ctype = "work";
           paperApi.getDetail(row).then((res) => {
             this.dialogForm.name = res.data.name;

+ 84 - 18
src/views/menu5/menu5-2/index.vue

@@ -74,14 +74,22 @@
       >
         <template slot="tableBtn">
           <div class="tableInfo">
-            <span>试卷名称:</span><span>{{taskInfo.name}}(T{{taskInfo.id}}-{{taskInfo.pno}})</span>
+            <span>试卷名称:</span
+            ><span
+              >{{ taskInfo.name }}(T{{ taskInfo.id }}-{{ taskInfo.pno }})</span
+            >
+          </div>
+          <div class="tableInfo">
+            <span>学校:</span><span>{{ taskInfo.school_name }}</span>
+          </div>
+          <div class="tableInfo">
+            <span>年级:</span><span>{{ taskInfo.grade_name }}</span>
+          </div>
+          <div class="tableInfo">
+            <span>班级:</span><span>{{ taskInfo.class_name }}</span>
           </div>
-          <div class="tableInfo"><span>学校:</span><span>{{taskInfo.school_name}}</span></div>
-          <div class="tableInfo"><span>年级:</span><span>{{taskInfo.grade_name}}</span></div>
-          <div class="tableInfo"><span>班级:</span><span>{{taskInfo.class_name}}</span></div>
           <div class="previewBox" id="XScannerContainer">
-            
-            <img v-if="imgSrc" style="width:100%" :src="imgSrc" alt="">
+            <img v-if="imgSrc" style="width: 100%" :src="imgSrc" alt="" />
             <div v-else>
               <img
                 style="position: absolute; top: 40%; left: 46%"
@@ -89,14 +97,19 @@
                 alt=""
               />
               <span style="position: absolute; top: 15%; color: #999999"
-              >等待扫描中</span>
+                >等待扫描中</span
+              >
             </div>
           </div>
         </template>
         <template slot="scanStatus" slot-scope="scope">
-          <span v-if="scope.row.status==2" style="color:#2BA245;">已上传</span>
-          <span v-if="scope.row.status==1" style="color:#e6a23c;">上传中...</span>
-          <span v-if="scope.row.status==0">待上传</span>
+          <span v-if="scope.row.status == 2" style="color: #2ba245"
+            >已上传</span
+          >
+          <span v-if="scope.row.status == 1" style="color: #e6a23c"
+            >上传中...</span
+          >
+          <span v-if="scope.row.status == 0">待上传</span>
         </template>
       </cloudTable>
       <div class="newForm" v-if="status == 1">
@@ -182,6 +195,56 @@
               size="small"
             ></el-input>
           </div>
+          <div class="cloudSearch-item">
+            <div class="form-label">学校:</div>
+            <el-select
+              v-model="listQuery.sid"
+              placeholder="请选择学校"
+              @change="Schange"
+            >
+              <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"
+              placeholder="请选择年级"
+              @change="Gchange"
+              :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"
+              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">年份:</div>
             <el-input
@@ -249,13 +312,13 @@ export default {
   computed: {},
   data() {
     return {
-      taskInfo:{
-        id:"",
-        name:"",
-        pno:"",
-        school_name:"",
-        grade_name:"",
-        class_name:""
+      taskInfo: {
+        id: "",
+        name: "",
+        pno: "",
+        school_name: "",
+        grade_name: "",
+        class_name: "",
       },
       status: 0, // 0,列表页,1,新增页,2,打印页
       curID: "0",
@@ -611,7 +674,7 @@ export default {
     },
     back() {
       this.status = 0;
-      this.getTask()
+      this.getTask();
       clearInterval(this.timer);
     },
     addItems() {
@@ -623,12 +686,15 @@ export default {
         this.metaData["grades"] = res.data;
         this.$set(this.newForm, "gid", "");
         this.$set(this.newForm, "cid", "");
+        this.$set(this.listQuery, "gid", "");
+        this.$set(this.listQuery, "cid", "");
       });
     },
     Gchange(e) {
       DictsApi.classes({ gid: e }).then((res) => {
         this.metaData["classes"] = res.data;
         this.$set(this.newForm, "cid", "");
+        this.$set(this.listQuery, "cid", "");
       });
     },
     startScan() {

+ 925 - 0
src/views/menu5/menu5-4/index.vue

@@ -0,0 +1,925 @@
+<template>
+  <el-row class="menu5-1" :gutter="10" v-loading="loading">
+    <!-- <el-col :span="5" class="left"> -->
+      <!-- <el-row :gutter="20">
+        <el-col :span="12">
+          <el-select v-model="leftQuery.period" placeholder="请选择学段">
+            <el-option
+              v-for="item in metaData['periodsR']"
+              :key="item.value"
+              :label="item.name"
+              :value="item.name"
+            ></el-option>
+          </el-select>
+        </el-col>
+        <el-col :span="12">
+          <el-select v-model="leftQuery.subject" placeholder="请选择学科">
+            <el-option
+              v-for="item in metaData['subjectsR']"
+              :key="item.value"
+              :label="item.name"
+              :value="item.name"
+            ></el-option>
+          </el-select>
+        </el-col>
+      </el-row> -->
+      <!-- <el-row style="padding: 20px 6px 0; text-align: right">
+        <el-button class="add" size="small" @click="open1">新增</el-button>
+      </el-row> -->
+      <!-- <div class="tree" ref="tree">
+        <el-tree
+          ref="treeInner"
+          :data="treeData"
+          node-key="id"
+          default-expand-all
+          :expand-on-click-node="false"
+          :highlight-current="true"
+        >
+          <span class="custom-tree-node" slot-scope="{ node, data }">
+            <span @click="getItems(data)">{{ data.name }}</span>
+          </span>
+        </el-tree>
+      </div> -->
+    <!-- </el-col> -->
+    <el-col :span="24" class="right">
+      <cloudSearch :advance="false" @search="getItems()" @reset="reset()">
+        <template slot="normal">
+          <div class="cloudSearch-item">
+            <div class="form-label">试卷名称:</div>
+            <el-input
+              v-model="listQuery.name"
+              placeholder="请输入试卷名称"
+              size="small"
+            ></el-input>
+          </div>
+          <div class="cloudSearch-item">
+            <div class="form-label">试卷编号:</div>
+            <el-input
+              v-model="listQuery.pno"
+              placeholder="请输入试卷编号"
+              size="small"
+            ></el-input>
+          </div>
+        </template>
+      </cloudSearch>
+      <cloudTable :table="dataTable" @refresh-table="getItems" @handle="handle">
+        <template slot="tableBtn">
+          <el-button size="small" @click="open2()">批量导入</el-button>
+          <el-button class="add" size="small" @click="addItems()"
+            >新增试卷</el-button
+          >
+          <el-button class="add" size="small" @click="paperTemp()"
+            >下载试卷模板</el-button
+          >
+        </template>
+        <template v-slot:customOpt="data">
+          <el-button
+            class="operation"
+            :disabled="data.row.cut || data.row.uploaded ? false : true"
+            :style="data.row.cut || data.row.uploaded ? '' : 'color:#E8EBF3'"
+            @click="setScore(data.row)"
+          >
+            设置分值
+          </el-button>
+          <el-upload
+            ref="upload"
+            class="opt"
+            action=""
+            :name="'datafile'"
+            :headers="upHeader"
+            :limit="1"
+            :on-success="handleUploadSuccess"
+            :on-error="handleUploadError"
+            :show-file-list="false"
+            :http-request="clickup"
+          >
+            <el-button
+              size="small"
+              class="operation"
+              @click="setCurRow(data.row)"
+              >上传</el-button
+            >
+          </el-upload>
+
+          <!-- {{data.row}} -->
+        </template>
+      </cloudTable>
+    </el-col>
+    <cloudDialog
+      ref="dialog1"
+      :config="dialogConfig1"
+      :beforeClose="beforeClose1"
+      @close="resetForm1"
+    >
+      <el-form ref="form" :model="dialogForm1" label-width="110px">
+        <el-form-item label="资源分类名称">
+          <el-input
+            v-model="dialogForm1.name"
+            placeholder="请输入名称"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="学段名称">
+          <el-select v-model="dialogForm1.period" placeholder="请选择学段">
+            <el-option
+              v-for="item in metaData['periodsR']"
+              :key="item.value"
+              :label="item.name"
+              :value="item.name"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item label="学科">
+          <el-select v-model="dialogForm1.subject" placeholder="请选择学科">
+            <el-option
+              v-for="item in metaData['subjectsR']"
+              :key="item.value"
+              :label="item.name"
+              :value="item.name"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+      </el-form>
+    </cloudDialog>
+    <cloudDialog
+      ref="dialog"
+      :config="dialogConfig"
+      :beforeClose="beforeClose"
+      @close="resetForm"
+    >
+      <el-form
+        ref="dialogForm"
+        :model="dialogForm"
+        label-width="80px"
+        :rules="dialogFormRules"
+      >
+        <el-form-item label="试卷名称" prop="name">
+          <el-input
+            v-model="dialogForm.name"
+            placeholder="请输入名称"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="试卷编号" prop="pno">
+          <el-input
+            v-model="dialogForm.pno"
+            placeholder="请输入编号"
+          ></el-input>
+        </el-form-item>
+        <el-form-item label="试卷页数" prop="pages">
+          <el-input-number
+            v-model="dialogForm.pages"
+            :min="1"
+            :max="50"
+            label="试卷页数"
+          ></el-input-number>
+        </el-form-item>
+        <el-form-item label="试卷大小" prop="size">
+          <el-select v-model="dialogForm.size" placeholder="请选择试卷大小">
+            <el-option
+              v-for="item in ['A3', 'A4']"
+              :key="item"
+              :label="item"
+              :value="item"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <!-- 
+        <el-form-item label="年份">
+          <el-date-picker v-model="dialogForm.year" type="year" value-format="yyyy" placeholder="请输入年份">
+          </el-date-picker>
+        </el-form-item>-->
+
+        <!-- <el-form-item label="试卷图片" prop="imgs">
+          <el-upload
+            class="avatar-uploader"
+            multiple
+            list-type="picture-card"
+            action="/v1/common/upfile"
+            :name="'datafile'"
+            :headers="upHeader"
+            :on-success="handleAvatarSuccess"
+            :file-list="this.dialogForm.imgs"
+          >
+            <i slot="default" class="el-icon-plus"></i>
+            <div slot="file" slot-scope="{ file }">
+              <img class="el-upload-list__item-thumbnail" :src="file.url" alt />
+              <span class="el-upload-list__item-actions">
+                <span
+                  v-if="!disabled"
+                  class="el-upload-list__item-delete"
+                  @click="handleRemove(file, dialogForm.imgs)"
+                >
+                  <i class="el-icon-delete"></i>
+                </span>
+              </span>
+            </div>
+          </el-upload>
+        </el-form-item> -->
+      </el-form>
+    </cloudDialog>
+    <cloudDialog
+      ref="dialog2"
+      :config="dialogConfig2"
+      :beforeClose="beforeClose2"
+      @close="resetForm2"
+    >
+      <span>
+        请先下载任务模板,按模板格式填充数据然后上传。
+        <a href="###" style="color: #429fff">点击下载模板</a>
+      </span>
+      <el-upload
+        class="upload-demo"
+        action="https://jsonplaceholder.typicode.com/posts/"
+        :on-preview="handlePreview"
+        :before-remove="beforeRemove"
+        multiple
+        :limit="3"
+        :on-exceed="handleExceed"
+        :file-list="this.fileList"
+      >
+        <el-button size="small" type="primary">选择文件</el-button>
+      </el-upload>
+    </cloudDialog>
+    <cloudDialog
+      className="queDialog"
+      ref="dialog3"
+      :config="dialogConfig3"
+      :beforeClose="beforeClose3"
+      @close="resetForm3"
+    >
+      <div class="ques" v-for="(item, index) in dialog3Content">
+        <span v-exchangeHtml:foo="item.tx"></span>
+        <span v-exchangeHtml:foo="item.tg"></span>
+        <span v-exchangeHtml:foo="item.da"></span>
+        <span v-exchangeHtml:foo="item.zsd"></span>
+        <span v-exchangeHtml:foo="item.nd"></span>
+        <span v-exchangeHtml:foo="item.jx"></span>
+      </div>
+    </cloudDialog>
+    <cloudDialog ref="dialog4" :config="dialogConfig4">
+      <div style="margin-bottom: 30px">
+        检测到未下载安装客户端,请点击以下链接下载客户端并安装
+      </div>
+      <div>
+        <a
+          style="color: #6195e0"
+          :href="'http://osscache.scxjc.club/static/say365/Say365Scanner.exe'"
+          >下载客户端</a
+        >
+      </div>
+    </cloudDialog>
+  </el-row>
+</template>
+
+<script>
+import { resourceApi } from "@/api/resource";
+import { paperApi } from "@/api/paper";
+import axios from "axios";
+import Clickoutside from "element-ui/src/utils/clickoutside";
+export default {
+  name: "menu5-1",
+  metaDataType: ["periodsR", "subjectsR", "regions"],
+  directives: { Clickoutside },
+  computed: {},
+  data() {
+    var token = this.Cookies.get("www-authenticate");
+    return {
+      queDialog: "queDialog",
+      loading: false,
+      curID: "0",
+      curTree: {},
+      curRow: {},
+      leftQuery: {
+        ctype: "work",
+        period: "",
+        subject: "",
+      },
+      listQuery: {
+        name: "",
+        pno: "",
+      },
+      treeData: [],
+      dataTable: {
+        loading: false,
+        hasSelect: true,
+        columns: [
+          {
+            id: "0",
+            label: "试卷名称",
+            prop: "name",
+            width: 280,
+            show: true,
+          },
+          {
+            id: "1",
+            label: "试卷编号",
+            prop: "pno",
+            width: 180,
+            show: true,
+          },
+          {
+            id: "2",
+            label: "试卷页数",
+            prop: "pages",
+            show: true,
+          },
+          {
+            id: "3",
+            label: "满分",
+            prop: "score",
+            show: true,
+          },
+          {
+            id: "4",
+            label: "标准卷上传状态",
+            prop: "uploaded",
+            show: true,
+            filter: "boolean",
+          },
+          {
+            id: "5",
+            label: "标准卷切割状态",
+            prop: "cut",
+            show: true,
+            filter: "boolean",
+          },
+          {
+            id: "6",
+            label: "电子版试卷上传状态",
+            prop: "attached",
+            show: true,
+            filter: "boolean",
+          },
+        ],
+        data: [],
+        setColShow: false,
+        btnShow: true,
+        hasOperation: true,
+        operation: {
+          label: "操作",
+          width: "280",
+          data: [
+            {
+              id: "1",
+              label: "切割",
+              FunName: "cutPaper",
+              size: "mini",
+              show: true,
+            },
+            {
+              id: "2",
+              label: "编辑",
+              FunName: "edit",
+              size: "mini",
+            },
+            {
+              id: "3",
+              label: "删除",
+              FunName: "del",
+              size: "mini",
+            },
+            // {
+            //   id: "4",
+            //   label: "设置分值",
+            //   FunName: "setScore",
+            //   size: "mini",
+            // },
+          ],
+        },
+        paginationShow: true,
+        paginationOpt: {
+          pageIndex: 1,
+          pageRows: 10,
+          total: 10,
+        },
+      },
+      dialogConfig1: {
+        top: "8vh",
+        width: "600px",
+        title: "新增试卷",
+        center: true,
+        btnTxt: ["取消", "保存"],
+      },
+      dialogForm1: {
+        ctype: "work",
+        name: "",
+        pid: 0,
+        period: "",
+        subject: "",
+      },
+      // 新增资源
+      dialogConfig: {
+        top: "8vh",
+        width: "600px",
+        title: "新增试卷信息",
+        center: true,
+        btnTxt: ["取消", "保存"],
+      },
+      dialogForm: {
+        name: "",
+        year: "",
+        pno: "",
+        pages: 0,
+        size: "",
+        imgs: [],
+      },
+      fileList: [],
+      dialogImageUrl: "",
+      dialogVisible: false,
+      disabled: false,
+
+      imageUrl: "",
+      upHeader: {
+        Authorization: `Bearer ${token}`,
+      },
+      dialogConfig2: {
+        top: "20vh",
+        width: "600px",
+        title: "批量导入任务",
+        center: true,
+        btnTxt: ["取消", "保存"],
+      },
+      dialogConfig3: {
+        top: "0px",
+        width: "1000px",
+        title: "电子版试卷预览",
+        center: true,
+        btnTxt: ["取消", "保存"],
+      },
+      dialog3Content: [],
+      dialogConfig4: {
+        top: "20vh",
+        width: "600px",
+        title: "请下载客户端",
+        center: true,
+        btnTxt: ["取消"],
+      },
+
+      dialogFormRules: {
+        name: [{ required: true, message: "请输入名称", trigger: "blur" }],
+        pno: [{ required: true, message: "请输入编号", trigger: "blur" }],
+        pages: [{ required: true, message: "请输入试卷页数", trigger: "blur" }],
+        size: [
+          { required: true, message: "请输入试卷大小", trigger: "change" },
+        ],
+        imgs: [
+          { required: true, message: "请输入试卷图片", trigger: "change" },
+        ],
+      },
+    };
+  },
+  watch: {
+    leftQuery: {
+      deep: true,
+      handler: function (newV, oldV) {
+        if (newV.period && newV.subject) {
+          this.getTree();
+        }
+      },
+    },
+    "metaData.periodsR": {
+      deep: true,
+      handler: function (newV, oldV) {
+        if (newV && newV.length > 0) {
+          this.leftQuery.period = newV[0].name;
+        }
+      },
+    },
+    "metaData.subjectsR": {
+      deep: true,
+      handler: function (newV, oldV) {
+        if (newV && newV.length > 0) {
+          this.leftQuery.subject = newV[0].name;
+        }
+      },
+    },
+  },
+  created() {},
+  mounted() {
+    // this.getTree();
+    // let that = this;
+    // this.$refs.tree.addEventListener("click", function (e) {
+    //   that.getItems();
+    //   that.curID = 0;
+    //   that.$refs.treeInner.setCurrentKey(null);
+    // });
+  },
+  methods: {
+    getTree() {
+      resourceApi.getCategories(this.leftQuery).then((res) => {
+        if (res.mess == "success") {
+          this.treeData = res.data;
+          this.getItems(this.treeData);
+        }
+      });
+    },
+    open1() {
+      this.$refs.dialog1.open((cancel) => {
+        resourceApi.add(this.dialogForm1).then((res) => {
+          if (res.mess == "success") {
+            this.getTree();
+            cancel();
+          }
+        });
+      });
+    },
+    open2() {
+      this.$refs.dialog2
+        .open((cancel) => {
+          // cancel();
+          console.log("点击提交按钮了");
+        })
+        .then(() => {
+          console.log(this.$refs.span);
+        }); //这里就充分利用了open方法中返回的nextTick
+    },
+    setCurRow(curRow) {
+      this.curRow = curRow;
+    },
+    open3() {
+      let _this = this;
+      this.$refs.dialog3.open((cancel) => {
+        cancel();
+        console.log(_this.curRow);
+        let params = {
+          // id:_this.curRow.id,
+          pid: _this.curRow.id,
+          pno: _this.curRow.pno,
+          ques: _this.dialog3Content,
+        };
+        paperApi.saveDocss(params).then((res) => {
+          if (res.mess == "success") {
+            this.$message({
+              type: "success",
+              message: "导入试题成功!",
+            });
+            this.getTree();
+            cancel();
+          }
+        });
+        // console.log("点击提交按钮了");
+      });
+    },
+    open4() {
+      this.$refs.upload.clearFiles();
+      this.$refs.dialog4.open((cancel) => {
+        // cancel();
+        console.log("点击提交按钮了");
+      });
+    },
+    beforeClose1() {},
+    beforeClose() {
+      console.log("关闭前");
+    },
+    beforeClose2() {
+      console.log("关闭前");
+    },
+    beforeClose3() {
+      console.log("关闭前");
+    },
+    resetForm1() {
+      // 这里可以写重置表单的实现
+    },
+    resetForm() {
+      this.dialogForm.name = "";
+      this.dialogForm.pno = "";
+      this.dialogForm.pages = "";
+      this.dialogForm.imgs = [];
+      // 这里可以写重置表单的实现
+    },
+    resetForm2() {
+      // 这里可以写重置表单的实现
+    },
+    resetForm3() {
+      // 这里可以写重置表单的实现
+    },
+    handleRemove(file, fileList) {
+      this.dialogForm.imgs = this.dialogForm.imgs.filter(
+        (item) => item.uid !== file.uid
+      );
+      debugger;
+    },
+    reset() {
+      this.ctime = "";
+      this.listQuery = {
+        name: "",
+        pno: "",
+      };
+      this.leftQuery.period = "高中";
+      this.leftQuery.subject = "语文";
+      this.curID = 0;
+      this.getItems();
+      this.$refs.treeInner.setCurrentKey(null);
+    },
+    handlePreview(file) {
+      console.log(file);
+    },
+    handleExceed(files, fileList) {
+      this.$message.warning(
+        `当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${
+          files.length + fileList.length
+        } 个文件`
+      );
+    },
+    beforeRemove(file, fileList) {
+      return this.$confirm(`确定移除 ${file.name}?`);
+    },
+    handleCheckChange(data, e1, e2) {},
+    remove(node, data) {
+      let params = {
+        id: data.id,
+        ctype: "work",
+      };
+      resourceApi.del(params).then((res) => {
+        this.getTree();
+      });
+    },
+    edit(node, data) {
+      this.dialogForm1 = data;
+      this.dialogForm1.ctype = "work";
+      this.$refs.dialog1.open((cancel) => {
+        resourceApi.edit(this.dialogForm1).then((res) => {
+          if (res.mess == "success") {
+            this.getTree();
+            cancel();
+          }
+        });
+      });
+    },
+    append(data) {
+      this.dialogForm1 = {};
+      this.dialogForm1.pid = data.id;
+      this.dialogForm1.ctype = "work";
+      this.open1(data);
+    },
+    getItems(data) {
+      this.curID = data ? data.id : "0";
+      this.curTree = data ? data : {};
+      let params = {
+        name: this.listQuery.name,
+        pno: this.listQuery.pno,
+        ctgid: this.curID,
+        page: this.dataTable.paginationOpt.pageIndex,
+        size: this.dataTable.paginationOpt.pageRows,
+        ptype:'exam'
+      };
+      paperApi.getPapers(params).then((res) => {
+        this.dataTable.data = res.data;
+        this.dataTable.paginationOpt.total = res.total;
+      });
+    },
+    handleAvatarSuccess(response, file, fileList) {
+      this.dialogForm.imgs.push(response.data);
+    },
+    handleUploadSuccess(response) {
+      this.$refs.upload.clearFiles();
+    },
+    handleUploadError(response) {
+      debugger;
+    },
+    addItems() {
+      // if (!+this.curID) {
+      //   this.$message({
+      //     type: "error",
+      //     message: "请先选择左侧的分类",
+      //   });
+      //   return;
+      // }
+      this.$refs.dialog.config.title = "新增试卷信息";
+      this.resetForm();
+      let that = this;
+      let params = {
+        ctgid: 0,
+        ctype: "exam",
+        ptype:'exam'
+        // imgs: this.dialogForm.imgs,
+      };
+      this.$refs.dialog.open((cancel) => {
+        this.$refs["dialogForm"].validate((valid) => {
+          if (valid) {
+            paperApi.add(Object.assign(params, that.dialogForm)).then((res) => {
+              this.dataTable.data = res.data;
+              this.getItems(that.curTree);
+              cancel();
+            });
+          } else {
+            return false;
+          }
+        });
+      });
+    },
+    paperTemp() {
+      var link = document.createElement("a");
+      link.href =
+        "http://osscache.scxjc.club/static/say365/eques_template.docx";
+      link.click();
+    },
+    handle(name, index, row) {
+      switch (name) {
+        case "cutPaper":
+          this.$router.push({
+            path: "cutPage",
+            query: { paperId: row.id },
+          });
+          break;
+        case "edit":
+          this.$refs.dialog.config.title = "编辑试卷信息";
+          row.ctype = "work";
+          paperApi.getDetail(row).then((res) => {
+            this.dialogForm.name = res.data.name;
+            this.dialogForm.pno = res.data.pno;
+            this.dialogForm.id = res.data.id;
+            // this.dialogForm.imgs = res.data.imgs.map((item) => {
+            //   return {
+            //     url: item,
+            //   };
+            // });
+            this.dialogForm.pages = res.data.pages;
+            this.$refs.dialog.open((cancel) => {
+              this.dialogForm.ctype = "work";
+              this.dialogForm.ctgid = res.data.category_id;
+              // this.dialogForm.imgs = this.dialogForm.imgs.map((item) =>
+              //   item.url ? item.url : item
+              // );
+              this.$refs["dialogForm"].validate((valid)=>{
+                if(valid){
+                  paperApi.edit(this.dialogForm).then((res) => {
+                    if(res.mess=="success"){
+                      this.$message({
+                        type:"success",
+                        message:"修改成功"
+                      })
+                      this.getItems(this.curTree);
+                      cancel();
+                    }else{
+                      Message({
+                        type:"error",
+                        message:res.message
+                      })
+                    }
+                  });
+                }
+              })
+            });
+          });
+          break;
+        case "del":
+          this.$confirm("此操作将删除试卷, 是否继续?", "提示", {
+            confirmButtonText: "确定",
+            cancelButtonText: "取消",
+            type: "warning",
+          })
+            .then(() => {
+              paperApi.del(row.id).then((res) => {
+                this.$message({
+                  type: "success",
+                  message: "删除成功!",
+                });
+                this.getItems(this.curTree);
+              });
+            })
+            .catch(() => {
+              this.$message({
+                type: "info",
+                message: "已取消删除",
+              });
+            });
+          break;
+      }
+    },
+    setScore(row) {
+      this.$router.push({
+        path: "scorePage",
+        query: { paperId: row.id },
+      });
+    },
+    clickup(params) {
+      this.dataTable.loading = true;
+      var formData = new FormData();
+      formData.append("file", params.file);
+      // let fileList = new FormData();
+      var token = this.Cookies.get("www-authenticate");
+      axios({
+        url: "http://127.0.0.1:19882/parsedocx.aspx",
+        // url: "http://10.10.153.242:19882/parsedocx.aspx",
+        method: "post",
+        data: formData,
+        headers: {
+          Authorization: `Bearer ${token}`,
+        },
+      })
+        .then((res) => {
+          this.dataTable.loading = false;
+          this.open3();
+          this.dialog3Content = res.data;
+          this.$refs.upload.clearFiles();
+        })
+        .catch((err) => {
+          this.loading = false;
+          this.open4();
+        });
+    },
+    handlePictureCardPreview(file) {
+      this.dialogImageUrl = file.url;
+      this.dialogVisible = true;
+    },
+    handleSuccess(event, file, fileList) {
+      debugger;
+    },
+    getHtml(desc) {
+      var temp = document.createElement("div");
+
+      temp.innerHTML = desc;
+
+      var output = temp.innerText || temp.textContent;
+
+      temp = null;
+
+      return output;
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.menu5-1 {
+  display: block;
+
+  .left {
+    padding: 30px 0;
+    margin-bottom: 20px;
+    border-right: 1px solid #ededed;
+
+    .tree {
+      height: 600px;
+      width: 100%;
+      margin: 14px 0;
+
+      .el-button {
+        color: $menuActiveText;
+      }
+    }
+  }
+}
+
+.custom-tree-node {
+  flex: 1;
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  font-size: 14px;
+  padding-right: 8px;
+  span {
+    &:first-child {
+      flex-grow: 0;
+      flex-shrink: 0;
+      width: 166px;
+      overflow: hidden;
+      white-space: nowrap;
+      text-overflow: ellipsis;
+    }
+  }
+}
+
+.bg-purple {
+  background: #d3dce6;
+}
+
+.bg-purple-light {
+  background: #e5e9f2;
+}
+.avatar-uploader .el-upload {
+  border: 1px dashed #d9d9d9;
+  border-radius: 6px;
+  cursor: pointer;
+  position: relative;
+  overflow: hidden;
+}
+.avatar-uploader .el-upload:hover {
+  border-color: #409eff;
+}
+.avatar-uploader-icon {
+  font-size: 28px;
+  color: #8c939d;
+  width: 178px;
+  height: 178px;
+  line-height: 178px;
+  text-align: center;
+}
+.avatar {
+  width: 178px;
+  height: 178px;
+  display: block;
+}
+.opt {
+  display: inline-flex;
+  margin-left: 10px;
+}
+</style>
+<style lang="scss">
+.queDialog {
+  .el-dialog__body {
+    height: 500px;
+    overflow-y: scroll;
+  }
+}
+</style>

+ 2 - 1
vue.config.js

@@ -30,7 +30,8 @@ module.exports = {
         proxy: {
             "/": {
                 // target: "http://47.108.130.28:8000",
-                target: "http://192.168.117.131:8000",
+                target: "http://10.10.153.242:8000",
+                // target: "http://192.168.192.131:8000",
                 // target: "http://47.104.213.35",
                 changeOrigin: true,
                 // ws: true,//websocket支持