瀏覽代碼

意见功能优化

songxy 1 年之前
父節點
當前提交
d89074c349

+ 1 - 1
client_h5/.env.dev

@@ -1,3 +1,3 @@
 VITE_BASE_URL='http://10.10.10.7:48080/'
 
-VITE_AUTHORIZATION='test83e06d0d-af60-4419-9437-c9a68bf1b669'
+VITE_AUTHORIZATION='Bearer test83e06d0d-af60-4419-9437-c9a68bf1b669'

+ 6 - 9
client_h5/src/App.vue

@@ -8,17 +8,16 @@ const initUserInfoHandler = async () => {
     const code: string = await getDDAuthCode() as string
     const userIdResult = await getUserIdByDD({code})
     if (userIdResult && userIdResult?.data) {
-        const userResult = await getUserInfoById(userIdResult?.data.accessToken)
+        localStorage.setItem("ACCESS_TOKEN", userIdResult?.data.accessToken)
+        console.log(localStorage.getItem("ACCESS_TOKEN"))
+        const userResult = await getUserInfoById()
         if (userResult && userResult?.data) { 
             const userInfo: UserInterface = {
                 id: userResult?.data.user.id,
-                nickname: userResult?.data.user.nickname,
-                accessToken: userIdResult?.data.accessToken,
+                nickname: userResult?.data.user.nickname
             }
             userStore.setUser(userInfo)
-            localStorage.setItem("ACCESS_TOKEN", userIdResult?.data.accessToken)
             localStorage.setItem("_userInfo", JSON.stringify(userInfo))
-            console.log(localStorage.getItem("ACCESS_TOKEN"))
         }
     }
 }
@@ -47,10 +46,8 @@ const getUserIdByDD = async (data: Required<UserIdParam>) => {
   return reqest.post(`/app-api/system/auth/login-ding?code=${data.code}`, null)
 }
 //@ts-ignore
