Browse Source

add 订阅规则

王文博 5 years ago
parent
commit
dee4258351

+ 1 - 1
.npmrc

@@ -1 +1 @@
-registry=http://npm.wpt.la/
+registry=https://registry.npm.taobao.org

+ 1 - 1
.yarnrc

@@ -1 +1 @@
-registry=http://npm.wpt.la/
+registry=https://registry.npm.taobao.org

+ 3 - 1
package.json

@@ -14,10 +14,12 @@
     "lodash": "^4.17.15",
     "react": "^16.9.0",
     "react-dom": "^16.9.0",
-    "wptpc-design": "^1.1.90"
+    "wptpc-design": "^1.1.99"
   },
   "devDependencies": {
+    "@babel/plugin-proposal-decorators": "^7.7.4",
     "babel-eslint": "^10.0.3",
+    "babel-plugin-transform-decorators-legacy": "^1.3.5",
     "eslint": "^6.4.0",
     "eslint-config-standard": "^14.1.0",
     "eslint-plugin-import": "^2.18.2",

+ 2 - 0
src/pages/dc/data.js

@@ -104,11 +104,13 @@ class Index extends React.PureComponent {
   // 点击编辑按钮时的事件处理函数
   editItem (record) {
     const fields = JSON.parse(record.fieldsJson)
+    console.log(fields)
     const fieldsJson = Object.keys(fields).map(f => ({
       key: f,
       desc: fields[f].desc,
       column: fields[f].column
     }))
+    console.log(fieldsJson)
     this.setState({
       showModal: true,
       params: {

+ 69 - 138
src/pages/dc/subscribe/components/Edit/index.js

@@ -1,7 +1,7 @@
 import React, { Component } from 'react'
-import { Modal, Input, Icon, Select, Radio, Checkbox, Button } from 'antd'
+import { Modal } from 'antd'
 import { FormItem } from 'wptpc-design'
-import s from './index.less'
+// import s from './index.less'
 // import CheckBox from 'rc-checkbox'
 
 export default class Index extends Component {
@@ -12,149 +12,80 @@ export default class Index extends Component {
     }
     this.formSetting = [
       {
-      label: '订阅描述',
-      type: 'input',
-      key: 'description',
-      isRequired: true,
-      placeholder: '请输入'
-    },
-    {
-      label: '订阅主题',
-      type: 'input',
-      key: 'topic',
-      isRequired: true,
-      placeholder: '请输入'
-    },
-    {
-      label: '回调地址',
-      type: 'input',
-      key: 'url',
-      isRequired: true,
-      placeholder: '请输入'
-    }, {
-      label: '订阅数据库',
-      type: 'input',
-      key: 'subDb',
-      isRequired: true,
-      placeholder: '请输入'
-    },
-    {
-      label:'订阅数据表',
-      type:'input',
-      key:'subTable',
-      isRequired:true,
-      placeholder:'请输入'
-    },
-    {
-      label:'订阅事件',
-      type:'input',
-      key:'subEvent',
-      isRequired:true,
-      placeholder:'请输入'
-    },
-    {
-      label:'订阅字段',
-      type:'input',
-      key:'subFields',
-      isRequired:true,
-      placeholder:'请输入'
-    },
-    {
-      label:'过滤条件',
-      type:'input',
-      key:'subFilter',
-      isRequired:true,
-      placeholder:'请输入'
-    },
-    {
-      label:'回调参数',
-      type:'input',
-      key:'params',
-      isRequired:true,
-      placeholder:'请输入'
-    },
-    // {
-    //   label: 'JSON',
-    //   formItemLayout:{
-    //     labelCol: {
-    //       xs: { span: 24 },
-    //       sm: { span: 1 },
-    //     },
-    //     wrapperCol: {
-    //       xs: { span: 24 },
-    //       sm: { span: 23 },
-    //     },
-    //   },
-    //   render: () => {
-    //     const { fieldsJson } = this.state.params
-    //     return <div>
-    //       <div><Icon type="plus" onClick={() => {
-    //         fieldsJson.push({})
-    //         this.onParamsChange('fieldsJson', fieldsJson)
-    //       }}/></div>
-    //       <div className={s.spanMargin}>
-    //         <span>* 订阅描述</span>
-    //         <span>* 查询名</span>
-    //         <span>* 唯一标识</span>
-    //         <span>* 返回数据字段</span>
-    //         <span>* 订阅类型</span>
-    //         <span>* 缓存类型-天</span>
-    //         <span>* 缓存类型-小时</span>
-    //         <span>* 操作</span>
-    //       </div>
-    //       <div>
-    //         {fieldsJson.map((f, index) => <div>
-    //           <Input value={f.description} onChange={(e) => {
-    //             fieldsJson[index].description = e.target.value
-    //             this.onParamsChange('fieldsJson', fieldsJson)
-    //           }} style={{ width: 120, marginRight: 10 }}/>
-    //           <Input value={f.name} onChange={(e) => {
-    //             fieldsJson[index].name = e.target.value
-    //             this.onParamsChange('fieldsJson', fieldsJson)
-    //           }} style={{ width: 120, marginRight: 10 }}/>
-    //           <Input value={f.uniqueId} onChange={(e) => {
-    //             fieldsJson[index].uniqueId = e.target.value
-    //             this.onParamsChange('fieldsJson', fieldsJson)
-    //           }} style={{ width: 120, marginRight: 10 }}/>
-    //           <Input value={f.fields} onChange={(e) => {
-    //             fieldsJson[index].fields = e.target.value
-    //             this.onParamsChange('fieldsJson', fieldsJson)
-    //           }} style={{ width: 120, marginRight: 10 }}/>
-    //           <Select value={f.type} style={{width:120, marginRight: 10}}>
-    //             <Select.Option value={1}>自增</Select.Option>
-    //             <Select.Option value={2}>变量增加</Select.Option>
-    //           </Select>
-    //           <Checkbox style={{width:120, marginRight: 10}}>按天缓存</Checkbox>
-    //           <Checkbox style={{width:120, marginRight: 10}}>按小时缓存</Checkbox>
-    //           <Button type="primary"  onClick={this.clickSaveJob} size="small" style={{marginRight: 5}}>保存</Button>
-    //           <Button type="danger" onClick={this.clickDeleteJob} size="small" onClick={this.deleteItem(index)}>删除</Button>
-    //           {/* <Icon onClick={(e) => {
-    //             fieldsJson.splice(index, 1)
-    //             this.onParamsChange('fieldsJson', fieldsJson)
-    //           }} type="close"/> */}
-    //         </div>)}
-    //       </div>
-    //     </div>
-    //   }
-    // }
+        label: '订阅描述',
+        type: 'input',
+        key: 'description',
+        isRequired: true,
+        placeholder: '请输入'
+      },
+      {
+        label: '订阅主题',
+        type: 'input',
+        key: 'topic',
+        isRequired: true,
+        placeholder: '请输入'
+      },
+      {
+        label: '回调地址',
+        type: 'input',
+        key: 'url',
+        isRequired: true,
+        placeholder: '请输入'
+      }, {
+        label: '订阅数据库',
+        type: 'input',
+        key: 'subDb',
+        isRequired: true,
+        placeholder: '请输入'
+      },
+      {
+        label: '订阅数据表',
+        type: 'input',
+        key: 'subTable',
+        isRequired: true,
+        placeholder: '请输入'
+      },
+      {
+        label: '订阅事件',
+        type: 'input',
+        key: 'subEvent',
+        isRequired: true,
+        placeholder: '请输入'
+      },
+      {
+        label: '订阅字段',
+        type: 'input',
+        key: 'subFields',
+        isRequired: true,
+        placeholder: '请输入'
+      },
+      {
+        label: '过滤条件',
+        type: 'input',
+        key: 'subFilter',
+        isRequired: true,
+        placeholder: '请输入'
+      },
+      {
+        label: '回调参数',
+        type: 'input',
+        key: 'params',
+        isRequired: true,
+        placeholder: '请输入'
+      }
     ]
   }
 
-  clickSaveJob = () => {
-    console.log('save');
-
-  }
-
   deleteItem = (index) => () => {
-    const { params } = this.state;
-    const { fieldsJson } = params;
-    fieldsJson.splice(index, 1);
+    const { params } = this.state
+    const { fieldsJson } = params
+    fieldsJson.splice(index, 1)
     this.setState({
-      params:{
+      params: {
         ...params,
-        fieldsJson,
+        fieldsJson
       }
-    });
+    })
   }
 
   clickDeleteJob = () => {

+ 144 - 84
src/pages/dc/subscribe/components/Job/index.js

@@ -1,102 +1,154 @@
-import React, { Component } from 'react'
-import { Modal, Input, Icon, Select, Radio, Checkbox, Button } from 'antd'
+import React from 'react'
+import { connect } from 'dva'
+
+import { Modal, Input, Icon, Select, Checkbox, Button, message } from 'antd'
 import { FormItem } from 'wptpc-design'
 import s from './index.less'
+// import { decorators } from 'handlebars'
+// import { thisExpression } from '@babel/types'
 // import CheckBox from 'rc-checkbox'
 
-export default class JobModal extends Component {
+@connect(() => ({}))
+
+class JobModal extends React.PureComponent {
   constructor (props) {
     super(props)
     this.state = {
       params: {}
     }
-    debugger;
+    // debugger;
     this.formSetting = [
-    {
-      label: 'JSON',
-      formItemLayout:{
-        labelCol: {
-          xs: { span: 24 },
-          sm: { span: 1 },
+      {
+        label: 'JSON',
+        formItemLayout: {
+          labelCol: {
+            xs: { span: 24 },
+            sm: { span: 1 }
+          },
+          wrapperCol: {
+            xs: { span: 24 },
+            sm: { span: 23 }
+          }
         },
-        wrapperCol: {
-          xs: { span: 24 },
-          sm: { span: 23 },
-        },
-      },
-      render: () => {
-        const { fieldsJson } = this.state.params
-        return <div>
-          <div><Icon type="plus" onClick={() => {
-            fieldsJson.push({})
-            this.onParamsChange('fieldsJson', fieldsJson)
-          }}/></div>
-          <div className={s.spanMargin}>
-            <span>* 订阅描述</span>
-            <span>* 查询名</span>
-            <span>* 唯一标识</span>
-            <span>* 返回数据字段</span>
-            <span>* 订阅类型</span>
-            <span>* 缓存类型-天</span>
-            <span>* 缓存类型-小时</span>
-            <span>* 操作</span>
-          </div>
-          <div>
-            {fieldsJson.map((f, index) => <div>
-              <Input value={f.description} onChange={(e) => {
-                fieldsJson[index].description = e.target.value
-                this.onParamsChange('fieldsJson', fieldsJson)
-              }} style={{ width: 120, marginRight: 10 }}/>
-              <Input value={f.name} onChange={(e) => {
-                fieldsJson[index].name = e.target.value
-                this.onParamsChange('fieldsJson', fieldsJson)
-              }} style={{ width: 120, marginRight: 10 }}/>
-              <Input value={f.uniqueId} onChange={(e) => {
-                fieldsJson[index].uniqueId = e.target.value
-                this.onParamsChange('fieldsJson', fieldsJson)
-              }} style={{ width: 120, marginRight: 10 }}/>
-              <Input value={f.fields} onChange={(e) => {
-                fieldsJson[index].fields = e.target.value
-                this.onParamsChange('fieldsJson', fieldsJson)
-              }} style={{ width: 120, marginRight: 10 }}/>
-              <Select value={f.type} style={{width:120, marginRight: 10}}>
-                <Select.Option value={1}>自增</Select.Option>
-                <Select.Option value={2}>变量增加</Select.Option>
-              </Select>
-              <Checkbox style={{width:120, marginRight: 10}}>按天缓存</Checkbox>
-              <Checkbox style={{width:120, marginRight: 10}}>按小时缓存</Checkbox>
-              <Button type="primary"  onClick={this.clickSaveJob} size="small" style={{marginRight: 5}}>保存</Button>
-              <Button type="danger" onClick={this.clickDeleteJob} size="small" onClick={this.deleteItem(index)}>删除</Button>
-              {/* <Icon onClick={(e) => {
-                fieldsJson.splice(index, 1)
-                this.onParamsChange('fieldsJson', fieldsJson)
-              }} type="close"/> */}
-            </div>)}
-          </div>
-        </div>
-      }
-    }]
-  }
-
-  clickSaveJob = () => {
-    console.log('save');
+        render: () => {
+          const { fieldsJson } = this.state.params
+          return <div>
+            <div><Icon type="plus" onClick={() => {
+              fieldsJson.push({
+                type: 1,
+                cacheDay: 1,
+                cacheHour: 0
+              })
+              this.onParamsChange('fieldsJson', fieldsJson)
+            }}/></div>
+            <div className={s.spanMargin}>
+              <span>* 订阅描述</span>
+              <span>* 查询名</span>
+              <span>* 唯一标识</span>
+              <span>* 返回数据字段</span>
+              <span>* 订阅类型</span>
+              <span>* 缓存类型-天</span>
+              <span>* 缓存类型-小时</span>
+              <span>* 操作</span>
+            </div>
+            <div>
+              {fieldsJson.map((f, index) => <div>
+                <Input value={f.description} onChange={(e) => {
+                  fieldsJson[index].sid = f.sid
+                  fieldsJson[index].description = e.target.value
+                  this.onParamsChange('fieldsJson', fieldsJson)
+                }} style={{ width: 120, marginRight: 10 }}/>
+                <Input value={f.name} onChange={(e) => {
+                  fieldsJson[index].name = e.target.value
+                  this.onParamsChange('fieldsJson', fieldsJson)
+                }} style={{ width: 120, marginRight: 10 }}/>
+                <Input value={f.uniqueId} onChange={(e) => {
+                  fieldsJson[index].uniqueId = e.target.value
+                  this.onParamsChange('fieldsJson', fieldsJson)
+                }} style={{ width: 120, marginRight: 10 }}/>
+                <Input value={f.fields} onChange={(e) => {
+                  fieldsJson[index].fields = e.target.value
+                  this.onParamsChange('fieldsJson', fieldsJson)
+                }} style={{ width: 120, marginRight: 10 }}/>
+                <Select value={f.type} onChange = {value => {
+                  fieldsJson[index].type = value
+                  this.onParamsChange('fieldsJson', fieldsJson)
+                }} style={{ width: 120, marginRight: 10 }}>
+                  <Select.Option value={1}>自增</Select.Option>
+                  <Select.Option value={2}>变量增加</Select.Option>
+                </Select>
+                <Checkbox checked={fieldsJson[index].cacheDay === 1} onChange={(e) => {
+                  fieldsJson[index].cacheDay = e.target.checked
+                  this.onParamsChange('fieldsJson', fieldsJson)
+                }} style={{ width: 120, marginRight: 10 }}>按天缓存</Checkbox>
+                <Checkbox checked={fieldsJson[index].cacheHour === 1} onChange={(e) => {
+                  fieldsJson[index].cacheHour = e.target.checked
+                  this.onParamsChange('fieldsJson', fieldsJson)
+                }} style={{ width: 120, marginRight: 10 }}>按小时缓存</Checkbox>
+                <Button type="primary" size="small" onClick={this.clickSaveJob(index)} style={{ marginRight: 5 }}>保存</Button>
+                <Button type="danger" size="small" onClick={this.clickDeleteJob(index)}>删除</Button>
 
+              </div>)}
+            </div>
+          </div>
+        }
+      }]
   }
 
-  deleteItem = (index) => () => {
-    const { params } = this.state;
-    const { fieldsJson } = params;
-    fieldsJson.splice(index, 1);
-    this.setState({
-      params:{
-        ...params,
-        fieldsJson,
+  clickSaveJob = (index) => () => {
+    const { params } = this.state
+    const { fieldsJson } = params
+    const type = 'template/_editSubJobItem'
+    console.log(params)
+    fieldsJson[index].sid = params.id
+    this.props.dispatch({
+      type,
+      payload: fieldsJson[index],
+      callback: res => {
+        const { code, data } = res || {}
+        if (code === 0) {
+          const msg = params.id ? '编辑成功' : '添加成功'
+          console.log(data)
+          fieldsJson[index].id = data
+          message.success(msg)
+          params.fieldsJson = fieldsJson
+          this.setState({
+            showModal: false,
+            params: {
+              ...params,
+              fieldsJson
+            }
+          })
+          this.refresh()
+        }
       }
-    });
+    })
   }
 
-  clickDeleteJob = () => {
-    console.log('delete')
+  clickDeleteJob = (index) => () => {
+    const { params } = this.state
+    const { fieldsJson } = params
+    const type = 'template/_deleteSubJobItem'
+    console.log(index)
+    this.props.dispatch({
+      type,
+      payload: { id: fieldsJson[index].id },
+      callback: res => {
+        const { code } = res || {}
+        if (code === 0) {
+          const msg = '删除成功'
+          message.success(msg)
+          fieldsJson.splice(index, 1)
+          this.setState({
+            params: {
+              ...params,
+              fieldsJson
+            }
+          })
+          this.refresh()
+        }
+      }
+    })
   }
 
   // 组件挂在的时候调用的生命周期函数
@@ -117,8 +169,14 @@ export default class JobModal extends Component {
     this.setState({ params })
   }
 
+  onJobCancel = () => {
+    const { onCancel } = this.props
+    const isEdit = true
+    if (onCancel) onCancel(isEdit)
+  }
+
   render () {
-    const { showModal, onCancel, loading } = this.props
+    const { showModal, loading } = this.props
     const { params } = this.state
 
     return (
@@ -126,7 +184,7 @@ export default class JobModal extends Component {
         title={'创建'}
         visible={showModal}
         onOk={this.onOk}
-        onCancel={onCancel}
+        onCancel={this.onJobCancel}
         // 确认按钮点击后,发起接口会处罚loading值的变化,从而控制确认按钮的状态(disable or enable)
         okButtonProps={{ disabled: loading }}
         width={1200}
@@ -136,3 +194,5 @@ export default class JobModal extends Component {
     )
   }
 }
+
+export default JobModal

+ 35 - 41
src/pages/dc/subscribe/data.js

@@ -18,9 +18,9 @@ class Index extends React.PureComponent {
     // 这两个state字段用来进行表单显示、隐藏控制以及表单里面的数据
     showModal: false,
     params: {},
-    jobModel:{
+    jobModel: {
       state: false,
-      params: {},
+      params: {}
     }
   }
 
@@ -72,40 +72,40 @@ class Index extends React.PureComponent {
         dataIndex: 'url'
       },
       {
-        title:'订阅数据库',
-        dataIndex:'subDb'
+        title: '订阅数据库',
+        dataIndex: 'subDb'
       },
       {
-        title:'订阅数据表',
-        dataIndex:'subTable'
+        title: '订阅数据表',
+        dataIndex: 'subTable'
       },
       {
-        title:'订阅事件',
-        dataIndex:'subEvent'
+        title: '订阅事件',
+        dataIndex: 'subEvent'
       },
       {
-        title:'订阅字段',
-        dataIndex:'subFields'
+        title: '订阅字段',
+        dataIndex: 'subFields'
       },
       {
-        title:'过滤条件',
-        dataIndex:'subFilter'
+        title: '过滤条件',
+        dataIndex: 'subFilter'
       },
       {
-        title:'回调参数',
-        dataIndex:'params'
+        title: '回调参数',
+        dataIndex: 'params'
       },
       {
         title: '操作',
         dataIndex: 'actions',
         // 所有需要弹窗操作的都可以用编辑的逻辑;所有不需要弹窗的操作,比如上架、发布等,都可以用”删除“的逻辑
         render: (text, record) => <span><a onClick={() => this.editItem(record)}>编辑</a>
-        <Divider type="vertical"/><a onClick={()=> this.editJob(record)}>任务</a><Divider
-          type="vertical"/><Popconfirm
-          title="确定删除"
-          onConfirm={() => this.delItem(record)}>
-          <a>删除</a>
-        </Popconfirm></span>
+          <Divider type="vertical"/><a onClick={() => this.editJob(record)}>任务</a><Divider
+            type="vertical"/><Popconfirm
+            title="确定删除"
+            onConfirm={() => this.delItem(record)}>
+            <a>删除</a>
+          </Popconfirm></span>
       }
     ],
     // 通过这个函数可以获取列表的刷新的函数,编辑、删除后可以用它来刷新列表
@@ -124,28 +124,21 @@ class Index extends React.PureComponent {
 
   // 点击编辑数据统计处理
   editJob (record) {
-    const fields = JSON.parse(record.fieldsJson)
-    const fieldsJson = Object.keys(fields).map(f => ({
-      key: f,
-      description: fields[f].description,
-      name: fields[f].name,
-      uniqueId: fields[f].uniqueId,
-      fields:fields[f].fields,
-      type:fields[f].type,
-      cacheDay:fields[f].cacheDay,
-      cacheHour:fields[f].cacheHour
-    }))
+    const fieldsJson = JSON.parse(record.fieldsJson)
+    console.log({
+      ...record,
+      fieldsJson
+    })
     this.setState({
-      jobModel:{
+      jobModel: {
         state: true,
-        params:{
+        params: {
           ...record,
           fieldsJson
         }
       }
     })
   }
-  
 
   // 点击编辑按钮时的事件处理函数
   editItem (record) {
@@ -159,7 +152,7 @@ class Index extends React.PureComponent {
       showModal: true,
       params: {
         ...record,
-        fieldsJson,
+        fieldsJson
       }
     })
   }
@@ -214,9 +207,8 @@ class Index extends React.PureComponent {
       }
       return t
     }, {})
-    console.log(fieldsJson, 1)
     params.fieldsJson = JSON.stringify(fieldsJson)
-    console.log(params, 2)
+    console.log(params, 235)
     const type = !params.id ? 'template/_addItem' : 'template/_editItem'
     this.props.dispatch({
       type,
@@ -233,13 +225,15 @@ class Index extends React.PureComponent {
     })
   }
 
-  onJobModalClose = () => {
+  onJobModalClose = isNeedReRender => {
     this.setState({
-      jobModel:{
+      jobModel: {
         state: false,
-        params:{},
+        params: {}
       }
-    });
+    }, () => {
+      if (isNeedReRender) this.refresh()
+    })
   }
 
   render () {

+ 7 - 7
src/pages/dc/subscribe/index.js

@@ -4,7 +4,7 @@ import { message, Divider, Popconfirm } from 'antd'
 import { FilterTable } from 'wptpc-design'
 import s from './index.less'
 import Edit from './components/Edit'
-const apiUrl = 'tabledata'
+const apiUrl = 'tabledata1'
 
 @connect(({ loading }) => ({
   // 添加或者编辑接口触发的loading属性,可以用于控制接口请求阶段让对话框的”确定“按钮不可点击
@@ -21,7 +21,7 @@ class Index extends React.PureComponent {
   filterSetting = {
     isClearSearch: true,
     // 这个数组里面的每一个元素就是一个搜索项
-    formFields: [ 
+    formFields: [
       { label: '账户ID:', type: 'input', key: 'developerId', placeholder: '请输入账户ID' },
       {
         label: '性别:',
@@ -101,8 +101,8 @@ class Index extends React.PureComponent {
     // 在触发action调用接口前,可以做一些前端校验工作,比如下面的:
     if (!params.developerName) {
       // 如果developerName不存在或者为空字符,那么给用户一个warning提示,同时return阻止后面的接口调用
-      message.warning('公司名称必填');
-      return;
+      message.warning('公司名称必填')
+      return
     }
     const type = params.id ? 'template/_addItem' : 'template/_editItem'
     this.props.dispatch({
@@ -112,9 +112,9 @@ class Index extends React.PureComponent {
         const { code } = res || {}
         if (code === 0) {
           const msg = !params.id ? '编辑用户成功' : '添加用户成功'
-          message.success(msg);
-          this.setState({ showModal: false });
-          this.refresh();
+          message.success(msg)
+          this.setState({ showModal: false })
+          this.refresh()
         }
       }
     })

+ 9 - 3
src/pages/dc/subscribe/model.js

@@ -1,17 +1,23 @@
 import {
-  addItem
+  editSubJobItem, deleteSubJobItem
 } from './service'
 
 export default {
   namespace: 'template',
   state: {},
   effects: {
-    * _addItem({ payload, callback }, { call }) {
-      const res = yield call(addItem, payload)
+    * _editSubJobItem ({ payload, callback }, { call }) {
+      const res = yield call(editSubJobItem, payload)
       if (res) {
         if (callback) callback(res)
       }
     },
+    * _deleteSubJobItem ({ payload, callback }, { call }) {
+      const res = yield call(deleteSubJobItem, payload)
+      if (res) {
+        if (callback) callback(res)
+      }
+    }
   },
   reducers: {}
 }

+ 6 - 5
src/pages/dc/subscribe/service.js

@@ -1,11 +1,12 @@
 import { fetchApi } from '@/apis/'
+import { dc } from '@/conf/config'
 
-export async function addItem (params) {
-  const url = 'tabledata'
+export async function editSubJobItem (params) {
+  const url = `${dc}/dc/web/edit-sub-job`
   return fetchApi(url, params)
 }
 
-export async function testpost (body) {
-  const url = 'tabledata'
-  return fetchApi(url, { method: 'POST', body })
+export async function deleteSubJobItem (params) {
+  const url = `${dc}/dc/web/delete-sub-job`
+  return fetchApi(url, params)
 }