| | |
| | | <template> |
| | | <div class="draw-upload"> |
| | | <a-spin :spinning="spinning" tip="拼命加载中..."> |
| | | <a-card> |
| | | <a-row> |
| | | <a-col :span="8"> |
| | |
| | | </template> |
| | | <template slot="action" slot-scope="text, record"> |
| | | <div v-if="record.dwgUrl"> |
| | | <a>预览</a> |
| | | <a @click="dwgReview(record.dwgUrl)">预览</a> |
| | | <a-divider type="vertical"></a-divider> |
| | | <a :href="webUrl+record.dwgUrl" download>下载</a> |
| | | </div> |
| | | </template> |
| | | </a-table> |
| | | </a-spin> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import getWebUrl from "@/assets/js/tools/getWebUrl"; |
| | | import ImageView from "@/pages/components/ImageView"; |
| | | import {dwgReview} from "@/pages/workplace/apis"; |
| | | export default { |
| | | name: "DrawUpload", |
| | | components: {ImageView}, |
| | |
| | | align: 'center', |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: '基本单位', |
| | | dataIndex: 'unit', |
| | | align: 'center', |
| | | ellipsis: true, |
| | | }, |
| | | // { |
| | | // title: '基本单位', |
| | | // dataIndex: 'unit', |
| | | // align: 'center', |
| | | // ellipsis: true, |
| | | // }, |
| | | { |
| | | title: '子件数量', |
| | | dataIndex: 'quantity', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: '生产商', |
| | | dataIndex: 'producer', |
| | | align: 'center', |
| | | ellipsis: true, |
| | | }, |
| | | // { |
| | | // title: '生产商', |
| | | // dataIndex: 'producer', |
| | | // align: 'center', |
| | | // ellipsis: true, |
| | | // }, |
| | | { |
| | | title: '封装类型/材质', |
| | | dataIndex: 'material', |
| | |
| | | columns: columns, |
| | | webUrl: getWebUrl(), |
| | | y: 500, |
| | | spinning: false |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | this.y++; |
| | | this.$nextTick(()=>{ |
| | | this.y--; |
| | | }); |
| | | }, |
| | | dwgReview(url) { |
| | | this.spinning = true; |
| | | dwgReview(url).then(res=>{ |
| | | this.spinning = false; |
| | | let rs = res.data; |
| | | if(rs.code == 1 && rs.data) { |
| | | window.open(this.webUrl+rs.data); |
| | | }else { |
| | | this.$message.error(rs.msg); |
| | | } |
| | | }).catch(error=>{ |
| | | this.spinning = false; |
| | | console.log(error); |
| | | }); |
| | | } |
| | | }, |
| | |
| | | parentModel: "", |
| | | parentName: "", |
| | | }; |
| | | if(this.list.length != 0) { |
| | | if(this.list.length !== 0) { |
| | | let item = this.list[0]; |
| | | info.parentCode = item.parentCode; |
| | | info.parentModel = item.parentModel; |
| | |
| | | } |
| | | }, |
| | | mounted() { |
| | | console.log(this.$refs.aTable); |
| | | |
| | | } |
| | | } |
| | | </script> |
| | |
| | | data |
| | | }); |
| | | } |
| | | |
| | | /** |
| | | * |
| | | * @param dwgUrl |
| | | * @returns {AxiosPromise} |
| | | */ |
| | | export const dwgReview = (dwgUrl)=>{ |
| | | return axios({ |
| | | method: "GET", |
| | | url: "bomApproving/dwgReview", |
| | | params: { |
| | | dwgUrl, |
| | | } |
| | | }); |
| | | } |