南昌市物联网技防平台-前端
zengh
2021-03-24 e2499a631708b565922aa3ce24da8a2a5dddc637
src/views/parcel/parcelKind.vue
@@ -18,19 +18,42 @@
               @size-change="sizeChange"
               @refresh-change="refreshChange"
               @on-load="onLoad">
      <template slot-scope="{ type, size, row }" slot="menu">
        <el-button
          v-if="row.imgUrl != null || row.imgUrl != ''"
          icon="el-icon-view"
          :size="size"
          :type="type"
          @click.stop="handleParcelPic(row)"
          >查看包裹图片
        </el-button>
      </template>
    </avue-crud>
    <!-- <template>
        <div>
          <img v-image-preview src="'data:image/png;base64,'+imgUrl"/>
        </div>
      </template> -->
  </basic-container>
</template>
<script>
  import {getKindList, getDetail} from "@/api/parcel/parcel";
  import {getKindList, getParcelPic} from "@/api/parcel/parcel";
  import {mapGetters} from "vuex";
  import VueDirectiveImagePreviewer from 'vue-directive-image-previewer';
  import 'vue-directive-image-previewer/dist/assets/style.css';
  import Vue from 'vue';
  Vue.use(VueDirectiveImagePreviewer);
  export default {
    data() {
      return {
        form: {},
        query: {},
        imgUrl:'',
        loading: true,
        page: {
          pageSize: 10,
@@ -44,7 +67,7 @@
          tip: false,
          searchShow: true,
          searchMenuSpan: 4,
          menuWidth:120,
          menuWidth:150,
          border: true,
          index: true,
          viewBtn: true,
@@ -67,10 +90,6 @@
              },
            },
            {
              label: "安检机名称",
              prop: "checkMachineName",
            },
            {
              label: "包裹ID",
              prop: "packageId",
            },
@@ -81,7 +100,7 @@
            },
            {
              label: "安检时间",
              prop: "samplingTime",
              prop: "createTime",
            },
            {
              label: "安检时间",
@@ -104,25 +123,25 @@
                }
              ]
            },
            {
              label: "违禁类型",
              search: true,
              searchLabelWidth: 120,
              searchSpan: 4,
              hide: true,
              prop: "decisioDiagramResult",
              type: "select",
              dicData: [
                {
                  label: "是",
                  value: "contraband"
                },
                {
                  label: "否",
                  value: "normal"
                },
              ]
            },
            // {
            //   label: "违禁类型",
            //   search: true,
            //   searchLabelWidth: 120,
            //   searchSpan: 4,
            //   hide: true,
            //   prop: "decisioDiagramResult",
            //   type: "select",
            //   dicData: [
            //     {
            //       label: "是",
            //       value: "contraband"
            //     },
            //     {
            //       label: "否",
            //       value: "normal"
            //     },
            //   ]
            // },
            {
              label: '违禁品名称',
              prop: 'objName'
@@ -151,7 +170,7 @@
      permissionList() {
        return {
          addBtn: this.vaildData(null, false),
          viewBtn: this.vaildData(this.permission.parcel_pic_view, true),
          viewBtn: this.vaildData(null, false),
          delBtn: this.vaildData(null, false),
          editBtn: this.vaildData(null, false)
        };
@@ -244,6 +263,13 @@
          this.loading = false;
          this.selectionClear();
        });
      },
      handleParcelPic(row) {
        console.log(row.imgUrl);
        getParcelPic(row.imgUrl).then(res => {
            this.imgUrl = res.data.data.imgBase64;
          });
        this.dialogTableVisible = true;
      }
    }
  };