提交 8783ae50 作者: 毛细亚

更新代码

上级 fd77b8d0
......@@ -3,18 +3,35 @@
<div class="mobile-menu-bar" v-if="token && external_userid && showMemberId">
<!-- 临时调试信息 -->
<div class="menu-container">
<el-menu
:default-active="selectedPath"
mode="horizontal"
class="mobile-el-menu"
:class="{ 'collapsed': !isMenuExpanded && shouldShowToggle }"
background-color="#fff"
router
@select="handleSelect"
ref="menuRef"
>
<el-menu-item v-for="item in menuList" :key="item.path" :index="item.path" class="mobile-menu-item">
{{ item.label }}
</el-menu-item>
</el-menu>
<!-- 展开收起按钮 -->
<el-button
type="text"
size="mini"
v-if="shouldShowToggle"
class="menu-toggle-btn"
@click="toggleMenu"
>
<i :class="isMenuExpanded ? 'el-icon-arrow-up' : 'el-icon-arrow-down'"></i>
<span>{{ isMenuExpanded ? '收起' : '展开' }}</span>
</el-button>
</div>
<!-- 绑定的 w 账号 -->
<bindUserList />
</div>
......@@ -76,6 +93,8 @@ export default {
],
selectedPath: '/userInfo',
showMemberId: false,
isMenuExpanded: false, // 菜单展开状态
shouldShowToggle: false, // 是否显示展开收起按钮
}
},
computed:{
......@@ -100,6 +119,8 @@ export default {
console.log('external_userid 已设置:', newVal, window.location.href, this.token,Cookies.get('token'))
// 强制更新组件
this.$forceUpdate()
// 检查是否需要显示展开收起按钮
this.checkMenuOverflow()
})
}
},
......@@ -132,11 +153,63 @@ export default {
this.selectedPath = currentPath
}
console.log('创建时路径:', currentPath, '选中路径:', this.selectedPath)
// 监听窗口大小变化
window.addEventListener('resize', this.handleResize)
// 初始检查
this.$nextTick(() => {
this.checkMenuOverflow()
})
},
beforeDestroy() {
window.removeEventListener('resize', this.handleResize)
},
methods:{
...mapMutations('user', ['set_token']),
handleSelect(key, keyPath) {
console.log('菜单选择:', key, keyPath, window.location.href)
},
// 切换菜单展开收起状态
toggleMenu() {
this.isMenuExpanded = !this.isMenuExpanded
},
// 检查菜单是否需要换行
checkMenuOverflow() {
this.$nextTick(() => {
const menuElement = this.$refs.menuRef?.$el
if (!menuElement) return
// 临时展开菜单来检查实际高度
const wasCollapsed = !this.isMenuExpanded && this.shouldShowToggle
if (wasCollapsed) {
menuElement.classList.remove('collapsed')
}
const menuHeight = menuElement.scrollHeight
const singleLineHeight = 50 // 单行高度
// 如果菜单高度超过单行,说明需要换行
this.shouldShowToggle = menuHeight > singleLineHeight + 10 // 加10px容错
// 如果不需要展开收起按钮,则直接展开
if (!this.shouldShowToggle) {
this.isMenuExpanded = true
} else if (wasCollapsed) {
// 恢复收起状态
menuElement.classList.add('collapsed')
}
})
},
// 窗口大小变化处理
handleResize() {
clearTimeout(this.resizeTimer)
this.resizeTimer = setTimeout(() => {
this.checkMenuOverflow()
}, 150)
}
}
}
......@@ -162,18 +235,30 @@ export default {
border-bottom: 1px solid #f0f0f0;
box-shadow: 0 2px 8px #f0f1f2;
z-index: 10;
.mobile-el-menu{
display: flex;
flex-wrap: wrap;
}
}
.menu-container {
position: relative;
padding-right: 30px;
}
.mobile-el-menu {
border: none;
background: #fff;
display: flex;
justify-content: flex-start;
padding-left: 16px;
flex-wrap: wrap;
transition: all 0.3s ease;
overflow: hidden;
}
/* 收起状态:只显示第一行 */
.mobile-el-menu.collapsed {
max-height: 50px;
overflow: hidden;
}
.mobile-menu-item {
font-size: 14px ;
padding: 0 16px !important;
......@@ -185,9 +270,29 @@ export default {
margin-right: 8px;
transition: all 0.3s ease;
}
.mobile-el-menu .el-menu-item.is-active {
font-weight: bold;
}
/* 展开收起按钮 */
.menu-toggle-btn {
position: absolute;
right: 10px;
top: 25px;
transform: translateY(-50%);
display: flex;
align-items: center;
cursor: pointer;
font-size: 12px;
transition: all 0.3s ease;
z-index: 20;
}
.menu-toggle-btn i {
font-size: 12px;
}
.mobile-content {
flex: 1;
overflow-y: auto;
......
......@@ -2,23 +2,17 @@ import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
// import ElementUI from 'element-ui';
import Cookies from 'js-cookie';
import _ from 'lodash';
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import 'lib-flexible/flexible.js'
// Vue.use(ElementUI);
Vue.use(ElementUI);
// import '@/styles/element-theme-colors.css';
import '@/styles/index.scss';
import moment from 'moment'
import VConsole from 'vconsole';
// import 'bi-element-ui/lib/bi-element-ui.css'
import Element from 'bi-eleme'
// import 'bi-eleme/lib/theme-chalk/index.css'
import BiElementUi from 'bi-element-ui'
// import 'bi-element-ui/lib/bi-element-ui.css'
import uploading from '@/utils/cos-upload'
import 'element-ui/lib/theme-chalk/index.css';
import errorHandle from '@/utils/errorHandle'
import { getParams } from '@/utils/index'
import globalComponent from '@/components/register.js'
......@@ -39,19 +33,8 @@ errorHandle.onload()
// if (process.env.NODE_ENV !== 'development') {
// errorHandle.onload()
// }
// 测试一下
Vue.use(uploading)
Vue.use(BiElementUi, {
dev: true,
env: 'development',
system: null
})
Vue.use(Element, {
size: Cookies.get('size') || 'small' // set element-ui default size
// locale: enLang, // 如果使用中文,无需设置,请删除123132
})
// 配置和原型方法设置应该在创建Vue实例之前
Vue.config.productionTip = false
// 配置 Vue DevTools
......@@ -59,7 +42,6 @@ Vue.config.devtools = process.env.NODE_ENV === 'development'
Vue.prototype.$cookies = Cookies;
Vue.prototype.$lodash = _;
Vue.prototype.$moment = moment;
new Vue({
router,
store,
......
......@@ -599,5 +599,9 @@ li {
z-index: 10000 !important;
}
/* ----------------- 修复 Element UI 图标显示问题 --------------------*/
// 确保 Element UI 图标字体正确加载
<template>
<div class="details columnFlex">
<div class="details">
<el-form
v-loading="loading"
class="content"
......@@ -37,8 +37,8 @@
>
<!-- AI自动封禁 -->
<div
class="remarkType"
v-if="item.information_type === 6"
class="remarkType"
>
<p>
<span class="label">所属项目:</span><span>{{ item.newRemake.project || "" }}</span>
......@@ -67,8 +67,8 @@
</div>
<!-- 其他类型 -->
<div
class="remarkType"
v-else
class="remarkType"
>
<div
v-if="item.remake.indexOf('src=') !== -1"
......@@ -93,6 +93,8 @@
</div>
</div>
</el-form-item>
<!-- 命中统计表格 -->
<div v-if="item && item.newRemake && item.newRemake.hit">
<div
class="title"
......@@ -100,19 +102,42 @@
>
命中统计
</div>
<BiTable
<el-table
:data="item.newRemake.hit"
size="medium"
:column="tableColums"
style="width: 100%"
class="hit-statistics-table"
>
<template v-slot:time="{ row }">
<p>{{ $moment(row.time).format("YYYY-MM-DD HH:mm:ss") }}</p>
<el-table-column
prop="content"
label="文本内容"
show-overflow-tooltip
/>
<el-table-column
prop="type"
label="命中类型"
width="120"
/>
<el-table-column
prop="key"
label="关键字"
width="120"
show-overflow-tooltip
/>
<el-table-column
label="时间"
width="180"
>
<template slot-scope="{ row }">
<span>{{ $moment(row.time).format("YYYY-MM-DD HH:mm:ss") }}</span>
</template>
</BiTable>
</el-table-column>
</el-table>
</div>
</div>
</div>
<!-- 无数据状态 -->
<div
v-if="!loading && violationList.length == 0"
class="noContent rowFlex allCenter"
......@@ -120,6 +145,8 @@
<noContent title="暂无数据" description="当前没有任何数据,请稍后再试或联系管理员" />
</div>
</el-form>
<!-- 查看大图弹窗 -->
<el-dialog
title="查看大图"
:visible.sync="imageLayer"
......@@ -142,34 +169,17 @@ import { violationList } from "@/api/game";
import noContent from "@/components/noContent.vue";
import { debounce } from '@/utils'
import watchMember from '@/mixins/watchMember'
export default {
name: 'ViolationRecord',
components: {
noContent,
},
mixins: [watchMember],
data() {
return {
imageSrc: [],
imageSrc: '',
violationList: [],
tableColums: [
{
label: "文本内容",
prop: "content",
},
{
label: "命中类型",
prop: "type",
},
{
label: "关键字",
prop: "key",
},
{
label: "时间",
prop: "time",
width: 120,
slotScope: true
},
],
loading: false,
imageLayer: false,
};
......@@ -177,7 +187,6 @@ export default {
computed: {
...mapState("game", ["accountSelect", "gameTabActive"]),
},
mixins: [watchMember],
mounted() {
this.requestViolationList();
},
......@@ -185,6 +194,7 @@ export default {
memberChange() {
this.requestViolationList()
},
handleRemark(remark) {
try {
const remarkObj = JSON.parse(JSON.parse(remark.replace(/\r\n\t/g, "")));
......@@ -194,10 +204,12 @@ export default {
return remark;
}
},
showRemake(remake) {
this.imageSrc = remake;
this.imageLayer = true;
},
requestViolationList() {
const data = {
account_type: 1,
......@@ -208,7 +220,7 @@ export default {
(res) => {
if (res.status_code == 1 && res.data.data.length > 0) {
this.violationList = res.data.data;
this.violationList.map((item) => {
this.violationList.forEach((item) => {
if (item.information_type == 6) {
item.newRemake = this.handleRemark(item.remake);
}
......@@ -226,6 +238,7 @@ export default {
},
};
</script>
<style lang="scss">
.remakeImage {
img {
......@@ -245,20 +258,25 @@ export default {
<style lang="scss" scoped>
.details {
width:100%;
width: 100%;
height: calc(100vh - 170px);
background: #fff;
.content {
width: 100%;
padding: vw(20);
padding: 20px;
height: 100%;
overflow: auto;
}
.contentMain {
}
.contentItem {
border-bottom: 1px dashed #ebeef5;
margin-bottom: 20px;
padding-bottom: 20px;
&:last-child {
border-bottom: none;
}
}
.remarkType {
......@@ -273,44 +291,28 @@ export default {
color: #86909C;
margin-right: 5px;
}
.value {
}
}
.error {
color: #ff5959;
}
.foulImage {
max-width: 300px;
height: auto;
}
::v-deep .el-collapse-item {
.hit-statistics-table {
margin-top: 10px;
margin-bottom: 20px;
}
::v-deep .el-collapse-item__content {
padding-bottom: 10px;
}
::v-deep .el-collapse {
border: none;
::v-deep .el-form-item {
margin-bottom: 5px;
}
::v-deep .el-collapse-item__header {
width: 100%;
height: 44px;
background: #F7F8FA;
color: #333333;
padding-left: 80px;
font-size: 14px;
font-weight: 400;
::v-deep .el-form-item__label {
color: #86909C;
font-weight: 500;
}
::v-deep .el-form-item {
margin-bottom: 5px;
::v-deep .el-form-item__content {
color: #333;
}
}
......@@ -320,4 +322,8 @@ export default {
max-height: 200px;
}
}
.noContent {
height: 300px;
}
</style>
......@@ -74,8 +74,8 @@
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="filterChange">搜索</el-button>
<el-button @click="resetForm">重置</el-button>
<el-button type="primary" size="mini" @click="filterChange">搜索</el-button>
<el-button size="mini" @click="resetForm">重置</el-button>
</el-form-item>
</el-form>
<div
......@@ -377,7 +377,6 @@ import noContent from "@/components/noContent.vue";
})
this.$forceUpdate()
}
this.$forceUpdate()
},
async request_register_type() {
......@@ -928,5 +927,6 @@ import noContent from "@/components/noContent.vue";
margin-bottom: 20px;
margin-top: 20px;
}
</style>
\ No newline at end of file
......@@ -233,14 +233,11 @@
}
this.isloadMore = true
this.orderList = []
this.requestOrderList()
// this.gameMemberView()
this.requestOrderList('msg')
}
}
},
mounted() {
// this.requestOrderList()
// this.gameMemberView()
this.payTypeList()
this.searchDate = [this.$moment().subtract(3, 'month').format('YYYY-MM-DD'), this.$moment().format('YYYY-MM-DD')]
this.timerData.order_time_start = this.$moment().subtract(3, 'month').format('YYYY-MM-DD')
......@@ -366,7 +363,7 @@
total: 0
}
this.orderList = []
this.requestOrderList()
this.requestOrderList('msg')
}
},
handleChange(val) {
......@@ -377,7 +374,7 @@
this.totalOrder = res.data
})
},
requestOrderList: throttle(function() {
requestOrderList: throttle(function(msg) {
console.log(12313, '开始展示', this)
if (this.accountSelect == '') {
this.$message.warning('暂无关联的账号,请先去关联账号!')
......@@ -415,8 +412,10 @@
this.orderInfo = res.data.page_info
}
if (res.status_code == 1) {
if (!msg) {
this.$message.success(res.msg)
}
}
},
(err) => {
this.loading = false
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论