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