优化操作流程界面,修改任务列表搜索和排序等
This commit is contained in:
@@ -30,7 +30,6 @@ func (self *AdminController) List() {
|
||||
|
||||
func (self *AdminController) Add() {
|
||||
self.Data["pageTitle"] = "新增管理员"
|
||||
|
||||
// 角色
|
||||
filters := make([]interface{}, 0)
|
||||
filters = append(filters, "status", 1)
|
||||
|
||||
@@ -13,9 +13,10 @@ import (
|
||||
|
||||
"fmt"
|
||||
|
||||
"strconv"
|
||||
|
||||
"github.com/astaxie/beego"
|
||||
"github.com/george518/PPGo_Job/models"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type ServerGroupController struct {
|
||||
@@ -29,10 +30,12 @@ func (self *ServerGroupController) List() {
|
||||
|
||||
func (self *ServerGroupController) Add() {
|
||||
self.Data["pageTitle"] = "新增分组"
|
||||
self.Data["hideTop"] = true
|
||||
self.display()
|
||||
}
|
||||
func (self *ServerGroupController) Edit() {
|
||||
self.Data["pageTitle"] = "编辑分组"
|
||||
self.Data["hideTop"] = true
|
||||
|
||||
id, _ := self.GetInt("id", 0)
|
||||
group, _ := models.TaskGroupGetById(id)
|
||||
|
||||
@@ -28,10 +28,10 @@ func (self *TaskController) List() {
|
||||
self.Data["pageTitle"] = "任务管理"
|
||||
self.Data["taskGroup"] = taskGroupLists(self.taskGroups, self.userId)
|
||||
self.Data["groupId"] = 0
|
||||
arr := strings.Split(self.Ctx.GetCookie("groupid"), "|")
|
||||
if len(arr) > 0 {
|
||||
self.Data["groupId"], _ = strconv.Atoi(arr[0])
|
||||
}
|
||||
//arr := strings.Split(self.Ctx.GetCookie("groupid"), "|")
|
||||
//if len(arr) > 0 {
|
||||
// self.Data["groupId"], _ = strconv.Atoi(arr[0])
|
||||
//}
|
||||
self.display()
|
||||
}
|
||||
|
||||
@@ -498,21 +498,22 @@ func (self *TaskController) Table() {
|
||||
|
||||
//0-全部,-1如果存在,n,如果不存在,0
|
||||
|
||||
if groupId == -1 {
|
||||
groupId = 0
|
||||
arr := strings.Split(self.Ctx.GetCookie("groupid"), "|")
|
||||
if len(arr) > 0 {
|
||||
groupId, _ = strconv.Atoi(arr[0])
|
||||
}
|
||||
}
|
||||
//if groupId == -1 {
|
||||
// groupId = 0
|
||||
// arr := strings.Split(self.Ctx.GetCookie("groupid"), "|")
|
||||
// if len(arr) > 0 {
|
||||
// groupId, _ = strconv.Atoi(arr[0])
|
||||
// }
|
||||
//}
|
||||
|
||||
if groupId > 0 {
|
||||
self.Ctx.SetCookie("groupid", strconv.Itoa(groupId)+"|job")
|
||||
}
|
||||
//if groupId > 0 {
|
||||
// self.Ctx.SetCookie("groupid", strconv.Itoa(groupId)+"|job")
|
||||
//}
|
||||
|
||||
status, _ := self.GetInt("status")
|
||||
|
||||
taskName := strings.TrimSpace(self.GetString("taskName"))
|
||||
taskName := strings.TrimSpace(self.GetString("task_name"))
|
||||
|
||||
StatusText := []string{
|
||||
"<font color='red'><i class='fa fa-minus-square'></i></font>",
|
||||
"<font color='green'><i class='fa fa-check-square'></i></font>",
|
||||
@@ -552,6 +553,8 @@ func (self *TaskController) Table() {
|
||||
filters = append(filters, "task_name__icontains", taskName)
|
||||
}
|
||||
|
||||
//fmt.Println(filters, "----------", taskName)
|
||||
|
||||
result, count := models.TaskGetList(page, self.pageSize, filters...)
|
||||
list := make([]map[string]interface{}, len(result))
|
||||
|
||||
|
||||
@@ -13,9 +13,10 @@ import (
|
||||
|
||||
"fmt"
|
||||
|
||||
"strconv"
|
||||
|
||||
"github.com/astaxie/beego"
|
||||
"github.com/george518/PPGo_Job/models"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
type GroupController struct {
|
||||
@@ -29,11 +30,12 @@ func (self *GroupController) List() {
|
||||
|
||||
func (self *GroupController) Add() {
|
||||
self.Data["pageTitle"] = "新增分组"
|
||||
self.Data["hideTop"] = true
|
||||
self.display()
|
||||
}
|
||||
func (self *GroupController) Edit() {
|
||||
self.Data["pageTitle"] = "编辑分组"
|
||||
|
||||
self.Data["hideTop"] = true
|
||||
id, _ := self.GetInt("id", 0)
|
||||
group, _ := models.GroupGetById(id)
|
||||
row := make(map[string]interface{})
|
||||
|
||||
Reference in New Issue
Block a user