dedsudiyu 1 week ago
parent
commit
b431a2f149

+ 2 - 0
package.json

@@ -38,6 +38,7 @@
   "dependencies": {
     "@jiaminghi/data-view": "^2.10.0",
     "@riophae/vue-treeselect": "0.4.0",
+    "@tinymce/tinymce-vue": "^3.2.8",
     "@vue-office/docx": "^1.6.0",
     "@vue-office/excel": "^1.7.6",
     "@vue-office/pdf": "^1.6.5",
@@ -73,6 +74,7 @@
     "sortablejs": "1.10.2",
     "spark-md5": "^3.0.1",
     "three": "^0.148.0",
+    "tinymce": "^6.0.0",
     "vue": "2.6.12",
     "vue-count-to": "1.0.13",
     "vue-cropper": "^0.5.5",

+ 2 - 1
src/views/safetyEducationExaminationNew/courseManagement/courseManagement/addPage.vue

@@ -106,7 +106,8 @@
       .top-1-p{
         flex:1;
         line-height:60px;
-        font-size:18px;
+        font-size:16px;
+        font-weight:700;
       }
       .top-2-p{
         height:35px;

+ 2 - 1
src/views/safetyEducationExaminationNew/courseManagement/coursewareManagement/addPage.vue

@@ -522,7 +522,8 @@
       .top-1-p{
         flex:1;
         line-height:60px;
-        font-size:18px;
+        font-size:16px;
+        font-weight:700;
       }
       .top-2-p{
         height:35px;

+ 9 - 7
src/views/safetyEducationExaminationNew/examManagement/examinationArrange/index.vue

@@ -86,18 +86,18 @@
       <div class="page-content-box">
         <el-table class="table-box" v-loading="loading" border :data="dataList">
           <el-table-column label="考试名称" prop="name"  show-overflow-tooltip/>
-          <el-table-column label="考试类型" prop="content" width="200" show-overflow-tooltip/>
-          <el-table-column label="专业类别" prop="content" width="200" show-overflow-tooltip/>
-          <el-table-column label="是否共享" prop="content" width="200" show-overflow-tooltip/>
+          <el-table-column label="考试类型" prop="content" width="140" show-overflow-tooltip/>
+          <el-table-column label="专业类别" prop="content" width="140" show-overflow-tooltip/>
+          <el-table-column label="是否共享" prop="content" width="120" show-overflow-tooltip/>
           <el-table-column label="考试时间" prop="createTime" width="200" show-overflow-tooltip>
             <template slot-scope="scope">
               <span>{{parseTime(scope.row.createTime,"{y}-{m}-{d} {h}:{i}")}}至{{parseTime(scope.row.createTime,"{y}-{m}-{d} {h}:{i}")}}</span>
             </template>
           </el-table-column>
-          <el-table-column label="可考次数" prop="content" width="200" show-overflow-tooltip/>
-          <el-table-column label="考试范围" prop="content" width="200" show-overflow-tooltip/>
+          <el-table-column label="可考次数" prop="content" width="120" show-overflow-tooltip/>
+          <el-table-column label="考试范围" prop="content" width="140" show-overflow-tooltip/>
           <el-table-column label="状态" prop="content" width="200" show-overflow-tooltip/>
-          <el-table-column label="操作" width="200" show-overflow-tooltip v-if="tableButtonType">
+          <el-table-column label="操作" width="200" show-overflow-tooltip>
             <template slot-scope="scope">
               <div class="table-button-box">
                 <p class="table-button-null"></p>
@@ -153,7 +153,9 @@
         //页面遮罩
         loading:false,
         //下拉列表数据
-        optionList:[{value:true,label:'启用'},{value:false,label:'停用'}],
+        optionListA:[],
+        optionListB:[],
+        optionListC:[],
         //查询条件
         queryParams:{
           page:1,

+ 89 - 45
src/views/safetyEducationExaminationNew/examManagement/examinationResult/index.vue

@@ -6,23 +6,49 @@
         <el-form :model="queryParams" class="form-box" ref="queryForm"
                  :inline="true" style="width:100%;">
           <el-form-item label="" prop="queryParamsData1">
-            <el-input
-              maxLength="30"
-              v-model="queryParams.queryParamsData1"
-              placeholder="请输入"
-              style="width: 200px"
-            />
+            <el-select v-model="queryParams.queryParamsData1" placeholder="学年" style="width: 140px">
+              <el-option
+                v-for="dict in optionListA"
+                :key="dict.id"
+                :label="dict.disciplineName"
+                :value="dict.id"
+              />
+            </el-select>
           </el-form-item>
           <el-form-item label="" prop="queryParamsData2">
-            <el-select v-model="queryParams.queryParamsData2" placeholder="请选择" style="width: 200px">
+            <el-select v-model="queryParams.queryParamsData2" placeholder="学院单位" style="width: 140px">
               <el-option
-                v-for="dict in optionList"
-                :key="dict.value"
-                :label="dict.label"
-                :value="dict.value"
+                v-for="dict in optionListB"
+                :key="dict.deptId"
+                :label="dict.deptName"
+                :value="dict.deptId"
               />
             </el-select>
           </el-form-item>
+          <el-form-item label="" prop="queryParamsData3">
+            <el-select v-model="queryParams.queryParamsData3" placeholder="考试类型" style="width: 160px">
+              <el-option
+                v-for="dict in optionListC"
+                :key="dict.id"
+                :label="dict.examTypeName"
+                :value="dict.id"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="" prop="queryParamsData4">
+            <el-select v-model="queryParams.queryParamsData4" placeholder="是否补考" style="width: 140px">
+              <el-option label="补考" value="1"/>
+              <el-option label="不补考" value="2"/>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="" prop="queryParamsData5">
+            <el-input
+              maxLength="30"
+              v-model="queryParams.queryParamsData5"
+              placeholder="考试名称"
+              style="width: 200px"
+            />
+          </el-form-item>
           <el-form-item label="" prop="state">
             <el-date-picker
               :clearable="false"
@@ -38,6 +64,9 @@
           </el-form-item>
           <p class="page-inquire-common-style-button" @click="handleQuery">查询</p>
           <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
+          <el-form-item style="float: right;">
+            <export-component :exportConfig="exportConfig"></export-component>
+          </el-form-item>
           <p class="page-submit-common-style-button"
              style="float: right;"
              @click="tableButton(1)"
@@ -47,45 +76,27 @@
       </div>
       <div class="page-content-box">
         <el-table class="table-box" v-loading="loading" border :data="dataList">
-          <el-table-column label="名称" prop="name"  show-overflow-tooltip/>
-          <el-table-column label="内容" prop="content" width="200" show-overflow-tooltip/>
-          <el-table-column label="状态" prop="state" width="100" show-overflow-tooltip>
-            <template slot-scope="scope">
-              <el-switch
-                @click.native="tableButton(5,scope.row)"
-                class="switch captcha-img"
-                :active-value="true"
-                :inactive-value="false"
-                active-color="#0183FA"
-                inactive-color="#999"
-                v-model="scope.row.state"
-                active-text="启用"
-                inactive-text="停用"
-                disabled
-              ></el-switch>
-            </template>
-          </el-table-column>
+          <el-table-column label="考试名称" prop="name"  show-overflow-tooltip/>
+          <el-table-column label="考试类型" prop="content" width="200" show-overflow-tooltip/>
           <el-table-column label="创建时间" prop="createTime" width="200" show-overflow-tooltip>
             <template slot-scope="scope">
-              <span>{{ parseTime(scope.row.createTime,"{y}-{m}-{d} {h}:{i}") }}</span>
+              <span>{{ parseTime(scope.row.createTime,"{y}-{m}-{d} {h}:{i}") }}至{{ parseTime(scope.row.createTime,"{y}-{m}-{d} {h}:{i}") }}</span>
             </template>
           </el-table-column>
-          <el-table-column label="操作" width="200" show-overflow-tooltip v-if="tableButtonType">
+          <el-table-column label="参加人数" prop="content" width="200" show-overflow-tooltip/>
+          <el-table-column label="合格人数" prop="content" width="200" show-overflow-tooltip/>
+          <el-table-column label="缺考人数" prop="content" width="200" show-overflow-tooltip/>
+          <el-table-column label="补考人数" prop="content" width="200" show-overflow-tooltip/>
+          <el-table-column label="操作" width="200" show-overflow-tooltip>
             <template slot-scope="scope">
               <div class="table-button-box">
                 <p class="table-button-null"></p>
                 <p class="table-button-p"
                    @click="tableButton(2,scope.row)"
-                   v-hasPermiRouter="['demo:demo:detail']"
-                >详情</p>
+                >查看成绩</p>
                 <p class="table-button-p"
                    @click="tableButton(3,scope.row)"
-                   v-hasPermiRouter="['demo:demo:edit']"
-                >编辑</p>
-                <p class="table-button-p"
-                   @click="tableButton(4,scope.row)"
-                   v-hasPermiRouter="['demo:demo:del']"
-                >删除</p>
+                >学习情况</p>
                 <p class="table-button-null"></p>
               </div>
             </template>
@@ -108,11 +119,13 @@
   //import { systemUserSelect } from "@/api/commonality/permission";
   //import { getInfo } from "@/api/basicsModules/index";
   //import addPage from "./addPage.vue";
+  import { examElExamTypeList,systemDeptCurrentDept, } from "@/api/safetyEducationExaminationNew/index";
+  import exportComponent from "@/components/exportComponent/exportComponent.vue";
   export default {
     name: 'index',
-    //components: {
-    //  addPage
-    //},
+    components: {
+      exportComponent,
+    },
     data () {
       return {
         tableButtonType:this.hasPermiDom(['demo:demo:detail','demo:demo:edit','demo:demo:del',]),
@@ -121,13 +134,18 @@
         //页面遮罩
         loading:false,
         //下拉列表数据
-        optionList:[{value:true,label:'启用'},{value:false,label:'停用'}],
+        optionListA:[],
+        optionListB:[],
+        optionListC:[],
         //查询条件
         queryParams:{
           page:1,
           pageSize:20,
-          queryParamsData1:"",
+          queryParamsData1:null,
           queryParamsData2 :null,
+          queryParamsData3 :null,
+          queryParamsData4 :null,
+          queryParamsData5 :'',
         },
         //时间数据
         dateRange:[],
@@ -137,6 +155,15 @@
         total:0,
         //组件传参
         propsData:{},
+        //导出配置
+        exportConfig:{
+          api:'system/user/student/export',              //导出接口地址
+          ids:'',                                        //勾选导出,勾选的IDS
+          fileName:'导出文件名',                         //导出文件的命名
+          customKey:null,                                //自定义参数KEY(非必填)
+          customValue:null,                               //自定义参数VALUE(非必填)
+          screenData:{}                                  //导出筛选数据(非必要-如有该参数组件会显示导出筛选数据按钮)
+        },
       }
     },
     created () {
@@ -144,6 +171,8 @@
     },
     mounted () {
       //this.getList();
+      this.examElExamTypeList();
+      this.systemDeptCurrentDept();
     },
     methods: {
       //查询按钮
@@ -157,8 +186,11 @@
         this.$set(this,'queryParams',{
           page:1,
           pageSize:20,
-          queryParamsData1:"",
+          queryParamsData1:null,
           queryParamsData2 :null,
+          queryParamsData3 :null,
+          queryParamsData4 :null,
+          queryParamsData5 :'',
         });
         this.getList();
       },
@@ -231,6 +263,18 @@
           this.getList();
         }
       },
+      //查询全部考试类型
+      examElExamTypeList(){
+        examElExamTypeList({}).then(response => {
+          this.$set(this,'optionListC',response.data);
+        });
+      },
+      //学院列表
+      systemDeptCurrentDept(){
+        systemDeptCurrentDept({}).then(response => {
+          this.$set(this,'optionListB',response.data);
+        });
+      },
     },
   }
 </script>

+ 110 - 20
src/views/safetyEducationExaminationNew/examManagement/testPaperManagement/index.vue

@@ -6,29 +6,78 @@
         <el-form :model="queryParams" class="form-box" ref="queryForm"
                  :inline="true" style="width:100%;">
           <el-form-item label="" prop="queryParamsData1">
-            <el-input
-              maxLength="30"
-              v-model="queryParams.queryParamsData1"
-              placeholder="请输入"
-              style="width: 200px"
-            />
+            <el-select v-model="queryParams.queryParamsData1" placeholder="学院单位" style="width: 140px">
+              <el-option
+                v-for="dict in optionListA"
+                :key="dict.deptId"
+                :label="dict.deptName"
+                :value="dict.deptId"
+              />
+            </el-select>
           </el-form-item>
           <el-form-item label="" prop="queryParamsData2">
-            <el-select v-model="queryParams.queryParamsData2" placeholder="请选择" style="width: 200px">
+            <el-select v-model="queryParams.queryParamsData2" placeholder="是否共享" style="width: 120px">
+              <el-option label="共享" value="1"/>
+              <el-option label="不共享" value="2"/>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="" prop="queryParamsData3">
+            <el-select v-model="queryParams.queryParamsData3" placeholder="来源" style="width: 120px">
               <el-option
-                v-for="dict in optionList"
+                v-for="dict in optionListB"
                 :key="dict.value"
                 :label="dict.label"
                 :value="dict.value"
               />
             </el-select>
           </el-form-item>
+          <el-form-item label="" prop="queryParamsData4">
+            <el-cascader
+              style="width: 180px"
+              v-model="queryParams.queryParamsData4"
+              :options="optionListC"
+              :props="{
+                emitPath:false,
+                checkStrictly: true,
+                value: 'id',
+                label: 'knowledgePointName',
+                children: 'children',
+              }"
+              :show-all-levels="false"
+              filterable
+              placeholder="请选择知识点"
+            ></el-cascader>
+          </el-form-item>
+          <el-form-item label="" prop="queryParamsData5">
+            <el-select v-model="queryParams.queryParamsData5" placeholder="专业类别" style="width: 140px">
+              <el-option
+                v-for="dict in optionListD"
+                :key="dict.id"
+                :label="dict.disciplineName"
+                :value="dict.id"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="" prop="queryParamsData6">
+            <el-select v-model="queryParams.queryParamsData6" placeholder="组卷方式" style="width: 140px">
+              <el-option label="固定组卷" value="1"/>
+              <el-option label="随机组卷" value="2"/>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="" prop="queryParamsData7">
+            <el-input
+              maxLength="30"
+              v-model="queryParams.queryParamsData7"
+              placeholder="搜索名称"
+              style="width: 140px"
+            />
+          </el-form-item>
           <el-form-item label="" prop="state">
             <el-date-picker
               :clearable="false"
               v-model="dateRange"
               size="small"
