jinlin
2024-03-18 812d77e3db062d63bc35304ac527f14efd1a454d
web/src/views/modules/basicInfo/SelectPicture.vue
@@ -12,7 +12,7 @@
            <el-table-column prop="name" label="图片名称"/>
            <el-table-column label="图片" align="center">
              <template v-slot="{ row }">
                <el-image v-if="row.accessoryMap" :src="getPath(row)" style="height: 50px;width: 50px"></el-image>
                <el-image v-if="row.id" :src="url+row.id" style="height: 50px;width: 50px"></el-image>
              </template>
            </el-table-column>
          </el-table>
@@ -23,13 +23,16 @@
</template>
<script>
  import Cookies from 'js-cookie'
  export default {
    data() {
      return {
        url: `${window.SITE_CONFIG['apiURL']}/sysPictureBase/getProductImg?token=${Cookies.get('token')}&id=`,
        name: 'SelectPicture',
        type: '',
        dataForm: {
          id:'',
          contentType: '',
          systemMark: '',
          sortNo: ''
@@ -41,17 +44,10 @@
      init(type) {
        this.type = type
      },
      getPath(row) {
        if (row.accessoryMap) {
          for (let key in row.accessoryMap) {
            return key
          }
        }
      },
      async selectedPicture(row) {
        await this.$tip.success()
        this.$refs.dialog.close()
        this.$emit('setPicture', row, this.type)
        this.$emit('setPicture', row)
      }
    }
  }