ソースを参照

Merge branch 'develop'

gaozhan 5 年 前
コミット
3fdd1c81ff

+ 2 - 1
src/pages/fengkong/strategies/add/index.js

@@ -44,6 +44,7 @@ class Add extends React.PureComponent {
       if (!err) {
         create({
           ...values,
+          state: 1,
           createUser: this.props.currentUser.name, // 创建人
           updateUser: this.props.currentUser.name // 最后修改人
         }).then(res => {
@@ -52,7 +53,7 @@ class Add extends React.PureComponent {
             this.setState({ ...values })
             Modal.success({
               title: '提交成功',
-              content: '决策代码编译正常,点击“测试按钮”可以继续测试决策逻辑'
+              content: '提交自核成功,请在自核列表中查看!'
             })
             // 跳转到列表页
             router.push('/fengkong/strategies/strategies')

+ 24 - 35
src/pages/fengkong/strategies/edit/$name.js

@@ -2,16 +2,16 @@ import React from 'react'
 import { Form, Input, Row, Col, Switch, Button, Modal, message, Select, Icon } from 'antd'
 import { connect } from 'dva'
 import AceEditor from 'react-ace'
-import {detail, test, update, groupList, createNote } from '../service'
+import {detail, test, update, groupList} from '../service'
 import { isJSON } from '@/utils/utils'
 
 import 'ace-builds/src-noconflict/mode-java'
 import 'ace-builds/src-noconflict/theme-monokai'
-import Nt from '@/pages/fengkong/strategies/note/note'
 
 const formItemLayout = {
   layout: 'vertical'
 }
+const { TextArea } = Input
 
 @connect(({ user }) => ({
   currentUser: user.currentUser
@@ -27,7 +27,9 @@ class Add extends React.PureComponent {
     dos: [],
     groupList: [],
     group: '',
-    features: ''
+    features: '',
+    bzEnabled:false,
+    note:''
   }
 
   async componentDidMount () {
@@ -49,36 +51,11 @@ class Add extends React.PureComponent {
         } else {
           this.setState({ ...res.data })
         }
+        console.log('dc状态数据:' + JSON.stringify(this.state))
       }
     })
   }
 
-  onNoteOk = () => {
-    const { content } = this.state.params
-    if (!content) {
-      message.warn('内容不能为空!')
-      return false
-    }
-    createNote({ name: this.props.match.params.name, content: content, operator: this.props.currentUser.name }).then(res => {
-      console.log('数据: ' + JSON.stringify(res))
-      if (res.data != null && res.code === 0) {
-        message.success('处理成功')
-        this.onNoteCancel()// 关闭弹窗
-        this.create()
-      } else {
-        message.error('处理失败: ' + res.msg)
-      }
-    })
-  }
-
-  onNoteCancel = () => {
-    this.setState({ showNote: false })
-  }
-
-  noteAndCreate = () => {
-    this.setState({ showNote: true, params: {} })
-  }
-
   onParamsChange = (key, value) => {
     const params = { ...this.state.params }
     params[key] = value
@@ -95,6 +72,7 @@ class Add extends React.PureComponent {
         }
         update({
           ...values,
+          state: this.state.state,
           createUser: this.state.createUser || this.props.currentUser.name, // 创建人
           updateUser: this.props.currentUser.name // 最后修改人
         }).then(res => {
@@ -102,7 +80,7 @@ class Add extends React.PureComponent {
             this.setState({ ...values })
             Modal.success({
               title: '提交成功',
-              content: '决策代码编译正常,点击“测试按钮”可以继续测试决策逻辑'
+              content: '提交自核成功,请在自核列表中查看!'
             })
           }
         })
@@ -162,7 +140,7 @@ class Add extends React.PureComponent {
 
   render () {
     const { getFieldDecorator } = this.props.form
-    const { name, description, enabled, content, params, showNote } = this.state
+    const { name, description, enabled, content, note} = this.state
     return (
       <div>
         <h1>编辑决策</h1>
@@ -172,7 +150,7 @@ class Add extends React.PureComponent {
               <Form.Item label="决策名称">
                 {getFieldDecorator('name', {
                   initialValue: name
-                })(<Input placeholder="全英文或英文带下划线" />)}
+                })(<Input placeholder="全英文或英文带下划线" disabled={true}/>)}
               </Form.Item>
               <Form.Item label="决策描述">
                 {getFieldDecorator('description', {
@@ -181,7 +159,7 @@ class Add extends React.PureComponent {
               </Form.Item>
               <Form.Item label="决策类型">
                 {getFieldDecorator('type', { initialValue: this.state.type })(
-                  <Select placeholder={'请选择类型'} onChange={value => this.setState({ type: value })}>
+                  <Select placeholder={'请选择类型'} onChange={value => this.setState({ type: value })} disabled={true}>
                     <Select.Option value= {0}>策略</Select.Option>
                     <Select.Option value= {1}>流程</Select.Option>
                     <Select.Option value= {2}>模型</Select.Option>
@@ -210,6 +188,18 @@ class Add extends React.PureComponent {
                   initialValue: enabled
                 })(<Switch checked={enabled} onChange={checked => this.setState({ enabled: checked })} />)}
               </Form.Item>
+              <Form.Item label="是否备注">
+                {getFieldDecorator('bzEnabled', {
+                  initialValue: this.state.bzEnabled
+                })(<Switch checked={this.state.bzEnabled} onChange={checked => this.setState({ bzEnabled: checked })} />)}
+              </Form.Item>
+              {this.state.bzEnabled === true && (
+                <Form.Item>
+                  {getFieldDecorator('note', {
+                  initialValue: note
+                })(<Input.TextArea placeholder="多行输入" />)}
+                </Form.Item>
+              )}
               {
                 // (this.state.type !== 3 && this.setState({ timeTaskEnabled: false })) ||
                 (this.state.type === 3 && (
@@ -288,7 +278,7 @@ class Add extends React.PureComponent {
                 )
               }
               <Form.Item>
-                <Button type="primary" onClick={this.noteAndCreate}>提交</Button>&emsp;
+                <Button type="primary" onClick={this.create}>提交</Button>&emsp;
                 <Button onClick={() => this.setState({ showTest: true })}>测试</Button>
               </Form.Item>
             </Form>
@@ -339,7 +329,6 @@ class Add extends React.PureComponent {
 
           </Col>
         </Row>
-        <Nt showModal={showNote} params={params} onChange={this.onParamsChange} onOk={this.onNoteOk} onCancel={this.onNoteCancel} />
       </div>
     )
   }

+ 31 - 12
src/pages/fengkong/strategies/note/$name.js

@@ -1,6 +1,7 @@
 import React from 'react'
 import { connect } from 'dva'
-import { message, Table } from 'antd'
+import { message, Table, Form } from 'antd'
+import AceEditor from 'react-ace'
 import { queryNote } from '@/pages/fengkong/strategies/service'
 
 @connect(({ user }) => ({
@@ -8,25 +9,24 @@ import { queryNote } from '@/pages/fengkong/strategies/service'
 }))
 
 class NoteRecord extends React.PureComponent {
-  constructor () {
+  constructor() {
     super()
     this.state = {
       dataSource: []
     }
   }
 
-  componentDidMount () {
+  componentDidMount() {
     queryNote({ name: this.props.match.params.name }).then(res => {
       if (res.data != null && res.code === 0) {
         this.setState({ dataSource: res.data })
-        message.success('处理成功')
       } else {
         message.error('处理失败: ' + res.msg)
       }
     })
   }
 
-  render () {
+  render() {
     let dataSource = []
     if (this.state.dataSource.length > 0) {
       dataSource = this.state.dataSource
@@ -55,13 +55,32 @@ class NoteRecord extends React.PureComponent {
     ]
 
     return (
-      <div>
-        <Table
-          dataSource={dataSource}
-          columns={columns}
-          size="small"
-        />
-      </div>
+      <Table
+        dataSource={dataSource}
+        columns={columns}
+        expandedRowRender={record =>
+          (record.codeContent.length > 0 ? <Form.Item label="当前版本代码">
+            <AceEditor
+              style={{ width: '100%' }}
+              mode="java"
+              theme="monokai"
+              name="content"
+              fontSize={14}
+              showPrintMargin={true}
+              showGutter={true}
+              highlightActiveLine={true}
+              value={record.codeContent}
+              setOptions={{
+                enableBasicAutocompletion: true,
+                enableLiveAutocompletion: true,
+                enableSnippets: true,
+                showLineNumbers: true,
+                tabSize: 2
+              }}
+            />
+          </Form.Item> : null)}
+        size="small"
+      />
     )
   }
 }

+ 2 - 2
src/pages/fengkong/strategies/strategies.js

@@ -144,14 +144,14 @@ class GroupList extends React.PureComponent {
                 pathname: './note/' + record.name,
                 state: record
               }}
-            >记录</Link>
+              target="_blank">记录</Link>
             <Divider type="vertical"/>
             <Link
               to={{
                 pathname: './edit/' + record.name,
                 state: record
               }}
-            >编辑</Link>
+              target="_blank" >编辑</Link>
             <Divider type="vertical"/>
             <Popconfirm
               title="确定删除"

+ 117 - 0
src/pages/fengkong/view/history/history.js

@@ -0,0 +1,117 @@
+import React from 'react'
+import { FilterTable } from 'wptpc-design'
+import { thanos } from '@/conf/config'
+import { connect } from 'dva'
+
+const apiUrl = `${thanos}/thanos-admin/api/v1/view/logs`
+
+@connect(({ user }) => ({
+  currentUser: user.currentUser
+}))
+
+class LogList extends React.PureComponent {
+  state = {
+    showModal: false,
+    params: {}
+  }
+
+  filterSetting = {
+    isClearSearch: true,
+    formFields: [
+      {
+        label: '描述:',
+        type: 'input',
+        key: 'queryName',
+        placeholder: '名称'
+      }
+    ],
+    // 在接口请求前,可以修改给接口的入参
+    beforeSearchFunc: params => {
+      params.state = 1
+    }
+  }
+
+  onParamsChange = (key, value) => {
+    const params = { ...this.state.params }
+    params[key] = value
+    this.setState({ params })
+  }
+
+  // filtertable的列表配置
+  tableSetting = {
+    rowKey: 'id',
+    // isFrontPagination: true,
+    pagination: {
+      pageSize: 10
+    },
+    columnConfig: [
+      {
+        title: '名称',
+        dataIndex: 'name',
+        render: (text) => {
+          if (text.startsWith('VIEW$')) {
+            return text.substr(5, text.length - 1)
+          }
+        }
+      },
+      {
+        title: '申请原因',
+        dataIndex: 'reason'
+      },
+      {
+        title: '修改内容',
+        dataIndex: 'modified'
+      },
+      {
+        title: '影响',
+        dataIndex: 'effect'
+        // render: (text) => text === true ? '是' : '否'
+      },
+      {
+        title: '审核状态',
+        dataIndex: 'state',
+        render: (text) => {
+          if (text === 1) {
+            return '通过'
+          }
+          if (text === 0) {
+            return '待审核'
+          }
+          if (text === -1) {
+            return '拒绝'
+          }
+        }
+      },
+      {
+        title: '拒绝原因',
+        dataIndex: 'rejectReason'
+      },
+      {
+        title: '申请人',
+        dataIndex: 'applyUser'
+      },
+      {
+        title: '审核人',
+        dataIndex: 'reviewUser'
+      },
+      {
+        title: '更新时间',
+        dataIndex: 'updateTime'
+      }
+    ],
+    getRefresh: refresh => {
+      this.refresh = refresh
+    }
+  }
+
+  render () {
+    return (
+      <div>
+        <FilterTable filterSetting={this.filterSetting} tableSetting={this.tableSetting} apiUrl={apiUrl}
+        />
+      </div>
+    )
+  }
+}
+
+export default LogList

+ 223 - 0
src/pages/fengkong/view/other/other.js

@@ -0,0 +1,223 @@
+import React from 'react'
+import { FilterTable } from 'wptpc-design'
+import { thanos } from '@/conf/config'
+import { message } from 'antd'
+import { update, writeLog, queryLog, reviewOk } from '../service.js'
+import Rv from '@/pages/fengkong/view/other/review'
+import { connect } from 'dva'
+
+const apiUrl = `${thanos}/thanos-admin/api/v1/dsl/list`
+@connect(({ user }) => ({
+  currentUser: user.currentUser
+}))
+
+class OtherList extends React.PureComponent {
+  state = {
+    showModal: false,
+    params: {}
+  }
+
+  filterSetting = {
+    isClearSearch: true,
+    formFields: [
+      {
+        label: '描述:',
+        type: 'input',
+        key: 'queryName',
+        placeholder: '名称'
+      }
+    ],
+    // 在接口请求前,可以修改给接口的入参
+    beforeSearchFunc: params => {
+      params.state = 2
+    }
+  }
+
+  onParamsChange = (key, value) => {
+    const params = { ...this.state.params }
+    params[key] = value
+    this.setState({ params })
+  }
+
+  // filtertable的列表配置
+  tableSetting = {
+    rowKey: 'id',
+    // isFrontPagination: true,
+    pagination: {
+      pageSize: 10
+    },
+    columnConfig: [
+      // {
+      //   title: 'ID',
+      //   dataIndex: 'id'
+      // },
+      {
+        title: '分组名称',
+        dataIndex: 'name',
+        render: (text) => {
+          if (text.startsWith('VIEW$')) {
+            return text.substr(5, text.length - 1)
+          }
+        }
+      },
+      {
+        title: '描述',
+        dataIndex: 'description'
+      },
+      {
+        title: '类型',
+        dataIndex: 'type',
+        render: (text) => {
+          if (text === 0) {
+            return '策略'
+          }
+          if (text === 1) {
+            return '流程'
+          }
+          if (text === 2) {
+            return '模型'
+          }
+          if (text === 3) {
+            return '调度'
+          }
+          if (text === 4) {
+            return '规则'
+          }
+        }
+      },
+      {
+        title: '决策是否启用',
+        dataIndex: 'enabled',
+        render: (text) => text === true ? '是' : '否'
+      },
+      {
+        title: '创建人',
+        dataIndex: 'createUser'
+      },
+      {
+        title: '修改人',
+        dataIndex: 'updateUser'
+      },
+      {
+        title: '操作',
+        dataIndex: 'actions',
+        // 所有需要弹窗操作的都可以用编辑的逻辑;所有不需要弹窗的操作,比如上架、发布等,都可以用”删除“的逻辑
+        render: (text, record) => (
+          <span>
+            <a onClick={() => this.process(record)}>点击处理</a>
+          </span>)
+      }
+    ],
+    getRefresh: refresh => {
+      this.refresh = refresh
+    }
+  }
+
+  // 审核通过
+  ok = (record) => {
+    console.log('提交到审核列表: ' + JSON.stringify(record))
+    record.state = 0
+    update(record).then(res => {
+      if (res.code === 0) {
+        console.log('数据: ' + JSON.stringify(res))
+        message.success('提交成功')
+        this.refresh()
+      }
+    })
+  }
+
+  // 审核拒绝
+  reject = (record) => {
+    console.log('提交到审核列表: ' + JSON.stringify(record))
+    record.state = 1
+    update(record).then(res => {
+      if (res.code === 0) {
+        console.log('数据: ' + JSON.stringify(res))
+        message.success('处理成功')
+        this.refresh()
+      }
+    })
+  }
+
+  process = (record) => {
+    // 查询申请记录 赋值params
+    queryLog({ name: record.name }).then(res => {
+      if (res.code === 0) {
+        res.data.rejectReason = ''
+        this.setState({ showRv: true, params: res.data, record: record })
+      }
+    })
+  }
+
+  onRvOk = () => {
+    const { state } = this.state.params
+    console.log('数据1:' + JSON.stringify(this.state.params))
+    if (!state) {
+      message.warn('未选择审批项')
+      return false
+    }
+    const record = this.state.record
+    if (state === 1) {
+      record.state = 0
+      this.reviewOk(record)
+    } else {
+      record.state = 1
+      this.reviewNotOk(record)
+    }
+    this.onRvCancel()
+    this.state.params.reviewUser = this.props.currentUser.name
+    this.state.params.updateTime = null
+    this.writeLog(this.state.params)
+    this.refresh()
+  }
+
+  reviewNotOk= (params) => {
+    update(params).then(res => {
+      if (res.code === 0) {
+        message.success('审核成功')
+      } else {
+        message.warn('审核失败')
+        return false
+      }
+    })
+  }
+
+  reviewOk = (params) => {
+    reviewOk(params).then(res => {
+      if (res.code === 0) {
+        message.success('审核成功')
+      } else {
+        message.warn('审核失败')
+        return false
+      }
+    })
+  }
+
+  writeLog = (params) => {
+    writeLog(params).then(res => {
+      console.log('------------')
+      if (res.code === 0) {
+        console.log('记录成功: ' + JSON.stringify(res))
+      } else {
+        console.log('记录失败: ' + JSON.stringify(res))
+      }
+    })
+  }
+
+  onRvCancel = () => {
+    this.setState({ showRv: false })
+  }
+
+  render () {
+    const { params, showRv } = this.state
+    return (
+      <div>
+        <FilterTable filterSetting={this.filterSetting} tableSetting={this.tableSetting} apiUrl={apiUrl}
+        />
+        <Rv showModal={showRv} params={params} onChange={this.onParamsChange} onOk={this.onRvOk} onCancel={this.onRvCancel} />
+      </div>
+    )
+  }
+}
+
+export default OtherList

+ 60 - 0
src/pages/fengkong/view/other/review.js

@@ -0,0 +1,60 @@
+import React, { Component } from 'react'
+import { Modal } from 'antd'
+import { FormItem } from 'wptpc-design'
+
+export default class Review extends Component {
+  render () {
+    console.log('props:' + JSON.stringify(this.props))
+    const { showModal, params, onChange, onOk, onCancel, fetching } = this.props
+    const formSetting = [
+      {
+        label: '申请原因',
+        type: 'textarea',
+        key: 'reason',
+        disabled: true
+      },
+      {
+        label: '调整内容',
+        type: 'textarea',
+        key: 'modified',
+        disabled: true
+      },
+      {
+        label: '影响',
+        type: 'textarea',
+        key: 'effect',
+        disabled: true
+      },
+      {
+        label: '审核',
+        type: 'select',
+        key: 'state',
+        options: [
+          { value: 1, label: '通过' },
+          { value: -1, label: '拒绝' }
+        ],
+        defaultValue: 1,
+        isRequired: true,
+        placeholder: '请选择'
+      },
+      {
+        label: '拒绝原因',
+        type: 'textarea',
+        key: 'rejectReason',
+        placeholder: '拒绝可填写/不填写拒绝原因',
+        clear: true
+      }
+    ]
+    return (
+      <Modal
+        title={'待审批'}
+        visible={showModal}
+        onOk={onOk}
+        onCancel={onCancel}
+        okButtonProps={{ disabled: fetching }}
+      >
+        <FormItem formSetting={formSetting} params={params} onChange={onChange}/>
+      </Modal>
+    )
+  }
+}

+ 38 - 0
src/pages/fengkong/view/self/apply.js

@@ -0,0 +1,38 @@
+import React, { Component } from 'react'
+import { Modal } from 'antd'
+import { FormItem } from 'wptpc-design'
+
+export default class Apply extends Component {
+  render () {
+    console.log('props:' + JSON.stringify(this.props))
+    const { showModal, params, onChange, onOk, onCancel, fetching } = this.props
+    const formSetting = [
+      {
+        label: '申请原因',
+        type: 'textarea',
+        key: 'reason'
+      },
+      {
+        label: '调整内容',
+        type: 'textarea',
+        key: 'modified'
+      },
+      {
+        label: '影响',
+        type: 'textarea',
+        key: 'effect'
+      }
+    ]
+    return (
+      <Modal
+        title={'审核申请'}
+        visible={showModal}
+        onOk={onOk}
+        onCancel={onCancel}
+        okButtonProps={{ disabled: fetching }}
+      >
+        <FormItem formSetting={formSetting} params={params} onChange={onChange}/>
+      </Modal>
+    )
+  }
+}

+ 197 - 0
src/pages/fengkong/view/self/self.js

@@ -0,0 +1,197 @@
+import React from 'react'
+import { FilterTable } from 'wptpc-design'
+import { Link } from 'dva/router'
+import { thanos } from '@/conf/config'
+import { Divider, message, Popconfirm } from 'antd'
+import { delItem, other, writeLog } from '../service.js'
+import Ap from '@/pages/fengkong/view/self/apply'
+import { connect } from 'dva'
+
+const apiUrl = `${thanos}/thanos-admin/api/v1/dsl/list`
+
+@connect(({ user }) => ({
+  currentUser: user.currentUser
+}))
+
+class SlefList extends React.PureComponent {
+  state = {
+    showModal: false,
+    params: {}
+  }
+
+  filterSetting = {
+    isClearSearch: true,
+    formFields: [
+      {
+        label: '描述:',
+        type: 'input',
+        key: 'queryName',
+        placeholder: '名称'
+      }
+    ],
+    // 在接口请求前,可以修改给接口的入参
+    beforeSearchFunc: params => {
+      params.state = 1
+    }
+  }
+
+  onParamsChange = (key, value) => {
+    const params = { ...this.state.params }
+    params[key] = value
+    this.setState({ params })
+  }
+
+  // filtertable的列表配置
+  tableSetting = {
+    rowKey: 'id',
+    // isFrontPagination: true,
+    pagination: {
+      pageSize: 10
+    },
+    columnConfig: [
+      // {
+      //   title: 'ID',
+      //   dataIndex: 'id'
+      // },
+      {
+        title: '分组名称',
+        dataIndex: 'name',
+        render: (text) => {
+          if (text.startsWith('VIEW$')) {
+            return text.substr(5, text.length - 1)
+          }
+        }
+      },
+      {
+        title: '描述',
+        dataIndex: 'description'
+      },
+      {
+        title: '类型',
+        dataIndex: 'type',
+        render: (text) => {
+          if (text === 0) {
+            return '策略'
+          }
+          if (text === 1) {
+            return '流程'
+          }
+          if (text === 2) {
+            return '模型'
+          }
+          if (text === 3) {
+            return '调度'
+          }
+          if (text === 4) {
+            return '规则'
+          }
+        }
+      },
+      {
+        title: '决策是否启用',
+        dataIndex: 'enabled',
+        render: (text) => text === true ? '是' : '否'
+      },
+      {
+        title: '创建人',
+        dataIndex: 'createUser'
+      },
+      {
+        title: '修改人',
+        dataIndex: 'updateUser'
+      },
+      {
+        title: '操作',
+        dataIndex: 'actions',
+        // 所有需要弹窗操作的都可以用编辑的逻辑;所有不需要弹窗的操作,比如上架、发布等,都可以用”删除“的逻辑
+        render: (text, record) => (
+          <span>
+            <Link
+              to={{
+                pathname: '/fengkong/strategies/edit/' + record.name,
+                state: record
+              }}
+            >编辑</Link>
+            <Divider type="vertical"/>
+            <a onClick={() => this.apply(record)}>提交审核</a>
+            <Divider type="vertical"/>
+            <Popconfirm
+              title="确定删除"
+              onConfirm={() => this.delItem(record)}>
+              <a>删除</a>
+            </Popconfirm>
+          </span>)
+      }
+    ],
+    getRefresh: refresh => {
+      this.refresh = refresh
+    }
+  }
+
+  apply = (record) => {
+    this.setState({ showAp: true, params: {}, record: record })
+  }
+
+  // 点击删除按钮时的事件处理函数
+  delItem = (record) => {
+    delItem({ id: record.id, name: record.name }).then(res => {
+      if (res.code === 0) {
+        message.success('删除成功')
+        this.refresh()
+      }
+    })
+  }
+
+  onApOk = () => {
+    const { reason, modified, effect } = this.state.params
+    if (!reason) {
+      message.warn('申请原因不能为空!')
+      return false
+    }
+    if (!modified) {
+      message.warn('调整内容不能为空!')
+      return false
+    }
+    if (!effect) {
+      message.warn('影响不能为空!')
+      return false
+    }
+    this.onApCancel()
+    const record = this.state.record
+    other(record).then(res => {
+      if (res.code === 0) {
+        console.log('数据: ' + JSON.stringify(res))
+        this.writeLog({ name: record.name, reason: reason, modified: modified, effect: effect, state: 0, applyUser: this.props.currentUser.name, rejectReason: '/', reviewUser: '/'})
+        message.success('提交审核成功')
+        this.refresh()
+      }
+    })
+  }
+
+  writeLog = (params) => {
+    writeLog(params).then(res => {
+      if (res.code === 0) {
+        console.log('记录成功: ' + JSON.stringify(res))
+      } else {
+        console.log('记录失败: ' + JSON.stringify(res))
+      }
+    })
+  }
+
+  onApCancel = () => {
+    this.setState({ showAp: false })
+  }
+
+  render () {
+    const { params, showAp } = this.state
+    return (
+      <div>
+        <FilterTable filterSetting={this.filterSetting} tableSetting={this.tableSetting} apiUrl={apiUrl}
+        />
+        <Ap showModal={showAp} params={params} onChange={this.onParamsChange} onOk={this.onApOk} onCancel={this.onApCancel} />
+      </div>
+    )
+  }
+}
+
+export default SlefList

+ 56 - 0
src/pages/fengkong/view/service.js

@@ -0,0 +1,56 @@
+import { fetchApi, fetchApi_get as fetchApiGet } from '@/apis/'
+import { thanos } from '@/conf/config'
+
+// 新增策略
+export async function create (params) {
+  const url = `${thanos}/thanos-admin/api/v1/dsl/create`
+  return fetchApi(url, params)
+}
+
+// 测试策略
+export async function test (params) {
+  const url = `${thanos}/thanos-admin//api/v1/dsl/test`
+  return fetchApi(url, params)
+}
+
+// 获取策略详情
+export async function detail (params) {
+  const url = `${thanos}/thanos-admin/api/v1/dsl/query`
+  return fetchApiGet(url, params)
+}
+
+// 更新
+export async function update (params) {
+  const url = `${thanos}/thanos-admin/api/v1/dsl/update`
+  return fetchApi(url, params)
+}
+
+export async function delItem (params) {
+  const url = `${thanos}/thanos-admin/api/v1/dsl/delete`
+  return fetchApi(url, params)
+}
+
+export async function other (params) {
+  const url = `${thanos}/thanos-admin/api/v1/view/other`
+  return fetchApi(url, params)
+}
+
+export async function writeLog (params) {
+  const url = `${thanos}/thanos-admin/api/v1/view/log/save`
+  return fetchApi(url, params)
+}
+
+export async function queryLog (params) {
+  const url = `${thanos}/thanos-admin/api/v1/view/log/query`
+  return fetchApiGet(url, params)
+}
+
+export async function logs (params) {
+  const url = `${thanos}/thanos-admin/api/v1/view/logs`
+  return fetchApi(url, params)
+}
+
+export async function reviewOk (params) {
+  const url = `${thanos}/thanos-admin/api/v1/view/ok`
+  return fetchApi(url, params)
+}