mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-03 20:40:26 +08:00
支持购买套餐/续费套餐/用户账户操作等
This commit is contained in:
@@ -380,6 +380,18 @@ func (this *RPCClient) UserBillRPC() pb.UserBillServiceClient {
|
||||
return pb.NewUserBillServiceClient(this.pickConn())
|
||||
}
|
||||
|
||||
func (this *RPCClient) UserAccountRPC() pb.UserAccountServiceClient {
|
||||
return pb.NewUserAccountServiceClient(this.pickConn())
|
||||
}
|
||||
|
||||
func (this *RPCClient) UserAccountLogRPC() pb.UserAccountLogServiceClient {
|
||||
return pb.NewUserAccountLogServiceClient(this.pickConn())
|
||||
}
|
||||
|
||||
func (this *RPCClient) UserAccountDailyStatRPC() pb.UserAccountDailyStatServiceClient {
|
||||
return pb.NewUserAccountDailyStatServiceClient(this.pickConn())
|
||||
}
|
||||
|
||||
func (this *RPCClient) UserAccessKeyRPC() pb.UserAccessKeyServiceClient {
|
||||
return pb.NewUserAccessKeyServiceClient(this.pickConn())
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import (
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
"net"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"reflect"
|
||||
"strings"
|
||||
)
|
||||
@@ -368,12 +369,31 @@ func (this *userMustAuth) modules(actionPtr actions.ActionWrapper, adminId int64
|
||||
"icon": "users",
|
||||
},
|
||||
{
|
||||
"code": "finance",
|
||||
"module": configloaders.AdminModuleCodeFinance,
|
||||
"name": "财务管理",
|
||||
"icon": "yen sign",
|
||||
"isOn": teaconst.IsPlus,
|
||||
"subItems": []maps.Map{},
|
||||
"code": "finance",
|
||||
"module": configloaders.AdminModuleCodeFinance,
|
||||
"name": "财务管理",
|
||||
"icon": "yen sign",
|
||||
"isOn": teaconst.IsPlus,
|
||||
"subItems": []maps.Map{
|
||||
{
|
||||
"name": "用户账户",
|
||||
"url": "/finance/accounts",
|
||||
"code": "accounts",
|
||||
"isOn": teaconst.IsPlus,
|
||||
},
|
||||
{
|
||||
"name": "操作记录",
|
||||
"url": "/finance/logs",
|
||||
"code": "logs",
|
||||
"isOn": teaconst.IsPlus,
|
||||
},
|
||||
{
|
||||
"name": "收支报表",
|
||||
"url": "/finance/income",
|
||||
"code": "income",
|
||||
"isOn": teaconst.IsPlus,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"code": "plans",
|
||||
@@ -443,5 +463,5 @@ func (this *userMustAuth) modules(actionPtr actions.ActionWrapper, adminId int64
|
||||
|
||||
// 跳转到登录页
|
||||
func (this *userMustAuth) login(action *actions.ActionObject) {
|
||||
action.RedirectURL("/")
|
||||
action.RedirectURL("/?from=" + url.QueryEscape(action.Request.RequestURI))
|
||||
}
|
||||
|
||||
33
web/public/js/components/finance/finance-user-selector.js
Normal file
33
web/public/js/components/finance/finance-user-selector.js
Normal file
@@ -0,0 +1,33 @@
|
||||
Vue.component("finance-user-selector", {
|
||||
mounted: function () {
|
||||
let that = this
|
||||
|
||||
Tea.action("/finance/users/options")
|
||||
.post()
|
||||
.success(function (resp) {
|
||||
that.users = resp.data.users
|
||||
})
|
||||
},
|
||||
props: ["v-user-id"],
|
||||
data: function () {
|
||||
let userId = this.vUserId
|
||||
if (userId == null) {
|
||||
userId = 0
|
||||
}
|
||||
return {
|
||||
users: [],
|
||||
userId: userId
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
userId: function (v) {
|
||||
this.$emit("change", v)
|
||||
}
|
||||
},
|
||||
template: `<div>
|
||||
<select class="ui dropdown auto-width" name="userId" v-model="userId">
|
||||
<option value="0">[选择用户]</option>
|
||||
<option v-for="user in users" :value="user.id">{{user.fullname}} ({{user.username}})</option>
|
||||
</select>
|
||||
</div>`
|
||||
})
|
||||
@@ -19,6 +19,11 @@ Vue.component("plan-user-selector", {
|
||||
userId: userId
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
userId: function (v) {
|
||||
this.$emit("change", v)
|
||||
}
|
||||
},
|
||||
template: `<div>
|
||||
<select class="ui dropdown auto-width" name="userId" v-model="userId">
|
||||
<option value="0">[选择用户]</option>
|
||||
|
||||
16
web/public/js/components/users/user-link.js
Normal file
16
web/public/js/components/users/user-link.js
Normal file
@@ -0,0 +1,16 @@
|
||||
Vue.component("user-link", {
|
||||
props: ["v-user", "v-keyword"],
|
||||
data: function () {
|
||||
let user = this.vUser
|
||||
if (user == null) {
|
||||
user = {id: 0, "username": "", "fullname": ""}
|
||||
}
|
||||
return {
|
||||
user: user
|
||||
}
|
||||
},
|
||||
template: `<div style="display: inline-block">
|
||||
<span v-if="user.id > 0"><keyword :v-word="vKeyword">{{user.fullname}}</keyword><span class="small grey">(<keyword :v-word="vKeyword">{{user.username}}</keyword>)</span></span>
|
||||
<span v-else class="disabled">[已删除]</span>
|
||||
</div>`
|
||||
})
|
||||
6
web/views/@default/finance/income/@menu.html
Normal file
6
web/views/@default/finance/income/@menu.html
Normal file
@@ -0,0 +1,6 @@
|
||||
<first-menu>
|
||||
<menu-item href="." code="daily">按天统计</menu-item>
|
||||
<menu-item href=".monthly" code="monthly">按月统计</menu-item>
|
||||
</first-menu>
|
||||
|
||||
<div class="margin"></div>
|
||||
Reference in New Issue
Block a user