Browse Source

修改栏目管理bug

yu_ber 4 years ago
parent
commit
db096425ef

+ 0 - 1
UI/src/components/Form/BirdForm.js

@@ -36,7 +36,6 @@ class BirdForm extends React.Component {
       sourceKeyMap: {},//dropdown与cascader类型key与data的hash映射
     }
   }
-  // UNSAFE_componentWillReceiveProps
   componentWillReceiveProps(nextProps) {
     if (!util.object.equal(nextProps.value,this.props.value)) {
       let initValue = deepClone(nextProps.value)

+ 2 - 0
UI/src/components/Grid/BirdGrid.js

@@ -592,6 +592,8 @@ class BirdGrid extends React.Component {
 
   /* 数据查询(本地) */
   localQuery(props) {
+    console.log(props,'localQuery');
+
     let { pageIndex, pageSize } = this.state;
     let dataSource = props.gridOption.dataSource;
 

+ 174 - 113
UI/src/pages/ArticleContentManage/index.js

@@ -4,7 +4,7 @@ import { BirdGrid } from 'components/Grid';
 import { connect } from "dva";
 import 'braft-editor/dist/index.css'
 import { config, request, util } from "utils";
-import { Modal, Upload, Select, Form, Input, Button, message, Icon, Checkbox, Mentions } from "antd";
+import { Modal, Upload, Select, Form, Input, Button, message, Icon, Checkbox, Mentions , InputNumber } from "antd";
 import { type } from 'jquery';
 const { WXMpAPI } = config;
 import BraftEditor from 'braft-editor'
@@ -16,19 +16,20 @@ class ArticleManage extends React.Component {
       level: false,
       Selected: "",
       Topping: false,
+      offsetTop: false,
       offshelf: false,
       httpModal: false,
       textUrl: "",
       offshelfId: '',
       stickyPosts: "",
       defaultAdd: false,
-      articleContent:"",
+      articleContent: "",
       editorState: BraftEditor.createEditorState('<p>亮剑集团!</b></p>'), // 设置编辑器初始内容
-      outputHTML: '<p></p>',
+      outputHTML: '',
       typeItem: [
-        { label: "全局置顶",value:"3", typographicTypeId: "3", disabled: false },
-        { label: "科室置顶",value:"2",typographicTypeId: "2", disabled: false },
-        { label: "分类置顶",value:"1",typographicTypeId: "1", disabled: false },
+        { label: "全局置顶", value: "3", typographicTypeId: "3", disabled: false },
+        { label: "科室置顶", value: "2", typographicTypeId: "2", disabled: false },
+        { label: "分类置顶", value: "1", typographicTypeId: "1", disabled: false },
       ],  // 置顶类型
       checkStateDataBase: [
         { label: "未通过", value: "0", disabled: false },
@@ -64,7 +65,8 @@ class ArticleManage extends React.Component {
       articleId: "", // 文章ID
       defaultName: "", // 栏目
       articleTitle: "", //  标题
-      articleEditorId: "",// 作者
+      articleEditor: "",// 作者
+      articleEditorId: "",// 作者ID
       articleCardinalnumber: "", //  基数
       typographicTypeList: [], // 置顶设置
       articleSummary: "",  // 摘要
@@ -79,14 +81,14 @@ class ArticleManage extends React.Component {
   componentDidMount() {
     this.isLivinig = true
     // 3秒后更改编辑器内容
-    setTimeout(this.setEditorContentAsync,500)
+    setTimeout(this.setEditorContentAsync, 500)
     // 获取栏目选择数据
     request({
-      url: config.WXMpAPI + "/wx/content/column/queryAllColumns",
+      url: config.WXMpAPI + "/wx/content/column/queryAllidColumns",
       method: "post",
-      data:{
-        pageIndex:1,    
-        pageSize:50
+      data: {
+        pageIndex: 1,
+        pageSize: 50
       }
     }).then((data) => {
       this.setState({
@@ -101,15 +103,34 @@ class ArticleManage extends React.Component {
     this.isLivinig = false
     // setTimeout(this.setEditorContentAsync, 200)
   }
-  onChangeGrid = ( key) =>{
-     const _Id = key[0]
-     if(_Id.field == "article_column_id"){
-      this.getContentUpdate( _Id.value );
-     }
+  updateArticleStatus = status =>{
+
+
+    return status
+  }
+  handleUpdate = (value, type) => {
+    // console.log(value,type);
+    if (type) {
+      this.setState({
+        offshelf: true,
+        offshelfId: value,
+      })
+    } else {
+      this.setState({
+        offsetTop: true,
+        offshelfId: value,
+      })
+    }
   }
-  updateChange = (e)=>{
+  onChangeGrid = (key) => {
+    const _Id = key[0]
+    if (_Id.field == "article_column_id") {
+      this.getContentUpdate(_Id.value);
+    }
+  }
+  updateChange = (e) => {
     this.setState({
-      articleTitle:e.target.value
+      articleTitle: e.target.value
     }, () => {
 
     })
@@ -150,12 +171,24 @@ class ArticleManage extends React.Component {
   removeImg = (imgSrc) => {
 
   }
-  handleChange = (handle) => {
+  handleChange = (handle, index) => {
+    console.log(handle, 'index');
     this.setState({
       handImgPath: handle.fileList[0] && handle.fileList[0].response ? handle.fileList[0].response.path : "",
       headImgList: handle.fileList
     })
   }
+  updeImg(imgUrl) {
+    let result = [];
+    if (imgUrl) {
+      result.push({
+        uid: '-1',
+        status: "done",
+        url: imgUrl,
+      })
+    }
+    return result;
+  }
   // 查询详情
   editMation = (id) => {
     request({
@@ -165,28 +198,39 @@ class ArticleManage extends React.Component {
       const returned = data.result
       const { typeItem } = this.state
       if (returned.articlePhotoaddress) {
-        var imgUrlMini = returned.articlePhotoaddress;
-        console.log(imgUrlMini,'默认的');
-        if (imgUrlMini) {
-          let SsoToken = util.auth.getToken();
-          let imgSeperator = "?";
-          if (imgUrlMini.indexOf("?") !== -1) imgSeperator = "&";
-          if (imgUrlMini.indexOf("&") !== -1) imgSeperator = "&";
-          imgUrlMini = imgUrlMini.indexOf('Sso-Token') > -1 ? imgUrlMini : imgUrlMini + imgSeperator + 'Sso-Token=' + SsoToken;
-          console.log(imgUrlMini,'no默认的');
-        }
-        let list = []
-        let obj = {}
-        obj.url = imgUrlMini
-        obj.status = "done",
-        obj.uid = '-2'
-        list.push(obj)
+        // const imgUrlMini = returned.articlePhotoaddress;
+        // if (imgUrlMini) {
+        //   let SsoToken = util.auth.getToken();
+        //   let imgSeperator = "?";
+        //   if (imgUrlMini.indexOf("?") !== -1) imgSeperator = "&";
+        //   if (imgUrlMini.indexOf("&") !== -1) imgSeperator = "&";
+        //   imgUrlMini = imgUrlMini.indexOf('Sso-Token') > -1 ? imgUrlMini : imgUrlMini + imgSeperator + 'Sso-Token=' + SsoToken;
+        //   console.log(imgUrlMini,'no默认的');
+        // }
+
+        // const url = this.updeImg(imgUrlMini)
+        //   this.setState({
+        //     headImgList:url,
+        //   })
+        // } else {
+        //   this.setState({
+        //     headImgList:[],
+        //   })
+      }
+
+      const imgUrlMini = returned.articlePhotoaddress;
+      var imgObj = [{
+        uid: '-1',
+        url: imgUrlMini,
+      }]
+      console.log(imgObj);
+      if (imgUrlMini) {
         this.setState({
-          headImgList: list,
+          headImgList: imgObj,
         })
       } else {
         this.setState({
-          headImgList:[],
+          headImgList: [],
         })
       }
       var typographicTypeList = []
@@ -198,11 +242,12 @@ class ArticleManage extends React.Component {
           }
         }
       }
-      console.log(returned,'returned');
+      console.log(returned, 'returned');
       this.setState({
-        defaultName:returned.column ? returned.column.columnName : "", // 栏目
-        tagId:returned.column ? returned.column.columnId : "", // 栏目
+        defaultName: returned.column ? returned.column.columnName : "", // 栏目
+        tagId: returned.column ? returned.column.columnId : "", // 栏目
         articleTitle: returned.articleTitle, //  标题
+        articleEditor: returned.articleAuthor ? returned.articleAuthor : "正在生成",// 作者
         articleEditorId: returned.articleAuthorId,// 作者
         articleCardinalnumber: returned.articleCardinalnumber, //  基数
         articleSummary: returned.articleSummary,  // 摘要
@@ -213,7 +258,7 @@ class ArticleManage extends React.Component {
         typographicTypeList: typographicTypeList, // 置顶设置
         visible: true,
       }, () => {
-          console.log(this.state.defaultName,'defaultName');
+        console.log(this.state.defaultName, 'defaultName');
       })
     }).catch((error) => {
 
@@ -320,11 +365,13 @@ class ArticleManage extends React.Component {
       data.articleStatus = '-1'
       this.props.dispatch({ type: 'ContentManage/goodsTheShelf', payload: { data } });
       setTimeout(() => this.refs.grid.reload(), 3000);
-    } else {
-      const value = this.refs.myInput;
-      this.setState({
-
-      })
+    }
+    if (type == "top") {
+      let data = {}
+      data.articleId = this.state.offshelfId.articleId
+      data.articleStatus = '1'
+      this.props.dispatch({ type: 'ContentManage/goodsTheShelf', payload: { data } });
+      setTimeout(() => this.refs.grid.reload(), 3000);
     }
 
   }
@@ -367,7 +414,7 @@ class ArticleManage extends React.Component {
   handleChangeColumn = (val) => {
     for (let i = 0; i < this.state.queryAllColumns.length; i++) {
       if (this.state.queryAllColumns[i].columnName == val) {
-       console.log(this.state.queryAllColumns[i].columnId,'uk-icon-ioxhost');
+        console.log(this.state.queryAllColumns[i].columnId, 'uk-icon-ioxhost');
         this.setState({
           tagId: this.state.queryAllColumns[i].columnId,
         });
@@ -391,14 +438,14 @@ class ArticleManage extends React.Component {
             }
           }
         }
-
+        console.log(this.state.outputHTML)
         let hicColumn = {} //  栏目ID
         hicColumn.columnId = this.state.tagId
         let hicDepa = this.state.selectDepartment   //  科室ID
         let hicTag = this.state.selectLableKeys //  标签ID
         parame.articleTitle = values.title;
         parame.articleId = this.state.articleId,
-        parame.articleStatus = index;  // 文章状态(0为保存,1为保存并发布,-1下架)
+          parame.articleStatus = index;  // 文章状态(0为保存,1为保存并发布,-1下架)
         // parame.articleAuthorId = 4;   // 作者ID
         parame.articleSummary = values.content
         parame.articlePhotoaddress = this.state.handImgPath
@@ -422,6 +469,7 @@ class ArticleManage extends React.Component {
       url: {
         read: WXMpAPI + '/wx/content/classification/queryAllClassifications',
       },
+      primaryKey: "classification_column_id",
       filterRules: [
         {
           // field: "column_id",
@@ -430,13 +478,21 @@ class ArticleManage extends React.Component {
           value: that.state.tagId
         }
       ],
-
+      customRules: [
+        {
+          field: "classification_column_id",
+          operate: "equal",
+          value: that.state.tagId
+        }
+      ],
       pageSize: 10,
       checkable: true,
+
       actions: [{
         name: "分类保存",
         onClick: (id, data) => {
-          if(data.length==0){
+          console.log(data);
+          if (data.length == 0) {
             message.error("请勾选分类");
           } else {
             message.success("保存成功");
@@ -455,6 +511,7 @@ class ArticleManage extends React.Component {
       },
       ],
       columns: [
+        // classificationId
         { title: "分类ID", data: "classificationId", type: "text", query: false },
         // { title: "关键词", data: "column_id", type: "text", editor: {}, query: true, hide: true },
         { title: "分类名称", data: "classificationName", type: "text", query: false },
@@ -476,7 +533,7 @@ class ArticleManage extends React.Component {
       actions: [{
         name: "科室保存",
         onClick: (id, data) => {
-          if(data.length==0){
+          if (data.length == 0) {
             message.error("请勾选科室");
           } else {
             message.success("保存成功");
@@ -515,7 +572,7 @@ class ArticleManage extends React.Component {
       actions: [{
         name: "标签保存",
         onClick: (id, preservation) => {
-          if(preservation.length==0){
+          if (preservation.length == 0) {
             message.error("请勾选标签");
           } else {
             message.success("保存成功");
@@ -546,23 +603,23 @@ class ArticleManage extends React.Component {
     };
     return gridOption
   }
-   getContentUpdate =( id )=>{
+  getContentUpdate = (id) => {
     let parme = {
       "filters": [
         {
           "field": "column_id",
           "operate": "equal",
-          "value":id
+          "value": id
         }
       ]
     }
-      request({
+    request({
       url: config.WXMpAPI + "/wx/content/classification/queryAllClassificationsSelection",
       method: "post",
-      data:parme
+      data: parme
     }).then((data) => {
-        this.refs.grid.props.gridOption.columns[3].source.data = data
-        this.refs.grid.state.columns[3].source.data = data
+      this.refs.grid.props.gridOption.columns[3].source.data = data
+      this.refs.grid.state.columns[3].source.data = data
     }).catch((error) => {
 
     });
@@ -579,7 +636,7 @@ class ArticleManage extends React.Component {
   getColumnInformation = () => {
     let that = this;
     var baseDate = []
-   
+
     let gridOption = {
       title: "权限资源",
       title: "关键词",
@@ -595,6 +652,7 @@ class ArticleManage extends React.Component {
             defaultName: "",
             articleTitle: "",
             articleEditorId: "",
+            articleEditor: "",
             articleCardinalnumber: "",
             typographicTypeList: "",
             articleSummary: "",
@@ -607,7 +665,11 @@ class ArticleManage extends React.Component {
             selectDepartment: [],
             selectCategory: [],
             articleId: "",
-            outputHTML:""
+            outputHTML: ""
+          })
+
+          that.isLivinig && that.setState({
+            editorState: BraftEditor.createEditorState("<p></p>")
           })
           that.props.form.resetFields();
           that.showModal('visible')
@@ -615,7 +677,7 @@ class ArticleManage extends React.Component {
       }
       ],
       columns: [
-        { title: "文章ID", data: "articleId", type: "text", query:false },
+        { title: "文章ID", data: "articleId", type: "text", query: false },
         {
           title: "栏目名称", data: "article_column_id", type: "dropdown",
           source: { url: WXMpAPI + "/wx/content/column/queryAllColumnsSelection" }, query: true, hide: true,
@@ -639,8 +701,6 @@ class ArticleManage extends React.Component {
         },
         { title: "标题", data: "article_title", type: "text", query: true, hide: true },
 
-
-        
         { title: "标题", data: "articleTitle", type: "text", query: false },
         { title: "作者", data: "articleAuthorId", type: "text", query: false },
         { title: "创建时间", data: "articleCreateDate", type: "text", query: false },
@@ -648,10 +708,19 @@ class ArticleManage extends React.Component {
         {
           title: "状态", data: "articleStatus", type: "number", query: false,
           // -1 下架, 0 保存 , 1 保存发布 
-          render: state =>
-            state == "-1" ?
-              <div>下架</div> : state == 0 ?
-                <div>保存</div> : state == 1 ? <div>保存发布</div> : ""
+          // render: state =>
+          //   state == "-1" ?
+          //     <div>下架</div> : state == 0 ?
+          //       <div>保存</div> : state == 1 ? <div>保存发布</div> : ""
+
+          render: (state, record) => (
+            <span>
+              {/* <a onClick={e => this.handleUpdate(record, false)} style={{ display: state == -1 ? "black" : "none" }}> (未发布)上架 </a>
+              <a onClick={e => this.handleUpdate(record, true)} style={{ display: state == 1 ? "black" : "none" }}>  (已发布)下架 </a> */}
+
+              { state == '-1' ?   <a onClick={e => this.handleUpdate(record, false)}> (未发布)上架 </a>: <a onClick={e => this.handleUpdate(record, true)}>  (已发布)下架 </a> }
+            </span>
+          ),
         },
         {
           title: "操作选项", type: "command", actions: [
@@ -659,12 +728,11 @@ class ArticleManage extends React.Component {
               name: '编辑', onClick: function (data) {
                 that.setState({
                   dynamicTitle: "编辑文章",
-                  articleId:data.articleId,
+                  articleId: data.articleId,
                 })
                 that.props.form.resetFields();
-                console.log(data);
                 that.editMation(data.articleId);
-                setTimeout(that.setEditorContentAsync,1000)
+                setTimeout(that.setEditorContentAsync, 1000)
               }
             },
             {
@@ -688,14 +756,14 @@ class ArticleManage extends React.Component {
                 })
               }
             },
-            {
-              name: '下架', onClick: function (data) {
-                that.setState({
-                  offshelf: true,
-                  offshelfId: data,
-                })
-              },
-            },
+            // {
+            //   name: '下架', onClick: function (data) {
+            //     that.setState({
+            //       offshelf: true,
+            //       offshelfId: data,
+            //     })
+            //   },
+            // },
             {
               name: '链接', onClick: function (data) {
                 if (data.articleLinkAddress) {
@@ -711,7 +779,7 @@ class ArticleManage extends React.Component {
             },
 
           ]
-        }
+        },
       ],
     };
     return gridOption
@@ -742,32 +810,14 @@ class ArticleManage extends React.Component {
       fileList: this.state.headImgList,
       showUploadList: true,
       onChange: result => this.handleChange(result),
-      onPreview:result => this.onPreview(result),
-      onRemove:result => this.removeImg(result),
-      headers:{
+      onPreview: result => this.onPreview(result),
+      onRemove: result => this.removeImg(result),
+      headers: {
         'Sso-Token': SsoToken
       },
     };
     return (
       <div className="ArticleManage">
-        {/* <Modal
-          title="选择标签"
-          visible={this.state.level}
-          onOk={(e) => this.handleOk('level')}
-          onCancel={(e) => this.handleCancel('level')}
-          width={800}
-        >
-          <div style={{display:this.state.Selected === 'show'? "block":"none"}}>
-            <BirdGrid gridOption={this.selectLable()}  />
-          </div>
-          <div style={{display:this.state.Selected === 'Department'? "block":"none"}}>
-            <BirdGrid gridOption={this.selectDepartment()} />
-          </div>
-          <div style={{display:this.state.Selected === 'category'? "block":"none"}}>
-            <BirdGrid gridOption={this.selectCategoryt()} />
-          </div>
-        </Modal> */}
-
         <Modal
           title="文章置顶"
           visible={this.state.Topping}
@@ -793,6 +843,17 @@ class ArticleManage extends React.Component {
         >
           <div>下架文章后,用户将无法查看。是否确认下架?</div>
         </Modal>
+
+        <Modal
+          title="文章上架"
+          visible={this.state.offsetTop}
+          onOk={(e) => this.offshelfClick('top')}
+          onCancel={(e) => this.setState({ offsetTop: false })}
+          width={400}
+        >
+          <div>是否确认上架?</div>
+        </Modal>
+
         <Modal
           title="链接"
           visible={this.state.httpModal}
@@ -809,7 +870,7 @@ class ArticleManage extends React.Component {
           onOk={(e) => this.onShow("show")}
           onCancel={(e) => this.close("show")}
           width={1200}
-           footer = {
+          footer={
             []
           }
         >
@@ -822,7 +883,7 @@ class ArticleManage extends React.Component {
           onOk={(e) => this.onShow("Department")}
           onCancel={(e) => this.close("Department")}
           width={1200}
-          footer = {
+          footer={
             []
           }
         >
@@ -835,7 +896,7 @@ class ArticleManage extends React.Component {
           onOk={(e) => this.onShow("category")}
           onCancel={(e) => this.close("category")}
           width={1200}
-          footer = {
+          footer={
             []
           }
         >
@@ -862,7 +923,7 @@ class ArticleManage extends React.Component {
                   <Select onChange={(val) => this.handleChangeColumn(val)}>
                     {
                       this.state.queryAllColumns && this.state.queryAllColumns.map((item, key) => {
-                        return <Option key= { this.state.defaultName } value={item.columnName}>{item.columnName}</Option>
+                        return <Option key={this.state.defaultName} value={item.columnName}>{item.columnName}</Option>
                       })
                     }
                   </Select>
@@ -874,7 +935,7 @@ class ArticleManage extends React.Component {
                   initialValue: this.state.articleTitle || "",
                   rules: [{ required: true, message: '请填写标题!' }],
                 })(
-                  <Input/>
+                  <Input />
                   // <Input onChange={(e)=>this.updateChange(e)}/>
                 )}
               </Form.Item>
@@ -886,18 +947,18 @@ class ArticleManage extends React.Component {
               </Form.Item>
               <Form.Item label="作者">
                 {getFieldDecorator('author', {
-                  initialValue: this.state.articleEditorId || "",
+                  initialValue: this.state.articleEditor || "",
                   rules: [{ required: true, message: '请填写作者!' }],
                 })(
-                  <Input key={ this.state.articleEditorId }/>
+                  <Input key={this.state.articleEditor} />
                 )}
               </Form.Item>
               <Form.Item label="虚假阅读量基数">
                 {getFieldDecorator('read', {
-                  initialValue: this.state.articleCardinalnumber || "",
+                  initialValue: this.state.articleCardinalnumber,
                   rules: [{ required: true, pattern: new RegExp(/^-?\d*(\.\d*)?$/, "g"), message: '请输入正确基数类型' }],
                 })(
-                  <Input key={ this.state.articleCardinalnumber }/>
+                  <InputNumber min={0}  key={this.state.articleCardinalnumber} />
                 )}
               </Form.Item>
               <Form.Item label="置顶设置">
@@ -953,7 +1014,7 @@ class ArticleManage extends React.Component {
               <Form.Item label="">
                 <div style={{ width: "600px", display: "flex" }}>
                   <Button type="primary" size={80} htmlType="submit" onClick={(e) => this.handleSubmit(e, 1)} style={{ marginLeft: "100px", marginRight: "30px", width: '120px' }}>保存并发布</Button>
-                  <Button type="Dashed" htmlType="submit" size={80} onClick={(e) => this.handleSubmit(e, 0)} style={{ width: '80px', marginLeft: "400px" }} >仅保存</Button>
+                  <Button type="Dashed" htmlType="submit" size={80} onClick={(e) => this.handleSubmit(e, -1)} style={{ width: '80px', marginLeft: "400px" }} >仅保存</Button>
                 </div>
               </Form.Item>
             </Form>
@@ -963,7 +1024,7 @@ class ArticleManage extends React.Component {
             />
           </div>
         </Modal>
-        <BirdGrid handleChange={(key,value)=>this.onChangeGrid(key,value) } gridOption={ this.getColumnInformation()} ref="grid" />
+        <BirdGrid handleChange={(key, value) => this.onChangeGrid(key, value)} gridOption={this.getColumnInformation()} ref="grid" />
       </div>
     )
   }

+ 3 - 0
UI/src/pages/contentManage/cateManage.css

@@ -35,6 +35,9 @@
 :global .message_item TextArea {
   width: 70%;
 }
+:global .index .ant-pagination {
+  display: none !important;
+}
 :global .flex {
   display: flex;
   height: 100%;

+ 32 - 107
UI/src/pages/contentManage/cateManage.js

@@ -15,7 +15,8 @@ class BirdGridPermissionPage extends React.Component {
       loading: false,
       visible: false,
       columnName: "",
-      columnDescription: ""
+      columnDescription: "",
+      IndexData:[]
     }
   }
 
@@ -27,11 +28,21 @@ class BirdGridPermissionPage extends React.Component {
 
   handleOk = () => {
     let self = this
+     let name =  self.state.columnName 
     if (this.state.columnName == null || this.state.columnName == '') {
       message.error("栏目名称不能为空")
       return;
   }
 
+  if (
+    this.state.IndexData.find(
+      v => v.columnName == self.state.columnName
+    )
+  ) {
+    message.error("栏目名称不能重复")
+    return;
+  }
+
   this.setState({
     loading: false,
     visible: false,
@@ -49,36 +60,13 @@ class BirdGridPermissionPage extends React.Component {
       if (res.success == 1) {
         message.success('操作成功!');
         self.refs.grid.reload();
-   
       } else {
         message.error(res.message);
       }
     });
   })
 
-    // this.setState({ loading: true });
-    // setTimeout(() => {
-    //   this.setState({ loading: false, visible: false });
-    // }, 50);
-
-    // let formData = {}
-    // formData.columnName = this.state.columnName
-    // formData.columnDescription = this.state.columnDescription
-    // request({
-    //   url: WXMpAPI + "/wx/content/column/addColumn",
-    //   method: "post",
-    //   data: formData
-    // }).then(function (res) {
-    //   if (res.success == 1) {
-    //     message.success('操作成功!');
-    //     // self.setState({
-    //     //   keywordModelVisible: false,
-    //     // });
-    //     self.refs.grid.query();
-    //   } else {
-    //     message.error(res.message);
-    //   }
-    // });
+    
     
   };
   changeLinkValue1 = (e) => {
@@ -96,52 +84,32 @@ class BirdGridPermissionPage extends React.Component {
   handleCancel = () => {
     this.setState({ visible: false });
   };
+  //获取栏目数据
+  requestIndexData=()=>{
+    let self = this
+    request({
+      url:  WXMpAPI + "/wx/content/column/queryAllColumns",
+      method: "post",
+    }).then(function (res) {
+      if (res.success == 1) {
+        self.setState({
+          IndexData:res.items
+        })
 
-  onClick = () => {
-    // const data = {
-    //   columnId:""
-    // }
-    // this.props.dispatch(routerRedux.push({
-    //   pathname: '/contentManage/columnManage',
-    //   query: { columnId: data.columnId}
-    // })
-    // )
-    // this.props.history.push('/contentManage/columnManage')
-  };
+      } else {
+        message.error(res.message);
+      }
+    });
+    
+  }
 
   //获取规则数据
   componentDidMount() {
     let self = this;
+    this.requestIndexData();
   }
   render() {
     let self = this
-
-  //   let gridOption = {
-  //     title: "栏目列表",
-  //     pageSize: 10,
-  //     checkable: false,
-  //     url: {
-  //       read: WXMpAPI + "/wx/content/column/queryAllColumns",
-  //         // read: APIV3Auth + "/ums/resource/query",
-  //         // add: APIV3Auth + "/ums/resource/addResource",
-  //         // edit: APIV3Auth + "/ums/resource/update",
-  //     },
-  //     afterSave: function(){
-  //         console.log(self.refs.gridResource)
-  //     },
-  //     columns: [
-  //         { title: "接口编码", data: "columnId", type: "text", query: false },
-  //         { title: "接口名称", data: "columnName", type: "text", hide: false, editor: {},query: true },
-  //         {
-  //             title: "接口类型", data: "columnDescription", type: "dropdown",
-  //             editor: {},
-  //             // source: { url: APIV3Auth + '/ums/resourceType/selectAllAsJson' },
-  //             query: true
-  //         },
-  //     ]
-  // };
-
-
     let gridOption = {
       title: "表格示例",
       url: {
@@ -175,7 +143,7 @@ class BirdGridPermissionPage extends React.Component {
               });
               self.props.dispatch(routerRedux.push({
                 pathname: '/contentManage/columnManage',
-                query: { columnId: data.columnId,columnName:data.columnName},
+                query: { columnId: data.columnId},
               })
               );
 
@@ -185,49 +153,6 @@ class BirdGridPermissionPage extends React.Component {
       ]
     };
     
-  //   let gridOption = {
-  //     title: "表格示例",
-  //     url: {
-  //         // read: APIV4 + "/userPointLog/logs",
-  //         read: APIV4 + "/pointGrowthRule/ruleCondition",
-  //         // add: "/japi/pointGrowthRule/rule",
-  //         // edit: "/test/edit",
-  //         // delete: "/japi/pointGrowthRule/deleteRule"
-  //     },
-  //     pageSize: 8,
-  //     checkable: false,
-  //     //actions: [{ name: '外部按钮', color: 'error', onClick: function () { } }],
-  //     columns: [
-  //       { title: "编码", data: "id", type: "number" },
-  //       { title: "栏目名称", data: "terminalName", type: "text", editor: {}},
-  //       { title: "栏目描述", data: "terminalCode", type: "text", editor: {}},
-
-  //         // { title: "编号", data: "id", type: "text", editor: {} },
-  //         // { title: "平台名称", data: "terminalName", type: "dropdown", editor: {}, source: { data: this.state.originTypeDatabase } },
-  //         // { title: "平台编号", data: "terminalCode", type: "text", editor: {} },
-  //         {
-  //           title: "操作选项", type: "command", actions: [{
-  //             name: '栏目管理',
-  
-  //             onClick: (data) => {
-  //               this.props.dispatch({
-  //                 type: 'app/updateState', payload: {
-  //                   menuPath: [{id:"310_panelchange_",name:"新增商品"}]
-  //                 }
-  //               });
-  //               self.props.dispatch(routerRedux.push({
-  //                 pathname: '/contentManage/columnManage',
-  //                 query: { columnId: data.columnId,columnName:data.columnName},
-  
-  //               })
-  //               );
-  
-  //             }
-  //           }]
-  //         }
-  //     ]
-  // };
-
     return <div className="index">
       <BirdGrid gridOption={gridOption} ref="grid"/>
       <Modal

+ 6 - 2
UI/src/pages/contentManage/cateManage.less

@@ -11,8 +11,12 @@
     
   }
 }
- 
-    
+ .index{
+   .ant-pagination{
+  display: none !important;
+}
+ }
+
     
   .flex {
     display: flex;

+ 1 - 4
UI/src/pages/contentManage/columnManage.css

@@ -44,7 +44,7 @@
   width: 98%;
   margin: 0 auto;
   background-color: #fff;
-  padding: 20px 0 20px 10px;
+  padding: 20px 0 20px;
 }
 :global .columnManage hr {
   margin: 20px 0;
@@ -225,9 +225,6 @@
 :global .departments .header_search input {
   width: 200px;
 }
-:global .departments .ant-row {
-  display: none;
-}
 :global .flex {
   display: flex;
   height: 100%;

File diff suppressed because it is too large
+ 555 - 267
UI/src/pages/contentManage/columnManage.js


+ 8 - 5
UI/src/pages/contentManage/columnManage.less

@@ -21,7 +21,7 @@
     width: 98%;
     margin: 0 auto;
     background-color: #fff;
-    padding:20px 0 20px 10px;
+    padding:20px 0 20px;
     hr{
       margin: 20px 0;
     }
@@ -64,7 +64,7 @@
       }
       }
          .slide_manage{
-        display: none;
+        // display: none;
         width: 50%;
         border: 1px solid @colorgary;
         padding: 20px;
@@ -211,9 +211,12 @@
             width: 200px;
           }
         }
-         .ant-row{
-            display: none;
-        }   
+        //  .ant-row{
+        //     display: none;
+        // }   
+        // .ant-col-14{
+        //   width: 100px !important;
+        // }
       }   
   .flex {
     display: flex;

+ 3 - 3
UI/src/utils/config.js

@@ -7,13 +7,13 @@ const APIV3Auth = 'http://192.168.50.32:13001/oauth2'
 const WXAPIV5= 'http://192.168.50.32:13001/qiyewechat'
 const WXMpAPI= 'http://192.168.50.32:13001/mpwechat'
 const staticMpAPI = 'http://192.168.50.32:13001/mpwechat'
-// const ymallAPI = 'http://192.168.50.32:13001/ymallWHC'
+const ymallAPI = 'http://192.168.50.32:13001/ymallWHC'
 
 // const APIV3Auth = 'http://192.168.50.32:8031'
 // const WXAPIV5= 'http://localhost:7000'
-// const WXMpAPI= 'http://localhost:8081'
+// const WXMpAPI= 'http://192.168.10.89:8081'
 // const staticMpAPI= 'http://localhost:8081'
-const ymallAPI = 'http://localhost:8070'
+// const ymallAPI = 'http://localhost:8070'
 module.exports =  {
   name: '亮健营销平台',
   prefix: 'bird',