|
|
@@ -0,0 +1,710 @@
|
|
|
+<template>
|
|
|
+ <div :class="{'ibps-fixed-toolbar':checkMode}">
|
|
|
+ <van-sticky>
|
|
|
+ <van-nav-bar
|
|
|
+ :title="generateTitle($route.name,$route.params.title||$route.meta.title)"
|
|
|
+ :left-text="$t('common.button.back')"
|
|
|
+ left-arrow
|
|
|
+ @click-left="$router.push({ name: 'dashboard' })"
|
|
|
+ />
|
|
|
+ <van-search v-model="subject" show-action placeholder="请输入搜索关键词" @search="onSearch">
|
|
|
+ <template #left>
|
|
|
+ <van-icon
|
|
|
+ name="bars"
|
|
|
+ :class="{'ibps-active':$utils.isNotEmpty(typeId)}"
|
|
|
+ class="ibps-pr-5"
|
|
|
+ @click="clickType"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ <template #action>
|
|
|
+ <!-- <van-icon name="filter-o" :class="{'ibps-active':stateActive}" @click="clickMoreSearch" /> -->
|
|
|
+ </template>
|
|
|
+ </van-search>
|
|
|
+ </van-sticky>
|
|
|
+ <!-- 内容展示区 -->
|
|
|
+ <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
|
|
|
+ <van-list v-model="loading" :finished="finished" :offset="5" @load="loadData">
|
|
|
+ <van-checkbox-group v-model="checkedIds">
|
|
|
+ <van-cell v-for="(item,index) in listData" :key="item.id+index" :title="item.wen_jian_ming_che" @click="onClick(item,index)">
|
|
|
+ <template slot="icon">
|
|
|
+ <van-checkbox v-if="checkMode" ref="checkboxes" :name="item.id" class="ibps-mr-10" />
|
|
|
+ <van-icon name="newspaper-o" size="2rem" color="#1E90FF" />
|
|
|
+ <!-- <van-icon name="notes-o" size="1.5rem" color="#1E90FF" /> -->
|
|
|
+ </template>
|
|
|
+ <template #label>
|
|
|
+ <van-row>
|
|
|
+ <van-col span="8">文件编号/版本</van-col>
|
|
|
+ <van-col span="16">{{ item.wen_jian_bian_hao==''?'/':item.wen_jian_bian_hao==null?'/':item.wen_jian_bian_hao==undefined?'/':item.wen_jian_bian_hao }}-{{ item.ban_ben_==''?'/':item.ban_ben_==null?'/':item.ban_ben_==undefined?'/':item.ban_ben_ }}</van-col>
|
|
|
+ </van-row>
|
|
|
+ <van-row>
|
|
|
+ <van-col span="8">文件类型</van-col>
|
|
|
+ <van-col span="16">{{ item.wen_jian_xi_lei_===''?'/':item.wen_jian_xi_lei_===null?'/':item.wen_jian_xi_lei_===undefined?'/':item.wen_jian_xi_lei_ }}</van-col>
|
|
|
+ </van-row>
|
|
|
+ <van-row>
|
|
|
+ <van-col span="8">发布时间</van-col>
|
|
|
+ <van-col span="16">{{ item.fa_fang_shi_jian_===''?'/':item.fa_fang_shi_jian_===null?'/':item.fa_fang_shi_jian_===undefined?'/':item.fa_fang_shi_jian_ }}</van-col>
|
|
|
+ </van-row>
|
|
|
+ <!-- <van-row> -->
|
|
|
+ <!-- <van-col span="12">附件</van-col>
|
|
|
+ <van-col span="12">{{ item.fu_jian_===''?'/':item.fu_jian_===null?'/':item.fu_jian_===undefined?'/':item.fu_jian_ }}</van-col> -->
|
|
|
+ <!-- </van-row> -->
|
|
|
+ </template>
|
|
|
+ <!-- 插入内容 -->
|
|
|
+ <!-- <span>{{ item.createTime|formatRelativeTime }}</span> -->
|
|
|
+ <!-- <div style="margin-top: 90%;height: 100%;">
|
|
|
+ <van-tag type="primary" size="medium" @click="onClick(item,index)">开始考试</van-tag>
|
|
|
+ </div> -->
|
|
|
+ </van-cell>
|
|
|
+ </van-checkbox-group>
|
|
|
+ <ibps-list-result-page :result-type="resultType" :error-type="errorType" :result-message="resultMessage" />
|
|
|
+ </van-list>
|
|
|
+ </van-pull-refresh>
|
|
|
+ <ibps-toolbar v-show="checkMode" :actions="mainActions" />
|
|
|
+ <!-- 点击搜索的右边显示 -->
|
|
|
+ <!-- <ibps-more-search
|
|
|
+ :show="moreSearchPopup"
|
|
|
+ :search-forms="searchForms"
|
|
|
+ @callback="onMoreSearch"
|
|
|
+ @close="show => moreSearchPopup = show"
|
|
|
+ @reset-form="resetForm"
|
|
|
+ /> -->
|
|
|
+ <!-- 点击搜索的左边显示 -->
|
|
|
+ <ibps-type-tree
|
|
|
+ ref="typeTree"
|
|
|
+ v-model="typeTreePopup"
|
|
|
+ title="文件分类"
|
|
|
+ category-key="FILE_TYPE"
|
|
|
+ @node-click="clickTypeNode"
|
|
|
+ @close="visible => typeTreePopup = visible"
|
|
|
+ />
|
|
|
+ <!-- 遮罩层,提示信息 -->
|
|
|
+ <van-divider v-if="footText">到底了~</van-divider>
|
|
|
+ <van-empty v-if="noData" description="暂无数据" />
|
|
|
+ <van-popup v-model="documentsSon" position="bottom" :style="{height:'100%',width:'100%'}">
|
|
|
+ <LookDocument :son-data="sonData" @son="son" />
|
|
|
+ </van-popup>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import { mapState } from 'vuex'
|
|
|
+import curdPost from '@/utils/joinCURD.js'
|
|
|
+import ActionUtils from '@/utils/action'
|
|
|
+import i18n from '@/utils/i18n'
|
|
|
+import random from '@/mixins/random'
|
|
|
+import bpmnStatus from '@/mixins/bpmnStatus'
|
|
|
+import IbpsMoreSearch from '@/components/ibps-more-search'
|
|
|
+import IbpsTypeTree from '@/business/platform/cat/type/tree'
|
|
|
+import IbpsAvatar from '@/components/ibps-avatar'
|
|
|
+import IbpsToolbar from '@/components/ibps-toolbar'
|
|
|
+import IbpsListResultPage from '@/components/ibps-list-result-page'
|
|
|
+import IbpsBpmnFormrenderDialog from '@/business/platform/bpmn/form/dialog'
|
|
|
+import LookDocument from './lookDocument'
|
|
|
+import interIndex from './index'
|
|
|
+import { Notify } from 'vant'
|
|
|
+const _ = require('lodash')
|
|
|
+
|
|
|
+export default {
|
|
|
+ components: {
|
|
|
+ IbpsMoreSearch,
|
|
|
+ IbpsTypeTree,
|
|
|
+ IbpsAvatar,
|
|
|
+ IbpsToolbar,
|
|
|
+ IbpsListResultPage,
|
|
|
+ IbpsBpmnFormrenderDialog,
|
|
|
+ LookDocument
|
|
|
+ },
|
|
|
+ mixins: [random, bpmnStatus],
|
|
|
+ data() {
|
|
|
+ const { userId, userList = [], deptList, menus, userInfo, role } = this.$store.getters
|
|
|
+ const depArrs = []
|
|
|
+ var fileDownloadAuthority = false
|
|
|
+ for (var i of deptList) {
|
|
|
+ depArrs.push(`wj.bian_zhi_bu_men_ like '${i.positionId}'`)
|
|
|
+ }
|
|
|
+ const roleKey = ['xtgljs', 'syszr', 'dagly', 'xxgljs']
|
|
|
+ for (const i of roleKey) {
|
|
|
+ if (role.some(so => { return so.alias === i })) {
|
|
|
+ fileDownloadAuthority = true
|
|
|
+ break
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ categoryKey: '',
|
|
|
+ documentsSon: false,
|
|
|
+ sonData: '',
|
|
|
+ userId: userId,
|
|
|
+ footText: false,
|
|
|
+ showPop: false,
|
|
|
+ noData: false,
|
|
|
+ showConfirmationBoxList: true,
|
|
|
+ countTotal: {},
|
|
|
+ examPopup: '',
|
|
|
+ ReachBottomShow: false,
|
|
|
+ moreSearchPopup: false,
|
|
|
+ searchForms: {
|
|
|
+ forms: [
|
|
|
+ // { prop: 'Q^examName_^SL', label: '考试名称', fieldType: 'text' },
|
|
|
+ // { prop: 'Q^bankName^SL', label: '题库名称', fieldType: 'text' },
|
|
|
+ { prop: 'examName', label: '考试名称', fieldType: 'text' },
|
|
|
+ { prop: 'bankName', label: '题库名称', fieldType: 'text' },
|
|
|
+ {
|
|
|
+ prop: 'examType', label: '考试类型', fieldType: 'checker', cols: 2, valueKey: 'value', options: [
|
|
|
+ { value: 'trainingExam', label: '培训考试' },
|
|
|
+ { value: 'POCTtraining', label: 'POCT培训' },
|
|
|
+ { value: 'selfAssessment', label: '自主考核' },
|
|
|
+ { value: 'routine', label: '常规' }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ { prop: ['startDateDL', 'startDateDG'], label: '开始时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' }},
|
|
|
+ { prop: ['limitDateDL', 'limitDateDG'], label: '限考时间', fieldType: 'dateRange', options: { datefmt: 'yyyy-MM-dd' }}
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ // './views/platform/bpmn/communication/communicationList
|
|
|
+ mainActions: [{
|
|
|
+ 'name': this.$t('common.button.remove'),
|
|
|
+ 'type': 'danger',
|
|
|
+ 'callback': this.onRemove
|
|
|
+ }],
|
|
|
+ stateActive: false,
|
|
|
+ subject: '',
|
|
|
+ moreSubject: '',
|
|
|
+ subjectTitle: '',
|
|
|
+ typeId: '',
|
|
|
+ moreParams: {},
|
|
|
+ listData: [],
|
|
|
+ listCopy: [],
|
|
|
+ pagination: {},
|
|
|
+ sorts: {},
|
|
|
+
|
|
|
+ loading: false,
|
|
|
+ finished: false,
|
|
|
+ refreshing: false,
|
|
|
+ resultType: 'init',
|
|
|
+ errorType: null,
|
|
|
+ resultMessage: null,
|
|
|
+
|
|
|
+ checkMode: false,
|
|
|
+ checkedIds: [],
|
|
|
+ proInstId: '',
|
|
|
+ defId: '',
|
|
|
+ formrenderVisible: false,
|
|
|
+ formrenderTitle: '',
|
|
|
+ typeTreePopup: false,
|
|
|
+ keyword: '',
|
|
|
+ name: '全部',
|
|
|
+ current: 0,
|
|
|
+ startTime: [],
|
|
|
+ endTime: [],
|
|
|
+ fileTypesDatas: {
|
|
|
+ comAuthority: [],
|
|
|
+ buMenAuthority: [],
|
|
|
+ authority: []
|
|
|
+ }, // 存放所点击列表的分类信息
|
|
|
+ searchWhere: {},
|
|
|
+ sqlWhere: {},
|
|
|
+ addDataCont: {},
|
|
|
+ oldorgId: '',
|
|
|
+ listConfig: {
|
|
|
+ // 工具栏
|
|
|
+ toolbars: [
|
|
|
+ { key: 'search' },
|
|
|
+ {
|
|
|
+ key: 'colect',
|
|
|
+ label: '收藏或取消收藏',
|
|
|
+ type: 'success'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ // 查询条件
|
|
|
+ searchForm: {
|
|
|
+ forms: []
|
|
|
+ },
|
|
|
+ // 表格字段配置
|
|
|
+ columns: []
|
|
|
+ },
|
|
|
+ pageKey: '',
|
|
|
+ depArrs,
|
|
|
+ fileDownloadAuthority
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState('ibps/user', [
|
|
|
+ 'info'
|
|
|
+ ]),
|
|
|
+ rightText() {
|
|
|
+ return this.checkMode ? this.$t('common.button.cancel') : this.$t('common.button.manage')
|
|
|
+ }
|
|
|
+ // selectedIds() {
|
|
|
+ // console.log('this.checkedIds', this.checkedIds)
|
|
|
+ // console.log('this.checkedIds', this.checkedIds.join(','))
|
|
|
+ // return this.checkedIds.join(',')
|
|
|
+ // }
|
|
|
+ },
|
|
|
+
|
|
|
+ beforeRouteLeave(to, from, next) {
|
|
|
+ if (this.showPop === true) {
|
|
|
+ // this.showConfirmationBoxList = true
|
|
|
+ this.$refs.childPop.parentSubmit()
|
|
|
+ this.showPop = false
|
|
|
+ next(false)
|
|
|
+ } else {
|
|
|
+ next()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ setTimeout(() => {
|
|
|
+ this.clickTypeNode(this.$refs.typeTree.treeData[0])
|
|
|
+ setTimeout(() => {
|
|
|
+ this.onRefresh()
|
|
|
+ }, 500)
|
|
|
+ }, 200)
|
|
|
+ })
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.pageKey = this.$route.name
|
|
|
+ this.categoryKey = this.$route.name === 'documents' ? 'FLOW_TYPE' : 'FILE_TYPE'
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ onClick(item, index) {
|
|
|
+ this.documentsSon = true
|
|
|
+ this.sonData = item
|
|
|
+ },
|
|
|
+ son() {
|
|
|
+ this.documentsSon = false
|
|
|
+ },
|
|
|
+ onClose() {
|
|
|
+ this.ReachBottomShow = false
|
|
|
+ },
|
|
|
+
|
|
|
+ updataSet(v) {
|
|
|
+ this.showPop = v
|
|
|
+ },
|
|
|
+ generateTitle(name, title) { // generateTitle by vue-i18n
|
|
|
+ return i18n.generateTitle(name, title)
|
|
|
+ },
|
|
|
+ toCheckMode() {
|
|
|
+ if (this.$utils.isEmpty(this.listData)) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if (this.checkMode) {
|
|
|
+ // this.show = true
|
|
|
+ this.checkedIds = []
|
|
|
+ }
|
|
|
+ this.checkMode = !this.checkMode
|
|
|
+ },
|
|
|
+ clickType() {
|
|
|
+ this.typeTreePopup = true
|
|
|
+ },
|
|
|
+ onSearch() {
|
|
|
+ this.stateActive = false
|
|
|
+ ActionUtils.initListData(this)
|
|
|
+ this.current = 0
|
|
|
+ // this.listData = []
|
|
|
+ this.loadData()
|
|
|
+ },
|
|
|
+ clickMoreSearch() {
|
|
|
+ this.moreSearchPopup = true
|
|
|
+ this.stateActive = false
|
|
|
+ },
|
|
|
+
|
|
|
+ clickTypeNode(nodeData) {
|
|
|
+ var nodeId = nodeData.id
|
|
|
+ // console.log('nodeData', nodeData)
|
|
|
+ this.typeId = nodeData.id
|
|
|
+ this.onMoreSearch({})
|
|
|
+ this.addDataCont = { fenLei: nodeData.name, fenLeiId: nodeId }
|
|
|
+ const fileTypes = []
|
|
|
+ if (this.oldorgId === nodeId && (nodeData.name !== '文件分类')) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 判断是否存在下级菜单
|
|
|
+ const noHadNext = nodeData.children === undefined
|
|
|
+ if (noHadNext && this.pageKey === 'wjkzgl-ywyxjlsc') {
|
|
|
+ const chongfu = this.listConfig.toolbars.filter(el => {
|
|
|
+ return el.key === 'add'
|
|
|
+ })
|
|
|
+ if (chongfu.length === 0 && this.depth !== 0) {
|
|
|
+ this.listConfig.toolbars.splice(1, 0, { key: 'add' })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.listConfig.toolbars = this.listConfig.toolbars.filter(el => {
|
|
|
+ return el.key !== 'add'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ this.fileTypesDatas = {
|
|
|
+ comAuthority: [],
|
|
|
+ buMenAuthority: [],
|
|
|
+ authority: [],
|
|
|
+ shiJiSql: [],
|
|
|
+ sheBeiSql: []
|
|
|
+ }
|
|
|
+ if (nodeData.children === undefined) {
|
|
|
+ const authorityName = JSON.parse(nodeData.authorityName)
|
|
|
+ fileTypes.push(nodeId)
|
|
|
+ if (authorityName.chaYue === '公用查阅') {
|
|
|
+ this.fileTypesDatas.comAuthority.push(nodeId)
|
|
|
+ }
|
|
|
+ if (authorityName.chaYue === '部门查阅') {
|
|
|
+ this.fileTypesDatas.buMenAuthority.push(nodeId)
|
|
|
+ }
|
|
|
+ if (authorityName.chaYue === '受限查阅') {
|
|
|
+ this.fileTypesDatas.authority.push(nodeId)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ const getTail = item => item.children && item.children.length > 0 ? item.children.map(m => getTail(m)) : [item]
|
|
|
+ const result = _.flattenDeep(nodeData.children.map(m => getTail(m)))
|
|
|
+ for (var i of result) {
|
|
|
+ fileTypes.push(i.id)
|
|
|
+ const authorityName = JSON.parse(i.authorityName)
|
|
|
+ if (authorityName.chaYue === '公用查阅') {
|
|
|
+ this.fileTypesDatas.comAuthority.push(i.id)
|
|
|
+ }
|
|
|
+ if (authorityName.chaYue === '部门查阅') {
|
|
|
+ this.fileTypesDatas.buMenAuthority.push(i.id)
|
|
|
+ }
|
|
|
+ if (authorityName.chaYue === '受限查阅') {
|
|
|
+ this.fileTypesDatas.authority.push(i.id)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.oldorgId = nodeId
|
|
|
+ this.sqlWhere = {
|
|
|
+ fileType: fileTypes.join(',')
|
|
|
+ }
|
|
|
+ this.getDatas()
|
|
|
+ // const fileTypes = []
|
|
|
+ },
|
|
|
+ getDatas() {
|
|
|
+ const { comAuthority, buMenAuthority, authority } = this.fileTypesDatas
|
|
|
+ const { fileType, sorts } = this.sqlWhere
|
|
|
+ this.listData = []
|
|
|
+ let wheres1 = '' // 共用
|
|
|
+ let wheres2 = '' // 部门
|
|
|
+ let wheres3 = '' // 受限
|
|
|
+ let start = ''
|
|
|
+ const positionsDatas = this.$store.getters.userInfo.positions
|
|
|
+ const needSelType = []
|
|
|
+ if (this.$store.getters.userInfo.positions === 0) {
|
|
|
+ this.$message({
|
|
|
+ message: '该账户并没有所属部门,请先归属部门再来操作。',
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+ for (var i in this.searchWhere) {
|
|
|
+ // console.log('i', i)
|
|
|
+ if (i === 'b') {
|
|
|
+ start = this.searchWhere[i]
|
|
|
+ }
|
|
|
+ if (i === 'i') {
|
|
|
+ wheres1 = wheres1 + ` and bian_zhi_shi_jian between '${start} 00:00:00' and '${this.searchWhere[i]} 23:59:59'`
|
|
|
+ wheres2 = wheres2 + ` and bian_zhi_shi_jian between '${start} 00:00:00' and '${this.searchWhere[i]} 23:59:59'`
|
|
|
+ wheres3 = wheres3 + ` and bian_zhi_shi_jian between '${start} 00:00:00' and '${this.searchWhere[i]} 23:59:59'`
|
|
|
+ }
|
|
|
+ if (i !== 'i' && i !== 'b') {
|
|
|
+ const likeWhere = i === 'nian_du_' ? this.searchWhere[i].getFullYear() : this.searchWhere[i]
|
|
|
+ wheres1 = wheres1 + ` and wj.${i} like '%${likeWhere}%'`
|
|
|
+ wheres2 = wheres2 + ` and wj.${i} like '%${likeWhere}%'`
|
|
|
+ wheres3 = wheres3 + ` and wj.${i} like '%${likeWhere}%'`
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 一样
|
|
|
+ if (fileType) {
|
|
|
+ if (this.pageKey === 'documents') {
|
|
|
+ if (comAuthority.length !== 0) {
|
|
|
+ wheres1 = wheres1 + ` and FIND_IN_SET (wj.xi_lei_id_,'${comAuthority}')`
|
|
|
+ }
|
|
|
+ if (buMenAuthority.length !== 0) {
|
|
|
+ let orSql = ''
|
|
|
+ // eslint-disable-next-line no-redeclare
|
|
|
+ for (const i in positionsDatas) {
|
|
|
+ if (i === '0') {
|
|
|
+ orSql = `wj.quan_xian_xin_xi_ LIKE '%${positionsDatas[i].id}%'`
|
|
|
+ } else {
|
|
|
+ orSql = orSql + `or wj.quan_xian_xin_xi_ LIKE '%${positionsDatas[i].id}%'`
|
|
|
+ }
|
|
|
+ }
|
|
|
+ wheres2 = wheres2 + ` and (${orSql}) and FIND_IN_SET (wj.xi_lei_id_,'${buMenAuthority}')`
|
|
|
+ }
|
|
|
+ if (authority.length !== 0) {
|
|
|
+ wheres3 = wheres3 + ` and FIND_IN_SET (wj.xi_lei_id_,'${authority}')`
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ wheres1 = wheres1 + ` and FIND_IN_SET (wj.fen_lei_id_,'${fileType}')`
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 没走
|
|
|
+ if (sorts) {
|
|
|
+ if (JSON.stringify(sorts) !== '{}') {
|
|
|
+ wheres1 = wheres1 + ` order by ${sorts.sortBy} ${sorts.order === 'ascending' ? 'asc' : 'desc'}`
|
|
|
+ wheres2 = wheres2 + ` order by ${sorts.sortBy} ${sorts.order === 'ascending' ? 'asc' : 'desc'}`
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const selectSql = `select wj.id_ as id,cy.id_ as cy_id_,sc.id_ as sc_id_,concat(file.file_name_,'.',file.ext_,'(大小:',file.total_bytes_,')') as file_info_,
|
|
|
+ wj.wen_jian_xi_lei_,wj.wen_jian_bian_hao,wj.wen_jian_ming_che,wj.ban_ben_,wj.wen_jian_fu_jian_ AS fu_jian_,wj.fa_bu_shi_jian_ as fa_fang_shi_jian_,wj.shi_fou_guo_shen_ AS shi_fou_guo_shen_, wj.bian_zhi_bu_men_ AS bian_zhi_bu_men_,
|
|
|
+ wj.bian_zhi_ren_ AS bian_zhi_ren_,
|
|
|
+ wj.bian_zhi_shi_jian AS bian_zhi_shi_jian,
|
|
|
+ wj.wen_jian_lei_xing AS wen_jian_lei_xing,
|
|
|
+ wj.quan_xian_lei_xin AS quan_xian_lei_xin,
|
|
|
+ wj.fa_bu_shi_jian_ AS fa_bu_shi_jian_,
|
|
|
+ wj.poct_shi_yong_ AS shi_yong_bu_men_,
|
|
|
+ "" AS cha_yue_jie_zhi_s from`
|
|
|
+ const leftSql = `left join (select id_,parent_id_ from t_wjcyjl group by parent_id_) cy on cy.parent_id_ = wj.id_
|
|
|
+ left join (select id_,parent_id_ from t_wjscjl group by parent_id_) sc on sc.parent_id_ = wj.id_
|
|
|
+ left join ibps_file_attachment file on file.id_ = wj.wen_jian_fu_jian_`
|
|
|
+ // 内外部文件查阅时候查所有文件
|
|
|
+ const allSql = ``
|
|
|
+ // 共用文件
|
|
|
+ const comSql = `${selectSql} t_wjxxb wj ${leftSql} where wj.shi_fou_guo_shen_ ='有效' and (${this.depArrs.join(' or ')}) ${wheres1} `
|
|
|
+ // 部门权限文件
|
|
|
+ const buMenSql = `${selectSql} t_wjxxb wj ${leftSql}
|
|
|
+ where wj.shi_fou_guo_shen_ in ('有效','使用') ${wheres2} `
|
|
|
+ // 受限文件:结合查阅授权模块的截止时间
|
|
|
+ const authoritySql = `select wj.id_ as id,cy.id_ as cy_id_,sc.id_ as sc_id_,concat(file.file_name_,'.',file.ext_,'(',file.total_bytes_,')') as file_info_,
|
|
|
+ wj.wen_jian_xi_lei_,wj.wen_jian_bian_hao,wj.wen_jian_ming_che,wj.ban_ben_,wj.wen_jian_fu_jian_ AS fu_jian_,wj.fa_bu_shi_jian_ as fa_fang_shi_jian_,wj.shi_fou_guo_shen_ AS shi_fou_guo_shen_, wj.bian_zhi_bu_men_ AS bian_zhi_bu_men_,
|
|
|
+ wj.bian_zhi_ren_ AS bian_zhi_ren_,
|
|
|
+ wj.bian_zhi_shi_jian AS bian_zhi_shi_jian,
|
|
|
+ wj.wen_jian_lei_xing AS wen_jian_lei_xing,
|
|
|
+ wj.quan_xian_lei_xin AS quan_xian_lei_xin,
|
|
|
+ wj.fa_bu_shi_jian_ AS fa_bu_shi_jian_,
|
|
|
+ wj.poct_shi_yong_ AS shi_yong_bu_men_,
|
|
|
+ sq.cha_yue_jie_zhi_s from
|
|
|
+ t_wjxxb wj
|
|
|
+ left join (select *from t_skwjcysqsqzb order by create_time_ desc limit 1) sq on wj.id_=sq.wen_jian_id_
|
|
|
+ ${leftSql}
|
|
|
+ WHERE wj.shi_fou_guo_shen_ ='有效' and ((sq.cha_yue_jie_zhi_s >DATE_FORMAT(NOW(), '%Y-%m-%d')) OR (sq.cha_yue_jie_zhi_s =DATE_FORMAT(NOW(), '%Y-%m-%d')))
|
|
|
+ and wj.quan_xian_xin_xi_ like '%${this.userId}%' ${wheres3} `
|
|
|
+ const sqlArr = [comSql, buMenSql, authoritySql]
|
|
|
+ let oldRecordSql = ''
|
|
|
+ const buMenWhere = []
|
|
|
+ if (this.pageKey !== 'documents') {
|
|
|
+ if (this.$store.getters.deptList.length !== 0) {
|
|
|
+ // eslint-disable-next-line no-redeclare
|
|
|
+ for (var i of this.$store.getters.deptList) {
|
|
|
+ buMenWhere.push(`bian_zhi_bu_men_ like '%${i.positionId}%'`)
|
|
|
+ }
|
|
|
+ oldRecordSql = `select wj.*,en.name_ AS org_name,ee.name_ as ry_name FROM t_ywyxjlb wj
|
|
|
+ left join ibps_party_employee ee on wj.bian_zhi_ren_ = ee.id_
|
|
|
+ LEFT JOIN ibps_party_entity en ON en.id_= bian_zhi_bu_men_
|
|
|
+ where (${buMenWhere.join(' or ')}) ${wheres1} order by bian_zhi_shi_jian desc`
|
|
|
+ } else {
|
|
|
+ console.log('没有部门组织')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // eslint-disable-next-line no-redeclare
|
|
|
+ for (var i in Object.keys(this.fileTypesDatas)) {
|
|
|
+ var key = Object.keys(this.fileTypesDatas)[i] // key
|
|
|
+ var value = this.fileTypesDatas[key] // value
|
|
|
+ if (value.length !== 0) {
|
|
|
+ needSelType.push(`(${sqlArr[i]})`)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const fileSearchSql = needSelType.join('union all')
|
|
|
+ const sql = this.pageKey === 'documents' ? `select sq.* from (${fileSearchSql}) sq ORDER BY sq.wen_jian_bian_hao DESC,sq.wen_jian_ming_che DESC ` : oldRecordSql
|
|
|
+ curdPost('sql', sql).then(res => {
|
|
|
+ this.listCopy = []
|
|
|
+ this.current = 0
|
|
|
+ this.listCopy = res.variables.data
|
|
|
+ this.onRefresh()
|
|
|
+ this.loadData()
|
|
|
+ // const tableDatas = res.variables.data
|
|
|
+ // this.selectListData = JSON.parse(JSON.stringify(tableDatas))
|
|
|
+ // let filterDatas = []
|
|
|
+ // this.bianlistData.pageResult.totalCount = tableDatas.length
|
|
|
+ // this.bianlistData.pageResult.totalPages = Math.ceil(tableDatas.length / this.pagination.limit)
|
|
|
+ // this.bianlistData.pageResult.limit = this.pagination.limit
|
|
|
+ // this.bianlistData.pageResult.page = this.pagination.page
|
|
|
+ // if (this.pagination.limit > tableDatas.length) {
|
|
|
+ // filterDatas = JSON.parse(JSON.stringify(tableDatas))
|
|
|
+ // } else {
|
|
|
+ // for (let index = 0; index < 20; index++) {
|
|
|
+ // filterDatas.push(tableDatas[index])
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // this.bianlistData.dataResult = filterDatas
|
|
|
+ // ActionUtils.handleListData(this, this.bianlistData)
|
|
|
+ }).catch(res => {
|
|
|
+ this.loading = false
|
|
|
+ this.listData = []
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 高级查询
|
|
|
+ onMoreSearch(params) {
|
|
|
+ if (this.$utils.isNotEmpty(this.typeId)) {
|
|
|
+ params['Q^type_id_^SL'] = this.typeId
|
|
|
+ }
|
|
|
+ this.moreParams = params
|
|
|
+ this.onSearch()
|
|
|
+ if (this.$utils.isNotEmpty(params)) {
|
|
|
+ this.stateActive = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ resetForm() {
|
|
|
+ this.typeId = ''
|
|
|
+ },
|
|
|
+ // 下拉刷新
|
|
|
+ onRefresh() {
|
|
|
+ this.footText = false
|
|
|
+ this.noData = false
|
|
|
+ this.refreshing = true
|
|
|
+ this.finished = false
|
|
|
+ this.loading = true
|
|
|
+ this.onSearch()
|
|
|
+ },
|
|
|
+ onRefreshPage() {
|
|
|
+ this.checkedIds = []
|
|
|
+ this.checkMode = false
|
|
|
+ this.onRefresh()
|
|
|
+ },
|
|
|
+ searchGao() {
|
|
|
+
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 加载数据
|
|
|
+ */
|
|
|
+ loadData() {
|
|
|
+ this.loading = true
|
|
|
+ this.refreshing = false
|
|
|
+ if (this.current >= this.listCopy.length) {
|
|
|
+ this.listData = []
|
|
|
+ this.finished = true
|
|
|
+ this.noData = true
|
|
|
+ this.footText = false
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 查询搜索
|
|
|
+ const subject = this.subject
|
|
|
+ if (subject) {
|
|
|
+ const filteredList = this.listCopy.filter(item => {
|
|
|
+ return item.wen_jian_ming_che.includes(subject)
|
|
|
+ })
|
|
|
+ if (filteredList.length <= 0) {
|
|
|
+ this.footText = false
|
|
|
+ this.loading = false
|
|
|
+ this.noData = true
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 计算本次加载的数据量
|
|
|
+ const endIndex = Math.min(this.current + 10, filteredList.length)
|
|
|
+ // 加载数据
|
|
|
+ const newData = filteredList.slice(this.current, endIndex)
|
|
|
+ this.listData.push(...newData)
|
|
|
+ this.current = endIndex
|
|
|
+ if (endIndex >= filteredList.length) {
|
|
|
+ this.finished = true
|
|
|
+ this.footText = true
|
|
|
+ this.noData = false
|
|
|
+ }
|
|
|
+ this.loading = false
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // 计算本次加载的数据量
|
|
|
+ const endIndex = Math.min(this.current + 10, this.listCopy.length)
|
|
|
+ // 加载数据
|
|
|
+ const newData = this.listCopy.slice(this.current, endIndex)
|
|
|
+ this.listData.push(...newData)
|
|
|
+ // 更新状态
|
|
|
+ this.current = endIndex
|
|
|
+
|
|
|
+ // 检查是否加载完毕
|
|
|
+ if (endIndex >= this.listCopy.length) {
|
|
|
+ this.finished = true
|
|
|
+ this.footText = true
|
|
|
+ this.noData = false
|
|
|
+ }
|
|
|
+
|
|
|
+ // 结束加载动画
|
|
|
+ this.loading = false
|
|
|
+
|
|
|
+ // this.listData = this.listCopy
|
|
|
+ // this.loading = true
|
|
|
+ // let page = 0
|
|
|
+ // if (this.current === 0) {
|
|
|
+ // page = 0
|
|
|
+ // } else {
|
|
|
+ // page = this.current * 10
|
|
|
+ // }
|
|
|
+ // if (this.listData || this.listData.length === 0) {
|
|
|
+ // this.finished = true
|
|
|
+ // this.noData = true
|
|
|
+ // this.footText = false
|
|
|
+ // }
|
|
|
+
|
|
|
+ // this.$common.request('sql', sql1).then(res => {
|
|
|
+ // if (this.current === 0 && res.variables.data.length === 0) {
|
|
|
+ // this.finished = true
|
|
|
+ // this.noData = true
|
|
|
+ // this.footText = false
|
|
|
+ // }
|
|
|
+
|
|
|
+ // const data = res.variables.data
|
|
|
+ // this.listData.push(...data)
|
|
|
+ // this.refreshing = false
|
|
|
+ // if (this.listData.length !== 0 && (this.listData.length) % 10 !== 0) {
|
|
|
+ // this.footText = true
|
|
|
+ // this.noData = false
|
|
|
+ // this.finished = true
|
|
|
+ // return
|
|
|
+ // } else {
|
|
|
+ // this.current++
|
|
|
+ // }
|
|
|
+ // this.loading = false
|
|
|
+ // }).catch(err => {
|
|
|
+ // console.log(err)
|
|
|
+ // })
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取格式化参数
|
|
|
+ getSearcFormData() {
|
|
|
+ let params = {}
|
|
|
+ if (this.$utils.isNotEmpty(this.subject)) {
|
|
|
+ params['Q^subject_^SL'] = this.subject
|
|
|
+ }
|
|
|
+ if (this.$utils.isNotEmpty(this.moreParams)) {
|
|
|
+ params = Object.assign(params, this.moreParams)
|
|
|
+ }
|
|
|
+ return ActionUtils.formatParams(
|
|
|
+ params,
|
|
|
+ this.pagination,
|
|
|
+ this.sorts)
|
|
|
+ },
|
|
|
+
|
|
|
+ transformTime(timeStamp) {
|
|
|
+ const hours = Math.floor(parseInt(timeStamp) / 3600000)
|
|
|
+ const minutes = Math.floor((parseInt(timeStamp) % 3600000) / 60000)
|
|
|
+ return hours + '小时' + minutes + '分钟'
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style scoped lang="scss">
|
|
|
+ .examRow {
|
|
|
+ padding: 2% 0;
|
|
|
+
|
|
|
+ .popupTitle {
|
|
|
+ text-align: center;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #555;
|
|
|
+ }
|
|
|
+
|
|
|
+ .popupContent {
|
|
|
+ text-align: left;
|
|
|
+ font-size: 14px;
|
|
|
+ color: #777;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ .examRowto {
|
|
|
+ margin: 10% 0;
|
|
|
+
|
|
|
+ .van-col {
|
|
|
+ text-align: center;
|
|
|
+
|
|
|
+ .van-button {
|
|
|
+ width: 80%;
|
|
|
+ font-size: 16px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+</style>
|