Commit cfd2fe37 authored by Xuguangxing's avatar Xuguangxing

Merge branch 'feat/v1.6-0621' of git.quantgroup.cn:ui/quantum-blocks into feat/v1.6-0621

parents 1979007b f8862df7
...@@ -130,6 +130,28 @@ import featurePageTable from './featurePageTable.vue'; ...@@ -130,6 +130,28 @@ import featurePageTable from './featurePageTable.vue';
import activityPageTable from './activityPageTable.vue'; import activityPageTable from './activityPageTable.vue';
import navigatorPageTable from './navigatorPageTable.vue'; import navigatorPageTable from './navigatorPageTable.vue';
import navigatorApi from '@api/navigator.api' import navigatorApi from '@api/navigator.api'
// 添加或修改url中的参数
function addOrEditUrlParams (url, paramName, replaceWith) {
if (url.indexOf(paramName) > -1) {
// let re = /(' + paramName + '=)([^&]*)/gi;
// url = url.replace(re, paramName + '=' + replaceWith);
const re = new RegExp(paramName + '=[^&]*', 'gi')
url = url.replace(re, paramName + '=' + replaceWith)
} else {
let paraStr = paramName + '=' + replaceWith;
let idx = url.indexOf('?');
if (idx < 0) {
url += '?';
} else if (idx >= 0 && idx !== url.length - 1) {
url += '&';
}
url = url + paraStr;
}
return url;
};
export default { export default {
components: { components: {
uploader, uploader,
...@@ -346,6 +368,15 @@ export default { ...@@ -346,6 +368,15 @@ export default {
const arr = this.navigatorData.concat([]); const arr = this.navigatorData.concat([]);
const targetIndex = type === 1 ? index - 1 : index + 1; const targetIndex = type === 1 ? index - 1 : index + 1;
arr[index] = arr.splice(targetIndex, 1, arr[index])[0]; arr[index] = arr.splice(targetIndex, 1, arr[index])[0];
for (let i = 0; i < arr.length; i++) {
if (arr[i].pageType == 2) {
console.log(i);
// 活动页面的时候,因上下移动需要重新给index排序
arr[i].pageUrl = addOrEditUrlParams(arr[i].pageUrl, 'index', i)
console.log(arr[i].pageUrl, i)
}
}
console.log(arr);
this.navigatorData = arr; this.navigatorData = arr;
} }
}, },
......
This diff is collapsed.
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