Przeglądaj źródła

Merge remote-tracking branch 'origin/master'

jzh 1 rok temu
rodzic
commit
4ce4a562ad

+ 1 - 1
client/package.json

@@ -31,7 +31,7 @@
     "@form-create/designer": "^3.1.3",
     "@form-create/element-ui": "^3.1.24",
     "@iconify/iconify": "^3.1.1",
-    "@tanstack/vue-query": "4.32.6",
+    "@tanstack/vue-query": "^4.32.6",
     "@videojs-player/vue": "^1.0.0",
     "@vue-office/docx": "^1.3.1",
     "@vue-office/excel": "^1.4.7",

+ 15 - 0
client/src/App.vue

@@ -4,6 +4,8 @@ import { useAppStore } from '@/store/modules/app'
 import { useDesign } from '@/hooks/web/useDesign'
 import { CACHE_KEY, useCache } from '@/hooks/web/useCache'
 import routerSearch from '@/components/RouterSearch/index.vue'
+import subscribe from '@/utils/Subscribe'
+import LinkRouteMap from './LinkRouteMap'
 
 defineOptions({ name: 'APP' })
 
@@ -23,6 +25,19 @@ const setDefaultTheme = () => {
   appStore.setIsDark(isDarkTheme)
 }
 setDefaultTheme()
+
+//订阅相应路由name
+const router = useRouter()
+const keys: string[] = Object.keys(LinkRouteMap)
+const eKeys: string[] = keys.map((key) => LinkRouteMap[key]['path'])
+eKeys.forEach((eKey) => {
+  subscribe.on(eKey, (payload) => {
+    router.push({
+      name: eKey,
+      query: payload
+    })
+  })
+})
 </script>
 <template>
   <ConfigGlobal :size="currentSize">

+ 19 - 0
client/src/LinkRouteMap.ts

@@ -0,0 +1,19 @@
+interface LinkRoutePayload {
+  path: string
+  id?: string
+  url?: string
+  data?: object
+}
+interface LinkRoute {
+  [propName: string]: LinkRoutePayload
+}
+export const LinkRouteMap: LinkRoute = {
+  新建流程: {
+    path: 'CreateNewProcess'
+  },
+  流程办理: {
+    path: 'CreateNewOffice'
+  }
+}
+
+export default LinkRouteMap

+ 15 - 0
client/src/main.ts

@@ -45,11 +45,26 @@ import './permission'
 
 import '@/plugins/tongji' // 百度统计
 import Logger from '@/utils/Logger'
+import subscribe from '@/utils/Subscribe'
 
 import VueDOMPurifyHTML from 'vue-dompurify-html' // 解决v-html 的安全隐患
 
 import * as ElementPlusIconsVue from '@element-plus/icons-vue' //导入所有图标并进行全局注册
 
+import LinkRouteMap from './LinkRouteMap';
+//监听iframe postMessage发送的信息
+window.addEventListener("message", (evt) => {
+  const eData = JSON.parse(evt.data)
+  console.log("evt------------------")
+  console.log(eData)
+  const payload = eData.data;
+  if (payload && payload['title']) {
+    const lRoutePayload = LinkRouteMap[payload['title']]
+    lRoutePayload['id'] = payload['id']
+    lRoutePayload['url'] = payload['url']
+    subscribe.emit(lRoutePayload['path'], lRoutePayload)
+  }
+}, false) ;
 // 创建实例
 const setupAll = async () => {
   const app = createApp(App)

+ 25 - 9
client/src/router/modules/remaining.ts

@@ -96,6 +96,22 @@ const remainingRouter: AppRouteRecordRaw[] = [
           title: '办件中心'
         }
       },
+      {
+        path: 'createNewProcess',
+        component: () => import('@/views/OaSystem/officeCenter/createNewProcess/index.vue'),
+        name: 'CreateNewProcess',
+        meta: {
+          title: '新建流程'
+        }
+      },
+      {
+        path: 'createNewOffice',
+        component: () => import('@/views/OaSystem/officeCenter/createNewOffice/index.vue'),
+        name: 'CreateNewOffice',
+        meta: {
+          title: '新建办件'
+        }
+      },
       {
         path: 'newsEditor',
         component: () => import('@/views/OaSystem/newsCenter/newsSetting/editor.vue'),
@@ -128,14 +144,14 @@ const remainingRouter: AppRouteRecordRaw[] = [
           title: '通知公告编辑'
         }
       },
