New file |
| | |
| | | export default { |
| | | downloadSoftware: 10001, |
| | | downloadDoc: 10002, |
| | | downloadBom: 10003, |
| | | downloadOther: 10004, |
| | | |
| | | uploadBom: 10009, |
| | | uploadSoftware: 10008 |
| | | } |
New file |
| | |
| | | function checkPermit(permitId, permitList) { |
| | | return permitList.some((v) => v == permitId); |
| | | } |
| | | |
| | | export default checkPermit; |
| | |
| | | <template slot="action" slot-scope="text, record"> |
| | | <div v-if="record.url"> |
| | | <a @click="view(record)">预览</a> |
| | | <a-divider type="vertical"></a-divider> |
| | | <a @click="downloadLog(record)">下载</a> |
| | | <template v-if="canDownloadOther"> |
| | | <a-divider type="vertical"></a-divider> |
| | | <a @click="downloadLog(record)">下载</a> |
| | | </template> |
| | | </div> |
| | | </template> |
| | | </a-table> |
| | |
| | | import getWebUrl from "@/assets/js/tools/getWebUrl"; |
| | | import { dwgReview } from "@/pages/workplace/apis"; |
| | | import { downloadLog } from "@/pages/system/logs/apis"; |
| | | import checkPermit from "@/assets/js/tools/checkPermit"; |
| | | import PERMITS from "@/assets/js/const/const_permits"; |
| | | import { mapGetters } from "vuex"; |
| | | export default { |
| | | name: "", |
| | | props: { |
| | |
| | | this.dwgReview(obj.url); |
| | | break; |
| | | default: |
| | | this.$message.warn('该类型文件暂不支持预览'); |
| | | this.$message.warn("该类型文件暂不支持预览"); |
| | | break; |
| | | } |
| | | }, |
| | |
| | | }; |
| | | }); |
| | | }, |
| | | ...mapGetters("account", ["permits"]), |
| | | canDownloadOther() { |
| | | return checkPermit(PERMITS.canDownloadOther, this.permits); |
| | | }, |
| | | }, |
| | | mounted() {}, |
| | | }; |
| | |
| | | <span class="title">物料中心</span> |
| | | <a-space class="operator" style="margin-left: 1em"> |
| | | <a-upload |
| | | v-if="canUpload" |
| | | :before-upload="beforeUpload" |
| | | :showUploadList="false" |
| | | @change="uploadChange" |
| | |
| | | <a-space> |
| | | <a-button @click="fileListCancel">关闭</a-button> |
| | | <a-upload |
| | | v-if="canUpload" |
| | | :before-upload="beforeUpload" |
| | | @change="fileUploadChange" |
| | | :showUploadList="false" |
| | |
| | | import { dwgReview } from "@/pages/workplace/apis"; |
| | | import { downloadLog } from "@/pages/system/logs/apis"; |
| | | import { mapGetters } from "vuex"; |
| | | import checkPermit from '@/assets/js/tools/checkPermit'; |
| | | import PERMITS from '@/assets/js/const/const_permits'; |
| | | |
| | | import createWs from "@/assets/js/websocket"; |
| | | const WSMixin = createWs("material"); |
| | |
| | | return this.isAdd ? "批量增加关联关系" : "批量解除关联关系"; |
| | | }, |
| | | ...mapGetters("setting", ["affixed"]), |
| | | ...mapGetters('account', ['permits']), |
| | | canUpload() { |
| | | return checkPermit(PERMITS.uploadBom, this.permits); |
| | | }, |
| | | }, |
| | | components: { |
| | | AdvanceTable, |
| | |
| | | <files-table slot="content" :list="otherDoc"></files-table> |
| | | <a-button type="primary">其他附件</a-button> |
| | | </a-popover> |
| | | <a-button type="primary" @click="zipDownload">bom下载</a-button> |
| | | <a-button v-if="canUploadBom" type="primary" @click="zipDownload">bom下载</a-button> |
| | | <a-button |
| | | type="primary" |
| | | v-if="softwareList.length" |
| | | v-if="softwareList.length && canUploadSoftware" |
| | | @click="showSoftwareDownload" |
| | | >软件下载</a-button |
| | | > |
| | |
| | | import ImageView from "@/pages/components/ImageView"; |
| | | import FilesTable from "@/pages/components/filesTable"; |
| | | import DiffList from "@/pages/components/diffList"; |
| | | import checkPermit from "@/assets/js/tools/checkPermit"; |
| | | import PERMITS from "@/assets/js/const/const_permits"; |
| | | |
| | | import List from "./list"; |
| | | import getWebUrl from "@/assets/js/tools/getWebUrl"; |
| | |
| | | }, |
| | | computed: { |
| | | ...mapGetters("setting", ["affixed"]), |
| | | ...mapGetters("account", ["permits"]), |
| | | canUploadSoftware() { |
| | | return checkPermit(PERMITS.uploadSoftware, this.permits); |
| | | }, |
| | | canDownloadBom() { |
| | | return checkPermit(PERMITS.downloadBom, this.permits); |
| | | }, |
| | | }, |
| | | watch: { |
| | | update(n) { |
| | |
| | | const { |
| | | currentVersion: { id, version }, |
| | | info, |
| | | lastId |
| | | lastId, |
| | | } = this; |
| | | if (id == lastId) { |
| | | return false; |
| | |
| | | <template slot="title"> |
| | | <a-space class="operator"> |
| | | <span class="title">产品中心</span> |
| | | <a-button type="primary" @click="uploadBom">新增</a-button> |
| | | <a-button v-if="canUploadBom" type="primary" @click="uploadBom">新增</a-button> |
| | | </a-space> |
| | | </template> |
| | | <template slot="isNormal" slot-scope="{ record }"> |
| | | {{ record.customCode == "" ? "是" : "否" }} |
| | | </template> |
| | | <template slot="action" slot-scope="{ record }"> |
| | | <a @click="upload(record)">上传软件</a> |
| | | <a-divider type="vertical"></a-divider> |
| | | <template v-if="canUploadSoftware"> |
| | | <a @click="upload(record)">上传软件</a> |
| | | <a-divider type="vertical"></a-divider> |
| | | </template> |
| | | <a @click="goDetails(record)">详情</a> |
| | | <a-divider type="vertical"></a-divider> |
| | | <a-popover title="" trigger="hover"> |
| | | <a-space direction="vertical" slot="content"> |
| | | <a-button type="primary" @click="edit(record)">编辑</a-button> |
| | | <a-button type="primary" @click="download(record)" |
| | | <a-button v-if="canDownloadBom" type="primary" @click="download(record)" |
| | | >下载</a-button |
| | | > |
| | | <a-button type="primary" @click="showCustom(record)" |
| | | <a-button type="primary" v-if="canUploadBom" @click="showCustom(record)" |
| | | >定制</a-button |
| | | > |
| | | </a-space> |
| | |
| | | import { productSoftwareSubmit } from "../software/apis"; |
| | | import { zipParse } from "@/pages/workplace/myDraw/apis"; |
| | | import { mapGetters } from "vuex"; |
| | | import checkPermit from "@/assets/js/tools/checkPermit"; |
| | | import PERMITS from "@/assets/js/const/const_permits"; |
| | | |
| | | import createWs from "@/assets/js/websocket"; |
| | | import DiffList from "@/pages/components/diffList"; |
| | |
| | | bomList: bomList.map((v) => ({ ...v, id: undefined })), |
| | | fileUrl: this.fileUrl, |
| | | customCode: data.customCode, |
| | | id: this.fromProd, |
| | | parentCode, |
| | | parentModel, |
| | | parentName, |
| | | }; |
| | | addProduct(param).then((res) => { |
| | | const { code, data, msg } = res.data; |
| | | if (code && data) { |
| | | const { code, msg } = res.data; |
| | | if (code) { |
| | | this.$message.success(msg); |
| | | this.prodUploadShow = false; |
| | | } else { |
| | |
| | | this.resList = data2; |
| | | this.diffData = { |
| | | addList: data3.addList, |
| | | delList: data3.deleteList, |
| | | updateList: data3.diffList |
| | | delList: data3.deleteList.map((v) => v.materialObj), |
| | | updateList: data3.diffList, |
| | | }; |
| | | this.fileUrl = msg; |
| | | this.prodUploadShow = true; |
| | |
| | | "roles", |
| | | "projectManagerList", |
| | | "generalManagerList", |
| | | 'permits' |
| | | ]), |
| | | ...mapGetters("setting", ["affixed"]), |
| | | canUploadBom() { |
| | | return checkPermit(PERMITS.uploadBom, this.permits); |
| | | }, |
| | | canUploadSoftware() { |
| | | return checkPermit(PERMITS.uploadSoftware, this.permits); |
| | | }, |
| | | canDownloadBom() { |
| | | return checkPermit(PERMITS.downloadBom, this.permits); |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.getUserByRoleId(); |
| | |
| | | :data-source="dataSource" |
| | | :columns="columns" |
| | | title="" |
| | | row-key="parentModel" |
| | | :row-key="(record, index) => index" |
| | | @search="onSearch" |
| | | @refresh="onRefresh" |
| | | @reset="onReset" |
| | | :format-conditions="true" |
| | | :scroll="{ x: 400, y }" |
| | | :scroll="{ y }" |
| | | :pagination="{ |
| | | current: pageCurr, |
| | | pageSize: pageSize, |
| | |
| | | <span class="title">软件中心</span> |
| | | </template> |
| | | <template slot="action" slot-scope="{ record }"> |
| | | <template > |
| | | <template v-if="canDownloadSoftware"> |
| | | <a @click="download(record)">下载</a> |
| | | </template> |
| | | </template> |
| | |
| | | |
| | | <script> |
| | | import AdvanceTable from "@/components/table/advance/AdvanceTable"; |
| | | import checkPermit from "@/assets/js/tools/checkPermit"; |
| | | import PERMITS from "@/assets/js/const/const_permits"; |
| | | |
| | | import { getList, downLoadSoftware } from "./apis"; |
| | | import { mapGetters } from "vuex"; |
| | |
| | | key: "softwareName", |
| | | align: "center", |
| | | noSearch: true, |
| | | width: 160, |
| | | }, |
| | | { |
| | | title: "操作", |
| | |
| | | }; |
| | | getList(pageCurr, pageSize, params).then((res) => { |
| | | res = res.data; |
| | | console.log(res); |
| | | // console.log(res); |
| | | let data = []; |
| | | let total = 0; |
| | | if (res.code && res.data) { |
| | |
| | | download(obj) { |
| | | const { parentModel, softwareName } = obj; |
| | | downLoadSoftware(softwareName).then((res) => { |
| | | console.log(res, "==========="); |
| | | // console.log(res, "==========="); |
| | | let { headers, data, status } = res; |
| | | if (200 == status && data) { |
| | | let url = window.URL.createObjectURL(data); |
| | |
| | | this.update = Math.random(); |
| | | }, 200); |
| | | }, |
| | | activeFN() { |
| | | this.resize(); |
| | | }, |
| | | }, |
| | | watch: { |
| | | update(n) { |
| | | if (-1 != n) { |
| | | // this.$nextTick(() => { |
| | | // const table = this.$refs.table; |
| | | // const header = document.querySelectorAll( |
| | | // ".doc-center-table .ant-table-header" |
| | | // )[0].clientHeight; |
| | | // const bar = document.querySelectorAll(".header-bar")[0].clientHeight; |
| | | // if (table.fullScreen) { |
| | | // this.y = table.$el.clientHeight - bar - header - 64; |
| | | // } else { |
| | | // const wraper = this.$refs.wraper.clientHeight; |
| | | // const card = document.querySelectorAll(".ant-card-body")[0]; |
| | | // const { paddingBottom, paddingTop } = getComputedStyle(card, null); |
| | | // const h = |
| | | // wraper - |
| | | // header - |
| | | // 64 - |
| | | // bar - |
| | | // parseInt(paddingBottom) - |
| | | // parseInt(paddingTop); |
| | | // // console.log(h, "h",wraper, header, bar ); |
| | | // this.y = h; |
| | | // } |
| | | // }); |
| | | this.$nextTick(() => { |
| | | const table = this.$refs.table; |
| | | const header = document.querySelectorAll( |
| | | ".doc-center-table .ant-table-header" |
| | | )[0].clientHeight; |
| | | const bar = document.querySelectorAll(".header-bar")[0].clientHeight; |
| | | if (table.fullScreen) { |
| | | this.y = table.$el.clientHeight - bar - header - 64; |
| | | } else { |
| | | const wraper = this.$refs.wraper.clientHeight; |
| | | const card = document.querySelectorAll(".ant-card-body")[0]; |
| | | const { paddingBottom, paddingTop } = getComputedStyle(card, null); |
| | | const h = |
| | | wraper - |
| | | header - |
| | | 64 - |
| | | bar - |
| | | parseInt(paddingBottom) - |
| | | parseInt(paddingTop); |
| | | // console.log(h, "h",wraper, header, bar ); |
| | | this.y = h; |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | affixed() { |
| | | setTimeout(() => { |
| | | this.update = Math.random(); |
| | | }, 200); |
| | | }, |
| | | }, |
| | | computed: { |
| | | ...mapGetters("account", ["permits"]), |
| | | ...mapGetters("setting", ["affixed"]), |
| | | canDownloadSoftware() { |
| | | return checkPermit(PERMITS.downloadSoftware, this.permits); |
| | | }, |
| | | }, |
| | | mounted() { |
| | | this.searchData(); |