<template>
  <div class="conbtainer">
    <lu-saas-table
      :tableData="data"
      :tableColumns="columns"
      :dictionary="dictionary"
    >
      <div slot="location" slot-scope="params">
        {{ params.data.location }}
      </div>
      <div slot="action" slot-scope="params">
        <lu-button @click="test(params.data.location)" type="text" size="small">
          设置
        </lu-button>
      </div>
    </lu-saas-table>
  </div>
</template>

<script>
import luSaasTable from "@/packages/lu/lu-saas-table";
export default {
  data() {
    return {
      columns: [
        {
          prop: "code",
          label: "机器码",
          type: "default"
        },
        {
          prop: "status",
          label: "状态",
          type: "choice"
        },
        {
          prop: "img1",
          label: "图片",
          type: "image",
          showImage: true,
          width: 50,
          height: 20
        },
        {
          prop: "img",
          label: "图片",
          type: "image"
        },
        {
          prop: "location",
          label: "位置",
          type: "custom",
          custom_name: "location"
        },
        {
          prop: "action",
          label: "操作",
          type: "custom",
          custom_name: "action",
          width: 200
        }
      ],
      data: [
        {
          code:
            "就东方斯卡拉放假了阿健发隆盛科技福利卡金风科技啊饭卡放假案例就对啦时间到了捡垃圾达拉斯加发链接酸辣粉机卡视角了大口径链接啦",
          status: 0,
          img:
            "https://static.changjinglu.net/YXJtYW5pLzIwMTkwNzA4LzVkMjJiYjViYTE4YTUuanBn",
          img1:
            "https://static.changjinglu.net/YXJtYW5pLzIwMTkwNzA4LzVkMjJiYjViYTE4YTUuanBn",
          location: "浙江省杭州市拱墅区"
        }
      ],
      dictionary: {
        status: {
          0: "正常",
          1: "不正常"
        }
      }
    };
  },
  components: {
    luSaasTable
  },
  methods: {
    test(val) {
      console.log(val);
    }
  }
};
</script>

<style></style>
