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

去除首页定时任务逻辑,增加系统指引页面,开放旧版首页入口

cfort 2 лет назад
Родитель
Сommit
9701c9a2df

+ 20 - 0
src/router/routes.js

@@ -25,6 +25,16 @@ const frameIn = [
                 },
                 component: _import('/system/homepage')
             },
+            {
+                path: 'temp',
+                name: 'temp',
+                meta: {
+                    title: '旧版首页',
+                    auth: true,
+                    hiddenAsideMenu: true
+                },
+                component: _import('/system/dashboard')
+            },
             {
                 path: 'blank',
                 name: 'blank',
@@ -137,6 +147,16 @@ const frameIn = [
                 },
                 component: _import('/platform/office/bpmInitiatedProcess/myDraft')
             },
+            {
+                path: 'mySysGuide',
+                name: 'mySysGuide',
+                meta: {
+                    title: '系统指引',
+                    auth: true,
+                    hiddenAsideMenu: true
+                },
+                component: _import('/system/dashboard/templates/systemGuide')
+            },
             {
                 path: 'myRequest',
                 name: 'myRequest',

+ 6 - 2
src/views/platform/office/mixin/utils.js

@@ -45,11 +45,15 @@ export default {
         /**
          * 获取格式化参数
          */
-        getFormatParams () {
-            const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
+        getFormatParams (args) {
+            let params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
             if (this.$utils.isNotEmpty(this.typeId)) {
                 params['Q^TYPE_ID_^S'] = this.typeId
             }
+            params = {
+                ...params,
+                ...args
+            }
             return ActionUtils.formatParams(params, this.pagination, this.sorts)
         },
         /**

+ 3 - 6
src/views/system/dashboard/components/util.js

@@ -7,7 +7,6 @@ import Utils from '@/utils/util'
 import { findAllByCurrUserId, saveCalendarInfos, removeCalendarInfos } from '@/api/detection/newHomeApi'
 import { delQuickNavigation, addQuickNavigation, getQuickNavigation } from '@/api/platform/message/innerMessage'
 import newPng from '@/assets/images/homepage/new.png'
-import ScheduleAdd from '@/views/system/dashboard/templates/scheduleAdd'
 
 /**
  * 创建组件
@@ -15,10 +14,9 @@ import ScheduleAdd from '@/views/system/dashboard/templates/scheduleAdd'
 export function buildComponent (name, column, preview) {
     try {
         return {
-            name: name,
+            name,
             components: {
-                VueDraggable: () => import('vuedraggable'),
-                ScheduleAdd
+                VueDraggable: () => import('vuedraggable')
             },
             props: {
                 params: {
@@ -37,7 +35,6 @@ export function buildComponent (name, column, preview) {
                     type: Boolean,
                     default: false
                 }
-                
             },
             filters: {
                 filterStatus (val, type) {
@@ -144,7 +141,7 @@ export function buildComponent (name, column, preview) {
                         animation: 200,
                         axis: 'y'
                     },
-                    calendarToolbar: this.fullScreen ? [{ key: 'refresh' }] : [{ key: 'refresh' }, { key: 'fullscreen' }, { key: 'collapse' }],
+                    calendarToolbar: this.fullScreen ? [{ key: 'refresh' }] : [{ key: 'refresh' }, { key: 'fullscreen' }, { key: 'collapse' }]
                 }
             },
             computed: {

+ 0 - 1
src/views/system/dashboard/page.vue

@@ -48,7 +48,6 @@
             </template>
         </newHome> -->
         <workbench
-            v-if="cronTask && scheduledTask"
             :plan="cronTask"
             @handleApprove="handleApprove"
             @handleUnreadMessage="handleUnreadMessage"

+ 324 - 0
src/views/system/dashboard/templates/systemGuide.vue

@@ -0,0 +1,324 @@
+<template>
+    <div class="app-container">
+        <div class="tab-container">
+            <div class="table-container">
+                <ibps-crud
+                    ref="guide"
+                    :data="dataList"
+                    :toolbars="listConfig.toolbars"
+                    :search-form="listConfig.searchForm"
+                    :pk-key="pkKey"
+                    :columns="listConfig.columns"
+                    :pagination="pagination"
+                    :loading="loading"
+                    :index-row="false"
+                    :selection-row="false"
+                    :display-field="title"
+                    @row-click="handleRowClick"
+                    @action-event="handleAction"
+                    @sort-change="handleSortChange"
+                    @pagination-change="handlePaginationChange"
+                />
+            </div>
+        </div>
+    </div>
+</template>
+
+<script>
+import ActionUtils from '@/utils/action'
+import { taskTypeOption, listSearchForm } from '../components/workbench'
+
+const searchForm = listSearchForm.guide
+
+export default {
+    name: 'system-guide1',
+    filters: {
+        getUserName (v, list) {
+            const user = list.find(i => i.userId === v)
+            return user ? user.userName : ''
+        }
+    },
+    props: {},
+    data () {
+        const { first = '', second = '' } = this.$store.getters.level || {}
+        const level = second || first
+        const { userList = [], deptList = [], role = [], menus = [], isSuper } = this.$store.getters || {}
+        const allRolesMap = new Map()
+        userList.forEach(user => {
+            user.roleId.split(',').forEach((roleId, index) => {
+                if (!allRolesMap.has(roleId)) {
+                    allRolesMap.set(roleId, user.roles.split(',')[index])
+                }
+            })
+        })
+        const allRoles = Array.from(allRolesMap, ([key, value]) => ({ key, value: key, label: value }))
+        const isManager = role.some(i => i.alias === 'xtgljs') || isSuper
+        const roleOption = isManager ? allRoles : role.map(i => ({ key: i.id, value: i.id, label: i.name }))
+        const sysOption = menus.map(i => ({ key: i.alias, value: i.title, label: i.title })).filter(i => !['xtgl', 'xnyz'].includes(i.key))
+        searchForm.forms[0].value = isManager ? 'all' : 'aboutMe'
+        searchForm.forms[1].options = sysOption
+        searchForm.forms[3].options = roleOption
+        const fieldWidth = window.innerWidth > 1600 ? 150 : 120
+        return {
+            title: '系统指引',
+            level,
+            userList,
+            deptList,
+            role,
+            menus,
+            pkKey: 'id',
+            loading: false,
+            selection: [],
+            defaultPagination: { page: 1, limit: 15 },
+            sorts: { },
+            dataList: [],
+            pagination: {},
+            listConfig: {
+                searchForm,
+                toolbars: [
+                    {
+                        key: 'search'
+                    }
+                ],
+                // 表格字段配置
+                columns: [
+                    { prop: 'sn', label: '序号', width: 60 },
+                    { prop: 'sysName', label: '所属子系统', width: 100 },
+                    { prop: 'module', label: '所属功能模块', width: fieldWidth },
+                    { prop: 'tableName', label: '记录表单', width: 200 },
+                    { prop: 'tableNo', label: '表单编号', width: 150, sortable: 'custom' },
+                    { prop: 'timing', label: '填写时机/记录频次', minWidth: fieldWidth },
+                    { prop: 'taskType', label: '事务类型', tags: taskTypeOption, width: 100 },
+                    { prop: 'fileName', label: '程序文件', width: 160 },
+                    { prop: 'creator', label: '编制人', width: fieldWidth },
+                    { prop: 'reviewer', label: '审核人', width: fieldWidth },
+                    { prop: 'approver', label: '审批人', width: fieldWidth }
+                ]
+            }
+        }
+    },
+    mounted () {
+        this.getData()
+    },
+    methods: {
+        getGuide ({ parameters, requestPage, sorts }) {
+            // 获取查询角色信息
+            let roleParams = ''
+            let aboutMeParams = ''
+            const range = {
+                aboutMe: [],
+                sponsor: [],
+                review: [],
+                approve: []
+            }
+            const sortField = {
+                TABLE_NO_: 'biao_dan_bian_hao'
+            }
+            let sortParams = 'sn_ + 0 asc'
+            if (sorts && sorts.length) {
+                sortParams = sorts.map(i => `${sortField[i.field]} ${i.order}`).join(',')
+            }
+            this.role.forEach(i => {
+                range.aboutMe.push(`bian_zhi_jiao_se_ like '%${i.id}%' or shen_he_jiao_se_ like '%${i.id}%' or shen_pi_jiao_se_ like '%${i.id}%'`)
+                range.sponsor.push(`bian_zhi_jiao_se_ like '%${i.id}%'`)
+                range.review.push(`shen_he_jiao_se_ like '%${i.id}%'`)
+                range.approve.push(`shen_pi_jiao_se_ like '%${i.id}%'`)
+            })
+            parameters.forEach(item => {
+                if (item.key === 'range' && item.value !== 'all') {
+                    aboutMeParams = ` and (${range[item.value].join(' or ')})`
+                }
+                if (item.key === 'role') {
+                    roleParams = ` and (bian_zhi_jiao_se_ like '%${item.value}%')`
+                }
+            })
+            // 获取查询字段
+            let params = parameters.filter(i => i.key !== 'role' && i.key !== 'range').reduce((acc, curr) => {
+                return `${acc} and ${curr.key} like '%${curr.value}%'`
+            }, '')
+            params = params + aboutMeParams + roleParams
+            // and di_dian_ = '${level}'
+            const sql = `select sn_ as sn, suo_shu_xi_tong_ as sysName, gong_neng_mo_kuai as module, biao_dan_ming_che as tableName, biao_dan_bian_hao as tableNo, tian_xie_shi_ji_ as timing, shi_wu_lei_xing_ as taskType, cheng_xu_wen_jian as fileName, bian_zhi_ren_ as creator, shen_he_ren_ as reviewer, shen_pi_ren_ as approver, ye_mian_lu_jing_ as path, zi_yuan_lu_jing_ as res from t_bdbhpzb where sn_ + 0 > 0 ${params} order by ${sortParams}`
+            const { pageNo = 1, limit = 15 } = requestPage || {}
+            return new Promise((resolve, reject) => {
+                this.$common.request('sql', sql).then(res => {
+                    const { data = [] } = res.variables || {}
+                    const page = {
+                        limit,
+                        page: pageNo,
+                        totalCount: data.length,
+                        totalPages: Math.ceil(data.length / limit)
+                    }
+                    const result = {
+                        data: {
+                            dataResult: data.slice((pageNo - 1) * limit, pageNo * limit),
+                            pageResult: page
+                        }
+                    }
+                    resolve(result)
+                }).catch(error => {
+                    reject(error)
+                })
+            })
+        },
+        tableRowClassName ({ row, rowIndex }) {
+            if (rowIndex % 2 === 1) return 'warning-row'
+            return 'success-row'
+        },
+        // 获取表格数据
+        getData () {
+            this.loading = true
+            const pageParams = this.pagination && this.pagination.page ? this.pagination : this.defaultPagination
+            this.getGuide(this.getFormatParams(null, pageParams)).then(response => {
+                const { dataResult, pageResult } = response.data
+                this.dataList = dataResult
+                this.pagination = pageResult || {}
+                this.loading = false
+            }).catch(() => {
+                this.loading = false
+            })
+        },
+        // 查询
+        search () {
+            this.dataList = []
+            this.pagination = {}
+            this.getData()
+        },
+        handleSortChange (sort) {
+            console.log(sort)
+            ActionUtils.setSorts(this.sorts, sort)
+            this.getData()
+        },
+        handlePaginationChange (page) {
+            ActionUtils.setPagination(this.pagination, page)
+            this.getData()
+        },
+        getFormatParams (v, page) {
+            const params = this.$refs.guide ? this.$refs.guide.getSearcFormData() : {}
+            const pageParams = { ...page, limit: 100 }
+            return ActionUtils.formatParams(params, pageParams, this.sorts)
+        },
+        // 处理表格点击事件
+        handleRowClick (data) {
+            const { res = '' } = data
+            if (!res) {
+                this.$message.warning('未配置资源菜单!')
+                return
+            }
+            const path = '/' + this.findPagePath(res)
+            this.$router.push(path)
+        },
+        handleAction (command, position, selection, data) {
+            switch (command) {
+                case 'search':// 查询
+                    ActionUtils.setFirstPagination(this.pagination || {})
+                    this.search()
+                    break
+                default:
+                    break
+            }
+        },
+        findPagePath (res) {
+            const resList = res.split('.')
+            const findAlias = (nodes, path) => {
+                const [currentId, ...rest] = path
+                const node = nodes.find(n => n.id === currentId)
+                return node && rest.length ? [node.alias, ...findAlias(node.children, rest)] : node && [node.alias]
+            }
+            this.$store.dispatch('ibps/menu/activeHeaderSet', { activeHeader: resList[0], vm: this })
+            return findAlias(this.menus, resList).join('/')
+        }
+    }
+}
+</script>
+<style lang="scss" scoped>
+    ::v-deep .el-table__row {
+        cursor: pointer;
+    }
+    ::v-deep .el-tabs__header {
+        margin-bottom: 0;
+    }
+    .el-completing {
+        background: #409eff !important;
+    }
+    .el-col {
+        min-height: 1px;
+    }
+    .firstcol {
+        padding-right: 10px;
+    }
+    .el-nothing {
+        font-size: 13px;
+    }
+    .calendar-day {
+        text-align: center;
+        color: #202535;
+        line-height: 30px;
+        font-size: 12px;
+    }
+    .is-selected {
+        color: #f8a535;
+        font-size: 10px;
+        margin-top: 5px;
+    }
+    #calendar .el-button-group > .el-button:not(:first-child):not(:last-child):after {
+        content: '当月';
+    }
+    #calendar .item {
+        position: relative;
+        margin: 0;
+        padding: 0;
+        height: auto;
+        border-radius: 4px;
+        -webkit-box-sizing: border-box;
+        box-sizing: border-box;
+        overflow: hidden;
+        color: #f8a535;
+    }
+    .ibps-list-split .ibps-list-item {
+        border-bottom: 1px solid #dcdfe6;
+        padding: 6px 0;
+    }
+    .jbd-font-style {
+        font-weight: bold;
+    }
+    .home-text-border {
+        color: #999999;
+        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);
+        min-height: 20px;
+        font-size: 14px;
+        margin-left: 60px;
+        margin-bottom: 5px;
+    }
+    .jbd-home-card {
+        overflow: auto;
+    }
+    .jbd-home-task {
+        width: 100%;
+        padding: 10px;
+        cursor: pointer;
+        font-size: 12px;
+        margin-bottom: 35px;
+    }
+    .jbd-home-card::-webkit-scrollbar {
+        display: none;
+    }
+    .jbd-control-cont {
+        text-align: center;
+        position: absolute;
+        z-index: 10;
+        right: 0px;
+        top: 50%;
+    }
+    .tab-container {
+        height: calc(100vh - 160px);
+        min-height: 600px;
+        >div {
+            display: inline-block;
+        }
+        .table-container {
+            width: 100%;
+            vertical-align: top;
+        }
+    }
+</style>

+ 16 - 45
src/views/system/homepage/index.vue

@@ -134,14 +134,10 @@ import BpmnFormrender from '@/business/platform/bpmn/form/dialog'
 
 import IbpsNewsDialog from '@/views/platform/system/news/detail'
 import IbpsMessageDialog from '@/views/platform/message/inner/detail/dialog'
-import { StatisticsData, StatisticsSign } from '@/api/platform/system/jbdHome'
 import { getToken } from '@/utils/auth'
-import curdPost from '@/business/platform/form/utils/custom/joinCURD.js'
-import param from '@/store/modules/ibps/modules/param'
 import ScheduleAdd from '@/views/system/dashboard/templates/scheduleAdd'
 
 const _import = require('@/utils/util.import.' + process.env.NODE_ENV)
-let cronTask = null
 export default {
     components: {
         'ibps-news-dialog': IbpsNewsDialog,
@@ -155,7 +151,6 @@ export default {
     },
     data () {
         return {
-            cronTask,
             infoMessage: [],
             uloadPath: BASE_API() + BUSINESS_BASE_URL() + '/ck/task/importExcel',
             reportPath: BASE_API() + BUSINESS_BASE_URL() + '/sys/SysDataContext/replaceReportFile',
@@ -214,18 +209,6 @@ export default {
             return this.system.isLocal
         }
     },
-    beforeRouteEnter (to, from, next) {
-        const { first = '', second = '' } = param.state.level
-        const sql = `select * from t_jhswpzb where di_dian_ = '${second || first}'`
-        curdPost('sql', sql).then(res => {
-            const { data = [] } = res.variables || {}
-            cronTask = data.map(i => i.liu_cheng_key_)
-            next()
-        }).catch(error => {
-            alert('获取计划事务配置表信息失败,请刷新页面重试!')
-            console.log(error)
-        })
-    },
     mounted () {
         if (localStorage.getItem('statistic') === 'isNormal') {
             this.showRepost = false
@@ -302,15 +285,16 @@ export default {
             }, 100)
         },
         getHeight (h) {
-            if (document.body.clientWidth > 1366 && document.body.clientWidth < 1920) {
-                const mH = (1920 - 1366) / (33 - 23)
-                this.rowHeight = ((document.body.clientWidth - 1366) / mH) + 23
-                // let mH = (1925-768)/(33-23)
-                // this.rowHeight=((document.body.clientWidth-768)/mH)+17
-                // console.log(this.rowHeight)
-            } else if (document.body.clientWidth <= 1366) {
-                this.rowHeight = 23
-            }
+            // if (document.body.clientWidth > 1366 && document.body.clientWidth < 1920) {
+            //     const mH = (1920 - 1366) / (33 - 23)
+            //     this.rowHeight = ((document.body.clientWidth - 1366) / mH) + 23
+            //     // let mH = (1925-768)/(33-23)
+            //     // this.rowHeight=((document.body.clientWidth-768)/mH)+17
+            //     // console.log(this.rowHeight)
+            // } else if (document.body.clientWidth <= 1366) {
+            //     this.rowHeight = 23
+            // }
+            console.log((h - 1) * (this.rowHeight + this.margin[1]) + this.margin[1])
             return (h - 1) * (this.rowHeight + this.margin[1]) + this.margin[1]
         },
         hasComponent (alias) {
@@ -360,8 +344,8 @@ export default {
             }
         },
         /**
-             * 全屏展示切换
-             */
+         * 全屏展示切换
+         */
         handleFullscreen (id) {
             this.dialogPreviewVisible = true
             this.id = id
@@ -373,12 +357,10 @@ export default {
             const deleteIndex = this.layout.findIndex(item => item.i === '0')
             this.layout.splice(deleteIndex, 1)
         },
-
         handleApprove (id) {
             this.ibpsNewsDialogVisible = true
             this.newsEditId = id
         },
-
         handleUnreadMessage (id) {
             this.ibpsMessageDialogVisible = true
             this.messageEditId = id
@@ -387,10 +369,6 @@ export default {
             this.defId = params.defId || null
             this.taskId = params.taskId || null
             this.instanceId = params.instanceId || null
-
-            this.instanceId = params.instanceId || null
-            this.instanceId = params.instanceId || null
-
             this.bpmnFormrenderDialogVisible = true
         },
         handleFlowCallback () {
@@ -591,28 +569,21 @@ export default {
             }
         },
         // 打开指定弹框
-        handleOpen (state, dateArr, events,clickId) {
+        handleOpen (state, dateArr, events, clickId) {
             const status = ['急', '重', '轻', '缓']
             const eventTrees = []
-
             switch (state) {
                 case 'calendar':
                     this.calendarDialogVisible = true
                     for (const i of events) {
                         // 根据指定日期A获取A在时间区间内的数据
                         if (!((this.compareDates(i.start, dateArr[1]) > 0) || (this.compareDates(i.jieShuShiJian, dateArr[0]) < 0))) {
-                            i.label = i.zhuangTai?`【${status[Number(i.zhuangTai) - 1] ? status[Number(i.zhuangTai) - 1] : ''}】` + i.title:i.title
+                            i.label = i.zhuangTai ? `【${status[Number(i.zhuangTai) - 1] ? status[Number(i.zhuangTai) - 1] : ''}】` + i.title : i.title
                             eventTrees.push(i)
                         }
                     }
-                    if (eventTrees.length) {
-                        this.calendarDialogForm = {
-                            eventTrees
-                        }
-                    } else {
-                        this.calendarDialogForm = {
-                            eventTrees: []
-                        }
+                    this.calendarDialogForm = {
+                        eventTrees: eventTrees.length ? eventTrees : []
                     }
                     this.calendarDialogForm.clickedDate = dateArr[0]
                     this.calendarDialogForm.clickId = clickId