Procházet zdrojové kódy

缓存添加前缀选择功能

jinlf před 4 roky
rodič
revize
7594f99fb2
1 změnil soubory, kde provedl 10 přidání a 2 odebrání
  1. 10 2
      src/pages/ht/codis.js

+ 10 - 2
src/pages/ht/codis.js

@@ -2,7 +2,7 @@ import React from 'react'
 import { FilterTable } from 'wptpc-design'
 import { dc } from '@/conf/config'
 import { getcodis,setcodis,delcodis,delscodis } from './service';
-import { Button,Input,Select,InputGroup,message,Modal } from 'antd';
+import { Button,Input,Select,InputGroup,message,Modal, Checkbox } from 'antd';
 import moment from 'moment';
 const apiUrl = `${dc}/ht/web/get-codis`
 const { Option } = Select;
@@ -31,6 +31,7 @@ class SummaryList extends React.PureComponent {
         remaintime:-3,
         msg:'',
         clusterType:'codis',
+        isCheck: false
     }
     handleChange = (value) => {
         this.setState({
@@ -85,6 +86,7 @@ class SummaryList extends React.PureComponent {
             type:this.state.type,
             clusterType:this.state.clusterType,
             cacheKey:this.state.cacheKey,
+            wx:this.state.isCheck
         }).then(res => {
             if (res.code === 0) {
                 this.setState({
@@ -127,6 +129,7 @@ class SummaryList extends React.PureComponent {
             socre:this.state.socre,
             clusterType:this.state.clusterType,
             list:value,
+            wx:this.state.isCheck
         }).then(res => {
             if (res.code === 0) {
                 this.setState({
@@ -159,6 +162,7 @@ class SummaryList extends React.PureComponent {
             value:this.state.value,
             clusterType:this.state.clusterType,
             list:value,
+            wx:this.state.isCheck
         }).then(res => {
             if (res.code === 0) {
                 this.setState({
@@ -191,6 +195,7 @@ class SummaryList extends React.PureComponent {
                     type:this.state.type,
                     clusterType:this.state.clusterType,
                     cacheKey:this.state.cacheKey,
+                    wx:this.state.isCheck
                 }).then(res => {
                     if (res.code === 0) {
                         this.setState({
@@ -238,7 +243,7 @@ class SummaryList extends React.PureComponent {
                         <Option value="userCodis">模块化用户</Option>
                     </Select>
                     <Input placeholder="default size" style={{ width: 520 }} value={this.state.cacheKey} onChange={this.cacheKeyChange} />
-                    <Select defaultValue="string" style={{ width: 120 }} value={this.state.type} onChange={this.handleChange}>
+                    <Select defaultValue="string" style={{ width: 80 }} value={this.state.type} onChange={this.handleChange}>
                     <Option value="string">string</Option>
                     <Option value="hash">hash</Option>
                     <Option value="list">list</Option>
@@ -247,6 +252,9 @@ class SummaryList extends React.PureComponent {
                     </Select>
                     <Button type="primary" onClick={this.getredis}>获取</Button>
                 </div>
+                {/*<input type="checkbox" style={{ "margin-left":167 }} name="vehicle" value="1" />是否不带wx_前缀*/}
+                <Checkbox style={{ "margin-left":167 }} value={this.state.isCheck} onChange={(e)=>{this.setState({isCheck: e.target.checked})}}/>是否不带wx_前缀
+                <br/>
                 { remaintime > -2 && "过期时间:" + this.state.endTimedate}<br/>
                 { remaintime > -2 && "过期时间戳:" + this.state.endTime}<br/>
                 { remaintime > -2 && "剩余秒数:" + this.state.remaintime}<br/>