liaoyongfei пре 4 година
родитељ
комит
5e061497b7
1 измењених фајлова са 133 додато и 0 уклоњено
  1. 133 0
      UI/src/pages/sellmanage/adminMessage.js

+ 133 - 0
UI/src/pages/sellmanage/adminMessage.js

@@ -0,0 +1,133 @@
+import React , { Component }from 'react';
+import { BirdGrid } from 'components/Grid';
+import { Modal, Tabs, message, Input, Button  } from 'antd';
+import request from "utils/request";
+import AutoForm from "components/Grid/BirdGridForm";
+import config from "utils/config";
+import "antd/dist/antd.css";
+
+
+
+const { APIV3Auth , WXMpAPI} = config;
+const { TabPane } = Tabs;
+
+class AddminiFans extends Component {
+  constructor(props) {
+    super(props);
+    this.state = {
+      type : '0',
+      mode : '',
+      editType : '0', //编辑框默认的窗口索引
+      //编辑模态框
+      editVisiable: false,
+      editConfirmLoading: false,
+      editSecret: {},
+      //宽度
+      formOption: [],
+      formWidth: 520,
+      formConfirmLoading: false,
+      formOption: { modal: "", title: "" },
+      initValue1: {}
+    };
+  }
+  //点击编辑
+  changeEdit(data){
+    this.setState({
+      editVisiable:true,
+      editConfirmLoading:true
+    });
+  }
+  /* 弹出框取消事件 */
+  cancelClick() { 
+    this.setState({
+      initValue1: {},
+      formVisiable: false,
+      formConfirmLoading: false
+    });
+  }
+
+  saveClick(callback){
+
+  }
+
+  onClose(){
+
+  }
+
+  render() {
+    self = this;
+    let gridOption = {
+      title: "表格",
+      url: {
+        read: WXMpAPI+"/wx/message/getMessagePageList",
+        edit: WXMpAPI+"/wx/message/editMessage",
+        delete: WXMpAPI+"/wx/message/deleteMessage",
+        add : WXMpAPI+"/wx/message/addMessage"
+      },
+      pageSize:10,
+      checkable: true, 
+      columns: [
+        { title: "编号", data: "msgId", type: "number" , query: true,editor:{ep:"disabled",ap:"hide"}},
+        { title: "消息类型", data: "msgType", type: "text", query: true ,editor:{isRequired:true,tips:"请选择消息类型"} },
+        { title: "消息名称", data: "title", type: "text",  query: true ,editor:{} },
+        { title: "消息用途", data: "description", type: "text" ,editor: {} },
+        { title: "消息渠道", data: "channel", type: "text", query: true ,editor: {isRequired:true,tips:"请选择消息渠道"}},
+        { title: "消息内容", data: "content", type: "text", query: true ,editor: {tips:"请输入消息内容"}},
+        { title: "跳转url", data: "url", type: "text", query: true ,hide:true,editor: {}},
+        {
+          title: "操作选项", type: "command", actions: [{
+            color: '#67c23a',
+            onClick: (data) => {
+              
+            }
+          }]
+        }
+      ],
+      // actions: [
+      //   {
+      //     name: "新增",
+      //     onClick: function(data) {
+      //       this.changeEdit(data);
+      //       const fields = [
+      //         { title: "消息类型", data: "portName", type: "text",  editor: { tips: "填写一个方便记忆的名称,以免公众号/企业微信等同名",isRequired: true },query: true},
+      //         { title: "消息名称",data: "headImg", type: "img", editor: { tips: "请上传1:1尺寸的图标"}, query: true },
+      //         { title: "用途说明",data: "name", type: "text", editor: { tips: "微信公众号名称" , isRequired: true}, query: true},
+      //         { title: "跳转url", data: "appId", type: "text", editor: { tips: "微信公众号AppID" , isRequired: true }, query: true },
+      //         { title: "消息渠道", data: "secret", type: "text", editor: { tips: "微信公众号AppSecret" , isRequired: true },query: true },
+      //         { title: "消息内容", data: "msg_template", type: "text", editor: { tips: "微信公众号token" , isRequired: true }, query: true },
+      //         { title: "消息示例", data: "example", type: "text", editor: { tips: "微信公众号aesKey" , isRequired: true },query: true },
+      //         { title: "模板id", data: "example", type: "text", editor: { tips: "微信公众号aesKey" , isRequired: true },query: true },
+      //         { title: "appid", data: "example", type: "text", editor: { tips: "微信公众号aesKey" , isRequired: true },query: true }
+      //       ];
+      //       let formOption = { model: "add",title: "新增", fields: fields, value: {}, extraParams: [] };
+      //       self.setState({
+      //         formVisiable: true,
+      //         formOption: formOption
+      //       });
+      //     }
+      //   } ]
+    };
+    return( <div>
+                <BirdGrid gridOption={gridOption} />
+                {/* <Modal
+                  title={this.state.formOption.title}
+                  width={this.state.formWidth}
+                  visible={this.state.formVisiable}
+                  onOk={() => this.saveClick()}
+                  onCancel={() => this.cancelClick()}
+                  confirmLoading={this.state.formConfirmLoading}
+                >
+                 <Tabs ActiveKey="0" activeKey={self.state.type} onChange={(key)=>{
+                    this.setState({ type: key });
+                     }}>
+                  <TabPane tab="公众号" key="0">
+                    <AutoForm formOption={this.state.formOption} initValue={this.state.initValue1} ref="autoForm" />
+                  </TabPane>
+                  </Tabs>
+                </Modal> */}
+           </div>
+           );
+  }
+}
+
+export default AddminiFans