From 9725528c8b6a1539199efe5bcc253bdbeafdd041 Mon Sep 17 00:00:00 2001
From: hrx <18603305412@163.com>
Date: Tue, 18 Nov 2025 10:08:21 +0800
Subject: [PATCH] updata
---
.../src/components/Pagination/index.vue | 606 +++++++++++++++---
.../src/views/customer/userResource/index.vue | 341 +++++-----
2 files changed, 722 insertions(+), 225 deletions(-)
diff --git a/f/web-kboss/src/components/Pagination/index.vue b/f/web-kboss/src/components/Pagination/index.vue
index c815e13..bd6ac67 100644
--- a/f/web-kboss/src/components/Pagination/index.vue
+++ b/f/web-kboss/src/components/Pagination/index.vue
@@ -1,101 +1,545 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+

集群一
@@ -103,9 +107,23 @@
+
+
+
-
+
@@ -122,10 +140,8 @@
{{ scope.row.productname }}* {{ scope.row.gpu }}卡
-
查看详情
-
存储: {{ scope.row.storage }} G
CPU: {{ scope.row.cpu }} 核
@@ -137,7 +153,6 @@
-
正常
@@ -153,23 +168,16 @@
-
-
-
-
-
@@ -177,52 +185,41 @@
关机
-
+
{{ cpccDetail.id }}
{{ cpccDetail.source_name }}
进行中
-
正常
-
{{ cpccDetail.source_authuser }}
****
-
{{ cpccDetail.source_authpasswd }}
-
-
-
{{ cpccDetail.source_externalip }}
{{ cpccDetail.source_outsideport }}
-
{{ cpccDetail.source_memrate }}
{{ cpccDetail.source_cpurate }}
{{ cpccDetail.source_storagelimits }}
{{ cpccDetail.disk_sys_limit }}
- {{
- cpccDetail.source_gpu
- }}
+ {{ cpccDetail.source_gpu }}
-
@@ -239,7 +236,9 @@ import SshTerminal from "@/views/customer/userResource/SshTerminal.vue";
export default {
name: "userResource",
- components: { SshTerminal },
+ components: {
+ SshTerminal
+ },
data() {
return {
isShowPass: false,
@@ -252,132 +251,181 @@ export default {
tableData: [],
loading: false,
dialogTableVisible: false,
- datailList: []
+ datailList: [],
+ total: 0,
+ dateRange: [],
+ queryParams: {
+ productname: '', // 搜索关键词
+ start_date: '', // 开始时间
+ end_date: '', // 结束时间
+ page: 1, // 页码
+ page_size: 10, // 每页数量
+ }
};
},
mounted() {
- this.loading = true
- this.getCustomerGoods()
- console.log("用户资源的路由信息是", this.$route)
- // this.initTerminal()
+ this.loading = true;
+ this.getCustomerGoods();
+ console.log("用户资源的路由信息是", this.$route);
},
-
methods: {
+ // 搜索处理
+ handleSearch() {
+ this.queryParams.page = 1; // 搜索时重置到第一页
+ this.getCustomerGoods();
+ },
+
+ // 重置搜索
+ handleReset() {
+ this.queryParams = {
+ productname: '',
+ start_date: '',
+ end_date: '',
+ page: 1,
+ page_size: 10,
+ };
+ this.dateRange = [];
+ this.getCustomerGoods();
+ },
+
+ // 日期选择处理
+ handleDateChange(value) {
+ if (value && value.length === 2) {
+ this.queryParams.start_date = value[0];
+ this.queryParams.end_date = value[1];
+ } else {
+ this.queryParams.start_date = '';
+ this.queryParams.end_date = '';
+ }
+ },
+
+ // 每页数量变化
+ handleSizeChange(val) {
+ this.queryParams.page_size = val;
+ this.getCustomerGoods();
+ },
+
+ // 当前页码变化
+ handleCurrentChange(val) {
+ this.queryParams.page = val;
+ this.getCustomerGoods();
+ },
+
+ // 获取用户资源列表
+ async getCustomerGoods() {
+ this.loading = true;
+ try {
+ const res = await getCustomerGoodsAPI(this.queryParams);
+ if (res.status === true) {
+ this.tableData = res.data;
+ this.total = res.pagination.total;
+ } else {
+ this.$message.error('获取数据失败');
+ }
+ } catch (error) {
+ console.error('获取用户资源失败:', error);
+ this.$message.error('获取数据失败');
+ } finally {
+ this.loading = false;
+ }
+ },
+
openCpccDetail(row) {
-
- this.rqyVisible = true
-
- this.cpccDetail = row.instance_info
- },
- initTerminal() {
- let term = new Terminal();
- term.open(document.getElementById('terminal'));
- term.write('Hello from \x1B[1;3;31mxterm.js\x1B[0m $ ');
+ this.rqyVisible = true;
+ this.cpccDetail = row.instance_info;
},
+
copyText(value) {
- // 创建一个临时的textarea元素,用来执行复制操作
const textarea = document.createElement('textarea');
textarea.value = value;
document.body.appendChild(textarea);
-
- // 选中内容并执行复制
textarea.select();
document.execCommand('copy');
-
- // 移除临时的textarea元素
document.body.removeChild(textarea);
-
- // 可以添加一个提示给用户,表示已经复制成功
this.$message.success('已复制到剪贴板');
},
+
shutDownThree(item) {
- this.deleteBtnLoading = true
+ this.deleteBtnLoading = true;
let ploay = {
id: item.id,
podname: item.podname,
pvcname: item.pvcname,
customer_goods_id: item.customer_goods_id
- }
+ };
reqDeleteK8sCloud(ploay).then(res => {
- this.deleteBtnLoading = false
+ this.deleteBtnLoading = false;
if (res.status) {
- this.$message.success("删除成功~")
+ this.$message.success("删除成功~");
reqGetInstance({ customer_goods_id: item.id, orgid: sessionStorage.getItem('orgid') }).then(res => {
if (res.status) {
- this.datailList = res.data
+ this.datailList = res.data;
}
- })
+ });
} else {
- this.$message.warning("删除失败~")
+ this.$message.warning("删除失败~");
}
- })
+ });
},
+
nodeThree(row) {
- this.detailBtnLoading = true
+ this.detailBtnLoading = true;
reqGetInstance({ customer_goods_id: row.id, orgid: sessionStorage.getItem('orgid') }).then(res => {
- this.detailBtnLoading = false
+ this.detailBtnLoading = false;
if (res.status) {
- this.dialogTableVisible = true
- this.datailList = res.data
+ this.dialogTableVisible = true;
+ this.datailList = res.data;
}
- })
+ });
},
+
goCaption() {
- this.$router.push('/product/gpu/showGpu')
+ this.$router.push('/product/gpu/showGpu');
},
- //去优客得
+
goUcloud(region) {
- sessionStorage.setItem('region', region)
- this.$router.push('/product/ucloudProduct/showCloudHost')
+ sessionStorage.setItem('region', region);
+ this.$router.push('/product/ucloudProduct/showCloudHost');
},
- //去jd产品
+
goJd() {
- this.loading = true
- //直接跳转到京东页面
+ this.loading = true;
goJdUrl(this.userid).then(res => {
- this.loading = false
+ this.loading = false;
if (res.status) {
- window.open(res.data)
+ window.open(res.data);
} else {
- this.$message.error('跳转京东界面失败')
+ this.$message.error('跳转京东界面失败');
}
-
- })
-
+ });
},
- //去百度产品
+
goBaiDu(listUrl) {
- this.$store.commit('setRedirectUrl', listUrl)
- localStorage.setItem('redirectUrl', listUrl)
+ this.$store.commit('setRedirectUrl', listUrl);
+ localStorage.setItem('redirectUrl', listUrl);
this.$router.push({
name: 'baiduProductShow',
params: {
listUrl: listUrl,
}
- })
+ });
},
+
HpcAccessTime() {
HpcAccessTimeAPI({ orgid: sessionStorage.getItem("orgid") }).then(res => {
- if (rs.status == true) {
-
- }
- })
- },
- getCustomerGoods() {//获取用户资源
- getCustomerGoodsAPI({}).then(res => {
- this.loading = false
if (res.status == true) {
- this.tableData = res.data
+ // 处理访问时间
}
- })
+ });
},
- goJiNanChaoSuan() {//跳转济南超算平台
- this.HpcAccessTime()
+
+ goJiNanChaoSuan() {
+ this.HpcAccessTime();
var orgid = sessionStorage.getItem("orgid");
var username = sessionStorage.getItem("user");
let ploay = {
username: username
- }
+ };
getJinanchaosuanSign(ploay).then(res => {
if (res.status && res.warn_msg == null) {
window.open(
@@ -396,33 +444,27 @@ export default {
"_blank"
);
}
- })
-
+ });
},
},
};
-