<template>
  <w-grid
    ref="gridRef"
    title="特征变量稳定性分析报表"
    dense
    :config-button="true"
    :checkbox-selection="false"
    :pageable="false"
    :toolbar-configure="{ noIcon: false }"
    :toolbar-actions="[
      {
        extend: 'query',
        click: () => {
          const model = gridRef.getQueryForm().getFieldValue('model');
          const year = gridRef.getQueryForm().getFieldValue('year');
          const month = gridRef.getQueryForm().getFieldValue('month');
          console.log(model, year, month);
          if (model === 'A评分卡' && year === 2023 && month === 6) {
            gridRef.setLocalData(data);
          } else {
            gridRef.setLocalData([]);
          }
        },
      },
      'refresh',
      'separator',
      'export',
    ]"
    :query-form-cols-num="6"
    :query-form-fields="[
      { colSpan: 2, name: 'model', label: '模型', type: 'select', options: ['A评分卡', 'B评分卡', 'K评分卡'], defaultValue: 'A评分卡', clearable: true },
      { name: 'year', label: '年', type: 'select', options: [2020, 2021, 2022, 2023, 2024], defaultValue: 2023, clearable: true },
      { name: 'month', label: '月', type: 'select', options: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], defaultValue: 6, clearable: true },
    ]"
    :columns="[
      { width: 200, name: 'tzl', label: '特征量' },
      { name: 'fxbq', label: '分箱标签' },
      { name: 'kfjzz', label: '开发基准值%' },
      { name: 'bs', label: '笔数' },
      { name: 'sjfscsbfb', label: '实际发生次数百分比%' },
      { name: 'bgbfb', label: '变更百分比%' },
      { name: 'fxpf', label: '分箱的评分' },
      { name: 'pfcz', label: '评分差值' },
      { name: 'zrdsbgbl', label: '自然对数(变更比率)%' },
      { name: 'wdxgxzs', label: '稳定性贡献指数' },
    ]"
  >
  </w-grid>
</template>
<script setup lang="ts">
import { onMounted, ref } from 'vue';

