Bladeren bron

考试功能迁移

lidie 2 jaren geleden
bovenliggende
commit
ddb4033ca6

+ 6 - 0
src/router/routes.js

@@ -300,6 +300,12 @@ const frameCustom = [
         meta: { title: '详细信息' },
         component: _import('/platform/bpmn/task-change/detail')
       },
+      {
+        path: 'myTest/index',
+        name: 'myTest',
+        meta: { title: '我的考试' },
+        component: _import('/platform/bpmn/my-test/index')
+      },
       {
         path: 'communication/communicationList',
         name: 'communicationList',

+ 25 - 25
src/utils/action.js

@@ -14,7 +14,7 @@ import I18n from '@/utils/i18n'
 import common from '@/constants/common.js'
 
 const action = {
-  descDialog: function({ title, message, className = 'ibps-dialog-desc', confirmButtonColor = '#3396FB', confirmButtonText = '知道了', overlay = true }) {
+  descDialog: function ({ title, message, className = 'ibps-dialog-desc', confirmButtonColor = '#3396FB', confirmButtonText = '知道了', overlay = true }) {
     Dialog.alert({
       title,
       message,
@@ -25,7 +25,7 @@ const action = {
       messageAlign: 'left'
     })
   },
-  msg: function(message, options) {
+  msg: function (message, options) {
     if (!options) {
       options = options || {}
     }
@@ -35,7 +35,7 @@ const action = {
   /**
    * 操作警告提示
    */
-  warning: function(message) {
+  warning: function (message) {
     this.msg(message, {
       type: 'warning'
     })
@@ -43,12 +43,12 @@ const action = {
   /**
    * 操作成功提示
    */
-  success: function(message) {
+  success: function (message) {
     this.msg(message, {
       type: 'success'
     })
   },
-  error: function(message) {
+  error: function (message) {
     this.msg(message, {
       type: 'error'
     })
@@ -57,14 +57,14 @@ const action = {
    * 默认操作成功提示
    *  @param {*} message
    */
-  successMessage: function(message = I18n.t('common.dialog.operateSuccess')) {
+  successMessage: function (message = I18n.t('common.dialog.operateSuccess')) {
     this.success(message)
   },
   /**
    * 删除成功提示
    * @param {*} message
    */
-  removeSuccessMessage: function(message = I18n.t('common.dialog.removeSuccess')) {
+  removeSuccessMessage: function (message = I18n.t('common.dialog.removeSuccess')) {
     this.success(message)
   },
   /**
@@ -72,7 +72,7 @@ const action = {
  * @param {*} rows
  * @param {*} pkKey
  */
-  getSelectedIds: function(rows, pkKey = 'id') {
+  getSelectedIds: function (rows, pkKey = 'id') {
     const ids = []
     rows.forEach(row => {
       ids.push(row[pkKey])
@@ -86,7 +86,7 @@ const action = {
  *
  * @param {*} selection
  */
-  selectedRecord: function(selection) {
+  selectedRecord: function (selection) {
     return new Promise((resolve, reject) => {
       if (Utils.isEmpty(selection)) {
         this.warning(I18n.t('common.dialog.selectedRecords'))
@@ -111,7 +111,7 @@ const action = {
  * @param {*} isArray 是否数组格式返回 默认 false
  * @param {*} separator 分割符 默认 `,`
  */
-  selectedMultiRecord: function(selection, isArray = false, separator = ',') {
+  selectedMultiRecord: function (selection, isArray = false, separator = ',') {
     return new Promise((resolve, reject) => {
       if (Utils.isEmpty(selection)) {
         this.warning(I18n.t('common.dialog.selectedRecords'))
@@ -132,7 +132,7 @@ const action = {
  * @param {*} rows
  * @param {*} pkKey
  */
-  removeRecord: function(selection, confirmMsg = I18n.t('common.dialog.removeRecord'), isArray = false, separator = ',') {
+  removeRecord: function (selection, confirmMsg = I18n.t('common.dialog.removeRecord'), isArray = false, separator = ',') {
     return new Promise((resolve, reject) => {
       if (Utils.isEmpty(selection)) {
         this.warning(I18n.t('common.dialog.selectedRecords'))
@@ -159,7 +159,7 @@ const action = {
   /**
  * 保存成功提示
  */
-  saveSuccessMessage: function(message = I18n.t('common.dialog.operateSuccess'), callback) {
+  saveSuccessMessage: function (message = I18n.t('common.dialog.operateSuccess'), callback) {
     message = Utils.isNotEmpty(message) ? message : I18n.t('common.dialog.operateSuccess')
 
     // MessageBox.confirm(message,
@@ -179,7 +179,7 @@ const action = {
   /**
  * 保存成功提示
  */
-  saveSuccessAlert: function(message = I18n.t('common.dialog.operateSuccess'), callback) {
+  saveSuccessAlert: function (message = I18n.t('common.dialog.operateSuccess'), callback) {
     // MessageBox.alert(message,
     //   I18n.t('common.dialog.title'),
     //   {
@@ -193,7 +193,7 @@ const action = {
   /**
  * 保存失败
  */
-  saveErrorMessage: function(message, callback) {
+  saveErrorMessage: function (message, callback) {
     this.warning(message || I18n.t('common.dialog.saveError'))
     if (callback) { callback() }
   },
@@ -221,7 +221,7 @@ const action = {
  *  resultKey 结果key 默认 listData
  *  pageKey 分页key 默认 pagination
  */
-  handleListData: function(vm, data, options = {}) {
+  handleListData: function (vm, data, options = {}) {
     const loadingKey = options.loadingKey || 'loading'
     const refreshingKey = options.refreshingKey || 'refreshing'
     const finishedKey = options.finishedKey || 'finished'
@@ -263,7 +263,7 @@ const action = {
    *  resultKey 结果key 默认 listData
    *  pageKey 分页key 默认 pagination
    */
-  handleListDataCommon: function(vm, data, options = {}) {
+  handleListDataCommon: function (vm, data, options = {}) {
     const loadingKey = options.loadingKey || 'loading'
     const refreshingKey = options.refreshingKey || 'refreshing'
     const finishedKey = options.finishedKey || 'finished'
@@ -294,7 +294,7 @@ const action = {
     vm[resultTypeKey] = this.handleResultType(vm, options)
     vm[resultMessageKey] = null
   },
-  handleResultType: function(vm, options) {
+  handleResultType: function (vm, options) {
     const resultKey = options.resultKey || 'listData'
     const finishedKey = options.finishedKey || 'finished'
     const list = vm[resultKey]
@@ -312,7 +312,7 @@ const action = {
     }
     return listData.length >= totalCount
   },
-  handleErrorData: function(vm, e, options = {}) {
+  handleErrorData: function (vm, e, options = {}) {
     const loadingKey = options.loadingKey || 'loading'
     const refreshingKey = options.refreshingKey || 'refreshing'
     const finishedKey = options.finishedKey || 'finished'
@@ -327,7 +327,7 @@ const action = {
   /**
  *  设置分页设置
  */
-  setPagination: function(pagination, defaultPagination) {
+  setPagination: function (pagination, defaultPagination) {
     pagination.page = defaultPagination ? defaultPagination.page || common.PAGE : common.PAGE
     pagination.limit = defaultPagination ? defaultPagination.limit || common.LIMIT : common.LIMIT
   },
@@ -335,8 +335,8 @@ const action = {
   /**
  * 设置排序
  */
-  setSorts: function(sorts, sort, defaultSorts = {}) {
-    const defaultSortsData = function() {
+  setSorts: function (sorts, sort, defaultSorts = {}) {
+    const defaultSortsData = function () {
       for (const key in defaultSorts) {
         sorts[key] = defaultSorts[key]
       }
@@ -363,7 +363,7 @@ const action = {
  * @param {} page 分页
  * @param {} sorts 排序
  */
-  formatParams: function(params, pagination, sorts) {
+  formatParams: function (params, pagination, sorts) {
     const results = {}
     if (params) {
       results.parameters = Object.keys(params).map((k) => {
@@ -397,7 +397,7 @@ const action = {
   /**
  * 下载
  */
-  download: function(data, fileName, responseType = 'application/octet-stream') {
+  download: function (data, fileName, responseType = 'application/octet-stream') {
     const blob = data instanceof Blob ? data : new Blob([data], { type: responseType })
     if ('download' in document.createElement('a')) { // 非IE下载
       const url = window.URL.createObjectURL(blob)
@@ -417,10 +417,10 @@ const action = {
   /**
  * 导出文件
  */
-  exportFile: function(data, fileName, responseType = 'application/octet-stream') {
+  exportFile: function (data, fileName, responseType = 'application/octet-stream') {
     this.download(data, fileName, responseType)
   }
 
 }
 
-export default action
+export default action

+ 3 - 3
src/utils/common.js

@@ -3,7 +3,7 @@ import { mapValues } from 'lodash'
 import { encryptByAes } from '@/utils/encrypt'
 // import { preview } from '@/business/platform/form/utils/custom/preview'
 import request from './joinCURD'
-import getRequest from './general'
+// import getRequest from './general'
 import pinyin4js from 'pinyin4js'
 // import { snapshoot } from "@/api/platform/file/attachment";
 import { getNextIdByAlias } from '@/api/platform/system/identity'
@@ -234,6 +234,6 @@ export default {
   // removeFormData,
   replaceNullWithEmpty,
   Utils,
-  ActionUtils,
-  getRequest
+  ActionUtils
+  // getRequest
 }

+ 4 - 2
src/views/platform/bpmn/completed/index.vue

@@ -73,8 +73,10 @@
         typeTreePopup: false,
         searchForms: {
           forms: [
-            { prop: 'Q^inst.subject_^SL', label: '事物名称', fieldType: 'text' },
-            { prop: 'Q^inst.proc_def_name_^SL', label: '事物说明', fieldType: 'text' },
+
+            { prop: 'Q^inst.subject_^SL', label: '事务名称', fieldType: 'text' },
+            // { prop: 'Q^inst.proc_def_name_^SL', label: '事务说明', fieldType: 'text' },
+            { prop: 'Q^inst.subject_^SL', label: '事务说明', fieldType: 'text' },
             { prop: ['Q^inst.create_time_^DL', 'Q^inst.create_time_^DG'], label: '创建时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' } },
             {
               prop: 'Q^inst.status_^S', label: '状态', fieldType: 'checker', cols: 3, options: [

+ 5 - 4
src/views/platform/bpmn/handled/index.vue

@@ -18,10 +18,10 @@
       <van-list v-model="loading" :finished="finished" @load="loadData">
         <van-cell v-for="(item,index) in listData" :key="item.id+index" :title="item.taskName"
           :label="getTaskDesc(item.subject)" size="large" @click="onClick(item,index)">
-          <template slot="icon">
+          <!-- <template slot="icon">
             <ibps-avatar :icon="_randomIcon(index)" :text="item.name" :bg-color="_randomColor(index)" radius="4"
               icon-prefix="ibps-icon" class="ibps-mr-10" />
-          </template>
+          </template> -->
           <span>{{ item.createTime|formatRelativeTime }}</span>
           <div>
             <!-- <van-tag plain :type=" item.status | optionsFilter(bpmnStatusOptions,'type')">{{ item.status | optionsFilter(bpmnStatusOptions) }}</van-tag> -->
@@ -76,8 +76,9 @@
         typeTreePopup: false,
         searchForms: {
           forms: [
-            { prop: 'Q^SUBJECT_^SL', label: '事物名称', fieldType: 'text' },
-            { prop: 'Q^TASK_NAME_^SL', label: '事物说明', fieldType: 'text' },
+            { prop: 'Q^SUBJECT_^SL', label: '事务名称', fieldType: 'text' },
+            // { prop: 'Q^TASK_NAME_^SL', label: '事务说明', fieldType: 'text' },
+            { prop: 'Q^inst.subject_^SL', label: '事务说明', fieldType: 'text' },
             { prop: ['Q^COMPLETE_TIME_^DL', 'Q^COMPLETE_TIME_^DG'], label: '创建时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' } },
             {
               prop: 'Q^APO.STATUS_^S', label: '是否结束', fieldType: 'checker', cols: 3, valueKey: 'value', options: [

+ 6 - 4
src/views/platform/bpmn/my-draft/index.vue

@@ -84,8 +84,9 @@
         typeTreePopup: false,
         searchForms: {
           forms: [
-            { prop: 'Q^subject_^SL', label: '事物名称', fieldType: 'text' },
-            { prop: 'Q^proc_def_name_^SL', label: '事物说明', fieldType: 'text' },
+            { prop: 'Q^subject_^SL', label: '事务名称', fieldType: 'text' },
+            // { prop: 'Q^proc_def_name_^SL', label: '事务说明', fieldType: 'text' },
+            { prop: 'Q^inst.subject_^SL', label: '事务说明', fieldType: 'text' },
             { prop: ['Q^create_time_^DL', 'Q^create_time_^DG'], label: '创建时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' } }
           ]
         },
@@ -133,7 +134,8 @@
       },
       /**
        * 加载数据
-       */
+       * 
+      */
       loadData() {
         this.loading = true
         myDraft(this.getSearcFormData()).then(response => {
@@ -154,7 +156,6 @@
         if (this.$utils.isNotEmpty(this.moreParams)) {
           params = Object.assign(params, this.moreParams)
         }
-
         return ActionUtils.formatParams(
           params,
           this.pagination,
@@ -210,6 +211,7 @@
         }
         return v.split('#')[1] || ''
       },
+      // 点击左边显示
       clickType() {
         this.typeTreePopup = true
       },

+ 3 - 2
src/views/platform/bpmn/my-request/index.vue

@@ -76,8 +76,9 @@
         typeTreePopup: false,
         searchForms: {
           forms: [
-            { prop: 'Q^subject_^SL', label: '事物名称', fieldType: 'text' },
-            { prop: 'Q^proc_def_name_^SL', label: '事物说明', fieldType: 'text' },
+            { prop: 'Q^subject_^SL', label: '事务名称', fieldType: 'text' },
+            // { prop: 'Q^proc_def_name_^SL', label: '事务说明', fieldType: 'text' },
+            { prop: 'Q^inst.subject_^SL', label: '事务说明', fieldType: 'text' },
             { prop: ['Q^create_time_^DL', 'Q^create_time_^DG'], label: '创建时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' } }
           ]
         },

+ 607 - 0
src/views/platform/bpmn/my-test/examPop.vue

@@ -0,0 +1,607 @@
+<template>
+  <!-- v-model="ReachBottomShow" @close="onClose" custom-style="height: 100%" ref="examPopup" -->
+  <!-- :style="{ width: '80%', height: '55%' }" -->
+  <!-- <van-popup :style="{ width: '100%', height: '100%' }" v-model="showPop"> -->
+  <!-- 标题 -->
+  <div style="padding: 8% 1% 5% 1%;">
+    <van-row>
+      <van-col span="2" @click="handInAnExaminationPaperBtn()"> <van-icon name="arrow-left" size="18px"
+          color="	#1E90FF" /></van-col>
+      <van-col span="20">剩余时间:不限</van-col>
+      <van-col span="2" @click="answerSheet=true"><van-icon name="notes-o" size="18px" color="	#1E90FF" /></van-col>
+    </van-row>
+    <!-- 进度条 -->
+    <div style="padding: 5% 4%;">
+      <van-progress :percentage="schedule" color="#1E90FF" stroke-width="8" />
+    </div>
+    <!-- 题的展示 -->
+    <div v-if="popList[questionsIndex]" class="bodyCenter">
+      <!-- 题型 -->
+      <div style="padding: 0 3%;"><van-tag plain type="primary"
+          style="padding: 1%;box-sizing: border-box;">{{popList[questionsIndex]?popList[questionsIndex].questionType:''}}</van-tag>
+      </div>
+    </div>
+    <!-- 题号,题目,分数 -->
+    <div style="padding: 4% 1%;">
+      <div class="quesTit">
+        <span>{{popList[questionsIndex]?`【${questionsIndex+1}】 ${popList[questionsIndex].stem} `:''}}
+          <span class="scoreTag">{{popList[questionsIndex]?popList[questionsIndex].score+'分':''}}</span>
+        </span>
+      </div>
+      <!-- 图片展示区 -->
+      <div style="display:flex" v-if="popList[questionsIndex] && popList[questionsIndex].pdfUrl">
+        <div class="fujianImg" v-for="(item,i) in popList[questionsIndex].pdfUrl" :key="i">
+          <img style="width:40%" :src="item" @click="showMaskPop(item)">
+        </div>
+      </div>
+      <!-- 选项 -->
+      <div style="margin: 2% 0;">
+        <div>
+          <!-- 单选题 -->
+          <van-radio-group v-model="popListAnswer[questionsIndex]" @change="radioGroupChange" ref="radioOptions"
+            class="radioGro" v-if="popList[questionsIndex]&&popList[questionsIndex].questionType=='单选题'">
+            <van-radio class="radioAlign" v-for="(item, index) in popList[questionsIndex].options" :key="index"
+              :name="item.value">{{`${item.label}.
+              ${item.value}`}}</van-radio>
+          </van-radio-group>
+          <!-- 多选题 -->
+          <van-checkbox-group ref="checkboxOptions" class="radioGro"
+            v-if="popList[questionsIndex]&&popList[questionsIndex].questionType=='多选题'"
+            v-model="popListAnswer[questionsIndex]" @change="checkboxGroupChange">
+            <van-checkbox class="radioAlign" v-for="(item, index) in popList[questionsIndex].options" :key="index"
+              :name="item.value">{{`${item.label}.${item.value}`}}
+            </van-checkbox>
+          </van-checkbox-group>
+        </div>
+        <!-- 判断对错 -->
+        <van-radio-group ref="radioOptions" class="radioGro" v-model="popListAnswer[questionsIndex]"
+          @change="radioGroupChange" v-if="popList[questionsIndex]&&popList[questionsIndex].questionType=='判断题'">
+          <van-radio class="radioAlign" v-for="(item, index) in judgeOp" :key="index"
+            :name="item.value">{{`${item.value}`}}</van-radio>
+        </van-radio-group>
+        <!-- 输入框 -->
+        <van-field v-model="popListAnswer[questionsIndex]" placeholder="请输入内容" :border="true" clearable maxlength="1000"
+          style="font-size: 20px; background-color: #f7f7f7;"
+          v-if="popList[questionsIndex]&&popList[questionsIndex].questionType=='填空题'" />
+        <!-- 简答题 -->
+        <van-field v-model="popListAnswer[questionsIndex]" placeholder="请输入内容" type="textarea" :border="true" clearable
+          maxlength="2000" style="font-size: 16px; background-color: #f7f7f7; height: 10%;"
+          v-if="popList[questionsIndex]&&popList[questionsIndex].questionType=='简答题'" />
+
+      </div>
+      <!--按钮显示  -->
+      <div class="bodyFloor">
+        <van-row style="text-align: center;">
+          <van-col span="12"><van-button style="width: 60%;" @click="preQuestion()" type="default">{{questionsIndex==0
+              ?
+              '无':'上一题'}}</van-button></van-col>
+          <van-col span="12"><van-button style="width:60%;"
+              @click="questionsIndex==popList.length-1?handInAnExaminationPaperBtn():nextQuestion()"
+              type="info">{{questionsIndex==popList.length-1 ? '交卷':'下一题'}}</van-button></van-col>
+        </van-row>
+      </div>
+    </div>
+    <!-- 答题卡 -->
+    <van-popup v-model="answerSheet" position="bottom" :style="{ width: '100%', height: '60%' }" closeable>
+      <div class="groupCO">答题卡</div>
+      <div class="tipColorsGro">
+        <van-row>
+          <van-col span="8" style="text-align: right;"><span class="tipColorsC"
+              style="background-color: rgb(64, 158, 255);"></span>已作答</van-col>
+          <van-col span="8" style="text-align: center;"><span class="tipColorsC"
+              style="background-color: #dddcdc;"></span>未作答</van-col>
+          <van-col span="8"><span class="tipColorsC" style="background-color:#30c2bd ;"></span>作答中</van-col>
+        </van-row>
+      </div>
+      <div class="circleGroOption">
+        <div class="styleC">
+          <van-grid :column-num="5" :border="false" style="width: 90%;margin: auto;">
+            <van-grid-item v-for="index in popListAnswer.length" :key="index">
+              <template #text>
+                <div style="padding: 17% 20%;border-radius: 50%; color: #fff;"
+                  :class="questionsIndex&&(index-1)==questionsIndex?'circleOption pitchOn':judgeType(index)?'circleOption fulfilled':'circleOption'"
+                  @click="changQuesInd(index-1)">{{index}}</div>
+              </template>
+            </van-grid-item>
+          </van-grid>
+          <div>
+          </div>
+        </div>
+      </div>
+      <!-- 交卷按钮 -->
+      <div class="footDiv">
+        <van-button type="info" class="submitBtn" @click="handInAnExaminationPaperBtn()">交卷</van-button>
+      </div>
+    </van-popup>
+    <van-dialog v-model="showConfirmationBox" show-cancel-button @confirm="confirmEvent" :showConfirmButton="endInd"
+      :showCancelButton="endInd">
+      <template #title>
+        <span style="font-size: 18px;color: #f80303; font-weight: 600;">提示</span>
+      </template>
+      <div style="padding: 5%;line-height: 2em;text-indent: 2em;">{{confirmationBoxContent()}}</div>
+    </van-dialog>
+    <!-- 遮罩层 -->
+    <van-overlay v-if="maskNum!=''" :show="showMask" @click="showMask = false">
+      <div class="warp"><img class="mackImg" :src="maskNum" alt="" srcset=""></div>
+    </van-overlay>
+  </div>
+
+  <!-- </van-popup> -->
+
+</template>
+<script>
+
+  export default {
+    name: "examPop",
+    props: {
+      show: {
+        type: Boolean,
+        default: false
+      },
+      bankId: {
+        type: String,
+        default: ''
+      },
+      listData: {
+        type: Object,
+        default: {}
+      },
+      notStart: {
+        type: String,
+        default: ''
+      }
+    },
+    data() {
+      const getUser = _ => {
+        if (this.info && this.info.user.id) {
+          return info.user.id || ''
+        } else {
+          return ''
+        }
+      }
+      return {
+        show1: true,
+        result: [],
+        radio: 1,
+        userInfo: getUser(),
+        showPop: this.show,
+        popList: [],
+        questionsIndex: 0,
+        preBtn: {
+          width: '47%',
+          height: '65%',
+          margin: 0,
+          // backgroundColor:'rgba(48, 194, 189,0.4)'
+          backgroundColor: '#FF9900'
+        },
+        nextBtn: {
+          width: '47%',
+          height: '65%',
+          margin: 0,
+          backgroundColor: '#30c2bd'
+        },
+        preBtnC: {
+          backgroundColor: '#f29100'
+        },
+        nextBtnC: {
+          backgroundColor: '#71d5a1'
+        },
+        scrollWhere: 0,
+        popListAnswer: [],
+        showMask: false,
+        maskNum: '',
+        judgeOp: [{
+          value: '√',
+          label: '√'
+        }, {
+          value: '×',
+          label: '×'
+        }],
+        schedule: 0,
+        answerSheet: false,
+        showConfirmationBox: false,
+        noQuestionNumber: [],
+        confirmationBoxT: {
+          'font-size': '35rpx',
+          'font-weight': 600
+        },
+        confirmationBoxC: {
+          'font-size': '28rpx',
+        },
+        confirmationBoxA: {
+          'font-size': '26rpx',
+        },
+        confirmationBoxO: {
+          'font-size': '26rpx',
+          'color': '#30c2bd'
+        },
+        endInd: true
+      }
+    },
+    watch: {
+      showPop: {
+        handler: function (val, oldVal) {
+          if (val == true) {
+            // this.stopScroll()
+          }
+          else {
+            // this.startScroll()
+          }
+          this.$emit('updataSet', val)
+        },
+        immediate: true
+      },
+      popListAnswer: {
+        handler: function (val, oldVal) {
+          // if(val!=null){
+          let accomplish = 0
+          this.noQuestionNumber.splice(0, this.noQuestionNumber.length)
+          val.forEach((item, i) => {
+            if (Array.isArray(item) && item.length != 0) {
+              accomplish += 1
+            } else if (item != '' && item != null) {
+              accomplish += 1
+            } else {
+              this.noQuestionNumber.push(i + 1)
+            }
+          })
+          // console.log(accomplish,val.length,accomplish/val.length,(accomplish/val.length).toFixed(2),((accomplish/val.length)*100).toFixed(0))
+          this.schedule = val.length > 0 ? ((accomplish / val.length) * 100).toFixed(0) * 1 : 0
+          // }
+
+        },
+        immediate: true
+      },
+    },
+    created() {
+      this.getInit()
+    },
+    mounted() {
+
+    },
+    methods: {
+      onChange(evnet) {
+        // console.log("evnet", evnet);
+      },
+      stopScroll() {
+        let mid = this.scrollWhere
+        // document.documentElement.style.overflow='hidden';
+        // document.body.style.overflow="hidden";
+        document.getElementsByClassName('tabulation')[0].style.overflow = 'hidden'
+        // document.documentElement.style.position='fixed';
+        document.getElementsByClassName('tabulation')[0].style.position = 'fixed';
+        // document.documentElement.style.top=-mid+'px';
+        document.getElementsByClassName('tabulation')[0].style.top = -mid + 'px';
+      },
+      //启用页面滚动
+      startScroll() {
+        // document.documentElement.style.overflow='';
+        document.getElementsByClassName('tabulation')[0].style.overflow = 'auto';
+        document.getElementsByClassName('tabulation')[0].style.position = 'static';
+        window.scrollTo(0, this.scrollWhere)
+        this.scrollWhere = 0
+      },
+      getInit() {
+        const sql = `select id_ as questionId, ti_gan_ as stem, ti_xing_ as questionType, fu_tu_ as img, xuan_xiang_lei_xi as optionType, da_an_ as options, xuan_xiang_shu_ as optionsLength, fen_zhi_ as score, ping_fen_fang_shi as rateType, ping_fen_ren_ as rater, zheng_que_da_an_ as rightKey from t_questions where parent_id_ = '${this.bankId}' and zhuang_tai_ = '启用' order by field(ti_xing_, '单选题', '多选题', '判断题', '填空题', '简答题')`
+        if (this.bankId != '') {
+          this.$common.request('sql', sql).then(res => {
+            const { data = [] } = res.variables || {}
+            this.popList = data
+            if (!data.length) {
+              this.$message.error('获取题目信息失败!')
+              this.closeDialog()
+              return
+            }
+            // data.map((item, i) => {
+            //   item.answer = item.questionType === '多选题' ? [] : null
+
+            //   this.popListAnswer.push(item.answer)
+
+            // })
+            data.map((item, i) => {
+              if (item.options) {
+                const temp = JSON.parse(item.options) || {}
+                const o = []
+                Object.keys(temp).forEach(key => {
+                  if (item.questionType === '多选题') {
+
+                    o.push({
+                      label: key,
+                      value: temp[key],
+                      checked: false,
+                      disabled: false
+                    })
+                  } else {
+                    o.push({
+                      label: key,
+                      value: temp[key]
+                    })
+                  }
+
+                })
+                item.options = o
+              } else {
+                item.options = Array.from({ length: item.optionsLength }, (v, k) => {
+                  return { answer: null }
+                })
+              }
+              item.img = item.img ? JSON.parse(item.img) : ''
+              item.answer = item.questionType === '多选题' ? [] : null
+              this.popListAnswer.push(item.answer)
+              if (item.img != "" && item.img.length > 0) {
+                let astr = ''
+                for (let a = 0; a < item.img.length; a++) {
+                  if (a == 0) {
+                    astr = item.img[a].id
+                  } else {
+                    astr = astr + ',' + item.img[a].id
+                  }
+                }
+                let sql1 = `select FILE_PATH_  from ibps_file_attachment  WHERE id_ in (${astr})`
+                this.$common.request('sql', sql1).then(res => {
+                  if (res.state == 200) {
+                    const data = res.variables.data
+                    if (data.length > 0) {
+                      let pdfUrlA = []
+                      for (let g = 0; g < data.length; g++) {
+                        let dataItem = data[g]
+                        let url = 'http://dev1.local/' + dataItem.FILE_PATH_
+                        pdfUrlA.push(url)
+                      }
+                      // item.pdfUrl = pdfUrl
+                      this.$set(item, 'pdfUrl', pdfUrlA)
+
+                      // this.popList = [...this.popList, item]
+                      // this.popList.push(item)
+                      // this.popList[i].pdfUrl = pdfUrlA
+                    }
+                  }
+                })
+              } else {
+                // this.popList = [...this.popList, item]
+                // this.popList[i] = item
+              }
+
+            })
+            // this.popList = data
+            // this.loading = false
+            // resolve(data)
+          }).catch(error => {
+            // this.loading = false
+            // reject(error)
+          })
+        }
+      },
+      countDown(time) {
+        this.endInd = false
+        this.handInAnExaminationPaperBtn()
+      },
+      preQuestion() {
+        if (this.questionsIndex - 1 >= 0) {
+          this.questionsIndex = this.questionsIndex - 1
+        }
+      },
+      // 点击下一题
+      nextQuestion() {
+        if (this.questionsIndex + 1 < this.popList.length) {
+          this.questionsIndex = this.questionsIndex + 1
+        }
+      },
+      showMaskPop(i) {
+        this.showMask = true
+        this.maskNum = i
+      },
+      radioGroupChange(n) {
+        // 选中第几个
+        // this.popList[this.questionsIndex].options.forEach((item, m) => {
+        //   if (item.value == n) {
+        //     this.$refs.radioOptions.$children[0].$children[m].$el.className = 'u-radio radioD radioX'
+        //   } else {
+        //     this.$refs.radioOptions.$children[0].$children[m].$el.className = 'u-radio radioD'
+        //   }
+        // })
+
+      },
+      radioChange(t, i) { },
+      checkboxGroupChange(n) {
+
+
+      },
+      checkboxChange(n) {
+        this.popListAnswer[this.questionsIndex].splice(0, this.popListAnswer[this.questionsIndex].length)
+        let index = this.popList[this.questionsIndex].options.findIndex(i => i.value == n.name)
+        this.popList[this.questionsIndex].options[index].checked = n.value
+        this.popList[this.questionsIndex].options.forEach((item, m) => {
+          if (item.checked == true) {
+            this.popListAnswer[this.questionsIndex].push(item.value)
+            this.$refs.checkboxOptions.$children[0].$children[m].$el.className = 'u-checkbox radioD radioX'
+          } else {
+            this.$refs.checkboxOptions.$children[0].$children[m].$el.className = 'u-checkbox radioD'
+          }
+
+        })
+      },
+      judgeType(index) {
+        if (Array.isArray(this.popListAnswer[index - 1]) && this.popListAnswer[index - 1].length != 0) {
+          return true
+        } else if (this.popListAnswer[index - 1] != '' && this.popListAnswer[index - 1] != null) {
+          return true
+        } else {
+          return false
+        }
+      },
+      changQuesInd(ind) {
+        this.questionsIndex = ind
+        this.answerSheet = false
+      },
+      handInAnExaminationPaperBtn() {
+        // this.showPop=false
+        this.showConfirmationBox = true
+        // this.handInAnExaminationPaperEvent()
+      },
+      handInAnExaminationPaperEvent() {
+        this.submitForm(this.dealFormData())
+      },
+      submitForm(data) {
+        let that = this
+        const addParams = {
+          tableName: 't_examination_detail',
+          paramWhere: data
+        }
+        const isAllReviewed = !data.some(i => i.shi_fou_yi_yue_ === '否')
+        const updateParams = {
+          tableName: 't_examination',
+          updList: [
+            {
+              where: {
+                id_: this.notStart
+              },
+              param: {
+                jie_shu_shi_jian_: that.$common.getDateNow(19),
+                ti_ku_zong_fen_: data.reduce((sum, item) => sum + parseFloat(item.fen_zhi_), 0),
+                zhuang_tai_: isAllReviewed ? '已完成' : '已交卷',
+                de_fen_: isAllReviewed ? data.reduce((sum, item) => sum + parseFloat(item.de_fen_), 0) : ''
+                // sheng_yu_shi_chan: ''
+              }
+            }
+          ]
+        }
+        that.$common.request('add', addParams).then(() => {
+          that.$common.request('update', updateParams).then(() => {
+            // this.$message.success('提交成功!')
+            // this.closeDialog()
+          })
+        })
+      },
+      dealFormData() {
+        let that = this
+        const submitData = []
+        const time = that.$common.getDateNow(19)
+        that.popList.forEach((item, index) => {
+          item.answer = that.popListAnswer[index]
+          const autoType = ['单选题', '多选题', '判断题'].includes(item.questionType)
+          const multipleType = ['多选题', '填空题'].includes(item.questionType)
+          const selectType = ['多选题', '单选题'].includes(item.questionType)
+          submitData.push({
+            parent_id_: that.notStart,
+            ti_mu_id_: item.questionId,
+            ti_gan_: item.stem,
+            ti_xing_: item.questionType,
+            fen_zhi_: item.score,
+            fu_tu_: item.img ? JSON.stringify(item.img) : '',
+            xuan_xiang_lei_xi: item.optionType,
+            xuan_xiang_: selectType ? JSON.stringify(item.options) : '',
+            can_kao_da_an_: item.rightKey,
+            ping_fen_fang_shi: item.rateType,
+            ping_fen_ren_: item.rater,
+            hui_da_: multipleType && item.answer ? JSON.stringify(item.answer) : item.answer,
+            shi_fou_yi_yue_: autoType ? '是' : '否',
+            ping_yue_shi_jian: autoType ? time : '',
+            de_fen_: autoType ? this.getScore(item) : '',
+            jie_xi_: ''
+          })
+        })
+        return submitData
+      },
+      getScore({ questionType, answer, rightKey, score }) {
+        if (questionType === '多选题') {
+          const temp = rightKey.split(',')
+          return answer.length === temp.length && answer.every(i => temp.includes(i)) ? score : 0
+        } else {
+          return answer === rightKey ? score : 0
+        }
+      },
+      confirmationBoxContent(e) {
+        let that = this
+        let str = this.endInd == false ? `考试时间已到,即将自动交卷,请勿关闭页面防止数据丢失!` : this.noQuestionNumber.length ? `您还有第${this.noQuestionNumber.join('、')}题未作答,您确定要直接交卷吗?` : '您已完成作答,确定要交卷吗?'
+        if (this.endInd == false) {
+          console.log('jjjjjjjjjjjj')
+          setTimeout(() => {
+            that.confirmEvent()
+          }, 3000)
+        }
+        return str
+      },
+      confirmEvent() {
+        this.showPop = false
+        this.handInAnExaminationPaperEvent()
+      }
+    }
+  }
+</script>
+<style scoped lang="scss">
+  .radioAlign {
+    padding: 3% 3%;
+    /* background-color: #fcf9f9; */
+  }
+
+  .bodyFloor {
+    width: 100%;
+    position: fixed;
+    top: 100%;
+    left: 0;
+    transform: translateY(-300%);
+  }
+
+  .groupCO {
+    height: 10%;
+    font-size: 18px;
+    font-weight: 600;
+    color: rgb(50, 50, 50);
+    text-align: center;
+    padding: 5%;
+    box-sizing: border-box;
+  }
+
+  .tipColorsGro {
+    color: #999;
+    font-size: 15px;
+    height: 5%;
+
+    span {
+      display: inline-block;
+      width: 10px;
+      height: 10px;
+      border-radius: 10px;
+      background-color: #30c2bd;
+    }
+  }
+
+  .footDiv {
+    width: 100%;
+    position: fixed;
+    top: 100%;
+    transform: translateY(-100%);
+
+    .submitBtn {
+      width: 100%;
+    }
+  }
+
+  .circleOption {
+    background-color: #dddcdc;
+  }
+
+  .fulfilled {
+    background-color: rgb(64, 158, 255);
+  }
+
+  .pitchOn {
+    background-color: #30c2bd;
+  }
+
+  .fujianImg {
+    width: 94%;
+    margin: 2% auto;
+
+  }
+
+  .scoreTag {
+    display: inline-block;
+    border: 1px solid rgb(64, 158, 255);
+    font-size: 12px;
+    padding: 1% 1% 0 1%;
+    border-radius: 20%;
+
+  }
+</style>

+ 560 - 0
src/views/platform/bpmn/my-test/index.vue

@@ -0,0 +1,560 @@
+<template>
+  <div :class="{'ibps-fixed-toolbar':checkMode}">
+    <van-sticky>
+      <van-nav-bar :title="generateTitle($route.name,$route.params.title||$route.meta.title)"
+        :left-text="$t('common.button.back')" :right-text="$utils.isNotEmpty(listData)?rightText:''" left-arrow
+        @click-left="$router.push({ name: 'dashboard' })" @click-right="toCheckMode()" />
+      <van-search v-model="subject" show-action placeholder="请输入搜索关键词" @search="onSearch">
+        <template #left>
+          <van-icon name="bars" :class="{'ibps-active':$utils.isNotEmpty(typeId)}" class="ibps-pr-5"
+            @click="clickType" />
+        </template>
+        <template #action>
+          <van-icon name="filter-o" :class="{'ibps-active':stateActive}" @click="clickMoreSearch" />
+        </template>
+      </van-search>
+    </van-sticky>
+    <!-- 内容展示区 -->
+    <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
+      <van-list v-model="loading" :finished="finished" @load="loadData">
+        <van-checkbox-group v-model="checkedIds">
+          <van-cell v-for="(item,index) in listData" :key="item.id+index" :title="item.examName">
+            <!-- :label="getTaskDesc(item.subject)" @click="onClick(item,index)"> -->
+            <!-- 插入图标 -->
+            <template slot="icon">
+              <van-checkbox v-if="checkMode" ref="checkboxes" :name="item.id" class="ibps-mr-10" />
+              <!-- <ibps-avatar v-else :icon="_randomIcon(index)" :text="item.name" :bg-color="_randomColor(index)"
+                radius="4" icon-prefix="ibps-icon" class="ibps-mr-10" /> -->
+              <van-icon name="notes-o" size="1.5rem" color="#1E90FF" />
+            </template>
+            <template #label>
+              <van-row>
+                <van-col span="12">考试类别</van-col>
+                <van-col span="12">{{item.examType==''?'/':item.examType==null?'/':item.examType}}</van-col>
+              </van-row>
+              <van-row>
+                <van-col span="12">考试状态</van-col>
+                <van-col span="12">{{item.examState==''?'/':item.examState==null?'/':item.examState}}</van-col>
+              </van-row>
+              <van-row>
+                <van-col span="12">限考时间</van-col>
+                <van-col span="12">{{item.limitDate==''?'/':item.limitDate==null?'/':item.limitDate}}</van-col>
+              </van-row>
+              <van-row>
+                <van-col span="12">限考次数</van-col>
+                <van-col span="12">{{item.limitCount==''?'/':item.limitCount==null?'/':item.limitCount}}</van-col>
+              </van-row>
+              <van-row>
+                <van-col span="12">考试时长</van-col>
+                <van-col
+                  span="12">{{item.duration==''?'/':item.duration==null?'/':item.duration=='不限'?item.duration:transformTime(item.duration)}}</van-col>
+              </van-row>
+              <van-row>
+                <van-col span="12">考试题库</van-col>
+                <van-col span="12">{{item.bankName==''?'/':item.bankName==null?'/':item.bankName}}</van-col>
+              </van-row>
+            </template>
+            <!-- 插入内容 -->
+            <span>{{ item.createTime|formatRelativeTime }}</span>
+            <div style="margin-top: 90%;height: 100%;">
+              <van-tag type="primary" size="medium" @click="onClick(item,index)">开始考试</van-tag>
+            </div>
+            <!-- <div> -->
+            <!-- <van-tag plain :type=" item.status | optionsFilter(bpmnStatusOptions,'type')">{{ item.status | optionsFilter(bpmnStatusOptions) }}</van-tag> -->
+            <!-- <van-tag size="medium"
+                :color="item.status | optionsFilter(bpmnStatusOptions,'type') | optionsFilter(colorOptions,'color','type')"
+                :text-color="item.status | optionsFilter(bpmnStatusOptions,'type') | optionsFilter(colorOptions,'textColor','type')">
+                {{ item.status| optionsFilter(bpmnStatusOptions) }}</van-tag> -->
+            <!-- </div> -->
+          </van-cell>
+        </van-checkbox-group>
+        <ibps-list-result-page :result-type="resultType" :error-type="errorType" :result-message="resultMessage" />
+      </van-list>
+    </van-pull-refresh>
+    <ibps-toolbar v-show="checkMode" :actions="mainActions" />
+    <!-- 点击搜索的右边显示 -->
+    <ibps-more-search :show="moreSearchPopup" :search-forms="searchForms" @callback="onMoreSearch"
+      @close="show => moreSearchPopup = show" @reset-form="resetForm" />
+    <!-- 点击搜索的左边显示 -->
+    <ibps-type-tree v-model="typeTreePopup" title="流程分类" category-key="FLOW_TYPE" @node-click="clickTypeNode"
+      @close="visible => typeTreePopup = visible" />
+    <!-- 遮罩层 -->
+    <template>
+      <van-popup v-model="ReachBottomShow" @close="onClose" custom-style="height: 100%" ref="examPopup"
+        :style="{ width: '80%', height: '55%',padding:'5%'}">
+        <div style="font-size: 20px; text-align: center;color: rgb(68, 152, 248);font-weight: 700;">
+          提示</div>
+        <div style="text-align: left;padding:  2%; font-weight: 700;font-size: 15px;color: #333;">当前考试信息如下:
+        </div>
+        <div style="width: 90%;margin: auto;">
+          <van-row class="examRow">
+            <van-col span="8" class="popupTitle">考试名称:</van-col>
+            <van-col span="16"
+              class="popupContent">{{examPopup.examName==''?'/':examPopup.examName==null?'/':examPopup.examName}}</van-col>
+          </van-row>
+          <van-row class="examRow">
+            <van-col span="8" class="popupTitle">考试题库:</van-col>
+            <van-col span="16"
+              class="popupContent">{{examPopup.bankName==''?'/':examPopup.bankName==null?'/':examPopup.bankName}}</van-col>
+          </van-row>
+          <van-row class="examRow">
+            <van-col span="8" class="popupTitle">题目数量:</van-col>
+            <van-col span="16"
+              class="popupContent">{{examPopup.questionCount==''?'/':examPopup.questionCount==null?'/':examPopup.questionCount}}</van-col>
+          </van-row>
+          <van-row class="examRow">
+            <van-col span="8" class="popupTitle">考试总分:</van-col>
+            <van-col span="16"
+              class="popupContent">{{examPopup.totalScore==''?'/':examPopup.totalScore==null?'/':examPopup.totalScore}}</van-col>
+          </van-row>
+          <van-row class="examRow">
+            <van-col span="8" class="popupTitle">考试人数:</van-col>
+            <van-col span="16"
+              class="popupContent">{{examPopup.examinee==''?'/':examPopup.examinee==null?'/':examPopup.examinee}}</van-col>
+          </van-row>
+          <van-row class="examRow">
+            <van-col span="8" class="popupTitle">限考时间:</van-col>
+            <van-col span="16"
+              class="popupContent">{{examPopup.limitDate==''?'/':examPopup.limitDate==null?'/':examPopup.limitDate}}</van-col>
+          </van-row>
+          <van-row class="examRow">
+            <van-col span="8" class="popupTitle">限考次数:</van-col>
+            <van-col span="16"
+              class="popupContent">{{examPopup.limitCount==''?'/':examPopup.limitCount==null?'/':examPopup.limitCount}}</van-col>
+          </van-row>
+          <van-row class="examRow">
+            <van-col span="8" class="popupTitle">考试时长:</van-col>
+            <van-col span="16"
+              class="popupContent">{{examPopup.duration==''?'/':examPopup.duration==null?'/':examPopup.duration}}</van-col>
+          </van-row>
+          <van-row class="examRow">
+            <van-col span="8" class="popupTitle">达标分数占比:</van-col>
+            <van-col span="16"
+              class="popupContent">{{examPopup.qualifiedRadio==''?'/':examPopup.qualifiedRadio==null?'/':examPopup.qualifiedRadio}}</van-col>
+          </van-row>
+          <van-row class="examRow">
+            <van-col span="8" class="popupTitle">计分方式:</van-col>
+            <van-col span="16"
+              class="popupContent">{{examPopup.scoringType==''?'/':examPopup.scoringType==null?'/':examPopup.scoringType}}</van-col>
+          </van-row>
+          <div style="margin:2% auto; font-size: 12px; color: red;text-align: left;">
+            开始考试后中途不允许退出,直至交卷或考试结束,退出视作提交试卷!是否立即开始考试?
+          </div>
+          <van-row class="examRowto">
+            <van-col span="12"> <van-button type="default" @click="ReachBottomShow=false">取消</van-button></van-col>
+            <van-col span="12"> <van-button type="info" @click="changeShowPop()">确定</van-button></van-col>
+          </van-row>
+        </div>
+      </van-popup>
+    </template>
+    <van-popup v-model="showPop" :style="{ width: '100%', height: '100%' }">
+      <exam-pop ref="childPop" v-if="showPop" :notStart="countTotal.notStart" :listData="examPopup"
+        :bankId=" examPopup.bankId" :show="showPop" @updataSet="updataSet" /></van-popup>
+    <van-divider v-if="footText">到底了~</van-divider>
+    <van-empty v-if="noData" description="暂无数据" />
+
+  </div>
+</template>
+<script>
+  import { mapState } from 'vuex'
+  import examPop from "./examPop.vue"
+  import ActionUtils from '@/utils/action'
+  import i18n from '@/utils/i18n'
+  import random from '@/mixins/random'
+  import bpmnStatus from '@/mixins/bpmnStatus'
+  import IbpsMoreSearch from '@/components/ibps-more-search'
+  import IbpsTypeTree from '@/business/platform/cat/type/tree'
+  import IbpsAvatar from '@/components/ibps-avatar'
+  import IbpsToolbar from '@/components/ibps-toolbar'
+  import IbpsListResultPage from '@/components/ibps-list-result-page'
+  import IbpsBpmnFormrenderDialog from '@/business/platform/bpmn/form/dialog'
+
+  export default {
+    components: {
+      IbpsMoreSearch,
+      IbpsTypeTree,
+      IbpsAvatar,
+      IbpsToolbar,
+      IbpsListResultPage,
+      IbpsBpmnFormrenderDialog,
+      examPop
+    },
+    mixins: [random, bpmnStatus],
+    data() {
+      const { userId, userList = [], deptList = [], menus, userInfo } = this.$store.getters
+      return {
+        footText: false,
+        showPop: false,
+        noData: false,
+        showConfirmationBoxList: true,
+        countTotal: {},
+        examPopup: '',
+        ReachBottomShow: false,
+        moreSearchPopup: false,
+        searchForms: {
+          forms: [
+            // { prop: 'Q^examName_^SL', label: '考试名称', fieldType: 'text' },
+            //   { prop: 'Q^bankName^SL', label: '题库名称', fieldType: 'text' },
+            { prop: 'examName', label: '考试名称', fieldType: 'text' },
+            { prop: 'bankName', label: '题库名称', fieldType: 'text' },
+            {
+              prop: 'examType', label: '考试类型', fieldType: 'checker', cols: 2, valueKey: 'value', options: [
+                { value: 'trainingExam', label: '培训考试' },
+                { value: 'POCTtraining', label: 'POCT培训' },
+                { value: 'selfAssessment', label: '自主考核' },
+                { value: 'routine', label: '常规' },
+              ]
+            },
+            // { prop: ['Q^startDate^DL^yyyy-MM-dd', 'Q^startDate^DG^yyyy-MM-dd'], label: '开始时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' } },
+            // { prop: ['Q^limitDate^DL^yyyy-MM-dd', 'Q^limitDate^DG^yyyy-MM-dd'], label: '限考时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' } },
+          ]
+        },
+        // './views/platform/bpmn/communication/communicationList
+        mainActions: [{
+          'name': this.$t('common.button.remove'),
+          'type': 'danger',
+          'callback': this.onRemove
+        }],
+        stateActive: false,
+        subject: '',
+        moreSubject: '',
+        subjectTitle: '',
+        typeId: '',
+        moreParams: {},
+        listData: [],
+        pagination: {},
+        sorts: {},
+
+        loading: false,
+        finished: false,
+        refreshing: false,
+        resultType: 'init',
+        errorType: null,
+        resultMessage: null,
+
+        checkMode: false,
+        checkedIds: [],
+        mainActions: [{
+          'name': this.$t('common.button.remove'),
+          'type': 'danger',
+          'callback': this.onRemove
+        }],
+
+        proInstId: '',
+        defId: '',
+        formrenderVisible: false,
+        formrenderTitle: '',
+        typeTreePopup: false,
+        checkMode: false,
+        keyword: '',
+        name: "全部",
+        current: 0,
+      }
+    },
+    computed: {
+      ...mapState('ibps/user', [
+        'info'
+      ]),
+      rightText() {
+        return this.checkMode ? this.$t('common.button.cancel') : this.$t('common.button.manage')
+      },
+      selectedIds() {
+        return this.checkedIds.join(',')
+      }
+    },
+
+    beforeRouteLeave(to, from, next) {
+      if (this.showPop == true) {
+        this.showConfirmationBoxList = true
+      } else {
+        next()
+      }
+    },
+
+    methods: {
+      // 点击开始考试
+      onClick(item, index) {
+        this.ReachBottomShow = true
+        this.examPopup = item
+      },
+
+      showPopup() {
+        this.ReachBottomShow = true
+      },
+      onClose() {
+        this.ReachBottomShow = false
+      },
+      // 点击确定进入考试界面
+      async changeShowPop() {
+        this.ReachBottomShow = false
+        if (this.countTotal.notStart && this.examPopup.bankId != '') {
+          // 已有未开始的试卷 更新开始时间
+          const updataParams = {
+            tableName: 't_examination',
+            updList: [{
+              where: {
+                id_: this.countTotal.notStart
+              },
+              param: {
+                zhuang_tai_: '进行中',
+                kai_shi_shi_jian_: this.$common.getDateNow(19)
+              }
+            }]
+          }
+          this.$common.request('update', updataParams)
+          this.showPop = true
+        } else {
+          // 无未开始试卷
+          let mid = this.examPopup
+          this.createPaper({ ...mid }, this.info)
+        }
+      },
+      async getExamCount(id) {
+        const param = id ? `exam_id_ = '${id}'` : 'exam_id_ is null'
+        const sql = `select id_, zhuang_tai_ from t_examination where ${param} and kao_shi_ren_ = '${this.userInfo}' and zhuang_tai_ != '已取消' order by bao_ming_shi_jian asc`
+        return new Promise((resolve, reject) => {
+          this.$common.request('sql', sql).then(res => {
+            const { data = [] } = res.data.variables || {}
+            const temp = data.find(item => item.zhuang_tai_ === '未开始')
+            resolve({
+              count: data.length,
+              notStart: temp ? temp.id_ : ''
+            })
+          }).catch(error => {
+            reject(error)
+          })
+        })
+      },
+      createPaper(data, examinees) {
+        let that = this
+        // const { first, second } = uni.getStorageSync('level') || {}
+        const { first = '', second = '' } = this.$store.getters.level
+        const { examId, bankId, examName, questionCount, totalScore, duration, qualifiedRadio, limitDate, limitCount } = data || {}
+        const examineeList = examinees.user.id.split(',')
+        const time = this.$common.getDateNow(19)
+        const paramWhere = examineeList.map(i => ({
+          exam_id_: examId,
+          ti_ku_id_: bankId,
+          di_dian_: second || first,
+          kao_shi_ren_: i,
+          bu_men_: '',
+          bao_ming_shi_jian: time,
+          kai_shi_shi_jian_: time,
+          ti_ku_zong_fen_: totalScore,
+          zhuang_tai_: '未开始',
+          sheng_yu_shi_chan: duration,
+          da_biao_zhan_bi_: qualifiedRadio
+        }))
+        const addParams = {
+          tableName: 't_examination',
+          paramWhere
+        }
+
+        if (that.examPopup.bankId != '') {
+          that.$common.request('add', addParams).then(res => {
+            const { cont } = res.variables || {}
+            if (cont.length) {
+              that.showPop = true
+            }
+          })
+        }
+
+      },
+      updataSet(v) {
+        this.showPop = v
+      },
+      generateTitle(name, title) { // generateTitle by vue-i18n
+        return i18n.generateTitle(name, title)
+      },
+      toCheckMode() {
+        if (this.$utils.isEmpty(this.listData)) {
+          return
+        }
+        if (this.checkMode) {
+          // this.show = true
+          this.checkedIds = []
+        }
+        this.checkMode = !this.checkMode
+      },
+      clickType() {
+        this.typeTreePopup = true
+      },
+      onSearch() {
+        this.stateActive = false
+        ActionUtils.initListData(this)
+        this.current = 0
+        this.listData = []
+        this.loadData()
+      },
+      clickMoreSearch() {
+        this.moreSearchPopup = true
+        this.stateActive = false
+      },
+      clickTypeNode(data) {
+        this.typeId = data.id
+        this.onMoreSearch({})
+      },
+      // 高级查询
+      onMoreSearch(params) {
+        // console.log("params", params, this.typeId);
+        if (this.$utils.isNotEmpty(this.typeId)) {
+          params['Q^type_id_^SL'] = this.typeId
+        }
+        this.moreParams = params
+        this.onSearch()
+        if (this.$utils.isNotEmpty(params)) {
+          this.stateActive = true
+        }
+      },
+      resetForm() {
+        this.typeId = ''
+      },
+      // 下拉刷新
+      onRefresh() {
+        this.footText = false
+        this.refreshing = true
+        this.finished = false
+        this.loading = true
+        this.onSearch()
+      },
+      onRefreshPage() {
+        this.checkedIds = []
+        this.checkMode = false
+        this.onRefresh()
+      },
+      /**
+       * 加载数据
+       */
+      loadData() {
+        this.loading = true
+        let page = 0
+        if (this.current === 0) {
+          page = 0
+        } else {
+          page = this.current * 10
+        }
+        let aa = JSON.parse(JSON.stringify(this.moreParams))
+        if ((aa !== '' && aa !== null && aa !== undefined && (typeof aa !== 'object' || Object.keys(aa).length > 0)) ||
+          (aa instanceof Array && aa.length > 0)) {
+          //   { prop: 'examName', label: '考试名称', fieldType: 'text' },
+          // { prop: 'bankName', label: '题库名称', fieldType: 'text' },
+          //   //  {examName: '自主考核', bankName: '提示', examType: 'trainingExam'}
+          if (aa.examName !== '' && aa.examName !== undefined && aa.examName !== null) {
+            this.moreSubject = aa.examName
+          }
+          if (aa.bankName !== '' && aa.bankName !== undefined && aa.bankName !== null) {
+            this.subjectTitle = aa.bankName
+          }
+          if (aa.examType !== '' && aa.examType !== undefined && aa.examType !== null) {
+            this.name = aa.examType == "trainingExam" ? "培训考试" : aa.examType == "POCTtraining" ? "POCT培训" : aa.examType == "selfAssessment" ? "自主考核" : aa.examType == "routine" ? "常规" : '全部'
+          }
+        }
+
+        const key = this.subject
+        let key1 = this.moreSubject
+        let key2 = this.subjectTitle
+        let canshu1 = key1 !== '' ? `and examName like '%${key1}%'` : '';
+        let canshu2 = key2 !== '' ? `and bankName like '%${key2}%'` : '';
+        let canshu = (key1 !== '' || key2 !== '') ? `${canshu1} ${canshu2}`.trim() : key != '' ? `and (examName like '%${key}%' or bankName like '%${key}%')` : ''
+        // let canshu = key != '' ? `and (examName like '%${key}%' or bankName like '%${key}%')` : ''
+        let sql = `select * from v_examination where examinee = '${this.info.employee.id}' and examType like '%${this.name == '全部' ? '' : this.name}%' ${canshu} ORDER BY startDate DESC LIMIT ${page},10`
+        let sql1 = `select * from (select * from v_examination where examinee = '${this.info.employee.id}' and examType like '%${this.name == '全部' ? '' : this.name}%' ${canshu}  ORDER BY startDate DESC LIMIT ${page},10) a LEFT JOIN (select exam_id_,id_,COUNT(id_) as num from t_examination where kao_shi_ren_ = '${this.info.employee.id}' and zhuang_tai_ != '已取消' GROUP BY exam_id_) b on a.examId = b.exam_id_`
+        // let sql2 = `select * from (select * from t-exams ) a LEFT JOIN () B ON a.examId=b.exam_id_`
+        this.$common.request('sql', sql1).then(res => {
+          if (this.current == 0 && res.variables.data.length == 0) {
+            this.finished = true;
+            this.noData = true
+            this.footText = false
+          }
+          let data = res.variables.data
+          this.listData.push(...data)
+          this.refreshing = false
+          if (this.listData.length != 0 && (this.listData.length) % 10 != 0) {
+            this.footText = true
+            this.finished = true;
+            return
+          } else {
+            this.current++
+          }
+          this.loading = false
+        }).catch(err => {
+          console.log(err);
+        })
+
+      },
+      // 获取格式化参数
+      getSearcFormData() {
+        let params = {}
+        if (this.$utils.isNotEmpty(this.subject)) {
+          params['Q^subject_^SL'] = this.subject
+        }
+        if (this.$utils.isNotEmpty(this.moreParams)) {
+          params = Object.assign(params, this.moreParams)
+        }
+        return ActionUtils.formatParams(
+          params,
+          this.pagination,
+          this.sorts)
+      },
+
+      transformTime(timeStamp) {
+        const hours = Math.floor(parseInt(timeStamp) / 3600000)
+        const minutes = Math.floor((parseInt(timeStamp) % 3600000) / 60000)
+        return hours + '小时' + minutes + '分钟'
+      },
+      onRemove() {
+        if (this.checkedIds.length === 0) {
+          this.$notify({
+            type: 'warning',
+            message: this.$t('common.dialog.selectedRecords')
+          })
+          return
+        }
+        this.$dialog.confirm({
+          title: this.$t('common.dialog.warn'),
+          message: this.$t('common.operate.makeSure')
+        }).then(() => {
+          removeDraft({ ids: this.selectedIds }).then(response => {
+            this.$notify({
+              type: 'success',
+              message: '删除草稿成功!'
+            })
+            this.onRefreshPage()
+          }).catch((e) => {
+            console.error(e)
+          })
+        })
+      }
+    }
+  }
+</script>
+<style scoped lang="scss">
+  .examRow {
+    padding: 2% 0;
+
+    .popupTitle {
+      text-align: center;
+      font-size: 14px;
+      color: #555;
+    }
+
+    .popupContent {
+      text-align: left;
+      font-size: 14px;
+      color: #777;
+    }
+  }
+
+  .examRowto {
+    margin: 10% 0;
+
+    .van-col {
+      text-align: center;
+
+      .van-button {
+        width: 80%;
+        font-size: 16px;
+      }
+    }
+  }
+</style>

+ 286 - 352
src/views/platform/bpmn/pending-matter/index.vue

@@ -1,412 +1,346 @@
 <template>
   <div :class="{'ibps-fixed-toolbar':checkMode}">
     <van-sticky>
-      <van-nav-bar
-        :title="generateTitle($route.name,$route.params.title||$route.meta.title)"
-        :left-text="$t('common.button.back')"
-        :right-text="$utils.isNotEmpty(listData)?rightText:''"
-        left-arrow
-        @click-left="$router.push({ name: 'dashboard' })"
-        @click-right="toCheckMode()"
-      />
-      <van-search
-        v-model="subject"
-        show-action
-        placeholder="请输入"
-        @search="onSearch"
-      >
+      <van-nav-bar :title="generateTitle($route.name,$route.params.title||$route.meta.title)"
+        :left-text="$t('common.button.back')" :right-text="$utils.isNotEmpty(listData)?rightText:''" left-arrow
+        @click-left="$router.push({ name: 'dashboard' })" @click-right="toCheckMode()" />
+      <van-search v-model="subject" show-action placeholder="请输入" @search="onSearch">
         <template #left>
-          <van-icon name="bars" :class="{'ibps-active':$utils.isNotEmpty(typeId)}" class="ibps-pr-5" @click="clickType" />
+          <van-icon name="bars" :class="{'ibps-active':$utils.isNotEmpty(typeId)}" class="ibps-pr-5"
+            @click="clickType" />
         </template>
         <template #action>
           <van-icon name="filter-o" :class="{'ibps-active':stateActive}" @click="clickMoreSearch" />
         </template>
       </van-search>
     </van-sticky>
-    <van-pull-refresh
-      v-model="refreshing"
-      @refresh="onRefresh"
-    >
-      <van-list
-        v-model="loading"
-        :finished="finished"
-        @load="loadData"
-      >
+    <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
+      <van-list v-model="loading" :finished="finished" @load="loadData">
         <van-checkbox-group v-model="checkedIds">
-          <van-cell
-            v-for="(item,index) in listData"
-            :key="item.id+index"
-            :title="item.procDefName"
-            :label="item.subject"
-            @click="onClick(item,index)"
-          >
+          <van-cell v-for="(item,index) in listData" :key="item.id+index" :title="item.procDefName"
+            :label="item.subject" @click="onClick(item,index)">
             <template slot="icon">
-              <van-checkbox
-                v-if="checkMode"
-                ref="checkboxes"
-                :name="item.taskId"
-                class="ibps-mr-10"
-              />
-              <ibps-avatar
-                v-else
-                :icon="_randomIcon(index)"
-                :text="item.procDefName"
-                :bg-color="_randomColor(index)"
-                radius="4"
-                icon-prefix="ibps-icon"
-                class="ibps-mr-10"
-              />
+              <van-checkbox v-if="checkMode" ref="checkboxes" :name="item.taskId" class="ibps-mr-10" />
+              <ibps-avatar v-else :icon="_randomIcon(index)" :text="item.procDefName" :bg-color="_randomColor(index)"
+                radius="4" icon-prefix="ibps-icon" class="ibps-mr-10" />
             </template>
             <span>{{ item.createTime|formatRelativeTime }}</span>
-            <van-tag :type=" item.status | optionsFilter(bpmnStatusOptions,'type')">{{ item.status | optionsFilter(bpmnStatusOptions) }}</van-tag>
+            <van-tag :type=" item.status | optionsFilter(bpmnStatusOptions,'type')">{{ item.status |
+              optionsFilter(bpmnStatusOptions) }}</van-tag>
             <div v-if="item.remindTimes>0">
               <!-- <van-tag plain :type="item.remindTimes|remindTimesTypeFilter">催办{{ item.remindTimes }}次</van-tag> -->
-              <van-tag
-                size="medium"
+              <van-tag size="medium"
                 :color="item.remindTimes|remindTimesTypeFilter | optionsFilter(colorOptions,'color','type')"
-                :text-color="item.remindTimes|remindTimesTypeFilter | optionsFilter(colorOptions,'textColor','type')"
-              >
+                :text-color="item.remindTimes|remindTimesTypeFilter | optionsFilter(colorOptions,'textColor','type')">
                 催办{{ item.remindTimes }}次</van-tag>
             </div>
           </van-cell>
         </van-checkbox-group>
       </van-list>
-      <ibps-list-result-page
-        :result-type="resultType"
-        :error-type="errorType"
-        :result-message="resultMessage"
-      />
+      <ibps-list-result-page :result-type="resultType" :error-type="errorType" :result-message="resultMessage" />
     </van-pull-refresh>
-    <ibps-toolbar
-      v-show="checkMode"
-      :actions="actions"
-    />
+    <ibps-toolbar v-show="checkMode" :actions="actions" />
 
-    <approve-popup
-      :visible="batchOpinionPopup"
-      :task-id="selectedIds"
-      :action="actionName"
-      @close="(visible)=>{batchOpinionPopup =visible}"
-      @callback="onRefreshPage"
-    />
+    <approve-popup :visible="batchOpinionPopup" :task-id="selectedIds" :action="actionName"
+      @close="(visible)=>{batchOpinionPopup =visible}" @callback="onRefreshPage" />
     <!--高级查询-->
-    <ibps-more-search
-      :show="moreSearchPopup"
-      :search-forms="searchForms"
-      @callback="onMoreSearch"
-      @close="callback => moreSearchPopup = callback"
-      @reset-form="resetForm"
-    >
+    <ibps-more-search :show="moreSearchPopup" :search-forms="searchForms" @callback="onMoreSearch"
+      @close="callback => moreSearchPopup = callback" @reset-form="resetForm">
       <template v-slot:definition>
-        <ibps-bpmn-definition
-          v-model="defKey"
-          input-align="left"
-          value-key="defKey"
-          class="van-hairline--bottom"
-        />
+        <ibps-bpmn-definition v-model="defKey" input-align="left" value-key="defKey" class="van-hairline--bottom" />
       </template>
     </ibps-more-search>
 
-    <ibps-type-tree
-      v-model="typeTreePopup"
-      title="流程分类"
-      category-key="FLOW_TYPE"
-      @node-click="clickTypeNode"
-      @close="visible => typeTreePopup = visible"
-    />
-    <ibps-bpmn-formrender-dialog
-      :visible="formrenderVisible"
-      :title="formrenderTitle"
-      :task-id="taskId"
-      @close="visible => formrenderVisible = visible"
-      @callback="onRefreshPage"
-    />
+    <ibps-type-tree v-model="typeTreePopup" title="流程分类" category-key="FLOW_TYPE" @node-click="clickTypeNode"
+      @close="visible => typeTreePopup = visible" />
+    <ibps-bpmn-formrender-dialog :visible="formrenderVisible" :title="formrenderTitle" :task-id="taskId"
+      @close="visible => formrenderVisible = visible" @callback="onRefreshPage" />
   </div>
 </template>
 <script>
-import { pending } from '@/api/platform/office/bpmReceived'
-import { batchSuspendProcess, batchRecoverProcess } from '@/api/platform/bpmn/bpmTask'
+  import { pending } from '@/api/platform/office/bpmReceived'
+  import { batchSuspendProcess, batchRecoverProcess } from '@/api/platform/bpmn/bpmTask'
 
-import i18n from '@/utils/i18n'
-import random from '@/mixins/random'
-import bpmnStatus from '@/mixins/bpmnStatus'
-import ActionUtils from '@/utils/action'
+  import i18n from '@/utils/i18n'
+  import random from '@/mixins/random'
+  import bpmnStatus from '@/mixins/bpmnStatus'
+  import ActionUtils from '@/utils/action'
 
-import ApprovePopup from '@/business/platform/bpmn/form-ext/approve'
+  import ApprovePopup from '@/business/platform/bpmn/form-ext/approve'
 
-import IbpsMoreSearch from '@/components/ibps-more-search'
-import IbpsAvatar from '@/components/ibps-avatar'
-import IbpsToolbar from '@/components/ibps-toolbar'
-import IbpsListResultPage from '@/components/ibps-list-result-page'
-import IbpsTypeTree from '@/business/platform/cat/type/tree'
-import IbpsBpmnDefinition from '@/business/platform/bpmn/definition/field'
+  import IbpsMoreSearch from '@/components/ibps-more-search'
+  import IbpsAvatar from '@/components/ibps-avatar'
+  import IbpsToolbar from '@/components/ibps-toolbar'
+  import IbpsListResultPage from '@/components/ibps-list-result-page'
+  import IbpsTypeTree from '@/business/platform/cat/type/tree'
+  import IbpsBpmnDefinition from '@/business/platform/bpmn/definition/field'
 
-import IbpsBpmnFormrenderDialog from '@/business/platform/bpmn/form/dialog'
+  import IbpsBpmnFormrenderDialog from '@/business/platform/bpmn/form/dialog'
 
-export default {
-  components: {
-    IbpsMoreSearch,
-    IbpsAvatar,
-    IbpsListResultPage,
-    IbpsTypeTree,
-    IbpsBpmnDefinition,
-    IbpsToolbar,
-    ApprovePopup,
-    IbpsBpmnFormrenderDialog
-  },
-  mixins: [random, bpmnStatus],
-  data() {
-    return {
-      moreSearchPopup: false,
-      stateActive: false,
-      searchForms: {
-        forms: [
-          // { prop: 'Q^subject_^SL', label: '请求标题' },
-          { prop: 'Q^procDefName^SL', label: '流程名称', fieldType: 'slot', slotName: 'definition' },
-          { prop: ['Q^create_time_^DL', 'Q^create_time_^DG'], label: '创建时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' }}
-        ]
-      },
+  export default {
+    components: {
+      IbpsMoreSearch,
+      IbpsAvatar,
+      IbpsListResultPage,
+      IbpsTypeTree,
+      IbpsBpmnDefinition,
+      IbpsToolbar,
+      ApprovePopup,
+      IbpsBpmnFormrenderDialog
+    },
+    mixins: [random, bpmnStatus],
+    data() {
+      return {
+        moreSearchPopup: false,
+        stateActive: false,
+        searchForms: {
+          forms: [
+            // { prop: 'Q^subject_^SL', label: '请求标题' },
+            { prop: 'Q^procDefName^SL', label: '流程名称', fieldType: 'slot', slotName: 'definition' },
+            { prop: ['Q^create_time_^DL', 'Q^create_time_^DG'], label: '创建时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' } }
+          ]
+        },
 
-      subject: '',
-      typeId: '',
-      defKey: '',
-      moreParams: {},
+        subject: '',
+        typeId: '',
+        defKey: '',
+        moreParams: {},
 
-      listData: [],
-      pagination: {},
-      sorts: {},
+        listData: [],
+        pagination: {},
+        sorts: {},
 
-      loading: false,
-      finished: false,
-      refreshing: false,
-      resultType: 'init',
-      errorType: null,
-      resultMessage: null,
+        loading: false,
+        finished: false,
+        refreshing: false,
+        resultType: 'init',
+        errorType: null,
+        resultMessage: null,
 
-      checkMode: false,
-      checkedIds: [],
-      show: false,
-      actions: [
-        {
-          name: this.$t('common.button.agree'),
-          type: 'primary',
-          callback: this.openAgreeDialog
-        }, {
-          name: this.$t('common.button.stop'),
-          type: 'danger',
-          callback: this.openStopDialog
-        }, {
-          name: this.$t('common.button.suspend'),
-          type: 'warning',
-          callback: this.suspend
-        }, {
-          name: this.$t('common.button.recover'),
-          type: 'info',
-          callback: this.recover
-        }
-      ],
-      batchOpinionPopup: false,
-      actionName: 'agree',
+        checkMode: false,
+        checkedIds: [],
+        show: false,
+        actions: [
+          {
+            name: this.$t('common.button.agree'),
+            type: 'primary',
+            callback: this.openAgreeDialog
+          }, {
+            name: this.$t('common.button.stop'),
+            type: 'danger',
+            callback: this.openStopDialog
+          }, {
+            name: this.$t('common.button.suspend'),
+            type: 'warning',
+            callback: this.suspend
+          }, {
+            name: this.$t('common.button.recover'),
+            type: 'info',
+            callback: this.recover
+          }
+        ],
+        batchOpinionPopup: false,
+        actionName: 'agree',
 
-      typeTreePopup: false,
+        typeTreePopup: false,
 
-      taskId: '',
-      formrenderVisible: false,
-      formrenderTitle: ''
-    }
-  },
-  computed: {
-    rightText() {
-      return this.checkMode ? this.$t('common.button.cancel') : this.$t('common.button.manage')
-    },
-    selectedIds() {
-      return this.checkedIds.join(',')
-    }
-  },
-  methods: {
-    generateTitle(name, title) { // generateTitle by vue-i18n
-      return i18n.generateTitle(name, title)
-    },
-    /**
-     * 加载数据
-     */
-    loadData() {
-      this.loading = true
-      pending(this.getSearcFormData()).then(response => {
-        // 处理数据
-        ActionUtils.handleListData(this, response.data)
-      }).catch((e) => {
-        ActionUtils.handleErrorData(this, e)
-      })
-    },
-    /**
-     * 获取格式化参数
-     */
-    getSearcFormData() {
-      let params = {}
-      if (this.$utils.isNotEmpty(this.subject)) {
-        params['Q^temp.subject_^SL'] = this.subject
-      }
-      if (this.$utils.isNotEmpty(this.typeId)) {
-        params['Q^temp.TYPE_ID_^S'] = this.typeId
-      }
-      if (this.$utils.isNotEmpty(this.defKey)) {
-        params['Q^temp.proc_def_key_^S'] = this.defKey
+        taskId: '',
+        formrenderVisible: false,
+        formrenderTitle: ''
       }
-      if (this.$utils.isNotEmpty(this.moreParams)) {
-        params = Object.assign(params, this.moreParams)
-      }
-
-      return ActionUtils.formatParams(
-        params,
-        this.pagination,
-        this.sorts)
-    },
-    /**
-     * 下拉刷新
-     */
-    onRefresh() {
-      this.refreshing = true
-      this.finished = false
-      this.loading = true
-      this.onSearch()
     },
-    /**
-     * 查询
-     */
-    onSearch() {
-      this.stateActive = false
-      ActionUtils.initListData(this)
-      this.loadData()
-    },
-    /**
-     * 高级查询
-     */
-    onMoreSearch(params) {
-      this.moreParams = params
-      this.onSearch()
-      if (this.$utils.isNotEmpty(params)) {
-        this.stateActive = true
+    computed: {
+      rightText() {
+        return this.checkMode ? this.$t('common.button.cancel') : this.$t('common.button.manage')
+      },
+      selectedIds() {
+        return this.checkedIds.join(',')
       }
     },
-    /**
-     * 弹窗更多查询条件
-     */
-    clickMoreSearch() {
-      this.moreSearchPopup = true
-      this.stateActive = false
-    },
-    /**
-     * 重置表单
-     */
-    resetForm() {
-      this.typeId = ''
-      this.defKey = ''
-    },
+    methods: {
+      generateTitle(name, title) { // generateTitle by vue-i18n
+        return i18n.generateTitle(name, title)
+      },
+      /**
+       * 加载数据
+       */
+      loadData() {
+        this.loading = true
+        pending(this.getSearcFormData()).then(response => {
+          // 处理数据
+          ActionUtils.handleListData(this, response.data)
+        }).catch((e) => {
+          ActionUtils.handleErrorData(this, e)
+        })
+      },
+      /**
+       * 获取格式化参数
+       */
+      getSearcFormData() {
+        let params = {}
+        if (this.$utils.isNotEmpty(this.subject)) {
+          params['Q^temp.subject_^SL'] = this.subject
+        }
+        if (this.$utils.isNotEmpty(this.typeId)) {
+          params['Q^temp.TYPE_ID_^S'] = this.typeId
+        }
+        if (this.$utils.isNotEmpty(this.defKey)) {
+          params['Q^temp.proc_def_key_^S'] = this.defKey
+        }
+        if (this.$utils.isNotEmpty(this.moreParams)) {
+          params = Object.assign(params, this.moreParams)
+        }
 
-    onRefreshPage() {
-      this.checkedIds = []
-      this.checkMode = false
-      this.onRefresh()
-    },
+        return ActionUtils.formatParams(
+          params,
+          this.pagination,
+          this.sorts)
+      },
+      /**
+       * 下拉刷新
+       */
+      onRefresh() {
+        this.refreshing = true
+        this.finished = false
+        this.loading = true
+        this.onSearch()
+      },
+      /**
+       * 查询
+       */
+      onSearch() {
+        this.stateActive = false
+        ActionUtils.initListData(this)
+        this.loadData()
+      },
+      /**
+       * 高级查询
+       */
+      onMoreSearch(params) {
+        this.moreParams = params
+        this.onSearch()
+        if (this.$utils.isNotEmpty(params)) {
+          this.stateActive = true
+        }
+      },
+      /**
+       * 弹窗更多查询条件
+       */
+      clickMoreSearch() {
+        this.moreSearchPopup = true
+        this.stateActive = false
+      },
+      /**
+       * 重置表单
+       */
+      resetForm() {
+        this.typeId = ''
+        this.defKey = ''
+      },
 
-    onClick(item, index) {
-      if (this.checkMode) {
-        this.$refs.checkboxes[index].toggle()
-      } else {
-        this.taskId = item.id
-        this.formrenderTitle = item.procDefName
-        this.formrenderVisible = true
-      }
-    },
-    clickType() {
-      this.typeTreePopup = true
-    },
-    clickTypeNode(data) {
-      this.typeId = data.id
-      this.onMoreSearch({})
-    },
-    toCheckMode() {
-      if (this.$utils.isEmpty(this.listData)) {
-        return
-      }
-      if (this.checkMode) {
-        this.show = true
+      onRefreshPage() {
         this.checkedIds = []
-      }
-      this.checkMode = !this.checkMode
-    },
-    openAgreeDialog() {
-      if (this.checkedIds.length === 0) {
-        this.$notify({
-          type: 'warning',
-          message: this.$t('common.dialog.selectedRecords')
-        })
-        return
-      }
-      this.batchOpinionPopup = true
-      this.actionName = 'agree'
-    },
-    openStopDialog() {
-      if (this.checkedIds.length === 0) {
-        this.$notify({
-          type: 'warning',
-          message: this.$t('common.dialog.selectedRecords')
-        })
-        return
-      }
-      this.batchOpinionPopup = true
-      this.actionName = 'stop'
-    },
+        this.checkMode = false
+        this.onRefresh()
+      },
 
-    suspend() {
-      if (this.checkedIds.length === 0) {
-        this.$notify({
-          type: 'warning',
-          message: this.$t('common.dialog.selectedRecords')
-        })
-        return
-      }
+      onClick(item, index) {
+        if (this.checkMode) {
+          this.$refs.checkboxes[index].toggle()
+        } else {
+          this.taskId = item.id
+          this.formrenderTitle = item.procDefName
+          this.formrenderVisible = true
+        }
+      },
+      clickType() {
+        this.typeTreePopup = true
+      },
+      clickTypeNode(data) {
+        this.typeId = data.id
+        this.onMoreSearch({})
+      },
+      toCheckMode() {
+        if (this.$utils.isEmpty(this.listData)) {
+          return
+        }
+        if (this.checkMode) {
+          this.show = true
+          this.checkedIds = []
+        }
+        this.checkMode = !this.checkMode
+      },
+      openAgreeDialog() {
+        if (this.checkedIds.length === 0) {
+          this.$notify({
+            type: 'warning',
+            message: this.$t('common.dialog.selectedRecords')
+          })
+          return
+        }
+        this.batchOpinionPopup = true
+        this.actionName = 'agree'
+      },
+      openStopDialog() {
+        if (this.checkedIds.length === 0) {
+          this.$notify({
+            type: 'warning',
+            message: this.$t('common.dialog.selectedRecords')
+          })
+          return
+        }
+        this.batchOpinionPopup = true
+        this.actionName = 'stop'
+      },
 
-      this.$dialog.confirm({
-        title: this.$t('common.dialog.warn'),
-        message: this.$t('common.operate.makeSure')
-      }).then(() => {
-        batchSuspendProcess({ 'taskIds': this.selectedIds }).then(response => {
+      suspend() {
+        if (this.checkedIds.length === 0) {
           this.$notify({
-            type: 'success',
-            message: '批量挂起流程成功!'
+            type: 'warning',
+            message: this.$t('common.dialog.selectedRecords')
+          })
+          return
+        }
+
+        this.$dialog.confirm({
+          title: this.$t('common.dialog.warn'),
+          message: this.$t('common.operate.makeSure')
+        }).then(() => {
+          batchSuspendProcess({ 'taskIds': this.selectedIds }).then(response => {
+            this.$notify({
+              type: 'success',
+              message: '批量挂起流程成功!'
+            })
+            this.onRefreshPage()
+          }).catch((e) => {
+            console.error(e)
           })
-          this.onRefreshPage()
-        }).catch((e) => {
-          console.error(e)
-        })
-      })
-    },
-    recover() {
-      if (this.checkedIds.length === 0) {
-        this.$notify({
-          type: 'warning',
-          message: this.$t('common.dialog.selectedRecords')
         })
-        return
-      }
-      this.$dialog.confirm({
-        title: this.$t('common.dialog.warn'),
-        message: this.$t('common.operate.makeSure')
-      }).then(() => {
-        batchRecoverProcess({ 'taskIds': this.selectedIds }).then(response => {
+      },
+      recover() {
+        if (this.checkedIds.length === 0) {
           this.$notify({
-            type: 'success',
-            message: '批量恢复流程成功!'
+            type: 'warning',
+            message: this.$t('common.dialog.selectedRecords')
+          })
+          return
+        }
+        this.$dialog.confirm({
+          title: this.$t('common.dialog.warn'),
+          message: this.$t('common.operate.makeSure')
+        }).then(() => {
+          batchRecoverProcess({ 'taskIds': this.selectedIds }).then(response => {
+            this.$notify({
+              type: 'success',
+              message: '批量恢复流程成功!'
+            })
+            this.onRefreshPage()
+          }).catch((e) => {
+            console.error(e)
           })
-          this.onRefreshPage()
-        }).catch((e) => {
-          console.error(e)
         })
-      })
+      }
     }
-  }
 
-}
-</script>
+  }
+</script>

+ 6 - 4
src/views/platform/bpmn/pending/index.vue

@@ -50,11 +50,12 @@
     <approve-popup :visible="batchOpinionPopup" :task-id="selectedIds" :action="actionName"
       @close="(visible)=>{batchOpinionPopup =visible}" @callback="onRefreshPage" />
     <!--高级查询-->
+
     <ibps-more-search :show="moreSearchPopup" :search-forms="searchForms" @callback="onMoreSearch"
       @close="callback => moreSearchPopup = callback" @reset-form="resetForm">
-      <template v-slot:definition>
+      <!-- <template v-slot:definition>
         <ibps-bpmn-definition v-model="defKey" value-key="defKey" input-align="left" class="van-hairline--bottom" />
-      </template>
+      </template> -->
     </ibps-more-search>
 
     <ibps-type-tree v-model="typeTreePopup" title="流程分类" category-key="FLOW_TYPE" @node-click="clickTypeNode"
@@ -122,8 +123,9 @@
         stateActive: false,
         searchForms: {
           forms: [
-            { prop: 'Q^subject_^SL', label: '事物名称' },
-            { prop: 'Q^procDefName^SL', label: '事物说明', fieldType: 'slot', slotName: 'definition' },
+            { prop: 'Q^subject_^SL', label: '事务名称' },
+            // { prop: 'Q^inst.subject_^SL', label: '事务说明' },
+            { prop: 'Q^procDefName^SL', label: '事务说明' },
             { prop: ['Q^create_time_^DL', 'Q^create_time_^DG'], label: '创建时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' } }
           ]
         },

+ 217 - 252
src/views/system/dashboard/index.vue

@@ -17,33 +17,15 @@
     <!--通知-->
     <template v-if="noticeList && noticeList.length > 0">
       <div class="dashboard-notice" style="height: 52px;background: #F3F3F3;">
-        <van-swipe
-          :autoplay="6000"
-          :height="44"
-          :show-indicators="false"
-          :initial-swipe="initialNotice()"
-          style="height:44px;"
-          vertical
-        >
+        <van-swipe :autoplay="6000" :height="44" :show-indicators="false" :initial-swipe="initialNotice()"
+          style="height:44px;" vertical>
           <van-swipe-item v-for="(notice, index) in noticeList" :key="index">
-            <van-notice-bar
-              background="#ffffff"
-              style="height:44px;"
-              color="#979797"
-              mode="link"
-              @click="onNotice(notice)"
-            >
+            <van-notice-bar background="#ffffff" style="height:44px;" color="#979797" mode="link"
+              @click="onNotice(notice)">
               <span class="ibps-pl-10"> {{ notice.title }}</span>
               <template #left-icon>
-                <ibps-avatar
-                  icon="volume-o"
-                  bg-color="#3396FB"
-                  color="#ffffff"
-                  radius="8"
-                  width="24"
-                  height="24"
-                  icon-size="12"
-                />
+                <ibps-avatar icon="volume-o" bg-color="#3396FB" color="#ffffff" radius="8" width="24" height="24"
+                  icon-size="12" />
               </template>
             </van-notice-bar>
           </van-swipe-item>
@@ -57,13 +39,8 @@
     <!--栏目-->
     <template v-if="dashboards && dashboards.length >0">
       <van-collapse v-model="activeDashboards" :border="false">
-        <van-collapse-item
-          v-for="(dashboard,index) in dashboards"
-          :key="dashboard[aliasKey]+index"
-          :name="dashboard[aliasKey]"
-          :border="false"
-          :is-link="false"
-        >
+        <van-collapse-item v-for="(dashboard,index) in dashboards" :key="dashboard[aliasKey]+index"
+          :name="dashboard[aliasKey]" :border="false" :is-link="false">
           <template #title>
             <h2 class="menus-title">
               <van-icon :name="dashboard.icon" :color="dashboard.iconBgColor" class-prefix="ibps-icon" />
@@ -74,23 +51,11 @@
             </h2>
           </template>
           <van-grid :column-num="4" :border="false" class="avatar-grid">
-            <van-grid-item
-              v-for="menu in dashboard[childrenKey]"
-              :key="menu[aliasKey]"
-              :badge="getBadge(menu)"
-              :text="getText(menu)"
-              @click.native="onClick(menu)"
-            >
+            <van-grid-item v-for="menu in dashboard[childrenKey]" :key="menu[aliasKey]" :badge="getBadge(menu)"
+              :text="getText(menu)" @click.native="onClick(menu)">
               <template #icon>
-                <ibps-avatar
-                  :icon="menu.icon"
-                  :text="getText(menu)"
-                  :bg-color="menu.iconBgColor"
-                  :color="menu.iconFontColor"
-                  icon-prefix="ibps-icon"
-                  radius="17"
-                  class="ibps-mb-10 avatar-layout"
-                />
+                <ibps-avatar :icon="menu.icon" :text="getText(menu)" :bg-color="menu.iconBgColor"
+                  :color="menu.iconFontColor" icon-prefix="ibps-icon" radius="17" class="ibps-mb-10 avatar-layout" />
               </template>
 
             </van-grid-item>
@@ -122,173 +87,154 @@
   </div>
 </template>
 <script>
-import Vue from 'vue'
-import { getMenuData, getInfoCount } from '@/api/platform/auth/appres'
-import { queryPageList } from '@/api/platform/system/news'
-import ActionUtils from '@/utils/action'
-// import navbar from '@/mixins/navbar'
-import { Lazyload } from 'vant'
-Vue.use(Lazyload)
-import TreeUtils from '@/utils/tree'
-import i18n from '@/utils/i18n' // Internationalization 国际化
-import IbpsAvatar from '@/components/ibps-avatar'
-import NoticeDialog from '@/views/platform/notice/edit'
-// 透明图片
-const BLANK = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'
-export default {
-  name: 'dashboard',
-  // mixins: [navbar],
-  components: {
-    IbpsAvatar,
-    NoticeDialog
-  },
-  data() {
-    const { userInfo } = this.$store.getters
-    return {
-      userInfo,
-      idKey: 'id',
-      aliasKey: 'alias',
-      labelKey: 'name',
-      parentIdKey: 'parentId',
-      childrenKey: 'children',
-      urlKey: 'defaultUrl',
-      dashboards: [],
-      emptyData: false,
-      resultType: 'empty',
-      resultMessage: '没有应用,请联系管理员',
-      countInfo: {}, // 右上角图标
-      swipes: [],
-      blankImage: BLANK,
+  import Vue from 'vue'
+  import { getMenuData, getInfoCount } from '@/api/platform/auth/appres'
+  import { queryPageList } from '@/api/platform/system/news'
+  import ActionUtils from '@/utils/action'
+  // import navbar from '@/mixins/navbar'
+  import { Lazyload } from 'vant'
+  Vue.use(Lazyload)
+  import TreeUtils from '@/utils/tree'
+  import i18n from '@/utils/i18n' // Internationalization 国际化
+  import IbpsAvatar from '@/components/ibps-avatar'
+  import NoticeDialog from '@/views/platform/notice/edit'
+  // 透明图片
+  const BLANK = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7'
+  export default {
+    name: 'dashboard',
+    // mixins: [navbar],
+    components: {
+      IbpsAvatar,
+      NoticeDialog
+    },
+    data() {
+      const { userInfo } = this.$store.getters
+      return {
+        userInfo,
+        idKey: 'id',
+        aliasKey: 'alias',
+        labelKey: 'name',
+        parentIdKey: 'parentId',
+        childrenKey: 'children',
+        urlKey: 'defaultUrl',
+        dashboards: [],
+        emptyData: false,
+        resultType: 'empty',
+        resultMessage: '没有应用,请联系管理员',
+        countInfo: {}, // 右上角图标
+        swipes: [],
+        blankImage: BLANK,
 
-      noticeList: [],
-      emptyNoticeData: false,
-      activeDashboards: [],
-      noticeVisible: false,
-      noticeId: '',
-      outList: [{
-        alias: 'userFeedback',
-        checked: 'false',
-        children: [{
-          alias: 'InfoComm',
+        noticeList: [],
+        emptyNoticeData: false,
+        activeDashboards: [],
+        noticeVisible: false,
+        noticeId: '',
+        outList: [{
+          alias: 'userFeedback',
           checked: 'false',
-          children: [],
+          children: [{
+            alias: 'InfoComm',
+            checked: 'false',
+            children: [],
+            createBy: null,
+            createTime: '2016-08-26 09:48:29',
+            dataStatus: null,
+            dbType: null,
+            defaultUrl: '/bpmn/communication/communicationList',
+            desc: '',
+            displayInMenu: '1',
+            dsAlias: null,
+            icon: 'title',
+            iconBgColor: '#00aabb',
+            iconFontColor: '#ffffff',
+            iconType: 'icon',
+            id: '2',
+            ip: null,
+            isCommon: 'N',
+            isFolder: 'Y',
+            isOpen: 'N',
+            name: '信息沟通',
+            parentId: '1',
+            path: '1.1.2.1.1.2',
+            pk: '',
+            resourceType: 'menu',
+            sn: 1,
+            systemId: 'app',
+            tenantId: '-999',
+            updateBy: null,
+            updateTime: null
+          }],
           createBy: null,
           createTime: '2016-08-26 09:48:29',
           dataStatus: null,
           dbType: null,
-          defaultUrl: '/bpmn/communication/communicationList',
+          defaultUrl: null,
           desc: '',
-          displayInMenu: '1',
+          displayInMenu: 'Y',
           dsAlias: null,
           icon: 'title',
           iconBgColor: '#00aabb',
           iconFontColor: '#ffffff',
           iconType: 'icon',
-          id: '2',
+          id: '1',
           ip: null,
           isCommon: 'N',
           isFolder: 'Y',
           isOpen: 'N',
-          name: '信息沟通',
-          parentId: '1',
-          path: '1.1.2.1.1.2',
+          name: '用户反馈',
+          parentId: '0',
+          path: '1.1.2.1.1',
           pk: '',
-          resourceType: 'menu',
+          resourceType: 'dir',
           sn: 1,
           systemId: 'app',
           tenantId: '-999',
           updateBy: null,
           updateTime: null
-        }],
-        createBy: null,
-        createTime: '2016-08-26 09:48:29',
-        dataStatus: null,
-        dbType: null,
-        defaultUrl: null,
-        desc: '',
-        displayInMenu: 'Y',
-        dsAlias: null,
-        icon: 'title',
-        iconBgColor: '#00aabb',
-        iconFontColor: '#ffffff',
-        iconType: 'icon',
-        id: '1',
-        ip: null,
-        isCommon: 'N',
-        isFolder: 'Y',
-        isOpen: 'N',
-        name: '用户反馈',
-        parentId: '0',
-        path: '1.1.2.1.1',
-        pk: '',
-        resourceType: 'dir',
-        sn: 1,
-        systemId: 'app',
-        tenantId: '-999',
-        updateBy: null,
-        updateTime: null
-      }]
-    }
-  },
-  created() {
-    this.loadData()
-  },
-  methods: {
-    getIcon(data) {
-      return this.activeDashboards.includes(data)
-    },
-    changeIcon(data) {
-      console.info(data, this.activeDashboards)
-    },
-    svgName(name) {
-      return `#${name}`
-    },
-    getImage(menu) {
-      if (menu.iconType === 'image') {
-        return menu.icon
+        }]
       }
-      return
     },
-    getText(menu) {
-      return i18n.generateTitle(menu[this.aliasKey], menu[this.labelKey])
+    created() {
+      this.loadData()
     },
-    getBadge(menu) {
-      const info = this.countInfo[menu[this.aliasKey]]
-      if (this.$utils.isNotEmpty(info)) { return info > 99 ? '99+' : info === '0' ? '' : info }
-    },
-    loadData() {
-      this.loadMenus()
-      this.loadCountInfo()
-      this.loadNotice()
-    },
-    loadMenus() {
-      this.swipes = [{}]
-      this.swipes = [
-        { image: './images/swipes/banner1.png' },
-        { image: './images/swipes/banner2.png' },
-        { image: './images/swipes/banner3.png' }
-      ]
-      if (this.userInfo.employee.jiNengZhiCheng !== 'inside' && this.userInfo.employee.isSuper === 'N') {
-        this.dashboards = this.outList
-        if (this.$utils.isNotEmpty(this.dashboards)) {
-          const activeDashboards = []
-          this.dashboards.forEach((d) => {
-            activeDashboards.push(d[this.aliasKey])
-          })
-          this.activeDashboards = activeDashboards
+    methods: {
+      getIcon(data) {
+        return this.activeDashboards.includes(data)
+      },
+      changeIcon(data) {
+        console.info(data, this.activeDashboards)
+      },
+      svgName(name) {
+        return `#${name}`
+      },
+      getImage(menu) {
+        if (menu.iconType === 'image') {
+          return menu.icon
         }
-        this.emptyData = !(this.dashboards.length > 0)
-      } else {
-        getMenuData().then(response => {
-          const data = response.data
-          const listData = data.filter((d) => {
-            return d.id !== '0'
-          })
-          this.dashboards = TreeUtils.transformToTreeFormat(listData, {
-            idKey: this.idKey,
-            parentIdKey: this.parentIdKey,
-            childrenKey: this.childrenKey
-          })
+        return
+      },
+      getText(menu) {
+        return i18n.generateTitle(menu[this.aliasKey], menu[this.labelKey])
+      },
+      getBadge(menu) {
+        const info = this.countInfo[menu[this.aliasKey]]
+        if (this.$utils.isNotEmpty(info)) { return info > 99 ? '99+' : info === '0' ? '' : info }
+      },
+      loadData() {
+        this.loadMenus()
+        this.loadCountInfo()
+        this.loadNotice()
+      },
+      loadMenus() {
+        this.swipes = [{}]
+        this.swipes = [
+          { image: './images/swipes/banner1.png' },
+          { image: './images/swipes/banner2.png' },
+          { image: './images/swipes/banner3.png' }
+        ]
+        if (this.userInfo.employee.jiNengZhiCheng !== 'inside' && this.userInfo.employee.isSuper === 'N') {
+          this.dashboards = this.outList
           if (this.$utils.isNotEmpty(this.dashboards)) {
             const activeDashboards = []
             this.dashboards.forEach((d) => {
@@ -296,77 +242,96 @@ export default {
             })
             this.activeDashboards = activeDashboards
           }
-          this.emptyData = !(listData.length > 0)
-        }).catch((e) => {
-          this.emptyData = true
-          this.resultType = 'error'
-          this.resultMessage = e.message
-        })
-      }
-    },
-    loadCountInfo() {
-      getInfoCount().then(response => {
-        const data = response.data
-        const countInfo = {}
-        data.forEach((d) => {
-          countInfo[d.alias] = d.dataText
-        })
-        this.countInfo = countInfo
-      }).catch((e) => {
-      })
-    },
-
-    loadNotice() {
-      this.emptyNoticeData = false
-      const params = ActionUtils.formatParams({ status: 'publish' }, { page: 1, limit: 5 })
-      queryPageList(params).then(response => {
-        this.noticeList = response.data.dataResult
-        this.emptyNoticeData = !(this.noticeList.length > 0)
-      }).catch((e) => {
-        this.emptyNoticeData = true
-      })
-    },
-    initialNotice() {
-      return Math.floor((Math.random() * this.noticeList.length))
-    },
-    onClick(menu) {
-      const url = menu[this.urlKey]
-      if (this.$utils.isNotEmpty(url)) {
-        if (/^https:\/\/|http:\/\//.test(url)) {
-          this.$utils.open(url)
+          this.emptyData = !(this.dashboards.length > 0)
         } else {
-          this.$router.push({ path: url })
-        }
-      } else {
-        // 判断是否有下级菜单如果有
-        if (this.$utils.isNotEmpty(menu.children)) {
-          this.$router.push({
-            name: 'next-menu',
-            params: {
-              title: menu.name,
-              menus: menu.children
+          getMenuData().then(response => {
+            const data = response.data
+            const listData = data.filter((d) => {
+              return d.id !== '0'
+            })
+            this.dashboards = TreeUtils.transformToTreeFormat(listData, {
+              idKey: this.idKey,
+              parentIdKey: this.parentIdKey,
+              childrenKey: this.childrenKey
+            })
+            if (this.$utils.isNotEmpty(this.dashboards)) {
+              const activeDashboards = []
+              this.dashboards.forEach((d) => {
+                activeDashboards.push(d[this.aliasKey])
+              })
+              this.activeDashboards = activeDashboards
             }
+            this.emptyData = !(listData.length > 0)
+          }).catch((e) => {
+            this.emptyData = true
+            this.resultType = 'error'
+            this.resultMessage = e.message
           })
-        } else {
-          this.$notify({
-            type: 'danger',
-            message: '未配置菜单的url路径,请在PC后台配置!'
+        }
+      },
+      loadCountInfo() {
+        getInfoCount().then(response => {
+          const data = response.data
+          const countInfo = {}
+          data.forEach((d) => {
+            countInfo[d.alias] = d.dataText
           })
+          this.countInfo = countInfo
+        }).catch((e) => {
+        })
+      },
+
+      loadNotice() {
+        this.emptyNoticeData = false
+        const params = ActionUtils.formatParams({ status: 'publish' }, { page: 1, limit: 5 })
+        queryPageList(params).then(response => {
+          this.noticeList = response.data.dataResult
+          this.emptyNoticeData = !(this.noticeList.length > 0)
+        }).catch((e) => {
+          this.emptyNoticeData = true
+        })
+      },
+      initialNotice() {
+        return Math.floor((Math.random() * this.noticeList.length))
+      },
+      onClick(menu) {
+        const url = menu[this.urlKey]
+        if (this.$utils.isNotEmpty(url)) {
+          if (/^https:\/\/|http:\/\//.test(url)) {
+            this.$utils.open(url)
+          } else {
+            this.$router.push({ path: url })
+          }
+        } else {
+          // 判断是否有下级菜单如果有
+          if (this.$utils.isNotEmpty(menu.children)) {
+            this.$router.push({
+              name: 'next-menu',
+              params: {
+                title: menu.name,
+                menus: menu.children
+              }
+            })
+          } else {
+            this.$notify({
+              type: 'danger',
+              message: '未配置菜单的url路径,请在PC后台配置!'
+            })
+          }
         }
+      },
+      onNotice(item) {
+        this.noticeId = item.id
+        this.noticeVisible = true
+        // this.$router.push({
+        //   name: 'noticeDetail',
+        //   query: {
+        //     id: item.id
+        //   }
+        // })
       }
-    },
-    onNotice(item) {
-      this.noticeId = item.id
-      this.noticeVisible = true
-      // this.$router.push({
-      //   name: 'noticeDetail',
-      //   query: {
-      //     id: item.id
-      //   }
-      // })
     }
   }
-}
 </script>
 <style lang="scss">
   .dashboard {
@@ -487,4 +452,4 @@ export default {
       }
     }
   }
-</style>
+</style>