研发图纸文件管理系统-前端项目
he wei
2022-12-05 b4435de3c39c0c99d7f0d19ff96472101ec8ebbc
U 产品详情页面 下载软件弹窗添加信息面板
2个文件已修改
75 ■■■■■ 已修改文件
src/pages/resourceManage/product/details/details.vue 73 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/resourceManage/software/list.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/resourceManage/product/details/details.vue
@@ -194,6 +194,7 @@
      <a-table
        size="small"
        :scroll="{ y: 300 }"
        ref="softwareTable"
        bordered
        :columns="softwareColumns"
        :data-source="softwareList"
@@ -205,6 +206,13 @@
          <a @click="downloadLog(record)">下载</a>
        </template>
      </a-table>
      <pop
        :visible.sync="popVisible"
        :x="popPosition.x"
        :y="popPosition.y"
        :info="popInfo"
        :position="popPosition.dir"
      ></pop>
    </a-modal>
    <!-- 差异 -->
    <a-modal
@@ -322,6 +330,8 @@
import DiffList from "@/pages/components/diffList";
import checkPermit from "@/assets/js/tools/checkPermit";
import PERMITS from "@/assets/js/const/const_permits";
import Pop from "../../software/pop";
import offset from "@/assets/js/tools/offset";
import List from "./list";
import getWebUrl from "@/assets/js/tools/getWebUrl";
@@ -344,6 +354,13 @@
  mixins: [WSMixin],
  data() {
    return {
      popVisible: false,
      popPosition: {
        x: 0,
        y: 0,
        dir: "bottom",
      },
      popInfo: [],
      originalZipUrl: "",
      // 当前操作 下载bom包 下载原始包
      currentAction: "",
@@ -510,6 +527,7 @@
          title: "软件名称",
          dataIndex: "fileName",
          align: "center",
          customCell: this.customCell,
          // width: 180,
        },
        {
@@ -517,6 +535,7 @@
          dataIndex: "version",
          align: "center",
          width: 180,
          customCell: this.customCell,
        },
        {
          title: "操作",
@@ -562,6 +581,7 @@
    ImageView,
    FilesTable,
    DiffList,
    Pop,
  },
  computed: {
    ...mapGetters("setting", ["affixed"]),
@@ -609,6 +629,59 @@
    },
  },
  methods: {
    customCell(record) {
      return {
        on: {
          mouseenter: (e) => this.cellMouseenter(e, record),
          mouseleave: (e) => this.cellMouseleave(e, record),
        },
      };
    },
    cellMouseenter(e, obj) {
      // console.log("enter", e, obj);
      const wraper = this.$refs.softwareTable.$el;
      // console.log(wraper, '=====wraper');
      const { clientHeight, clientWidth } = document.body;
      const { target, clientX, clientY } = e;
      let { left: x, top: y } = offset(wraper);
      x = clientX - x + 24;
      y = clientY - y + 55 + 24;
      let dir = "bottom";
      if (clientHeight < 380 * 2) {
        if (x + 420 + 18 > clientWidth) {
          dir = "left";
        } else {
          dir = "right";
        }
        if (y < 180) {
          y = 180;
        } else if (y > clientHeight - 378) {
          y = clientHeight / 2;
        }
      } else {
        if (y + 18 + 360 > clientHeight) {
          // y = clientHeight - 378;
          dir = "top";
        } else {
          dir = "bottom";
        }
        if (x < 300) {
          x = 300;
        }
        if (x + 300 > clientWidth) {
          x = clientWidth - 300;
        }
      }
      this.popPosition.x = x;
      this.popPosition.y = y;
      this.popPosition.dir = dir;
      this.popInfo = [obj];
      this.popVisible = true;
    },
    cellMouseleave(e, obj) {
      // console.log("leave", obj);
      this.popVisible = false;
    },
    getVersions(res) {
      if (res) {
        // res = res.data;
src/pages/resourceManage/software/list.vue
@@ -594,7 +594,7 @@
        });
    },
    cellMouseenter(e, obj) {
      // console.log("enter", e, obj);
      console.log("enter", e, obj);
      const wraper = this.$refs.wraper;
      const { clientHeight, clientWidth } = wraper;
      const { target, clientX, clientY } = e;