tuonina 5 лет назад
Родитель
Сommit
57938f5097

+ 4 - 1
src/axios/index.js

@@ -5,11 +5,14 @@ import axios from 'axios';
 import { get, post } from './tools';
 import * as config from './config';
 import { findPLabel, labelAdd, labelEdit, pLabelDelete, searchLabel } from './property/label';
+import { queryConfig } from './property/config';
 
+/*配置中心*/
 export {
-    findPLabel, searchLabel, labelAdd, labelEdit, pLabelDelete,
+    findPLabel, searchLabel, labelAdd, labelEdit, pLabelDelete, queryConfig,
 };
 
+
 export const getBbcNews = () => get({ url: config.NEWS_BBC });
 
 export const npmDependencies = () =>

+ 11 - 0
src/axios/property/config.js

@@ -0,0 +1,11 @@
+
+import {get,post,put,del} from '../tools'
+
+
+/**
+ * 根据条件查询配置信息
+ * @param params
+ * @param headers
+ * @returns {Promise<any | never>}
+ */
+export const queryConfig=(params,headers={})=>get({url:'/v1/property/config',headers,params});

+ 0 - 2
src/pages/config/ConfigLabel.js

@@ -77,8 +77,6 @@ class ConfigLabel extends React.Component {
     render() {
         const { data: labelList = {}, isFetching } = this.props.findPLabel || {};
         let { records, current, total } = labelList || { total: 0, current: 1, records: [] };
-
-        console.log('params: ', this.params);
         const { currentLabel } = this.state;
         return (<div className="page-label-container">
             <div className="prop-label-header">

+ 0 - 17
src/pages/config/PropertiesLabel.jsx

@@ -1,17 +0,0 @@
-import React from 'react';
-
-class PropertiesLabel extends React.Component {
-
-    constructor(props){
-        super(props);
-    }
-
-
-    render() {
-        return (<div>什么鬼</div>);
-    }
-
-}
-
-
-export default PropertiesLabel;

+ 46 - 10
src/pages/config/SystemProperties.js

@@ -1,23 +1,59 @@
-import React from 'react'
+import React from 'react';
 import { Button } from 'antd';
 import SystemPropertiesForm from './widget/SystemPropertiesForm';
+import './styles/system.less';
+import * as PropTypes from 'prop-types';
+import { connectAlita } from 'redux-alita';
+import { withRouter } from 'react-router-dom';
 
+ class SystemProperties extends React.Component {
 
-export default class SystemProperties extends React.Component{
-    constructor(props){
+    static propTypes = {
+        queryConfig: PropTypes.object,
+    };
+
+    constructor(props) {
         super(props);
-        this.state={
-            addModalVisible:false
-        }
+        this.state = {
+            addModalVisible: false,
+        };
+        this.params = {
+            page: 1,
+            pageSize: 10,
+            application:undefined,
+            profile:undefined,
+            label:undefined,
+            key:undefined
+        };
+    }
+
+    _refreshData() {
+        this.params.page = 1;
+        this._queryConfigData();
+    }
+
+    _queryConfigData(){
+        let params = this.params;
+        this.props.setAlitaState({funcName:'queryConfig',params});
+
     }
 
     render() {
-        return (<div>
-            <Button htmlType='button' type='primary' onClick={()=>this.setState({addModalVisible:true})} icon='plus'/>
+        let {data:configList,isFetching} = this.props.queryConfig||{};
+        return (<div className='page-container'>
+            <div className='page-header'>
+                <Button htmlType="button" type="primary" icon="sync" loading={isFetching}
+                        onClick={this._refreshData.bind(this)}/>
+                <Button htmlType='button' type='primary'
+                        onClick={() => this.setState({ addModalVisible: true })} icon='plus'/>
+            </div>
+
             <SystemPropertiesForm visible={this.state.addModalVisible}
-                                  onHide={()=>this.setState({addModalVisible:false})}/>
+                                  onHide={() => this.setState({ addModalVisible: false })}/>
             系统的基本属性配置
-        </div>)
+        </div>);
     }
 
 }
+
+export default connectAlita(['queryConfig'])(SystemProperties)

+ 5 - 0
src/pages/config/styles/system.less

@@ -0,0 +1,5 @@
+.system-properties{
+  padding: 10px;
+
+
+}

+ 10 - 0
src/style/custom/page.less

@@ -0,0 +1,10 @@
+/*页面布局*/
+
+.page-container{
+  padding: 10px;
+  .page-header{
+
+  }
+}
+
+

+ 1 - 0
src/style/index.less

@@ -15,6 +15,7 @@
 @import "utils-size";
 @import "utils-border";
 @import "utils-spacing";
+@import "./custom/page";
 body {
   margin: 0;
   padding: 0;