diff --git a/packages/examination/src/api/demo/index.tsx b/packages/examination/src/api/demo/index.tsx index ea9d888..7824c04 100644 --- a/packages/examination/src/api/demo/index.tsx +++ b/packages/examination/src/api/demo/index.tsx @@ -2,7 +2,7 @@ import axios from '../axios'; export function getList(obj: any) { return axios({ - url: '/ins/demo/list', + url: '/ex/demo/list', method: 'get' }) } \ No newline at end of file diff --git a/packages/examination/src/api/dict/index.tsx b/packages/examination/src/api/dict/index.tsx new file mode 100644 index 0000000..654e9d6 --- /dev/null +++ b/packages/examination/src/api/dict/index.tsx @@ -0,0 +1,8 @@ +import axios from '../axios'; + +export function dictionary(code: any) { + return axios({ + url: '/ex/dict/dictionary?code=' + code, + method: 'get' + }) +} diff --git a/packages/examination/src/views/demo/demoList.tsx b/packages/examination/src/views/demo/demoList.tsx index 9de3d1b..8158ba5 100644 --- a/packages/examination/src/views/demo/demoList.tsx +++ b/packages/examination/src/views/demo/demoList.tsx @@ -1,12 +1,16 @@ import React, { Component } from "react"; -import { Button, Empty, Modal, notification, Popconfirm } from "antd"; +import {Button, Empty, Form, Input, Modal, notification, Popconfirm, Select} from "antd"; import { getList } from "api/demo/index"; +import { dictionary } from "api/dict/index"; + +const { Option } = Select interface States { resData: any visible: boolean title: string - current: any + current: any, + sexDict: any } class DemoList extends Component { @@ -16,12 +20,14 @@ class DemoList extends Component { resData: undefined, visible: false, title: '新增公告', - current: {} + current: {}, + sexDict: undefined } } componentDidMount() { this.getList() + this.getDict() } getList() { @@ -33,39 +39,20 @@ class DemoList extends Component { }).catch(() => { }) } - getStatusText(status: number): string { - if (status === 1) { - return "启用"; - } else if (status === 0) { - return "禁用"; - } else { - return ''; - } + getDict() { + dictionary('sex').then((res) => { + if(res.data){ + this.setState({ sexDict: res.data }) + } + }) } handelCreate() { this.setState({ visible: true }) } - handelUpdate(item: any) { - this.setState({ - visible: true, - title: '编辑公告', - current: item - }) - } - - handleEnable(item: any) { - } - - handleDisable(item: any) { - } - - handleDel(item: any) { - } - render() { - const { resData, visible, title, current } = this.state; + const { resData, visible, title, current, sexDict } = this.state; const handleCancel = () => { this.setState({ visible: false }) }; @@ -73,6 +60,35 @@ class DemoList extends Component { return (
TABLE
+
+
+ + + +
+
{ resData ? null :