Skip to content

Commit

Permalink
粘贴修改单
Browse files Browse the repository at this point in the history
  • Loading branch information
Dusongg committed Aug 27, 2024
1 parent e95877b commit dc3db46
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 14 deletions.
12 changes: 6 additions & 6 deletions inboxInter.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,18 @@ func CreateInBoxInterface(client pb.ServiceClient, mw fyne.Window) fyne.CanvasOb
}

searchEntry := widget.NewEntry()
searchChoose := widget.NewSelect([]string{"TaskId", "Principal", "ReqNo", "Deadline", "SQL"}, func(s string) {
searchChoose := widget.NewSelect([]string{"修改单号", "负责人", "需求号", "截止日期", "SQL"}, func(s string) {
switch s {
case "TaskId":
case "修改单号":
searchEntry.SetText("")
searchEntry.Refresh()
case "Principal":
case "负责人":
searchEntry.SetText("")
searchEntry.Refresh()
case "ReqNo":
case "需求号":
searchEntry.SetText("")
searchEntry.Refresh()
case "Deadline":
case "截止日期":
searchEntry.SetText("Usage: 2006-01-02")
searchEntry.Refresh()
case "SQL":
Expand All @@ -110,6 +110,7 @@ func CreateInBoxInterface(client pb.ServiceClient, mw fyne.Window) fyne.CanvasOb
activity := widget.NewActivity()
searchBtn := widget.NewButtonWithIcon("", theme.SearchIcon(), func() {
activity.Start()
defer activity.Stop()
if searchEntry.Text == "" {
tableData = flushData(client, mw)
table.Refresh()
Expand All @@ -133,7 +134,6 @@ func CreateInBoxInterface(client pb.ServiceClient, mw fyne.Window) fyne.CanvasOb
tableData = buildData(rep.Tasks)
table.Refresh()
}
activity.Stop()
})
flushBtn := widget.NewButtonWithIcon("", theme.ViewRefreshIcon(), func() {
searchBtn.SetText("")
Expand Down
7 changes: 4 additions & 3 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@
// TODO 2. 离线用户接受消息 √

// 2024.8.23
// TODO 1. 分组显示
// TODO 1. 分组显示

//0224.8.27
//TODO 1. 收件箱新增按姓名搜索
//TODO 2. team修改排列顺序
//TODO 1. 收件箱新增按姓名搜索
//TODO 2. team修改排列顺序
//TODO 3. account和team界面分离(尝试)
//TODO 4. 修改预览界面的用户任务搜索

package main

Expand Down
28 changes: 23 additions & 5 deletions preViewinter.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,16 +192,20 @@ func CreatePreviewInterface(appTab *container.AppTabs, client pb.ServiceClient,
}
}
})

accountEty := widget.NewEntry()
accountEty.PlaceHolder = "请输入姓名进行查询"
preSearch := ""
accountBtn := widget.NewButtonWithIcon("", theme.AccountIcon(), func() {
curView = AccountView
if accountEty.Text != "" {
preSearch = accountEty.Text
//TODO:没有考虑用户是否存在
data, expired = loadAccountGrid(client, mw, accountEty.Text)
} else {
} else if preSearch != "" { //防止重复刷新
preSearch = ""
data, expired = loadAccountGrid(client, mw, config.Cfg.Login.UserName)
}
curView = AccountView
appTab.Items[0].Content = container.NewBorder(topBtn, bottom, nil, nil, viewGrid[accountViewPage])
appTab.Refresh()

Expand Down Expand Up @@ -371,7 +375,11 @@ func tidyTeamGrid(data map[string]soredTV, expired []*pb.Task, mw fyne.Window) f
for j := 0; len(val) != 0 && j < 31; j++ { //日期 +2为grid表格
if val[0].deadPoint == j {
for val[0].deadPoint == j {
infoMap[(int64(i+1)<<32)|int64(j+2)] = append(infoMap[(int64(i+1)<<32)|int64(j+2)], fmt.Sprintf("%s (%d)", val[0].taskId, val[0].time))
if val[0].time > 8 {
infoMap[(int64(i+1)<<32)|int64(j+2)] = append(infoMap[(int64(i+1)<<32)|int64(j+2)], fmt.Sprintf("%s (%d)", val[0].taskId, val[0].time))
} else {
infoMap[(int64(i+1)<<32)|int64(j+2)] = append(infoMap[(int64(i+1)<<32)|int64(j+2)], val[0].taskId)
}
val = val[1:]
if len(val) == 0 {
break
Expand Down Expand Up @@ -412,11 +420,21 @@ func tidyTeamGrid(data map[string]soredTV, expired []*pb.Task, mw fyne.Window) f
btn.SetText(value[0])
}

if len(value) > 1 {
if len(value) > 1 || strings.HasSuffix(value[0], ")") {
btn.Importance = widget.DangerImportance
}
btn.OnTapped = func() {
dialog.ShowInformation("TaskInfo", strings.Join(value, "\r\n"), mw)
//dialog.ShowInformation("TaskInfo", strings.Join(value, "\r\n"), mw)
popupWindow := fyne.CurrentApp().NewWindow("tasklist window")
label := widget.NewLabel(strings.Join(value, "\r\n"))
copyBtn := widget.NewButton("Copy", func() {
clipboard := fyne.CurrentApp().Driver().AllWindows()[0].Clipboard()
clipboard.SetContent(label.Text)
})
popupContent := container.NewBorder(nil, copyBtn, nil, nil, label)
popupWindow.SetContent(popupContent)
popupWindow.Resize(fyne.NewSize(300, 150))
popupWindow.Show()
}
} else {
btn.Hidden = true
Expand Down

0 comments on commit dc3db46

Please sign in to comment.