import { defineComponent, ref, onBeforeUpdate, openBlock, createBlock, unref } from "vue";
import { aG as useFormStore, af as generateReportHtml, a9 as defHttp } from "./index-BkxFjINf.js";
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "Demo",
  props: {
    data: {
      type: Object,
      default: []
    }
  },
  setup(__props) {
    const formStore = useFormStore();
    let list = ref(formStore.formData.config.eventScript);
    const { eventScript, baseScript, ...restConfig } = formStore.formData.config;
    let vue3Script = ref({
      importScript: "",
      //import导入
      variableScript: "",
      //变量
      contentScript: ""
      //ts内容
    });
    const generateData = generateReportHtml(formStore.formData.list, restConfig, vue3Script), columns = JSON.parse(generateData.columns), searchInfo = generateData.searchData;
    onBeforeUpdate(() => {
    });
    const generateVue3 = defineComponent({
      template: generateData.html,
      props: {},
      setup() {
        let viewData = ref({});
        const events = {};
        return generateTs(), {
          // formData,
          // formRef,
          search,
          searchInfo,
          // defineExpose,
          // paginations,
          // dataSource,
          // datalist,
          columns,
          viewData,
          // initTable,
          ...events,
          defHttp,
          onChange
        };
        function search() {
        }
        function onChange(e) {
        }
        function generateTs() {
          for (let e = 0; e < list.value.length; e++) {
            const t = list.value[e];
            events[t.name] = newFunction(t);
          }
        }
        function newFunction(_data) {
          return _data.param != "" ? (_params) => {
            eval(_data.func);
          } : () => {
            eval(_data.func);
          };
        }
      }
    });
    return (e, t) => (openBlock(), createBlock(unref(generateVue3)));
  }
});
export {
  _sfc_main as default
};
