<script setup name="AssetLibrary">
import { ref, toRefs, reactive, getCurrentInstance } from 'vue'
import QueryForm from './QueryForm.vue'

const data = reactive({
  form: {},
  queryParams: {
    customerName: null
  },
  rules: {
  }
})

const { queryParams, form, rules } = toRefs(data)

const onQuery = () => {
  console.log('onQuery')
  // handleQuery()
}
// 查询组件事件重置
const onReset = (formQuery) => {
  console.log('onReset')
  formQuery.resetFields()
}
</script>

<template>
  <div class="app-container scroller">
    <PageTitle>
      <template #title>
        <span id="badDebt" class="title-icon">
          资产库
          <PageTour tourType="badDebt" />
        </span>
      </template>
      <template #buttons>
        <el-button
          type="primary"
          icon="Plus"
        >新增数据源</el-button>
      </template>
    </PageTitle>
    <div class="app-container__body">
      <query-form
        ref="QueryFormRef"
        v-model="queryParams"
        @query="onQuery"
        @reset="onReset" />
        <el-scrollbar>
          <div class="flex-content">
            <el-card class="box-card" :body-style="{ padding: '0px !important' }">
              <img class="img" src="https://172.19.1.166:9005/static/img/MYSQL.535270a.png" alt="">
              <div class="title">
                <div class="title-content"></div>
              </div>
            </el-card>
          </div>
        </el-scrollbar>
    </div>
  </div>
</template>

<style lang="scss" scoped>
.flex-content{
  display: flex;
  .box-card{
    flex-shrink: 0;
    margin-right: 20px;
    height: 138px;
    width: 188px;
    border-radius: 10px;
    .img{
      width: 100%;
      border-radius: 10px 10px 0 0;
    }
    :deep(.el-card__body){
      display: flex;
      flex-direction: column;
    }
    .title{
      &-content{
        padding-left: 16px;
        padding-right: 16px;
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }
  }
  .box-card:last-child{
    margin-right: 0;
  }
}
</style>