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:
odjbin
2023-11-17 13:52:26 +00:00
8 changed files with 82 additions and 35 deletions

View File

@@ -86,8 +86,9 @@ html, body, #app, .el-container, .el-aside, .el-main {
margin-left: 14px; margin-left: 14px;
.el-form-item { .el-form-item {
display: flex; //display: flex;
align-items: center; //align-items: center;
margin-right: 18px;
} }
.el-form-item__label { .el-form-item__label {

View File

@@ -29,15 +29,29 @@
</div> </div>
</template> </template>
</el-popover> </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> </div>
</template> </template>
<script setup> <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 {getToken} from '@/utils/auth'
import {ElMessage} from "element-plus"; import {ElMessage} from "element-plus";
import {useRouter} from "vue-router"; import {useRouter} from "vue-router";
import {defineExpose} from "vue"; // import {defineExpose} from "vue";
const router = useRouter() const router = useRouter()
const pageInfo = reactive({ const pageInfo = reactive({
pageNum: 1, pageNum: 1,
@@ -46,10 +60,18 @@ const pageInfo = reactive({
let send = { let send = {
type: "ping" type: "ping"
} }
const viewForm = ref();
const visible = ref(false);
const showNotify = ref(false); const showNotify = ref(false);
const total = ref(); const total = ref();
const noticeList = ref(); const noticeList = ref();
//查看详情
const handleViewDetails = (noticeId) => {
getNotifyDetail(noticeId).then(res => {
visible.value = true
viewForm.value = res.data
})
}
const initWebSocket = () => { const initWebSocket = () => {
const socket = new WebSocket(import.meta.env.VITE_BASE_WSURL + '/notice-ws/notice') const socket = new WebSocket(import.meta.env.VITE_BASE_WSURL + '/notice-ws/notice')
// 2. ws.send()给服务器发送信息 // 2. ws.send()给服务器发送信息
@@ -108,7 +130,12 @@ searchNotifyList()
const handleToNotifyDetail = (notice, index) => { const handleToNotifyDetail = (notice, index) => {
noticeList.value.splice(index, 1) noticeList.value.splice(index, 1)
total.value -= 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> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.title-block {
text-align: center;
padding-bottom: 30px;
.title {
font-size: 28px;
font-weight: bold;
}
}
ul::-webkit-scrollbar { ul::-webkit-scrollbar {
width: 6px; width: 6px;
} }

View File

@@ -7,7 +7,7 @@
<bell-socket/> <bell-socket/>
</div> </div>
<div> <div>
<img :src="authStore.userinfo.avatar" alt="" @click="handleVisitedP"> <img :src="authStore.userinfo.avatar" alt="" @click.stop="handleVisitedP">
<div v-if="visitedP"> <div v-if="visitedP">
<ul> <ul>
<li @click="handleToAuth">个人中心</li> <li @click="handleToAuth">个人中心</li>
@@ -29,7 +29,15 @@ import BellSocket from "./BellSocket.vue";
const authStore = useAuthStore() const authStore = useAuthStore()
const visitedP = ref(false) const visitedP = ref(false)
const router = useRouter() const router = useRouter()
onMounted(() => {
document.addEventListener('click', nullBlockClick)
})
onBeforeUnmount(() => {
document.removeEventListener('click', nullBlockClick)
})
const nullBlockClick = () => {
visitedP.value = false
}
const handleVisitedP = () => { const handleVisitedP = () => {
visitedP.value = !visitedP.value visitedP.value = !visitedP.value
} }

View File

@@ -35,15 +35,13 @@ const props = defineProps({
required: true required: true
} }
}) })
console.log(props.menuItem) const link = ref('http://gateway.feashow.cn/doc.html#/home')
const link = ref('http://web-tunnel.feashow.com/api/doc.html#/home')
const handleGo = (path) => { const handleGo = (path) => {
if (path === "/tool/swagger") { if (path === "/tool/swagger") {
return '' return ''
} else { } else {
return path return path
} }
// window.open(path)
} }
</script> </script>

View File

@@ -15,7 +15,7 @@
</router-link> </router-link>
</div> </div>
</el-scrollbar> </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="closeCurrentTagView">关闭当前</li>
<li class="el-dropdown-menu__item" @click="closeOtherTagView">关闭其他</li> <li class="el-dropdown-menu__item" @click="closeOtherTagView">关闭其他</li>
</ul> </ul>
@@ -31,11 +31,20 @@ const route = useRoute()
const tagsViewStore = useTagsView() const tagsViewStore = useTagsView()
const visible = ref(false) const visible = ref(false)
const left = ref() const left = ref()
const top = ref() const tagPath = ref()
watch(route, () => { watch(route, () => {
init() init()
}) })
onMounted(() => {
document.addEventListener('click', nullBlockClick)
})
onBeforeUnmount(() => {
document.removeEventListener('click', nullBlockClick)
})
const nullBlockClick = () => {
visible.value = false
}
const init = () => { const init = () => {
tagsViewStore.addVisitedViews(route) tagsViewStore.addVisitedViews(route)
} }
@@ -46,19 +55,18 @@ const isActive = (tag) => {
return tag.path === route.path return tag.path === route.path
} }
const openMenu = (tag, e) => { const openMenu = (tag, e) => {
console.log(tag, e); tagPath.value=tag
left.value = e.x + 10 left.value = e.x-230
top.value = e.y + 10
visible.value = true visible.value = true
} }
// 关闭当前 // 关闭当前
const closeCurrentTagView = () => { const closeCurrentTagView = () => {
tagsViewStore.delVisitedViews(route.path) tagsViewStore.delVisitedViews(tagPath.value.path)
visible.value = false visible.value = false
} }
// 关闭其他 // 关闭其他
const closeOtherTagView = () => { const closeOtherTagView = () => {
tagsViewStore.delOtherVisitedViews(route) tagsViewStore.delOtherVisitedViews(tagPath.value)
visible.value = false visible.value = false
} }
init() init()
@@ -66,6 +74,7 @@ init()
<style lang="scss" scoped> <style lang="scss" scoped>
.link-box { .link-box {
position: relative;
padding: 12px 0; padding: 12px 0;
line-height: 30px; line-height: 30px;
@@ -89,14 +98,18 @@ init()
} }
.contextmenu { .contextmenu {
padding: 5px;
width: 88px;
//height: 82px;
position: absolute; position: absolute;
top:47px;
z-index: 3000; z-index: 3000;
background: #fff; background: #fff;
box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, .3); box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, .3);
li { li {
margin: 0; margin: 0;
padding: 7px 16px; padding: 7px 10px;
cursor: pointer; cursor: pointer;
&:hover { &:hover {

View File

@@ -37,6 +37,7 @@ export const useTagsView = defineStore('tagsView',()=>{
const delOtherVisitedViews = ({path,meta}) => { const delOtherVisitedViews = ({path,meta}) => {
visitedViews.value = [] visitedViews.value = []
visitedViews.value.push({path,meta}) visitedViews.value.push({path,meta})
toLastTagView(visitedViews)
} }
//路由到末尾标签页 //路由到末尾标签页

View File

@@ -147,7 +147,7 @@
<el-col :span="11" :offset="1" v-if="form.menuType !== 'B'"> <el-col :span="11" :offset="1" v-if="form.menuType !== 'B'">
<el-form-item label="菜单状态"> <el-form-item label="菜单状态">
<el-radio-group v-model="form.state"> <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"> :key="item.value">
{{ item.label }} {{ item.label }}
</el-radio> </el-radio>

View File

@@ -38,7 +38,6 @@
</div> </div>
<paging :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :page-sizes="[10, 20, 30, 40,50]" <paging :current-page="pageInfo.pageNum" :page-size="pageInfo.pageSize" :page-sizes="[10, 20, 30, 40,50]"
:total="total" @changeSize="handleSizeChange" @goPage="handleCurrentChange"/> :total="total" @changeSize="handleSizeChange" @goPage="handleCurrentChange"/>
<!-- <bell-socket style="display: none" ref="bellSocket"/>-->
<!--详情弹窗--> <!--详情弹窗-->
<el-dialog v-model="isViewVisited" title="通知公告详情" width="1200px" @close="handleCloseDialog"> <el-dialog v-model="isViewVisited" title="通知公告详情" width="1200px" @close="handleCloseDialog">
<el-form :model="viewForm" label-width="100px"> <el-form :model="viewForm" label-width="100px">
@@ -71,22 +70,16 @@ const queryParams = reactive({
state: null state: null
}) })
const router = useRouter() const router = useRouter()
// const bellSocket = ref()
const loading = ref(true) const loading = ref(true)
const list = ref([]) const list = ref([])
const total = ref([]); const total = ref([]);
const isViewVisited = ref(false); const isViewVisited = ref(false);
const viewForm = ref(); const viewForm = ref();
const notifyId = reactive(router.currentRoute.value.params.queryId)
const pageInfo = reactive({ const pageInfo = reactive({
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
}); });
onMounted(()=>{
if(notifyId!==undefined){
handleViewDetails(notifyId)
}
})
//重置搜索 //重置搜索
const handleReset = () => { const handleReset = () => {
getList() getList()
@@ -118,9 +111,6 @@ const handleViewDetails = (noticeId) => {
} }
//关闭详情弹窗 //关闭详情弹窗
const handleCloseDialog = () => { const handleCloseDialog = () => {
if(notifyId!==undefined){
router.push({path:'/system/notice/inform/index'})
}
isViewVisited.value = false isViewVisited.value = false
} }
//删除单个消息 //删除单个消息