<template>
    <el-container>
        <el-header>
            <div class="left-panel">
                <!-- <el-button type="primary" @click="handleAdd">新增</el-button> -->
            </div>
            <div class="right-panel">
                <el-input
                    v-model="query.search"
                    placeholder="关键词"
                    clearable
                    @keyup.enter="$refs.table.refresh()"
                ></el-input>
                <el-button
            type="primary"
            icon="el-icon-search"
            @click="handleQuery"
          ></el-button>
            </div>

        </el-header>
        <el-main class="nopadding">
            <scTable
            ref="table"
            :apiObj="API.asm.asset.list"
            row-key="id"
            stripe
            :query="query"
            @row-click="(row)=>{t_id=row.id;mode='show';drawerVisible=true;}"
            >
            <el-table-column label="资产ID" prop="id" width="200" show-overflow-tooltip></el-table-column>
            <el-table-column label="固定资产名称" prop="name" width="200" show-overflow-tooltip></el-table-column>
            <el-table-column label="规格型号" prop="specification" width="200" show-overflow-tooltip></el-table-column>
            <el-table-column label="资产类别" prop="cate_name" width="100" show-overflow-tooltip></el-table-column>
            <el-table-column label="使用状态" prop="state" width="100" show-overflow-tooltip></el-table-column>
            <el-table-column label="数量" prop="quantity" width="100" show-overflow-tooltip></el-table-column>
            <el-table-column label="计量单位" prop="unit" width="100" show-overflow-tooltip></el-table-column>
            <el-table-column label="启用日期" prop="start_date" width="100" show-overflow-tooltip></el-table-column>
            <el-table-column label="保管部门" prop="keep_dept_name" width="120" show-overflow-tooltip></el-table-column>
            <el-table-column label="保管人" prop="keeper_name" width="100" show-overflow-tooltip></el-table-column>
            <el-table-column label="存放地点" prop="location" show-overflow-tooltip></el-table-column>
            </scTable>
        </el-main>
    </el-container>
    <!-- <el-drawer title="固定资产分类" v-model="drawerVisible" :size="'80%'" destroy-on-close>
        <assetcate-form :mode="mode" :t_id="t_id" @success="drawerVisible=false;$refs.table.refresh()"></assetcate-form>
    </el-drawer> -->
</template>
<script setup>
import { ref } from 'vue'
import API from '@/api'
// import assetcateForm from './assetcate_form.vue'
import { actStateEnum, interveneTypeEnum } from "@/utils/enum.js";
const query = ref({});
const drawerVisible = ref(false);
const mode = ref('add');
const t_id = ref(null);
const handleAdd = () => {
    mode.value = 'add';
    drawerVisible.value = true;
}
</script>