-              style="width: 240px"
+              style="width: 220px"
               value-format="yyyy-MM-dd"
               type="daterange"
               range-separator="-"
@@ -41,8 +90,7 @@
           <p class="page-submit-common-style-button"
              style="float: right;"
              @click="tableButton(1)"
-             v-hasPermiRouter="['demo:demo:add']"
-          >新增</p>
+          >新建试卷</p>
         </el-form>
       </div>
       <div class="page-content-box">
@@ -70,21 +118,18 @@
               <span>{{ parseTime(scope.row.createTime,"{y}-{m}-{d} {h}:{i}") }}</span>
             </template>
           </el-table-column>
-          <el-table-column label="操作" width="200" show-overflow-tooltip v-if="tableButtonType">
+          <el-table-column label="操作" width="200" show-overflow-tooltip>
             <template slot-scope="scope">
               <div class="table-button-box">
                 <p class="table-button-null"></p>
                 <p class="table-button-p"
                    @click="tableButton(2,scope.row)"
-                   v-hasPermiRouter="['demo:demo:detail']"
-                >详情</p>
+                >编辑</p>
                 <p class="table-button-p"
                    @click="tableButton(3,scope.row)"
-                   v-hasPermiRouter="['demo:demo:edit']"
-                >编辑</p>
+                >复制</p>
                 <p class="table-button-p"
                    @click="tableButton(4,scope.row)"
