| | |
| | | <a-table |
| | | size="small" |
| | | :scroll="{ y: 300 }" |
| | | ref="softwareTable" |
| | | bordered |
| | | :columns="softwareColumns" |
| | | :data-source="softwareList" |
| | |
| | | <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 |
| | |
| | | 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"; |
| | |
| | | mixins: [WSMixin], |
| | | data() { |
| | | return { |
| | | popVisible: false, |
| | | popPosition: { |
| | | x: 0, |
| | | y: 0, |
| | | dir: "bottom", |
| | | }, |
| | | popInfo: [], |
| | | originalZipUrl: "", |
| | | // 当前操作 下载bom包 下载原始包 |
| | | currentAction: "", |
| | |
| | | title: "软件名称", |
| | | dataIndex: "fileName", |
| | | align: "center", |
| | | customCell: this.customCell, |
| | | // width: 180, |
| | | }, |
| | | { |
| | |
| | | dataIndex: "version", |
| | | align: "center", |
| | | width: 180, |
| | | customCell: this.customCell, |
| | | }, |
| | | { |
| | | title: "操作", |
| | |
| | | ImageView, |
| | | FilesTable, |
| | | DiffList, |
| | | Pop, |
| | | }, |
| | | computed: { |
| | | ...mapGetters("setting", ["affixed"]), |
| | |
| | | }, |
| | | }, |
| | | 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; |
| | |
| | | }); |
| | | }, |
| | | 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; |