import * as React from 'react'; import { DatePicker, message, Button, Radio, Dropdown, Menu, Icon, Row, Col, Tabs, Checkbox, Input, InputNumber, Select, Switch, TimePicker, TreeSelect, Upload, Table, Tooltip } from 'antd'; import electron from 'electron'; export class App extends React.Component{ constructor(props) { super(props); this.state = { date: "", size: "default", loading: false, iconLoading: false, current: '1', openKeys: [], theme: 'dark' }; console.log("App构造函数完成!!!!!!!!"); } getInitialState() { return { current: "mail", theme: 'dark' }; } handleChange(date) { message.info("您选择的日期是:" + date.toString()); this.setState({ date }); } handleSizeChange = (e) => { message.info("您选择的大小是:" + e.target.value); this.setState({ size: e.target.value }); } handleMenuClick(e): void { message.info("您选择的菜单是:" + e.target.value); } enterLoading() { this.setState({ loading: true }); } handleButtonClick(e) { } handleClick(e) { console.log('Clicked: ', e); this.setState({ current: e.key }); } onTabChanged(e) { } onOpenChange(openKeys) { const state = this.state; const latestOpenKey = openKeys.find(key => !(state.openKeys.indexOf(key) > -1)); const latestCloseKey = state.openKeys.find(key => !(openKeys.indexOf(key) > -1)); let nextOpenKeys = []; if (latestOpenKey) { nextOpenKeys = this.getAncestorKeys(latestOpenKey).concat(latestOpenKey); } if (latestCloseKey) { nextOpenKeys = this.getAncestorKeys(latestCloseKey); } this.setState({ openKeys: nextOpenKeys }); } getAncestorKeys(key) { const map = { sub3: ['sub2'], }; return map[key] || []; } onTabEdit(e) { } render() { let template: any[] = [ { label: "文件", submenu: [ { label: "新建项目", click: "" }, { type: "separator" }, { label: "打开文件", click: "" }, { type: "separator" }, { label: "保存", click: "" }, { type: "separator" }, { label: "退出", click: "" } ] } ]; var remote: Electron.Remote = require('electron').remote; RES.getResByUrl("assets/menu/menu.json", function (data: any): void { var _menu: Electron.Menu = remote.Menu.buildFromTemplate(data); remote.Menu.setApplicationMenu(_menu); }, this, RES.ResourceItem.TYPE_JSON); console.log("process type:", process.type); console.log("electron version:" + process.versions.electron); console.log("chrome version:", process.versions.chrome); console.log("resourcesPath:", process.resourcesPath); console.log("windowsStore:", process.windowsStore); console.log("cwd:", process.cwd); console.log("defaultApp", process.defaultApp); console.log("process memoryInfo:", process.getProcessMemoryInfo()); console.log("system memoryInfo:", process.getSystemMemoryInfo()); const size = this.state.size; const SubMenu = Menu.SubMenu; const MenuItemGroup = Menu.ItemGroup; const TabPane = Tabs.TabPane; const RadioGroup = Radio.Group; const RadioButton = Radio.Button; const OptGroup = Select.OptGroup; const TreeNode = TreeSelect.TreeNode; const panes = [ { title: "Tab1", Content: "Content of Tab 1", key: "1" }, { title: "Tab2", Content: "Content of Tab 2", key: "2" }, { title: "Tab3", Content: "Content of Tab 3", key: "3" }, { title: "Tab4", Content: "Content of Tab 4", key: "4" }, { title: "Tab5", Content: "Content of Tab 5", key: "5" }, { title: "Tab6", Content: "Content of Tab 6", key: "6" }, { title: "Tab7", Content: "Content of Tab 7", key: "7" }, { title: "Tab8", Content: "Content of Tab 8", key: "8" }, { title: "Tab9", Content: "Content of Tab 9", key: "9" }, { title: "Tab10", Content: "Content of Tab 10", key: "10" } ]; const columns = [{ title: 'Name', dataIndex: 'name', key: 'name', render: text => {text}, }, { title: 'Age', dataIndex: 'age', key: 'age', }, { title: 'Address', dataIndex: 'address', key: 'address', }, { title: 'Action', key: 'action', render: (text, record) => ( Action 一 {record.name} Delete More actions ), }]; const tableData = [{ key: '1', name: 'John Brown', age: 32, address: 'New York No. 1 Lake Park', }, { key: '2', name: 'Jim Green', age: 42, address: 'London No. 1 Lake Park', }, { key: '3', name: 'Joe Black', age: 32, address: 'Sidney No. 1 Lake Park', }]; const treeData = [ { label: 'Node1', value: '0-0', key: '0-0', children: [ { label: 'Child Node1', value: '0-0-1', key: '0-0-1', }, { label: 'Child Node2', value: '0-0-2', key: '0-0-2', } ], }, { label: 'Node2', value: '0-1', key: '0-1', } ]; const CheckBoxGroup = Checkbox.Group; const options = [ ]; const radioStyle = { display: 'block', height: '30px', lineHeight: '30px', }; const menu = ( leo1 leo2 leo3 ); const menu2 = ( leo1 leo2 百度 sub1 sub2 sub3 ); return (

Large Default Small

Navigation One Navigation Two Navigation Three - Submenu}> Option 1 Option 2 Option 3 Option 4 Navigation Four - Link
Navigation One}> Option 1 Option 2 Option 3 Option 4 Navigation Two}> Option 5 Option 6 Option 7 Option 8 Navigation Three}> Option 9 Option 10 Option 11 Option 12 Navigation One}> Option 1 Option 2 Option 3 Option 4 Navigation Two}> Option 5 Option 6 Option 7 Option 8 Navigation Three}> Option 9 Option 10 Option 11 Option 12 Navigation One}> Option 1 Option 2 Option 3 Option 4 Navigation Two}> Option 5 Option 6 Option 7 Option 8 Navigation Three}> Option 9 Option 10 Option 11 Option 12
Tab 1} key="1">Content of Tab Pane 1 Content of Tab Pane 2 Tab 1} key="3">Content of Tab Pane 3 Tab 1} key="4">Content of Tab Pane 3 Tab 1} key="5">Content of Tab Pane 3 Tab 1} key="6">Content of Tab Pane 3 Tab 1} key="7">Content of Tab Pane 3 Tab 1} key="8">Content of Tab Pane 3 Tab 1} key="9">Content of Tab Pane 3 Tab 1} key="10">Content of Tab Pane 3 Tab 1} key="11">Content of Tab Pane 3 Tab 1} key="12">Content of Tab Pane 3 Extra Action}> Tab 1} key="1">Content of Tab Pane 1 Content of Tab Pane 2 Tab 1} key="3">Content of Tab Pane 3 Tab 1} key="1">Content of Tab Pane 1 Content of Tab Pane 2 Tab 1} key="3">Content of Tab Pane 3 Tab 1} key="1">Content of Tab Pane 1 Content of Tab Pane 2 Tab 1} key="3">Content of Tab Pane 3 Tab 1} key="1">Content of Tab Pane 1 Content of Tab Pane 2 Tab 1} key="3">Content of Tab Pane 3 Tab 1} key="1">Content of Tab Pane 1 Content of Tab Pane 2 Tab 1} key="3">Content of Tab Pane 3 {panes.map(pane => {pane.Content})} CheckBox Radio A B C D More... 杭州 上海 北京 成都 深圳 广州 湖北 湖南 河北 } unCheckedChildren={} /> sss} key="random3" /> Tooltip will show when mouse enter. col-6 col-6 col-6 col-6 this.handleChange(value)} />
当前日期:{this.state.date.toString()}
); } }