Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	src/layout/components/Sidebar/index.vue
#	src/permission.ts
#	src/types/element.d.ts
#	src/types/global.d.ts
#	tsconfig.json
This commit is contained in:
ahao 2023-12-26 18:00:17 +08:00
commit 40cf0128d8
12 changed files with 37 additions and 38 deletions

View File

@ -26,5 +26,5 @@ VITE_APP_RSA_PRIVATE_KEY = 'MIIBVAIBADANBgkqhkiG9w0BAQEFAASCAT4wggE6AgEAAkEAmc3C
# 客户端id # 客户端id
VITE_APP_CLIENT_ID = 'e5cd7e4891bf95d1d19206ce24a7b32e' VITE_APP_CLIENT_ID = 'e5cd7e4891bf95d1d19206ce24a7b32e'
# websocket 开关(开发环境默认关闭ws 因vite的bug导致如ws无法连接则会崩溃) # websocket 开关
VITE_APP_WEBSOCKET = false VITE_APP_WEBSOCKET = true

View File

@ -1,6 +1,6 @@
{ {
"name": "ruoyi-vue-plus", "name": "ruoyi-vue-plus",
"version": "5.1.1", "version": "5.1.2",
"description": "RuoYi-Vue-Plus多租户管理系统", "description": "RuoYi-Vue-Plus多租户管理系统",
"author": "LionLi", "author": "LionLi",
"license": "MIT", "license": "MIT",
@ -23,10 +23,10 @@
"@vueuse/core": "10.7.0", "@vueuse/core": "10.7.0",
"animate.css": "4.1.1", "animate.css": "4.1.1",
"await-to-js": "^3.0.0", "await-to-js": "^3.0.0",
"axios": "^1.3.4", "axios": "^1.6.0",
"crypto-js": "^4.1.1", "crypto-js": "^4.2.0",
"echarts": "5.4.3", "echarts": "5.4.3",
"element-plus": "2.4.3", "element-plus": "2.4.4",
"file-saver": "2.0.5", "file-saver": "2.0.5",
"fuse.js": "6.6.2", "fuse.js": "6.6.2",
"js-cookie": "3.0.5", "js-cookie": "3.0.5",
@ -37,7 +37,7 @@
"pinia": "2.1.7", "pinia": "2.1.7",
"screenfull": "6.0.0", "screenfull": "6.0.0",
"vform3-builds": "3.0.8", "vform3-builds": "3.0.8",
"vue": "3.3.11", "vue": "3.3.13",
"vue-cropper": "1.1.1", "vue-cropper": "1.1.1",
"vue-i18n": "9.2.2", "vue-i18n": "9.2.2",
"vue-router": "4.2.5", "vue-router": "4.2.5",
@ -46,9 +46,9 @@
"devDependencies": { "devDependencies": {
"@iconify/json": "^2.2.157", "@iconify/json": "^2.2.157",
"@intlify/unplugin-vue-i18n": "1.6.0", "@intlify/unplugin-vue-i18n": "1.6.0",
"@types/crypto-js": "^4.1.1", "@types/crypto-js": "^4.2.0",
"@types/file-saver": "2.0.5", "@types/file-saver": "2.0.5",
"@types/js-cookie": "3.0.3", "@types/js-cookie": "3.0.5",
"@types/node": "18.14.2", "@types/node": "18.14.2",
"@types/nprogress": "0.2.0", "@types/nprogress": "0.2.0",
"@types/path-browserify": "^1.0.0", "@types/path-browserify": "^1.0.0",
@ -74,7 +74,7 @@
"postcss": "^8.4.21", "postcss": "^8.4.21",
"prettier": "3.1.1", "prettier": "3.1.1",
"sass": "1.69.5", "sass": "1.69.5",
"typescript": "5.2.2", "typescript": "5.3.3",
"unocss": "^0.58.0", "unocss": "^0.58.0",
"unplugin-auto-import": "0.17.2", "unplugin-auto-import": "0.17.2",
"unplugin-icons": "0.18.1", "unplugin-icons": "0.18.1",
@ -85,6 +85,6 @@
"vitest": "^0.29.7", "vitest": "^0.29.7",
"vue-eslint-parser": "9.3.2", "vue-eslint-parser": "9.3.2",
"vue-tsc": "0.35.0", "vue-tsc": "0.35.0",
"vite": "5.0.4" "vite": "5.0.5"
} }
} }

View File

