<template>
  <view class="company-select-page">
    <view class="search-header">
      <view class="search-box">
        <text class="icon-search"></text>
        <input type="text" v-model="searchQuery" placeholder="搜索公司名称" placeholder-style="color: #A0AABF;" />
      </view>
    </view>

    <scroll-view class="company-list" scroll-y>
       <view class="company-item" v-for="(item, index) in filteredList" :key="index" @tap="toggleSelect(item)">
          <text class="company-name">{{ item.name }}</text>
          <view :class="['checkbox', item.selected ? 'checked' : '']"></view>
       </view>
       
       <view class="empty-state" v-if="filteredList.length === 0">
           <text class="empty-text">未找到相关公司</text>
       </view>
    </scroll-view>

    <view class="footer-btn-area">
      <button class="btn-confirm" @tap="confirmSelection">确定</button>
    </view>
  </view>
</template>

<script src="./company-select.js"></script>

<style lang="scss" scoped>
@import './company-select.scss';
</style>
