!69 修复升级依赖带来的类型问题
* fix 修复变量问题
* Merge remote-tracking branch 'origin/dev' into dev
* update 依赖升级
* update 依赖升级
* Merge remote-tracking branch 'origin/dev' into dev
* 升级依赖
* Merge remote-tracking branch 'origin/ts' into ts
* 升级依赖
* Merge branch 'dev' of gitee.com:JavaLionLi/plus-ui into ts
* 升级依赖
* !61 fix: 删除重复环境变量ElUploadInstance
* fix: 删除重复环境变量ElUploadInstance
| | |
| | | rules: { |
| | | '@typescript-eslint/no-empty-function': 'off', |
| | | '@typescript-eslint/no-explicit-any': 'off', |
| | | '@typescript-eslint/no-unused-vars': 'off', |
| | | '@typescript-eslint/no-this-alias': 'off', |
| | | |
| | | // vue |
| | | 'vue/multi-word-component-names': 'off', |
| | |
| | | |
| | | package-lock.json |
| | | yarn.lock |
| | | pnpm-lock.yaml |
| | | |
| | | # ç¼è¯çæçæä»¶ |
| | | auto-imports.d.ts |
| | |
| | | } |
| | | return name.trim() === 'Index'; |
| | | }; |
| | | const handleLink = (item: RouteLocationMatched) => { |
| | | const handleLink = (item) => { |
| | | const { redirect, path } = item; |
| | | redirect ? router.push(redirect as string) : router.push(path); |
| | | redirect ? router.push(redirect) : router.push(path); |
| | | }; |
| | | |
| | | watchEffect(() => { |
| | |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { QuillEditor, Quill } from '@vueup/vue-quill'; |
| | | import '@vueup/vue-quill/dist/vue-quill.snow.css'; |
| | | |
| | | import { QuillEditor, Quill } from '@vueup/vue-quill'; |
| | | import { propTypes } from '@/utils/propTypes'; |
| | | import { globalHeaders } from '@/utils/request'; |
| | | |
| | | defineEmits(['update:modelValue']); |
| | | |
| | | const props = defineProps({ |
| | | /* ç¼è¾å¨çå
容 */ |
| | |
| | | }); |
| | | const quillEditorRef = ref(); |
| | | |
| | | const options = ref({ |
| | | const options = ref<any>({ |
| | | theme: 'snow', |
| | | bounds: document.body, |
| | | debug: 'warn', |
| | |
| | | import { globalHeaders } from '@/utils/request'; |
| | | |
| | | const props = defineProps({ |
| | | modelValue: [String, Object, Array], |
| | | modelValue: { |
| | | type: [String, Object, Array], |
| | | default: () => [] |
| | | }, |
| | | // æ°ééå¶ |
| | | limit: propTypes.number.def(5), |
| | | // 大å°éå¶(MB) |
| | |
| | | if (val) { |
| | | let temp = 1; |
| | | // é¦å
å°å¼è½¬ä¸ºæ°ç» |
| | | let list = []; |
| | | let list: any[] = []; |
| | | if (Array.isArray(val)) { |
| | | list = val; |
| | | } else { |
| | | const res = await listByIds(val as string); |
| | | const res = await listByIds(val); |
| | | list = res.data.map((oss) => { |
| | | const data = { |
| | | name: oss.originalName, |
| | |
| | | |
| | | const realSrcList = computed(() => { |
| | | if (!props.src) { |
| | | return; |
| | | return []; |
| | | } |
| | | let real_src_list = props.src.split(','); |
| | | let srcList: string[] = []; |
| | |
| | | import { globalHeaders } from '@/utils/request'; |
| | | |
| | | const props = defineProps({ |
| | | modelValue: [String, Object, Array], |
| | | modelValue: { |
| | | type: [String, Object, Array], |
| | | default: () => [] |
| | | }, |
| | | // å¾çæ°ééå¶ |
| | | limit: propTypes.number.def(5), |
| | | // 大å°éå¶(MB) |
| | |
| | | <template> |
| | | <div :style="'height:' + height"> |
| | | <iframe :id="iframeId" style="width: 100%; height: 100%" :src="src" frameborder="no"></iframe> |
| | | <iframe :id="iframeId" style="width: 100%; height: 100%; border: 0" :src="src"></iframe> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | import { RouteRecordRaw } from 'vue-router'; |
| | | |
| | | const props = defineProps({ |
| | | // route object |
| | | item: { |
| | | type: Object as PropType<RouteRecordRaw>, |
| | | required: true |
| | |
| | | if (isExternal(routePath)) { |
| | | return routePath; |
| | | } |
| | | if (isExternal(props.basePath)) { |
| | | if (isExternal(props.basePath as string)) { |
| | | return props.basePath; |
| | | } |
| | | if (routeQuery) { |
| | |
| | | :collapse-transition="false" |
| | | mode="vertical" |
| | | > |
| | | <sidebar-item v-for="(route, index) in sidebarRouters" :key="route.path + index" :item="route" :base-path="route.path" /> |
| | | <sidebar-item v-for="(r, index) in sidebarRouters" :key="r.path + index" :item="r" :base-path="r.path" /> |
| | | </el-menu> |
| | | </transition> |
| | | </el-scrollbar> |
| | |
| | | import useSettingsStore from '@/store/modules/settings'; |
| | | import usePermissionStore from '@/store/modules/permission'; |
| | | import { RouteRecordRaw } from 'vue-router'; |
| | | const { proxy } = getCurrentInstance() as ComponentInternalInstance; |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | | |
| | | const route = useRoute(); |
| | | const appStore = useAppStore(); |
| | |
| | | <script setup lang="ts"> |
| | | import useTagsViewStore from '@/store/modules/tagsView'; |
| | | import { TagView } from 'vue-router'; |
| | | |
| | | const tagAndTagSpacing = ref(4); |
| | | |
| | | const scrollContainerRef = ref<ElScrollbarInstance>(); |
| | |
| | | scrollPaneRef.value?.moveToTarget(r); |
| | | // when query is different then update |
| | | if (r.fullPath !== route.fullPath) { |
| | | useTagsViewStore().updateVisitedView(route); |
| | | useTagsViewStore().updateVisitedView(route as any); |
| | | } |
| | | } |
| | | } |
| | |
| | | }); |
| | | }; |
| | | const closeRightTags = () => { |
| | | proxy?.$tab.closeRightPage(selectedTag.value).then((visitedViews) => { |
| | | if (!visitedViews.find((i) => i.fullPath === route.fullPath)) { |
| | | proxy?.$tab.closeRightPage(selectedTag.value).then((visitedViews: TagView[]) => { |
| | | if (!visitedViews.find((i: TagView) => i.fullPath === route.fullPath)) { |
| | | toLastView(visitedViews); |
| | | } |
| | | }); |
| | | }; |
| | | const closeLeftTags = () => { |
| | | proxy?.$tab.closeLeftPage(selectedTag.value).then((visitedViews) => { |
| | | proxy?.$tab.closeLeftPage(selectedTag.value).then((visitedViews: TagView[]) => { |
| | | if (!visitedViews.find((i: TagView) => i.fullPath === route.fullPath)) { |
| | | toLastView(visitedViews); |
| | | } |
| | |
| | | import { createApp } from 'vue'; |
| | | // global css |
| | | import 'uno.css'; |
| | | import 'virtual:uno.css'; |
| | | import '@/assets/styles/index.scss'; |
| | | import 'element-plus/theme-chalk/dark/css-vars.css'; |
| | | |
| | |
| | | import useUserStore from '@/store/modules/user'; |
| | | import useSettingsStore from '@/store/modules/settings'; |
| | | import usePermissionStore from '@/store/modules/permission'; |
| | | import { RouteRecordRaw } from 'vue-router'; |
| | | |
| | | NProgress.configure({ showSpinner: false }); |
| | | const whiteList = ['/login', '/register', '/social-callback']; |
| | |
| | | isRelogin.show = false; |
| | | const accessRoutes = await usePermissionStore().generateRoutes(); |
| | | // æ ¹æ®rolesæéçæå¯è®¿é®çè·¯ç±è¡¨ |
| | | accessRoutes.forEach((route: RouteRecordRaw) => { |
| | | accessRoutes.forEach((route) => { |
| | | if (!isHttp(route.path)) { |
| | | router.addRoute(route); // å¨ææ·»å å¯è®¿é®è·¯ç±è¡¨ |
| | | } |
| | | }); |
| | | next({ ...to, replace: true }); // hackæ¹æ³ ç¡®ä¿addRoutes已宿 |
| | | const n = { ...to, replace: true }; |
| | | console.log(n); |
| | | next({ path: to.path, replace: true, params: to.params, query: to.query, hash: to.hash, name: to.name as string }); // hackæ¹æ³ ç¡®ä¿addRoutes已宿 |
| | | } |
| | | } else { |
| | | next(); |
| | |
| | | }); |
| | | }; |
| | | |
| | | const updateVisitedView = (view: TagView | RouteLocationNormalized): void => { |
| | | const updateVisitedView = (view: TagView): void => { |
| | | for (let v of visitedViews.value) { |
| | | if (v.path === view.path) { |
| | | v = Object.assign(v, view); |
| | |
| | | }); |
| | | }; |
| | | |
| | | const addCachedView = (view: TagView | RouteLocationNormalized): void => { |
| | | const addCachedView = (view: TagView): void => { |
| | | const viewName = view.name as string; |
| | | if (!viewName) return; |
| | | if (cachedViews.value.includes(viewName)) return; |
| | |
| | | import axios from 'axios'; |
| | | |
| | | declare module 'axios' { |
| | | export interface AxiosResponse<T = any> { |
| | | interface AxiosResponse<T = any> { |
| | | code: number; |
| | | msg: string; |
| | | rows: T; |
| | |
| | | declare type ElFormInstance = ep.FormInstance; |
| | | declare type ElTableInstance = ep.TableInstance; |
| | | declare type ElUploadInstance = ep.UploadInstance; |
| | | declare type ElScrollbarInstance = ep.ScrollbarInstance; |
| | | declare type ElTreeInstance = InstanceType<typeof ep.ElTree>; |
| | | declare type ElTreeSelectInstance = InstanceType<typeof ep.ElTreeSelect>; |
| | | declare type ElSelectInstance = InstanceType<typeof ep.ElSelect>; |
| | |
| | | declare type ElColorPickerInstance = InstanceType<typeof ep.ElColorPicker>; |
| | | declare type ElRateInstance = InstanceType<typeof ep.ElRate>; |
| | | declare type ElSliderInstance = InstanceType<typeof ep.ElSlider>; |
| | | declare type ElScrollbarInstance = InstanceType<typeof ep.ElScrollbar>; |
| | | |
| | | declare type TransferKey = ep.TransferKey; |
| | | declare type CheckboxValueType = ep.CheckboxValueType; |
| | |
| | | export default Component; |
| | | } |
| | | |
| | | declare module '*.avif' { |
| | | const src: string; |
| | | export default src; |
| | | } |
| | | |
| | | declare module '*.bmp' { |
| | | const src: string; |
| | | export default src; |
| | | } |
| | | |
| | | declare module '*.gif' { |
| | | const src: string; |
| | | export default src; |
| | | } |
| | | |
| | | declare module '*.jpg' { |
| | | const src: string; |
| | | export default src; |
| | | } |
| | | |
| | | declare module '*.jpeg' { |
| | | const src: string; |
| | | export default src; |
| | | } |
| | | |
| | | declare module '*.png' { |
| | | const src: string; |
| | | export default src; |
| | | } |
| | | |
| | | declare module '*.webp' { |
| | | const src: string; |
| | | export default src; |
| | | } |
| | | |
| | | declare module '*.svg' { |
| | | const src: string; |
| | | export default src; |
| | | } |
| | | |
| | | declare module '*.module.css' { |
| | | const classes: { readonly [key: string]: string }; |
| | | export default classes; |
| | | } |
| | | |
| | | declare module '*.module.scss' { |
| | | const classes: { readonly [key: string]: string }; |
| | | export default classes; |
| | | } |
| | | |
| | | declare module '*.module.sass' { |
| | | const classes: { readonly [key: string]: string }; |
| | | export default classes; |
| | | } |
| | | // ç¯å¢åé |
| | | interface ImportMetaEnv { |
| | | VITE_APP_TITLE: string; |
| | |
| | | import type { ComponentInternalInstance as ComponentInstance, PropType as VuePropType } from 'vue/runtime-core'; |
| | | import type { ComponentInternalInstance as ComponentInstance } from 'vue/runtime-core'; |
| | | import type { PropType as VuePropType } from 'vue'; |
| | | import { LanguageEnum } from '@/enums/LanguageEnum'; |
| | | |
| | | declare global { |
| | |
| | | parseTime: typeof parseTime; |
| | | } |
| | | } |
| | | |
| | | declare module 'vform3-builds' { |
| | | const content: any; |
| | | export = content; |
| | | } |
| | |
| | | roles?: string[]; |
| | | alwaysShow?: boolean; |
| | | query?: string; |
| | | parentPath?: string; |
| | | } |
| | | |
| | | interface _RouteLocationBase { |
| | |
| | | * @returns {Array} |
| | | */ |
| | | export const cleanArray = (actual: Array<any>) => { |
| | | const newArray = []; |
| | | const newArray: any[] = []; |
| | | for (let i = 0; i < actual.length; i++) { |
| | | if (actual[i]) { |
| | | newArray.push(actual[i]); |
| | |
| | | if (value === undefined) { |
| | | return ''; |
| | | } |
| | | const actions = []; |
| | | const actions: Array<string | number> = []; |
| | | Object.keys(datas).some((key) => { |
| | | if (datas[key].value == '' + value) { |
| | | actions.push(datas[key].label); |
| | |
| | | <script setup name="Online" lang="ts"> |
| | | import { forceLogout, list as initData } from '@/api/monitor/online'; |
| | | import { OnlineQuery, OnlineVO } from '@/api/monitor/online/types'; |
| | | import api from '@/api/system/user'; |
| | | import { to } from 'await-to-js'; |
| | | |
| | | const { proxy } = getCurrentInstance() as ComponentInternalInstance; |
| | |
| | | <template> |
| | | <div class="p-2"> |
| | | <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave"> |
| | | <div class="mb-[10px]"> |
| | | <div v-show="showSearch" class="mb-[10px]"> |
| | | <el-card shadow="hover"> |
| | | <el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="68px"> |
| | | <el-form-item label="æä½å°å" prop="operIp"> |
| | |
| | | |
| | | const props = defineProps({ |
| | | roleId: { |
| | | type: [Number, String] |
| | | type: [Number, String], |
| | | required: true |
| | | } |
| | | }); |
| | | |
| | |
| | | postIds: [], |
| | | roleIds: [] |
| | | }; |
| | | const data = reactive<PageData<UserForm, UserQuery>>({ |
| | | |
| | | const initData: PageData<UserForm, UserQuery> = { |
| | | form: { ...initFormData }, |
| | | queryParams: { |
| | | pageNum: 1, |
| | |
| | | userName: '', |
| | | phonenumber: '', |
| | | status: '', |
| | | deptId: '' |
| | | deptId: '', |
| | | roleId: '' |
| | | }, |
| | | rules: { |
| | | userName: [ |
| | |
| | | } |
| | | ] |
| | | } |
| | | }); |
| | | }; |
| | | const data = reactive<PageData<UserForm, UserQuery>>(initData); |
| | | |
| | | const { queryParams, form, rules } = toRefs<PageData<UserForm, UserQuery>>(data); |
| | | |
| | |
| | | |
| | | <script lang="ts" setup> |
| | | import { authUnlock, authBinding } from '@/api/system/social/auth'; |
| | | import { PropType } from 'vue'; |
| | | import { propTypes } from '@/utils/propTypes'; |
| | | |
| | | const { proxy } = getCurrentInstance() as ComponentInternalInstance; |
| | | |
| | | const props = defineProps({ |
| | | auths: { |
| | | type: Object as PropType<any> |
| | | } |
| | | auths: propTypes.any.isRequired |
| | | }); |
| | | const auths = computed(() => props.auths); |
| | | |
| | |
| | | import { VueCropper } from 'vue-cropper'; |
| | | import { uploadAvatar } from '@/api/system/user'; |
| | | import useUserStore from '@/store/modules/user'; |
| | | import { UploadRawFile } from 'element-plus'; |
| | | |
| | | interface Options { |
| | | img: string | any; // è£åªå¾ççå°å |
| | |
| | | cropper.value.changeScale(num); |
| | | }; |
| | | /** ä¸ä¼ é¢å¤ç */ |
| | | const beforeUpload = (file: any) => { |
| | | const beforeUpload = (file: UploadRawFile): any => { |
| | | if (file.type.indexOf('image/') == -1) { |
| | | proxy?.$modal.msgError('æä»¶æ ¼å¼é误ï¼è¯·ä¸ä¼ å¾çç±»å,å¦ï¼JPGï¼PNGåç¼çæä»¶ã'); |
| | | } else { |
| | |
| | | const res = await uploadAvatar(formData); |
| | | open.value = false; |
| | | options.img = res.data.imgUrl; |
| | | userStore.setAvatar(options.img as string); |
| | | userStore.setAvatar(options.img); |
| | | proxy?.$modal.msgSuccess('ä¿®æ¹æå'); |
| | | visible.value = false; |
| | | }); |
| | |
| | | const userForm = computed(() => props.user); |
| | | const { proxy } = getCurrentInstance() as ComponentInternalInstance; |
| | | const userRef = ref<ElFormInstance>(); |
| | | const rules = ref<ElFormRules>({ |
| | | const rule: ElFormRules = { |
| | | nickName: [{ required: true, message: 'ç¨æ·æµç§°ä¸è½ä¸ºç©º', trigger: 'blur' }], |
| | | email: [ |
| | | { required: true, message: 'é®ç®±å°åä¸è½ä¸ºç©º', trigger: 'blur' }, |
| | |
| | | }, |
| | | { pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, message: '请è¾å
¥æ£ç¡®çææºå·ç ', trigger: 'blur' } |
| | | ] |
| | | }); |
| | | }; |
| | | const rules = ref<ElFormRules>(rule); |
| | | |
| | | /** æäº¤æé® */ |
| | | const submit = () => { |
| | |
| | | interface MenuOptionsType { |
| | | menuId: number | string; |
| | | menuName: string; |
| | | children: MenuOptionsType[] | undefined; |
| | | children?: MenuOptionsType[]; |
| | | } |
| | | const { proxy } = getCurrentInstance(); |
| | | |
| | | const subColumns = ref<any>([]); |
| | | const menuOptions = ref<Array<MenuOptionsType>>([]); |
| | | const { proxy } = getCurrentInstance(); |
| | | |
| | | const props = defineProps({ |
| | | info: propTypes.any.def(null), |
| | | tables: propTypes.any.def(null) |
| | | info: propTypes.any.isRequired, |
| | | tables: propTypes.any.isRequired |
| | | }); |
| | | |
| | | const infoForm = computed(() => props.info); |
| | |
| | | const res = await listMenu(); |
| | | res.data.forEach((m) => (m.menuId = m.menuId.toString())); |
| | | const data = proxy?.handleTree<MenuOptionsType>(res.data, 'menuId'); |
| | | |
| | | if (data) { |
| | | menuOptions.value = data; |
| | | } |
| | |
| | | "compilerOptions": { |
| | | "target": "esnext", |
| | | "module": "esnext", |
| | | "useDefineForClassFields": true, |
| | | "moduleResolution": "node", |
| | | // "useDefineForClassFields": true, |
| | | "moduleResolution": "bundler", |
| | | "strict": true, |
| | | "jsx": "preserve", |
| | | "sourceMap": true, |
| | | "resolveJsonModule": true, |
| | | "esModuleInterop": true, |
| | | "strictFunctionTypes": false, |
| | | "lib": ["esnext", "dom"], |
| | | "noImplicitAny": false, |
| | | "baseUrl": ".", |
| | | "allowJs": true, |
| | | "experimentalDecorators": true, |
| | | "paths": { |
| | | "@/*": ["src/*"] |
| | | }, |
| | | "types": ["vite/client"], |
| | | "skipLibCheck": true, |
| | | "removeComments": true, |
| | | // å
许é»è®¤å¯¼å
¥ |
| | | "allowSyntheticDefaultImports": true, |
| | | "forceConsistentCasingInFileNames": true |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { |
| | | defineConfig, |
| | | presetAttributify, |
| | | presetIcons, |
| | | presetTypography, |
| | | presetUno, |
| | | presetWebFonts, |
| | | transformerDirectives, |
| | | transformerVariantGroup |
| | | } from 'unocss'; |
| | | |
| | | export default defineConfig({ |
| | | shortcuts: { |
| | | 'panel-title': |
| | | 'pb-[5px] font-sans leading-[1.1] font-medium text-base text-[#6379bb] border-b border-b-solid border-[var(--el-border-color-light)] mb-5 mt-0' |
| | | }, |
| | | theme: { |
| | | colors: { |
| | | primary: 'var(--el-color-primary)', |
| | | primary_dark: 'var(--el-color-primary-light-5)' |
| | | } |
| | | }, |
| | | presets: [ |
| | | presetUno(), |
| | | presetAttributify(), |
| | | presetIcons(), |
| | | presetTypography(), |
| | | presetWebFonts({ |
| | | fonts: {} |
| | | }) |
| | | ], |
| | | transformers: [transformerDirectives(), transformerVariantGroup()] |
| | | }); |
| | |
| | | import compression from 'vite-plugin-compression'; |
| | | |
| | | export default function createCompression(env: any) { |
| | | export default (env: any) => { |
| | | const { VITE_BUILD_COMPRESS } = env; |
| | | const plugin: any[] = []; |
| | | if (VITE_BUILD_COMPRESS) { |
| | |
| | | } |
| | | } |
| | | return plugin; |
| | | } |
| | | }; |
| | |
| | | import path from 'path'; |
| | | |
| | | export default (viteEnv: any, isBuild = false): [] => { |
| | | const vitePlusgins: any = []; |
| | | vitePlusgins.push(vue()); |
| | | vitePlusgins.push(createUnoCss()); |
| | | vitePlusgins.push(createAutoImport(path)); |
| | | vitePlusgins.push(createComponents(path)); |
| | | vitePlusgins.push(createCompression(viteEnv)); |
| | | vitePlusgins.push(createIcons()); |
| | | vitePlusgins.push(createSvgIconsPlugin(path, isBuild)); |
| | | vitePlusgins.push(createSetupExtend()); |
| | | return vitePlusgins; |
| | | const vitePlugins: any = []; |
| | | vitePlugins.push(vue()); |
| | | vitePlugins.push(createUnoCss()); |
| | | vitePlugins.push(createAutoImport(path)); |
| | | vitePlugins.push(createComponents(path)); |
| | | vitePlugins.push(createCompression(viteEnv)); |
| | | vitePlugins.push(createIcons()); |
| | | vitePlugins.push(createSvgIconsPlugin(path, isBuild)); |
| | | vitePlugins.push(createSetupExtend()); |
| | | return vitePlugins; |
| | | }; |
| | |
| | | import UnoCss from 'unocss/vite'; |
| | | import { presetUno, presetAttributify, presetIcons } from 'unocss'; |
| | | |
| | | export default () => { |
| | | return UnoCss({ |
| | | presets: [presetUno(), presetAttributify(), presetIcons()], |
| | | // rules: [['search', {}]], |
| | | shortcuts: { |
| | | 'panel-title': |
| | | 'pb-[5px] font-sans leading-[1.1] font-medium text-base text-[#6379bb] border-b border-b-solid border-[var(--el-border-color-light)] mb-5 mt-0' |
| | | }, |
| | | hmrTopLevelAwait: false // unocssé»è®¤æ¯trueï¼ä½çæ¬æµè§å¨æ¯ä¸æ¯æçï¼å¯å¨å伿¥é |
| | | }); |
| | | }; |