<!-- 以下是SmartWeb生成代码，请勿修改！ -->
<!-- $page.title ($page.key) -->
<template>
  <fz-split-panel
          horizontal
  >
    <fz-form-panel
            :padding-x="5"
            :col-num="1"
            :padding-y="5"
    >
      <fx-tree
              ref="roleTree"
              class="sw-layout-col1"
              default-expand-all
              filter-show
              name="roleTree"
              filter-placeholder="角色"
              :toolbar-buttons="[{type:'fx-button',props:{leftIcon:'plus',type:'text',size:'mini',action:'add'},id:'id17cc9d01004'},{type:'fx-button',props:{leftIcon:'edit',type:'text',size:'mini',action:'add'},id:'id17cc9d01005'},{type:'fx-button',props:{leftIcon:'remove',type:'text',size:'mini',action:'remove'},id:'id17cc9d01006'}]"

              dataset="sysRole"

              @action="onAction('sysRole', $event)"
      />
    </fz-form-panel>
    <fz-form-panel
            :padding-x="5"
            :col-num="1"
            :padding-y="5"
    >
      <fx-tree
              ref="menuTree"
              class="sw-layout-col1"
              show-checkbox
              default-expand-all
              filter-show
              name="menuTree"
              filter-placeholder="菜单"
              :toolbar-buttons="[{type:'fx-button',props:{leftIcon:'plus',type:'text',size:'mini',action:'add'},id:'id17cc9d01013'},{type:'fx-button',props:{leftIcon:'edit',type:'text',size:'mini',action:'add'},id:'id17cc9d01014'},{type:'fx-button',props:{leftIcon:'remove',type:'text',size:'mini',action:'remove'},id:'id17cc9d01015'}]"

              dataset="sysMenu"

              @action="onAction('sysMenu', $event)"
      />
    </fz-form-panel>
    <fz-form-panel
            :padding-x="5"
            :col-num="1"
            :padding-y="5"
    />
  </fz-split-panel>
</template>

<script lang="ts">
  import { reactive } from "vue";
  import { usePageForm, usePageDatasets, usePage } from "sw-widget";
  import eventObject from "./events";

  export default {
    name: "PermPermList",
    props: {
      id: {
        type: String,
        default: "",
      },
    },
    setup(props) {
      // 数据集
      const datasets = null;

      // 界面定义
      const pageForm = usePageForm("637672244742459392");
      const params = { pageId: "637672244742459392" };

      // 数据集
      const event = Object.create(eventObject) as any;
      // const event = eventObject;

      const data: any = {};
      const pageDataset = usePageDatasets(pageForm, event.page);

      datasets.forEach((dataset: any) => {
        const datasetData = reactive({ list: { data: [], total: -1, loading: false }, form: {} });
        data[dataset.name] = datasetData;
        pageDataset.add(params, datasetData, dataset, event[dataset.name]);
      });

      // const refData = reactive(data);
      const p = usePage(params, pageDataset, event);
      if (event.create) {
        event.create({ pageDataset });
      }

      const onAction = (dataset, params: any) => {
        p.onAction({ type: "button", params });
      };

      const onEvent = (name, event, params: any) => {
        p.onAction({ type: "widget", name, event, params });
      };

      return {
        data,
        widgets,
        onAction,
        onEvent,
      };
    },
  };

</script>
<style lang="less">
  @import ~"/@/pages/page/page.less";
</style>

<!-- 554d90aaeb89f68bdac0202800f566d9ba8bb4987c8d63eb41a0e69194bd7aef,000008c0,08d977872f001000 -->
