jinlin
2024-09-20 275125ec506507e7a644ab3b3079f618c64d1fea
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<template>
  <zt-dialog ref="dialog" column="2" title="选择图片" append-to-body :editAble="false" :hasConfirm="false">
    <el-card shadow="never" class="aui-card--fill">
      <div class="mod-sysPictureBase-sysPictureBase}">
        <zt-table-wraper query-url="/sysPictureBase/page"
                         :paging='false'
                         v-slot="{ table }">
          <el-form :inline="true" :model="dataForm" @keyup.enter.native="table.query()">
            </el-form>
          <el-table v-loading="table.dataLoading" :data="table.dataList" height="100px" v-adaptive="{bottomOffset:70}"
                    border
                    @row-dblclick="selectedPicture"
                    @selection-change="table.selectionChangeHandle">
            <el-table-column prop="name" label="图片名称"/>
            <el-table-column label="图片" align="center">
              <template v-slot="{ row }">
                <el-image v-if="row.id" :src="url+row.id" style="height: 50px;width: 50px"></el-image>
              </template>
            </el-table-column>
          </el-table>
        </zt-table-wraper>
      </div>
    </el-card>
  </zt-dialog>
</template>
 
<script>
  import Cookies from 'js-cookie'
 
  export default {
    data() {
      return {
        url: `${window.SITE_CONFIG['apiURL']}/sysPictureBase/getSvgImage?token=${Cookies.get('token')}&id=`,
        name: 'SelectPicture',
        type: '',
        dataForm: {
          id:'',
          contentType: '',
          systemMark: '',
          productType:'',
          sortNo: ''
        },
      }
    },
    components: {},
    methods: {
      init(type) {
        this.dataForm.productType = type
        console.log(this.dataForm.productType)
      },
      async selectedPicture(row) {
        await this.$tip.success()
        this.$refs.dialog.close()
        this.$emit('setPicture', row)
      }
    }
  }
</script>