-                   v-hasPermiRouter="['demo:demo:del']"
                 >删除</p>
                 <p class="table-button-null"></p>
               </div>
@@ -108,6 +153,7 @@
   //import { systemUserSelect } from "@/api/commonality/permission";
   //import { getInfo } from "@/api/basicsModules/index";
   //import addPage from "./addPage.vue";
+  import { examElDisciplineTypeList,systemDeptCurrentDept,examElKnowledgePointTreeList, } from "@/api/safetyEducationExaminationNew/index";
   export default {
     name: 'index',
     //components: {
@@ -121,13 +167,19 @@
         //页面遮罩
         loading:false,
         //下拉列表数据
-        optionList:[{value:true,label:'启用'},{value:false,label:'停用'}],
+        optionListA:[],
+        optionListB:[],
+        optionListC:[],
+        optionListD:[],
         //查询条件
         queryParams:{
           page:1,
           pageSize:20,
-          queryParamsData1:"",
+          queryParamsData1:null,
           queryParamsData2 :null,
+          queryParamsData3 :null,
+          queryParamsData4 :null,
+          queryParamsData5 :'',
         },
         //时间数据
         dateRange:[],
@@ -143,6 +195,9 @@
 
     },
     mounted () {
+      this.systemDeptCurrentDept();
+      this.examElKnowledgePointTreeList();
+      this.examElDisciplineTypeList();
       //this.getList();
     },
     methods: {
@@ -157,8 +212,11 @@
         this.$set(this,'queryParams',{
           page:1,
           pageSize:20,
-          queryParamsData1:"",
+          queryParamsData1:null,
           queryParamsData2 :null,
+          queryParamsData3 :null,
+          queryParamsData4 :null,
+          queryParamsData5 :'',
         });
         this.getList();
       },
