From 40ff3685bc1c4dec8923b6bf3980361bb5c7fc80 Mon Sep 17 00:00:00 2001
From: odc.xiaohui <xiaohui@Q1>
Date: 星期五, 24 十一月 2023 17:11:48 +0800
Subject: [PATCH] 修改青羊后台部门bug

---
 src/views/exam/personalRandomTemplate/edit.vue |  462 ++++++++++++++++++++++++++++++++++++++++++
 src/views/exam/personalRandomTemplate/list.vue |  152 +++++++++++++
 src/router.js                                  |   13 +
 src/views/exam/paper/edit.vue                  |   14 
 4 files changed, 636 insertions(+), 5 deletions(-)

diff --git a/src/router.js b/src/router.js
index dd4ace5..4bb28d1 100644
--- a/src/router.js
+++ b/src/router.js
@@ -121,6 +121,19 @@
         meta: { title: '涓汉妯℃嫙', noCache: true }
       },
       {
+        path: 'personalRandomTemplate/list',
+        component: () => import('@/views/exam/personalRandomTemplate/list'),
+        name: 'personalSimulation',
+        meta: { title: '涓汉闅忔満妯℃澘', noCache: true }
+      },
+      {
+        path: 'personalRandomTemplate/edit',
+        component: () => import('@/views/exam/personalRandomTemplate/edit'),
+        name: 'personalSimulationEdit',
+        meta: { title: '涓汉闅忔満妯℃澘缂栬緫', noCache: true, activeMenu: '/exam/personalRandomTemplate/list' },
+        hidden: true
+      },
+      {
         path: 'personalSimulation/edit',
         component: () => import('@/views/exam/personalSimulation/edit'),
         name: 'personalSimulationEdit',
diff --git a/src/views/exam/paper/edit.vue b/src/views/exam/paper/edit.vue
index fa3904a..a3b03fd 100644
--- a/src/views/exam/paper/edit.vue
+++ b/src/views/exam/paper/edit.vue
@@ -1,8 +1,8 @@
 <template>
   <div class="app-container">
     <el-form :model="form" ref="form" label-width="200px" v-loading="formLoading" :rules="rules">
-      <el-form-item label="鑰冪敓锛�" prop="userIds" required>
-        <el-cascader v-model="form.userIds" :options="options" :props="props" clearable collapse-tags>
+      <el-form-item label="鑰冪敓锛�" prop="menuIds" required>
+        <el-cascader v-model="form.menuIds" :options="options" :props="props" @change="handleChange" clearable collapse-tags>
         </el-cascader>
       </el-form-item>
       <el-form-item label="璇剧洰锛�" prop="subjectId" required>
@@ -172,7 +172,7 @@
       subjectFilter: null,
       formLoading: false,
       rules: {
-        userIds: [
+        menuIds: [
           { required: true, message: '璇烽�夋嫨', trigger: 'change' }
         ],
         subjectId: [
@@ -215,7 +215,7 @@
       _this.formLoading = true
       examPaperApi.select(id).then(re => {
         _this.form = re.response
-        _this.form.userIds = re.response.userId
+        _this.form.menuIds = JSON.parse(re.response.menuIds)
         console.log(_this.form)
         _this.formLoading = false
       })
@@ -227,6 +227,9 @@
     })
   },
   methods: {
+    handleChange(val){
+      console.log(val)
+    },
     titlejs(val){
       console.log(val)
       let str = ''
@@ -303,9 +306,10 @@
             this.form.subjectId= this.form.subjectId
           };
           let op = [];
-          for(var ele of this.form.userIds){
+          for(var ele of this.form.menuIds){
             op.push(ele[1])
           };
+          this.form.menuIds = JSON.stringify(this.form.menuIds);
           this.form.userIds = op;
           console.log("laks",this.form)
           if(this.form.questionTypeVMS == null){
diff --git a/src/views/exam/personalRandomTemplate/edit.vue b/src/views/exam/personalRandomTemplate/edit.vue
new file mode 100644
index 0000000..e95830c
--- /dev/null
+++ b/src/views/exam/personalRandomTemplate/edit.vue
@@ -0,0 +1,462 @@
+<template>
+  <div class="app-container">
+    <el-form :model="form" ref="form" label-width="200px" v-loading="formLoading" :rules="rules">
+      <el-form-item label="鑰冪敓锛�" prop="menuIds" required>
+        <el-cascader v-model="form.menuIds" :options="options" :props="props" clearable collapse-tags>
+        </el-cascader>
+      </el-form-item>
+      <el-form-item label="璇剧洰锛�" prop="subjectId" required >
+        <el-select ref="subjectIdRef" v-model="form.subjectId" placeholder="璇剧洰" multiple
+                   collapse-tags   @visible-change="subjectIdEvent">
+          <el-option v-for="item in subjectFilter" :key="item.id" :value="item.id"
+                     :label="item.name+' '"></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="璇曞嵎绫诲瀷锛�" prop="paperType" required >
+        <el-select v-model="form.paperType" placeholder="璇曞嵎绫诲瀷"  @visible-change="subjectIdEvent" disabled>
+          <el-option v-for="item in paperTypeEnum" :key="item.key" :value="item.key" :label="item.value" ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item label="鏃堕棿闄愬埗锛�" required v-show="form.paperType===4">
+        <el-date-picker v-model="form.limitDateTime" value-format="yyyy-MM-dd HH:mm:ss" type="datetimerange"
+                        range-separator="鑷�" start-placeholder="寮�濮嬫棩鏈�" end-placeholder="缁撴潫鏃ユ湡">
+        </el-date-picker>
+      </el-form-item>
+      <el-form-item label="璇曞嵎鍚嶇О锛�"  prop="name" required >
+        <el-row :gutter="20">
+          <el-col :span="9">
+            <el-input v-model="form.name"/>
+          </el-col>
+          <el-col :span="2" v-if="form.paperType==7">
+            <span>鎬绘暟鍒嗭細</span>
+          </el-col>
+          <el-col :span="9" v-if="form.paperType==7">
+            <el-input disabled v-model="form.aggregateSource"/>
+          </el-col>
+        </el-row>
+      </el-form-item>
+      <el-form-item :key="item.subjectId" :label="item.label"   required  v-for="(item,key) in form.questionTypeVMS"  v-if="form.paperType ==7">
+        <el-row >
+          <el-col :span="3" >
+            <span>澶氶�夐锛� </span>
+
+          </el-col>
+          <el-col :span="3">
+            <el-input v-model="form.questionTypeVMS[key].multipleChoice" style="width: 80%"/>
+          </el-col>
+          <el-col :span="3" >
+            <span>鍗曢�夐锛�</span>
+          </el-col>
+          <el-col :span="3">
+            <el-input v-model="form.questionTypeVMS[key].singleChoice" style="width: 80%"/>
+          </el-col>
+          <el-col :span="3" >
+            <span>鍒ゆ柇棰橈細</span>
+          </el-col>
+          <el-col :span="3">
+            <el-input v-model="form.questionTypeVMS[key].trueFalse" style="width: 80%"/>
+          </el-col>
+        </el-row>
+      </el-form-item>
+      <!--      <el-form-item label="鎬绘暟鍒嗭細" v-if="form.paperType==7"  prop="name" required>-->
+      <!--        <el-input v-model="form.name"/>-->
+      <!--      </el-form-item>-->
+      <el-form-item :key="index" :label="'鏍囬'+(index+1)+'锛�'" required v-for="(titleItem,index) in form.titleItems">
+        <el-input v-model="titleItem.name" style="width: 80%"/>
+        <el-button  v-if="form.paperType!=7" type="text" class="link-left" style="margin-left: 20px" size="mini" @click="addQuestion(titleItem)">
+          娣诲姞棰樼洰
+        </el-button>
+        <el-button type="text" class="link-left" size="mini" @click="form.titleItems.splice(index,1)">鍒犻櫎</el-button>
+        <el-card class="exampaper-item-box" v-if="titleItem.questionItems&&titleItem.questionItems.length!==0&&subjectIdList.length<2">
+          <el-form-item :key="questionIndex" :label="'棰樼洰'+(questionIndex+1)+'锛�'"
+                        v-for="(questionItem,questionIndex) in titleItem.questionItems" style="margin-bottom: 15px">
+            <el-row>
+              <el-col :span="23">
+                <QuestionShow :qType="questionItem.questionType" :question="questionItem"/>
+              </el-col>
+              <el-col :span="1">
+                <el-button type="text" size="mini" @click="titleItem.questionItems.splice(questionIndex,1)">鍒犻櫎
+                </el-button>
+              </el-col>
+            </el-row>
+          </el-form-item>
+        </el-card>
+      </el-form-item>
+      <el-form-item label="寤鸿鏃堕暱锛�" prop="suggestTime" required>
+        <el-input v-model="form.suggestTime" placeholder="鍒嗛挓"/>
+      </el-form-item>
+      <el-form-item>
+        <el-button type="primary" @click="submitForm">鎻愪氦</el-button>
+        <el-button @click="resetForm">閲嶇疆</el-button>
+        <el-button type="success" @click="addTitle">娣诲姞鏍囬</el-button>
+      </el-form-item>
+    </el-form>
+    <el-dialog :visible.sync="questionPage.showDialog"  width="70%">
+      <el-form :model="questionPage.queryParam" ref="queryForm" :inline="true">
+        <el-form-item label="ID锛�">
+          <el-input v-model="questionPage.queryParam.id"  clearable></el-input>
+        </el-form-item>
+        <el-form-item label="棰樺瀷锛�">
+          <el-select v-model="questionPage.queryParam.questionType" clearable>
+            <el-option v-for="item in questionTypeEnum" :key="item.key" :value="item.key" :label="item.value"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" @click="queryForm">鏌ヨ</el-button>
+        </el-form-item>
+      </el-form>
+      <el-table v-loading="questionPage.listLoading" :data="questionPage.tableData"
+                @selection-change="handleSelectionChange" border fit highlight-current-row style="width: 100%">
+        <el-table-column type="selection" width="35"></el-table-column>
+        <el-table-column prop="questionType" label="棰樺瀷" :formatter="questionTypeFormatter" width="70px"/>
+        <el-table-column prop="shortTitle" label="棰樺共" show-overflow-tooltip/>
+      </el-table>
+      <pagination v-show="questionPage.total>0" :total="questionPage.total"
+                  :page.sync="questionPage.queryParam.pageIndex" :limit.sync="questionPage.queryParam.pageSize"
+                  @pagination="search"/>
+      <span slot="footer" class="dialog-footer">
+          <el-button @click="questionPage.showDialog = false">鍙� 娑�</el-button>
+          <el-button type="primary" @click="confirmQuestionSelect">纭畾</el-button>
+     </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+
+import { mapGetters, mapState, mapActions } from 'vuex'
+import Pagination from '@/components/Pagination'
+import QuestionShow from '../question/components/Show'
+import examPaperApi from '@/api/examPaper'
+import questionApi from '@/api/question'
+import departmentApi from '@/api/department'
+
+export default {
+  components: { Pagination, QuestionShow },
+
+  data () {
+    return {
+      props: {
+        multiple: true
+        // lazy: true,
+        // lazyLoad (node, resolve) {
+        //   console.log(node,"node");
+        //   var that = this;
+        //   departmentApi.selectUser(node.value).then(re=>{
+        //     console.log(re,"re");
+        //     const nodes = re.response.map(xxx=>{
+        //       return {value: xxx.id,label: xxx.realName,leaf: node.level >= 1}
+        //     });
+        //     resolve(nodes);
+        //   })
+        // }
+      },
+      options: [],
+      departCascaderProps:{
+        multiple: true
+      },
+      subjectIdList:[],
+      form: {
+        aggregateSource:'',
+        id: null,
+        departmentIds: [],
+
+        subjectId: [],
+        paperType: 7,
+        limitDateTime: [],
+        name: '',
+        suggestTime: null,
+        titleItems: [],
+        subjectSource:{},
+        questionTypeVMS:[]
+      },
+      subjectFilter: null,
+      formLoading: false,
+      rules: {
+
+        subjectId: [
+          { required: true, message: '璇烽�夋嫨璇剧洰', trigger: 'change' }
+        ],
+        paperType: [
+          { required: true, message: '璇烽�夋嫨璇曞嵎绫诲瀷', trigger: 'change' }
+        ],
+        name: [
+          { required: true, message: '璇疯緭鍏ヨ瘯鍗峰悕绉�', trigger: 'blur' }
+        ],
+        suggestTime: [
+          { required: true, message: '璇疯緭鍏ュ缓璁椂闀�', trigger: 'blur' }
+        ]
+      },
+      questionPage: {
+        multipleSelection: [],
+        showDialog: false,
+        queryParam: {
+          id: null,
+          questionType: null,
+          subjectId: 1,
+          pageIndex: 1,
+          pageSize: 5
+        },
+        listLoading: true,
+        tableData: [],
+        total: 0
+      },
+      currentTitleItem: null
+    }
+  },
+  created () {
+    examPaperApi.selflist().then(res => {
+      console.log(res)
+      this.subjectFilter = res.response
+    })
+  },
+   async mounted () {
+
+     let id = this.$route.query.id
+     let _this = this
+
+     this.initSubject(function () {
+       _this.subjectFilter = _this.subjects
+     })
+     if (id && parseInt(id) !== 0) {
+       _this.formLoading = true
+       await examPaperApi.selfselect(id).then(re => {
+         _this.form = re.response
+         _this.form.menuIds = JSON.parse(re.response.menuIds)
+         console.log(_this.form)
+         _this.formLoading = false
+       })
+     }
+     departmentApi.selectDepartmentUser().then(res => {
+       console.log("res", res);
+
+       _this.options = res.response.map(x => {
+         return {
+           value: x.department.id, label: x.department.name, children: x.userList.map(xx => {
+             return { value: xx.id, label: xx.realName }
+           })
+         }
+       })
+     })
+
+     // this.subjectIdEvent(false)
+   },
+  methods: {
+    titlejs(val){
+      console.log(val)
+      let str = ''
+      this.subjectFilter.forEach(item=>{
+        if (item.id == val){
+          str = item.name
+        }
+      })
+      return str
+    },
+    subjectIdEvent(e){
+      console.log(e,this.$refs.subjectIdRef.selected)
+      let arr=[]
+      if (e){
+
+      }else {
+        this.$refs.subjectIdRef.selected.forEach(item=>{
+          arr.push({
+            label:item.label,
+            subjectId:item.value,
+            singleChoice:'',
+            multipleChoice:'',
+            trueFalse:''
+          })
+        })
+        console.log(arr)
+        this.form.questionTypeVMS = arr
+      }
+
+      if (this.form.paperType ==7){
+        //瑾槑鏄毃姗�
+        this.subjectIdList = arr
+        let obj1={}
+        let arr1 = []
+        arr.forEach((item,index)=>{
+          // obj1[item.id]=''
+          arr1.push({
+            subjectId:item.id,
+            singleChoice:'',
+            multipleChoice:'',
+            trueFalse:''
+          })
+          // let obj={
+          //   item
+          // }
+
+          // for (let i in obj) {
+          //   i=item.id
+          //   obj[i]= ''
+          //   obj1[i] = ''
+          //   console.log('閿悕锛�', i);
+          //   console.log('閿�硷細', obj[i]);
+          // }
+        })
+        this.form.subjectSource = obj1
+
+        console.log(this.form.subjectSource)
+        console.log(this.form.questionTypeVMS)
+        // this.form.paperType = 7
+        this.form.titleItems = []
+      }else {
+        this.form.subjectSource={}
+        this.subjectIdList = []
+        // this.form.paperType = 1
+      }
+    },
+    submitForm () {
+      let _this = this
+      console.log(this.subjectIdList)
+      console.log(this.form.subjectSource)
+      this.$refs.form.validate((valid) => {
+        if (valid) {
+          this.formLoading = true;
+          if (this.subjectIdList.length == 1){
+            this.form.subjectId= this.form.subjectId
+          };
+          let op = [];
+          for(var ele of this.form.menuIds){
+            op.push(ele[1])
+          };
+          this.form.menuIds = JSON.stringify(this.form.menuIds);
+          this.form.userIds = op;
+          console.log("laks",this.form)
+          if(this.form.questionTypeVMS == null){
+            this.form.questionTypeVMS = [];
+          }
+          this.form.status = 0
+          examPaperApi.selfedit(this.form).then(re => {
+            if (re.code === 1) {
+              _this.$message.success(re.message)
+              _this.delCurrentView(_this).then(() => {
+                _this.$router.push('/exam/personalRandomTemplate/list')
+              })
+            } else {
+              _this.$message.error(re.message)
+              this.formLoading = false
+            }
+          }).catch(e => {
+            this.formLoading = false
+          })
+        } else {
+          return false
+        }
+      })
+    },
+    addTitle () {
+      this.form.titleItems.push({
+        name: '',
+        questionItems: []
+      })
+    },
+    addQuestion (titleItem) {
+      this.currentTitleItem = titleItem
+      this.questionPage.showDialog = true
+      this.search()
+    },
+    removeTitleItem (titleItem) {
+      this.form.titleItems.remove(titleItem)
+    },
+    removeQuestion (titleItem, questionItem) {
+      titleItem.questionItems.remove(questionItem)
+    },
+    queryForm () {
+      this.questionPage.queryParam.pageIndex = 1
+      this.search()
+    },
+    confirmQuestionSelect () {
+      let _this = this
+      this.questionPage.multipleSelection.forEach(q => {
+        questionApi.select(q.id).then(re => {
+          _this.currentTitleItem.questionItems.push(re.response)
+        })
+      })
+      this.questionPage.showDialog = false
+    },
+    levelChange () {
+      // this.form.subjectId = null
+      // this.subjectFilter = this.subjects.filter(data =>{
+      //   return this.form.departmentIds.forEach(item=>{data.level == item})
+      // })
+      //
+      // this.subjectFilter = []
+      // this.form.departmentIds.forEach(item=>{
+      //   this.subjects.forEach(jectitem=>{
+      //     if (item==jectitem.level){
+      //       this.subjectFilter.push(jectitem)
+      //     }
+      //   })
+      // })
+      console.log(this.subjects,this.form.departmentIds)
+      // this.subjectFilter = this.subjects
+    },
+    search () {
+      if (this.subjectIdList.length=1){
+        this.questionPage.queryParam.subjectId = this.form.subjectId
+      }
+
+      this.questionPage.listLoading = true
+      questionApi.pageList(this.questionPage.queryParam).then(data => {
+        const re = data.response
+        this.questionPage.tableData = re.list
+        this.questionPage.total = re.total
+        this.questionPage.queryParam.pageIndex = re.pageNum
+        this.questionPage.listLoading = false
+      })
+    },
+    handleSelectionChange (val) {
+      this.questionPage.multipleSelection = val
+    },
+    questionTypeFormatter (row, column, cellValue, index) {
+      return this.enumFormat(this.questionTypeEnum, cellValue)
+    },
+    subjectFormatter (row, column, cellValue, index) {
+      return this.subjectEnumFormat(cellValue)
+    },
+    resetForm () {
+      let lastId = this.form.id
+      this.$refs['form'].resetFields()
+      this.form= {
+        aggregateSource:100,
+        id: null,
+        departmentIds: [],
+        subjectId: [],
+        paperType: 1,
+        limitDateTime: [],
+        name: '',
+        suggestTime: null,
+        titleItems: [],
+        subjectSource:null,
+        questionTypeVMS:[]
+      }
+      this.form.id = lastId
+    },
+    ...mapActions('exam', { initSubject: 'initSubject' }),
+    ...mapActions('tagsView', { delCurrentView: 'delCurrentView' }),
+  },
+  computed: {
+
+    ...mapGetters('enumItem', ['enumFormat']),
+    ...mapState('enumItem', {
+      questionTypeEnum: state => state.exam.question.typeEnum,
+      paperTypeEnum: state => state.exam.examPaper.paperTypeEnum,
+      levelEnum: state => state.user.levelEnum
+    }),
+    ...mapState('exam', { subjects: state => state.subjects })
+  }
+}
+</script>
+
+<style lang="scss">
+.exampaper-item-box {
+  .q-title {
+    margin: 0px 5px 0px 5px;
+  }
+  .q-item-content {
+  }
+}
+</style>
diff --git a/src/views/exam/personalRandomTemplate/list.vue b/src/views/exam/personalRandomTemplate/list.vue
new file mode 100644
index 0000000..8a2107a
--- /dev/null
+++ b/src/views/exam/personalRandomTemplate/list.vue
@@ -0,0 +1,152 @@
+<template>
+  <div class="app-container">
+<!--    <el-form :model="queryParam" ref="queryForm" :inline="true">-->
+<!--      <el-form-item label="棰樼洰ID锛�">-->
+<!--        <el-input v-model="queryParam.id" clearable></el-input>-->
+<!--      </el-form-item>-->
+<!--      <el-form-item label="閮ㄩ棬锛�">-->
+<!--        <el-select v-model="queryParam.level" placeholder="閮ㄩ棬" @change="levelChange" clearable>-->
+<!--          <el-option v-for="item in levelEnum" :key="item.key" :value="item.key" :label="item.value"></el-option>-->
+<!--        </el-select>-->
+<!--      </el-form-item>-->
+<!--      <el-form-item label="璇剧洰锛�" >-->
+<!--        <el-select v-model="queryParam.subjectId"  clearable>-->
+<!--          <el-option v-for="item in subjectFilter" :key="item.id" :value="item.id" :label="item.name+' '"></el-option>-->
+<!--        </el-select>-->
+<!--      </el-form-item>-->
+<!--      <el-form-item>-->
+<!--        <el-button type="primary" @click="submitForm">鏌ヨ</el-button>-->
+<!--        <router-link :to="{path:'/exam/personalSimulation/edit'}" class="link-left">-->
+<!--          <el-button type="primary">娣诲姞</el-button>-->
+<!--        </router-link>-->
+<!--      </el-form-item>-->
+<!--    </el-form>-->
+    <router-link :to="{path:'/exam/personalRandomTemplate/edit'}" class="link-left">
+      <el-button type="primary">娣诲姞</el-button>
+    </router-link>
+    <el-table v-loading="listLoading" :data="tableData" border fit highlight-current-row style="width: 100%">
+      <el-table-column prop="subjectId" label="璇剧洰" :formatter="subjectFormatter" width="120px" />
+      <el-table-column prop="name" label="鍚嶇О"  />
+      <el-table-column  label="鎿嶄綔" align="center"  width="260px">
+        <template slot-scope="{row}">
+          <el-button size="mini" @click="$router.push({path:'/exam/personalRandomTemplate/edit',query:{id:row.id}})" >缂栬緫</el-button>
+          <el-button size="mini" type="danger"  @click="deletePaper(row)" class="link-left">鍒犻櫎</el-button>
+          <el-button size="mini" type="danger"  @click="handleExport(row)" class="link-left">瀵煎嚭</el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <pagination v-show="total>0" :total="total" :page.sync="queryParam.pageIndex" :limit.sync="queryParam.pageSize"
+                @pagination="search"/>
+  </div>
+</template>
+
+<script>
+import { mapActions, mapGetters, mapState } from 'vuex'
+import Pagination from '@/components/Pagination'
+import examPaperApi from '@/api/examPaper'
+
+export default {
+  components: { Pagination },
+  data () {
+    return {
+      queryParam: {
+        id: null,
+        level: null,
+        subjectId: null,
+        pageIndex: 1,
+        pageSize: 10
+      },
+      subjectFilter: null,
+      listLoading: true,
+      tableData: [],
+      total: 0
+    }
+  },
+  created () {
+    this.initSubject()
+    this.search()
+    this.queryParam.subjectId = null
+    this.subjectFilter = this.subjects
+  },
+  methods: {
+    handleExport(row){
+      let fileName = row.name +'.xls'
+      let url ='/api/admin/exam/count/exportTemplatesId/'+row.id
+      var x = new XMLHttpRequest();
+      x.open("GET", url, true);
+      x.responseType = "blob";
+      x.onload = function () {
+        var url = window.URL.createObjectURL(x.response);
+        var a = document.createElement("a");
+        a.href = url;
+        a.download = fileName;
+        a.click();
+      };
+      x.send();
+
+      // examPaperApi.uploadEnrolmentsa(row.id).then(res=> {
+      //   console.log(res)
+
+
+
+        // const link = document.createElement('a');  //鍒涘缓涓�涓猘鏍囩
+        // const blob = new Blob([res.data]);//杩欓噷res.data鏍规嵁杩斿洖鍊兼潵瀹氱殑.data鏄痓lob瀵硅薄
+        // link.style.display = 'none';
+        // link.href = URL.createObjectURL(blob);    //灏嗗悗绔繑鍥炵殑鏁版嵁閫氳繃blob杞崲涓轰竴涓湴鍧�
+        // //璁剧疆涓嬭浇涓嬫潵鍚庢枃浠剁殑鍚嶅瓧浠ュ強鏂囦欢鏍煎紡
+        // link.setAttribute(
+        //   'download',
+        //   `xxx.` + `xlsx`,
+        // );
+        // document.body.appendChild(link);
+        // link.click();                            //涓嬭浇璇ユ枃浠�
+        // document.body.removeChild(link);
+
+      // })
+    },
+    submitForm () {
+      this.queryParam.pageIndex = 1
+      this.search()
+    },
+    search () {
+      this.listLoading = true
+      this.queryParam.status = 0
+      examPaperApi.pageselfList(this.queryParam).then(data => {
+        const re = data.response
+        this.tableData = re.list
+        this.total = re.total
+        this.queryParam.pageIndex = re.pageNum
+        this.listLoading = false
+      })
+    },
+    deletePaper (row) {
+      let _this = this
+      examPaperApi.selfdeletePaper(row.id).then(re => {
+        if (re.code === 1) {
+          _this.search()
+          _this.$message.success(re.message)
+        } else {
+          _this.$message.error(re.message)
+        }
+      })
+    },
+    levelChange () {
+      this.queryParam.subjectId = null
+      this.subjectFilter = this.subjects
+    },
+    subjectFormatter  (row, column, cellValue, index) {
+      console.log(row, column, cellValue, index)
+      return this.subjectEnumFormat(cellValue)
+    },
+    ...mapActions('exam', { initSubject: 'initSubject' })
+  },
+  computed: {
+    ...mapGetters('enumItem', ['enumFormat']),
+    ...mapState('enumItem', {
+      levelEnum: state => state.user.levelEnum
+    }),
+    ...mapGetters('exam', ['subjectEnumFormat']),
+    ...mapState('exam', { subjects: state => state.subjects })
+  }
+}
+</script>

--
Gitblit v1.8.0