@ -64,12 +64,12 @@ export const delClient = (id: string | number | Array<string | number>) => {
/** /**
* *
* @param id ID * @param clientId id
* @param status * @param status
*/ */
export function changeStatus(id: number | string, status: string) { export function changeStatus(clientId: string, status: string) {
const data = { const data = {
id, clientId,
status status
}; };
return request({ return request({

View File

@ -7,7 +7,7 @@ export interface ClientVO {
/** /**
* id * id
*/ */
clientId: string | number; clientId: string;
/** /**
* key * key

View File

@ -13,7 +13,7 @@
:collapse-transition="false" :collapse-transition="false"
mode="vertical" mode="vertical"
> >
<sidebar-item v-for="(r, index) in sidebarRouters" :key="r.path + index" :item="r" :base-path="r.path" /> <sidebar-item v-for="(route, index) in sidebarRouters" :key="route.path + index" :item="route" :base-path="route.path" />
</el-menu> </el-menu>
</transition> </transition>
</el-scrollbar> </el-scrollbar>
@ -35,7 +35,7 @@ const route = useRoute();
const appStore = useAppStore(); const appStore = useAppStore();
const settingsStore = useSettingsStore(); const settingsStore = useSettingsStore();
const permissionStore = usePermissionStore(); const permissionStore = usePermissionStore();
const sidebarRouters = computed<RouteRecordRaw[]>(() => permissionStore.sidebarRouters as any); const sidebarRouters = computed<RouteRecordRaw[]>(() => permissionStore.sidebarRouters);
const showLogo = computed(() => settingsStore.sidebarLogo); const showLogo = computed(() => settingsStore.sidebarLogo);
const sideTheme = computed(() => settingsStore.sideTheme); const sideTheme = computed(() => settingsStore.sideTheme);
const theme = computed(() => settingsStore.theme); const theme = computed(() => settingsStore.theme);

View File

@ -26,6 +26,7 @@ import SideBar from './components/Sidebar/index.vue';
import { AppMain, Navbar, Settings, TagsView } from './components'; import { AppMain, Navbar, Settings, TagsView } from './components';
import useAppStore from '@/store/modules/app'; import useAppStore from '@/store/modules/app';
import useSettingsStore from '@/store/modules/settings'; import useSettingsStore from '@/store/modules/settings';
import { initWebSocket } from '@/utils/websocket';
const settingsStore = useSettingsStore(); const settingsStore = useSettingsStore();
const theme = computed(() => settingsStore.theme); const theme = computed(() => settingsStore.theme);
@ -65,6 +66,11 @@ onMounted(() => {
}); });
}); });
onMounted(() => {
let protocol = window.location.protocol === 'https:' ? 'wss://' : 'ws://';
initWebSocket(protocol + window.location.host + import.meta.env.VITE_APP_BASE_API + '/resource/websocket');
});
const handleClickOutside = () => { const handleClickOutside = () => {
useAppStore().closeSideBar({ withoutAnimation: false }); useAppStore().closeSideBar({ withoutAnimation: false });
}; };

View File

@ -16,11 +16,6 @@ declare global {
declare type ElColorPickerInstance = ep.ColorPickerInstance; declare type ElColorPickerInstance = ep.ColorPickerInstance;
declare type ElRateInstance = ep.RateInstance; declare type ElRateInstance = ep.RateInstance;
declare type ElSliderInstance = ep.SliderInstance; declare type ElSliderInstance = ep.SliderInstance;
declare type TransferKey = ep.TransferKey;
declare type CheckboxValueType = ep.CheckboxValueType;
declare type ElFormRules = ep.FormRules;
declare type DateModelType = ep.DateModelType;
declare type UploadFile = ep.UploadFile;
declare type ElTreeInstance = InstanceType<typeof ep.ElTree>; declare type ElTreeInstance = InstanceType<typeof ep.ElTree>;
declare type ElTreeSelectInstance = InstanceType<typeof ep.ElTreeSelect>; declare type ElTreeSelectInstance = InstanceType<typeof ep.ElTreeSelect>;
@ -31,4 +26,11 @@ declare global {
declare type ElDatePickerInstance = InstanceType<typeof ep.ElDatePicker>; declare type ElDatePickerInstance = InstanceType<typeof ep.ElDatePicker>;
declare type ElTimePickerInstance = InstanceType<typeof ep.ElTimePicker>; declare type ElTimePickerInstance = InstanceType<typeof ep.ElTimePicker>;
declare type ElTimeSelectInstance = InstanceType<typeof ep.ElTimeSelect>; declare type ElTimeSelectInstance = InstanceType<typeof ep.ElTimeSelect>;
declare type TransferKey = ep.TransferKey;
declare type CheckboxValueType = ep.CheckboxValueType;
declare type ElFormRules = ep.FormRules;
declare type DateModelType = ep.DateModelType;
declare type UploadFile = ep.UploadFile;
} }

View File

@ -19,10 +19,8 @@
*/ */
import { getToken } from '@/utils/auth'; import { getToken } from '@/utils/auth';
import useNoticeStore from '@/store/modules/notice';
import { ElNotification } from 'element-plus'; import { ElNotification } from 'element-plus';
import useNoticeStore from '@/store/modules/notice';
const { addNotice } = useNoticeStore();
let socketUrl: any = ''; // socket地址 let socketUrl: any = ''; // socket地址
let websocket: any = null; // websocket 实例 let websocket: any = null; // websocket 实例
@ -125,7 +123,7 @@ export const websocketonmessage = () => {
if (e.data.indexOf('ping') > 0) { if (e.data.indexOf('ping') > 0) {
return; return;
} }
addNotice({ useNoticeStore().addNotice({
message: e.data, message: e.data,
read: false, read: false,
time: new Date().toLocaleString() time: new Date().toLocaleString()

View File

@ -33,7 +33,7 @@
* 部署方式 Docker 容器编排 一键部署业务集群<br /> * 部署方式 Docker 容器编排 一键部署业务集群<br />
* 国际化 SpringMessage Spring标准国际化方案<br /> * 国际化 SpringMessage Spring标准国际化方案<br />
</p> </p>
<p><b>当前版本:</b> <span>v5.1.1</span></p> <p><b>当前版本:</b> <span>v5.1.2</span></p>
<p> <p>
<el-tag type="danger">&yen;免费开源</el-tag> <el-tag type="danger">&yen;免费开源</el-tag>
</p> </p>
@ -78,7 +78,7 @@
* 分布式监控 PrometheusGrafana 全方位性能监控<br /> * 分布式监控 PrometheusGrafana 全方位性能监控<br />
* 其余与 Vue 版本一致<br /> * 其余与 Vue 版本一致<br />
</p> </p>
<p><b>当前版本:</b> <span>v2.1.1</span></p> <p><b>当前版本:</b> <span>v2.1.2</span></p>
<p> <p>
<el-tag type="danger">&yen;免费开源</el-tag> <el-tag type="danger">&yen;免费开源</el-tag>
</p> </p>
@ -96,13 +96,6 @@
</template> </template>
<script setup name="Index" lang="ts"> <script setup name="Index" lang="ts">
import { initWebSocket } from '@/utils/websocket';
onMounted(() => {
let protocol = window.location.protocol === 'https:' ? 'wss://' : 'ws://';
initWebSocket(protocol + window.location.host + import.meta.env.VITE_APP_BASE_API + '/resource/websocket');
});
const goTarget = (url: string) => { const goTarget = (url: string) => {
window.open(url, '__blank'); window.open(url, '__blank');
}; };

View File

@ -303,7 +303,7 @@ const handleStatusChange = async (row: ClientVO) => {
let text = row.status === '0' ? '启用' : '停用'; let text = row.status === '0' ? '启用' : '停用';
try { try {
await proxy?.$modal.confirm('确认要"' + text + '"吗?'); await proxy?.$modal.confirm('确认要"' + text + '"吗?');
await changeStatus(row.id, row.status); await changeStatus(row.clientId, row.status);
proxy?.$modal.msgSuccess(text + '成功'); proxy?.$modal.msgSuccess(text + '成功');
} catch (err) { } catch (err) {
row.status = row.status === '0' ? '1' : '0'; row.status = row.status === '0' ? '1' : '0';

View File

@ -70,7 +70,7 @@
</el-table> </el-table>
</el-card> </el-card>
<el-dialog v-model="dialog.visible" :title="dialog.title" destroy-on-close append-to-bod width="600px"> <el-dialog v-model="dialog.visible" :title="dialog.title" destroy-on-close append-to-body width="600px">
<el-form ref="deptFormRef" :model="form" :rules="rules" label-width="80px"> <el-form ref="deptFormRef" :model="form" :rules="rules" label-width="80px">
<el-row> <el-row>
<el-col v-if="form.parentId !== 0" :span="24"> <el-col v-if="form.parentId !== 0" :span="24">

View File

@ -222,7 +222,7 @@ const submitForm = () => {
noticeFormRef.value?.validate(async (valid: boolean) => { noticeFormRef.value?.validate(async (valid: boolean) => {
if (valid) { if (valid) {
form.value.noticeId ? await updateNotice(form.value) : await addNotice(form.value); form.value.noticeId ? await updateNotice(form.value) : await addNotice(form.value);
proxy?.$modal.msgSuccess('修改成功'); proxy?.$modal.msgSuccess('操作成功');
dialog.visible = false; dialog.visible = false;
await getList(); await getList();
} }