@@ -231,6 +289,38 @@
           this.getList();
         }
       },
+      //知识点
+      examElKnowledgePointTreeList(){
+        examElKnowledgePointTreeList({}).then(response => {
+          const list = response.data || [];
+          this.formatTreeData(list);
+          this.$set(this, 'optionListC', list);
+        });
+      },
+      //学院列表
+      systemDeptCurrentDept(){
+        systemDeptCurrentDept({}).then(response => {
+          this.$set(this,'optionListA',response.data);
+        });
+      },
+      //查询全部专业类别
+      examElDisciplineTypeList(){
+        examElDisciplineTypeList({}).then(response => {
+          this.$set(this,'optionListD',response.data);
+        });
+      },
+      formatTreeData(data) {
+        data.forEach(item => {
+          // 如果 children 存在,且是数组,且长度为 0(即 children: [])
+          if (Array.isArray(item.children) && item.children.length === 0) {
+            // 将 children 设为 undefined(或直接 delete item.children;)
+            item.children = undefined;
+          } else if (item.children && item.children.length > 0) {
+            // 如果还有下一级,继续递归处理
+            this.formatTreeData(item.children);
+          }
+        });
+      },
     },
   }
 </script>

+ 2 - 1
src/views/safetyEducationExaminationNew/publicConfiguration/basicConfiguration/index.vue

