<template>
    <div>
      <PageQuery :table_name="table_name" ref="page_query" :page_size="10" :query_code="query_code" :filter_data="filter_data">
        <template v-slot:soltSearchBar>
          <div class="soltSearchBar" style="background: white;">
            <el-select style="width: 200px;margin-left:0px;" size="mini" filterable clearable v-model="select_app_id" placeholder="请选择应用">
              <el-option v-for="app in app_infos" :key="app.flame_id" :label="app.app_name" :value="app.flame_id"></el-option>
            </el-select>
            <el-button type="primary" class="bt_search" @click="clickSearch" size="mini" icon="el-icon-search">查询</el-button>
            <el-button type="primary" size="mini" class="bt_search" @click="clickClear" icon="el-icon-search">清除</el-button>
          </div>
        </template>
      </PageQuery>
  </div>
</template>

<script>
import system from '../../api/system.js';
export default {
  name: 'Page-one',
  data() {
    return {
      table_name: 'sys_user_token',
      filter_data: {},
      is_visbile_new: true,
      dialog_new: false,
      query_code: 'report_config',
      app_infos: [],
      select_app_id: null
    };
  },
  mounted() {
    let that = this;
    system.allSearch('sys_app', {}, res => {
      if (res.result === true) {
        that.app_infos = res.items;
        console.log('app_infos:', that.app_infos);
      }
    });
  },
  methods: {
    clickNew() {
      let that = this;
      that.dialog_new = true;
    },
    clickSearch() {
      let that = this;
      let filter_data = {};
      filter_data.app_id = that.select_app_id;
      console.log('filter_data', filter_data);
      that.$refs.page_query.searchClick(filter_data);
      // console.log('filter_data',filter_data)
    },
    clickClear() {
      let that = this;
      that.select_app_id = '';
    },
    newDiaglogClose(value) {
      let that = this;
      that.dialog_new = false;
    }
  }
};
</script>

<style></style>