-      // {
-      //   path: 'projectDetail',
-      //   component: () => import('@/views/OaSystem/projectCenter/projectDetail/projectDetail.vue'),
-      //   name: 'projectDetail',
-      //   meta: {
-      //     title: '项目详情'
-      //   }
-      // },
+      {
+        path: 'projectDetail',
+        component: () => import('@/views/OaSystem/projectCenter/projectDetail/projectDetail.vue'),
+        name: 'projectDetail',
+        meta: {
+          title: '项目详情'
+        }
+      },
       {
         path: 'processCenter',
         component: () => import('@/views/OaSystem/platformManagement/processCenter/index.vue'),
@@ -147,7 +163,7 @@ const remainingRouter: AppRouteRecordRaw[] = [
       {
         path: 'collectionDetail',
         component: () => import('@/views/OaSystem/home/collectionDetail.vue'),
-        name: 'projectDetail',
+        name: 'collectionDetail',
         meta: {
           title: '回款信息'
         }

+ 56 - 0
client/src/utils/Subscribe.ts

@@ -0,0 +1,56 @@
+/**
+ * 构建发布订阅模式
+ */
+interface Event {
+  type: string
+  handle: Function
+}
+export class Subscribe {
+  private static instance: Subscribe
+
+  static getInstance() {
+    if (this.instance) return this.instance
+    this.instance = new Subscribe()
+    return this.instance
+  }
+
+  private events: Event[]
+
+  constructor() {
+    this.events = []
+  }
+  on(type: string, handle: Function): void {
+    const i: number = this.isType(type)
+    if (i !== -1) {
+      this.events.splice(i, 1)
+    }
+    this.events.push({
+      type,
+      handle
+    })
+  }
+  emit(type: string, payload: any): void {
+    const i: number = this.isType(type)
+    if (i === -1) throw new Error(`${type}未定义`)
+    const currentEvent = this.events[i]
+    console.log(payload)
+    currentEvent[type] = currentEvent['handle'](payload)
+  }
+  remove(type: string): void {
+    const i: number = this.isType(type)
+    if (i === -1) throw new Error(`${type}未定义`)
+    this.events.splice(i, 1)
+  }
+  isType(type: string): number {
+    let index: number = -1
+    for (let i: number = 0; i < this.events.length; i++) {
+      if (this.events[i]['type'] === type) {
+        index = i
+        break
+      }
+    }
+    return index
+  }
+}
+
+export default Subscribe.getInstance()

+ 5 - 2
client/src/views/OaSystem/oaLayout/menusActive.vue

@@ -70,7 +70,8 @@ onMounted(() => {
   left: 184px;
   top: 0;
   z-index: 99999999;
-  width: 566px;
+  // width: 566px;
+  width: 700px;
   ul {
     display: inline-block;
     width: auto;
@@ -84,8 +85,10 @@ onMounted(() => {
       display: inline-block;
       margin: 10px 35px;
       text-align: center;
+      width: 96px;
       > span {
         display: block;
+        margin: auto;
         &.icon {
           background-color: #fff;
           width: 66px;
@@ -101,7 +104,7 @@ onMounted(() => {
         &.title {
           margin-top: 8px;
           color: #2d333c;
-          width: 66px;
+          width: 96px;
           text-overflow: ellipsis;
           white-space: nowrap;
           overflow: hidden;

+ 30 - 0
client/src/views/OaSystem/officeCenter/createNewOffice/index.vue

@@ -0,0 +1,30 @@
+<template>
+  <div class="officeCenterBox">
+    <iframe :src="iframeUrl"></iframe>
+  </div>
+</template>
+
+<script setup lang="ts">
+defineOptions({
+  name: 'CreateNewOffice'
+})
+const { query } = useRoute() // 查询参数
+const iframeUrl: string = query['url']
+</script>
+
+<style lang="scss" scoped>
+.officeCenterBox {
+  margin-top: 20px;
+  height: calc(100% - 20px);
+  background-color: #fff;
+  border-radius: 20px;
+  position: relative;
+  text-align: center;
+  overflow: hidden;
+  > iframe {
+    width: 100%;
+    height: 100%;
+    border: 0px;
+  }
+}
+</style>

+ 30 - 0
client/src/views/OaSystem/officeCenter/createNewProcess/index.vue

@@ -0,0 +1,30 @@
+<template>
+  <div class="officeCenterBox">
+    <iframe :src="iframeUrl"></iframe>
+  </div>
+</template>
+
+<script setup lang="ts">
+defineOptions({
+  name: 'CreateNewProcess'
+})
+const { query } = useRoute() // 查询参数
+const iframeUrl: string = query['url']
+</script>
+
+<style lang="scss" scoped>
+.officeCenterBox {
+  margin-top: 20px;
+  height: calc(100% - 20px);
+  background-color: #fff;
+  border-radius: 20px;
+  position: relative;
+  text-align: center;
+  overflow: hidden;
+  > iframe {
+    width: 100%;
+    height: 100%;
+    border: 0px;
+  }
+}
+</style>

+ 1 - 1
client/src/views/OaSystem/projectCenter/projectBook/myProject.vue

@@ -213,7 +213,7 @@ const handleCurrentChange = (pageNo: number) => {
 }
 const operateClick = (row: any) => {
   router.push({
-    path: 'projectDetail',
+    path: '/projectDetail',
     query: { id: row.id, name: row.xmmc }
   })
 }

+ 1 - 1
zjugis-business/src/main/resources/static/login.html

@@ -20,7 +20,7 @@
             // 账号 + 密码
             const username = $('#username').val();
             const password = $('#password').val();
-            if (username.length === 0 || password.length === 0) {
+            if (username.length === 0 || password.length === 0) {timeSelector
                 alert('账号或密码未输入');
                 return;
             }

+ 2 - 2
zjugis-workflow/src/main/resources/templates/TFlowCatalog/js/index.js

@@ -159,11 +159,11 @@
 
 	function openWebContainerTab(title, tip, url) {
 		z.webcontainer.openTab({
-			id: 'workflowMain_' + new Date().getTime(),
+			id: 'workflowMain_' + tip,
 			title: "流程办理",
 			tip: tip,
 			url: url,
 			iconclass: 'fa fa-file'
-		}, window.userConfig.openWay);
+		});
 	}
 }());