@@ -112,7 +112,8 @@
       .top-1-p{
         flex:1;
         line-height:60px;
-        font-size:18px;
+        font-size:16px;
+        font-weight:700;
       }
       .top-2-p{
         height:35px;

+ 284 - 0
src/views/safetyEducationExaminationNew/questionBankManagement/questionBankManagement/addPage.vue

@@ -0,0 +1,284 @@
+<!-- 新建试题 -->
+<template>
+  <div class="page-container questionBankManagement-addPage">
+    <div class="top-max-big-box">
+      <p class="top-1-p">{{newData.id?'编辑试题':'添加试题'}}</p>
+      <p class="top-2-p" @click="backPage()">返回</p>
+      <p class="top-3-p" v-if="newData.id" @click="resetButton()">重置</p>
+      <p class="top-4-p" @click="submitButton()">保存</p>
+    </div>
+    <div class="content-box">
+      <el-form class="add-form-box" :model="newData" ref="form" label-width="140px" :rules="rules">
+        <div class="top-content-box">
+          <div class="flex-content-box">
+            <el-form-item label="试题类型" prop="data1">
+              <el-select v-model="newData.data1" placeholder="试题类型" style="width: 180px">
+                <el-option
+                  v-for="dict in optionListA"
+                  :key="dict.id"
+                  :label="dict.disciplineName"
+                  :value="dict.id"
+                />
+              </el-select>
+            </el-form-item>
+            <el-form-item label="知识点" prop="data2">
+              <el-cascader
+                style="width: 180px"
+                v-model="newData.data2"
+                :options="optionListB"
+                :props="{
+                emitPath:false,
+                checkStrictly: true,
+                value: 'id',
+                label: 'knowledgePointName',
+                children: 'children',
+              }"
+                :show-all-levels="false"
+                filterable
+                placeholder="知识点"
+              ></el-cascader>
+            </el-form-item>
+            <el-form-item label="难度" prop="data4">
+              <el-select v-model="newData.data4" placeholder="难度" style="width: 180px">
+                <el-option
+                  v-for="dict in optionListC"
+                  :key="dict.id"
+                  :label="dict.disciplineName"
+                  :value="dict.id"
+                />
+              </el-select>
+            </el-form-item>
+            <el-form-item label="是否共享" prop="data3">
+              <el-switch
+                :active-value="true"
+                :inactive-value="false"
+                v-model="newData.data3"
+                active-color="#0183FB"
+                inactive-color="#AAAAAA">
+              </el-switch>
+              <span style="margin-left:15px;line-height:40px;color:#999;">{{newData.data3?'共享开启,全校所有学院单位都可见':'不共享,仅本学院单位及上级都可见'}}</span>
+            </el-form-item>
+          </div>
+        </div>
+        <div class="title-content-box">
+          <p></p>
+          <p>题干</p>
+          <p></p>
+        </div>
+        <div class="editor-form-box edde">
+          <el-form-item label="" prop="data5" label-width="0">
+
+          </el-form-item>
+        </div>
+        <div class="title-content-box">
+          <p></p>
+          <p>选项</p>
+          <p></p>
+        </div>
+        <div class="title-content-box">
+          <p></p>
+          <p>答案</p>
+          <p></p>
+        </div>
+        <div class="title-content-box">
+          <p></p>
+          <p>解析</p>
+          <p></p>
+        </div>
+      </el-form>
+    </div>
+  </div>
+</template>
+
+<script>
+  //import { getDicts } from "@/api/commonality/noPermission";
+  //import { systemUserSelect } from "@/api/commonality/permission";
+  import { examElKnowledgePointTreeList, } from "@/api/safetyEducationExaminationNew/index";
+  export default {
+    name: 'addPage',
+    props: {
+      propsData: {}
+    },
+    data() {
+      return {
+        optionListA:[{value:1,label:'单选'},{value:2,label:'多选'},{value:3,label:'判断'}],
+        optionListB:[],
+        optionListC:[{value:1,label:'简单'},{value:2,label:'一般'},{value:3,label:'较难'},{value:4,label:'极难'}],
+        newData: {
+          data1:null,
+          data2:null,
+          data3:true,
+          data4:null,
+          data5:"",
+          data6:[],
+          data7:[],
+          data8:"",
+          data9:"",
+        },
+        rules:{
+          data1: [
+            { required: true, message: "请选择试题类型", trigger: "blur" },
+            { required: true, message: "请选择试题类型", validator: this.spaceJudgment, trigger: "blur" }
+          ],
+          data2: [
+            { required: true, message: "请选择知识点", trigger: "blur" },
+            { required: true, message: "请选择知识点", validator: this.spaceJudgment, trigger: "blur" }
+          ],
+          data4: [
+            { required: true, message: "请选择难度", trigger: "blur" },
+            { required: true, message: "请选择难度", validator: this.spaceJudgment, trigger: "blur" }
+          ],
+        },
+
+        // 编辑器内容(v-model 绑定)
+        docContent: '<p>初始内容:这是一篇测试文档</p>',
+        // 是否禁用编辑器
+        isEditorDisabled: false
+      }
+    },
+    created() {
+
+    },
+    mounted() {
+      this.initialize()
+      this.examElKnowledgePointTreeList();
+    },
+    methods: {
+      // 初始化
+      initialize() {
+
+      },
+      // 返回按钮
+      backPage() {
+        this.$parent.tableButton(6)
+      },
+      resetButton(){
+
+      },
+      // 提交按钮
+      submitForm() {
+
+      },
+      // 接收编辑器传递的内容
+      handleGetContent(content) {
+        console.log('页面接收的编辑器内容:', content)
+        // 可在此处添加“保存到后端”等逻辑
+      },
+      //知识点
+      examElKnowledgePointTreeList(){
+        examElKnowledgePointTreeList({}).then(response => {
+          const list = response.data || [];
+          this.formatTreeData(list);
+          this.$set(this, 'optionListB', list);
+        });
+      },
+      formatTreeData(data) {
+        data.forEach(item => {
+          // 如果 children 存在,且是数组,且长度为 0(即 children: [])
+          if (Array.isArray(item.children) && item.children.length === 0) {
+            // 将 children 设为 undefined(或直接 delete item.children;)
+            item.children = undefined;
+          } else if (item.children && item.children.length > 0) {
+            // 如果还有下一级,继续递归处理
+            this.formatTreeData(item.children);
+          }
+        });
+      },
+    },
+    beforeDestroy() {
+      // 组件销毁时记得销毁编辑器,防止内存泄漏
+      if (this.editor) {
+        this.editor.destroy();
+        this.editor = null;
+      }
+    }
+  }
+</script>
+
+<style scoped lang="scss">
+  .questionBankManagement-addPage {
+    .top-max-big-box{
+      height:60px;
+      display: flex;
+      overflow: hidden;
+      padding:0 20px;
+      border-bottom:1px solid #dedede;
+      .top-1-p{
+        flex:1;
+        line-height:60px;
+        font-size:16px;
+        font-weight:700;
+      }
+      .top-2-p{
+        height:35px;
+        line-height:33px;
+        margin:12px 0 0 20px;
+        padding:0 20px;
+        border-radius:4px;
+        background-color: #fff;
+        border:1px solid #999;
+        color:#999;
+        cursor: pointer;
+      }
+      .top-3-p{
+        height:35px;
+        line-height:33px;
+        margin:12px 0 0 20px;
+        padding:0 20px;
+        border-radius:4px;
+        background-color: #dedede;
+        border:1px solid #dedede;
+        color:#333;
+        cursor: pointer;
+      }
+      .top-4-p{
+        height:35px;
+        line-height:33px;
+        margin:12px 0 0 20px;
+        padding:0 20px;
+        border-radius:4px;
+        background-color: #0183fa;
+        border:1px solid #0183fa;
+        color:#fff;
+        cursor: pointer;
+      }
+    }
+    .content-box {
+      flex: 1;
+      display: flex;
+      flex-direction: column;
+      overflow: hidden;
+      padding: 20px;
+      .top-content-box{
+        .flex-content-box{
+          display: flex;
+
+        }
+      }
+      .title-content-box{
+        display: flex;
+        height:40px;
+        overflow: hidden;
+        margin:20px 40px;
+        p:nth-child(1){
+          flex:1;
+          height:2px;
+          background-color: #999;
+          margin-top:19px;
+        }
+        p:nth-child(2){
+          line-height:40px;
+          color:#333;
+          margin:0 20px;
+          font-size:16px;
+        }
+        p:nth-child(3){
+          flex:1;
+          height:2px;
+          background-color: #999;
+          margin-top:19px;
+        }
+      }
+    }
+  }
+</style>

