浏览代码

隔离点图片更换

pm 1 年之前
父节点
当前提交
03abbc4d6a
共有 2 个文件被更改,包括 15 次插入12 次删除
  1. 4 2
      src/components/separationPoint/index.vue
  2. 11 10
      src/views/mes/md/segregationpoint/index.vue

+ 4 - 2
src/components/separationPoint/index.vue

@@ -154,7 +154,8 @@ export default {
         const labelText = pos.pointName; // 对应的文字
 
         const point = new Image();
-        point.src = imageSrc;
+        point.src=pos.pointIcon
+        // point.src = imageSrc;
         point.onload = () => {
           const knovaImage = new Konva.Image({
             x: x,
@@ -218,7 +219,8 @@ export default {
                 this.redtexts[labelText].visible(false);
 
                 const normalImage = new Image();
-                normalImage.src = imageSrc; // 未选中的默认图片路径
+                normalImage.src=pos.pointIcon
+                // normalImage.src = imageSrc; // 未选中的默认图片路径
                 normalImage.onload = () => {
                   knovaImage.image(normalImage); // 更新图像
                   this.layer.draw(); // 更新图层

+ 11 - 10
src/views/mes/md/segregationpoint/index.vue

@@ -159,11 +159,11 @@
           />
         </template>
       </el-table-column> -->
-      <!--      <el-table-column label="隔离点图片" align="center" prop="pointPicture">-->
-      <!--        <template slot-scope="scope">-->
-      <!--          <img :src="scope.row.pointPicture" alt="" />-->
-      <!--        </template>-->
-      <!--      </el-table-column>-->
+            <el-table-column label="隔离点图片" align="center" prop="pointIcon">
+              <template slot-scope="scope">
+                <img :src="scope.row.pointIcon" alt="" style="width: 50px;height: 50px"/>
+              </template>
+            </el-table-column>
       <el-table-column label="隔离点类型" align="center" prop="pointType">
         <template slot-scope="scope">
           <dict-tag
@@ -312,10 +312,10 @@
             />
           </el-select>
         </el-form-item>
-        <el-form-item label="隔离点图片" prop="pointPicture">
+        <el-form-item label="隔离点图片" prop="pointIcon">
           <ImageUpload
             :limit="1"
-            :value="form.pointPicture"
+            :value="form.pointIcon"
             :fileSize="5"
             @onUploaded="handleImgUplaoded"
             @onRemoved="handleImgRemoved"
@@ -474,11 +474,11 @@ export default {
     },
     //图片上传成功
     handleImgUplaoded(imgUrl) {
-      this.form.pointPicture = imgUrl;
+      this.form.pointIcon = imgUrl;
     },
     //图片移除
     handleImgRemoved(imgUrl) {
-      this.form.pointPicture = null;
+      this.form.pointIcon = null;
     },
     // 取消按钮
     cancel() {
@@ -490,7 +490,7 @@ export default {
       this.form = {
         pointCode: null,
         pointName: null,
-        pointPicture: null,
+        pointIcon: null,
         pointType: null,
         powerType: null,
         createTime: null,
@@ -560,6 +560,7 @@ export default {
               this.getList();
             });
           } else {
+            console.log(this.form,'新增参数');
             addinsertIsIsolationPoint(this.form).then((response) => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;