lidie 1 год назад
Родитель
Сommit
943f2a94ae

+ 5 - 4
src/business/platform/file/attachment/editFile/editor.vue

@@ -1,14 +1,14 @@
 <!--onlyoffice 编辑器-->
 <template>
-    <div>
-        <div id="editorDiv" ref="editor" class="nav" />
-    </div>
+    <div id="editorDiv" ref="editor" class="nav" />
 </template>
 
 <script>
 import { handleDocType } from './editor/editor.js'
 import { showView } from '@/api/platform/file/attachment'
 import { getToken } from '@/utils/auth'
+import { ref } from 'vue'
+
 export default {
     name: 'editor',
     props: {
@@ -29,6 +29,7 @@ export default {
             newId: '',
             timer: '',
             configKey: ''
+
         }
     },
     watch: {
@@ -138,7 +139,7 @@ export default {
                 width: '100%',
                 token: getToken(),
                 // 减去弹窗的顶部标题区域
-                height: document.body.clientHeight - 56 + 'px'
+                height: document.body.clientHeight - 63 + 'px'
             }
             const docEditor = new DocsAPI.DocEditor('editorDiv', config)
             this.configKey = config.document.key

+ 223 - 0
src/views/component/fileTraining/fileDialog.vue

@@ -0,0 +1,223 @@
+<template>
+    <el-dialog
+        width="80%"
+        title="文件信息"
+        :visible="innerVisible"
+        append-to-body
+        :close-on-click-modal="false"
+        @close="closeDiag"
+    >
+        <!--  close-on-click-modal="false"//禁止点击遮罩层关闭弹窗。 -->
+        <!-- $emit('update-inner-visible', false) -->
+        <el-row class="row">
+            <el-col :span="12">
+                <el-row>
+                    <el-col :span="5" class="nameClass">文件名称:</el-col>
+                    <el-col :span="19" class="contentClass">{{ digData?digData.FILE_NAME_:'/' }}</el-col>
+                </el-row>
+            </el-col>
+            <el-col :span="12">
+                <el-row>
+                    <el-col :span="5" class="nameClass">版本号:</el-col>
+                    <el-col :span="19" class="contentClass">{{ digData?(digData.ban_ben_?digData.ban_ben_:(digData.xiu_ding_ban_ben_?digData.xiu_ding_ban_ben_:'/')):'/' }}</el-col>
+                </el-row>
+            </el-col>
+        </el-row>
+        <el-row class="row">
+            <el-col :span="12">
+                <el-row>
+                    <el-col :span="5" class="nameClass">修订人:</el-col>
+                    <el-col :span="19" class="contentClass">{{ digData?(digData.fileInfos.CREATOR_NAME_?digData.fileInfos.CREATOR_NAME_:'/'):'/' }}</el-col>
+                </el-row>
+            </el-col>
+            <el-col :span="12">
+                <el-row>
+                    <el-col :span="5" class="nameClass">修订日期:</el-col>
+                    <el-col :span="19" class="contentClass">{{ digData?(digData.fileInfos.CREATE_TIME_?formattedTimestamp(digData.fileInfos.CREATE_TIME_):'/'):'/' }}</el-col>
+                </el-row>
+            </el-col>
+        </el-row>
+        <el-row v-if="fileIndex>0" class="row">
+            <el-col :span="12" class="nameClass">修订内容:</el-col>
+            <el-col :span="12" class="contentClass">{{ digData.xiu_ding_nei_rong?digData.xiu_ding_nei_rong:'/' }}</el-col>
+        </el-row>
+        <el-row v-if="fileIndex>0" class="row">
+            <el-col :span="12" class="nameClass">修订原因:</el-col>
+            <el-col :span="12" class="contentClass">{{ digData.yuan_yin_?digData.yuan_yin_:'/' }}</el-col>
+        </el-row>
+        <el-table
+            :data="listData"
+            stripe
+            border
+            max-height="380px"
+            highlight-current-row
+            style="width: 100%;padding:10px;"
+        >
+            <el-table-column
+                label="姓名"
+                width="300"
+            >
+                <template slot-scope="scope">
+                    <span style="margin-left: 10px">{{ changUserName(scope.row.create_by_) }}</span>
+                </template>
+            </el-table-column>
+            <el-table-column
+                label="阅读时间"
+                width="300"
+            >
+                <template slot-scope="scope">
+                    <span style="margin-left: 10px">{{ formattedTimestamp(scope.row.create_time_) }}</span>
+                </template>
+            </el-table-column>
+            <el-table-column
+                label="阅读时长"
+            >
+                <template slot-scope="scope">
+                    <span style="margin-left: 10px">{{ formatDuration(scope.row.shi_chang_) }}</span>
+                </template>
+            </el-table-column>
+        </el-table>
+        <el-pagination
+            style="margin-top: 5px; padding-bottom: 10px"
+            :current-page="currentPage"
+            :page-sizes="[10, 20,30, 50,100]"
+            :page-size="pageSize"
+            layout="prev,pager,next,jumper,sizes,->,total"
+            :total="showList.length"
+            @size-change="handleSizeChange"
+            @current-change="handleCurrentChange"
+        />
+    </el-dialog>
+</template>
+<script>
+export default {
+    props: {
+        showList: {
+            type: Array,
+            default: () => []
+        },
+        digData: {
+            type: Object,
+            default: () => {}
+        },
+        innerVisible: {
+            type: Boolean,
+            default: false
+        },
+        fileIndex: {
+            type: Number }
+    },
+    data () {
+        const { userList } = this.$store.getters
+        return {
+            userList: userList,
+            listData: [],
+            currentPage: 1,
+            pageSize: 10,
+            timer: null
+        }
+    },
+    watch: {
+        innerVisible: {
+            immediate: true,
+            handler (val) {
+                if (val) {
+                    this.updateShowList()
+                }
+            }
+        }
+    },
+    mounted () {
+        this.setInterfaceTime()
+    },
+    methods: {
+        updateShowList () {
+            const start = (this.currentPage - 1) * this.pageSize
+            const end = start + this.pageSize
+            this.listData = this.showList.slice(start, end)
+        },
+        handleSizeChange (val) {
+            this.pageSize = val
+            this.updateShowList()
+        },
+        handleCurrentChange (val) {
+            this.currentPage = val
+            this.updateShowList()
+        },
+        // 定时器
+        setInterfaceTime () {
+            this.timer = setTimeout(() => {
+                this.$emit('pause')
+            }, 5000)
+        },
+        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}`
+        },
+        // id转name
+        changUserName (id) {
+            const user = this.userList.find(item => item.userId === id)
+            if (user) {
+                return user.userName
+            }
+        },
+        // 查阅时长的转化
+        formatDuration (data) {
+            // 定义变量
+            let hours = 0
+            let minutes = 0
+            let seconds = data
+
+            // 处理大于 60 分钟的情况
+            if (data >= 3600) { // 3600 秒 = 1 小时
+                hours = Math.floor(data / 3600)
+                data %= 3600
+            }
+
+            // 处理大于 60 秒的情况
+            if (data >= 60) {
+                minutes = Math.floor(data / 60)
+                seconds = data % 60
+            }
+
+            // 格式化输出
+            const formattedHours = hours > 0 ? `${hours}小时` : ''
+            const formattedMinutes = minutes > 0 ? `${minutes}分钟` : ''
+            const formattedSeconds = seconds > 0 ? `${seconds}秒` : ''
+
+            // 返回格式化的字符串
+            return `${formattedHours}${formattedMinutes}${formattedSeconds}`
+        },
+        closeDiag () {
+            this.$emit('update-inner-visible', false)
+            this.$emit('start')
+            clearTimeout(this.timer)
+        }
+    }
+
+}
+</script>
+<style scoped lang="scss">
+        .row{
+            padding: 1% 2%;
+           .nameClass{
+            font-size: 16px;
+            color: #555;
+            font-weight: 600;
+           }
+           .contentClass{
+            font-size: 16px;
+            color: #777;
+           }
+        }
+</style>
+

+ 373 - 32
src/views/component/fileTraining/index.vue

@@ -7,16 +7,80 @@
  * @LastEditTime: 2024-04-26 16:04:02
 -->
 <template>
-    <el-dialog
+    <!-- <el-dialog
         :visible.sync="dialogVisible"
-        :title="title"
         fullscreen
+        :title="title"
         append-to-body
         custom-class="ibps-file-preview-dialog"
     >
         <div>
             <fView v-if="refresh" ref="fvView" :option-file="optionFile" :operation_status="operation_status" @hadLoadedFile="hadLoadedFile" />
         </div>
+    </el-dialog> -->
+
+    <!--个人修改  -->
+    <el-dialog
+        :visible.sync="dialogVisible"
+        fullscreen
+        append-to-body
+        custom-class="ibps-file-preview-dialog"
+    >
+        <template #title>
+            <el-row>
+                <el-col :span="12">{{ title }}</el-col>
+                <el-col :span="4">阅读量:{{ lookNum }}</el-col>
+                <el-col :span="8" style="text-align: center;">
+                    <el-button type="primary" @click="lookFile">查看文件信息</el-button>
+                    <el-button type="primary" @click="hideLeft">左侧内容</el-button>
+                    <el-button type="primary" @click="updateFile">下载文件</el-button>
+                    <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 slot="reference" type="danger" style="margin-left:10px;">删除</el-button>
+                    </el-popover>
+                </el-col>
+            </el-row>
+        </template>
+        <div>
+            <el-row>
+                <el-col v-if="leftShow" :span="4" class="left-content">
+                    <el-timeline :reverse="reverse">
+                        <el-timeline-item
+                            v-for="(activity, index) in leftData"
+                            :key="index"
+                            :timestamp="activity.fa_fang_shi_jian_"
+                            @click.stop.native="toggleActive(activity, index)"
+                        >
+                            <div>
+                                <el-tooltip class="item" effect="dark" placement="right-end" :content="showContent(activity,index)">
+                                    <div>版本号:{{ activity.ban_ben_ }}/修订人:{{ activity.fileInfos.CREATOR_NAME_ }}</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" @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>
@@ -34,20 +98,30 @@
 import fView from '@/business/platform/file/attachment/editFile/fView.vue'
 import { SYSTEM_URL, BASE_API } from '@/api/baseUrl'
 import ViewFile from '@/views/viewFile/index.vue'
-
+import Template from '@/business/platform/form/form-print/template.vue'
+import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
+import FileDialog from './fileDialog.vue'
+// 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
+        ViewFile,
+        Template,
+        FileDialog
     },
     props: {
         visible: {
             type: Boolean,
             default: false
         },
+        // fileInfos: {
+        //     type: Object,
+        //     default: () => {}
+        // },
         fileInfos: {
-            type: Object,
+            type: Array,
             default: () => {}
         }
         // template: {
@@ -56,7 +130,10 @@ export default {
         // }
     },
     data () {
+        const { userList, userId, role, isSuper } = this.$store.getters
+        // const userId = this.$store.getters.userInfo.employee.id// 本人修改
         return {
+            curFileName: '',
             dialogVisible: false,
             operation_status: 'fileTraining',
             title: '',
@@ -68,40 +145,120 @@ export default {
             height: 0,
             out: false, // 记录鼠标是否离开过被监听的位置,未离开过则startTimer不启用
             hadLoad: false,
-            refresh: false
+            refresh: false,
+            // 本人修改
+            leftShow: true,
+            scrollTimeout: null,
+            reverse: false,
+            fileInfo: '',
+            fileJie: '',
+            leftData: [],
+            activeIndex: null,
+            userList: userList,
+            userId: userId,
+            innerVisible: false,
+            currentPage: 1,
+            pageSize: 10,
+            lookNum: null,
+            showList: [],
+            digData: null,
+            paused: false,
+            role: role,
+            isSuper: isSuper,
+            deleteVisible: false
+
         }
     },
+    // 本人修改
+    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]
+            }
+        },
+        // fileInfos: {
+        //     handler: function (val, oldVal) {
+        //         this.dialogVisible = this.visible
+        //         this.title = `文件:《${val.FILE_NAME_}》`
+        //         this.tmpId = val.id
+        //         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_
+        //         }
+        //         // 1、获取文件数据 及下载流接口
+        //         this.optionFile.url = BASE_API() + SYSTEM_URL() + '/file/download?attachmentId=' + data.id
+        //         this.optionFile.editUrl = BASE_API() + SYSTEM_URL() + '/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
+        //         })
+        //         // 本人修改2
+        //         // const sql = `select * from t_wjxxb WHERE tou_ban_wen_jian_='${val.id}'`
+        //         // this.$common.request('sql', sql).then((res) => {
+        //         //     this.fileInfo = res.variables.data[0]
+        //         //     this.fileJie = res.variables.data[0].jie_gai_jie_xi_
+        //         // })
+
+        //         // 本人修改,获取更新数据
+        //         const sql1 = `select * from t_wjxxgxb where yuan_wen_jian_id_= '${val.id}'`
+        //         const sql2 = `select * from t_wjxxb where id_= '${val.id}'`
+        //         Promise.all([this.$common.request('sql', sql2), this.$common.request('sql', sql1)]).then(([res1, res2]) => {
+        //             this.leftData = res1.variables.data
+        //             const arr = res2.variables.data
+        //             arr.forEach(el => {
+        //                 el['ban_ben_'] = res1.variables.data[0].ban_ben_
+        //                 this.leftData.push(el)
+        //             })
+        //         })
+        //     },
+        //     deep: true// 深度监听,确保对象属性变化也能触发(本人修改)
+        // },
+        // 本人修改
         fileInfos: {
-            handler: function (val, oldVal) {
-                this.dialogVisible = this.visible
-                this.title = `文件:《${val.FILE_NAME_}》`
-                this.tmpId = val.id
-                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_
-                }
-                // 1、获取文件数据 及下载流接口
-                this.optionFile.url = BASE_API() + SYSTEM_URL() + '/file/download?attachmentId=' + data.id
-                this.optionFile.editUrl = BASE_API() + SYSTEM_URL() + '/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
+            handler (newVal) {
+                this.leftData = newVal
+                newVal.forEach(val => {
+                    this.fileShow(val)
                 })
-            }
+            },
+            deep: true, // 深度监听,确保对象属性变化也能触发(本人修改)
+            immediate: true
         },
+
         browseTime: {
             handler: function (val, oldVal) {
-                this.title = `文件:《 ${this.fileInfos.FILE_NAME_} 》,查阅时长:${val}秒`
+                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
         },
@@ -116,13 +273,24 @@ export default {
     beforeDestroy () {
         this.fileType = ''
         this.option = {}
+        // 本人修改
+        this.removeMouseMoveListener()
     },
     mounted () {
         this.height = this.getDialogHeightHeight()
         // 页面切换时改变计时状态
         document.addEventListener('visibilitychange', this.handlePageChange)
+        // 本人修改
+        this.checkDialogBody()
     },
     methods: {
+        showContent (activity, index) {
+            if (index <= 0) {
+                return '第一版'
+            }
+            return activity.xiu_ding_nei_rong ? activity.xiu_ding_nei_rong : '无修订原因'
+        },
+
         handlePageChange () {
             if (document.visibilityState === 'hidden') {
                 this.pauseTimer()
@@ -134,7 +302,10 @@ export default {
             const fvView = this.$refs.fvView
             // 销毁子组件方法
             fvView.destoryZiComponent()
-            this.upFunc(this.tmpId, this.browseTime)
+            if (this.browseTime >= 30) {
+                this.upFunc(this.tmpId, this.browseTime)
+            }
+
             // 针对关闭窗口或者浏览器的
             if (this.clearTimeSet != null) {
                 clearInterval(this.clearTimeSet)
@@ -142,6 +313,11 @@ export default {
             }
             this.out = false
             this.browseTime = 0
+            this.curFileName = ''// 本人添加
+            this.lookNum = null
+            this.showList = []
+            this.leftData = []
+            this.digData = null
         },
         hadLoadedFile (v) {
             this.setBrowseTime()
@@ -169,7 +345,165 @@ export default {
                 clearInterval(this.clearTimeSet)
                 this.clearTimeSet = null
             }
+        },
+        // 本人修改
+        toggleActive (activity, index) {
+            this.digData = activity
+            clearInterval(this.clearTimeSet)
+            this.browseTime = 0
+            // console.log('activity', activity)
+            this.curFileName = activity.FILE_NAME_
+            this.fileShow(activity)// 展示内容改变
+            this.checkNum(activity)// 阅读量
+
+            // this.$forceUpdate()// 触发监听器
+        },
+        // 阅读量函数
+        checkNum (activity) {
+            const sql1 = `select * from t_wjcyjl where parent_id_= '${activity.id}' order by create_time_ desc`
+            this.$common.request('sql', sql1).then((res) => {
+                const { data = [] } = res.variables || {}
+                this.lookNum = data.length
+                this.showList = data
+                // console.log('showList', this.showList)
+            })
+        },
+        handleUpdate (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()
+            })
+        },
+        hideLeft () {
+            this.leftShow = !this.leftShow
+        },
+
+        lookFile () {
+            // console.log(document.querySelector('iframe').contentWindow.document)
+            // console.log(document.querySelector('iframe').contentWindow.document.body.innerHTML);
+            // console.log('查看文件', this.digData)
+            // console.log('leftData', this.leftData)
+            if (this.digData) {
+                this.checkNum(this.digData)
+            } else {
+                this.digData = this.leftData[0]
+                this.checkNum(this.digData)
+            }
+            this.innerVisible = true
+        },
+        deleteFile () {
+            this.deleteVisible = false
+            const roleKey = ['xtgljs', 'syszr', 'wjgly', 'wjglzzc']
+            const curRole = this.role.map(i => i.alias)
+            const isPower = curRole.some(item => roleKey.includes(item))
+            if (this.isSuper || isPower) {
+                console.log('this.leftData[0]', this.leftData[0])
+                const deleteParams = {
+                    tableName: 't_wjxxb',
+                    paramWhere: { id_: this.leftData[0].id }
+                }
+                curdPost('delete', deleteParams).then(() => {
+                    this.$message({
+                        message: '删除成功!',
+                        type: 'warning'
+                    })
+                    this.dialogVisible = false
+                })
+                return
+            }
+            this.$message({
+                message: '您还没有权限,请联系管理员',
+                type: 'warning'
+            })
+        },
+        closeDialog1 (val) {
+            this.innerVisible = val
+        },
+        updateFile () {
+            // console.log('下载文件', this.optionFile)
+            const a = document.createElement('a')
+            a.href = this.optionFile.url
+            a.download = this.optionFile.data.fileName
+            document.body.appendChild(a)
+            a.click()
+            a.remove()
+        },
+        fileShow (val) {
+            this.dialogVisible = this.visible
+            this.title = `文件:《${val.FILE_NAME_}》`
+            this.tmpId = val.id
+            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_
+            }
+            // 1、获取文件数据 及下载流接口
+            this.optionFile.url = BASE_API() + SYSTEM_URL() + '/file/download?attachmentId=' + data.id
+            this.optionFile.editUrl = BASE_API() + SYSTEM_URL() + '/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
+            })
+        },
+        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}`
+        },
+
+        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>
@@ -185,4 +519,11 @@ export default {
             height: calc(88vh) !important;
         }
     }
+    .left-content{
+        padding-top: 2%;
+    }
+    // .file-read-num{
+    //     display: inline-block;
+    //     margin-left: 60px;
+    // }
 </style>

+ 45 - 4
src/views/component/shiftHandover/enrolled.vue

@@ -24,8 +24,26 @@
                     />
                 </el-form-item></el-col>
                 <el-col :span="8">  <el-form-item label="岗位" prop="gang_wei_">
-                    <el-input v-model="ruleForm.gang_wei_" type="text" :disabled="!editPermissions" />
-                </el-form-item></el-col>
+                    <!-- <el-input v-model="ruleForm.gang_wei_" type="text" :disabled="!editPermissions" /> -->
+                    <el-select v-model="ruleForm.gang_wei_" placeholder="请选择" size="mini" style="width:100%"  :disabled="!editPermissions">
+                        <el-option
+                            v-for="item in filterData"
+                            :key="item.id_"
+                            :label="item.wei_hu_gang_wei_"
+                            :value="item.wei_hu_gang_wei_"
+                        />
+                    </el-select>
+                </el-form-item>
+
+                    <!-- <ibps-link-data
+                        v-model="ruleForm.gang_wei_"
+                        style="width:80%"
+                        size="mini"
+                        template-key="jcgwxz"
+                        :multiple="false"
+                        :temp-search="true"
+                    /> -->
+                </el-col>
                 <el-col :span="8"> <el-form-item label="日期" prop="deng_ji_shi_jian_">
                     <el-date-picker v-model="ruleForm.deng_ji_shi_jian_" type="date" placeholder="选择日期" style="width: 100%;" :disabled="!editPermissions" />
                 </el-form-item></el-col>
@@ -51,8 +69,8 @@
                     <div class="grid-content bg-purple-dark">
                         <el-form-item label="是否查漏" prop="shi_fou_cha_lou_" required>
                             <el-radio-group v-model="ruleForm.shi_fou_cha_lou_">
-                                <el-radio label="否" />
                                 <el-radio label="是" />
+                                <el-radio label="否" />
                             </el-radio-group>
                         </el-form-item>
                     </div>
@@ -150,7 +168,7 @@ export default {
                 jiao_ban_biao_ben: 0,
                 wei_chu_li_biao_b: 0,
                 wei_fa_bao_gao_: 0,
-                shi_fou_cha_lou_: '',
+                shi_fou_cha_lou_: '',
                 lou_fa_lou_jian_: 0,
                 qi_ta_qing_kuang_: '',
                 jie_ban_ren_: '',
@@ -215,6 +233,8 @@ export default {
                     { required: true, message: this.$t('validate.required') }
                 ]
             },
+            jianCeGangWeiList: [],
+            filterData: [],
             masterReport: ['已早交班', '已午交班', '已晚交班', '已完成'],
             subReport: ['早班', '午班', '晚班']
         }
