Commit e85db9e6 authored by lijin's avatar lijin

modified

parent 5abbd4df
......@@ -413,11 +413,12 @@ export function backhaul(params) {
})
}
export function getGoogleTokenList() {
export function getGoogleTokenList(params) {
return request({
// url: 'http://localhost:8567/youtube/getTokenList',
url: process.env.PUTIN_API + '/youtube/getTokenList',
method: "get",
params
})
}
export function getYoutubeAccountList() {
......
<template>
<div class="app-container">
<div class="channel-management">
<div class="header-section">
<el-button type="primary" class="add-button" @click="authorize()" >添加频道</el-button>
<div class="info-text">
<i class="el-icon-info"></i>
<span>当前公共主体已授权2个,上限为15个,如有问题,请联系系统管理员</span>
<!-- 查询条件 -->
<div class="filter-container">
<!-- <div class="filter-item">
<span class="filter-label">名称</span>
<el-input v-model="queryParams.name" placeholder="请输入" clearable class="filter-input"></el-input>
</div> -->
<div class="filter-item">
<span class="filter-label">状态</span>
<el-select v-model="queryParams.status" placeholder="全部" clearable class="filter-input" @change="handleQuery">
<el-option label="全部" value=""></el-option>
<el-option label="正常" value="1"></el-option>
<el-option label="受限" value="2"></el-option>
</el-select>
</div>
</div>
<!-- 操作区 -->
<div class="operation-container">
<div class="operation-left">
<el-button type="primary" class="add-button" @click="authorize()" >添加频道</el-button>
</div>
<div class="operation-right">
<el-button icon="el-icon-refresh" class="refresh-btn" @click="handleQuery">刷新</el-button>
</div>
</div>
<!--&lt;!&ndash; <p v-if="authCode">授权码: {{ authCode }}</p>&ndash;&gt;-->
<!--&lt;!&ndash; <p v-if="accessToken">访问令牌: {{ accessToken }}</p>&ndash;&gt;-->
<!--&lt;!&ndash; <p v-if="refreshToken">刷新令牌: {{ refreshToken }}</p>&ndash;&gt;av-->
<el-table :data="tokenList" style="width: 100%" border >
<!-- <el-table-column prop="id" label="ID" width="50"></el-table-column>-->
<!--&lt;!&ndash; <el-table-column prop="appName" label="应用名" ></el-table-column>&ndash;&gt;-->
<!--&lt;!&ndash; <el-table-column prop="pkg" label="包名"></el-table-column>&ndash;&gt;-->
<!-- <el-table-column prop="alias" label="别名"></el-table-column>-->
<!-- <el-table-column prop="access_token" label="访问密钥"></el-table-column>-->
<!-- <el-table-column prop="refresh_token" label="刷新密钥"></el-table-column>-->
<!-- <el-table-column label="操作" width="100">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button type="primary" @click="handleDelete(scope.row)">删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column prop="create_time" label="创建时间" :formatter="formatDate"></el-table-column>-->
<!-- <el-table-column prop="update_time" label="更改时间":formatter="formatDate"></el-table-column>-->
<!-- <el-table-column prop="id" label="id" width="50"></el-table-column>-->
<el-table :data="tokenList" style="width: 100%" border v-loading="loading">
<el-table-column
prop="id"
label="频道ID"
width="100">
width="100"
align="center">
</el-table-column>
<el-table-column
prop="picture"
......@@ -47,24 +45,38 @@
<el-table-column
prop="name"
label="频道名称"
width="250">
width="250"
align="center">
</el-table-column>
<el-table-column
prop="email"
label="邮箱"
width="250">
width="250"
align="center">
</el-table-column>
<el-table-column
prop="status"
label="状态"
width="100"
align="center">
<template slot-scope="scope">
<el-tag :type="scope.row.status === 1 || scope.row.status === '1' ? 'success' : 'warning'">
{{ scope.row.status === 1 || scope.row.status === '1' ? '正常' : '受限' }}
</el-tag>
</template>
</el-table-column>
<el-table-column
prop="create_time"
:formatter="formatDate"
label="添加时间">
label="添加时间"
align="center">
</el-table-column>
<el-table-column
label="操作"
width="150">
width="150"
align="center">
<template slot-scope="scope">
<el-button type="text" size="small" class="operation-btn">编辑</el-button>
<el-button type="text" size="small" class="operation-btn" @click="handleDelete(scope.row)">删除</el-button>
......@@ -103,9 +115,16 @@ export default {
accessToken: null,
refreshToken: null,
tokenList: [],
loading: false,
showSuccessMessage: false,
showErrorMessage: false,
errorMessage: '',
queryParams: {
name: '',
status: '',
channel: '',
uploadStatus: ''
}
}),
created() {
this.getTokenList();
......@@ -151,9 +170,28 @@ export default {
},
handleQuery() {
this.getTokenList();
},
resetQuery() {
this.queryParams = {
name: '',
status: '',
channel: '',
uploadStatus: ''
};
this.getTokenList();
},
getTokenList(){
getGoogleTokenList().then(res => {
this.loading = true;
getGoogleTokenList(this.queryParams).then(res => {
this.tokenList = res.result.data;
this.loading = false;
}).catch(error => {
this.loading = false;
this.$message.error('获取频道列表失败: ' + error);
})
},
......@@ -167,9 +205,11 @@ export default {
type: 'warning'
})
.then(() => {
this.loading = true;
return deleteYouTubeAccountById({ id: row.id });
})
.then(response => {
this.loading = false;
if (response.status === 1) {
this.$message({
type: 'success',
......@@ -181,8 +221,9 @@ export default {
}
})
.catch(error => {
this.loading = false;
if (error === 'cancel') {
// 用户取消操作,不提示错误
} else {
this.$message.error('删除失败: ' + error);
}
......@@ -195,56 +236,60 @@ export default {
<style scoped>
.channel-management {
padding: 20px;
background-color: #fff;
border-radius: 4px;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}
.header-section {
/* 查询条件样式 */
.filter-container {
display: flex;
align-items: center;
margin-bottom: 20px;
padding: 15px 20px;
border-bottom: 1px solid #ebeef5;
}
.add-button {
background-color: #409EFF;
}
.info-text {
.filter-item {
display: flex;
align-items: center;
margin-left: 10px;
font-size: 12px;
color: #909399;
margin-right: 20px;
}
.info-text i {
margin-right: 5px;
.filter-label {
font-size: 14px;
color: #606266;
margin-right: 8px;
}
.operation-btn {
color: #409EFF;
padding: 0;
margin-right: 10px;
.filter-input {
width: 180px;
}
/* 操作区样式 */
.operation-container {
display: flex;
justify-content: space-between;
padding: 20px 0px;
background-color: #fff;
}
.pagination-container {
.operation-left {
display: flex;
justify-content: flex-end;
align-items: center;
margin-top: 20px;
}
.total-text {
margin-right: 15px;
font-size: 13px;
.operation-left .el-button {
margin-right: 10px;
}
.page-size-dropdown {
margin-left: 15px;
font-size: 13px;
cursor: pointer;
.operation-right .el-button {
font-size: 14px;
}
.el-dropdown-link {
color: #606266;
/* 表格样式 */
.el-table {
margin-top: 5px;
}
.operation-btn {
margin-right: 5px;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment