<template>
  <div class="page-box" v-loading="Loading.tableLoading">
    <tablePagination
      v-if="apiColumns_Table"
      :currenButtonData="currenButtonData"
      :tableData="tableData"
      :tableLoading="Loading.tableLoading"
      :tableColumns="apiColumns_Table"
      @rowDrop="rowDrop"
      :totalCount="totalCount"
      :multipleSelection="multipleSelection"
      :MaxResultCount="PageListParams.MaxResultCount"
      @topbutton="topbutton"
      @inlineDialog="inlineDialog"
      @sortChange="sortChange"
      @alertoldSkipCount="alertoldSkipCount"
      @alterResultCount="alterResultCount"
      @handleSelectionChange="handleSelectionChange"
      :currentPageProps="oldSkipCount"
      :quicklySearchOption="quicklySearchOption"
      @quicklySearchClick="quicklySearchClick"
      @quicklySearchClear="quicklySearchClear"
      :primarySearchOption="primarySearchOption"
      @overallSearchFormClick="overallSearchFormClick"
      :httpOverallSearchData="httpOverallSearchData"
      @buttonOperationClick_left="buttonOperationClick_left"
      :buttonOperationList_left="buttonOperationClick_leftBase"
      :buttonOperationList_right="buttonOperationList_rightBase"
      @buttonOperationClick_right="buttonOperationClick_right"
    ></tablePagination>
    <curren-Drawer
      ref="currenDrawer_Ref"
      :title="apiColumns_DesTions"
      @rowDrop="rowDrop"
      :tableColumns="apiColumns_DetailsTable"
      :tabsDesTions="apiColumns_DesTions"
      :DrawerLoading="Loading.DrawerLoading"
      :drawer="displayDialog.detailsDialog"
      :dropdownData="dropdownData"
      :propsData="propsData"
      :detailSearchDataFE="detailSearchDataFE"
      @drawerShut="(val) => (displayDialog.detailsDialog = val)"
      @drawerbutton="drawerbutton"
      @handleCommand="drawerHandle"
      @close-value="closeValue"
      :totalCount="totalCountDetails"
      :currentPage="oldSkipCountDetails"
      :MaxResultCount="MaxResultCountDetails"
      @alterResultCountDetails="alterResultCountDetails"
      @alertoldSkipCountDetails="alertoldSkipCountDetails"
      :buttonOperationList_left="operationButtonsDetail"
    ></curren-Drawer>
    <!-- 新增与编辑 -->
    <newAndEdiDialog
      :loading="Loading.newAndEdiLoading"
      :active="active"
      :pageStatus="pageStatus"
      :formReveal="formReveal"
      :formTitle="formTitle"
      :displayDialog="editDialog"
      :FormData="formReveal ? CreateFormData : editFormData"
      :Form="formReveal ? CreateForm : editForm"
      :Options="editOptions"
      :Handle="editHandle"
      :Rules="formReveal ? editRules.cerateRule : editRules.editRule"
      @FormSubmit="FormSubmit"
      @close="FormClose"
      @goBack="goBack"
    ></newAndEdiDialog>
    <!-- 明细查询页面 -->
    <filterForDetailPage
      v-if="filterForDetailShow"
      :parentColumns="apiColumns_Table"
      @closeDialog="changeFilterForDetailShow"
    ></filterForDetailPage>
    <!-- DeleteApi="TestSchoolDetailList_delete" -->
    <!-- todo: 明细查询中的parentColumns 是否需要独立表头，现与列表页面一致-->
    <!-- 导出弹窗 -->
    <exportDrop 
      v-if="displayDialog.exportDialog"
      @closeDialog="closeExportDrop"
      @exportDropSubmit="exportDropSubmit"
    ></exportDrop>
  </div>
</template>
<script>
import { tableMixins } from "@/mixins/TableMixins";
import { LoadingMixins } from "@/mixins/LoadingMixins";
import { drawerMixins } from "@/mixins/drawerMixins"
import { TableHeaderMixins } from "@/mixins/TableHeaderMixins";
import { newAndEdiDialogMixins } from "@/mixins/newAndEdiDialogMixins"
import { mixins } from "@/mixins/mixins";
import { filterSelectMixins } from '@/mixins/filter-Select'
import { getToken } from '@/utils/auth'
// import  * as tableColumns_api from "@/utils/tableColumns_api/index" //全局从接口缓存的表头
// import  * as tabsDesTions_api from "@/utils/tabsDesTions_api/index" //全局从接口缓存的详情
// import  * as detailsTableColumns_api from "@/utils/detailsTableColumns_api/index" //全局从接口缓存的列表-明细
// import  * as detailsPageColumns_api from "@/utils/detailsPageColumns_api/index" //全局从接口缓存的明细列表

export default {
  name: "TestSchool",
  mixins: [
    tableMixins,
    LoadingMixins,
    drawerMixins,
    TableHeaderMixins,
    mixins,
    filterSelectMixins,
    newAndEdiDialogMixins
  ],
  computed: {
    editDialog: {
      get: function () {
        return this.displayDialog.newDialog || this.displayDialog.editDialog;
      },
    },
  },
  data() {
    return {
      //常用按钮数据
      currenButtonData: [
        this.defaultAddBtn(),//新增
        this.defaultExportBtn({
          isRedundance:true,
          isDetailExport:true
        }),//导出
        this.defaultFieldSettingBtn(),//字段设置
        this.defaultFreshBtn(),//刷新
        this.defaultFilterBtn(),//筛选
        this.defaultFilterForDetailBtn()//明细查询按钮
      ],
      //新增数据
      CreateFormData: {
        schoolName:null,
        orderType:null,
        details:null,
        details: [
          {
              "lastModifierId": "ad731144-d789-f322-fede-327cac55dd36",
              "creationTime": "1978-07-18T22:00:37.5Z",
              "creatorId": "19e78d1b-6203-8d6d-b6e7-ae5b503c0824",
              "id": "5926ec25-2132-ba25-6b93-e453c17f00e2",
              "studentName": "张三0712",
              "orderType": 712,
              "masterId": "a044e2c6-3bc6-7cdd-55a6-f1a2a9682ccb",
              "lastModificationTime": "1946-12-30T14:22:31.982Z"
          },
        ],
      },
      //编辑数据
      editFormData: {
        id:null,
        schoolName:null,
        orderType:null,
        details:null,
      },
      // 新增配置
      CreateForm: [
        { type: "input", label: '名称', prop: 'schoolName', colSpan: 12 },
        { type: "input", label: 'orderType', prop: 'orderType', colSpan: 12 },
      ],
      // 编辑配置
      editForm: [
        { type: "input", label: '名称', prop: 'schoolName', colSpan: 12 },
        { type: "input", label: 'orderType', prop: 'orderType', colSpan: 12 },
      ],
      editOptions: {},
      editRules: {
        cerateRule: {
          schoolName: [{ required: true, trigger: "blur", message: "不可为空" }],
        },
        editRule: {
          schoolName: [{ required: true, trigger: "blur", message: "不可为空" }],
        }
      },
    };
  },
  mounted() {
    // 如果使用动态api(全局进入时候获取情况)
    // this.initApiColumns(tableColumns_api,tabsDesTions_api,detailsTableColumns_api,detailsPageColumns_api)
    this.paging();
  },
}
</script>
<style lang="scss" scoped>
@import "@/styles/basicData.scss";
</style>