@@ -232,8 +252,19 @@ export default {
                 this.dialogVisible = this.visible
             }
             // immediate: true
+        },
+        'ruleForm.deng_ji_bu_men_': {
+            handler (val) {
+                console.log(val)
+                this.filterData = this.jianCeGangWeiList.filter(i => i.suo_shu_bu_men_ === val)
+            },
+            deep: true
         }
     },
+
+    mounted () {
+        this.loadSelectorData()
+    },
     created () {
         if (this.parentData) {
             if (this.parentData.id_) {
@@ -253,6 +284,16 @@ export default {
         }
     },
     methods: {
+        // 修改
+        loadSelectorData () {
+            console.log('部门', this.ruleForm.deng_ji_bu_men_)
+            const pos = this.$store.getters.level.second ? this.$store.getters.level.second : this.$store.getters.level.first
+            const sql = `select * from t_sbwhgwpzb where di_dian_='${pos}'`
+            this.$common.request('sql', sql).then(res => {
+                const { data = [] } = res.variables || {}
+                this.jianCeGangWeiList = data
+            })
+        },
         closeDialog () {
             this.$emit('close', false)
         },

+ 35 - 33
src/views/infosManage/fileIE.vue

@@ -113,15 +113,16 @@
                     scrolling="no"
                 />
             </el-dialog>
-            <file-lookup
+            <!-- <file-lookup
                 :visible="dialogVisible"
                 :file-infos="fileInfos"
-            />
+            /> -->
             <!-- 本人修改 -->
-            <!-- <file-lookup
+            <file-lookup
+                v-if="dialogVisible"
                 :visible="dialogVisible"
                 :file-infos="fileArray"
-            /> -->
+            />
         </div>
         <!-- 文件更新的内容 -->
         <el-dialog
@@ -166,13 +167,13 @@
                             <el-date-picker v-model="dialogForm.sheng_xiao_shi_" :picker-options="{ disabledDate(time) { return time.getTime() <= Date.now(); } }" type="date" placeholder="选择日期" style="width:100%" />
                         </el-form-item></el-col>
                     </el-row>
+                    <!--  :multiple="false" -->
                     <el-row :gutter="80" style="margin:2% 0">
                         <el-col :span="12"> <el-form-item label="上传文件:" prop="wen_jian_fu_jian_">
                             <ibps-attachment
                                 v-model="dialogForm.wen_jian_fu_jian_"
                                 allow-download
                                 download
-                                multiple
                                 accept="*"
                                 store="id"
                                 :readonly="false"
@@ -832,46 +833,47 @@ export default {
         },
         handleClickTag (val) {
             console.log('val', val)
-            const sql = `select * from ibps_file_attachment where id_= '${val.fu_jian_}'`
-            this.$common.request('sql', sql).then(res => {
-                console.log('res', res)
-                // this.fileInfos = {}// 本人添加
-                const { data = [] } = res.variables || {}
-                if (!data.length) {
-                    this.$message.warning('没有可查阅的文件,请查明原因!')
-                    return
-                }
-                this.fileInfos = { id: val.id, FILE_NAME_: val.wen_jian_ming_che, fileInfos: data[0], func: this.handleUpdate, ban_ben_: val.ban_ben_ }
+            // const sql = `select * from ibps_file_attachment where id_= '${val.fu_jian_}'`
+            // this.$common.request('sql', sql).then(res => {
+            //     console.log('res', res)
+            //     this.fileInfos = {}// 本人添加
+            //     const { data = [] } = res.variables || {}
+            //     if (!data.length) {
+            //         this.$message.warning('没有可查阅的文件,请查明原因!')
+            //         return
+            //     }
+            //     this.fileInfos = { id: val.id, FILE_NAME_: val.wen_jian_ming_che, fileInfos: data[0], func: this.handleUpdate, ban_ben_: val.ban_ben_ }
+            //     this.dialogVisible = true
+            // 本人修改
+            this.fileArray = []
+            this.handleFileInfo(val)
+            const sql1 = `select t_wjxxb.*, t_wjxzxdjlb.xiu_ding_ban_ben_, t_wjxzxdjlb.xiu_ding_nei_rong,t_wjxzxdjlb.yuan_yin_
+            from  t_wjxxb
+            INNER JOIN t_wjxzxdjlb ON  t_wjxxb.shu_ju_lai_yuan_ = t_wjxzxdjlb.id_ WHERE  tou_ban_wen_jian_='${val.id}' AND t_wjxxb.shi_fou_guo_shen_='有效'`
+            // const sql1 = `select * from t_wjxxb WHERE tou_ban_wen_jian_='${val.id}'`
+            this.$common.request('sql', sql1).then(res => {
+                console.log('res测试', res)
+                const list = res.variables.data
+                list.forEach(el => {
+                    const obj = { id: el.id_, wen_jian_ming_che: el.wen_jian_ming_che, fu_jian_: el.wen_jian_fu_jian_, xiu_ding_nei_rong: el.xiu_ding_nei_rong, yuan_yin_: el.yuan_yin_, xiu_ding_ban_ben_: el.xiu_ding_ban_ben_, ban_ben_: el.ban_ben_, wen_jian_bian_hao: el.wen_jian_bian_hao, fa_fang_shi_jian_: el.fa_fang_shi_jian_
+                    }
+                    this.handleFileInfo(obj)
+                })
                 this.dialogVisible = true
             })
-            // 本人修改
-            // this.fileArray = []
-            // this.handleFileInfo(val)
-            // const sql1 = `select t_wjxxb.*, t_wjxzxdjlb.xiu_ding_ban_ben_, t_wjxzxdjlb.xiu_ding_nei_rong,t_wjxzxdjlb.yuan_yin_
-            // from  t_wjxxb
-            // INNER JOIN t_wjxzxdjlb ON  t_wjxxb.shu_ju_lai_yuan_ = t_wjxzxdjlb.id_ WHERE  tou_ban_wen_jian_='${val.id}' `
-            // // const sql1 = `select * from t_wjxxb WHERE tou_ban_wen_jian_='${val.id}'`
-            // this.$common.request('sql', sql1).then(res => {
-            //     console.log('res测试', res)
-            //     const list = res.variables.data
-            //     list.forEach(el => {
-            //         const obj = { id: el.id_, wen_jian_ming_che: el.wen_jian_ming_che, fu_jian_: el.wen_jian_fu_jian_, xiu_ding_nei_rong: el.xiu_ding_nei_rong, yuan_yin_: el.yuan_yin_, xiu_ding_ban_ben_: el.xiu_ding_ban_ben_ }
-            //         this.handleFileInfo(obj)
-            //     })
-            //     this.dialogVisible = true
-            // })
         },
         handleFileInfo (val) {
+            console.log('val121212', val)
             const sql = `select * from ibps_file_attachment where id_= '${val.fu_jian_}'`
             this.$common.request('sql', sql).then(res => {
                 console.log('res', res)
-                // this.fileInfos = {}// 本人添加
+                this.fileInfos = {}// 本人添加
                 const { data = [] } = res.variables || {}
                 if (!data.length) {
                     this.$message.warning('没有可查阅的文件,请查明原因!')
                     return
                 }
-                this.fileInfos = { id: val.id, FILE_NAME_: val.wen_jian_ming_che, fileInfos: data[0], func: this.handleUpdate, ban_ben_: val.ban_ben_ }
+                this.fileInfos = { id: val.id, FILE_NAME_: val.wen_jian_ming_che, fileInfos: data[0], func: this.handleUpdate, ban_ben_: val.ban_ben_, xiu_ding_nei_rong: val.xiu_ding_nei_rong ? val.xiu_ding_nei_rong : '', yuan_yin_: val.yuan_yin_ ? val.yuan_yin_ : '', xiu_ding_ban_ben_: val.xiu_ding_ban_ben_ ? val.xiu_ding_ban_ben_ : '', wen_jian_bian_hao: val.wen_jian_bian_hao, fa_fang_shi_jian_: val.fa_fang_shi_jian_ }
                 this.fileArray.push(this.fileInfos)
             })
         },