Răsfoiți Sursa

格式化代码规范

luoaoxuan 2 ani în urmă
părinte
comite
92b58ccbf7

+ 14 - 16
src/api/detection/newHomeApi.js

@@ -5,7 +5,7 @@ const news_url = 'business/v3'
  * 个人信息
  * @param {*} params
  */
-export function getAccountInfo(params) {
+export function getAccountInfo (params) {
     return request({
         url: NEWHOME_URL + '/desktop/facade/userInfo',
         method: 'get',
@@ -16,7 +16,7 @@ export function getAccountInfo(params) {
  * 新建流程
  * @param {*} params
  */
-export function findBpm(params) {
+export function findBpm (params) {
     return request({
         url: NEWHOME_URL + '/bpm/initiated/find/dashboard/bpmn',
         method: 'get',
@@ -27,7 +27,7 @@ export function findBpm(params) {
  * 公告栏目
  * @param {*} params
  */
-export function getNews(params) {
+export function getNews (params) {
     return request({
         url: NEWHOME_URL + '/desktop/facade/getNews',
         method: 'get',
@@ -38,7 +38,7 @@ export function getNews(params) {
  * 新短信公告
  * @param {*} params
  */
-export function getCmsNews(params) {
+export function getCmsNews (params) {
     return request({
         url: news_url + '/data/template/queryDataTable',
         method: 'post',
@@ -50,7 +50,7 @@ export function getCmsNews(params) {
  * 未读消息
  * @param {*} params
  */
-export function unreadMessage(params) {
+export function unreadMessage (params) {
     return request({
         url: NEWHOME_URL + '/desktop/facade/unreadMessage',
         method: 'get',
@@ -62,7 +62,7 @@ export function unreadMessage(params) {
  * 查询当前用户日历日程信息
  * @param {*} params
  */
-export function findAllByCurrUserId(params) {
+export function findAllByCurrUserId (params) {
     return request({
         url: NEWHOME_URL + '/desktop/facade/calendar/findAllByCurrUserId',
         method: 'get',
@@ -74,7 +74,7 @@ export function findAllByCurrUserId(params) {
  * 编辑保存用户日历日程
  * @param {*} params
  */
-export function saveCalendarInfos(params) {
+export function saveCalendarInfos (params) {
     return request({
         url: NEWHOME_URL + '/desktop/facade/calendar/save',
         method: 'post',
@@ -86,7 +86,7 @@ export function saveCalendarInfos(params) {
  * 删除用户日历日程
  * @param {*} params
  */
-export function removeCalendarInfos(params) {
+export function removeCalendarInfos (params) {
     return request({
         url: NEWHOME_URL + '/desktop/facade/calendar/remove',
         method: 'post',
@@ -95,9 +95,9 @@ export function removeCalendarInfos(params) {
 }
 /**
  * 标记该日历为已读
- * @param {*} params 
+ * @param {*} params
  */
-export function markReadCalendar(params) {
+export function markReadCalendar (params) {
     return request({
         url: NEWHOME_URL + '/desktop/facade/calendar/markRead',
         method: 'post',
@@ -105,13 +105,11 @@ export function markReadCalendar(params) {
     })
 }
 
-
-
 /**
  * 添加快捷导航,带参数
  * @param {*} params
  */
-export function addNavigation(params) {
+export function addNavigation (params) {
     return request({
         url: NEWHOME_URL + '/desktop/facade/navigate/save',
         method: 'post',
@@ -121,7 +119,7 @@ export function addNavigation(params) {
 /**
  * 查找快捷导航
  */
-export function getNavigation() {
+export function getNavigation () {
     return request({
         url: NEWHOME_URL + '/desktop/facade/navigate/findAllByCurrUserId',
         method: 'get'
@@ -131,7 +129,7 @@ export function getNavigation() {
  * 删除快捷导航,带参数
  * @param {*} params
  */
-export function delNavigation(params) {
+export function delNavigation (params) {
     return request({
         url: NEWHOME_URL + '/desktop/facade/navigate/remove',
         method: 'post',
@@ -143,7 +141,7 @@ export function delNavigation(params) {
  * 保存用户导航排序
  * @param {*} params
  */
-export function sortNavigation(params) {
+export function sortNavigation (params) {
     return request({
         url: NEWHOME_URL + '/desktop/facade/navigate/order',
         method: 'post',

+ 1 - 1
src/utils/action.js

@@ -59,7 +59,7 @@ const action = {
     },
     /**
     * 没有权限编辑提示
-    * @param {*} message 
+    * @param {*} message
     */
     noPowerMessage: function (message = I18n.t('common.dialog.noPower')) {
         this.warning(message)

+ 766 - 771
src/views/platform/bpmn/bpmAgent/edit.vue

@@ -1,809 +1,804 @@
 <template>
-  <el-dialog
-    :title="title"
-    :visible.sync="dialogVisible"
-    :close-on-click-modal="false"
-    :close-on-press-escape="false"
-    append-to-body
-    class="bpmn-agent-dialog"
-    width="60%"
-    top="10vh"
-    @open="getFormData"
-    @close="closeDialog"
-  >
-    <div style="padding: 15px">
-      <el-form
-        ref="agentForm"
-        v-loading="dialogLoading"
-        class="bpmnForm"
-        :element-loading-text="$t('common.loading')"
-        :model="bpmAgent"
-        :rules="rules"
-        :label-width="formLabelWidth"
-        label-position="left"
-        @submit.native.prevent
-      >
-        <el-row v-if="srcList.length > 0">
-          <el-col :span="24">
-            <el-form-item label="代理人参考图片:">
-              <div class="imageListClass">
-                <div v-for="(item, index) in srcList" :key="index">
-                  <el-image
-                    :src="item"
-                    class="sinImageList"
-                    :preview-src-list="srcList"
-                  />
-                </div>
-              </div>
-            </el-form-item>
-          </el-col>
-        </el-row>
-
-        <el-row>
-          <el-col :span="24">
-            <el-form-item label="标题:" prop="title">
-              <el-input
-                v-if="!readonly"
-                v-model="bpmAgent.title"
-                placeholder="请输入标题"
-              />
-              <span v-else>{{ bpmAgent.title }}</span>
-            </el-form-item>
-          </el-col>
-        </el-row>
-
-        <el-row :gutter="20">
-          <el-col :span="12">
-            <el-form-item label="生效时间:" prop="effectiveTime">
-              <el-date-picker
-                v-if="!readonly"
-                v-model="bpmAgent.effectiveTime"
-                class="time"
-                type="date"
-                value-format="yyyy-MM-dd"
-                placeholder="请选择生效时间"
-              />
-              <span v-else>{{ bpmAgent.effectiveTime }}</span>
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="失效时间:" prop="expiryTime">
-              <el-date-picker
-                v-if="!readonly"
-                v-model="bpmAgent.expiryTime"
-                class="time"
-                type="date"
-                value-format="yyyy-MM-dd"
-                placeholder="请选择失效时间"
-              />
-              <span v-else>{{ bpmAgent.expiryTime }}</span>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row :gutter="20">
-          <el-col :span="12">
-            <el-form-item label="是否启用:" prop="isEnabled">
-              <el-switch
-                v-if="!readonly"
-                v-model="bpmAgent.isEnabled"
-                active-value="enabled"
-                inactive-value="disabled"
-              />
-              <el-tag
-                v-else
-                :type="
-                  bpmAgent.isEnabled | optionsFilter(statusOptions, 'type')
-                "
-                >{{
-                  bpmAgent.isEnabled | optionsFilter(statusOptions, "label")
-                }}</el-tag
-              >
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-alert
-          title="1、菜单按钮权限的代理"
-          type="success"
-          :closable="false"
-        />
-        <el-row :gutter="20">
-          <el-col :span="12">
-            <el-form-item label="委托人:" prop="delegatorId">
-              <ibps-user-selector
-                v-if="!readonly"
-                v-model="bpmAgent.delegatorId"
-                :type="type"
-                :filter="filter"
-                :multiple="multiple"
-                :filtrate="filtrate"
-                :store="store"
-                :disabled="delegatorDisabled"
-                :readonly-text="readonlyText"
-                placeholder="请选择委托人"
-                @change-link-data="callbackDelegatorrInfo"
-              />
-              <span v-else>{{ bpmAgent.delegatorName }}</span>
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item
-              v-if="
-                bpmAgent.agentType === 'all' || bpmAgent.agentType === 'part'
-              "
-              label="代理人:"
-              prop="agenterId"
+    <el-dialog
+        :title="title"
+        :visible.sync="dialogVisible"
+        :close-on-click-modal="false"
+        :close-on-press-escape="false"
+        append-to-body
+        class="bpmn-agent-dialog"
+        width="60%"
+        top="10vh"
+        @open="getFormData"
+        @close="closeDialog"
+    >
+        <div style="padding: 15px">
+            <el-form
+                ref="agentForm"
+                v-loading="dialogLoading"
+                class="bpmnForm"
+                :element-loading-text="$t('common.loading')"
+                :model="bpmAgent"
+                :rules="rules"
+                :label-width="formLabelWidth"
+                label-position="left"
+                @submit.native.prevent
             >
-              <ibps-user-selector
-                v-if="!readonly"
-                v-model="bpmAgent.agenterId"
-                :type="type"
-                :filter="filter"
-                :multiple="multiple"
-                :filtrate="filtrate"
-                :store="store"
-                :disabled="disabled"
-                :readonly-text="readonlyText"
-                placeholder="请选择代理人"
-                @change-link-data="callbackAgenterInfo"
-              />
-              <span v-else>{{ bpmAgent.agenterName }}</span>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row :gutter="20">
-          <el-col :span="24">
-            <el-form-item prop="bpmAgentRoleList">
-              <template slot="label">
-                委托人角色
-                <help-tip
-                  :title="formAsterisk.title"
-                  :content="formAsterisk.content"
-                />:
-              </template>
-              <el-checkbox-group
-                v-if="!readonly"
-                v-model="bpmAgent.bpmAgentRoleList"
-              >
-                <el-checkbox
-                  v-for="item in roleList"
-                  :key="item.id"
-                  :label="item.id"
-                  >{{ item.name }}</el-checkbox
-                >
-              </el-checkbox-group>
-              <span v-else>{{
-                getWeiTuoName(bpmAgent.bpmAgentRoleList, roleList)
-              }}</span>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-col :span="24">
-            <el-form-item label="代理人角色:">
-              <span>{{ daiRoleName }}</span>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-alert
-          title="2、流程数据扭转的代理"
-          type="success"
-          :closable="false"
-        />
-        <!-- 全部代理 || 部分代理 -->
-        <el-row :gutter="20">
-          <el-col :span="24" col>
-            <el-form-item label="代理类型:" prop="agentType">
-              <el-radio-group v-if="!readonly" v-model="bpmAgent.agentType">
-                <el-radio
-                  v-for="option in agentTypeOptions"
-                  :key="option.value"
-                  :label="option.value"
-                  >{{ option.label }}</el-radio
-                >
-              </el-radio-group>
-              <el-tag
-                v-else
-                :type="
-                  bpmAgent.agentType | optionsFilter(agentTypeOptions, 'type')
-                "
-                >{{
-                  bpmAgent.agentType | optionsFilter(agentTypeOptions, "label")
-                }}</el-tag
-              >
-            </el-form-item>
-          </el-col>
-        </el-row>
+                <el-row v-if="srcList.length > 0">
+                    <el-col :span="24">
+                        <el-form-item label="代理人参考图片:">
+                            <div class="imageListClass">
+                                <div v-for="(item, index) in srcList" :key="index">
+                                    <el-image
+                                        :src="item"
+                                        class="sinImageList"
+                                        :preview-src-list="srcList"
+                                    />
+                                </div>
+                            </div>
+                        </el-form-item>
+                    </el-col>
+                </el-row>
 
-        <div v-if="bpmAgent.agentType === 'part'">
-          <el-form-item label="流程定义">
-            <div v-if="!readonly" class="dialog-right">
-              <bpm-definition-selector
-                button
-                multiple
-                @callback="updateDefine"
-              />
-              <el-button
-                class="ibps-icon-remove ibps-ml-10"
-                type="danger"
-                @click="handleAllDelete(multipleSelection)"
-                >删除</el-button
-              >
-            </div>
-          </el-form-item>
-          <el-form-item
-            v-loading="rowLoading"
-            label-width="0px"
-            :element-loading-text="$t('common.loading')"
-          >
-            <el-table
-              ref="multipleTable"
-              border
-              :data="bpmAgent.bpmAgentDefPoList"
-              tooltip-effect="dark"
-              style="width: 100%"
-              @selection-change="handleSelectionChange"
-            >
-              <el-table-column v-if="!readonly" type="selection" width="45" />
-              <el-table-column label="流程名称">
-                <template slot-scope="scope">{{
-                  scope.row.procDefName ? scope.row.procDefName : scope.row.name
-                }}</template>
-              </el-table-column>
-              <el-table-column v-if="!readonly" label="操作" width="55">
-                <template slot-scope="scope">
-                  <el-button
-                    type="danger"
-                    icon="el-icon-delete"
-                    circle
-                    @click="handleDelete(scope.$index, scope.row)"
-                  />
-                </template>
-              </el-table-column>
-            </el-table>
-          </el-form-item>
-        </div>
+                <el-row>
+                    <el-col :span="24">
+                        <el-form-item label="标题:" prop="title">
+                            <el-input
+                                v-if="!readonly"
+                                v-model="bpmAgent.title"
+                                placeholder="请输入标题"
+                            />
+                            <span v-else>{{ bpmAgent.title }}</span>
+                        </el-form-item>
+                    </el-col>
+                </el-row>
 
-        <!-- 条件代理 -->
-        <div v-if="bpmAgent.agentType === 'condition'">
-          <el-form-item label="流程名称:">
-            <bpm-definition-selector
-              v-model="bpmAgent.procDefId"
-              :disabled="readonly"
-            />
-          </el-form-item>
-          <el-form-item label="流程代理条件:">
-            <div v-if="!readonly" class="dialog-right">
-              <el-button
-                class="ibps-icon-add"
-                type="primary"
-                @click="openConditionDialog"
-                >添加</el-button
-              >
-              <el-button class="ibps-icon-remove ibps-ml-5" type="danger"
-                >删除</el-button
-              >
-            </div>
-          </el-form-item>
-          <el-form-item
-            v-loading="rowLoading"
-            label-width="20px"
-            :element-loading-text="$t('common.loading')"
-          >
-            <el-table
-              ref="multipleTable"
-              :data="bpmAgent.bpmAgentConditionPoList"
-              tooltip-effect="dark"
-              style="width: 100%"
-              @selection-change="handleConditionChange"
-            >
-              <el-table-column type="selection" width="55" />
-              <el-table-column label="代理人">
-                <template slot-scope="scope">{{
-                  scope.row.agenterName
-                }}</template>
-              </el-table-column>
-              <el-table-column label="条件名称">
-                <template slot-scope="scope">{{ scope.row.name }}</template>
-              </el-table-column>
-              <el-table-column
-                prop="address"
-                label="管理"
-                width="100px"
-                show-overflow-tooltip
-              >
-                <el-button
-                  type="primary"
-                  icon="el-icon-edit"
-                  circle
-                  @click="handleEdit(scope.$index, scope.row)"
+                <el-row :gutter="20">
+                    <el-col :span="12">
+                        <el-form-item label="生效时间:" prop="effectiveTime">
+                            <el-date-picker
+                                v-if="!readonly"
+                                v-model="bpmAgent.effectiveTime"
+                                class="time"
+                                type="date"
+                                value-format="yyyy-MM-dd"
+                                placeholder="请选择生效时间"
+                            />
+                            <span v-else>{{ bpmAgent.effectiveTime }}</span>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="12">
+                        <el-form-item label="失效时间:" prop="expiryTime">
+                            <el-date-picker
+                                v-if="!readonly"
+                                v-model="bpmAgent.expiryTime"
+                                class="time"
+                                type="date"
+                                value-format="yyyy-MM-dd"
+                                placeholder="请选择失效时间"
+                            />
+                            <span v-else>{{ bpmAgent.expiryTime }}</span>
+                        </el-form-item>
+                    </el-col>
+                </el-row>
+                <el-row :gutter="20">
+                    <el-col :span="12">
+                        <el-form-item label="是否启用:" prop="isEnabled">
+                            <el-switch
+                                v-if="!readonly"
+                                v-model="bpmAgent.isEnabled"
+                                active-value="enabled"
+                                inactive-value="disabled"
+                            />
+                            <el-tag
+                                v-else
+                                :type="
+                                    bpmAgent.isEnabled | optionsFilter(statusOptions, 'type')
+                                "
+                            >{{
+                                bpmAgent.isEnabled | optionsFilter(statusOptions, "label")
+                            }}</el-tag>
+                        </el-form-item>
+                    </el-col>
+                </el-row>
+                <el-alert
+                    title="1、菜单按钮权限的代理"
+                    type="success"
+                    :closable="false"
                 />
-                <el-button
-                  type="danger"
-                  icon="el-icon-delete"
-                  circle
-                  @click="handleRemove(scope.$index, scope.row)"
+                <el-row :gutter="20">
+                    <el-col :span="12">
+                        <el-form-item label="委托人:" prop="delegatorId">
+                            <ibps-user-selector
+                                v-if="!readonly"
+                                v-model="bpmAgent.delegatorId"
+                                :type="type"
+                                :filter="filter"
+                                :multiple="multiple"
+                                :filtrate="filtrate"
+                                :store="store"
+                                :disabled="delegatorDisabled"
+                                :readonly-text="readonlyText"
+                                placeholder="请选择委托人"
+                                @change-link-data="callbackDelegatorrInfo"
+                            />
+                            <span v-else>{{ bpmAgent.delegatorName }}</span>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="12">
+                        <el-form-item
+                            v-if="
+                                bpmAgent.agentType === 'all' || bpmAgent.agentType === 'part'
+                            "
+                            label="代理人:"
+                            prop="agenterId"
+                        >
+                            <ibps-user-selector
+                                v-if="!readonly"
+                                v-model="bpmAgent.agenterId"
+                                :type="type"
+                                :filter="filter"
+                                :multiple="multiple"
+                                :filtrate="filtrate"
+                                :store="store"
+                                :disabled="disabled"
+                                :readonly-text="readonlyText"
+                                placeholder="请选择代理人"
+                                @change-link-data="callbackAgenterInfo"
+                            />
+                            <span v-else>{{ bpmAgent.agenterName }}</span>
+                        </el-form-item>
+                    </el-col>
+                </el-row>
+                <el-row :gutter="20">
+                    <el-col :span="24">
+                        <el-form-item prop="bpmAgentRoleList">
+                            <template slot="label">
+                                委托人角色
+                                <help-tip
+                                    :title="formAsterisk.title"
+                                    :content="formAsterisk.content"
+                                />:
+                            </template>
+                            <el-checkbox-group
+                                v-if="!readonly"
+                                v-model="bpmAgent.bpmAgentRoleList"
+                            >
+                                <el-checkbox
+                                    v-for="item in roleList"
+                                    :key="item.id"
+                                    :label="item.id"
+                                >{{ item.name }}</el-checkbox>
+                            </el-checkbox-group>
+                            <span v-else>{{
+                                getWeiTuoName(bpmAgent.bpmAgentRoleList, roleList)
+                            }}</span>
+                        </el-form-item>
+                    </el-col>
+                </el-row>
+                <el-row>
+                    <el-col :span="24">
+                        <el-form-item label="代理人角色:">
+                            <span>{{ daiRoleName }}</span>
+                        </el-form-item>
+                    </el-col>
+                </el-row>
+                <el-alert
+                    title="2、流程数据扭转的代理"
+                    type="success"
+                    :closable="false"
                 />
-              </el-table-column>
-            </el-table>
-          </el-form-item>
+                <!-- 全部代理 || 部分代理 -->
+                <el-row :gutter="20">
+                    <el-col :span="24" col>
+                        <el-form-item label="代理类型:" prop="agentType">
+                            <el-radio-group v-if="!readonly" v-model="bpmAgent.agentType">
+                                <el-radio
+                                    v-for="option in agentTypeOptions"
+                                    :key="option.value"
+                                    :label="option.value"
+                                >{{ option.label }}</el-radio>
+                            </el-radio-group>
+                            <el-tag
+                                v-else
+                                :type="
+                                    bpmAgent.agentType | optionsFilter(agentTypeOptions, 'type')
+                                "
+                            >{{
+                                bpmAgent.agentType | optionsFilter(agentTypeOptions, "label")
+                            }}</el-tag>
+                        </el-form-item>
+                    </el-col>
+                </el-row>
+
+                <div v-if="bpmAgent.agentType === 'part'">
+                    <el-form-item label="流程定义">
+                        <div v-if="!readonly" class="dialog-right">
+                            <bpm-definition-selector
+                                button
+                                multiple
+                                @callback="updateDefine"
+                            />
+                            <el-button
+                                class="ibps-icon-remove ibps-ml-10"
+                                type="danger"
+                                @click="handleAllDelete(multipleSelection)"
+                            >删除</el-button>
+                        </div>
+                    </el-form-item>
+                    <el-form-item
+                        v-loading="rowLoading"
+                        label-width="0px"
+                        :element-loading-text="$t('common.loading')"
+                    >
+                        <el-table
+                            ref="multipleTable"
+                            border
+                            :data="bpmAgent.bpmAgentDefPoList"
+                            tooltip-effect="dark"
+                            style="width: 100%"
+                            @selection-change="handleSelectionChange"
+                        >
+                            <el-table-column v-if="!readonly" type="selection" width="45" />
+                            <el-table-column label="流程名称">
+                                <template slot-scope="scope">{{
+                                    scope.row.procDefName ? scope.row.procDefName : scope.row.name
+                                }}</template>
+                            </el-table-column>
+                            <el-table-column v-if="!readonly" label="操作" width="55">
+                                <template slot-scope="scope">
+                                    <el-button
+                                        type="danger"
+                                        icon="el-icon-delete"
+                                        circle
+                                        @click="handleDelete(scope.$index, scope.row)"
+                                    />
+                                </template>
+                            </el-table-column>
+                        </el-table>
+                    </el-form-item>
+                </div>
+
+                <!-- 条件代理 -->
+                <div v-if="bpmAgent.agentType === 'condition'">
+                    <el-form-item label="流程名称:">
+                        <bpm-definition-selector
+                            v-model="bpmAgent.procDefId"
+                            :disabled="readonly"
+                        />
+                    </el-form-item>
+                    <el-form-item label="流程代理条件:">
+                        <div v-if="!readonly" class="dialog-right">
+                            <el-button
+                                class="ibps-icon-add"
+                                type="primary"
+                                @click="openConditionDialog"
+                            >添加</el-button>
+                            <el-button
+                                class="ibps-icon-remove ibps-ml-5"
+                                type="danger"
+                            >删除</el-button>
+                        </div>
+                    </el-form-item>
+                    <el-form-item
+                        v-loading="rowLoading"
+                        label-width="20px"
+                        :element-loading-text="$t('common.loading')"
+                    >
+                        <el-table
+                            ref="multipleTable"
+                            :data="bpmAgent.bpmAgentConditionPoList"
+                            tooltip-effect="dark"
+                            style="width: 100%"
+                            @selection-change="handleConditionChange"
+                        >
+                            <el-table-column type="selection" width="55" />
+                            <el-table-column label="代理人">
+                                <template slot-scope="scope">{{
+                                    scope.row.agenterName
+                                }}</template>
+                            </el-table-column>
+                            <el-table-column label="条件名称">
+                                <template slot-scope="scope">{{ scope.row.name }}</template>
+                            </el-table-column>
+                            <el-table-column
+                                prop="address"
+                                label="管理"
+                                width="100px"
+                                show-overflow-tooltip
+                            >
+                                <el-button
+                                    type="primary"
+                                    icon="el-icon-edit"
+                                    circle
+                                    @click="handleEdit(scope.$index, scope.row)"
+                                />
+                                <el-button
+                                    type="danger"
+                                    icon="el-icon-delete"
+                                    circle
+                                    @click="handleRemove(scope.$index, scope.row)"
+                                />
+                            </el-table-column>
+                        </el-table>
+                    </el-form-item>
+                </div>
+            </el-form>
         </div>
-      </el-form>
-    </div>
 
-    <div slot="footer" class="el-dialog--center">
-      <ibps-toolbar :actions="toolbars" @action-event="handleActionEvent" />
-    </div>
+        <div slot="footer" class="el-dialog--center">
+            <ibps-toolbar :actions="toolbars" @action-event="handleActionEvent" />
+        </div>
 
-    <!-- 添加规则弹窗 -->
-    <condition
-      :def-id="bpmAgent.procDefId"
-      :visible="conditionDialogVisible"
-      @callback="callbackBpmAgentConditionPoList"
-      @close="(visible) => (conditionDialogVisible = visible)"
-    />
-  </el-dialog>
+        <!-- 添加规则弹窗 -->
+        <condition
+            :def-id="bpmAgent.procDefId"
+            :visible="conditionDialogVisible"
+            @callback="callbackBpmAgentConditionPoList"
+            @close="(visible) => (conditionDialogVisible = visible)"
+        />
+    </el-dialog>
 </template>
 
 <script>
-import { save, get } from "@/api/platform/bpmn/bpmAgent";
-import { agentTypeOptions, statusOptions } from "./constants";
-import ActionUtils from "@/utils/action";
-import IbpsEmployeeSelector from "@/business/platform/org/employee/selector";
-import BpmDefinitionSelector from "@/business/platform/bpmn/definition/selector";
-import ibpsUserSelector from "@/business/platform/org/selector";
-import curdPost from "@/business/platform/form/utils/custom/joinCURD.js";
-import helpTip from "@/business/platform/form/formbuilder/right-aside/components/help-tip.vue";
-import Condition from "./condition";
-import { load } from "@/api/platform/org/employee";
-import { setTimeout } from "timers";
-import { mapGetters } from "vuex";
+import { save, get } from '@/api/platform/bpmn/bpmAgent'
+import { agentTypeOptions, statusOptions } from './constants'
+import ActionUtils from '@/utils/action'
+import IbpsEmployeeSelector from '@/business/platform/org/employee/selector'
+import BpmDefinitionSelector from '@/business/platform/bpmn/definition/selector'
+import ibpsUserSelector from '@/business/platform/org/selector'
+import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
+import helpTip from '@/business/platform/form/formbuilder/right-aside/components/help-tip.vue'
+import Condition from './condition'
+import { load } from '@/api/platform/org/employee'
+import { setTimeout } from 'timers'
+import { mapGetters } from 'vuex'
 
 export default {
-  components: {
-    IbpsEmployeeSelector,
-    BpmDefinitionSelector,
-    Condition,
-    ibpsUserSelector,
-    helpTip,
-  },
-  props: {
-    visible: {
-      type: Boolean,
-      default: false,
-    },
-    readonly: {
-      type: Boolean,
-      default: false,
+    components: {
+        IbpsEmployeeSelector,
+        BpmDefinitionSelector,
+        Condition,
+        ibpsUserSelector,
+        helpTip
     },
-    id: String,
-    title: String,
-  },
-  data() {
-    const { first = "", second = "" } = this.$store.getters.level;
-    const level = second || first;
-    return {
-      level,
-      formName: "agentForm",
-      formLabelWidth: "115px",
-      dialogVisible: this.visible,
-      conditionDialogVisible: false, // 条件规则界面
-      dialogLoading: false,
-      rowLoading: false,
-      statusOptions: statusOptions,
-      agentTypeOptions: agentTypeOptions,
-      defaultForm: {},
-      multipleSelection: [],
-      conditionSelection: [],
-      bpmAgent: {
-        title: "",
-        procDefId: "",
-        procDefKey: "",
-        delegatorId: this.$store.getters.userId,
-        delegatorName: this.$store.getters.name,
-        effectiveTime: "",
-        expiryTime: "",
-        agenterId: "",
-        agenterName: "",
-        agentType: "all",
-        isEnabled: "enabled",
-        bpmAgentDefPoList: [],
-        bpmAgentConditionPoList: [],
-        bpmAgentRoleList: [],
-      },
-      rules: {
-        title: [
-          { required: true, message: this.$t("validate.required") },
-          {
-            min: 1,
-            max: 64,
-            message: "长度不能超过64个字符",
-            trigger: "blur",
-          },
-        ],
-        delegatorId: [
-          { required: true, message: this.$t("validate.required") },
-        ],
-        agenterId: [{ required: true, message: this.$t("validate.required") }],
-        effectiveTime: [
-          { required: true, message: this.$t("validate.required") },
-        ],
-        expiryTime: [{ required: true, message: this.$t("validate.required") }],
-        isEnabled: [{ required: true, message: this.$t("validate.required") }],
-      },
-      toolbars: [
-        {
-          key: "save",
-          hidden: () => {
-            return this.readonly;
-          },
+    props: {
+        visible: {
+            type: Boolean,
+            default: false
         },
-        { key: "cancel" },
-      ],
-      url: "",
-      srcList: [],
-
-      // 委托人和代理人 选择器修改通用选择器,需要这些参数
-      type: "user",
-      filter: [
-        {
-          descVal: "2",
-          includeSub: true,
-          old: "position",
-          partyId: "",
-          partyName: "",
-          scriptContent: "",
-          type: "user",
-          userType: "position",
+        readonly: {
+            type: Boolean,
+            default: false
         },
-      ],
-      multiple: false,
-      filtrate: true,
-      store: "id",
-      disabled: false,
-      delegatorDisabled: false,
-      readonlyText: "null",
-      roleList: [],
-      // checkRoleList: [],
-      daiRoleName: "",
-      yuanRoleList: [],
-      daiRoleList: [],
-      formAsterisk: {
-        title: "角色代理",
-        content: "该委托人角色代理主要用于菜单权限与编辑按钮权限",
-      },
-    };
-  },
-  computed: {
-    formId() {
-      return this.id;
-    },
-    isMyself() {
-      return this.$store.getters.userId === this.bpmAgent.delegatorId;
-    },
-    ...mapGetters(["isSuper"]),
-  },
-  watch: {
-    visible: {
-      handler: function () {
-        this.dialogVisible = this.visible;
-      },
-      immediate: true,
-    },
-    "bpmAgent.delegatorId": {
-      handler: function () {
-        this.delegatorDisabled = !this.isSuper && this.isMyself;
-        this.getWeiTuo(this.bpmAgent.delegatorId, 1);
-      },
-      immediate: true,
-      deep: true,
-    },
-    "bpmAgent.agenterId": {
-      handler: function () {
-        this.getWeiTuo(this.bpmAgent.agenterId, 2);
-      },
-      immediate: true,
-      deep: true,
-    },
-  },
-  created() {
-    this.defaultForm = JSON.parse(JSON.stringify(this.bpmAgent));
-    this.getImage();
-    this.getInit();
-  },
-  mounted() {
-    this.$nextTick(() => {
-      if (this.$refs.multipleTable) {
-        this.$refs.multipleTable.doLayout();
-      }
-    });
-  },
-  methods: {
-    // 初始化
-    getInit() {
-      this.filter[0].partyId =
-        this.$store.getters.userInfo.employee.positions || "";
-    },
-    handleEdit() {
-      this.rowLoading = true;
-      setTimeout(() => {
-        this.rowLoading = false;
-        // TODO:
-      });
+        id: String,
+        title: String
     },
-    handleRemove() {
-      this.rowLoading = true;
-      setTimeout(() => {
-        this.rowLoading = false;
-        // TODO:
-      });
-    },
-    callbackBpmAgentConditionPoList() {},
-    handleDelete(index, arr) {
-      this.rowLoading = true;
-      setTimeout(() => {
-        if (arr !== []) {
-          this.bpmAgent.bpmAgentDefPoList.splice(index, 1);
-        } else {
-          arr.forEach((i) => {
-            this.bpmAgent.bpmAgentDefPoList.forEach((l) => {
-              if (i.procDefKey === l.procDefKey) {
-                this.bpmAgent.bpmAgentDefPoList.splice(l, 1);
-              }
-            });
-          });
-        }
-        this.rowLoading = false;
-      });
-    },
-    handleAllDelete(arr) {
-      this.rowLoading = true;
-      setTimeout(() => {
-        if (!this.$utils.isEmpty(arr)) {
-          arr.forEach((i) => {
-            this.bpmAgent.bpmAgentDefPoList.forEach((l) => {
-              if (i.procDefKey === l.procDefKey) {
-                this.bpmAgent.bpmAgentDefPoList.splice(l, 1);
-              }
-            });
-          });
+    data () {
+        const { first = '', second = '' } = this.$store.getters.level
+        const level = second || first
+        return {
+            level,
+            formName: 'agentForm',
+            formLabelWidth: '115px',
+            dialogVisible: this.visible,
+            conditionDialogVisible: false, // 条件规则界面
+            dialogLoading: false,
+            rowLoading: false,
+            statusOptions: statusOptions,
+            agentTypeOptions: agentTypeOptions,
+            defaultForm: {},
+            multipleSelection: [],
+            conditionSelection: [],
+            bpmAgent: {
+                title: '',
+                procDefId: '',
+                procDefKey: '',
+                delegatorId: this.$store.getters.userId,
+                delegatorName: this.$store.getters.name,
+                effectiveTime: '',
+                expiryTime: '',
+                agenterId: '',
+                agenterName: '',
+                agentType: 'all',
+                isEnabled: 'enabled',
+                bpmAgentDefPoList: [],
+                bpmAgentConditionPoList: [],
+                bpmAgentRoleList: []
+            },
+            rules: {
+                title: [
+                    { required: true, message: this.$t('validate.required') },
+                    {
+                        min: 1,
+                        max: 64,
+                        message: '长度不能超过64个字符',
+                        trigger: 'blur'
+                    }
+                ],
+                delegatorId: [
+                    { required: true, message: this.$t('validate.required') }
+                ],
+                agenterId: [{ required: true, message: this.$t('validate.required') }],
+                effectiveTime: [
+                    { required: true, message: this.$t('validate.required') }
+                ],
+                expiryTime: [{ required: true, message: this.$t('validate.required') }],
+                isEnabled: [{ required: true, message: this.$t('validate.required') }]
+            },
+            toolbars: [
+                {
+                    key: 'save',
+                    hidden: () => {
+                        return this.readonly
+                    }
+                },
+                { key: 'cancel' }
+            ],
+            url: '',
+            srcList: [],
+
+            // 委托人和代理人 选择器修改通用选择器,需要这些参数
+            type: 'user',
+            filter: [
+                {
+                    descVal: '2',
+                    includeSub: true,
+                    old: 'position',
+                    partyId: '',
+                    partyName: '',
+                    scriptContent: '',
+                    type: 'user',
+                    userType: 'position'
+                }
+            ],
+            multiple: false,
+            filtrate: true,
+            store: 'id',
+            disabled: false,
+            delegatorDisabled: false,
+            readonlyText: 'null',
+            roleList: [],
+            // checkRoleList: [],
+            daiRoleName: '',
+            yuanRoleList: [],
+            daiRoleList: [],
+            formAsterisk: {
+                title: '角色代理',
+                content: '该委托人角色代理主要用于菜单权限与编辑按钮权限'
+            }
         }
-        this.rowLoading = false;
-      });
     },
-    handleSelectionChange(val) {
-      this.multipleSelection = val;
-    },
-    handleConditionChange(val) {
-      this.conditionSelection = val;
-    },
-    handleActionEvent({ key }) {
-      switch (key) {
-        case "save":
-          this.handleSave();
-          break;
-        case "cancel":
-          this.closeDialog();
-          break;
-        default:
-          break;
-      }
+    computed: {
+        formId () {
+            return this.id
+        },
+        isMyself () {
+            return this.$store.getters.userId === this.bpmAgent.delegatorId
+        },
+        ...mapGetters(['isSuper'])
     },
-    // 保存数据
-    handleSave() {
-      // 委托人和代理人校验
-      if (this.getVerification()) {
-        return;
-      }
-      this.$refs[this.formName].validate((valid) => {
-        if (valid) {
-          this.saveData();
-        } else {
-          ActionUtils.saveErrorMessage();
+    watch: {
+        visible: {
+            handler: function () {
+                this.dialogVisible = this.visible
+            },
+            immediate: true
+        },
+        'bpmAgent.delegatorId': {
+            handler: function () {
+                this.delegatorDisabled = !this.isSuper && this.isMyself
+                this.getWeiTuo(this.bpmAgent.delegatorId, 1)
+            },
+            immediate: true,
+            deep: true
+        },
+        'bpmAgent.agenterId': {
+            handler: function () {
+                this.getWeiTuo(this.bpmAgent.agenterId, 2)
+            },
+            immediate: true,
+            deep: true
         }
-      });
     },
-    // 提交保存数据
-    saveData() {
-      const data = JSON.parse(JSON.stringify(this.bpmAgent));
-      data.effectiveTime =
-        new Date(this.bpmAgent.effectiveTime).getTime() || "";
-      data.expiryTime = new Date(this.bpmAgent.expiryTime).getTime() || "";
-      // 检测生效时间日期是否发布日期在之前。
-      if (data.effectiveTime > data.expiryTime) {
-        ActionUtils.error("生效时间与失效时间范围不合法!");
-        return;
-      }
-      if (
-        this.$utils.isEmpty(this.bpmAgent.bpmAgentDefPoList) &&
-        this.bpmAgent.agentType === "part"
-      ) {
-        ActionUtils.error("流程定义数据不能为空!");
-        return;
-      }
-      save(this.bpmAgent)
-        .then((response) => {
-          this.$emit("callback", this);
-          ActionUtils.saveSuccessMessage(response.message, (rtn) => {
-            if (this.$utils.isEmpty(this.formId)) {
-              this.$refs[this.formName].resetFields();
-            }
-            if (rtn) {
-              this.closeDialog();
+    created () {
+        this.defaultForm = JSON.parse(JSON.stringify(this.bpmAgent))
+        this.getImage()
+        this.getInit()
+    },
+    mounted () {
+        this.$nextTick(() => {
+            if (this.$refs.multipleTable) {
+                this.$refs.multipleTable.doLayout()
             }
-          });
         })
-        .catch(() => {
-          ActionUtils.error("无法保存,请稍后检查数据重新再试");
-        });
-    },
-    // 关闭当前窗口
-    closeDialog() {
-      this.$emit("close", false);
-      this.$refs[this.formName].resetFields();
-      this.daiRoleName = "";
-      this.roleList = [];
-      // this.checkRoleList = []
     },
-    /**
+    methods: {
+    // 初始化
+        getInit () {
+            this.filter[0].partyId =
+        this.$store.getters.userInfo.employee.positions || ''
+        },
+        handleEdit () {
+            this.rowLoading = true
+            setTimeout(() => {
+                this.rowLoading = false
+                // TODO:
+            })
+        },
+        handleRemove () {
+            this.rowLoading = true
+            setTimeout(() => {
+                this.rowLoading = false
+                // TODO:
+            })
+        },
+        callbackBpmAgentConditionPoList () {},
+        handleDelete (index, arr) {
+            this.rowLoading = true
+            setTimeout(() => {
+                if (arr !== []) {
+                    this.bpmAgent.bpmAgentDefPoList.splice(index, 1)
+                } else {
+                    arr.forEach((i) => {
+                        this.bpmAgent.bpmAgentDefPoList.forEach((l) => {
+                            if (i.procDefKey === l.procDefKey) {
+                                this.bpmAgent.bpmAgentDefPoList.splice(l, 1)
+                            }
+                        })
+                    })
+                }
+                this.rowLoading = false
+            })
+        },
+        handleAllDelete (arr) {
+            this.rowLoading = true
+            setTimeout(() => {
+                if (!this.$utils.isEmpty(arr)) {
+                    arr.forEach((i) => {
+                        this.bpmAgent.bpmAgentDefPoList.forEach((l) => {
+                            if (i.procDefKey === l.procDefKey) {
+                                this.bpmAgent.bpmAgentDefPoList.splice(l, 1)
+                            }
+                        })
+                    })
+                }
+                this.rowLoading = false
+            })
+        },
+        handleSelectionChange (val) {
+            this.multipleSelection = val
+        },
+        handleConditionChange (val) {
+            this.conditionSelection = val
+        },
+        handleActionEvent ({ key }) {
+            switch (key) {
+                case 'save':
+                    this.handleSave()
+                    break
+                case 'cancel':
+                    this.closeDialog()
+                    break
+                default:
+                    break
+            }
+        },
+        // 保存数据
+        handleSave () {
+            // 委托人和代理人校验
+            if (this.getVerification()) {
+                return
+            }
+            this.$refs[this.formName].validate((valid) => {
+                if (valid) {
+                    this.saveData()
+                } else {
+                    ActionUtils.saveErrorMessage()
+                }
+            })
+        },
+        // 提交保存数据
+        saveData () {
+            const data = JSON.parse(JSON.stringify(this.bpmAgent))
+            data.effectiveTime =
+        new Date(this.bpmAgent.effectiveTime).getTime() || ''
+            data.expiryTime = new Date(this.bpmAgent.expiryTime).getTime() || ''
+            // 检测生效时间日期是否发布日期在之前。
+            if (data.effectiveTime > data.expiryTime) {
+                ActionUtils.error('生效时间与失效时间范围不合法!')
+                return
+            }
+            if (
+                this.$utils.isEmpty(this.bpmAgent.bpmAgentDefPoList) &&
+        this.bpmAgent.agentType === 'part'
+            ) {
+                ActionUtils.error('流程定义数据不能为空!')
+                return
+            }
+            save(this.bpmAgent)
+                .then((response) => {
+                    this.$emit('callback', this)
+                    ActionUtils.saveSuccessMessage(response.message, (rtn) => {
+                        if (this.$utils.isEmpty(this.formId)) {
+                            this.$refs[this.formName].resetFields()
+                        }
+                        if (rtn) {
+                            this.closeDialog()
+                        }
+                    })
+                })
+                .catch(() => {
+                    ActionUtils.error('无法保存,请稍后检查数据重新再试')
+                })
+        },
+        // 关闭当前窗口
+        closeDialog () {
+            this.$emit('close', false)
+            this.$refs[this.formName].resetFields()
+            this.daiRoleName = ''
+            this.roleList = []
+            // this.checkRoleList = []
+        },
+        /**
      * 表单验证
      */
-    formValidate() {
-      if (this.readonly) return;
-      this.$nextTick(() => {
-        this.$refs[this.formName].validate(() => {});
-      });
-    },
-    /**
+        formValidate () {
+            if (this.readonly) return
+            this.$nextTick(() => {
+                this.$refs[this.formName].validate(() => {})
+            })
+        },
+        /**
      * 获取表单数据
      */
-    getFormData() {
-      if (this.$utils.isEmpty(this.formId)) {
-        // 重置表单
-        this.bpmAgent = JSON.parse(JSON.stringify(this.defaultForm));
-        this.formValidate();
-        return;
-      }
-      this.dialogLoading = true;
-      get({
-        id: this.formId,
-      })
-        .then((response) => {
-          this.bpmAgent = response.data;
+        getFormData () {
+            if (this.$utils.isEmpty(this.formId)) {
+                // 重置表单
+                this.bpmAgent = JSON.parse(JSON.stringify(this.defaultForm))
+                this.formValidate()
+                return
+            }
+            this.dialogLoading = true
+            get({
+                id: this.formId
+            })
+                .then((response) => {
+                    this.bpmAgent = response.data
 
-          // this.checkRoleList = response.data.bpmAgentRoleList || []
-          this.bpmAgent.bpmAgentRoleList = response.data.bpmAgentRoleList || [];
-          this.formValidate();
-          this.dialogLoading = false;
-        })
-        .catch(() => {
-          this.dialogLoading = false;
-        });
-    },
-    addDef() {
-      alert("打开流程选择器");
-    },
-    callbackDelegatorrInfo(data) {
-      // this.checkRoleList = []
-      this.bpmAgent.bpmAgentRoleList = [];
-      this.bpmAgent.delegatorName = data.name;
-      this.getVerification();
-    },
-    callbackAgenterInfo(data) {
-      // this.checkRoleList = []
-      this.bpmAgent.bpmAgentRoleList = [];
-      this.bpmAgent.agenterName = data.name;
-      this.getVerification();
-    },
-    updateDefine(data) {
-      this.rowLoading = true;
-      const arr = data.map((item) => {
-        return {
-          id: "",
-          agentId: "",
-          procDefKey: item.defKey,
-          nodeId: "",
-          name: item.name,
-        };
-      });
-      setTimeout(() => {
-        if (this.$utils.isEmpty(this.bpmAgent.bpmAgentDefPoList)) {
-          this.bpmAgent.bpmAgentDefPoList = arr;
-        } else {
-          this.bpmAgent.bpmAgentDefPoList =
-            this.bpmAgent.bpmAgentDefPoList.concat(arr);
-        }
-        this.rowLoading = false;
-      });
-    },
-    openConditionDialog() {
-      if (this.$utils.isEmpty(this.bpmAgent.procDefId)) {
-        ActionUtils.warning("请选择流程!!");
-        return;
-      }
-      this.conditionDialogVisible = true;
-    },
+                    // this.checkRoleList = response.data.bpmAgentRoleList || []
+                    this.bpmAgent.bpmAgentRoleList = response.data.bpmAgentRoleList || []
+                    this.formValidate()
+                    this.dialogLoading = false
+                })
+                .catch(() => {
+                    this.dialogLoading = false
+                })
+        },
+        addDef () {
+            alert('打开流程选择器')
+        },
+        callbackDelegatorrInfo (data) {
+            // this.checkRoleList = []
+            this.bpmAgent.bpmAgentRoleList = []
+            this.bpmAgent.delegatorName = data.name
+            this.getVerification()
+        },
+        callbackAgenterInfo (data) {
+            // this.checkRoleList = []
+            this.bpmAgent.bpmAgentRoleList = []
+            this.bpmAgent.agenterName = data.name
+            this.getVerification()
+        },
+        updateDefine (data) {
+            this.rowLoading = true
+            const arr = data.map((item) => {
+                return {
+                    id: '',
+                    agentId: '',
+                    procDefKey: item.defKey,
+                    nodeId: '',
+                    name: item.name
+                }
+            })
+            setTimeout(() => {
+                if (this.$utils.isEmpty(this.bpmAgent.bpmAgentDefPoList)) {
+                    this.bpmAgent.bpmAgentDefPoList = arr
+                } else {
+                    this.bpmAgent.bpmAgentDefPoList =
+            this.bpmAgent.bpmAgentDefPoList.concat(arr)
+                }
+                this.rowLoading = false
+            })
+        },
+        openConditionDialog () {
+            if (this.$utils.isEmpty(this.bpmAgent.procDefId)) {
+                ActionUtils.warning('请选择流程!!')
+                return
+            }
+            this.conditionDialogVisible = true
+        },
 
-    getImage() {
-      const sql = `select * from t_dlpz where di_dian_ = '${this.level}' order by create_time_ desc LIMIT 1`;
-      curdPost("sql", sql).then((res) => {
-        if (res.state === 200) {
-          const datas = res.variables.data;
-          if (datas.length > 0) {
-            const image = JSON.parse(datas[0].tu_pian_);
-            const idList = image.map((item) => {
-              return item.id;
-            });
-            const ids = idList.join(",");
-            this.getUrl(ids);
-          }
-        }
-      });
-    },
-    getUrl(id) {
-      const sql1 = `select nei_rong_ from t_ipcc where id_ = '1'`;
-      const sql2 = `select * from ibps_file_attachment where find_in_set(ID_,'${id}')`;
-      Promise.all([curdPost("sql", sql1), curdPost("sql", sql2)]).then(
-        ([res1, res2]) => {
-          if (res1.state === 200 && res2.state === 200) {
-            const datas1 = res1.variables.data;
-            const datas2 = res2.variables.data;
-            const ip = datas1[0].nei_rong_;
-            const imageList = datas2.map((item) => {
-              return ip + "/" + item.FILE_PATH_;
-            });
-            this.srcList = imageList;
-          }
-        }
-      );
-    },
-    getWeiTuo(id, type = 1, formId = "") {
-      if (!id) return;
-      return new Promise((resolve) => {
-        load({ employeeId: id })
-          .then((response) => {
-            const data = response;
-            const partyRole = response.variables.partyRoles;
-            if (type === 1) {
-              this.yuanRoleList = partyRole || [];
+        getImage () {
+            const sql = `select * from t_dlpz where di_dian_ = '${this.level}' order by create_time_ desc LIMIT 1`
+            curdPost('sql', sql).then((res) => {
+                if (res.state === 200) {
+                    const datas = res.variables.data
+                    if (datas.length > 0) {
+                        const image = JSON.parse(datas[0].tu_pian_)
+                        const idList = image.map((item) => {
+                            return item.id
+                        })
+                        const ids = idList.join(',')
+                        this.getUrl(ids)
+                    }
+                }
+            })
+        },
+        getUrl (id) {
+            const sql1 = `select nei_rong_ from t_ipcc where id_ = '1'`
+            const sql2 = `select * from ibps_file_attachment where find_in_set(ID_,'${id}')`
+            Promise.all([curdPost('sql', sql1), curdPost('sql', sql2)]).then(
+                ([res1, res2]) => {
+                    if (res1.state === 200 && res2.state === 200) {
+                        const datas1 = res1.variables.data
+                        const datas2 = res2.variables.data
+                        const ip = datas1[0].nei_rong_
+                        const imageList = datas2.map((item) => {
+                            return ip + '/' + item.FILE_PATH_
+                        })
+                        this.srcList = imageList
+                    }
+                }
+            )
+        },
+        getWeiTuo (id, type = 1, formId = '') {
+            if (!id) return
+            return new Promise((resolve) => {
+                load({ employeeId: id })
+                    .then((response) => {
+                        const data = response
+                        const partyRole = response.variables.partyRoles
+                        if (type === 1) {
+                            this.yuanRoleList = partyRole || []
+                        }
+                        if (type === 2) {
+                            this.daiRoleList = partyRole || []
+                            const roleName = partyRole.map((item) => item.name)
+                            this.daiRoleName = roleName.join(',')
+                        }
+                        this.getRoleList()
+                        resolve(data)
+                    })
+                    .catch(() => {})
+            })
+        },
+        // 获取委托人角色信息
+        getRoleList () {
+            if (this.yuanRoleList.length > 0 && this.daiRoleList.length > 0) {
+                this.roleList = this.yuanRoleList.filter((item) => {
+                    return !this.daiRoleList.some((it) => it.id === item.id)
+                })
             }
-            if (type === 2) {
-              this.daiRoleList = partyRole || [];
-              const roleName = partyRole.map((item) => item.name);
-              this.daiRoleName = roleName.join(",");
+        },
+        getVerification () {
+            if (this.bpmAgent.agenterId === this.bpmAgent.delegatorId) {
+                this.$message.error('委托人和代理人是同一个账号,请重新选择。')
+                return true
+            } else {
+                return false
             }
-            this.getRoleList();
-            resolve(data);
-          })
-          .catch(() => {});
-      });
-    },
-    // 获取委托人角色信息
-    getRoleList() {
-      if (this.yuanRoleList.length > 0 && this.daiRoleList.length > 0) {
-        this.roleList = this.yuanRoleList.filter((item) => {
-          return !this.daiRoleList.some((it) => it.id === item.id);
-        });
-      }
-    },
-    getVerification() {
-      if (this.bpmAgent.agenterId === this.bpmAgent.delegatorId) {
-        this.$message.error("委托人和代理人是同一个账号,请重新选择。");
-        return true;
-      } else {
-        return false;
-      }
-    },
-    getWeiTuoName(data, list) {
-      const nameList = [];
-      list.forEach((item) => {
-        if (data.includes(item.id)) {
-          nameList.push(item.name);
+        },
+        getWeiTuoName (data, list) {
+            const nameList = []
+            list.forEach((item) => {
+                if (data.includes(item.id)) {
+                    nameList.push(item.name)
+                }
+            })
+            return nameList.join(',')
         }
-      });
-      return nameList.join(",");
-    },
-  },
-};
+    }
+}
 </script>
 
 <style lang="scss" scoped>

+ 311 - 310
src/views/platform/bpmn/bpmAgent/list.vue

@@ -1,338 +1,339 @@
 <template>
-  <div class="main-container">
-    <ibps-crud
-      ref="crud"
-      :height="height"
-      :data="listData"
-      :toolbars="listConfig.toolbars"
-      :search-form="listConfig.searchForm"
-      :pk-key="pkKey"
-      :columns="listConfig.columns"
-      :row-handle="listConfig.rowHandle"
-      :pagination="pagination"
-      :loading="loading"
-      :index-row="false"
-      :display-field="listTitle"
-      @action-event="handleAction"
-      @sort-change="handleSortChange"
-      @pagination-change="handlePaginationChange"
-    >
-      <template slot="delegatorId">
-        <!-- <ibps-employee-selector :value="searchDelegatorId" style="width: 200px" @input="getDelegatorId" /> -->
-        <ibps-user-selector
-          v-model="searchDelegatorId"
-          :type="type"
-          :filter="filter"
-          :multiple="multiple"
-          :filtrate="filtrate"
-          :store="store"
-          :disabled="disabled"
-          :readonly-text="readonlyText"
-          placeholder="请选择代理人"
-          @change-link-data="callbackAgenterInfo"
+    <div class="main-container">
+        <ibps-crud
+            ref="crud"
+            :height="height"
+            :data="listData"
+            :toolbars="listConfig.toolbars"
+            :search-form="listConfig.searchForm"
+            :pk-key="pkKey"
+            :columns="listConfig.columns"
+            :row-handle="listConfig.rowHandle"
+            :pagination="pagination"
+            :loading="loading"
+            :index-row="false"
+            :display-field="listTitle"
+            @action-event="handleAction"
+            @sort-change="handleSortChange"
+            @pagination-change="handlePaginationChange"
+        >
+            <template slot="delegatorId">
+                <!-- <ibps-employee-selector :value="searchDelegatorId" style="width: 200px" @input="getDelegatorId" /> -->
+                <ibps-user-selector
+                    v-model="searchDelegatorId"
+                    :type="type"
+                    :filter="filter"
+                    :multiple="multiple"
+                    :filtrate="filtrate"
+                    :store="store"
+                    :disabled="disabled"
+                    :readonly-text="readonlyText"
+                    placeholder="请选择代理人"
+                    @change-link-data="callbackAgenterInfo"
+                />
+            </template>
+        </ibps-crud>
+        <edit
+            :id="editId"
+            :title="title"
+            :visible="dialogFormVisible"
+            :readonly="readonly"
+            @callback="search"
+            @close="(visible) => (dialogFormVisible = visible)"
         />
-      </template>
-    </ibps-crud>
-    <edit
-      :id="editId"
-      :title="title"
-      :visible="dialogFormVisible"
-      :readonly="readonly"
-      @callback="search"
-      @close="(visible) => (dialogFormVisible = visible)"
-    />
-  </div>
+    </div>
 </template>
 
 <script>
-import IbpsEmployeeSelector from "@/business/platform/org/employee/selector";
-import { queryPageList, remove, setEnable } from "@/api/platform/bpmn/bpmAgent";
-import ibpsUserSelector from "@/business/platform/org/selector";
-import ActionUtils from "@/utils/action";
-import FixHeight from "@/mixins/height";
-import { statusOptions, agentTypeOptions } from "./constants";
-import Edit from "./edit";
-import { mapGetters } from "vuex";
+import IbpsEmployeeSelector from '@/business/platform/org/employee/selector'
+import { queryPageList, remove, setEnable } from '@/api/platform/bpmn/bpmAgent'
+import ibpsUserSelector from '@/business/platform/org/selector'
+import ActionUtils from '@/utils/action'
+import FixHeight from '@/mixins/height'
+import { statusOptions, agentTypeOptions } from './constants'
+import Edit from './edit'
+import { mapGetters } from 'vuex'
 
 export default {
-  components: {
-    IbpsEmployeeSelector,
-    Edit,
-    ibpsUserSelector,
-  },
-  mixins: [FixHeight],
-  data() {
-    return {
-      dialogFormVisible: false, // 弹窗
-      editId: "", // 编辑dialog需要使用
-      readonly: false, // 是否只读
-      pkKey: "id", // 主键  如果主键不是pk需要传主键
+    components: {
+        IbpsEmployeeSelector,
+        Edit,
+        ibpsUserSelector
+    },
+    mixins: [FixHeight],
+    data () {
+        return {
+            dialogFormVisible: false, // 弹窗
+            editId: '', // 编辑dialog需要使用
+            readonly: false, // 是否只读
+            pkKey: 'id', // 主键  如果主键不是pk需要传主键
 
-      searchDelegatorId: "",
-      listTitle: "事务代理记录列表",
-      title: "",
-      loading: true,
-      height: document.clientHeight,
+            searchDelegatorId: '',
+            listTitle: '事务代理记录列表',
+            title: '',
+            loading: true,
+            height: document.clientHeight,
 
-      listData: [],
-      pagination: {},
-      sorts: {},
-      listConfig: {
-        toolbars: [
-          {
-            key: "search",
-          },
-          {
-            key: "add",
-          },
-          {
-            key: "edit",
-          },
-          {
-            key: "remove",
-          },
-        ],
-        searchForm: {
-          forms: [
-            // { prop: 'Q^TITLE_^SL', label: '标题' },
-            {
-              prop: "Q^AGENTER_ID_^S",
-              label: "代理人",
-              fieldType: "slot",
-              slotName: "delegatorId",
-            },
-            {
-              prop: "Q^IS_ENABLED_^S",
-              label: "是否启用",
-              fieldType: "select",
-              options: statusOptions,
-            },
-            // {
-            //     prop: 'Q^AGENT_TYPE_^S',
-            //     label: '代理类型',
-            //     fieldType: 'select',
-            //     options: agentTypeOptions
-            // }
-          ],
-        },
-        // 表格字段配置
-        columns: [
-          { prop: "title", label: "标题" },
-          { prop: "delegatorName", label: "委托人", width: "100" },
-          { prop: "agenterName", label: "代理人", width: "100" },
-          {
-            prop: "isEnabled",
-            label: "是否启用",
-            tags: statusOptions,
-            width: "100",
-          },
-          {
-            prop: "effectiveTime",
-            label: "生效时间",
-            sortable: "custom",
-            width: "100",
-          },
-          {
-            prop: "expiryTime",
-            label: "失效时间",
-            sortable: "custom",
-            width: "100",
-          },
-          {
-            prop: "agentType",
-            label: "代理类型",
-            tags: agentTypeOptions,
-            width: "150",
-          },
-        ],
-        rowHandle: {
-          effect: "display",
-          actions: [
-            //     {
-            //     key: 'edit'
-            //   }, {
-            //     key: 'enabled',
-            //     label: '启用',
-            //     icon: 'ibps-icon-toggle-on',
-            //     hidden: (rowData, index) => {
-            //       return rowData.isEnabled === 'enabled'
-            //     }
-            //   }, {
-            //     key: 'disabled',
-            //     label: '禁用',
-            //     icon: 'ibps-icon-toggle-off',
-            //     hidden: (rowData, index) => {
-            //       return rowData.isEnabled === 'disabled'
-            //     }
-            //   }, {
-            //     key: 'remove'
-            //   },
-            {
-              key: "detail",
-              label: "查阅",
+            listData: [],
+            pagination: {},
+            sorts: {},
+            listConfig: {
+                toolbars: [
+                    {
+                        key: 'search'
+                    },
+                    {
+                        key: 'add'
+                    },
+                    {
+                        key: 'edit'
+                    },
+                    {
+                        key: 'remove'
+                    }
+                ],
+                searchForm: {
+                    forms: [
+                        // { prop: 'Q^TITLE_^SL', label: '标题' },
+                        {
+                            prop: 'Q^AGENTER_ID_^S',
+                            label: '代理人',
+                            fieldType: 'slot',
+                            slotName: 'delegatorId'
+                        },
+                        {
+                            prop: 'Q^IS_ENABLED_^S',
+                            label: '是否启用',
+                            fieldType: 'select',
+                            options: statusOptions
+                        }
+                        // {
+                        //     prop: 'Q^AGENT_TYPE_^S',
+                        //     label: '代理类型',
+                        //     fieldType: 'select',
+                        //     options: agentTypeOptions
+                        // }
+                    ]
+                },
+                // 表格字段配置
+                columns: [
+                    { prop: 'title', label: '标题' },
+                    { prop: 'delegatorName', label: '委托人', width: '100' },
+                    { prop: 'agenterName', label: '代理人', width: '100' },
+                    {
+                        prop: 'isEnabled',
+                        label: '是否启用',
+                        tags: statusOptions,
+                        width: '100'
+                    },
+                    {
+                        prop: 'effectiveTime',
+                        label: '生效时间',
+                        sortable: 'custom',
+                        width: '100'
+                    },
+                    {
+                        prop: 'expiryTime',
+                        label: '失效时间',
+                        sortable: 'custom',
+                        width: '100'
+                    },
+                    {
+                        prop: 'agentType',
+                        label: '代理类型',
+                        tags: agentTypeOptions,
+                        width: '150'
+                    }
+                ],
+                rowHandle: {
+                    effect: 'display',
+                    actions: [
+                        //     {
+                        //     key: 'edit'
+                        //   }, {
+                        //     key: 'enabled',
+                        //     label: '启用',
+                        //     icon: 'ibps-icon-toggle-on',
+                        //     hidden: (rowData, index) => {
+                        //       return rowData.isEnabled === 'enabled'
+                        //     }
+                        //   }, {
+                        //     key: 'disabled',
+                        //     label: '禁用',
+                        //     icon: 'ibps-icon-toggle-off',
+                        //     hidden: (rowData, index) => {
+                        //       return rowData.isEnabled === 'disabled'
+                        //     }
+                        //   }, {
+                        //     key: 'remove'
+                        //   },
+                        {
+                            key: 'detail',
+                            label: '查阅'
+                        }
+                    ]
+                }
             },
-          ],
-        },
-      },
-      // 委托人和代理人 选择器修改通用选择器,需要这些参数
-      type: "user",
-      filter: [
-        {
-          descVal: "2",
-          includeSub: true,
-          old: "position",
-          partyId: "",
-          partyName: "",
-          scriptContent: "",
-          type: "user",
-          userType: "position",
-        },
-      ],
-      multiple: false,
-      filtrate: true,
-      store: "id",
-      disabled: false,
-      readonlyText: "null",
-    };
-  },
-  created() {
-    this.getInit();
-    this.loadData();
-  },
-  methods: {
-    // 初始化
-    getInit() {
-      this.filter[0].partyId =
-        this.$store.getters.userInfo.employee.positions || "";
-    },
-    getDelegatorId(value) {
-      this.searchDelegatorId = value;
+            // 委托人和代理人 选择器修改通用选择器,需要这些参数
+            type: 'user',
+            filter: [
+                {
+                    descVal: '2',
+                    includeSub: true,
+                    old: 'position',
+                    partyId: '',
+                    partyName: '',
+                    scriptContent: '',
+                    type: 'user',
+                    userType: 'position'
+                }
+            ],
+            multiple: false,
+            filtrate: true,
+            store: 'id',
+            disabled: false,
+            readonlyText: 'null'
+        }
     },
-    callbackAgenterInfo(value, data, type) {
-      this.searchDelegatorId = value;
+    computed: {
+        ...mapGetters(['isSuper', 'userId'])
     },
-    // 加载数据
-    loadData() {
-      this.loading = true;
-      queryPageList(this.getSearcFormData())
-        .then((response) => {
-          ActionUtils.handleListData(this, response.data);
-          this.loading = false;
-        })
-        .catch(() => {
-          this.loading = false;
-        });
+    created () {
+        this.getInit()
+        this.loadData()
     },
-    /**
+
+    methods: {
+    // 初始化
+        getInit () {
+            this.filter[0].partyId =
+        this.$store.getters.userInfo.employee.positions || ''
+        },
+        getDelegatorId (value) {
+            this.searchDelegatorId = value
+        },
+        callbackAgenterInfo (value, data, type) {
+            this.searchDelegatorId = value
+        },
+        // 加载数据
+        loadData () {
+            this.loading = true
+            queryPageList(this.getSearcFormData())
+                .then((response) => {
+                    ActionUtils.handleListData(this, response.data)
+                    this.loading = false
+                })
+                .catch(() => {
+                    this.loading = false
+                })
+        },
+        /**
      * 获取格式化参数
      */
-    getSearcFormData() {
-      const params = this.$refs["crud"]
-        ? this.$refs["crud"].getSearcFormData()
-        : {};
-      params["Q^AGENTER_ID_^S"] = this.searchDelegatorId;
-      return ActionUtils.formatParams(params, this.pagination, this.sorts);
-    },
-    /**
+        getSearcFormData () {
+            const params = this.$refs['crud']
+                ? this.$refs['crud'].getSearcFormData()
+                : {}
+            params['Q^AGENTER_ID_^S'] = this.searchDelegatorId
+            return ActionUtils.formatParams(params, this.pagination, this.sorts)
+        },
+        /**
      * 处理分页事件
      */
-    handlePaginationChange(page) {
-      ActionUtils.setPagination(this.pagination, page);
-      this.loadData();
-    },
-    /**
+        handlePaginationChange (page) {
+            ActionUtils.setPagination(this.pagination, page)
+            this.loadData()
+        },
+        /**
      * 处理排序
      */
-    handleSortChange(sort) {
-      ActionUtils.setSorts(this.sorts, sort);
-      this.loadData();
-    },
-    /**
+        handleSortChange (sort) {
+            ActionUtils.setSorts(this.sorts, sort)
+            this.loadData()
+        },
+        /**
      * 查询
      */
-    search() {
-      this.loadData();
-    },
-    /**
+        search () {
+            this.loadData()
+        },
+        /**
      * 处理按钮事件
      */
-    handleAction(command, position, selection, data) {
-      switch (command) {
-        case "search": // 查询
-          ActionUtils.setFirstPagination(this.pagination);
-          this.search();
-          break;
-        case "add": // 添加
-          this.handleEdit();
-          this.title = "事务代理设置";
-          break;
-        case "edit": // 编辑
-          ActionUtils.selectedRecord(selection)
-            .then((id) => {
-              if (!this.isSuper && this.userId !== data[0].delegatorId) {
-                 return ActionUtils.noPowerMessage();
-              }
-              this.handleEdit(id);
-              this.title = "编辑流程代理";
-            })
-            .catch(() => {});
-          break;
-        case "detail": // 明细
-          ActionUtils.selectedRecord(selection)
-            .then((id) => {
-              this.handleEdit(id, true);
-              this.title = "流程代理明细";
-            })
-            .catch(() => {});
-          break;
-        case "remove": // 删除
-          ActionUtils.removeRecord(selection)
-            .then((ids) => {
-              this.handleRemove(ids);
-            })
-            .catch(() => {});
-          break;
-        case "enabled": // 启用
-          this.handleSetEnable(data.id, "enabled");
-          break;
-        case "disabled": // 禁用
-          this.handleSetEnable(data.id, "disabled");
-          break;
-        default:
-          break;
-      }
-    },
-    /**
+        handleAction (command, position, selection, data) {
+            switch (command) {
+                case 'search': // 查询
+                    ActionUtils.setFirstPagination(this.pagination)
+                    this.search()
+                    break
+                case 'add': // 添加
+                    this.handleEdit()
+                    this.title = '事务代理设置'
+                    break
+                case 'edit': // 编辑
+                    ActionUtils.selectedRecord(selection)
+                        .then((id) => {
+                            if (!this.isSuper && this.userId !== data[0].delegatorId) {
+                                return ActionUtils.noPowerMessage()
+                            }
+                            this.handleEdit(id)
+                            this.title = '编辑流程代理'
+                        })
+                        .catch(() => {})
+                    break
+                case 'detail': // 明细
+                    ActionUtils.selectedRecord(selection)
+                        .then((id) => {
+                            this.handleEdit(id, true)
+                            this.title = '流程代理明细'
+                        })
+                        .catch(() => {})
+                    break
+                case 'remove': // 删除
+                    ActionUtils.removeRecord(selection)
+                        .then((ids) => {
+                            this.handleRemove(ids)
+                        })
+                        .catch(() => {})
+                    break
+                case 'enabled': // 启用
+                    this.handleSetEnable(data.id, 'enabled')
+                    break
+                case 'disabled': // 禁用
+                    this.handleSetEnable(data.id, 'disabled')
+                    break
+                default:
+                    break
+            }
+        },
+        /**
      * 处理编辑。
      */
-    handleEdit(id = "", readonly = false) {
-      this.editId = id;
-      this.readonly = readonly;
-      this.dialogFormVisible = true;
-    },
-    /**
+        handleEdit (id = '', readonly = false) {
+            this.editId = id
+            this.readonly = readonly
+            this.dialogFormVisible = true
+        },
+        /**
      * 处理删除
      */
-    handleRemove(ids) {
-      remove({ ids: ids })
-        .then((response) => {
-          ActionUtils.removeSuccessMessage();
-          this.search();
-        })
-        .catch(() => {});
-    },
-    handleSetEnable(id, status) {
-      const params = { id: id, isEnabled: status };
-      setEnable(params)
-        .then((response) => {
-          ActionUtils.removeSuccessMessage(response.message);
-          this.search();
-        })
-        .catch(() => {});
-    },
-  },
-  computed: {
-    ...mapGetters(["isSuper", "userId"]),
-  },
-};
+        handleRemove (ids) {
+            remove({ ids: ids })
+                .then((response) => {
+                    ActionUtils.removeSuccessMessage()
+                    this.search()
+                })
+                .catch(() => {})
+        },
+        handleSetEnable (id, status) {
+            const params = { id: id, isEnabled: status }
+            setEnable(params)
+                .then((response) => {
+                    ActionUtils.removeSuccessMessage(response.message)
+                    this.search()
+                })
+                .catch(() => {})
+        }
+    }
+}
 </script>

+ 585 - 587
src/views/platform/examination/exam/detail.vue

@@ -1,167 +1,166 @@
 <template>
-  <el-dialog
-    :title="title"
-    :visible.sync="dialogVisible"
-    :close-on-click-modal="false"
-    :close-on-press-escape="false"
-    :show-close="false"
-    append-to-body
-    fullscreen
-    class="dialog paper-detail-dialog"
-    top="0"
-    @open="loadData"
-    @close="closeDialog"
-  >
-    <div class="container">
-      <div class="paper-info">
-        <div class="info-item">
-          <span class="label">考试名称:</span>
-          <span class="value">{{ paperData.examName }}</span>
-        </div>
-        <div class="info-item">
-          <span class="label">创建人:</span>
-          <span class="value">{{ transformUser(paperData.createBy) }}</span>
-        </div>
-        <div class="info-item">
-          <span class="label">创建时间:</span>
-          <span class="value">{{ paperData.createTime }}</span>
-        </div>
-        <div class="info-item">
-          <span class="label">发布时间:</span>
-          <span class="value">{{ paperData.publishDate }}</span>
-        </div>
-        <div class="info-item">
-          <span class="label">限考时间:</span>
-          <span class="value">{{ paperData.limitDate }}</span>
-        </div>
-        <div class="info-item">
-          <span class="label">考试时长:</span>
-          <span class="value">{{ transformTime(paperData.duration) }}</span>
-        </div>
-        <div class="info-item">
-          <span class="label">限考次数:</span>
-          <span class="value">{{ paperData.limitCount }}</span>
-        </div>
-        <div class="info-item">
-          <span class="label">题库名称:</span>
-          <span class="value">{{ paperData.bankName }}</span>
-        </div>
-        <div class="info-item">
-          <span class="label">题目数量:</span>
-          <span class="value">{{ paperData.questionCount }}</span>
-        </div>
-        <div class="info-item">
-          <span class="label">总分:</span>
-          <span class="value">{{ paperData.totalScore }}分</span>
-        </div>
-        <div class="info-item">
-          <el-tooltip
-            effect="dark"
-            content="达标分值占总分的比率"
-            placement="top"
-          >
-            <span class="label">达标占比:</span>
-          </el-tooltip>
-          <span class="value">{{ paperData.qualifiedRadio }}%</span>
-        </div>
-        <div class="info-item">
-          <span class="label">最高分:</span>
-          <span class="value">{{ maxScore }}</span>
-        </div>
-        <div class="info-item">
-          <span class="label">最低分:</span>
-          <span class="value">{{ minScore }}</span>
-        </div>
-        <div class="info-item">
-          <span class="label">平均分:</span>
-          <span class="value">{{ avgScore }}</span>
-        </div>
-        <div class="info-item">
-          <span class="label">计分方式:</span>
-          <span class="value">{{ paperData.scoringType }}</span>
-        </div>
-        <div class="info-item">
-          <span class="label">应参考人数:</span>
-          <span class="value">{{ paperList.length }}</span>
-        </div>
-        <div class="info-item">
-          <span class="label">实参考人数:</span>
-          <span class="value">{{ joinRate.count }}</span>
-        </div>
-        <div class="info-item">
-          <span class="label">参考率:</span>
-          <span class="value">{{ joinRate.rate }}</span>
-        </div>
-        <div class="info-item">
-          <span class="label">达标率:</span>
-          <span class="value">{{ passRate }}</span>
-        </div>
-      </div>
-      <div class="paper-status">
-        <div>
-          考试状态:<el-select
-            v-model="selectValue"
-            placeholder="请选择查询状态"
-            @change="onSelectChange"
-          >
-            <el-option
-              v-for="item in paperOptions"
-              :key="item.value"
-              :label="item.label"
-              :value="item.value"
-            >
-            </el-option>
-          </el-select>
-        </div>
+    <el-dialog
+        :title="title"
+        :visible.sync="dialogVisible"
+        :close-on-click-modal="false"
+        :close-on-press-escape="false"
+        :show-close="false"
+        append-to-body
+        fullscreen
+        class="dialog paper-detail-dialog"
+        top="0"
+        @open="loadData"
+        @close="closeDialog"
+    >
+        <div class="container">
+            <div class="paper-info">
+                <div class="info-item">
+                    <span class="label">考试名称:</span>
+                    <span class="value">{{ paperData.examName }}</span>
+                </div>
+                <div class="info-item">
+                    <span class="label">创建人:</span>
+                    <span class="value">{{ transformUser(paperData.createBy) }}</span>
+                </div>
+                <div class="info-item">
+                    <span class="label">创建时间:</span>
+                    <span class="value">{{ paperData.createTime }}</span>
+                </div>
+                <div class="info-item">
+                    <span class="label">发布时间:</span>
+                    <span class="value">{{ paperData.publishDate }}</span>
+                </div>
+                <div class="info-item">
+                    <span class="label">限考时间:</span>
+                    <span class="value">{{ paperData.limitDate }}</span>
+                </div>
+                <div class="info-item">
+                    <span class="label">考试时长:</span>
+                    <span class="value">{{ transformTime(paperData.duration) }}</span>
+                </div>
+                <div class="info-item">
+                    <span class="label">限考次数:</span>
+                    <span class="value">{{ paperData.limitCount }}</span>
+                </div>
+                <div class="info-item">
+                    <span class="label">题库名称:</span>
+                    <span class="value">{{ paperData.bankName }}</span>
+                </div>
+                <div class="info-item">
+                    <span class="label">题目数量:</span>
+                    <span class="value">{{ paperData.questionCount }}</span>
+                </div>
+                <div class="info-item">
+                    <span class="label">总分:</span>
+                    <span class="value">{{ paperData.totalScore }}分</span>
+                </div>
+                <div class="info-item">
+                    <el-tooltip
+                        effect="dark"
+                        content="达标分值占总分的比率"
+                        placement="top"
+                    >
+                        <span class="label">达标占比:</span>
+                    </el-tooltip>
+                    <span class="value">{{ paperData.qualifiedRadio }}%</span>
+                </div>
+                <div class="info-item">
+                    <span class="label">最高分:</span>
+                    <span class="value">{{ maxScore }}</span>
+                </div>
+                <div class="info-item">
+                    <span class="label">最低分:</span>
+                    <span class="value">{{ minScore }}</span>
+                </div>
+                <div class="info-item">
+                    <span class="label">平均分:</span>
+                    <span class="value">{{ avgScore }}</span>
+                </div>
+                <div class="info-item">
+                    <span class="label">计分方式:</span>
+                    <span class="value">{{ paperData.scoringType }}</span>
+                </div>
+                <div class="info-item">
+                    <span class="label">应参考人数:</span>
+                    <span class="value">{{ paperList.length }}</span>
+                </div>
+                <div class="info-item">
+                    <span class="label">实参考人数:</span>
+                    <span class="value">{{ joinRate.count }}</span>
+                </div>
+                <div class="info-item">
+                    <span class="label">参考率:</span>
+                    <span class="value">{{ joinRate.rate }}</span>
+                </div>
+                <div class="info-item">
+                    <span class="label">达标率:</span>
+                    <span class="value">{{ passRate }}</span>
+                </div>
+            </div>
+            <div class="paper-status">
+                <div>
+                    考试状态:<el-select
+                        v-model="selectValue"
+                        placeholder="请选择查询状态"
+                        @change="onSelectChange"
+                    >
+                        <el-option
+                            v-for="item in paperOptions"
+                            :key="item.value"
+                            :label="item.label"
+                            :value="item.value"
+                        />
+                    </el-select>
+                </div>
 
-        <el-button type="primary" @click="showStatistics"
-          >各部门数据统计</el-button
-        >
-      </div>
-      <div class="paper-table">
-        <el-table
-          ref="elTable"
-          :data="showPaperList"
-          border
-          stripe
-          highlight-current-row
-          header-row-class-name="exam-table-header"
-          style="width: 100%"
-          class="exam-table"
-          @row-dblclick="handleRowDblclick"
-        >
-          <el-table-column label="序号" type="index" width="50" />
-          <el-table-column prop="userName" label="考生姓名" width="100" />
-          <el-table-column prop="positionId" label="部门" width="100">
-            <template slot-scope="{ row }">
-              <ibps-user-selector
-                type="position"
-                :value="row.positionId"
-                readonlyText="text"
-                :disabled="true"
-                :multiple="true"
-              />
-            </template>
-          </el-table-column>
-          <el-table-column prop="count" label="参考次数/完成次数" width="90" />
-          <el-table-column prop="" label="考试成绩">
-            <el-table-column prop="max" label="最高得分" width="90" />
-            <el-table-column prop="min" label="最低得分" width="90" />
-            <el-table-column prop="avg" label="平均得分" width="90" />
-            <el-table-column prop="latest" label="最近得分" width="90" />
-          </el-table-column>
-          <el-table-column prop="resultScore" label="最终成绩" width="90" />
-          <el-table-column prop="isQualified" label="是否达标">
-            <template slot-scope="scope">
-              <el-tag
-                :type="getTagType(scope.row)"
-                size="medium"
-                class="score"
-                >{{ scope.row.isQualified }}</el-tag
-              >
-            </template>
-          </el-table-column>
-          <!-- <el-table-column
+                <el-button
+                    type="primary"
+                    @click="showStatistics"
+                >各部门数据统计</el-button>
+            </div>
+            <div class="paper-table">
+                <el-table
+                    ref="elTable"
+                    :data="showPaperList"
+                    border
+                    stripe
+                    highlight-current-row
+                    header-row-class-name="exam-table-header"
+                    style="width: 100%"
+                    class="exam-table"
+                    @row-dblclick="handleRowDblclick"
+                >
+                    <el-table-column label="序号" type="index" width="50" />
+                    <el-table-column prop="userName" label="考生姓名" width="100" />
+                    <el-table-column prop="positionId" label="部门" width="100">
+                        <template slot-scope="{ row }">
+                            <ibps-user-selector
+                                type="position"
+                                :value="row.positionId"
+                                readonly-text="text"
+                                :disabled="true"
+                                :multiple="true"
+                            />
+                        </template>
+                    </el-table-column>
+                    <el-table-column prop="count" label="参考次数/完成次数" width="90" />
+                    <el-table-column prop="" label="考试成绩">
+                        <el-table-column prop="max" label="最高得分" width="90" />
+                        <el-table-column prop="min" label="最低得分" width="90" />
+                        <el-table-column prop="avg" label="平均得分" width="90" />
+                        <el-table-column prop="latest" label="最近得分" width="90" />
+                    </el-table-column>
+                    <el-table-column prop="resultScore" label="最终成绩" width="90" />
+                    <el-table-column prop="isQualified" label="是否达标">
+                        <template slot-scope="scope">
+                            <el-tag
+                                :type="getTagType(scope.row)"
+                                size="medium"
+                                class="score"
+                            >{{ scope.row.isQualified }}</el-tag>
+                        </template>
+                    </el-table-column>
+                    <!-- <el-table-column
                         fixed="right"
                         label="操作"
                         width="60"
@@ -170,457 +169,456 @@
                             <el-button type="text" size="small" @click="handleRowDblclick(scope.row)">详情</el-button>
                         </template>
                     </el-table-column> -->
-        </el-table>
+                </el-table>
 
-        <el-pagination
-          style="margin-top: 5px; padding-bottom: 10px"
-          @size-change="handleSizeChange"
-          @current-change="handleCurrentChange"
-          :current-page="currentPage"
-          :page-sizes="[10, 15, 20, 25, 30, 50]"
-          :page-size="pageSize"
-          layout="prev,pager,next,jumper,sizes,->,total"
-          :total="filterPaperList.length"
-        >
-        </el-pagination>
-      </div>
-    </div>
-    <div slot="footer" class="el-dialog--center">
-      <ibps-toolbar :actions="toolbars" @action-event="handleActionEvent" />
-    </div>
-    <paper-detail
-      v-if="paperDialogVisible"
-      :id="paperId"
-      :visible.sync="paperDialogVisible"
-      :bank-id="bankId"
-      :exam-id="examId"
-      :examinee-id="examineeId"
-      @close="paperDialogVisible = false"
-    />
-    <Statistics
-      ref="statisticsRef"
-      :departmentData="departmentData"
-    ></Statistics>
-  </el-dialog>
+                <el-pagination
+                    style="margin-top: 5px; padding-bottom: 10px"
+                    :current-page="currentPage"
+                    :page-sizes="[10, 15, 20, 25, 30, 50]"
+                    :page-size="pageSize"
+                    layout="prev,pager,next,jumper,sizes,->,total"
+                    :total="filterPaperList.length"
+                    @size-change="handleSizeChange"
+                    @current-change="handleCurrentChange"
+                />
+            </div>
+        </div>
+        <div slot="footer" class="el-dialog--center">
+            <ibps-toolbar :actions="toolbars" @action-event="handleActionEvent" />
+        </div>
+        <paper-detail
+            v-if="paperDialogVisible"
+            :id="paperId"
+            :visible.sync="paperDialogVisible"
+            :bank-id="bankId"
+            :exam-id="examId"
+            :examinee-id="examineeId"
+            @close="paperDialogVisible = false"
+        />
+        <Statistics
+            ref="statisticsRef"
+            :department-data="departmentData"
+        />
+    </el-dialog>
 </template>
 
 <script>
-import IbpsUserSelector from "@/business/platform/org/selector";
+import IbpsUserSelector from '@/business/platform/org/selector'
 // 数据统计组件
-import Statistics from "./statistics.vue";
-import { max, min, mean, sum, maxBy, minBy, meanBy, round } from "lodash";
+import Statistics from './statistics.vue'
+import { max, min, mean, sum, maxBy, minBy, meanBy, round } from 'lodash'
 const qualifiedType = [
-  {
-    value: "达标",
-    type: "success",
-  },
-  {
-    value: "未达标",
-    type: "danger",
-  },
-  {
-    value: "考试未结束",
-    type: "warning",
-  },
-];
-export default {
-  components: {
-    IbpsImage: () => import("@/business/platform/file/image"),
-    PaperDetail: () => import("../questionBank/detail"),
-    IbpsUserSelector,
-    Statistics,
-  },
-  props: {
-    visible: {
-      type: Boolean,
-      default: false,
-    },
-    bankId: {
-      type: String,
-      default: "",
+    {
+        value: '达标',
+        type: 'success'
     },
-    examId: {
-      type: String,
-      default: "",
+    {
+        value: '未达标',
+        type: 'danger'
     },
-    id: {
-      type: String,
-      default: "",
+    {
+        value: '考试未结束',
+        type: 'warning'
+    }
+]
+export default {
+    components: {
+        IbpsImage: () => import('@/business/platform/file/image'),
+        PaperDetail: () => import('../questionBank/detail'),
+        IbpsUserSelector,
+        Statistics
     },
-  },
-  data() {
-    return {
-      title: "考试详情",
-      dialogVisible: this.visible,
-      paperDialogVisible: false,
-      toolbars: [{ key: "cancel", label: "退出" }],
-      paperList: [],
-      paperData: [],
-      paperId: "",
-      examineeId: "",
-      maxScore: "",
-      minScore: "",
-      avgScore: "",
-      passRate: "",
-      paperOptions: [
-        {
-          value: "all",
-          label: "全部",
+    props: {
+        visible: {
+            type: Boolean,
+            default: false
         },
-        {
-          value: "good",
-          label: "达标",
+        bankId: {
+            type: String,
+            default: ''
         },
-        {
-          value: "bad",
-          label: "未达标",
+        examId: {
+            type: String,
+            default: ''
         },
-        {
-          value: "noFinish",
-          label: "考试未结束",
-        },
-      ],
-      selectValue: "all",
-      pageSize: 10,
-      currentPage: 1,
-      departmentData: [], // 数据统计
-    };
-  },
-  watch: {
-    visible: {
-      handler(val, oldVal) {
-        this.dialogVisible = this.visible;
-      },
-    },
-  },
-  mounted() {
-    this.loadData();
-
-    // 监听键盘事件
-    window.addEventListener("keyup", this.handleKeyPress);
-  },
-  beforeDestroy() {
-    window.removeEventListener("keyup", this.handleKeyPress);
-  },
-  methods: {
-    // 获取题库数据
-    async loadData() {
-      if (!this.examId) {
-        this.$message.error("获取题目信息失败,请重试!");
-        this.closeDialog();
-        return;
-      }
-      this.paperList = await this.getQuestionData();
-      console.log(this.paperList);
-      this.paperData = this.paperList[0];
-
-      this.posData();
-    },
-    // 获取部门数据
-    posData() {
-      this.paperList.forEach((item) => {
-        let user = this.$store.getters.userList.find(
-          (u) => u.userName === item.userName
-        );
-        item.positionId = user.positionId;
-      });
-    },
-
-    handleActionEvent({ key }) {
-      switch (key) {
-        case "cancel":
-          this.closeDialog();
-          break;
-        default:
-          break;
-      }
-    },
-    handleKeyPress(event) {
-      if (event.keyCode === 27 || event.key === "Esc") {
-        this.closeDialog();
-      }
-    },
-    getTagType(row) {
-      const temp = qualifiedType.find((i) => i.value === row.isQualified);
-      return temp ? temp.type : "default";
-    },
-    transformUser(userId) {
-      const { userList = [] } = this.$store.getters;
-      const user = userList.find((u) => u.userId === userId) || {};
-      return user.userName || "-";
-    },
-    transformTime(timeStamp) {
-      if (timeStamp === "不限" || !timeStamp) return "不限";
-      const hours = Math.floor(parseInt(timeStamp) / 3600000);
-      const minutes = Math.floor((parseInt(timeStamp) % 3600000) / 60000);
-      return hours + "小时" + minutes + "分钟";
-    },
-    getPassRate(list) {
-      const passScore =
-        (parseFloat(list[0].qualifiedRadio) / 100) *
-        parseFloat(list[0].totalScore);
-      const passList = list.filter((i) => i.resultScore >= passScore);
-      return ((passList.length / list.length) * 100).toFixed(2) + "%";
-    },
-    getQuestionData() {
-      const sql = `select qb.ti_ku_ming_cheng_ as bankName, ex.id_ as examId, ex.ti_ku_id_ as bankId, e.id_ as paperId, ex.zhuang_tai_ as examState, e.zhuang_tai_ as paperState, qb.ti_shu_ as questionCount, qb.zong_fen_ as totalScore, ex.kao_shi_ming_chen as examName, ex.can_kao_ren_yuan_ as examinee, e.kao_shi_ren_ as examineeId, ex.create_by_ as createBy, ex.chuang_jian_shi_j as createTime, ex.fa_bu_shi_jian_ as publishDate, ex.xian_kao_shi_jian as limitDate, ex.kao_shi_shi_chang as duration, ex.xian_kao_ci_shu_ as limitCount, ex.da_biao_zhan_bi_ as qualifiedRadio, ex.ji_fen_fang_shi_ as scoringType, ex.yun_xu_bao_ming_ as allowRegist, ex.kao_shi_miao_shu_ as examDesc, e.de_fen_ as score, e.bao_ming_shi_jian as applyTime, e.kai_shi_shi_jian_ as startTime, e.jie_shu_shi_jian_ as endTime from t_exams ex, t_question_bank qb, t_examination e where ex.ti_ku_id_ = qb.id_ and e.exam_id_ = ex.id_ and ex.id_ = '${this.examId}' order by e.kao_shi_ren_ desc, e.jie_shu_shi_jian_ desc`;
-      return new Promise((resolve, reject) => {
-        this.$common
-          .request("sql", sql)
-          .then((res) => {
-            const { data = [] } = res.variables || {};
-            if (!data.length) {
-              this.$message.warning("未查询到已提交的考试记录,请先完成考试!");
-              this.closeDialog();
-              return;
-            }
-            const result = [];
-            const scorrType = {
-              最高分: "max",
-              平均分: "avg",
-              最近得分: "latest",
-            };
-            data.forEach((item) => {
-              const index = result.findIndex(
-                (i) => i.examineeId === item.examineeId
-              );
-              if (index === -1) {
-                result.push({
-                  ...item,
-                  totalCount: data.length,
-                  totalScore: parseFloat(item.totalScore),
-                  statusList: [item.paperState],
-                  scoreList: [parseFloat(item.score || -1)],
-                });
-              } else {
-                result[index].scoreList.push(parseFloat(item.score || -1));
-                result[index].statusList.push(item.paperState);
-              }
-            });
-            const nodatadesc = "/";
-            result.forEach((item, index) => {
-              const finishScore = item.scoreList.filter((i) => i !== -1);
-              item.userName = this.transformUser(item.examineeId);
-              item.max = finishScore.length
-                ? round(max(finishScore), 2)
-                : nodatadesc;
-              item.min = finishScore.length
-                ? round(min(finishScore), 2)
-                : nodatadesc;
-              item.avg = finishScore.length
-                ? round(mean(finishScore), 2)
-                : nodatadesc;
-              item.sum = finishScore.length
-                ? round(sum(finishScore), 2)
-                : nodatadesc;
-              item.latest = finishScore.length
-                ? round(finishScore[0], 2)
-                : nodatadesc;
-              item.examCount = item.scoreList.length;
-              item.finishCount = finishScore.length;
-              item.count = `${item.examCount}/${item.finishCount}`;
-              item.examStatus =
-                item.examCount === item.finishCount ? "已完成" : "未完成";
-              item.resultScore = item[scorrType[item.scoringType]];
-              item.isQualified =
-                item.examStatus === "已完成"
-                  ? item.resultScore >=
-                    (parseFloat(item.qualifiedRadio) / 100) *
-                      parseFloat(item.totalScore)
-                    ? "达标"
-                    : "未达标"
-                  : "考试未结束";
-            });
-            const finishList = result.filter((i) => i.examStatus === "已完成");
-            this.maxScore = finishList.length
-              ? maxBy(finishList, "max").max
-              : nodatadesc;
-            this.minScore = finishList.length
-              ? minBy(finishList, "min").min
-              : nodatadesc;
-            this.avgScore = finishList.length
-              ? meanBy(finishList, "avg").toFixed(2)
-              : nodatadesc;
-            this.passRate = finishList.length
-              ? this.getPassRate(finishList)
-              : nodatadesc;
-            resolve(result);
-          })
-          .catch((error) => {
-            reject(error);
-          });
-      });
-    },
-    handleRowDblclick(row) {
-      this.paperId = row.paperId;
-      this.examineeId = row.examineeId;
-      this.paperDialogVisible = true;
-    },
-    // 关闭当前窗口
-    closeDialog() {
-      window.removeEventListener("keyup", this.handleKeyPress);
-      this.$emit("close", false);
-    },
-    // 选择器状态改变
-    onSelectChange(select) {
-      this.pageSize = 10;
-      this.currentPage = 1;
-    },
-    // 当前页码改变
-    handleCurrentChange(val) {
-      this.currentPage = val;
-    },
-    // 页码选择器改变
-    handleSizeChange(val) {
-      this.pageSize = val;
-      this.currentPage = 1;
-    },
-    // position部门所有应参考人数
-    filterdepartmentData(position) {
-      let count = 0;
-      this.paperList.forEach((paper) => {
-        let pos = paper.positions.split(",");
-        for (let i = 0; i < pos.length; i++) {
-          if (position === pos[i]) {
-            count++;
-            break;
-          }
+        id: {
+            type: String,
+            default: ''
         }
-      });
-      return count;
     },
-    // position部门所有已参考人数
-    filterJoindepartmentData(position) {
-      let count = 0;
-      this.paperList.forEach((paper) => {
-        let pos = paper.positions.split(",");
-        for (let i = 0; i < pos.length; i++) {
-          if (position === pos[i] && paper.count.split("/")[1] !== "0") {
-            count++;
-            break;
-          }
+    data () {
+        return {
+            title: '考试详情',
+            dialogVisible: this.visible,
+            paperDialogVisible: false,
+            toolbars: [{ key: 'cancel', label: '退出' }],
+            paperList: [],
+            paperData: [],
+            paperId: '',
+            examineeId: '',
+            maxScore: '',
+            minScore: '',
+            avgScore: '',
+            passRate: '',
+            paperOptions: [
+                {
+                    value: 'all',
+                    label: '全部'
+                },
+                {
+                    value: 'good',
+                    label: '达标'
+                },
+                {
+                    value: 'bad',
+                    label: '未达标'
+                },
+                {
+                    value: 'noFinish',
+                    label: '考试未结束'
+                }
+            ],
+            selectValue: 'all',
+            pageSize: 10,
+            currentPage: 1,
+            departmentData: [] // 数据统计
         }
-      });
-      return count;
     },
-    // position部门最高分
-    departmentMaxScore(pos) {
-      let res = 0;
-      this.paperList.forEach((paper) => {
-        let positionsArr = paper.positions.split(",");
-        let position = positionsArr.find((item) => item === pos);
-        if (position && paper.resultScore !== "/") {
-          res = Math.max(res, +paper.resultScore);
+    computed: {
+        filterPaperList () {
+            return this.paperList.filter((paper) => {
+                if (this.selectValue === 'all') return this.paperList
+                const { label } = this.paperOptions.find(
+                    (option) => option.value === this.selectValue
+                )
+                return paper.isQualified === label
+            })
+        },
+        showPaperList () {
+            const start = (this.currentPage - 1) * this.pageSize
+            const end = start + this.pageSize
+            return this.filterPaperList.slice(start, end)
+        },
+        joinRate () {
+            let count = 0
+            this.paperList.forEach((item) => {
+                if (item.count && item.count.split('/')[1] !== '0') {
+                    count++
+                }
+            })
+            return {
+                count,
+                rate: ((count / this.paperList.length) * 100).toFixed(2) + '%'
+            }
         }
-      });
-      return res;
     },
-    departmentMinScore(pos) {
-      let res = 1e9;
-      this.paperList.forEach((paper) => {
-        let positionsArr = paper.positions.split(",");
-        let position = positionsArr.find((item) => item === pos);
-        if (position && paper.resultScore !== "/") {
-          res = Math.min(res, +paper.resultScore);
+    watch: {
+        visible: {
+            handler (val, oldVal) {
+                this.dialogVisible = this.visible
+            }
         }
-      });
-      return res === 1e9 ? 0 : res;
     },
-    // position部门达标人数
-    departmentPassRate(pos) {
-      let count = 0;
-      this.paperList.forEach((paper) => {
-        let positionsArr = paper.positions.split(",");
-        let position = positionsArr.find((item) => item === pos);
-        if (position && paper.isQualified === "达标") {
-          count++;
-        }
-      });
-      return count;
+    mounted () {
+        this.loadData()
+
+        // 监听键盘事件
+        window.addEventListener('keyup', this.handleKeyPress)
     },
-    // position部门分数和
-    departmentScoreSum(pos) {
-      let count = 0;
-      this.paperList.forEach((paper) => {
-        let positionsArr = paper.positions.split(",");
-        let position = positionsArr.find((item) => item === pos);
-        if (position && paper.resultScore !== "/") {
-          count += +paper.resultScore;
-        }
-      });
-      return count;
+    beforeDestroy () {
+        window.removeEventListener('keyup', this.handleKeyPress)
     },
-    // 数据统计
-    showStatistics() {
-      this.paperList.forEach((paper) => {
-        let user = this.$store.getters.userList.find(
-          (user) => paper.userName === user.userName
-        );
-        if (user) {
-          paper["positions"] = user.positions;
-        }
-      });
+    methods: {
+    // 获取题库数据
+        async loadData () {
+            if (!this.examId) {
+                this.$message.error('获取题目信息失败,请重试!')
+                this.closeDialog()
+                return
+            }
+            this.paperList = await this.getQuestionData()
+            console.log(this.paperList)
+            this.paperData = this.paperList[0]
 
-      let departmentData = [];
-      this.paperList.forEach((paper) => {
-        let pos = paper.positions.split(",");
-        for (let i = 0; i < pos.length; i++) {
-          departmentData.push(pos[i]);
-        }
-      });
+            this.posData()
+        },
+        // 获取部门数据
+        posData () {
+            this.paperList.forEach((item) => {
+                const user = this.$store.getters.userList.find(
+                    (u) => u.userName === item.userName
+                )
+                item.positionId = user.positionId
+            })
+        },
 
-      departmentData = [...new Set(departmentData)];
-      this.departmentData = departmentData.map((item) => {
-        let plannedAttendees = this.filterdepartmentData(item);
-        let actualAttendees = this.filterJoindepartmentData(item);
-        let minScore = this.departmentMinScore(item);
-        let maxScore = this.departmentMaxScore(item);
-        let PassPeople = this.departmentPassRate(item);
-        let sumScore = this.departmentScoreSum(item);
+        handleActionEvent ({ key }) {
+            switch (key) {
+                case 'cancel':
+                    this.closeDialog()
+                    break
+                default:
+                    break
+            }
+        },
+        handleKeyPress (event) {
+            if (event.keyCode === 27 || event.key === 'Esc') {
+                this.closeDialog()
+            }
+        },
+        getTagType (row) {
+            const temp = qualifiedType.find((i) => i.value === row.isQualified)
+            return temp ? temp.type : 'default'
+        },
+        transformUser (userId) {
+            const { userList = [] } = this.$store.getters
+            const user = userList.find((u) => u.userId === userId) || {}
+            return user.userName || '-'
+        },
+        transformTime (timeStamp) {
+            if (timeStamp === '不限' || !timeStamp) return '不限'
+            const hours = Math.floor(parseInt(timeStamp) / 3600000)
+            const minutes = Math.floor((parseInt(timeStamp) % 3600000) / 60000)
+            return hours + '小时' + minutes + '分钟'
+        },
+        getPassRate (list) {
+            const passScore =
+        (parseFloat(list[0].qualifiedRadio) / 100) *
+        parseFloat(list[0].totalScore)
+            const passList = list.filter((i) => i.resultScore >= passScore)
+            return ((passList.length / list.length) * 100).toFixed(2) + '%'
+        },
+        getQuestionData () {
+            const sql = `select qb.ti_ku_ming_cheng_ as bankName, ex.id_ as examId, ex.ti_ku_id_ as bankId, e.id_ as paperId, ex.zhuang_tai_ as examState, e.zhuang_tai_ as paperState, qb.ti_shu_ as questionCount, qb.zong_fen_ as totalScore, ex.kao_shi_ming_chen as examName, ex.can_kao_ren_yuan_ as examinee, e.kao_shi_ren_ as examineeId, ex.create_by_ as createBy, ex.chuang_jian_shi_j as createTime, ex.fa_bu_shi_jian_ as publishDate, ex.xian_kao_shi_jian as limitDate, ex.kao_shi_shi_chang as duration, ex.xian_kao_ci_shu_ as limitCount, ex.da_biao_zhan_bi_ as qualifiedRadio, ex.ji_fen_fang_shi_ as scoringType, ex.yun_xu_bao_ming_ as allowRegist, ex.kao_shi_miao_shu_ as examDesc, e.de_fen_ as score, e.bao_ming_shi_jian as applyTime, e.kai_shi_shi_jian_ as startTime, e.jie_shu_shi_jian_ as endTime from t_exams ex, t_question_bank qb, t_examination e where ex.ti_ku_id_ = qb.id_ and e.exam_id_ = ex.id_ and ex.id_ = '${this.examId}' order by e.kao_shi_ren_ desc, e.jie_shu_shi_jian_ desc`
+            return new Promise((resolve, reject) => {
+                this.$common
+                    .request('sql', sql)
+                    .then((res) => {
+                        const { data = [] } = res.variables || {}
+                        if (!data.length) {
+                            this.$message.warning('未查询到已提交的考试记录,请先完成考试!')
+                            this.closeDialog()
+                            return
+                        }
+                        const result = []
+                        const scorrType = {
+                            最高分: 'max',
+                            平均分: 'avg',
+                            最近得分: 'latest'
+                        }
+                        data.forEach((item) => {
+                            const index = result.findIndex(
+                                (i) => i.examineeId === item.examineeId
+                            )
+                            if (index === -1) {
+                                result.push({
+                                    ...item,
+                                    totalCount: data.length,
+                                    totalScore: parseFloat(item.totalScore),
+                                    statusList: [item.paperState],
+                                    scoreList: [parseFloat(item.score || -1)]
+                                })
+                            } else {
+                                result[index].scoreList.push(parseFloat(item.score || -1))
+                                result[index].statusList.push(item.paperState)
+                            }
+                        })
+                        const nodatadesc = '/'
+                        result.forEach((item, index) => {
+                            const finishScore = item.scoreList.filter((i) => i !== -1)
+                            item.userName = this.transformUser(item.examineeId)
+                            item.max = finishScore.length
+                                ? round(max(finishScore), 2)
+                                : nodatadesc
+                            item.min = finishScore.length
+                                ? round(min(finishScore), 2)
+                                : nodatadesc
+                            item.avg = finishScore.length
+                                ? round(mean(finishScore), 2)
+                                : nodatadesc
+                            item.sum = finishScore.length
+                                ? round(sum(finishScore), 2)
+                                : nodatadesc
+                            item.latest = finishScore.length
+                                ? round(finishScore[0], 2)
+                                : nodatadesc
+                            item.examCount = item.scoreList.length
+                            item.finishCount = finishScore.length
+                            item.count = `${item.examCount}/${item.finishCount}`
+                            item.examStatus =
+                item.examCount === item.finishCount ? '已完成' : '未完成'
+                            item.resultScore = item[scorrType[item.scoringType]]
+                            item.isQualified =
+                item.examStatus === '已完成'
+                    ? item.resultScore >=
+                    (parseFloat(item.qualifiedRadio) / 100) *
+                      parseFloat(item.totalScore)
+                        ? '达标'
+                        : '未达标'
+                    : '考试未结束'
+                        })
+                        const finishList = result.filter((i) => i.examStatus === '已完成')
+                        this.maxScore = finishList.length
+                            ? maxBy(finishList, 'max').max
+                            : nodatadesc
+                        this.minScore = finishList.length
+                            ? minBy(finishList, 'min').min
+                            : nodatadesc
+                        this.avgScore = finishList.length
+                            ? meanBy(finishList, 'avg').toFixed(2)
+                            : nodatadesc
+                        this.passRate = finishList.length
+                            ? this.getPassRate(finishList)
+                            : nodatadesc
+                        resolve(result)
+                    })
+                    .catch((error) => {
+                        reject(error)
+                    })
+            })
+        },
+        handleRowDblclick (row) {
+            this.paperId = row.paperId
+            this.examineeId = row.examineeId
+            this.paperDialogVisible = true
+        },
+        // 关闭当前窗口
+        closeDialog () {
+            window.removeEventListener('keyup', this.handleKeyPress)
+            this.$emit('close', false)
+        },
+        // 选择器状态改变
+        onSelectChange (select) {
+            this.pageSize = 10
+            this.currentPage = 1
+        },
+        // 当前页码改变
+        handleCurrentChange (val) {
+            this.currentPage = val
+        },
+        // 页码选择器改变
+        handleSizeChange (val) {
+            this.pageSize = val
+            this.currentPage = 1
+        },
+        // position部门所有应参考人数
+        filterdepartmentData (position) {
+            let count = 0
+            this.paperList.forEach((paper) => {
+                const pos = paper.positions.split(',')
+                for (let i = 0; i < pos.length; i++) {
+                    if (position === pos[i]) {
+                        count++
+                        break
+                    }
+                }
+            })
+            return count
+        },
+        // position部门所有已参考人数
+        filterJoindepartmentData (position) {
+            let count = 0
+            this.paperList.forEach((paper) => {
+                const pos = paper.positions.split(',')
+                for (let i = 0; i < pos.length; i++) {
+                    if (position === pos[i] && paper.count.split('/')[1] !== '0') {
+                        count++
+                        break
+                    }
+                }
+            })
+            return count
+        },
+        // position部门最高分
+        departmentMaxScore (pos) {
+            let res = 0
+            this.paperList.forEach((paper) => {
+                const positionsArr = paper.positions.split(',')
+                const position = positionsArr.find((item) => item === pos)
+                if (position && paper.resultScore !== '/') {
+                    res = Math.max(res, +paper.resultScore)
+                }
+            })
+            return res
+        },
+        departmentMinScore (pos) {
+            let res = 1e9
+            this.paperList.forEach((paper) => {
+                const positionsArr = paper.positions.split(',')
+                const position = positionsArr.find((item) => item === pos)
+                if (position && paper.resultScore !== '/') {
+                    res = Math.min(res, +paper.resultScore)
+                }
+            })
+            return res === 1e9 ? 0 : res
+        },
+        // position部门达标人数
+        departmentPassRate (pos) {
+            let count = 0
+            this.paperList.forEach((paper) => {
+                const positionsArr = paper.positions.split(',')
+                const position = positionsArr.find((item) => item === pos)
+                if (position && paper.isQualified === '达标') {
+                    count++
+                }
+            })
+            return count
+        },
+        // position部门分数和
+        departmentScoreSum (pos) {
+            let count = 0
+            this.paperList.forEach((paper) => {
+                const positionsArr = paper.positions.split(',')
+                const position = positionsArr.find((item) => item === pos)
+                if (position && paper.resultScore !== '/') {
+                    count += +paper.resultScore
+                }
+            })
+            return count
+        },
+        // 数据统计
+        showStatistics () {
+            this.paperList.forEach((paper) => {
+                const user = this.$store.getters.userList.find(
+                    (user) => paper.userName === user.userName
+                )
+                if (user) {
+                    paper['positions'] = user.positions
+                }
+            })
 
-        return {
-          department: item,
-          plannedAttendees,
-          actualAttendees,
-          joinRate: actualAttendees / plannedAttendees,
-          minScore,
-          maxScore,
-          passRate: actualAttendees === 0 ? 0 : PassPeople / actualAttendees,
-          avgScore: actualAttendees === 0 ? 0 : sumScore / actualAttendees,
-        };
-      });
-      this.$refs.statisticsRef.open();
-    },
-  },
-  computed: {
-    filterPaperList() {
-      return this.paperList.filter((paper) => {
-        if (this.selectValue === "all") return this.paperList;
-        let { label } = this.paperOptions.find(
-          (option) => option.value === this.selectValue
-        );
-        return paper.isQualified === label;
-      });
-    },
-    showPaperList() {
-      let start = (this.currentPage - 1) * this.pageSize;
-      let end = start + this.pageSize;
-      return this.filterPaperList.slice(start, end);
-    },
-    joinRate() {
-      let count = 0;
-      this.paperList.forEach((item) => {
-        if (item.count && item.count.split("/")[1] !== "0") {
-          count++;
+            let departmentData = []
+            this.paperList.forEach((paper) => {
+                const pos = paper.positions.split(',')
+                for (let i = 0; i < pos.length; i++) {
+                    departmentData.push(pos[i])
+                }
+            })
+
+            departmentData = [...new Set(departmentData)]
+            this.departmentData = departmentData.map((item) => {
+                const plannedAttendees = this.filterdepartmentData(item)
+                const actualAttendees = this.filterJoindepartmentData(item)
+                const minScore = this.departmentMinScore(item)
+                const maxScore = this.departmentMaxScore(item)
+                const PassPeople = this.departmentPassRate(item)
+                const sumScore = this.departmentScoreSum(item)
+
+                return {
+                    department: item,
+                    plannedAttendees,
+                    actualAttendees,
+                    joinRate: actualAttendees / plannedAttendees,
+                    minScore,
+                    maxScore,
+                    passRate: actualAttendees === 0 ? 0 : PassPeople / actualAttendees,
+                    avgScore: actualAttendees === 0 ? 0 : sumScore / actualAttendees
+                }
+            })
+            this.$refs.statisticsRef.open()
         }
-      });
-      return {
-        count,
-        rate: ((count / this.paperList.length) * 100).toFixed(2) + "%",
-      };
-    },
-  },
-};
+    }
+}
 </script>
 <style lang="scss" scoped>
 .paper-detail-dialog {

+ 472 - 472
src/views/platform/examination/exam/edit.vue

@@ -1,34 +1,34 @@
 <template>
-  <el-dialog
-    :title="title"
-    :visible.sync="dialogVisible"
-    :close-on-click-modal="false"
-    :close-on-press-escape="false"
-    append-to-body
-    width="60%"
-    class="dialog exam-dialog"
-    top="6vh"
-    @close="closeDialog"
-    @open="getExamData"
-  >
-    <el-form
-      ref="form"
-      :label-width="formLabelWidth"
-      :model="form"
-      :rules="rules"
-      class="exam-form"
-      @submit.native.prevent
+    <el-dialog
+        :title="title"
+        :visible.sync="dialogVisible"
+        :close-on-click-modal="false"
+        :close-on-press-escape="false"
+        append-to-body
+        width="60%"
+        class="dialog exam-dialog"
+        top="6vh"
+        @close="closeDialog"
+        @open="getExamData"
     >
-      <el-form-item label="考试名称:" prop="kao_shi_ming_chen">
-        <el-input
-          v-model="form.kao_shi_ming_chen"
-          type="text"
-          :maxlength="256"
-          placeholder="请输入考试名称"
-          :disabled="isDisabled"
-        />
-      </el-form-item>
-      <!-- <el-form-item label="考试类型:" prop="kao_shi_lei_xing_">
+        <el-form
+            ref="form"
+            :label-width="formLabelWidth"
+            :model="form"
+            :rules="rules"
+            class="exam-form"
+            @submit.native.prevent
+        >
+            <el-form-item label="考试名称:" prop="kao_shi_ming_chen">
+                <el-input
+                    v-model="form.kao_shi_ming_chen"
+                    type="text"
+                    :maxlength="256"
+                    placeholder="请输入考试名称"
+                    :disabled="isDisabled"
+                />
+            </el-form-item>
+            <!-- <el-form-item label="考试类型:" prop="kao_shi_lei_xing_">
                 <el-select
                     v-model="form.kao_shi_lei_xing_"
                     filterable
@@ -44,469 +44,469 @@
                     />
                 </el-select>
             </el-form-item> -->
-      <el-form-item label="考试题库:" prop="ti_ku_id_">
-        <div class="tiku">
-          <div>
-            <ibps-custom-dialog
-              v-model="form.ti_ku_id_"
-              size="small"
-              template-key="tkdhk"
-              :multiple="false"
-              :disabled="isDisabled"
-              type="dialog"
-              class="custom-dialog"
-              placeholder="请选择考试题库"
-            />
-          </div>
+            <el-form-item label="考试题库:" prop="ti_ku_id_">
+                <div class="tiku">
+                    <div>
+                        <ibps-custom-dialog
+                            v-model="form.ti_ku_id_"
+                            size="small"
+                            template-key="tkdhk"
+                            :multiple="false"
+                            :disabled="isDisabled"
+                            type="dialog"
+                            class="custom-dialog"
+                            placeholder="请选择考试题库"
+                        />
+                    </div>
 
-          <!-- <el-button
+                    <!-- <el-button
             type="primary"
             @click="randTiku"
             :disabled="randButtonDisabled"
             >随机题库</el-button
           > -->
+                </div>
+            </el-form-item>
+            <el-form-item prop="xian_kao_shi_jian">
+                <template slot="label">
+                    限考时间
+                    <el-tooltip
+                        effect="dark"
+                        content="设置该考试的提交截至时间。"
+                        placement="top"
+                    >
+                        <i class="el-icon-question question-icon">:</i>
+                    </el-tooltip>
+                </template>
+                <el-radio-group
+                    v-model="form.isDateLimit"
+                    @change="changeLimit(form.isDateLimit, 'xian_kao_shi_jian', null)"
+                >
+                    <el-radio label="0">不限</el-radio>
+                    <el-radio label="1">限制</el-radio>
+                </el-radio-group>
+                <el-date-picker
+                    v-if="form.isDateLimit === '1'"
+                    v-model="form.xian_kao_shi_jian"
+                    type="datetime"
+                    placeholder="请选择考试限制提交时间"
+                    align="right"
+                    default-time="12:00:00"
+                    class="date-picker"
+                    :picker-options="pickerOptions"
+                />
+            </el-form-item>
+            <el-form-item label="参考人员:" prop="can_kao_ren_yuan_">
+                <ibps-custom-dialog
+                    v-model="form.can_kao_ren_yuan_"
+                    size="small"
+                    template-key="gjxcxryk"
+                    multiple
+                    :disabled="isDisabled"
+                    type="dialog"
+                    class="custom-dialog"
+                    placeholder="请选择需参加考试的人员"
+                />
+            </el-form-item>
+            <el-form-item prop="isCountLimit" class="inline-item">
+                <template slot="label">
+                    限考次数
+                    <el-tooltip
+                        effect="dark"
+                        content="限制是否可重复参加,以及可参加考试的最大次数。"
+                        placement="top"
+                    >
+                        <i class="el-icon-question question-icon">:</i>
+                    </el-tooltip>
+                </template>
+                <el-radio-group
+                    v-model="form.isCountLimit"
+                    :disabled="isDisabled"
+                    @change="changeLimit(form.isCountLimit, 'xian_kao_ci_shu_', 1)"
+                >
+                    <el-radio label="0">不限</el-radio>
+                    <el-radio label="1">限制</el-radio>
+                </el-radio-group>
+                <div v-if="form.isCountLimit === '1'" class="time">
+                    <el-input-number
+                        v-model="form.xian_kao_ci_shu_"
+                        :min="1"
+                        :precision="0"
+                        :disabled="isDisabled"
+                        placeholder="请输入单个用户最大限考次数"
+                    />
+                    <div class="unit">次</div>
+                </div>
+            </el-form-item>
+            <el-form-item
+                v-if="
+                    form.isCountLimit === '0' ||
+                        (form.isCountLimit === '1' && form.xian_kao_ci_shu_ > 1)
+                "
+                prop="ji_fen_fang_shi_"
+            >
+                <template slot="label">
+                    计分方式
+                    <el-tooltip
+                        effect="dark"
+                        content="设置对于可重复参加的考试,最终得分的计算方式(仅限考次数大于1时有效)。"
+                        placement="top"
+                    >
+                        <i class="el-icon-question question-icon">:</i>
+                    </el-tooltip>
+                </template>
+                <el-radio-group v-model="form.ji_fen_fang_shi_" :disabled="isDisabled">
+                    <el-radio label="平均分">平均分</el-radio>
+                    <el-radio label="最高分">最高分</el-radio>
+                    <el-radio label="最近得分">最近得分</el-radio>
+                </el-radio-group>
+            </el-form-item>
+            <el-form-item prop="isTimeLimit" class="inline-item">
+                <template slot="label">
+                    考试时长
+                    <el-tooltip
+                        effect="dark"
+                        content="设置该考试单次作答的最大时长。"
+                        placement="top"
+                    >
+                        <i class="el-icon-question question-icon">:</i>
+                    </el-tooltip>
+                </template>
+                <el-radio-group v-model="form.isTimeLimit" :disabled="isDisabled">
+                    <el-radio label="0">不限</el-radio>
+                    <el-radio label="1">限制</el-radio>
+                </el-radio-group>
+                <template v-if="form.isTimeLimit === '1'">
+                    <div class="time">
+                        <el-input-number
+                            v-model="form.hours"
+                            :min="0"
+                            :max="72"
+                            :precision="0"
+                            :disabled="isDisabled"
+                        />
+                        <div class="unit">小时</div>
+                    </div>
+                    <div class="time">
+                        <el-input-number
+                            v-model="form.minutes"
+                            :min="0"
+                            :max="59"
+                            :precision="0"
+                            :disabled="isDisabled"
+                        />
+                        <div class="unit">分钟</div>
+                    </div>
+                </template>
+            </el-form-item>
+            <el-form-item prop="da_biao_zhan_bi_">
+                <template slot="label">
+                    达标分值占比
+                    <el-tooltip
+                        effect="dark"
+                        content="设置该考试的达标分数线占试题总分的百分比。"
+                        placement="top"
+                    >
+                        <i class="el-icon-question question-icon">:</i>
+                    </el-tooltip>
+                </template>
+                <el-input-number
+                    v-model="form.da_biao_zhan_bi_"
+                    :min="50"
+                    :max="100"
+                    :precision="0"
+                    :disabled="isDisabled"
+                    placeholder="请输入达标分值占比"
+                />
+                <div class="unit">%</div>
+            </el-form-item>
+            <el-form-item prop="yun_xu_bao_ming_">
+                <template slot="label">
+                    允许自主报名
+                    <el-tooltip
+                        effect="dark"
+                        content="限制非本考试的参考人员是否可报名参加该考试。"
+                        placement="top"
+                    >
+                        <i class="el-icon-question question-icon">:</i>
+                    </el-tooltip>
+                </template>
+                <el-radio-group v-model="form.yun_xu_bao_ming_" :disabled="isDisabled">
+                    <el-radio label="是">是</el-radio>
+                    <el-radio label="否">否</el-radio>
+                </el-radio-group>
+            </el-form-item>
+            <el-form-item
+                v-if="!isDisabled || form.guan_lian_id_"
+                prop="guan_lian_id_"
+            >
+                <template slot="label">
+                    关联培训记录
+                    <el-tooltip effect="dark" content="关联培训记录。" placement="top">
+                        <i class="el-icon-question question-icon">:</i>
+                    </el-tooltip>
+                </template>
+                <ibps-custom-dialog
+                    v-model="form.guan_lian_id_"
+                    size="small"
+                    template-key="pxjldhk"
+                    :multiple="false"
+                    :disabled="isDisabled"
+                    type="dialog"
+                    class="custom-dialog"
+                    placeholder="请选择培训记录"
+                />
+            </el-form-item>
+            <el-form-item
+                v-if="!isDisabled || form.kao_shi_miao_shu_"
+                label="考试描述:"
+                prop="kao_shi_miao_shu_"
+            >
+                <el-input
+                    v-model="form.kao_shi_miao_shu_"
+                    type="textarea"
+                    :rows="4"
+                    :maxlength="512"
+                    placeholder="请输入描述内容"
+                    :disabled="isDisabled"
+                />
+            </el-form-item>
+        </el-form>
+        <div slot="footer" class="el-dialog--center">
+            <ibps-toolbar :actions="toolbars" @action-event="handleActionEvent" />
         </div>
-      </el-form-item>
-      <el-form-item prop="xian_kao_shi_jian">
-        <template slot="label">
-          限考时间
-          <el-tooltip
-            effect="dark"
-            content="设置该考试的提交截至时间。"
-            placement="top"
-          >
-            <i class="el-icon-question question-icon">:</i>
-          </el-tooltip>
-        </template>
-        <el-radio-group
-          v-model="form.isDateLimit"
-          @change="changeLimit(form.isDateLimit, 'xian_kao_shi_jian', null)"
-        >
-          <el-radio label="0">不限</el-radio>
-          <el-radio label="1">限制</el-radio>
-        </el-radio-group>
-        <el-date-picker
-          v-if="form.isDateLimit === '1'"
-          v-model="form.xian_kao_shi_jian"
-          type="datetime"
-          placeholder="请选择考试限制提交时间"
-          align="right"
-          default-time="12:00:00"
-          class="date-picker"
-          :picker-options="pickerOptions"
-        />
-      </el-form-item>
-      <el-form-item label="参考人员:" prop="can_kao_ren_yuan_">
-        <ibps-custom-dialog
-          v-model="form.can_kao_ren_yuan_"
-          size="small"
-          template-key="gjxcxryk"
-          multiple
-          :disabled="isDisabled"
-          type="dialog"
-          class="custom-dialog"
-          placeholder="请选择需参加考试的人员"
-        />
-      </el-form-item>
-      <el-form-item prop="isCountLimit" class="inline-item">
-        <template slot="label">
-          限考次数
-          <el-tooltip
-            effect="dark"
-            content="限制是否可重复参加,以及可参加考试的最大次数。"
-            placement="top"
-          >
-            <i class="el-icon-question question-icon">:</i>
-          </el-tooltip>
-        </template>
-        <el-radio-group
-          v-model="form.isCountLimit"
-          :disabled="isDisabled"
-          @change="changeLimit(form.isCountLimit, 'xian_kao_ci_shu_', 1)"
-        >
-          <el-radio label="0">不限</el-radio>
-          <el-radio label="1">限制</el-radio>
-        </el-radio-group>
-        <div v-if="form.isCountLimit === '1'" class="time">
-          <el-input-number
-            v-model="form.xian_kao_ci_shu_"
-            :min="1"
-            :precision="0"
-            :disabled="isDisabled"
-            placeholder="请输入单个用户最大限考次数"
-          />
-          <div class="unit">次</div>
-        </div>
-      </el-form-item>
-      <el-form-item
-        v-if="
-          form.isCountLimit === '0' ||
-          (form.isCountLimit === '1' && form.xian_kao_ci_shu_ > 1)
-        "
-        prop="ji_fen_fang_shi_"
-      >
-        <template slot="label">
-          计分方式
-          <el-tooltip
-            effect="dark"
-            content="设置对于可重复参加的考试,最终得分的计算方式(仅限考次数大于1时有效)。"
-            placement="top"
-          >
-            <i class="el-icon-question question-icon">:</i>
-          </el-tooltip>
-        </template>
-        <el-radio-group v-model="form.ji_fen_fang_shi_" :disabled="isDisabled">
-          <el-radio label="平均分">平均分</el-radio>
-          <el-radio label="最高分">最高分</el-radio>
-          <el-radio label="最近得分">最近得分</el-radio>
-        </el-radio-group>
-      </el-form-item>
-      <el-form-item prop="isTimeLimit" class="inline-item">
-        <template slot="label">
-          考试时长
-          <el-tooltip
-            effect="dark"
-            content="设置该考试单次作答的最大时长。"
-            placement="top"
-          >
-            <i class="el-icon-question question-icon">:</i>
-          </el-tooltip>
-        </template>
-        <el-radio-group v-model="form.isTimeLimit" :disabled="isDisabled">
-          <el-radio label="0">不限</el-radio>
-          <el-radio label="1">限制</el-radio>
-        </el-radio-group>
-        <template v-if="form.isTimeLimit === '1'">
-          <div class="time">
-            <el-input-number
-              v-model="form.hours"
-              :min="0"
-              :max="72"
-              :precision="0"
-              :disabled="isDisabled"
-            />
-            <div class="unit">小时</div>
-          </div>
-          <div class="time">
-            <el-input-number
-              v-model="form.minutes"
-              :min="0"
-              :max="59"
-              :precision="0"
-              :disabled="isDisabled"
-            />
-            <div class="unit">分钟</div>
-          </div>
-        </template>
-      </el-form-item>
-      <el-form-item prop="da_biao_zhan_bi_">
-        <template slot="label">
-          达标分值占比
-          <el-tooltip
-            effect="dark"
-            content="设置该考试的达标分数线占试题总分的百分比。"
-            placement="top"
-          >
-            <i class="el-icon-question question-icon">:</i>
-          </el-tooltip>
-        </template>
-        <el-input-number
-          v-model="form.da_biao_zhan_bi_"
-          :min="50"
-          :max="100"
-          :precision="0"
-          :disabled="isDisabled"
-          placeholder="请输入达标分值占比"
-        />
-        <div class="unit">%</div>
-      </el-form-item>
-      <el-form-item prop="yun_xu_bao_ming_">
-        <template slot="label">
-          允许自主报名
-          <el-tooltip
-            effect="dark"
-            content="限制非本考试的参考人员是否可报名参加该考试。"
-            placement="top"
-          >
-            <i class="el-icon-question question-icon">:</i>
-          </el-tooltip>
-        </template>
-        <el-radio-group v-model="form.yun_xu_bao_ming_" :disabled="isDisabled">
-          <el-radio label="是">是</el-radio>
-          <el-radio label="否">否</el-radio>
-        </el-radio-group>
-      </el-form-item>
-      <el-form-item
-        v-if="!isDisabled || form.guan_lian_id_"
-        prop="guan_lian_id_"
-      >
-        <template slot="label">
-          关联培训记录
-          <el-tooltip effect="dark" content="关联培训记录。" placement="top">
-            <i class="el-icon-question question-icon">:</i>
-          </el-tooltip>
-        </template>
-        <ibps-custom-dialog
-          v-model="form.guan_lian_id_"
-          size="small"
-          template-key="pxjldhk"
-          :multiple="false"
-          :disabled="isDisabled"
-          type="dialog"
-          class="custom-dialog"
-          placeholder="请选择培训记录"
-        />
-      </el-form-item>
-      <el-form-item
-        v-if="!isDisabled || form.kao_shi_miao_shu_"
-        label="考试描述:"
-        prop="kao_shi_miao_shu_"
-      >
-        <el-input
-          v-model="form.kao_shi_miao_shu_"
-          type="textarea"
-          :rows="4"
-          :maxlength="512"
-          placeholder="请输入描述内容"
-          :disabled="isDisabled"
-        />
-      </el-form-item>
-    </el-form>
-    <div slot="footer" class="el-dialog--center">
-      <ibps-toolbar :actions="toolbars" @action-event="handleActionEvent" />
-    </div>
-  </el-dialog>
+    </el-dialog>
 </template>
 
 <script>
-import ActionUtils from "@/utils/action";
-import { examTypeOptions, scoringType } from "../constants";
+import ActionUtils from '@/utils/action'
+import { examTypeOptions, scoringType } from '../constants'
 export default {
-  components: {
-    IbpsCustomDialog: () =>
-      import("@/business/platform/data/templaterender/custom-dialog"),
-  },
-  props: {
-    visible: {
-      type: Boolean,
-      default: false,
-    },
-    id: {
-      type: String,
-      default: "",
+    components: {
+        IbpsCustomDialog: () =>
+            import('@/business/platform/data/templaterender/custom-dialog')
     },
-    isDisabled: {
-      type: Boolean,
-      default: false,
-    },
-  },
-  data() {
-    const {
-      userList = [],
-      deptList = [],
-      userId,
-      level,
-    } = this.$store.getters || {};
-    return {
-      userList,
-      examTypeOptions,
-      deptList: deptList.filter((i) => i.depth === 4),
-      title: this.id ? "编辑考试" : "新建考试",
-      formLabelWidth: "150px",
-      dialogVisible: this.visible,
-      dialogLoading: false,
-      randButtonDisabled: false,
-      form: {
-        di_dian_: level.second || level.first,
-        chuang_jian_shi_j: "",
-        kao_shi_ming_chen: "",
-        kao_shi_lei_xing_: "常规",
-        ti_ku_id_: "",
-        guan_lian_id_: "",
-        xian_kao_shi_jian: "不限",
-        xian_kao_ci_shu_: "不限",
-        can_kao_ren_yuan_: "",
-        kao_shi_shi_chang: "",
-        zhuang_tai_: "未发布",
-        da_biao_zhan_bi_: 60,
-        ji_fen_fang_shi_: scoringType.length ? scoringType[0].value : "",
-        kao_shi_miao_shu_: "",
-        yun_xu_bao_ming_: "否",
-        isCountLimit: "0",
-        isTimeLimit: "0",
-        isDateLimit: "0",
-        hours: 2,
-        minutes: 30,
-      },
-      pickerOptions: {
-        disabledDate(time) {
-          // 禁用当前日期之前的日期
-          return time.getTime() < Date.now() - 8.64e7;
+    props: {
+        visible: {
+            type: Boolean,
+            default: false
         },
-      },
-      toolbars: [
-        {
-          key: "submit",
-          icon: "ibps-icon-save",
-          label: "保存",
-          hidden: () => {
-            return this.readonly;
-          },
+        id: {
+            type: String,
+            default: ''
         },
-        { key: "cancel", label: "关闭" },
-      ],
-      rules: {
-        kao_shi_ming_chen: [
-          { required: true, message: this.$t("validate.required") },
-        ],
-        // kao_shi_lei_xing_: [{ required: true, message: this.$t('validate.required') }],
-        ti_ku_id_: [{ required: true, message: this.$t("validate.required") }],
-        xian_kao_shi_jian: [
-          { required: true, message: this.$t("validate.required") },
-        ],
-        xian_kao_ci_shu_: [
-          { required: true, message: this.$t("validate.required") },
-        ],
-        can_kao_ren_yuan_: [
-          { required: true, message: this.$t("validate.required") },
-        ],
-        kao_shi_shi_chang: [
-          { required: true, message: this.$t("validate.required") },
-        ],
-        da_biao_zhan_bi_: [
-          { required: true, message: this.$t("validate.required") },
-        ],
-      },
-    };
-  },
-  watch: {
-    visible: {
-      handler: function (val, oldVal) {
-        this.dialogVisible = this.visible;
-      },
-      // immediate: true
-    },
-  },
-  mounted() {
-    this.getExamData();
-  },
-  methods: {
-    changeLimit(e, type, defaultValue) {
-      this.form[type] = e === "1" ? defaultValue : "不限";
-    },
-    handleActionEvent({ key }) {
-      switch (key) {
-        case "submit":
-          this.handleSubmit();
-          break;
-        case "cancel":
-          this.closeDialog();
-          break;
-        default:
-          break;
-      }
-    },
-    // 获取考试数据
-    getExamData() {
-      if (this.$utils.isEmpty(this.id)) {
-        return;
-      }
-      if (this.isDisabled) {
-        this.randButtonDisabled = true;
-        this.$message.info("非未发布状态的考试仅可修改限考时间!");
-      }
-      const sql = `select id_, create_by_, ti_ku_id_, guan_lian_id_, kao_shi_ming_chen, kao_shi_lei_xing_, chuang_jian_shi_j, fa_bu_shi_jian_, fa_bu_ren_, xian_kao_shi_jian, xian_kao_ci_shu_, kao_shi_shi_chang, can_kao_ren_yuan_, zhuang_tai_, da_biao_zhan_bi_, ji_fen_fang_shi_, kao_shi_miao_shu_, yun_xu_bao_ming_ from t_exams where id_ = '${this.id}'`;
-      this.$common.request("sql", sql).then((res) => {
-        const { data = [] } = res.variables || {};
-        if (!data.length) {
-          this.$message.error("数据不存在");
-          return;
+        isDisabled: {
+            type: Boolean,
+            default: false
         }
-        data[0].isCountLimit = data[0].xian_kao_ci_shu_ === "不限" ? "0" : "1";
-        data[0].isDateLimit = data[0].xian_kao_shi_jian === "不限" ? "0" : "1";
-        if (data[0].kao_shi_shi_chang === "不限") {
-          data[0].isTimeLimit = "0";
-          data[0].hours = null;
-          data[0].minutes = null;
-        } else {
-          data[0].isTimeLimit = "1";
-          data[0].hours = Math.floor(
-            data[0].kao_shi_shi_chang / (1000 * 60 * 60)
-          );
-          data[0].minutes =
-            (data[0].kao_shi_shi_chang % (1000 * 60 * 60)) / (60 * 1000);
-        }
-        this.form = data[0];
-      });
-    },
-    // 随机题库
-    randTiku() {
-      this.randButtonDisabled = true;
-      const sql = `select id_ from t_question_bank where ti_ku_zhuang_tai_='可用'`;
-      this.$common.request("sql", sql).then((res) => {
-        const { data = [] } = res.variables || {};
-        let randNumber = Math.floor(Math.random() * data.length);
-        this.form.ti_ku_id_ = data[randNumber].id_;
-        this.randButtonDisabled = false;
-      });
     },
-    handleSubmit() {
-      this.$refs.form.validate((valid) => {
-        if (valid) {
-          const { isTimeLimit, xian_kao_shi_jian = "" } = this.form || {};
-          // 转换考试时长
-          if (isTimeLimit === "0") {
-            this.form.kao_shi_shi_chang = "不限";
-          } else {
-            this.form.kao_shi_shi_chang =
-              (this.form.hours * 60 + this.form.minutes) * 60 * 1000;
-          }
-          delete this.form.isDateLimit;
-          delete this.form.isCountLimit;
-          delete this.form.isTimeLimit;
-          delete this.form.hours;
-          delete this.form.minutes;
-          this.form.chuang_jian_shi_j = this.$common.getDateNow(19);
-          this.form.xian_kao_shi_jian =
-            xian_kao_shi_jian !== "不限"
-              ? this.$common.getFormatDate("string", 16, xian_kao_shi_jian)
-              : xian_kao_shi_jian;
-          // 表单验证通过,提交表单
-          this.submitForm();
-        } else {
-          ActionUtils.saveErrorMessage();
+    data () {
+        const {
+            userList = [],
+            deptList = [],
+            userId,
+            level
+        } = this.$store.getters || {}
+        return {
+            userList,
+            examTypeOptions,
+            deptList: deptList.filter((i) => i.depth === 4),
+            title: this.id ? '编辑考试' : '新建考试',
+            formLabelWidth: '150px',
+            dialogVisible: this.visible,
+            dialogLoading: false,
+            randButtonDisabled: false,
+            form: {
+                di_dian_: level.second || level.first,
+                chuang_jian_shi_j: '',
+                kao_shi_ming_chen: '',
+                kao_shi_lei_xing_: '常规',
+                ti_ku_id_: '',
+                guan_lian_id_: '',
+                xian_kao_shi_jian: '不限',
+                xian_kao_ci_shu_: '不限',
+                can_kao_ren_yuan_: '',
+                kao_shi_shi_chang: '',
+                zhuang_tai_: '未发布',
+                da_biao_zhan_bi_: 60,
+                ji_fen_fang_shi_: scoringType.length ? scoringType[0].value : '',
+                kao_shi_miao_shu_: '',
+                yun_xu_bao_ming_: '否',
+                isCountLimit: '0',
+                isTimeLimit: '0',
+                isDateLimit: '0',
+                hours: 2,
+                minutes: 30
+            },
+            pickerOptions: {
+                disabledDate (time) {
+                    // 禁用当前日期之前的日期
+                    return time.getTime() < Date.now() - 8.64e7
+                }
+            },
+            toolbars: [
+                {
+                    key: 'submit',
+                    icon: 'ibps-icon-save',
+                    label: '保存',
+                    hidden: () => {
+                        return this.readonly
+                    }
+                },
+                { key: 'cancel', label: '关闭' }
+            ],
+            rules: {
+                kao_shi_ming_chen: [
+                    { required: true, message: this.$t('validate.required') }
+                ],
+                // kao_shi_lei_xing_: [{ required: true, message: this.$t('validate.required') }],
+                ti_ku_id_: [{ required: true, message: this.$t('validate.required') }],
+                xian_kao_shi_jian: [
+                    { required: true, message: this.$t('validate.required') }
+                ],
+                xian_kao_ci_shu_: [
+                    { required: true, message: this.$t('validate.required') }
+                ],
+                can_kao_ren_yuan_: [
+                    { required: true, message: this.$t('validate.required') }
+                ],
+                kao_shi_shi_chang: [
+                    { required: true, message: this.$t('validate.required') }
+                ],
+                da_biao_zhan_bi_: [
+                    { required: true, message: this.$t('validate.required') }
+                ]
+            }
         }
-      });
     },
-    submitForm() {
-      const addParams = {
-        tableName: "t_exams",
-        paramWhere: [this.form],
-      };
-      const updateParams = {
-        tableName: "t_exams",
-        updList: [
-          {
-            where: {
-              id_: this.id,
-            },
-            param: this.form,
-          },
-        ],
-      };
-      const type = this.id ? "update" : "add";
-      const params = type === "add" ? addParams : updateParams;
-      this.$common.request(type, params).then(() => {
-        this.$message.success(this.id ? "修改考试成功" : "新建考试成功");
-        this.closeDialog();
-      });
+    watch: {
+        visible: {
+            handler: function (val, oldVal) {
+                this.dialogVisible = this.visible
+            }
+            // immediate: true
+        }
     },
-    // 关闭当前窗口
-    closeDialog() {
-      this.$emit("close", false);
+    mounted () {
+        this.getExamData()
     },
-  },
-};
+    methods: {
+        changeLimit (e, type, defaultValue) {
+            this.form[type] = e === '1' ? defaultValue : '不限'
+        },
+        handleActionEvent ({ key }) {
+            switch (key) {
+                case 'submit':
+                    this.handleSubmit()
+                    break
+                case 'cancel':
+                    this.closeDialog()
+                    break
+                default:
+                    break
+            }
+        },
+        // 获取考试数据
+        getExamData () {
+            if (this.$utils.isEmpty(this.id)) {
+                return
+            }
+            if (this.isDisabled) {
+                this.randButtonDisabled = true
+                this.$message.info('非未发布状态的考试仅可修改限考时间!')
+            }
+            const sql = `select id_, create_by_, ti_ku_id_, guan_lian_id_, kao_shi_ming_chen, kao_shi_lei_xing_, chuang_jian_shi_j, fa_bu_shi_jian_, fa_bu_ren_, xian_kao_shi_jian, xian_kao_ci_shu_, kao_shi_shi_chang, can_kao_ren_yuan_, zhuang_tai_, da_biao_zhan_bi_, ji_fen_fang_shi_, kao_shi_miao_shu_, yun_xu_bao_ming_ from t_exams where id_ = '${this.id}'`
+            this.$common.request('sql', sql).then((res) => {
+                const { data = [] } = res.variables || {}
+                if (!data.length) {
+                    this.$message.error('数据不存在')
+                    return
+                }
+                data[0].isCountLimit = data[0].xian_kao_ci_shu_ === '不限' ? '0' : '1'
+                data[0].isDateLimit = data[0].xian_kao_shi_jian === '不限' ? '0' : '1'
+                if (data[0].kao_shi_shi_chang === '不限') {
+                    data[0].isTimeLimit = '0'
+                    data[0].hours = null
+                    data[0].minutes = null
+                } else {
+                    data[0].isTimeLimit = '1'
+                    data[0].hours = Math.floor(
+                        data[0].kao_shi_shi_chang / (1000 * 60 * 60)
+                    )
+                    data[0].minutes =
+            (data[0].kao_shi_shi_chang % (1000 * 60 * 60)) / (60 * 1000)
+                }
+                this.form = data[0]
+            })
+        },
+        // 随机题库
+        randTiku () {
+            this.randButtonDisabled = true
+            const sql = `select id_ from t_question_bank where ti_ku_zhuang_tai_='可用'`
+            this.$common.request('sql', sql).then((res) => {
+                const { data = [] } = res.variables || {}
+                const randNumber = Math.floor(Math.random() * data.length)
+                this.form.ti_ku_id_ = data[randNumber].id_
+                this.randButtonDisabled = false
+            })
+        },
+        handleSubmit () {
+            this.$refs.form.validate((valid) => {
+                if (valid) {
+                    const { isTimeLimit, xian_kao_shi_jian = '' } = this.form || {}
+                    // 转换考试时长
+                    if (isTimeLimit === '0') {
+                        this.form.kao_shi_shi_chang = '不限'
+                    } else {
+                        this.form.kao_shi_shi_chang =
+              (this.form.hours * 60 + this.form.minutes) * 60 * 1000
+                    }
+                    delete this.form.isDateLimit
+                    delete this.form.isCountLimit
+                    delete this.form.isTimeLimit
+                    delete this.form.hours
+                    delete this.form.minutes
+                    this.form.chuang_jian_shi_j = this.$common.getDateNow(19)
+                    this.form.xian_kao_shi_jian =
+            xian_kao_shi_jian !== '不限'
+                ? this.$common.getFormatDate('string', 16, xian_kao_shi_jian)
+                : xian_kao_shi_jian
+                    // 表单验证通过,提交表单
+                    this.submitForm()
+                } else {
+                    ActionUtils.saveErrorMessage()
+                }
+            })
+        },
+        submitForm () {
+            const addParams = {
+                tableName: 't_exams',
+                paramWhere: [this.form]
+            }
+            const updateParams = {
+                tableName: 't_exams',
+                updList: [
+                    {
+                        where: {
+                            id_: this.id
+                        },
+                        param: this.form
+                    }
+                ]
+            }
+            const type = this.id ? 'update' : 'add'
+            const params = type === 'add' ? addParams : updateParams
+            this.$common.request(type, params).then(() => {
+                this.$message.success(this.id ? '修改考试成功' : '新建考试成功')
+                this.closeDialog()
+            })
+        },
+        // 关闭当前窗口
+        closeDialog () {
+            this.$emit('close', false)
+        }
+    }
+}
 </script>
 <style lang="scss" scoped>
 .exam-dialog {

+ 222 - 223
src/views/platform/examination/exam/statistics.vue

@@ -1,238 +1,237 @@
 <template>
-  <div>
-    <el-dialog
-      center
-      append-to-body
-      title="数据统计"
-      :visible.sync="dialogVisible"
-      width="70%"
-      top
-      :close-on-click-modal="false"
-      :close-on-press-escape="false"
-    >
-      <div class="chart">
-        <div class="chart1">
-          <v-chart
-            :options="joinChartOptions"
-            :autoresize="true"
-            style="width: 80%"
-          ></v-chart>
-        </div>
-        <div class="chart2">
-          <v-chart
-            :options="scoreChartOptions"
-            :autoresize="true"
-            style="width: 80%"
-          ></v-chart>
-        </div>
-      </div>
+    <div>
+        <el-dialog
+            center
+            append-to-body
+            title="数据统计"
+            :visible.sync="dialogVisible"
+            width="70%"
+            top
+            :close-on-click-modal="false"
+            :close-on-press-escape="false"
+        >
+            <div class="chart">
+                <div class="chart1">
+                    <v-chart
+                        :options="joinChartOptions"
+                        :autoresize="true"
+                        style="width: 80%"
+                    />
+                </div>
+                <div class="chart2">
+                    <v-chart
+                        :options="scoreChartOptions"
+                        :autoresize="true"
+                        style="width: 80%"
+                    />
+                </div>
+            </div>
 
-      <span slot="footer" class="dialog-footer">
-        <el-button type="info" @click="dialogVisible = false">关闭</el-button>
-      </span>
-    </el-dialog>
-  </div>
+            <span slot="footer" class="dialog-footer">
+                <el-button type="info" @click="dialogVisible = false">关闭</el-button>
+            </span>
+        </el-dialog>
+    </div>
 </template>
 
 <script>
 export default {
-  props: {
-    departmentData: {
-      type: Array,
-      default: [],
+    props: {
+        departmentData: {
+            type: Array,
+            default: () => []
+        }
     },
-  },
-  data() {
-    return {
-      dialogVisible: false,
-      joinChartOptions: {},
-      scoreChartOptions: {},
-      //   departmentData:[ { "department": "检验科", "plannedAttendees": 6, "actualAttendees": 0, "joinRate": "0.00%" }, { "department": "综合/质量管理组", "plannedAttendees": 4, "actualAttendees": 0, "joinRate": "0.00%" }, { "department": "微生物组", "plannedAttendees": 4, "actualAttendees": 0, "joinRate": "0.00%" }, { "department": "生化组", "plannedAttendees": 4, "actualAttendees": 0, "joinRate": "0.00%" }, { "department": "临检组", "plannedAttendees": 8, "actualAttendees": 0, "joinRate": "0.00%" }, { "department": "免疫组", "plannedAttendees": 1, "actualAttendees": 0, "joinRate": "0.00%" } ]
-    };
-  },
-  methods: {
-    open() {
-      this.dialogVisible = true;
+    data () {
+        return {
+            dialogVisible: false,
+            joinChartOptions: {},
+            scoreChartOptions: {}
+            //   departmentData:[ { "department": "检验科", "plannedAttendees": 6, "actualAttendees": 0, "joinRate": "0.00%" }, { "department": "综合/质量管理组", "plannedAttendees": 4, "actualAttendees": 0, "joinRate": "0.00%" }, { "department": "微生物组", "plannedAttendees": 4, "actualAttendees": 0, "joinRate": "0.00%" }, { "department": "生化组", "plannedAttendees": 4, "actualAttendees": 0, "joinRate": "0.00%" }, { "department": "临检组", "plannedAttendees": 8, "actualAttendees": 0, "joinRate": "0.00%" }, { "department": "免疫组", "plannedAttendees": 1, "actualAttendees": 0, "joinRate": "0.00%" } ]
+        }
     },
-    close() {
-      this.dialogVisible = false;
+    computed: {},
+    watch: {
+    // 解决echart渲染问题
+        departmentData () {
+            this.joinChartOptions = this.generateChartOptions('join')
+            this.scoreChartOptions = this.generateChartOptions('score')
+        }
     },
-    transformData(type) {
-      const xAxisData = [];
-      const plannedAttendeesData = [];
-      const actualAttendeesData = [];
-      const joinRateData = [];
-      const avgScoreData = [];
-      if (type === "join") {
-        this.departmentData.forEach((department) => {
-          xAxisData.push(department.department);
-          plannedAttendeesData.push(department.plannedAttendees);
-          actualAttendeesData.push(department.actualAttendees);
-          joinRateData.push((department.joinRate * 100).toFixed(2));
-        });
-      }
-      if (type === "score") {
-        this.departmentData.forEach((department) => {
-          xAxisData.push(department.department);
-          plannedAttendeesData.push(department.minScore.toFixed(2));
-          actualAttendeesData.push(department.maxScore.toFixed(2));
-          joinRateData.push((department.passRate * 100).toFixed(2));
-          avgScoreData.push(department.avgScore.toFixed(2));
-        });
-      }
-
-      return {
-        xAxisData,
-        plannedAttendeesData,
-        actualAttendeesData,
-        joinRateData,
-        avgScoreData,
-      };
+    created () {
+        this.joinChartOptions = this.generateChartOptions('join')
+        this.scoreChartOptions = this.generateChartOptions('score')
     },
-    generateChartOptions(type) {
-      const {
-        xAxisData,
-        plannedAttendeesData,
-        actualAttendeesData,
-        joinRateData,
-        avgScoreData,
-      } = this.transformData(type);
-
-      let text = "";
-      let legendText = [];
-      let series = [];
-      let llable = "";
-      if (type === "join") {
-        text = "各部门参考人数信息统计";
-        llable = "人数";
-        legendText = ["应参考人数", "实参考人数", "参考率"];
-        series = [
-          {
-            name: legendText[0],
-            type: "bar",
-            data: plannedAttendeesData,
-          },
-          {
-            name: legendText[1],
-            type: "bar",
-            data: actualAttendeesData,
-          },
-          {
-            name: legendText[2],
-            type: "line",
-            yAxisIndex: 1,
-            data: joinRateData,
-            label:{
-              show:true,
-              position:"top",
-            }
-          },
-        ];
-      }
-      if (type === "score") {
-        text = "各部门成绩信息统计";
-        llable = "分数";
-        legendText = ["最高分", "最低分", "平均分", "合格率"];
-        series = [
-          {
-            name: legendText[0],
-            type: "bar",
-            data: plannedAttendeesData,
-          },
-          {
-            name: legendText[1],
-            type: "bar",
-            data: actualAttendeesData,
-          },
-          {
-            name: legendText[2],
-            type: "bar",
-            data: avgScoreData,
-          },
-          {
-            name: legendText[3],
-            type: "line",
-            yAxisIndex: 1,
-            data: joinRateData,
-            label:{
-              show:true,
-              position:"top",
-            }
-          },
-        ];
-      }
-      return {
-        title: {
-          text,
+    methods: {
+        open () {
+            this.dialogVisible = true
         },
-        tooltip: {
-          trigger: "axis",
-          axisPointer: {
-            type: "shadow",
-          },
+        close () {
+            this.dialogVisible = false
         },
-        legend: {
-          data: legendText,
-          
-        },
-        grid: {
-          // top: 0,
-          // left: 10,
-        },
-        xAxis: {
-          type: "category",
-          data: xAxisData,
-          axisLabel: {
-            rotate: 20,
-          },
+        transformData (type) {
+            const xAxisData = []
+            const plannedAttendeesData = []
+            const actualAttendeesData = []
+            const joinRateData = []
+            const avgScoreData = []
+            if (type === 'join') {
+                this.departmentData.forEach((department) => {
+                    xAxisData.push(department.department)
+                    plannedAttendeesData.push(department.plannedAttendees)
+                    actualAttendeesData.push(department.actualAttendees)
+                    joinRateData.push((department.joinRate * 100).toFixed(2))
+                })
+            }
+            if (type === 'score') {
+                this.departmentData.forEach((department) => {
+                    xAxisData.push(department.department)
+                    plannedAttendeesData.push(department.minScore.toFixed(2))
+                    actualAttendeesData.push(department.maxScore.toFixed(2))
+                    joinRateData.push((department.passRate * 100).toFixed(2))
+                    avgScoreData.push(department.avgScore.toFixed(2))
+                })
+            }
+
+            return {
+                xAxisData,
+                plannedAttendeesData,
+                actualAttendeesData,
+                joinRateData,
+                avgScoreData
+            }
         },
-        yAxis: [
-          {
-            type: "value",
-            name: llable,
-            axisLabel: {
-              formatter: "{value}",
-            },
-          },
-          {
-            type: "value",
-            name: legendText[legendText.length - 1],
-            axisLabel: {
-              formatter: "{value}%",
-            },
-          },
-        ],
-        series,
-        dataZoom: [
-          {
-            show: true,
-            realtime: true,
-            start: 0,
-            end: 200,
-          },
-          {
-            type: "inside",
-            realtime: true,
-            start: 0,
-            end: 200,
-          },
-        ],
-      };
-    },
-  },
-  computed: {},
-  created() {
-    this.joinChartOptions = this.generateChartOptions("join");
-    this.scoreChartOptions = this.generateChartOptions("score");
-  },
-  watch: {
-    // 解决echart渲染问题
-    departmentData() {
-      this.joinChartOptions = this.generateChartOptions("join");
-      this.scoreChartOptions = this.generateChartOptions("score");
-    },
-  },
-};
+        generateChartOptions (type) {
+            const {
+                xAxisData,
+                plannedAttendeesData,
+                actualAttendeesData,
+                joinRateData,
+                avgScoreData
+            } = this.transformData(type)
+
+            let text = ''
+            let legendText = []
+            let series = []
+            let llable = ''
+            if (type === 'join') {
+                text = '各部门参考人数信息统计'
+                llable = '人数'
+                legendText = ['应参考人数', '实参考人数', '参考率']
+                series = [
+                    {
+                        name: legendText[0],
+                        type: 'bar',
+                        data: plannedAttendeesData
+                    },
+                    {
+                        name: legendText[1],
+                        type: 'bar',
+                        data: actualAttendeesData
+                    },
+                    {
+                        name: legendText[2],
+                        type: 'line',
+                        yAxisIndex: 1,
+                        data: joinRateData,
+                        label: {
+                            show: true,
+                            position: 'top'
+                        }
+                    }
+                ]
+            }
+            if (type === 'score') {
+                text = '各部门成绩信息统计'
+                llable = '分数'
+                legendText = ['最高分', '最低分', '平均分', '合格率']
+                series = [
+                    {
+                        name: legendText[0],
+                        type: 'bar',
+                        data: plannedAttendeesData
+                    },
+                    {
+                        name: legendText[1],
+                        type: 'bar',
+                        data: actualAttendeesData
+                    },
+                    {
+                        name: legendText[2],
+                        type: 'bar',
+                        data: avgScoreData
+                    },
+                    {
+                        name: legendText[3],
+                        type: 'line',
+                        yAxisIndex: 1,
+                        data: joinRateData,
+                        label: {
+                            show: true,
+                            position: 'top'
+                        }
+                    }
+                ]
+            }
+            return {
+                title: {
+                    text
+                },
+                tooltip: {
+                    trigger: 'axis',
+                    axisPointer: {
+                        type: 'shadow'
+                    }
+                },
+                legend: {
+                    data: legendText
+                },
+                grid: {
+                    // top: 0,
+                    // left: 10,
+                },
+                xAxis: {
+                    type: 'category',
+                    data: xAxisData,
+                    axisLabel: {
+                        rotate: 20
+                    }
+                },
+                yAxis: [
+                    {
+                        type: 'value',
+                        name: llable,
+                        axisLabel: {
+                            formatter: '{value}'
+                        }
+                    },
+                    {
+                        type: 'value',
+                        name: legendText[legendText.length - 1],
+                        axisLabel: {
+                            formatter: '{value}%'
+                        }
+                    }
+                ],
+                series,
+                dataZoom: [
+                    {
+                        show: true,
+                        realtime: true,
+                        start: 0,
+                        end: 200
+                    },
+                    {
+                        type: 'inside',
+                        realtime: true,
+                        start: 0,
+                        end: 200
+                    }
+                ]
+            }
+        }
+    }
+}
 </script>
 
 <style scoped lang="scss">
@@ -257,4 +256,4 @@ export default {
     margin-bottom: 60px;
   }
 }
-</style>
+</style>

+ 497 - 507
src/views/platform/examination/questionBank/detail.vue

@@ -1,537 +1,527 @@
 <template>
-  <el-dialog
-    :title="title"
-    :visible.sync="dialogVisible"
-    :close-on-click-modal="false"
-    :close-on-press-escape="false"
-    :show-close="false"
-    append-to-body
-    fullscreen
-    class="dialog paper-detail-dialog"
-    top="0"
-    @open="loadData"
-    @close="closeDialog"
-  >
-    <div class="container">
-      <div class="paper-info">
-        <div class="info-item">
-          <span class="label">题库名称:</span>
-          <span class="value">{{ paperData.paperName }}</span>
-        </div>
-        <div class="info-item">
-          <span class="label">题目数量:</span>
-          <span class="value">{{ paperData.totalCount }}</span>
-        </div>
-        <div class="info-item">
-          <span class="label">总分:</span>
-          <span class="value">{{ paperData.totalScore }}分</span>
-        </div>
-        <div class="info-item">
-          <span class="label">达标占比:</span>
-          <span class="value">{{ paperData.qualifiedRadio }}%</span>
-        </div>
-        <div class="info-item">
-          <span class="label">计分方式:</span>
-          <span class="value">{{ paperData.scoringType }}</span>
-        </div>
-        <div class="info-item">
-          <span class="label">得分:</span>
-          <span class="value">{{
-            paperData.status !== "已完成"
-              ? "未评分"
-              : `${paperData.resultScore}分`
-          }}</span>
-        </div>
-        <div class="info-item">
-          <span class="label">报考时间:</span>
-          <span class="value">{{ paperData.applyTime }}</span>
-        </div>
-        <div class="info-item">
-          <span class="label">开考时间:</span>
-          <span class="value">{{ paperData.startTime }}</span>
-        </div>
-        <div class="info-item">
-          <span class="label">结束时间:</span>
-          <span class="value">{{ paperData.endTime }}</span>
-        </div>
-        <div class="info-item">
-          <span class="label">考生姓名:</span>
-          <span class="value">{{ transformUser(paperData.examinee) }}</span>
-        </div>
-        <!-- <div class="info-item">
+    <el-dialog
+        :title="title"
+        :visible.sync="dialogVisible"
+        :close-on-click-modal="false"
+        :close-on-press-escape="false"
+        :show-close="false"
+        append-to-body
+        fullscreen
+        class="dialog paper-detail-dialog"
+        top="0"
+        @open="loadData"
+        @close="closeDialog"
+    >
+        <div class="container">
+            <div class="paper-info">
+                <div class="info-item">
+                    <span class="label">题库名称:</span>
+                    <span class="value">{{ paperData.paperName }}</span>
+                </div>
+                <div class="info-item">
+                    <span class="label">题目数量:</span>
+                    <span class="value">{{ paperData.totalCount }}</span>
+                </div>
+                <div class="info-item">
+                    <span class="label">总分:</span>
+                    <span class="value">{{ paperData.totalScore }}分</span>
+                </div>
+                <div class="info-item">
+                    <span class="label">达标占比:</span>
+                    <span class="value">{{ paperData.qualifiedRadio }}%</span>
+                </div>
+                <div class="info-item">
+                    <span class="label">计分方式:</span>
+                    <span class="value">{{ paperData.scoringType }}</span>
+                </div>
+                <div class="info-item">
+                    <span class="label">得分:</span>
+                    <span class="value">{{
+                        paperData.status !== "已完成"
+                            ? "未评分"
+                            : `${paperData.resultScore}分`
+                    }}</span>
+                </div>
+                <div class="info-item">
+                    <span class="label">报考时间:</span>
+                    <span class="value">{{ paperData.applyTime }}</span>
+                </div>
+                <div class="info-item">
+                    <span class="label">开考时间:</span>
+                    <span class="value">{{ paperData.startTime }}</span>
+                </div>
+                <div class="info-item">
+                    <span class="label">结束时间:</span>
+                    <span class="value">{{ paperData.endTime }}</span>
+                </div>
+                <div class="info-item">
+                    <span class="label">考生姓名:</span>
+                    <span class="value">{{ transformUser(paperData.examinee) }}</span>
+                </div>
+                <!-- <div class="info-item">
                     <span class="label">部门:</span>
                     <span class="value">{{ paperData.dept }}</span>
                 </div> -->
-      </div>
-      <div class="select">
-        答题状态:<el-select v-model="paperStatus" placeholder="请选择">
-          <el-option
-            v-for="item in paperoptions"
-            :key="item.value"
-            :label="item.label"
-            :value="item.value"
-          >
-          </el-option>
-        </el-select>
-      </div>
-
-      <div class="question">
-        <div
-          v-for="(item, index) in showPaperData.list"
-          :key="index"
-          class="question-item"
-        >
-          <div class="type" v-if="item.questions.length > 0">
-            {{ item.type
-            }}<el-tag
-              type="primary"
-              size="small"
-              class="score"
-              v-if="paperStatus === 'all'"
-              >{{ `共${item.totalScore}分` }}</el-tag
-            >
-          </div>
-          <div
-            v-for="(q, qIndex) in item.questions"
-            :key="`${index}${qIndex}`"
-            class="card"
-          >
-            <div class="stem">
-              <span>{{ `【${qIndex + 1}】${q.stem}` }}</span>
-              <el-tag type="primary" size="small">{{
-                `${q.questionScore}分`
-              }}</el-tag>
-            </div>
-            <div v-if="q.img && q.img.length" class="img">
-              <ibps-image
-                v-model="q.img"
-                height="100"
-                width="100"
-                accept=".jpg,.jpeg,.png,.gif,.bmp,.webp"
-                download
-                disabled
-              />
             </div>
-            <div class="answer">
-              <div class="mine">
-                <div class="title">
-                  考生答案:<el-tag
-                    :type="q.score && q.score !== '0' ? 'success' : 'danger'"
-                    size="small"
-                    class="score"
-                    >{{
-                      !q.score && q.score !== "0" ? "未评分" : `得${q.score}分`
-                    }}</el-tag
-                  >
-                </div>
-                <div class="answer-content">
-                  <el-radio-group
-                    v-if="q.questionType === '单选题'"
-                    :value="q.answer"
-                  >
-                    <el-radio
-                      v-for="(o, i) in q.options"
-                      :key="`${index}${qIndex}${i}`"
-                      :label="o.label"
-                      >{{ `${o.label}.${o.value}` }}</el-radio
-                    >
-                  </el-radio-group>
-                  <el-checkbox-group
-                    v-else-if="q.questionType === '多选题'"
-                    :value="q.answer"
-                  >
-                    <el-checkbox
-                      v-for="(o, i) in q.options"
-                      :key="`${index}${qIndex}${i}`"
-                      :label="o.label"
-                      >{{ `${o.label}.${o.value}` }}</el-checkbox
-                    >
-                  </el-checkbox-group>
-                  <el-radio-group
-                    v-else-if="q.questionType === '判断题'"
-                    :value="q.answer"
-                  >
-                    <el-radio-button label="√">√</el-radio-button>
-                    <el-radio-button label="×">×</el-radio-button>
-                  </el-radio-group>
-                  <template v-else>
-                    <el-input
-                      v-for="(o, i) in q.answer"
-                      :key="`${index}${qIndex}${i}`"
-                      :value="o"
-                      :type="q.questionType === '简答题' ? 'textarea' : 'text'"
-                      :rows="q.questionType === '简答题' ? 12 : 1"
-                      readonly
+            <div class="select">
+                答题状态:<el-select v-model="paperStatus" placeholder="请选择">
+                    <el-option
+                        v-for="item in paperoptions"
+                        :key="item.value"
+                        :label="item.label"
+                        :value="item.value"
                     />
-                  </template>
-                </div>
-              </div>
-              <div class="right">
-                <div class="title">参考答案:</div>
-                <div class="answer-content">
-                  <el-radio-group
-                    v-if="q.questionType === '单选题'"
-                    :value="q.rightKey"
-                  >
-                    <el-radio
-                      v-for="(o, i) in q.options"
-                      :key="`${index}${qIndex}${i}`"
-                      :label="o.label"
-                      >{{ `${o.label}.${o.value}` }}</el-radio
-                    >
-                  </el-radio-group>
-                  <el-checkbox-group
-                    v-else-if="q.questionType === '多选题'"
-                    :value="q.rightKey"
-                  >
-                    <el-checkbox
-                      v-for="(o, i) in q.options"
-                      :key="`${index}${qIndex}${i}`"
-                      :label="o.label"
-                      >{{ `${o.label}.${o.value}` }}</el-checkbox
+                </el-select>
+            </div>
+
+            <div class="question">
+                <div
+                    v-for="(item, index) in showPaperData.list"
+                    :key="index"
+                    class="question-item"
+                >
+                    <div v-if="item.questions.length > 0" class="type">
+                        {{ item.type
+                        }}<el-tag
+                            v-if="paperStatus === 'all'"
+                            type="primary"
+                            size="small"
+                            class="score"
+                        >{{ `共${item.totalScore}分` }}</el-tag>
+                    </div>
+                    <div
+                        v-for="(q, qIndex) in item.questions"
+                        :key="`${index}${qIndex}`"
+                        class="card"
                     >
-                  </el-checkbox-group>
-                  <el-radio-group
-                    v-else-if="q.questionType === '判断题'"
-                    :value="q.rightKey"
-                  >
-                    <el-radio-button label="√">√</el-radio-button>
-                    <el-radio-button label="×">×</el-radio-button>
-                  </el-radio-group>
-                  <template v-else>
-                    <el-input
-                      v-for="(o, i) in q.rightKey"
-                      :key="`${index}${qIndex}${i}`"
-                      :value="o"
-                      :type="q.questionType === '简答题' ? 'textarea' : 'text'"
-                      :rows="q.questionType === '简答题' ? 12 : 1"
-                      readonly
-                    />
-                  </template>
+                        <div class="stem">
+                            <span>{{ `【${qIndex + 1}】${q.stem}` }}</span>
+                            <el-tag type="primary" size="small">{{
+                                `${q.questionScore}分`
+                            }}</el-tag>
+                        </div>
+                        <div v-if="q.img && q.img.length" class="img">
+                            <ibps-image
+                                v-model="q.img"
+                                height="100"
+                                width="100"
+                                accept=".jpg,.jpeg,.png,.gif,.bmp,.webp"
+                                download
+                                disabled
+                            />
+                        </div>
+                        <div class="answer">
+                            <div class="mine">
+                                <div class="title">
+                                    考生答案:<el-tag
+                                        :type="q.score && q.score !== '0' ? 'success' : 'danger'"
+                                        size="small"
+                                        class="score"
+                                    >{{
+                                        !q.score && q.score !== "0" ? "未评分" : `得${q.score}分`
+                                    }}</el-tag>
+                                </div>
+                                <div class="answer-content">
+                                    <el-radio-group
+                                        v-if="q.questionType === '单选题'"
+                                        :value="q.answer"
+                                    >
+                                        <el-radio
+                                            v-for="(o, i) in q.options"
+                                            :key="`${index}${qIndex}${i}`"
+                                            :label="o.label"
+                                        >{{ `${o.label}.${o.value}` }}</el-radio>
+                                    </el-radio-group>
+                                    <el-checkbox-group
+                                        v-else-if="q.questionType === '多选题'"
+                                        :value="q.answer"
+                                    >
+                                        <el-checkbox
+                                            v-for="(o, i) in q.options"
+                                            :key="`${index}${qIndex}${i}`"
+                                            :label="o.label"
+                                        >{{ `${o.label}.${o.value}` }}</el-checkbox>
+                                    </el-checkbox-group>
+                                    <el-radio-group
+                                        v-else-if="q.questionType === '判断题'"
+                                        :value="q.answer"
+                                    >
+                                        <el-radio-button label="√">√</el-radio-button>
+                                        <el-radio-button label="×">×</el-radio-button>
+                                    </el-radio-group>
+                                    <template v-else>
+                                        <el-input
+                                            v-for="(o, i) in q.answer"
+                                            :key="`${index}${qIndex}${i}`"
+                                            :value="o"
+                                            :type="q.questionType === '简答题' ? 'textarea' : 'text'"
+                                            :rows="q.questionType === '简答题' ? 12 : 1"
+                                            readonly
+                                        />
+                                    </template>
+                                </div>
+                            </div>
+                            <div class="right">
+                                <div class="title">参考答案:</div>
+                                <div class="answer-content">
+                                    <el-radio-group
+                                        v-if="q.questionType === '单选题'"
+                                        :value="q.rightKey"
+                                    >
+                                        <el-radio
+                                            v-for="(o, i) in q.options"
+                                            :key="`${index}${qIndex}${i}`"
+                                            :label="o.label"
+                                        >{{ `${o.label}.${o.value}` }}</el-radio>
+                                    </el-radio-group>
+                                    <el-checkbox-group
+                                        v-else-if="q.questionType === '多选题'"
+                                        :value="q.rightKey"
+                                    >
+                                        <el-checkbox
+                                            v-for="(o, i) in q.options"
+                                            :key="`${index}${qIndex}${i}`"
+                                            :label="o.label"
+                                        >{{ `${o.label}.${o.value}` }}</el-checkbox>
+                                    </el-checkbox-group>
+                                    <el-radio-group
+                                        v-else-if="q.questionType === '判断题'"
+                                        :value="q.rightKey"
+                                    >
+                                        <el-radio-button label="√">√</el-radio-button>
+                                        <el-radio-button label="×">×</el-radio-button>
+                                    </el-radio-group>
+                                    <template v-else>
+                                        <el-input
+                                            v-for="(o, i) in q.rightKey"
+                                            :key="`${index}${qIndex}${i}`"
+                                            :value="o"
+                                            :type="q.questionType === '简答题' ? 'textarea' : 'text'"
+                                            :rows="q.questionType === '简答题' ? 12 : 1"
+                                            readonly
+                                        />
+                                    </template>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
                 </div>
-              </div>
             </div>
-          </div>
         </div>
-      </div>
-    </div>
-    <div class="date-line">
-      <el-timeline>
-        <el-timeline-item
-          v-for="(paper, index) in paperList"
-          :key="index"
-          :timestamp="paper.applyTime"
-          :icon="
-            paper.status === '已完成' ? 'el-icon-circle-check' : 'el-icon-view'
-          "
-          :type="paper.status === '已完成' ? 'success' : 'primary'"
-          placement="top"
-          size="large"
-        >
-          <el-card
-            class="timeline-card"
-            :class="paper.dataId === showPaperId ? 'active-card' : ''"
-            @click.native="changePaper(paper.dataId)"
-          >
-            <div class="card-item">{{ `开始时间:${paper.startTime}` }}</div>
-            <div class="card-item">{{ `结束时间:${paper.endTime}` }}</div>
-            <div v-if="paper.status === '已完成'" class="card-item">
-              <span>{{ `得分:${paper.resultScore}` }}</span>
-              <el-tag
-                :type="paper.isQualified ? 'success' : 'danger'"
-                size="mini"
-                class="score"
-                >{{ paper.isQualified ? `达标` : "未达标" }}</el-tag
-              >
-              <el-tag
-                v-if="paper.resultScore === maxScore"
-                type="success"
-                size="mini"
-                class="score"
-                >{{ `最高分` }}</el-tag
-              >
-              <el-tag
-                v-if="paper.resultScore === minScore"
-                type="warning"
-                size="mini"
-                class="score"
-                >{{ `最低分` }}</el-tag
-              >
-            </div>
-          </el-card>
-        </el-timeline-item>
-      </el-timeline>
-    </div>
-    <div slot="footer" class="el-dialog--center">
-      <ibps-toolbar :actions="toolbars" @action-event="handleActionEvent" />
-    </div>
-  </el-dialog>
+        <div class="date-line">
+            <el-timeline>
+                <el-timeline-item
+                    v-for="(paper, index) in paperList"
+                    :key="index"
+                    :timestamp="paper.applyTime"
+                    :icon="
+                        paper.status === '已完成' ? 'el-icon-circle-check' : 'el-icon-view'
+                    "
+                    :type="paper.status === '已完成' ? 'success' : 'primary'"
+                    placement="top"
+                    size="large"
+                >
+                    <el-card
+                        class="timeline-card"
+                        :class="paper.dataId === showPaperId ? 'active-card' : ''"
+                        @click.native="changePaper(paper.dataId)"
+                    >
+                        <div class="card-item">{{ `开始时间:${paper.startTime}` }}</div>
+                        <div class="card-item">{{ `结束时间:${paper.endTime}` }}</div>
+                        <div v-if="paper.status === '已完成'" class="card-item">
+                            <span>{{ `得分:${paper.resultScore}` }}</span>
+                            <el-tag
+                                :type="paper.isQualified ? 'success' : 'danger'"
+                                size="mini"
+                                class="score"
+                            >{{ paper.isQualified ? `达标` : "未达标" }}</el-tag>
+                            <el-tag
+                                v-if="paper.resultScore === maxScore"
+                                type="success"
+                                size="mini"
+                                class="score"
+                            >{{ `最高分` }}</el-tag>
+                            <el-tag
+                                v-if="paper.resultScore === minScore"
+                                type="warning"
+                                size="mini"
+                                class="score"
+                            >{{ `最低分` }}</el-tag>
+                        </div>
+                    </el-card>
+                </el-timeline-item>
+            </el-timeline>
+        </div>
+        <div slot="footer" class="el-dialog--center">
+            <ibps-toolbar :actions="toolbars" @action-event="handleActionEvent" />
+        </div>
+    </el-dialog>
 </template>
 
 <script>
-import { cloneDeep } from "lodash";
+import { cloneDeep } from 'lodash'
 export default {
-  components: {
-    IbpsImage: () => import("@/business/platform/file/image"),
-  },
-  props: {
-    visible: {
-      type: Boolean,
-      default: false,
-    },
-    bankId: {
-      type: String,
-      default: "",
+    components: {
+        IbpsImage: () => import('@/business/platform/file/image')
     },
-    examId: {
-      type: String,
-      default: "",
-    },
-    id: {
-      type: String,
-      default: "",
-    },
-    examineeId: {
-      type: String,
-      default: "",
+    props: {
+        visible: {
+            type: Boolean,
+            default: false
+        },
+        bankId: {
+            type: String,
+            default: ''
+        },
+        examId: {
+            type: String,
+            default: ''
+        },
+        id: {
+            type: String,
+            default: ''
+        },
+        examineeId: {
+            type: String,
+            default: ''
+        }
     },
-  },
-  data() {
-    return {
-      title: "考试详情",
-      dialogVisible: this.visible,
-      toolbars: [{ key: "cancel", label: "退出" }],
-      paperList: [],
-      paperData: [],
-      maxScore: "",
-      minScore: "",
-      showPaperId: "",
-      paperoptions: [
-        { value: "all", label: "全部" },
-        { value: "false", label: "错误" },
-        { value: "true", label: "正确" },
-        { value: "noFinished", label: "未评分" },
-      ],
-      paperStatus: "all",
-    };
-  },
-  computed: {
-    formData() {
-      return this.data;
+    data () {
+        return {
+            title: '考试详情',
+            dialogVisible: this.visible,
+            toolbars: [{ key: 'cancel', label: '退出' }],
+            paperList: [],
+            paperData: [],
+            maxScore: '',
+            minScore: '',
+            showPaperId: '',
+            paperoptions: [
+                { value: 'all', label: '全部' },
+                { value: 'false', label: '错误' },
+                { value: 'true', label: '正确' },
+                { value: 'noFinished', label: '未评分' }
+            ],
+            paperStatus: 'all'
+        }
     },
-    showPaperData: {
-      set() {}, // 解决报错
-      get() {
-        let showPaperData = cloneDeep(this.paperData);
+    computed: {
+        formData () {
+            return this.data
+        },
+        showPaperData: {
+            set () {}, // 解决报错
+            get () {
+                const showPaperData = cloneDeep(this.paperData)
         showPaperData.list?.forEach((papers) => {
-          papers.questions = papers.questions.filter((paper) => {
-            switch (this.paperStatus) {
-              case "all":
-                return true;
-              case "false":
-                return paper.score && paper.score === "0";
-              case "true":
-                return paper.score && paper.score !== "0";
-              case "noFinished":
-                return paper.score === "";
-              default:
-                break;
+            papers.questions = papers.questions.filter((paper) => {
+                switch (this.paperStatus) {
+                    case 'all':
+                        return true
+                    case 'false':
+                        return paper.score && paper.score === '0'
+                    case 'true':
+                        return paper.score && paper.score !== '0'
+                    case 'noFinished':
+                        return paper.score === ''
+                    default:
+                        break
+                }
+            })
+        })
+        return showPaperData
             }
-          });
-        });
-        return showPaperData;
-      },
-    },
-  },
-  watch: {
-    visible: {
-      handler(val, oldVal) {
-        this.dialogVisible = this.visible;
-      },
-    },
-  },
-  mounted() {
-    this.loadData();
-    // 监听键盘事件
-    window.addEventListener("keyup", this.handleKeyPress);
-  },
-  beforeDestroy() {
-    window.removeEventListener("keyup", this.handleKeyPress);
-  },
-  methods: {
-    // 获取题库数据
-    async loadData() {
-      if (!this.bankId) {
-        this.$message.error("获取题目信息失败,请重试!");
-        this.closeDialog();
-        return;
-      }
-      this.paperList = await this.getQuestionData();
-      this.paperData =
-        this.paperList.find((i) => i.dataId === this.id) || this.paperList[0];
-      this.showPaperId = this.paperData.dataId;
+        }
     },
-    handleActionEvent({ key }) {
-      switch (key) {
-        case "cancel":
-          this.closeDialog();
-          break;
-        default:
-          break;
-      }
+    watch: {
+        visible: {
+            handler (val, oldVal) {
+                this.dialogVisible = this.visible
+            }
+        }
     },
-    handleKeyPress(event) {
-      if (event.keyCode === 27 || event.key === "Esc") {
-        this.closeDialog();
-      }
+    mounted () {
+        this.loadData()
+        // 监听键盘事件
+        window.addEventListener('keyup', this.handleKeyPress)
     },
-    transformUser(userId) {
-      const { userList = [] } = this.$store.getters;
-      const user = userList.find((u) => u.userId === userId) || {};
-      return user.userName || "-";
+    beforeDestroy () {
+        window.removeEventListener('keyup', this.handleKeyPress)
     },
-    getQuestionData() {
-      const param = this.examId
-        ? `and e.exam_id_ = '${this.examId}'`
-        : "and e.exam_id_ is null";
-      const sql = `select e.id_ as dataId, e.exam_id_ as examId, e.kao_shi_ren_ as examinee, e.bu_men_ as dept, e.zhuang_tai_ as status, e.bao_ming_shi_jian as applyTime, e.kai_shi_shi_jian_ as startTime, e.jie_shu_shi_jian_ as endTime, e.ti_ku_zong_fen_ as totalScore, e.de_fen_ as resultScore, ed.ti_mu_id_ as questionId, ed.ti_gan_ as stem, ed.ti_xing_ as questionType, ed.fen_zhi_ as questionScore, ed.fu_tu_ as img, ed.xuan_xiang_lei_xi as optionsType, ed.xuan_xiang_ as options, ed.can_kao_da_an_ as rightKey, ed.ping_fen_fang_shi as rateType, ed.ping_fen_ren_ as rater, ed.hui_da_ as answer, ed.ping_yue_shi_jian as rateTime, ed.de_fen_ as score, ed.jie_xi_ as analysis, q.ti_ku_ming_cheng_ as paperName, case when e.exam_id_ is not null then ex.da_biao_zhan_bi_ else q.da_biao_zhan_bi_ end as qualifiedRadio, case when e.exam_id_ is not null then ex.ji_fen_fang_shi_ else q.ji_fen_fang_shi_ end as scoringType, case when e.exam_id_ is not null then ex.kao_shi_ming_chen else '自主考核' end as examName, case when e.exam_id_ is not null then ex.xian_kao_shi_jian else '不限' end as limitDate from t_examination e left join t_examination_detail ed on e.id_ = ed.parent_id_ left join  t_question_bank q on e.ti_ku_id_ = q.id_ left join  t_exams ex on e.exam_id_ = ex.id_ where e.ti_ku_id_ = '${this.bankId}' ${param} and e.kao_shi_ren_ = '${this.examineeId}' and (e.zhuang_tai_ = '已完成' or e.zhuang_tai_ = '已交卷') order by field(ed.ti_xing_, '单选题', '多选题', '判断题', '填空题', '简答题')`;
-      return new Promise((resolve, reject) => {
-        this.$common
-          .request("sql", sql)
-          .then((res) => {
-            const { data = [] } = res.variables || {};
-            if (!data.length) {
-              this.$message.error("未查询到已提交的考试记录,请先完成考试!");
-              this.closeDialog();
-              return;
+    methods: {
+    // 获取题库数据
+        async loadData () {
+            if (!this.bankId) {
+                this.$message.error('获取题目信息失败,请重试!')
+                this.closeDialog()
+                return
             }
-            const result = [];
-            data.map((item) => {
-              // 数据转换
-              if (["单选题", "多选题"].includes(item.questionType)) {
-                item.options = JSON.parse(item.options);
-                item.rightKey =
-                  item.questionType === "多选题"
-                    ? item.rightKey.split(",")
-                    : item.rightKey;
-                item.answer =
-                  item.questionType === "多选题"
-                    ? JSON.parse(item.answer)
-                    : item.answer;
-              } else if (item.questionType === "填空题") {
-                item.rightKey = item.rightKey ? JSON.parse(item.rightKey) : [];
-                item.answer = item.answer
-                  ? JSON.parse(item.answer)
-                  : Array(item.rightKey.length).fill("");
-              } else if (item.questionType === "简答题") {
-                item.rightKey = [item.rightKey];
-                item.answer = [item.answer];
-              }
-              item.img = item.img ? JSON.parse(item.img) : "";
+            this.paperList = await this.getQuestionData()
+            this.paperData =
+        this.paperList.find((i) => i.dataId === this.id) || this.paperList[0]
+            this.showPaperId = this.paperData.dataId
+        },
+        handleActionEvent ({ key }) {
+            switch (key) {
+                case 'cancel':
+                    this.closeDialog()
+                    break
+                default:
+                    break
+            }
+        },
+        handleKeyPress (event) {
+            if (event.keyCode === 27 || event.key === 'Esc') {
+                this.closeDialog()
+            }
+        },
+        transformUser (userId) {
+            const { userList = [] } = this.$store.getters
+            const user = userList.find((u) => u.userId === userId) || {}
+            return user.userName || '-'
+        },
+        getQuestionData () {
+            const param = this.examId
+                ? `and e.exam_id_ = '${this.examId}'`
+                : 'and e.exam_id_ is null'
+            const sql = `select e.id_ as dataId, e.exam_id_ as examId, e.kao_shi_ren_ as examinee, e.bu_men_ as dept, e.zhuang_tai_ as status, e.bao_ming_shi_jian as applyTime, e.kai_shi_shi_jian_ as startTime, e.jie_shu_shi_jian_ as endTime, e.ti_ku_zong_fen_ as totalScore, e.de_fen_ as resultScore, ed.ti_mu_id_ as questionId, ed.ti_gan_ as stem, ed.ti_xing_ as questionType, ed.fen_zhi_ as questionScore, ed.fu_tu_ as img, ed.xuan_xiang_lei_xi as optionsType, ed.xuan_xiang_ as options, ed.can_kao_da_an_ as rightKey, ed.ping_fen_fang_shi as rateType, ed.ping_fen_ren_ as rater, ed.hui_da_ as answer, ed.ping_yue_shi_jian as rateTime, ed.de_fen_ as score, ed.jie_xi_ as analysis, q.ti_ku_ming_cheng_ as paperName, case when e.exam_id_ is not null then ex.da_biao_zhan_bi_ else q.da_biao_zhan_bi_ end as qualifiedRadio, case when e.exam_id_ is not null then ex.ji_fen_fang_shi_ else q.ji_fen_fang_shi_ end as scoringType, case when e.exam_id_ is not null then ex.kao_shi_ming_chen else '自主考核' end as examName, case when e.exam_id_ is not null then ex.xian_kao_shi_jian else '不限' end as limitDate from t_examination e left join t_examination_detail ed on e.id_ = ed.parent_id_ left join  t_question_bank q on e.ti_ku_id_ = q.id_ left join  t_exams ex on e.exam_id_ = ex.id_ where e.ti_ku_id_ = '${this.bankId}' ${param} and e.kao_shi_ren_ = '${this.examineeId}' and (e.zhuang_tai_ = '已完成' or e.zhuang_tai_ = '已交卷') order by field(ed.ti_xing_, '单选题', '多选题', '判断题', '填空题', '简答题')`
+            return new Promise((resolve, reject) => {
+                this.$common
+                    .request('sql', sql)
+                    .then((res) => {
+                        const { data = [] } = res.variables || {}
+                        if (!data.length) {
+                            this.$message.error('未查询到已提交的考试记录,请先完成考试!')
+                            this.closeDialog()
+                            return
+                        }
+                        const result = []
+                        data.map((item) => {
+                            // 数据转换
+                            if (['单选题', '多选题'].includes(item.questionType)) {
+                                item.options = JSON.parse(item.options)
+                                item.rightKey =
+                  item.questionType === '多选题'
+                      ? item.rightKey.split(',')
+                      : item.rightKey
+                                item.answer =
+                  item.questionType === '多选题'
+                      ? JSON.parse(item.answer)
+                      : item.answer
+                            } else if (item.questionType === '填空题') {
+                                item.rightKey = item.rightKey ? JSON.parse(item.rightKey) : []
+                                item.answer = item.answer
+                                    ? JSON.parse(item.answer)
+                                    : Array(item.rightKey.length).fill('')
+                            } else if (item.questionType === '简答题') {
+                                item.rightKey = [item.rightKey]
+                                item.answer = [item.answer]
+                            }
+                            item.img = item.img ? JSON.parse(item.img) : ''
 
-              // 数据分组
-              const index = result.findIndex((i) => i.dataId === item.dataId);
-              if (index === -1) {
-                const {
-                  dataId,
-                  examinee,
-                  dept,
-                  status,
-                  applyTime,
-                  startTime,
-                  endTime,
-                  qualifiedRadio,
-                  paperName,
-                  totalScore,
-                  resultScore,
-                  scoringType,
-                } = item || {};
-                result.push({
-                  dataId,
-                  examinee,
-                  dept,
-                  status,
-                  applyTime,
-                  startTime,
-                  endTime,
-                  qualifiedRadio,
-                  isQualified:
-                    status === "已完成"
-                      ? parseFloat(resultScore) >=
+                            // 数据分组
+                            const index = result.findIndex((i) => i.dataId === item.dataId)
+                            if (index === -1) {
+                                const {
+                                    dataId,
+                                    examinee,
+                                    dept,
+                                    status,
+                                    applyTime,
+                                    startTime,
+                                    endTime,
+                                    qualifiedRadio,
+                                    paperName,
+                                    totalScore,
+                                    resultScore,
+                                    scoringType
+                                } = item || {}
+                                result.push({
+                                    dataId,
+                                    examinee,
+                                    dept,
+                                    status,
+                                    applyTime,
+                                    startTime,
+                                    endTime,
+                                    qualifiedRadio,
+                                    isQualified:
+                    status === '已完成'
+                        ? parseFloat(resultScore) >=
                         (parseFloat(qualifiedRadio) / 100) *
                           parseFloat(totalScore)
-                      : "",
-                  paperName,
-                  totalScore: parseFloat(totalScore),
-                  resultScore: parseFloat(resultScore),
-                  totalCount: data.length,
-                  scoringType,
-                  list: [
-                    {
-                      type: item.questionType,
-                      questions: [item],
-                    },
-                  ],
-                });
-              } else {
-                const qIndex = result[index].list.findIndex(
-                  (i) => i.type === item.questionType
-                );
-                if (qIndex === -1) {
-                  result[index].list.push({
-                    type: item.questionType,
-                    questions: [item],
-                  });
-                } else {
-                  result[index].list[qIndex].questions.push(item);
-                }
-              }
-            });
-            result.forEach((item) => {
-              item.list.forEach((i) => {
-                i.totalScore = i.questions.reduce(
-                  (a, b) => a + parseFloat(b.questionScore),
-                  0
-                );
-              });
-            });
-            // 获取最高分最低分
-            const { maxScore, minScore } = result
-              .filter((i) => i.status === "已完成")
-              .reduce(
-                (acc, curr) => {
-                  if (curr.resultScore > acc.maxScore) {
-                    acc.maxScore = curr.resultScore;
-                  }
-                  if (curr.resultScore < acc.minScore) {
-                    acc.minScore = curr.resultScore;
-                  }
-                  return acc;
-                },
-                { maxScore: -Infinity, minScore: Infinity }
-              );
-            this.maxScore = maxScore;
-            this.minScore = minScore;
-            resolve(result);
-          })
-          .catch((error) => {
-            reject(error);
-          });
-      });
-    },
-    changePaper(id) {
-      this.showPaperId = id;
-      this.paperData = this.paperList.find((i) => i.dataId === id);
-      console.log(id);
-      this.paperStatus = "all";
-    },
-    // 关闭当前窗口
-    closeDialog() {
-      window.removeEventListener("keyup", this.handleKeyPress);
-      this.$emit("close", false);
-    },
-  },
-};
+                        : '',
+                                    paperName,
+                                    totalScore: parseFloat(totalScore),
+                                    resultScore: parseFloat(resultScore),
+                                    totalCount: data.length,
+                                    scoringType,
+                                    list: [
+                                        {
+                                            type: item.questionType,
+                                            questions: [item]
+                                        }
+                                    ]
+                                })
+                            } else {
+                                const qIndex = result[index].list.findIndex(
+                                    (i) => i.type === item.questionType
+                                )
+                                if (qIndex === -1) {
+                                    result[index].list.push({
+                                        type: item.questionType,
+                                        questions: [item]
+                                    })
+                                } else {
+                                    result[index].list[qIndex].questions.push(item)
+                                }
+                            }
+                        })
+                        result.forEach((item) => {
+                            item.list.forEach((i) => {
+                                i.totalScore = i.questions.reduce(
+                                    (a, b) => a + parseFloat(b.questionScore),
+                                    0
+                                )
+                            })
+                        })
+                        // 获取最高分最低分
+                        const { maxScore, minScore } = result
+                            .filter((i) => i.status === '已完成')
+                            .reduce(
+                                (acc, curr) => {
+                                    if (curr.resultScore > acc.maxScore) {
+                                        acc.maxScore = curr.resultScore
+                                    }
+                                    if (curr.resultScore < acc.minScore) {
+                                        acc.minScore = curr.resultScore
+                                    }
+                                    return acc
+                                },
+                                { maxScore: -Infinity, minScore: Infinity }
+                            )
+                        this.maxScore = maxScore
+                        this.minScore = minScore
+                        resolve(result)
+                    })
+                    .catch((error) => {
+                        reject(error)
+                    })
+            })
+        },
+        changePaper (id) {
+            this.showPaperId = id
+            this.paperData = this.paperList.find((i) => i.dataId === id)
+            console.log(id)
+            this.paperStatus = 'all'
+        },
+        // 关闭当前窗口
+        closeDialog () {
+            window.removeEventListener('keyup', this.handleKeyPress)
+            this.$emit('close', false)
+        }
+    }
+}
 </script>
 <style lang="scss" scoped>
 .paper-detail-dialog {

+ 562 - 562
src/views/platform/org/employee/edit/index.vue

@@ -1,41 +1,41 @@
 <template>
-  <el-dialog
-    :title="title"
-    :visible.sync="dialogVisible"
-    :close-on-click-modal="false"
-    :close-on-press-escape="false"
-    append-to-body
-    top="0"
-    custom-class="employee-dialog is-fullscreen"
-    width="80%"
-    @open="getFormData"
-    @close="closeDialog"
-  >
-    <el-tabs
-      v-if="dialogVisible"
-      v-model="activeName"
-      v-loading="dialogLoading"
-      :element-loading-text="$t('common.loading')"
-      class="emp-tab"
+    <el-dialog
+        :title="title"
+        :visible.sync="dialogVisible"
+        :close-on-click-modal="false"
+        :close-on-press-escape="false"
+        append-to-body
+        top="0"
+        custom-class="employee-dialog is-fullscreen"
+        width="80%"
+        @open="getFormData"
+        @close="closeDialog"
     >
-      <el-tab-pane label="基本资料" name="basic-info">
-        <basic-info
-          ref="basicInfo"
-          :readonly="readonly"
-          :data="employee"
-          :form-type="formType"
-          @input="(data) => (employee = data)"
-        />
-      </el-tab-pane>
-      <el-tab-pane v-if="isSuper" label="扩展属性" name="ext-attr">
-        <ext-attr
-          ref="attrInfo"
-          :readonly="readonly"
-          :data="employee.attrItemList"
-          @input="(data) => (employee.attrItemList = data)"
-        />
-      </el-tab-pane>
-      <!-- <el-tab-pane
+        <el-tabs
+            v-if="dialogVisible"
+            v-model="activeName"
+            v-loading="dialogLoading"
+            :element-loading-text="$t('common.loading')"
+            class="emp-tab"
+        >
+            <el-tab-pane label="基本资料" name="basic-info">
+                <basic-info
+                    ref="basicInfo"
+                    :readonly="readonly"
+                    :data="employee"
+                    :form-type="formType"
+                    @input="(data) => (employee = data)"
+                />
+            </el-tab-pane>
+            <el-tab-pane v-if="isSuper" label="扩展属性" name="ext-attr">
+                <ext-attr
+                    ref="attrInfo"
+                    :readonly="readonly"
+                    :data="employee.attrItemList"
+                    @input="(data) => (employee.attrItemList = data)"
+                />
+            </el-tab-pane>
+            <!-- <el-tab-pane
                 v-if="!infoIncludes('org-info')"
                 label="组织信息"
                 name="org-info"
@@ -50,23 +50,23 @@
                 />
             </el-tab-pane> -->
 
-      <!-- 原岗位 -->
-      <el-tab-pane label="部门信息" name="position-info">
-        <position-info
-          ref="positionInfo"
-          :span="span"
-          :readonly="readonly"
-          :org-id="orgId"
-          :data="employee.posItemList"
-          @input="(data) => (employee.posItemList = data)"
-        />
-      </el-tab-pane>
-      <el-tab-pane
-        v-if="!infoIncludes('role-info')"
-        label="角色信息"
-        name="role-info"
-      >
-        <!-- <span slot="label">角色信息
+            <!-- 原岗位 -->
+            <el-tab-pane label="部门信息" name="position-info">
+                <position-info
+                    ref="positionInfo"
+                    :span="span"
+                    :readonly="readonly"
+                    :org-id="orgId"
+                    :data="employee.posItemList"
+                    @input="(data) => (employee.posItemList = data)"
+                />
+            </el-tab-pane>
+            <el-tab-pane
+                v-if="!infoIncludes('role-info')"
+                label="角色信息"
+                name="role-info"
+            >
+                <!-- <span slot="label">角色信息
                     <el-tooltip
                         v-if="!readonly"
                         class="item"
@@ -77,15 +77,15 @@
                         <ibps-icon name="help" style="color: #dd5b44;" />
                     </el-tooltip>
                 </span> -->
-        <role-info
-          ref="roleInfo"
-          :span="span"
-          :readonly="readonly"
-          :data="employee.roleItemList"
-          @input="(data) => (employee.roleItemList = data)"
-        />
-      </el-tab-pane>
-      <!-- <el-tab-pane label="用户组信息" name="group-info">
+                <role-info
+                    ref="roleInfo"
+                    :span="span"
+                    :readonly="readonly"
+                    :data="employee.roleItemList"
+                    @input="(data) => (employee.roleItemList = data)"
+                />
+            </el-tab-pane>
+            <!-- <el-tab-pane label="用户组信息" name="group-info">
                 <group-info
                     ref="groupInfo"
                     :readonly="readonly"
@@ -93,532 +93,532 @@
                     @input="data => employee.userGroupItemList = data"
                 />
             </el-tab-pane> -->
-    </el-tabs>
-    <div slot="footer" class="el-dialog--center">
-      <ibps-toolbar
-        v-if="!readonly || formType === 'part'"
-        :actions="toolbars"
-        @action-event="handleActionEvent"
-      />
-    </div>
-    <personal-code
-      v-if="qrcodeVisible"
-      :visible.sync="qrcodeVisible"
-      :content="personalInfo"
-      :photo="employee.photo"
-      @close="(visible) => (qrcodeVisible = visible)"
-    />
-  </el-dialog>
+        </el-tabs>
+        <div slot="footer" class="el-dialog--center">
+            <ibps-toolbar
+                v-if="!readonly || formType === 'part'"
+                :actions="toolbars"
+                @action-event="handleActionEvent"
+            />
+        </div>
+        <personal-code
+            v-if="qrcodeVisible"
+            :visible.sync="qrcodeVisible"
+            :content="personalInfo"
+            :photo="employee.photo"
+            @close="(visible) => (qrcodeVisible = visible)"
+        />
+    </el-dialog>
 </template>
 
 <script>
-import { create, update, load, upEmployee } from "@/api/platform/org/employee";
-import ActionUtils from "@/utils/action";
-import BasicInfo from "./basic-info";
-import ExtAttr from "./ext-attr";
-import OrgInfo from "./org-info";
-import PositionInfo from "./position-info";
-import RoleInfo from "./role-info";
-import GroupInfo from "./group-info";
-import PersonalCode from "./personal-qrcode";
+import { create, update, load, upEmployee } from '@/api/platform/org/employee'
+import ActionUtils from '@/utils/action'
+import BasicInfo from './basic-info'
+import ExtAttr from './ext-attr'
+import OrgInfo from './org-info'
+import PositionInfo from './position-info'
+import RoleInfo from './role-info'
+import GroupInfo from './group-info'
+import PersonalCode from './personal-qrcode'
 
 export default {
-  components: {
-    BasicInfo,
-    ExtAttr,
-    OrgInfo,
-    PositionInfo,
-    RoleInfo,
-    GroupInfo,
-    PersonalCode,
-  },
-  props: {
-    visible: Boolean,
-    id: String,
-    title: String,
-    readonly: {
-      type: Boolean,
-      default: false,
+    components: {
+        BasicInfo,
+        ExtAttr,
+        OrgInfo,
+        PositionInfo,
+        RoleInfo,
+        GroupInfo,
+        PersonalCode
     },
-    formType: {
-      type: String,
-      default: "add",
-    },
-    ceroParams: {
-      type: Object,
-      default: () => {},
-    },
-    span: [Number, String],
-  },
-  data() {
-    const { isSuper } = this.$store.getters;
-    return {
-      isSuper,
-      info: [],
-      orgId: "",
-      dialogLoading: false,
-      dialogVisible: false,
-      activeName: "basic-info",
-      defaultEmployee: {
-        id: "",
-        account: "",
-        password: "jyk123456",
-        isSuper: "N",
-        name: "",
-        status: "actived",
-        gender: "male",
-        email: "",
-        photo: "",
-        mobile: "",
-        createTime: "",
-        attrItemList: [], // 扩展属性
-        groupID: "", // 组织ID
-        posItemList: [],
-        roleItemList: [],
-        userGroupItemList: [],
-        orgItem: {}, // 组织全部信息
-        wxyhId: "",
-        jiNengZhiCheng: "inside",
-      },
-      employee: {},
-      qrcodeVisible: false,
-      personalInfo: "",
-      toolbars: [
-        {
-          key: "save",
-          hidden: () => {
-            return this.readonly && this.formType === "detail";
-          },
+    props: {
+        visible: Boolean,
+        id: String,
+        title: String,
+        readonly: {
+            type: Boolean,
+            default: false
         },
-        {
-          key: "qrcode",
-          icon: "ibps-icon-qrcode",
-          label: "个人二维码",
-          type: "success",
+        formType: {
+            type: String,
+            default: 'add'
         },
-        { key: "cancel" },
-      ],
-    };
-  },
-  computed: {
-    formId() {
-      return this.id;
-    },
-  },
-  watch: {
-    visible: {
-      handler(val, oldVal) {
-        this.dialogVisible = this.visible;
-      },
-      immediate: true,
+        ceroParams: {
+            type: Object,
+            default: () => {}
+        },
+        span: [Number, String]
     },
-    ceroParams: {
-      handler(val, oldVal) {
-        if (val && val !== {}) {
-          this.orgId = val.groundId;
+    data () {
+        const { isSuper } = this.$store.getters
+        return {
+            isSuper,
+            info: [],
+            orgId: '',
+            dialogLoading: false,
+            dialogVisible: false,
+            activeName: 'basic-info',
+            defaultEmployee: {
+                id: '',
+                account: '',
+                password: 'jyk123456',
+                isSuper: 'N',
+                name: '',
+                status: 'actived',
+                gender: 'male',
+                email: '',
+                photo: '',
+                mobile: '',
+                createTime: '',
+                attrItemList: [], // 扩展属性
+                groupID: '', // 组织ID
+                posItemList: [],
+                roleItemList: [],
+                userGroupItemList: [],
+                orgItem: {}, // 组织全部信息
+                wxyhId: '',
+                jiNengZhiCheng: 'inside'
+            },
+            employee: {},
+            qrcodeVisible: false,
+            personalInfo: '',
+            toolbars: [
+                {
+                    key: 'save',
+                    hidden: () => {
+                        return this.readonly && this.formType === 'detail'
+                    }
+                },
+                {
+                    key: 'qrcode',
+                    icon: 'ibps-icon-qrcode',
+                    label: '个人二维码',
+                    type: 'success'
+                },
+                { key: 'cancel' }
+            ]
         }
-      },
-      deep: true,
-    },
-  },
-  methods: {
-    infoIncludes(params) {
-      const arr = this.ceroParams !== undefined ? this.ceroParams.unshow : [];
-      return arr.includes(params);
     },
-    handleActionEvent({ key }) {
-      switch (key) {
-        case "save":
-          this.handleSave();
-          break;
-        case "qrcode":
-          this.handleQRCode();
-          break;
-        case "cancel":
-          this.closeDialog();
-          break;
-        default:
-          break;
-      }
-    },
-    handleSave() {
-      // 验证表单是否填写
-      this.$refs.basicInfo.validate((valid) => {
-        if (valid) {
-          if (this.formId) {
-            this.getUpEmployee();
-          } else {
-            this.saveData();
-          }
-        } else {
-          this.activeName = "basic-info";
-          ActionUtils.saveErrorMessage();
+    computed: {
+        formId () {
+            return this.id
         }
-      });
-    },
-    handleQRCode() {
-      this.personalInfo = JSON.stringify({
-        id: this.employee.id,
-        account: this.employee.account,
-        name: this.employee.name,
-        mobile: this.employee.mobile,
-        email: this.employee.email,
-        gender: this.employee.gender,
-        dept: this.employee.posItemList.map((i) => i.name).join(","),
-        role: this.employee.roleItemList.map((i) => i.name).join(","),
-      });
-      this.qrcodeVisible = true;
-    },
-    checkPhone(value) {
-      const reg =
-        /^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|166|198|199|(147))\d{8}$/;
-      if (!reg.test(value)) {
-        return false;
-      }
-      return true;
     },
-    checkEmail(value) {
-      const reg =
-        /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
-      if (!reg.test(value)) {
-        return false;
-      }
-      return true;
-    },
-    getUpEmployee() {
-      const params = {
-        id: this.employee.id,
-        account: this.employee.account,
-      };
-      upEmployee(params).then((res) => {
-        if (res.state === 200) {
-          const data = res.variables.data;
-          if (data === "Y") {
-            this.saveData();
-          } else {
-            ActionUtils.warning(res.message);
-          }
-        }
-      });
-    },
-    createTrain(id) {
-      const { isTrain, trainType, teacher, jianDingZiGeZ } =
-        this.employee || {};
-      const { first, second } = this.$store.getters.level || {};
-      const { userList } = this.$store.getters || {};
-      if (isTrain !== "Y") {
-        return;
-      }
-      const time = this.$common.getDateNow(19);
-      const userInfo = userList.find((item) => item.userId === teacher) || {};
-      const addTrainData = {
-        tableName: "t_lhgqpxjh",
-        paramWhere: [
-          {
-            di_dian_: second || first,
-            nian_du_: time.slice(0, 4),
-            bian_zhi_bu_men_: userInfo
-              ? userInfo.positionId.split(",").pop()
-              : "",
-            bian_zhi_ren_: teacher,
-            bian_zhi_shi_jian: time,
-            shi_fou_guo_shen_: "已编制",
-            bu_men_: "",
-            pei_xun_lei_xing_: trainType,
-            ru_zhi_zhuan_gang: time,
-            yuan_gong_xing_mi: id,
-            gong_hao_: jianDingZiGeZ,
-          },
-        ],
-        formKey: "lhgqpxypjb",
-        defKey: "Process_1a66tzk",
-      };
-      this.$common.request("add", addTrainData);
-    },
-    saveData() {
-      const attrValidator =
-        this.$refs["attrInfo"] && this.isSuper
-          ? this.$refs["attrInfo"].callback()
-          : null;
-      const vo = this.formatSubmitData();
-      if (!this.$utils.isEmpty(this.formId) && !this.ceroParams) {
-        delete vo.partyEmployeePo.password;
-      }
-      if (vo.positionVoList.length === 0) {
-        ActionUtils.warning("请选择部门");
-        return;
-      }
-      this.dialogLoading = true;
-      if (!attrValidator && this.isSuper) {
-        ActionUtils.warning("请检查扩展属性是否填写正确");
-        this.dialogLoading = false;
-        return;
-      }
-      const { mobile = "" } = vo.user || {};
-      if (mobile && !this.checkPhone(mobile)) {
-        ActionUtils.warning("请输入正确的手机号");
-        this.dialogLoading = false;
-        return;
-      }
-
-      const { email = "" } = vo.user || {};
-      if (email && !this.checkEmail(email)) {
-        ActionUtils.warning("请输入正确的邮箱");
-        this.dialogLoading = false;
-        return;
-      }
-      const { isTrain, trainType, teacher } = this.employee || {};
-      if (isTrain === "Y" && !trainType) {
-        this.dialogLoading = false;
-        return ActionUtils.warning("请选择培训类型");
-      }
-      if (isTrain === "Y" && !teacher) {
-        this.dialogLoading = false;
-        return ActionUtils.warning("请选择带教老师");
-      }
-      // 部门信息
-      vo.user.positions = vo.positionVoList.length
-        ? vo.positionVoList.map((i) => i.id).join(",")
-        : "";
-      // 角色信息
-      vo.user.job = vo.roleVoList.length
-        ? vo.roleVoList.map((i) => i.id).join(",")
-        : "";
-      // 更新该表的job_字段
-      const updateParams = {
-        tableName: "ibps_party_employee",
-        updList: [
-          {
-            where: {
-              id_: vo.user.id,
+    watch: {
+        visible: {
+            handler (val, oldVal) {
+                this.dialogVisible = this.visible
             },
-            param: {
-              positions_: vo.user.positions,
-              job_: vo.user.job,
+            immediate: true
+        },
+        ceroParams: {
+            handler (val, oldVal) {
+                if (val && val !== {}) {
+                    this.orgId = val.groundId
+                }
             },
-          },
-        ],
-      };
+            deep: true
+        }
+    },
+    methods: {
+        infoIncludes (params) {
+            const arr = this.ceroParams !== undefined ? this.ceroParams.unshow : []
+            return arr.includes(params)
+        },
+        handleActionEvent ({ key }) {
+            switch (key) {
+                case 'save':
+                    this.handleSave()
+                    break
+                case 'qrcode':
+                    this.handleQRCode()
+                    break
+                case 'cancel':
+                    this.closeDialog()
+                    break
+                default:
+                    break
+            }
+        },
+        handleSave () {
+            // 验证表单是否填写
+            this.$refs.basicInfo.validate((valid) => {
+                if (valid) {
+                    if (this.formId) {
+                        this.getUpEmployee()
+                    } else {
+                        this.saveData()
+                    }
+                } else {
+                    this.activeName = 'basic-info'
+                    ActionUtils.saveErrorMessage()
+                }
+            })
+        },
+        handleQRCode () {
+            this.personalInfo = JSON.stringify({
+                id: this.employee.id,
+                account: this.employee.account,
+                name: this.employee.name,
+                mobile: this.employee.mobile,
+                email: this.employee.email,
+                gender: this.employee.gender,
+                dept: this.employee.posItemList.map((i) => i.name).join(','),
+                role: this.employee.roleItemList.map((i) => i.name).join(',')
+            })
+            this.qrcodeVisible = true
+        },
+        checkPhone (value) {
+            const reg =
+        /^((13[0-9])|(14[5,7])|(15[0-3,5-9])|(17[0,3,5-8])|(18[0-9])|166|198|199|(147))\d{8}$/
+            if (!reg.test(value)) {
+                return false
+            }
+            return true
+        },
+        checkEmail (value) {
+            const reg =
+        /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
+            if (!reg.test(value)) {
+                return false
+            }
+            return true
+        },
+        getUpEmployee () {
+            const params = {
+                id: this.employee.id,
+                account: this.employee.account
+            }
+            upEmployee(params).then((res) => {
+                if (res.state === 200) {
+                    const data = res.variables.data
+                    if (data === 'Y') {
+                        this.saveData()
+                    } else {
+                        ActionUtils.warning(res.message)
+                    }
+                }
+            })
+        },
+        createTrain (id) {
+            const { isTrain, trainType, teacher, jianDingZiGeZ } =
+        this.employee || {}
+            const { first, second } = this.$store.getters.level || {}
+            const { userList } = this.$store.getters || {}
+            if (isTrain !== 'Y') {
+                return
+            }
+            const time = this.$common.getDateNow(19)
+            const userInfo = userList.find((item) => item.userId === teacher) || {}
+            const addTrainData = {
+                tableName: 't_lhgqpxjh',
+                paramWhere: [
+                    {
+                        di_dian_: second || first,
+                        nian_du_: time.slice(0, 4),
+                        bian_zhi_bu_men_: userInfo
+                            ? userInfo.positionId.split(',').pop()
+                            : '',
+                        bian_zhi_ren_: teacher,
+                        bian_zhi_shi_jian: time,
+                        shi_fou_guo_shen_: '已编制',
+                        bu_men_: '',
+                        pei_xun_lei_xing_: trainType,
+                        ru_zhi_zhuan_gang: time,
+                        yuan_gong_xing_mi: id,
+                        gong_hao_: jianDingZiGeZ
+                    }
+                ],
+                formKey: 'lhgqpxypjb',
+                defKey: 'Process_1a66tzk'
+            }
+            this.$common.request('add', addTrainData)
+        },
+        saveData () {
+            const attrValidator =
+        this.$refs['attrInfo'] && this.isSuper
+            ? this.$refs['attrInfo'].callback()
+            : null
+            const vo = this.formatSubmitData()
+            if (!this.$utils.isEmpty(this.formId) && !this.ceroParams) {
+                delete vo.partyEmployeePo.password
+            }
+            if (vo.positionVoList.length === 0) {
+                ActionUtils.warning('请选择部门')
+                return
+            }
+            this.dialogLoading = true
+            if (!attrValidator && this.isSuper) {
+                ActionUtils.warning('请检查扩展属性是否填写正确')
+                this.dialogLoading = false
+                return
+            }
+            const { mobile = '' } = vo.user || {}
+            if (mobile && !this.checkPhone(mobile)) {
+                ActionUtils.warning('请输入正确的手机号')
+                this.dialogLoading = false
+                return
+            }
 
-      if (this.formId) {
-        update(vo)
-          .then((response) => {
-            this.dialogLoading = false;
-            if (this.wxyhId) {
-              this.updateWxyh();
+            const { email = '' } = vo.user || {}
+            if (email && !this.checkEmail(email)) {
+                ActionUtils.warning('请输入正确的邮箱')
+                this.dialogLoading = false
+                return
+            }
+            const { isTrain, trainType, teacher } = this.employee || {}
+            if (isTrain === 'Y' && !trainType) {
+                this.dialogLoading = false
+                return ActionUtils.warning('请选择培训类型')
             }
-            // 更新部门、岗位数据
-            this.$common.request("update", updateParams);
-            // 启动培训
-            this.createTrain(response.variables.id);
-            this.$emit("dialog-callback", this);
-            if (this.formType === "part") {
-              this.closeDialog();
-              return this.$router.currentRoute.path === "/dashboard"
-                ? location.reload()
-                : this.$router.push("/");
+            if (isTrain === 'Y' && !teacher) {
+                this.dialogLoading = false
+                return ActionUtils.warning('请选择带教老师')
             }
-            ActionUtils.saveSuccessMessage(response.message, (r) => {
-              // if (this.$utils.isEmpty(this.formId)) {
-              //     this.$refs[this.formName].resetFields()
-              // }
-              if (r) {
-                this.closeDialog();
-              }
-            });
-          })
-          .catch(() => {
-            this.dialogLoading = false;
-          });
-      } else {
-        create(vo)
-          .then((response) => {
-            this.dialogLoading = false;
-            // 更新部门、岗位数据
-            this.$common.request("update", updateParams);
-            // 启动培训
-            this.createTrain(response.variables.id);
-            this.$emit("dialog-callback", this);
-            ActionUtils.saveSuccessMessage(response.message, (r) => {
-              if (r) {
-                this.closeDialog();
-              } else {
-                this.init();
+            // 部门信息
+            vo.user.positions = vo.positionVoList.length
+                ? vo.positionVoList.map((i) => i.id).join(',')
+                : ''
+            // 角色信息
+            vo.user.job = vo.roleVoList.length
+                ? vo.roleVoList.map((i) => i.id).join(',')
+                : ''
+            // 更新该表的job_字段
+            const updateParams = {
+                tableName: 'ibps_party_employee',
+                updList: [
+                    {
+                        where: {
+                            id_: vo.user.id
+                        },
+                        param: {
+                            positions_: vo.user.positions,
+                            job_: vo.user.job
+                        }
+                    }
+                ]
+            }
+
+            if (this.formId) {
+                update(vo)
+                    .then((response) => {
+                        this.dialogLoading = false
+                        if (this.wxyhId) {
+                            this.updateWxyh()
+                        }
+                        // 更新部门、岗位数据
+                        this.$common.request('update', updateParams)
+                        // 启动培训
+                        this.createTrain(response.variables.id)
+                        this.$emit('dialog-callback', this)
+                        if (this.formType === 'part') {
+                            this.closeDialog()
+                            return this.$router.currentRoute.path === '/dashboard'
+                                ? location.reload()
+                                : this.$router.push('/')
+                        }
+                        ActionUtils.saveSuccessMessage(response.message, (r) => {
+                            // if (this.$utils.isEmpty(this.formId)) {
+                            //     this.$refs[this.formName].resetFields()
+                            // }
+                            if (r) {
+                                this.closeDialog()
+                            }
+                        })
+                    })
+                    .catch(() => {
+                        this.dialogLoading = false
+                    })
+            } else {
+                create(vo)
+                    .then((response) => {
+                        this.dialogLoading = false
+                        // 更新部门、岗位数据
+                        this.$common.request('update', updateParams)
+                        // 启动培训
+                        this.createTrain(response.variables.id)
+                        this.$emit('dialog-callback', this)
+                        ActionUtils.saveSuccessMessage(response.message, (r) => {
+                            if (r) {
+                                this.closeDialog()
+                            } else {
+                                this.init()
+                                if (this.isSuper) {
+                                    this.$refs.attrInfo.clearData()
+                                }
+                            }
+                        })
+                    })
+                    .catch(() => {
+                        this.dialogLoading = false
+                    })
+            }
+        },
+        // 关闭当前窗口
+        closeDialog () {
+            this.dialogVisible = false
+            this.$emit('close', false)
+        },
+        // 初始化页面,出现之前的数据
+        init () {
+            this.activeName = 'basic-info'
+            this.employee = this.$utils.newData(this.defaultEmployee)
+            this.$nextTick(() => {
+                // if (this.$refs.orgInfo) {
+                //     this.$refs.orgInfo.init()
+                // }
+                // this.$refs.positionInfo.init()
+                if (this.$refs.roleInfo) {
+                    this.$refs.roleInfo.init()
+                }
+            })
+        },
+        getFormData () {
+            this.init()
+            this.$nextTick(() => {
+                this.$refs['basicInfo'].handleGetDefaultUserSecurity()
+            })
+            if (this.$utils.isEmpty(this.formId)) {
+                // 清空拓展属性数据
                 if (this.isSuper) {
-                  this.$refs.attrInfo.clearData();
+                    this.$nextTick(() => {
+                        this.$refs.attrInfo.clearData()
+                    })
                 }
-              }
-            });
-          })
-          .catch(() => {
-            this.dialogLoading = false;
-          });
-      }
-    },
-    // 关闭当前窗口
-    closeDialog() {
-      this.dialogVisible = false;
-      this.$emit("close", false);
-    },
-    // 初始化页面,出现之前的数据
-    init() {
-      this.activeName = "basic-info";
-      this.employee = this.$utils.newData(this.defaultEmployee);
-      this.$nextTick(() => {
-        // if (this.$refs.orgInfo) {
-        //     this.$refs.orgInfo.init()
-        // }
-        // this.$refs.positionInfo.init()
-        if (this.$refs.roleInfo) {
-          this.$refs.roleInfo.init();
-        }
-      });
-    },
-    getFormData() {
-      this.init();
-      this.$nextTick(() => {
-        this.$refs["basicInfo"].handleGetDefaultUserSecurity();
-      });
-      if (this.$utils.isEmpty(this.formId)) {
-        // 清空拓展属性数据
-        if (this.isSuper) {
-          this.$nextTick(() => {
-            this.$refs.attrInfo.clearData();
-          });
-        }
 
-        return;
-      }
-      this.dialogLoading = true;
-      // 用户基本信息
-      load({ employeeId: this.formId })
-        .then((response) => {
-          this.dialogLoading = false;
-          this.employee = response.data;
-          this.employee.orgItem = response.variables.partyOrg || {};
-          this.employee.attrItemList = response.variables.partyAttrs || [];
-          this.employee.posItemList = response.variables.partyPositions || [];
-          this.employee.roleItemList = response.variables.partyRoles || [];
-          this.employee.userGroupItemList =
-            response.variables.partyGroups || [];
-          if (this.isSuper) {
-            this.$nextTick(() => {
-              this.$refs.attrInfo.loadAttrData();
-            });
-          } else {
-            const list = [];
-            response.variables.partyAttrs.forEach((item) => {
-              if (item.values.length > 0) {
-                const obj = {
-                  attrId: item.values[0].attrID,
-                  value: item.values[0].value,
-                };
-                list.push(obj);
-              }
-            });
-            this.employee.attrItemList = list;
-          }
+                return
+            }
+            this.dialogLoading = true
+            // 用户基本信息
+            load({ employeeId: this.formId })
+                .then((response) => {
+                    this.dialogLoading = false
+                    this.employee = response.data
+                    this.employee.orgItem = response.variables.partyOrg || {}
+                    this.employee.attrItemList = response.variables.partyAttrs || []
+                    this.employee.posItemList = response.variables.partyPositions || []
+                    this.employee.roleItemList = response.variables.partyRoles || []
+                    this.employee.userGroupItemList =
+            response.variables.partyGroups || []
+                    if (this.isSuper) {
+                        this.$nextTick(() => {
+                            this.$refs.attrInfo.loadAttrData()
+                        })
+                    } else {
+                        const list = []
+                        response.variables.partyAttrs.forEach((item) => {
+                            if (item.values.length > 0) {
+                                const obj = {
+                                    attrId: item.values[0].attrID,
+                                    value: item.values[0].value
+                                }
+                                list.push(obj)
+                            }
+                        })
+                        this.employee.attrItemList = list
+                    }
 
-          // 添加更新 t_wxyh 用于扫码签到
-          // if()
-          this.getWxyh(this.employee);
-        })
-        .catch(() => {
-          this.dialogLoading = false;
-        });
-    },
-    formatSubmitData() {
-      const vo = {};
-      vo.partyEmployeePo = this.employee;
-      vo.user = this.employee;
-      vo.user.password =
-        this.formId === "" || this.ceroParams
-          ? this.employee.password
-          : this.defaultEmployee.password;
-      vo.partyEmployeePo.groupID =
+                    // 添加更新 t_wxyh 用于扫码签到
+                    // if()
+                    this.getWxyh(this.employee)
+                })
+                .catch(() => {
+                    this.dialogLoading = false
+                })
+        },
+        formatSubmitData () {
+            const vo = {}
+            vo.partyEmployeePo = this.employee
+            vo.user = this.employee
+            vo.user.password =
+        this.formId === '' || this.ceroParams
+            ? this.employee.password
+            : this.defaultEmployee.password
+            vo.partyEmployeePo.groupID =
         this.ceroParams !== {} && this.ceroParams
-          ? this.ceroParams.groundId
-          : this.formatOrgData();
-      vo.positionVoList = this.formatPositionData();
-      vo.roleVoList = this.formatRoleData();
-      vo.attrValueVoList = this.employee.attrItemList;
-      vo.userGroupPoList = this.formatUserGroupData();
-      if (this.ceroParams !== {} && this.ceroParams) {
-        vo.partyEmployeePo.prem = this.ceroParams.prem;
-      }
-      return vo;
-    },
-    formatOrgData() {
-      return this.employee.orgItem.id || "";
-    },
-    formatPositionData() {
-      const result = [];
-      const list = this.employee.posItemList;
-      if (this.$utils.isEmpty(list)) return result;
-      for (const variable of list) {
-        const tmp = { id: variable.id, name: variable.name };
-        tmp["isMainPost"] = variable.isMainPost === "Y";
-        tmp["isPrincipal"] = variable.isPrincipal === "Y";
-        result.push(tmp);
-      }
-      return result;
-    },
-    formatRoleData() {
-      const result = [];
-      const list = this.employee.roleItemList;
-      if (this.$utils.isEmpty(list)) return result;
-      for (const variable of list) {
-        const tmp = { id: variable.id, name: variable.name };
-        tmp["subSystemName"] = variable.subSystemName;
-        tmp["source"] = this.employee.id ? variable.source : "自有";
-        tmp["canDelete"] = variable.source === "自有";
-        result.push(tmp);
-      }
-      return result;
-    },
-    formatUserGroupData() {
-      const result = [];
-      const list = this.employee.userGroupItemList;
-      if (this.$utils.isEmpty(list)) return result;
-      for (const variable of list) {
-        result.push({
-          groupId: variable.id,
-          groupName: variable.name,
-        });
-      }
-      return result;
-    },
-
-    // 更新扫码签到表的数据
-    getWxyh(data) {
-      const sql = `select * from t_wxyh where xing_ming_ = '${data.name}' and shou_ji_ = '${data.mobile}'`;
-      this.$common.request("sql", sql).then((res) => {
-        const { data = [] } = res.variables || {};
-        if (!data.length) {
-          return;
-        }
-        this.wxyhId = data[0].id_;
-      });
-    },
-    updateWxyh() {
-      const obj = {
-        where: {
-          id_: this.wxyhId,
+            ? this.ceroParams.groundId
+            : this.formatOrgData()
+            vo.positionVoList = this.formatPositionData()
+            vo.roleVoList = this.formatRoleData()
+            vo.attrValueVoList = this.employee.attrItemList
+            vo.userGroupPoList = this.formatUserGroupData()
+            if (this.ceroParams !== {} && this.ceroParams) {
+                vo.partyEmployeePo.prem = this.ceroParams.prem
+            }
+            return vo
+        },
+        formatOrgData () {
+            return this.employee.orgItem.id || ''
+        },
+        formatPositionData () {
+            const result = []
+            const list = this.employee.posItemList
+            if (this.$utils.isEmpty(list)) return result
+            for (const variable of list) {
+                const tmp = { id: variable.id, name: variable.name }
+                tmp['isMainPost'] = variable.isMainPost === 'Y'
+                tmp['isPrincipal'] = variable.isPrincipal === 'Y'
+                result.push(tmp)
+            }
+            return result
         },
-        param: {
-          xing_ming_: this.employee.name,
-          shou_ji_: this.employee.mobile,
+        formatRoleData () {
+            const result = []
+            const list = this.employee.roleItemList
+            if (this.$utils.isEmpty(list)) return result
+            for (const variable of list) {
+                const tmp = { id: variable.id, name: variable.name }
+                tmp['subSystemName'] = variable.subSystemName
+                tmp['source'] = this.employee.id ? variable.source : '自有'
+                tmp['canDelete'] = variable.source === '自有'
+                result.push(tmp)
+            }
+            return result
+        },
+        formatUserGroupData () {
+            const result = []
+            const list = this.employee.userGroupItemList
+            if (this.$utils.isEmpty(list)) return result
+            for (const variable of list) {
+                result.push({
+                    groupId: variable.id,
+                    groupName: variable.name
+                })
+            }
+            return result
         },
-      };
 
-      const params = {
-        tableName: "t_wxyh",
-        updList: [obj],
-      };
-      this.$common.request("update", params);
-    },
-  },
-};
+        // 更新扫码签到表的数据
+        getWxyh (data) {
+            const sql = `select * from t_wxyh where xing_ming_ = '${data.name}' and shou_ji_ = '${data.mobile}'`
+            this.$common.request('sql', sql).then((res) => {
+                const { data = [] } = res.variables || {}
+                if (!data.length) {
+                    return
+                }
+                this.wxyhId = data[0].id_
+            })
+        },
+        updateWxyh () {
+            const obj = {
+                where: {
+                    id_: this.wxyhId
+                },
+                param: {
+                    xing_ming_: this.employee.name,
+                    shou_ji_: this.employee.mobile
+                }
+            }
+
+            const params = {
+                tableName: 't_wxyh',
+                updList: [obj]
+            }
+            this.$common.request('update', params)
+        }
+    }
+}
 </script>
 <style lang="scss">
 .employee-dialog {

+ 186 - 185
src/views/platform/org/employee/edit/personal-qrcode.vue

@@ -1,202 +1,203 @@
 <template>
-  <div>
-    <el-dialog
-      :title="`${formatContent.name} 的${formatName}`"
-      :visible.sync="dialogVisible"
-      :close-on-click-modal="false"
-      :close-on-press-escape="false"
-      append-to-body
-      class="personal-qrcode"
-      width="50%"
-      center
-      @close="closeDialog"
-    >
-      <el-tabs v-model="activeName" @tab-click="handleClick">
-        <el-tab-pane label="二维码" name="erweima">
-          <div id="my-QRCode" ref="myQRCode" class="qrCode" />
-        </el-tab-pane>
-        <el-tab-pane label="条形码" name="tiaoxingma">
-          <div class="oneQr">
-            <vue-barcode :value="formatTcodeValue" :displayValue="false" :width="1"
-              >生成条形码失败</vue-barcode
-            >
-          </div>
-        </el-tab-pane>
-      </el-tabs>
-      <div slot="footer" class="el-dialog--center">
-        <ibps-toolbar :actions="toolbars" @action-event="handleActionEvent" />
-      </div>
-    </el-dialog>
-    <vue-easy-print ref="easyPrintRef">
-      <vue-barcode
-        style="text-align: center; margin-top: 30px"
-        :value="formatContent.id"
-        :displayValue="false"
-        >生成条形码失败</vue-barcode
-      >
-    </vue-easy-print>
-  </div>
+    <div>
+        <el-dialog
+            :title="`${formatContent.name} 的${formatName}`"
+            :visible.sync="dialogVisible"
+            :close-on-click-modal="false"
+            :close-on-press-escape="false"
+            append-to-body
+            class="personal-qrcode"
+            width="50%"
+            center
+            @close="closeDialog"
+        >
+            <el-tabs v-model="activeName" @tab-click="handleClick">
+                <el-tab-pane label="二维码" name="erweima">
+                    <div id="my-QRCode" ref="myQRCode" class="qrCode" />
+                </el-tab-pane>
+                <el-tab-pane label="条形码" name="tiaoxingma">
+                    <div class="oneQr">
+                        <vue-barcode
+                            :value="formatTcodeValue"
+                            :display-value="false"
+                            :width="1"
+                        >生成条形码失败</vue-barcode>
+                    </div>
+                </el-tab-pane>
+            </el-tabs>
+            <div slot="footer" class="el-dialog--center">
+                <ibps-toolbar :actions="toolbars" @action-event="handleActionEvent" />
+            </div>
+        </el-dialog>
+        <vue-easy-print ref="easyPrintRef">
+            <vue-barcode
+                style="text-align: center; margin-top: 30px"
+                :value="formatContent.id"
+                :display-value="false"
+            >生成条形码失败</vue-barcode>
+        </vue-easy-print>
+    </div>
 </template>
 
 <script>
-import QRCode from "qrcodejs2"; // 引入qrcode
-import VueBarcode from "vue-barcode";
-import vueEasyPrint from "vue-easy-print";
+import QRCode from 'qrcodejs2' // 引入qrcode
+import VueBarcode from 'vue-barcode'
+import vueEasyPrint from 'vue-easy-print'
 
-import { getFile } from "@/utils/avatar";
+import { getFile } from '@/utils/avatar'
 export default {
-  name: "qrcode",
-  props: {
-    visible: {
-      type: Boolean,
-      default: false,
+    name: 'qrcode',
+    components: {
+        VueBarcode,
+        vueEasyPrint
     },
-    content: {
-      type: String,
-      default: "",
-    },
-    photo: {
-      type: String,
-      default: "",
-    },
-  },
-  components: {
-    VueBarcode,
-    vueEasyPrint,
-  },
-  data() {
-    return {
-      code: "",
-      dialogVisible: this.visible,
-      toolbars: [
-        {
-          key: "download",
-          icon: "ibps-icon-downlaod",
-          label: "下载",
-          type: "primary",
+    props: {
+        visible: {
+            type: Boolean,
+            default: false
         },
-        {
-          key: "cancel",
-          icon: "ibps-icon-close",
-          label: "关闭",
-          type: "drange",
+        content: {
+            type: String,
+            default: ''
         },
-      ],
-      activeName: "erweima", // 二维码条形码切换
-    };
-  },
-  watch: {
-    visible: {
-      handler(val, oldVal) {
-        this.dialogVisible = this.visible;
-        if (val) {
-          this.$nextTick(() => {
-            this.qrcodeRender();
-          });
+        photo: {
+            type: String,
+            default: ''
         }
-      },
-      immediate: true,
-    },
-  },
-  methods: {
-    qrcodeRender() {
-      console.log("qrcodeRender");
-      if (this.code) {
-        this.$refs.myQRCode.innerHTML = "";
-      }
-      this.code = new QRCode("my-QRCode", {
-        width: 250,
-        height: 250,
-        text: this.content,
-        colorDark: "#000000", // 前景色
-        colorLight: "#FFFFFF", // 背景色
-        correctLevel: QRCode.CorrectLevel.Q, // 纠错能力拉满
-      });
-      this.logoRender();
-    },
-    // 中心logo
-    logoRender() {
-      let logo = new Image();
-      logo.setAttribute("crossOrigin", "Anonymous"); // 解决CORS 策略报错
-      logo.src = getFile(this.photo);
-      logo.onload = () => {
-        let qrImg = document
-          .getElementById("my-QRCode")
-          .getElementsByTagName("img")[0];
-        let canvas = document
-          .getElementById("my-QRCode")
-          .getElementsByTagName("canvas")[0];
-        let ctx = canvas.getContext("2d");
-        ctx.drawImage(
-          logo,
-          (250 - 250 / 3.7) / 2,
-          (250 - 250 / 3.7) / 2,
-          250 / 3.7,
-          250 / 3.7
-        );
-        qrImg.src = canvas.toDataURL();
-      };
     },
-    handleActionEvent({ key }) {
-      switch (key) {
-        case "download":
-          this.handleDownload();
-          break;
-        case "cancel":
-          this.closeDialog();
-          break;
-        default:
-          break;
-      }
-    },
-    handleDownload() {
-      if (this.activeName === "erweima") {
-        const myCanvas = document
-          .getElementById("my-QRCode")
-          .getElementsByTagName("canvas");
-        const a = document.createElement("a");
-        a.href = myCanvas[0].toDataURL("image/png");
-        a.download = this.formatContent.name + "的二维码";
-        a.click();
-      } else if (this.activeName === "tiaoxingma") {
-        const svgElement = document
-          .querySelector(".oneQr")
-          .getElementsByTagName("svg")[0];
-        const svgContent = svgElement.outerHTML;
-        const svgDataURL = "data:image/svg+xml;base64," + btoa(svgContent);
-        const canvas = document.createElement("canvas");
-        const context = canvas.getContext("2d");
-        canvas.width = svgElement.width.baseVal.value;
-        canvas.height = svgElement.height.baseVal.value;
-        const img = new Image();
-        img.onload = () => {
-          context.drawImage(img, 0, 0);
-          const imageDataURL = canvas.toDataURL("image/png");
-          const a = document.createElement("a");
-          a.href = imageDataURL;
-          a.download = this.formatContent.name + "的条形码";
-          a.click();
-        };
-        img.src = svgDataURL;
-      }
-    },
-    closeDialog() {
-      this.$emit("close", false);
-    },
-    handleClick() {},
-  },
-  computed: {
-    formatContent() {
-      return JSON.parse(this.content);
+    data () {
+        return {
+            code: '',
+            dialogVisible: this.visible,
+            toolbars: [
+                {
+                    key: 'download',
+                    icon: 'ibps-icon-downlaod',
+                    label: '下载',
+                    type: 'primary'
+                },
+                {
+                    key: 'cancel',
+                    icon: 'ibps-icon-close',
+                    label: '关闭',
+                    type: 'drange'
+                }
+            ],
+            activeName: 'erweima' // 二维码条形码切换
+        }
     },
-    formatName() {
-      return this.activeName === "erweima" ? "二维码" : "条形码";
+    computed: {
+        formatContent () {
+            return JSON.parse(this.content)
+        },
+        formatName () {
+            return this.activeName === 'erweima' ? '二维码' : '条形码'
+        },
+        formatTcodeValue () {
+            return JSON.stringify({ id: JSON.parse(this.content).id })
+        }
     },
-    formatTcodeValue() {
-      return JSON.stringify({ id: JSON.parse(this.content).id });
+    watch: {
+        visible: {
+            handler (val, oldVal) {
+                this.dialogVisible = this.visible
+                if (val) {
+                    this.$nextTick(() => {
+                        this.qrcodeRender()
+                    })
+                }
+            },
+            immediate: true
+        }
     },
-  },
-};
+    methods: {
+        qrcodeRender () {
+            console.log('qrcodeRender')
+            if (this.code) {
+                this.$refs.myQRCode.innerHTML = ''
+            }
+            this.code = new QRCode('my-QRCode', {
+                width: 250,
+                height: 250,
+                text: this.content,
+                colorDark: '#000000', // 前景色
+                colorLight: '#FFFFFF', // 背景色
+                correctLevel: QRCode.CorrectLevel.Q // 纠错能力拉满
+            })
+            this.logoRender()
+        },
+        // 中心logo
+        logoRender () {
+            const logo = new Image()
+            logo.setAttribute('crossOrigin', 'Anonymous') // 解决CORS 策略报错
+            logo.src = getFile(this.photo)
+            logo.onload = () => {
+                const qrImg = document
+                    .getElementById('my-QRCode')
+                    .getElementsByTagName('img')[0]
+                const canvas = document
+                    .getElementById('my-QRCode')
+                    .getElementsByTagName('canvas')[0]
+                const ctx = canvas.getContext('2d')
+                ctx.drawImage(
+                    logo,
+                    (250 - 250 / 3.7) / 2,
+                    (250 - 250 / 3.7) / 2,
+                    250 / 3.7,
+                    250 / 3.7
+                )
+                qrImg.src = canvas.toDataURL()
+            }
+        },
+        handleActionEvent ({ key }) {
+            switch (key) {
+                case 'download':
+                    this.handleDownload()
+                    break
+                case 'cancel':
+                    this.closeDialog()
+                    break
+                default:
+                    break
+            }
+        },
+        handleDownload () {
+            if (this.activeName === 'erweima') {
+                const myCanvas = document
+                    .getElementById('my-QRCode')
+                    .getElementsByTagName('canvas')
+                const a = document.createElement('a')
+                a.href = myCanvas[0].toDataURL('image/png')
+                a.download = this.formatContent.name + '的二维码'
+                a.click()
+            } else if (this.activeName === 'tiaoxingma') {
+                const svgElement = document
+                    .querySelector('.oneQr')
+                    .getElementsByTagName('svg')[0]
+                const svgContent = svgElement.outerHTML
+                const svgDataURL = 'data:image/svg+xml;base64,' + btoa(svgContent)
+                const canvas = document.createElement('canvas')
+                const context = canvas.getContext('2d')
+                canvas.width = svgElement.width.baseVal.value
+                canvas.height = svgElement.height.baseVal.value
+                const img = new Image()
+                img.onload = () => {
+                    context.drawImage(img, 0, 0)
+                    const imageDataURL = canvas.toDataURL('image/png')
+                    const a = document.createElement('a')
+                    a.href = imageDataURL
+                    a.download = this.formatContent.name + '的条形码'
+                    a.click()
+                }
+                img.src = svgDataURL
+            }
+        },
+        closeDialog () {
+            this.$emit('close', false)
+        },
+        handleClick () {}
+    }
+}
 </script>
 
 <style lang="scss" scoped>

+ 54 - 54
src/views/system/dashboard/components/calendar-alert.vue

@@ -1,65 +1,65 @@
 <template>
-  <div class="calendar-alert">
-    <el-dialog
-      title="提醒事项"
-      :visible.sync="dialogFormVisible"
-      width="30%"
-      :close-on-click-modal="false"
-      :close-on-press-escape="false"
-    >
-    <div style="height: 50vh; overflow-y: auto;">
-        <div
-        v-for="(value, key) in calendarAlertData"
-        :key="key"
-        class="item-container"
-      >
-        <div
-          class="start-time"
-          :class="{ alertcolor: new Date() > new Date(key) }"
+    <div class="calendar-alert">
+        <el-dialog
+            title="提醒事项"
+            :visible.sync="dialogFormVisible"
+            width="30%"
+            :close-on-click-modal="false"
+            :close-on-press-escape="false"
         >
-          {{ key }}:
-        </div>
-        <div class="message" v-for="(item, index) in value" :key="item.id">
-          {{ index + 1 }}.{{ item.title }}
-        </div>
-      </div>
-    </div>
-    
+            <div style="height: 50vh; overflow-y: auto;">
+                <div
+                    v-for="(value, key) in calendarAlertData"
+                    :key="key"
+                    class="item-container"
+                >
+                    <div
+                        class="start-time"
+                        :class="{ alertcolor: new Date() > new Date(key) }"
+                    >
+                        {{ key }}:
+                    </div>
+                    <div v-for="(item, index) in value" :key="item.id" class="message">
+                        {{ index + 1 }}.{{ item.title }}
+                    </div>
+                </div>
+            </div>
 
-      <div slot="footer" class="dialog-footer">
-        <el-checkbox v-model="checked">今日不再提醒</el-checkbox>
-        <el-button type="primary" @click="confirm">确 定</el-button>
-      </div>
-    </el-dialog>
-  </div>
+            <div slot="footer" class="dialog-footer">
+                <el-checkbox v-model="checked">今日不再提醒</el-checkbox>
+                <el-button type="primary" @click="confirm">确 定</el-button>
+            </div>
+        </el-dialog>
+    </div>
 </template>
 
 <script>
 export default {
-  props: {
-    calendarAlertData: {
-      default: () => {},
-    },
-  },
-  data() {
-    return {
-      dialogFormVisible: false,
-      checked: false,
-    };
-  },
-  methods: {
-    open() {
-      this.dialogFormVisible = true;
+    props: {
+        calendarAlertData: {
+            default: () => {},
+            type: Object
+        }
     },
-    close() {
-      this.dialogFormVisible = false;
+    data () {
+        return {
+            dialogFormVisible: false,
+            checked: false
+        }
     },
-    confirm() {
-      this.dialogFormVisible = false;
-      this.$emit("onCalendarAlert", this.checked);
-    },
-  },
-};
+    methods: {
+        open () {
+            this.dialogFormVisible = true
+        },
+        close () {
+            this.dialogFormVisible = false
+        },
+        confirm () {
+            this.dialogFormVisible = false
+            this.$emit('onCalendarAlert', this.checked)
+        }
+    }
+}
 </script>
 
 <style>
@@ -89,4 +89,4 @@ export default {
 .alertcolor {
   color: red;
 }
-</style>
+</style>

+ 50 - 51
src/views/system/dashboard/components/util.js

@@ -13,7 +13,7 @@ import dayjs from 'dayjs'
 /**
  * 创建组件
  */
-export function buildComponent(name, column, preview, vm) {
+export function buildComponent (name, column, preview, vm) {
     try {
         return {
             name,
@@ -39,7 +39,7 @@ export function buildComponent(name, column, preview, vm) {
                 }
             },
             filters: {
-                filterStatus(val, type) {
+                filterStatus (val, type) {
                     if (Utils.isEmpty(val)) {
                         return ''
                     }
@@ -58,7 +58,7 @@ export function buildComponent(name, column, preview, vm) {
                     return typeMap[type].find(x => x['value'] === val) ? typeMap[type].find(x => x['value'] === val).label : val
                 }
             },
-            data() {
+            data () {
                 const { first = '', second = '' } = this.$store.getters.level
                 const { userId, userList = [], deptList = [], menus, userInfo } = this.$store.getters
                 const t1 = deptList.find(i => i.positionId === first) || {}
@@ -155,14 +155,14 @@ export function buildComponent(name, column, preview, vm) {
                     userInfo: state => state.ibps.user.info
                 })
             },
-            mounted() {
+            mounted () {
                 this.defaultForm = JSON.parse(JSON.stringify(this.quickNavform))
                 this.$nextTick(() => {
                     this.fetchData()
                 })
             },
             methods: {
-                fetchData(columns, params = {}) {
+                fetchData (columns, params = {}) {
                     this.loading = true
                     this.data = []
                     this.showHeight = this.getHeight()
@@ -221,12 +221,12 @@ export function buildComponent(name, column, preview, vm) {
                     }
                 },
                 // 过滤日程提醒数据
-                filterAlertData(data, dayNumber = 3) {
+                filterAlertData (data, dayNumber = 3) {
                     if (dayNumber <= 0) return
                     const today = dayjs()
-                    let tempCalendarAlertData = data.filter(day => {
-                        const startTime = dayjs(day.startTime);
-                        const endTime = dayjs(day.endTime);
+                    const tempCalendarAlertData = data.filter(day => {
+                        const startTime = dayjs(day.startTime)
+                        const endTime = dayjs(day.endTime)
                         if (day.popUp) {
                             if ((startTime.diff(today, 'day') <= 0 && endTime.diff(today, 'day') >= 0) || (startTime.diff(today, 'day') <= dayNumber - 2 && startTime.diff(today, 'day') >= 0)) {
                                 return true
@@ -234,14 +234,13 @@ export function buildComponent(name, column, preview, vm) {
                         }
                     })
                     tempCalendarAlertData.sort((a, b) => new Date(a.startTime) - new Date(b.startTime))
-                    let calendarIds = tempCalendarAlertData.map(item => item.id)
+                    const calendarIds = tempCalendarAlertData.map(item => item.id)
 
-                    let calendarAlertData = {}
+                    const calendarAlertData = {}
                     tempCalendarAlertData.forEach(item => {
                         if (calendarAlertData[item.startTime]) {
                             calendarAlertData[item.startTime].push(item)
-                        }
-                        else {
+                        } else {
                             calendarAlertData[item.startTime] = []
                             calendarAlertData[item.startTime].push(item)
                         }
@@ -249,20 +248,20 @@ export function buildComponent(name, column, preview, vm) {
                     return { calendarAlertData, calendarIds }
                 },
                 // 日程提醒
-                showAlert(data) {
-                    let calendarAlertData = this.filterAlertData(data)
+                showAlert (data) {
+                    const calendarAlertData = this.filterAlertData(data)
                     this.handleCalendarAlert(calendarAlertData)
                 },
-                getPhoto(photo) {
+                getPhoto (photo) {
                     return getFile(photo)
                 },
-                getTaskDesc(v) {
+                getTaskDesc (v) {
                     if (!v.includes('#')) {
                         return ''
                     }
                     return v.split('#')[1] || ''
                 },
-                getTaskInfo(val, arg) {
+                getTaskInfo (val, arg) {
                     const arr = val.split('#')
                     if (!arr[2]) {
                         return ''
@@ -280,14 +279,14 @@ export function buildComponent(name, column, preview, vm) {
                     result.deptName = deptNames.join(',')
                     return result[arg]
                 },
-                transformData(val, dataset, from, to) {
+                transformData (val, dataset, from, to) {
                     if (!val) {
                         return ''
                     }
                     const temp = this[dataset].find(u => u[from] === val)
                     return temp ? temp[to] : ''
                 },
-                getHeightNoUnit() {
+                getHeightNoUnit () {
                     // 高度 - header - 边框
                     if (!this.visible) {
                         return this.height ? (this.height - 60 - 20) : 150
@@ -295,7 +294,7 @@ export function buildComponent(name, column, preview, vm) {
                         return 150
                     }
                 },
-                getHeight(h = 20) {
+                getHeight (h = 20) {
                     // 高度 - header - 边框
                     if (!this.visible) {
                         return this.height ? `${(this.height - 60 - h)}px` : '150px'
@@ -303,10 +302,10 @@ export function buildComponent(name, column, preview, vm) {
                         return '100%'
                     }
                 },
-                getDashboardHeight() {
+                getDashboardHeight () {
                     return this.height ? `${this.height + 20}px` : '150px'
                 },
-                getAttrs() {
+                getAttrs () {
                     const item = JSON.parse(JSON.stringify(column))
                     item.templateHtml = null
                     return item
@@ -316,7 +315,7 @@ export function buildComponent(name, column, preview, vm) {
                  * @param {*} data
                  * @returns
                  */
-                getFullCalendarConfig(data) {
+                getFullCalendarConfig (data) {
                     const events = data === null ? [] : Utils.parseJSON(data)
                     const config = {
                         height: preview ? '100%' : (this.height ? this.height : 180),
@@ -349,7 +348,7 @@ export function buildComponent(name, column, preview, vm) {
                     }
                     return config
                 },
-                handleDateClick(param) {
+                handleDateClick (param) {
                     this.$emit(
                         'open',
                         'calendar',
@@ -357,7 +356,7 @@ export function buildComponent(name, column, preview, vm) {
                         this.data
                     )
                 },
-                handleEventClick(param) {
+                handleEventClick (param) {
                     this.$emit(
                         'open',
                         'calendar',
@@ -366,7 +365,7 @@ export function buildComponent(name, column, preview, vm) {
                         param.event.id
                     )
                 },
-                handleMoreLinkClick(date) {
+                handleMoreLinkClick (date) {
                     this.$emit(
                         'open',
                         'calendar',
@@ -375,7 +374,7 @@ export function buildComponent(name, column, preview, vm) {
                         date.allSegs[0].event.id
                     )
                 },
-                refreshData() {
+                refreshData () {
                     this.fetchData()
                 },
                 /**
@@ -385,7 +384,7 @@ export function buildComponent(name, column, preview, vm) {
                  * @param {*} data
                  * @param {*} actions
                  */
-                handleActionEvent(command, position, data, actions) {
+                handleActionEvent (command, position, data, actions) {
                     switch (command) {
                         case 'refresh': // 刷新
                             this.refreshData()
@@ -407,27 +406,27 @@ export function buildComponent(name, column, preview, vm) {
                             break
                     }
                 },
-                emitActionEventHandler(command) {
+                emitActionEventHandler (command) {
                     this.$emit('action-event', command, ...Array.from(arguments).slice(1))
                 },
                 // 公告栏目点击事件
-                handleApprove(id, title) {
+                handleApprove (id, title) {
                     this.$emit('action-event', 'approve', {
                         id, title
                     })
                 },
-                handleUnreadMessage(id, tableId, tableName) {
+                handleUnreadMessage (id, tableId, tableName) {
                     this.$emit('action-event', 'unRead', { id, tableId, tableName })
                 },
                 // 日程提醒
-                handleCalendarAlert(calendarAlertData) {
+                handleCalendarAlert (calendarAlertData) {
                     this.$emit('action-event', 'calendarAlert', { calendarAlertData })
                 },
                 // 处理全屏
-                handleFullscreen() {
+                handleFullscreen () {
                     this.emitActionEventHandler('fullscreen', { id: this.attrs.id })
                 },
-                openPlate(url) {
+                openPlate (url) {
                     const menuMap = {
                         myTraining: 'rygl/rypx/wdpx',
                         myTesting: 'rygl/kszx/wdks',
@@ -446,7 +445,7 @@ export function buildComponent(name, column, preview, vm) {
                 /**
                  * 处理更多
                  */
-                handleMore() {
+                handleMore () {
                     if (this.attrs.alias === 'quickNavigation') {
                         return this.openPlate('quickNavigation')
                     }
@@ -456,22 +455,22 @@ export function buildComponent(name, column, preview, vm) {
                     this.openPlate(this.attrs.colUrl)
                 },
                 // 未读消息
-                handleClick(option) {
+                handleClick (option) {
                     this.unreadMessageOption = option
                     option[this.activeName].dataMode = column.dataMode
                     this.fetchData(option[this.activeName])
                 },
                 // 待办事务
-                handleTabClick(option) {
+                handleTabClick (option) {
                     this.pendingBusinessOption = option
                     option[this.pendingTabActiveName].dataMode = column.dataMode
                     this.fetchData(option[this.pendingTabActiveName])
                 },
-                handleFlowClick(params) {
+                handleFlowClick (params) {
                     params.$alias = this.alias
                     this.emitActionEventHandler('flow', params)
                 },
-                handleCollapseExpand(command, data, actions) {
+                handleCollapseExpand (command, data, actions) {
                     this.bodyShow = !this.bodyShow
                     const index = actions.findIndex((action) => action.key === data.key)
                     actions[index].key = this.bodyShow ? 'collapse' : 'expansion'
@@ -482,17 +481,17 @@ export function buildComponent(name, column, preview, vm) {
                     this.showHeight = this.bodyShow ? this.getHeight() : 0
                     this.$refs['toolbar'].callback(actions)
                 },
-                formValidate(formName) {
+                formValidate (formName) {
                     this.$nextTick(() => {
                         this.$refs[formName].validate(() => { })
                     })
                 },
-                getFormData() {
+                getFormData () {
                     this.quickNavform = JSON.parse(JSON.stringify(this.defaultForm))
                     this.formValidate('quickNavform')
                     this.dialogFormVisible = true
                 },
-                handleNavRemove(navId, i) {
+                handleNavRemove (navId, i) {
                     this.$confirm('是否确认删除该快捷导航?', '提示', {
                         confirmButtonText: '确认',
                         cancelButtonText: '取消',
@@ -507,15 +506,15 @@ export function buildComponent(name, column, preview, vm) {
                     })
                 },
                 // 错误头像的照片
-                errorAvatarHandler(data) {
+                errorAvatarHandler (data) {
                     // data.photo = require('https://cube.elemecdn.com/e/fd/0fc7d20532fdaf769a25683617711png.png')
                     return true
                 },
-                close() {
+                close () {
                     this.$refs[this.formName].resetFields()
                     this.dialogFormVisible = false
                 },
-                saveQuickNav() {
+                saveQuickNav () {
                     this.$refs[this.formName].validate(valid => {
                         if (valid) {
                             addNavigation({ id: '', ...this.quickNavform }).then(res => {
@@ -529,7 +528,7 @@ export function buildComponent(name, column, preview, vm) {
                         }
                     })
                 },
-                handleSortChange() {
+                handleSortChange () {
                     this.isDragging = false
                     const newSort = this.quickNavigationData.map(i => i.id)
                     if (isEqual(this.navigationList, newSort)) {
@@ -541,7 +540,7 @@ export function buildComponent(name, column, preview, vm) {
                     })
                 },
                 // 父组件调用该方法给日程添加数据
-                async setCalendarEvents(param) {
+                async setCalendarEvents (param) {
                     const { name = '' } = this.$store.getters
                     const form = param.form
                     const paramObject = {
@@ -558,7 +557,7 @@ export function buildComponent(name, column, preview, vm) {
                     await saveCalendarInfos(paramObject)
                     this.refreshData()
                 },
-                async hanldeCalendardel(param) {
+                async hanldeCalendardel (param) {
                     if (param.form.id) {
                         await removeCalendarInfos({
                             calendarIds: param.form.id
@@ -567,12 +566,12 @@ export function buildComponent(name, column, preview, vm) {
                     this.refreshData()
                 },
                 // 公告栏是否显示new图标
-                showNewIcon(date, days) {
+                showNewIcon (date, days) {
                     const nowDate = new Date().getTime()
                     const targetDate = new Date(date).getTime()
                     return targetDate + days * 24 * 60 * 60 * 1000 > nowDate
                 },
-                handleOverflow(val, length) {
+                handleOverflow (val, length) {
                     if (val.length > length) {
                         return val.slice(0, length - 2) + '...'
                     }

+ 684 - 684
src/views/system/homepage/index.vue

@@ -1,736 +1,736 @@
 <template>
-  <ibps-container
-    ref="dashboardContainer"
-    v-loading="loading"
-    :element-loading-text="$t('common.loading')"
-    :scroll-delay="scrollDelay"
-    type="full"
-    class="ibps-desktop-page"
-    @scroll="
-      ({ x, y }) => {
-        scrollTop = y;
-      }
-    "
-  >
-    <ibps-back-to-top
-      :visibility-height="150"
-      :scroll-top="scrollTop"
-      transition-name="fade"
-      @scrollToTop="scrollToTop"
-    />
-    <preview
-      :id="id"
-      :visible="dialogPreviewVisible"
-      title="全屏预览"
-      screen
-      @close="(visible) => (dialogPreviewVisible = visible)"
-    />
-    <bpmn-formrender
-      :visible="bpmnFormrenderDialogVisible"
-      :def-id="defId"
-      :task-id="taskId"
-      :instance-id="instanceId"
-      :title="flowName"
-      @close="(visible) => (bpmnFormrenderDialogVisible = visible)"
-      @callback="handleFlowCallback"
-    />
+    <ibps-container
+        ref="dashboardContainer"
+        v-loading="loading"
+        :element-loading-text="$t('common.loading')"
+        :scroll-delay="scrollDelay"
+        type="full"
+        class="ibps-desktop-page"
+        @scroll="
+            ({ x, y }) => {
+                scrollTop = y;
+            }
+        "
+    >
+        <ibps-back-to-top
+            :visibility-height="150"
+            :scroll-top="scrollTop"
+            transition-name="fade"
+            @scrollToTop="scrollToTop"
+        />
+        <preview
+            :id="id"
+            :visible="dialogPreviewVisible"
+            title="全屏预览"
+            screen
+            @close="(visible) => (dialogPreviewVisible = visible)"
+        />
+        <bpmn-formrender
+            :visible="bpmnFormrenderDialogVisible"
+            :def-id="defId"
+            :task-id="taskId"
+            :instance-id="instanceId"
+            :title="flowName"
+            @close="(visible) => (bpmnFormrenderDialogVisible = visible)"
+            @callback="handleFlowCallback"
+        />
 
-    <ibps-news-dialog
-      :id="newsEditId"
-      :title="newsTitle"
-      :visible="ibpsNewsDialogVisible"
-      :readonly="true"
-      @close="(visible) => (ibpsNewsDialogVisible = visible)"
-    />
+        <ibps-news-dialog
+            :id="newsEditId"
+            :title="newsTitle"
+            :visible="ibpsNewsDialogVisible"
+            :readonly="true"
+            @close="(visible) => (ibpsNewsDialogVisible = visible)"
+        />
 
-    <ibps-message-dialog
-      :id="messageEditId"
-      title="消息明细"
-      :table-id="messageTableId"
-      :table-name="messageTableName"
-      :readonly="true"
-      :visible="ibpsMessageDialogVisible"
-      @callback="handleMessageCallback"
-      @close="(visible) => (ibpsMessageDialogVisible = visible)"
-    />
-    <div v-if="initLoading">
-      <template v-if="localSystem">
-        <ibps-grid-layout
-          v-if="layout && layout.length > 0"
-          :layout.sync="layout"
-          :col-num="colNum"
-          :row-height="rowHeight"
-          :is-draggable="isDraggable"
-          :is-resizable="isResizable"
-          :is-mirrored="isMirrored"
-          :vertical-compact="verticalCompact"
-          :margin="margin"
-          :use-css-transforms="useCssTransforms"
-        >
-          <ibps-grid-item
-            v-for="(item, index) in layout"
-            :key="item.i"
-            :x="item.x"
-            :y="item.y"
-            :w="item.w"
-            :h="item.h"
-            :i="item.i"
-          >
-            <component
-              :is="'ibps-desktop-' + item.alias"
-              v-if="hasComponent(item.alias)"
-              :id="item.i"
-              :ref="item.alias"
-              :alias="item.alias"
-              :height="getHeight(item.h)"
-              :add-component-datas="addComponentDatas"
-              @open="handleOpen"
-              @close="handleClose"
-              @action-event="
-                (command, data) => handleActionEvent(command, data, index)
-              "
-            />
-          </ibps-grid-item>
-        </ibps-grid-layout>
-        <el-alert
-          v-else-if="!loading"
-          :closable="false"
-          type="warning"
-          show-icon
-          style="height: 50px"
-        >
-          <span slot="title"
-            >未设置个人桌面布局,可以通过“<a
-              href="javascript:void(0)"
-              @click="goMyLayout"
-              >个人办公-》个人桌面布局</a
-            >”进行设置</span
-          >
-        </el-alert>
-      </template>
-      <!--不是本地系统-->
-      <template v-else>
-        <!--iframe方式-->
-        <iframe
-          v-if="systemUrlType === 'iframe'"
-          ref="systemrender"
-          class="ibps-container-frame"
-          frameborder="0"
+        <ibps-message-dialog
+            :id="messageEditId"
+            title="消息明细"
+            :table-id="messageTableId"
+            :table-name="messageTableName"
+            :readonly="true"
+            :visible="ibpsMessageDialogVisible"
+            @callback="handleMessageCallback"
+            @close="(visible) => (ibpsMessageDialogVisible = visible)"
         />
-        <!--vue组件方式-->
-        <component
-          :is="systemUrlName"
-          v-else
-          ref="systemrender"
-          :params="systemUrlParams"
+        <div v-if="initLoading">
+            <template v-if="localSystem">
+                <ibps-grid-layout
+                    v-if="layout && layout.length > 0"
+                    :layout.sync="layout"
+                    :col-num="colNum"
+                    :row-height="rowHeight"
+                    :is-draggable="isDraggable"
+                    :is-resizable="isResizable"
+                    :is-mirrored="isMirrored"
+                    :vertical-compact="verticalCompact"
+                    :margin="margin"
+                    :use-css-transforms="useCssTransforms"
+                >
+                    <ibps-grid-item
+                        v-for="(item, index) in layout"
+                        :key="item.i"
+                        :x="item.x"
+                        :y="item.y"
+                        :w="item.w"
+                        :h="item.h"
+                        :i="item.i"
+                    >
+                        <component
+                            :is="'ibps-desktop-' + item.alias"
+                            v-if="hasComponent(item.alias)"
+                            :id="item.i"
+                            :ref="item.alias"
+                            :alias="item.alias"
+                            :height="getHeight(item.h)"
+                            :add-component-datas="addComponentDatas"
+                            @open="handleOpen"
+                            @close="handleClose"
+                            @action-event="
+                                (command, data) => handleActionEvent(command, data, index)
+                            "
+                        />
+                    </ibps-grid-item>
+                </ibps-grid-layout>
+                <el-alert
+                    v-else-if="!loading"
+                    :closable="false"
+                    type="warning"
+                    show-icon
+                    style="height: 50px"
+                >
+                    <span
+                        slot="title"
+                    >未设置个人桌面布局,可以通过“<a
+                        href="javascript:void(0)"
+                        @click="goMyLayout"
+                    >个人办公-》个人桌面布局</a>”进行设置</span>
+                </el-alert>
+            </template>
+            <!--不是本地系统-->
+            <template v-else>
+                <!--iframe方式-->
+                <iframe
+                    v-if="systemUrlType === 'iframe'"
+                    ref="systemrender"
+                    class="ibps-container-frame"
+                    frameborder="0"
+                />
+                <!--vue组件方式-->
+                <component
+                    :is="systemUrlName"
+                    v-else
+                    ref="systemrender"
+                    :params="systemUrlParams"
+                />
+            </template>
+        </div>
+        <schedule-add
+            :visible="calendarDialogVisible"
+            :form="calendarDialogForm"
+            @close="handleClose"
+            @saveData="handleSaveData"
+            @delData="handleDelData"
         />
-      </template>
-    </div>
-    <schedule-add
-      :visible="calendarDialogVisible"
-      :form="calendarDialogForm"
-      @close="handleClose"
-      @saveData="handleSaveData"
-      @delData="handleDelData"
-    />
-    <CalendarAlert
-      :calendarAlertData="calendarAlertData"
-      ref="calendarRef"
-      @onCalendarAlert="onCalendarAlert"
-    ></CalendarAlert>
-  </ibps-container>
+        <CalendarAlert
+            ref="calendarRef"
+            :calendar-alert-data="calendarAlertData"
+            @onCalendarAlert="onCalendarAlert"
+        />
+    </ibps-container>
 </template>
 
 <script>
-import { getMyDesktop } from "@/api/platform/desktop/myLayout";
+import { getMyDesktop } from '@/api/platform/desktop/myLayout'
 import {
-  initColumn,
-  isInit,
-  getComponents,
-} from "@/views/system/dashboard/components";
+    initColumn,
+    isInit,
+    getComponents
+} from '@/views/system/dashboard/components'
 // 引用导出地址
-import { BASE_API, BUSINESS_BASE_URL } from "@/api/baseUrl";
+import { BASE_API, BUSINESS_BASE_URL } from '@/api/baseUrl'
 //  网格布局组件
-import { GridLayout, GridItem } from "vue-grid-layout";
-import IbpsBackToTop from "@/components/ibps-back-to-top";
-import Preview from "@/views/platform/desktop/column/preview";
-import BpmnFormrender from "@/business/platform/bpmn/form/dialog";
+import { GridLayout, GridItem } from 'vue-grid-layout'
+import IbpsBackToTop from '@/components/ibps-back-to-top'
+import Preview from '@/views/platform/desktop/column/preview'
+import BpmnFormrender from '@/business/platform/bpmn/form/dialog'
 
-import IbpsNewsDialog from "@/views/platform/system/news/detail";
-import IbpsMessageDialog from "@/views/platform/message/inner/detail/dialog";
-import { getToken } from "@/utils/auth";
-import ScheduleAdd from "@/views/system/dashboard/templates/scheduleAdd";
+import IbpsNewsDialog from '@/views/platform/system/news/detail'
+import IbpsMessageDialog from '@/views/platform/message/inner/detail/dialog'
+import { getToken } from '@/utils/auth'
+import ScheduleAdd from '@/views/system/dashboard/templates/scheduleAdd'
 
 // 标记日历已读
-import { markReadCalendar } from "@/api/detection/newHomeApi";
+import { markReadCalendar } from '@/api/detection/newHomeApi'
 // 日程提醒弹窗组件
-import CalendarAlert from "@/views/system/dashboard/components/calendar-alert.vue";
+import CalendarAlert from '@/views/system/dashboard/components/calendar-alert.vue'
 
-const _import = require("@/utils/util.import." + process.env.NODE_ENV);
+const _import = require('@/utils/util.import.' + process.env.NODE_ENV)
 export default {
-  components: {
-    "ibps-news-dialog": IbpsNewsDialog,
-    "ibps-message-dialog": IbpsMessageDialog,
-    IbpsBackToTop,
-    Preview,
-    BpmnFormrender,
-    "ibps-grid-layout": GridLayout,
-    "ibps-grid-item": GridItem,
-    ScheduleAdd,
-    CalendarAlert,
-  },
-  data() {
-    return {
-      infoMessage: [],
-      uloadPath: BASE_API() + BUSINESS_BASE_URL() + "/ck/task/importExcel",
-      reportPath:
+    components: {
+        'ibps-news-dialog': IbpsNewsDialog,
+        'ibps-message-dialog': IbpsMessageDialog,
+        IbpsBackToTop,
+        Preview,
+        BpmnFormrender,
+        'ibps-grid-layout': GridLayout,
+        'ibps-grid-item': GridItem,
+        ScheduleAdd,
+        CalendarAlert
+    },
+    data () {
+        return {
+            infoMessage: [],
+            uloadPath: BASE_API() + BUSINESS_BASE_URL() + '/ck/task/importExcel',
+            reportPath:
         BASE_API() +
         BUSINESS_BASE_URL() +
-        "/sys/SysDataContext/replaceReportFile",
-      layout: null,
-      colNum: 24,
-      rowHeight: 30,
-      isDraggable: false,
-      isResizable: false,
-      isMirrored: false,
-      verticalCompact: true,
-      margin: [15, 15],
-      useCssTransforms: true,
-      taskId: "",
-      flowName: "",
-      ibpsNewsDialogVisible: false,
-      newsEditId: "",
-      newsTitle: "公告明细",
-      showRepost: true,
+        '/sys/SysDataContext/replaceReportFile',
+            layout: null,
+            colNum: 24,
+            rowHeight: 30,
+            isDraggable: false,
+            isResizable: false,
+            isMirrored: false,
+            verticalCompact: true,
+            margin: [15, 15],
+            useCssTransforms: true,
+            taskId: '',
+            flowName: '',
+            ibpsNewsDialogVisible: false,
+            newsEditId: '',
+            newsTitle: '公告明细',
+            showRepost: true,
 
-      ibpsMessageDialogVisible: false,
-      messageEditId: "",
-      messageTableId: "",
-      messageTableName: "",
+            ibpsMessageDialogVisible: false,
+            messageEditId: '',
+            messageTableId: '',
+            messageTableName: '',
 
-      scrollDelay: 0,
-      scrollTop: 0,
-      initLoading: false,
-      loading: false,
-      id: "",
-      dialogPreviewVisible: false, // 预览
-      defaultData: [],
+            scrollDelay: 0,
+            scrollTop: 0,
+            initLoading: false,
+            loading: false,
+            id: '',
+            dialogPreviewVisible: false, // 预览
+            defaultData: [],
 
-      bpmnFormrenderDialogVisible: false, // 流程
-      defId: "",
-      instanceId: "",
-      layoutIndex: "",
-      initInterval: null,
+            bpmnFormrenderDialogVisible: false, // 流程
+            defId: '',
+            instanceId: '',
+            layoutIndex: '',
+            initInterval: null,
 
-      systemUrlType: "iframe",
-      systemUrlName: "",
-      systemUrlParams: {},
-      alias: "",
-      headers: {
-        "X-Authorization-access_token": getToken(),
-      },
-      scheduledTask: false,
-      calendarDialogVisible: false,
-      calendarDialogForm: {},
-      addComponentDatas: {},
-      calendarAlertData: {}, // 日程
-      calendarIds: [], // 日程 id 数组
-    };
-  },
-  computed: {
-    system() {
-      return this.$store.getters.system ? this.$store.getters.system : null;
-    },
-    systemAlias() {
-      return this.$store.getters.system ? this.$store.getters.system.alias : "";
-    },
-    localSystem() {
-      return this.system.isLocal;
-    },
-  },
-  mounted() {
-    if (localStorage.getItem("statistic") === "isNormal") {
-      this.showRepost = false;
-    }
-    this.initLoading = false;
-    this.initData();
-  },
-  created() {
-    const today = new Date().toLocaleDateString();
-    const savedDate = localStorage.getItem("doNotShowToday");
-    if (savedDate !== today) {
-      // this.getPeriodTask()
-    }
-  },
-  beforeDestroy() {
-    for (let i = 0; i < this.infoMessage.length; i++) {
-      this.infoMessage[i].close();
-    }
-  },
-  methods: {
-    cancelInfo(cronId, title, num, processData, taskId) {
-      /* 调用流程*/
-      if (taskId) {
-        this.$router.push({
-          name: "pendingItems",
-        });
-      } else if (processData) {
-        this.defId = processData;
-        this.bpmnFormrenderDialogVisible = true;
-      }
-      this.infoMessage[num].close();
-    },
-    downloadData() {
-      window.location.href =
-        BASE_API() + BUSINESS_BASE_URL() + "/sys/SysDataContext/downloadData";
-    },
-    scrollToTop() {
-      this.$refs.dashboardContainer.scrollToTop();
-    },
-    initData() {
-      this.initInterval = setInterval(() => {
-        if (this.$utils.isNotEmpty(this.systemAlias)) {
-          this.initLoading = true;
-          if (this.localSystem) {
-            this.fetchData();
-          } else {
-            this.initSystemUrl(this.system.homePage);
-          }
-          clearInterval(this.initInterval);
+            systemUrlType: 'iframe',
+            systemUrlName: '',
+            systemUrlParams: {},
+            alias: '',
+            headers: {
+                'X-Authorization-access_token': getToken()
+            },
+            scheduledTask: false,
+            calendarDialogVisible: false,
+            calendarDialogForm: {},
+            addComponentDatas: {},
+            calendarAlertData: {}, // 日程
+            calendarIds: [] // 日程 id 数组
         }
-      }, 100);
     },
-    // 抓取数据
-    fetchData() {
-      initColumn(this.systemAlias, this);
-      this.loading = true;
-      const interval = setInterval(() => {
-        if (isInit()) {
-          getMyDesktop({
-            systemAlias: this.systemAlias,
-          })
-            .then((response) => {
-              try {
-                this.layout = this.$utils.parseData(response.data);
-                this.defaultData = this.$utils.parseData(response.data);
-              } catch (error) {
-                this.layout = [];
-                this.defaultData = [];
-              }
-              this.loading = false;
-            })
-            .catch(() => {
-              this.loading = false;
-            });
-          clearInterval(interval);
+    computed: {
+        system () {
+            return this.$store.getters.system ? this.$store.getters.system : null
+        },
+        systemAlias () {
+            return this.$store.getters.system ? this.$store.getters.system.alias : ''
+        },
+        localSystem () {
+            return this.system.isLocal
         }
-      }, 100);
     },
-    getHeight(h) {
-      // if (document.body.clientWidth > 1366 && document.body.clientWidth < 1920) {
-      //     const mH = (1920 - 1366) / (33 - 23)
-      //     this.rowHeight = ((document.body.clientWidth - 1366) / mH) + 23
-      //     // let mH = (1925-768)/(33-23)
-      //     // this.rowHeight=((document.body.clientWidth-768)/mH)+17
-      //     // console.log(this.rowHeight)
-      // } else if (document.body.clientWidth <= 1366) {
-      //     this.rowHeight = 23
-      // }
-      return (h - 1) * (this.rowHeight + this.margin[1]) + this.margin[1];
-    },
-    hasComponent(alias) {
-      const name = "ibps-desktop-" + alias;
-      const components = getComponents();
-      if (components) {
-        return components.includes(name);
-      } else {
-        return false;
-      }
-    },
-    resizedHandler(i, newH, newW, newHPx, newWPx) {
-      if (!this.layout) return;
-      this.layout.layout.find((n) => {
-        if (i === n.i) {
-          n.widthPx = this.getWidth(n.w);
-          n.heightPx = this.getHeight(n.h);
+    mounted () {
+        if (localStorage.getItem('statistic') === 'isNormal') {
+            this.showRepost = false
+        }
+        this.initLoading = false
+        this.initData()
+    },
+    created () {
+        const today = new Date().toLocaleDateString()
+        const savedDate = localStorage.getItem('doNotShowToday')
+        if (savedDate !== today) {
+            // this.getPeriodTask()
         }
-      });
-    },
-    goMyLayout() {
-      this.$router.push({ path: "/officeDesk/grzlsw/desktopMyLayout" });
     },
-    handleActionEvent(command, params, index) {
-      this.layoutIndex = index;
-      this.alias = params.$alias;
-      switch (command) {
-        case "fullscreen":
-          this.handleFullscreen(params.id);
-          break;
-        case "collapse":
-        case "expansion":
-          this.handleCollapseExpansion(index, command === "collapse");
-          break;
-        case "flow":
-          this.handleFlow(params);
-          break;
-        case "approve":
-          this.handleApprove(params);
-          break;
-        case "unRead":
-          this.handleUnreadMessage(params);
-          break;
-        case "calendarAlert":
-          this.handleCalendarAlert(params);
-        default:
-          break;
-      }
+    beforeDestroy () {
+        for (let i = 0; i < this.infoMessage.length; i++) {
+            this.infoMessage[i].close()
+        }
     },
-    /**
+    methods: {
+        cancelInfo (cronId, title, num, processData, taskId) {
+            /* 调用流程*/
+            if (taskId) {
+                this.$router.push({
+                    name: 'pendingItems'
+                })
+            } else if (processData) {
+                this.defId = processData
+                this.bpmnFormrenderDialogVisible = true
+            }
+            this.infoMessage[num].close()
+        },
+        downloadData () {
+            window.location.href =
+        BASE_API() + BUSINESS_BASE_URL() + '/sys/SysDataContext/downloadData'
+        },
+        scrollToTop () {
+            this.$refs.dashboardContainer.scrollToTop()
+        },
+        initData () {
+            this.initInterval = setInterval(() => {
+                if (this.$utils.isNotEmpty(this.systemAlias)) {
+                    this.initLoading = true
+                    if (this.localSystem) {
+                        this.fetchData()
+                    } else {
+                        this.initSystemUrl(this.system.homePage)
+                    }
+                    clearInterval(this.initInterval)
+                }
+            }, 100)
+        },
+        // 抓取数据
+        fetchData () {
+            initColumn(this.systemAlias, this)
+            this.loading = true
+            const interval = setInterval(() => {
+                if (isInit()) {
+                    getMyDesktop({
+                        systemAlias: this.systemAlias
+                    })
+                        .then((response) => {
+                            try {
+                                this.layout = this.$utils.parseData(response.data)
+                                this.defaultData = this.$utils.parseData(response.data)
+                            } catch (error) {
+                                this.layout = []
+                                this.defaultData = []
+                            }
+                            this.loading = false
+                        })
+                        .catch(() => {
+                            this.loading = false
+                        })
+                    clearInterval(interval)
+                }
+            }, 100)
+        },
+        getHeight (h) {
+            // if (document.body.clientWidth > 1366 && document.body.clientWidth < 1920) {
+            //     const mH = (1920 - 1366) / (33 - 23)
+            //     this.rowHeight = ((document.body.clientWidth - 1366) / mH) + 23
+            //     // let mH = (1925-768)/(33-23)
+            //     // this.rowHeight=((document.body.clientWidth-768)/mH)+17
+            //     // console.log(this.rowHeight)
+            // } else if (document.body.clientWidth <= 1366) {
+            //     this.rowHeight = 23
+            // }
+            return (h - 1) * (this.rowHeight + this.margin[1]) + this.margin[1]
+        },
+        hasComponent (alias) {
+            const name = 'ibps-desktop-' + alias
+            const components = getComponents()
+            if (components) {
+                return components.includes(name)
+            } else {
+                return false
+            }
+        },
+        resizedHandler (i, newH, newW, newHPx, newWPx) {
+            if (!this.layout) return
+            this.layout.layout.find((n) => {
+                if (i === n.i) {
+                    n.widthPx = this.getWidth(n.w)
+                    n.heightPx = this.getHeight(n.h)
+                }
+            })
+        },
+        goMyLayout () {
+            this.$router.push({ path: '/officeDesk/grzlsw/desktopMyLayout' })
+        },
+        handleActionEvent (command, params, index) {
+            this.layoutIndex = index
+            this.alias = params.$alias
+            switch (command) {
+                case 'fullscreen':
+                    this.handleFullscreen(params.id)
+                    break
+                case 'collapse':
+                case 'expansion':
+                    this.handleCollapseExpansion(index, command === 'collapse')
+                    break
+                case 'flow':
+                    this.handleFlow(params)
+                    break
+                case 'approve':
+                    this.handleApprove(params)
+                    break
+                case 'unRead':
+                    this.handleUnreadMessage(params)
+                    break
+                case 'calendarAlert':
+                    this.handleCalendarAlert(params)
+                    break
+                default:
+                    break
+            }
+        },
+        /**
      * 日程提醒
      */
-    handleCalendarAlert(calendarAlertData) {
-      this.calendarAlertData =
-        calendarAlertData.calendarAlertData.calendarAlertData;
-      this.calendarIds = calendarAlertData.calendarAlertData.calendarIds;
-      if (Object.keys(this.calendarAlertData).length > 0) {
-        this.$refs.calendarRef.open();
-      }
-    },
-    /**
+        handleCalendarAlert (calendarAlertData) {
+            this.calendarAlertData =
+        calendarAlertData.calendarAlertData.calendarAlertData
+            this.calendarIds = calendarAlertData.calendarAlertData.calendarIds
+            if (Object.keys(this.calendarAlertData).length > 0) {
+                this.$refs.calendarRef.open()
+            }
+        },
+        /**
      * 标记日程已读
      */
-    onCalendarAlert(checked) {
-      if (checked) {
-        markReadCalendar({
-          calendarIds: this.calendarIds + "",
-        })
-          .then((res) => {})
-          .catch((err) => {
-            console.log(err);
-          });
-      }
-    },
+        onCalendarAlert (checked) {
+            if (checked) {
+                markReadCalendar({
+                    calendarIds: this.calendarIds + ''
+                })
+                    .then((res) => {})
+                    .catch((err) => {
+                        console.log(err)
+                    })
+            }
+        },
 
-    /**
+        /**
      * 全屏展示切换
      */
-    handleFullscreen(id) {
-      this.dialogPreviewVisible = true;
-      this.id = id;
-    },
-    // 处理收缩/展开
-    handleCollapseExpansion(index, isCollapse) {
-      this.layout[index].h = isCollapse ? 1.34 : this.defaultData[index].h;
-      this.layout.push({ i: "0" });
-      const deleteIndex = this.layout.findIndex((item) => item.i === "0");
-      this.layout.splice(deleteIndex, 1);
-    },
-    handleApprove(params) {
-      this.ibpsNewsDialogVisible = true;
-      this.newsEditId = params.id || params;
-      this.newsTitle = params.title || this.newsTitle;
-    },
-    handleUnreadMessage(params) {
-      this.messageEditId = params.id || params;
-      this.messageTableId = params.tableId || "";
-      this.messageTableName = params.tableName || "";
-      this.ibpsMessageDialogVisible = true;
-    },
-    handleFlow(params) {
-      this.defId = params.defId || null;
-      this.taskId = params.taskId || null;
-      this.instanceId = params.instanceId || null;
-      this.flowName = params.flowName || null;
-      this.bpmnFormrenderDialogVisible = true;
-    },
-    handleFlowCallback() {
-      this.$refs[this.alias] ? this.$refs[this.alias][0].refreshData() : null;
-    },
-    handleMessageCallback(isRead) {
-      if (isRead && this.$refs.unreadMessage) {
-        this.$refs.unreadMessage[0].refreshData();
-      }
-    },
-    initSystemUrl(url) {
-      if (url.startsWith("http")) {
-        this.systemUrlType = "iframe";
-        this.$nextTick(() => {
-          this.$refs.systemrender.src = url;
-          // 传递消息
-          // this.$refs.systemrender.contentWindow.postMessage({ data: this.attributes }, '*')
-        });
-      } else {
-        const component = url.split("?")[0];
-        this.systemUrlParams.attrs = this.urlParse(url);
-        this.systemUrlType = "inner";
-        const systemUrlName = "IbpsBpmnSystemUrl";
-        this.$options.components[systemUrlName] = _import(component);
-        this.systemUrlName = systemUrlName;
-      }
-    },
-    urlParse(str) {
-      const obj = {};
-      if (str.indexOf("?") !== -1) {
-        const str1 = str.split("?")[1].split("&");
-        for (let i = 0; i < str1.length; i++) {
-          const params = str1[i].split("=");
-          obj[params[0]] = params[1];
-        }
-      }
-      return obj;
-    },
-    /* 文件类型*/
-    beforeUpload(file) {
-      var testmsg = file.name.substring(file.name.lastIndexOf(".") + 1);
-      const extension = testmsg === "xls";
-      const extension2 = testmsg === "xlsx";
-      if (!extension && !extension2) {
-        this.$message({
-          message: "上传文件只能是excel格式!",
-          type: "warning",
-        });
-        return false;
-      }
-      return extension || extension2;
-    },
-    /* 文件类型*/
-    ReportBeforeUpload(file) {
-      var testmsg = file.name.substring(file.name.lastIndexOf(".") + 1);
-      const extension = testmsg === "rpx";
-      if (!extension) {
-        this.$message({
-          message: "上传文件只能是rpx格式!",
-          type: "warning",
-        });
-        return false;
-      }
-      return extension;
-    },
+        handleFullscreen (id) {
+            this.dialogPreviewVisible = true
+            this.id = id
+        },
+        // 处理收缩/展开
+        handleCollapseExpansion (index, isCollapse) {
+            this.layout[index].h = isCollapse ? 1.34 : this.defaultData[index].h
+            this.layout.push({ i: '0' })
+            const deleteIndex = this.layout.findIndex((item) => item.i === '0')
+            this.layout.splice(deleteIndex, 1)
+        },
+        handleApprove (params) {
+            this.ibpsNewsDialogVisible = true
+            this.newsEditId = params.id || params
+            this.newsTitle = params.title || this.newsTitle
+        },
+        handleUnreadMessage (params) {
+            this.messageEditId = params.id || params
+            this.messageTableId = params.tableId || ''
+            this.messageTableName = params.tableName || ''
+            this.ibpsMessageDialogVisible = true
+        },
+        handleFlow (params) {
+            this.defId = params.defId || null
+            this.taskId = params.taskId || null
+            this.instanceId = params.instanceId || null
+            this.flowName = params.flowName || null
+            this.bpmnFormrenderDialogVisible = true
+        },
+        handleFlowCallback () {
+            this.$refs[this.alias] ? this.$refs[this.alias][0].refreshData() : null
+        },
+        handleMessageCallback (isRead) {
+            if (isRead && this.$refs.unreadMessage) {
+                this.$refs.unreadMessage[0].refreshData()
+            }
+        },
+        initSystemUrl (url) {
+            if (url.startsWith('http')) {
+                this.systemUrlType = 'iframe'
+                this.$nextTick(() => {
+                    this.$refs.systemrender.src = url
+                    // 传递消息
+                    // this.$refs.systemrender.contentWindow.postMessage({ data: this.attributes }, '*')
+                })
+            } else {
+                const component = url.split('?')[0]
+                this.systemUrlParams.attrs = this.urlParse(url)
+                this.systemUrlType = 'inner'
+                const systemUrlName = 'IbpsBpmnSystemUrl'
+                this.$options.components[systemUrlName] = _import(component)
+                this.systemUrlName = systemUrlName
+            }
+        },
+        urlParse (str) {
+            const obj = {}
+            if (str.indexOf('?') !== -1) {
+                const str1 = str.split('?')[1].split('&')
+                for (let i = 0; i < str1.length; i++) {
+                    const params = str1[i].split('=')
+                    obj[params[0]] = params[1]
+                }
+            }
+            return obj
+        },
+        /* 文件类型*/
+        beforeUpload (file) {
+            var testmsg = file.name.substring(file.name.lastIndexOf('.') + 1)
+            const extension = testmsg === 'xls'
+            const extension2 = testmsg === 'xlsx'
+            if (!extension && !extension2) {
+                this.$message({
+                    message: '上传文件只能是excel格式!',
+                    type: 'warning'
+                })
+                return false
+            }
+            return extension || extension2
+        },
+        /* 文件类型*/
+        ReportBeforeUpload (file) {
+            var testmsg = file.name.substring(file.name.lastIndexOf('.') + 1)
+            const extension = testmsg === 'rpx'
+            if (!extension) {
+                this.$message({
+                    message: '上传文件只能是rpx格式!',
+                    type: 'warning'
+                })
+                return false
+            }
+            return extension
+        },
 
-    handleSuccess(res, file, fileList) {
-      if (res.state === 200) {
-        this.$message({
-          message: "上传数据成功!",
-          type: "success",
-        });
-      } else {
-        this.$message({
-          message: res.message,
-          type: "error",
-        });
-      }
-    },
-    getPeriodTask() {
-      const { userId, role = [] } = this.$store.getters;
-      const roles = role.map((i) => i.id);
-      const sql = `select * from t_zqswtxb where shi_fou_ti_xing_ = '是' and (zhi_xing_ren_yuan like '%${userId}%' or find_in_set(zhi_xing_jiao_se_, '${roles.join(
-        ","
-      )}')) order by field(zhi_xing_zhou_qi_, '1次/天', '1次/周', '1次/月', '1次/季度', '1次/半年', '1次/年')`;
-      this.$common
-        .request("sql", sql)
-        .then((res) => {
-          const { data = [] } = res.variables || {};
-          if (data.length) {
-            this.showMsg(data);
-          }
-        })
-        .catch((error) => {
-          this.$message.error("获取周期事务信息失败!");
-          console.log(error);
-        });
-    },
-    showMsg(data) {
-      const h = this.$createElement;
-      const text = {
-        "1次/天": "本日",
-        "1次/周": "本周",
-        "1次/月": "本月",
-        "1次/季度": "本季度",
-        "1次/半年": "近半年",
-        "1次/年": "本年度",
-      };
-      const result = data.reduce((acc, item) => {
-        const key = item.zhi_xing_zhou_qi_;
-        if (!acc[key]) {
-          acc[key] = [];
-        }
-        acc[key].push({
-          name: item.shi_wu_ming_cheng,
-          path: item.ye_mian_lu_jing_,
-        });
-        return acc;
-      }, {});
-      const msg = [];
-      const doNotShowBtn = h(
-        "el-button",
-        {
-          attrs: {
-            size: "mini",
-            type: "primary",
-            plain: true,
-          },
-          on: {
-            click: () => {
-              this.doNotShowToday();
-            },
-          },
-        },
-        "今日不再提示"
-      );
-      const confirmBtn = h(
-        "el-button",
-        {
-          attrs: {
-            size: "mini",
-            type: "success",
-            plain: true,
-          },
-          on: {
-            click: () => {
-              this.infoMessage.close();
-            },
-          },
-        },
-        "确认"
-      );
-      Object.keys(result).forEach((key) => {
-        // msg.push(h('p', {style: {
-        //     'font-weight': 'bold',
-        //     'color': '#666',
-        //     'font-size': '16px'
-        // }}, key))
-        // result[key].forEach(i => {
-        //     msg.push(h('span', null, i))
-        //     msg.push(h('br'))
-        // })
-        const ul = [text[key]];
-        result[key].forEach((i) => {
-          ul.push(
-            h(
-              "li",
-              {
-                style: {
-                  "font-weight": "normal",
-                  color: "#666",
-                  "font-size": "14px",
-                  cursor: "pointer",
+        handleSuccess (res, file, fileList) {
+            if (res.state === 200) {
+                this.$message({
+                    message: '上传数据成功!',
+                    type: 'success'
+                })
+            } else {
+                this.$message({
+                    message: res.message,
+                    type: 'error'
+                })
+            }
+        },
+        getPeriodTask () {
+            const { userId, role = [] } = this.$store.getters
+            const roles = role.map((i) => i.id)
+            const sql = `select * from t_zqswtxb where shi_fou_ti_xing_ = '是' and (zhi_xing_ren_yuan like '%${userId}%' or find_in_set(zhi_xing_jiao_se_, '${roles.join(
+                ','
+            )}')) order by field(zhi_xing_zhou_qi_, '1次/天', '1次/周', '1次/月', '1次/季度', '1次/半年', '1次/年')`
+            this.$common
+                .request('sql', sql)
+                .then((res) => {
+                    const { data = [] } = res.variables || {}
+                    if (data.length) {
+                        this.showMsg(data)
+                    }
+                })
+                .catch((error) => {
+                    this.$message.error('获取周期事务信息失败!')
+                    console.log(error)
+                })
+        },
+        showMsg (data) {
+            const h = this.$createElement
+            const text = {
+                '1次/天': '本日',
+                '1次/周': '本周',
+                '1次/月': '本月',
+                '1次/季度': '本季度',
+                '1次/半年': '近半年',
+                '1次/年': '本年度'
+            }
+            const result = data.reduce((acc, item) => {
+                const key = item.zhi_xing_zhou_qi_
+                if (!acc[key]) {
+                    acc[key] = []
+                }
+                acc[key].push({
+                    name: item.shi_wu_ming_cheng,
+                    path: item.ye_mian_lu_jing_
+                })
+                return acc
+            }, {})
+            const msg = []
+            const doNotShowBtn = h(
+                'el-button',
+                {
+                    attrs: {
+                        size: 'mini',
+                        type: 'primary',
+                        plain: true
+                    },
+                    on: {
+                        click: () => {
+                            this.doNotShowToday()
+                        }
+                    }
                 },
-                on: {
-                  click: () => {
-                    this.infoMessage.close();
-                    this.$router.push(i.path);
-                  },
+                '今日不再提示'
+            )
+            const confirmBtn = h(
+                'el-button',
+                {
+                    attrs: {
+                        size: 'mini',
+                        type: 'success',
+                        plain: true
+                    },
+                    on: {
+                        click: () => {
+                            this.infoMessage.close()
+                        }
+                    }
                 },
-              },
-              i.name
+                '确认'
             )
-          );
-        });
-        msg.push(
-          h(
-            "ul",
-            {
-              style: {
-                "font-weight": "bold",
-                color: "#000",
-                "font-size": "16px",
-                margin: "0",
-                padding: "0",
-                "margin-bottom": "5px",
-              },
-            },
-            ul
-          )
-        );
-      });
-      msg.push(doNotShowBtn, confirmBtn);
-      window.setTimeout(() => {
-        this.infoMessage = this.$notify({
-          title: "以下是您的周期性事务提示",
-          message: h("div", null, msg),
-          duration: 0,
-          iconClass: "el-icon-bell",
-          showClose: false,
-        });
-      }, 0);
-    },
-    doNotShowToday() {
-      const today = new Date().toLocaleDateString();
-      localStorage.setItem("doNotShowToday", today);
-      this.infoMessage.close();
-    },
-    /**
+            Object.keys(result).forEach((key) => {
+                // msg.push(h('p', {style: {
+                //     'font-weight': 'bold',
+                //     'color': '#666',
+                //     'font-size': '16px'
+                // }}, key))
+                // result[key].forEach(i => {
+                //     msg.push(h('span', null, i))
+                //     msg.push(h('br'))
+                // })
+                const ul = [text[key]]
+                result[key].forEach((i) => {
+                    ul.push(
+                        h(
+                            'li',
+                            {
+                                style: {
+                                    'font-weight': 'normal',
+                                    color: '#666',
+                                    'font-size': '14px',
+                                    cursor: 'pointer'
+                                },
+                                on: {
+                                    click: () => {
+                                        this.infoMessage.close()
+                                        this.$router.push(i.path)
+                                    }
+                                }
+                            },
+                            i.name
+                        )
+                    )
+                })
+                msg.push(
+                    h(
+                        'ul',
+                        {
+                            style: {
+                                'font-weight': 'bold',
+                                color: '#000',
+                                'font-size': '16px',
+                                margin: '0',
+                                padding: '0',
+                                'margin-bottom': '5px'
+                            }
+                        },
+                        ul
+                    )
+                )
+            })
+            msg.push(doNotShowBtn, confirmBtn)
+            window.setTimeout(() => {
+                this.infoMessage = this.$notify({
+                    title: '以下是您的周期性事务提示',
+                    message: h('div', null, msg),
+                    duration: 0,
+                    iconClass: 'el-icon-bell',
+                    showClose: false
+                })
+            }, 0)
+        },
+        doNotShowToday () {
+            const today = new Date().toLocaleDateString()
+            localStorage.setItem('doNotShowToday', today)
+            this.infoMessage.close()
+        },
+        /**
      * 关于预览日历日程组件的方法及属性,在预览处也有相同的逻辑
      */
-    // 关闭指定弹框
-    handleClose(state) {
-      switch (state) {
-        case "calendar":
-          this.calendarDialogVisible = false;
-          break;
-        default:
-          break;
-      }
-    },
-    // 打开指定弹框
-    handleOpen(state, dateArr, events, clickId) {
-      const status = ["急", "重", "轻", "缓"];
-      const eventTrees = [];
-      switch (state) {
-        case "calendar":
-          this.calendarDialogVisible = true;
-          for (const i of events) {
-            // 根据指定日期A获取A在时间区间内的数据
-            if (
-              !(
-                this.compareDates(i.start, dateArr[1]) > 0 ||
+        // 关闭指定弹框
+        handleClose (state) {
+            switch (state) {
+                case 'calendar':
+                    this.calendarDialogVisible = false
+                    break
+                default:
+                    break
+            }
+        },
+        // 打开指定弹框
+        handleOpen (state, dateArr, events, clickId) {
+            const status = ['急', '重', '轻', '缓']
+            const eventTrees = []
+            switch (state) {
+                case 'calendar':
+                    this.calendarDialogVisible = true
+                    for (const i of events) {
+                        // 根据指定日期A获取A在时间区间内的数据
+                        if (
+                            !(
+                                this.compareDates(i.start, dateArr[1]) > 0 ||
                 this.compareDates(i.jieShuShiJian, dateArr[0]) < 0
-              )
-            ) {
-              i.label = i.zhuangTai
-                ? `【${
-                    status[Number(i.zhuangTai) - 1]
-                      ? status[Number(i.zhuangTai) - 1]
-                      : ""
-                  }】` + i.title
-                : i.title;
-              eventTrees.push(i);
+                            )
+                        ) {
+                            i.label = i.zhuangTai
+                                ? `【${
+                                    status[Number(i.zhuangTai) - 1]
+                                        ? status[Number(i.zhuangTai) - 1]
+                                        : ''
+                                }】` + i.title
+                                : i.title
+                            eventTrees.push(i)
+                        }
+                    }
+                    this.calendarDialogForm = {
+                        eventTrees: eventTrees.length ? eventTrees : []
+                    }
+                    this.calendarDialogForm.clickedDate = dateArr[0]
+                    this.calendarDialogForm.clickId = clickId
+                    break
+                default:
+                    break
             }
-          }
-          this.calendarDialogForm = {
-            eventTrees: eventTrees.length ? eventTrees : [],
-          };
-          this.calendarDialogForm.clickedDate = dateArr[0];
-          this.calendarDialogForm.clickId = clickId;
-          break;
-        default:
-          break;
-      }
-    },
-    /**
+        },
+        /**
      * date1(2024-01-01) 大于 date2(2023-01-01) 返回 1
      * date1 小于 date2 返回 -1
      * date1 等于 date2 返回 0
      */
-    compareDates(date1, date2) {
-      var time1 = new Date(date1).getTime();
-      var time2 = new Date(date2).getTime();
-      return Math.sign(time1 - time2); // 使用Math.sign()函数返回值为 -1, 0, 1
-    },
-    // 日历弹框组件保存时候的回调
-    handleSaveData(param) {
-      if (param.state === "calendar") {
-        this.$refs.myCalendar[0].setCalendarEvents(param);
-      }
-    },
-    // 日历弹框组件删除日程时候的回调
-    handleDelData(param) {
-      if (param.state === "calendar") {
-        this.$refs.myCalendar[0].hanldeCalendardel(param);
-      }
-    },
-  },
-};
+        compareDates (date1, date2) {
+            var time1 = new Date(date1).getTime()
+            var time2 = new Date(date2).getTime()
+            return Math.sign(time1 - time2) // 使用Math.sign()函数返回值为 -1, 0, 1
+        },
+        // 日历弹框组件保存时候的回调
+        handleSaveData (param) {
+            if (param.state === 'calendar') {
+                this.$refs.myCalendar[0].setCalendarEvents(param)
+            }
+        },
+        // 日历弹框组件删除日程时候的回调
+        handleDelData (param) {
+            if (param.state === 'calendar') {
+                this.$refs.myCalendar[0].hanldeCalendardel(param)
+            }
+        }
+    }
+}
 </script>
 
 <style lang="scss" scoped>