Browse Source

调整模态框距离顶部位置,采用默认值100px

zhanghe 7 years ago
parent
commit
3d9e53a34d

+ 1 - 1
src/routes/CmsUser/table.js

@@ -41,7 +41,7 @@ export default class CMSUserTableList extends Component {
             src={text}
             style={{ backgroundColor: colorList[Math.floor(Math.random() * (colorList.length - 1))], verticalAlign: 'middle' }}
           >
-            {record.nickName[0]}
+            {(record.nickName || record.name)[0]}
           </Avatar>
         );
       },

+ 0 - 1
src/routes/Combo/Edit/index.js

@@ -286,7 +286,6 @@ export default class PackageProfile extends PureComponent {
               modalVisible={modalShow}
               selTableData={products || []}
               width={600}
-              style={{ top: 20 }}
               fsTableDataSource={list}
               fsTableLoading={listLoading}
               fsTablePagination={pagination}

+ 0 - 3
src/routes/Course/Edit/index.js

@@ -428,7 +428,6 @@ export default class CourseDetail extends PureComponent {
             <LessonSelectSortModal
               rowKeyName="id"
               modalVisible={lessonModalVisible}
-              style={{ top: 20 }}
               width={600}
               onCancel={this.handleModalCancel}
               onOk={this.handleModalOk}
@@ -443,7 +442,6 @@ export default class CourseDetail extends PureComponent {
             <ResourceSelectModal
               rowKeyName="id"
               modalVisible={resourceModalVisible}
-              style={{ top: 20 }}
               width={600}
               onOk={this.handleModalOk}
               onCancel={this.handleModalCancel}
@@ -457,7 +455,6 @@ export default class CourseDetail extends PureComponent {
             <SupportSelectSortModal
               rowKeyName="id"
               modalVisible={supportModalVisible}
-              style={{ top: 20 }}
               width={600}
               onCancel={this.handleModalCancel}
               onOk={this.handleModalOk}

+ 0 - 1
src/routes/Lesson/Edit/index.js

@@ -218,7 +218,6 @@ export default class LessonDetail extends PureComponent {
             <WareSelectSortModal
               rowKeyName="id"
               modalVisible={modalVisible}
-              style={{ top: 20 }}
               width={600}
               onCancel={this.handleModalCancel}
               onOk={this.handleModalOk}

+ 0 - 1
src/routes/MProduct/Edit/index.js

@@ -262,7 +262,6 @@ export default class MerchantProductEdit extends PureComponent {
             rowKeyName="id"
             modalVisible={tagModalShow}
             selTableData={tags || []}
-            style={{ top: 20 }}
             fsTableDataSource={list}
             fsTableLoading={listLoading}
             fsTablePagination={pagination}

+ 3 - 5
src/routes/Order/Add/index.js

@@ -597,9 +597,9 @@ export default class CreateOrder extends Component {
               :
                 (
                   <Tooltip title="先选择终端">
-  <Button onClick={this.handleProductSelectBtnClick} disabled type="primary" size="small" icon="plus-circle-o">添加</Button>
-</Tooltip>
-)
+                    <Button onClick={this.handleProductSelectBtnClick} disabled type="primary" size="small" icon="plus-circle-o">添加</Button>
+                  </Tooltip>
+                )
               }
               <Table
                 bordered
@@ -615,7 +615,6 @@ export default class CreateOrder extends Component {
           <TerminalSelectModal
             rowKeyName="id"
             modalVisible={terminalModalShow}
-            style={{ top: 20 }}
             width={660}
             onOk={this.handleTerminalModalOk}
             onCancel={this.handleTerminalModalCancel}
@@ -630,7 +629,6 @@ export default class CreateOrder extends Component {
             rowKeyName="id"
             modalVisible={productModalShow}
             selTableData={products}
-            style={{ top: 20 }}
             width={660}
             fsTableDataSource={productList}
             fsTableLoading={mproduct.listLoading}

+ 0 - 2
src/routes/Support/Edit/index.js

@@ -387,7 +387,6 @@ export default class SupportDetail extends PureComponent {
             <SupportSelectSortModal
               rowKeyName="id"
               modalVisible={supportModalVisible}
-              style={{ top: 20 }}
               width={600}
               onCancel={this.handleModalCancel}
               onOk={this.handleModalOk}
@@ -403,7 +402,6 @@ export default class SupportDetail extends PureComponent {
               mode={curClickedBtn == 'imgBtn' ? 'multiple' : 'single'}
               rowKeyName="id"
               modalVisible={resourceModalVisible}
-              style={{ top: 20 }}
               width={600}
               onOk={this.handleModalOk}
               onCancel={this.handleModalCancel}

+ 28 - 5
src/routes/Terminal/Edit/index.js

@@ -32,12 +32,36 @@ export default class TerminalProfile extends Component {
     this.props.dispatch({ type: 'terminalDetail/hideModal' });
   }
 
-  handleCampusModalSearch = () => {
-
+  handleCampusModalSearch = (data) => {
+    const newData = { ...data };
+    if (newData.keyword) {
+      newData[newData.field] = newData.keyword;
+    }
+    delete newData.field;
+    delete newData.keyword;
+    this.props.dispatch({
+      type: 'campus/query',
+      payload: { ...newData, pageNo: 1, pageSize },
+    });
   }
 
-  handleCampusModalTableChange = () => {
-
+  handleCampusModalTableChange = (pagination, filterArgs, filters) => {
+    const newFilters = { ...filters };
+    if (newFilters.keyword) {
+      newFilters[newFilters.field] = newFilters.keyword;
+    }
+    delete newFilters.field;
+    delete newFilters.keyword;
+    const getValue = obj => Object.keys(obj).map(key => obj[key]).join(',');
+    const tableFilters = Object.keys(filterArgs).reduce((obj, key) => {
+      const newObj = { ...obj };
+      newObj[key] = getValue(filterArgs[key]);
+      return newObj;
+    }, {});
+
+    const data = { ...newFilters, ...tableFilters, pageNo: pagination.current, pageSize: pagination.pageSize };
+    Object.keys(data).map(key => (data[key] ? null : delete data[key]));
+    this.props.dispatch({ type: 'campus/query', payload: data });
   }
 
   handlePageCancel = () => {
@@ -175,7 +199,6 @@ export default class TerminalProfile extends Component {
           <CampusSelectModal
             rowKeyName="id"
             modalVisible={modalShow}
-            style={{ top: 20 }}
             width={600}
             onOk={this.handleCampusModalOk}
             onCancel={this.handleCampusModalCancel}

+ 0 - 1
src/routes/Ware/Edit/index.js

@@ -268,7 +268,6 @@ export default class WareDetail extends PureComponent {
             <ResourceSelectSortModal
               rowKeyName="id"
               modalVisible={modalVisible}
-              style={{ top: 20 }}
               width={600}
               onCancel={this.handleModalCancel}
               onOk={this.handleModalOk}

+ 1 - 1
src/services/login.js

@@ -15,7 +15,7 @@ export async function login(params) {
 
 export async function logout() {
   const options = {
-    method: 'DELETE',
+    method: 'POST',
   };
   return request(`${userLogout}`, options);
 }

+ 2 - 1
src/utils/config.js

@@ -44,7 +44,8 @@ Codes.CODE_SEASON = '季';
 Codes.CODE_ITEM = '件';
 
 module.exports = {
-  apiHost: 'http://tt-cms.api.ai160.com',
+  apiHost: 'http://192.168.1.40:8500',
+  //apiHost: 'http://tt-cms.api.ai160.com',
   ossHost: 'http://efunimgs.oss-cn-beijing.aliyuncs.com',
   // apiHost: '/api',
   // 每页返回数据量