const gridRef = ref();
const data = [
  { tzl: '主要业务开展时长', fxbq: '(15, )', kfjzz: '0%', bs: '0', sjfscsbfb: '0%', bgbfb: '0%', fxpf: '0', pfcz: '0', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '主要业务开展时长', fxbq: '(10, 15]', kfjzz: '0%', bs: '0', sjfscsbfb: '0%', bgbfb: '0%', fxpf: '0', pfcz: '0', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '主要业务开展时长', fxbq: '(5,10]', kfjzz: '0%', bs: '0', sjfscsbfb: '0%', bgbfb: '0%', fxpf: '0', pfcz: '0', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '主要业务开展时长', fxbq: '( ,5]', kfjzz: '0%', bs: '0', sjfscsbfb: '0%', bgbfb: '0%', fxpf: '0', pfcz: '0', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '小计', fxbq: '-', kfjzz: '-', bs: '-', sjfscsbfb: '-', bgbfb: '-', fxpf: '-', pfcz: '-', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '背景支持', fxbq: '大企业', kfjzz: '0%', bs: '0', sjfscsbfb: '0%', bgbfb: '0%', fxpf: '0', pfcz: '0', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '背景支持', fxbq: '小型', kfjzz: '0%', bs: '0', sjfscsbfb: '0%', bgbfb: '0%', fxpf: '0', pfcz: '0', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '背景支持', fxbq: '其他', kfjzz: '0%', bs: '0', sjfscsbfb: '0%', bgbfb: '0%', fxpf: '0', pfcz: '0', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '小计', fxbq: '-', kfjzz: '-', bs: '-', sjfscsbfb: '-', bgbfb: '-', fxpf: '-', pfcz: '-', zrdsbgbl: '0%', wdxgxzs: '0%' },
  {
    tzl: '技术实力',
    fxbq: '先进',
    kfjzz: '0%',
    bs: '0',
    sjfscsbfb: '0%',
    bgbfb: '0%',
    fxpf: '0',
    pfcz: '0',
    zrdsbgbl: '0%',
    wdxgxzs: '0%',
  },
  { tzl: '技术实力', fxbq: '一般', kfjzz: '0%', bs: '0', sjfscsbfb: '0%', bgbfb: '0%', fxpf: '0', pfcz: '0', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '技术实力', fxbq: '落后', kfjzz: '0%', bs: '0', sjfscsbfb: '0%', bgbfb: '0%', fxpf: '0', pfcz: '0', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '小计', fxbq: '-', kfjzz: '-', bs: '-', sjfscsbfb: '-', bgbfb: '-', fxpf: '-', pfcz: '-', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '行内授信投向政策', fxbq: '扶持类', kfjzz: '0%', bs: '0', sjfscsbfb: '0%', bgbfb: '0%', fxpf: '0', pfcz: '0', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '行内授信投向政策', fxbq: '适度支持类', kfjzz: '0%', bs: '0', sjfscsbfb: '0%', bgbfb: '0%', fxpf: '0', pfcz: '0', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '行内授信投向政策', fxbq: '维持类', kfjzz: '0%', bs: '0', sjfscsbfb: '0%', bgbfb: '0%', fxpf: '0', pfcz: '0', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '行内授信投向政策', fxbq: '限制类或禁止类', kfjzz: '0%', bs: '0', sjfscsbfb: '0%', bgbfb: '0%', fxpf: '0', pfcz: '0', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '小计', fxbq: '-', kfjzz: '-', bs: '-', sjfscsbfb: '-', bgbfb: '-', fxpf: '-', pfcz: '-', zrdsbgbl: '0%', wdxgxzs: '0%' },
  {
    tzl: '企业征信信用历史',
    fxbq: '正常类',
    kfjzz: '0%',
    bs: '0',
    sjfscsbfb: '0%',
    bgbfb: '0%',
    fxpf: '0',
    pfcz: '0',
    zrdsbgbl: '0%',
    wdxgxzs: '0%',
  },
  { tzl: '企业征信信用历史', fxbq: '关注类', kfjzz: '0%', bs: '0', sjfscsbfb: '0%', bgbfb: '0%', fxpf: '0', pfcz: '0', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '企业征信信用历史', fxbq: '不良类', kfjzz: '0%', bs: '0', sjfscsbfb: '0%', bgbfb: '0%', fxpf: '0', pfcz: '0', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '企业征信信用历史', fxbq: '不良贷款未还清', kfjzz: '0%', bs: '0', sjfscsbfb: '0%', bgbfb: '0%', fxpf: '0', pfcz: '0', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '小计', fxbq: '-', kfjzz: '-', bs: '-', sjfscsbfb: '-', bgbfb: '-', fxpf: '-', pfcz: '-', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '负债利润倍数', fxbq: '(0,6]', kfjzz: '0%', bs: '0', sjfscsbfb: '0%', bgbfb: '0%', fxpf: '0', pfcz: '0', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '负债利润倍数', fxbq: '(6,12]', kfjzz: '0%', bs: '0', sjfscsbfb: '0%', bgbfb: '0%', fxpf: '0', pfcz: '0', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '负债利润倍数', fxbq: '(12,24]', kfjzz: '0%', bs: '0', sjfscsbfb: '0%', bgbfb: '0%', fxpf: '0', pfcz: '0', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '负债利润倍数', fxbq: '(24,70]', kfjzz: '0%', bs: '0', sjfscsbfb: '0%', bgbfb: '0%', fxpf: '0', pfcz: '0', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '负债利润倍数', fxbq: '(70,)', kfjzz: '0%', bs: '0', sjfscsbfb: '0%', bgbfb: '0%', fxpf: '0', pfcz: '0', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '小计', fxbq: '-', kfjzz: '-', bs: '-', sjfscsbfb: '-', bgbfb: '-', fxpf: '-', pfcz: '-', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '货币资金负债比', fxbq: '(0,0.04]', kfjzz: '0%', bs: '0', sjfscsbfb: '0%', bgbfb: '0%', fxpf: '0', pfcz: '0', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '货币资金负债比', fxbq: '(0.04,0.18]', kfjzz: '0%', bs: '0', sjfscsbfb: '0%', bgbfb: '0%', fxpf: '0', pfcz: '0', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '货币资金负债比', fxbq: '(0.18,0.35]', kfjzz: '0%', bs: '0', sjfscsbfb: '0%', bgbfb: '0%', fxpf: '0', pfcz: '0', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '货币资金负债比', fxbq: '(0.35,)', kfjzz: '0%', bs: '0', sjfscsbfb: '0%', bgbfb: '0%', fxpf: '0', pfcz: '0', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '小计', fxbq: '-', kfjzz: '-', bs: '-', sjfscsbfb: '-', bgbfb: '-', fxpf: '-', pfcz: '-', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '资本积累率', fxbq: '(0.04,0.17)', kfjzz: '0%', bs: '0', sjfscsbfb: '0%', bgbfb: '0%', fxpf: '0', pfcz: '0', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '资本积累率', fxbq: '(0.17,0.4]', kfjzz: '0%', bs: '0', sjfscsbfb: '0%', bgbfb: '0%', fxpf: '0', pfcz: '0', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '资本积累率', fxbq: '(0.4,)', kfjzz: '0%', bs: '0', sjfscsbfb: '0%', bgbfb: '0%', fxpf: '0', pfcz: '0', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '小计', fxbq: '-', kfjzz: '-', bs: '-', sjfscsbfb: '-', bgbfb: '-', fxpf: '-', pfcz: '-', zrdsbgbl: '0%', wdxgxzs: '0%' },
  {
    tzl: '净资产收益率(ROE)',
    fxbq: '(,0.04]',
    kfjzz: '0%',
    bs: '0',
    sjfscsbfb: '0%',
    bgbfb: '0%',
    fxpf: '0',
    pfcz: '0',
    zrdsbgbl: '0%',
    wdxgxzs: '0%',
  },
  {
    tzl: '净资产收益率(ROE)',
    fxbq: '(0.04,0.1]',
    kfjzz: '0%',
    bs: '0',
    sjfscsbfb: '0%',
    bgbfb: '0%',
    fxpf: '0',
    pfcz: '0',
    zrdsbgbl: '0%',
    wdxgxzs: '0%',
  },
  {
    tzl: '净资产收益率(ROE)',
    fxbq: '(0.1,0.2]',
    kfjzz: '0%',
    bs: '0',
    sjfscsbfb: '0%',
    bgbfb: '0%',
    fxpf: '0',
    pfcz: '0',
    zrdsbgbl: '0%',
    wdxgxzs: '0%',
  },
  {
    tzl: '净资产收益率(ROE)',
    fxbq: '(0.2,0.5]',
    kfjzz: '0%',
    bs: '0',
    sjfscsbfb: '0%',
    bgbfb: '0%',
    fxpf: '0',
    pfcz: '0',
    zrdsbgbl: '0%',
    wdxgxzs: '0%',
  },
  {
    tzl: '净资产收益率(ROE)',
    fxbq: '(0.5,]',
    kfjzz: '0%',
    bs: '0',
    sjfscsbfb: '0%',
    bgbfb: '0%',
    fxpf: '0',
    pfcz: '0',
    zrdsbgbl: '0%',
    wdxgxzs: '0%',
  },
  { tzl: '小计', fxbq: '-', kfjzz: '-', bs: '-', sjfscsbfb: '-', bgbfb: '-', fxpf: '-', pfcz: '-', zrdsbgbl: '0%', wdxgxzs: '0%' },
  {
    tzl: '应收账款和存货的账期表现',
    fxbq: '(,70]',
    kfjzz: '0%',
    bs: '0',
    sjfscsbfb: '0%',
    bgbfb: '0%',
    fxpf: '0',
    pfcz: '0',
    zrdsbgbl: '0%',
    wdxgxzs: '0%',
  },
  {
    tzl: '应收账款和存货的账期表现',
    fxbq: '(70,140]',
    kfjzz: '0%',
    bs: '0',
    sjfscsbfb: '0%',
    bgbfb: '0%',
    fxpf: '0',
    pfcz: '0',
    zrdsbgbl: '0%',
    wdxgxzs: '0%',
  },
  {
    tzl: '应收账款和存货的账期表现',
    fxbq: '(140,210]',
    kfjzz: '0%',
    bs: '0',
    sjfscsbfb: '0%',
    bgbfb: '0%',
    fxpf: '0',
    pfcz: '0',
    zrdsbgbl: '0%',
    wdxgxzs: '0%',
  },
  {
    tzl: '应收账款和存货的账期表现',
    fxbq: '(210,400]',
    kfjzz: '0%',
    bs: '0',
    sjfscsbfb: '0%',
    bgbfb: '0%',
    fxpf: '0',
    pfcz: '0',
    zrdsbgbl: '0%',
    wdxgxzs: '0%',
  },
  { tzl: '应收账款和存货的账期表现', fxbq: '(400,+)', kfjzz: '0%', bs: '0', sjfscsbfb: '0%', bgbfb: '0%', fxpf: '0', pfcz: '0', zrdsbgbl: '0%', wdxgxzs: '0%' },
  { tzl: '小计', fxbq: '-', kfjzz: '-', bs: '-', sjfscsbfb: '-', bgbfb: '-', fxpf: '-', pfcz: '-', zrdsbgbl: '0%', wdxgxzs: '0%' },
];

onMounted(() => {
  //gridRef.value.setLocalData(data);
});
</script>