-const getUserInfoById = async (token: Required<string>) => {
-    return reqest.get('/admin-api/system/auth/get-permission-info', {
-        headers: { 'Authorization': 'Bearer ' + token }
-  })
+const getUserInfoById = async () => {
+    return reqest.get('/admin-api/system/auth/get-permission-info')
 }
 </script>
 

+ 45 - 8
client_h5/src/components/flowForm.vue

@@ -13,7 +13,8 @@
                   <div v-for="(item,index) in tItem['opinions']" :key="tIndex-index" :class="{'flowOpinionItem': true, 'disabled': !item['isEditor']}">
                     <h4>{{ tItem['opinionName'] }}</h4>
                     <div class="content">
-                      <van-field
+                      <template v-if="item['isEditor']">
+                        <van-field
                         v-model="currentOpinion.opinionContent"
                         rows="3"
                         autosize
@@ -23,6 +24,19 @@
                         maxlength="50"
                         placeholder="请输入留言"
                       />
+                    </template>
+                    <template v-else>
+                        <van-field
+                        v-model="item.opinionContent"
+                        rows="3"
+                        autosize
+                        label=""
+                        type="textarea"
+                        :disabled="!item['isEditor']"
+                        maxlength="50"
+                        placeholder="请输入留言"
+                      />
+                    </template>
                     </div>
                     <div class="footer">
                       <p>
@@ -115,10 +129,16 @@ getTemplateOpinionListByFlowInstanceId(flowInstanceId).then((tResult) => {
   getOpinionListByFlowInstanceId(flowInstanceId).then((oResult) => {
     const oList = oResult.data ?? []
     if (oList.length > 0) { 
-      tList.forEach((tItem: any) => {
+      for (let i = 0; i < tList.length; i++) { 
+        const tItem = tList[i];
+        if (tItem['iDisplayOpinion'] === 0) {
+          tList.splice(i, 1)
+          i--;
+          continue;
+        }
         tItem['opinions'] = []
-        for (let i = 0; i < oList.length; i++) { 
-          const oItem = oList[i]
+        for (let j = 0; j < oList.length; j++) { 
+          const oItem = oList[j]
           if (tItem['id'] === oItem['flowOpinionId']) {
             if (oItem['activityInstanceId'] === activityInstanceId) {
               oItem['isEditor'] = true;
@@ -128,13 +148,19 @@ getTemplateOpinionListByFlowInstanceId(flowInstanceId).then((tResult) => {
               if (oItem['sign']) {
                 currentOpinion.value.sign = oItem['sign']
               }
+            } else {
+              if (!oItem['opinionContent'] && tItem['iHideNonFilledComment'] === 1) {
+                tList.splice(i, 1)
+                i--;
+                continue;
+              }
             }
             tItem['opinions'].push(oItem);
-            oList.splice(i, 1)
-            i--;
+            oList.splice(j, 1)
+            j--;
           }
         }
-      })
+      }
     }
     templateOpinions.value = tList
   })
@@ -165,6 +191,17 @@ const submitHandle = () => {
       margin-bottom: 15px;
       background-color: #fff;
       padding: 10px 0px;
+      &.disabled {
+        >h4 {
+          color: #999;
+        }
+        
+        >.footer {
+          > p {
+            color: #999;
+          }
+        }
+      }
       >h4 {
         font-size: 17px;
         margin: 0px;
@@ -184,8 +221,8 @@ const submitHandle = () => {
           margin: 0px;
           flex: 1;
           white-space: nowrap;
+          color: #333;
           >span {
-            color: #333;
             &:first-child {
               display: inline-block;
               margin-right: 5px;

+ 4 - 1
client_h5/src/pages/home/index.vue

@@ -1,6 +1,7 @@
 <script setup lang="ts">
 import { useUserStoreWithOut } from "@/stores/modules/user";
 import { getAssetsURI } from "@/utils/common";
+import { createProcessByModalId } from '@/service/flow';
 import reqest from "@/utils/request";
 
 const userStore = useUserStoreWithOut();
@@ -86,7 +87,9 @@ const toPageHandle = (path: string) => {
   window.location.href = path;
 };
 const toProcessHandle = (item: ProcessMenuItem): void => {
-  reqest.get(`/TProcessEngine/addMobile?templateId=${item.instanceId}`).then((result: any) => { 
+  createProcessByModalId({
+    templateId:item.instanceId
+  }).then((result: any) => { 
     if (typeof(result) === 'string') {
       location.href = result
     }

+ 5 - 11
client_h5/src/service/flow.ts

@@ -11,28 +11,22 @@ export interface FlowCreateDTO {
 
 /** 获取下一步流程(转件) */
 export const getNextActivity = async (data: FlowDTO) => {
-  return await reqest.post(`/workflow/Transfer/getNextActivity`, data,{
-    headers: { 'Authorization': 'Bearer test83e06d0d-af60-4419-9437-c9a68bf1b669' }
-  });
+  return await reqest.post(`/workflow/Transfer/getNextActivity`, data);
 }
 
 /** 发起流程 */
 export const createProcessByModalId = async (createData: FlowCreateDTO) => {
-  return await reqest.post(`/workflow/TProcessEngine/addMobile`, createData,{
-    headers: { 'Authorization': 'Bearer test83e06d0d-af60-4419-9437-c9a68bf1b669' }
+  return await reqest.get(`/workflow/TProcessEngine/addMobile`, {
+    params: createData,
   });
 }
 
 /** 获取流程意见 */
 export const getOpinionListByFlowInstanceId = async (flowInstanceId: String) => {
-  return await reqest.get(`/workflow/IFlowOpinion/getOpinionListByFlowInstanceId?flowInstanceId=${flowInstanceId}`,{
-    headers: { 'Authorization': 'Bearer test83e06d0d-af60-4419-9437-c9a68bf1b669' }
-  });
+  return await reqest.get(`/workflow/IFlowOpinion/getOpinionListByFlowInstanceId?flowInstanceId=${flowInstanceId}`);
 }
 
 /** 获取流程模板意见 */
 export const getTemplateOpinionListByFlowInstanceId = async (flowInstanceId: String) => {
-  return await reqest.get(`/workflow/TFlowOpinion/getOpinionListByFlowInstanceId?flowInstanceId=${flowInstanceId}`,{
-    headers: { 'Authorization': 'Bearer test83e06d0d-af60-4419-9437-c9a68bf1b669' }
-  });
+  return await reqest.get(`/workflow/TFlowOpinion/getOpinionListByFlowInstanceId?flowInstanceId=${flowInstanceId}`);
 }

+ 1 - 3
client_h5/src/stores/modules/user.ts

@@ -3,14 +3,12 @@ import { defineStore } from "pinia";
 export interface UserInterface {
     id: string  //用户ID
     nickname: string    //用户昵称
-    accessToken: string //accessToken
 }
 const UserStore = defineStore("UserStore", {
     state: () => ({
         userInfo: {
             id: "",
-            nickname: "",
-            accessToken: ""
+            nickname: ""
         } as UserInterface
     }),
     actions: {