Просмотр исходного кода

fix: 5449 多人并行 受控文件查阅提示框遮挡历史信息&文件发放无法确认,且催办有Bug

johnsen 6 месяцев назад
Родитель
Сommit
9bd5778391

+ 1 - 0
src/business/platform/data/templaterender/utils/JDialogTemplate.js

@@ -27,6 +27,7 @@ _.extend(JDialog, {
     // 初始化表单
     _init: function (template) {
         if (this._isInitialization) return
+        this.$message = template.$message
         this.$template = template
         this.$vue = Vue
         this.$request = request

+ 1 - 0
src/business/platform/data/templaterender/utils/JTemplate.js

@@ -28,6 +28,7 @@ _.extend(JTemplate, {
     _init: function (template) {
         if (this._isInitialization) return
         this.$template = template
+        this.$message = template.$message
         this.$vue = Vue
         this.$request = request
         this.$dialog = dialog

+ 1 - 0
src/business/platform/form/utils/JForm.js

@@ -31,6 +31,7 @@ _.extend(JForm, {
         this.$vue = Vue
         this.$request = request
         this.$dialog = dialog
+        this.$message = form.$message
         this.$common = common
         this.$router = router
         this.$store = store

+ 688 - 715
src/views/component/fileTraining/index.vue

@@ -7,7 +7,7 @@
  * @LastEditTime: 2024-04-26 16:04:02
 -->
 <template>
-    <!-- <el-dialog
+  <!-- <el-dialog
         :visible.sync="dialogVisible"
         fullscreen
         :title="title"
@@ -19,168 +19,141 @@
         </div>
     </el-dialog> -->
 
-    <!--个人修改  -->
-    <el-dialog
-        :visible.sync="dialogVisible"
-        fullscreen
-        append-to-body
-        custom-class="ibps-file-preview-dialog"
-        :show-close="false"
-    >
-        <template #title>
-            <el-row>
-                <el-col :span="11" class="titleHander">{{ title }}</el-col>
-                <el-col
-                    :span="3"
-                    class="read"
-                    style="text-align: right"
-                >阅读量:{{ lookNum }}</el-col>
-                <el-col :span="10" style="text-align: right">
-                    <el-popover
-                        v-model="deleteVisible"
-                        placement="top"
-                        width="160"
-                    >
-                        <p>文件删除之后将不能查看,确定要删除该文件吗?</p>
-                        <div style="text-align: right; margin: 0">
-                            <el-button
-                                size="mini"
-                                type="text"
-                                @click="deleteVisible = false"
-                            >取消</el-button>
-                            <el-button
-                                type="primary"
-                                size="mini"
-                                @click="deleteFile"
-                            >确定</el-button>
+  <!--个人修改  -->
+  <el-dialog
+    :visible.sync="dialogVisible"
+    fullscreen
+    append-to-body
+    custom-class="ibps-file-preview-dialog"
+    :show-close="false"
+  >
+    <template #title>
+      <el-row>
+        <el-col :span="11" class="titleHander">{{ title }}</el-col>
+        <el-col :span="3" class="read" style="text-align: right"
+          >阅读量:{{ lookNum }}</el-col
+        >
+        <el-col :span="10" style="text-align: right">
+          <el-popover v-model="deleteVisible" placement="top" width="160">
+            <p>文件删除之后将不能查看,确定要删除该文件吗?</p>
+            <div style="text-align: right; margin: 0">
+              <el-button size="mini" type="text" @click="deleteVisible = false"
+                >取消</el-button
+              >
+              <el-button type="primary" size="mini" @click="deleteFile"
+                >确定</el-button
+              >
+            </div>
+            <el-button
+              v-if="deleteShow"
+              slot="reference"
+              type="danger"
+              icon="el-icon-delete"
+              class="deleteBtn"
+              @click="deleteVisible = true"
+              >删除</el-button
+            >
+          </el-popover>
+          <el-button type="primary" icon="el-icon-view" @click="lookFile"
+            >查看文件信息</el-button
+          >
+          <el-button type="primary" icon="el-icon-s-fold" @click="hideLeft">{{
+            leftContent
+          }}</el-button>
+          <el-button
+            v-if="updateShow"
+            type="primary"
+            icon="el-icon-download"
+            @click="updateFile"
+            >下载文件</el-button
+          >
+          <el-button type="danger" icon="el-icon-close" @click="closeDialog"
+            >关闭</el-button
+          >
+        </el-col>
+      </el-row>
+    </template>
+    <div>
+      <el-row>
+        <el-col v-if="leftShow" :span="4" class="left-content">
+          <div class="left-title">文件修订历史</div>
+          <el-timeline :reverse="reverse">
+            <el-timeline-item
+              v-for="(activity, index) in leftData"
+              :key="index"
+              :timestamp="'发布日期:' + activity.fa_bu_shi_jian_"
+              :type="index === activeIndex ? type : ''"
+              @click.stop.native="toggleActive(activity, index)"
+            >
+              <div class="timeline-content">
+                <el-tooltip
+                  class="itemStyle"
+                  effect="dark"
+                  popper-class="tooltip-max-width"
+                  placement="right"
+                  :content="showContent(activity, index)"
+                >
+                  <div>
+                    <!-- <div>版本号:{{ activity.ban_ben_ }}/修订人:{{ getUserName(activity.bian_zhi_ren_) }}</div> -->
+                    <el-collapse v-model="activeName" accordion>
+                      <el-collapse-item :name="index + 1">
+                        <template slot="title">
+                          <div>
+                            版本号:{{
+                              activity.ban_ben_
+                            }}&nbsp;&nbsp;&nbsp;&nbsp;修订人:{{
+                              getUserName(activity.bian_zhi_ren_)
+                            }}
+                          </div>
+                        </template>
+                        <!-- 附件 -->
+                        <div v-if="activity.zhen_fu_jian_">
+                          <ibps-attachment
+                            v-model="activity.zhen_fu_jian_"
+                            allow-download
+                            download
+                            multiple
+                            accept="*"
+                            store="id"
+                            readonly
+                          />
                         </div>
-                        <el-button
-                            v-if="deleteShow"
-                            slot="reference"
-                            type="danger"
-                            icon="el-icon-delete"
-                            class="deleteBtn"
-                            @click="deleteVisible = true"
-                        >删除</el-button>
-                    </el-popover>
-                    <el-button
-                        type="primary"
-                        icon="el-icon-view"
-                        @click="lookFile"
-                    >查看文件信息</el-button>
-                    <el-button
-                        type="primary"
-                        icon="el-icon-s-fold"
-                        @click="hideLeft"
-                    >{{ leftContent }}</el-button>
-                    <el-button
-                        v-if="updateShow"
-                        type="primary"
-                        icon="el-icon-download"
-                        @click="updateFile"
-                    >下载文件</el-button>
-                    <el-button
-                        type="danger"
-                        icon="el-icon-close"
-                        @click="closeDialog"
-                    >关闭</el-button>
-                </el-col>
-            </el-row>
-        </template>
-        <div>
-            <el-row>
-                <el-col v-if="leftShow" :span="4" class="left-content">
-                    <div class="left-title">文件修订历史</div>
-                    <el-timeline :reverse="reverse">
-                        <el-timeline-item
-                            v-for="(activity, index) in leftData"
-                            :key="index"
-                            :timestamp="'发布日期:' + activity.fa_bu_shi_jian_"
-                            :type="index === activeIndex ? type : ''"
-                            @click.stop.native="toggleActive(activity, index)"
-                        >
-                            <div class="timeline-content">
-                                <el-tooltip
-                                    class="itemStyle"
-                                    effect="dark"
-                                    placement="right-end"
-                                    :content="showContent(activity, index)"
-                                >
-                                    <div>
-                                        <!-- <div>版本号:{{ activity.ban_ben_ }}/修订人:{{ getUserName(activity.bian_zhi_ren_) }}</div> -->
-                                        <el-collapse
-                                            v-model="activeName"
-                                            accordion
-                                        >
-                                            <el-collapse-item :name="index + 1">
-                                                <template slot="title">
-                                                    <div>
-                                                        版本号:{{
-                                                            activity.ban_ben_
-                                                        }}&nbsp;&nbsp;&nbsp;&nbsp;修订人:{{
-                                                            getUserName(
-                                                                activity.bian_zhi_ren_
-                                                            )
-                                                        }}
-                                                    </div>
-                                                </template>
-                                                <!-- 附件 -->
-                                                <div
-                                                    v-if="
-                                                        activity.zhen_fu_jian_
-                                                    "
-                                                >
-                                                    <ibps-attachment
-                                                        v-model="
-                                                            activity.zhen_fu_jian_
-                                                        "
-                                                        allow-download
-                                                        download
-                                                        multiple
-                                                        accept="*"
-                                                        store="id"
-                                                        readonly
-                                                    />
-                                                </div>
-                                                <div v-else>
-                                                    <i
-                                                        class="el-icon-warning-outline"
-                                                        type="warning"
-                                                    >
-                                                        暂无附件</i>
-                                                </div>
-                                            </el-collapse-item>
-                                        </el-collapse>
-                                    </div>
-                                </el-tooltip>
-                            </div>
-                        </el-timeline-item>
-                    </el-timeline>
-                </el-col>
-                <el-col
-                    :span="computedSpan"
-                ><fView
-                    v-if="refresh"
-                    ref="fvView"
-                    :option-file="optionFile"
-                    :operation_status="operation_status"
-                    :copy="updateShow"
-                    @hadLoadedFile="hadLoadedFile"
-                /></el-col>
-            </el-row>
-        </div>
-        <!-- 查看文件信息弹窗 @close="closeDialog"-->
-        <FileDialog
-            v-if="innerVisible"
-            :show-list="showList"
-            :dig-data="digData"
-            :inner-visible="innerVisible"
-            :file-index="fileIndex"
-            @pause="pauseTimer"
-            @start="startTimer"
-            @update-inner-visible="updateInnerVisible"
-        />
-    </el-dialog>
+                        <div v-else>
+                          <i class="el-icon-warning-outline" type="warning">
+                            暂无附件</i
+                          >
+                        </div>
+                      </el-collapse-item>
+                    </el-collapse>
+                  </div>
+                </el-tooltip>
+              </div>
+            </el-timeline-item>
+          </el-timeline>
+        </el-col>
+        <el-col :span="computedSpan"
+          ><fView
+            v-if="refresh"
+            ref="fvView"
+            :option-file="optionFile"
+            :operation_status="operation_status"
+            :copy="updateShow"
+            @hadLoadedFile="hadLoadedFile"
+        /></el-col>
+      </el-row>
+    </div>
+    <!-- 查看文件信息弹窗 @close="closeDialog"-->
+    <FileDialog
+      v-if="innerVisible"
+      :show-list="showList"
+      :dig-data="digData"
+      :inner-visible="innerVisible"
+      :file-index="fileIndex"
+      @pause="pauseTimer"
+      @start="startTimer"
+      @update-inner-visible="updateInnerVisible"
+    />
+  </el-dialog>
 </template>
 <script>
 /**
@@ -204,599 +177,599 @@ import IbpsAttachment from '@/business/platform/file/attachment/selector'
 // import * as selectbox from 'bpmn-js-properties-panel/lib/factory/SelectEntryFactory'
 // import func from 'vue-editor-bridge'
 export default {
-    name: 'file-training',
-    components: {
-        fView,
-        ViewFile,
-        Template,
-        FileDialog,
-        'ibps-attachment': IbpsAttachment
-    },
-    props: {
-        visible: {
-            type: Boolean,
-            default: false
-        },
-        // fileInfos: {
-        //     type: Object,
-        //     default: () => {}
-        // },
-        fileInfos: {
-            type: Array,
-            default: () => {}
-        }
-        // template: {
-        //     type: Object,
-        //     default: () => {}
-        // }
+  name: 'file-training',
+  components: {
+    fView,
+    ViewFile,
+    Template,
+    FileDialog,
+    'ibps-attachment': IbpsAttachment
+  },
+  props: {
+    visible: {
+      type: Boolean,
+      default: false
     },
-    data () {
-        const { userList, userId, role, isSuper } = this.$store.getters
-        // const userId = this.$store.getters.userInfo.employee.id// 本人修改
+    // fileInfos: {
+    //     type: Object,
+    //     default: () => {}
+    // },
+    fileInfos: {
+      type: Array,
+      default: () => {}
+    }
+    // template: {
+    //     type: Object,
+    //     default: () => {}
+    // }
+  },
+  data() {
+    const { userList, userId, role, isSuper } = this.$store.getters
+    // const userId = this.$store.getters.userInfo.employee.id// 本人修改
 
-        return {
-            activeName: 1,
-            updateShow: false,
-            type: 'success',
-            curFileName: '',
-            curZid: '',
-            timeId: '',
-            dialogVisible: false,
-            operation_status: 'fileTraining',
-            title: '',
-            browseTime: 0, // 浏览时长初始值为 0
-            clearTimeSet: null,
-            optionFile: {},
-            tmpId: '',
-            upFunc: () => {},
-            height: 0,
-            out: false, // 记录鼠标是否离开过被监听的位置,未离开过则startTimer不启用
-            hadLoad: false,
-            refresh: false,
-            // 本人修改
-            leftShow: true,
-            scrollTimeout: null,
-            reverse: false,
-            fileInfo: '',
-            fileJie: '',
-            leftData: [],
-            activeIndex: 0,
-            userList: userList,
-            userId: userId,
-            innerVisible: false,
-            currentPage: 1,
-            pageSize: 10,
-            lookNum: null,
-            showList: [],
-            digData: null,
-            paused: false,
-            role: role,
-            isSuper: isSuper,
-            deleteVisible: false,
-            deleteShow: false,
-            leftContent: '隐藏修订历史'
+    return {
+      activeName: 1,
+      updateShow: false,
+      type: 'success',
+      curFileName: '',
+      curZid: '',
+      timeId: '',
+      dialogVisible: false,
+      operation_status: 'fileTraining',
+      title: '',
+      browseTime: 0, // 浏览时长初始值为 0
+      clearTimeSet: null,
+      optionFile: {},
+      tmpId: '',
+      upFunc: () => {},
+      height: 0,
+      out: false, // 记录鼠标是否离开过被监听的位置,未离开过则startTimer不启用
+      hadLoad: false,
+      refresh: false,
+      // 本人修改
+      leftShow: true,
+      scrollTimeout: null,
+      reverse: false,
+      fileInfo: '',
+      fileJie: '',
+      leftData: [],
+      activeIndex: 0,
+      userList: userList,
+      userId: userId,
+      innerVisible: false,
+      currentPage: 1,
+      pageSize: 10,
+      lookNum: null,
+      showList: [],
+      digData: null,
+      paused: false,
+      role: role,
+      isSuper: isSuper,
+      deleteVisible: false,
+      deleteShow: false,
+      leftContent: '隐藏修订历史'
+    }
+  },
+  // 本人修改
+  computed: {
+    computedSpan() {
+      return this.leftShow ? 20 : 24
+    },
+    fileIndex() {
+      if (this.leftData.length <= 0) {
+        return 0
+      }
+      return this.leftData.findIndex((i) => i === this.digData)
+    }
+  },
+  watch: {
+    visible: {
+      immediate: true,
+      handler(val) {
+        this.digData = this.leftData[0]
+      }
+    },
+    leftShow: {
+      immediate: true, // 强制执行一次
+      handler(val) {
+        if (val) {
+          this.leftContent = '隐藏修订历史'
+          return
         }
+        this.leftContent = '显示修订历史'
+      }
     },
     // 本人修改
-    computed: {
-        computedSpan () {
-            return this.leftShow ? 20 : 24
-        },
-        fileIndex () {
-            if (this.leftData.length <= 0) {
-                return 0
-            }
-            return this.leftData.findIndex((i) => i === this.digData)
+    fileInfos: {
+      handler(newVal) {
+        this.leftData = newVal
+        const temp = JSON.parse(JSON.stringify(newVal))
+        temp.sort((a, b) => {
+          return (
+            new Date(b.fa_fang_shi_jian_).getTime() -
+            new Date(a.fa_fang_shi_jian_).getTime()
+          )
+        })
+        if (newVal !== temp) {
+          this.leftData = temp
         }
+        temp.forEach((val) => {
+          this.fileShow(temp[0])
+        })
+        // newVal.forEach(val => {
+        //     this.fileShow(val)
+        // })
+      },
+      deep: true, // 深度监听,确保对象属性变化也能触发(本人修改)
+      immediate: true
     },
-    watch: {
-        visible: {
-            immediate: true,
-            handler (val) {
-                this.digData = this.leftData[0]
-            }
-        },
-        leftShow: {
-            immediate: true, // 强制执行一次
-            handler (val) {
-                if (val) {
-                    this.leftContent = '隐藏修订历史'
-                    return
-                }
-                this.leftContent = '显示修订历史'
-            }
-        },
-        // 本人修改
-        fileInfos: {
-            handler (newVal) {
-                this.leftData = newVal
-                const temp = JSON.parse(JSON.stringify(newVal))
-                temp.sort((a, b) => {
-                    return (
-                        new Date(b.fa_fang_shi_jian_).getTime() -
-                        new Date(a.fa_fang_shi_jian_).getTime()
-                    )
-                })
-                if (newVal !== temp) {
-                    this.leftData = temp
-                }
-                temp.forEach((val) => {
-                    this.fileShow(temp[0])
-                })
-                // newVal.forEach(val => {
-                //     this.fileShow(val)
-                // })
-            },
-            deep: true, // 深度监听,确保对象属性变化也能触发(本人修改)
-            immediate: true
-        },
 
-        browseTime: {
-            handler: function (val, oldVal) {
-                if (this.curFileName) {
-                    this.title = `文件:《 ${this.curFileName} 》,查阅时长:${val}秒`
-                } else {
-                    this.title = `文件:《 ${this.leftData[0]?.FILE_NAME_} 》,查阅时长:${val}秒`
-                }
-                if (!this.lookNum) {
-                    if (this.leftData[0]?.id) {
-                        this.checkNum(this.leftData[0])
-                    }
-                }
-            },
-            immediate: true
-        },
-        dialogVisible: {
-            handler: function (val, oldVal) {
-                if (!val) {
-                    this.closeDialog()
-                }
-            }
+    browseTime: {
+      handler: function (val, oldVal) {
+        if (this.curFileName) {
+          this.title = `文件:《 ${this.curFileName} 》,查阅时长:${val}秒`
+        } else {
+          this.title = `文件:《 ${this.leftData[0]?.FILE_NAME_} 》,查阅时长:${val}秒`
         }
+        if (!this.lookNum) {
+          if (this.leftData[0]?.id) {
+            this.checkNum(this.leftData[0])
+          }
+        }
+      },
+      immediate: true
     },
-    beforeDestroy () {
-        this.fileType = ''
-        this.option = {}
-        // 本人修改
-        this.removeMouseMoveListener()
-    },
-    mounted () {
-        this.height = this.getDialogHeightHeight()
-        // 页面切换时改变计时状态
-        document.addEventListener('visibilitychange', this.handlePageChange)
-        this.checkDialogBody()
-        const roleKey = ['xtgljs']
-        const curRole = this.role.map((i) => i.alias)
-        const isPower = curRole.some((item) => roleKey.includes(item))
-        this.deleteShow = !!(isPower || this.isPower)
-        const hasRole = localStorage.getItem('hasHighRole') === '1'
-        if (this.isSuper || hasRole) {
-            this.updateShow = true
+    dialogVisible: {
+      handler: function (val, oldVal) {
+        if (!val) {
+          this.closeDialog()
         }
+      }
+    }
+  },
+  beforeDestroy() {
+    this.fileType = ''
+    this.option = {}
+    // 本人修改
+    this.removeMouseMoveListener()
+  },
+  mounted() {
+    this.height = this.getDialogHeightHeight()
+    // 页面切换时改变计时状态
+    document.addEventListener('visibilitychange', this.handlePageChange)
+    this.checkDialogBody()
+    const roleKey = ['xtgljs']
+    const curRole = this.role.map((i) => i.alias)
+    const isPower = curRole.some((item) => roleKey.includes(item))
+    this.deleteShow = !!(isPower || this.isPower)
+    const hasRole = localStorage.getItem('hasHighRole') === '1'
+    if (this.isSuper || hasRole) {
+      this.updateShow = true
+    }
+  },
+  methods: {
+    getUserName(data) {
+      const user = this.userList.find((item) => item.userId === data)
+      return user ? user.userName : '未知用户'
+    },
+    showContent(activity, index) {
+      if (activity.cao_zuo_lei_xing_ === '新增') {
+        return '第一版本'
+      }
+      return activity.xiu_ding_nei_rong
+        ? activity.xiu_ding_nei_rong
+        : '无修订原因'
     },
-    methods: {
-        getUserName (data) {
-            const user = this.userList.find((item) => item.userId === data)
-            return user ? user.userName : '未知用户'
-        },
-        showContent (activity, index) {
-            if (activity.cao_zuo_lei_xing_ === '新增') {
-                return '第一版本'
-            }
-            return activity.xiu_ding_nei_rong
-                ? activity.xiu_ding_nei_rong
-                : '无修订原因'
-        },
 
-        handlePageChange () {
-            if (document.visibilityState === 'hidden') {
-                this.pauseTimer()
-            } else {
-                this.startTimer()
-            }
-        },
+    handlePageChange() {
+      if (document.visibilityState === 'hidden') {
+        this.pauseTimer()
+      } else {
+        this.startTimer()
+      }
+    },
 
-        closeDialog () {
-            // 关闭时存入查阅时间
-            if (this.browseTime && this.browseTime > 0 && this.timeId) {
-                this.handleUpdate()
-            }
-            this.$emit('colseVisible', false)
-            const fvView = this.$refs.fvView
-            // 销毁子组件方法
-            fvView.destoryZiComponent()
-            if (this.browseTime >= 30) {
-                this.upFunc(this.tmpId, this.browseTime)
-            }
+    closeDialog() {
+      // 关闭时存入查阅时间
+      if (this.browseTime && this.browseTime > 0 && this.timeId) {
+        this.handleUpdate()
+      }
+      this.$emit('colseVisible', false)
+      const fvView = this.$refs.fvView
+      // 销毁子组件方法
+      fvView.destoryZiComponent()
+      if (this.browseTime >= 30) {
+        this.upFunc(this.tmpId, this.browseTime)
+      }
 
-            // 针对关闭窗口或者浏览器的
-            if (this.clearTimeSet != null) {
-                clearInterval(this.clearTimeSet)
-                this.clearTimeSet = null
-            }
-            this.leftShow = true
-            this.out = false
-            this.browseTime = 0
-            // this.curFileName = ''// 本人添加
-            // this.lookNum = null
-            // this.showList = []
-            // this.leftData = []
-            // this.digData = null
-        },
-        hadLoadedFile (v) {
-            // 计时开始,添加查看记录
-            if (!this.curZid) {
-                this.handleAdd(this.leftData[0]?.zId, 0)
-            }
-            this.setBrowseTime()
-            this.hadLoad = true
-        },
-        setBrowseTime () {
-            // 设置定时器
-            this.clearTimeSet = setInterval(() => {
-                this.browseTime++
-            }, 1000)
-        },
-        getDialogHeightHeight () {
-            return (
-                (document.documentElement.clientHeight ||
-                    document.body.clientHeight) -
-                60 +
-                'px'
-            )
-        },
-        startTimer () {
-            if (
-                this.dialogVisible &&
-                this.hadLoad &&
-                this.out &&
-                this.clearTimeSet == null
-            ) {
-                this.clearTimeSet = setInterval(() => {
-                    this.browseTime++
-                }, 1000)
-            }
-        },
-        pauseTimer () {
-            if (this.dialogVisible) {
-                this.out = true
-                clearInterval(this.clearTimeSet)
-                this.clearTimeSet = null
-            }
-        },
-        // 本人修改
-        // id转换
-        async idChange (id) {
-            const sql = `select id_ FROM t_wjxxb WHERE shu_ju_lai_yuan_ = '${id}'`
-            return new Promise((resolve, reject) => {
-                this.$common
-                    .request('sql', sql)
-                    .then((res) => {
-                        const { data = [] } = res.variables || {}
-                        const firstId = data[0]?.id_
-                        resolve(firstId) // 解析 Promise 时返回 firstId
-                    })
-                    .catch((error) => {
-                        reject(error) // 捕获错误并拒绝 Promise
-                    })
-            })
-        },
+      // 针对关闭窗口或者浏览器的
+      if (this.clearTimeSet != null) {
+        clearInterval(this.clearTimeSet)
+        this.clearTimeSet = null
+      }
+      this.leftShow = true
+      this.out = false
+      this.browseTime = 0
+      // this.curFileName = ''// 本人添加
+      // this.lookNum = null
+      // this.showList = []
+      // this.leftData = []
+      // this.digData = null
+    },
+    hadLoadedFile(v) {
+      // 计时开始,添加查看记录
+      if (!this.curZid) {
+        this.handleAdd(this.leftData[0]?.zId, 0)
+      }
+      this.setBrowseTime()
+      this.hadLoad = true
+    },
+    setBrowseTime() {
+      // 设置定时器
+      this.clearTimeSet = setInterval(() => {
+        this.browseTime++
+      }, 1000)
+    },
+    getDialogHeightHeight() {
+      return (
+        (document.documentElement.clientHeight || document.body.clientHeight) -
+        60 +
+        'px'
+      )
+    },
+    startTimer() {
+      if (
+        this.dialogVisible &&
+        this.hadLoad &&
+        this.out &&
+        this.clearTimeSet == null
+      ) {
+        this.clearTimeSet = setInterval(() => {
+          this.browseTime++
+        }, 1000)
+      }
+    },
+    pauseTimer() {
+      if (this.dialogVisible) {
+        this.out = true
+        clearInterval(this.clearTimeSet)
+        this.clearTimeSet = null
+      }
+    },
+    // 本人修改
+    // id转换
+    async idChange(id) {
+      const sql = `select id_ FROM t_wjxxb WHERE shu_ju_lai_yuan_ = '${id}'`
+      return new Promise((resolve, reject) => {
+        this.$common
+          .request('sql', sql)
+          .then((res) => {
+            const { data = [] } = res.variables || {}
+            const firstId = data[0]?.id_
+            resolve(firstId) // 解析 Promise 时返回 firstId
+          })
+          .catch((error) => {
+            reject(error) // 捕获错误并拒绝 Promise
+          })
+      })
+    },
 
-        toggleActive (activity, index) {
-            if (this.activeIndex === index) {
-                return
-            }
-            // 切换文件修订历史时,保存上一个文件查看记录,新增当前文件查看记录
-            if (this.browseTime && this.browseTime > 0 && this.timeId) {
-                this.handleUpdate()
-                this.handleAdd(this.curZid || this.leftData[0]?.zId, 0)
-            }
-            this.activeIndex = index
-            this.digData = activity
-            this.curZid = activity.zid
-            this.fileShow(activity)
-            if (this.browseTime >= 30) {
-                this.upFunc(this.tmpId, this.browseTime)
-            }
+    toggleActive(activity, index) {
+      if (this.activeIndex === index) {
+        return
+      }
+      // 切换文件修订历史时,保存上一个文件查看记录,新增当前文件查看记录
+      if (this.browseTime && this.browseTime > 0 && this.timeId) {
+        this.handleUpdate()
+        this.handleAdd(this.curZid || this.leftData[0]?.zId, 0)
+      }
+      this.activeIndex = index
+      this.digData = activity
+      this.curZid = activity.zid
+      this.fileShow(activity)
+      if (this.browseTime >= 30) {
+        this.upFunc(this.tmpId, this.browseTime)
+      }
 
-            clearInterval(this.clearTimeSet)
-            this.browseTime = 0
-            this.curFileName = activity.FILE_NAME_
-            this.checkNum(activity) // 阅读量
-            // this.$forceUpdate()// 触发监听器
-        },
-        // 阅读量函数
-        async checkNum (activity) {
-            const sql = `select t_wjcyjl.* from t_wjcyjl
+      clearInterval(this.clearTimeSet)
+      this.browseTime = 0
+      this.curFileName = activity.FILE_NAME_
+      this.checkNum(activity) // 阅读量
+      // this.$forceUpdate()// 触发监听器
+    },
+    // 阅读量函数
+    async checkNum(activity) {
+      const sql = `select t_wjcyjl.* from t_wjcyjl
                 INNER JOIN t_wjxxb ON t_wjcyjl.parent_id_ = t_wjxxb.id_
                 WHERE t_wjxxb.shu_ju_lai_yuan_ = '${activity.id}' order by create_time_ desc`
-            // const sql1 = `select * from t_wjcyjl where parent_id_= '${activity.id}' order by create_time_ desc`
-            await this.$common.request('sql', sql).then((res) => {
-                const { data = [] } = res.variables || {}
-                this.lookNum = data.length
-                this.showList = data
-            })
-        },
-        handleAdd (fileId, time) {
-            const addParams = {
-                tableName: 't_wjcyjl',
-                paramWhere: [
-                    {
-                        bian_zhi_ren_: this.userId,
-                        bian_zhi_shi_jian: this.$common.getDateNow(19),
-                        parent_id_: fileId,
-                        shi_chang_: time
-                    }
-                ]
-            }
-            curdPost('add', addParams).then((res) => {
-                // this.refreshData()
-                const { cont = [] } = res.variables || {}
-                this.timeId = cont[0]?.id_ || ''
-            })
-        },
-        handleUpdate () {
-            const updateParams = {
-                tableName: 't_wjcyjl',
-                updList: [
-                    {
-                        where: {
-                            id_: this.timeId
-                        },
-                        param: {
-                            // shi_chang_: this.browseTime
-                            shi_chang_: 20
-                        }
-                    }
-                ]
+      // const sql1 = `select * from t_wjcyjl where parent_id_= '${activity.id}' order by create_time_ desc`
+      await this.$common.request('sql', sql).then((res) => {
+        const { data = [] } = res.variables || {}
+        this.lookNum = data.length
+        this.showList = data
+      })
+    },
+    handleAdd(fileId, time) {
+      const addParams = {
+        tableName: 't_wjcyjl',
+        paramWhere: [
+          {
+            bian_zhi_ren_: this.userId,
+            bian_zhi_shi_jian: this.$common.getDateNow(19),
+            parent_id_: fileId,
+            shi_chang_: time
+          }
+        ]
+      }
+      curdPost('add', addParams).then((res) => {
+        // this.refreshData()
+        const { cont = [] } = res.variables || {}
+        this.timeId = cont[0]?.id_ || ''
+      })
+    },
+    handleUpdate() {
+      const updateParams = {
+        tableName: 't_wjcyjl',
+        updList: [
+          {
+            where: {
+              id_: this.timeId
+            },
+            param: {
+              // shi_chang_: this.browseTime
+              shi_chang_: 20
             }
-            curdPost('update', updateParams).then((res) => {})
-        },
-        hideLeft () {
-            this.leftShow = !this.leftShow
-        },
+          }
+        ]
+      }
+      curdPost('update', updateParams).then((res) => {})
+    },
+    hideLeft() {
+      this.leftShow = !this.leftShow
+    },
 
-        async lookFile () {
-            // console.log(document.querySelector('iframe').contentWindow.document)
-            // console.log(document.querySelector('iframe').contentWindow.document.body.innerHTML);
-            if (this.digData) {
-                await this.checkNum(this.digData)
-            } else {
-                this.digData = this.leftData[0]
-                await this.checkNum(this.digData)
-            }
-            this.innerVisible = true
-        },
-        a () {
-            fetch(this.optionFile.url)
-                .then((response) => {
-                    if (response.ok) {
-                        // 如果响应状态码为 200-299,则创建下载链接
-                        const a = document.createElement('a')
-                        a.href = this.optionFile.url
-                        a.download = this.optionFile.data.fileName
-                        document.body.appendChild(a)
-                        a.click()
-                        a.remove()
-                    } else {
-                        // 如果响应状态码不是 200-299,则显示错误消息
-                        this.$message({
-                            message: '文件未找到,请联系管理员',
-                            type: 'warning'
-                        })
-                        console.error(
-                            '文件未找到:',
-                            response.status,
-                            response.statusText
-                        )
-                    }
-                })
-                .catch((error) => {
-                    // 捕获网络请求错误
-                    this.$message({
-                        message: '网络请求失败,请联系管理员',
-                        type: 'warning'
-                    })
-                    console.error('网络请求失败:', error)
-                })
-        },
-        deleteFile () {
-            this.deleteVisible = false
-            // const roleKey = ['xtgljs', 'syszr', 'wjgly', 'wjglzzc']
-            const roleKey = ['xtgljs']
-            const curRole = this.role.map((i) => i.alias)
-            const isPower = curRole.some((item) => roleKey.includes(item))
-            if (this.isSuper || isPower) {
-                const deleteParams = {
-                    tableName: 't_wjxxb',
-                    paramWhere: { id_: this.leftData[0].zId }
-                }
-                curdPost('delete', deleteParams).then(() => {
-                    this.$message({
-                        message: '删除成功!',
-                        type: 'warning'
-                    })
-                    this.dialogVisible = false
-                })
-                return
-            }
+    async lookFile() {
+      // console.log(document.querySelector('iframe').contentWindow.document)
+      // console.log(document.querySelector('iframe').contentWindow.document.body.innerHTML);
+      if (this.digData) {
+        await this.checkNum(this.digData)
+      } else {
+        this.digData = this.leftData[0]
+        await this.checkNum(this.digData)
+      }
+      this.innerVisible = true
+    },
+    a() {
+      fetch(this.optionFile.url)
+        .then((response) => {
+          if (response.ok) {
+            // 如果响应状态码为 200-299,则创建下载链接
+            const a = document.createElement('a')
+            a.href = this.optionFile.url
+            a.download = this.optionFile.data.fileName
+            document.body.appendChild(a)
+            a.click()
+            a.remove()
+          } else {
+            // 如果响应状态码不是 200-299,则显示错误消息
             this.$message({
-                message: '您还没有权限,请联系管理员',
-                type: 'warning'
+              message: '文件未找到,请联系管理员',
+              type: 'warning'
             })
-        },
-        // closeDialog1 (val) {
-        //     this.innerVisible = val
-        // },
-        updateFile () {
-            const hasRole = localStorage.getItem('hasHighRole') === '1'
-            // const roleKey = ['xtgljs', 'wjglzzc', 'wjgly', 'zhsfzr']
-            // const curRole = this.role.map(i => i.alias)
-            // const isPower = curRole.some(i => roleKey.includes(i))
-            if (this.isSuper || hasRole) {
-                const a = document.createElement('a')
-                a.href = this.optionFile.url
-                a.download = this.optionFile.data.fileName
-                document.body.appendChild(a)
-                a.click()
-                a.remove()
-                return
+            console.error('文件未找到:', response.status, response.statusText)
+          }
+        })
+        .catch((error) => {
+          // 捕获网络请求错误
+          this.$message({
+            message: '网络请求失败,请联系管理员',
+            type: 'warning'
+          })
+          console.error('网络请求失败:', error)
+        })
+    },
+    deleteFile() {
+      this.deleteVisible = false
+      // const roleKey = ['xtgljs', 'syszr', 'wjgly', 'wjglzzc']
+      const roleKey = ['xtgljs']
+      const curRole = this.role.map((i) => i.alias)
+      const isPower = curRole.some((item) => roleKey.includes(item))
+      if (this.isSuper || isPower) {
+        const deleteParams = {
+          tableName: 't_wjxxb',
+          paramWhere: { id_: this.leftData[0].zId }
+        }
+        curdPost('delete', deleteParams).then(() => {
+          this.$message({
+            message: '删除成功!',
+            type: 'warning'
+          })
+          this.dialogVisible = false
+        })
+        return
+      }
+      this.$message({
+        message: '您还没有权限,请联系管理员',
+        type: 'warning'
+      })
+    },
+    // closeDialog1 (val) {
+    //     this.innerVisible = val
+    // },
+    updateFile() {
+      const hasRole = localStorage.getItem('hasHighRole') === '1'
+      // const roleKey = ['xtgljs', 'wjglzzc', 'wjgly', 'zhsfzr']
+      // const curRole = this.role.map(i => i.alias)
+      // const isPower = curRole.some(i => roleKey.includes(i))
+      if (this.isSuper || hasRole) {
+        const a = document.createElement('a')
+        a.href = this.optionFile.url
+        a.download = this.optionFile.data.fileName
+        document.body.appendChild(a)
+        a.click()
+        a.remove()
+        return
+      }
+      this.$message({
+        message: '您还没有权限,请联系管理员',
+        type: 'warning'
+      })
+    },
+    fileShow(val) {
+      return new Promise((resolve, reject) => {
+        try {
+          this.dialogVisible = true
+          this.title = `文件:《${val.FILE_NAME_}》`
+          this.idChange(val.id).then((res) => {
+            this.tmpId = res
+            if (val.func) {
+              this.upFunc = val.func
+            }
+            const data = {
+              ext: val.fileInfos.EXT_,
+              fileName: val.fileInfos.FILE_NAME_,
+              id: val.fileInfos.ID_,
+              index: 0,
+              totalBytes: val.fileInfos.TOTAL_BYTES_
             }
-            this.$message({
-                message: '您还没有权限,请联系管理员',
-                type: 'warning'
-            })
-        },
-        fileShow (val) {
-            return new Promise((resolve, reject) => {
-                try {
-                    this.dialogVisible = true
-                    this.title = `文件:《${val.FILE_NAME_}》`
-                    this.idChange(val.id).then((res) => {
-                        this.tmpId = res
-                        if (val.func) {
-                            this.upFunc = val.func
-                        }
-                        const data = {
-                            ext: val.fileInfos.EXT_,
-                            fileName: val.fileInfos.FILE_NAME_,
-                            id: val.fileInfos.ID_,
-                            index: 0,
-                            totalBytes: val.fileInfos.TOTAL_BYTES_
-                        }
 
-                        this.optionFile.url = `${this.$onlyofficeApi}/file/download?attachmentId=${data.id}`
-                        this.optionFile.editUrl = `${this.$onlyofficeApi}/file/editCallback?fileName=${data.fileName}&fileType=${data.ext}&type=fileTraining&id=${data.id}`
-                        this.optionFile.title = data.fileName // 文件名称
-                        this.optionFile.fileType = data.ext // 类型
-                        this.optionFile.data = data // 记录编制的位置,需要替换。
-                        this.optionFile.data.index = data.index
+            this.optionFile.url = `${this.$onlyofficeApi}/file/download?attachmentId=${data.id}`
+            this.optionFile.editUrl = `${this.$onlyofficeApi}/file/editCallback?fileName=${data.fileName}&fileType=${data.ext}&type=fileTraining&id=${data.id}`
+            this.optionFile.title = data.fileName // 文件名称
+            this.optionFile.fileType = data.ext // 类型
+            this.optionFile.data = data // 记录编制的位置,需要替换。
+            this.optionFile.data.index = data.index
 
-                        // 使用 v-if 实现组件刷新功能
-                        this.refresh = false
-                        this.$nextTick(() => {
-                            this.refresh = true
-                            resolve() // 异步操作完成后 resolve
-                        })
-                    })
-                } catch (error) {
-                    reject(error)
-                }
-            })
-        },
-        // 排序函数
-        sortByFabushijianDesc (data) {
-            return data.sort((a, b) => {
-                const dateA = new Date(a.fa_fang_shi_jian_)
-                const dateB = new Date(b.fa_fang_shi_jian_)
-                return dateB - dateA // 降序排序
+            // 使用 v-if 实现组件刷新功能
+            this.refresh = false
+            this.$nextTick(() => {
+              this.refresh = true
+              resolve() // 异步操作完成后 resolve
             })
-        },
-        formattedTimestamp (timestamp) {
-            const date = new Date(timestamp)
-            // 获取年月日时分秒
-            const year = date.getFullYear()
-            const month = String(date.getMonth() + 1).padStart(2, '0')
-            const day = String(date.getDate()).padStart(2, '0')
-            const hours = String(date.getHours()).padStart(2, '0')
-            const minutes = String(date.getMinutes()).padStart(2, '0')
-            const seconds = String(date.getSeconds()).padStart(2, '0')
+          })
+        } catch (error) {
+          reject(error)
+        }
+      })
+    },
+    // 排序函数
+    sortByFabushijianDesc(data) {
+      return data.sort((a, b) => {
+        const dateA = new Date(a.fa_fang_shi_jian_)
+        const dateB = new Date(b.fa_fang_shi_jian_)
+        return dateB - dateA // 降序排序
+      })
+    },
+    formattedTimestamp(timestamp) {
+      const date = new Date(timestamp)
+      // 获取年月日时分秒
+      const year = date.getFullYear()
+      const month = String(date.getMonth() + 1).padStart(2, '0')
+      const day = String(date.getDate()).padStart(2, '0')
+      const hours = String(date.getHours()).padStart(2, '0')
+      const minutes = String(date.getMinutes()).padStart(2, '0')
+      const seconds = String(date.getSeconds()).padStart(2, '0')
 
-            // 格式化日期
-            return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
-        },
+      // 格式化日期
+      return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`
+    },
 
-        checkDialogBody () {
-            const intervalId = setInterval(() => {
-                if (document.querySelector('iframe')) {
-                    this.dialogBody = document.querySelector('iframe')
-                    this.addMouseMoveListener()
-                    clearInterval(intervalId)
-                }
-            }, 200)
-        },
-        addMouseMoveListener () {
-            if (this.dialogBody && !this.mouseMoveHandler) {
-                this.mouseMoveHandler = () => {
-                    console.log('鼠标移动事件!!!!')
-                }
-                this.dialogBody.addEventListener(
-                    'mousemove',
-                    this.mouseMoveHandler,
-                    true
-                )
-            }
-        },
-        removeMouseMoveListener () {
-            if (this.dialogBody && this.mouseMoveHandler) {
-                this.dialogBody.removeEventListener(
-                    'mousemove',
-                    this.mouseMoveHandler,
-                    true
-                )
-                this.mouseMoveHandler = null
-            }
-        },
-        updateInnerVisible (newVal) {
-            this.innerVisible = newVal
+    checkDialogBody() {
+      const intervalId = setInterval(() => {
+        if (document.querySelector('iframe')) {
+          this.dialogBody = document.querySelector('iframe')
+          this.addMouseMoveListener()
+          clearInterval(intervalId)
+        }
+      }, 200)
+    },
+    addMouseMoveListener() {
+      if (this.dialogBody && !this.mouseMoveHandler) {
+        this.mouseMoveHandler = () => {
+          console.log('鼠标移动事件!!!!')
         }
+        this.dialogBody.addEventListener(
+          'mousemove',
+          this.mouseMoveHandler,
+          true
+        )
+      }
+    },
+    removeMouseMoveListener() {
+      if (this.dialogBody && this.mouseMoveHandler) {
+        this.dialogBody.removeEventListener(
+          'mousemove',
+          this.mouseMoveHandler,
+          true
+        )
+        this.mouseMoveHandler = null
+      }
+    },
+    updateInnerVisible(newVal) {
+      this.innerVisible = newVal
     }
+  }
 }
 </script>
 <style lang="scss">
+.tooltip-max-width {
+  max-width: 800px !important; /* 固定最大宽度800px */
+  width: max-content; /* 内容不足时自适应宽度,不占满800px */
+  white-space: pre-wrap; /* 超长内容自动换行,避免横向溢出 */
+  word-break: break-all; /* 英文/数字超长时强制换行 */
+  padding: 8px 12px; /* 可选:调整内边距,优化排版 */
+}
 .ibps-file-preview-dialog {
-    width: 80%;
-    z-index: 99999;
-    .el-dialog__body {
-        padding: 0;
-    }
-    .file-type-txt {
-        height: calc(88vh) !important;
-    }
-    .itemStyle:hover {
-        cursor: pointer;
-    }
-    .titleHander,
-    .read {
-        line-height: 32px;
-    }
-    .deleteBtn {
-        margin: 0 10px 0 0;
-    }
+  width: 80%;
+  z-index: 99999;
+  .el-dialog__body {
+    padding: 0;
+  }
+  .file-type-txt {
+    height: calc(88vh) !important;
+  }
+  .itemStyle:hover {
+    cursor: pointer;
+  }
+  .titleHander,
+  .read {
+    line-height: 32px;
+  }
+  .deleteBtn {
+    margin: 0 10px 0 0;
+  }
 }
 .left-content {
-    .left-title {
-        text-align: left;
-        padding: 15px;
-        font-size: 18px;
-        font-weight: 600;
-    }
-    .el-timeline {
-        padding: 0 15px;
-    }
-    /* 清除分割线 */
-    .el-collapse-item__wrap,
-    .el-collapse-item__header {
-        border-bottom: none !important;
-    }
-    .el-collapse {
-        border: none !important;
-    }
-    .el-collapse-item__header {
-        height: 30px;
-        line-height: 30px;
-    }
-    .el-collapse-item__content {
-        padding: 0px;
-    }
-    .el-timeline-item {
-        padding-bottom: 10px;
-    }
+  .left-title {
+    text-align: left;
+    padding: 15px;
+    font-size: 18px;
+    font-weight: 600;
+  }
+  .el-timeline {
+    padding: 0 15px;
+  }
+  /* 清除分割线 */
+  .el-collapse-item__wrap,
+  .el-collapse-item__header {
+    border-bottom: none !important;
+  }
+  .el-collapse {
+    border: none !important;
+  }
+  .el-collapse-item__header {
+    height: 30px;
+    line-height: 30px;
+  }
+  .el-collapse-item__content {
+    padding: 0px;
+  }
+  .el-timeline-item {
+    padding-bottom: 10px;
+  }
 }
 // .file-read-num{
 //     display: inline-block;
 //     margin-left: 60px;
 // }
-
 </style>
-

+ 240 - 220
src/views/platform/message/inner/detail/dialog.vue

@@ -1,249 +1,269 @@
 <template>
-    <el-dialog
-        :title="title"
-        :visible.sync="dialogVisible"
-        :close-on-click-modal="false"
-        :close-on-press-escape="false"
-        :class="[inside ? 'inside-dialog' : 'inner-dialog']"
-        append-to-body
-        top="10vh"
-        width="65%"
-        @open="getFormData"
-        @close="closeDialog"
-    >
-        <inner-message
-            :id="id"
-            ref="innerMessage"
-            :inside="inside"
-            :readonly="readonly"
-            :type="type"
-            @callback="handleCallback"
-            @judgeIndex="acquire"
-        />
-        <div
-            slot="footer"
-            class="el-dialog--center"
-        >
-            <ibps-toolbar
-                :actions="toolbars"
-                @action-event="handleActionEvent"
-            />
-        </div>
-    </el-dialog>
+  <el-dialog
+    :title="title"
+    :visible.sync="dialogVisible"
+    :close-on-click-modal="false"
+    :close-on-press-escape="false"
+    :class="[inside ? 'inside-dialog' : 'inner-dialog']"
+    append-to-body
+    top="10vh"
+    width="65%"
+    @open="getFormData"
+    @close="closeDialog"
+  >
+    <inner-message
+      :id="id"
+      ref="innerMessage"
+      :inside="inside"
+      :readonly="readonly"
+      :type="type"
+      @callback="handleCallback"
+      @judgeIndex="acquire"
+    />
+    <div slot="footer" class="el-dialog--center">
+      <ibps-toolbar :actions="toolbars" @action-event="handleActionEvent" />
+    </div>
+  </el-dialog>
 </template>
 <script>
 import InnerMessage from './index'
 
 export default {
-    components: { InnerMessage },
-    props: {
-        inside: {
-            type: Boolean,
-            default: false
-        },
-        visible: {
-            type: Boolean,
-            default: false
-        },
-        readonly: {
-            type: Boolean,
-            default: false
-        },
-        // type: {
-        //   type: String,
-        //   default: ''
-        // },
-        tableId: {
-            type: String,
-            default: ''
-        },
-        tableName: {
-            type: String,
-            default: ''
-        },
+  components: { InnerMessage },
+  props: {
+    inside: {
+      type: Boolean,
+      default: false
+    },
+    visible: {
+      type: Boolean,
+      default: false
+    },
+    readonly: {
+      type: Boolean,
+      default: false
+    },
+    // type: {
+    //   type: String,
+    //   default: ''
+    // },
+    tableId: {
+      type: String,
+      default: ''
+    },
+    tableName: {
+      type: String,
+      default: ''
+    },
 
-        id: String,
-        // 子表ID
-        subId: String,
-        title: String
+    id: String,
+    // 子表ID
+    subId: String,
+    title: String
+  },
+  data() {
+    return {
+      dialogVisible: this.visible,
+      dialogLoading: false,
+      toolbars: [{ key: 'cancel', label: '关闭' }],
+      type: ''
+    }
+  },
+  watch: {
+    visible: {
+      handler: function (val, oldVal) {
+        this.dialogVisible = this.visible
+      },
+      immediate: true
     },
-    data () {
-        return {
-            dialogVisible: this.visible,
-            dialogLoading: false,
-            toolbars: [{ key: 'cancel', label: '关闭' }],
-            type: ''
+    tableId: {
+      handler: function (val, oldVal) {
+        const btn1 = [
+          { key: 'confirm', label: '确认' },
+          { key: 'cancel', label: '关闭' }
+        ]
+        const btn2 = [{ key: 'cancel', label: '关闭' }]
+        if (val) {
+          this.toolbars = btn1
+          this.type = '1'
+        } else {
+          this.toolbars = btn2
+          this.type = ''
         }
+      }
+    }
+  },
+  methods: {
+    handleActionEvent({ key }) {
+      switch (key) {
+        case 'cancel':
+          this.closeDialog()
+          break
+        case 'confirm':
+          this.confirmMsg()
+          break
+        case 'viewDetails':
+          this.$refs.innerMessage.handleDifferentTab()
+          break
+        default:
+          break
+      }
     },
-    watch: {
-        visible: {
-            handler: function (val, oldVal) {
-                this.dialogVisible = this.visible
-            },
-            immediate: true
-        },
-        tableId: {
-            handler: function (val, oldVal) {
-                const btn1 = [
-                    { key: 'confirm', label: '确认' },
-                    { key: 'cancel', label: '关闭' }
-                ]
-                const btn2 = [
-                    { key: 'cancel', label: '关闭' }
-                ]
-                if (val) {
-                    this.toolbars = btn1
-                    this.type = '1'
-                } else {
-                    this.toolbars = btn2
-                    this.type = ''
-                }
-            }
-        }
+    // 关闭当前窗口
+    closeDialog() {
+      this.$emit('close', false)
     },
-    methods: {
-        handleActionEvent ({ key }) {
-            switch (key) {
-                case 'cancel':
-                    this.closeDialog()
-                    break
-                case 'confirm':
-                    this.confirmMsg()
-                    break
-                case 'viewDetails':
-                    this.$refs.innerMessage.handleDifferentTab()
-                    break
-                default:
-                    break
+    // 获取表单数据
+    getFormData() {
+      return this.$refs.innerMessage.getFormData()
+    },
+    // getId (arr) {
+    //     if (!arr.length) {
+    //         return ''
+    //     }
+    //     const idArrs = arr.map(item => item.id)
+    //     return idArrs.join(',')
+    // },
+    // 消息确认,受控文件用
+    confirmMsg() {
+      // TODO
+      this.$confirm(
+        '点击确认将在系统里“文件与记录”模块下的“受控文件查阅”查看到所通知文件的具体信息',
+        '提示',
+        {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning',
+          showClose: false,
+          closeOnClickModal: false
+        }
+      )
+        .then(() => {
+          // TODO 受控文件逻辑处理
+          const { position, userId, name } = this.$store.getters || {}
+          if (!position) {
+            return this.$message.warning(
+              '系统所登录的账户并没有所属部门,请先在系统设置完再进行确认!'
+            )
+          }
+          // 判断签字图文是否存在
+          const sql1 = `select qian_zi_tu_wen_ FROM t_ryjbqk WHERE parent_id_ = '${userId}'`
+          // 判断是否已经点击过确认
+          const sql2 = `select id_ FROM ibps_msg_read WHERE msg_id_ = '${this.id}' and receiver_id_='${userId}'`
+          Promise.all([
+            this.$common.request('sql', sql1),
+            this.$common.request('sql', sql2)
+          ]).then((res) => {
+            const ryjbqkDatas = res[0].variables.data
+            const cont2 = res[1].variables.data
+            if (!ryjbqkDatas.length) {
+              return this.$message.warning(
+                '系统所登录的账户并没有签字图文在系统,请先上传系统再进行确认!'
+              )
             }
-        },
-        // 关闭当前窗口
-        closeDialog () {
-            this.$emit('close', false)
-        },
-        // 获取表单数据
-        getFormData () {
-            this.$nextTick(() => {
-                this.$refs.innerMessage.getFormData()
-                // this.handleCallback(true)
-            })
-        },
-        // getId (arr) {
-        //     if (!arr.length) {
-        //         return ''
-        //     }
-        //     const idArrs = arr.map(item => item.id)
-        //     return idArrs.join(',')
-        // },
-        // 消息确认,受控文件用
-        confirmMsg () {
-            // TODO
-            this.$confirm('点击确认将在系统里“文件与记录”模块下的“受控文件查阅”查看到所通知文件的具体信息', '提示', {
-                confirmButtonText: '确定',
-                cancelButtonText: '取消',
-                type: 'warning',
-                showClose: false,
-                closeOnClickModal: false
-            }).then(() => {
-                // TODO 受控文件逻辑处理
-                const { position, userId, name } = this.$store.getters || {}
-                if (!position) {
-                    return this.$message.warning('系统所登录的账户并没有所属部门,请先在系统设置完再进行确认!')
-                }
-                // 判断签字图文是否存在
-                const sql1 = `select qian_zi_tu_wen_ FROM t_ryjbqk WHERE parent_id_ = '${userId}'`
-                // 判断是否已经点击过确认
-                const sql2 = `select id_ FROM ibps_msg_read WHERE msg_id_ = '${this.id}' and receiver_id_='${userId}'`
-                Promise.all([this.$common.request('sql', sql1), this.$common.request('sql', sql2)]).then((res) => {
-                    const ryjbqkDatas = res[0].variables.data
-                    const cont2 = res[1].variables.data
-                    if (!ryjbqkDatas.length) {
-                        return this.$message.warning('系统所登录的账户并没有签字图文在系统,请先上传系统再进行确认!')
-                    }
-                    if (!cont2.length) {
-                        const tempObj = {
-                            id_: this.$utils.guid(),
-                            parent_id_: this.tableId,
-                            tong_zhi_bu_men_: position,
-                            que_ren_qian_ming: JSON.stringify([{
-                                id: ryjbqkDatas[0].qian_zi_tu_wen_,
-                                fileName: '确认签名'
-                            }]),
-                            que_ren_ri_qi_: this.$common.getDateNow(10),
-                            que_ren_ren_xing_: name
-                        }
-                        const returnParams = {
-                            tableName: this.tableName.slice(0, this.tableName.indexOf('(')), // 字符串 "表名(发放时间)"
-                            paramWhere: [tempObj]
-                        }
-                        // 获取所发放的文件
-                        // const files = this.$refs.innerMessage.form.fileMsg
-                        // const addwjcysqbs = []
-                        // const { userId = '' } = this.$store.getters
-                        // files.split(',').forEach(i => {
-                        //     const addwjcysqb = {
-                        //         yong_hu_id_: userId,
-                        //         wen_jian_id_: i,
-                        //         shou_quan_: '1',
-                        //         fa_bu_ri_qi_: this.tableName.slice(this.tableName.indexOf('(') + 1, this.tableName.lastIndexOf(')'))
-                        //     }
-                        //     addwjcysqbs.push(addwjcysqb)
-                        // })
-                        this.$common.request('add', returnParams).then(() => { console.log('确认接收到发放文件') }).then(() => {
-                            this.type = ''
-                            this.getFormData()
-                        })
-                    }
+            if (!cont2.length) {
+              const tempObj = {
+                id_: this.$utils.guid(),
+                parent_id_: this.tableId,
+                tong_zhi_bu_men_: position,
+                que_ren_qian_ming: JSON.stringify([
+                  {
+                    id: ryjbqkDatas[0].qian_zi_tu_wen_,
+                    fileName: '确认签名'
+                  }
+                ]),
+                que_ren_ri_qi_: this.$common.getDateNow(10),
+                que_ren_ren_xing_: name
+              }
+              const returnParams = {
+                tableName: this.tableName.slice(
+                  0,
+                  this.tableName.indexOf('(')
+                ), // 字符串 "表名(发放时间)"
+                paramWhere: [tempObj]
+              }
+              // 获取所发放的文件
+              // const files = this.$refs.innerMessage.form.fileMsg
+              // const addwjcysqbs = []
+              // const { userId = '' } = this.$store.getters
+              // files.split(',').forEach(i => {
+              //     const addwjcysqb = {
+              //         yong_hu_id_: userId,
+              //         wen_jian_id_: i,
+              //         shou_quan_: '1',
+              //         fa_bu_ri_qi_: this.tableName.slice(this.tableName.indexOf('(') + 1, this.tableName.lastIndexOf(')'))
+              //     }
+              //     addwjcysqbs.push(addwjcysqb)
+              // })
+              this.$common
+                .request('add', returnParams)
+                .then(() => {
+                  console.log('确认接收到发放文件')
+                })
+                .then(() => {
+                  this.type = ''
+                  this.getFormData().then(() => {
+                    this.closeDialog()
+                  })
                 })
-                this.closeDialog()
-            }).catch(() => { })
-        },
-        handleCallback (res) {
-            this.$emit('callback', res)
-        },
-        acquire(res){
-            let mid = { key: 'viewDetails', label: '查看详情', type: 'danger', icon: 'ibps-icon-search' }
-            if(res){
-                let indexNum = this.toolbars.findIndex(i=>i.key == mid.key)
-                if(indexNum == -1){
-                    this.toolbars.unshift(mid)
-                }
-            }else{
-                let indexNum = this.toolbars.findIndex(i=>i.key == mid.key)
-                if(indexNum != -1){
-                    this.toolbars.splice(indexNum,1)
-                }
+            } else {
+              this.closeDialog()
             }
+          })
+        })
+        .catch(() => {})
+    },
+    handleCallback(res) {
+      this.$emit('callback', res)
+    },
+    acquire(res) {
+      const mid = {
+        key: 'viewDetails',
+        label: '查看详情',
+        type: 'danger',
+        icon: 'ibps-icon-search'
+      }
+      if (res) {
+        const indexNum = this.toolbars.findIndex((i) => i.key == mid.key)
+        if (indexNum == -1) {
+          this.toolbars.unshift(mid)
+        }
+      } else {
+        const indexNum = this.toolbars.findIndex((i) => i.key == mid.key)
+        if (indexNum != -1) {
+          this.toolbars.splice(indexNum, 1)
         }
+      }
     }
+  }
 }
 </script>
 <style lang="scss">
 .inner-dialog {
-    .el-dialog__body {
-        padding: 20px 20px;
-        height: calc(40vh) !important;
-    }
+  .el-dialog__body {
+    padding: 20px 20px;
+    height: calc(40vh) !important;
+  }
 
-    .list {
-        .el-form-item__content {
-            margin-left: 0px !important;
+  .list {
+    .el-form-item__content {
+      margin-left: 0px !important;
 
-            .el-table--border {
-                height: 300px !important;
-            }
-        }
+      .el-table--border {
+        height: 300px !important;
+      }
     }
+  }
 
-    .ibps-container-crud__header {
-        display: none;
-    }
+  .ibps-container-crud__header {
+    display: none;
+  }
 }
 
 .inside-dialog {
-    .el-dialog__body {
-        padding: 20px 20px;
-        height: calc(50vh - 110px) !important;
-    }
+  .el-dialog__body {
+    padding: 20px 20px;
+    height: calc(50vh - 110px) !important;
+  }
 }
 </style>

+ 303 - 284
src/views/platform/message/inner/detail/index.vue

@@ -1,38 +1,40 @@
 <template>
-    <el-form
-        ref="form"
-        v-loading="loading"
-        :element-loading-text="$t('common.loading')"
-        :label-width="formLabelWidth"
-        class="inner-detail"
-        @submit.native.prevent
-    >
-        <el-row>
-            <el-col :span="12">
-                <el-form-item label="主题:">
-                    <div class="text-border">{{ form.subject }}</div>
-                </el-form-item>
-            </el-col>
-            <el-col :span="12">
-                <el-form-item label="创建时间:">
-                    <div class="text-border">{{ form.createTime | dateFormat }}</div>
-                </el-form-item>
-            </el-col>
-            <el-col :span="12">
-                <el-form-item label="发送人:">
-                    <div class="text-border">{{ form.ownerName }}</div>
-                </el-form-item>
-            </el-col>
-            <el-col :span="12">
-                <el-form-item label="消息类型:">
-                    <div class="text-border">
-                        <el-tag :type="form.messageType | optionsFilter(typeOptions, 'type')">
-                            {{ form.messageType | optionsFilter(typeOptions, 'label') }}
-                        </el-tag>
-                    </div>
-                </el-form-item>
-            </el-col>
-            <!-- <el-col v-if="judgeTF(form)" :span="12">
+  <el-form
+    ref="form"
+    v-loading="loading"
+    :element-loading-text="$t('common.loading')"
+    :label-width="formLabelWidth"
+    class="inner-detail"
+    @submit.native.prevent
+  >
+    <el-row>
+      <el-col :span="12">
+        <el-form-item label="主题:">
+          <div class="text-border">{{ form.subject }}</div>
+        </el-form-item>
+      </el-col>
+      <el-col :span="12">
+        <el-form-item label="创建时间:">
+          <div class="text-border">{{ form.createTime | dateFormat }}</div>
+        </el-form-item>
+      </el-col>
+      <el-col :span="12">
+        <el-form-item label="发送人:">
+          <div class="text-border">{{ form.ownerName }}</div>
+        </el-form-item>
+      </el-col>
+      <el-col :span="12">
+        <el-form-item label="消息类型:">
+          <div class="text-border">
+            <el-tag
+              :type="form.messageType | optionsFilter(typeOptions, 'type')"
+            >
+              {{ form.messageType | optionsFilter(typeOptions, 'label') }}
+            </el-tag>
+          </div>
+        </el-form-item>
+      </el-col>
+      <!-- <el-col v-if="judgeTF(form)" :span="12">
                 <el-form-item v-if="showDialog==true" :label="fontText[JSON.parse(form.skipTypeMsg).skipType-1]">
                     <el-button
                         :type="form.messageType | optionsFilter(typeOptions, 'type')"
@@ -40,49 +42,55 @@
                     >点击</el-button>
                 </el-form-item>
             </el-col> -->
-            <el-col :span="12">
-                <el-form-item
-                    label="是否公告:"
-                    :hidden="type"
-                >
-                    <div class="text-border">
-                        <el-tag :type="form.isPublic | optionsFilter(publicOrCanreplyOptions, 'type')">
-                            {{ form.isPublic | optionsFilter(publicOrCanreplyOptions, 'label') }}
-                        </el-tag>
-                    </div>
-                </el-form-item>
-            </el-col>
-            <el-col :span="12">
-                <el-form-item
-                    label="是否可回复:"
-                    :hidden="type"
-                >
-                    <div class="text-border">
-                        <el-tag :type="form.canreply | optionsFilter(publicOrCanreplyOptions, 'type')">
-                            {{ form.canreply | optionsFilter(publicOrCanreplyOptions, 'label') }}
-                        </el-tag>
-                    </div>
-                </el-form-item>
-            </el-col>
-            <el-col :span="24">
-                <el-form-item label="消息内容:">
-                    <span
-                        class="original-content"
-                        v-html="$utils.formatText(form.content)"
-                    />
-                </el-form-item>
-            </el-col>
-            <el-col :span="24">
-                <el-form-item label="附件:">
-                    <ibps-attachment-selector
-                        v-model="form.fileMsg"
-                        :download="!readonly"
-                        :readonly="readonly"
-                        multiple
-                    />
-                </el-form-item>
-            </el-col>
-            <!-- <el-col v-if="!inside" :span="24">
+      <el-col :span="12">
+        <el-form-item label="是否公告:" :hidden="type">
+          <div class="text-border">
+            <el-tag
+              :type="
+                form.isPublic | optionsFilter(publicOrCanreplyOptions, 'type')
+              "
+            >
+              {{
+                form.isPublic | optionsFilter(publicOrCanreplyOptions, 'label')
+              }}
+            </el-tag>
+          </div>
+        </el-form-item>
+      </el-col>
+      <el-col :span="12">
+        <el-form-item label="是否可回复:" :hidden="type">
+          <div class="text-border">
+            <el-tag
+              :type="
+                form.canreply | optionsFilter(publicOrCanreplyOptions, 'type')
+              "
+            >
+              {{
+                form.canreply | optionsFilter(publicOrCanreplyOptions, 'label')
+              }}
+            </el-tag>
+          </div>
+        </el-form-item>
+      </el-col>
+      <el-col :span="24">
+        <el-form-item label="消息内容:">
+          <span
+            class="original-content"
+            v-html="$utils.formatText(form.content)"
+          />
+        </el-form-item>
+      </el-col>
+      <el-col :span="24">
+        <el-form-item label="附件:">
+          <ibps-attachment-selector
+            v-model="form.fileMsg"
+            :download="!readonly"
+            :readonly="readonly"
+            multiple
+          />
+        </el-form-item>
+      </el-col>
+      <!-- <el-col v-if="!inside" :span="24">
                 <el-form-item class="list">
                     <el-tabs v-model="activeName" class="detail" @tab-click="handleClick">
                         <el-tab-pane label="已回复信息列表" name="replied" style="height:300px;">
@@ -94,14 +102,14 @@
                     </el-tabs>
                 </el-form-item>
             </el-col> -->
-        </el-row>
-        <bpmn-formrender
-            :visible="dialogFormVisible"
-            :task-id="taskId"
-            :instance-id="instanceId"
-            @close="visible => dialogFormVisible = visible"
-        />
-        <!-- <data-template-formrender-dialog
+    </el-row>
+    <bpmn-formrender
+      :visible="dialogFormVisible"
+      :task-id="taskId"
+      :instance-id="instanceId"
+      @close="(visible) => (dialogFormVisible = visible)"
+    />
+    <!-- <data-template-formrender-dialog
             :visible="dialogformrenderVisible"
             :form-key="formKey"
             :default-data="defaultFormData"
@@ -110,8 +118,8 @@
             :readonly="readonly"
             @close="visible => dialogformrenderVisible = visible"
         /> -->
-        <!-- @callback="search" -->
-    </el-form>
+    <!-- @callback="search" -->
+  </el-form>
 </template>
 
 <script>
@@ -124,222 +132,233 @@ import ReplyList from './reply-list'
 import DataTemplateFormrenderDialog from '@/business/platform/data/templaterender/form/dialog'
 
 export default {
-    components: {
-        ReadedList,
-        IbpsAttachmentSelector,
-        ReplyList,
-        DataTemplateFormrenderDialog
+  components: {
+    ReadedList,
+    IbpsAttachmentSelector,
+    ReplyList,
+    DataTemplateFormrenderDialog
+  },
+  props: {
+    inside: {
+      type: Boolean,
+      default: false
+    },
+    visible: {
+      type: Boolean,
+      default: false
+    },
+    readonly: {
+      type: Boolean,
+      default: false
     },
-    props: {
-        inside: {
-            type: Boolean,
-            default: false
-        },
-        visible: {
-            type: Boolean,
-            default: false
-        },
-        readonly: {
-            type: Boolean,
-            default: false
-        },
 
-        id: String,
-        title: String,
-        type: String,
-        getform: {
-            type: Function,
-            default: () => {}
-        }
+    id: String,
+    title: String,
+    type: String,
+    getform: {
+      type: Function,
+      default: () => {}
+    }
+  },
+  data() {
+    return {
+      activeName: 'replied',
+      formLabelWidth: '120px',
+      typeOptions: typeOptions,
+      publicOrCanreplyOptions: publicOrCanreplyOptions,
+      loading: false,
+      form: {},
+      fileSrc: '',
+      fileTitle: '',
+      instanceId: '',
+      dialogFormVisible: false, // 弹窗
+      // dialogformrenderVisible: false,
+      taskId: '', // 编辑dialog需要使用
+      fontText: ['明细:', '流程:', '路由:', '表单:'],
+      showDialog: false
+      // formKey: 'snwsdjkjlb',
+      // defaultFormData: {},
+      // pkValue: '',
+      // editToolbars: [
+      //     {
+      //         button_type: 'close',
+      //         label: '关闭',
+      //         key: 'close'
+      //     },
+      //     {
+      //         button_type: 'save',
+      //         label: '提交',
+      //         key: 'save',
+      //         icon: 'el-icon-finished'
+      //     }
+      // ],
+      // readonly: false
+    }
+  },
+  computed: {
+    formId() {
+      return this.id
+    }
+  },
+  watch: {
+    showDialog: {
+      handler(val, oldVal) {
+        this.$emit('judgeIndex', val)
+      }
+      // immediate: true
     },
-    data () {
-        return {
-            activeName: 'replied',
-            formLabelWidth: '120px',
-            typeOptions: typeOptions,
-            publicOrCanreplyOptions: publicOrCanreplyOptions,
-            loading: false,
-            form: {},
-            fileSrc: '',
-            fileTitle: '',
-            instanceId: '',
-            dialogFormVisible: false, // 弹窗
-            // dialogformrenderVisible: false,
-            taskId: '', // 编辑dialog需要使用
-            fontText: ['明细:', '流程:', '路由:', '表单:'],
-            showDialog: false
-            // formKey: 'snwsdjkjlb',
-            // defaultFormData: {},
-            // pkValue: '',
-            // editToolbars: [
-            //     {
-            //         button_type: 'close',
-            //         label: '关闭',
-            //         key: 'close'
-            //     },
-            //     {
-            //         button_type: 'save',
-            //         label: '提交',
-            //         key: 'save',
-            //         icon: 'el-icon-finished'
-            //     }
-            // ],
-            // readonly: false
-        }
+    form: {
+      handler(val, oldVal) {
+        this.judgeTF(val)
+      },
+      immediate: true,
+      deep: true
+    }
+  },
+  methods: {
+    handleClick(tab, event) {
+      this.$refs['readedList'].loadData()
     },
-    computed: {
-        formId () {
-            return this.id
-        }
+    // 流程
+    handleEdit(id) {
+      this.taskId = id
+      this.dialogFormVisible = true
+    },
+    // 明细
+    handleLinkClick(data) {
+      this.instanceId = data
+      this.dialogFormVisible = true
+    },
+    // 路由
+    handleRouterSkip(way) {
+      this.$router.push(`${way}`)
     },
-    watch:{
-        showDialog: {
-            handler(val, oldVal) {
-                this.$emit('judgeIndex', val)
-            },
-            // immediate: true
-        },
-        form: {
-            handler(val, oldVal) {
-                this.judgeTF(val)
-            },
-            immediate: true,
-            deep: true
-        },
+    // 无流程表单
+    // handleFlowlessForm(way){
+    //     this.dialogformrenderVisible = true
+    // },
+    handleDifferentTab() {
+      const objNum = this.form
+      const stm = JSON.parse(objNum.skipTypeMsg)
+      const tid = stm.pathInfo ? stm.pathInfo : objNum.taskId
+      switch (stm.skipType) {
+        case 1: // 明细
+          this.handleLinkClick(stm.pathInfo)
+          break
+        case 2: // 流程
+          this.handleEdit(tid)
+          break
+        case 3: // 路由
+          this.handleRouterSkip(stm.pathInfo)
+          break
+        // case 4:// 表单
+        //     this.handleFlowlessForm(stm.pathInfo)
+        //     break
+        default:
+          break
+      }
     },
-    methods: {
-        handleClick (tab, event) {
+    // search() {
+    //     this.loadData()
+    // },
+    /**
+     * 获取表单数据
+     */
+    getFormData() {
+      this.activeName = 'replied'
+      this.form = ''
+      this.loading = true
+      return get({
+        innerMessageId: this.formId,
+        type: this.type || '' // 是否为空值,来决定消息是否要已读:空就已读,非空就未读
+      })
+        .then((response) => {
+          this.form = response.data
+          if (this.$refs['replyList']) {
+            this.$refs['replyList'].loadData()
+          }
+          if (this.$refs['readedList']) {
             this.$refs['readedList'].loadData()
-        },
-        // 流程
-        handleEdit (id) {
-            this.taskId = id
-            this.dialogFormVisible = true
-        },
-        // 明细
-        handleLinkClick (data) {
-            this.instanceId = data
-            this.dialogFormVisible = true
-        },
-        // 路由
-        handleRouterSkip (way) {
-            this.$router.push(`${way}`)
-        },
-        // 无流程表单
-        // handleFlowlessForm(way){
-        //     this.dialogformrenderVisible = true
-        // },
-        handleDifferentTab () {
-            let objNum = this.form
-            const stm = JSON.parse(objNum.skipTypeMsg)
-            const tid = stm.pathInfo ? stm.pathInfo :objNum.taskId
-            switch (stm.skipType) {
-                case 1:// 明细
-                    this.handleLinkClick(stm.pathInfo)
-                    break
-                case 2:// 流程
-                    this.handleEdit(tid)
-                    break
-                case 3:// 路由
-                    this.handleRouterSkip(stm.pathInfo)
-                    break
-                // case 4:// 表单
-                //     this.handleFlowlessForm(stm.pathInfo)
-                //     break
-                default:
-                    break
-            }
-        },
-        // search() {
-        //     this.loadData()
-        // },
-        /**
-         * 获取表单数据
-         */
-        getFormData () {
-            this.activeName = 'replied'
-            this.form = ''
-            this.loading = true
-            get({
-                innerMessageId: this.formId,
-                type: this.type || '' // 是否为空值,来决定消息是否要已读:空就已读,非空就未读
-            }).then(response => {
-                this.form = response.data
-                if (this.$refs['replyList']) { this.$refs['replyList'].loadData() }
-                if (this.$refs['readedList']) { this.$refs['readedList'].loadData() }
-                const { fileMsg } = this.form
-                this.fileSrc = fileMsg && fileMsg.src ? fileMsg.src : ''
-                this.fileTitle = fileMsg && fileMsg.src ? fileMsg.src : ''
-                this.loading = false
-                if (!this.type) {
-                    this.$emit('callback', true)
-                }
-            }).catch(() => {
-                this.loading = false
-            })
-        },
-        judgeTF (form) {
-            if (form.skipTypeMsg) {
-                try {
-                    const obj = JSON.parse(form.skipTypeMsg)
-                    if (typeof obj === 'object' && obj) {
-                        if (obj.skipType > 0) {
-                            if (obj.skipType === 1) {
-                                this.showDialog = true
-                            } else if (obj.skipType === 2 ) {
-                                let canshu = form.taskId ? form.taskId : JSON.parse(form.skipTypeMsg).pathInfo
-                                const sql = "select count(id_) as num from ibps_bpm_task_pendding where task_id_='" + canshu + "'"
-                                curdPost('sql', sql).then(res => {
-                                    if (res.variables.data[0].num > 0) {
-                                        this.showDialog = true
-                                    } else {
-                                        this.showDialog = false
-                                    }
-                                })
-                            } else if (obj.skipType === 3) {
-                                this.showDialog = true
-                            }
-                            // else if(obj.skipType==4){
-                            //     this.showDialog = true;
-                            // }
-                            else {
-                                this.showDialog = false
-                            }
-                        } else {
-                            this.showDialog = false
-                        }
-                    } else {
-                        this.showDialog = false
-                    }
-                } catch (e) {
+          }
+          const { fileMsg } = this.form
+          this.fileSrc = fileMsg && fileMsg.src ? fileMsg.src : ''
+          this.fileTitle = fileMsg && fileMsg.src ? fileMsg.src : ''
+          this.loading = false
+          if (!this.type) {
+            this.$emit('callback', true)
+          }
+          return 1
+        })
+        .catch(() => {
+          this.loading = false
+        })
+    },
+    judgeTF(form) {
+      if (form.skipTypeMsg) {
+        try {
+          const obj = JSON.parse(form.skipTypeMsg)
+          if (typeof obj === 'object' && obj) {
+            if (obj.skipType > 0) {
+              if (obj.skipType === 1) {
+                this.showDialog = true
+              } else if (obj.skipType === 2) {
+                const canshu = form.taskId
+                  ? form.taskId
+                  : JSON.parse(form.skipTypeMsg).pathInfo
+                const sql =
+                  "select count(id_) as num from ibps_bpm_task_pendding where task_id_='" +
+                  canshu +
+                  "'"
+                curdPost('sql', sql).then((res) => {
+                  if (res.variables.data[0].num > 0) {
+                    this.showDialog = true
+                  } else {
                     this.showDialog = false
-                }
-            } else {
+                  }
+                })
+              } else if (obj.skipType === 3) {
+                this.showDialog = true
+              }
+              // else if(obj.skipType==4){
+              //     this.showDialog = true;
+              // }
+              else {
                 this.showDialog = false
+              }
+            } else {
+              this.showDialog = false
             }
-            return true
+          } else {
+            this.showDialog = false
+          }
+        } catch (e) {
+          this.showDialog = false
         }
+      } else {
+        this.showDialog = false
+      }
+      return true
     }
-
+  }
 }
 </script>
 <style lang="scss">
 .inner-detail {
-    .original-content {
-        p {
-            margin: 0;
-        }
+  .original-content {
+    p {
+      margin: 0;
     }
+  }
 }
 
 .text-border {
-    color: #000000;
-    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.1), 0 0 0 0 rgba(0, 0, 0, 0.1),
-        0 0 0 0 rgba(0, 0, 0, 0.1), 0 1px 0px 0 rgba(0, 0, 0, 0.1);
-    padding-left: 5px;
-    min-height: 38px;
-    font-size: 16px;
-    text-align: center;
-    width: 80%;
+  color: #000000;
+  box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.1), 0 0 0 0 rgba(0, 0, 0, 0.1),
+    0 0 0 0 rgba(0, 0, 0, 0.1), 0 1px 0px 0 rgba(0, 0, 0, 0.1);
+  padding-left: 5px;
+  min-height: 38px;
+  font-size: 16px;
+  text-align: center;
+  width: 80%;
 }
 </style>