<template>
|
<el-dialog v-model="dialogMes" :title="title">
|
<el-table
|
:data="tableData"
|
highlight-current-row
|
style="width: 100%;margin-top: 20px"
|
border
|
:header-cell-style="{background: '#fafafa'}"
|
>
|
<el-table-column property="id" label="发送时间"/>
|
<el-table-column property="roleId" label="预警信息内容"/>
|
<el-table-column property="workTypeDesc" label="预警级别"/>
|
<el-table-column property="roleId" label="接收人">
|
<template #default="scope">
|
{{ roleList.find(i=>i.roleId == scope.row.roleId)?.roleName }}
|
</template>
|
</el-table-column>
|
</el-table>
|
</el-dialog>
|
</template>
|
|
<script lang="ts">
|
import {toRefs, reactive, defineComponent, ref, defineAsyncComponent, onMounted} from 'vue';
|
import { storeToRefs } from 'pinia';
|
import { initBackEndControlRoutes } from '/@/router/backEnd';
|
import {useUserInfo} from "/@/stores/userInfo";
|
import { Session } from '/@/utils/storage';
|
import { Search, Delete, Edit, View, Plus } from '@element-plus/icons-vue'
|
import {ElMessage, ElMessageBox, ElTable} from 'element-plus'
|
import {userApi} from "/@/api/systemManage/user";
|
|
|
interface stateType {
|
title: string
|
dialogMes: boolean
|
tableData: Array<any>
|
roleList: Array<any>
|
uid: number | null
|
}
|
export default defineComponent({
|
name: 'historyMessages',
|
components: {},
|
props:[],
|
setup() {
|
const userInfo = useUserInfo()
|
const { userInfos } = storeToRefs(userInfo);
|
const state = reactive<stateType>({
|
title: '',
|
dialogMes: false,
|
tableData: [],
|
roleList: [],
|
uid: null
|
});
|
// 页面载入时执行方法
|
onMounted(() => {
|
|
});
|
const ctfRef = ref()
|
const openDialog = (value: any) => {
|
state.dialogMes = true
|
}
|
|
// const getRoleData = async () => {
|
// let res = await useRoleApi().getRoleList();
|
// if (res.data.code === '200') {
|
// state.roleList = res.data.data;
|
// } else {
|
// ElMessage({
|
// type: 'warning',
|
// message: res.data.msg
|
// });
|
// }
|
// };
|
//
|
// const getCtf = async()=>{
|
// let res = await userApi().getCtf({uid: state.uid})
|
// if(res.data.code == 200){
|
// state.tableData = res.data.data
|
// }else{
|
// ElMessage({
|
// type: 'warning',
|
// message: res.data.msg
|
// })
|
// }
|
// }
|
|
const renderMenu = async (value: string) => {
|
Session.set('projectId',value)
|
userInfos.value.projectId = value
|
await initBackEndControlRoutes();
|
};
|
return {
|
renderMenu,
|
openDialog,
|
ctfRef,
|
Search,
|
Delete,
|
Edit,
|
View,
|
Plus,
|
...toRefs(state),
|
};
|
},
|
});
|
</script>
|
|
<style scoped lang="scss">
|
.home-container {
|
height: 100%;
|
overflow: hidden;
|
position: relative;
|
.homeCard{
|
width: 100%;
|
padding: 0 20px;
|
box-sizing: border-box;
|
background: #fff;
|
border-radius: 4px;
|
}
|
.applyBtn{
|
width: 100%;
|
background: #fff;
|
padding-top: 15px;
|
z-index: 5;
|
box-shadow: 0 -3px 8px rgba(150,150,150,.1);
|
display: flex;
|
align-items: center;
|
justify-content: center;
|
}
|
.el-row{
|
margin-bottom: 20px;
|
}
|
.el-row:last-child {
|
margin-bottom: 0;
|
}
|
.el-input{
|
width: 100% !important;
|
}
|
.el-date-editor::v-deep{
|
width: 100%;
|
}
|
.el-select{
|
width: 100%;
|
}
|
.el-cascader{
|
width: 100% !important;
|
}
|
}
|
</style>
|