Merge branch 'dev-sws' into dev-yxl
commit
f23679ebe2
|
|
@ -13,6 +13,7 @@
|
|||
},
|
||||
"dependencies": {
|
||||
"@types/dompurify": "^3.0.5",
|
||||
"@types/qrcode": "^1.5.5",
|
||||
"@vueuse/core": "^10.2.1",
|
||||
"@wangeditor/editor": "^5.1.23",
|
||||
"@wangeditor/editor-for-vue": "^5.1.12",
|
||||
|
|
@ -20,7 +21,7 @@
|
|||
"dompurify": "^3.1.6",
|
||||
"element-plus": "^2.3.7",
|
||||
"pinia": "^2.1.3",
|
||||
"qrcode": "^1.5.3",
|
||||
"qrcode": "^1.5.4",
|
||||
"swiper": "^11.1.5",
|
||||
"terser": "^5.31.5",
|
||||
"tsparticles": "^2.11.0",
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ class UploadAPI {
|
|||
/** 分类查询接口*/
|
||||
static getTree() {
|
||||
return request({
|
||||
url: `diyapi/attachmentinit`,
|
||||
url: `diyapi/attachmentcategory`,
|
||||
method: 'post',
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,13 +1,6 @@
|
|||
import request from '@/utils/request';
|
||||
|
||||
class UrlValueAPI {
|
||||
/** 链接初始化接口 */
|
||||
static getInit() {
|
||||
return request({
|
||||
url: `diyapi/linkinit`,
|
||||
method: 'post',
|
||||
});
|
||||
}
|
||||
/** 获取商品列表 */
|
||||
static getGoodsList(data: any) {
|
||||
return request({
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<!-- 上传组件 -->
|
||||
<template>
|
||||
<el-dialog v-model="dialog_visible" fullscreen @close="close_event">
|
||||
<el-dialog v-model="dialog_visible" fullscreen :close-on-click-modal="false" @close="close_event">
|
||||
<template #header>
|
||||
<div class="title re">
|
||||
<div class="tc size-16 fw">编辑热区</div>
|
||||
|
|
@ -57,7 +57,7 @@
|
|||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="hot_dialog_visible" width="560" append-to-body draggable @close="hot_close_event">
|
||||
<el-dialog v-model="hot_dialog_visible" width="560" append-to-body draggable :close-on-click-modal="false" @close="hot_close_event">
|
||||
<template #header>
|
||||
<div class="title re">
|
||||
<div class="tc size-16 fw">设置热区</div>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<el-dialog v-model="dialog_visible" class="radius-lg" width="1168" draggable append-to-body @close="close_event">
|
||||
<el-dialog v-model="dialog_visible" class="radius-lg" width="1168" draggable append-to-body :close-on-click-modal="false" @close="close_event">
|
||||
<template #header>
|
||||
<div class="title center re">
|
||||
<div class="tc size-16 fw">主题选择</div>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<el-dialog v-model="dialog_visible_category_operate" class="radius-lg" width="500" draggable append-to-body>
|
||||
<el-dialog v-model="dialog_visible_category_operate" class="radius-lg" width="500" :close-on-click-modal="false" draggable append-to-body>
|
||||
<template #header>
|
||||
<div class="title center re">
|
||||
<div class="tc size-16 fw">{{ type == 'add' ? '添加' : '编辑' }}附件分类</div>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<!-- 上传组件 -->
|
||||
<template>
|
||||
<el-dialog v-model="dialog_visible" class="radius-lg" width="1168" draggable append-to-body>
|
||||
<el-dialog v-model="dialog_visible" class="radius-lg" width="1168" draggable :close-on-click-modal="false" append-to-body>
|
||||
<template #header>
|
||||
<div class="title re">
|
||||
<el-radio-group v-model="upload_type" is-button @change="upload_type_change">
|
||||
|
|
@ -70,7 +70,7 @@
|
|||
<el-scrollbar v-loading="img_loading" height="440px">
|
||||
<div v-if="upload_list.length > 0" class="flex-row flex-wrap align-c gap-y-15 gap-x-10 pa-10">
|
||||
<div v-for="(item, index) in upload_list" :key="index" class="item" @click="check_img_event(item)">
|
||||
<el-badge :value="view_list_value.findIndex((i) => i.id === item.id) == -1 ? '' : view_list_value.findIndex((i) => i.id === item.id) + 1" class="badge flex-col gap-5 w" :hidden="view_list_value.findIndex((i) => i.id === item.id) == -1">
|
||||
<el-badge :value="view_list_value.findIndex((i) => i.id === item.id) == -1 ? '' : view_list_value.findIndex((i) => i.id === item.id) + 1" class="badge flex-col gap-5 w" :hidden="view_list_value.findIndex((i) => i.id === item.id) == -1 || limit == 1">
|
||||
<div class="item-content re br-f5 radius">
|
||||
<template v-if="upload_type == 'video'">
|
||||
<video :src="item.url" class="w h" @error="handle_error(index)"></video>
|
||||
|
|
@ -223,10 +223,11 @@
|
|||
<script lang="ts" setup>
|
||||
import { ext_img_name_list, ext_video_name_list, ext_file_name_list, ext_file_name_list_map } from './index';
|
||||
import UploadAPI, { Tree } from '@/api/upload';
|
||||
import { uploadStore } from '@/store';
|
||||
import { uploadStore, commonStore } from '@/store';
|
||||
import { isEmpty } from 'lodash';
|
||||
import searchIcons from '@/assets/search-icons/iconfont.json';
|
||||
const upload_store = uploadStore();
|
||||
const common_store = commonStore();
|
||||
const app = getCurrentInstance();
|
||||
/**
|
||||
* @description: 图片上传
|
||||
|
|
@ -297,9 +298,7 @@ watch(
|
|||
} else {
|
||||
upload_type.value = props.type;
|
||||
}
|
||||
// upload_type.value = props.type;
|
||||
// 获取分类
|
||||
get_tree();
|
||||
|
||||
// 获取附件列表
|
||||
get_attachment_list();
|
||||
|
||||
|
|
@ -373,9 +372,9 @@ const get_tree = (bool: boolean = false) => {
|
|||
tree_loading.value = true;
|
||||
UploadAPI.getTree()
|
||||
.then((res) => {
|
||||
// 将all_tree和res.data.category_list全部插入到type_data.value,all_tree放在数组最前面
|
||||
type_data.value = [all_tree, ...res.data.category_list];
|
||||
type_data_list.value = res.data.category_list;
|
||||
// 将all_tree和res.data.attachment_category全部插入到type_data.value,all_tree放在数组最前面
|
||||
type_data.value = [all_tree, ...res.data.attachment_category];
|
||||
type_data_list.value = res.data.attachment_category;
|
||||
upload_store.set_category(type_data_list.value);
|
||||
tree_loading.value = false;
|
||||
})
|
||||
|
|
@ -700,8 +699,21 @@ const close_upload_model = (data: any) => {
|
|||
onMounted(() => {
|
||||
// 监听点击事件
|
||||
document.addEventListener('click', video_show);
|
||||
get_tree();
|
||||
nextTick(() => {
|
||||
setTimeout(() => {
|
||||
// 获取分类
|
||||
if (common_store.common.attachment_category.length > 0) {
|
||||
type_data_list.value = common_store.common.attachment_category;
|
||||
type_data.value = [all_tree, ...common_store.common.attachment_category];
|
||||
upload_store.set_category(common_store.common.attachment_category);
|
||||
upload_store.set_is_upload_api(true);
|
||||
} else {
|
||||
get_tree();
|
||||
}
|
||||
}, 1000);
|
||||
});
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
// 移除监听事件
|
||||
document.removeEventListener('click', video_show);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<!-- 上传组件 -->
|
||||
<template>
|
||||
<el-dialog v-model="dialogVisible" class="radius-lg" width="1168" draggable append-to-body @close="close_dialog">
|
||||
<el-dialog v-model="dialogVisible" class="radius-lg" width="1168" draggable append-to-body :close-on-click-modal="false" @close="close_dialog">
|
||||
<template #header>
|
||||
<div class="title center re">
|
||||
<div class="tc size-16 fw">{{ upload_type_name }}上传</div>
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
</el-form-item>
|
||||
<el-form-item label="上传至分组" prop="category_id">
|
||||
<div class="form-item-width">
|
||||
<el-cascader v-model="form.category_id" class="w" :options="cascader_data" placeholder="请选择" :show-all-levels="false" filterable clearable change="category_id_change"></el-cascader>
|
||||
<el-cascader v-model="form.category_id" class="w" :options="cascader_data" placeholder="请选择" :show-all-levels="false" filterable clearable @change="category_id_change"></el-cascader>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<template v-if="form.type == 'loc'">
|
||||
|
|
@ -101,8 +101,8 @@
|
|||
<div class="table-cell-operate">操作</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="scan_file_list.length > 0">
|
||||
<el-scrollbar height="224px">
|
||||
<el-scrollbar height="224px">
|
||||
<div v-if="scan_file_list.length > 0">
|
||||
<div class="table-body">
|
||||
<div v-for="(item, index) in scan_file_list" :key="index" class="table-row">
|
||||
<div class="table-cell">
|
||||
|
|
@ -133,17 +133,17 @@
|
|||
<div class="table-cell-operate" @click="del_already_upload(item.id, index)">删除</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
<div v-else>
|
||||
<no-data height="280px"></no-data>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
<no-data height="280px"></no-data>
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
</div>
|
||||
</template>
|
||||
<template v-else-if="form.type == 'web'">
|
||||
<el-form-item label="网络图片">
|
||||
<div class="flex-row align-c gap-10">
|
||||
<el-input v-model="form.web_image" class="form-item-width" placeholder="请输入网络图片地址" />
|
||||
<el-input v-model="form.web_image" class="form-item-width" placeholder="请输入网络图片地址" clearable />
|
||||
<div class="c-pointer cr-primary size-12" @click="extract_images(ruleFormRef)">提取图片</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
|
@ -224,7 +224,8 @@ const rules = reactive<FormRules>({
|
|||
});
|
||||
// 是否给二维码加模糊效果
|
||||
const is_mask = ref(true);
|
||||
const timer = ref<number | null>(null);
|
||||
const timer = ref<any>(null);
|
||||
const scan_uuid = ref('');
|
||||
// 上传方式
|
||||
const upload_type_change = (type: any) => {
|
||||
// 清除之前的定时器(如果存在)
|
||||
|
|
@ -235,20 +236,19 @@ const upload_type_change = (type: any) => {
|
|||
}
|
||||
if (type == 'scan') {
|
||||
timer.value = setInterval(async () => {
|
||||
if (scan_uuid.value.toString().length > 0) {
|
||||
if (scan_uuid.value.length > 0) {
|
||||
const { data } = await UploadAPI.uploadQrcode({ key: scan_uuid.value });
|
||||
scan_file_list.value = data;
|
||||
scan_file_list.value = data || [];
|
||||
}
|
||||
}, 3000);
|
||||
}
|
||||
};
|
||||
const scan_uuid = ref('');
|
||||
// 选择分组
|
||||
const category_id_change = (val: any) => {
|
||||
if (val && val.length > 0) {
|
||||
scan_file_list.value = [];
|
||||
is_mask.value = false;
|
||||
scan_uuid.value = get_math();
|
||||
scan_uuid.value = get_math() + '';
|
||||
let new_url = '';
|
||||
if (import.meta.env.VITE_APP_BASE_API == '/dev-api') {
|
||||
new_url = get_before_string(import.meta.env.VITE_APP_BASE_API_URL);
|
||||
|
|
|
|||
|
|
@ -40,8 +40,8 @@
|
|||
</template>
|
||||
<script lang="ts" setup>
|
||||
import UrlValueAPI from '@/api/url-value';
|
||||
import { urlValueStore } from '@/store';
|
||||
const url_value_store = urlValueStore();
|
||||
import { commonStore } from '@/store';
|
||||
const common_store = commonStore();
|
||||
const props = defineProps({
|
||||
// 重置
|
||||
reset: {
|
||||
|
|
@ -71,7 +71,7 @@ const init = () => {
|
|||
template_selection.value = '';
|
||||
category_ids.value = '';
|
||||
search_value.value = '';
|
||||
article_category_list.value = url_value_store.url_value.article_category_list;
|
||||
article_category_list.value = common_store.common.article_category;
|
||||
get_list(1);
|
||||
};
|
||||
const handle_search = () => {
|
||||
|
|
|
|||
|
|
@ -41,8 +41,8 @@
|
|||
</template>
|
||||
<script lang="ts" setup>
|
||||
import UrlValueAPI from '@/api/url-value';
|
||||
import { urlValueStore } from '@/store';
|
||||
const url_value_store = urlValueStore();
|
||||
import { commonStore } from '@/store';
|
||||
const common_store = commonStore();
|
||||
const props = defineProps({
|
||||
// 重置
|
||||
reset: {
|
||||
|
|
@ -78,7 +78,7 @@ const init = () => {
|
|||
category_ids.value = [];
|
||||
brand_ids.value = '';
|
||||
search_value.value = '';
|
||||
brand_category.value = url_value_store.url_value.brand_category;
|
||||
brand_category.value = common_store.common.brand_category;
|
||||
get_list(1);
|
||||
};
|
||||
const handle_search = () => {
|
||||
|
|
|
|||
|
|
@ -30,8 +30,8 @@
|
|||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { urlValueStore } from '@/store';
|
||||
const url_value_store = urlValueStore();
|
||||
import { commonStore } from '@/store';
|
||||
const common_store = commonStore();
|
||||
const props = defineProps({
|
||||
// 重置
|
||||
reset: {
|
||||
|
|
@ -55,8 +55,8 @@ onMounted(() => {
|
|||
});
|
||||
const init = () => {
|
||||
search_value.value = '';
|
||||
table_data.value = url_value_store.url_value.goods_category;
|
||||
new_table_data.value = url_value_store.url_value.goods_category;
|
||||
table_data.value = common_store.common.goods_category;
|
||||
new_table_data.value = common_store.common.goods_category;
|
||||
};
|
||||
// 筛选
|
||||
const handle_search = () => {
|
||||
|
|
|
|||
|
|
@ -62,8 +62,8 @@
|
|||
</template>
|
||||
<script lang="ts" setup>
|
||||
import type { FormInstance, FormRules } from 'element-plus';
|
||||
import { urlValueStore } from '@/store';
|
||||
const url_value_store = urlValueStore();
|
||||
import { commonStore } from '@/store';
|
||||
const common_store = commonStore();
|
||||
const props = defineProps({
|
||||
status: {
|
||||
type: Boolean,
|
||||
|
|
@ -110,8 +110,8 @@ const brand_data = ref<pageLinkList[]>([]);
|
|||
const init = () => {
|
||||
reset_data();
|
||||
custom_type_active.value = 0;
|
||||
goods_category_data.value = url_value_store.url_value.goods_category;
|
||||
brand_data.value = url_value_store.url_value.brand_list;
|
||||
goods_category_data.value = common_store.common.goods_category;
|
||||
brand_data.value = common_store.common.brand_list;
|
||||
};
|
||||
const custom_type = [
|
||||
{ id: 0, name: '商品分类' },
|
||||
|
|
|
|||
|
|
@ -43,8 +43,8 @@
|
|||
</template>
|
||||
<script lang="ts" setup>
|
||||
import UrlValueAPI from '@/api/url-value';
|
||||
import { urlValueStore } from '@/store';
|
||||
const url_value_store = urlValueStore();
|
||||
import { commonStore } from '@/store';
|
||||
const common_store = commonStore();
|
||||
const props = defineProps({
|
||||
// 重置
|
||||
reset: {
|
||||
|
|
@ -80,9 +80,8 @@ const init = () => {
|
|||
category_ids.value = [];
|
||||
brand_ids.value = '';
|
||||
search_value.value = '';
|
||||
category_list.value = url_value_store.url_value.goods_category;
|
||||
brand_list.value = url_value_store.url_value.brand_list;
|
||||
console.log('1111122');
|
||||
category_list.value = common_store.common.goods_category;
|
||||
brand_list.value = common_store.common.brand_list;
|
||||
get_list(1);
|
||||
};
|
||||
const handle_search = () => {
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@
|
|||
</div>
|
||||
</template>
|
||||
<script lang="ts" setup>
|
||||
import { urlValueStore } from '@/store';
|
||||
const url_value_store = urlValueStore();
|
||||
import { commonStore } from '@/store';
|
||||
const common_store = commonStore();
|
||||
const props = defineProps({
|
||||
// 类型
|
||||
type: {
|
||||
|
|
@ -64,8 +64,8 @@ onMounted(() => {
|
|||
const init = () => {
|
||||
menu_active.value = '';
|
||||
search_value.value = '';
|
||||
// 过滤url_value_store.url_value.page_link_list中的type为shop的data的数据,只保留data数组
|
||||
base_data.value = url_value_store.url_value.page_link_list.filter((item: any) => {
|
||||
// 过滤common_store.common.page_link_list中的type为shop的data的数据,只保留data数组
|
||||
base_data.value = common_store.common.page_link_list.filter((item: any) => {
|
||||
if (item.type == props.type) {
|
||||
return item.data;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<el-dialog v-model="dialogVisible" class="radius-lg" width="1168" draggable append-to-body @close="close_event">
|
||||
<el-dialog v-model="dialogVisible" class="radius-lg" width="1168" draggable append-to-body :close-on-click-modal="false" @close="close_event">
|
||||
<template #header>
|
||||
<div class="title center re">
|
||||
<div class="tc size-16 fw">{{ dialog_title }}</div>
|
||||
|
|
@ -60,9 +60,8 @@
|
|||
<script lang="ts" setup>
|
||||
import { MenuItemClicked } from 'element-plus/es/components/menu/src/types';
|
||||
import { PropType } from 'vue';
|
||||
import UrlValueAPI from '@/api/url-value';
|
||||
import { urlValueStore } from '@/store';
|
||||
const url_value_store = urlValueStore();
|
||||
import { commonStore } from '@/store';
|
||||
const common_store = commonStore();
|
||||
const app = getCurrentInstance();
|
||||
/**
|
||||
* @description: 页面链接
|
||||
|
|
@ -88,49 +87,25 @@ const link_value = ref<any[]>([]);
|
|||
const reset_compontent = ref(false);
|
||||
const custom_link_type = ref(props.type);
|
||||
const base_data = ref<any[]>([]);
|
||||
const init_data = ref({});
|
||||
watch(
|
||||
() => dialogVisible.value,
|
||||
(val) => {
|
||||
if (val) {
|
||||
init();
|
||||
}
|
||||
}
|
||||
);
|
||||
onMounted(() => {
|
||||
init();
|
||||
});
|
||||
const init = () => {
|
||||
if (!url_value_store.is_url_value_api) {
|
||||
url_value_store.set_is_url_value_api(true);
|
||||
UrlValueAPI.getInit()
|
||||
.then((res: any) => {
|
||||
init_data.value = res.data;
|
||||
base_data.value = res.data.page_link_list;
|
||||
if (res.data.page_link_list.length > 0) {
|
||||
nextTick(() => {
|
||||
// 定时获取common_store.common.article_category的数据,直到拿到值或者关闭页面为止
|
||||
const interval = setInterval(() => {
|
||||
// 获取分类
|
||||
if (common_store.common.page_link_list.length > 0) {
|
||||
base_data.value = common_store.common.page_link_list;
|
||||
if (common_store.common.page_link_list.length > 0) {
|
||||
if (props.type.length == 0) {
|
||||
link_select.value = res.data.page_link_list[0].type;
|
||||
link_select.value = common_store.common.page_link_list[0].type || '';
|
||||
} else {
|
||||
link_select.value = props.type[0];
|
||||
}
|
||||
clearInterval(interval);
|
||||
}
|
||||
url_value_store.set_url_value(res.data);
|
||||
})
|
||||
.catch(() => {
|
||||
url_value_store.set_is_url_value_api(false);
|
||||
});
|
||||
} else {
|
||||
init_data.value = url_value_store.url_value;
|
||||
base_data.value = url_value_store.url_value.page_link_list;
|
||||
if (url_value_store.url_value.page_link_list.length > 0) {
|
||||
if (props.type.length == 0) {
|
||||
link_select.value = url_value_store.url_value.page_link_list[0].type || '';
|
||||
} else {
|
||||
link_select.value = props.type[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
}, 1000);
|
||||
});
|
||||
});
|
||||
const dialog_title = computed(() => {
|
||||
if (props.type.length == 1) {
|
||||
let name = '';
|
||||
|
|
|
|||
|
|
@ -62,9 +62,8 @@
|
|||
</template>
|
||||
<script setup lang="ts">
|
||||
import { get_math } from '@/utils';
|
||||
import ArticleAPI from '@/api/article';
|
||||
import { articleStore } from '@/store';
|
||||
const article_store = articleStore();
|
||||
import { commonStore } from '@/store';
|
||||
const common_store = commonStore();
|
||||
const props = defineProps({
|
||||
value: {
|
||||
type: Object,
|
||||
|
|
@ -118,25 +117,16 @@ const base_list = reactive({
|
|||
],
|
||||
});
|
||||
onMounted(() => {
|
||||
init();
|
||||
nextTick(() => {
|
||||
// 定时获取common_store.common.article_category的数据,直到拿到值或者关闭页面为止
|
||||
const interval = setInterval(() => {
|
||||
if (common_store.common.article_category.length > 0) {
|
||||
base_list.article_category_list = common_store.common.article_category;
|
||||
clearInterval(interval);
|
||||
}
|
||||
}, 1000);
|
||||
});
|
||||
});
|
||||
const init = () => {
|
||||
// 判断是否有历史数据
|
||||
if (!article_store.is_article_api) {
|
||||
article_store.set_is_article_api(true);
|
||||
ArticleAPI.getInit()
|
||||
.then((res: any) => {
|
||||
const { article_category_list } = res.data;
|
||||
base_list.article_category_list = article_category_list;
|
||||
article_store.set_article(article_category_list);
|
||||
})
|
||||
.catch((err: any) => {
|
||||
article_store.set_is_article_api(false);
|
||||
});
|
||||
} else {
|
||||
base_list.article_category_list = article_store.article;
|
||||
}
|
||||
};
|
||||
const theme_change = (val: any) => {
|
||||
if (val == '3' || val == '4') {
|
||||
form.value.field_show = ['1'];
|
||||
|
|
|
|||
|
|
@ -88,8 +88,8 @@
|
|||
<script setup lang="ts">
|
||||
import { get_math, tabs_style } from '@/utils';
|
||||
import ArticleAPI from '@/api/article';
|
||||
import { articleStore } from '@/store';
|
||||
const article_store = articleStore();
|
||||
import { commonStore } from '@/store';
|
||||
const common_store = commonStore();
|
||||
const props = defineProps({
|
||||
value: {
|
||||
type: Object,
|
||||
|
|
@ -143,25 +143,16 @@ const base_list = reactive({
|
|||
],
|
||||
});
|
||||
onMounted(() => {
|
||||
init();
|
||||
nextTick(() => {
|
||||
// 定时获取common_store.common.article_category的数据,直到拿到值或者关闭页面为止
|
||||
const interval = setInterval(() => {
|
||||
if (common_store.common.article_category.length > 0) {
|
||||
base_list.article_category_list = common_store.common.article_category;
|
||||
clearInterval(interval);
|
||||
}
|
||||
}, 1000);
|
||||
});
|
||||
});
|
||||
const init = () => {
|
||||
// 判断是否有历史数据
|
||||
if (!article_store.is_article_api) {
|
||||
article_store.set_is_article_api(true);
|
||||
ArticleAPI.getInit()
|
||||
.then((res: any) => {
|
||||
const { article_category_list } = res.data;
|
||||
base_list.article_category_list = article_category_list;
|
||||
article_store.set_article(article_category_list);
|
||||
})
|
||||
.catch((err: any) => {
|
||||
article_store.set_is_article_api(false);
|
||||
});
|
||||
} else {
|
||||
base_list.article_category_list = article_store.article;
|
||||
}
|
||||
};
|
||||
const article_theme_change = (val: any) => {
|
||||
if (val == '3' || val == '4') {
|
||||
form.field_show = ['1'];
|
||||
|
|
|
|||
|
|
@ -1,37 +1,37 @@
|
|||
import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
|
||||
import Layout from "@/views/layout/index.vue";
|
||||
import { createRouter, createWebHashHistory, RouteRecordRaw } from 'vue-router';
|
||||
import Layout from '@/views/layout/index.vue';
|
||||
|
||||
export const constantRoutes: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/redirect",
|
||||
path: '/redirect',
|
||||
component: Layout,
|
||||
meta: { hidden: true },
|
||||
children: [
|
||||
{
|
||||
path: "/redirect/:path(.*)",
|
||||
component: () => import("@/views/redirect/index.vue"),
|
||||
path: '/redirect/:path(.*)',
|
||||
component: () => import('@/views/redirect/index.vue'),
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
path: "/",
|
||||
path: '/',
|
||||
component: Layout,
|
||||
redirect: "/dashboard",
|
||||
redirect: '/dashboard',
|
||||
children: [
|
||||
{
|
||||
path: "dashboard",
|
||||
component: () => import("@/views/dashboard/index.vue"),
|
||||
name: "Dashboard",
|
||||
meta: { title: "dashboard", icon: "homepage", affix: true },
|
||||
path: 'dashboard',
|
||||
component: () => import('@/views/dashboard/index.vue'),
|
||||
name: 'Dashboard',
|
||||
meta: { title: 'dashboard', icon: 'homepage', affix: true },
|
||||
},
|
||||
{
|
||||
path: "401",
|
||||
component: () => import("@/views/error-page/401.vue"),
|
||||
path: '401',
|
||||
component: () => import('@/views/error-page/401.vue'),
|
||||
meta: { hidden: true },
|
||||
},
|
||||
{
|
||||
path: "404",
|
||||
component: () => import("@/views/error-page/404.vue"),
|
||||
path: '404',
|
||||
component: () => import('@/views/error-page/404.vue'),
|
||||
meta: { hidden: true },
|
||||
},
|
||||
],
|
||||
|
|
@ -52,7 +52,7 @@ const router = createRouter({
|
|||
* 重置路由
|
||||
*/
|
||||
export function resetRouter() {
|
||||
router.replace({ path: "/login" });
|
||||
router.replace({ path: '/login' });
|
||||
}
|
||||
|
||||
export default router;
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@ export function setupStore(app: App<Element>) {
|
|||
export * from './modules/footer-nav-content';
|
||||
export * from './modules/upload';
|
||||
export * from './modules/shop';
|
||||
export * from './modules/url-value';
|
||||
export * from './modules/custom';
|
||||
export * from './modules/article';
|
||||
export * from './modules/common';
|
||||
export { store };
|
||||
|
|
|
|||
|
|
@ -1,24 +0,0 @@
|
|||
import { ref, computed } from 'vue';
|
||||
import { defineStore } from 'pinia';
|
||||
export const articleStore = defineStore('article', () => {
|
||||
// 文章是否需要调接口判断
|
||||
const is_article_api = ref(false);
|
||||
// 文章数据
|
||||
const article = ref<select_1[]>([]);
|
||||
// 存储文章数据
|
||||
const set_article = (data: select_1[]) => {
|
||||
article.value = data;
|
||||
is_article_api.value = true;
|
||||
};
|
||||
// 如果为false 则转为true
|
||||
const set_is_article_api = (bool: boolean) => {
|
||||
is_article_api.value = bool;
|
||||
};
|
||||
|
||||
return {
|
||||
article,
|
||||
is_article_api,
|
||||
set_article,
|
||||
set_is_article_api,
|
||||
};
|
||||
});
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
import { ref, computed } from 'vue';
|
||||
import { defineStore } from 'pinia';
|
||||
export const commonStore = defineStore('common', () => {
|
||||
// 链接是否需要调接口判断
|
||||
const is_common_api = ref(false);
|
||||
const common = ref({
|
||||
article_category: [] as any[], //---- 文章分类
|
||||
attachment_category: [] as any[], //---- 附件分类
|
||||
brand_category: [] as any[], //---- 品牌分类
|
||||
brand_list: [] as any[], //---- 品牌列表
|
||||
goods_category: [] as any[], //---- 商品分类
|
||||
module_list: [] as any[], //---- 模块列表
|
||||
page_link_list: [] as any[], //---- 页面链接
|
||||
});
|
||||
// 存储链接数据
|
||||
const set_common = (data: any) => {
|
||||
common.value = data;
|
||||
is_common_api.value = true;
|
||||
};
|
||||
// 如果为false 则转为true
|
||||
const set_is_common_api = (bool: boolean) => {
|
||||
is_common_api.value = bool;
|
||||
};
|
||||
|
||||
return {
|
||||
common,
|
||||
is_common_api,
|
||||
set_common,
|
||||
set_is_common_api,
|
||||
};
|
||||
});
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
import { ref, computed } from 'vue';
|
||||
import { defineStore } from 'pinia';
|
||||
export const urlValueStore = defineStore('urlValue', () => {
|
||||
// 链接是否需要调接口判断
|
||||
const is_url_value_api = ref(false);
|
||||
// 链接数据
|
||||
const url_value = ref<urlValue>({
|
||||
goods_category: [],
|
||||
brand_list: [],
|
||||
article_category_list: [],
|
||||
page_link_list: [],
|
||||
brand_category: [],
|
||||
});
|
||||
// 存储链接数据
|
||||
const set_url_value = (data: urlValue) => {
|
||||
url_value.value = data;
|
||||
is_url_value_api.value = true;
|
||||
};
|
||||
// 如果为false 则转为true
|
||||
const set_is_url_value_api = (bool: boolean) => {
|
||||
is_url_value_api.value = bool;
|
||||
};
|
||||
|
||||
return {
|
||||
url_value,
|
||||
is_url_value_api,
|
||||
set_url_value,
|
||||
set_is_url_value_api,
|
||||
};
|
||||
});
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
<el-button class="btn-white" @click="save_close_event">保存关闭</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog v-model="dialog_visible" class="radius-lg" width="650" draggable append-to-body>
|
||||
<el-dialog v-model="dialog_visible" class="radius-lg" width="650" draggable :close-on-click-modal="false" append-to-body>
|
||||
<template #header>
|
||||
<div class="title re">
|
||||
<div class="middle size-16 fw">附件管理</div>
|
||||
|
|
@ -148,17 +148,18 @@ const confirm_event = async (formEl: FormInstance | undefined) => {
|
|||
border-color: #fff;
|
||||
color: #fff;
|
||||
&:hover {
|
||||
background-color: #666;
|
||||
background-color: #fff;
|
||||
border-color: #fff;
|
||||
color: $cr-primary;
|
||||
}
|
||||
}
|
||||
.btn-white {
|
||||
background-color: #fff;
|
||||
border-color: #fff;
|
||||
// color: #{$cr-primary};
|
||||
color: $cr-primary;
|
||||
&:hover {
|
||||
background-color: $cr-primary;
|
||||
border-color: $cr-primary;
|
||||
background-color: #1e7ede;
|
||||
border-color: #1e7ede;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,6 +18,9 @@ import { Navbar, Settings, AppMain } from './components/index';
|
|||
import defaultSettings from './components/main/index';
|
||||
import { cloneDeep } from 'lodash';
|
||||
import DiyAPI, { diyData } from '@/api/diy';
|
||||
import CommonAPI from '@/api/common';
|
||||
import { commonStore } from '@/store';
|
||||
const common_store = commonStore();
|
||||
interface headerAndFooter {
|
||||
name: string;
|
||||
show_tabs: boolean;
|
||||
|
|
@ -74,14 +77,10 @@ const right_update = (item: any, diy: [Array<any>], header: headerAndFooter, foo
|
|||
// 页面加载
|
||||
onMounted(() => {
|
||||
init();
|
||||
common_init();
|
||||
});
|
||||
const is_empty = ref(false);
|
||||
const init = () => {
|
||||
// 获取localStorage数据
|
||||
// const diy_data = localStorage.getItem('diy_data');
|
||||
// if (diy_data) {
|
||||
// form.value = JSON.parse(diy_data);
|
||||
// }
|
||||
// 截取document.location.search字符串内id/后面的所有字段
|
||||
let new_data = { id: '' };
|
||||
if (document.location.search.indexOf('id/') !== -1) {
|
||||
|
|
@ -102,6 +101,20 @@ const init = () => {
|
|||
});
|
||||
}
|
||||
};
|
||||
|
||||
// 初始化公共数据
|
||||
const common_init = () => {
|
||||
CommonAPI.getInit().then((res: any) => {
|
||||
// article_category ---- 文章分类
|
||||
// attachment_category ---- 附件分类
|
||||
// brand_category; ---- 品牌分类
|
||||
// brand_list ---- 品牌列表
|
||||
// goods_category ---- 商品分类
|
||||
// module_list ---- 模块列表
|
||||
//page_link_list ---- 页面链接
|
||||
common_store.set_common(res.data);
|
||||
});
|
||||
};
|
||||
//#endregion 页面初始化数据 ---------------------end
|
||||
|
||||
//#region 顶部导航回调方法 ---------------------start
|
||||
|
|
|
|||
|
|
@ -413,6 +413,13 @@
|
|||
dependencies:
|
||||
undici-types "~6.13.0"
|
||||
|
||||
"@types/qrcode@^1.5.5":
|
||||
version "1.5.5"
|
||||
resolved "https://registry.yarnpkg.com/@types/qrcode/-/qrcode-1.5.5.tgz#993ff7c6b584277eee7aac0a20861eab682f9dac"
|
||||
integrity sha512-CdfBi/e3Qk+3Z/fXYShipBT13OJ2fDO2Q2w5CIP5anLTLIndQG9z6P1cnm+8zCWSpm5dnxMFd/uREtb0EXuQzg==
|
||||
dependencies:
|
||||
"@types/node" "*"
|
||||
|
||||
"@types/semver@^7.3.12":
|
||||
version "7.5.8"
|
||||
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.8.tgz#8268a8c57a3e4abd25c165ecd36237db7948a55e"
|
||||
|
|
@ -3761,7 +3768,7 @@ punycode@^2.1.0:
|
|||
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5"
|
||||
integrity sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==
|
||||
|
||||
qrcode@^1.5.3:
|
||||
qrcode@^1.5.4:
|
||||
version "1.5.4"
|
||||
resolved "https://registry.yarnpkg.com/qrcode/-/qrcode-1.5.4.tgz#5cb81d86eb57c675febb08cf007fff963405da88"
|
||||
integrity sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==
|
||||
|
|
|
|||
Loading…
Reference in New Issue