uptada
This commit is contained in:
parent
b8c117c1e8
commit
dad34ae571
@ -554,7 +554,7 @@ export default {
|
|||||||
|
|
||||||
<style lang="scss" scope>
|
<style lang="scss" scope>
|
||||||
.myOranization {
|
.myOranization {
|
||||||
height: 81vh;
|
height: 86vh;
|
||||||
|
|
||||||
.oranizationInfo {
|
.oranizationInfo {
|
||||||
// height: 2rem;
|
// height: 2rem;
|
||||||
|
|||||||
@ -353,15 +353,15 @@ export default {
|
|||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
.departmentManagement {
|
.departmentManagement {
|
||||||
height: 85vh;
|
height: 90vh;
|
||||||
.left {
|
.left {
|
||||||
height: 85vh;
|
height:90vh;
|
||||||
}
|
}
|
||||||
.right {
|
.right {
|
||||||
.button{
|
.button{
|
||||||
display:flex;
|
display:flex;
|
||||||
}
|
}
|
||||||
height: 85vh;
|
height: 90vh;
|
||||||
.userdeparment {
|
.userdeparment {
|
||||||
// font-size: 18px;
|
// font-size: 18px;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -42,7 +42,7 @@
|
|||||||
<i class="el-icon-upload2"></i> 全部导出
|
<i class="el-icon-upload2"></i> 全部导出
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</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="加载中..."
|
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)">
|
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">
|
<el-table-column v-if="searchData.radioType!='1'&&searchData.radioType!='3'" prop="date" label="图片" width="180">
|
||||||
@ -107,7 +107,7 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</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"
|
@current-change="handleCurrentChange" :current-page.sync="current_page" :page-size="page_size"
|
||||||
layout="total, prev, pager, next" :total="total_count">
|
layout="total, prev, pager, next" :total="total_count">
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
@ -567,7 +567,7 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.table-box {
|
.table-box {
|
||||||
height: calc(100vh - 120px);
|
height: calc(100vh - 150px);
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
background-color: white;
|
background-color: white;
|
||||||
|
|
||||||
@ -602,4 +602,9 @@ export default {
|
|||||||
display: flex;
|
display: flex;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
}
|
}
|
||||||
|
.pageBox{
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
margin: 10px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@ -45,9 +45,9 @@
|
|||||||
<span class="language-text">{{ language === 'zh' ? 'English' : '中文' }}</span>
|
<span class="language-text">{{ language === 'zh' ? 'English' : '中文' }}</span>
|
||||||
</div>
|
</div>
|
||||||
<!-- AI -->
|
<!-- 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>
|
<a @click="goB" v-if="loginState" class="login-btn">{{ translations[language].console }}</a>
|
||||||
<!-- 消息 - 修改这里:点击时打开消息中心 -->
|
<!-- 消息 - 修改这里:点击时打开消息中心 -->
|
||||||
@ -217,6 +217,7 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
messageCenterVisible: false, // 控制消息中心显示
|
||||||
homePath: getHomePath(), // 首页路径
|
homePath: getHomePath(), // 首页路径
|
||||||
isShowKbossCharge: false, // 是否显示Kboss充值按钮
|
isShowKbossCharge: false, // 是否显示Kboss充值按钮
|
||||||
role: sessionStorage.getItem("jueseNew") == "admin" ? [] : sessionStorage.getItem("jueseNew"), // 用户角色
|
role: sessionStorage.getItem("jueseNew") == "admin" ? [] : sessionStorage.getItem("jueseNew"), // 用户角色
|
||||||
@ -250,6 +251,9 @@ export default Vue.extend({
|
|||||||
login: '登录',
|
login: '登录',
|
||||||
register: '立即注册',
|
register: '立即注册',
|
||||||
noData: '暂无数据',
|
noData: '暂无数据',
|
||||||
|
aiAssistant: 'AI助手',
|
||||||
|
customerService: '在线客服',
|
||||||
|
featureComingSoon: '功能即将上线,敬请期待!',
|
||||||
// 一级菜单翻译
|
// 一级菜单翻译
|
||||||
'云': '云',
|
'云': '云',
|
||||||
'算': '算',
|
'算': '算',
|
||||||
@ -362,6 +366,9 @@ export default Vue.extend({
|
|||||||
login: 'Login',
|
login: 'Login',
|
||||||
register: 'Register Now',
|
register: 'Register Now',
|
||||||
noData: 'No Data',
|
noData: 'No Data',
|
||||||
|
aiAssistant: 'AI Assistant',
|
||||||
|
customerService: 'Customer Service',
|
||||||
|
featureComingSoon: 'Feature coming soon, stay tuned!',
|
||||||
// 一级菜单翻译
|
// 一级菜单翻译
|
||||||
'云': 'Cloud',
|
'云': 'Cloud',
|
||||||
'算': 'Computing',
|
'算': 'Computing',
|
||||||
@ -535,10 +542,28 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
handleMessageClick() {
|
||||||
if (this.loginState) {
|
if (this.loginState) {
|
||||||
// 已登录状态:打开消息中心
|
|
||||||
// 已登录状态:打开消息中心
|
// 已登录状态:打开消息中心
|
||||||
this.messageCenterVisible = true;
|
this.messageCenterVisible = true;
|
||||||
// 同时调用组件方法确保初始化
|
// 同时调用组件方法确保初始化
|
||||||
@ -930,7 +955,7 @@ export default Vue.extend({
|
|||||||
this.showPanelRightData = this.threeData
|
this.showPanelRightData = this.threeData
|
||||||
},
|
},
|
||||||
|
|
||||||
// 返回测试数据(未使用)
|
// 返回测试数据
|
||||||
networkData() {
|
networkData() {
|
||||||
return networkData
|
return networkData
|
||||||
},
|
},
|
||||||
@ -1154,6 +1179,7 @@ export default Vue.extend({
|
|||||||
padding-right: 20px;
|
padding-right: 20px;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
color: #000;
|
color: #000;
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
color: #1E6FFF;
|
color: #1E6FFF;
|
||||||
|
|||||||
@ -57,7 +57,7 @@
|
|||||||
<!-- 用户信息 -->
|
<!-- 用户信息 -->
|
||||||
<div class="user card">
|
<div class="user card">
|
||||||
<div class="userImg">
|
<div class="userImg">
|
||||||
<div class="imgUser">{{ userInfo.username.charAt(0) }}</div>
|
<div class="imgUser">{{ userInfo.username ? userInfo.username.charAt(0) : '' }}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="userBox">
|
<div class="userBox">
|
||||||
<h3>{{ userInfo.username }}</h3>
|
<h3>{{ userInfo.username }}</h3>
|
||||||
@ -72,7 +72,7 @@
|
|||||||
<div class="price card">
|
<div class="price card">
|
||||||
<div class="title">账户余额</div>
|
<div class="title">账户余额</div>
|
||||||
<div class="content">
|
<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 size="mini" type="primary" @click="$router.push('/kbossCharge')">
|
||||||
立即充值
|
立即充值
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -94,7 +94,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import { mapState } from "vuex";
|
import { mapState, mapActions } from "vuex";
|
||||||
import { reqNewHomeResource, reqNewHomeResourceWarning, reqQuickNav } from "@/api/newHome";
|
import { reqNewHomeResource, reqNewHomeResourceWarning, reqQuickNav } from "@/api/newHome";
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
@ -109,31 +109,122 @@ export default Vue.extend({
|
|||||||
email: ""
|
email: ""
|
||||||
},
|
},
|
||||||
viewList: [],
|
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() {
|
mounted() {
|
||||||
reqQuickNav().then(res => {
|
this.initPage();
|
||||||
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);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
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) {
|
goBaidu(item) {
|
||||||
this.$store.commit('setRedirectUrl', item.url)
|
this.$store.commit('setRedirectUrl', item.url)
|
||||||
localStorage.setItem('redirectUrl', item.url)
|
localStorage.setItem('redirectUrl', item.url)
|
||||||
@ -145,16 +236,20 @@ export default Vue.extend({
|
|||||||
url: item.url
|
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>
|
</script>
|
||||||
|
|
||||||
@ -442,7 +537,3 @@ export default Vue.extend({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user