mirror of
https://gitee.com/zongzhige/shopxo-diy.git
synced 2026-06-05 18:25:52 +08:00
1.链接优化
sws 2024-08-19
This commit is contained in:
@ -1,6 +1,6 @@
|
|||||||
## 模拟环境
|
## 模拟环境
|
||||||
NODE_ENV='staging'
|
NODE_ENV='staging'
|
||||||
|
|
||||||
VITE_APP_TITLE = 'vue3-element-admin'
|
VITE_APP_TITLE = 'shopxo'
|
||||||
VITE_APP_PORT = 3000
|
VITE_APP_PORT = 3000
|
||||||
VITE_APP_BASE_API = '/prod--api'
|
VITE_APP_BASE_API = '/prod--api'
|
||||||
|
|||||||
110
package.json
110
package.json
@ -1,57 +1,57 @@
|
|||||||
{
|
{
|
||||||
"name": "shopxo-diy",
|
"name": "shopxo-diy",
|
||||||
"version": "0.0.0",
|
"version": "0.0.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
"build": "vite build",
|
"build": "vite build --mode development",
|
||||||
"preview": "vite preview",
|
"preview": "vite preview",
|
||||||
"build-pro": "vite build --mode production",
|
"build-pro": "vite build --mode production",
|
||||||
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false",
|
"type-check": "vue-tsc --noEmit -p tsconfig.app.json --composite false",
|
||||||
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
|
||||||
"format": "prettier --write src/"
|
"format": "prettier --write src/"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/dompurify": "^3.0.5",
|
"@types/dompurify": "^3.0.5",
|
||||||
"@vueuse/core": "^10.2.1",
|
"@vueuse/core": "^10.2.1",
|
||||||
"@wangeditor/editor": "^5.1.23",
|
"@wangeditor/editor": "^5.1.23",
|
||||||
"@wangeditor/editor-for-vue": "^5.1.12",
|
"@wangeditor/editor-for-vue": "^5.1.12",
|
||||||
"axios": "^1.4.0",
|
"axios": "^1.4.0",
|
||||||
"dompurify": "^3.1.6",
|
"dompurify": "^3.1.6",
|
||||||
"element-plus": "^2.3.7",
|
"element-plus": "^2.3.7",
|
||||||
"pinia": "^2.1.3",
|
"pinia": "^2.1.3",
|
||||||
"qrcode": "^1.5.3",
|
"qrcode": "^1.5.3",
|
||||||
"swiper": "^11.1.5",
|
"swiper": "^11.1.5",
|
||||||
"terser": "^5.31.5",
|
"terser": "^5.31.5",
|
||||||
"tsparticles": "^2.11.0",
|
"tsparticles": "^2.11.0",
|
||||||
"unocss": "^0.53.5",
|
"unocss": "^0.53.5",
|
||||||
"vue": "^3.3.4",
|
"vue": "^3.3.4",
|
||||||
"vue-draggable-plus": "^0.5.0",
|
"vue-draggable-plus": "^0.5.0",
|
||||||
"vue-router": "^4.0.13",
|
"vue-router": "^4.0.13",
|
||||||
"vue3-draggable-resizable": "^1.6.5"
|
"vue3-draggable-resizable": "^1.6.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@iconify-json/ep": "^1.1.11",
|
"@iconify-json/ep": "^1.1.11",
|
||||||
"@rushstack/eslint-patch": "^1.2.0",
|
"@rushstack/eslint-patch": "^1.2.0",
|
||||||
"@tsconfig/node18": "^2.0.1",
|
"@tsconfig/node18": "^2.0.1",
|
||||||
"@types/sortablejs": "^1.15.8",
|
"@types/sortablejs": "^1.15.8",
|
||||||
"@vitejs/plugin-vue": "^4.2.3",
|
"@vitejs/plugin-vue": "^4.2.3",
|
||||||
"@vue/eslint-config-prettier": "^7.1.0",
|
"@vue/eslint-config-prettier": "^7.1.0",
|
||||||
"@vue/eslint-config-typescript": "^11.0.3",
|
"@vue/eslint-config-typescript": "^11.0.3",
|
||||||
"@vue/tsconfig": "^0.4.0",
|
"@vue/tsconfig": "^0.4.0",
|
||||||
"eslint": "^8.39.0",
|
"eslint": "^8.39.0",
|
||||||
"eslint-plugin-vue": "^9.11.0",
|
"eslint-plugin-vue": "^9.11.0",
|
||||||
"fast-glob": "3.2.11",
|
"fast-glob": "3.2.11",
|
||||||
"npm-run-all": "^4.1.5",
|
"npm-run-all": "^4.1.5",
|
||||||
"prettier": "^3.0.0",
|
"prettier": "^3.0.0",
|
||||||
"sass": "^1.63.6",
|
"sass": "^1.63.6",
|
||||||
"typescript": "~5.0.4",
|
"typescript": "~5.0.4",
|
||||||
"unplugin-auto-import": "^0.16.6",
|
"unplugin-auto-import": "^0.16.6",
|
||||||
"unplugin-icons": "^0.16.3",
|
"unplugin-icons": "^0.16.3",
|
||||||
"unplugin-vue-components": "^0.25.1",
|
"unplugin-vue-components": "^0.25.1",
|
||||||
"vite": "^4.3.9",
|
"vite": "^4.3.9",
|
||||||
"vite-plugin-svg-icons": "2.0.1",
|
"vite-plugin-svg-icons": "2.0.1",
|
||||||
"vue-tsc": "^1.6.5",
|
"vue-tsc": "^1.6.5",
|
||||||
"vue3-particles": "^2.10.1"
|
"vue3-particles": "^2.10.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,7 +25,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { urlValueStore, urlValue } from '@/store';
|
import { urlValueStore, urlValue, pageLinkList } from '@/store';
|
||||||
const url_value_store = urlValueStore();
|
const url_value_store = urlValueStore();
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
// 重置
|
// 重置
|
||||||
@ -42,35 +42,43 @@ watch(
|
|||||||
);
|
);
|
||||||
const modelValue = defineModel({ type: Object, default: {} });
|
const modelValue = defineModel({ type: Object, default: {} });
|
||||||
const search_value = ref('');
|
const search_value = ref('');
|
||||||
const base_data = computed(() => {
|
const base_data = ref<pageLinkList[]>([]);
|
||||||
|
const new_base_data = ref<pageLinkList[]>([]);
|
||||||
|
onMounted(() => {
|
||||||
// 过滤url_value_store.url_value.page_link_list中的type为shop的data的数据,只保留data数组
|
// 过滤url_value_store.url_value.page_link_list中的type为shop的data的数据,只保留data数组
|
||||||
return url_value_store.url_value.page_link_list.filter((item: any) => {
|
base_data.value = url_value_store.url_value.page_link_list.filter((item: any) => {
|
||||||
if (item.type == 'shop') {
|
if (item.type == 'shop') {
|
||||||
return item.data;
|
return item.data;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
new_base_data.value = base_data.value[0].data;
|
||||||
});
|
});
|
||||||
const new_base_data = computed(() => {
|
|
||||||
// 过滤url_value_store.url_value.page_link_list中的type为shop的data的数据,只保留data数组
|
|
||||||
return base_data.value[0].data;
|
|
||||||
});
|
|
||||||
const handle_search = () => {
|
const handle_search = () => {
|
||||||
// 根据关键词过滤new_base_data数据
|
// 根据关键词过滤new_base_data数据,如果==父级 显示父级和父级下的所有子级数据,如果==子级则显示该子级数据和父级
|
||||||
new_base_data.value.filter((item: any) => {
|
let bool = false;
|
||||||
if (item.data) {
|
if (search_value.value) {
|
||||||
return item.data.filter((item: any) => {
|
new_base_data.value = new_base_data.value.filter((item: any) => {
|
||||||
if (item.name.includes(search_value.value)) {
|
if (item.name == search_value.value) {
|
||||||
return item;
|
bool = true;
|
||||||
}
|
console.log(1);
|
||||||
});
|
return item;
|
||||||
} else {
|
}
|
||||||
return item.filter((item: any) => {
|
});
|
||||||
if (item.name.includes(search_value.value)) {
|
if (!true) {
|
||||||
return item;
|
new_base_data.value = new_base_data.value.filter((item: any) => {
|
||||||
}
|
item.filter((child: any) => {
|
||||||
|
if (child.name == search_value.value) {
|
||||||
|
bool = true;
|
||||||
|
return child;
|
||||||
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
} else {
|
||||||
|
new_base_data.value = base_data.value[0].data;
|
||||||
|
}
|
||||||
|
console.log(new_base_data.value);
|
||||||
};
|
};
|
||||||
const menu_active = ref('');
|
const menu_active = ref('');
|
||||||
const emit = defineEmits(['update:link']);
|
const emit = defineEmits(['update:link']);
|
||||||
|
|||||||
@ -28,7 +28,7 @@ export const urlValueStore = defineStore('urlValue', () => {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
interface pageLinkList {
|
export interface pageLinkList {
|
||||||
name: string;
|
name: string;
|
||||||
type: string;
|
type: string;
|
||||||
data: pageLinkList[];
|
data: pageLinkList[];
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import { get_cookie } from './index';
|
|||||||
// 创建 axios 实例
|
// 创建 axios 实例
|
||||||
const index = window.location.href.lastIndexOf('?s=');
|
const index = window.location.href.lastIndexOf('?s=');
|
||||||
const pro_url = window.location.href.substring(0, index);
|
const pro_url = window.location.href.substring(0, index);
|
||||||
|
console.log(import.meta.env.VITE_APP_BASE_API);
|
||||||
const service = axios.create({
|
const service = axios.create({
|
||||||
baseURL: import.meta.env.VITE_APP_BASE_API == '/dev-api' ? import.meta.env.VITE_APP_BASE_API : pro_url + '?s=',
|
baseURL: import.meta.env.VITE_APP_BASE_API == '/dev-api' ? import.meta.env.VITE_APP_BASE_API : pro_url + '?s=',
|
||||||
timeout: 50000,
|
timeout: 50000,
|
||||||
@ -33,9 +34,10 @@ service.interceptors.response.use(
|
|||||||
const { code, msg, data } = response.data;
|
const { code, msg, data } = response.data;
|
||||||
if (code == 0) {
|
if (code == 0) {
|
||||||
return response.data;
|
return response.data;
|
||||||
} else if(code == -400) {
|
} else if (code == -400) {
|
||||||
ElMessageBox.alert(msg, '温馨提示', {
|
ElMessageBox.alert(msg, '温馨提示', {
|
||||||
confirmButtonText: '确定',
|
confirmButtonText: '确定',
|
||||||
|
showClose: false,
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
localStorage.clear(); // @vueuse/core 自动导入
|
localStorage.clear(); // @vueuse/core 自动导入
|
||||||
|
|||||||
BIN
装修-标题1-页面设置.png
BIN
装修-标题1-页面设置.png
Binary file not shown.
|
Before Width: | Height: | Size: 94 KiB |
Reference in New Issue
Block a user