+ 41 - 11
src/views/safetyEducationExaminationNew/questionBankManagement/questionBankManagement/index.vue

@@ -65,13 +65,19 @@
           <p class="page-submit-common-style-button"
              style="float: right;"
              @click="tableButton(1)"
-             v-hasPermiRouter="['demo:demo:add']"
           >添加试题</p>
+          <el-form-item style="float: right;">
+            <import-component :importConfig="importConfig"></import-component>
+          </el-form-item>
         </el-form>
       </div>
       <div class="page-content-box">
         <el-table class="table-box" v-loading="loading" border :data="dataList">
-          <el-table-column label="题干" prop="name"  show-overflow-tooltip/>
+          <el-table-column label="题干" prop="name"  show-overflow-tooltip>
+            <template slot-scope="scope">
+              <span>{{ cleanRichText(scope.row) }}</span>
+            </template>
+          </el-table-column>
           <el-table-column label="知识点" prop="content" width="200" show-overflow-tooltip/>
           <el-table-column label="题型" prop="content" width="200" show-overflow-tooltip/>
           <el-table-column label="难度" prop="content" width="200" show-overflow-tooltip/>
@@ -81,17 +87,15 @@
               <span style="padding:2px 10px;border:1px solid rgb(245, 154, 35);border-radius:4px;color: rgb(245, 154, 35);background-color:rgba(245, 154, 35,0.2)">不共享</span>
             </template>
           </el-table-column>
