Bläddra i källkod

4.0.12 Merge branch 'master' of https://prodog.leanwo.com:3000/prodog-client-2023/client-base-v4

# Conflicts:
#	package.json
YangZhiJie 2 år sedan
förälder
incheckning
00f1b427f1

+ 1 - 1
package.json

@@ -1,7 +1,7 @@
 {
   "name": "client-base-v4",
   "description": "Leanwo Prodog Client",
-  "version": "3.0.99",
+  "version": "4.0.12",
   "author": "yangzhijie1488 <yangzhijie1488@163.com>",
   "scripts": {
     "dev": "cross-env webpack serve --config ./webpack.dev.js",

+ 1 - 1
public/index-release.html

@@ -78,7 +78,7 @@
 <body>
 	<div id="app">
 	</div>
-
+	<div id="refreshCount"></div>
 	<script defer="defer" nonce="*NONCE_TOKEN*"  src="../static/js/echarts.min.js"></script>
 	<!-- <script src="../static/js/fullscreen-api.js"></script> -->
 	<!-- <script src="../static/js/problem-feedback-api.js"></script> -->

+ 58 - 63
src/client/OrganizationEditPanel.vue

@@ -77,14 +77,24 @@
     </div>
     <div class="form-group">
       <label>{{ $t("lang.OrganizationEditPanel.superiorDepartment") }}</label>
-      <SearchWidget
+      <a-tree-select
+        v-model:value="organization.parentId"
+        show-search
+        allow-clear
+        style="width: 100%"
+        :tree-data="organizations"
+        tree-node-filter-prop="label"
+        :dropdown-style="{ maxHeight: '300px', overflow: 'auto' }"
+        @change="parentOrganizationValueChanged"
+      />
+      <!-- <SearchWidget
         info-window-no="20220420_233656"
         :field-value="parentOrganizationFieldValue"
         :title-name="$t('lang.OrganizationEditPanel.departmentInquiry')"
         display-name="name"
         :where-clause-source="parentOrganizationAdditionHql"
         @value-changed="parentOrganizationValueChanged"
-      />
+      /> -->
     </div>
     <div class="form-group">
       <label>{{ $t("lang.OrganizationEditPanel.departmentProfile") }}</label>
@@ -183,6 +193,8 @@ import {
   getAllOrganization,
 } from '../api/department/index';
 import { message } from 'ant-design-vue';
+import { TreeSelect } from 'ant-design-vue';
+const SHOW_PARENT = TreeSelect.SHOW_PARENT;
 
 const clientId = ref(''); //公司id
 const id = ref(''); //公司id
@@ -197,30 +209,24 @@ const organization = ref({}); // 部门详情
 const client = ref({}); // 公司详情
 const editVisible = ref(false); // 抽屉开关
 const organizationId = ref(''); // 所选部门ID
-// const clientAdditionHql = ref({});
 const clientNameStr = ref('');
 const { proxy } = getCurrentInstance(); //访问this
-const parentOrganizationAdditionHql = ref('');
-const parentFieldValue = ref({});
-const parentOrganizationFieldValue = ref({
-  displayValue: [],
-  fieldType: 'Key',
-  id: null,
-});
-const clientFieldValue = ref({
-  displayValue: [],
-  fieldType: 'Key',
-  id: null,
-});
+const superiorDepartment = ref('');
+const organizations = ref([]);
+const oldParentId = ref('');
+const oldParentName = ref('');
 onMounted(() => {
   getComponyInfo();
 });
 // 获取公司名称id
 const getComponyInfo = () => {
+  companies.value = [];
   getCompony().then(
     success => {
       if (success.errorCode == 0) {
-        companies.value = success.datas;
+        if (success.datas && success.datas.length > 0) {
+          getALLClient(success.datas);
+        }
       } else {
         message.error(success.errorMessage);
       }
@@ -230,7 +236,15 @@ const getComponyInfo = () => {
     },
   );
 };
-
+// 展示子公司数据
+const getALLClient = datas => {
+  datas.forEach(item => {
+    companies.value.push({ id: item.id, name: item.name });
+    if (item.childrenClients && item.childrenClients.length > 0) {
+      getALLClient(item.childrenClients);
+    }
+  });
+};
 // 编辑公司(获取公司信息)
 const editClient = () => {
   if (clientNameStr.value) {
@@ -287,22 +301,12 @@ const getClientId = (value, client) => {
 const createOrganization = () => {
   organization.value = {};
   organization.value.clientName = clientNameStr.value;
-  (clientFieldValue.value = {
-    displayValue: [],
-    fieldType: 'Key',
-    id: null,
-  }),
-  (parentOrganizationFieldValue.value = {
-    displayValue: [],
-    fieldType: 'Key',
-    id: null,
-  });
-  parentOrganizationAdditionHql.value = '';
+  organization.value.parentId = null;
+  organization.value.parentName = null;
 };
 
 // 创建按钮
 const createNew = organization => {
-  organization.parentName = parentOrganizationFieldValue.value.displayValue[0];
   organization.clientId = id.value;
   create(organization).then(
     success => {
@@ -336,6 +340,7 @@ const getOrganization = () => {
           datas.push(item.childrenOrganizations);
         });
         traversalTree(datas.flat(1), dataSource.value);
+        clientOrganizations(dataSource.value);
       }
       // loadAllSubClients();
     },
@@ -344,7 +349,17 @@ const getOrganization = () => {
     },
   );
 };
-
+// 处理上级部门数据
+const clientOrganizations = datas => {
+  datas.forEach(item => {
+    item.value = item.id;
+    item.label = item.name;
+    if (item.children && item.children.length > 0) {
+      clientOrganizations(item.children);
+    }
+  });
+  organizations.value = datas;
+};
 // 编辑部门(获取部门信息)
 const editOrganization = (flag, id) => {
   organizationId.value = id;
@@ -365,17 +380,8 @@ const editOrganization = (flag, id) => {
       success => {
         if (success.errorCode == 0) {
           organization.value = success.data;
-          parentOrganizationFieldValue.value = {
-            displayValue: [success.data.parentName],
-            fieldType: 'Key',
-            id: success.data.parentId,
-          };
-          parentFieldValue.value = parentOrganizationFieldValue.value;
-          clientFieldValue.value = {
-            displayValue: [success.data.clientName],
-            fieldType: 'Key',
-            id: success.data.clientId,
-          };
+          oldParentName.value = success.data.parentName;
+          oldParentId.value = success.data.parentId;
           fetchUserList();
         } else {
           message.error(success.errorMessage);
@@ -407,12 +413,6 @@ const updateOrganization = () => {
         if (success.data) {
           message.success(proxy.$t('lang.OrganizationEditPanel.describe6'));
           organization.value = {};
-          organization.value.clientId = clientFieldValue.value.id;
-          parentOrganizationFieldValue.value = {
-            displayValue: [],
-            fieldType: 'Key',
-            id: null,
-          };
           getOrganization();
         }
       } else {
@@ -493,26 +493,21 @@ const fetchUserList = (search, loading) => {
     },
   );
 };
-// 公司change事件
-const clientValueChanged = newFieldValue => {
-  clientFieldValue.value = newFieldValue;
-  organization.value.clientId = newFieldValue.id;
-  parentOrganizationAdditionHql.value = ' client.id = ' + newFieldValue.id; // 添加部门约束
-};
 
 // 上级部门change事件
-const parentOrganizationValueChanged = newFieldValue => {
-  if (organizationId.value == newFieldValue.id) {
+const parentOrganizationValueChanged = (value, label) => {
+  if(!value && label.length == 0){
+    organization.value.parentId = null;
+    organization.value.parentName = null;
+    return;
+  }
+  if (organizationId.value == value) {
     message.warning('不能将自己作为上级部门!');
-    parentOrganizationFieldValue.value = {
-      displayValue: [parentFieldValue.value.displayValue[0]],
-      fieldType: 'Key',
-      id: parentFieldValue.value.id,
-    };
+    organization.value.parentId = oldParentId.value;
+    organization.value.parentName = oldParentName.value;
   } else {
-    parentOrganizationFieldValue.value = newFieldValue;
-    organization.value.parentId = newFieldValue.id;
-    organization.value.parentName = newFieldValue.displayValue[0];
+    organization.value.parentId = value;
+    organization.value.parentName = label[0];
   }
 };
 

+ 8 - 0
src/client/TopNavigation.vue

@@ -83,6 +83,10 @@ export default {
 
   mounted: function () {
     this.getLocalStorage();
+    if (this.isMobile()) {
+      this.visible = false;
+      this.$emit('menuVisibleChanged');
+    }
   },
 
   methods: {
@@ -98,6 +102,10 @@ export default {
       this.visible = !this.visible;
       this.$emit('menuVisibleChanged');
     },
+    isMobile() {
+      let flag = navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i);
+      return flag;
+    },
   },
 };
 </script>

+ 24 - 14
src/common/pushMessage.js

@@ -12,10 +12,8 @@ export default {
   timer: null,
   source: null,
   isSound: false,
-  openDate: null,
   allMessage: [],
   webSocket: null,
-  messageDate: null,
   notificationId: null,
 
 
@@ -155,7 +153,7 @@ export default {
       notification.open({
         key: messageData.uuid,
         message: messageData.content.title,
-        description: messageData.content.description,
+        description: '您有一条待处理消息',
         icon: () =>
           h(MessageTwoTone, {
             style: 'color: #108ee9',
@@ -254,7 +252,7 @@ export default {
   messageModal: function () {
     const _self = this;
     Modal.warning({
-      okText: '我知道了',
+      okText: '确认',
       title: '温馨提示',
       content: '您的浏览器设置,提示音无法自动播放,请您点击【确认】按钮,可以自动播放提示音。',
       onOk() {
@@ -263,7 +261,19 @@ export default {
       },
     });
   },
-
+  // 触发仪表盘数量更新事件
+  executionEvent: function () {
+    // 获取刷新元素
+    const refreshElement = document.querySelector('#refreshCount');
+    // 自定义事件
+    const customEvent = new CustomEvent('evt');
+    // 触发事件
+    window.refreshTimer = setInterval(function () {
+      refreshElement.dispatchEvent(customEvent);
+      clearInterval(window.refreshTimer);
+      window.refreshTimer = null;
+    }, 10000);
+  },
   // 打开websocket
   openWebSocket: function () {
     const _self = this;
@@ -281,16 +291,9 @@ export default {
     }
     _self.webSocket = new WebSocket(websocketUrl, [token]);
     _self.webSocket.onopen = function () {
-      _self.openDate = new Date().getTime();
       console.log('websocket打开');
     };
     _self.webSocket.onmessage = function (message) {
-      _self.messageDate = new Date().getTime();
-      const difference = Math.abs(_self.messageDate - _self.openDate);
-      if (difference > 10000) {
-        // 刷新数量
-        console.log('刷新数量');
-      }
       let taskData = JSON.parse(message.data);
       console.log('websocket 收到信息 : ' + taskData);
       if (taskData) {
@@ -299,6 +302,10 @@ export default {
       if (_self.timer == null) {
         _self.triggerNotification();
       }
+      if (!window.refreshTimer) {
+        _self.executionEvent();
+      }
+      _self.webSocket.send(message.data);
     };
     _self.webSocket.onclose = function () {
       console.log('websocket关闭');
@@ -313,10 +320,13 @@ export default {
   // 注销后关闭websocket和循环
   closeWebsocket: function () {
     const _self = this;
-    if (_self.webSocket && _self.timer) {
-      _self.timer = null;
+    if (_self.webSocket) {
       _self.webSocket.close();
+      clearInterval(_self.timer);
+      clearInterval(window.refreshTimer);
+      _self.timer = null;
       _self.webSocket = null;
+      window.refreshTimer = null;
       _self.allMessage.splice(0, _self.allMessage.length);
       notification.close(_self.notificationId);
     }

+ 2 - 13
src/window/tabFormView/CurdWindowComment.vue

@@ -7,10 +7,6 @@
 <template>
   <div>
     <div v-for="items in traceComments" :key="items" class="media">
-      <h4 class="media-heading headDiv">
-        {{ items.createdName
-        }}<a class="fa-pull-right" @click="edit(items)">编辑</a>
-      </h4>
       <div class="media-body">
         <div>
           <!-- eslint-disable-next-line -->
@@ -56,7 +52,7 @@ export default {
   data: function () {
     return {
       traceComments: [],
-      className: 'com.leanwo.prodog.trace.model.TraceComment',
+      className: 'com.leanwo.prodog.system.model.CurdWindowComment',
       uuid: '',
     };
   },
@@ -131,7 +127,7 @@ export default {
       var _self = this;
       if (item != undefined && item != null) {
         return Common.getImageSrc(
-          'com.leanwo.prodog.trace.model.TraceComment',
+          'com.leanwo.prodog.system.model.CurdWindowComment',
           item,
         );
       } else {
@@ -145,13 +141,6 @@ export default {
       return Common.getImageSrc('com.leanwo.prodog.model.base.User', imageName);
     },
 
-    /**
-     * 打开评论界面进行评论
-     * @author GuoZhiBo 20171201
-     */
-    edit: function (item) {
-      this.$router.push('/trace/traceCommentEdit/' + item.id);
-    },
   },
 };
 </script>

+ 17 - 16
src/window/tabFormView/CurdWindowCommentCreate.vue

@@ -1,23 +1,8 @@
 <template>
   <div>
     <div>
-      <Navbar title="创建评论" />
+      <!-- <Navbar title="创建评论" /> -->
       <div>
-        <div class="form-group">
-          <label for="exampleInputEmail2">接收人</label>
-          <a-select
-            v-model:value="userIds"
-            mode="multiple"
-            style="width: 100%"
-            placeholder="选择抄送人"
-            :options="options"
-            :filter-option="false"
-            auto-clear-search-value
-            @change="handleChange"
-            @search="listInGroupCompanyByCondition"
-          />
-        </div>
-
         <div class="form-group">
           <label for="exampleInputEmail2">
             主题:
@@ -39,6 +24,22 @@
                               rows="5"
                               v-model="content"></textarea> -->
         </div>
+
+        <div class="form-group">
+          <label for="exampleInputEmail2">通知人</label>
+          <a-select
+            v-model:value="userIds"
+            mode="multiple"
+            style="width: 100%"
+            placeholder="选择通知人"
+            :options="options"
+            :filter-option="false"
+            auto-clear-search-value
+            @change="handleChange"
+            @search="listInGroupCompanyByCondition"
+          />
+        </div>
+
         <div>
           <input
             ref="fileInput"

+ 9 - 9
src/window/tabFormView/TabFormView.vue

@@ -295,11 +295,11 @@
       <TabAudit v-if="showAuditPanel" :window-no="windowNo" :tab-index="tabIndex" :tab="tab" :model-data="modelData" />
     </Modal>
 
-    <Modal v-model:show="modal3" :large="true" :show-canel-button="false" :show-ok-button="false">
+    <Modal v-model:show="modal3" :large="true" :show-canel-button="false" :show-ok-button="false" title="创建评论">
       <TraceCommentCreate ref="traceCommentCreate" :trace-id="modelData.id" :window-no="modelData.windowNo" />
       <template #footer>
         <button type="submit" class="btn btn-default" @click="saveAndSendNotification">
-          推送
+          确认
         </button>
         <button type="button" class="btn btn-default" @click="cancelNotification">
           取消
@@ -789,8 +789,7 @@ export default {
 
     saveAndSendNotification: function () {
       var _self = this;
-      var status = _self.$refs.traceCommentCreate.photograph();
-      console.log('11111111111 '+ status);
+      _self.$refs.traceCommentCreate.photograph();
       _self.sendNotification();
     },
 
@@ -804,10 +803,11 @@ export default {
         Notify.error(_self.$t('lang.Notify.error'), _self.$t('lang.tabButton.describe7'), true);
         return;
       }
-      if (notification.userIds == null || notification.userIds.length == 0) {
-        Notify.error(_self.$t('lang.Notify.error'), _self.$t('lang.tabButton.describe8'), true);
-        return;
-      }
+      // if (notification.userIds == null || notification.userIds.length == 0) {
+      //   Notify.error(_self.$t('lang.Notify.error'), _self.$t('lang.tabButton.describe8'), true);
+      //   _self.modal3 = false;
+      //   return;
+      // }
       if (notification.theme == null || notification.theme.trim() == '') {
         Notify.error(_self.$t('lang.Notify.error'), _self.$t('lang.tabButton.describe9'), true);
         return;
@@ -843,7 +843,7 @@ export default {
         data: JSON.stringify(notification),
         success: function (data) {
           _self.loading=false;
-          Notify.success(_self.$t('lang.tabButton.describe11'), _self.$t('lang.tabButton.describe12'), true);
+          Notify.success(_self.$t('lang.tabButton.describe11'), '操作成功', true);
           _self.modal3 = false;
           _self.$refs.traceComment.getTraceComment();
         },

+ 11 - 10
src/workflow/Approve.vue

@@ -97,15 +97,15 @@ export default {
     };
   },
 
-  watch: {
-    $route: function () {
-      var functionType = this.$route.query.functionType;
-      if (functionType) {
-        this.functionType = functionType;
-      }
-      this.initQueryParamter();
-    },
-  },
+  // watch: {
+  //   $route: function () {
+  //     var functionType = this.$route.query.functionType;
+  //     if (functionType) {
+  //       this.functionType = functionType;
+  //     }
+  //     this.initQueryParamter();
+  //   },
+  // },
 
   mounted: function () {
     var _self = this;
@@ -180,7 +180,8 @@ export default {
         url = url.substring(0, index);
       }
       url = url + '?functionType=' + _self.functionType;
-      window.location.href = url;
+      // window.location.href = url;
+      this.$router.push('/desktop/approve?functionType=' + _self.functionType);
     },
 
   },