@@ -3,6 +3,7 @@ package models | |||
import ( | |||
"code.gitea.io/gitea/modules/log" | |||
"code.gitea.io/gitea/modules/timeutil" | |||
"fmt" | |||
"strconv" | |||
"strings" | |||
"xorm.io/builder" | |||
@@ -130,21 +131,27 @@ func (l RewardRecordShowList) loadAction() error { | |||
return nil | |||
} | |||
actionIds := make([]int64, 0) | |||
actionIdMap := make(map[int64]*RewardOperateRecordShow, 0) | |||
for _, r := range l { | |||
if r.SourceType != SourceTypeAccomplishTask.Name() { | |||
continue | |||
} | |||
i, _ := strconv.ParseInt(r.SourceId, 10, 64) | |||
actionIds = append(actionIds, i) | |||
actionIdMap[i] = r | |||
} | |||
actions, err := GetActionByIds(actionIds) | |||
if err != nil { | |||
return err | |||
} | |||
actionIdMap := make(map[string]*Action, 0) | |||
for _, v := range actions { | |||
actionIdMap[v.ID].Action = v.ToShow() | |||
actionIdMap[fmt.Sprint(v.ID)] = v | |||
} | |||
for i, r := range l { | |||
act := actionIdMap[r.SourceId] | |||
if act != nil { | |||
l[i].Action = act.ToShow() | |||
} | |||
} | |||
return nil | |||
} | |||
@@ -64,6 +64,18 @@ func QueryInvitaionPage(start int, pageSize int) ([]*Invitation, int64) { | |||
return invitationList, allCount | |||
} | |||
func QueryInvitaionByTime(startTime int64, endTime int64) []*Invitation { | |||
statictisSess := xStatistic.NewSession() | |||
defer statictisSess.Close() | |||
cond := "created_unix >=" + fmt.Sprint(startTime) + " and created_unix <=" + fmt.Sprint(endTime) | |||
invitationList := make([]*Invitation, 0) | |||
if err := statictisSess.Table(new(Invitation)).Where(cond).OrderBy("created_unix desc"). | |||
Find(&invitationList); err != nil { | |||
return nil | |||
} | |||
return invitationList | |||
} | |||
func InsertInvitaion(invitationUser *Invitation) error { | |||
statictisSess := xStatistic.NewSession() | |||
defer statictisSess.Close() | |||
@@ -1058,6 +1058,7 @@ modify_image=Modify Image | |||
image_exist=Image name has been used, please use a new one. | |||
image_committing=Image is submitting, please try again later. | |||
image_commit_fail=Failed to submit image, please try again later. | |||
image_over_20g=Failed to submit image, the size of image can not be over 20GB. | |||
image_not_exist=Image does not exits. | |||
image_edit_fail=Failed to edit image, please try again later. | |||
image_delete_fail=Failed to delete image, please try again later. | |||
@@ -1373,7 +1374,9 @@ fork_guest_user = Sign in to fork this repository. | |||
copy_link = Copy | |||
copy_link_success = Link has been copied | |||
copy_link_error = Use ⌘C or Ctrl-C to copy | |||
copy = Copy | |||
copied = Copied OK | |||
copied_error = Copied error | |||
unwatch = Unwatch | |||
watch = Watch | |||
unstar = Unstar | |||
@@ -3245,6 +3248,7 @@ load_code_failed=Fail to load code, please check if the right branch is selected | |||
error.dataset_select = dataset select error:the count exceed the limit or has same name | |||
new_train_gpu_tooltips = The code is storaged in <strong style="color:#010101">%s</strong>, the dataset is storaged in <strong style="color:#010101">%s</strong>, the pre-trained model is storaged in the environment <strong style="color:#010101">%s</strong>, and please put your model into <strong style="color:#010101">%s</strong> then you can download it online | |||
new_train_npu_tooltips = The code is storaged in <strong style="color:#010101">%s</strong>, the pre-trained model is storaged in the environment <strong style="color:#010101">%s</strong>, and please put your model into <strong style="color:#010101">%s</strong> then you can download it online | |||
new_infer_gpu_tooltips = The dataset is stored in <strong style="color:#010101">%s</strong>, the model file is stored in <strong style="color:#010101">%s</strong>, please store the inference output in <strong style="color:#010101">%s</strong> for subsequent downloads. | |||
[points] | |||
@@ -72,7 +72,7 @@ your_starred=已点赞 | |||
your_settings=设置 | |||
invite_friends=邀请好友 | |||
your_friend=您的好友 | |||
invite_you_to_join_the_OpenI_AI_Collaboration_Platform_and_enjoy_abundant_free_computing_resources=邀请你加入启智社区AI协作平台,畅享充沛的免费算力资源! | |||
invite_you_to_join_the_OpenI_AI_Collaboration_Platform_and_enjoy_abundant_free_computing_resources=邀请您加入启智社区AI协作平台,畅享充沛的免费算力资源! | |||
recommender=推荐人 | |||
all=所有 | |||
@@ -1059,6 +1059,7 @@ modify_image=修改镜像 | |||
image_exist=镜像Tag已被使用,请修改镜像Tag。 | |||
image_committing=镜像正在提交中,请稍后再试。 | |||
image_commit_fail=提交镜像失败,请稍后再试。 | |||
image_over_20g=提交镜像失败,镜像大小不能超过20GB。 | |||
image_not_exist=镜像不存在。 | |||
image_edit_fail=编辑镜像失败,请稍后再试。 | |||
image_delete_fail=删除镜像失败,请稍后再试。 | |||
@@ -1389,7 +1390,9 @@ fork_guest_user=登录并 派生 这个项目。 | |||
copy_link=复制链接 | |||
copy_link_success=已复制链接 | |||
copy_link_error=请按下 ⌘-C 或 Ctrl-C 复制 | |||
copy=复制 | |||
copied=复制成功 | |||
copied_error=复制失败 | |||
unwatch=取消关注 | |||
watch=关注 | |||
unstar=取消点赞 | |||
@@ -2022,7 +2025,7 @@ settings.githooks=管理 Git 钩子 | |||
settings.basic_settings=基本设置 | |||
settings.mirror_settings=镜像设置 | |||
settings.sync_mirror=同步 | |||
settings.mirror_sync_in_progress=镜像同步正在进行中,请稍后后再试。 | |||
settings.mirror_sync_in_progress=镜像同步正在进行中,请稍后再试。 | |||
settings.email_notifications.enable=启用邮件通知 | |||
settings.email_notifications.onmention=只在被提到时邮件通知 | |||
settings.email_notifications.disable=停用邮件通知 | |||
@@ -3101,9 +3104,9 @@ task_gputrainjob=`创建了CPU/GPU类型训练任务 <a href="%s/cloudbrain/trai | |||
task_c2netnputrainjob=`创建了NPU类型训练任务 <a href="%s/grampus/train-job/%s">%s</a>` | |||
task_c2netgputrainjob=`创建了CPU/GPU类型训练任务 <a href="%s/grampus/train-job/%s">%s</a>` | |||
binded_wechat=绑定微信 | |||
dataset_recommended=`创建的数据集<a href="%s/datasets">%s</a>被设置为推荐数据集` | |||
create_image=`提交了镜像<span style="font-weight:bold;">%s</span>` | |||
image_recommended=`提交的镜像<span style="font-weight:bold;">%s</span>被设置为推荐镜像` | |||
dataset_recommended=`创建的数据集 <a href="%s/datasets">%s</a> 被设置为推荐数据集` | |||
create_image=`提交了镜像 <span style="font-weight:bold;">%s</span>` | |||
image_recommended=`提交的镜像 <span style="font-weight:bold;">%s</span> 被设置为推荐镜像` | |||
update_user_avatar=更新了头像 | |||
[tool] | |||
@@ -3264,6 +3267,7 @@ load_code_failed=代码加载失败,请确认选择了正确的分支。 | |||
error.dataset_select = 数据集选择错误:数量超过限制或者有同名数据集 | |||
new_train_gpu_tooltips =训练脚本存储在<strong style="color:#010101">%s</strong>中,数据集存储在<strong style="color:#010101">%s</strong>中,预训练模型存放在环境变量<strong style="color:#010101">%s</strong>中,训练输出请存储在<strong style="color:#010101">%s</strong>中以供后续下载。 | |||
new_train_npu_tooltips =训练脚本存储在<strong style="color:#010101">%s</strong>中,预训练模型存放在环境变量<strong style="color:#010101">%s</strong>中,训练输出请存储在<strong style="color:#010101">%s</strong>中以供后续下载。 | |||
new_infer_gpu_tooltips = 数据集存储在<strong style="color:#010101">%s</strong>中,模型文件存储在<strong style="color:#010101">%s</strong>中,推理输出请存储在<strong style="color:#010101">%s</strong>中以供后续下载。 | |||
[points] | |||
@@ -581,6 +581,8 @@ func RegisterRoutes(m *macaron.Macaron) { | |||
m.Get("/query_invitation_last_month", operationReq, repo_ext.QueryInvitationLastMonth) | |||
m.Get("/query_invitation_yesterday", operationReq, repo_ext.QueryInvitationYesterday) | |||
m.Get("/query_invitation_all", operationReq, repo_ext.QueryInvitationAll) | |||
m.Get("/query_invitation_userdefine", operationReq, repo_ext.QueryUserDefineInvitationPage) | |||
m.Get("/download_invitation_detail", operationReq, repo_ext.DownloadInvitationDetail) | |||
//cloudbrain board | |||
@@ -1147,6 +1147,8 @@ func CloudBrainCommitImage(ctx *context.Context, form auth.CommitImageCloudBrain | |||
} else if models.IsErrorImageCommitting(err) { | |||
ctx.JSON(200, models.BaseErrorMessage(ctx.Tr("repo.image_committing"))) | |||
} else if isOver20GError(err) { | |||
ctx.JSON(200, models.BaseErrorMessage(ctx.Tr("repo.image_over_20g"))) | |||
} else { | |||
ctx.JSON(200, models.BaseErrorMessage(ctx.Tr("repo.image_commit_fail"))) | |||
} | |||
@@ -1156,6 +1158,10 @@ func CloudBrainCommitImage(ctx *context.Context, form auth.CommitImageCloudBrain | |||
ctx.JSON(200, models.BaseOKMessage) | |||
} | |||
func isOver20GError(err error) bool { | |||
return strings.Contains(err.Error(), "over max image size 20GB") | |||
} | |||
func checkTopics(Topics string) ([]string, string) { | |||
var topics = make([]string, 0) | |||
var topicsStr = strings.TrimSpace(Topics) | |||
@@ -4,6 +4,8 @@ import ( | |||
"fmt" | |||
"net/http" | |||
"net/url" | |||
"sort" | |||
"time" | |||
"code.gitea.io/gitea/models" | |||
"code.gitea.io/gitea/modules/context" | |||
@@ -123,6 +125,9 @@ func DownloadInvitationDetail(ctx *context.Context) { | |||
for _, userRecord := range re { | |||
row++ | |||
userRecord.Name = userNameMap[userRecord.UserID] | |||
if userRecord.Name == "" { | |||
userRecord.Name = "已注销" | |||
} | |||
writeInvitationDetailExcel(row, xlsx, sheetName, userRecord) | |||
} | |||
indexTotal += PAGE_SIZE | |||
@@ -271,14 +276,156 @@ func QueryInvitationAll(ctx *context.Context) { | |||
queryDataFromStaticTable(ctx, "public.user_business_analysis_all", new(models.UserBusinessAnalysisAll)) | |||
} | |||
// func queryData(ctx *context.Context, startTime int64, endTime int64) { | |||
// page, pageSize := getPageInfo(ctx) | |||
// result, count := models.QueryInvitaionPage(startTime, endTime, (page-1)*pageSize, pageSize) | |||
// mapInterface := make(map[string]interface{}) | |||
// mapInterface["data"] = result | |||
// mapInterface["count"] = count | |||
// ctx.JSON(http.StatusOK, mapInterface) | |||
// } | |||
func QueryUserDefineInvitationPage(ctx *context.Context) { | |||
startDate := ctx.Query("startDate") | |||
endDate := ctx.Query("endDate") | |||
startTime, _ := time.ParseInLocation("2006-01-02", startDate, time.Local) | |||
//startTime = startTime.UTC() | |||
endTime, _ := time.ParseInLocation("2006-01-02", endDate, time.Local) | |||
queryData(ctx, startTime, endTime) | |||
} | |||
func queryData(ctx *context.Context, startTime time.Time, endTime time.Time) { | |||
page, pageSize := getPageInfo(ctx) | |||
IsReturnFile := ctx.QueryBool("IsReturnFile") | |||
dbResult := models.QueryInvitaionByTime(startTime.Unix(), endTime.Unix()) | |||
invitaionNumMap := make(map[int64]int, 0) | |||
allUserIds := make([]int64, 0) | |||
for _, record := range dbResult { | |||
if _, ok := invitaionNumMap[record.SrcUserID]; !ok { | |||
invitaionNumMap[record.SrcUserID] = 1 | |||
} else { | |||
invitaionNumMap[record.SrcUserID] = invitaionNumMap[record.SrcUserID] + 1 | |||
} | |||
} | |||
invitaionNumList := make([]models.Invitation, 0) | |||
for key, value := range invitaionNumMap { | |||
invi := models.Invitation{ | |||
SrcUserID: key, | |||
InvitationUserNum: value, | |||
} | |||
invitaionNumList = append(invitaionNumList, invi) | |||
allUserIds = append(allUserIds, key) | |||
} | |||
sort.Slice(invitaionNumList, func(i, j int) bool { | |||
return invitaionNumList[i].InvitationUserNum > invitaionNumList[j].InvitationUserNum | |||
}) | |||
if IsReturnFile { | |||
xlsx := excelize.NewFile() | |||
sheetName := ctx.Tr("user.static.invitationsheetname") | |||
index := xlsx.NewSheet(sheetName) | |||
xlsx.DeleteSheet("Sheet1") | |||
excelHeader := getInvitationExcelHeader(ctx) | |||
for k, v := range excelHeader { | |||
//设置单元格的值 | |||
xlsx.SetCellValue(sheetName, k, v) | |||
} | |||
end := 100 | |||
userMap := make(map[int64]*models.User, 0) | |||
log.Info("len(allUserIds)=" + fmt.Sprint(len(allUserIds))) | |||
for i := 0; i < len(allUserIds); i += 100 { | |||
if end >= len(allUserIds) { | |||
end = len(allUserIds) | |||
} | |||
log.Info("i=" + fmt.Sprint(i) + " end=" + fmt.Sprint(end)) | |||
if i == end { | |||
break | |||
} | |||
userList, err := models.GetUsersByIDs(allUserIds[i:end]) | |||
if err == nil { | |||
for _, tmp := range userList { | |||
userMap[tmp.ID] = tmp | |||
} | |||
} else { | |||
} | |||
end = end + 100 | |||
} | |||
row := 1 | |||
log.Info("len(userMap)=" + fmt.Sprint(len(userMap))) | |||
for _, userRecord := range invitaionNumList { | |||
row++ | |||
rows := fmt.Sprint(row) | |||
var tmp byte | |||
tmp = 0 | |||
xlsx.SetCellValue(sheetName, getColumn(tmp)+rows, userRecord.SrcUserID) | |||
tmp = tmp + 1 | |||
name := "已注销" | |||
if userMap[userRecord.SrcUserID] != nil { | |||
name = userMap[userRecord.SrcUserID].Name | |||
} | |||
xlsx.SetCellValue(sheetName, getColumn(tmp)+rows, name) | |||
tmp = tmp + 1 | |||
xlsx.SetCellValue(sheetName, getColumn(tmp)+rows, userRecord.InvitationUserNum) | |||
tmp = tmp + 1 | |||
Phone := "" | |||
if userMap[userRecord.SrcUserID] != nil { | |||
Phone = userMap[userRecord.SrcUserID].PhoneNumber | |||
} | |||
xlsx.SetCellValue(sheetName, getColumn(tmp)+rows, Phone) | |||
tmp = tmp + 1 | |||
formatTime := "" | |||
if userMap[userRecord.SrcUserID] != nil { | |||
formatTime = userMap[userRecord.SrcUserID].CreatedUnix.Format("2006-01-02 15:04:05") | |||
formatTime = formatTime[0 : len(formatTime)-3] | |||
} | |||
xlsx.SetCellValue(sheetName, getColumn(tmp)+rows, formatTime) | |||
} | |||
//设置默认打开的表单 | |||
xlsx.SetActiveSheet(index) | |||
filename := sheetName + "_" + getTimeFileName(startTime) + "_" + getTimeFileName(endTime) + ".xlsx" | |||
//filename := sheetName + "_" + ctx.Tr("user.static."+tableName) + ".xlsx" | |||
ctx.Resp.Header().Set("Content-Disposition", "attachment; filename="+url.QueryEscape(filename)) | |||
ctx.Resp.Header().Set("Content-Type", "application/octet-stream") | |||
if _, err := xlsx.WriteTo(ctx.Resp); err != nil { | |||
log.Info("writer exel error." + err.Error()) | |||
} | |||
} else { | |||
result := make([]*models.Invitation, 0) | |||
userIds := make([]int64, 0) | |||
end := len(invitaionNumList) - 1 | |||
for start := (page - 1) * pageSize; start <= end; start++ { | |||
invi := invitaionNumList[start] | |||
//todo name phone,createunix | |||
result = append(result, &invi) | |||
userIds = append(userIds, invi.SrcUserID) | |||
if len(result) == pageSize { | |||
break | |||
} | |||
} | |||
userList, err := models.GetUsersByIDs(userIds) | |||
if err == nil { | |||
for _, invi := range result { | |||
tmpUser := userList[0] | |||
for _, tmp := range userList { | |||
if tmp.ID == invi.SrcUserID { | |||
tmpUser = tmp | |||
break | |||
} | |||
} | |||
if invi.SrcUserID == tmpUser.ID { | |||
invi.Name = tmpUser.Name | |||
invi.Phone = tmpUser.PhoneNumber | |||
invi.CreatedUnix = tmpUser.CreatedUnix | |||
} else { | |||
invi.Name = "已注销" | |||
} | |||
} | |||
} else { | |||
log.Info("query user error." + err.Error()) | |||
} | |||
mapInterface := make(map[string]interface{}) | |||
mapInterface["data"] = result | |||
mapInterface["count"] = len(invitaionNumList) | |||
ctx.JSON(http.StatusOK, mapInterface) | |||
} | |||
} | |||
func getPageInfo(ctx *context.Context) (int, int) { | |||
page := ctx.QueryInt("page") | |||
@@ -61,7 +61,7 @@ func Accomplish(action models.Action) { | |||
actions = append(actions, models.Action{ | |||
ID: action.ID, | |||
OpType: models.ActionDatasetRecommended, | |||
ActUserID: action.UserID, | |||
ActUserID: action.ActUserID, | |||
UserID: user.ID, | |||
RepoID: action.RepoID, | |||
Content: action.Content, | |||
@@ -85,7 +85,11 @@ func accomplish(action models.Action, taskType models.TaskType) error { | |||
log.Error("PANIC:%v", combinedErr) | |||
} | |||
}() | |||
log.Info("accomplish start. actionId=%d userId= %d", action.ID, action.UserID) | |||
userId := action.UserID | |||
if !isUserAvailable(userId) { | |||
return nil | |||
} | |||
//get task config | |||
config, err := GetTaskConfig(string(taskType)) | |||
@@ -127,7 +131,7 @@ func accomplish(action models.Action, taskType models.TaskType) error { | |||
Type: models.GetRewardTypeInstance(config.AwardType), | |||
}, | |||
TargetUserId: userId, | |||
RequestId: fmt.Sprint(action.ID), | |||
RequestId: fmt.Sprintf("%d_%d", action.ID, userId), | |||
OperateType: models.OperateTypeIncrease, | |||
RejectPolicy: models.FillUp, | |||
}) | |||
@@ -143,3 +147,17 @@ func isLimited(userId int64, config *models.TaskConfig, rejectPolicy models.Limi | |||
return false | |||
} | |||
func isUserAvailable(userId int64) bool { | |||
if userId < 1 { | |||
return false | |||
} | |||
user, err := models.GetUserByID(userId) | |||
if err != nil || user == nil { | |||
return false | |||
} | |||
if user.IsOrganization() { | |||
return false | |||
} | |||
return true | |||
} |
@@ -205,11 +205,12 @@ | |||
<!-- 云脑侧名称 --> | |||
<div class="two wide column text center nowrap" | |||
style="overflow: hidden;text-overflow:ellipsis;width:10% !important;"> | |||
<span class="ui poping up clipboard" data-position="top center" id="clipboard-btn" style="cursor:pointer" | |||
<span class="ui poping up clipboard" data-position="top center" id="clipboard-btn-{{.JobName}}" style="cursor:pointer" | |||
data-clipboard-text="{{.JobName}}" | |||
data-success="{{$.i18n.Tr "repo.copy_link_success"}}" | |||
data-error="{{$.i18n.Tr "repo.copy_link_error"}}" | |||
data-content="{{$.i18n.Tr "repo.copy_link"}}" | |||
data-original="{{$.i18n.Tr "repo.copy"}}" | |||
data-success="{{$.i18n.Tr "repo.copied"}}" | |||
data-error="{{$.i18n.Tr "repo.copied_error"}}" | |||
data-content="{{$.i18n.Tr "repo.copy"}}" | |||
data-variation="inverted tiny" | |||
> | |||
<span class="fitted" title="{{.JobName}}">{{.JobName}}</span> | |||
@@ -106,7 +106,7 @@ | |||
{{template "custom/task_wait_count" .}} | |||
<div style="display: flex;align-items: center;margin-left: 156px;margin-top: 0.5rem;"> | |||
<i class="ri-error-warning-line" style="color: #f2711c;margin-right: 0.5rem;"></i> | |||
<span style="color: #888;font-size: 12px;">{{.i18n.Tr "cloudbrain.new_train_gpu_tooltips" "/cache/code" "/cache/dataset" "ckpt_url" "/cache/output" | Safe}}</span> | |||
<span style="color: #888;font-size: 12px;">{{.i18n.Tr "cloudbrain.new_train_npu_tooltips" "/cache/code" "ckpt_url" "/cache/output" | Safe}}</span> | |||
</div> | |||
</div> | |||
<div class="required min_title inline field" style="margin-bottom: 0rem !important;"> | |||
@@ -73,7 +73,7 @@ | |||
<td class="t-center">数据集被平台推荐</td> | |||
<td class="t-center point">-</td> | |||
<td class="t-center"><span class="typ">每日</span>积分获取上限<span class="limit"> - </span></td> | |||
<td>仅统计属于个人的数据集,属于组织的数据集暂不统计。</td> | |||
<td>数据集被推荐时,所有文件上传者都可获得奖励积分。</td> | |||
</tr> | |||
<tr key="CreateNewModelTask"> | |||
<td class="t-center">导入新模型</td> | |||
@@ -15,11 +15,11 @@ | |||
data-all-compute="{{.i18n.Tr "admin.cloudbrain.all_computing_resources"}}" | |||
data-all-status="{{.i18n.Tr "admin.cloudbrain.all_status"}}"></div> | |||
{{template "admin/cloudbrain/search_dashboard" .}} | |||
<div class="ui container" style="width: 90%;"> | |||
<div class="ui container" style="width:90%;overflow-x:auto;overflow-y:hidden"> | |||
{{template "base/alert" .}} | |||
<div class="ui grid"> | |||
<div class="ui grid" style="min-width:1700px;"> | |||
<div class="row"> | |||
<div class="ui sixteen wide column"> | |||
<div class="ui sixteen wide column" style="margin-bottom:15px;"> | |||
<!-- 任务展示 --> | |||
<div class="dataset list"> | |||
<!-- 表头 --> | |||
@@ -377,19 +377,18 @@ | |||
</div> | |||
{{end}} | |||
{{end}} | |||
<div id="app" style="margin-top: 2rem;"> | |||
<div class="center"> | |||
<el-pagination background @current-change="handleCurrentChange" :current-page="page" | |||
:page-sizes="[10]" :page-size="10" layout="total, sizes, prev, pager, next, jumper" | |||
:total="{{.Page.Paginater.Total}}"> | |||
</el-pagination> | |||
</div> | |||
</div> | |||
{{end}} | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<div id="app" style="margin-top: 2rem;margin-bottom: 2rem;"> | |||
<div class="center"> | |||
<el-pagination background @current-change="handleCurrentChange" :current-page="page" | |||
:page-sizes="[10]" :page-size="10" layout="total, sizes, prev, pager, next, jumper" | |||
:total="{{.Page.Paginater.Total}}"> | |||
</el-pagination> | |||
</div> | |||
</div> | |||
<!-- 确认模态框 --> | |||
@@ -164,9 +164,9 @@ const zh = { | |||
}, | |||
user: { | |||
inviteFriends: '邀请好友', | |||
inviteFriendsTips: '复制二维码或者邀请注册链接分享给好友', | |||
inviteFriendsTips: '复制二维码或者注册邀请链接分享给好友', | |||
clickToViewTheEventDetails: '点击查看活动详情', | |||
copyRegistrationInvitationLink: '复制邀请注册链接', | |||
copyRegistrationInvitationLink: '复制注册邀请链接', | |||
registrationAdress: '注册地址:', | |||
recommender: '推荐人:', | |||
invitedFriends: '已邀请好友', | |||
@@ -21,8 +21,8 @@ | |||
</div> | |||
</div> | |||
<div class="table-container"> | |||
<div style="min-height:600px;"> | |||
<el-table border :data="tableData" style="width: 100%;min-width:1700px;" v-loading="loading" stripe> | |||
<div style="min-height:600px;overflow-x:auto;"> | |||
<el-table border :data="tableData" style="width:100%;min-width:1700px;" v-loading="loading" stripe> | |||
<el-table-column prop="ID" label="ID" align="center" header-align="center" width="60"></el-table-column> | |||
<el-table-column prop="SpecStr" :label="$t('resourcesManagement.resourceSpecification')" align="left" | |||
header-align="center" min-width="160"> | |||
@@ -22,7 +22,7 @@ | |||
<div class="txt-2"><span>{{ $t('user.registrationAdress') }}</span><span>{{ invitationLink + invitationCode | |||
}}</span></div> | |||
<div class="txt-3"><span>{{ $t('user.recommender') }}</span><span>{{ invitationCode }}</span></div> | |||
<el-button class="__copy_link_btn__" type="primary" style="background:rgb(21, 114, 255);">{{ $t('user.copyRegistrationInvitationLink') }}</el-button> | |||
<el-button class="__copy_link_btn__" type="primary">{{ $t('user.copyRegistrationInvitationLink') }}</el-button> | |||
</div> | |||
<div class="qr-code"> | |||
<div id="__qr-code__" style="width:120px;height:120px;"></div> | |||
@@ -31,7 +31,7 @@ | |||
<div class="table-container"> | |||
<div> | |||
<el-table border :data="tableData" style="width:100%" v-loading="loading" stripe> | |||
<el-table-column prop="ID" :label="$t('user.invitedFriends')" align="left" header-align="left"> | |||
<el-table-column prop="ID" :label="$t('user.invitedFriends')" align="left" header-align="center"> | |||
<template slot-scope="scope"> | |||
<div style="display:flex;align-items:center;padding-left:20px;"> | |||
<img :src="scope.row.avatarSrc" alt="" style="height:45px;width:45px;margin-right:10px;" /> | |||
@@ -47,7 +47,7 @@ | |||
<el-table-column prop="regTime" :label="$t('user.registrationTime')" align="center" header-align="center"> | |||
</el-table-column> | |||
<template slot="empty"> | |||
<span style="font-size: 12px">{{ | |||
<span>{{ | |||
loading ? $t('loading') : $t('noData') | |||
}}</span> | |||
</template> | |||
@@ -271,6 +271,13 @@ export default { | |||
} | |||
} | |||
.__copy_link_btn__ { | |||
font-size: 14px; | |||
padding: 11px 15px; | |||
background: rgb(21, 114, 255); | |||
border-radius: 0; | |||
} | |||
.qr-code { | |||
width: 150px; | |||
display: flex; | |||
@@ -285,14 +292,15 @@ export default { | |||
/deep/ .el-table__header { | |||
th { | |||
background: rgb(245, 245, 246); | |||
font-size: 12px; | |||
font-size: 14px; | |||
color: rgb(36, 36, 36); | |||
font-weight: 400; | |||
} | |||
} | |||
/deep/ .el-table__body { | |||
td { | |||
font-size: 12px; | |||
font-size: 14px; | |||
} | |||
} | |||