+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
{{ title }}
-
-
- ali
-
-
- ele
-
-
- awe
-
-
-
-
+
{{ title }}
+
+
+
+
+
+
+
+
+
+
+
@@ -69,7 +50,8 @@
diff --git a/src/components/iconSelector/list.vue b/src/components/iconSelector/list.vue
new file mode 100644
index 0000000..8bf837b
--- /dev/null
+++ b/src/components/iconSelector/list.vue
@@ -0,0 +1,84 @@
+
+
+
+
+
+
+
diff --git a/src/components/table/index.vue b/src/components/table/index.vue
index f4e1538..2d96a1b 100644
--- a/src/components/table/index.vue
+++ b/src/components/table/index.vue
@@ -119,11 +119,6 @@ const props = defineProps({
type: Array
,
default: () => [],
},
- // 搜索参数
- param: {
- type: Object,
- default: () => {},
- },
// 配置项
config: {
type: Object,
@@ -161,7 +156,7 @@ const setHeader = computed(() => {
return props.header.filter((v) => v.isCheck);
});
// tool 列显示全选改变时
-const onCheckAllChange = (val: boolean) => {
+const onCheckAllChange = (val: T) => {
if (val) props.header.forEach((v) => (v.isCheck = true));
else props.header.forEach((v) => (v.isCheck = false));
state.checkListIndeterminate = false;
diff --git a/src/i18n/index.ts b/src/i18n/index.ts
index 071123b..04f5f26 100644
--- a/src/i18n/index.ts
+++ b/src/i18n/index.ts
@@ -2,53 +2,53 @@ import { createI18n } from 'vue-i18n';
import pinia from '/@/stores/index';
import { storeToRefs } from 'pinia';
import { useThemeConfig } from '/@/stores/themeConfig';
-import zhcnLocale from 'element-plus/lib/locale/lang/zh-cn';
-import enLocale from 'element-plus/lib/locale/lang/en';
-import zhtwLocale from 'element-plus/lib/locale/lang/zh-tw';
-
-import nextZhcn from '/@/i18n/lang/zh-cn';
-import nextEn from '/@/i18n/lang/en';
-import nextZhtw from '/@/i18n/lang/zh-tw';
-
-import pagesLoginZhcn from '/@/i18n/pages/login/zh-cn';
-import pagesLoginEn from '/@/i18n/pages/login/en';
-import pagesLoginZhtw from '/@/i18n/pages/login/zh-tw';
-import pagesFormI18nZhcn from '/@/i18n/pages/formI18n/zh-cn';
-import pagesFormI18nEn from '/@/i18n/pages/formI18n/en';
-import pagesFormI18nZhtw from '/@/i18n/pages/formI18n/zh-tw';
// 定义语言国际化内容
+
/**
* 说明:
- * /src/i18n/lang 下的 ts 为框架的国际化内容
- * /src/i18n/pages 下的 ts 为各界面的国际化内容
+ * 须在 pages 下新建文件夹(建议 `要国际化界面目录` 与 `i18 目录` 相同,方便查找),
+ * 注意国际化定义的字段,不要与原有的定义字段相同。
+ * 1、/src/i18n/lang 下的 ts 为框架的国际化内容
+ * 2、/src/i18n/pages 下的 ts 为各界面的国际化内容
*/
-const messages = {
- [zhcnLocale.name]: {
- ...zhcnLocale,
- message: {
- ...nextZhcn,
- ...pagesLoginZhcn,
- ...pagesFormI18nZhcn,
- },
- },
- [enLocale.name]: {
- ...enLocale,
- message: {
- ...nextEn,
- ...pagesLoginEn,
- ...pagesFormI18nEn,
- },
- },
- [zhtwLocale.name]: {
- ...zhtwLocale,
- message: {
- ...nextZhtw,
- ...pagesLoginZhtw,
- ...pagesFormI18nZhtw,
- },
- },
-};
+
+// element plus 自带国际化
+import enLocale from 'element-plus/lib/locale/lang/en';
+import zhcnLocale from 'element-plus/lib/locale/lang/zh-cn';
+import zhtwLocale from 'element-plus/lib/locale/lang/zh-tw';
+
+// 定义变量内容
+const messages = {};
+const element = { en: enLocale, 'zh-cn': zhcnLocale, 'zh-tw': zhtwLocale };
+const itemize = { en: [], 'zh-cn': [], 'zh-tw': [] };
+const modules: Record = import.meta.glob('./**/*.ts', { eager: true });
+
+// 对自动引入的 modules 进行分类 en、zh-cn、zh-tw
+// https://vitejs.cn/vite3-cn/guide/features.html#glob-import
+for (const path in modules) {
+ const key = path.match(/(\S+)\/(\S+).ts/);
+ if (itemize[key![2]]) itemize[key![2]].push(modules[path].default);
+ else itemize[key![2]] = modules[path];
+}
+
+// 合并数组对象(非标准数组对象,数组中对象的每项 key、value 都不同)
+function mergeArrObj(list: T, key: string) {
+ let obj = {};
+ list[key].forEach((i: EmptyObjectType) => {
+ obj = Object.assign({}, obj, i);
+ });
+ return obj;
+}
+
+// 处理最终格式
+for (const key in itemize) {
+ messages[key] = {
+ name: key,
+ el: element[key].el,
+ message: mergeArrObj(itemize, key),
+ };
+}
// 读取 pinia 默认语言
const stores = useThemeConfig(pinia);
diff --git a/src/layout/routerView/parent.vue b/src/layout/routerView/parent.vue
index a8d05d6..4124f7f 100644
--- a/src/layout/routerView/parent.vue
+++ b/src/layout/routerView/parent.vue
@@ -80,12 +80,13 @@ onMounted(() => {
getIframeListRoutes();
// https://gitee.com/lyt-top/vue-next-admin/issues/I58U75
// https://gitee.com/lyt-top/vue-next-admin/issues/I59RXK
+ // https://gitee.com/lyt-top/vue-next-admin/pulls/40
nextTick(() => {
setTimeout(() => {
- if (themeConfig.value.isCacheTagsView) {
- let tagsViewArr:RouteItem[] = Session.get('tagsViewList') || []
- cachedViews.value = tagsViewArr.filter((item) => item.meta.isKeepAlive).map((item) => item.name as string)
- }
+ if (themeConfig.value.isCacheTagsView) {
+ let tagsViewArr: RouteItem[] = Session.get('tagsViewList') || [];
+ cachedViews.value = tagsViewArr.filter((item) => item.meta?.isKeepAlive).map((item) => item.name as string);
+ }
}, 0);
});
});
diff --git a/src/layout/upgrade/index.vue b/src/layout/upgrade/index.vue
index 890c070..e361012 100644
--- a/src/layout/upgrade/index.vue
+++ b/src/layout/upgrade/index.vue
@@ -16,6 +16,11 @@
{{ getThemeConfig.globalTitle }} {{ $t('message.upgrade.msg') }}
+
+
+ CHANGELOG.md
+
+
{{ $t('message.upgrade.desc') }}
@@ -38,7 +43,7 @@ const { t } = useI18n();
const storesThemeConfig = useThemeConfig();
const { themeConfig } = storeToRefs(storesThemeConfig);
const state = reactive({
- isUpgrade: true,
+ isUpgrade: false,
// @ts-ignore
version: __VERSION__,
isLoading: false,
@@ -63,8 +68,15 @@ const onUpgrade = () => {
Local.set('version', state.version);
}, 2000);
};
+// 延迟显示,防止刷新时界面显示太快
+const delayShow = () => {
+ setTimeout(() => {
+ state.isUpgrade = true;
+ }, 2000);
+};
// 页面加载时
onMounted(() => {
+ delayShow();
setTimeout(() => {
state.btnTxt = t('message.upgrade.btnTwo');
}, 200);
@@ -90,7 +102,7 @@ onMounted(() => {
&::after {
content: '';
position: absolute;
- background-color: var(--el-color-primary);
+ background-color: var(--el-color-primary-light-1);
width: 130%;
height: 130px;
border-bottom-left-radius: 100%;
@@ -105,7 +117,8 @@ onMounted(() => {
letter-spacing: 3px;
}
.upgrade-title-warp-version {
- background-color: var(--next-color-white);
+ color: var(--next-color-white);
+ background-color: var(--el-color-primary-light-4);
font-size: 12px;
position: absolute;
display: flex;
diff --git a/src/router/backEnd.ts b/src/router/backEnd.ts
index 10cc662..1e4eec1 100644
--- a/src/router/backEnd.ts
+++ b/src/router/backEnd.ts
@@ -43,6 +43,9 @@ export async function initBackEndControlRoutes() {
await useUserInfo().setUserInfos();
// 获取路由菜单数据
const res = await getBackEndControlRoutes();
+ // 无登录权限时,添加判断
+ // https://gitee.com/lyt-top/vue-next-admin/issues/I64HVO
+ if (res.data.length <= 0) return Promise.resolve(true);
// 存储接口原始路由(未处理component),根据需求选择使用
useRequestOldRoutes().setRequestOldRoutes(JSON.parse(JSON.stringify(res.data)));
// 处理路由(component),替换 dynamicRoutes(/@/router/route)第一个顶级 children 的路由
@@ -58,7 +61,7 @@ export async function initBackEndControlRoutes() {
* @description 用于左侧菜单、横向菜单的显示
* @description 用于 tagsView、菜单搜索中:未过滤隐藏的(isHide)
*/
-export function setFilterMenuAndCacheTagsViewRoutes() {
+export async function setFilterMenuAndCacheTagsViewRoutes() {
const storesRoutesList = useRoutesList(pinia);
storesRoutesList.setRoutesList(dynamicRoutes[0].children as any);
setCacheTagsViewRoutes();
@@ -119,8 +122,8 @@ export function getBackEndControlRoutes() {
* @description 用于菜单管理界面刷新菜单(未进行测试)
* @description 路径:/src/views/system/menu/component/addMenu.vue
*/
-export function setBackEndControlRefreshRoutes() {
- getBackEndControlRoutes();
+export async function setBackEndControlRefreshRoutes() {
+ await getBackEndControlRoutes();
}
/**
diff --git a/src/router/frontEnd.ts b/src/router/frontEnd.ts
index e45a6af..21337b6 100644
--- a/src/router/frontEnd.ts
+++ b/src/router/frontEnd.ts
@@ -26,6 +26,9 @@ export async function initFrontEndControlRoutes() {
// 触发初始化用户信息 pinia
// https://gitee.com/lyt-top/vue-next-admin/issues/I5F1HP
await useUserInfo(pinia).setUserInfos();
+ // 无登录权限时,添加判断
+ // https://gitee.com/lyt-top/vue-next-admin/issues/I64HVO
+ if (useUserInfo().userInfos.roles.length <= 0) return Promise.resolve(true);
// 添加动态路由
await setAddRoute();
// 设置递归过滤有权限的路由到 pinia routesList 中(已处理成多级嵌套路由)及缓存多级嵌套数组处理后的一维数组
diff --git a/src/router/route.ts b/src/router/route.ts
index 2083529..21a9f3f 100644
--- a/src/router/route.ts
+++ b/src/router/route.ts
@@ -856,7 +856,7 @@ export const dynamicRoutes: Array
= [
isAffix: false,
isIframe: false,
roles: ['admin'],
- icon: 'iconfont icon-diannao',
+ icon: 'iconfont icon-wenducanshu-05',
},
},
{
diff --git a/src/stores/themeConfig.ts b/src/stores/themeConfig.ts
index 65ca13c..39097ed 100644
--- a/src/stores/themeConfig.ts
+++ b/src/stores/themeConfig.ts
@@ -89,13 +89,13 @@ export const useThemeConfig = defineStore('themeConfig', {
// 是否开启 TagsView 共用
isShareTagsView: false,
// 是否开启 Footer 底部版权信息
- isFooter: true,
+ isFooter: false,
// 是否开启灰色模式
- isGrayscale: true,
+ isGrayscale: false,
// 是否开启色弱模式
isInvert: false,
// 是否开启水印
- isWartermark: false,
+ isWartermark: true,
// 水印文案
wartermarkText: 'vue-next-admin',
diff --git a/src/theme/element.scss b/src/theme/element.scss
index 8a463b4..96b9832 100644
--- a/src/theme/element.scss
+++ b/src/theme/element.scss
@@ -19,9 +19,6 @@
/* Input 输入框、InputNumber 计数器
------------------------------- */
-.el-input {
- height: 100%;
-}
// 菜单搜索
.el-autocomplete-suggestion__wrap {
max-height: 280px !important;
diff --git a/src/theme/iconSelector.scss b/src/theme/iconSelector.scss
index 970201e..569f614 100644
--- a/src/theme/iconSelector.scss
+++ b/src/theme/iconSelector.scss
@@ -5,64 +5,25 @@
.icon-selector-warp {
height: 260px;
overflow: hidden;
+ position: relative;
.icon-selector-warp-title {
+ position: absolute;
height: 40px;
line-height: 40px;
- padding: 0 15px;
- .icon-selector-warp-title-tab {
- span {
- cursor: pointer;
- &:hover {
- color: var(--el-color-primary);
- text-decoration: underline;
- }
- }
- .span-active {
- color: var(--el-color-primary);
- text-decoration: underline;
- }
- }
+ left: 15px;
}
- .icon-selector-warp-row {
- height: 230px;
- overflow: hidden;
- border-top: 1px solid var(--el-border-color);
- .el-row {
- padding: 15px;
- }
- .el-scrollbar__bar.is-horizontal {
- display: none;
- }
- .icon-selector-warp-item {
- display: flex;
- border: 1px solid var(--el-border-color);
- padding: 5px;
- border-radius: 5px;
- margin-bottom: 10px;
- .icon-selector-warp-item-value {
- i {
- font-size: 20px;
- color: var(--el-text-color-regular);
- }
+ .el-tabs__header {
+ display: flex;
+ justify-content: flex-end;
+ padding: 0 15px;
+ border-bottom: 1px solid var(--el-border-color-light);
+ margin: 0 !important;
+ .el-tabs__nav-wrap {
+ &::after {
+ height: 0 !important;
}
- &:hover {
- cursor: pointer;
- background-color: var(--el-color-primary-light-9);
- border: 1px solid var(--el-color-primary-light-5);
- .icon-selector-warp-item-value {
- i {
- color: var(--el-color-primary);
- }
- }
- }
- }
- .icon-selector-active {
- background-color: var(--el-color-primary-light-9);
- border: 1px solid var(--el-color-primary-light-5);
- .icon-selector-warp-item-value {
- i {
- color: var(--el-color-primary);
- }
+ .el-tabs__item {
+ padding: 0 5px !important;
}
}
}
diff --git a/src/theme/media/form.scss b/src/theme/media/form.scss
index 5274df5..eb1d883 100644
--- a/src/theme/media/form.scss
+++ b/src/theme/media/form.scss
@@ -16,4 +16,16 @@
// 响应式表单时,登录页需要重新处理
display: unset !important;
}
+ // 表格演示中的表单筛选
+ .table-form-btn {
+ display: flex !important;
+ .el-form-item__label {
+ width: auto !important;
+ }
+ }
+ // 表格演示中的表单筛选最大高度,适配移动端
+ .table-search-container {
+ max-height: 160px;
+ overflow: auto;
+ }
}
diff --git a/src/types/views.d.ts b/src/types/views.d.ts
index 5c08ea3..a44eb04 100644
--- a/src/types/views.d.ts
+++ b/src/types/views.d.ts
@@ -43,7 +43,6 @@ declare type Demo2State = {
earth3DBtnList: T[];
chartData4List: T[];
myCharts: T[];
- the3DEarth: HTMLDivElement | null;
};
/**
@@ -305,11 +304,19 @@ declare type TableHeaderType = {
isCheck: boolean;
};
+declare type TableSearchType = {
+ label: string;
+ prop: string;
+ placeholder: string;
+ required: boolean;
+ type: string;
+ options?: SelectOptionType[];
+};
+
declare type TableDemoState = {
tableData: {
data: EmptyObjectType[];
header: TableHeaderType[];
- param: EmptyObjectType;
config: {
total: number;
loading: boolean;
@@ -318,5 +325,7 @@ declare type TableDemoState = {
isSerialNo: boolean;
isOperate: boolean;
};
+ search: TableSearchType[];
+ param: EmptyObjectType;
};
};
diff --git a/src/utils/request.ts b/src/utils/request.ts
index 41b22b4..08e6184 100644
--- a/src/utils/request.ts
+++ b/src/utils/request.ts
@@ -9,10 +9,10 @@ const service: AxiosInstance = axios.create({
timeout: 50000,
headers: { 'Content-Type': 'application/json' },
paramsSerializer: {
- serialize: function (params) {
- return qs.stringify(params, {allowDots: true});
- }
- }
+ serialize(params) {
+ return qs.stringify(params, { allowDots: true });
+ },
+ },
});
// 添加请求拦截器
diff --git a/src/views/fun/echartsMap/index.vue b/src/views/fun/echartsMap/index.vue
index f71a5e8..eaf23e9 100644
--- a/src/views/fun/echartsMap/index.vue
+++ b/src/views/fun/echartsMap/index.vue
@@ -1,18 +1,19 @@
diff --git a/src/views/make/selector/index.vue b/src/views/make/selector/index.vue
index ad76e6c..d8fd47f 100644
--- a/src/views/make/selector/index.vue
+++ b/src/views/make/selector/index.vue
@@ -35,6 +35,13 @@ const IconSelector = defineAsyncComponent(() => import('/@/components/iconSelect
const state = reactive({
modelIcon: '',
tableData: [
+ {
+ a1: 'v-model',
+ a2: '双向绑定值',
+ a3: 'string',
+ a4: '',
+ a5: '',
+ },
{
a1: 'prepend',
a2: '输入框前置内容,只能字体图标',
@@ -63,13 +70,6 @@ const state = reactive({
a4: '',
a5: '请选择图标',
},
- {
- a1: 'type',
- a2: 'icon 图标类型',
- a3: 'string',
- a4: 'ali / ele / awe / all',
- a5: 'ele',
- },
{
a1: 'disabled',
a2: '禁用',
diff --git a/src/views/make/tableDemo/index.vue b/src/views/make/tableDemo/index.vue
index 792978c..052607f 100644
--- a/src/views/make/tableDemo/index.vue
+++ b/src/views/make/tableDemo/index.vue
@@ -1,15 +1,7 @@
-
-
-
-
-
-
- 查询
-
-
+
import('/@/components/table/index.vue'));
+const TableSearch = defineAsyncComponent(() => import('/@/views/make/tableDemo/search.vue'));
// 定义变量内容
const tableRef = ref();
@@ -44,10 +37,6 @@ const state = reactive({
{ key: 'isSupport', colWidth: '', title: '是否支持24小时核酸检测', type: 'text', isCheck: true },
{ key: 'image', colWidth: '', width: '70', height: '40', title: '图片描述', type: 'image', isCheck: true },
],
- // 搜索参数(可选)
- param: {
- search: '',
- },
// 配置项(必传)
config: {
total: 0, // 列表总数
@@ -57,6 +46,31 @@ const state = reactive({
isSelection: true, // 是否显示表格多选
isOperate: true, // 是否显示表格操作栏
},
+ // 搜索表单,动态生成(传空数组时,将不显示搜索,注意格式)
+ search: [
+ { label: '采样点名称', prop: 'name', placeholder: '请输入应检尽检核酸采样点名称', required: true, type: 'input' },
+ { label: '详细地址', prop: 'address', placeholder: '请输入详细地址', required: false, type: 'input' },
+ { label: '联系电话', prop: 'phone', placeholder: '请输入采样点联系电话', required: false, type: 'input' },
+ { label: '开放时间', prop: 'time', placeholder: '请选择', required: false, type: 'date' },
+ {
+ label: '支持24小时',
+ prop: 'isSupport',
+ placeholder: '请选择',
+ required: false,
+ type: 'select',
+ options: [
+ { label: '是', value: 1 },
+ { label: '否', value: 0 },
+ ],
+ },
+ { label: '图片描述', prop: 'image', placeholder: '请输入图片描述', required: false, type: 'input' },
+ { label: '核酸机构', prop: 'mechanism', placeholder: '请输入核酸机构', required: false, type: 'input' },
+ ],
+ // 搜索参数(不用传,用于分页、搜索时传给后台的值,`getTableData` 中使用)
+ param: {
+ pageNum: 1,
+ pageSize: 10,
+ },
},
});
@@ -81,8 +95,9 @@ const getTableData = () => {
state.tableData.config.loading = false;
}, 500);
};
-// 搜索
-const onSearch = () => {
+// 搜索点击时表单回调
+const onSearch = (data: EmptyObjectType) => {
+ state.tableData.param = Object.assign({}, state.tableData.param, { ...data });
tableRef.value.pageReset();
};
// 删除当前项回调
diff --git a/src/views/make/tableDemo/search.vue b/src/views/make/tableDemo/search.vue
new file mode 100644
index 0000000..bffc6d6
--- /dev/null
+++ b/src/views/make/tableDemo/search.vue
@@ -0,0 +1,110 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ state.isToggle ? '收筛选' : '展筛选' }}
+
+
+
+
+ 查询
+ 重置
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/views/pages/tree/index.vue b/src/views/pages/tree/index.vue
index 7222261..623523f 100644
--- a/src/views/pages/tree/index.vue
+++ b/src/views/pages/tree/index.vue
@@ -15,8 +15,8 @@
{{ node.label }}
- {{ data.label1 }}
- {{ data.label2 }}
+ {{ data.label1 }}
+ {{ data.label2 }}
diff --git a/src/views/system/dept/component/addDept.vue b/src/views/system/dept/component/addDept.vue
deleted file mode 100644
index 86448f2..0000000
--- a/src/views/system/dept/component/addDept.vue
+++ /dev/null
@@ -1,143 +0,0 @@
-
-
-
-
-
-
-
-
-
- {{ data.deptName }}
- ({{ data.children.length }})
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/system/dept/component/editDept.vue b/src/views/system/dept/dialog.vue
similarity index 75%
rename from src/views/system/dept/component/editDept.vue
rename to src/views/system/dept/dialog.vue
index c4ffd25..b725593 100644
--- a/src/views/system/dept/component/editDept.vue
+++ b/src/views/system/dept/dialog.vue
@@ -1,7 +1,7 @@
-
-
-
+
+
+
@@ -60,19 +60,22 @@
-
diff --git a/src/views/system/dic/component/addDic.vue b/src/views/system/dic/component/addDic.vue
deleted file mode 100644
index cc1c063..0000000
--- a/src/views/system/dic/component/addDic.vue
+++ /dev/null
@@ -1,114 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 字段
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/views/system/dic/component/editDic.vue b/src/views/system/dic/dialog.vue
similarity index 68%
rename from src/views/system/dic/component/editDic.vue
rename to src/views/system/dic/dialog.vue
index e67f196..5ec6a46 100644
--- a/src/views/system/dic/component/editDic.vue
+++ b/src/views/system/dic/dialog.vue
@@ -1,8 +1,8 @@
-
-
+
+
-
+
@@ -56,19 +56,22 @@
-
diff --git a/src/views/system/menu/component/editMenu.vue b/src/views/system/menu/component/editMenu.vue
deleted file mode 100644
index a928e88..0000000
--- a/src/views/system/menu/component/editMenu.vue
+++ /dev/null
@@ -1,237 +0,0 @@
-
-
-
-
-
diff --git a/src/views/system/menu/component/addMenu.vue b/src/views/system/menu/dialog.vue
similarity index 85%
rename from src/views/system/menu/component/addMenu.vue
rename to src/views/system/menu/dialog.vue
index 7380a71..e1c452c 100644
--- a/src/views/system/menu/component/addMenu.vue
+++ b/src/views/system/menu/dialog.vue
@@ -1,7 +1,7 @@
-