From c5ebe440e869d81cc82aadfadc4ef8780e806796 Mon Sep 17 00:00:00 2001 From: wxg0103 <727495428@qq.com> Date: Wed, 15 Nov 2023 15:01:10 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=8E=A5=E5=8F=A3=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=8E=AF=E5=A2=83=E5=88=A0=E9=99=A4=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E4=BC=9A=E8=B7=B3=E8=BD=AC=E5=88=B0=E6=9C=80=E5=90=8E?= =?UTF-8?q?=E4=B8=80=E9=A1=B5=E7=9A=84=E7=BC=BA=E9=99=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1032690 --user=王孝刚 【项目设置】github#27449,接口测试运行环境变量无法删除 https://www.tapd.cn/55049933/s/1436764 --- .../src/business/automation/ApiAutomation.vue | 4 +- .../scenario/common/ApiBaseComponent.vue | 2 +- .../commons/ApiScenarioVariables.vue | 1 - system-setting/frontend/src/main.js | 55 ++++++++++--------- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/api-test/frontend/src/business/automation/ApiAutomation.vue b/api-test/frontend/src/business/automation/ApiAutomation.vue index 0e6e35e272..ae6b5877cc 100644 --- a/api-test/frontend/src/business/automation/ApiAutomation.vue +++ b/api-test/frontend/src/business/automation/ApiAutomation.vue @@ -538,10 +538,10 @@ export default { if (item.headers && item.headers.length <= 1) { delete item.headers; } - if (item.arguments && item.arguments.length <= 1) { + if (item.arguments) { delete item.arguments; } - if (item.arguments && item.arguments.length > 0) { + if (item.arguments && item.arguments.length > 1) { item.arguments.forEach((arg) => { if (!arg.isEdit || arg.isEdit) { delete arg.isEdit; diff --git a/api-test/frontend/src/business/automation/scenario/common/ApiBaseComponent.vue b/api-test/frontend/src/business/automation/scenario/common/ApiBaseComponent.vue index 1803a07e29..56e4ebb97f 100644 --- a/api-test/frontend/src/business/automation/scenario/common/ApiBaseComponent.vue +++ b/api-test/frontend/src/business/automation/scenario/common/ApiBaseComponent.vue @@ -261,7 +261,7 @@ export default { return store.selectStep; }, colorStyle() { - if (this.selectStep?.resourceId === this.data.resourceId) { + if (this.selectStep?.resourceId === this.data.resourceId && this.selectStep?.index === this.data.index) { return this.color; } else { return ''; diff --git a/framework/sdk-parent/frontend/src/components/environment/commons/ApiScenarioVariables.vue b/framework/sdk-parent/frontend/src/components/environment/commons/ApiScenarioVariables.vue index c7cc573eee..bcaa41b505 100644 --- a/framework/sdk-parent/frontend/src/components/environment/commons/ApiScenarioVariables.vue +++ b/framework/sdk-parent/frontend/src/components/environment/commons/ApiScenarioVariables.vue @@ -264,7 +264,6 @@ export default { const itemsIndex = this.items.findIndex((d) => d.name === index.name); this.items.splice(itemsIndex, 1); this.sortParameters(); - this.currentPage = Math.ceil(this.allData.length / this.pageSize); this.queryPage(); }, queryPage() { diff --git a/system-setting/frontend/src/main.js b/system-setting/frontend/src/main.js index 7e543ef6a9..15ccf80a54 100644 --- a/system-setting/frontend/src/main.js +++ b/system-setting/frontend/src/main.js @@ -1,29 +1,30 @@ -import "./public-path" -import Vue from "vue" -import "metersphere-frontend/src/styles/index.scss" +import "./public-path"; +import Vue from "vue"; +import "metersphere-frontend/src/styles/index.scss"; import ElementUI from "element-ui"; -import App from "./App.vue" +import App from "./App.vue"; import i18n from "./i18n"; -import router from "./router" -import {createPinia, PiniaVuePlugin} from 'pinia' -import PersistedState from 'pinia-plugin-persistedstate' -import icons from "metersphere-frontend/src/icons" +import router from "./router"; +import { createPinia, PiniaVuePlugin } from "pinia"; +import PersistedState from "pinia-plugin-persistedstate"; +import icons from "metersphere-frontend/src/icons"; import svg from "metersphere-frontend/src/components/svg"; import plugins from "metersphere-frontend/src/plugins"; import directives from "metersphere-frontend/src/directive"; import filters from "metersphere-frontend/src/filters"; import "metersphere-frontend/src/router/permission"; -import VueShepherd from 'vue-shepherd' // 新手引导 -import 'metersphere-frontend/src/assets/shepherd/shepherd-theme.css' +import VueShepherd from "vue-shepherd"; // 新手引导 +import VuePapaParse from "vue-papa-parse"; +import "metersphere-frontend/src/assets/shepherd/shepherd-theme.css"; import { gotoCancel, gotoNext } from "metersphere-frontend/src/utils"; -Vue.config.productionTip = false +Vue.config.productionTip = false; -const pinia = createPinia() -pinia.use(PersistedState) //开启缓存,存储在localstorage +const pinia = createPinia(); +pinia.use(PersistedState); //开启缓存,存储在localstorage Vue.use(ElementUI, { - i18n: (key, value) => i18n.t(key, value) + i18n: (key, value) => i18n.t(key, value), }); Vue.use(svg); @@ -33,14 +34,15 @@ Vue.use(directives); Vue.use(filters); Vue.use(PiniaVuePlugin); Vue.use(VueShepherd); +Vue.use(VuePapaParse); -Vue.prototype.gotoCancel = gotoCancel -Vue.prototype.gotoNext = gotoNext +Vue.prototype.gotoCancel = gotoCancel; +Vue.prototype.gotoNext = gotoNext; let instance = null; function render(props = {}) { - const {container, eventBus = new Vue()} = props; + const { container, eventBus = new Vue() } = props; // 添加全局事件总线 Vue.prototype.$EventBus = eventBus; @@ -48,14 +50,14 @@ function render(props = {}) { i18n, router, pinia, - render: h => h(App), - }).$mount(container ? container.querySelector('#app') : '#app'); + render: (h) => h(App), + }).$mount(container ? container.querySelector("#app") : "#app"); // 解决qiankun下,vue-devtools不显示的问题 - if (process.env.NODE_ENV === 'development') { - const instanceDiv = document.createElement('div') - instanceDiv.__vue__ = instance - document.body.appendChild(instanceDiv) + if (process.env.NODE_ENV === "development") { + const instanceDiv = document.createElement("div"); + instanceDiv.__vue__ = instance; + document.body.appendChild(instanceDiv); } } @@ -68,8 +70,7 @@ if (!window.__POWERED_BY_QIANKUN__) { * bootstrap 只会在微应用初始化的时候调用一次,下次微应用重新进入时会直接调用 mount 钩子,不会再重复触发 bootstrap。 * 通常我们可以在这里做一些全局变量的初始化,比如不会在 unmount 阶段被销毁的应用级别的缓存等。 */ -export async function bootstrap(props) { -} +export async function bootstrap(props) {} /** * 应用每次进入都会调用 mount 方法,通常我们在这里触发应用的渲染方法 @@ -78,7 +79,7 @@ export async function mount(props) { props.onGlobalStateChange((state, prev) => { // state: 变更后的状态; prev 变更前的状态 }); - props.setGlobalState({event: 'opendialog'}); + props.setGlobalState({ event: "opendialog" }); render(props); } @@ -92,7 +93,7 @@ export async function unmount(props) { /** * 更新钩子,目前只有routeParams更新,后续有其他属性更新再添加 */ -export async function update (props) { +export async function update(props) { const { defaultPath, routeParams, routeName } = props; // 微服务过来的路由 if (defaultPath || routeName) {