<!--在线服务 -->
<template>
  <div style="position: relative">
    <div class="topBox">
      <div class="title">在线服务</div>
    </div>
    <div class="tableBox" :style="{ height: tableHeight }">

      <el-form ref="myDataSetPage" :model="myDataSetPage" label-width="75px" :size="defaultFormItemSize" label-position="right" @submit.native.prevent>
        <filter-box :item-width="350" @search="search()" @reset="onReset">
          <el-form-item label-width="0px">
            <el-button class="add" type="primary" icon="el-icon-plus" :size="defaultFormItemSize">创建服务</el-button>
          </el-form-item>
          <el-form-item label="数据集名称" prop="formFilter.dataName" label-width="120px">
            <el-input class="filter-item" v-model="myDataSetPage.formFilter.dataName" :clearable="true" placeholder="请输入服务名称" />
          </el-form-item>
        </filter-box>
      </el-form>
      <vxe-table border show-header-overflow show-overflow :row-config="{ isHover: true }" :data="tableData" min-height="96">
        <vxe-column field="serviceName" title="服务名称"></vxe-column>
        <vxe-column field="serviceState" title="服务状态"></vxe-column>
        <vxe-column field="modelNameAndVersion" title="模型名称及版本"></vxe-column>
        <vxe-column field="callUnitPrice" title="调用单价"></vxe-column>
        <vxe-column field="resourcePool" title="资源池"></vxe-column>
        <vxe-column field="creationTime" title="更新时间"></vxe-column>
        <vxe-column field="turnoverTime" title="操作">
          <!-- <template slot-scope="scope">
              <el-button
                type="text"
                :size="defaultFormItemSize"
                @click="dataImport(scope.row)"
                >导入</el-button
              >
              <el-button
                type="text"
                :size="defaultFormItemSize"
                @click="del(scope.row)"
                >删除</el-button
              >
            </template> -->
        </vxe-column>
      </vxe-table>
    </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
export default {
  data() {
    return {
      myDataSetPage: {
        formFilter: {
          dataName: ''
        }
      },
      tableData: [
        {
          id: 10001,
          name: 'Test1',
          role: 'Develop',
          sex: 'Man',
          age: 28,
          address: 'test abc'
        }
      ]
    }
  },

  components: {},

  computed: {
    ...mapGetters(['getMainContextHeight']),
    tableHeight() {
      return this.getMainContextHeight - 110 + 'px'
    }
  },

  mounted() {},

  methods: {
    resize(e) {
      setTimeout(() => {
        this.collapseHeight = e.height
      }, 300)
    }
  }
}
</script>
<style lang="scss" scoped>
@import '@/assets/style/element-variables.scss';
.topBox {
  background-color: white;
  width: 100%;

  margin-bottom: 16px;
  .title {
    color: $--color-text-primary;
    font-size: 16px;
    font-weight: 500;

    padding: 20px 20px 20px 20px;
  }
}

.tableBox {
  background-color: white;
  width: 100%;
  padding: 20px;
  overflow: auto;
  .add {
    margin-bottom: 20px;
  }
}
</style>
