fix(接口测试): 修复环境删除变量会跳转到最后一页的缺陷

--bug=1032690 --user=王孝刚 【项目设置】github#27449,接口测试运行环境变量无法删除 https://www.tapd.cn/55049933/s/1436764
This commit is contained in:
wxg0103 2023-11-15 15:01:10 +08:00 committed by wxg0103
parent 0ec81e3668
commit c5ebe440e8
4 changed files with 31 additions and 31 deletions

View File

@ -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;

View File

@ -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 '';

View File

@ -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() {

View File

@ -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,9 +34,10 @@ 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;
@ -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);
}