浏览代码

Merge branch 'master' of http://gogs.ioobot.com:6680/xy/online

wly 7 年之前
父节点
当前提交
005629cd45

+ 4 - 0
package.json

@@ -24,6 +24,7 @@
     "css-loader": "1.0.0",
     "dotenv": "6.0.0",
     "dotenv-expand": "4.2.0",
+    "draft-js": "^0.10.5",
     "eslint": "5.6.0",
     "eslint-config-react-app": "^3.0.5",
     "eslint-loader": "2.1.1",
@@ -59,12 +60,15 @@
     "react-app-polyfill": "^0.1.3",
     "react-dev-utils": "^6.1.0",
     "react-dom": "^16.6.0",
+    "react-draft-wysiwyg": "^1.12.13",
     "react-intl": "^2.7.2",
     "react-router": "^4.3.1",
     "react-router-dom": "^4.3.1",
     "redux": "^4.0.1",
     "resolve": "1.8.1",
     "sass-loader": "7.1.0",
+    "slate": "^0.44.9",
+    "slate-react": "^0.21.15",
     "style-loader": "0.23.0",
     "terser-webpack-plugin": "1.1.0",
     "url-loader": "1.1.1",

+ 112 - 0
src/all_graphql.txt

@@ -13,6 +13,33 @@ query userbyid($id: ID) {
   }
 }
 
