Commit d10e8154 d10e8154b95dd0b08946e4f0bf583907df50debb by zhanghao

commit

1 parent b03abf27
## 2.2.14 2020-10-13
- Add Preview Mode
## 2.2.14 2020-07-27
- Allow add specific style for float and integer numbers [pr](https://github.com/chenfengjw163/vue-json-viewer/pull/51)
## 2.2.13 2020-07-14
- Add timeformat props to support custom time format [pr](https://github.com/chenfengjw163/vue-json-viewer/pull/48)
\ No newline at end of file
MIT License
Copyright (c) 2018 陈峰
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
# vue-json-viewer
[中文版](https://github.com/chenfengjw163/vue-json-viewer/blob/master/README_CN.md)
Simple JSON viewer component, for Vue.js 2.
Support for incremental update components
[![Travis](https://img.shields.io/travis/chenfengjw163/vue-json-viewer/master.svg?style=flat-square)](https://travis-ci.org/chenfengjw163/vue-json-viewer)
[![npm](https://img.shields.io/npm/v/vue-json-viewer.svg?style=flat-square)](https://www.npmjs.com/package/vue-json-viewer)
![npm](https://img.shields.io/npm/dw/vue-json-viewer.svg?style=flat-square)
- [Installing](#installing)
- [Example](#example)
- [Options](#options)
- [Listeners](#listeners)
- [Slots](#slots)
- [Theming](#theming)
## Installing
Using npm:
```
$ npm install vue-json-viewer --save
```
Using yarn:
```
$ yarn add vue-json-viewer
```
## Example
``` html
<json-viewer :value="jsonData"></json-viewer>
<hr />
<json-viewer
:value="jsonData"
:expand-depth=5
copyable
boxed
sort></json-viewer>
```
``` js
import Vue from 'vue'
import JsonViewer from 'vue-json-viewer'
// Import JsonViewer as a Vue.js plugin
Vue.use(JsonViewer)
// or
// components: {JsonViewer}
new Vue({
el: '#app',
data() {
return {
jsonData: {
total: 25,
limit: 10,
skip: 0,
links: {
previous: undefined,
next: function () {},
},
data: [
{
id: '5968fcad629fa84ab65a5247',
firstname: 'Ada',
lastname: 'Lovelace',
awards: null,
known: [
'mathematics',
'computing'
],
position: {
lat: 44.563836,
lng: 6.495139
},
description: `Augusta Ada King, Countess of Lovelace (née Byron; 10 December 1815 – 27 November 1852) was an English mathematician and writer,
chiefly known for her work on Charles Babbage's proposed mechanical general-purpose computer,
the Analytical Engine. She was the first to recognise that the machine had applications beyond pure calculation,
and published the first algorithm intended to be carried out by such a machine.
As a result, she is sometimes regarded as the first to recognise the full potential of a "computing machine" and the first computer programmer.`,
bornAt: '1815-12-10T00:00:00.000Z',
diedAt: '1852-11-27T00:00:00.000Z'
}, {
id: '5968fcad629fa84ab65a5246',
firstname: 'Grace',
lastname: 'Hopper',
awards: [
'Defense Distinguished Service Medal',
'Legion of Merit',
'Meritorious Service Medal',
'American Campaign Medal',
'World War II Victory Medal',
'National Defense Service Medal',
'Armed Forces Reserve Medal',
'Naval Reserve Medal',
'Presidential Medal of Freedom'
],
known: null,
position: {
lat: 43.614624,
lng: 3.879995
},
description: `Grace Brewster Murray Hopper (née Murray; December 9, 1906 – January 1, 1992)
was an American computer scientist and United States Navy rear admiral.
One of the first programmers of the Harvard Mark I computer,
she was a pioneer of computer programming who invented one of the first compiler related tools.
She popularized the idea of machine-independent programming languages, which led to the development of COBOL,
an early high-level programming language still in use today.`,
bornAt: '1815-12-10T00:00:00.000Z',
diedAt: '1852-11-27T00:00:00.000Z'
}
]
}
}
}
})
```
### SSR
``` js
import JsonViewer from 'vue-json-viewer/ssr'
// Import JsonViewer as a Vue.js plugin
Vue.use(JsonViewer)
// or
// components: {JsonViewer}
```
and
``` js
import 'vue-json-viewer/style.css'
```
### Preview
![preview](./example/preview.png)
## Options
| Property | Description | Default |
| ----------- |:------------- | ----------- |
| `value` | JSON data (can be used with `v-model`) | **Required** |
| `expand-depth` | Collapse blocs under this depth | `1` |
| `copyable` | Display the copy button, you can customize copy text just set `{copyText: 'copy', copiedText: 'copied', timeout: 2000}` or set `true` use default copytext | `false` |
| `sort` | Sort keys before displaying | `false` |
| `boxed` | Add a fancy "boxed" style to component | `false` |
| `theme` | Add a custom CSS class for theming purposes | `jv-light` |
| `expanded` | Default expand the view | `false` |
| `timeformat` | custom time format function | time => time.toLocaleString() |
| `preview-mode` | no expand mode | `false` |
## Listeners
| Listener | Description | Value |
| ----------- |:------------- | ----------- |
| `copied` | Emits copyEvent after text copied | Clipboard success event |
## Slots
| Name | Description | Scope |
| ----------- |:------------- | ----------- |
| `copy` | Custom content for copy button | `{copied: boolean}` |
## Theming
To create custom theme, (e.g. `my-awesome-json-theme`), in two easy steps:
1. add `theme="my-awesome-json-theme"` to the JsonViewer component
2. copy-pasta and customize this SCSS template:
``` scss
// values are default one from jv-light template
.my-awesome-json-theme {
background: #fff;
white-space: nowrap;
color: #525252;
font-size: 14px;
font-family: Consolas, Menlo, Courier, monospace;
.jv-ellipsis {
color: #999;
background-color: #eee;
display: inline-block;
line-height: 0.9;
font-size: 0.9em;
padding: 0px 4px 2px 4px;
border-radius: 3px;
vertical-align: 2px;
cursor: pointer;
user-select: none;
}
.jv-button { color: #49b3ff }
.jv-key { color: #111111 }
.jv-item {
&.jv-array { color: #111111 }
&.jv-boolean { color: #fc1e70 }
&.jv-function { color: #067bca }
&.jv-number { color: #fc1e70 }
&.jv-number-float { color: #fc1e70 }
&.jv-number-integer { color: #fc1e70 }
&.jv-object { color: #111111 }
&.jv-undefined { color: #e08331 }
&.jv-string {
color: #42b983;
word-break: break-word;
white-space: normal;
}
}
.jv-code {
.jv-toggle {
&:before {
padding: 0px 2px;
border-radius: 2px;
}
&:hover {
&:before {
background: #eee;
}
}
}
}
}
```
{
"_from": "vue-json-viewer",
"_id": "vue-json-viewer@2.2.15",
"_inBundle": false,
"_integrity": "sha512-Trn4iyX9TUOmHSq9BAT+MXErl9jXwqP/72+HokqBXByHfHMKPEeKAvcv91oL4zR5xzL92O72W2J+aMBE7ly64w==",
"_location": "/vue-json-viewer",
"_phantomChildren": {},
"_requested": {
"type": "tag",
"registry": true,
"raw": "vue-json-viewer",
"name": "vue-json-viewer",
"escapedName": "vue-json-viewer",
"rawSpec": "",
"saveSpec": null,
"fetchSpec": "latest"
},
"_requiredBy": [
"#USER",
"/"
],
"_resolved": "https://registry.npmjs.org/vue-json-viewer/-/vue-json-viewer-2.2.15.tgz",
"_shasum": "856bd50d23c84471b2445bfda3e746a018c33dd2",
"_spec": "vue-json-viewer",
"_where": "/Users/zhanghao/brcode/br-client",
"author": {
"name": "陈峰",
"email": "chenfengjw@hotmail.com"
},
"bugs": {
"url": "https://github.com/chenfengjw163/vue-json-viewer/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "陈峰",
"email": "chenfengjw@hotmail.com"
},
{
"name": "Sacha Stafyniak",
"email": "sacha.stafyniak@gmail.com"
}
],
"dependencies": {
"clipboard": "^2.0.4",
"vue": "^2.6.9"
},
"deprecated": false,
"description": "vuejs展示json的组件",
"devDependencies": {
"autoprefixer": "^7.1.5",
"babel-core": "^6.26.0",
"babel-eslint": "^8.0.1",
"babel-loader": "^7.1.2",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"babel-plugin-transform-runtime": "^6.23.0",
"babel-plugin-transform-vue-jsx": "^3.7.0",
"babel-preset-es2015": "^6.24.1",
"babel-runtime": "^6.26.0",
"css-loader": "^3.0.0",
"eslint": "^6.0.1",
"eslint-plugin-vue": "^5.0.0-beta.3",
"file-loader": "^1.1.5",
"html-webpack-plugin": "^3.2.0",
"mini-css-extract-plugin": "^0.5.0",
"node-sass": "^4.12.0",
"optimize-css-assets-webpack-plugin": "^5.0.3",
"postcss-loader": "^3.0.0",
"sass-loader": "^7.1.0",
"style-loader": "^0.19.0",
"uglifyjs-webpack-plugin": "^2.1.2",
"url-loader": "^0.6.2",
"vue-loader": "^15.7.0",
"vue-style-loader": "^4.1.2",
"vue-template-compiler": "^2.6.9",
"webpack": "=4.29.6",
"webpack-bundle-analyzer": "^3.3.2",
"webpack-cli": "^3.3.11",
"webpack-dev-server": "^3.10.3",
"webpack-merge": "^4.1.0"
},
"directories": {
"lib": "./lib",
"example": "./example"
},
"files": [
"vue-json-viewer.js",
"ssr.js",
"style.css"
],
"homepage": "https://github.com/chenfengjw163/vue-json-viewer#readme",
"keywords": [
"vue",
"json"
],
"license": "MIT",
"main": "vue-json-viewer.js",
"name": "vue-json-viewer",
"repository": {
"type": "git",
"url": "git+https://github.com/chenfengjw163/vue-json-viewer.git"
},
"scripts": {
"build": "npm run build:browser && npm run build:ssr",
"build:browser": "webpack --config ./build/webpack.config.js",
"build:ssr": "webpack --config ./build/webpack.ssr.config.js",
"example": "webpack-dev-server --config ./example/build/webpack.dev.conf.js"
},
"version": "2.2.15"
}
.jv-node{position:relative}.jv-node:after{content:","}.jv-node:last-of-type:after{content:""}.jv-node.toggle{margin-left:13px!important}.jv-node .jv-node{margin-left:25px}.jv-container{box-sizing:border-box;position:relative}.jv-container.boxed{border:1px solid #eee;border-radius:6px}.jv-container.boxed:hover{box-shadow:0 2px 7px rgba(0,0,0,.15);border-color:transparent;position:relative}.jv-container.jv-light{background:#fff;white-space:nowrap;color:#525252;font-size:14px;font-family:Consolas,Menlo,Courier,monospace}.jv-container.jv-light .jv-ellipsis{color:#999;background-color:#eee;display:inline-block;line-height:.9;font-size:.9em;padding:0 4px 2px;margin:0 4px;border-radius:3px;vertical-align:2px;cursor:pointer;-webkit-user-select:none;-ms-user-select:none;user-select:none}.jv-container.jv-light .jv-button{color:#49b3ff}.jv-container.jv-light .jv-key{color:#111;margin-right:4px}.jv-container.jv-light .jv-item.jv-array{color:#111}.jv-container.jv-light .jv-item.jv-boolean{color:#fc1e70}.jv-container.jv-light .jv-item.jv-function{color:#067bca}.jv-container.jv-light .jv-item.jv-number{color:#fc1e70}.jv-container.jv-light .jv-item.jv-object{color:#111}.jv-container.jv-light .jv-item.jv-undefined{color:#e08331}.jv-container.jv-light .jv-item.jv-string{color:#42b983;word-break:break-word;white-space:normal}.jv-container.jv-light .jv-code .jv-toggle:before{padding:0 2px;border-radius:2px}.jv-container.jv-light .jv-code .jv-toggle:hover:before{background:#eee}.jv-container .jv-code{overflow:hidden;padding:20px}.jv-container .jv-code.boxed{max-height:300px}.jv-container .jv-code.open{max-height:none!important;overflow:visible;overflow-x:auto;padding-bottom:45px}.jv-container .jv-toggle{background-image:url(data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE2IiB3aWR0aD0iOCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjNjY2IiBkPSJNMCAwbDggOC04IDh6Ii8+PC9zdmc+);background-repeat:no-repeat;background-size:contain;background-position:50%;cursor:pointer;width:10px;height:10px;margin-right:2px;display:inline-block;-webkit-transition:-webkit-transform .1s;transition:-webkit-transform .1s;transition:transform .1s;transition:transform .1s,-webkit-transform .1s}.jv-container .jv-toggle.open{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.jv-container .jv-more{position:absolute;z-index:1;bottom:0;left:0;right:0;height:40px;width:100%;text-align:center;cursor:pointer}.jv-container .jv-more .jv-toggle{position:relative;top:40%;z-index:2;color:#888;-webkit-transition:all .1s;transition:all .1s;-webkit-transform:rotate(90deg);transform:rotate(90deg)}.jv-container .jv-more .jv-toggle.open{-webkit-transform:rotate(-90deg);transform:rotate(-90deg)}.jv-container .jv-more:after{content:"";width:100%;height:100%;position:absolute;bottom:0;left:0;z-index:1;background:-webkit-linear-gradient(top,transparent 20%,hsla(0,0%,90.2%,.3));background:linear-gradient(180deg,transparent 20%,hsla(0,0%,90.2%,.3));-webkit-transition:all .1s;transition:all .1s}.jv-container .jv-more:hover .jv-toggle{top:50%;color:#111}.jv-container .jv-more:hover:after{background:-webkit-linear-gradient(top,transparent 20%,hsla(0,0%,90.2%,.3));background:linear-gradient(180deg,transparent 20%,hsla(0,0%,90.2%,.3))}.jv-container .jv-button{position:relative;cursor:pointer;display:inline-block;padding:5px;z-index:5}.jv-container .jv-button.copied{opacity:.4;cursor:default}.jv-container .jv-tooltip{position:absolute;right:15px;top:10px}.jv-container .j-icon{font-size:12px}
\ No newline at end of file
......@@ -10750,6 +10750,15 @@
"integrity": "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==",
"dev": true
},
"vue-json-viewer": {
"version": "2.2.15",
"resolved": "https://registry.npmjs.org/vue-json-viewer/-/vue-json-viewer-2.2.15.tgz",
"integrity": "sha512-Trn4iyX9TUOmHSq9BAT+MXErl9jXwqP/72+HokqBXByHfHMKPEeKAvcv91oL4zR5xzL92O72W2J+aMBE7ly64w==",
"requires": {
"clipboard": "^2.0.4",
"vue": "^2.6.9"
}
},
"vue-loader": {
"version": "13.7.3",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-13.7.3.tgz",
......
......@@ -15,6 +15,7 @@
"qs": "^6.9.4",
"vue": "^2.5.2",
"vue-clipboard2": "^0.3.1",
"vue-json-viewer": "^2.2.15",
"vue-router": "^3.0.1"
},
"devDependencies": {
......
......@@ -8,6 +8,7 @@ import Element from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import qs from 'qs'
import vueClipboard from 'vue-clipboard2'
import JsonViewer from 'vue-json-viewer'
Vue.config.productionTip = false
Vue.prototype.$http = axios
......@@ -17,6 +18,7 @@ axios.defaults.baseURL = 'http://192.168.8.113:9090'
Vue.use(Element, { size: 'small', zIndex: 3000 });
Vue.use(vueClipboard);
Vue.use(JsonViewer)
router.beforeEach((to, from, next) => {
if (to.meta.title) {
......
<template xmlns:el-col="http://www.w3.org/1999/html">
<div>
<json-viewer
:value="jsonData"
:expand-depth=10
copyable></json-viewer>
</div>
</template>
<script>
export default {
data() {
return {
method: this.$route.query.method,
biz_data: this.$route.query.biz_data,
phone: this.$route.query.phone,
path: this.$route.query.path,
type: this.$route.query.type,
jsonData: ''
}
},
mounted() {
this.activity()
},
methods: {
activity() {
const loading = this.$loading({
lock: true,
text: '加载中...',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.7)'
});
let config = {
headers: {
'Content-Type': 'application/x-www-form-urlencoded'
}
}
this.$http.get('/tool/apiTest?'+this.$qs.stringify({
method: this.method,
biz_data: this.biz_data,
phone: this.phone,
path: this.path,
type: this.type
}),config).then((res)=>{
console.log(res.data)
this.jsonData=res.data
loading.close();
}).catch(error=>{
console.log(error);
loading.close();
this.$message({
showClose: true,
message: '服务器处理失败,请核对参数!',
type: 'error'
});
})
}
}
}
</script>
......@@ -170,24 +170,6 @@
</el-row>
<el-row style="margin-bottom: 15px;">
<el-col :span="8">
<el-form ref="changeOrg" :model="changeOrg" label-width="0px">
<el-card class="darkred" shadow="always">
<div slot="header" class="clearfix">
<span>开通切换任意机构权限</span>
</div>
<div class="text item">
<el-form-item>
<el-input placeholder="请输入手机号" v-model="changeOrg.phone" clearable></el-input>
</el-form-item>
<div style="margin: 15px 0;"></div>
<el-form-item>
<el-button round @click="changeOrgSubmit">开通权限</el-button>
</el-form-item>
</div>
</el-card>
</el-form>
</el-col>
<el-col :span="8">
<el-form ref="queryPhoneCode" :model="queryPhoneCode" label-width="0px">
<el-card class="darkred" shadow="always">
<div slot="header" class="clearfix">
......@@ -225,49 +207,44 @@
</el-dialog>
</el-col>
<el-col :span="8">
<el-form ref="createCluesYoubaoe" :model="createCluesYoubaoe" label-width="0px">
<el-form ref="apiTest" :model="apiTest" label-width="0px">
<el-card class="darkred" shadow="always">
<div slot="header" class="clearfix">
<span>生成线索-活动类型-有预约保额</span>
<span>接口访问测试</span>
</div>
<div class="text item">
<el-form-item>
<el-input placeholder="代理人UID" v-model="createCluesYoubaoe.agentUid" clearable></el-input>
<el-select v-model="apiTest.path" placeholder="请选择接口服务">
<el-option
v-for="item in apiTestPathoptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<div style="margin: 15px 0;"></div>
<el-form-item>
<el-input placeholder="该代理人名下的健康坊用户UID" v-model="createCluesYoubaoe.customUid" clearable></el-input>
<el-input placeholder="请输入method" v-model="apiTest.method" clearable></el-input>
</el-form-item>
<el-form-item>
<el-input placeholder="正在进行中的活动ID" v-model="createCluesYoubaoe.actId" clearable></el-input>
<el-input placeholder="请输入biz_data" v-model="apiTest.biz_data" clearable></el-input>
</el-form-item>
<div style="margin: 15px 0;"></div>
<el-form-item>
<el-button round @click="createCluesYoubaoeSubmit">生成线索</el-button>
<el-input placeholder="请输入手机号,如果token已失效,请在app进行登录" v-model="apiTest.phone" clearable></el-input>
</el-form-item>
</div>
</el-card>
</el-form>
</el-col>
</el-row>
<el-row style="margin-bottom: 15px;">
<el-col :span="8">
<el-form ref="deleteClues" :model="deleteClues" label-width="0px">
<el-card class="darkred" shadow="always">
<div slot="header" class="clearfix">
<span>删除线索</span>
</div>
<div class="text item">
<el-form-item>
<el-input placeholder="代理人UID" v-model="deleteClues.agentUid" clearable></el-input>
</el-form-item>
<div style="margin: 15px 0;"></div>
<el-form-item>
<el-input placeholder="该代理人名下的健康坊用户UID" v-model="deleteClues.customUid" clearable></el-input>
<el-select v-model="apiTest.huanjing" placeholder="请选择执行环境">
<el-option
v-for="item in apiTestoptions"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<div style="margin: 15px 0;"></div>
<el-form-item>
<el-button round @click="onSubmit">删除线索</el-button>
<el-button round @click="apiTestSubmit">调用接口</el-button>
</el-form-item>
</div>
</el-card>
......@@ -320,6 +297,73 @@
</el-dialog>
</el-col>
</el-row>
<el-row style="margin-bottom: 15px;">
<el-col :span="8">
<el-form ref="changeOrg" :model="changeOrg" label-width="0px">
<el-card class="darkred" shadow="always">
<div slot="header" class="clearfix">
<span>开通切换任意机构权限</span>
</div>
<div class="text item">
<el-form-item>
<el-input placeholder="请输入手机号" v-model="changeOrg.phone" clearable></el-input>
</el-form-item>
<div style="margin: 15px 0;"></div>
<el-form-item>
<el-button round @click="changeOrgSubmit">开通权限</el-button>
</el-form-item>
</div>
</el-card>
</el-form>
</el-col>
<el-col :span="8">
<el-form ref="deleteClues" :model="deleteClues" label-width="0px">
<el-card class="darkred" shadow="always">
<div slot="header" class="clearfix">
<span>删除线索</span>
</div>
<div class="text item">
<el-form-item>
<el-input placeholder="代理人UID" v-model="deleteClues.agentUid" clearable></el-input>
</el-form-item>
<div style="margin: 15px 0;"></div>
<el-form-item>
<el-input placeholder="该代理人名下的健康坊用户UID" v-model="deleteClues.customUid" clearable></el-input>
</el-form-item>
<div style="margin: 15px 0;"></div>
<el-form-item>
<el-button round @click="onSubmit">删除线索</el-button>
</el-form-item>
</div>
</el-card>
</el-form>
</el-col>
<el-col :span="8">
<el-form ref="createCluesYoubaoe" :model="createCluesYoubaoe" label-width="0px">
<el-card class="darkred" shadow="always">
<div slot="header" class="clearfix">
<span>生成线索-活动类型-有预约保额</span>
</div>
<div class="text item">
<el-form-item>
<el-input placeholder="代理人UID" v-model="createCluesYoubaoe.agentUid" clearable></el-input>
</el-form-item>
<div style="margin: 15px 0;"></div>
<el-form-item>
<el-input placeholder="该代理人名下的健康坊用户UID" v-model="createCluesYoubaoe.customUid" clearable></el-input>
</el-form-item>
<el-form-item>
<el-input placeholder="正在进行中的活动ID" v-model="createCluesYoubaoe.actId" clearable></el-input>
</el-form-item>
<div style="margin: 15px 0;"></div>
<el-form-item>
<el-button round @click="createCluesYoubaoeSubmit">生成线索</el-button>
</el-form-item>
</div>
</el-card>
</el-form>
</el-col>
</el-row>
</div>
</template>
......@@ -487,7 +531,37 @@
myQueryUserInfo: '',
changeOrg: {
phone: ''
}
},
apiTest: {
path: [],
method: '',
biz_data: '',
phone: '',
huanjing: []
},
apiTestoptions: [{
value: '0',
label: '测试环境'
}, {
value: '1',
label: '线上环境'
}],
apiTestPathoptions: [{
value: 'business',
label: 'business'
}, {
value: 'insurance',
label: 'insurance'
}, {
value: 'activity',
label: 'activity'
}, {
value: 'ucenter',
label: 'ucenter'
}, {
value: 'peripheral',
label: 'peripheral'
}]
// activityConfigRules: {
// id: [
// { required: true, message: '请输入活动ID', trigger: 'blur' }
......@@ -815,7 +889,12 @@
type: 'error'
});
})
}
},
apiTestSubmit() {
const {href} = this.$router.resolve({ name:'apiTest', query:
{method: this.apiTest.method, biz_data: this.apiTest.biz_data, phone: this.apiTest.phone, path: this.apiTest.path.toString(), type: this.apiTest.huanjing.toString()}})
window.open(href, '_blank')
},
}
}
</script>
......
......@@ -5,6 +5,7 @@ import tool from '@/page/tool'
import activityConfig from '@/page/activityConfig'
import activityConfigRedis from '@/page/activityConfigRedis'
import userInfo from '@/page/userInfo'
import apiTest from '@/page/apiTest'
Vue.use(Router)
......@@ -56,6 +57,14 @@ export default new Router({
}
}
]
},
{
path: '/apiTest',
component: apiTest,
name: 'apiTest',
meta: {
title: '测试工具平台'
}
}
]
})
......