wzh 3 năm trước cách đây
mục cha
commit
15c57fd6e4

+ 0 - 9
src/router/index.js

@@ -98,15 +98,6 @@ const router = createRouter({
       },
       component: () => import("../views/voyage/voyageList.vue"),
     },
-
-    {
-      path: "/index/mediaCheck",
-      name: "mediaCheck",
-      meta: {
-        title: "鉴图/视频",
-      },
-      component: () => import("../views/index/mediaCheck.vue"),
-    },
     {
       path: "/agencyList",
       name: "agencyList",

+ 0 - 193
src/views/index/Blockchain.vue

@@ -1,193 +0,0 @@
-<template>
-  <div class="full-container-p24">
-    <div style="display: flex; justify-content: space-between">
-      <div style="display: flex">
-        <el-input
-          placeholder="货主名称/船名/MMSI"
-          prefix-icon="el-icon-search"
-          v-model="term"
-          clearable
-          style="height: 32px; width: 330px; line-height: 32px"
-        ></el-input>
-        <div class="seach-btn" @click="getBlockChainList">查询</div>
-      </div>
-    </div>
-    <div style="margin-top: 24px">
-      <el-table :data="tableData" stripe style="width: 100%">
-        <el-table-column
-          type="index"
-          label="序号"
-          min-width="80"
-          align="center"
-        ></el-table-column>
-        <el-table-column
-          prop="voyageName"
-          label="航次名称"
-          min-width="160"
-          align="center"
-        ></el-table-column>
-        <el-table-column
-          prop="shipName"
-          label="船名"
-          min-width="160"
-          align="center"
-        ></el-table-column>
-        <el-table-column
-          prop="shipMmsi"
-          label="MMSI"
-          min-width="120"
-          align="center"
-        ></el-table-column>
-        <el-table-column
-          prop="loadPort"
-          label="装货港"
-          min-width="160"
-          align="center"
-        ></el-table-column>
-        <el-table-column
-          prop="dischargeProt"
-          label="卸货港"
-          min-width="120"
-          align="center"
-        ></el-table-column>
-        <el-table-column
-          prop="loadTons"
-          label="载货吨位(吨)"
-          min-width="160"
-          align="center"
-        ></el-table-column>
-        <el-table-column
-          prop="onChainTime"
-          label="上链时间"
-          min-width="200"
-          align="center"
-        ></el-table-column>
-        <el-table-column label="操作" min-width="80" align="center">
-          <template v-slot="scope">
-            <span v-if="scope.row.hash">已上链</span>
-            <el-button
-              v-else
-              @click="upBlockChain(scope.row.voyageId, scope.$index)"
-              type="primary"
-              size="small"
-              :loading="upLoading && currentIndex == scope.$index"
-            >
-              上链
-            </el-button>
-          </template>
-        </el-table-column>
-      </el-table>
-      <div style="width: 100%; text-align: right; margin-top: 43px">
-        <el-pagination
-          background
-          layout="prev, pager, next"
-          :total="total"
-          @current-change="pageChange"
-        ></el-pagination>
-      </div>
-    </div>
-  </div>
-</template>
-<script setup>
-import { ref, h, reactive, toRefs, onMounted } from "vue";
-import { ElNotification, ElMessageBox, ElMessage } from "element-plus";
-import store from "../../store";
-import router from "../../router";
-import md5 from "md5";
-import api from "../../apis/fetch";
-
-let currentPage = ref(1);
-let term = ref("");
-let tableData = ref();
-let total = ref();
-async function getBlockChainList() {
-  tableData.value = [];
-  let res = await api.getBlockChainList({
-    currentPage: currentPage.value,
-    size: 10,
-    term: term.value,
-  });
-  if (res.data.status == 0) {
-    tableData.value = res.data.result;
-    total.value = res.data.total;
-  }
-}
-
-let upLoading = ref(false);
-let currentIndex = ref(-1);
-
-async function upBlockChain(voyageId, index) {
-  upLoading.value = true;
-  currentIndex.value = index;
-  let res = await api.upBlockChain({
-    voyageId,
-  });
-  if (res.data.status == 0) {
-    ElNotification.success({
-      title: "成功",
-      duration: 2000,
-      message: res.data.msg,
-    });
-    getBlockChainList();
-  } else {
-    ElNotification.error({
-      title: "失败",
-      duration: 2000,
-      message: res.data.msg,
-    });
-  }
-  upLoading.value = false;
-  currentIndex.value = -1;
-}
-function pageChange(e) {
-  currentPage.value = e;
-  getBlockChainList();
-}
-onMounted(() => {
-  getBlockChainList();
-});
-</script>
-<style scoped>
-.seach-btn {
-  display: inline-block;
-  width: 60px;
-  height: 38px;
-  background: #0094fe;
-  border-radius: 2px;
-  font-size: 14px;
-  font-family: PingFangSC-Regular, PingFang SC;
-  font-weight: 400;
-  color: #ffffff;
-  text-align: center;
-  line-height: 38px;
-  margin-left: 10px;
-  cursor: pointer;
-}
-
-.cargo-owner-add {
-  width: 80px;
-  height: 32px;
-  border-radius: 2px;
-  border: 1px solid #0094fe;
-  font-size: 14px;
-  font-family: PingFangSC-Regular, PingFang SC;
-  font-weight: 400;
-  color: #0094fe;
-  line-height: 32px;
-  text-align: center;
-  cursor: pointer;
-}
-
-:deep().el-dialog {
-  width: 560px;
-  padding: 20px 50px;
-  border-radius: 6px;
-}
-
-:deep() .el-dialog__title {
-  font-size: 18px;
-  font-family: PingFangSC-Regular, PingFang SC;
-  font-weight: 400;
-  color: #0094fe;
-}
-</style>

+ 0 - 343
src/views/index/Versions.vue

@@ -1,343 +0,0 @@
-<template>
-  <div class="mt10 df aic jcsb">
-    <div>
-      <el-button type="primary" class="mb20 mr30" @click="isModalVisable = true"
-        >添加版本记录</el-button
-      >
-      <el-popover placement="bottom" trigger="hover" :width="240">
-        <div style="width: 100%; height: 80vh; overflow-y: scroll">
-          <el-timeline>
-            <el-timeline-item
-              v-for="item in store.state.versions"
-              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-button> 新功能日志</el-button>
-          </el-badge>
-        </template>
-      </el-popover>
-    </div>
-    <div>
-      <!-- <el-button @click="">返回版本记录列表</el-button>
-      <el-button class="mr20 ml20" type="warning" @click="trash"
-        >回收站</el-button
-      > -->
-    </div>
-
-    <el-dialog
-      title="版本管理"
-      width="500px"
-      v-model="isModalVisable"
-      @closed="cancel"
-    >
-      <el-form
-        ref="ruleFormRef"
-        :model="ruleForm"
-        :rules="rules"
-        class="demo-ruleForm"
-        label-width="100px"
-        label-position="left"
-      >
-        <el-form-item label="版本号" prop="version">
-          <el-input style="width: 240px" v-model="ruleForm.version"></el-input>
-        </el-form-item>
-        <el-form-item label="发布时间" prop="timer">
-          <el-date-picker
-            style="width: 240px"
-            v-model="ruleForm.timer"
-            type="date"
-            placeholder="请选择日期"
-            format="YYYY/MM/DD"
-            value-format="YYYY/MM/DD"
-          >
-          </el-date-picker>
-        </el-form-item>
-        <hr class="mb20" />
-        <el-form-item
-          v-for="(item, index) in ruleForm.remarks"
-          :label="'发布内容 ' + parseInt(index + 1) + ' :'"
-          prop="remarks"
-        >
-          <div class="df aic jcsb">
-            <el-input
-              type="textarea"
-              style="width: 240px"
-              v-model="item.text"
-              autosize
-            ></el-input>
-            <el-button size="small" @click="deleteRemark(index)" type="danger"
-              >删除</el-button
-            >
-          </div>
-        </el-form-item>
-        <div class="df aic jcfe">
-          <el-button
-            size="small"
-            type="primary"
-            @click="ruleForm.remarks.push({})"
-            >添加一条记录</el-button
-          >
-        </div>
-        <hr class="mt20 mb20" />
-        <div class="df aic jcfe">
-          <el-button @click="cancel(ruleFormRef)">取消</el-button>
-          <el-button type="primary" @click="add(ruleFormRef)">提交</el-button>
-        </div>
-      </el-form>
-    </el-dialog>
-  </div>
-  <el-table :data="versions">
-    <el-table-column
-      type="index"
-      label="序号"
-      min-width="120"
-      align="center"
-    ></el-table-column>
-    <el-table-column
-      prop="version"
-      label="版本号"
-      min-width="100"
-      align="center"
-    ></el-table-column>
-    <el-table-column
-      prop="timer"
-      label="发布时间"
-      min-width="100"
-      align="center"
-    ></el-table-column>
-    <el-table-column label="版本内容" min-width="150" align="center">
-      <template v-slot="scope">
-        <div
-          style="width: 100%; text-align: left"
-          v-for="(item, index) in scope.row.remarks"
-        >
-          {{ index + 1 + ". " + item.text }}
-        </div>
-      </template>
-    </el-table-column>
-    <el-table-column label="状态" min-width="150" align="center">
-      <template v-slot="scope">
-        <el-switch
-          v-model="scope.row.disabled"
-          active-color="#13ce66"
-          :active-value="false"
-          :inactive-value="true"
-          inactive-color="#ff4949"
-          @change="changeSwitch($event, scope.row._id)"
-        />
-      </template>
-    </el-table-column>
-    <el-table-column label="操作" min-width="150" align="center">
-      <template v-slot="scope">
-        <el-button
-          @click="detail(scope.row, scope.$index)"
-          type="primary"
-          size="small"
-        >
-          修改
-        </el-button>
-        <el-button
-          @click="deleteItem(scope.row._id, scope.$index)"
-          type="danger"
-          size="small"
-        >
-          删除
-        </el-button>
-      </template>
-    </el-table-column>
-  </el-table>
-  <div style="width: 100%; text-align: right; padding: 43px 0">
-    <el-pagination
-      background
-      layout="prev, pager, next"
-      :total="total"
-      :page-size="pageSize"
-      @current-change="pageChange"
-    ></el-pagination>
-  </div>
-</template>
-
-<script setup>
-import { reactive, ref, onMounted } from "vue";
-import { AnonymousLogin, tcb } from "apis/cloudLogin";
-import _ from "lodash";
-import { ElMessage, ElMessageBox } from "element-plus";
-import store from "../../store";
-const db = tcb.database();
-const v = db.collection("huihenduo_versions");
-const __ = db.command;
-
-let versions = ref([]);
-let isModalVisable = ref(false);
-let ruleFormRef = ref(null);
-let currentPage = ref(1);
-let pageSize = ref(10);
-let currentVersionId = ref(null);
-let total = ref(0);
-
-function detail(item1) {
-  let item = _.cloneDeep(item1);
-  let { _id, version, timer, remarks } = item;
-  currentVersionId.value = _id;
-  ruleForm.value = { version, timer, remarks };
-
-  isModalVisable.value = true;
-}
-
-async function deleteItem(_id) {
-  ElMessageBox.confirm("确认删除版本日志?", "Warning", {
-    confirmButtonText: "删除",
-    cancelButtonText: "取消",
-    type: "warning",
-  })
-    .then(async () => {
-      let res = await v.doc(_id).update({
-        deleted: true,
-      });
-      getAllVersions();
-    })
-    .catch(() => {
-      ElMessage({
-        type: "info",
-        message: "取消删除",
-      });
-    });
-}
-
-async function changeSwitch(disabled, id) {
-  let res = await v.doc(id).update({
-    disabled,
-  });
-  getAllVersions();
-}
-
-function deleteRemark(index) {
-  ruleForm.value.remarks.splice(index, 1);
-}
-
-async function add() {
-  ruleFormRef.value.validate(async (valid) => {
-    if (valid) {
-      let res;
-      for (let i in ruleForm.value.remarks) {
-        if (!ruleForm.value.remarks[i].text) {
-          ruleForm.value.remarks.splice(i, 1);
-        }
-      }
-      if (currentVersionId.value) {
-        res = await v.doc(currentVersionId.value).update({
-          ...ruleForm.value,
-          updateTime: db.serverDate(),
-        });
-      } else {
-        res = await v.add({
-          ...ruleForm.value,
-          disabled: false,
-          createTime: db.serverDate(),
-        });
-      }
-
-      getAllVersions();
-      cancel();
-    } else {
-      console.log("未提交", ruleForm.value);
-    }
-  });
-}
-
-async function getAllVersions(listType) {
-  let res1 = await v.where({ deleted: __.neq(true) }).count();
-  total.value = res1.total;
-  let res = await v
-    .aggregate()
-    .match({ deleted: __.neq(true) })
-    .sort({
-      createTime: -1,
-    })
-    .skip((currentPage.value - 1) * pageSize.value)
-    .limit(pageSize.value)
-    .end();
-  versions.value = res.data;
-  getAbledVersions();
-}
-
-let abledVersions = ref([]);
-async function getAbledVersions() {
-  let res = await v
-    .aggregate()
-    .match({ deleted: __.neq(true) })
-    .sort({
-      createTime: -1,
-    })
-    .limit(10)
-    .end();
-  abledVersions.value = res.data;
-  store.commit("setVersions", abledVersions.value);
-}
-
-function cancel() {
-  isModalVisable.value = false;
-  ruleForm.value = {
-    version: "",
-    timer: "",
-    remarks: [{}, {}, {}],
-  };
-  currentVersionId.value = null;
-}
-
-let ruleForm = ref({
-  version: "",
-  timer: "",
-  remarks: [{}, {}, {}],
-});
-
-const rules = reactive({
-  version: [
-    {
-      required: true,
-      message: "请填写版本号",
-      trigger: "blur",
-    },
-  ],
-  timer: [
-    {
-      required: true,
-      message: "请填写发布时间",
-      trigger: "blur",
-    },
-  ],
-});
-async function init() {
-  await AnonymousLogin();
-  getAllVersions();
-}
-
-function pageChange(e) {
-  currentPage.value = e;
-  getAllVersions();
-}
-
-onMounted(() => {
-  init();
-});
-</script>
-
-<style scoped>
-</style>

+ 0 - 307
src/views/index/mediaCheck.vue

@@ -1,307 +0,0 @@
-<template>
-  <div class="df aic">
-    <div
-      @click="changeMediaStatus(0)"
-      :class="
-        audit == 0
-          ? 'currentbtn radio-btns left-radius'
-          : 'radio-btns left-radius'
-      "
-    >
-      待审核
-    </div>
-    <div
-      @click="changeMediaStatus(1)"
-      :class="audit == 1 ? ' radio-btns currentbtn' : 'radio-btns '"
-      style="border-right: none; border-left: none"
-    >
-      审核通过
-    </div>
-    <div
-      @click="changeMediaStatus(2)"
-      :class="
-        audit == 2
-          ? ' radio-btns right-radius currentbtn'
-          : 'radio-btns right-radius '
-      "
-      style="margin-right: 40px"
-    >
-      审核未通过
-    </div>
-  </div>
-  <div class="container-title">图片/视频</div>
-  <div class="line-container-p24 df aic ffw">
-    <el-card
-      style="
-        width: 240px;
-        height: 360px;
-        margin-left: 20px;
-        margin-bottom: 15px;
-      "
-      v-for="(item, index) in media"
-      :key="item"
-      shadow="hover"
-    >
-      <div class="card-note">
-        {{ item.shipName }} 拍摄于
-        <br />
-        {{ item.createTime }}
-      </div>
-      <div class="media-box" style="position: relative">
-        <el-image
-          v-if="item.mediaType == 1"
-          style="width: 100%; height: 100%"
-          fit="contain"
-          :src="item.downloadUrl"
-          :preview-src-list="previewSrcList"
-        ></el-image>
-        <video
-          style="width: 100%; height: 100%"
-          v-else
-          :src="item.downloadUrl"
-        ></video>
-        <img
-          @click="openVideoModal(item.downloadUrl, index, item.id, item.audit)"
-          v-if="item.mediaType == 2"
-          src="../../assets/icon-player.png"
-          style="
-            object-fit: contain;
-            width: 40px;
-            height: 40px;
-            position: absolute;
-            top: calc(50% - 20px);
-            left: calc(50% - 20px);
-            background: #fff;
-            border-radius: 50%;
-          "
-          alt=""
-        />
-      </div>
-      <div class="checkbox-group df aic jcsa">
-        <el-checkbox
-          @change="auditMedia(item.id, 1, index, item.mediaType)"
-          :model-value="item.audit == 1"
-          label="通过"
-        ></el-checkbox>
-        <el-checkbox
-          @change="auditMedia(item.id, 2, index, item.mediaType)"
-          :model-value="item.audit == 2"
-          label="未通过"
-        ></el-checkbox>
-      </div>
-    </el-card>
-    <div style="width: 100%; text-align: right; margin-top: 43px">
-      <el-pagination
-        background
-        layout="prev, pager, next"
-        :total="total"
-        @current-change="pageChange"
-      />
-    </div>
-  </div>
-
-  <el-dialog
-    v-model="videoModal"
-    title="视频审核"
-    width="30%"
-    :before-close="videoClose"
-  >
-    <video
-      autoplay
-      controls
-      style="width: 100%; height: 100%"
-      :src="currentUrl"
-    ></video>
-    <template #footer>
-      <span class="dialog-footer">
-        <el-button type="primary" @click="dialogAuditVideo(1)">通过</el-button>
-        <el-button type="warning" @click="dialogAuditVideo(2)">
-          未通过
-        </el-button>
-      </span>
-    </template>
-  </el-dialog>
-</template>
-<script>
-import { ref, toRefs, reactive } from "vue";
-import { ElNotification } from "element-plus";
-import api from "../../apis/fetch";
-export default {
-  setup() {
-    let checkedBox = ref();
-    let audit = ref(0);
-    let currentPage = ref(1);
-    let media = ref([]);
-    let photos = ref([]);
-    let videoes = ref([]);
-    let previewSrcList = ref([]);
-    let total = ref();
-
-    async function getMediaList() {
-      let res = await api.getMediaList({
-        audit: audit.value,
-        currentPage: currentPage.value,
-        size: 10,
-      });
-      if (res.data.status == 0) {
-        total.value = res.data.total;
-        media.value = res.data.result;
-        for (let i of media.value) {
-          if (i.mediaType == 1) {
-            previewSrcList.value.push(i.downloadUrl);
-          }
-        }
-      } else {
-        console.log(res);
-      }
-    }
-
-    function pageChange(e) {
-      currentPage.value = e;
-      getMediaList();
-    }
-
-    function changeMediaStatus(s) {
-      currentPage.value = 1;
-      photos.value = [];
-      videoes.value = [];
-      audit.value = s;
-      getMediaList();
-    }
-
-    async function auditMedia(mediaId, a, index, mediaType) {
-      if (a == audit.value) return;
-      let res = await api.auditMedia({
-        mediaId,
-        audit: a,
-      });
-      if (res.data.status == 0) {
-        videoModal.value = false;
-        ElNotification({
-          title: res.data.msg,
-          message: `${a == 1 ? "通过" : "未通过"}`,
-          type: `${a == 1 ? "success" : "info"}`,
-        });
-        media.value.splice(index, 1);
-        if (mediaType == 1) {
-          previewSrcList.value.splice(index, 1);
-        }
-      } else {
-        ElNotification({
-          title: "Error!",
-          message: res.data.msg,
-          type: "error",
-        });
-      }
-      console.log(res);
-    }
-    let videoModal = ref(false);
-    let currentIndex = ref();
-    let currentId = ref();
-    let currentAudit = ref();
-    let currentUrl = ref();
-    function openVideoModal(url, i, id, a) {
-      currentIndex.value = i;
-      currentId.value = id;
-      currentAudit.value = a;
-      currentUrl.value = url;
-      videoModal.value = true;
-    }
-
-    function dialogAuditVideo(a) {
-      console.log(a);
-      console.log(currentAudit.value);
-      if (a == currentAudit.value) {
-        videoModal.value = false;
-      } else {
-        auditMedia(currentId.value, a, currentIndex.value, 2);
-      }
-    }
-
-    function videoClose() {}
-    getMediaList();
-
-    return {
-      audit,
-      getMediaList,
-      changeMediaStatus,
-      photos,
-      videoes,
-      checkedBox,
-      previewSrcList,
-      auditMedia,
-      media,
-      videoModal,
-      openVideoModal,
-      dialogAuditVideo,
-      currentUrl,
-      total,
-      pageChange,
-    };
-  },
-};
-</script>
-<style scoped>
-.radio-btns {
-  height: 38px;
-  width: 103px;
-  border: 1px solid #1486f9;
-  line-height: 38px;
-  text-align: center;
-  font-size: 14px;
-  font-family: PingFangSC-Regular, PingFang SC;
-  font-weight: 400;
-  color: #0094fe;
-  cursor: pointer;
-}
-
-.left-radius {
-  border-top-left-radius: 19px;
-  border-bottom-left-radius: 19px;
-}
-
-.right-radius {
-  border-top-right-radius: 19px;
-  border-bottom-right-radius: 19px;
-}
-.currentbtn {
-  background: #1486f9;
-  color: #fff;
-}
-
-.seach-btn {
-  display: inline-block;
-  width: 60px;
-  height: 38px;
-  background: #0094fe;
-  border-radius: 2px;
-  font-size: 14px;
-  font-family: PingFangSC-Regular, PingFang SC;
-  font-weight: 400;
-  color: #ffffff;
-  text-align: center;
-  line-height: 38px;
-  margin-left: 10px;
-  cursor: pointer;
-}
-
-.card-note {
-  height: 30px;
-  font-size: 12px;
-  font-family: PingFangSC-Regular, PingFang SC;
-  font-weight: 400;
-  color: #777777;
-}
-
-.media-box {
-  width: 200px;
-  height: 200px;
-  margin-top: 20px;
-}
-
-.checkbox-group {
-  width: 200px;
-  height: 50px;
-  margin-top: 20px;
-}
-</style>