feat 全局系统名称bug

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
Ironsp
2026-05-29 11:47:50 +08:00
parent f149fca426
commit d1ed96b8fc
4 changed files with 41 additions and 1 deletions

View File

@@ -15,7 +15,7 @@
</div>
<!-- 已读/未读 -->
<!-- <span v-if="v.read" class="el-tag el-tag--success el-tag--mini read">已读</span> -->
<button v-if="!v.read" class="el-tag el-tag--danger el-tag--mini read" @click="handleSee(v)">查看画面</button>
<button class="el-tag el-tag--danger el-tag--mini read" @click="handleSee(v)">查看画面</button>
</div>
</template>
<el-empty v-else :description="'消息为空'"></el-empty>

View File

@@ -0,0 +1,30 @@
import { defineStore } from 'pinia';
import { ref, computed } from 'vue';
import { getDevicetList } from '@/api/equipmentList/index';
export const useDeviceStore = defineStore('devices', () => {
// --- State (状态) ---
// 相当于 Vuex 中的 state用 ref 或 reactive 定义
const deviceList = ref();
// --- Getters (计算属性) ---
// 相当于 Vuex 中的 getters直接用 computed 定义
// --- Actions (动作) ---
// 相当于 Vuex 中的 actions/mutations直接写同步或异步函数
async function getdeviceList(query?: any) {
try {
const response = await getDevicetList(query);
console.log('获取设备列表:', response);
deviceList.value = response.data;
} catch (error) {
console.error('获取设备列表失败', error);
}
}
// ⚠️ 核心点:必须把需要暴露出去的变量和方法 return 出去!
return {
deviceList,
getdeviceList
};
});

View File

@@ -118,6 +118,12 @@
<script setup name="WarningList" lang="ts">
import { listDemo, updateDemo } from '@/api/WarningList/index';
//import { DemoVO, DemoQuery, DemoForm } from '@/api/WarningList/types';
import { useDeviceStore } from '@/store/modules/equipmentList';
import { storeToRefs } from 'pinia';
const deviceStore = useDeviceStore();
const { deviceList } = storeToRefs(deviceStore);
const { getdeviceList } = deviceStore;
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
@@ -256,5 +262,6 @@ const submitForm = async () => {
onMounted(() => {
getList();
getdeviceList();
});
</script>

View File

@@ -48,6 +48,7 @@ import type { UploadProps, UploadUserFile } from 'element-plus';
import { uploadDemo, getDemo, updateDemo } from '@/api/systemList/index';
import { ElMessage } from 'element-plus';
import { Plus } from '@element-plus/icons-vue';
import router from '@/router';
const uploadUrl = import.meta.env.VITE_BASE_API + '/system/logo/upload';
@@ -84,6 +85,8 @@ const save = async () => {
.then((res) => {
console.log('保存成功', res);
ElMessage.success('保存成功');
// 刷新当前路由
router.go(0);
})
.catch((err) => {
console.error('保存失败', err);