<template>
  <div class="flex items-center query-head">
    <el-space alignment="center" :size="30">
      <el-input
        v-model="queryStr"
        :style="{ width: '300px' }"
        placeholder="请输入搜索内容"
        :prefix-icon="Search"
      />
    </el-space>
    <div class="flex-1 flex">
      <el-button type="primary" style="margin-left: 15px" @click="getUserGroup">
        搜索
      </el-button>
      <el-button style="margin-left: 15px" @click="resetSearch">
        重置
      </el-button>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { Search } from '@element-plus/icons-vue';
import userGroupList from '../store/index';
import { storeToRefs } from 'pinia';
const userGroup = userGroupList();
const { queryStr } = storeToRefs(userGroup);
const { getUserGroup } = userGroup;
const resetSearch = () => {
  queryStr.value = '';
  getUserGroup();
};
</script>

<style lang="scss" scoped>
</style>