소스 검색

添加大图功能 修改部分图片无法显示bug

haojianlong 5 년 전
부모
커밋
071d71a57e

+ 1 - 9
src/components/business_space/dialogs/list/uploadImgDialog.vue

@@ -43,16 +43,8 @@ export default {
   mounted() { },
   methods: {
     deepcopy(obj) {
-      //   var out = [],
-      //     i = 0,
-      //     len = obj.length;
-      //   for (; i < len; i++) {
-      //     if (obj[i] instanceof Array) {
-      //       out[i] = this.deepcopy(obj[i]);
-      //     } else out[i] = obj[i];
-      //   }
       console.log(obj, "out")
-      return obj;
+      return JSON.parse(JSON.stringify(obj));
     },
     changeItem(file) {
       console.log(file, "changed")

+ 13 - 27
src/components/business_space/lib/detailsDia.vue

@@ -1,31 +1,17 @@
 <template>
-  <el-dialog
-    :title="title"
-    append-to-body
-    class="iframe"
-    :visible.sync="dialog.details"
-    width="500px"
-  >
-    <iframe
-      id="google_ads_frame2"
-      name="google_ads_frame2"
-      frameborder="0"
-      width="100%"
-      height="600px"
-      :src="iframeSrc"
-      marginwidth="0"
-      marginheight="0"
-      vspace="0"
-      hspace="0"
-      allowtransparency="true"
-      scrolling="no"
-      allowfullscreen="true"
-    ></iframe>
+  <el-dialog :title="title" append-to-body class="iframe" :visible.sync="dialog.details" width="500px">
+    <iframe :id="id" name="google_ads_frame2" frameborder="0" width="100%" height="300px" :src="iframeSrc" marginwidth="0" marginheight="0" vspace="0"
+      hspace="0" allowtransparency="true" scrolling="no" allowfullscreen="true"></iframe>
   </el-dialog>
 </template>
 
 <script>
 export default {
+  data() {
+    return {
+      id: 'google_ads_frame2' + new Date().getTime()
+    }
+  },
   props: {
     iframeSrc: {
       type: String,
@@ -53,7 +39,7 @@ export default {
   methods: {
     setMess() {
       this.$nextTick(_ => {
-        let iframe = document.getElementById("google_ads_frame2")
+        let iframe = document.getElementById(this.id)
         iframe.onload = () => {
           iframe.contentWindow.postMessage(this.setData, "*")
         }
@@ -73,9 +59,9 @@ export default {
 }
 </script>
 <style lang="less" scoped>
-    #google_ads_frame2 {
-        height: 300px;
-        overflow: auto;
-    }
+#google_ads_frame2 {
+  height: 300px;
+  overflow: auto;
+}
 </style>
 

+ 3 - 3
src/components/business_space/lib/uploadImgs.vue

@@ -9,14 +9,14 @@
     <div class="saga-upload-images">
       <div v-if="type != 'video'" class="point-image" v-for="(item,index) in imagesArr">
         <i v-if="!readOnly" class="el-icon-delete" @click="delImage(index,item)"></i>
-        <img :src="imageGetUrl + '&key=' +item" alt v-load>
+        <img :src="imageGetUrl + '&key=' +item.key" alt v-load>
       </div>
       <div v-if="type == 'video'" class="point-image" v-for="(item,index) in imagesArr">
         <i v-if="!readOnly" class="el-icon-delete" @click="delImage(index,item)"></i>
         <video
           width="100%"
           height="100%;"
-          :src="imageGetUrl + '&key=' +item"
+          :src="imageGetUrl + '&key=' +item.key"
           controls="controls"
         >您的浏览器不支持 video 标签。</video>
       </div>
@@ -304,7 +304,7 @@ export default {
     margin-bottom: 10px;
     border: 1px solid #ccc;
     overflow: hidden;
-    image {
+    img {
       z-index: 11;
     }
     i {

+ 1 - 1
src/components/business_space/lib/uploadImgsName.vue

@@ -348,7 +348,7 @@ export default {
     position: relative;
     border: 1px solid #ccc;
     overflow: hidden;
-    image {
+    img {
       z-index: 11;
     }
     i {

+ 1 - 9
src/components/dialogs/list/uploadImgDialog.vue

@@ -42,16 +42,8 @@ export default {
   mounted() { },
   methods: {
     deepcopy(obj) {
-      //   var out = [],
-      //     i = 0,
-      //     len = obj.length;
-      //   for (; i < len; i++) {
-      //     if (obj[i] instanceof Array) {
-      //       out[i] = this.deepcopy(obj[i]);
-      //     } else out[i] = obj[i];
-      //   }
       console.log(obj, "out")
-      return obj;
+      return JSON.parse(JSON.stringify(obj));
     },
     changeItem(file) {
       console.log(file, "changed")

+ 3 - 3
src/components/ledger/handsontables/assets.vue

@@ -45,7 +45,7 @@
       <my-pagination @change="getTableData" :page="page"></my-pagination>
     </div>
     <!-- <dialog-assets :assetType="[this.mess.deviceId]"  @close="closeDialog" ref="assets" v-if="myDialog.addDevice" :dialog="myDialog" ></dialog-assets> -->
-    <details-dialog :iframeSrc="iframeSrc" v-if="myDialog.details" :dialog="myDialog"></details-dialog>
+    <!-- <details-dialog :iframeSrc="iframeSrc" v-if="myDialog.details" :dialog="myDialog"></details-dialog> -->
     <look-pic :dialog="myDialog" :keysArr="picsArr"></look-pic>
     <!-- 不支持的输入方式 -->
     <el-dialog title="临时维护信息点" :visible.sync="myDialog.update" @close="handleCloseUpdate" width="670px">
@@ -97,7 +97,7 @@ import insurerDialog from "@/components/business_space/dialogs/list/insurerDialo
 import guaranteeDialog from "@/components/business_space/dialogs/list/guaranteeDialog"
 import uploadFilesDialog from "@/components/business_space/dialogs/list/filesDialog"
 import uploadImgDialog from "@/components/business_space/dialogs/list/uploadImgDialog"
-import detailsDialog from "@/components/business_space/lib/detailsDia"
+// import detailsDialog from "@/components/business_space/lib/detailsDia"
 import picDialog from "@/components/business_space/dialogs/list/picDialog"
 import myPagination from "@/components/common/myPagination"
 import dialogAssets from "@/components/ledger/addDialog/dialogAssets"
@@ -131,7 +131,7 @@ export default {
     myCascader,
     floorCascader,
     dieCascader,
-    detailsDialog,
+    // detailsDialog,
     lookPic
   },
   created() {

+ 17 - 4
src/components/ledger/lib/uploadImgs.vue

@@ -9,14 +9,14 @@
     <div class="saga-upload-images">
       <div v-if="type != 'video'" class="point-image" v-for="(item,index) in imagesArr">
         <i v-if="!readOnly" class="el-icon-delete" @click="delImage(index,item)"></i>
-        <img :src="imageGetUrl + '&key=' +item" alt v-load>
+        <img :src="imageGetUrl + '&key=' +item.key" @click="lookImg" alt v-load>
       </div>
       <div v-if="type == 'video'" class="point-image" v-for="(item,index) in imagesArr">
         <i v-if="!readOnly" class="el-icon-delete" @click="delImage(index,item)"></i>
         <video
           width="100%"
           height="100%;"
-          :src="imageGetUrl + '&key=' +item"
+          :src="imageGetUrl + '&key=' +item.key"
           controls="controls"
         >您的浏览器不支持 video 标签。</video>
       </div>
@@ -35,11 +35,16 @@
         <video style="display:none;" id="video" controls/>
       </div>
     </div>
+    <details-dialog :title="'图片'" :iframeSrc="iframeSrc" :dialog="dialog" :setData="imagesArr"></details-dialog>
   </div>
 </template>
 <script>
 import tools from "@/utils/scan/tools";
+import detailsDialog from "@/components/business_space/lib/detailsDia"
 export default {
+  components: {
+    detailsDialog
+  },
   props: {
     keysArr: {
       type: [Array, String]
@@ -73,7 +78,11 @@ export default {
       baseUrl: "",
       imageGetUrl: "/image-service/common/image_get?systemId=dataPlatform",
       imageUploadUrl: "/image-service/common/image_upload?systemId=dataPlatform&secret=9e0891a7a8c8e885&overwrite=true",
-      imagesArr: []
+      imagesArr: [],
+      iframeSrc: "",
+      dialog: {
+        details: false
+      }
     };
   },
   created() {
@@ -94,7 +103,11 @@ export default {
         this.imagesArr = [];
       }
     },
-
+    //查看图片
+    lookImg() {
+      this.dialog.details = true
+      this.iframeSrc = process.env.BASE_URL + ":8890/photo-View.html"
+    },
     //删除图片
     delImage(i, key) {
       if (this.type == "video") {

+ 1 - 1
src/components/ledger/lib/uploadImgsName.vue

@@ -347,7 +347,7 @@ export default {
     position: relative;
     border: 1px solid #ccc;
     overflow: hidden;
-    image {
+    img {
       z-index: 11;
     }
     i {