From f358f667a292973618199b51552d61179181cf1d Mon Sep 17 00:00:00 2001 From: ZZJ <10913410+zzj2100@user.noreply.gitee.com> Date: 星期三, 27 七月 2022 14:23:32 +0800 Subject: [PATCH] bug修复 --- public/images/equipmentManagement/full.png | 0 public/images/equipmentManagement/quit.png | 0 public/images/equipmentManagement/select.png | 0 src/components/TopNav.vue | 4 src/components/subComponents/imgDown.vue | 47 ++++++----- src/views/equipmentManage/equipmentList/components/Content.vue | 8 +- public/images/layout/default.jpg | 0 src/views/operateManage/productManage/ProductList.vue | 109 +++++++++++++++++++++++++++ src/api/product.ts | 9 ++ src/views/operateManage/productManage/BannerList.vue | 2 src/api/utils.ts | 2 src/views/operateManage/productManage/AddBanner.vue | 4 /dev/null | 0 src/views/operateManage/productManage/ModelList.vue | 37 -------- public/images/equipmentManagement/default.png | 0 src/views/operateManage/productManage/DelBox.vue | 2 src/views/operateManage/productManage/AddModel.vue | 2 17 files changed, 159 insertions(+), 67 deletions(-) diff --git "a/public/images/ModelList/\346\232\202\347\224\250.png" "b/public/images/ModelList/\346\232\202\347\224\250.png" deleted file mode 100644 index 355239b..0000000 --- "a/public/images/ModelList/\346\232\202\347\224\250.png" +++ /dev/null Binary files differ diff --git "a/public/images/equipmentManagement/\350\256\276\345\244\207\351\273\230\350\256\244.png" b/public/images/equipmentManagement/default.png similarity index 100% rename from "public/images/equipmentManagement/\350\256\276\345\244\207\351\273\230\350\256\244.png" rename to public/images/equipmentManagement/default.png Binary files differ diff --git "a/public/images/equipmentManagement/\345\205\250\345\261\217.png" b/public/images/equipmentManagement/full.png similarity index 100% rename from "public/images/equipmentManagement/\345\205\250\345\261\217.png" rename to public/images/equipmentManagement/full.png Binary files differ diff --git "a/public/images/equipmentManagement/\351\200\200\345\207\272\345\205\250\345\261\217.png" b/public/images/equipmentManagement/quit.png similarity index 100% rename from "public/images/equipmentManagement/\351\200\200\345\207\272\345\205\250\345\261\217.png" rename to public/images/equipmentManagement/quit.png Binary files differ diff --git "a/public/images/equipmentManagement/\350\256\276\345\244\207\351\200\211\344\270\255.png" b/public/images/equipmentManagement/select.png similarity index 100% rename from "public/images/equipmentManagement/\350\256\276\345\244\207\351\200\211\344\270\255.png" rename to public/images/equipmentManagement/select.png Binary files differ diff --git "a/public/images/index/11\346\273\236\347\225\231.png" "b/public/images/index/11\346\273\236\347\225\231.png" deleted file mode 100644 index 80f55f8..0000000 --- "a/public/images/index/11\346\273\236\347\225\231.png" +++ /dev/null Binary files differ diff --git "a/public/images/index/13\346\273\236\347\225\231.png" "b/public/images/index/13\346\273\236\347\225\231.png" deleted file mode 100644 index 1700189..0000000 --- "a/public/images/index/13\346\273\236\347\225\231.png" +++ /dev/null Binary files differ diff --git "a/public/images/index/15\346\210\264\345\217\243\347\275\251.png" "b/public/images/index/15\346\210\264\345\217\243\347\275\251.png" deleted file mode 100644 index cf806b1..0000000 --- "a/public/images/index/15\346\210\264\345\217\243\347\275\251.png" +++ /dev/null Binary files differ diff --git "a/public/images/index/1\344\273\260\345\215\247\346\243\200\346\265\213.png" "b/public/images/index/1\344\273\260\345\215\247\346\243\200\346\265\213.png" deleted file mode 100644 index 3a63bcf..0000000 --- "a/public/images/index/1\344\273\260\345\215\247\346\243\200\346\265\213.png" +++ /dev/null Binary files differ diff --git "a/public/images/index/20\347\235\241\345\262\227.png" "b/public/images/index/20\347\235\241\345\262\227.png" deleted file mode 100644 index 0ee6103..0000000 --- "a/public/images/index/20\347\235\241\345\262\227.png" +++ /dev/null Binary files differ diff --git "a/public/images/index/28\347\216\251\346\211\213\346\234\272.png" "b/public/images/index/28\347\216\251\346\211\213\346\234\272.png" deleted file mode 100644 index 23cbfb1..0000000 --- "a/public/images/index/28\347\216\251\346\211\213\346\234\272.png" +++ /dev/null Binary files differ diff --git "a/public/images/index/34\350\267\214\345\200\222.png" "b/public/images/index/34\350\267\214\345\200\222.png" deleted file mode 100644 index 7c19476..0000000 --- "a/public/images/index/34\350\267\214\345\200\222.png" +++ /dev/null Binary files differ diff --git "a/public/images/index/AI\347\210\206\346\254\276.png" "b/public/images/index/AI\347\210\206\346\254\276.png" deleted file mode 100644 index bf749cc..0000000 --- "a/public/images/index/AI\347\210\206\346\254\276.png" +++ /dev/null Binary files differ diff --git "a/public/images/index/\346\225\260\346\215\256\346\216\250\351\200\201.png" "b/public/images/index/\346\225\260\346\215\256\346\216\250\351\200\201.png" deleted file mode 100644 index bda7759..0000000 --- "a/public/images/index/\346\225\260\346\215\256\346\216\250\351\200\201.png" +++ /dev/null Binary files differ diff --git "a/public/images/index/\346\257\224\345\257\271\345\272\223\347\256\241\347\220\206.png" "b/public/images/index/\346\257\224\345\257\271\345\272\223\347\256\241\347\220\206.png" deleted file mode 100644 index 0f7a9a4..0000000 --- "a/public/images/index/\346\257\224\345\257\271\345\272\223\347\256\241\347\220\206.png" +++ /dev/null Binary files differ diff --git "a/public/images/index/\347\263\273\347\273\237\347\273\264\346\212\244.png" "b/public/images/index/\347\263\273\347\273\237\347\273\264\346\212\244.png" deleted file mode 100644 index d3bab3f..0000000 --- "a/public/images/index/\347\263\273\347\273\237\347\273\264\346\212\244.png" +++ /dev/null Binary files differ diff --git "a/public/images/index/\347\273\237\350\256\241\346\237\245\350\257\242.png" "b/public/images/index/\347\273\237\350\256\241\346\237\245\350\257\242.png" deleted file mode 100644 index 4021f6d..0000000 --- "a/public/images/index/\347\273\237\350\256\241\346\237\245\350\257\242.png" +++ /dev/null Binary files differ diff --git a/public/images/layout/default.jpg b/public/images/layout/default.jpg new file mode 100644 index 0000000..eb8d088 --- /dev/null +++ b/public/images/layout/default.jpg Binary files differ diff --git "a/public/images/layout/\351\273\230\350\256\244\345\244\264\345\203\217-01.png" "b/public/images/layout/\351\273\230\350\256\244\345\244\264\345\203\217-01.png" deleted file mode 100644 index 107d75d..0000000 --- "a/public/images/layout/\351\273\230\350\256\244\345\244\264\345\203\217-01.png" +++ /dev/null Binary files differ diff --git a/src/api/product.ts b/src/api/product.ts index 6190a6d..4d33d16 100644 --- a/src/api/product.ts +++ b/src/api/product.ts @@ -134,4 +134,13 @@ method: "POST", data }); +}; + +//淇濆瓨瀹夎鍖� +export const saveProductPackage = (data) => { + return request({ + url: "/admin/api-i/index/saveProductPackage", + method: "POST", + data + }); }; \ No newline at end of file diff --git a/src/api/utils.ts b/src/api/utils.ts index bc3f4e5..ec71427 100644 --- a/src/api/utils.ts +++ b/src/api/utils.ts @@ -44,6 +44,6 @@ // 閫氳繃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", }) diff --git a/src/components/TopNav.vue b/src/components/TopNav.vue index f6cf762..f715571 100644 --- a/src/components/TopNav.vue +++ b/src/components/TopNav.vue @@ -6,7 +6,7 @@ </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> @@ -51,3 +51,5 @@ } } </style> + + diff --git a/src/components/subComponents/imgDown.vue b/src/components/subComponents/imgDown.vue index 267e4a3..a386a91 100644 --- a/src/components/subComponents/imgDown.vue +++ b/src/components/subComponents/imgDown.vue @@ -1,56 +1,61 @@ <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 { diff --git a/src/views/equipmentManage/equipmentList/components/Content.vue b/src/views/equipmentManage/equipmentList/components/Content.vue index e81e7c0..8e559de 100644 --- a/src/views/equipmentManage/equipmentList/components/Content.vue +++ b/src/views/equipmentManage/equipmentList/components/Content.vue @@ -6,14 +6,14 @@ <!-- 鍏ㄥ睆鎸夐挳 --> <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 /> @@ -112,8 +112,8 @@ 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>"); diff --git a/src/views/operateManage/productManage/AddBanner.vue b/src/views/operateManage/productManage/AddBanner.vue index 57030ec..9c31953 100644 --- a/src/views/operateManage/productManage/AddBanner.vue +++ b/src/views/operateManage/productManage/AddBanner.vue @@ -84,7 +84,7 @@ 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({ @@ -232,7 +232,7 @@ .buttonArea { display: flex; align-items: flex-end; - justify-content: end; + justify-content: flex-end; height: 52px; line-height: 32px; font-size: 12px; diff --git a/src/views/operateManage/productManage/AddModel.vue b/src/views/operateManage/productManage/AddModel.vue index 6fa5dab..1e05840 100644 --- a/src/views/operateManage/productManage/AddModel.vue +++ b/src/views/operateManage/productManage/AddModel.vue @@ -156,7 +156,7 @@ }); 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({ diff --git a/src/views/operateManage/productManage/BannerList.vue b/src/views/operateManage/productManage/BannerList.vue index 895e20c..8163f6a 100644 --- a/src/views/operateManage/productManage/BannerList.vue +++ b/src/views/operateManage/productManage/BannerList.vue @@ -176,7 +176,7 @@ .buttonArea { display: flex; - justify-content: end; + justify-content: flex-end; margin: 20px 20px 0 0px; .addButton { width: 84px; diff --git a/src/views/operateManage/productManage/DelBox.vue b/src/views/operateManage/productManage/DelBox.vue index a3319e1..055d698 100644 --- a/src/views/operateManage/productManage/DelBox.vue +++ b/src/views/operateManage/productManage/DelBox.vue @@ -54,7 +54,7 @@ .buttonArea { display: flex; align-items: center; - justify-content: end; + justify-content: flex-end; line-height: 24px; font-size: 12px; text-align: center; diff --git a/src/views/operateManage/productManage/ModelList.vue b/src/views/operateManage/productManage/ModelList.vue index 3a480cd..0018b6d 100644 --- a/src/views/operateManage/productManage/ModelList.vue +++ b/src/views/operateManage/productManage/ModelList.vue @@ -89,40 +89,7 @@ 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, }; @@ -195,7 +162,7 @@ .buttonArea { display: flex; - justify-content: end; + justify-content: flex-end; margin: 20px 20px 0 0; .addButton { width: 84px; diff --git a/src/views/operateManage/productManage/ProductList.vue b/src/views/operateManage/productManage/ProductList.vue index cb71bb2..1275c1e 100644 --- a/src/views/operateManage/productManage/ProductList.vue +++ b/src/views/operateManage/productManage/ProductList.vue @@ -17,6 +17,7 @@ :data="dataList" tooltip-effect="dark" :fit="true" + :key="num" > <el-table-column label="搴忓彿" width="68"> <template slot-scope="scope">{{ scope.$index + 1 }}</template> @@ -63,6 +64,51 @@ </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> @@ -77,16 +123,21 @@ <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(); @@ -98,6 +149,8 @@ dataList: [], showDelBox: false, delId: null, + stop: false, + num: 0, }; }, methods: { @@ -107,6 +160,9 @@ }); if (res && res.success) { this.dataList = res.data.productList; + this.dataList.forEach((item) => { + item.status = 2; + }); } }, edit() { @@ -146,6 +202,41 @@ 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; }, }, }; @@ -270,5 +361,23 @@ 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> \ No newline at end of file -- Gitblit v1.8.0