+query ticketbyid($id: ID) {
+  ticketbyid: ticket_by_id(id: $id) {
+    updatedAt
+    repliedBy
+    content
+    repliedAt
+    createdAt
+    type
+    title
+    status
+    id
+    user_id {
+      email
+      updatedAt
+      password
+      telephone
+      nickname
+      username
+      createdAt
+      openid
+      id
+      avatar
+    }
+    screenshot
+  }
+}
+
 query notificationbyprops($user_id: ID, $type: String, $webhook: String, $name: String) {
   notificationbyprops: notification_by_props(user_id: $user_id type: $type webhook: $webhook name: $name) {
     id
@@ -894,6 +921,33 @@ query cloudbyprops($user_id: ID, $cloudName: String, $secretId: String, $secretK
   }
 }
 
+query ticketbyprops($updatedAt: String, $repliedBy: ID, $content: String, $repliedAt: String, $createdAt: String, $type: String, $title: String, $status: String, $user_id: ID) {
+  ticketbyprops: ticket_by_props(updatedAt: $updatedAt repliedBy: $repliedBy content: $content repliedAt: $repliedAt createdAt: $createdAt type: $type title: $title status: $status user_id: $user_id) {
+    updatedAt
+    repliedBy
+    content
+    repliedAt
+    createdAt
+    type
+    title
+    status
+    id
+    user_id {
+      email
+      updatedAt
+      password
+      telephone
+      nickname
+      username
+      createdAt
+      openid
+      id
+      avatar
+    }
+    screenshot
+  }
+}
+
 query userbyprops($email: String, $updatedAt: String, $password: String, $telephone: String, $nickname: String, $username: String, $createdAt: String, $openid: String, $avatar: String) {
   userbyprops: user_by_props(email: $email updatedAt: $updatedAt password: $password telephone: $telephone nickname: $nickname username: $username createdAt: $createdAt openid: $openid avatar: $avatar) {
     email
@@ -1943,6 +1997,10 @@ mutation createnotification($id: ID!, $user_id: ID, $type: String, $webhook: Str
   }
 }
 
+mutation deleteticket($updatedAt: String, $repliedBy: ID, $content: String, $repliedAt: String, $createdAt: String, $type: String, $title: String, $status: String, $id: ID, $user_id: ID) {
+  deleteticket: delete_ticket(updatedAt: $updatedAt repliedBy: $repliedBy content: $content repliedAt: $repliedAt createdAt: $createdAt type: $type title: $title status: $status id: $id user_id: $user_id)
+}
+
 mutation updatenotification($id: ID, $user_id: ID, $type: String, $webhook: String, $name: String) {
   updatenotification: update_notification(id: $id user_id: $user_id type: $type webhook: $webhook name: $name) {
     id
@@ -2082,6 +2140,60 @@ mutation updateapiGWGroup($environmentName: String, $userStatus: String, $defaul
   }
 }
 
+mutation updateticket($updatedAt: String, $repliedBy: ID, $content: String, $repliedAt: String, $createdAt: String, $type: String, $title: String, $status: String, $id: ID, $user_id: ID, $screenshot: String) {
+  updateticket: update_ticket(updatedAt: $updatedAt repliedBy: $repliedBy content: $content repliedAt: $repliedAt createdAt: $createdAt type: $type title: $title status: $status id: $id user_id: $user_id screenshot: $screenshot) {
+    updatedAt
+    repliedBy
+    content
+    repliedAt
+    createdAt
+    type
+    title
+    status
+    id
+    user_id {
+      email
+      updatedAt
+      password
+      telephone
+      nickname
+      username
+      createdAt
+      openid
+      id
+      avatar
+    }
+    screenshot
+  }
+}
+
+mutation createticket($updatedAt: String, $repliedBy: ID, $content: String, $repliedAt: String, $createdAt: String, $type: String, $title: String, $status: String, $id: ID!, $user_id: ID, $screenshot: String) {
+  createticket: create_ticket(updatedAt: $updatedAt repliedBy: $repliedBy content: $content repliedAt: $repliedAt createdAt: $createdAt type: $type title: $title status: $status id: $id user_id: $user_id screenshot: $screenshot) {
+    updatedAt
+    repliedBy
+    content
+    repliedAt
+    createdAt
+    type
+    title
+    status
+    id
+    user_id {
+      email
+      updatedAt
+      password
+      telephone
+      nickname
+      username
+      createdAt
+      openid
+      id
+      avatar
+    }
+    screenshot
+  }
+}
+
 mutation createwxConfig($updatedAt: String, $mch_id: String, $appName: String, $notify_url: String, $appSecret: String, $createdAt: String, $appID: String, $token: String, $spbill_create_ip: String, $enter_url: String, $id: ID!, $pay_api_key: String, $user_id: ID, $body: String, $welcome_words: String, $attach: String) {
   createwxConfig: create_wxConfig(updatedAt: $updatedAt mch_id: $mch_id appName: $appName notify_url: $notify_url appSecret: $appSecret createdAt: $createdAt appID: $appID token: $token spbill_create_ip: $spbill_create_ip enter_url: $enter_url id: $id pay_api_key: $pay_api_key user_id: $user_id body: $body welcome_words: $welcome_words attach: $attach) {
     updatedAt

+ 1 - 1
src/app/common/deploy/Deploy.jsx

@@ -37,7 +37,7 @@ class Deploy extends Component {
 
     render() {
         const contentListNoTitle = {
-            tencent: <TencentConfig userID={this.props.userID} projectID={this.props.projectID} trialcase={this.props.trialcase}/>,
+            tencent: <TencentConfig userID={this.props.userID} projectID={this.props.projectID} trialcase={this.props.trialcase} kind={this.props.kind}/>,
             aliyun: <AliConfig/>,
             amazon: <AmazonConfig/>,
         };

+ 48 - 28
src/app/common/deploy/tencent/TencentConfig.js

@@ -22,6 +22,7 @@ class TencentConfig extends Component {
             deployIdPassToPath: '',
             groupIdPassToPath: '',
             pathIdPassToConfig: '',
+            reachStep: '',
             currentStep: '',
             stepAllShow: false,
             deploying: '',
@@ -30,7 +31,7 @@ class TencentConfig extends Component {
     }
 
     componentWillMount() {
-        let projectID = this.props.projectID ? this.props.projectID : 'ecommerce_projectID';
+        let projectID = this.props.projectID ? this.props.projectID : this.props.kind === 'graphql' ? 'ecommerce_projectID' : 'ecommerce_projectID_wx';
 
         request(graphqlUrl, GET_PROJECT, {id: projectID}).then(
             data => {
@@ -44,33 +45,39 @@ class TencentConfig extends Component {
                         case 'deployed':
                             this.setState({
                                 currentStep: 5,
+                                reachStep: 5,
                                 stepAllShow: true,
                                 deploying: 'deployed'
                             });
                             break;
                         case 'notificationed':
                             this.setState({
-                                currentStep: 4
+                                currentStep: 4,
+                                reachStep: 4,
                             });
                             break;
                         case 'pathed':
                             this.setState({
-                                currentStep: 3
+                                currentStep: 3,
+                                reachStep: 3,
                             });
                             break;
                         case 'grouped':
                             this.setState({
-                                currentStep: 2
+                                currentStep: 2,
+                                reachStep: 2
                             });
                             break;
                         case 'functioned':
                             this.setState({
-                                currentStep: 1
+                                currentStep: 1,
+                                reachStep: 1
                             });
                             break;
                         case 'created':
                             this.setState({
-                                currentStep: 0
+                                currentStep: 0,
+                                reachStep: 0
                             });
                             break;
                         case 'updated':
@@ -87,7 +94,8 @@ class TencentConfig extends Component {
                             break;
                         default:
                             this.setState({
-                                currentStep: 0
+                                currentStep: 0,
+                                reachStep: 0
                             });
                             break;
                     }
@@ -125,32 +133,38 @@ class TencentConfig extends Component {
                             this.setState({
                                 deploying: 'deployed',
                                 currentStep: 5,
+                                reachStep: 5,
                                 stepAllShow: true
                             });
                             break;
                         case 'notificationed':
                             this.setState({
-                                currentStep: 4
+                                currentStep: 4,
+                                reachStep: 4
                             });
                             break;
                         case 'pathed':
                             this.setState({
-                                currentStep: 3
+                                currentStep: 3,
+                                reachStep: 3
                             });
                             break;
                         case 'grouped':
                             this.setState({
-                                currentStep: 2
+                                currentStep: 2,
+                                reachStep: 2
                             });
                             break;
                         case 'functioned':
                             this.setState({
-                                currentStep: 1
+                                currentStep: 1,
+                                reachStep: 1
                             });
                             break;
                         case 'created':
                             this.setState({
-                                currentStep: 0
+                                currentStep: 0,
+                                reachStep: 0
                             });
                             break;
                         case 'updated':
@@ -167,7 +181,8 @@ class TencentConfig extends Component {
                             break;
                         default:
                             this.setState({
-                                currentStep: 0
+                                currentStep: 0,
+                                reachStep: 0
                             });
                             break;
                     }
@@ -268,16 +283,19 @@ class TencentConfig extends Component {
         );
     };
 
-    stepByStep = (stepNum) => {
-        this.setState({
-            currentStep: stepNum
-        })
+    stepByStep = (bool) => {
+        return (stepNum) => {
+            this.setState({
+                currentStep: stepNum,
+                reachStep: bool ? stepNum : this.state.reachStep
+            })
+        };
     };
 
     stepStatus = (value) => {
-        if (this.state.currentStep === value)
+        if (this.state.reachStep === value)
             return '进行中';
-        else if (this.state.currentStep > value)
+        else if (this.state.reachStep > value)
             return '完成';
         else
             return '等待';
@@ -311,16 +329,19 @@ class TencentConfig extends Component {
                                     <Steps current={this.state.deploying !== 'deploying' ? this.state.currentStep : 4}
                                            style={{marginBottom: 30}}>
                                         <Step onClick={() => {
-                                            this.stepByStep(0)
+                                            this.stepByStep(false)(0)
                                         }} title={this.stepStatus(0)} description="云函数配置"/>
                                         <Step onClick={() => {
-                                            this.stepByStep(1)
+                                            if (this.state.reachStep > 0)
+                                                this.stepByStep(false)(1);
                                         }} title={this.stepStatus(1)} description="服务配置"/>
                                         <Step onClick={() => {
-                                            this.stepByStep(2)
+                                            if (this.state.reachStep > 1)
+                                                this.stepByStep(false)(2)
                                         }} title={this.stepStatus(2)} description="API 配置"/>
                                         <Step onClick={() => {
-                                            this.stepByStep(3)
+                                            if (this.state.reachStep > 2)
+                                                this.stepByStep(false)(3)
                                         }} title={this.stepStatus(3)} description="通知配置"/>
                                     </Steps>
                                     :
@@ -337,8 +358,7 @@ class TencentConfig extends Component {
                                                         switchRegion={this.switchRegion}
                                                         region={this.state.region}
                                                         trialcase={this.props.trialcase}
-                                                        stepByStep={this.stepByStep}
-                                                        userID={this.props.userID}
+                                                        stepByStep={this.stepByStep(true)}
                                                         projectID={projectID}
                                                     />
                                                 </Card>
@@ -358,7 +378,7 @@ class TencentConfig extends Component {
                                                         switchRegion={this.switchRegion}
                                                         region={this.state.region}
                                                         trialcase={this.props.trialcase}
-                                                        stepByStep={this.stepByStep}
+                                                        stepByStep={this.stepByStep(true)}
                                                         userID={this.props.userID}
                                                         projectID={projectID}
                                                         stepAllShow={this.state.stepAllShow}
@@ -377,7 +397,7 @@ class TencentConfig extends Component {
                                                 <Card title={msg} style={{marginBottom: 10}}>
                                                     <APIPathCardFetch
                                                         trialcase={this.props.trialcase}
-                                                        stepByStep={this.stepByStep}
+                                                        stepByStep={this.stepByStep(true)}
                                                         userID={this.props.userID}
                                                         projectID={projectID}
                                                         stepAllShow={this.state.stepAllShow}
@@ -398,7 +418,7 @@ class TencentConfig extends Component {
                                                     <NotificationCardFetch
                                                         userID={this.props.userID}
                                                         trialcase={this.props.trialcase}
-                                                        stepByStep={this.stepByStep}
+                                                        stepByStep={this.stepByStep(true)}
                                                         projectID={projectID}
                                                         stepAllShow={this.state.stepAllShow}
                                                     />

+ 1 - 1
src/app/common/manage/Manage.jsx

@@ -36,7 +36,7 @@ class Manage extends Component {
 
     render() {
         const contentListNoTitle = {
-            tencent: <TencentResult userID={this.props.userID} projectID={this.props.projectID} trialcase={this.props.trialcase} switchMenu={this.props.switchMenu}/>,
+            tencent: <TencentResult userID={this.props.userID} projectID={this.props.projectID} trialcase={this.props.trialcase} switchMenu={this.props.switchMenu} kind={this.props.kind}/>,
             aliyun: <AliyunResult/>,
             amazon: <AmazonResult/>,
         };

+ 175 - 8
src/app/common/manage/TencentResult.js

@@ -1,10 +1,22 @@
 import React, {Component} from 'react';
 import {FormattedMessage} from 'react-intl';
 import {Switch, Input, Icon, Spin, Row, Col, message} from 'antd';
-import {GET_PROJECT, SHOW_APIGWPATH, UPDATE_APIGROUP} from "../../../gql";
+import {
+    DELETE_APIGWPATH,
+    DELETE_APIGROUP,
+    GET_PROJECT,
+    SHOW_APIGWPATH,
+    UPDATE_APIGROUP,
+    UPDATE_PROJECT_ONLY_STATUS
+} from "../../../gql";
+import {request} from 'graphql-request'
 import gql from "graphql-tag";
 import {Query, Mutation} from "react-apollo";
 import copy from 'copy-to-clipboard';
+import axios from 'axios';
+import {removeAPI, graphqlUrl} from "../../../config";
+
+axios.defaults.withCredentials = true;
 
 class TencentResult extends Component {
     constructor(props) {
@@ -13,7 +25,7 @@ class TencentResult extends Component {
     }
 
     render() {
-        let projectID = this.props.projectID ? this.props.projectID : 'ecommerce_projectID';
+        let projectID = this.props.projectID ? this.props.projectID : this.props.kind === 'graphql' ? 'ecommerce_projectID' : 'ecommerce_projectID_wx';
         return (
             <Query query={gql(GET_PROJECT)} variables={{id: projectID}} fetchPolicy={'network-only'}>
                 {
@@ -26,10 +38,12 @@ class TencentResult extends Component {
                         }
                         let group = data.project_by_id.apiGWGroup_id || {};
                         let projectType = data.project_by_id.projectType || 'graphql';
+                        let projectStatus = data.project_by_id.projectStatus || 'created';
+                        let cloudID = data.project_by_id.cloud_id || 'tencent_CloudID';
                         return (
                             <div>
                                 {
-                                    Object.keys(group).length !== 0 ?
+                                    projectStatus === 'deployed'?
                                         <div>
                                             <div className={'schema-name'}><FormattedMessage id='service manage'/></div>
                                             <div className={'schema-table-list-title'}>
@@ -67,7 +81,18 @@ class TencentResult extends Component {
                                                                 :
                                                                 <SwitchStatus group={group}/>
                                                         }
-                                                        {/*<span className={'schema-table-content name'}>删除</span>*/}
+                                                        &nbsp;
+                                                        {
+                                                            this.props.trialcase ?
+                                                                ''
+                                                                :
+                                                                <DeleteGroupSpan
+                                                                cloudID={cloudID}
+                                                                groupID={group.id}
+                                                                projectID={projectID}
+                                                                userID={this.props.userID}
+                                                            />
+                                                        }
                                                     </span>
                                                     </Col>
                                                 </Row>
@@ -78,11 +103,18 @@ class TencentResult extends Component {
                                                     group={group}
                                                     projectType={projectType}
                                                     switchMenu={this.props.switchMenu}
+                                                    cloudID={cloudID}
+                                                    projectID={projectID}
+                                                    userID={this.props.userID}
+                                                    trialcase={this.props.trialcase}
                                                 />
                                             </div>
                                         </div>
                                         :
-                                        <FormattedMessage id='No deploy'/>
+                                        projectStatus === 'updated'?
+                                            <FormattedMessage id='deploy updated'/>
+                                            :
+                                            <FormattedMessage id='No deploy'/>
                                 }
                             </div>
                         )
@@ -159,7 +191,7 @@ class APIGWPathResult extends Component {
 
     render() {
         let {group, projectType} = this.props;
-        let {id, frontType, defaultDomain, environmentName} = group;
+        let {id} = group;
         return (
             <Query query={gql(SHOW_APIGWPATH)} variables={{apiGWGroup_id: id}} fetchPolicy={'network-only'}>
                 {
@@ -202,8 +234,6 @@ class APIGWPathResult extends Component {
                                                                 <span className={'schema-table-content'}>{path.apiGWDesc}</span>
                                                             </Col>
                                                             <Col span={3}>
-                                                                {/*<span className={'schema-table-content name'}>删除</span>*/}
-                                                                {/*&nbsp;*/}
                                                                 {
                                                                     projectType === 'graphql'?
                                                                         <span className={'schema-table-content name'}
@@ -215,6 +245,19 @@ class APIGWPathResult extends Component {
                                                                         :
                                                                         ''
                                                                 }
+                                                                &nbsp;
+                                                                {
+                                                                    this.props.trialcase?
+                                                                        ''
+                                                                        :
+                                                                        <DeletePathSpan
+                                                                            cloudID={this.props.cloudID}
+                                                                            groupID={id}
+                                                                            path={path}
+                                                                            projectID={this.props.projectID}
+                                                                            userID={this.props.userID}
+                                                                        />
+                                                                }
 
                                                             </Col>
                                                         </Row>
@@ -234,3 +277,127 @@ class APIGWPathResult extends Component {
         )
     }
 }
+
+class DeletePathSpan extends Component {
+    constructor(props) {
+        super(props);
+        this.state = {
+
+        }
+    }
+
+    render() {
+        return (
+            <Mutation
+                mutation={gql(DELETE_APIGWPATH)}
+                refetchQueries={[{query: gql(SHOW_APIGWPATH), variables: {apiGWGroup_id: this.props.groupID}}]}
+            >
+                {(delete_apiGWPath, {loading, error}) => {
+                    if (error)
+                        return 'error';
+                    if (loading)
+                        return <Spin style={{marginLeft: 3}}/>;
+
+                    return (
+                        <span className={'schema-table-content name'} onClick={() => {
+                                  let _this = this;
+                                  axios.get(`${removeAPI}`, {
+                                      params: {
+                                          'cloud-id': `${_this.props.cloudID}`,
+                                          'group-id': `${_this.props.groupID}`,
+                                          'api-id': `${_this.props.path.id}`
+                                      }
+                                  })
+                                      .then((res) => {
+                                          console.log('delete api');
+                                          if (res.data !== '') {
+
+                                              console.log('path id', _this.props.path.id, 'user id', _this.props.userID);
+
+                                              delete_apiGWPath({variables: {id:_this.props.path.id, user_id: _this.props.userID}});
+
+                                              // 写回 project 状态
+                                              request(graphqlUrl, UPDATE_PROJECT_ONLY_STATUS, {
+                                                  id: this.props.projectID,
+                                                  updatedAt: new Date().getTime(),
+                                                  projectStatus: 'grouped'
+                                              });
+
+                                              console.log(res.data);
+                                          } else {
+                                              console.log('error');
+                                          }
+                                      })
+                                      .catch((err) => {
+                                          console.log(err);
+                                      });
+                              }}
+                        >
+                            删除
+                        </span>
+                    )
+                }}
+            </Mutation>
+        )
+    }
+}
+
+class DeleteGroupSpan extends Component {
+    constructor(props) {
+        super(props);
+        this.state = {
+        }
+    }
+
+    render() {
+        let {projectID, cloudID, groupID, userID} = this.props;
+        return (
+            <Mutation
+                mutation={gql(DELETE_APIGROUP)}
+                refetchQueries={[{query: gql(GET_PROJECT), variables: {id: projectID}}]}
+            >
+                {(delete_apiGWGroup, {loading, error}) => {
+                    if (error)
+                        return 'error';
+                    if (loading)
+                        return <Spin style={{marginLeft: 3}}/>;
+
+                    return (
+                        <span className={'schema-table-content name'} onClick={() => {
+                            axios.get(`${removeAPI}`, {
+                                params: {
+                                    'cloud-id': `${cloudID}`,
+                                    'group-id': `${groupID}`,
+                                }
+                            })
+                                .then((res) => {
+                                    console.log('delete service');
+                                    if (res.data !== '') {
+
+                                        delete_apiGWGroup({variables: {id: groupID, user_id: userID}});
+
+                                        // 写回 project 状态
+                                        request(graphqlUrl, UPDATE_PROJECT_ONLY_STATUS, {
+                                            id: projectID,
+                                            updatedAt: new Date().getTime(),
+                                            projectStatus: 'functioned'
+                                        });
+
+                                        console.log(res.data);
+                                    } else {
+                                        console.log('error');
+                                    }
+                                })
+                                .catch((err) => {
+                                    console.log(err);
+                                });
+                        }}
+                        >
+                            删除
+                        </span>
+                    )
+                }}
+            </Mutation>
+        )
+    }
+}

+ 2 - 2
src/app/graphqlService/TrialCase.jsx

@@ -87,9 +87,9 @@ class TrialCase extends Component {
                                     case 'schema':
                                         return <Schema trialcase={true} userID={this.state.userID} projectID={projectID} schemaName={schemaName} schemaID={schemaID} history={this.props.history} location={this.props.location}/>;
                                     case 'deploy':
-                                        return <Deploy trialcase={true} userID={this.state.userID} projectID={projectID}/>;
+                                        return <Deploy trialcase={true} userID={this.state.userID} projectID={projectID} kind={'graphql'}/>;
                                     case 'manage':
-                                        return <Manage trialcase={true} userID={this.state.userID} projectID={projectID} switchMenu={this.switchMenu}/>;
+                                        return <Manage trialcase={true} userID={this.state.userID} projectID={projectID} switchMenu={this.switchMenu} kind={'graphql'}/>;
                                     case 'graphiql':
                                         return <Graphql api={this.state.api} projectID={projectID}/>;
                                     case 'template':

+ 2 - 2
src/app/wechatService/WxTrialCase.js

@@ -55,9 +55,9 @@ class WxTrialCase extends Component {
                                 case 'wechat-config':
                                     return <WxConfig trialcase={true} userID={this.state.userID} projectID={projectID} defaultAppName={'ecommerce'} defaultConfigID={'ecommerce_wxConfigID'} history={this.props.history} location={this.props.location}/>;
                                 case 'wechat-deploy':
-                                    return <WxDeploy trialcase={true} userID={this.state.userID} projectID={projectID}/>;
+                                    return <WxDeploy trialcase={true} userID={this.state.userID} projectID={projectID} kind={'wx'}/>;
                                 case 'wechat-manage':
-                                    return <Manage trialcase={true} userID={this.state.userID} projectID={projectID}/>;
+                                    return <Manage trialcase={true} userID={this.state.userID} projectID={projectID} kind={'wx'}/>;
                                 default:
                                     return <WxConfig/>
                             }

+ 3 - 1
src/config.js

@@ -29,9 +29,11 @@ const backendGQ = backend + '/graphql';
 const genJsUrl = backendGQ + '/genjs';
 const checkSchemaUrl = backendGQ + '/compile';
 const deployUrl = backendGQ + '/deployall';
+const removeFC = backendGQ + '/removefc';
+const removeAPI = backendGQ + '/removeapi';
 
 // 管理员配置
 // 通过在该数组中添加 userID,可以管理 trialcase 的增删改查
 const manageUsers = ['xy_1_je9{d\'\'_32sD+'];
 
-export {getIdUrl, loginUrl, registerUrl, checkSchemaUrl, deployUrl, genJsUrl, graphqlUrl, manageUsers}
+export {getIdUrl, loginUrl, registerUrl, checkSchemaUrl, deployUrl, genJsUrl, graphqlUrl, manageUsers, removeFC, removeAPI}

+ 16 - 0
src/gql.js

@@ -583,6 +583,12 @@ const UPDATE_APIGROUP = `
             }
         `;
 
+const DELETE_APIGROUP = `
+            mutation deleteapiGWGroup($id: ID, $user_id: ID) {
+                delete_apiGWGroup(id: $id user_id: $user_id)
+            }
+        `;
+
 const SHOW_APIGWPATH = `
             query PATH($apiGWGroup_id: ID!) {
                 apiGWPath_by_props(apiGWGroup_id: $apiGWGroup_id) {
@@ -631,6 +637,12 @@ const UPDATE_APIGWPATH = `
         `;
 
 
+const DELETE_APIGWPATH = `
+            mutation deleteapiGWPath($id: ID, $user_id: ID) {
+                delete_apiGWPath(id: $id user_id: $user_id)
+            }
+        `;
+
 
 const SHOW_ALL_WXCONFIG = `
             query WXCONFIG($user_id: ID) {
@@ -970,6 +982,8 @@ const UPDATE_NOTIFICATION = `
             }
         `;
 
+
+
 export {
     ADD_USER,
     GET_USER,
@@ -995,9 +1009,11 @@ export {
     UPDATE_DEPLOY,
     ADD_APIGROUP,
     UPDATE_APIGROUP,
+    DELETE_APIGROUP,
     SHOW_APIGWPATH,
     ADD_APIGWPATH,
     UPDATE_APIGWPATH,
+    DELETE_APIGWPATH,
     ADD_PROJECT_AND_WX,
     SHOW_ALL_WXCONFIG,
     SHOW_WXCONFIG,

+ 1 - 0
src/language/en_US.js

@@ -64,6 +64,7 @@ const en_US = {
     'userStatus': 'open/close',
     'operation':'operation',
     'No deploy':'No deploy',
+    'deploy updated':'deploy updated, re-deploy please',
     'method':'method',
     'path':'path',
     'try':'try',

+ 1 - 0
src/language/zh_CN.js

@@ -64,6 +64,7 @@ const zh_CN = {
     'userStatus': '开启状态',
     'operation':'操作',
     'No deploy':'尚未部署',
+    'deploy updated':'部署参数已更新,请重新部署',
     'method':'方法',
     'path':'路径',
     'try':'调试',

+ 29 - 2
src/ticket/Ticket.js

@@ -1,21 +1,48 @@
 import React, {Component} from 'react';
 import {Layout} from 'antd';
+import { Editor } from 'slate-react'
+import { Value } from 'slate'
 
 const {Content} = Layout;
 
+const initialValue = Value.fromJSON({
+    document: {
+        nodes: [
+            {
+                object: 'block',
+                type: 'paragraph',
+                nodes: [
+                    {
+                        object: 'text',
+                        leaves: [
+                            {
+                                text: 'A line of text in a paragraph.',
+                            },
+                        ],
+                    },
+                ],
+            },
+        ],
+    },
+});
+
 class Ticket extends Component {
     constructor() {
         super();
         this.state = {
-            kind: '工单'
+            value: initialValue,
         }
     }
 
+    onChange = ({ value }) => {
+        this.setState({ value })
+    };
+
     render() {
         return (
             <Layout style={{padding: '24px', zIndex: '0'}}>
                 <Content style={{padding: '24px', minHeight: 280, background: '#fff'}}>
-                    <div>Ticket</div>
+                    <Editor value={this.state.value} onChange={this.onChange} />
                 </Content>
             </Layout>
         )