14个文件已删除
1个文件已添加
4 文件已重命名
11个文件已修改
| | |
| | | data |
| | | }); |
| | | }; |
| | | |
| | | //ä¿åå®è£
å
|
| | | export const saveProductPackage = (data) => { |
| | | return request({ |
| | | url: "/admin/api-i/index/saveProductPackage", |
| | | method: "POST", |
| | | data |
| | | }); |
| | | }; |
| | |
| | | |
| | | // éè¿md5è·åæä»¶è·¯å¾ |
| | | export const getFilePath = (query:any) => request({ |
| | | url: `/data/api-f/file/path?identifier=${query.identifier}&filename=${query.filename}`, |
| | | url: `/admin/api-f/file/path?identifier=${query.identifier}&filename=${query.filename}`, |
| | | method: "get", |
| | | }) |
| | |
| | | </div> |
| | | |
| | | <div class="user"> |
| | | <img src="/images/layout/é»è®¤å¤´å-01.png" alt="" /> |
| | | <img src="/images/layout/default.jpg" style="border-radius: 50%" alt="" /> |
| | | <div class="dropdown">basic</div> |
| | | <i class="el-icon-arrow-down"></i> |
| | | </div> |
| | |
| | | } |
| | | } |
| | | </style> |
| | | |
| | | |
| | |
| | | <template> |
| | | <div class="imgBox"> |
| | | <img :src="'/httpImage/' + url" class="cursor-pointer" v-if="isPreview" preview /> |
| | | <img :src="'/httpImage/' + url" v-if="!isPreview" /> |
| | | <el-button class="btn" @click="downloadIamge('/httpImage/' + url)"> |
| | | <img |
| | | :src="'http://' + url" |
| | | class="cursor-pointer" |
| | | v-if="isPreview" |
| | | preview |
| | | /> |
| | | <img :src="'http://' + url" v-if="!isPreview" /> |
| | | <el-button class="btn" @click="downloadIamge('http://' + url)"> |
| | | <i class="iconfont iconxiazai"></i> |
| | | </el-button> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import axios from "axios" |
| | | import axios from "axios"; |
| | | export default { |
| | | props: { |
| | | url: { |
| | | default: "", |
| | | type: String |
| | | type: String, |
| | | }, |
| | | isPreview: { |
| | | default: true, |
| | | type: Boolean |
| | | } |
| | | type: Boolean, |
| | | }, |
| | | }, |
| | | methods: { |
| | | downloadIamge(url) { |
| | | axios({ |
| | | method: "get", |
| | | url: url, |
| | | responseType: "blob" |
| | | responseType: "blob", |
| | | }) |
| | | .then((res) => { |
| | | if (res.status == 200) { |
| | | var a = document.createElement("a") |
| | | var strs = url.split("/") |
| | | var href = new Blob([res.data], { type: "image/jpeg" }) |
| | | a.href = URL.createObjectURL(href) |
| | | a.download = strs[strs.length - 1] + ".jpg" |
| | | a.click() |
| | | var a = document.createElement("a"); |
| | | var strs = url.split("/"); |
| | | var href = new Blob([res.data], { type: "image/jpeg" }); |
| | | a.href = URL.createObjectURL(href); |
| | | a.download = strs[strs.length - 1] + ".jpg"; |
| | | a.click(); |
| | | } |
| | | }) |
| | | .catch((err) => { |
| | | if (err && err.status == 401) { |
| | | return |
| | | return; |
| | | } |
| | | this.$notify({ |
| | | type: "error", |
| | | message: "ä¸è½½å¤±è´¥ï¼" + err + "请éè¯ï¼", |
| | | duration: 2500, |
| | | offset: 57 |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | offset: 57, |
| | | }); |
| | | }); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .imgBox { |
| | |
| | | <!-- å
¨å±æé® --> |
| | | <img |
| | | class="zoomOut iconfont" |
| | | src="/images/equipmentManagement/å
¨å±.png" |
| | | src="/images/equipmentManagement/full.png" |
| | | @click="toggleZoom('Full')" |
| | | v-if="!isFull" |
| | | /> |
| | | <!-- åæ¶å
¨å±çæé® --> |
| | | <img |
| | | class="zoomOut iconfont" |
| | | src="/images/equipmentManagement/éåºå
¨å±.png" |
| | | src="/images/equipmentManagement/quit.png" |
| | | @click="toggleZoom('')" |
| | | v-else |
| | | /> |
| | |
| | | let markerContent = |
| | | "" + |
| | | `<div class="nodeMarker" id="node${index}}">` + |
| | | '<img class="normal" src="/images/equipmentManagement/设å¤é»è®¤.png">' + |
| | | '<img class="selected" src="/images/equipmentManagement/设å¤éä¸.png">' + |
| | | '<img class="normal" src="/images/equipmentManagement/default.png">' + |
| | | '<img class="selected" src="/images/equipmentManagement/select.png">' + |
| | | `<div class="box"> <div class="name">${item.devName}</div> <div class="property">IPå°å: <span class="data">${item.devIp}</span> </div> <div class="property">设å¤ä½ç½®: <span class="data">${item.province}</span></div><div class="property">å®è£
æ¶é´: <span class="data">${item.installTime}</span></div></div>`; |
| | | ("</div>"); |
| | | |
| | |
| | | |
| | | if (this.ruleForm.pic && this.ruleForm.pic.indexOf("/images") !== 0) { |
| | | this.pic.push({ |
| | | url: "/httpImage/" + this.ruleForm.pic, |
| | | url: this.ruleForm.pic, |
| | | }); |
| | | } else { |
| | | this.pic.push({ |
| | |
| | | .buttonArea { |
| | | display: flex; |
| | | align-items: flex-end; |
| | | justify-content: end; |
| | | justify-content: flex-end; |
| | | height: 52px; |
| | | line-height: 32px; |
| | | font-size: 12px; |
| | |
| | | }); |
| | | if (this.ruleForm.pic && this.ruleForm.pic.indexOf("/images") !== 0) { |
| | | this.pic.push({ |
| | | url: "/httpImage/" + this.ruleForm.pic, |
| | | url: "http://" + this.ruleForm.pic, |
| | | }); |
| | | } else { |
| | | this.pic.push({ |
| | |
| | | |
| | | .buttonArea { |
| | | display: flex; |
| | | justify-content: end; |
| | | justify-content: flex-end; |
| | | margin: 20px 20px 0 0px; |
| | | .addButton { |
| | | width: 84px; |
| | |
| | | .buttonArea { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: end; |
| | | justify-content: flex-end; |
| | | line-height: 24px; |
| | | font-size: 12px; |
| | | text-align: center; |
| | |
| | | return { |
| | | input: "", |
| | | time: "", |
| | | dataList: [ |
| | | { |
| | | name: "AIçæ¬¾", |
| | | img: "/images/ModelList/æç¨.png", |
| | | type: 0, |
| | | des: "ç²¾å¿æéçå
¥é¨ç®æ³ååºç¨ï¼æ»æä¸æ¬¾éåä½ ", |
| | | sort: 3, |
| | | show: false, |
| | | }, |
| | | { |
| | | name: "AIçæ¬¾", |
| | | img: "/images/ModelList/æç¨.png", |
| | | type: 1, |
| | | des: "ç²¾å¿æéçå
¥é¨ç®æ³ååºç¨ï¼æ»æä¸æ¬¾éåä½ ", |
| | | sort: 3, |
| | | show: false, |
| | | }, |
| | | { |
| | | name: "AIçæ¬¾", |
| | | img: "/images/ModelList/æç¨.png", |
| | | type: 2, |
| | | des: "ç²¾å¿æéçå
¥é¨ç®æ³ååºç¨ï¼æ»æä¸æ¬¾éåä½ ", |
| | | sort: 3, |
| | | show: true, |
| | | }, |
| | | { |
| | | name: "AIçæ¬¾", |
| | | img: "/images/ModelList/æç¨.png", |
| | | type: 3, |
| | | des: "ç²¾å¿æéçå
¥é¨ç®æ³ååºç¨ï¼æ»æä¸æ¬¾éåä½ ", |
| | | sort: 3, |
| | | show: true, |
| | | }, |
| | | ], |
| | | dataList: [], |
| | | showDelBox: false, |
| | | delId: null, |
| | | }; |
| | |
| | | |
| | | .buttonArea { |
| | | display: flex; |
| | | justify-content: end; |
| | | justify-content: flex-end; |
| | | margin: 20px 20px 0 0; |
| | | .addButton { |
| | | width: 84px; |
| | |
| | | :data="dataList" |
| | | tooltip-effect="dark" |
| | | :fit="true" |
| | | :key="num" |
| | | > |
| | | <el-table-column label="åºå·" width="68"> |
| | | <template slot-scope="scope">{{ scope.$index + 1 }}</template> |
| | |
| | | </span> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | width="350" |
| | | key="status" |
| | | label="å®è£
å
管ç" |
| | | align="center" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <div class="uploadBox"> |
| | | <file-uploader |
| | | single |
| | | uploadPlaceholder="ä¸ä¼ æä»¶" |
| | | url="/admin/api-f/file/upload" |
| | | @complete="onFileUpload($event, scope.row)" |
| | | @file-added="onFileAdded(scope.row)" |
| | | v-if="scope.row.status === 0" |
| | | /> |
| | | <div class="name" v-if="scope.row.status === 1"> |
| | | {{ scope.row.component_name }} |
| | | </div> |
| | | <div |
| | | class="cancel" |
| | | v-if="scope.row.status === 1" |
| | | @click="cancel(scope.row)" |
| | | > |
| | | åæ¶ |
| | | </div> |
| | | <div |
| | | class="save" |
| | | @click="submit(scope.row)" |
| | | v-if="scope.row.status === 1" |
| | | > |
| | | ä¿å |
| | | </div> |
| | | |
| | | <div |
| | | class="save" |
| | | @click="editPcg(scope.row)" |
| | | v-if="scope.row.status === 2" |
| | | > |
| | | ç¼è¾ |
| | | </div> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </div> |
| | |
| | | |
| | | <script> |
| | | import DelBox from "@/views/operateManage/productManage/DelBox"; |
| | | import FileUploader from "@/components/subComponents/FileUpload/index"; |
| | | import { getFilePath } from "@/api/utils"; |
| | | |
| | | import { |
| | | getProductListByModel, |
| | | setProductIsShow, |
| | | setProductIndexShow, |
| | | deleteProduct, |
| | | saveProductPackage, |
| | | } from "@/api/product"; |
| | | |
| | | export default { |
| | | components: { |
| | | DelBox, |
| | | FileUploader, |
| | | }, |
| | | created() { |
| | | this.getProductList(); |
| | |
| | | dataList: [], |
| | | showDelBox: false, |
| | | delId: null, |
| | | stop: false, |
| | | num: 0, |
| | | }; |
| | | }, |
| | | methods: { |
| | |
| | | }); |
| | | if (res && res.success) { |
| | | this.dataList = res.data.productList; |
| | | this.dataList.forEach((item) => { |
| | | item.status = 2; |
| | | }); |
| | | } |
| | | }, |
| | | edit() { |
| | |
| | | id: id, |
| | | indexShow: val, |
| | | }); |
| | | }, |
| | | onFileUpload(params, row) { |
| | | row.component_name = params.filename; |
| | | console.log(row.component_name); |
| | | getFilePath(params).then((res) => { |
| | | if (res.code == 200) { |
| | | this.num++; |
| | | row.component_path = res.data; |
| | | row.status = 1; |
| | | } |
| | | }); |
| | | }, |
| | | onFileAdded() {}, |
| | | cancel(row) { |
| | | this.num++; |
| | | row.status = 0; |
| | | }, |
| | | async submit(row) { |
| | | console.log(row); |
| | | const res = await saveProductPackage({ |
| | | component_path: row.component_path, |
| | | productId: row.productId, |
| | | }); |
| | | if (res && res.success) { |
| | | this.$notify({ |
| | | type: "success", |
| | | message: "ä¿åæå", |
| | | }); |
| | | row.status = 2; |
| | | this.num++; |
| | | } |
| | | }, |
| | | editPcg(row) { |
| | | this.num++; |
| | | row.status = 0; |
| | | }, |
| | | }, |
| | | }; |
| | |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | |
| | | .uploadBox { |
| | | display: flex; |
| | | justify-content: center; |
| | | line-height: 32px; |
| | | |
| | | .cancel { |
| | | color: #0064ff; |
| | | margin: 0 10px; |
| | | margin-left: 35px; |
| | | cursor: pointer; |
| | | } |
| | | |
| | | .save { |
| | | color: #0064ff; |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | } |
| | | </style> |