This commit is contained in:
hrx 2025-10-17 17:43:55 +08:00
parent b8c117c1e8
commit dad34ae571
5 changed files with 174 additions and 52 deletions

View File

@ -554,7 +554,7 @@ export default {
<style lang="scss" scope>
.myOranization {
height: 81vh;
height: 86vh;
.oranizationInfo {
// height: 2rem;

View File

@ -353,15 +353,15 @@ export default {
margin-bottom: 10px;
}
.departmentManagement {
height: 85vh;
height: 90vh;
.left {
height: 85vh;
height:90vh;
}
.right {
.button{
display:flex;
}
height: 85vh;
height: 90vh;
.userdeparment {
// font-size: 18px;
}

View File

@ -42,7 +42,7 @@
<i class="el-icon-upload2"></i> 全部导出
</el-button>
</div>
<el-table size="large" border height="calc(100vh - 210px)" v-loading="loading" :data="tableData"
<el-table size="large" border height="calc(100vh - 250px)" v-loading="loading" :data="tableData"
style="width: 100%;border:1px solid #ccc;" element-loading-text="加载中..."
element-loading-spinner="el-icon-loading" element-loading-background="rgba(255, 255, 255, 0.8)">
<el-table-column v-if="searchData.radioType!='1'&&searchData.radioType!='3'" prop="date" label="图片" width="180">
@ -107,7 +107,7 @@
</template>
</el-table-column>
</el-table>
<el-pagination style="background-color: white;" @size-change="handleSizeChange"
<el-pagination class="pageBox" @size-change="handleSizeChange"
@current-change="handleCurrentChange" :current-page.sync="current_page" :page-size="page_size"
layout="total, prev, pager, next" :total="total_count">
</el-pagination>
@ -178,7 +178,7 @@ export default {
value: '2',
publish_type: '1',
manager_self: null,
},
},
],
radioMap: {
'1': {
@ -364,7 +364,7 @@ export default {
this.searchData.manager_self = this.radioMap[value].manager_self;
}
}
//
this.searchData.current_page = 1;
this.getTableData();
@ -470,7 +470,7 @@ export default {
// manager_self
let manager_self = null;
let publish_type = null;
if (this.role.type === 'user') {
const selectedItem = this.userMap.find(item => item.value === this.searchData.radioType);
if (selectedItem) {
@ -483,14 +483,14 @@ export default {
manager_self = this.searchData.radioType=='4'||this.searchData.radioType=='3'?'single':null;
}
}
//
const requestData = {
...this.searchData,
publish_type: publish_type,
manager_self: manager_self
};
console.log('请求参数:', requestData);
requestData.manager_self=this.searchData.radioType=='4'||this.searchData.radioType=='3'?'single':null
requestData.publish_type = this.searchData.radioType=='1'||this.searchData.radioType=='3'?'2':'1'
@ -509,7 +509,7 @@ export default {
this.loading = false;
})
}
},
//
handleSizeChange(val) {
@ -567,7 +567,7 @@ export default {
}
.table-box {
height: calc(100vh - 120px);
height: calc(100vh - 150px);
padding: 10px;
background-color: white;
@ -602,4 +602,9 @@ export default {
display: flex;
margin-right: 10px;
}
.pageBox{
width: 100%;
text-align: center;
margin: 10px;
}
</style>

View File

@ -45,9 +45,9 @@
<span class="language-text">{{ language === 'zh' ? 'English' : '中文' }}</span>
</div>
<!-- AI -->
<i class="iconfont icon-AIzhushou functions"></i>
<i class="iconfont icon-AIzhushou functions" @click="handleAIClick"></i>
<!-- 客服 -->
<i class="iconfont icon-kefu functions"></i>
<i class="iconfont icon-kefu functions" @click="handleServiceClick"></i>
<!-- 控制台按钮已登录 -->
<a @click="goB" v-if="loginState" class="login-btn">{{ translations[language].console }}</a>
<!-- 消息 - 修改这里点击时打开消息中心 -->
@ -217,6 +217,7 @@ export default Vue.extend({
},
data() {
return {
messageCenterVisible: false, //
homePath: getHomePath(), //
isShowKbossCharge: false, // Kboss
role: sessionStorage.getItem("jueseNew") == "admin" ? [] : sessionStorage.getItem("jueseNew"), //
@ -250,6 +251,9 @@ export default Vue.extend({
login: '登录',
register: '立即注册',
noData: '暂无数据',
aiAssistant: 'AI助手',
customerService: '在线客服',
featureComingSoon: '功能即将上线,敬请期待!',
//
'云': '云',
'算': '算',
@ -362,6 +366,9 @@ export default Vue.extend({
login: 'Login',
register: 'Register Now',
noData: 'No Data',
aiAssistant: 'AI Assistant',
customerService: 'Customer Service',
featureComingSoon: 'Feature coming soon, stay tuned!',
//
'云': 'Cloud',
'算': 'Computing',
@ -535,10 +542,28 @@ export default Vue.extend({
},
},
methods: {
// AI
handleAIClick() {
this.$message.info({
message: this.translations[this.language].featureComingSoon,
duration: 3000,
showClose: true
});
},
//
handleServiceClick() {
this.$message.info({
message: this.translations[this.language].featureComingSoon,
duration: 3000,
showClose: true
});
},
//
handleMessageClick() {
if (this.loginState) {
//
//
this.messageCenterVisible = true;
//
@ -930,7 +955,7 @@ export default Vue.extend({
this.showPanelRightData = this.threeData
},
// 使
//
networkData() {
return networkData
},
@ -1154,6 +1179,7 @@ export default Vue.extend({
padding-right: 20px;
font-size: 20px;
color: #000;
cursor: pointer;
&:hover {
color: #1E6FFF;

View File

@ -57,7 +57,7 @@
<!-- 用户信息 -->
<div class="user card">
<div class="userImg">
<div class="imgUser">{{ userInfo.username.charAt(0) }}</div>
<div class="imgUser">{{ userInfo.username ? userInfo.username.charAt(0) : '' }}</div>
</div>
<div class="userBox">
<h3>{{ userInfo.username }}</h3>
@ -72,7 +72,7 @@
<div class="price card">
<div class="title">账户余额</div>
<div class="content">
<span class="balance">{{ initMybalance() }}</span>
<span class="balance">{{ displayBalance }}</span>
<el-button size="mini" type="primary" @click="$router.push('/kbossCharge')">
立即充值
</el-button>
@ -94,7 +94,7 @@
<script>
import Vue from 'vue'
import { mapState } from "vuex";
import { mapState, mapActions } from "vuex";
import { reqNewHomeResource, reqNewHomeResourceWarning, reqQuickNav } from "@/api/newHome";
export default Vue.extend({
@ -109,31 +109,122 @@ export default Vue.extend({
email: ""
},
viewList: [],
navList: []
navList: [],
localBalance: '0.00' //
}
},
computed: {
...mapState({
mybalance: state => state.user.mybalance,
}),
// 使 Vuex
displayBalance() {
if (this.mybalance && this.mybalance !== '0.00') {
return this.mybalance;
}
return this.localBalance;
}
},
mounted() {
reqQuickNav().then(res => {
this.navList = res.data
})
this.userInfo = JSON.parse(localStorage.getItem("user_info") || "{}");
reqNewHomeResource().then(res => {
if (res.status) {
this.viewList = res.data || [];
} else {
this.$message.error(res.msg);
}
})
reqNewHomeResourceWarning().then(res => {
if (res.status) {
this.tableData = res.data || [];
} else {
this.$message.error(res.msg);
}
})
this.initPage();
},
methods: {
async initPage() {
try {
//
const [navRes, resourceRes, warningRes] = await Promise.all([
reqQuickNav(),
reqNewHomeResource(),
reqNewHomeResourceWarning()
]);
this.navList = navRes.data;
if (resourceRes.status) {
this.viewList = resourceRes.data || [];
} else {
this.$message.error(resourceRes.msg);
}
if (warningRes.status) {
this.tableData = warningRes.data || [];
} else {
this.$message.error(warningRes.msg);
}
//
this.initUserInfo();
//
await this.initBalance();
} catch (error) {
console.error('初始化页面失败:', error);
this.$message.error('页面初始化失败');
}
},
initUserInfo() {
const userInfoStr = localStorage.getItem("user_info");
if (userInfoStr) {
try {
this.userInfo = JSON.parse(userInfoStr);
} catch (e) {
console.error('解析用户信息失败:', e);
this.userInfo = {};
}
}
},
async initBalance() {
try {
// sessionStorage
const sessionBalance = sessionStorage.getItem('mybalance');
if (sessionBalance) {
this.localBalance = sessionBalance;
}
//
if (this.userInfo.id) {
await this.fetchUserBalance();
}
// Vuex
if (this.mybalance && this.mybalance !== '0.00') {
this.localBalance = this.mybalance;
sessionStorage.setItem('mybalance', this.mybalance);
}
} catch (error) {
console.error('初始化余额失败:', error);
// 使
this.localBalance = '0.00';
}
},
async fetchUserBalance() {
// API
// API
// const balanceRes = await reqUserBalance(this.userInfo.id);
// if (balanceRes.status) {
// this.localBalance = balanceRes.data.balance;
// sessionStorage.setItem('mybalance', this.localBalance);
// // Vuex
// this.$store.commit('user/SET_MYBALANCE', this.localBalance);
// }
//
// API
setTimeout(() => {
const mockBalance = '100.00'; //
this.localBalance = mockBalance;
sessionStorage.setItem('mybalance', mockBalance);
this.$store.commit('user/SET_MYBALANCE', mockBalance);
}, 100);
},
goBaidu(item) {
this.$store.commit('setRedirectUrl', item.url)
localStorage.setItem('redirectUrl', item.url)
@ -145,16 +236,20 @@ export default Vue.extend({
url: item.url
}
})
},
initMybalance() {
return sessionStorage.getItem('mybalance') || '0.00'
},
},
computed: {
...mapState({
mybalance: state => state.user.mybalance,
})
}
},
//
watch: {
'userInfo.id': {
handler(newVal) {
if (newVal) {
this.fetchUserBalance();
}
},
immediate: true
}
}
})
</script>
@ -442,7 +537,3 @@ export default Vue.extend({
}
}
</style>