<template>
  <div class="div">
    <div>我是微前端的测试页面</div>
    <div>我是传过来的参数:{{ params.data }}</div>
    <div>{{ str }}</div>
    <h-button type="primary" @click="onClick">点我</h-button>
    <!-- <div style="width: 1000px">
      <h-b-button-group v-bind="menuProps" ref="menuRef" id="OrganizationPag" />
    </div> -->
  </div>
</template>

<script lang="ts">
import { defineComponent, reactive, ref } from 'vue';
import { HModal } from '@crami/ui';
import { useButtonGroup } from '@crami/bui-platform';
import { commonApi } from '@remote/icpx-platform/commonApi';
/* import { commonApi } from '@/api/commonApi/index'; */

export default defineComponent({
  name: 'TEST',
  components: {},
  setup() {
    const str = ref('hhhhh');
    let params = reactive({
      data: '我没有获取参数',
    });
    try {
      if (window.$wujie) {
        params = window.$wujie?.props;
      }
    } catch (error) {}

    const [menuRef, menuProps, { getRowMenu }] = useButtonGroup({
      sortRule: 'default',
      pageName: 'OrganizationPage',
      checkPermission: false,
      dataSourceApi: {
        url: commonApi().studioCache.getMetaInfo.url,
        params: {
          ...commonApi().studioCache.getMetaInfo.params,
          ...{
            type: 'menuv2',
            name: 'P_SYS_ORG_MENU', //commonParams.value?.menuName,
          },
        },
        method: commonApi().studioCache.getMetaInfo.method,
      },
    });
    const onClick = () => {
      HModal.confirm({ title: '提示', content: 'hello' });
    };
    return { str, params, menuRef, menuProps, onClick };
  },
});
</script>

<style lang="less" scoped>
.div {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}
</style>
