update 依赖升级

This commit is contained in:
ahao 2023-12-14 10:41:09 +08:00
parent 856c5f4ef2
commit 498e71f8b6
14 changed files with 85 additions and 46 deletions

1
.gitignore vendored
View File

@ -22,6 +22,7 @@ selenium-debug.log
package-lock.json package-lock.json
yarn.lock yarn.lock
pnpm-lock.yaml
# 编译生成的文件 # 编译生成的文件
auto-imports.d.ts auto-imports.d.ts

View File

@ -20,7 +20,7 @@ export function getConfig(configId: string | number): AxiosPromise<ConfigVO> {
} }
// 根据参数键名查询参数值 // 根据参数键名查询参数值
export function getConfigKey(configKey: string): AxiosPromise<String> { export function getConfigKey(configKey: string): AxiosPromise<string> {
return request({ return request({
url: '/system/config/configKey/' + configKey, url: '/system/config/configKey/' + configKey,
method: 'get' method: 'get'

View File

@ -2,16 +2,20 @@
<div> <div>
<template v-for="(item, index) in options"> <template v-for="(item, index) in options">
<template v-if="values.includes(item.value)"> <template v-if="values.includes(item.value)">
<span v-if="(item.elTagType === 'default' || item.elTagType === '') && (item.elTagClass === '' || item.elTagClass == null)" <span
:key="item.value" :index="index" :class="item.elTagClass"> v-if="(item.elTagType === 'default' || item.elTagType === '') && (item.elTagClass === '' || item.elTagClass == null)"
{{ item.label + " " }} :key="item.value"
:index="index"
:class="item.elTagClass"
>
{{ item.label + ' ' }}
</span> </span>
<el-tag <el-tag
v-else v-else
:key="item.value + ''" :key="item.value + ''"
:disable-transitions="true" :disable-transitions="true"
:index="index" :index="index"
:type="(item.elTagType === 'primary' || item.elTagType === 'default')? '' : item.elTagType" :type="item.elTagType === 'primary' || item.elTagType === 'default' ? '' : item.elTagType"
:class="item.elTagClass" :class="item.elTagClass"
> >
{{ item.label + ' ' }} {{ item.label + ' ' }}

View File

@ -1,6 +1,6 @@
import { createApp } from 'vue'; import { createApp } from 'vue';
// global css // global css
import 'uno.css'; import 'virtual:uno.css';
import '@/assets/styles/index.scss'; import '@/assets/styles/index.scss';
import 'element-plus/theme-chalk/dark/css-vars.css'; import 'element-plus/theme-chalk/dark/css-vars.css';

View File

@ -61,10 +61,10 @@
</template> </template>
<script setup name="Online" lang="ts"> <script setup name="Online" lang="ts">
import { forceLogout, list as initData } from "@/api/monitor/online"; import { forceLogout, list as initData } from '@/api/monitor/online';
import { OnlineQuery, OnlineVO } from "@/api/monitor/online/types"; import { OnlineQuery, OnlineVO } from '@/api/monitor/online/types';
import api from "@/api/system/user"; import api from '@/api/system/user';
import {to} from "await-to-js"; import { to } from 'await-to-js';
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { sys_device_type } = toRefs<any>(proxy?.useDict('sys_device_type')); const { sys_device_type } = toRefs<any>(proxy?.useDict('sys_device_type'));
@ -106,9 +106,9 @@ const handleForceLogout = async (row: OnlineVO) => {
if (!err) { if (!err) {
await forceLogout(row.tokenId); await forceLogout(row.tokenId);
await getList(); await getList();
proxy?.$modal.msgSuccess("删除成功"); proxy?.$modal.msgSuccess('删除成功');
} }
} };
onMounted(() => { onMounted(() => {
getList(); getList();

View File

@ -49,8 +49,16 @@
<el-table-column v-if="false" label="字典编码" align="center" prop="dictCode" /> <el-table-column v-if="false" label="字典编码" align="center" prop="dictCode" />
<el-table-column label="字典标签" align="center" prop="dictLabel"> <el-table-column label="字典标签" align="center" prop="dictLabel">
<template #default="scope"> <template #default="scope">
<span v-if="(scope.row.listClass === '' || scope.row.listClass === 'default') && (scope.row.cssClass === '' || scope.row.cssClass == null)">{{ scope.row.dictLabel }}</span> <span
<el-tag v-else :type="(scope.row.listClass === 'primary' || scope.row.listClass === 'default') ? '' : scope.row.listClass" :class="scope.row.cssClass">{{ scope.row.dictLabel }}</el-tag> v-if="(scope.row.listClass === '' || scope.row.listClass === 'default') && (scope.row.cssClass === '' || scope.row.cssClass == null)"
>{{ scope.row.dictLabel }}</span
>
<el-tag
v-else
:type="scope.row.listClass === 'primary' || scope.row.listClass === 'default' ? '' : scope.row.listClass"
:class="scope.row.cssClass"
>{{ scope.row.dictLabel }}</el-tag
>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="字典键值" align="center" prop="dictValue" /> <el-table-column label="字典键值" align="center" prop="dictValue" />

View File

@ -29,13 +29,15 @@
<template #header> <template #header>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:ossConfig:add']">新增</el-button> <el-button v-hasPermi="['system:ossConfig:add']" type="primary" plain icon="Plus" @click="handleAdd">新增</el-button>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['system:ossConfig:edit']">修改</el-button> <el-button v-hasPermi="['system:ossConfig:edit']" type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()"
>修改</el-button
>
</el-col> </el-col>
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['system:ossConfig:remove']"> <el-button v-hasPermi="['system:ossConfig:remove']" type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()">
删除 删除
</el-button> </el-button>
</el-col> </el-col>
@ -67,10 +69,10 @@
<el-table-column label="操作" fixed="right" align="center" width="150" class-name="small-padding"> <el-table-column label="操作" fixed="right" align="center" width="150" class-name="small-padding">
<template #default="scope"> <template #default="scope">
<el-tooltip content="修改" placement="top"> <el-tooltip content="修改" placement="top">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:ossConfig:edit']"></el-button> <el-button v-hasPermi="['system:ossConfig:edit']" link type="primary" icon="Edit" @click="handleUpdate(scope.row)"></el-button>
</el-tooltip> </el-tooltip>
<el-tooltip content="删除" placement="top"> <el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:ossConfig:remove']"></el-button> <el-button v-hasPermi="['system:ossConfig:remove']" link type="primary" icon="Delete" @click="handleDelete(scope.row)"></el-button>
</el-tooltip> </el-tooltip>
</template> </template>
</el-table-column> </el-table-column>

View File

@ -1,7 +1,7 @@
<template> <template>
<div class="user-info-head" @click="editCropper()"> <div class="user-info-head" @click="editCropper()">
<img :src="options.img" title="点击上传头像" class="img-circle img-lg" /> <img :src="options.img" title="点击上传头像" class="img-circle img-lg" />
<el-dialog :title="title" v-model="open" width="800px" append-to-body @opened="modalOpened" @close="closeDialog"> <el-dialog v-model="open" :title="title" width="800px" append-to-body @opened="modalOpened" @close="closeDialog">
<el-row> <el-row>
<el-col :xs="24" :md="12" :style="{ height: '350px' }"> <el-col :xs="24" :md="12" :style="{ height: '350px' }">
<vue-cropper <vue-cropper
@ -60,6 +60,7 @@ import 'vue-cropper/dist/index.css';
import { VueCropper } from 'vue-cropper'; import { VueCropper } from 'vue-cropper';
import { uploadAvatar } from '@/api/system/user'; import { uploadAvatar } from '@/api/system/user';
import useUserStore from '@/store/modules/user'; import useUserStore from '@/store/modules/user';
import { UploadRawFile } from 'element-plus';
interface Options { interface Options {
img: string | any; // img: string | any; //
@ -118,7 +119,7 @@ const changeScale = (num: number) => {
cropper.value.changeScale(num); cropper.value.changeScale(num);
}; };
/** 上传预处理 */ /** 上传预处理 */
const beforeUpload = (file: any) => { const beforeUpload = (file: UploadRawFile): any => {
if (file.type.indexOf('image/') == -1) { if (file.type.indexOf('image/') == -1) {
proxy?.$modal.msgError('文件格式错误,请上传图片类型,如JPGPNG后缀的文件。'); proxy?.$modal.msgError('文件格式错误,请上传图片类型,如JPGPNG后缀的文件。');
} else { } else {
@ -138,8 +139,8 @@ const uploadImg = async () => {
const res = await uploadAvatar(formData); const res = await uploadAvatar(formData);
open.value = false; open.value = false;
options.img = res.data.imgUrl; options.img = res.data.imgUrl;
userStore.setAvatar(options.img as string) userStore.setAvatar(options.img);
proxy?.$modal.msgSuccess("修改成功"); proxy?.$modal.msgSuccess('修改成功');
visible.value = false; visible.value = false;
}); });
}; };

View File

@ -97,9 +97,9 @@
<el-tabs v-model="preview.activeName"> <el-tabs v-model="preview.activeName">
<el-tab-pane <el-tab-pane
v-for="(value, key) in preview.data" v-for="(value, key) in preview.data"
:key="value"
:label="key.substring(key.lastIndexOf('/') + 1, key.indexOf('.vm'))" :label="key.substring(key.lastIndexOf('/') + 1, key.indexOf('.vm'))"
:name="key.substring(key.lastIndexOf('/') + 1, key.indexOf('.vm'))" :name="key.substring(key.lastIndexOf('/') + 1, key.indexOf('.vm'))"
:key="value"
> >
<el-link v-copyText="value" v-copyText:callback="copyTextSuccess" :underline="false" icon="DocumentCopy" style="float: right"> <el-link v-copyText="value" v-copyText:callback="copyTextSuccess" :underline="false" icon="DocumentCopy" style="float: right">
&nbsp;复制 &nbsp;复制

33
uno.config.ts Normal file
View File

@ -0,0 +1,33 @@
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()]
});

View File

@ -64,11 +64,8 @@ export default defineConfig(({ mode, command }: ConfigEnv): UserConfig => {
'@vueuse/core', '@vueuse/core',
'path-to-regexp', 'path-to-regexp',
'echarts', 'echarts',
'@wangeditor/editor',
'@wangeditor/editor-for-vue',
'vue-i18n', 'vue-i18n',
'@vueup/vue-quill', '@vueup/vue-quill',
'@iconify/iconify',
'element-plus/es/components/form/style/css', 'element-plus/es/components/form/style/css',
'element-plus/es/components/form-item/style/css', 'element-plus/es/components/form-item/style/css',

View File

@ -1,6 +1,6 @@
import compression from 'vite-plugin-compression'; import compression from 'vite-plugin-compression';
export default function createCompression(env: any) { export default (env: any) => {
const { VITE_BUILD_COMPRESS } = env; const { VITE_BUILD_COMPRESS } = env;
const plugin: any[] = []; const plugin: any[] = [];
if (VITE_BUILD_COMPRESS) { if (VITE_BUILD_COMPRESS) {
@ -25,4 +25,4 @@ export default function createCompression(env: any) {
} }
} }
return plugin; return plugin;
} };

View File

@ -9,14 +9,14 @@ import createSetupExtend from './setup-extend';
import path from 'path'; import path from 'path';
export default (viteEnv: any, isBuild = false): [] => { export default (viteEnv: any, isBuild = false): [] => {
const vitePlusgins: any = []; const vitePlugins: any = [];
vitePlusgins.push(vue()); vitePlugins.push(vue());
vitePlusgins.push(createUnoCss()); vitePlugins.push(createUnoCss());
vitePlusgins.push(createAutoImport(path)); vitePlugins.push(createAutoImport(path));
vitePlusgins.push(createComponents(path)); vitePlugins.push(createComponents(path));
vitePlusgins.push(createCompression(viteEnv)); vitePlugins.push(createCompression(viteEnv));
vitePlusgins.push(createIcons()); vitePlugins.push(createIcons());
vitePlusgins.push(createSvgIconsPlugin(path, isBuild)); vitePlugins.push(createSvgIconsPlugin(path, isBuild));
vitePlusgins.push(createSetupExtend()); vitePlugins.push(createSetupExtend());
return vitePlusgins; return vitePlugins;
}; };

View File

@ -1,14 +1,7 @@
import UnoCss from 'unocss/vite'; import UnoCss from 'unocss/vite';
import { presetUno, presetAttributify, presetIcons } from 'unocss';
export default () => { export default () => {
return UnoCss({ 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低版本浏览器是不支持的启动后会报错 hmrTopLevelAwait: false // unocss默认是true低版本浏览器是不支持的启动后会报错
}); });
}; };