-          <el-table-column label="操作" width="200" show-overflow-tooltip v-if="tableButtonType">
+          <el-table-column label="操作" width="200" show-overflow-tooltip>
             <template slot-scope="scope">
               <div class="table-button-box">
                 <p class="table-button-null"></p>
                 <p class="table-button-p"
                    @click="tableButton(3,scope.row)"
-                   v-hasPermiRouter="['demo:demo:edit']"
                 >编辑</p>
                 <p class="table-button-p"
                    @click="tableButton(4,scope.row)"
-                   v-hasPermiRouter="['demo:demo:del']"
                 >删除</p>
                 <p class="table-button-null"></p>
               </div>
@@ -107,19 +111,21 @@
         />
       </div>
     </div>
-    <!--<add-page :propsData="propsData" v-if="pageType === 2"></add-page>-->
+    <add-page :propsData="propsData" v-if="pageType === 2"></add-page>
   </div>
 </template>
 <script>
   //import { getDicts } from "@/api/commonality/noPermission";
   //import { systemUserSelect } from "@/api/commonality/permission";
   import { examElKnowledgePointTreeList, } from "@/api/safetyEducationExaminationNew/index";
-  //import addPage from "./addPage.vue";
+  import importComponent from "@/components/importComponent/importComponent.vue";
+  import addPage from "./addPage.vue";
   export default {
     name: 'index',
-    //components: {
-    //  addPage
-    //},
+    components: {
+      importComponent,
+      addPage,
+    },
     data () {
       return {
         tableButtonType:this.hasPermiDom(['demo:demo:detail','demo:demo:edit','demo:demo:del',]),
@@ -127,6 +133,16 @@
         pageType:1,
         //页面遮罩
         loading:false,
+        importConfig:{
+          upLoadApi:'/system/user/student/importData',                //上传接口地址
+          downloadApi:'/system/user/student/importTemplate',          //下载模板接口地址
+          downloadCustomKey:null,                                     //下载模板自定义参数KEY(非必填)
+          downloadCustomValue:null,                                   //下载模板自定义参数VALUE(非必填)
+          loseApi:'/system/user/student/importErrorData',             //失败报表接口地址
+          loseCustomKey:null,                                         //失败报表自定义参数KEY(非必填)
+          loseCustomValue:null,                                       //失败报表自定义参数VALUE(非必填)
+          fileName:'导入模板-',                                       //下载模板命名
+        },
         //下拉列表数据
         optionListA:[{value:true,label:'共享'},{value:false,label:'不共享'}],
         optionListB:[],
@@ -143,7 +159,13 @@
           queryParamsData5 :'',
         },
         //列表数据
-        dataList:[],
+        dataList:[
+          {text:'<img src="https://example.com/images/test.jpg" alt="测试图片" style="width: 100%; max-width: 600px;" />',name:'321'},
+          {text:'<p>这是一段普通的<strong>测试文本</strong>,里面包含了一个<a href="https://www.example.com" target="_blank">外部链接</a>。</p>\n' +
+              '<p>下面是一张图片:</p>\n' +
+              '<img src="https://example.com/images/test.jpg" alt="测试图片" style="width: 100%; max-width: 600px;" />\n' +
+              '<p>图片下方还有更多文字内容,<em>用于验证正则表达式或DOM解析</em>是否能完美清洗掉所有HTML标签,只保留纯文字。</p>',name:'123'},
+        ],
         //数据数量
         total:0,
         //组件传参
@@ -158,6 +180,14 @@
       //this.getList();
     },
     methods: {
+      //清洗富文本
+      cleanRichText(row) {
+        if (!row.text) return row.name || '';
+        const tempDiv = document.createElement('div');
+        tempDiv.innerHTML = row.text;
+        let plainText = (tempDiv.textContent || tempDiv.innerText || '').trim();
+        return plainText || row.name || '';
+      },
       //查询按钮
       handleQuery(){
         this.$set(this.queryParams,'page',1);