开放平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

304 rivejä
8.3 KiB

  1. <template>
  2. <div class="debugApi-box">
  3. <div class="apiBox-head">
  4. <div class="api-title">API市场</div>
  5. <div class="seek-input">
  6. <el-input placeholder="搜索接口连接/方法名/接口中文名"> </el-input>
  7. <span class="seek-slod">搜索</span>
  8. </div>
  9. </div>
  10. <div class="debug-html">
  11. <div class="flex-left">
  12. <el-form
  13. :model="ruleForm"
  14. :rules="rules"
  15. ref="ruleForm"
  16. label-width="100px"
  17. class="demo-ruleForm"
  18. label-position="top"
  19. >
  20. <div class="left-title">接口测试</div>
  21. <el-form-item label="接口" prop="name">
  22. <span class="left-float">查看该接口文档</span>
  23. <el-select v-model="ruleForm.name" filterable placeholder="请选择">
  24. <el-option
  25. v-for="item in options"
  26. :key="item.value"
  27. :label="item.label"
  28. :value="item.value"
  29. >
  30. </el-option>
  31. </el-select>
  32. </el-form-item>
  33. <el-form-item label="请求方式" prop="name">
  34. <el-select v-model="ruleForm.name" filterable placeholder="请选择">
  35. <el-option
  36. v-for="item in options"
  37. :key="item.value"
  38. :label="item.label"
  39. :value="item.value"
  40. >
  41. </el-option>
  42. </el-select>
  43. </el-form-item>
  44. <div class="left-title" style="margin-top: 30px">请求参数</div>
  45. <el-form-item label="APIKEY" prop="name">
  46. <el-input placeholder="请输入内容"></el-input>
  47. </el-form-item>
  48. <div class="key-for">
  49. <el-form-item label="KEY" style="margin-right: 20px">
  50. <el-input placeholder="请输入内容"></el-input>
  51. </el-form-item>
  52. <el-form-item label="value" style="margin-right: 20px">
  53. <el-input placeholder="请输入内容"></el-input>
  54. </el-form-item>
  55. <div
  56. class="span-icon el-icon-remove"
  57. style="margin-right: 12px"
  58. ></div>
  59. <div class="span-icon el-icon-circle-plus"></div>
  60. </div>
  61. <el-button class="onSubmit" type="primary" @click="onSubmit"
  62. >提交测试</el-button
  63. >
  64. </el-form>
  65. </div>
  66. <div class="flex-right">
  67. <div class="rigth-title">输出参数</div>
  68. <div>
  69. <json-viewer
  70. v-if="jsonData"
  71. :value="jsonData"
  72. :expand-depth="5"
  73. expanded
  74. copyable
  75. boxed
  76. sort
  77. ></json-viewer>
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. </template>
  83. <script>
  84. export default {
  85. data() {
  86. return {
  87. ruleForm: {
  88. name: "",
  89. },
  90. options: [
  91. {
  92. value: "选项1",
  93. label: "黄金糕",
  94. },
  95. {
  96. value: "选项2",
  97. label: "双皮奶",
  98. },
  99. {
  100. value: "选项3",
  101. label: "蚵仔煎",
  102. },
  103. {
  104. value: "选项4",
  105. label: "龙须面",
  106. },
  107. {
  108. value: "选项5",
  109. label: "北京烤鸭",
  110. },
  111. ],
  112. rules: {
  113. name: [
  114. { required: true, message: "请输入活动名称", trigger: "blur" },
  115. { min: 3, max: 5, message: "长度在 3 到 5 个字符", trigger: "blur" },
  116. ],
  117. },
  118. jsonData: {
  119. total: 25,
  120. limit: 10,
  121. skip: 0,
  122. links: {
  123. previous: undefined,
  124. next: function () {},
  125. },
  126. data: [
  127. {
  128. id: "5968fcad629fa84ab65a5247",
  129. firstname: "Ada",
  130. lastname: "Lovelace",
  131. awards: null,
  132. known: ["mathematics", "computing"],
  133. position: {
  134. lat: 44.563836,
  135. lng: 6.495139,
  136. },
  137. description: `Augusta Ada King, Countess of Lovelace (née Byron; 10 December 1815 – 27 November 1852) was an English mathematician and writer,
  138. chiefly known for her work on Charles Babbage's proposed mechanical general-purpose computer,
  139. the Analytical Engine. She was the first to recognise that the machine had applications beyond pure calculation,
  140. and published the first algorithm intended to be carried out by such a machine.
  141. As a result, she is sometimes regarded as the first to recognise the full potential of a "computing machine" and the first computer programmer.`,
  142. bornAt: "1815-12-10T00:00:00.000Z",
  143. diedAt: "1852-11-27T00:00:00.000Z",
  144. },
  145. {
  146. id: "5968fcad629fa84ab65a5246",
  147. firstname: "Grace",
  148. lastname: "Hopper",
  149. awards: [
  150. "Defense Distinguished Service Medal",
  151. "Legion of Merit",
  152. "Meritorious Service Medal",
  153. "American Campaign Medal",
  154. "World War II Victory Medal",
  155. "National Defense Service Medal",
  156. "Armed Forces Reserve Medal",
  157. "Naval Reserve Medal",
  158. "Presidential Medal of Freedom",
  159. ],
  160. known: null,
  161. position: {
  162. lat: 43.614624,
  163. lng: 3.879995,
  164. },
  165. description: `Grace Brewster Murray Hopper (née Murray; December 9, 1906 – January 1, 1992)
  166. was an American computer scientist and United States Navy rear admiral.
  167. One of the first programmers of the Harvard Mark I computer,
  168. she was a pioneer of computer programming who invented one of the first compiler related tools.
  169. She popularized the idea of machine-independent programming languages, which led to the development of COBOL,
  170. an early high-level programming language still in use today.`,
  171. bornAt: "1815-12-10T00:00:00.000Z",
  172. diedAt: "1852-11-27T00:00:00.000Z",
  173. },
  174. ],
  175. },
  176. };
  177. },
  178. methods: {
  179. onSubmit: function () {},
  180. },
  181. };
  182. </script>
  183. <style lang="scss" scoped>
  184. .debugApi-box {
  185. width: 1200px;
  186. border-radius: 14px;
  187. overflow: hidden;
  188. .apiBox-head {
  189. height: 184px;
  190. width: 100%;
  191. background: url("../../static/img/index-bar.png");
  192. background-size: 100% 100%;
  193. background-repeat: no-repeat;
  194. display: flex;
  195. align-items: center;
  196. flex-direction: column;
  197. .api-title {
  198. color: #fff;
  199. font-weight: bold;
  200. font-size: 40px;
  201. margin-top: 40px;
  202. }
  203. .seek-input {
  204. width: 350px;
  205. height: 34px;
  206. display: flex;
  207. background: #fff;
  208. border-radius: 17px;
  209. margin-top: 18px;
  210. overflow: hidden;
  211. .seek-slod {
  212. background: #1890ff;
  213. color: #fff;
  214. width: 70px;
  215. height: 34px;
  216. text-align: center;
  217. line-height: 34px;
  218. border-radius: 17px;
  219. padding: 0;
  220. margin: 0;
  221. cursor: pointer;
  222. }
  223. }
  224. }
  225. .debug-html {
  226. display: flex;
  227. margin-top: 20px;
  228. width: 100%;
  229. align-items: baseline;
  230. .flex-left {
  231. width: 468px;
  232. min-height: 585px;
  233. background: #ffffff;
  234. border-radius: 14px;
  235. box-sizing: border-box;
  236. padding: 20px;
  237. .left-title {
  238. color: #333333;
  239. font-size: 20px;
  240. height: 20px;
  241. line-height: 20px;
  242. padding-left: 12px;
  243. border-left: 4px solid #1890ff;
  244. margin-bottom: 20px;
  245. }
  246. .left-float {
  247. position: absolute;
  248. z-index: 99;
  249. right: 0;
  250. top: -40px;
  251. color: #1890ff;
  252. font-size: 14px;
  253. cursor: pointer;
  254. }
  255. }
  256. .flex-right {
  257. width: 712px;
  258. min-height: 710px;
  259. background: #ffffff;
  260. border-radius: 14px;
  261. margin-left: auto;
  262. box-sizing: border-box;
  263. padding: 20px;
  264. .rigth-title {
  265. color: #333333;
  266. font-size: 20px;
  267. height: 20px;
  268. line-height: 20px;
  269. padding-left: 12px;
  270. border-left: 4px solid #1890ff;
  271. margin-bottom: 20px;
  272. }
  273. }
  274. .key-for {
  275. display: flex;
  276. .span-icon {
  277. color: #1890ff;
  278. cursor: pointer;
  279. line-height: 11px;
  280. margin-top: 53px;
  281. font-size: 16px;
  282. }
  283. }
  284. .onSubmit {
  285. margin: 20px auto 0;
  286. display: block;
  287. }
  288. }
  289. }
  290. </style>