王智慧 3 éve
szülő
commit
404e605800

+ 1 - 0
package.json

@@ -16,6 +16,7 @@
     "element-plus": "^2.2.25",
     "lodash": "^4.17.21",
     "md5": "^2.3.0",
+    "moment": "^2.29.4",
     "vite-plugin-compression": "^0.3.5",
     "vue": "^3.2.16",
     "vue-router": "^4.0.4",

+ 0 - 0
public/汇很多-数据中心.ico → public/汇很多-船务公司.ico


+ 0 - 16
src/App.vue

@@ -4,9 +4,6 @@
 
 <script setup></script>
 <style>
-.footer {
-  text-align: center;
-}
 .main-app {
   width: 100%;
   height: calc(100% - 120px);
@@ -19,19 +16,6 @@
   overflow: auto;
 }
 
-.first-title {
-  height: 52px;
-  line-height: 52px;
-  width: 100%;
-  box-sizing: border-box;
-  background: #fff;
-  font-size: 18px;
-  font-family: PingFangSC-Medium, PingFang SC;
-  font-weight: 500;
-  color: #333d43;
-  padding-left: 20px;
-}
-
 .line-container-p18 {
   padding: 18px;
   background: #fff;

+ 4 - 1
src/apis/config.js

@@ -16,7 +16,10 @@ export const $http = function (url, data) {
   return axios({
     method: data ? "post" : "get",
     url: baseurl + url,
-    data,
+    data: {
+      ...data,
+      loginAccountId: localStorage.loginAccountId,
+    },
     withCredentials: true,
   });
 };

+ 6 - 402
src/apis/fetch.js

@@ -5,419 +5,23 @@ export default {
     return $http("/user/web/login", data);
   },
 
-  // 获取用户列表 货主/船东
-  getUserList(data) {
-    return $http("user/list", data);
+  // 新增船东
+  addShipOwner(data) {
+    return $http("/shipOwner/add", data);
   },
 
+  // 获取船东列表
   getShipOwnerList(data) {
     return $http("/shipOwner/list", data);
   },
 
+  // 获取船东详情
   getShipOwnerDetail(data) {
-    return $http("/shipOwner/details", data);
-  },
-
-  updateShipOwner(data) {
-    return $http("/shipOwner/update", data);
-  },
-
-  // 添加用户
-  addUser(data) {
-    return $http("user/add", data);
-  },
-
-  // 添加船东
-  addShipOwner(data) {
-    return $http("/shipOwner/add", data);
-  },
-
-  // 获取用户详情
-  getUserDetail(data) {
-    return $http("user/details", data);
-  },
-
-  // 更新用户详情
-  updateUserDetail(data) {
-    return $http("/user/update", data);
-  },
-
-  // 获取航次列表
-  getVoyageList(data) {
-    return $http("voyage/list", data);
-  },
-
-  // 获取航次详情
-  getVoyageDetail(data) {
-    return $http("/voyage/detail", data);
-  },
-
-  // 更新航次
-  updateVoyage(data) {
-    return $http("/voyage/update", data);
-  },
-
-  // 完成航次
-  finishVoyage(data) {
-    return $http("/voyage/finish", data);
-  },
-
-  // 根据船名/MMSI/船东手机号获取船舶用户信息(员工端添加航次选择船)
-  getUserInfoAndShipInfo(data) {
-    return $http("ship/userShipInfo", data);
-  },
-
-  // 添加航次
-  addVoyage(data) {
-    return $http("voyage/add", data);
-  },
-
-  // 获取媒体列表
-  getMediaList(data) {
-    return $http("/media/list", data);
-  },
-
-  // 审核媒体文件
-  auditMedia(data) {
-    return $http("/media/audit", data);
-  },
-
-  // 标记媒体文件
-  markMedia(data) {
-    return $http("/media/markMedia", data);
-  },
-
-  // 模糊搜索用户
-  searchUser(data) {
-    return $http("/user/search", data);
-  },
-
-  // 获取船舶列表
-  getShipList(data) {
-    return $http("/ship/list", data);
-  },
-
-  // 更新船舶信息
-  updateShip(data) {
-    return $http("/ship/update", data);
+    return $http("/shipOwner/detail", data);
   },
 
   // 更新船东信息
   updateShipOwner(data) {
     return $http("/shipOwner/update", data);
   },
-
-  // 获取船舶详情
-  getShipDetail(data) {
-    return $http("/ship/detail", data);
-  },
-
-  // 船舶查询
-  searchShip(data) {
-    return $http("ship/search", data);
-  },
-
-  // 根据shipId获取船东列表
-  getShipOwnerListByShipId(data) {
-    return $http("/ship/detail/shopOwner/list", data);
-  },
-
-  // 添加卸货记录
-  addDischarge(data) {
-    return $http("/voyage/addDischarge", data);
-  },
-
-  // 删除卸货记录
-  deleteDischarge(data) {
-    return $http("/voyage/deleteDischarge", data);
-  },
-
-  // 导出excel
-  exportExcel(data) {
-    return $http("/voyage/exportExcel", data);
-  },
-
-  // 获取卸货列表
-  getDischargeList(data) {
-    return $http("/voyage/getDischargeList", data);
-  },
-
-  // 修改卸货记录
-  updateDischarge(data) {
-    return $http("/voyage/updateDischarge", data);
-  },
-
-  // 获取未拍照航次
-  getUnphotographNotice() {
-    return $http("/voyage/notice");
-  },
-
-  // 计算预计到港时间
-  calExpectedArrivalTime(data) {
-    return $http("/voyage/calExpectedArrivalTime", data);
-  },
-
-  // 删除运单
-  deleteWaybill(data) {
-    return $http("/voyage/deleteWaybill", data);
-  },
-
-  // 上传运单
-  updateVoyageWaybill(data) {
-    return $http("/voyage/updateVoyageWaybill", data);
-  },
-
-  // 获取港口列表
-  getCol(data) {
-    return $http("/port/getCol", data);
-  },
-
-  // 取消航次
-  cancelVoyage(data) {
-    return $http("/voyage/cancel", data);
-  },
-
-  // 添加汽车装货记录
-  addTruckLoadRecord(data) {
-    return $http("/voyage/addCarLoadRecord", data);
-  },
-
-  // 获取汽车装货记录
-  getTruckLoadRecord(data) {
-    return $http("/voyage/getCarLoadRecordList", data);
-  },
-
-  // 删除汽车装货记录
-  deleteTruckLoadRecord(data) {
-    return $http("/voyage/deleteCarLoadRecord", data);
-  },
-
-  // 更新汽车装货记录
-  updateTruckLoadRecord(data) {
-    return $http("/voyage/updateCarLoadRecord", data);
-  },
-
-  // 分配单据
-  distribute(data) {
-    return $http("/shipownerUploadFile/distribute", data);
-  },
-
-  // ocr识别
-  ocr(data) {
-    return $http("/shipownerUploadFile/ocr", data);
-  },
-
-  // 用户选择
-  getUserSelect(data) {
-    return $http("/user/select", data);
-  },
-
-  // 添加提货单
-  addLab(data) {
-    return $http("/voyage/addLab", data);
-  },
-
-  // 获取提货单
-  getLabList(data) {
-    return $http("/voyage/getLabList", data);
-  },
-
-  // 更新提货单
-  updateLab(data) {
-    return $http("/voyage/updateLab", data);
-  },
-
-  // 删除提货单
-  deleteLab(data) {
-    return $http("/voyage/deleteLab", data);
-  },
-
-  // 获取港口天气列表
-  getPortWeatherList(data) {
-    return $http("/voyage/getPortWeatherList", data);
-  },
-
-  // 获取超期航次提醒
-  getLongDaysInPort(data) {
-    return $http("/voyage/cargo/longDaysInPort", data);
-  },
-
-  // 获取区块链列表
-  getBlockChainList(data) {
-    return $http("/block/voyage/list", data);
-  },
-
-  // 航次上链
-  upBlockChain(data) {
-    return $http("/block/voyage/up", data);
-  },
-
-  // 插入卸货港
-  addNewPort(data) {
-    return $http("/voyage/addNewPort", data);
-  },
-
-  // 代理列表
-  getAgencyList(data) {
-    return $http("/proxy/list", data);
-  },
-
-  // 代理子账户列表
-  getAgencySubAccountList(data) {
-    return $http("/proxy/detail/account/list", data);
-  },
-
-  // 添加代理子账户
-  addAgencySubAccount(data) {
-    return $http("/proxy/detail/account/add", data);
-  },
-
-  // 获取货主公司列表
-  getCargoOwnerCompanyList(data) {
-    return $http("/cargoOwner/list", data);
-  },
-
-  // 获取货主公司详情
-  getCargoOwnerCompanyDetail(data) {
-    return $http("/cargoOwner/detail", data);
-  },
-
-  // 添加货主公司
-  addCargoOwnerCompany(data) {
-    return $http("/cargoOwner/add", data);
-  },
-
-  // 获取货主公司账号列表
-  getCargoOwnerAccountList(data) {
-    return $http("/cargoOwner/detail/account/list", data);
-  },
-
-  // 添加货主公司账号
-  addCargoOwnerAccount(data) {
-    return $http("/cargoOwner/detail/account/add", data);
-  },
-
-  // 添加代理公司
-  addAgencyCompany(data) {
-    return $http("/proxy/add", data);
-  },
-
-  // 获取代理公司列表
-  getAgencyCompanyList(data) {
-    return $http("/proxy/list", data);
-  },
-
-  // 获取代理公司审核列表
-  getAgencyExamineList(data) {
-    return $http("/proxy/audit/list", data);
-  },
-
-  // 代理公司审核
-  examineAgency(data) {
-    return $http("/proxy/audit", data);
-  },
-
-  // 获取代理公司详情
-  getAgencyCompanyDetail(data) {
-    return $http("/proxy/detail", data);
-  },
-
-  // 货主公司详情-代理公司列表
-  getAgencyCompanyByCargoOwnerCompany(data) {
-    return $http("/cargoOwner/detail/proxy/list", data);
-  },
-  // 货主公司添加账号-关联货种
-  getCargoList(data) {
-    return $http("/cargo/account/add/cargo/select", data);
-  },
-
-  // 关联代理公司-select
-  getAgencySelect(data) {
-    return $http("/cargoOwner/detail/proxy/select", data);
-  },
-
-  // 货主公司详情-关联代理;代理公司详情-关联货主公司
-  relateCargoAgency(data) {
-    return $http("/proxy/cargoOwner/add", data);
-  },
-
-  // 取消货主公司详情-关联代理;代理公司详情-关联货主公司
-  unrelateCargoAgency(data) {
-    return $http("/proxy/cargoOwner/delete", data);
-  },
-
-  // 代理公司详情-货主公司列表
-  getCargoOwnerCompanyByAgencyCompany(data) {
-    return $http("/proxy/detail/cargoOwner/list", data);
-  },
-
-  // 关联货主公司-select
-  getCargoOwnerCompanySelect(data) {
-    return $http("/proxy/detail/cargoOwner/select", data);
-  },
-
-  // 添加港口
-  addPort(data) {
-    return $http("/port/add", data);
-  },
-
-  // 港口列表
-  getPortsList(data) {
-    return $http("/port/list", data);
-  },
-
-  // 获取港口列表select
-  getPortsSelect(data) {
-    return $http("/port/select", data);
-  },
-
-  // 启用禁用港口
-  updatePortStatus(data) {
-    return $http("/port/updateStatus", data);
-  },
-
-  // 添加港口航期
-  addTransPort(data) {
-    return $http("/port/trans/add", data);
-  },
-
-  // 港口航期列表
-  getTransPortsList(data) {
-    return $http("/port/trans/list", data);
-  },
-
-  // 获取货主下拉
-  getCargoOwnerSelect(data) {
-    return $http("/proxy/detail/cargoOwner/select", data);
-  },
-
-  // 货主公司更新有效期
-  updateCargoOwnerExpiredTime(data) {
-    return $http("/cargoOwner/updateExpiredTime", data);
-  },
-
-  // 代理公司更新有效期
-  updateAgencyExpiredTime(data) {
-    return $http("/proxy/updateExpiredTime", data);
-  },
-
-  // 删除通用文件
-  deleteUFile(data) {
-    return $http("/ufile/delete", data);
-  },
-
-  // 获取通用文件列表
-  getUFileList(data) {
-    return $http("/ufile/getFileList", data);
-  },
-
-  // 获取通用文件类型选项
-  getUFileTypeSelect(data) {
-    return $http("/ufile/getTypeSelect", data);
-  },
-
-  // 上传通用文件
-  uploadUFile(data) {
-    return $http("/ufile/upload", data);
-  },
 };

+ 0 - 96
src/components/Aside.vue

@@ -1,96 +0,0 @@
-<template>
-  <el-menu
-    :default-active="this.$store.state.currentMenuItem"
-    style="width: 220px; height: 100%"
-    background-color="#141B29"
-    text-color="#fff"
-    active-text-color="#ffd04b"
-    :router="true"
-  >
-    <el-sub-menu v-for="(item, index) in menu" :key="item" :index="index + ''">
-      <template v-slot:title>
-        <el-icon :size="18">
-          <component :is="item.icon" />
-        </el-icon>
-        <span>{{ item.title }}</span>
-      </template>
-      <el-menu-item
-        v-for="son in item.items"
-        :index="son.path"
-        :key="son"
-        @click="changeIndex(son.path)"
-      >
-        {{ son.name }}
-      </el-menu-item>
-    </el-sub-menu>
-  </el-menu>
-</template>
-<script>
-import { ref } from "vue";
-export default {
-  setup() {
-    let defaultActive = ref();
-    function changeIndex(path) {
-      defaultActive.value = path;
-    }
-    let menu = [
-      {
-        icon: "Fold",
-        title: "首页",
-        items: [
-          {
-            path: "/index",
-            name: "首页",
-          },
-        ],
-      },
-      {
-        icon: "Avatar",
-        title: "船东管理",
-        items: [
-          {
-            path: "/shipOwnerManage/shipOwnerList",
-            name: "船东列表",
-          },
-        ],
-      },
-      {
-        icon: "Ship",
-        title: "船舶管理",
-        items: [
-          {
-            path: "/shipManage/shipList",
-            name: "船舶列表",
-          },
-        ],
-      },
-      {
-        icon: "Document",
-        title: "工作站",
-        items: [
-          {
-            path: "/workStation/certsManage",
-            name: "证书管理",
-          },
-          {
-            path: "/workStation/insuranceManage",
-            name: "保险管理",
-          },
-        ],
-      },
-    ];
-
-    return {
-      changeIndex,
-      defaultActive,
-      menu,
-    };
-  },
-};
-</script>
-<style scoped>
-.el-sub-menu__title i {
-  height: 20px;
-  margin-right: 10px;
-}
-</style>

+ 0 - 37
src/components/Footer.vue

@@ -1,37 +0,0 @@
-<template>
-  <div class="copyright">
-    <div class="in" @click="goBeian">
-      Copyright © 2021 河南省汇很多科技有限公司 豫ICP备 2021029101 号
-    </div>
-  </div>
-</template>
-<script>
-export default {
-  setup() {
-    function goBeian() {
-      window.open("https://beian.miit.gov.cn/");
-    }
-    return {
-      goBeian,
-    };
-  },
-};
-</script>
-<style scoped>
-.copyright {
-  width: 100%;
-  height: 60px;
-  background: #b3c0d1;
-}
-
-.in {
-  width: 520px;
-  margin: 0 auto;
-  line-height: 60px;
-  font-family: PingFang SC;
-  font-weight: 400;
-  color: #333333;
-  opacity: 0.8;
-  cursor: pointer;
-}
-</style>

+ 0 - 279
src/components/Header.vue

@@ -1,279 +0,0 @@
-<template>
-  <div class="header">
-    <div class="left">
-      <img class="first" src="../assets/three.png" alt="" />
-      <div class="shu"></div>
-      <img class="logo" src="../assets/white-logo.png" alt="" />
-      <div
-        class="ml20"
-        style="color: #fff; font-size: 18px; height: 60px; padding-top: 50px"
-      >
-        version:{{ timelineData[0]?.version }}
-      </div>
-    </div>
-    <div class="right">
-      <div
-        @click="dialogVisible = true"
-        class="pointer"
-        style="padding-top: 6px"
-      >
-        <el-badge
-          :hidden="isNewMessage.length == 0"
-          :value="isNewMessage.length"
-          class="mr30"
-        >
-          <el-icon :size="size" color="#00a9dc">
-            <BellFilled />
-          </el-icon>
-        </el-badge>
-      </div>
-      <img class="user-icon" src="../assets/user.png" alt="" />
-      <div class="user">{{ userName }}</div>
-      <el-popover placement="bottom" trigger="hover" :width="280">
-        <div
-          style="
-            width: 100%;
-            height: 60vh;
-            overflow-y: auto;
-            padding-right: 10px;
-            margin-right: 10px;
-          "
-        >
-          <el-timeline>
-            <el-timeline-item
-              v-for="item in timelineData"
-              center
-              :timestamp="item.timer"
-              placement="top"
-            >
-              <div class="log-card">
-                <p style="margin-bottom: 10px">Version: {{ item.version }}</p>
-                <div
-                  style="margin-bottom: 5px; font-size: 12px"
-                  v-for="(item1, index) in item.remarks"
-                >
-                  {{ index + 1 }}. {{ item1.text }}
-                </div>
-              </div>
-            </el-timeline-item>
-          </el-timeline>
-        </div>
-
-        <template #reference>
-          <el-badge value="new">
-            <div class="log">新功能日志</div>
-          </el-badge>
-        </template>
-      </el-popover>
-      <div class="quit" @click="quit">[退出]</div>
-    </div>
-    <el-dialog v-model="dialogVisible" title="拍照通知" width="30%">
-      <el-table :data="tableData[currentTableIndex - 1]" border>
-        <el-table-column align="center" type="index" />
-        <el-table-column align="center" property="shipName" label="船名" />
-        <el-table-column align="center" property="status" label="状态" />
-      </el-table>
-      <el-pagination
-        style="text-align: right; margin-top: 20px"
-        @current-change="pageChange"
-        background
-        layout="prev, pager, next"
-        :total="total"
-      >
-      </el-pagination>
-      <template #footer>
-        <span class="dialog-footer">
-          <el-button type="primary" @click="dialogVisible = false">
-            确定
-          </el-button>
-        </span>
-      </template>
-    </el-dialog>
-  </div>
-</template>
-<script>
-import store from "../store";
-import router from "../router";
-import api from "../apis/fetch";
-import { onMounted, ref } from "vue";
-import { BellFilled } from "@element-plus/icons";
-import _ from "lodash";
-import { AnonymousLogin, tcb } from "../apis/cloudLogin";
-const db = tcb.database();
-const v = db.collection("huihenduo_versions");
-const __ = db.command;
-
-export default {
-  components: {
-    BellFilled,
-  },
-  setup() {
-    let userName = localStorage.staffName;
-    function quit() {
-      localStorage.removeItem("staffPhone");
-      localStorage.removeItem("id");
-      localStorage.removeItem("status");
-      localStorage.removeItem("userType");
-      localStorage.removeItem("staffName");
-      store.commit("changeLogin", false);
-      router.push({ path: "/login" });
-    }
-    let dialogVisible = ref(false);
-    let isNewMessage = ref([]);
-    function isWithinTime(t0 = new Date()) {
-      let t1 = _.cloneDeep(t0);
-      let t2 = _.cloneDeep(t0);
-      t1.setHours(8);
-      t1.setMinutes(30);
-      t1.setSeconds(0);
-      t2.setHours(9);
-      t2.setMinutes(30);
-      t2.setSeconds(0);
-      let t00 = t0.getTime();
-      let t11 = t1.getTime();
-      let t22 = t2.getTime();
-      return t00 > t11 && t00 < t22;
-    }
-    function spArr(arr, num) {
-      //arr是你要分割的数组,num是以几个为一组
-      let newArr = []; //首先创建一个新的空数组。用来存放分割好的数组
-      for (let i = 0; i < arr.length; ) {
-        //注意:这里与for循环不太一样的是,没有i++
-        newArr.push(arr.slice(i, (i += num)));
-      }
-      return newArr;
-    }
-    let tableData = ref([]);
-    let currentTableIndex = ref(1);
-    let total = ref(0);
-    function pageChange(c) {
-      currentTableIndex.value = c;
-    }
-    async function getUnphotographNotice() {
-      let { data } = await api.getUnphotographNotice();
-      if (data.status == 0) {
-        for (let i of data.result) {
-          isNewMessage.value.push({
-            shipName: i,
-            status: "未拍照",
-          });
-        }
-        total.value = isNewMessage.value.length;
-        tableData.value = spArr(isNewMessage.value, 10);
-      } else {
-        isNewMessage.value = 0;
-      }
-    }
-    onMounted(() => {
-      // getUnphotographNotice();
-      // setInterval(async () => {
-      //   if (isWithinTime()) {
-      //     getUnphotographNotice();
-      //   }
-      // }, 2 * 60 * 1000);
-      cloudLogin();
-    });
-    let timelineData = ref([]);
-    async function cloudLogin() {
-      await AnonymousLogin();
-      getAbledVersions();
-    }
-    async function getAbledVersions() {
-      let res = await v
-        .aggregate()
-        .match({ deleted: __.neq(true) })
-        .sort({
-          createTime: -1,
-        })
-        .limit(10)
-        .end();
-      timelineData.value = res.data;
-    }
-
-    const size = 20;
-    return {
-      size,
-      quit,
-      userName,
-      isNewMessage,
-      tableData,
-      dialogVisible,
-      currentTableIndex,
-      total,
-      pageChange,
-      timelineData,
-    };
-  },
-};
-</script>
-<style scoped>
-.header {
-  width: 100%;
-  height: 60px;
-  background: #212029;
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-}
-
-.left,
-.right {
-  display: flex;
-  align-items: center;
-}
-
-.first {
-  width: 22px;
-  height: 20px;
-  margin: 0 22px;
-}
-
-.shu {
-  width: 1px;
-  height: 60px;
-  background: #101015;
-  margin-right: 22px;
-}
-
-.logo {
-  width: 120px;
-  height: 40px;
-}
-
-.title {
-  font-size: 21px;
-  font-family: PingFangSC-Regular, PingFang SC;
-  font-weight: 400;
-  color: #ffffff;
-  margin-left: 26px;
-}
-
-.user-icon {
-  width: 18px;
-  height: 18px;
-  margin-right: 16px;
-}
-
-.user,
-.quit,
-.log {
-  font-size: 14px;
-  font-family: PingFangSC-Medium, PingFang SC;
-  font-weight: 500;
-  color: #ffffff;
-  cursor: pointer;
-  margin-right: 16px;
-}
-
-.log {
-  margin-right: 4px;
-}
-
-.quit {
-  margin-left: 26px;
-}
-
-.log-card p {
-  font-size: 10px;
-}
-</style>

+ 7 - 10
src/layout/Header.vue

@@ -4,10 +4,7 @@
       <img class="first" src="../assets/three.png" alt="" />
       <div class="shu"></div>
       <img class="logo" src="../assets/white-logo.png" alt="" />
-      <div
-        class="ml20"
-        style="color: #fff; font-size: 18px; height: 60px; padding-top: 50px"
-      >
+      <div class="ml20" style="color: #fff; font-size: 18px">
         version:{{ timelineData[0]?.version }}
       </div>
     </div>
@@ -106,12 +103,12 @@ const v = db.collection("huihenduo_versions");
 const __ = db.command;
 let userName = localStorage.staffName;
 function quit() {
-  localStorage.removeItem("staffPhone");
-  localStorage.removeItem("id");
-  localStorage.removeItem("status");
-  localStorage.removeItem("userType");
-  localStorage.removeItem("staffName");
-  store.commit("changeLogin", true);
+  localStorage.removeItem("loginAccountId");
+  localStorage.removeItem("loginName");
+  localStorage.removeItem("loginPhone");
+  localStorage.removeItem("shippingCompany");
+  localStorage.removeItem("shippingId");
+  store.commit("changeLogin", false);
   router.push({ path: "/login" });
 }
 let dialogVisible = ref(false);

+ 11 - 0
src/layout/Layout.vue

@@ -39,6 +39,17 @@ const route = useRoute();
   position: absolute;
   top: 60px;
   left: 220px;
+
+  height: 52px;
+  line-height: 52px;
+  width: calc(100% - 220px);
+  box-sizing: border-box;
+  background: #fff;
+  font-size: 18px;
+  font-family: PingFangSC-Medium, PingFang SC;
+  font-weight: 500;
+  color: #333d43;
+  padding-left: 20px;
 }
 
 .main-section {

+ 6 - 6
src/main.js

@@ -26,7 +26,7 @@ for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
   app.component(key, component);
 }
 router.beforeEach(async (to, from, next) => {
-  let id = localStorage.id;
+  let id = localStorage.loginAccountId;
   if (id) {
     store.commit("changeLogin", true);
     if (0 === to.matched.length) {
@@ -37,11 +37,11 @@ router.beforeEach(async (to, from, next) => {
       next();
     }
   } else {
-    localStorage.removeItem("staffPhone");
-    localStorage.removeItem("id");
-    localStorage.removeItem("status");
-    localStorage.removeItem("userType");
-    localStorage.removeItem("staffName");
+    localStorage.removeItem("loginAccountId");
+    localStorage.removeItem("loginName");
+    localStorage.removeItem("loginPhone");
+    localStorage.removeItem("shippingCompany");
+    localStorage.removeItem("shippingId");
     store.commit("changeLogin", false);
     if (to.path == "/login") {
       next();

+ 3 - 0
src/router/index.js

@@ -12,6 +12,9 @@ const router = createRouter({
     {
       path: "/index",
       name: "index",
+      meta: {
+        title: "展示",
+      },
       component: () => import("../views/index/Index.vue"),
     },
     {

+ 4 - 0
src/styles/index.css

@@ -3,6 +3,10 @@
 @import "./font-size.css";
 @import "./color.css";
 
+*{
+  box-sizing: border-box;
+}
+
 .tac {
   text-align: center;
 }

+ 60 - 13
src/views/index/Index.vue

@@ -1,17 +1,64 @@
 <template>
-  index
-  <div v-for="i in arr" :key="i">
-    <p>{{ i }}</p>
+  <div class="top-line df aic jcsb p10">
+    <div>
+      <div class="fs20 mb10">汇很多船务公司</div>
+      <div class="df aic">
+        <div class="mr10">{{ today }}</div>
+        <div>天气</div>
+      </div>
+    </div>
+    <div>
+      <div>所有船舶数量:</div>
+      <div>所有船舶吨位:</div>
+    </div>
   </div>
+  <div id="map-container" class="map-container"></div>
 </template>
-<script>
-export default {
-  data() {
-    return {
-      arr: ["a", "b", "c"],
-    };
-  },
-  methods: {},
-  created() {},
-};
+<script setup>
+import moment from "moment";
+import "moment/dist/locale/zh-cn";
+import { onMounted, ref } from "vue";
+
+let today = ref(moment().format("YYYY年MM月DD日 dddd"));
+
+const map = ref({});
+function initMap() {
+  map.value = new AMap.Map("map-container", {
+    zoom: 9, //级别
+    zooms: [4, 9],
+    center: [120.563757, 31.891174], //中心点坐标
+    mapStyle: "amap://styles/f48d96805f5fa7f5aada657c5ee37017",
+    zoomEnable: true,
+    dragEnable: true,
+  });
+  let toolBar = new AMap.ToolBar({
+    position: {
+      top: "40px",
+      right: "40px",
+    },
+  });
+  let hawkEye = new AMap.HawkEye({
+    opened: false,
+  });
+  map.value.addControl(toolBar);
+  map.value.addControl(hawkEye);
+}
+
+onMounted(() => {
+  initMap();
+});
+
+navigator.geolocation.getCurrentPosition(showPosition, showError);
+function showPosition(position) {
+  console.log(position);
+}
+function showError(position) {
+  console.log(position);
+}
 </script>
+<style scoped>
+.map-container {
+  width: 100%;
+  height: calc(100% - 81px);
+}
+</style>

+ 13 - 18
src/views/index/Login.vue

@@ -75,14 +75,11 @@ export default {
 
     const rules = reactive({
       rules: {
-        // phone: [
-        //   { required: true, message: "请输入手机号", trigger: "blur" },
-        //   { min: 11, max: 11, message: "请正确输入手机号", trigger: "blur" },
-        // ],
-        // password: [
-        //   { required: true, message: "请输入密码", trigger: "blur" },
-        //   { min: 6, max: 20, message: "请正确输入手机号", trigger: "blur" },
-        // ],
+        phone: [
+          { required: true, message: "请输入手机号", trigger: "blur" },
+          { min: 11, max: 11, message: "请正确输入手机号", trigger: "blur" },
+        ],
+        password: [{ required: true, message: "请输入密码", trigger: "blur" }],
       },
     });
     function check() {
@@ -95,31 +92,29 @@ export default {
       form.value.validate(async (valid) => {
         if (valid) {
           let { phone, password } = ruleForm.ruleForm;
-          let res = await api.login({
+          let { data } = await api.login({
             phone,
             password,
             // password: md5(password).toUpperCase(),
           });
-          if (res.data.status == 0) {
+          if (data.status == 0) {
             ElNotification.success({
               title: "成功",
               duration: 2000,
-              message: res.data.msg,
+              message: data.msg,
               type: "success",
             });
-            let { id, staffName, staffPhone, status } = res.data.result;
-            localStorage.setItem("id", id);
-            localStorage.setItem("staffName", staffName);
-            localStorage.setItem("staffPhone", staffPhone);
-            localStorage.setItem("status", status);
-            localStorage.setItem("userType", 2);
+            Object.keys(data.result).forEach((key) => {
+              localStorage.setItem(key, data.result[key]);
+            });
+
             store.commit("changeLogin", true);
             router.replace({ path: "/index" });
           } else {
             ElNotification.error({
               title: "错误",
               duration: 3000,
-              message: res.data.msg,
+              message: data.msg,
             });
           }
         } else {

+ 103 - 283
src/views/shipOwnerManage/shipOwnerDetail.vue

@@ -16,7 +16,7 @@
         <div class="info-line-title">船东姓名</div>
         <el-input
           class="info-line-text"
-          v-model="userDetail.userName"
+          v-model="shipOwnerDetail.userName"
           :disabled="unchangeableShipOwner"
         ></el-input>
       </div>
@@ -24,7 +24,7 @@
         <div class="info-line-title">船东手机号</div>
         <el-input
           class="info-line-text"
-          v-model="userDetail.phone"
+          v-model="shipOwnerDetail.userPhone"
           :disabled="unchangeableShipOwner"
         ></el-input>
       </div>
@@ -34,15 +34,7 @@
         <div class="info-line-title">船东身份证</div>
         <el-input
           class="info-line-text"
-          v-model="userDetail.idcardNo"
-          :disabled="unchangeableShipOwner"
-        ></el-input>
-      </div>
-      <div class="info-line">
-        <div class="info-line-title">偏好货种</div>
-        <el-input
-          class="info-line-text"
-          v-model="userDetail.preferenceCargo"
+          v-model="shipOwnerDetail.idcardNo"
           :disabled="unchangeableShipOwner"
         ></el-input>
       </div>
@@ -50,41 +42,19 @@
     <div class="line">
       <div class="info-line aic">
         <div class="info-line-title">上传身份证 :</div>
-        <Uploader
-          :uploaderId="'idFrontFile'"
-          :params="idParams"
-          :disabled="unchangeableShipOwner"
-          @onSendFileList="idFrontUploadSuccess"
-          :fileList="idFrontFile"
-          :limit="1"
-          :uploadText="'身份证人像面'"
-        ></Uploader>
-        <div class="mr20"></div>
-        <Uploader
-          :uploaderId="'idBackFile'"
-          :params="idParams"
-          :disabled="unchangeableShipOwner"
-          @onSendFileList="idBackUploadSuccess"
-          :fileList="idBackFile"
-          :limit="1"
-          :uploadText="'身份证国徽面'"
-        ></Uploader>
+        <el-upload
+          class="upload-demo"
+          drag
+          action="https://run.mocky.io/v3/9d059bf9-4660-45f2-925d-ce80ad6c4d15"
+          multiple
+        >
+          <div class="fs30 c9">+</div>
+          <div class="el-upload__text c9">拖动或点击上传</div>
+        </el-upload>
       </div>
     </div>
-    <div class="df aic jcfe mt50">
-      <el-button v-if="unchangeableShipOwner" type="primary" @click="change(1)">
-        修改
-      </el-button>
-      <el-button v-if="!unchangeableShipOwner" @click="cancelChange(1)">
-        取消
-      </el-button>
-      <el-button
-        v-if="!unchangeableShipOwner"
-        type="primary"
-        @click="submitChange(1)"
-      >
-        提交
-      </el-button>
+    <div class="df aic jcfe">
+      <el-button type="primary" @click="addShipOwner()">确定</el-button>
     </div>
   </div>
   <div class="container-title">船舶信息</div>
@@ -153,7 +123,6 @@
         ></el-input>
       </div>
     </div>
-    <Certs ref="certs"></Certs>
     <div class="df aic jcfe">
       <el-button v-if="unchangeableShip" type="primary" @click="change(0)">
         修改
@@ -171,7 +140,7 @@
     </div>
   </div>
 </template>
-<script>
+<script setup>
 import { ref, h, reactive, toRefs, onMounted } from "vue";
 // import { uploadUrl } from "../../apis/config";
 import { ElNotification, ElMessageBox, ElMessage } from "element-plus";
@@ -181,251 +150,102 @@ import md5 from "md5";
 import api from "../../apis/fetch";
 import { useRoute } from "vue-router";
 import _ from "lodash";
-export default {
-  setup() {
-    const route = useRoute();
-    let userDetail = ref({});
-    let shipDetail = ref({});
-    let idFrontFile = ref([]);
-    let idBackFile = ref([]);
-    let unchangeableShipOwner = ref(true);
-    let unchangeableShip = ref(true);
-    async function getUserDetail() {
-      let res = await api.getShipOwnerDetail({
-        shipOwnerId: route.query.shipOwnerId,
-      });
-      if (res.data.status == 0) {
-        let r = res.data.result;
-
-        let {
-          //船东信息
-          idcardBackDownloadUrl,
-          idcardBackFileKey,
-          idcardBackViewUrl,
-          idcardFrontDownloadUrl,
-          idcardFrontFileKey,
-          idcardFrontViewUrl,
-          idcardNo,
-          phone,
-          preferenceCargo,
-          userId: shipOwnerId,
-          userName,
 
-          // 船舶信息
-          breadth,
-          draught,
-          length,
-          loadTons,
-          mmsi,
-          shipId,
-          shipname,
-          tonnage,
-          shipCerts,
-        } = r;
+const route = useRoute();
+let shipOwnerDetail = ref({});
+let shipDetail = ref({});
+async function getShipOwnerDetail() {
+  let res = await api.getShipOwnerDetail({
+    shipOwnerId: route.query.shipOwnerId,
+  });
+  if (res.data.status == 0) {
+    let r = res.data.result;
 
-        userDetail.value = {
-          idcardNo,
-          phone,
-          preferenceCargo,
-          shipOwnerId,
-          userName,
-        };
-        idFrontFile.value = idcardFrontFileKey
-          ? [
-              {
-                url: idcardFrontViewUrl,
-                idcardFrontDownloadUrl,
-                idcardFrontFileKey,
-                idcardFrontViewUrl,
-              },
-            ]
-          : [];
-        idBackFile.value = idcardBackFileKey
-          ? [
-              {
-                url: idcardBackViewUrl,
-                idcardBackDownloadUrl,
-                idcardBackFileKey,
-                idcardBackViewUrl,
-              },
-            ]
-          : [];
+    let {
+      //船东信息
+      idcardBackDownloadUrl,
+      idcardBackFileKey,
+      idcardBackViewUrl,
+      idcardFrontDownloadUrl,
+      idcardFrontFileKey,
+      idcardFrontViewUrl,
+      idcardNo,
+      phone,
+      preferenceCargo,
+      userId: shipOwnerId,
+      userName,
 
-        shipDetail.value = {
-          breadth,
-          draught,
-          length,
-          loadTons,
-          mmsi,
-          shipId,
-          shipname,
-          tonnage,
-        };
-        certs.value.initCerts(shipCerts);
-      } else {
-        ElNotification({
-          type: "error",
-          title: res.data.msg,
-        });
-        console.log(res);
-      }
-    }
+      // 船舶信息
+      breadth,
+      draught,
+      length,
+      loadTons,
+      mmsi,
+      shipId,
+      shipname,
+      tonnage,
+      shipCerts,
+    } = r;
 
-    let idParams = ref({
-      type: 1,
-      location: "",
-      shipOwnerId: 0,
-    });
+    shipOwnerDetail.value = {
+      idcardNo,
+      phone,
+      preferenceCargo,
+      shipOwnerId,
+      userName,
+    };
+    idFrontFile.value = idcardFrontFileKey
+      ? [
+          {
+            url: idcardFrontViewUrl,
+            idcardFrontDownloadUrl,
+            idcardFrontFileKey,
+            idcardFrontViewUrl,
+          },
+        ]
+      : [];
+    idBackFile.value = idcardBackFileKey
+      ? [
+          {
+            url: idcardBackViewUrl,
+            idcardBackDownloadUrl,
+            idcardBackFileKey,
+            idcardBackViewUrl,
+          },
+        ]
+      : [];
 
-    let shipParams = ref({
-      type: 2,
-      shipOwnerId: 0,
-      location: "",
+    shipDetail.value = {
+      breadth,
+      draught,
+      length,
+      loadTons,
+      mmsi,
+      shipId,
+      shipname,
+      tonnage,
+    };
+    certs.value.initCerts(shipCerts);
+  } else {
+    ElNotification({
+      type: "error",
+      title: res.data.msg,
     });
+    console.log(res);
+  }
+}
 
-    function idFrontUploadSuccess(list) {
-      idFrontFile.value = list;
-    }
-    function idBackUploadSuccess(list) {
-      idBackFile.value = list;
-    }
-
-    let userDetailCache = ref({});
-    let idFrontFileCache = ref([]);
-    let idBackFileCache = ref([]);
-    let shipDetailCache = ref({});
-    function change(type) {
-      if (type) {
-        userDetailCache.value = _.cloneDeep(userDetail.value);
-        idFrontFileCache.value = _.cloneDeep(idFrontFile.value);
-        idBackFileCache.value = _.cloneDeep(idBackFile.value);
-        unchangeableShipOwner.value = false;
-      } else {
-        shipDetailCache.value = _.cloneDeep(shipDetail.value);
-        certs.value.editCerts();
-        unchangeableShip.value = false;
-      }
-    }
-
-    function cancelChange(type) {
-      if (type) {
-        if (!_.isEqual(userDetail.value, userDetailCache.value)) {
-          userDetail.value = _.cloneDeep(userDetailCache.value);
-        }
-        if (!_.isEqual(idFrontFile.value, idFrontFileCache.value)) {
-          idFrontFile.value = [];
-          idFrontFile.value = _.cloneDeep(idFrontFileCache.value);
-        }
-        if (!_.isEqual(idBackFile.value, idBackFileCache.value)) {
-          idBackFile.value = [];
-          idBackFile.value = _.cloneDeep(idBackFileCache.value);
-        }
-        unchangeableShipOwner.value = true;
-      } else {
-        if (!_.isEqual(shipDetail.value, shipDetailCache.value)) {
-          shipDetail.value = _.cloneDeep(shipDetailCache.value);
-        }
-        certs.value.cancelEditCerts();
-        unchangeableShip.value = true;
-      }
-    }
-
-    async function submitChange(type) {
-      if (type) {
-        let postData = {
-          ...userDetail.value,
-          idcardFrontDownloadUrl:
-            idFrontFile.value[0]?.response?.result?.downloadUrl ||
-            idFrontFile.value[0]?.idcardFrontDownloadUrl ||
-            "",
-          idcardFrontFileKey:
-            idFrontFile.value[0]?.response?.result?.key ||
-            idFrontFile.value[0]?.idcardFrontFileKey ||
-            "",
-          idcardFrontViewUrl:
-            idFrontFile.value[0]?.response?.result?.viewUrl ||
-            idFrontFile.value[0]?.idcardFrontViewUrl ||
-            "",
-          idcardBackDownloadUrl:
-            idBackFile.value[0]?.response?.result?.downloadUrl ||
-            idBackFile.value[0]?.idcardBackDownloadUrl ||
-            "",
-          idcardBackFileKey:
-            idBackFile.value[0]?.response?.result?.key ||
-            idBackFile.value[0]?.idcardBackFileKey ||
-            "",
-          idcardBackViewUrl:
-            idBackFile.value[0]?.response?.result?.viewUrl ||
-            idBackFile.value[0]?.idcardBackViewUrl ||
-            "",
-        };
-        let res = await api.updateShipOwner(postData);
-        if (res.data.status == 0) {
-          ElNotification({
-            type: "success",
-            title: res.data.msg,
-          });
-          unchangeableShipOwner.value = true;
-        } else {
-          ElNotification({
-            type: "error",
-            title: res.data.msg,
-          });
-          console.log(res);
-        }
-        getUserDetail();
-      } else {
-        shipDetail.value.shipCerts = certs.value.sendCerts();
-        let postData = {
-          ...shipDetail.value,
-          shipOwnerId: route.query.shipOwnerId,
-        };
-        postData.shipId = postData.shipId || 0;
-        let res = await api.updateShip(postData);
-        console.log(res);
-        if (res.data.status == 0) {
-          ElNotification({
-            type: "success",
-            title: res.data.msg,
-          });
-          unchangeableShip.value = true;
-        } else {
-          ElNotification({
-            type: "error",
-            title: res.data.msg,
-          });
-          console.log(res);
-        }
-        certs.value.disabled = true;
-
-        getUserDetail();
-      }
-    }
-    let certs = ref(null);
+function addShipOwner() {
+  console.log();
+}
 
-    onMounted(() => {
-      getUserDetail();
-    });
-    return {
-      idFrontUploadSuccess,
-      idBackUploadSuccess,
-      getUserDetail,
-      userDetail,
-      shipDetail,
-      unchangeableShipOwner,
-      unchangeableShip,
-      idParams,
-      shipParams,
-      submitChange,
-      change,
-      cancelChange,
-      router,
-      idFrontFile,
-      idBackFile,
-      certs,
-    };
-  },
-};
+onMounted(() => {
+  if (route.query.shipOwnerId) {
+    getShipOwnerDetail();
+    unchangeableShipOwner.value = true;
+    unchangeableShip.value = true;
+  }
+});
 </script>
 <style scoped>
 :deep().el-upload-list__item-thumbnail {

+ 87 - 109
src/views/shipOwnerManage/shipOwnerList.vue

@@ -11,7 +11,10 @@
         ></el-input>
         <div class="seach-btn" @click="getShipOwnerList(1)">查询</div>
       </div>
-      <div class="cargo-owner-add" @click="dialogFormVisible = true">
+      <div
+        class="cargo-owner-add"
+        @click="router.push('/shipOwnerManage/shipOwnerDetail')"
+      >
         添加船东
       </div>
       <el-dialog title="添加船东" v-model="dialogFormVisible">
@@ -107,7 +110,7 @@
     </div>
   </div>
 </template>
-<script>
+<script setup>
 import { ref, h, reactive, toRefs, onMounted } from "vue";
 import { ElNotification, ElMessageBox, ElMessage } from "element-plus";
 import store from "../../store";
@@ -115,119 +118,94 @@ import router from "../../router";
 import md5 from "md5";
 import api from "../../apis/fetch";
 
-export default {
-  setup() {
-    let dialogFormVisible = ref(false);
-    let form = ref(null);
-    let ruleForm = reactive({
-      ruleForm: {
-        userName: "",
-        phone: "",
-        shipname: "",
-        mmsi: "",
-      },
-    });
-    async function resetForm() {
-      dialogFormVisible.value = false;
-      form.value.resetFields();
-    }
-    const rules = reactive({
-      rules: {
-        userName: [
-          { required: true, message: "请填写船东名称", trigger: "blur" },
-        ],
-        shipname: [{ required: true, message: "请填写船名", trigger: "blur" }],
-        mmsi: [{ required: true, message: "请填写MMSI", trigger: "blur" }],
-        phone: [
-          { required: true, message: "请填写手机号", trigger: "blur" },
-          { min: 11, max: 11, message: "请正确填写手机号", trigger: "blur" },
-        ],
-      },
-    });
-    async function addShipOwner() {
-      form.value.validate(async (valid) => {
-        if (valid) {
-          let { userName, shipname, mmsi, phone } = ruleForm.ruleForm;
-          let res = await api.addShipOwner({
-            userName,
-            shipname,
-            mmsi,
-            phone,
-          });
-          console.log(res);
-          if (res.data.status == 0) {
-            ElNotification.success({
-              title: "添加成功",
-              duration: 0,
-              message: `${userName}:${res.data.msg}`,
-              type: "success",
-            });
-            resetForm();
-            getShipOwnerList();
-          } else {
-            ElNotification.error({
-              title: "失败",
-              duration: 3000,
-              message: res.data.msg,
-            });
-          }
-        } else {
-          return false;
-        }
-      });
-    }
-    let currentPage = ref(1);
-    let term = ref("");
-    let tableData = ref([]);
-    let total = ref(0);
-    async function getShipOwnerList(page) {
-      currentPage.value = page || currentPage.value;
-      let res = await api.getShipOwnerList({
-        currentPage: currentPage.value,
-        size: 10,
-        term: term.value,
+let dialogFormVisible = ref(false);
+let form = ref(null);
+let ruleForm = ref({
+  userName: "",
+  phone: "",
+  shipname: "",
+  mmsi: "",
+});
+async function resetForm() {
+  dialogFormVisible.value = false;
+  form.value.resetFields();
+}
+const rules = ref({
+  userName: [{ required: true, message: "请填写船东名称", trigger: "blur" }],
+  shipname: [{ required: true, message: "请填写船名", trigger: "blur" }],
+  mmsi: [{ required: true, message: "请填写MMSI", trigger: "blur" }],
+  phone: [
+    { required: true, message: "请填写手机号", trigger: "blur" },
+    { min: 11, max: 11, message: "请正确填写手机号", trigger: "blur" },
+  ],
+});
+async function addShipOwner() {
+  form.value.validate(async (valid) => {
+    if (valid) {
+      let { userName, shipname, mmsi, phone } = ruleForm.value;
+      let res = await api.addShipOwner({
+        userName,
+        shipname,
+        mmsi,
+        phone,
       });
+      console.log(res);
       if (res.data.status == 0) {
-        tableData.value = res.data.result;
-        total.value = res.data.total;
+        ElNotification.success({
+          title: "添加成功",
+          duration: 0,
+          message: `${userName}:${res.data.msg}`,
+          type: "success",
+        });
+        resetForm();
+        getShipOwnerList();
       } else {
-        tableData.value = [];
-        total.value = 0;
+        ElNotification.error({
+          title: "失败",
+          duration: 3000,
+          message: res.data.msg,
+        });
       }
+    } else {
+      return false;
     }
+  });
+}
+let currentPage = ref(1);
+let term = ref("");
+let tableData = ref([]);
+let total = ref(0);
+async function getShipOwnerList(page) {
+  currentPage.value = page || currentPage.value;
+  let res = await api.getShipOwnerList({
+    currentPage: currentPage.value,
+    size: 10,
+    term: term.value,
+  });
+  if (res.data.status == 0) {
+    tableData.value = res.data.result;
+    total.value = res.data.total;
+  } else {
+    tableData.value = [];
+    total.value = 0;
+  }
+}
 
-    async function shipOwnerDetail(shipOwnerId) {
-      router.push({
-        path: "/shipOwnerManage/shipOwnerDetail",
-        query: {
-          shipOwnerId,
-        },
-      });
-    }
-    function pageChange(e) {
-      currentPage.value = e;
-      getShipOwnerList();
-    }
-    getShipOwnerList();
-    onMounted(() => {});
-    return {
-      currentPage,
-      term,
-      tableData,
-      total,
-      getShipOwnerList,
-      shipOwnerDetail,
-      pageChange,
-      dialogFormVisible,
-      ...toRefs(ruleForm),
-      resetForm,
-      addShipOwner,
-      dialogFormVisible,
-      form,
-      ...toRefs(rules),
-    };
-  },
-};
+async function shipOwnerDetail(shipOwnerId) {
+  router.push({
+    path: "/shipOwnerManage/shipOwnerDetail",
+    query: {
+      shipOwnerId,
+    },
+  });
+}
+function pageChange(e) {
+  currentPage.value = e;
+  getShipOwnerList();
+}
+onMounted(() => {
+  getShipOwnerList();
+});
 </script>
 <style scoped>
 .seach-btn {