cz 1 年之前
父节点
当前提交
e4d7610477

+ 28 - 18
src/components/process/EHSD/Purchase.vue

@@ -302,7 +302,7 @@
                                     </div>
                                   </template>
                                   <template #reference>
-                                    <div style="margin-left:10px;cursor:pointer;position:relative;top:4px" v-if="$index==0">
+                                    <div style="margin-left:10px;cursor:pointer;position:relative;top:4px">
                                       <el-icon :size="20" color="#85c1a6">
                                         <WarningFilled />
                                       </el-icon>
@@ -920,7 +920,14 @@ const getBuyCityName = (val, provinceId) => {
   }
 };
 const changeProductPrice = () => {
-  let productIds = formData.data.purchaseProductList.map((x) => x.productId);
+  let productIds = [];
+  for (let i = 0; i < formData.data.purchaseProductList.length; i++) {
+    const iele = formData.data.purchaseProductList[i];
+    for (let j = 0; j < iele.purchaseProductMountingsList.length; j++) {
+      const jele = iele.purchaseProductMountingsList[j];
+      productIds.push(jele.productId);
+    }
+  }
   if (productIds && productIds.length > 0) {
     proxy
       .post("/ehsdPurchase/getProductPriceInfo", {
@@ -932,36 +939,38 @@ const changeProductPrice = () => {
       .then((resOne) => {
         for (let i = 0; i < formData.data.purchaseProductList.length; i++) {
           const iele = formData.data.purchaseProductList[i];
-          for (const key in resOne) {
-            if (iele.productId == key) {
-              iele.purchaseProductMountingsList[0].purchaseProductPriceList =
-                resOne[key].purchaseProductList
+          for (let j = 0; j < iele.purchaseProductMountingsList.length; j++) {
+            const jele = iele.purchaseProductMountingsList[j];
+            for (const key in resOne) {
+              if (jele.productId == key) {
+                jele.purchaseProductPriceList = resOne[key].purchaseProductList
                   .map((x) => ({
                     createTime: x.createTime,
                     price: x.price,
                   }))
                   .filter((y, index) => index < 3);
-              iele.purchaseProductMountingsList[0].purchaseProductPriceListOne =
-                resOne[key].purchaseProductList.map((x) => ({
+                jele.purchaseProductPriceListOne = resOne[
+                  key
+                ].purchaseProductList.map((x) => ({
                   createTime: x.createTime,
                   price: x.price,
                 }));
-              iele.purchaseProductMountingsList[0].topPriceList = resOne[
-                key
-              ].topPriceList
-                .map((x) => ({
-                  supplierName: x.supplierName,
-                  price: x.price,
-                }))
-                .filter((y, index) => index < 3);
+                jele.topPriceList = resOne[key].topPriceList
+                  .map((x) => ({
+                    supplierName: x.supplierName,
+                    price: x.price,
+                  }))
+                  .filter((y, index) => index < 3);
 
-              iele.purchaseProductMountingsList[0].supplyPurchaseProductPriceList =
-                resOne[key].supplyPurchaseProductList
+                jele.supplyPurchaseProductPriceList = resOne[
+                  key
+                ].supplyPurchaseProductList
                   .map((x) => ({
                     createTime: x.createTime,
                     price: x.price,
                   }))
                   .filter((y, index) => index < 3);
+              }
             }
           }
         }
@@ -1642,6 +1651,7 @@ const selectMaterial = (goods) => {
       fileUrl: fileUrl,
       activeName: true,
     });
+    changeProductPrice();
     ElMessage({
       message: "添加成功!",
       type: "success",

+ 28 - 19
src/components/process/EHSD/PurchaseChange.vue

@@ -287,7 +287,7 @@
                                     </div>
                                   </template>
                                   <template #reference>
-                                    <div style="margin-left:10px;cursor:pointer;position:relative;top:4px" v-if="$index==0">
+                                    <div style="margin-left:10px;cursor:pointer;position:relative;top:4px">
                                       <el-icon :size="20" color="#85c1a6">
                                         <WarningFilled />
                                       </el-icon>
@@ -892,7 +892,14 @@ const getBuyCityName = (val, provinceId) => {
   }
 };
 const changeProductPrice = () => {
-  let productIds = formData.data.purchaseProductList.map((x) => x.productId);
+  let productIds = [];
+  for (let i = 0; i < formData.data.purchaseProductList.length; i++) {
+    const iele = formData.data.purchaseProductList[i];
+    for (let j = 0; j < iele.purchaseProductMountingsList.length; j++) {
+      const jele = iele.purchaseProductMountingsList[j];
+      productIds.push(jele.productId);
+    }
+  }
   if (productIds && productIds.length > 0) {
     proxy
       .post("/ehsdPurchase/getProductPriceInfo", {
@@ -904,37 +911,38 @@ const changeProductPrice = () => {
       .then((resOne) => {
         for (let i = 0; i < formData.data.purchaseProductList.length; i++) {
           const iele = formData.data.purchaseProductList[i];
-          for (const key in resOne) {
-            if (iele.productId == key) {
-              iele.purchaseProductMountingsList[0].purchaseProductPriceList =
-                resOne[key].purchaseProductList
+          for (let j = 0; j < iele.purchaseProductMountingsList.length; j++) {
+            const jele = iele.purchaseProductMountingsList[j];
+            for (const key in resOne) {
+              if (jele.productId == key) {
+                jele.purchaseProductPriceList = resOne[key].purchaseProductList
                   .map((x) => ({
                     createTime: x.createTime,
                     price: x.price,
                   }))
                   .filter((y, index) => index < 3);
-              iele.purchaseProductMountingsList[0].purchaseProductPriceListOne =
-                resOne[key].purchaseProductList.map((x) => ({
+                jele.purchaseProductPriceListOne = resOne[
+                  key
+                ].purchaseProductList.map((x) => ({
                   createTime: x.createTime,
                   price: x.price,
                 }));
+                jele.topPriceList = resOne[key].topPriceList
+                  .map((x) => ({
+                    supplierName: x.supplierName,
+                    price: x.price,
+                  }))
+                  .filter((y, index) => index < 3);
 
-              iele.purchaseProductMountingsList[0].topPriceList = resOne[
-                key
-              ].topPriceList
-                .map((x) => ({
-                  supplierName: x.supplierName,
-                  price: x.price,
-                }))
-                .filter((y, index) => index < 3);
-
-              iele.purchaseProductMountingsList[0].supplyPurchaseProductPriceList =
-                resOne[key].supplyPurchaseProductList
+                jele.supplyPurchaseProductPriceList = resOne[
+                  key
+                ].supplyPurchaseProductList
                   .map((x) => ({
                     createTime: x.createTime,
                     price: x.price,
                   }))
                   .filter((y, index) => index < 3);
+              }
             }
           }
         }
@@ -1678,6 +1686,7 @@ const selectMaterial = (goods) => {
       fileUrl: fileUrl,
       activeName: true,
     });
+    changeProductPrice();
     ElMessage({
       message: "添加成功!",
       type: "success",

+ 1 - 0
src/views/connect/E-mail/mail/com/left.vue

@@ -747,6 +747,7 @@ const clickTreeMail = (data, node) => {
     const menuData = {
       id: data.id,
       name: data.name,
+      oldName: data.name,
     };
     handleOpenMenu(menuData, "10");
   } else {

+ 204 - 78
src/views/connect/E-mail/mail/com/mailDetail.vue

@@ -1,107 +1,142 @@
 <template>
-  <div v-loading="loading" class="box">
-    <div style="
+  <div style="display:flex" ref="outerDom" v-loading="loading">
+    <div style="overflow:auto" :style="{width:boxWidth+'px',height:boxHeight+'px'}">
+      <div class="box">
+        <div style="
         margin-bottom: 10px;
         display: flex;
         align-items: center;
         flex-wrap: wrap;
       ">
-      <el-button :disabled="currentMailIndex === 0" @click="handleChangeEail('10')">上一封</el-button>
-      <el-button :disabled="currentMailIndex === allLength - 1" @click="handleChangeEail('20')">下一封</el-button>
-      <el-button type="primary" @click="handleReply('10')">回复</el-button>
-      <el-button type="primary" @click="handleReply('30')">全部回复</el-button>
-      <el-button type="warning" @click="handleReply('20')">转发</el-button>
-      <el-button @click="handleReply('40')">再次编辑</el-button>
-      <el-button @click="handleMove">移动</el-button>
-      <el-button @click="handleRemove">删除</el-button>
-      <div style="
+          <el-button :disabled="currentMailIndex === 0" @click="handleChangeEail('10')">上一封</el-button>
+          <el-button :disabled="currentMailIndex === allLength - 1" @click="handleChangeEail('20')">下一封</el-button>
+          <el-button type="primary" @click="handleReply('10')">回复</el-button>
+          <el-button type="primary" @click="handleReply('30')">全部回复</el-button>
+          <el-button type="warning" @click="handleReply('20')">转发</el-button>
+          <el-button @click="handleReply('40')">再次编辑</el-button>
+          <el-button @click="handleMove">移动</el-button>
+          <el-button @click="handleRemove">删除</el-button>
+          <div style="
           background-color: #eff6ff;
           padding: 6px;
           margin-left: 10px;
           cursor: pointer;
           border-radius: 2px 2px 2px 2px;
         " @click="handleAddTag">
-        <span class="iconfont icon-icon_biaoqian2" style="color: #0084ff; font-size: 20px"></span>
-      </div>
-      <!-- <el-tag
+            <span class="iconfont icon-icon_biaoqian2" style="color: #0084ff; font-size: 20px"></span>
+          </div>
+          <!-- <el-tag
         style="margin-left: 8px; cursor: pointer"
         type="success"
         @click="handleAddTag"
       >
         +
       </el-tag> -->
-    </div>
-    <div class="top">
-      <div class="top-row">
-        <div class="subject">
-          {{ subject }}
-        </div>
-      </div>
-      <div class="top-row" v-if="mailTagList && mailTagList.length > 0">
-        <el-tag style="margin-left: 8px" type="success" closable v-for="(tag, index) in mailTagList" :key="index" @close="tagClose(tag)">
-          {{ tag.name }}
-        </el-tag>
-      </div>
-      <div class="top-row">
-        <div class="label">发 件 人:</div>
-        <div class="value">
-          <span v-for="item in replyTo" :key="item.id" style="margin-right: 10px">
-            {{ item.email || item.personalName }}</span>
         </div>
-      </div>
-      <div class="top-row">
-        <div class="label">收 件 人:</div>
-        <div class="value">
-          <span v-for="item in to" :key="item.id" style="margin-right: 10px">{{
+        <div class="top">
+          <div class="top-row">
+            <div class="subject">
+              {{ subject }}
+            </div>
+          </div>
+          <div class="top-row" v-if="mailTagList && mailTagList.length > 0">
+            <el-tag style="margin-left: 8px" type="success" closable v-for="(tag, index) in mailTagList" :key="index" @close="tagClose(tag)">
+              {{ tag.name }}
+            </el-tag>
+          </div>
+          <div class="top-row">
+            <div class="label">发 件 人:</div>
+            <div class="value">
+              <span v-for="item in replyTo" :key="item.id" style="margin-right: 10px">
+                {{ item.email || item.personalName }}</span>
+            </div>
+          </div>
+          <div class="top-row">
+            <div class="label">收 件 人:</div>
+            <div class="value">
+              <span v-for="item in to" :key="item.id" style="margin-right: 10px">{{
             item.email || item.personalName
           }}</span>
-        </div>
-      </div>
-      <div class="top-row" v-if="cc && cc.length > 0">
-        <div class="label">抄 送 人:</div>
-        <div class="value">
-          <span v-for="item in cc" :key="item.id" style="margin-right: 10px">
-            {{ item.email || item.personalName }}</span>
-        </div>
-      </div>
-      <div class="top-row" v-if="bcc && bcc.length > 0">
-        <div class="label">密 送 人:</div>
-        <div class="value">
-          <span v-for="item in bcc" :key="item.id" style="margin-right: 10px">
-            {{ item.email || item.personalName }}</span>
-        </div>
-      </div>
-      <div class="top-row">
-        <div class="label">时 间:</div>
-        <div class="value">
-          {{ time }}
-        </div>
-      </div>
-      <div class="top-row" v-if="fileList && fileList.length > 0">
-        <div class="label">附 件:</div>
-        <div class="value">
-          <div v-for="(item, index) in fileList" style="margin-right: 20px; display: flex; align-items: center" :key="index">
-            <span style="cursor: pointer" @click="handleClickFile(item)">{{
+            </div>
+          </div>
+          <div class="top-row" v-if="cc && cc.length > 0">
+            <div class="label">抄 送 人:</div>
+            <div class="value">
+              <span v-for="item in cc" :key="item.id" style="margin-right: 10px">
+                {{ item.email || item.personalName }}</span>
+            </div>
+          </div>
+          <div class="top-row" v-if="bcc && bcc.length > 0">
+            <div class="label">密 送 人:</div>
+            <div class="value">
+              <span v-for="item in bcc" :key="item.id" style="margin-right: 10px">
+                {{ item.email || item.personalName }}</span>
+            </div>
+          </div>
+          <div class="top-row">
+            <div class="label">时 间:</div>
+            <div class="value">
+              {{ time }}
+            </div>
+          </div>
+          <div class="top-row" v-if="fileList && fileList.length > 0">
+            <div class="label">附 件:</div>
+            <div class="value">
+              <div v-for="(item, index) in fileList" style="margin-right: 20px; display: flex; align-items: center" :key="index">
+                <span style="cursor: pointer" @click="handleClickFile(item)">{{
               item.name
             }}</span>
-            <span style="margin-left: 8px; cursor: pointer" @click="handleClickDownload(item)"><el-icon color="#0084FF">
-                <Download />
-              </el-icon></span>
+                <span style="margin-left: 8px; cursor: pointer" @click="handleClickDownload(item)"><el-icon color="#0084FF">
+                    <Download />
+                  </el-icon></span>
+              </div>
+            </div>
           </div>
         </div>
-      </div>
-    </div>
 
-    <div class="body">
-      <iframe frameborder="0" allowTransparency="true" style="
+        <div class="body">
+          <iframe frameborder="0" allowTransparency="true" style="
           width: 99% !important;
           overflow-x: scroll;
           padding-top: 10px;
-          height: 500px;
         " :srcdoc="showBodyText(detailsData.data.content)" :ref="'iframeText_' + mailStore.currentId" :id="'iframeText_' + mailStore.currentId">
-      </iframe>
+          </iframe>
+        </div>
+
+      </div>
     </div>
+    <div style="width:210px;margin-left:10px;overflow:auto" :style="{height:boxHeight+'px'}" v-if="isShowCommunication">
+      <el-tabs v-model="activeName" class="demo-tabs" type="card" @tab-click="handleClick">
+        <el-tab-pane label="往来附件" name="first"></el-tab-pane>
+        <el-tab-pane label="往来邮件" name="second"></el-tab-pane>
+      </el-tabs>
+      <div class="communication">
+        <div class="list" v-show="activeName=='first'">
+          <div class="item" v-for="(item,index) in communicationAtt" :key="item.id" @click="handleRowClick(item)">
+            <div>
+              发件时间: {{item.sendDate}}
+            </div>
+            <div style="margin:5px 0">
+              主题: {{item.subject}}
+            </div>
+            <div>
+              附件: aa.png
+            </div>
+          </div>
+        </div>
+        <div class="list" v-show="activeName=='second'">
+          <div class="item" v-for="(item,index) in communicationMail" :key="item.id" @click="handleRowClick(item)">
+            <div>
+              发件时间: {{item.sendDate}}
+            </div>
+            <div style="margin-top:5px">
+              主题: {{item.subject}}
+            </div>
 
+          </div>
+        </div>
+      </div>
+    </div>
     <el-dialog title="移动邮件" v-model="myFolderDialog" width="300px" destroy-on-close v-loading="submitLoading">
       <byForm :formConfig="myFolderFormConfig" :formOption="formOption" v-model="formData.myFolderData" :rules="rules" ref="myFolderForm">
       </byForm>
@@ -124,6 +159,7 @@
       </template>
     </el-dialog>
   </div>
+
 </template>
 
 <script setup>
@@ -131,7 +167,19 @@ import useMailStore from "@/store/modules/mail";
 import useUserStore from "@/store/modules/user";
 import byForm from "@/components/byForm/index";
 import { ElMessage, ElMessageBox } from "element-plus";
+import { nextTick } from "vue";
 const { proxy } = getCurrentInstance();
+const outerDom = ref(null);
+const boxHeight = ref(0);
+const boxWidth = ref(700);
+const getTableHeight = () => {
+  boxHeight.value = window.innerHeight - 180;
+};
+getTableHeight();
+window.addEventListener("resize", () => {
+  getTableHeight();
+});
+const isShowCommunication = ref(true);
 const mailStore = useMailStore();
 let loading = ref(false);
 const detailsData = reactive({
@@ -344,7 +392,22 @@ const getDetails = (messageId) => {
       if (mailStore.currentMenu.subject) {
         subject.value = mailStore.currentMenu.subject;
       }
-
+      if (mailStore.currentMenu.fromEmail) {
+        // 如果发件人是自己的话就不显示往来邮件
+        let flag =
+          mailStore.currentMenu.fromEmail == mailStore.selectMail.mailUser;
+        if (flag) {
+          isShowCommunication.value = false;
+          nextTick(() => {
+            boxWidth.value = outerDom.value.offsetWidth;
+          });
+        } else {
+          getCommunicationData();
+          nextTick(() => {
+            boxWidth.value = outerDom.value.offsetWidth - 220;
+          });
+        }
+      }
       detailsData.data = res;
       to.value = res.messageAddressList.filter((x) => x.type === 1);
       cc.value = res.messageAddressList.filter((x) => x.type === 2);
@@ -464,10 +527,49 @@ const handleClickDownload = (file) => {
   };
 };
 
-// onMounted(() => {
-//   getMyFolderTree(true);
-//   getAllTagData();
-// });
+onMounted(() => {
+  // getMyFolderTree(true);
+  // getAllTagData();
+  // iframe动态高度
+  const iframe = proxy.$refs["iframeText_" + mailStore.currentId];
+  iframe.addEventListener("load", () => {
+    iframe.style.height =
+      iframe.contentWindow.document.body.scrollHeight + 30 + "px";
+  });
+});
+const communicationMail = ref([]);
+const communicationAtt = ref([]);
+const getCommunicationData = () => {
+  let data = {
+    folderId: "",
+    type: mailStore.selectMail.type,
+    mailboxId: mailStore.selectMail.id,
+    dealingsEmail: mailStore.currentMenu.fromEmail,
+  };
+  proxy.post("/mailService/getMessagePage", data).then((res) => {
+    communicationMail.value = res.rows.filter((x) => !x.isAttachments);
+    communicationAtt.value = res.rows.filter((x) => x.isAttachments == 1);
+  });
+};
+
+const handleRowClick = (row) => {
+  const menu = {
+    title: row.subject.slice(0, 4) + "...",
+    type: mailStore.selectMail.type,
+    messageId: row.id,
+    id: "detail" + "," + row.id,
+    time: row.sendDate,
+    subject: row.subject,
+    fromEmail: row.fromEmail,
+    row: { ...row },
+  };
+  const menuItem = mailStore.mailMenuList.find((x) => x.id === menu.id);
+  if (menuItem === undefined) {
+    mailStore.mailMenuList.push(menu);
+  }
+  mailStore.currentMenu = menu;
+  mailStore.currentId = menu.id;
+};
 
 const init = () => {
   //实时更换索引
@@ -482,6 +584,7 @@ const init = () => {
   getAllTagData();
 };
 
+const activeName = ref("first");
 defineExpose({
   initFn: init,
 });
@@ -521,10 +624,19 @@ defineExpose({
   background: #ffffff;
   color: #0084ff;
 }
-
 .el-tag.el-tag--success {
   color: #0084ff;
 }
+:deep(.el-tabs__item) {
+  font-size: 12px;
+  line-height: 30px;
+  height: 30px;
+  font-weight: normal;
+}
+:deep(.el-tabs__header) {
+  margin: 8px 0;
+  height: 32px;
+}
 </style>
 <style lang="scss">
 .top-row {
@@ -536,4 +648,18 @@ defineExpose({
     background: #0084ff !important ;
   }
 }
+.communication {
+  font-size: 12px;
+  padding: 0 10px;
+  .list {
+    display: flex;
+    flex-direction: column;
+    .item {
+      border-bottom: 1px solid #eee;
+      margin-bottom: 10px;
+      cursor: pointer;
+      padding-bottom: 10px;
+    }
+  }
+}
 </style>

+ 70 - 7
src/views/connect/E-mail/mail/com/mailList.vue

@@ -39,16 +39,14 @@
         </el-table-column>
         <el-table-column label="" width="80">
           <template #default="{ row, $index }">
-            <div style="display:flex;align-items:center" @click="handleRowClick(row, $index)">
-              <span v-if="row.flags && !row.flags.includes('6')">
-                <img src="@/assets/images/mail/message.png" alt="" title="未读" class="messageImg" style="cursor: pointer;" />
-              </span>
+            <div style="display:flex;align-items:center">
               <span v-if="
                   row.flags !== undefined &&
                   row.flags !== null &&
                   row.flags === ''
                 ">
-                <img src="@/assets/images/mail/message.png" alt="" title="未读" class="messageImg" style="cursor: pointer;" />
+                <img src="@/assets/images/mail/message.png" alt="" title="未读" class="messageImg" style="cursor: pointer;"
+                     @click.stop="handleRead(row)" />
               </span>
               <span v-if="
                   row.flags &&
@@ -58,7 +56,8 @@
                 <img src="@/assets/images/mail/replied.png" alt="" title="已回复" class="messageImg" style="cursor: pointer;" />
               </span>
               <span v-if="row.flags && row.flags.includes('6')">
-                <img src="@/assets/images/mail/message-open.png" alt="" title="已读" class="messageImg" style="cursor: pointer;" />
+                <img src="@/assets/images/mail/message-open.png" alt="" title="已读" class="messageImg" style="cursor: pointer;"
+                     @click.stop="handleUnRead(row)" />
               </span>
               <span style="margin-left:5px;cursor: pointer;">
                 <el-popover placement="top-start" :width="300" trigger="hover">
@@ -218,6 +217,7 @@ import { ElMessage, ElMessageBox } from "element-plus";
 import "@imengyu/vue3-context-menu/lib/vue3-context-menu.css";
 import ContextMenu from "@imengyu/vue3-context-menu";
 import AddCustomer from "@/views/customer/addCustomer.vue";
+import { watch } from "vue";
 const AddCustomerDom = ref(null);
 const customerId = ref("");
 const modalType = ref("add");
@@ -411,6 +411,7 @@ const handleRowClick = (row, index) => {
     id: "detail" + "," + row.id,
     time: row.sendDate,
     subject: row.subject,
+    fromEmail: row.fromEmail,
     row: { ...row },
   };
   const menuItem = mailStore.mailMenuList.find((x) => x.id === menu.id);
@@ -497,7 +498,7 @@ const handleChangeCheckAll = () => {
 const btnLoading = ref(false);
 const handleSetAllRead = () => {
   btnLoading.value = true;
-  const uidList = selectData.value.map((x) => x.id);
+  const uidList = selectData.value.map((x) => x.uid);
   const data = {
     folderName: mailStore.currentMenu.oldName,
     uidList,
@@ -608,8 +609,51 @@ const editFormLoading = ref(false);
 const editType = ref("1");
 const editTile = ref("添加标签");
 const editDialog = ref(false);
+const readData = ref({});
+const handleRead = (row) => {
+  // 标记未读已读数据
+  const uidList = [row.uid];
+  readData.value = {
+    folderName: mailStore.currentMenu.oldName,
+    uidList,
+    mailboxId: mailStore.selectMail.id,
+    type: mailStore.selectMail.type,
+  };
+  proxy.post("/mailService/setSeen", readData.value).then(
+    (res) => {
+      ElMessage({
+        message: `操作成功!`,
+        type: "success",
+      });
+      getList();
+    },
+    (err) => {}
+  );
+};
+const handleUnRead = (row) => {
+  loading.value = true;
+  // 标记未读已读数据
+  const uidList = [row.uid];
+  readData.value = {
+    folderName: mailStore.currentMenu.oldName,
+    uidList,
+    mailboxId: mailStore.selectMail.id,
+    type: mailStore.selectMail.type,
+  };
+  proxy.post("/mailService/cancelSeen", readData.value).then(
+    (res) => {
+      ElMessage({
+        message: `操作成功!`,
+        type: "success",
+      });
+      getList();
+    },
+    (err) => {}
+  );
+};
 const handleContextmenu = (row, column, e) => {
   e.preventDefault();
+  // 添加标签或者移动到文件夹数据
   editForm.data = {
     myTagId: "",
     myFolderId: "",
@@ -635,6 +679,18 @@ const handleContextmenu = (row, column, e) => {
           editDialog.value = true;
         },
       },
+      {
+        label: "未读",
+        onClick: () => {
+          handleUnRead(row);
+        },
+      },
+      {
+        label: "已读",
+        onClick: () => {
+          handleRead(row);
+        },
+      },
     ],
   });
 };
@@ -724,6 +780,13 @@ const handleGoWrite = (mail = {}, pageType = "0") => {
   mailStore.currentId = menu.id;
 };
 
+watch(
+  () => mailStore.selectMail.id,
+  () => {
+    getList();
+  }
+);
+
 defineExpose({
   initFn: init,
 });

+ 20 - 2
src/views/connect/E-mail/mail/com/mailWrite.vue

@@ -310,6 +310,7 @@ const handleSend = () => {
           bcc: bcc.value,
           replyTo: replyTo,
           fileList: fileListCopy.value.map((x) => ({
+            id: x.id,
             fileName: x.fileName,
             fileUrl: x.fileUrl,
           })),
@@ -344,7 +345,6 @@ const handleBeforeUpload = async (file) => {
     fileName: res.fileName,
     path: res.fileUrl,
     fileUrl: res.fileUrl,
-    uid: file.uid,
   });
 };
 
@@ -591,7 +591,25 @@ const handleChangeTemplate = (val) => {
     );
   }
 };
-onMounted(() => {});
+
+onMounted(() => {
+  $bus.on("uploadFile", (fileList) => {
+    for (let i = 0; i < fileList.length; i++) {
+      const file = fileList[i];
+      fileListCopy.value.push({
+        id: file.id,
+        fileName: file.fileName,
+        path: file.fileUrl,
+        fileUrl: file.fileUrl,
+      });
+    }
+  });
+});
+
+onBeforeUnmount(() => {
+  // 取消订阅特定事件
+  $bus.off("uploadFile");
+});
 
 defineExpose({
   initFn: init,

+ 5 - 26
src/views/connect/E-mail/mail/com/main.vue

@@ -1,32 +1,11 @@
 <template>
   <div class="container">
-    <el-tabs
-      v-model="activeMenu"
-      closable
-      :stretch="false"
-      type="card"
-      @tab-remove="handleTabRemove"
-      @tab-change="handleTabChange"
-    >
-      <el-tab-pane
-        v-for="(item, index) in menuList"
-        :key="index"
-        :label="item.title"
-        :name="item.id"
-      >
+    <el-tabs v-model="activeMenu" closable :stretch="false" type="card" @tab-remove="handleTabRemove" @tab-change="handleTabChange">
+      <el-tab-pane v-for="(item, index) in menuList" :key="index" :label="item.title" :name="item.id">
         <div class="main">
-          <mailList
-            v-show="item.id.includes('folder')"
-            :ref="'folder' + index"
-          ></mailList>
-          <mailDetail
-            v-show="item.id.includes('detail')"
-            :ref="'detail' + index"
-          ></mailDetail>
-          <mailWrite
-            v-show="item.id.includes('write')"
-            :ref="'write' + index"
-          ></mailWrite>
+          <mailList v-if="item.id.includes('folder')" :ref="'folder' + index"></mailList>
+          <mailDetail v-if="item.id.includes('detail')" :ref="'detail' + index"></mailDetail>
+          <mailWrite v-if="item.id.includes('write')" :ref="'write' + index"></mailWrite>
         </div>
       </el-tab-pane>
     </el-tabs>

+ 23 - 5
src/views/connect/E-mail/mail/com/right/netdisk/enterprise.vue

@@ -47,6 +47,7 @@
 
 <script setup>
 import useMailStore from "@/store/modules/mail";
+import $bus from "@/bus/index.js";
 const mailStore = useMailStore();
 const isShowBtn = ref(false);
 mailStore.$subscribe((mutations, state) => {
@@ -129,12 +130,29 @@ const getTreeList = () => {
 getTreeList();
 getList();
 
-const handleClickRow = (row) => {
-  proxy
-    .post("/fileInfo/getList", { businessIdList: [row.parentFolderId] })
-    .then((fileObj) => {
-      console.log(fileObj, "asda");
+const handleClickRow = async (row) => {
+  let businessIdList = [];
+  if (row.type == 1) {
+    // 点击的是文件夹
+    const res = await proxy.post("/netdisk/getFileList", {
+      parentFolderId: row.id,
     });
+    businessIdList = res.map((x) => x.id);
+  } else {
+    // 点击的是文件
+    businessIdList = [row.id];
+  }
+  if (businessIdList && businessIdList.length > 0) {
+    proxy.post("/fileInfo/getList", { businessIdList }).then((resFile) => {
+      let arr = [];
+      for (const key in resFile) {
+        arr = arr.concat([...resFile[key]]);
+      }
+      if (arr && arr.length > 0) {
+        $bus.emit("uploadFile", arr);
+      }
+    });
+  }
 };
 </script>