mirror of
https://github.com/pure-admin/vue-pure-admin.git
synced 2026-02-13 17:30:27 +08:00
Compare commits
13 Commits
feat/fulls
...
ff007fbc03
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ff007fbc03 | ||
|
|
593739cf77 | ||
|
|
d7c049d821 | ||
|
|
4c3ad7acce | ||
|
|
f3756089fd | ||
|
|
42076a2247 | ||
|
|
f2616fdfaf | ||
|
|
ebc92ba61c | ||
|
|
fcd28837b2 | ||
|
|
4c07d84463 | ||
|
|
4f59013b61 | ||
|
|
ace4c07590 | ||
|
|
b20323e627 |
@@ -5,4 +5,4 @@
|
||||
|
||||
PATH="/usr/local/bin:$PATH"
|
||||
|
||||
npx --no-install commitlint --edit "$1"
|
||||
pnpm dlx commitlint --edit "$1"
|
||||
@@ -55,9 +55,6 @@ panel:
|
||||
pureTagsStyleCardTip: Card tags for efficient browsing
|
||||
pureTagsStyleChrome: Chrome
|
||||
pureTagsStyleChromeTip: Chrome style is classic and elegant
|
||||
pureFullScreenWatermark: FullScreen Watermark
|
||||
pureEnableWatermark: Watermark
|
||||
pureWatermarkText: Text
|
||||
pureInterfaceDisplay: Interface Display
|
||||
pureGreyModel: Grey Model
|
||||
pureWeakModel: Weak Model
|
||||
@@ -241,4 +238,19 @@ login:
|
||||
purePassWordRuleReg: The password format should be any combination of 8-18 digits
|
||||
purePassWordSureReg: Please enter confirm password
|
||||
purePassWordDifferentReg: The two passwords do not match!
|
||||
purePassWordUpdateReg: Password has been updated
|
||||
purePassWordUpdateReg: Password has been updated
|
||||
pureLoginExpired: Login expired, please login again
|
||||
tableBar:
|
||||
pureList: List
|
||||
pureLarge: Large
|
||||
pureDefault: Default
|
||||
pureSmall: Small
|
||||
pureColumnSettings: ColumnSettings
|
||||
pureCollapse: Collapse
|
||||
pureExpand: Expand
|
||||
pureRefresh: Refresh
|
||||
pureDensity: Density
|
||||
pureColumnDisplay: ColumnDisplay
|
||||
pureReset: Reset
|
||||
pureExitFullScreen: ExitFullScreen
|
||||
pureFullScreen: FullScreen
|
||||
@@ -55,9 +55,6 @@ panel:
|
||||
pureTagsStyleCardTip: 卡片标签,高效浏览
|
||||
pureTagsStyleChrome: 谷歌
|
||||
pureTagsStyleChromeTip: 谷歌风格,经典美观
|
||||
pureFullScreenWatermark: 全屏水印
|
||||
pureEnableWatermark: 水印
|
||||
pureWatermarkText: 文本
|
||||
pureInterfaceDisplay: 界面显示
|
||||
pureGreyModel: 灰色模式
|
||||
pureWeakModel: 色弱模式
|
||||
@@ -241,4 +238,19 @@ login:
|
||||
purePassWordRuleReg: 密码格式应为8-18位数字、字母、符号的任意两种组合
|
||||
purePassWordSureReg: 请输入确认密码
|
||||
purePassWordDifferentReg: 两次密码不一致!
|
||||
purePassWordUpdateReg: 修改密码成功
|
||||
purePassWordUpdateReg: 修改密码成功
|
||||
pureLoginExpired: 登录已过期,请重新登录
|
||||
tableBar:
|
||||
pureList: 列表
|
||||
pureLarge: 宽松
|
||||
pureDefault: 默认
|
||||
pureSmall: 紧凑
|
||||
pureColumnSettings: 列设置
|
||||
pureCollapse: 折叠
|
||||
pureExpand: 展开
|
||||
pureRefresh: 刷新
|
||||
pureDensity: 密度
|
||||
pureColumnDisplay: 列展示
|
||||
pureReset: 重置
|
||||
pureExitFullScreen: 退出全屏
|
||||
pureFullScreen: 全屏
|
||||
@@ -326,7 +326,8 @@ export default defineFakeRoute([
|
||||
method: "get",
|
||||
response: () => {
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: [
|
||||
systemManagementRouter,
|
||||
systemMonitorRouter,
|
||||
|
||||
@@ -6,7 +6,8 @@ export default defineFakeRoute([
|
||||
method: "post",
|
||||
response: () => {
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: {
|
||||
list: [
|
||||
{
|
||||
|
||||
@@ -8,7 +8,8 @@ export default defineFakeRoute([
|
||||
response: ({ body }) => {
|
||||
if (body.username === "admin") {
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: {
|
||||
avatar: "https://avatars.githubusercontent.com/u/44761321",
|
||||
username: "admin",
|
||||
@@ -24,7 +25,8 @@ export default defineFakeRoute([
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: {
|
||||
avatar: "https://avatars.githubusercontent.com/u/52823142",
|
||||
username: "common",
|
||||
|
||||
@@ -33,7 +33,8 @@ export default defineFakeRoute([
|
||||
method: "get",
|
||||
response: () => {
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: mapList()
|
||||
};
|
||||
}
|
||||
|
||||
@@ -8,7 +8,8 @@ export default defineFakeRoute([
|
||||
method: "get",
|
||||
response: () => {
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: {
|
||||
avatar: "https://avatars.githubusercontent.com/u/44761321",
|
||||
username: "admin",
|
||||
@@ -46,7 +47,8 @@ export default defineFakeRoute([
|
||||
}
|
||||
];
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: {
|
||||
list,
|
||||
total: list.length, // 总条目数
|
||||
|
||||
@@ -8,7 +8,8 @@ export default defineFakeRoute([
|
||||
response: ({ body }) => {
|
||||
if (body.refreshToken) {
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: {
|
||||
accessToken: "eyJhbGciOiJIUzUxMiJ9.newAdmin",
|
||||
refreshToken: "eyJhbGciOiJIUzUxMiJ9.newAdminRefresh",
|
||||
@@ -18,7 +19,8 @@ export default defineFakeRoute([
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
success: false,
|
||||
code: 10001,
|
||||
message: "请求参数缺失或格式不正确",
|
||||
data: {}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -50,7 +50,8 @@ export default defineFakeRoute([
|
||||
if (body.phone) list = list.filter(item => item.phone === body.phone);
|
||||
if (body.deptId) list = list.filter(item => item.dept.id === body.deptId);
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: {
|
||||
list,
|
||||
total: list.length, // 总条目数
|
||||
@@ -66,7 +67,8 @@ export default defineFakeRoute([
|
||||
method: "get",
|
||||
response: () => {
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: [
|
||||
{ id: 1, name: "超级管理员" },
|
||||
{ id: 2, name: "普通角色" }
|
||||
@@ -82,18 +84,21 @@ export default defineFakeRoute([
|
||||
if (body.userId) {
|
||||
if (body.userId == 1) {
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: [1]
|
||||
};
|
||||
} else if (body.userId == 2) {
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: [2]
|
||||
};
|
||||
}
|
||||
} else {
|
||||
return {
|
||||
success: false,
|
||||
code: 10001,
|
||||
message: "请求参数缺失或格式不正确",
|
||||
data: []
|
||||
};
|
||||
}
|
||||
@@ -130,7 +135,8 @@ export default defineFakeRoute([
|
||||
);
|
||||
if (body.code) list = list.filter(item => item.code === body.code);
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: {
|
||||
list,
|
||||
total: list.length, // 总条目数
|
||||
@@ -146,7 +152,8 @@ export default defineFakeRoute([
|
||||
method: "post",
|
||||
response: () => {
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: [
|
||||
// 外部页面
|
||||
{
|
||||
@@ -350,7 +357,8 @@ export default defineFakeRoute([
|
||||
response: ({ body }) => {
|
||||
if (body.id == 1) {
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: [
|
||||
100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 200, 201,
|
||||
202, 203, 204, 205, 300, 301, 302, 303, 304, 400, 401, 402, 403,
|
||||
@@ -359,7 +367,8 @@ export default defineFakeRoute([
|
||||
};
|
||||
} else if (body.id == 2) {
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: [
|
||||
100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 404, 500,
|
||||
501, 502, 503
|
||||
@@ -374,7 +383,8 @@ export default defineFakeRoute([
|
||||
method: "post",
|
||||
response: () => {
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: [
|
||||
// 外部页面
|
||||
{
|
||||
@@ -1255,7 +1265,8 @@ export default defineFakeRoute([
|
||||
method: "post",
|
||||
response: () => {
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: [
|
||||
{
|
||||
name: "杭州总公司",
|
||||
@@ -1418,7 +1429,8 @@ export default defineFakeRoute([
|
||||
];
|
||||
list = list.filter(item => item.username.includes(body?.username));
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: {
|
||||
list,
|
||||
total: list.length, // 总条目数
|
||||
@@ -1462,7 +1474,8 @@ export default defineFakeRoute([
|
||||
String(item.status).includes(String(body?.status))
|
||||
);
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: {
|
||||
list,
|
||||
total: list.length, // 总条目数
|
||||
@@ -1508,7 +1521,8 @@ export default defineFakeRoute([
|
||||
String(item.status).includes(String(body?.status))
|
||||
);
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: {
|
||||
list,
|
||||
total: list.length, // 总条目数
|
||||
@@ -1566,7 +1580,8 @@ export default defineFakeRoute([
|
||||
];
|
||||
list = list.filter(item => item.module.includes(body?.module));
|
||||
return {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: {
|
||||
list,
|
||||
total: list.length, // 总条目数
|
||||
@@ -1601,7 +1616,8 @@ export default defineFakeRoute([
|
||||
"Content-Length": 17019
|
||||
},
|
||||
responseBody: {
|
||||
success: true,
|
||||
code: 0,
|
||||
message: "操作成功",
|
||||
data: [
|
||||
{
|
||||
parentId: 0,
|
||||
|
||||
66
package.json
66
package.json
@@ -56,7 +56,7 @@
|
||||
"@pureadmin/table": "^3.3.0",
|
||||
"@pureadmin/utils": "^2.6.3",
|
||||
"@vue-flow/background": "^1.3.2",
|
||||
"@vue-flow/core": "^1.48.0",
|
||||
"@vue-flow/core": "^1.48.1",
|
||||
"@vueuse/core": "^14.1.0",
|
||||
"@vueuse/motion": "^3.0.3",
|
||||
"@wangeditor/editor": "^5.1.23",
|
||||
@@ -69,14 +69,14 @@
|
||||
"codemirror-editor-vue3": "^2.8.0",
|
||||
"cropperjs": "^1.6.2",
|
||||
"dayjs": "^1.11.19",
|
||||
"deep-chat": "^2.3.0",
|
||||
"deep-chat": "^2.4.1",
|
||||
"echarts": "^6.0.0",
|
||||
"el-table-infinite-scroll": "^3.0.8",
|
||||
"element-plus": "^2.12.0",
|
||||
"element-plus": "^2.13.1",
|
||||
"highlight.js": "^11.11.1",
|
||||
"intro.js": "^7.2.0",
|
||||
"js-cookie": "^3.0.5",
|
||||
"jsbarcode": "^3.12.1",
|
||||
"jsbarcode": "^3.12.3",
|
||||
"localforage": "^1.10.0",
|
||||
"mint-filter": "^4.0.3",
|
||||
"mitt": "^3.0.1",
|
||||
@@ -87,7 +87,7 @@
|
||||
"pinyin-pro": "^3.27.0",
|
||||
"plus-pro-components": "^0.1.30",
|
||||
"qrcode": "^1.5.4",
|
||||
"qs": "^6.14.0",
|
||||
"qs": "^6.14.1",
|
||||
"responsive-storage": "^2.2.0",
|
||||
"sortablejs": "^1.15.6",
|
||||
"swiper": "^12.0.3",
|
||||
@@ -96,16 +96,16 @@
|
||||
"v3-infinite-loading": "^1.3.2",
|
||||
"vditor": "^3.11.2",
|
||||
"version-rocket": "^1.7.4",
|
||||
"vue": "^3.5.25",
|
||||
"vue-i18n": "^11.2.2",
|
||||
"vue": "^3.5.26",
|
||||
"vue-i18n": "^11.2.8",
|
||||
"vue-json-pretty": "^2.6.0",
|
||||
"vue-pdf-embed": "^2.1.3",
|
||||
"vue-router": "^4.6.3",
|
||||
"vue-router": "^4.6.4",
|
||||
"vue-tippy": "^6.7.1",
|
||||
"vue-types": "^6.0.0",
|
||||
"vue-virtual-scroller": "2.0.0-beta.8",
|
||||
"vue-waterfall-plugin-next": "^2.6.9",
|
||||
"vue3-danmaku": "^1.6.6",
|
||||
"vue3-danmaku": "^1.6.7",
|
||||
"vue3-puzzle-vcode": "^1.1.7",
|
||||
"vuedraggable": "^4.1.0",
|
||||
"vxe-table": "4.6.25",
|
||||
@@ -114,57 +114,57 @@
|
||||
"xlsx": "^0.18.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^20.2.0",
|
||||
"@commitlint/config-conventional": "^20.2.0",
|
||||
"@commitlint/types": "^20.2.0",
|
||||
"@eslint/js": "^9.39.1",
|
||||
"@faker-js/faker": "^10.1.0",
|
||||
"@iconify/json": "^2.2.416",
|
||||
"@commitlint/cli": "^20.3.1",
|
||||
"@commitlint/config-conventional": "^20.3.1",
|
||||
"@commitlint/types": "^20.3.1",
|
||||
"@eslint/js": "^9.39.2",
|
||||
"@faker-js/faker": "^10.2.0",
|
||||
"@iconify/json": "^2.2.428",
|
||||
"@iconify/vue": "4.2.0",
|
||||
"@intlify/unplugin-vue-i18n": "^11.0.1",
|
||||
"@tailwindcss/vite": "^4.1.17",
|
||||
"@intlify/unplugin-vue-i18n": "^11.0.3",
|
||||
"@tailwindcss/vite": "^4.1.18",
|
||||
"@types/codemirror": "^5.60.17",
|
||||
"@types/dagre": "^0.7.53",
|
||||
"@types/intro.js": "^5.1.5",
|
||||
"@types/js-cookie": "^3.0.6",
|
||||
"@types/node": "^20.19.26",
|
||||
"@types/node": "^20.19.30",
|
||||
"@types/nprogress": "^0.2.3",
|
||||
"@types/path-browserify": "^1.0.3",
|
||||
"@types/qrcode": "^1.5.6",
|
||||
"@types/qs": "^6.14.0",
|
||||
"@types/sortablejs": "^1.15.9",
|
||||
"@vitejs/plugin-vue": "^6.0.2",
|
||||
"@vitejs/plugin-vue-jsx": "^5.1.2",
|
||||
"@vitejs/plugin-vue": "^6.0.3",
|
||||
"@vitejs/plugin-vue-jsx": "^5.1.3",
|
||||
"boxen": "^8.0.1",
|
||||
"code-inspector-plugin": "^1.3.0",
|
||||
"code-inspector-plugin": "^1.3.4",
|
||||
"cssnano": "^7.1.2",
|
||||
"dagre": "^0.8.5",
|
||||
"eslint": "^9.39.1",
|
||||
"eslint": "^9.39.2",
|
||||
"eslint-config-prettier": "^10.1.8",
|
||||
"eslint-plugin-prettier": "^5.5.4",
|
||||
"eslint-plugin-prettier": "^5.5.5",
|
||||
"eslint-plugin-vue": "^10.6.2",
|
||||
"gradient-string": "^3.0.0",
|
||||
"husky": "^9.1.7",
|
||||
"lint-staged": "^16.2.7",
|
||||
"postcss": "^8.5.6",
|
||||
"postcss-html": "^1.8.0",
|
||||
"postcss-html": "^1.8.1",
|
||||
"postcss-load-config": "^6.0.1",
|
||||
"postcss-scss": "^4.0.9",
|
||||
"prettier": "^3.7.4",
|
||||
"prettier": "^3.8.0",
|
||||
"rimraf": "^6.1.2",
|
||||
"rollup-plugin-visualizer": "^6.0.5",
|
||||
"sass": "^1.95.1",
|
||||
"stylelint": "^16.26.1",
|
||||
"sass": "^1.97.2",
|
||||
"stylelint": "^17.0.0",
|
||||
"stylelint-config-recess-order": "^7.4.0",
|
||||
"stylelint-config-recommended-vue": "^1.6.1",
|
||||
"stylelint-config-standard-scss": "^14.0.0",
|
||||
"stylelint-config-standard-scss": "^17.0.0",
|
||||
"stylelint-prettier": "^5.0.3",
|
||||
"svgo": "^4.0.0",
|
||||
"tailwindcss": "^4.1.17",
|
||||
"tailwindcss": "^4.1.18",
|
||||
"typescript": "^5.9.3",
|
||||
"typescript-eslint": "^8.49.0",
|
||||
"unplugin-icons": "^22.5.0",
|
||||
"vite": "^7.2.7",
|
||||
"typescript-eslint": "^8.53.0",
|
||||
"unplugin-icons": "^23.0.1",
|
||||
"vite": "^7.3.1",
|
||||
"vite-plugin-cdn-import": "^1.0.1",
|
||||
"vite-plugin-compression": "^0.5.1",
|
||||
"vite-plugin-fake-server": "^2.2.2",
|
||||
@@ -172,7 +172,7 @@
|
||||
"vite-plugin-router-warn": "^2.0.0",
|
||||
"vite-svg-loader": "^5.1.0",
|
||||
"vue-eslint-parser": "^10.2.0",
|
||||
"vue-tsc": "^3.1.8"
|
||||
"vue-tsc": "^3.2.2"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^20.19.0 || >=22.13.0",
|
||||
|
||||
3143
pnpm-lock.yaml
generated
3143
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
15
src/App.vue
15
src/App.vue
@@ -7,8 +7,9 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent } from "vue";
|
||||
import { useGlobal } from "@pureadmin/utils";
|
||||
import { checkVersion } from "version-rocket";
|
||||
import { defineComponent, computed } from "vue";
|
||||
import { ElConfigProvider } from "element-plus";
|
||||
import { ReDialog } from "@/components/ReDialog";
|
||||
import { ReDrawer } from "@/components/ReDrawer";
|
||||
@@ -24,12 +25,16 @@ export default defineComponent({
|
||||
ReDialog,
|
||||
ReDrawer
|
||||
},
|
||||
computed: {
|
||||
currentLocale() {
|
||||
return this.$storage.locale?.locale === "zh"
|
||||
setup() {
|
||||
const { $storage } = useGlobal<GlobalPropertiesApi>();
|
||||
const currentLocale = computed(() => {
|
||||
return $storage.locale?.locale === "zh"
|
||||
? { ...zhCn, ...plusZhCn }
|
||||
: { ...en, ...plusEn };
|
||||
}
|
||||
});
|
||||
return {
|
||||
currentLocale
|
||||
};
|
||||
},
|
||||
beforeCreate() {
|
||||
const { version, name: title } = __APP_INFO__.pkg;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { http } from "@/utils/http";
|
||||
|
||||
type Result = {
|
||||
success: boolean;
|
||||
code: number;
|
||||
message: string;
|
||||
data?: {
|
||||
/** 列表数据 */
|
||||
list: Array<any>;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { http } from "@/utils/http";
|
||||
|
||||
type Result = {
|
||||
success: boolean;
|
||||
code: number;
|
||||
message: string;
|
||||
data: Array<any>;
|
||||
};
|
||||
|
||||
@@ -14,7 +15,7 @@ export const mapJson = (params?: object) => {
|
||||
export const formUpload = data => {
|
||||
return http.request<Result>(
|
||||
"post",
|
||||
"https://run.mocky.io/v3/3aa761d7-b0b3-4a03-96b3-6168d4f7467b",
|
||||
"https://pureadmin.free.beeceptor.com/images",
|
||||
{ data },
|
||||
{
|
||||
headers: {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { http } from "@/utils/http";
|
||||
|
||||
type Result = {
|
||||
success: boolean;
|
||||
code: number;
|
||||
message: string;
|
||||
data: Array<any>;
|
||||
};
|
||||
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import { http } from "@/utils/http";
|
||||
|
||||
type Result = {
|
||||
success: boolean;
|
||||
code: number;
|
||||
message: string;
|
||||
data?: Array<any>;
|
||||
};
|
||||
|
||||
type ResultTable = {
|
||||
success: boolean;
|
||||
code: number;
|
||||
message: string;
|
||||
data?: {
|
||||
/** 列表数据 */
|
||||
list: Array<any>;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { http } from "@/utils/http";
|
||||
|
||||
export type UserResult = {
|
||||
success: boolean;
|
||||
code: number;
|
||||
message: string;
|
||||
data: {
|
||||
/** 头像 */
|
||||
avatar: string;
|
||||
@@ -23,7 +24,8 @@ export type UserResult = {
|
||||
};
|
||||
|
||||
export type RefreshTokenResult = {
|
||||
success: boolean;
|
||||
code: number;
|
||||
message: string;
|
||||
data: {
|
||||
/** `token` */
|
||||
accessToken: string;
|
||||
@@ -50,12 +52,14 @@ export type UserInfo = {
|
||||
};
|
||||
|
||||
export type UserInfoResult = {
|
||||
success: boolean;
|
||||
code: number;
|
||||
message: string;
|
||||
data: UserInfo;
|
||||
};
|
||||
|
||||
type ResultTable = {
|
||||
success: boolean;
|
||||
code: number;
|
||||
message: string;
|
||||
data?: {
|
||||
/** 列表数据 */
|
||||
list: Array<any>;
|
||||
|
||||
@@ -92,14 +92,16 @@ onBeforeMount(() => {
|
||||
|
||||
// 获取模拟车辆信息
|
||||
mapJson()
|
||||
.then(({ data }) => {
|
||||
const points: object = data.map(v => {
|
||||
return {
|
||||
lnglat: [v.lng, v.lat],
|
||||
...v
|
||||
};
|
||||
});
|
||||
if (MarkerCluster) MarkerCluster.setData(points);
|
||||
.then(({ code, data }) => {
|
||||
if (code === 0) {
|
||||
const points: object = data.map(v => {
|
||||
return {
|
||||
lnglat: [v.lng, v.lat],
|
||||
...v
|
||||
};
|
||||
});
|
||||
if (MarkerCluster) MarkerCluster.setData(points);
|
||||
}
|
||||
})
|
||||
.catch(err => {
|
||||
console.log("err:", err);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Sortable from "sortablejs";
|
||||
import { transformI18n } from "@/plugins/i18n";
|
||||
import { $t, transformI18n } from "@/plugins/i18n";
|
||||
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
|
||||
import {
|
||||
type PropType,
|
||||
@@ -30,7 +30,7 @@ const props = {
|
||||
/** 头部最左边的标题 */
|
||||
title: {
|
||||
type: String,
|
||||
default: "列表"
|
||||
default: $t("tableBar.pureList")
|
||||
},
|
||||
/** 对于树形表格,如果想启用展开和折叠功能,传入当前表格的ref即可 */
|
||||
tableRef: {
|
||||
@@ -169,19 +169,19 @@ export default defineComponent({
|
||||
style={getDropdownItemStyle.value("large")}
|
||||
onClick={() => (size.value = "large")}
|
||||
>
|
||||
宽松
|
||||
{transformI18n($t("tableBar.pureLarge"))}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
style={getDropdownItemStyle.value("default")}
|
||||
onClick={() => (size.value = "default")}
|
||||
>
|
||||
默认
|
||||
{transformI18n($t("tableBar.pureDefault"))}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
style={getDropdownItemStyle.value("small")}
|
||||
onClick={() => (size.value = "small")}
|
||||
>
|
||||
紧凑
|
||||
{transformI18n($t("tableBar.pureSmall"))}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
)
|
||||
@@ -245,7 +245,9 @@ export default defineComponent({
|
||||
reference: () => (
|
||||
<SettingIcon
|
||||
class={["w-[16px]", iconClass.value]}
|
||||
v-tippy={rendTippyProps("列设置")}
|
||||
v-tippy={rendTippyProps(
|
||||
transformI18n($t("tableBar.pureColumnSettings"))
|
||||
)}
|
||||
/>
|
||||
)
|
||||
};
|
||||
@@ -268,7 +270,7 @@ export default defineComponent({
|
||||
{slots?.title ? (
|
||||
slots.title()
|
||||
) : (
|
||||
<p class="font-bold truncate">{props.title}</p>
|
||||
<p class="font-bold truncate">{transformI18n(props.title)}</p>
|
||||
)}
|
||||
<div class="flex items-center justify-around">
|
||||
{slots?.buttons ? (
|
||||
@@ -282,7 +284,9 @@ export default defineComponent({
|
||||
transform: isExpandAll.value ? "none" : "rotate(-90deg)"
|
||||
}}
|
||||
v-tippy={rendTippyProps(
|
||||
isExpandAll.value ? "折叠" : "展开"
|
||||
isExpandAll.value
|
||||
? transformI18n($t("tableBar.pureCollapse"))
|
||||
: transformI18n($t("tableBar.pureExpand"))
|
||||
)}
|
||||
onClick={() => onExpand()}
|
||||
/>
|
||||
@@ -295,14 +299,18 @@ export default defineComponent({
|
||||
iconClass.value,
|
||||
loading.value ? "animate-spin" : ""
|
||||
]}
|
||||
v-tippy={rendTippyProps("刷新")}
|
||||
v-tippy={rendTippyProps(
|
||||
transformI18n($t("tableBar.pureRefresh"))
|
||||
)}
|
||||
onClick={() => onReFresh()}
|
||||
/>
|
||||
<el-divider direction="vertical" />
|
||||
<el-dropdown
|
||||
v-slots={dropdown}
|
||||
trigger="click"
|
||||
v-tippy={rendTippyProps("密度")}
|
||||
v-tippy={rendTippyProps(
|
||||
transformI18n($t("tableBar.pureDensity"))
|
||||
)}
|
||||
>
|
||||
<CollapseIcon class={["w-[16px]", iconClass.value]} />
|
||||
</el-dropdown>
|
||||
@@ -318,13 +326,13 @@ export default defineComponent({
|
||||
<div class={[topClass.value]}>
|
||||
<el-checkbox
|
||||
class="-mr-1!"
|
||||
label="列展示"
|
||||
label={transformI18n($t("tableBar.pureColumnDisplay"))}
|
||||
v-model={checkAll.value}
|
||||
indeterminate={isIndeterminate.value}
|
||||
onChange={value => handleCheckAllChange(value)}
|
||||
/>
|
||||
<el-button type="primary" link onClick={() => onReset()}>
|
||||
重置
|
||||
{transformI18n($t("tableBar.pureReset"))}
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
@@ -382,7 +390,11 @@ export default defineComponent({
|
||||
<iconifyIconOffline
|
||||
class={["w-[16px]", iconClass.value]}
|
||||
icon={isFullscreen.value ? ExitFullscreen : Fullscreen}
|
||||
v-tippy={isFullscreen.value ? "退出全屏" : "全屏"}
|
||||
v-tippy={
|
||||
isFullscreen.value
|
||||
? transformI18n($t("tableBar.pureExitFullScreen"))
|
||||
: transformI18n($t("tableBar.pureFullScreen"))
|
||||
}
|
||||
onClick={() => onFullscreen()}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -5,14 +5,10 @@ import {
|
||||
ref,
|
||||
unref,
|
||||
nextTick,
|
||||
computed
|
||||
computed,
|
||||
useTemplateRef
|
||||
} from "vue";
|
||||
import {
|
||||
tryOnMounted,
|
||||
tryOnUnmounted,
|
||||
templateRef,
|
||||
useDebounceFn
|
||||
} from "@vueuse/core";
|
||||
import { tryOnMounted, tryOnUnmounted, useDebounceFn } from "@vueuse/core";
|
||||
import * as utilsMethods from "./utils";
|
||||
const { animationFrame, copyObj } = utilsMethods;
|
||||
animationFrame();
|
||||
@@ -62,17 +58,14 @@ if (props.classOption["key"] === undefined) {
|
||||
props.classOption["key"] = 0;
|
||||
}
|
||||
|
||||
const wrap = templateRef<HTMLElement | null>(
|
||||
`wrap${props.classOption["key"]}`,
|
||||
null
|
||||
const wrap = useTemplateRef<HTMLElement | null>(
|
||||
`wrap${props.classOption["key"]}`
|
||||
);
|
||||
const slotList = templateRef<HTMLElement | null>(
|
||||
`slotList${props.classOption["key"]}`,
|
||||
null
|
||||
const slotList = useTemplateRef<HTMLElement | null>(
|
||||
`slotList${props.classOption["key"]}`
|
||||
);
|
||||
const realBox = templateRef<HTMLElement | null>(
|
||||
`realBox${props.classOption["key"]}`,
|
||||
null
|
||||
const realBox = useTemplateRef<HTMLElement | null>(
|
||||
`realBox${props.classOption["key"]}`
|
||||
);
|
||||
|
||||
const leftSwitchState = computed(() => {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Sortable from "sortablejs";
|
||||
import { transformI18n } from "@/plugins/i18n";
|
||||
import { $t, transformI18n } from "@/plugins/i18n";
|
||||
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
|
||||
import { delay, cloneDeep, getKeyList } from "@pureadmin/utils";
|
||||
import {
|
||||
@@ -24,7 +24,7 @@ const props = {
|
||||
/** 头部最左边的标题 */
|
||||
title: {
|
||||
type: String,
|
||||
default: "列表"
|
||||
default: $t("tableBar.pureList")
|
||||
},
|
||||
vxeTableRef: {
|
||||
type: Object as PropType<any>
|
||||
@@ -161,19 +161,19 @@ export default defineComponent({
|
||||
style={getDropdownItemStyle.value("medium")}
|
||||
onClick={() => changeSize("medium")}
|
||||
>
|
||||
宽松
|
||||
{transformI18n($t("tableBar.pureLarge"))}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
style={getDropdownItemStyle.value("small")}
|
||||
onClick={() => changeSize("small")}
|
||||
>
|
||||
默认
|
||||
{transformI18n($t("tableBar.pureDefault"))}
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item
|
||||
style={getDropdownItemStyle.value("mini")}
|
||||
onClick={() => changeSize("mini")}
|
||||
>
|
||||
紧凑
|
||||
{transformI18n($t("tableBar.pureSmall"))}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
)
|
||||
@@ -238,7 +238,9 @@ export default defineComponent({
|
||||
reference: () => (
|
||||
<SettingIcon
|
||||
class={["w-[16px]", iconClass.value]}
|
||||
v-tippy={rendTippyProps("列设置")}
|
||||
v-tippy={rendTippyProps(
|
||||
transformI18n($t("tableBar.pureColumnSettings"))
|
||||
)}
|
||||
/>
|
||||
)
|
||||
};
|
||||
@@ -261,7 +263,7 @@ export default defineComponent({
|
||||
{slots?.title ? (
|
||||
slots.title()
|
||||
) : (
|
||||
<p class="font-bold truncate">{props.title}</p>
|
||||
<p class="font-bold truncate">{transformI18n(props.title)}</p>
|
||||
)}
|
||||
<div class="flex items-center justify-around">
|
||||
{slots?.buttons ? (
|
||||
@@ -275,7 +277,9 @@ export default defineComponent({
|
||||
transform: isExpandAll.value ? "none" : "rotate(-90deg)"
|
||||
}}
|
||||
v-tippy={rendTippyProps(
|
||||
isExpandAll.value ? "折叠" : "展开"
|
||||
isExpandAll.value
|
||||
? transformI18n($t("tableBar.pureCollapse"))
|
||||
: transformI18n($t("tableBar.pureExpand"))
|
||||
)}
|
||||
onClick={() => onExpand()}
|
||||
/>
|
||||
@@ -288,14 +292,18 @@ export default defineComponent({
|
||||
iconClass.value,
|
||||
loading.value ? "animate-spin" : ""
|
||||
]}
|
||||
v-tippy={rendTippyProps("刷新")}
|
||||
v-tippy={rendTippyProps(
|
||||
transformI18n($t("tableBar.pureRefresh"))
|
||||
)}
|
||||
onClick={() => onReFresh()}
|
||||
/>
|
||||
<el-divider direction="vertical" />
|
||||
<el-dropdown
|
||||
v-slots={dropdown}
|
||||
trigger="click"
|
||||
v-tippy={rendTippyProps("密度")}
|
||||
v-tippy={rendTippyProps(
|
||||
transformI18n($t("tableBar.pureDensity"))
|
||||
)}
|
||||
>
|
||||
<CollapseIcon class={["w-[16px]", iconClass.value]} />
|
||||
</el-dropdown>
|
||||
@@ -311,13 +319,13 @@ export default defineComponent({
|
||||
<div class={[topClass.value]}>
|
||||
<el-checkbox
|
||||
class="-mr-1!"
|
||||
label="列展示"
|
||||
label={transformI18n($t("tableBar.pureColumnDisplay"))}
|
||||
v-model={checkAll.value}
|
||||
indeterminate={isIndeterminate.value}
|
||||
onChange={value => handleCheckAllChange(value)}
|
||||
/>
|
||||
<el-button type="primary" link onClick={() => onReset()}>
|
||||
重置
|
||||
{transformI18n($t("tableBar.pureReset"))}
|
||||
</el-button>
|
||||
</div>
|
||||
|
||||
@@ -373,7 +381,11 @@ export default defineComponent({
|
||||
<iconifyIconOffline
|
||||
class={["w-[16px]", iconClass.value]}
|
||||
icon={isFullscreen.value ? ExitFullscreen : Fullscreen}
|
||||
v-tippy={isFullscreen.value ? "退出全屏" : "全屏"}
|
||||
v-tippy={
|
||||
isFullscreen.value
|
||||
? transformI18n($t("tableBar.pureExitFullScreen"))
|
||||
: transformI18n($t("tableBar.pureFullScreen"))
|
||||
}
|
||||
onClick={() => onFullscreen()}
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -53,9 +53,11 @@ const { t, locale, translationCh, translationEn } = useTranslationLang();
|
||||
<LaySearch id="header-search" />
|
||||
<!-- 国际化 -->
|
||||
<el-dropdown id="header-translation" trigger="click">
|
||||
<GlobalizationIcon
|
||||
class="navbar-bg-hover w-[40px] h-[48px] p-[11px] cursor-pointer outline-hidden"
|
||||
/>
|
||||
<div
|
||||
class="globalization-icon navbar-bg-hover hover:[&>svg]:animate-scale-bounce"
|
||||
>
|
||||
<IconifyIconOffline :icon="GlobalizationIcon" />
|
||||
</div>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu class="translation">
|
||||
<el-dropdown-item
|
||||
@@ -113,7 +115,7 @@ const { t, locale, translationCh, translationEn } = useTranslationLang();
|
||||
</template>
|
||||
</el-dropdown>
|
||||
<span
|
||||
class="set-icon navbar-bg-hover"
|
||||
class="set-icon navbar-bg-hover hover:[&>svg]:animate-scale-bounce"
|
||||
:title="t('buttons.pureOpenSystemSet')"
|
||||
@click="onPanel"
|
||||
>
|
||||
@@ -172,7 +174,7 @@ const { t, locale, translationCh, translationEn } = useTranslationLang();
|
||||
}
|
||||
|
||||
.translation {
|
||||
::v-deep(.el-dropdown-menu__item) {
|
||||
:deep(.el-dropdown-menu__item) {
|
||||
padding: 5px 40px;
|
||||
}
|
||||
|
||||
@@ -190,7 +192,7 @@ const { t, locale, translationCh, translationEn } = useTranslationLang();
|
||||
.logout {
|
||||
width: 120px;
|
||||
|
||||
::v-deep(.el-dropdown-menu__item) {
|
||||
:deep(.el-dropdown-menu__item) {
|
||||
display: inline-flex;
|
||||
flex-wrap: wrap;
|
||||
min-width: 100%;
|
||||
|
||||
@@ -3,15 +3,12 @@ import { useI18n } from "vue-i18n";
|
||||
import { ref, computed } from "vue";
|
||||
import { noticesData } from "./data";
|
||||
import NoticeList from "./components/NoticeList.vue";
|
||||
import BellIcon from "~icons/ep/bell";
|
||||
import BellIcon from "~icons/lucide/bell";
|
||||
|
||||
const { t } = useI18n();
|
||||
const noticesNum = ref(0);
|
||||
const notices = ref(noticesData);
|
||||
const activeKey = ref(noticesData[0]?.key);
|
||||
|
||||
notices.value.map(v => (noticesNum.value += v.list.length));
|
||||
|
||||
const getLabel = computed(
|
||||
() => item =>
|
||||
t(item.name) + (item.list.length > 0 ? `(${item.list.length})` : "")
|
||||
@@ -21,14 +18,9 @@ const getLabel = computed(
|
||||
<template>
|
||||
<el-dropdown trigger="click" placement="bottom-end">
|
||||
<span
|
||||
:class="[
|
||||
'dropdown-badge',
|
||||
'navbar-bg-hover',
|
||||
'select-none',
|
||||
Number(noticesNum) !== 0 && 'mr-[10px]'
|
||||
]"
|
||||
:class="['dropdown-badge', 'navbar-bg-hover', 'select-none', 'mr-[7px]']"
|
||||
>
|
||||
<el-badge :value="Number(noticesNum) === 0 ? '' : noticesNum" :max="99">
|
||||
<el-badge is-dot>
|
||||
<span class="header-notice-icon">
|
||||
<IconifyIconOffline :icon="BellIcon" />
|
||||
</span>
|
||||
@@ -65,6 +57,34 @@ const getLabel = computed(
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
/* ”铃铛“摇晃衰减动画 */
|
||||
@keyframes pure-bell-ring {
|
||||
0%,
|
||||
100% {
|
||||
transform-origin: top;
|
||||
}
|
||||
|
||||
15% {
|
||||
transform: rotateZ(10deg);
|
||||
}
|
||||
|
||||
30% {
|
||||
transform: rotateZ(-10deg);
|
||||
}
|
||||
|
||||
45% {
|
||||
transform: rotateZ(5deg);
|
||||
}
|
||||
|
||||
60% {
|
||||
transform: rotateZ(-5deg);
|
||||
}
|
||||
|
||||
75% {
|
||||
transform: rotateZ(2deg);
|
||||
}
|
||||
}
|
||||
|
||||
.dropdown-badge {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -74,7 +94,13 @@ const getLabel = computed(
|
||||
cursor: pointer;
|
||||
|
||||
.header-notice-icon {
|
||||
font-size: 18px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
.header-notice-icon svg {
|
||||
animation: pure-bell-ring 1s both;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ onBeforeUnmount(() => {
|
||||
<div class="right-panel-background" />
|
||||
<div ref="target" class="right-panel bg-bg_color">
|
||||
<div
|
||||
class="project-configuration border-0 border-b-[1px] border-solid border-[var(--pure-border-color)]"
|
||||
class="flex-bc py-3 px-5 border-0 border-l border-solid border-(--pure-border-color)"
|
||||
>
|
||||
<h4 class="dark:text-white">
|
||||
{{ t("panel.pureSystemSet") }}
|
||||
@@ -73,12 +73,14 @@ onBeforeUnmount(() => {
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
<el-scrollbar>
|
||||
<el-scrollbar
|
||||
class="border-y border-l border-r-0 border-solid border-(--pure-border-color) h-[calc(100vh-104px)]!"
|
||||
>
|
||||
<slot />
|
||||
</el-scrollbar>
|
||||
|
||||
<div
|
||||
class="flex justify-end p-3 border-0 border-t-[1px] border-solid border-[var(--pure-border-color)]"
|
||||
class="flex justify-end p-3 border-0 border-l border-solid border-(--pure-border-color)"
|
||||
>
|
||||
<el-button
|
||||
v-tippy="{
|
||||
@@ -99,10 +101,6 @@ onBeforeUnmount(() => {
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
:deep(.el-scrollbar) {
|
||||
height: calc(100vh - 110px);
|
||||
}
|
||||
|
||||
.right-panel-background {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
@@ -139,11 +137,4 @@ onBeforeUnmount(() => {
|
||||
transform: translate(0);
|
||||
}
|
||||
}
|
||||
|
||||
.project-configuration {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 14px 20px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -11,7 +11,7 @@ function handleSearch() {
|
||||
<template>
|
||||
<div>
|
||||
<div
|
||||
class="search-container w-[40px] h-[48px] flex-c cursor-pointer navbar-bg-hover"
|
||||
class="search-container w-[40px] h-[48px] flex-c cursor-pointer navbar-bg-hover hover:[&>svg]:animate-scale-bounce"
|
||||
@click="handleSearch"
|
||||
>
|
||||
<IconifyIconOffline icon="ri/search-line" />
|
||||
|
||||
@@ -9,14 +9,6 @@ import {
|
||||
onUnmounted,
|
||||
onBeforeMount
|
||||
} from "vue";
|
||||
import {
|
||||
useDark,
|
||||
debounce,
|
||||
isNumber,
|
||||
useGlobal,
|
||||
isAllEmpty,
|
||||
useWatermark
|
||||
} from "@pureadmin/utils";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { emitter } from "@/utils/mitt";
|
||||
import LayPanel from "../lay-panel/index.vue";
|
||||
@@ -25,6 +17,7 @@ import { useAppStoreHook } from "@/store/modules/app";
|
||||
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
|
||||
import Segmented, { type OptionsType } from "@/components/ReSegmented";
|
||||
import { useDataThemeChange } from "@/layout/hooks/useDataThemeChange";
|
||||
import { useDark, useGlobal, debounce, isNumber } from "@pureadmin/utils";
|
||||
|
||||
import Check from "~icons/ep/check";
|
||||
import LeftArrow from "~icons/ri/arrow-left-s-line?width=20&height=20";
|
||||
@@ -34,9 +27,8 @@ import DarkIcon from "@/assets/svg/dark.svg?component";
|
||||
import SystemIcon from "@/assets/svg/system.svg?component";
|
||||
|
||||
const { t } = useI18n();
|
||||
const { device } = useNav();
|
||||
const { isDark } = useDark();
|
||||
const { device, title } = useNav();
|
||||
const { setWatermark, clear } = useWatermark();
|
||||
const { $storage } = useGlobal<GlobalPropertiesApi>();
|
||||
|
||||
const mixRef = ref();
|
||||
@@ -66,12 +58,6 @@ const markValue = ref($storage.configure?.showModel ?? "smart");
|
||||
|
||||
const logoVal = ref($storage.configure?.showLogo ?? true);
|
||||
|
||||
/** WIP... */
|
||||
const watermarkConfigs = reactive({
|
||||
enable: false,
|
||||
text: null
|
||||
});
|
||||
|
||||
const settings = reactive({
|
||||
greyVal: $storage.configure.grey,
|
||||
weakVal: $storage.configure.weak,
|
||||
@@ -143,21 +129,6 @@ function onChange({ option }) {
|
||||
emitter.emit("tagViewsShowModel", value);
|
||||
}
|
||||
|
||||
function onWatermarkSwitchChange(value) {
|
||||
const text = isAllEmpty(watermarkConfigs.text)
|
||||
? title.value
|
||||
: watermarkConfigs.text;
|
||||
if (value) {
|
||||
setWatermark(text);
|
||||
} else {
|
||||
clear();
|
||||
}
|
||||
}
|
||||
|
||||
function onWatermarkInputChange(value) {
|
||||
setWatermark(value);
|
||||
}
|
||||
|
||||
/** 侧边栏Logo */
|
||||
function logoChange() {
|
||||
unref(logoVal)
|
||||
@@ -374,8 +345,8 @@ onUnmounted(() => removeMatchMedia);
|
||||
@click="setLayoutThemeColor(item.themeColor)"
|
||||
>
|
||||
<el-icon
|
||||
style="margin: 0.1em 0.1em 0 0"
|
||||
:size="17"
|
||||
class="mt-px"
|
||||
:size="20"
|
||||
:color="getThemeColor(item.themeColor)"
|
||||
>
|
||||
<IconifyIconOffline :icon="Check" />
|
||||
@@ -476,39 +447,30 @@ onUnmounted(() => removeMatchMedia);
|
||||
@change="onChange"
|
||||
/>
|
||||
|
||||
<p class="mt-5! font-medium text-sm dark:text-white">
|
||||
{{ t("panel.pureFullScreenWatermark") }}
|
||||
</p>
|
||||
<ul class="setting">
|
||||
<li>
|
||||
<span class="dark:text-white">
|
||||
{{ t("panel.pureEnableWatermark") }}
|
||||
</span>
|
||||
<el-switch
|
||||
v-model="watermarkConfigs.enable"
|
||||
inline-prompt
|
||||
:active-text="t('buttons.pureOpenText')"
|
||||
:inactive-text="t('buttons.pureCloseText')"
|
||||
@change="onWatermarkSwitchChange"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<span class="dark:text-white">
|
||||
{{ t("panel.pureWatermarkText") }}
|
||||
</span>
|
||||
<el-input
|
||||
v-model="watermarkConfigs.text"
|
||||
class="w-[100px]!"
|
||||
:placeholder="title"
|
||||
@input="onWatermarkInputChange"
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<p class="mt-5! font-medium text-sm dark:text-white">
|
||||
{{ t("panel.pureInterfaceDisplay") }}
|
||||
</p>
|
||||
<ul class="setting">
|
||||
<li>
|
||||
<span class="dark:text-white">{{ t("panel.pureGreyModel") }}</span>
|
||||
<el-switch
|
||||
v-model="settings.greyVal"
|
||||
inline-prompt
|
||||
:active-text="t('buttons.pureOpenText')"
|
||||
:inactive-text="t('buttons.pureCloseText')"
|
||||
@change="greyChange"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<span class="dark:text-white">{{ t("panel.pureWeakModel") }}</span>
|
||||
<el-switch
|
||||
v-model="settings.weakVal"
|
||||
inline-prompt
|
||||
:active-text="t('buttons.pureOpenText')"
|
||||
:inactive-text="t('buttons.pureCloseText')"
|
||||
@change="weekChange"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<span class="dark:text-white">{{ t("panel.pureHiddenTags") }}</span>
|
||||
<el-switch
|
||||
@@ -529,18 +491,6 @@ onUnmounted(() => removeMatchMedia);
|
||||
@change="hideFooterChange"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<span class="dark:text-white">
|
||||
{{ t("panel.pureMultiTagsCache") }}
|
||||
</span>
|
||||
<el-switch
|
||||
v-model="settings.multiTagsCache"
|
||||
inline-prompt
|
||||
:active-text="t('buttons.pureOpenText')"
|
||||
:inactive-text="t('buttons.pureCloseText')"
|
||||
@change="multiTagsCacheChange"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<span class="dark:text-white">Logo</span>
|
||||
<el-switch
|
||||
@@ -554,23 +504,15 @@ onUnmounted(() => removeMatchMedia);
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<span class="dark:text-white">{{ t("panel.pureGreyModel") }}</span>
|
||||
<span class="dark:text-white">
|
||||
{{ t("panel.pureMultiTagsCache") }}
|
||||
</span>
|
||||
<el-switch
|
||||
v-model="settings.greyVal"
|
||||
v-model="settings.multiTagsCache"
|
||||
inline-prompt
|
||||
:active-text="t('buttons.pureOpenText')"
|
||||
:inactive-text="t('buttons.pureCloseText')"
|
||||
@change="greyChange"
|
||||
/>
|
||||
</li>
|
||||
<li>
|
||||
<span class="dark:text-white">{{ t("panel.pureWeakModel") }}</span>
|
||||
<el-switch
|
||||
v-model="settings.weakVal"
|
||||
inline-prompt
|
||||
:active-text="t('buttons.pureOpenText')"
|
||||
:inactive-text="t('buttons.pureCloseText')"
|
||||
@change="weekChange"
|
||||
@change="multiTagsCacheChange"
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -596,17 +538,24 @@ onUnmounted(() => removeMatchMedia);
|
||||
}
|
||||
|
||||
.theme-color {
|
||||
height: 20px;
|
||||
display: flex;
|
||||
gap: 8px;
|
||||
margin-top: 8px;
|
||||
|
||||
li {
|
||||
float: left;
|
||||
height: 20px;
|
||||
margin-right: 8px;
|
||||
position: relative;
|
||||
width: 21px;
|
||||
height: 21px;
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
box-shadow: rgb(0 0 0 / 15%) 0 0 0 1px inset;
|
||||
transition: all 0.2s ease;
|
||||
|
||||
&:nth-child(1) {
|
||||
border: 1px solid #ddd;
|
||||
&:hover {
|
||||
box-shadow:
|
||||
rgb(0 0 0 / 25%) 0 0 0 1px inset,
|
||||
0 2px 4px rgb(0 0 0 / 15%);
|
||||
transform: scale(1.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -83,9 +83,11 @@ onMounted(() => {
|
||||
<LaySearch id="header-search" />
|
||||
<!-- 国际化 -->
|
||||
<el-dropdown id="header-translation" trigger="click">
|
||||
<GlobalizationIcon
|
||||
class="navbar-bg-hover w-[40px] h-[48px] p-[11px] cursor-pointer outline-hidden"
|
||||
/>
|
||||
<div
|
||||
class="globalization-icon navbar-bg-hover hover:[&>svg]:animate-scale-bounce"
|
||||
>
|
||||
<IconifyIconOffline :icon="GlobalizationIcon" />
|
||||
</div>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu class="translation">
|
||||
<el-dropdown-item
|
||||
@@ -141,7 +143,7 @@ onMounted(() => {
|
||||
</template>
|
||||
</el-dropdown>
|
||||
<span
|
||||
class="set-icon navbar-bg-hover"
|
||||
class="set-icon navbar-bg-hover hover:[&>svg]:animate-scale-bounce"
|
||||
:title="t('buttons.pureOpenSystemSet')"
|
||||
@click="onPanel"
|
||||
>
|
||||
@@ -157,7 +159,7 @@ onMounted(() => {
|
||||
}
|
||||
|
||||
.translation {
|
||||
::v-deep(.el-dropdown-menu__item) {
|
||||
:deep(.el-dropdown-menu__item) {
|
||||
padding: 5px 40px;
|
||||
}
|
||||
|
||||
@@ -175,7 +177,7 @@ onMounted(() => {
|
||||
.logout {
|
||||
width: 120px;
|
||||
|
||||
::v-deep(.el-dropdown-menu__item) {
|
||||
:deep(.el-dropdown-menu__item) {
|
||||
display: inline-flex;
|
||||
flex-wrap: wrap;
|
||||
min-width: 100%;
|
||||
|
||||
@@ -104,9 +104,11 @@ watch(
|
||||
<LaySearch id="header-search" />
|
||||
<!-- 国际化 -->
|
||||
<el-dropdown id="header-translation" trigger="click">
|
||||
<GlobalizationIcon
|
||||
class="navbar-bg-hover w-[40px] h-[48px] p-[11px] cursor-pointer outline-hidden"
|
||||
/>
|
||||
<div
|
||||
class="globalization-icon navbar-bg-hover hover:[&>svg]:animate-scale-bounce"
|
||||
>
|
||||
<IconifyIconOffline :icon="GlobalizationIcon" />
|
||||
</div>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu class="translation">
|
||||
<el-dropdown-item
|
||||
@@ -162,7 +164,7 @@ watch(
|
||||
</template>
|
||||
</el-dropdown>
|
||||
<span
|
||||
class="set-icon navbar-bg-hover"
|
||||
class="set-icon navbar-bg-hover hover:[&>svg]:animate-scale-bounce"
|
||||
:title="t('buttons.pureOpenSystemSet')"
|
||||
@click="onPanel"
|
||||
>
|
||||
@@ -178,7 +180,7 @@ watch(
|
||||
}
|
||||
|
||||
.translation {
|
||||
::v-deep(.el-dropdown-menu__item) {
|
||||
:deep(.el-dropdown-menu__item) {
|
||||
padding: 5px 40px;
|
||||
}
|
||||
|
||||
@@ -196,7 +198,7 @@ watch(
|
||||
.logout {
|
||||
width: 120px;
|
||||
|
||||
::v-deep(.el-dropdown-menu__item) {
|
||||
:deep(.el-dropdown-menu__item) {
|
||||
display: inline-flex;
|
||||
flex-wrap: wrap;
|
||||
min-width: 100%;
|
||||
|
||||
@@ -24,7 +24,10 @@ watch(
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<span class="fullscreen-icon navbar-bg-hover" @click="toggle">
|
||||
<span
|
||||
class="fullscreen-icon navbar-bg-hover hover:[&>svg]:animate-scale-bounce"
|
||||
@click="toggle"
|
||||
>
|
||||
<IconifyIconOffline :icon="screenIcon" />
|
||||
</span>
|
||||
</template>
|
||||
|
||||
@@ -209,18 +209,26 @@ function initRouter() {
|
||||
});
|
||||
} else {
|
||||
return new Promise(resolve => {
|
||||
getAsyncRoutes().then(({ data }) => {
|
||||
handleAsyncRoutes(cloneDeep(data));
|
||||
storageLocal().setItem(key, data);
|
||||
resolve(router);
|
||||
getAsyncRoutes().then(({ code, data }) => {
|
||||
if (code === 0) {
|
||||
handleAsyncRoutes(cloneDeep(data));
|
||||
storageLocal().setItem(key, data);
|
||||
resolve(router);
|
||||
} else {
|
||||
resolve(router);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
} else {
|
||||
return new Promise(resolve => {
|
||||
getAsyncRoutes().then(({ data }) => {
|
||||
handleAsyncRoutes(cloneDeep(data));
|
||||
resolve(router);
|
||||
getAsyncRoutes().then(({ code, data }) => {
|
||||
if (code === 0) {
|
||||
handleAsyncRoutes(cloneDeep(data));
|
||||
resolve(router);
|
||||
} else {
|
||||
resolve(router);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -80,8 +80,12 @@ export const useUserStore = defineStore("pure-user", {
|
||||
return new Promise<UserResult>((resolve, reject) => {
|
||||
getLogin(data)
|
||||
.then(data => {
|
||||
if (data?.success) setToken(data.data);
|
||||
resolve(data);
|
||||
if (data.code === 0) {
|
||||
setToken(data.data);
|
||||
resolve(data);
|
||||
} else {
|
||||
reject(data.message);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
reject(error);
|
||||
@@ -103,9 +107,11 @@ export const useUserStore = defineStore("pure-user", {
|
||||
return new Promise<RefreshTokenResult>((resolve, reject) => {
|
||||
refreshTokenApi(data)
|
||||
.then(data => {
|
||||
if (data) {
|
||||
if (data.code === 0) {
|
||||
setToken(data.data);
|
||||
resolve(data);
|
||||
} else {
|
||||
reject(data.message);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
|
||||
@@ -135,17 +135,6 @@ html.dark {
|
||||
}
|
||||
}
|
||||
|
||||
/* 系统配置面板 */
|
||||
.right-panel-items {
|
||||
.el-divider__text {
|
||||
--el-bg-color: var(--el-bg-color);
|
||||
}
|
||||
|
||||
.el-divider--horizontal {
|
||||
border-top: none;
|
||||
}
|
||||
}
|
||||
|
||||
/* 表单设计器 */
|
||||
.design-form {
|
||||
.el-main.config-content,
|
||||
|
||||
@@ -35,3 +35,18 @@
|
||||
.html-weakness {
|
||||
filter: invert(80%);
|
||||
}
|
||||
|
||||
/* 轻微缩小,再恢复原状的平滑缩放动画 */
|
||||
@keyframes pure-scale-bounce {
|
||||
0% {
|
||||
transform: scale(1);
|
||||
}
|
||||
|
||||
50% {
|
||||
transform: scale(0.9);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,12 +34,14 @@
|
||||
}
|
||||
|
||||
.set-icon,
|
||||
.fullscreen-icon {
|
||||
.fullscreen-icon,
|
||||
.globalization-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 40px;
|
||||
height: 48px;
|
||||
font-size: 16px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@@ -449,7 +451,7 @@
|
||||
/* 搜索 */
|
||||
.search-container,
|
||||
/* 国际化 */
|
||||
.globalization,
|
||||
.globalization-icon,
|
||||
/* 全屏 */
|
||||
.fullscreen-icon,
|
||||
/* 消息通知 */
|
||||
@@ -468,12 +470,8 @@
|
||||
color: var(--pure-theme-sub-menu-active-text);
|
||||
}
|
||||
|
||||
.globalization {
|
||||
width: 40px;
|
||||
height: 48px;
|
||||
padding: 11px;
|
||||
.globalization-icon {
|
||||
color: var(--pure-theme-sub-menu-active-text);
|
||||
cursor: pointer;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
@@ -630,7 +628,7 @@ body[layout="vertical"] {
|
||||
/* 搜索 */
|
||||
.search-container,
|
||||
/* 国际化 */
|
||||
.globalization,
|
||||
.globalization-icon,
|
||||
/* 全屏 */
|
||||
.fullscreen-icon,
|
||||
/* 消息通知 */
|
||||
|
||||
@@ -42,5 +42,9 @@
|
||||
}
|
||||
|
||||
@utility navbar-bg-hover {
|
||||
@apply dark:text-white dark:hover:bg-[#242424]!;
|
||||
@apply select-none dark:text-white dark:hover:bg-[#242424]!;
|
||||
}
|
||||
|
||||
@utility animate-scale-bounce {
|
||||
animation: pure-scale-bounce 0.3s ease-in-out;
|
||||
}
|
||||
|
||||
@@ -10,6 +10,8 @@ import type {
|
||||
PureHttpRequestConfig
|
||||
} from "./types.d";
|
||||
import { stringify } from "qs";
|
||||
import { message } from "@/utils/message";
|
||||
import { $t, transformI18n } from "@/plugins/i18n";
|
||||
import { getToken, formatToken } from "@/utils/auth";
|
||||
import { useUserStoreHook } from "@/store/modules/user";
|
||||
|
||||
@@ -90,6 +92,13 @@ class PureHttp {
|
||||
PureHttp.requests.forEach(cb => cb(token));
|
||||
PureHttp.requests = [];
|
||||
})
|
||||
.catch(_err => {
|
||||
PureHttp.requests = [];
|
||||
useUserStoreHook().logOut();
|
||||
message(transformI18n($t("login.pureLoginExpired")), {
|
||||
type: "warning"
|
||||
});
|
||||
})
|
||||
.finally(() => {
|
||||
PureHttp.isRefreshing = false;
|
||||
});
|
||||
|
||||
@@ -171,7 +171,7 @@ onBeforeUnmount(() => {
|
||||
</template>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep(.el-upload-dragger) {
|
||||
:deep(.el-upload-dragger) {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 180px;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import { reactive, ref } from "vue";
|
||||
import { formUpload } from "@/api/mock";
|
||||
import { message } from "@/utils/message";
|
||||
import { onMounted, reactive, ref } from "vue";
|
||||
import { type UserInfo, getMine } from "@/api/user";
|
||||
import type { FormInstance, FormRules } from "element-plus";
|
||||
import ReCropperPreview from "@/components/ReCropperPreview";
|
||||
@@ -73,8 +73,8 @@ const handleSubmitImage = () => {
|
||||
files: new File([cropperBlob.value], "avatar")
|
||||
});
|
||||
formUpload(formData)
|
||||
.then(({ success, data }) => {
|
||||
if (success) {
|
||||
.then(({ code }) => {
|
||||
if (code === 0) {
|
||||
message("更新头像成功", { type: "success" });
|
||||
handleClose();
|
||||
} else {
|
||||
@@ -98,8 +98,11 @@ const onSubmit = async (formEl: FormInstance) => {
|
||||
});
|
||||
};
|
||||
|
||||
getMine().then(res => {
|
||||
Object.assign(userInfos, res.data);
|
||||
onMounted(async () => {
|
||||
const { code, data } = await getMine();
|
||||
if (code === 0) {
|
||||
Object.assign(userInfos, data);
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -55,11 +55,13 @@ const columns: TableColumnList = [
|
||||
|
||||
async function onSearch() {
|
||||
loading.value = true;
|
||||
const { data } = await getMineLogs();
|
||||
dataList.value = data.list;
|
||||
pagination.total = data.total;
|
||||
pagination.pageSize = data.pageSize;
|
||||
pagination.currentPage = data.currentPage;
|
||||
const { code, data } = await getMineLogs();
|
||||
if (code === 0) {
|
||||
dataList.value = data.list;
|
||||
pagination.total = data.total;
|
||||
pagination.pageSize = data.pageSize;
|
||||
pagination.currentPage = data.currentPage;
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
loading.value = false;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import { getMine } from "@/api/user";
|
||||
import { useRouter } from "vue-router";
|
||||
import { ref, onBeforeMount } from "vue";
|
||||
import { ReText } from "@/components/ReText";
|
||||
import Profile from "./components/Profile.vue";
|
||||
import { ref, onMounted, onBeforeMount } from "vue";
|
||||
import Preferences from "./components/Preferences.vue";
|
||||
import SecurityLog from "./components/SecurityLog.vue";
|
||||
import { useGlobal, deviceDetection } from "@pureadmin/utils";
|
||||
@@ -61,8 +61,11 @@ const panes = [
|
||||
];
|
||||
const witchPane = ref("profile");
|
||||
|
||||
getMine().then(res => {
|
||||
userInfo.value = res.data;
|
||||
onMounted(async () => {
|
||||
const { code, data } = await getMine();
|
||||
if (code === 0) {
|
||||
userInfo.value = data;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -71,17 +71,17 @@ const settingTB: ContextProps = reactive({
|
||||
|
||||
.dv-a {
|
||||
padding-top: 30vh;
|
||||
color: rgba($color: dodgerblue, $alpha: 80%);
|
||||
color: rgb(30 144 255 / 80%);
|
||||
}
|
||||
|
||||
.dv-b {
|
||||
padding-top: 10vh;
|
||||
color: rgba($color: #000, $alpha: 80%);
|
||||
color: rgb(0 0 0 / 80%);
|
||||
}
|
||||
|
||||
.dv-c {
|
||||
padding-top: 18vh;
|
||||
color: rgba($color: #ce272d, $alpha: 80%);
|
||||
color: rgb(206 39 45 / 80%);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -23,8 +23,8 @@ const submitForm = formEl => {
|
||||
date: validateForm.date // 别的字段
|
||||
});
|
||||
formUpload(formData)
|
||||
.then(({ success }) => {
|
||||
if (success) {
|
||||
.then(({ code }) => {
|
||||
if (code === 0) {
|
||||
message("提交成功", { type: "success" });
|
||||
} else {
|
||||
message("提交失败");
|
||||
|
||||
@@ -143,7 +143,7 @@ const onDownload = () => {
|
||||
class="pure-upload"
|
||||
list-type="picture-card"
|
||||
accept="image/jpeg,image/png,image/gif"
|
||||
action="https://run.mocky.io/v3/3aa761d7-b0b3-4a03-96b3-6168d4f7467b"
|
||||
action="https://pureadmin.free.beeceptor.com/images"
|
||||
:limit="3"
|
||||
:headers="{ Authorization: 'eyJhbGciOiJIUzUxMiJ9.admin' }"
|
||||
:on-exceed="onExceed"
|
||||
@@ -264,13 +264,13 @@ const onDownload = () => {
|
||||
表格操作栏中的上传头像功能
|
||||
</p>
|
||||
<p class="text-[red] text-[12px] flex flex-auto items-center justify-end">
|
||||
免责声明:上传接口使用免费开源的
|
||||
免责声明:上传接口使用
|
||||
<el-link
|
||||
href="https://designer.mocky.io/"
|
||||
href="https://beeceptor.com/"
|
||||
target="_blank"
|
||||
style="font-size: 16px; font-weight: 800"
|
||||
>
|
||||
Mocky
|
||||
Beeceptor
|
||||
</el-link>
|
||||
<span class="font-bold text-[18x]"> 请不要上传重要信息 </span
|
||||
>,如果造成任何损失,我们概不负责
|
||||
|
||||
@@ -38,12 +38,14 @@ const dataLoading = ref(true);
|
||||
|
||||
const getCardListData = async () => {
|
||||
try {
|
||||
const { data } = await getCardList();
|
||||
productList.value = data.list;
|
||||
pagination.value = {
|
||||
...pagination.value,
|
||||
total: data.list.length
|
||||
};
|
||||
const { code, data } = await getCardList();
|
||||
if (code === 0) {
|
||||
productList.value = data.list;
|
||||
pagination.value = {
|
||||
...pagination.value,
|
||||
total: data.list.length
|
||||
};
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
} finally {
|
||||
|
||||
@@ -73,23 +73,21 @@ const onLogin = async (formEl: FormInstance | undefined) => {
|
||||
username: ruleForm.username,
|
||||
password: ruleForm.password
|
||||
})
|
||||
.then(res => {
|
||||
if (res.success) {
|
||||
// 获取后端路由
|
||||
return initRouter().then(() => {
|
||||
disabled.value = true;
|
||||
router
|
||||
.push(getTopMenu(true).path)
|
||||
.then(() => {
|
||||
message(t("login.pureLoginSuccess"), { type: "success" });
|
||||
})
|
||||
.finally(() => (disabled.value = false));
|
||||
});
|
||||
} else {
|
||||
message(t("login.pureLoginFail"), { type: "error" });
|
||||
}
|
||||
.then(async () => {
|
||||
// 获取后端路由
|
||||
await initRouter();
|
||||
disabled.value = true;
|
||||
router.push(getTopMenu(true).path).then(() => {
|
||||
message(t("login.pureLoginSuccess"), { type: "success" });
|
||||
});
|
||||
})
|
||||
.finally(() => (loading.value = false));
|
||||
.catch(_err => {
|
||||
message(t("login.pureLoginFail"), { type: "error" });
|
||||
})
|
||||
.finally(() => {
|
||||
disabled.value = false;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
@@ -360,7 +358,7 @@ watch(loginDay, value => {
|
||||
}
|
||||
|
||||
.translation {
|
||||
::v-deep(.el-dropdown-menu__item) {
|
||||
:deep(.el-dropdown-menu__item) {
|
||||
padding: 5px 40px;
|
||||
}
|
||||
|
||||
|
||||
@@ -129,11 +129,13 @@ export function useRole(tableRef: Ref) {
|
||||
|
||||
async function onSearch() {
|
||||
loading.value = true;
|
||||
const { data } = await getLoginLogsList(toRaw(form));
|
||||
dataList.value = data.list;
|
||||
pagination.total = data.total;
|
||||
pagination.pageSize = data.pageSize;
|
||||
pagination.currentPage = data.currentPage;
|
||||
const { code, data } = await getLoginLogsList(toRaw(form));
|
||||
if (code === 0) {
|
||||
dataList.value = data.list;
|
||||
pagination.total = data.total;
|
||||
pagination.pageSize = data.pageSize;
|
||||
pagination.currentPage = data.currentPage;
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
loading.value = false;
|
||||
|
||||
@@ -134,11 +134,13 @@ export function useRole(tableRef: Ref) {
|
||||
|
||||
async function onSearch() {
|
||||
loading.value = true;
|
||||
const { data } = await getOperationLogsList(toRaw(form));
|
||||
dataList.value = data.list;
|
||||
pagination.total = data.total;
|
||||
pagination.pageSize = data.pageSize;
|
||||
pagination.currentPage = data.currentPage;
|
||||
const { code, data } = await getOperationLogsList(toRaw(form));
|
||||
if (code === 0) {
|
||||
dataList.value = data.list;
|
||||
pagination.total = data.total;
|
||||
pagination.pageSize = data.pageSize;
|
||||
pagination.currentPage = data.currentPage;
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
loading.value = false;
|
||||
|
||||
@@ -204,11 +204,13 @@ export function useRole(tableRef: Ref) {
|
||||
|
||||
async function onSearch() {
|
||||
loading.value = true;
|
||||
const { data } = await getSystemLogsList(toRaw(form));
|
||||
dataList.value = data.list;
|
||||
pagination.total = data.total;
|
||||
pagination.pageSize = data.pageSize;
|
||||
pagination.currentPage = data.currentPage;
|
||||
const { code, data } = await getSystemLogsList(toRaw(form));
|
||||
if (code === 0) {
|
||||
dataList.value = data.list;
|
||||
pagination.total = data.total;
|
||||
pagination.pageSize = data.pageSize;
|
||||
pagination.currentPage = data.currentPage;
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
loading.value = false;
|
||||
|
||||
@@ -80,11 +80,13 @@ export function useRole() {
|
||||
|
||||
async function onSearch() {
|
||||
loading.value = true;
|
||||
const { data } = await getOnlineLogsList(toRaw(form));
|
||||
dataList.value = data.list;
|
||||
pagination.total = data.total;
|
||||
pagination.pageSize = data.pageSize;
|
||||
pagination.currentPage = data.currentPage;
|
||||
const { code, data } = await getOnlineLogsList(toRaw(form));
|
||||
if (code === 0) {
|
||||
dataList.value = data.list;
|
||||
pagination.total = data.total;
|
||||
pagination.pageSize = data.pageSize;
|
||||
pagination.currentPage = data.currentPage;
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
loading.value = false;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { message } from "@/utils/message";
|
||||
import { initRouter } from "@/router/utils";
|
||||
import { storageLocal } from "@pureadmin/utils";
|
||||
import { type CSSProperties, ref, computed } from "vue";
|
||||
@@ -32,12 +33,13 @@ const options = [
|
||||
function onChange() {
|
||||
useUserStoreHook()
|
||||
.loginByUsername({ username: username.value, password: "admin123" })
|
||||
.then(res => {
|
||||
if (res.success) {
|
||||
storageLocal().removeItem("async-routes");
|
||||
usePermissionStoreHook().clearAllCachePage();
|
||||
initRouter();
|
||||
}
|
||||
.then(() => {
|
||||
storageLocal().removeItem("async-routes");
|
||||
usePermissionStoreHook().clearAllCachePage();
|
||||
initRouter();
|
||||
})
|
||||
.catch(err => {
|
||||
message(err, { type: "error" });
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -74,17 +74,20 @@ export function useDept() {
|
||||
|
||||
async function onSearch() {
|
||||
loading.value = true;
|
||||
const { data } = await getDeptList(); // 这里是返回一维数组结构,前端自行处理成树结构,返回格式要求:唯一id加父节点parentId,parentId取父节点id
|
||||
let newData = data;
|
||||
if (!isAllEmpty(form.name)) {
|
||||
// 前端搜索部门名称
|
||||
newData = newData.filter(item => item.name.includes(form.name));
|
||||
const { code, data } = await getDeptList(); // 这里是返回一维数组结构,前端自行处理成树结构,返回格式要求:唯一id加父节点parentId,parentId取父节点id
|
||||
if (code === 0) {
|
||||
let newData = data;
|
||||
if (!isAllEmpty(form.name)) {
|
||||
// 前端搜索部门名称
|
||||
newData = newData.filter(item => item.name.includes(form.name));
|
||||
}
|
||||
if (!isAllEmpty(form.status)) {
|
||||
// 前端搜索状态
|
||||
newData = newData.filter(item => item.status === form.status);
|
||||
}
|
||||
dataList.value = handleTree(newData); // 处理成树结构
|
||||
}
|
||||
if (!isAllEmpty(form.status)) {
|
||||
// 前端搜索状态
|
||||
newData = newData.filter(item => item.status === form.status);
|
||||
}
|
||||
dataList.value = handleTree(newData); // 处理成树结构
|
||||
|
||||
setTimeout(() => {
|
||||
loading.value = false;
|
||||
}, 500);
|
||||
|
||||
@@ -106,15 +106,18 @@ export function useMenu() {
|
||||
|
||||
async function onSearch() {
|
||||
loading.value = true;
|
||||
const { data } = await getMenuList(); // 这里是返回一维数组结构,前端自行处理成树结构,返回格式要求:唯一id加父节点parentId,parentId取父节点id
|
||||
let newData = data;
|
||||
if (!isAllEmpty(form.title)) {
|
||||
// 前端搜索菜单名称
|
||||
newData = newData.filter(item =>
|
||||
transformI18n(item.title).includes(form.title)
|
||||
);
|
||||
const { code, data } = await getMenuList(); // 这里是返回一维数组结构,前端自行处理成树结构,返回格式要求:唯一id加父节点parentId,parentId取父节点id
|
||||
if (code === 0) {
|
||||
let newData = data;
|
||||
if (!isAllEmpty(form.title)) {
|
||||
// 前端搜索菜单名称
|
||||
newData = newData.filter(item =>
|
||||
transformI18n(item.title).includes(form.title)
|
||||
);
|
||||
}
|
||||
dataList.value = handleTree(newData); // 处理成树结构
|
||||
}
|
||||
dataList.value = handleTree(newData); // 处理成树结构
|
||||
|
||||
setTimeout(() => {
|
||||
loading.value = false;
|
||||
}, 500);
|
||||
|
||||
@@ -163,11 +163,13 @@ export function useRole(treeRef: Ref) {
|
||||
|
||||
async function onSearch() {
|
||||
loading.value = true;
|
||||
const { data } = await getRoleList(toRaw(form));
|
||||
dataList.value = data.list;
|
||||
pagination.total = data.total;
|
||||
pagination.pageSize = data.pageSize;
|
||||
pagination.currentPage = data.currentPage;
|
||||
const { code, data } = await getRoleList(toRaw(form));
|
||||
if (code === 0) {
|
||||
dataList.value = data.list;
|
||||
pagination.total = data.total;
|
||||
pagination.pageSize = data.pageSize;
|
||||
pagination.currentPage = data.currentPage;
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
loading.value = false;
|
||||
@@ -229,8 +231,10 @@ export function useRole(treeRef: Ref) {
|
||||
if (id) {
|
||||
curRow.value = row;
|
||||
isShow.value = true;
|
||||
const { data } = await getRoleMenuIds({ id });
|
||||
treeRef.value.setCheckedKeys(data);
|
||||
const { code, data } = await getRoleMenuIds({ id });
|
||||
if (code === 0) {
|
||||
treeRef.value.setCheckedKeys(data);
|
||||
}
|
||||
} else {
|
||||
curRow.value = null;
|
||||
isShow.value = false;
|
||||
@@ -268,9 +272,11 @@ export function useRole(treeRef: Ref) {
|
||||
|
||||
onMounted(async () => {
|
||||
onSearch();
|
||||
const { data } = await getRoleMenu();
|
||||
treeIds.value = getKeyList(data, "id");
|
||||
treeData.value = handleTree(data);
|
||||
const { code, data } = await getRoleMenu();
|
||||
if (code === 0) {
|
||||
treeIds.value = getKeyList(data, "id");
|
||||
treeData.value = handleTree(data);
|
||||
}
|
||||
});
|
||||
|
||||
watch(isExpandAll, val => {
|
||||
|
||||
@@ -272,11 +272,13 @@ export function useUser(tableRef: Ref, treeRef: Ref) {
|
||||
|
||||
async function onSearch() {
|
||||
loading.value = true;
|
||||
const { data } = await getUserList(toRaw(form));
|
||||
dataList.value = data.list;
|
||||
pagination.total = data.total;
|
||||
pagination.pageSize = data.pageSize;
|
||||
pagination.currentPage = data.currentPage;
|
||||
const { code, data } = await getUserList(toRaw(form));
|
||||
if (code === 0) {
|
||||
dataList.value = data.list;
|
||||
pagination.total = data.total;
|
||||
pagination.pageSize = data.pageSize;
|
||||
pagination.currentPage = data.currentPage;
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
loading.value = false;
|
||||
@@ -497,13 +499,16 @@ export function useUser(tableRef: Ref, treeRef: Ref) {
|
||||
onSearch();
|
||||
|
||||
// 归属部门
|
||||
const { data } = await getDeptList();
|
||||
higherDeptOptions.value = handleTree(data);
|
||||
treeData.value = handleTree(data);
|
||||
const { code, data } = await getDeptList();
|
||||
if (code === 0) {
|
||||
higherDeptOptions.value = handleTree(data);
|
||||
treeData.value = handleTree(data);
|
||||
}
|
||||
|
||||
treeLoading.value = false;
|
||||
|
||||
// 角色列表
|
||||
roleOptions.value = (await getAllRoleList()).data;
|
||||
roleOptions.value = (await getAllRoleList()).data ?? [];
|
||||
});
|
||||
|
||||
return {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { ref, computed } from "vue";
|
||||
import { tableDataDrag } from "../data";
|
||||
import { message } from "@/utils/message";
|
||||
import { templateRef } from "@vueuse/core";
|
||||
import { ref, computed, useTemplateRef } from "vue";
|
||||
import { clone, useDark, useECharts } from "@pureadmin/utils";
|
||||
|
||||
export function useColumns() {
|
||||
@@ -31,7 +30,7 @@ export function useColumns() {
|
||||
const theme = computed(() => (isDark.value ? "dark" : "light"));
|
||||
|
||||
dataList.value.forEach((_, i) => {
|
||||
const { setOptions } = useECharts(templateRef(`PieChartRef${i}`), {
|
||||
const { setOptions } = useECharts(useTemplateRef(`PieChartRef${i}`), {
|
||||
theme
|
||||
});
|
||||
|
||||
|
||||
@@ -102,7 +102,6 @@ function onCloseTags() {
|
||||
default-expand-all
|
||||
:props="{
|
||||
label: data => transformI18n(data.meta.title),
|
||||
value: 'uniqueId',
|
||||
children: 'children',
|
||||
disabled: 'disabled'
|
||||
}"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, nextTick, ref, toRef, watch } from "vue";
|
||||
import { TransitionPresets, executeTransition } from "@vueuse/core";
|
||||
import { TransitionPresets, transition } from "@vueuse/core";
|
||||
import {
|
||||
Position,
|
||||
BaseEdge,
|
||||
@@ -153,7 +153,7 @@ async function runAnimation() {
|
||||
currentLength.value = totalLength;
|
||||
}
|
||||
|
||||
await executeTransition(edgePoint, from, totalLength, {
|
||||
await transition(edgePoint, from, totalLength, {
|
||||
transition: TransitionPresets.easeInOutCubic,
|
||||
duration: Math.max(1500, totalLength / 2),
|
||||
abort: () => !isAnimating.value
|
||||
|
||||
Reference in New Issue
Block a user