|
@@ -30,28 +30,31 @@ const Addjurisdiction = Form.create()(React.createClass({
|
|
|
loading: true
|
|
|
});
|
|
|
$.ajax({
|
|
|
- method: "POST",
|
|
|
- dataType: "json",
|
|
|
- crossDomain: false,
|
|
|
- url: globalConfig.context + api,
|
|
|
- data: {
|
|
|
- id:this.state.ids,
|
|
|
- name:this.state.name, //接口名称
|
|
|
- url:this.state.url,//接口路径
|
|
|
- type:this.state.urlType||'0',
|
|
|
- superId:this.state.auto,//接口上级模板功能
|
|
|
- }
|
|
|
- }).done(function (data) {
|
|
|
+ method: "POST",
|
|
|
+ dataType: "json",
|
|
|
+ crossDomain: false,
|
|
|
+ url: globalConfig.context + api,
|
|
|
+ data: {
|
|
|
+ id: this.state.ids,
|
|
|
+ name: this.state.name, //接口名称
|
|
|
+ url: this.state.url, //接口路径
|
|
|
+ type: this.state.urlType || "0",
|
|
|
+ superId: this.state.auto, //接口上级模板功能
|
|
|
+ showOrder: this.state.showOrder,
|
|
|
+ },
|
|
|
+ }).done(
|
|
|
+ function (data) {
|
|
|
this.setState({
|
|
|
- loading: false
|
|
|
+ loading: false,
|
|
|
});
|
|
|
if (!data.error.length) {
|
|
|
- message.success('保存成功!');
|
|
|
- this.props.closeDesc(false,true);
|
|
|
+ message.success("保存成功!");
|
|
|
+ this.props.closeDesc(false, true);
|
|
|
} else {
|
|
|
- message.warning(data.error[0].message);
|
|
|
+ message.warning(data.error[0].message);
|
|
|
}
|
|
|
- }.bind(this));
|
|
|
+ }.bind(this)
|
|
|
+ );
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -132,16 +135,17 @@ const Addjurisdiction = Form.create()(React.createClass({
|
|
|
thisData = {};
|
|
|
};
|
|
|
this.setState({
|
|
|
- ids:thisData.id,
|
|
|
- name:thisData.name, //接口名称
|
|
|
- urlType:thisData.type.toString(),
|
|
|
- url:thisData.url,//接口路径
|
|
|
- preModule:thisData.preModule,//接口上级模板功能
|
|
|
- createId:thisData.createId,
|
|
|
- createTime:(new Date(thisData.createTime)).toLocaleString(),
|
|
|
- updateTime:(new Date(thisData.updateTime)).toLocaleString(),
|
|
|
- autNo:thisData.autNo,
|
|
|
- auto:thisData.superId,
|
|
|
+ ids: thisData.id,
|
|
|
+ name: thisData.name, //接口名称
|
|
|
+ urlType: thisData.type.toString(),
|
|
|
+ url: thisData.url, //接口路径
|
|
|
+ preModule: thisData.preModule, //接口上级模板功能
|
|
|
+ createId: thisData.createId,
|
|
|
+ createTime: new Date(thisData.createTime).toLocaleString(),
|
|
|
+ updateTime: new Date(thisData.updateTime).toLocaleString(),
|
|
|
+ autNo: thisData.autNo,
|
|
|
+ auto: thisData.superId,
|
|
|
+ showOrder: thisData.showOrder,
|
|
|
});
|
|
|
}.bind(this),
|
|
|
}).always(function () {
|
|
@@ -187,99 +191,179 @@ const Addjurisdiction = Form.create()(React.createClass({
|
|
|
<Option key={index} value={group.name}>{group.name}</Option>
|
|
|
)
|
|
|
return (
|
|
|
- <div>
|
|
|
- <Modal maskClosable={false} visible={this.state.visible}
|
|
|
- onOk={this.handleOk} onCancel={this.handleCancel}
|
|
|
- width='600px'
|
|
|
- title={this.props.userDetaile?'权限详情':'新建权限'}
|
|
|
- footer=''
|
|
|
- className="admin-desc-content">
|
|
|
- <Form layout="horizontal" onSubmit={this.handleSubmit} id="demand-form">
|
|
|
- <Spin spinning={this.state.loading}>
|
|
|
- <div className="clearfix">
|
|
|
- <FormItem className="half-middle"
|
|
|
- {...formItemLayout}
|
|
|
- label="接口名称" >
|
|
|
- <Input placeholder="接口名称" value={this.state.name} style={{width:'230px'}}
|
|
|
- onChange={(e)=>{this.setState({name:e.target.value})}} required="required"/>
|
|
|
- <span className="mandatory">*</span>
|
|
|
- </FormItem>
|
|
|
- <FormItem className="half-middle"
|
|
|
- {...formItemLayout}
|
|
|
- label="接口路径" >
|
|
|
- <Input placeholder="接口路径" value={this.state.url} style={{width:'230px'}}
|
|
|
- onChange={(e)=>{this.setState({url:e.target.value})}} required="required"/>
|
|
|
- <span className="mandatory">*</span>
|
|
|
- </FormItem>
|
|
|
- <FormItem className="half-middle"
|
|
|
- {...formItemLayout}
|
|
|
- label="接口类型" >
|
|
|
- {this.props.userDetaile?<Select placeholder="选择接口类型" style={{width:'230px'}}
|
|
|
- value={this.state.urlType}
|
|
|
- onChange={(e) => { this.setState({ urlType: e }) }}>
|
|
|
- {
|
|
|
- urlType.map(function (item) {
|
|
|
- return <Select.Option key={item.value} >{item.key}</Select.Option>
|
|
|
- })
|
|
|
- }
|
|
|
- </Select>:
|
|
|
- <span>导航</span>
|
|
|
- }
|
|
|
- </FormItem>
|
|
|
- </div>
|
|
|
- <div className="clearfix" style={{display:this.props.userDetaile?'block':'none'}}>
|
|
|
- <FormItem className="half-middle"
|
|
|
- {...formItemLayout}
|
|
|
- label="上级功能模块" >
|
|
|
- <AutoComplete
|
|
|
- className="certain-category-search"
|
|
|
- dropdownClassName="certain-category-search-dropdown"
|
|
|
- dropdownMatchSelectWidth={false}
|
|
|
- dropdownStyle={{ width: 230 }}
|
|
|
- size="large"
|
|
|
- style={{ width: '230px' }}
|
|
|
- dataSource={options}
|
|
|
- placeholder="输入名称"
|
|
|
- value={this.state.auto}
|
|
|
- onChange={this.httpChange}
|
|
|
- filterOption={true}
|
|
|
- onBlur={this.blurChange}
|
|
|
- onSelect={this.selectAuto}
|
|
|
- >
|
|
|
- <Input/>
|
|
|
- </AutoComplete>
|
|
|
- <span className="mandatory">*</span>
|
|
|
- </FormItem>
|
|
|
- <FormItem className="half-middle"
|
|
|
- {...formItemLayout}
|
|
|
- label="权限编号" >
|
|
|
- <span>{this.state.autNo}</span>
|
|
|
- </FormItem>
|
|
|
- <FormItem className="half-middle"
|
|
|
- {...formItemLayout}
|
|
|
- label="创建人" >
|
|
|
- <span>{this.state.createId}</span>
|
|
|
- </FormItem>
|
|
|
- <FormItem className="half-middle"
|
|
|
- {...formItemLayout}
|
|
|
- label="创建时间" >
|
|
|
- <span>{this.state.createTime}</span>
|
|
|
- </FormItem>
|
|
|
- <FormItem className="half-middle"
|
|
|
- {...formItemLayout}
|
|
|
- label="更新时间" >
|
|
|
- <span>{this.state.updateTime}</span>
|
|
|
- </FormItem>
|
|
|
- </div>
|
|
|
- <FormItem className="half-middle">
|
|
|
- <Button className="set-submit" type="primary" htmlType="submit" style={{marginLeft:'150px'}}>保存</Button>
|
|
|
- <Button className="set-submit" type="ghost" onClick={this.handleCancel}>取消</Button>
|
|
|
- </FormItem>
|
|
|
- </Spin>
|
|
|
- </Form >
|
|
|
- </Modal>
|
|
|
- </div>
|
|
|
- )
|
|
|
+ <div>
|
|
|
+ <Modal
|
|
|
+ maskClosable={false}
|
|
|
+ visible={this.state.visible}
|
|
|
+ onOk={this.handleOk}
|
|
|
+ onCancel={this.handleCancel}
|
|
|
+ width="600px"
|
|
|
+ title={this.props.userDetaile ? "权限详情" : "新建权限"}
|
|
|
+ footer=""
|
|
|
+ className="admin-desc-content"
|
|
|
+ >
|
|
|
+ <Form
|
|
|
+ layout="horizontal"
|
|
|
+ onSubmit={this.handleSubmit}
|
|
|
+ id="demand-form"
|
|
|
+ >
|
|
|
+ <Spin spinning={this.state.loading}>
|
|
|
+ <div className="clearfix">
|
|
|
+ <FormItem
|
|
|
+ className="half-middle"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="接口名称"
|
|
|
+ >
|
|
|
+ <Input
|
|
|
+ placeholder="接口名称"
|
|
|
+ value={this.state.name}
|
|
|
+ style={{ width: "230px" }}
|
|
|
+ onChange={(e) => {
|
|
|
+ this.setState({ name: e.target.value });
|
|
|
+ }}
|
|
|
+ required="required"
|
|
|
+ />
|
|
|
+ <span className="mandatory">*</span>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem
|
|
|
+ className="half-middle"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="接口路径"
|
|
|
+ >
|
|
|
+ <Input
|
|
|
+ placeholder="接口路径"
|
|
|
+ value={this.state.url}
|
|
|
+ style={{ width: "230px" }}
|
|
|
+ onChange={(e) => {
|
|
|
+ this.setState({ url: e.target.value });
|
|
|
+ }}
|
|
|
+ required="required"
|
|
|
+ />
|
|
|
+ <span className="mandatory">*</span>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem
|
|
|
+ className="half-middle"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="接口类型"
|
|
|
+ >
|
|
|
+ {this.props.userDetaile ? (
|
|
|
+ <Select
|
|
|
+ placeholder="选择接口类型"
|
|
|
+ style={{ width: "230px" }}
|
|
|
+ value={this.state.urlType}
|
|
|
+ onChange={(e) => {
|
|
|
+ this.setState({ urlType: e });
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ {urlType.map(function (item) {
|
|
|
+ return (
|
|
|
+ <Select.Option key={item.value}>
|
|
|
+ {item.key}
|
|
|
+ </Select.Option>
|
|
|
+ );
|
|
|
+ })}
|
|
|
+ </Select>
|
|
|
+ ) : (
|
|
|
+ <span>导航</span>
|
|
|
+ )}
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ className="clearfix"
|
|
|
+ style={{
|
|
|
+ display: this.props.userDetaile ? "block" : "none",
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ <FormItem
|
|
|
+ className="half-middle"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="上级功能模块"
|
|
|
+ >
|
|
|
+ <AutoComplete
|
|
|
+ className="certain-category-search"
|
|
|
+ dropdownClassName="certain-category-search-dropdown"
|
|
|
+ dropdownMatchSelectWidth={false}
|
|
|
+ dropdownStyle={{ width: 230 }}
|
|
|
+ size="large"
|
|
|
+ style={{ width: "230px" }}
|
|
|
+ dataSource={options}
|
|
|
+ placeholder="输入名称"
|
|
|
+ value={this.state.auto}
|
|
|
+ onChange={this.httpChange}
|
|
|
+ filterOption={true}
|
|
|
+ onBlur={this.blurChange}
|
|
|
+ onSelect={this.selectAuto}
|
|
|
+ >
|
|
|
+ <Input />
|
|
|
+ </AutoComplete>
|
|
|
+ <span className="mandatory">*</span>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem
|
|
|
+ className="half-middle"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="排序"
|
|
|
+ >
|
|
|
+ <Input
|
|
|
+ placeholder="排序数字"
|
|
|
+ value={this.state.showOrder}
|
|
|
+ style={{ width: "230px" }}
|
|
|
+ onChange={(e) => {
|
|
|
+ this.setState({ showOrder: e.target.value });
|
|
|
+ }}
|
|
|
+ required="required"
|
|
|
+ />
|
|
|
+ </FormItem>
|
|
|
+ <FormItem
|
|
|
+ className="half-middle"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="权限编号"
|
|
|
+ >
|
|
|
+ <span>{this.state.autNo}</span>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem
|
|
|
+ className="half-middle"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="创建人"
|
|
|
+ >
|
|
|
+ <span>{this.state.createId}</span>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem
|
|
|
+ className="half-middle"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="创建时间"
|
|
|
+ >
|
|
|
+ <span>{this.state.createTime}</span>
|
|
|
+ </FormItem>
|
|
|
+ <FormItem
|
|
|
+ className="half-middle"
|
|
|
+ {...formItemLayout}
|
|
|
+ label="更新时间"
|
|
|
+ >
|
|
|
+ <span>{this.state.updateTime}</span>
|
|
|
+ </FormItem>
|
|
|
+ </div>
|
|
|
+ <FormItem className="half-middle">
|
|
|
+ <Button
|
|
|
+ className="set-submit"
|
|
|
+ type="primary"
|
|
|
+ htmlType="submit"
|
|
|
+ style={{ marginLeft: "150px" }}
|
|
|
+ >
|
|
|
+ 保存
|
|
|
+ </Button>
|
|
|
+ <Button
|
|
|
+ className="set-submit"
|
|
|
+ type="ghost"
|
|
|
+ onClick={this.handleCancel}
|
|
|
+ >
|
|
|
+ 取消
|
|
|
+ </Button>
|
|
|
+ </FormItem>
|
|
|
+ </Spin>
|
|
|
+ </Form>
|
|
|
+ </Modal>
|
|
|
+ </div>
|
|
|
+ );
|
|
|
}
|
|
|
}));
|
|
|
|