Commit fad22b61 authored by 黎博's avatar 黎博

提交代码

parent 43401ef1
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>QA测试平台</title><link rel="shortcut icon" href=/QA.png><link href=/static/css/app.3804c14083e2345202d2cd2d81fcfe7a.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.2ae2e69a05c33dfc65f8.js></script><script type=text/javascript src=/static/js/vendor.1134eedaba434c4356cb.js></script><script type=text/javascript src=/static/js/app.7da8710a193a7ec6b4f2.js></script></body></html>
\ No newline at end of file
<!DOCTYPE html><html><head><meta charset=utf-8><meta name=viewport content="width=device-width,initial-scale=1"><title>QA测试平台</title><link rel="shortcut icon" href=/QA.png><link href=/static/css/app.f41bd8009244a7c9a99512e9c4b5b82c.css rel=stylesheet></head><body><div id=app></div><script type=text/javascript src=/static/js/manifest.2ae2e69a05c33dfc65f8.js></script><script type=text/javascript src=/static/js/vendor.8705403673bf9eca112f.js></script><script type=text/javascript src=/static/js/app.f87257f7b04ece982d07.js></script></body></html>
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
{"version":3,"sources":["webpack:///webpack/bootstrap fbcb0f9991c3208cfeed"],"names":["parentJsonpFunction","window","chunkIds","moreModules","executeModules","moduleId","chunkId","result","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","shift","__webpack_require__","s","installedModules","2","exports","module","l","m","c","d","name","getter","o","defineProperty","configurable","enumerable","get","n","__esModule","object","property","p","oe","err","console","error"],"mappings":"aACA,IAAAA,EAAAC,OAAA,aACAA,OAAA,sBAAAC,EAAAC,EAAAC,GAIA,IADA,IAAAC,EAAAC,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8.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap fbcb0f9991c3208cfeed"],"sourceRoot":""}
\ No newline at end of file
{"version":3,"sources":["webpack:///webpack/bootstrap 53967894d90fdd130634"],"names":["parentJsonpFunction","window","chunkIds","moreModules","executeModules","moduleId","chunkId","result","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","shift","__webpack_require__","s","installedModules","2","exports","module","l","m","c","d","name","getter","o","defineProperty","configurable","enumerable","get","n","__esModule","object","property","p","oe","err","console","error"],"mappings":"aACA,IAAAA,EAAAC,OAAA,aACAA,OAAA,sBAAAC,EAAAC,EAAAC,GAIA,IADA,IAAAC,EAAAC,EAAAC,EAAAC,EAAA,EAAAC,KACQD,EAAAN,EAAAQ,OAAoBF,IAC5BF,EAAAJ,EAAAM,GACAG,EAAAL,IACAG,EAAAG,KAAAD,EAAAL,GAAA,IAEAK,EAAAL,GAAA,EAEA,IAAAD,KAAAF,EACAU,OAAAC,UAAAC,eAAAC,KAAAb,EAAAE,KACAY,EAAAZ,GAAAF,EAAAE,IAIA,IADAL,KAAAE,EAAAC,EAAAC,GACAK,EAAAC,QACAD,EAAAS,OAAAT,GAEA,GAAAL,EACA,IAAAI,EAAA,EAAYA,EAAAJ,EAAAM,OAA2BF,IACvCD,EAAAY,IAAAC,EAAAhB,EAAAI,IAGA,OAAAD,GAIA,IAAAc,KAGAV,GACAW,EAAA,GAIA,SAAAH,EAAAd,GAGA,GAAAgB,EAAAhB,GACA,OAAAgB,EAAAhB,GAAAkB,QAGA,IAAAC,EAAAH,EAAAhB,IACAG,EAAAH,EACAoB,GAAA,EACAF,YAUA,OANAN,EAAAZ,GAAAW,KAAAQ,EAAAD,QAAAC,IAAAD,QAAAJ,GAGAK,EAAAC,GAAA,EAGAD,EAAAD,QAKAJ,EAAAO,EAAAT,EAGAE,EAAAQ,EAAAN,EAGAF,EAAAS,EAAA,SAAAL,EAAAM,EAAAC,GACAX,EAAAY,EAAAR,EAAAM,IACAhB,OAAAmB,eAAAT,EAAAM,GACAI,cAAA,EACAC,YAAA,EACAC,IAAAL,KAMAX,EAAAiB,EAAA,SAAAZ,GACA,IAAAM,EAAAN,KAAAa,WACA,WAA2B,OAAAb,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAL,EAAAS,EAAAE,EAAA,IAAAA,GACAA,GAIAX,EAAAY,EAAA,SAAAO,EAAAC,GAAsD,OAAA1B,OAAAC,UAAAC,eAAAC,KAAAsB,EAAAC,IAGtDpB,EAAAqB,EAAA,IAGArB,EAAAsB,GAAA,SAAAC,GAA8D,MAApBC,QAAAC,MAAAF,GAAoBA","file":"static/js/manifest.2ae2e69a05c33dfc65f8.js","sourcesContent":[" \t// install a JSONP callback for chunk loading\n \tvar parentJsonpFunction = window[\"webpackJsonp\"];\n \twindow[\"webpackJsonp\"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [], result;\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n \t\tif(executeModules) {\n \t\t\tfor(i=0; i < executeModules.length; i++) {\n \t\t\t\tresult = __webpack_require__(__webpack_require__.s = executeModules[i]);\n \t\t\t}\n \t\t}\n \t\treturn result;\n \t};\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// objects to store loaded and loading chunks\n \tvar installedChunks = {\n \t\t2: 0\n \t};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"/\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 53967894d90fdd130634"],"sourceRoot":""}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
......@@ -15290,6 +15290,14 @@
}
}
},
"vue-json-editor": {
"version": "1.4.3",
"resolved": "https://registry.npmjs.org/vue-json-editor/-/vue-json-editor-1.4.3.tgz",
"integrity": "sha512-st9HdXBgCnyEmmfWrZQiKzp4KuYXzmYVUNDn5h6Fa18MrrGS1amnyUFyv7hQFsNBDW27B7BKkdGOqszYT1srAg==",
"requires": {
"vue": "^2.2.6"
}
},
"vue-loader": {
"version": "13.7.3",
"resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-13.7.3.tgz",
......
......@@ -19,6 +19,7 @@
"element-ui": "^2.13.2",
"less": "^3.11.1",
"vue": "^2.5.2",
"vue-json-editor": "^1.4.3",
"vue-router": "^3.0.1"
},
"devDependencies": {
......
import request from '@/utils/request'
export function getMockList() {
return request({
url: '/list/mock',
method: 'get'
})
}
export function addMock(data) {
return request({
url: '/add/mock',
method: 'post',
data
})
}
......@@ -32,7 +32,11 @@ import {
Form,
FormItem,
Message,
Loading
Loading,
Dialog,
Tabs,
TabPane,
Switch
} from 'element-ui'
Vue.config.productionTip = false
......@@ -68,6 +72,10 @@ Vue.use(Tag)
Vue.use(Pagination)
Vue.use(Form)
Vue.use(FormItem)
Vue.use(Dialog)
Vue.use(Tabs)
Vue.use(TabPane)
Vue.use(Switch)
/* eslint-disable no-new */
new Vue({
el: '#app',
......
......@@ -12,6 +12,7 @@ import XyqbGetLoanData from '../views/Xyqb/GetLoanData'
import VccGetData from '../views/Vcc/GetData'
import VccGenData from '../views/Vcc/GenData'
import VccCheckData from '../views/Vcc/CheckData'
import Mock from '../views/Mock/Mock'
Vue.use(Router)
......@@ -69,6 +70,10 @@ const router = new Router({
{
'path': '/vcc/checkData',
component: VccCheckData
},
{
'path': '/mock/list',
component: Mock
}
]
}
......
......@@ -80,6 +80,18 @@
</template>
</el-menu-item>
</el-submenu>
<el-submenu :index="4">
<template slot="title">
<i class="el-icon-s-shop"></i>
<span>Mock</span>
</template>
<el-menu-item index="/mock/list" @click="saveNavState('/mock/list')">
<template slot="title">
<i class="el-icon-pear"></i>
<span>mock</span>
</template>
</el-menu-item>
</el-submenu>
</el-menu>
</el-aside>
<el-main>
......
<template>
<div>
<!-- 头部导航栏 -->
<el-breadcrumb separator-class="el-icon-arrow-right">
<el-breadcrumb-item>Mock</el-breadcrumb-item>
<el-breadcrumb-item>Mock列表</el-breadcrumb-item>
</el-breadcrumb>
<el-card>
<el-button type="primary" @click="addDialogVisible = true">新增mock</el-button>
<el-table :data="mockList" border style="width: 100%">
<el-table-column prop="id" label="序号" width="100">
</el-table-column>
<el-table-column prop="url" label="路径" width="250">
</el-table-column>
<el-table-column prop="description" label="描述" width="200">
</el-table-column>
<el-table-column label="操作">
<slot slot-scope="scope">
<el-button type="warning" @click="openDetailDialog(scope.row)">详情</el-button>
<el-button type="success" @click="openEditDialog(scope.row)">编辑</el-button>
<el-button type="danger">删除</el-button>
</slot>
</el-table-column>
</el-table>
<!-- 分页 -->
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="queryInfo.pageNum"
:page-size="queryInfo.pageSize"
layout="total, prev, pager, next"
:total="totalNum"
></el-pagination>
</el-card>
<!-- 详情对话框 -->
<el-dialog title="Mock详情" :visible.sync="detailDialogVisible" width="60%">
<el-tabs v-model="activeTab">
<el-tab-pane label="基本信息" name="basic">
<p>路径:{{ activeUrl }}</p>
<p>描述:{{ activeDescription }}</p>
</el-tab-pane>
<el-tab-pane label="成功响应" name="success">
<vue-json-editor v-model="successResponse" :mode="'code'" :showBtns="false" lang="zh" @json-change="onSuccessJsonChange" @json-save="onSuccessJsonSave" />
</el-tab-pane>
<el-tab-pane label="失败响应" name="fail">
<vue-json-editor v-model="failResponse" :mode="'code'" :showBtns="false" lang="zh" @json-change="onSuccessJsonChange" @json-save="onSuccessJsonSave" />
</el-tab-pane>
</el-tabs>
<span slot="footer" class="dialog-footer">
<el-button @click="detailDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="detailDialogVisible = false">确 定</el-button>
</span>
</el-dialog>
<!-- 新增对话框 -->
<el-dialog title="Mock详情" :visible.sync="addDialogVisible" width="60%">
<el-form label-width="80px" :model="addMockForm">
<el-form-item label="路径">
<el-input v-model="addMockForm.url"></el-input>
</el-form-item>
<el-form-item label="描述">
<el-input v-model="addMockForm.description"></el-input>
</el-form-item>
<el-form-item label="成功响应">
<!-- <el-input v-model="addMockForm.success"></el-input> -->
<vue-json-editor v-model="addMockForm.success" :mode="'code'" :showBtns="false" lang="zh" @json-change="onSuccessJsonChange" @json-save="onSuccessJsonSave" />
</el-form-item>
<el-form-item label="失败响应">
<!-- <el-input v-model="addMockForm.fail"></el-input> -->
<vue-json-editor v-model="addMockForm.fail" :mode="'code'" :showBtns="false" lang="zh" @json-change="onFailJsonChange" @json-save="onFailJsonSave" />
</el-form-item>
<el-form-item label="当前返回">
<el-switch v-model="addMockForm.flag" active-color="#13ce66" inactive-color="#ff4949" active-value="1" inactive-value="0" width="60">
</el-switch>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="addDialogVisible = false">取 消</el-button>
<el-button type="primary" @click="addMock">确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import { getMockList, addMock } from '@/api/mock'
import vueJsonEditor from 'vue-json-editor'
export default {
data() {
return {
queryInfo: {
pageNo: '',
pageSize: ''
},
mockList: [],
addDialogVisible: false,
detailDialogVisible: false,
editDialogVisible: false,
activeTab: 'basic',
successResponse: '',
failResponse: '',
activeUrl: '',
activeDescription: '',
addMockForm: {
url: '',
description: '',
success: '',
fail: '',
flag: ''
},
successJson: '',
failJson: ''
}
},
components: {
vueJsonEditor
},
methods: {
// 获取mock列表
getMockList() {
getMockList().then((resp) => {
this.mockList = resp.data.data
})
},
openDetailDialog(row) {
this.detailDialogVisible = true
this.successResponse = JSON.parse(row.success)
this.failResponse = JSON.parse(row.fail)
this.activeUrl = row.url
this.activeDescription = row.description
},
openEditDialog(row) {
this.editDialogVisible = true
},
addMock() {
this.addMockForm.success = JSON.stringify(this.addMockForm.success)
this.addMockForm.fail = JSON.stringify(this.addMockForm.fail)
addMock(this.addMockForm).then((resp) => {
if (resp.data.data === true) {
this.addDialogVisible = false
this.getMockList()
return this.$message.success('新增mock成功!')
} else {
return this.$message.error('新增mock失败!')
}
})
},
onSuccessJsonChange() {},
onSuccessJsonSave() {},
onFailJsonChange() {},
onFailJsonSave() {}
},
created() {
this.getMockList()
}
}
</script>
<style lang="less" scoped>
.el-table {
margin-top: 20px;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment