import 'antd/es/button/style';
import _Button from 'antd/es/button';
import 'antd/es/space/style';
import _Space from 'antd/es/space';
import { a as __spreadArray, f as __rest, d as __assign } from './index.js';
import { mchcEvent } from '@lm_fe/env';
import { MyBaseList, config_table_fd, mchcModal__ } from '@lm_fe/pages';
import React__default, { useEffect } from 'react';
import MyConfigTable from './pages.config-table.list.js';
import MyConfigPanel from './pages.config-table.panel.js';
import { u as useHistory } from './react-router.js';
import 'antd/es/tabs/style';
import 'antd/es/tabs';
import 'lodash/size';
import 'lodash/get';
import '@lm_fe/utils';
import 'lodash/orderBy';
import 'lodash/map';
import '@lm_fe/components';
import 'antd/es/collapse/style';
import 'antd/es/collapse';
import 'antd/es/badge/style';
import 'antd/es/badge';
import 'lodash/assign';
import '@ant-design/icons';
import '@lm_fe/components_m';
import '@lm_fe/service';
import './extends.js';
import './utils.js';
import 'antd/es/message/style';
import 'antd/es/message';
import 'antd/es/form/style';
import 'antd/es/form';
import './hoist-non-react-statics.cjs.js';
import 'history';
var index = function index(props) {
  useHistory();
  useEffect(function () {
    var rm = mchcEvent.on_rm('my_form', function (event) {
      console.log('globalEvent', event);
      if (event.type === 'onChange') {
        event.name;
        event.value;
      }
      if (event.type === 'onClick') {
        if (event.btnName) ;
      }
    });
    return rm;
  }, []);
  return /*#__PURE__*/React__default.createElement("div", null, /*#__PURE__*/React__default.createElement(MyBaseList, {
    size: "small",
    showExport: true,
    showPrint: true,
    searchParams: {},
    initialSearchValue: {},
    RenderBtns: function RenderBtns() {
      return /*#__PURE__*/React__default.createElement("div", null, "\u8BF7\u4E0D\u8981\u518D\u8BBE\u7F6E\u63A5\u53E3\u524D\u7F00!!\u5982\u679C\u6253\u5F00\u7A7A\u767D\uFF0C\u8BF7\u8BBE\u7F6E\u5BF9\u5E94\u7684\u83DC\u5355\u6743\u9650");
    },
    searchConfig: [{
      inputType: 'MyInput',
      label: '名称',
      name: 'title'
    }, {
      inputType: 'MyInput',
      label: '接口路径',
      name: 'name'
    }, {
      inputType: 'MyInput',
      label: '模块',
      name: 'type'
    }],
    baseTitle: "\u6885\u6BD2\u611F\u67D3\u5B55\u4EA7\u5987\u767B\u8BB0\u5361",
    name: "/tableConfig",
    tableColumns: __spreadArray(__spreadArray([], config_table_fd(props), true), [{
      title: '预览',
      dataIndex: 'id',
      render: function render(value, record) {
        return /*#__PURE__*/React__default.createElement(_Space, null, /*#__PURE__*/React__default.createElement("a", {
          target: "blank",
          onClick: function onClick() {
            return mchcModal__.open('test', {
              modal_data: {
                content: /*#__PURE__*/React__default.createElement(MyConfigPanel, {
                  configId: value,
                  id: 1
                })
              },
              width: '90vw',
              title: record.title
            });
          }
        }, "\u8868\u5355"), /*#__PURE__*/React__default.createElement("a", {
          target: "blank",
          onClick: function onClick() {
            return mchcModal__.open('test', {
              modal_data: {
                content: /*#__PURE__*/React__default.createElement(MyConfigTable, {
                  configId: value
                })
              },
              width: '90vw',
              title: record.title
            });
          }
        }, "\u8868\u683C"));
      }
    }], false),
    modalFormConfig: {
      width: "96vw",
      bodyStyle: {
        height: '80vh',
        overflowY: 'scroll'
      },
      modal_data: {
        modalFormSize: 'small'
      }
    },
    requestBeforeEdit: true,
    ActionAddonBefore: function ActionAddonBefore(_a) {
      var rowData = _a.rowData,
        createOrUpdate = _a.createOrUpdate;
      rowData.id;
      var newData = __rest(rowData, ["id"]);
      return /*#__PURE__*/React__default.createElement(_Button, {
        size: "small",
        onClick: function onClick() {
          createOrUpdate(__assign(__assign({}, newData), {
            title: "".concat(newData.title, "-\u590D\u5236")
          }));
        }
      }, "\u590D\u5236");
    }
  }), /*#__PURE__*/React__default.createElement("div", {
    style: {
      margin: 12
    }
  }));
};
export { index as default };
//# sourceMappingURL=src.pages.config-table.js.map
