Merge pull request 'dengjie' (#18) from dengjie into master
Reviewed-on: http://git.feashow.cn/feashow/tunnel-cloud-front/pulls/18
This commit is contained in:
@@ -86,8 +86,9 @@ html, body, #app, .el-container, .el-aside, .el-main {
|
||||
margin-left: 14px;
|
||||
|
||||
.el-form-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
//display: flex;
|
||||
//align-items: center;
|
||||
margin-right: 18px;
|
||||
}
|
||||
|
||||
.el-form-item__label {
|
||||
|
||||
@@ -29,15 +29,29 @@
|
||||
</div>
|
||||
</template>
|
||||
</el-popover>
|
||||
<el-dialog width="1200px" title="通知公告详情" v-model="visible" @close="visible=false">
|
||||
<el-form :model="viewForm" label-width="100px">
|
||||
<el-row>
|
||||
<el-col :span="24" class="title-block">
|
||||
<el-text class="title">{{ viewForm.noticeTitle }}</el-text>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-text v-if="viewForm.contentType == 'text'">{{ viewForm.noticeContent }}</el-text>
|
||||
<span v-else v-html="viewForm.noticeContent"></span>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {getNotifyList,readAllNotify, readSingleNotify} from "@/api/notice/notify";
|
||||
import {getNotifyList,getNotifyDetail, readAllNotify, readSingleNotify} from "@/api/notice/notify";
|
||||
import {getToken} from '@/utils/auth'
|
||||
import {ElMessage} from "element-plus";
|
||||
import {useRouter} from "vue-router";
|
||||
import {defineExpose} from "vue";
|
||||
// import {defineExpose} from "vue";
|
||||
|
||||
const router = useRouter()
|
||||
const pageInfo = reactive({
|
||||
pageNum: 1,
|
||||
@@ -46,10 +60,18 @@ const pageInfo = reactive({
|
||||
let send = {
|
||||
type: "ping"
|
||||
}
|
||||
|
||||
const viewForm = ref();
|
||||
const visible = ref(false);
|
||||
const showNotify = ref(false);
|
||||
const total = ref();
|
||||
const noticeList = ref();
|
||||
//查看详情
|
||||
const handleViewDetails = (noticeId) => {
|
||||
getNotifyDetail(noticeId).then(res => {
|
||||
visible.value = true
|
||||
viewForm.value = res.data
|
||||
})
|
||||
}
|
||||
const initWebSocket = () => {
|
||||
const socket = new WebSocket(import.meta.env.VITE_BASE_WSURL + '/notice-ws/notice')
|
||||
// 2. ws.send()给服务器发送信息
|
||||
@@ -108,7 +130,12 @@ searchNotifyList()
|
||||
const handleToNotifyDetail = (notice, index) => {
|
||||
noticeList.value.splice(index, 1)
|
||||
total.value -= 1
|
||||
router.push({path: `/system/notice/inform/index/${notice.noticeId}`})
|
||||
viewForm.value={
|
||||
noticeTitle:'',
|
||||
noticeContent:''
|
||||
}
|
||||
// router.push({path: `/system/notice/inform/index/${notice.noticeId}`})
|
||||
handleViewDetails(notice.noticeId)
|
||||
}
|
||||
|
||||
//单个已读
|
||||
@@ -167,6 +194,15 @@ const handleNext = () => {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.title-block {
|
||||
text-align: center;
|
||||
padding-bottom: 30px;
|
||||
|
||||
.title {
|
||||
font-size: 28px;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
ul::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<bell-socket/>
|
||||
</div>
|
||||
<div>
|
||||
<img :src="authStore.userinfo.avatar" alt="" @click="handleVisitedP">
|
||||
<img :src="authStore.userinfo.avatar" alt="" @click.stop="handleVisitedP">
|
||||
<div v-if="visitedP">
|
||||
<ul>
|
||||
<li @click="handleToAuth">个人中心</li>
|
||||
@@ -29,7 +29,15 @@ import BellSocket from "./BellSocket.vue";
|
||||
const authStore = useAuthStore()
|
||||
const visitedP = ref(false)
|
||||
const router = useRouter()
|
||||
|
||||
onMounted(() => {
|
||||
document.addEventListener('click', nullBlockClick)
|
||||
})
|
||||
onBeforeUnmount(() => {
|
||||
document.removeEventListener('click', nullBlockClick)
|
||||
})
|
||||
const nullBlockClick = () => {
|
||||
visitedP.value = false
|
||||
}
|
||||
const handleVisitedP = () => {
|
||||
visitedP.value = !visitedP.value
|
||||
}
|
||||
|
||||
@@ -35,15 +35,13 @@ const props = defineProps({
|
||||
required: true
|
||||
}
|
||||
})
|
||||
console.log(props.menuItem)
|
||||
const link = ref('http://web-tunnel.feashow.com/api/doc.html#/home')
|
||||
const link = ref('http://gateway.feashow.cn/doc.html#/home')
|
||||
const handleGo = (path) => {
|
||||
if (path === "/tool/swagger") {
|
||||
return ''
|
||||
} else {
|
||||
return path
|
||||
}
|
||||
// window.open(path)
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
</router-link>
|
||||
</div>
|
||||
</el-scrollbar>
|
||||
<ul class="el-dropdown-menu contextmenu" :style="{ 'left': left + 'px', 'top': top + 'px' }" v-if="visible">
|
||||
<ul class=" contextmenu" :style="{ 'left': left + 'px' }" v-if="visible">
|
||||
<li class="el-dropdown-menu__item" @click="closeCurrentTagView">关闭当前</li>
|
||||
<li class="el-dropdown-menu__item" @click="closeOtherTagView">关闭其他</li>
|
||||
</ul>
|
||||
@@ -31,11 +31,20 @@ const route = useRoute()
|
||||
const tagsViewStore = useTagsView()
|
||||
const visible = ref(false)
|
||||
const left = ref()
|
||||
const top = ref()
|
||||
const tagPath = ref()
|
||||
|
||||
watch(route, () => {
|
||||
init()
|
||||
})
|
||||
onMounted(() => {
|
||||
document.addEventListener('click', nullBlockClick)
|
||||
})
|
||||
onBeforeUnmount(() => {
|
||||
document.removeEventListener('click', nullBlockClick)
|
||||
})
|
||||
const nullBlockClick = () => {
|
||||
visible.value = false
|
||||
}
|
||||
const init = () => {
|
||||
tagsViewStore.addVisitedViews(route)
|
||||
}
|
||||
@@ -46,19 +55,18 @@ const isActive = (tag) => {
|
||||
return tag.path === route.path
|
||||
}
|
||||
const openMenu = (tag, e) => {
|
||||
console.log(tag, e);
|
||||
left.value = e.x + 10
|
||||
top.value = e.y + 10
|
||||
tagPath.value=tag
|
||||
left.value = e.x-230
|
||||
visible.value = true
|
||||
}
|
||||
// 关闭当前
|
||||
const closeCurrentTagView = () => {
|
||||
tagsViewStore.delVisitedViews(route.path)
|
||||
tagsViewStore.delVisitedViews(tagPath.value.path)
|
||||
visible.value = false
|
||||
}
|
||||
// 关闭其他
|
||||
const closeOtherTagView = () => {
|
||||
tagsViewStore.delOtherVisitedViews(route)
|
||||
tagsViewStore.delOtherVisitedViews(tagPath.value)
|
||||
visible.value = false
|
||||
}
|
||||
init()
|
||||
@@ -66,6 +74,7 @@ init()
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.link-box {
|
||||
position: relative;
|
||||
padding: 12px 0;
|
||||
line-height: 30px;
|
||||
|
||||
@@ -89,14 +98,18 @@ init()
|
||||
}
|
||||
|
||||
.contextmenu {
|
||||
padding: 5px;
|
||||
width: 88px;
|
||||
//height: 82px;
|
||||
position: absolute;
|
||||
top:47px;
|
||||
z-index: 3000;
|
||||
background: #fff;
|
||||
box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, .3);
|
||||
|
||||
li {
|
||||
margin: 0;
|
||||
padding: 7px 16px;
|
||||
padding: 7px 10px;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
|
||||
@@ -37,6 +37,7 @@ export const useTagsView = defineStore('tagsView',()=>{
|
||||
const delOtherVisitedViews = ({path,meta}) => {
|
||||
visitedViews.value = []
|
||||
visitedViews.value.push({path,meta})
|
||||
toLastTagView(visitedViews)
|
||||
}
|
||||
|
||||
//路由到末尾标签页
|
||||
|
||||
@@ -147,7 +147,7 @@
|
||||
<el-col :span="11" :offset="1" v-if="form.menuType !== 'B'">
|
||||
<el-form-item label="菜单状态">
|
||||
<el-radio-group v-model="form.state">
|
||||
<el-radio v-for="item in [{ label: '正常', value: '0' }, { label: '停用', value: '1' }]" :label="item.value"
|
||||
<el-radio v-for="item in [{ label: '正常', value: '1' }, { label: '停用', value: '0' }]" :label="item.value"
|
||||
:key="item.value">
|
||||
{{ item.label }}
|
||||
</el-radio>
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
</div>
|
||||
<paging :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :page-sizes="[10, 20, 30, 40,50]"
|
||||
:total="total" @changeSize="handleSizeChange" @goPage="handleCurrentChange"/>
|
||||
<!-- <bell-socket style="display: none" ref="bellSocket"/>-->
|
||||
<!--详情弹窗-->
|
||||
<el-dialog v-model="isViewVisited" title="通知公告详情" width="1200px" @close="handleCloseDialog">
|
||||
<el-form :model="viewForm" label-width="100px">
|
||||
@@ -71,22 +70,16 @@ const queryParams = reactive({
|
||||
state: null
|
||||
})
|
||||
const router = useRouter()
|
||||
// const bellSocket = ref()
|
||||
const loading = ref(true)
|
||||
const list = ref([])
|
||||
const total = ref([]);
|
||||
const isViewVisited = ref(false);
|
||||
const viewForm = ref();
|
||||
const notifyId = reactive(router.currentRoute.value.params.queryId)
|
||||
const pageInfo = reactive({
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
});
|
||||
onMounted(()=>{
|
||||
if(notifyId!==undefined){
|
||||
handleViewDetails(notifyId)
|
||||
}
|
||||
})
|
||||
|
||||
//重置搜索
|
||||
const handleReset = () => {
|
||||
getList()
|
||||
@@ -118,9 +111,6 @@ const handleViewDetails = (noticeId) => {
|
||||
}
|
||||
//关闭详情弹窗
|
||||
const handleCloseDialog = () => {
|
||||
if(notifyId!==undefined){
|
||||
router.push({path:'/system/notice/inform/index'})
|
||||
}
|
||||
isViewVisited.value = false
|
||||
}
|
||||
//删除单个消息
|
||||
|
||||
Reference in New Issue
Block a user