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
yarn.lock
pnpm-lock.yaml
# 编译生成的文件
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({
url: '/system/config/configKey/' + configKey,
method: 'get'

View File

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

View File

@ -1,6 +1,6 @@
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';

View File

@ -61,10 +61,10 @@
</template>
<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";
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;
const { sys_device_type } = toRefs<any>(proxy?.useDict('sys_device_type'));
@ -106,9 +106,9 @@ const handleForceLogout = async (row: OnlineVO) => {
if (!err) {
await forceLogout(row.tokenId);
await getList();
proxy?.$modal.msgSuccess("删除成功");
}
proxy?.$modal.msgSuccess('删除成功');
}
};
onMounted(() => {
getList();

View File

@ -49,8 +49,16 @@
<el-table-column v-if="false" label="字典编码" align="center" prop="dictCode" />
<el-table-column label="字典标签" align="center" prop="dictLabel">
<template #default="scope">
<span 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>
<span
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>
</el-table-column>
<el-table-column label="字典键值" align="center" prop="dictValue" />

View File

@ -29,13 +29,15 @@
<template #header>
<el-row :gutter="10" class="mb8">
<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 :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 :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-col>
@ -67,10 +69,10 @@
<el-table-column label="操作" fixed="right" align="center" width="150" class-name="small-padding">
<template #default="scope">
<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 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>
</template>
</el-table-column>

View File

@ -1,7 +1,7 @@
<template>
<div class="user-info-head" @click="editCropper()">
<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-col :xs="24" :md="12" :style="{ height: '350px' }">
<vue-cropper
@ -60,6 +60,7 @@ import 'vue-cropper/dist/index.css';
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; //
@ -118,7 +119,7 @@ const changeScale = (num: number) => {
cropper.value.changeScale(num);
};
/** 上传预处理 */
const beforeUpload = (file: any) => {
const beforeUpload = (file: UploadRawFile): any => {
if (file.type.indexOf('image/') == -1) {
proxy?.$modal.msgError('文件格式错误,请上传图片类型,如JPGPNG后缀的文件。');
} else {
@ -138,8 +139,8 @@ const uploadImg = async () => {
const res = await uploadAvatar(formData);
open.value = false;
options.img = res.data.imgUrl;
userStore.setAvatar(options.img as string)
proxy?.$modal.msgSuccess("修改成功");
userStore.setAvatar(options.img);
proxy?.$modal.msgSuccess('修改成功');
visible.value = false;
});
};

View File

@ -97,9 +97,9 @@
<el-tabs v-model="preview.activeName">
<el-tab-pane
v-for="(value, key) in preview.data"
:key="value"
:label="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">
&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',
'path-to-regexp',
'echarts',
'@wangeditor/editor',
'@wangeditor/editor-for-vue',
'vue-i18n',
'@vueup/vue-quill',
'@iconify/iconify',
'element-plus/es/components/form/style/css',
'element-plus/es/components/form-item/style/css',

View File

@ -1,6 +1,6 @@
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) {
@ -25,4 +25,4 @@ export default function createCompression(env: any) {
}
}
return plugin;
}
};

View File

@ -9,14 +9,14 @@ import createSetupExtend from './setup-extend';
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;
};

View File

@ -1,14 +1,7 @@
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低版本浏览器是不支持的启动后会报错
});
};