【sgCreateCallAPIFunctionParam】自定义小工具:敏捷开发→调用接口方法参数生成工具

server/2024/9/22 18:24:46/

 

 

<template><div :class="$options.name" class="sgDevTool"><sgHead /><div class="sg-container"><div class="sg-start"><div style="margin-bottom: 10px">参数列表[逗号模式]<el-tooltip:content="`如何获取参数列表[逗号模式]?`":effect="`dark`":enterable="false":placement="`top`":transition="`none`"><el-linkicon="el-icon-info":underline="false"@click="$refs.image.showViewer = true"/></el-tooltip><el-imageref="image"style="display: none":preview-src-list="[`~@/../static/img/${$options.name}.gif`]"/></div><el-inputstyle="margin-bottom: 10px"ref="textareaValue1"type="textarea":placeholder="`请粘贴apifox.com网站对应接口-运行-body-[x-www-form-urlencoded]-批量编辑-逗号模式,复制内容`"v-model="textareaValue1"show-word-limit/><el-button type="primary" @click="createResult">运行</el-button></div><div class="sg-center">→</div><div class="sg-end"><ouputTextarea ref="ouputTextarea" v-model="textareaValue2" /></div></div></div>
</template><script>
import sgHead from "@/vue/components/sgHead";
import ouputTextarea from "@/vue/components/ouputTextarea";
export default {name: "sgCreateCallAPIFunctionParam",components: {sgHead,ouputTextarea,},data() {return {textareaValue1: localStorage[`sgDevTool/leftTextArea`],textareaValue2: "",};},computed: {},watch: {textareaValue1(newValue, oldValue) {newValue && this.createResult(newValue);localStorage[`sgDevTool/leftTextArea`] = newValue;},},created() {},methods: {createResult(d) {if (this.textareaValue1.includes("true,")) {let texts = this.$g.getMultiLineTexts(this.textareaValue1);let r = [];texts.forEach((v) => {if (v.includes("true,")) {r.push(v.split("true,")[1].split(",")[0].replace(/\[/g, ``).replace(/\]/g, ``).replace(/\s+/g, ""));}});let params1 = r.join(",");let params2 = r.join(",\n");this.textareaValue2 = `${params1}${params2},
`;this.$refs.ouputTextarea.copyResult(); //自动复制生成结果} else {return this.$message.error(this.$refs.textareaValue1.$attrs.placeholder);}},},
};
</script><style lang="scss" scoped>
@import "~@/css/sgDevTool";
</style>


http://www.ppmy.cn/server/120400.html

相关文章

c++ prime plus-5-編程練習

1, #include <iostream> using namespace std;int main() {int num1,num2,sum0;cout << "請輸入第一個整數&#xff08;較小的整數&#xff09;:";cin >> num1;cout << "請輸入第二個整數&#xff08;較大的整數&#xff09;&#xf…

Rust编写Windows服务

文章目录 Rust编写Windows服务一&#xff1a;Windows服务程序大致原理二&#xff1a;Rust中编写windows服务三&#xff1a;具体实例 Rust编写Windows服务 编写Windows服务可选语言很多, 其中C#最简单。本着练手Rust语言&#xff0c;尝试用Rust编写一个服务。 一&#xff1a;Win…

第k个排列 - 华为OD统一考试(E卷)

2024华为OD机试(E卷+D卷+C卷)最新题库【超值优惠】Java/Python/C++合集 题目描述 给定参数n,从1到n会有n个整数:1,2,3,.,n,这n个数字共有 n!种排列。按大小顺序升序列出所有排列情况,并-一标记,当n=3时,所有排列如下: “123” “132” “213” “231” “312” “…

「数组」十大排序:精讲与分析(C++)

概述 截止目前&#xff0c;我们已经讲解并分析了十种最常见的排序算法&#xff0c;下附对应文章链接和全体Code。 链接 「数组」冒泡排序|选择排序|插入排序 / 及优化方案&#xff08;C&#xff09; 「数组」归并排序 / if语句优化|小区间插入优化&#xff08;C&#xff09…

CTFShow-反序列化

一些基础&#xff1a; private变量会被序列化为&#xff1a;\x00类名\x00变量名 protected变量会被序列化为: \x00*\x00变量名 public变量会被序列化为&#xff1a;变量名 __sleep() //在对象被序列化之前运行 * __wakeup() //将在反序列化之后立即调用&#xff08;当反序列化时…

天安门广场预约分析

首先&#xff0c;我们进入到首页&#xff0c;https://yuyue.tamgw.beijing.gov.cn/index.html&#xff0c;我们选择个人预约信息。 第一个比较重要的参数playDate&#xff0c;就是预约日期&#xff0c;一般可以预约未来1-7天的不同时间段&#xff0c;这里我们选择好固定的日期…

鸿蒙OpenHarmony【轻量系统芯片移植】轻量系统STM32F407芯片移植案例

轻量系统STM32F407芯片移植案例 介绍基于STM32F407IGT6芯片在拓维信息[Niobe407]开发板上移植OpenHarmony LiteOS-M轻量系统&#xff0c;提供交通、工业领域开发板解决方案。移植架构采用Board与SoC分离方案&#xff0c;使用arm gcc工具链Newlib C库&#xff0c;实现了lwip、l…

SQL Server 2022的数据类型

新书速览|SQL Server 2022从入门到精通&#xff1a;视频教学超值版_sql server 2022 出版社-CSDN博客 《SQL Server 2022从入门到精通&#xff08;视频教学超值版&#xff09;&#xff08;数据库技术丛书&#xff09;》(王英英)【摘要 书评 试读】- 京东图书 (jd.com) 数据类…