框架优化

This commit is contained in:
hoteas 2022-03-26 16:53:40 +08:00
parent 5945ed64c6
commit fec195b3a1
78 changed files with 17187 additions and 21 deletions

View File

@ -659,17 +659,17 @@ func setMakeCodeLintener(name string, appIns *Application) {
}
filePath := context.Config.GetString("filePath")
if filePath == "" {
filePath = "file/2006/01/02/"
filePath = "/file/2006/01/02/"
}
path := time.Now().Format(filePath)
e := os.MkdirAll(context.Config.GetString("tpt")+"/"+path, os.ModeDir)
e := os.MkdirAll(context.Config.GetString("tpt")+path, os.ModeDir)
if e != nil {
context.Display(3, e)
return true
}
filePath = path + Md5(ObjToStr(RandX(100000, 9999999))) + fheader.Filename[strings.LastIndex(fheader.Filename, "."):]
newFile, e := os.Create(context.Config.GetString("tpt") + "/" + filePath)
newFile, e := os.Create(context.Config.GetString("tpt") + filePath)
if e != nil {
context.Display(3, e)

65
code.go
View File

@ -12,7 +12,7 @@ var TptProject = Proj{
"info": func(that *Context) {
hotimeName := that.RouterString[0]
fileConfig := that.MakeCodeRouter[hotimeName].FileConfig
data := that.Db.Get(hotimeName, "*", Map{"id": that.Session(fileConfig.GetString("table") + "_id").ToCeilInt()})
data := that.Db.Get(fileConfig.GetString("table"), "*", Map{"id": that.Session(fileConfig.GetString("table") + "_id").ToCeilInt()})
str, inData := that.MakeCodeRouter[hotimeName].Info(that.RouterString[1], data, that.Db)
where := Map{"id": that.RouterString[2]}
@ -36,16 +36,46 @@ var TptProject = Proj{
if column == nil {
continue
}
if (column["list"] == nil || column.GetBool("list")) && column.GetString("link") != "" {
re[column.GetString("link")] = that.Db.Get(column.GetString("link"), "id,"+column.GetString("value"), Map{"id": v})
seStr:="id,"+column.GetString("value")
if that.MakeCodeRouter[hotimeName].TableColumns[column.GetString("link")]["phone"]!=nil{
seStr=seStr+",phone"
}
link:=strings.Replace(column.GetString("name"),"_id","",-1)
re[link] = that.Db.Get(column.GetString("link"), seStr, Map{"id": v})
}
}
//如果有table字段则代为link
if re["table"]!=nil&&re["table_id"]!=nil {
column := that.MakeCodeRouter[hotimeName].TableColumns[that.RouterString[1]][re.GetString("table")]
v:=re.GetCeilInt64("table_id")
seStr:="id,"+column.GetString("value")
if that.MakeCodeRouter[hotimeName].TableColumns[column.GetString("link")]["phone"]!=nil{
seStr=seStr+",phone"
}
link:=strings.Replace(column.GetString("name"),"_id","",-1)
re[link] = that.Db.Get(column.GetString("link"), seStr, Map{"id": v})
}
that.Display(0, re)
},
"add": func(that *Context) {
that.Log=Map{"table":that.RouterString[1],"type":1}
hotimeName := that.RouterString[0]
inData := that.MakeCodeRouter[hotimeName].Add(that.RouterString[1], that.Req)
fileConfig := that.MakeCodeRouter[hotimeName].FileConfig
data := that.Db.Get(fileConfig.GetString("table"), "*", Map{"id": that.Session(fileConfig.GetString("table") + "_id").ToCeilInt()})
inData := that.MakeCodeRouter[hotimeName].Add(that.RouterString[1],data, that.Req)
if inData == nil {
that.Display(3, "请求参数不足")
return
@ -66,12 +96,17 @@ var TptProject = Proj{
inData["index"] = "," + ObjToStr(re) + ","
that.Db.Update(that.RouterString[1], Map{"index": inData["index"]}, Map{"id": re})
}
that.Log["table_id"]=re
that.Display(0, re)
},
"update": func(that *Context) {
that.Log=Map{"table":that.RouterString[1],"type":2,"table_id":that.RouterString[2]}
hotimeName := that.RouterString[0]
inData := that.MakeCodeRouter[hotimeName].Edit(that.RouterString[1], that.Req)
if inData == nil {
that.Display(3, "没有找到要更新的数据")
return
@ -106,6 +141,7 @@ var TptProject = Proj{
that.Display(0, re)
},
"remove": func(that *Context) {
that.Log=Map{"table":that.RouterString[1],"type":3,"table_id":that.RouterString[2]}
hotimeName := that.RouterString[0]
inData := that.MakeCodeRouter[hotimeName].Delete(that.RouterString[1], that.Req)
if inData == nil {
@ -131,7 +167,7 @@ var TptProject = Proj{
hotimeName := that.RouterString[0]
fileConfig := that.MakeCodeRouter[hotimeName].FileConfig
data := that.Db.Get(hotimeName, "*", Map{"id": that.Session(fileConfig.GetString("table") + "_id").ToCeilInt()})
data := that.Db.Get(fileConfig.GetString("table"), "*", Map{"id": that.Session(fileConfig.GetString("table") + "_id").ToCeilInt()})
columnStr, leftJoin, where := that.MakeCodeRouter[hotimeName].Search(that.RouterString[1], data, that.Req, that.Db)
@ -152,13 +188,27 @@ var TptProject = Proj{
for _, v := range reData {
v.RangeSort(func(k string, v1 interface{}) (isEnd bool) {
//for k, _ := range v {
//如果有table字段则代为link
if v["table"]!=nil&&v["table_id"]!=nil {
id:=v.GetCeilInt64("table_id")
tableName := that.MakeCodeRouter[hotimeName].TableConfig.GetMap(v.GetString("table")).GetString("label")
v["table_table_name"]=strings.Replace(tableName,"管理","",-1)
parentC := that.Db.Get(v.GetString("table"), "name", Map{"id": id})
v["table_table_id_name"] = ""
if parentC != nil {
v["table_table_id_name"]= parentC.GetString("name")
}
}
column := that.MakeCodeRouter[hotimeName].TableColumns[that.RouterString[1]][k]
if column == nil {
return true
}
if column["list"] != false && column["name"] == "parent_id" && column.GetString("link") != "" {
parentC := that.Db.Get(column.GetString("link"), column.GetString("value"), Map{"id": v.GetCeilInt(k)})
v[column.GetString("link")+"_"+column.GetString("name")+"_"+column.GetString("value")] = ""
if parentC != nil {
@ -166,7 +216,6 @@ var TptProject = Proj{
}
}
//}
return isEnd
})
}
@ -207,7 +256,7 @@ var TptProject = Proj{
hotimeName := that.RouterString[0]
fileConfig := that.MakeCodeRouter[hotimeName].FileConfig
data := that.Db.Get(hotimeName, "*", Map{"id": that.Session(fileConfig.GetString("table") + "_id").ToCeilInt()})
data := that.Db.Get(fileConfig.GetString("table"), "*", Map{"id": that.Session(fileConfig.GetString("table") + "_id").ToCeilInt()})
str, inData := that.MakeCodeRouter[hotimeName].Info(fileConfig.GetString("table"), data, that.Db)
where := Map{"id": that.Session(fileConfig.GetString("table") + "_id").ToCeilInt()}
if len(inData) == 1 {

View File

@ -86,7 +86,7 @@ var ColumnNameType = []ColumnShow{
{"description", false, true, true, false, "", false},
{"abstract", false, true, true, false, "", false},
{"content", false, true, true, false, "", false},
{"address", false, true, true, false, "", false},
{"address", true, true, true, false, "", false},
{"full_name", false, true, true, false, "", false},
{"create_time", false, false, true, false, "time", true},
{"modify_time", true, false, true, false, "time", true},
@ -97,7 +97,9 @@ var ColumnNameType = []ColumnShow{
{"file", false, true, true, false, "file", false},
{"age", false, true, true, false, "", false},
{"email", false, true, true, false, "", false},
{"time", true, true, true, true, "time", false},
{"time", true, true, true, false, "time", false},
{"level", false, false, true, false, "", false},
{"rule", true, true, true, false, "form", false},
{"table", true, false, true, false, "table", false},
{"table_id", true, false, true, false, "table_id", false},
}

View File

@ -236,6 +236,7 @@ func (that *MakeCode) Db2JSON(db *db.HoTimeDB, config Map) {
coloum["label"] = coloum.GetString("label")[:indexNum]
}
for _, ColumnName := range that.RuleConfig {
if (ColumnName.GetBool("strict") && coloum.GetString("name") == ColumnName.GetString("name")) ||
(!ColumnName.GetBool("strict") && strings.Contains(coloum.GetString("name"), ColumnName.GetString("name"))) {
@ -260,7 +261,7 @@ func (that *MakeCode) Db2JSON(db *db.HoTimeDB, config Map) {
if ColumnName.GetBool("list") {
delete(coloum, "list")
}
if ColumnName.GetBool("must") {
if !ColumnName.GetBool("must") {
delete(coloum, "must")
}
@ -298,10 +299,10 @@ func (that *MakeCode) Db2JSON(db *db.HoTimeDB, config Map) {
}
if coloum.GetString("type") == "select" {
coloum["must"] = true
//coloum["must"] = true
coloum["options"] = options
} else if len(options) > 0 {
coloum["must"] = true
//coloum["must"] = true
coloum["options"] = options
coloum["type"] = "select"
@ -619,7 +620,7 @@ func (that *MakeCode) Info(table string, userData Map, db *db.HoTimeDB) (string,
}
return reStr, data
}
func (that *MakeCode) Add(table string, req *http.Request) Map {
func (that *MakeCode) Add(table string,user Map, req *http.Request) Map {
data := Map{}
for _, v := range that.TableColumns[table] {
//不可使用,未在前端展示,但在内存中保持有
@ -633,6 +634,17 @@ func (that *MakeCode) Add(table string, req *http.Request) Map {
if v.Get("add") == nil || v.GetBool("add") {
if len(req.Form[v.GetString("name")]) == 0 {
if user[v.GetString("name")]!=nil{
data[v.GetString("name")] = user[v.GetString("name")]
continue
}
if that.FileConfig.GetString("table")+"_id"==v.GetString("name"){
data[v.GetString("name")] = user["id"]
continue
}
if v.GetBool("must") {
return nil
} else {
@ -752,6 +764,12 @@ func (that *MakeCode) Search(table string, userData Map, req *http.Request, db *
v.GetString("link") + "." + v.GetString("value") + " AS " +
v.GetString("link") + "_" + v.GetString("name") + "_" + v.GetString("value") + ","
if that.TableColumns[v.GetString("link")]["phone"]!=nil{
reStr += table + "." + v.GetString("name") + "," +
v.GetString("link") + ".phone AS " +
v.GetString("link") + "_" + v.GetString("name") + "_phone,"
}
leftJoin["[>]"+v.GetString("link")] =
table + "." + v.GetString("name") + "=" +
v.GetString("link") + ".id"
@ -848,7 +866,12 @@ func (that *MakeCode) Search(table string, userData Map, req *http.Request, db *
//日期类型
if searchItemName == "daterange" && v.GetString("type") == "time" {
//fmt.Println(req.Form["daterange"])
daterange[table+"."+v.GetString("name")+"[<>]"] = ObjToSlice(req.Form["daterange"])
if len(req.Form["daterange"])==1{
daterange[table+"."+v.GetString("name")+"[<]"]=req.FormValue("daterange")
}else{
daterange[table+"."+v.GetString("name")+"[<>]"] = ObjToSlice(req.Form["daterange"])
}
}
}
@ -900,9 +923,11 @@ func (that *MakeCode) Search(table string, userData Map, req *http.Request, db *
}
if len(daterange) > 1 {
if data["AND"] != nil {
//if data["AND"] == nil {
data = Map{"AND": Map{"AND": data, "OR": daterange}}
}
//}else{
// data = Map{"AND": Map{"AND": data, "OR": daterange}}
//}
}
if len(data) > 1 {

View File

@ -6,22 +6,26 @@ import (
. "code.hoteas.com/golang/hotime/db"
"encoding/json"
"net/http"
"time"
)
type Context struct {
*Application
Resp http.ResponseWriter
Req *http.Request
Log Map//日志有则创建
RouterString []string
Config Map
Db *HoTimeDB
RespData Map
RespFunc func()
CacheIns
SessionIns
DataSize int
HandlerStr string //复写请求url
}
// Mtd 唯一标志
func (that *Context) Mtd(router [3]string) Map {
that.Application.Router[router[0]][router[1]][router[2]](that)
@ -57,10 +61,24 @@ func (that *Context) Display(statu int, data interface{}) {
}
func (that *Context) View() {
if that.RespFunc!=nil {
that.RespFunc()
}
if that.RespData == nil {
return
}
//创建日志
if that.Log!=nil{
that.Log["time"]=time.Now().Unix()
if that.Session("admin_id").Data!=nil{
that.Log["admin_id"]=that.Session("admin_id").ToCeilInt()
}
if that.Session("user_id").Data!=nil{
that.Log["user_id"]=that.Session("user_id").ToCeilInt()
}
that.Db.Insert("logs",that.Log)
}
d, err := json.Marshal(that.RespData)
if err != nil {
return

3966
example/config/admin.json Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,344 @@
[
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "idcard",
"strict": false,
"type": ""
},
{
"edit": false,
"info": true,
"list": true,
"must": false,
"name": "id",
"strict": true,
"type": ""
},
{
"edit": true,
"info": true,
"list": true,
"must": false,
"name": "parent_id",
"strict": true,
"type": ""
},
{
"edit": true,
"info": true,
"list": true,
"must": false,
"name": "status",
"strict": false,
"type": "select"
},
{
"edit": true,
"info": true,
"list": true,
"must": false,
"name": "state",
"strict": false,
"type": "select"
},
{
"edit": true,
"info": true,
"list": true,
"must": false,
"name": "sex",
"strict": false,
"type": "select"
},
{
"edit": false,
"info": false,
"list": false,
"must": false,
"name": "delete",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "lat",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "lng",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "latitude",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "longitude",
"strict": false,
"type": ""
},
{
"edit": false,
"info": false,
"list": false,
"must": false,
"name": "index",
"strict": false,
"type": "index"
},
{
"edit": true,
"info": false,
"list": false,
"must": false,
"name": "password",
"strict": false,
"type": "password"
},
{
"edit": true,
"info": false,
"list": false,
"must": false,
"name": "pwd",
"strict": false,
"type": "password"
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "info",
"strict": false,
"type": ""
},
{
"edit": false,
"info": false,
"list": false,
"must": false,
"name": "version",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "seq",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "sort",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "note",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "description",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "abstract",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "content",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": true,
"must": false,
"name": "address",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "full_name",
"strict": false,
"type": ""
},
{
"edit": false,
"info": true,
"list": false,
"must": false,
"name": "create_time",
"strict": true,
"type": "time"
},
{
"edit": false,
"info": true,
"list": true,
"must": false,
"name": "modify_time",
"strict": true,
"type": "time"
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "image",
"strict": false,
"type": "image"
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "img",
"strict": false,
"type": "image"
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "icon",
"strict": false,
"type": "image"
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "avatar",
"strict": false,
"type": "image"
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "file",
"strict": false,
"type": "file"
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "age",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "email",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": true,
"must": false,
"name": "time",
"strict": false,
"type": "time"
},
{
"edit": false,
"info": true,
"list": false,
"must": false,
"name": "level",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": true,
"must": false,
"name": "rule",
"strict": false,
"type": "form"
},
{
"edit": false,
"info": true,
"list": true,
"must": false,
"name": "table",
"strict": false,
"type": "table"
},
{
"edit": false,
"info": true,
"list": true,
"must": false,
"name": "table_id",
"strict": false,
"type": "table_id"
}
]

344
example/config/appRule.json Normal file
View File

@ -0,0 +1,344 @@
[
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "idcard",
"strict": false,
"type": ""
},
{
"edit": false,
"info": true,
"list": true,
"must": false,
"name": "id",
"strict": true,
"type": ""
},
{
"edit": true,
"info": true,
"list": true,
"must": false,
"name": "parent_id",
"strict": true,
"type": ""
},
{
"edit": true,
"info": true,
"list": true,
"must": false,
"name": "status",
"strict": false,
"type": "select"
},
{
"edit": true,
"info": true,
"list": true,
"must": false,
"name": "state",
"strict": false,
"type": "select"
},
{
"edit": true,
"info": true,
"list": true,
"must": false,
"name": "sex",
"strict": false,
"type": "select"
},
{
"edit": false,
"info": false,
"list": false,
"must": false,
"name": "delete",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "lat",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "lng",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "latitude",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "longitude",
"strict": false,
"type": ""
},
{
"edit": false,
"info": false,
"list": false,
"must": false,
"name": "index",
"strict": false,
"type": "index"
},
{
"edit": true,
"info": false,
"list": false,
"must": false,
"name": "password",
"strict": false,
"type": "password"
},
{
"edit": true,
"info": false,
"list": false,
"must": false,
"name": "pwd",
"strict": false,
"type": "password"
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "info",
"strict": false,
"type": ""
},
{
"edit": false,
"info": false,
"list": false,
"must": false,
"name": "version",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "seq",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "sort",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "note",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "description",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "abstract",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "content",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": true,
"must": false,
"name": "address",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "full_name",
"strict": false,
"type": ""
},
{
"edit": false,
"info": true,
"list": false,
"must": false,
"name": "create_time",
"strict": true,
"type": "time"
},
{
"edit": false,
"info": true,
"list": true,
"must": false,
"name": "modify_time",
"strict": true,
"type": "time"
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "image",
"strict": false,
"type": "image"
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "img",
"strict": false,
"type": "image"
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "icon",
"strict": false,
"type": "image"
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "avatar",
"strict": false,
"type": "image"
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "file",
"strict": false,
"type": "file"
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "age",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": false,
"must": false,
"name": "email",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": true,
"must": false,
"name": "time",
"strict": false,
"type": "time"
},
{
"edit": false,
"info": true,
"list": false,
"must": false,
"name": "level",
"strict": false,
"type": ""
},
{
"edit": true,
"info": true,
"list": true,
"must": false,
"name": "rule",
"strict": false,
"type": "form"
},
{
"edit": false,
"info": true,
"list": true,
"must": false,
"name": "table",
"strict": false,
"type": "table"
},
{
"edit": false,
"info": true,
"list": true,
"must": false,
"name": "table_id",
"strict": false,
"type": "table_id"
}
]

View File

@ -2,7 +2,9 @@ package main
import (
. "code.hoteas.com/golang/hotime"
. "code.hoteas.com/golang/hotime/common"
"code.hoteas.com/golang/hotime/example/app"
"strings"
//. "code.hoteas.com/golang/hotime/common"
"fmt"
@ -33,6 +35,227 @@ func main() {
}
}
if len(that.RouterString)==2{
if that.HandlerStr == "/app/proj" &&that.Req.Method == "POST"{
that.RespFunc= func() {
if that.RespData["status"]!=nil&&that.RespData.GetCeilInt64("status")==0{
companyId:= ObjToInt(that.Req.FormValue("company_id"))
userId:= ObjToInt(that.Req.FormValue("user_id"))
zoneId:= ObjToInt(that.Req.FormValue("zone_id"))
channelId:= ObjToInt(that.Req.FormValue("channel_id"))
categoryId:= ObjToInt(that.Req.FormValue("category_id"))
projId:=that.RespData.GetCeilInt("result")
if companyId!=0{
cdata:=Map{"proj_id":projId}
if userId!=0{
cdata["user_id"]=userId
}
if zoneId!=0{
cdata["zone_id"]=zoneId
}
if channelId!=0{
cdata["channel_id"]=channelId
}
that.Db.Update("company",cdata,Map{"id":companyId})
}
projD:=Map{}
if categoryId!=0{
category:=that.Db.Get("category","*",Map{"id":categoryId})
projD["name"]=category.GetString("name")
}
if companyId!=0{
company:=that.Db.Get("company","*",Map{"id":companyId})
projD["level"]=company.GetString("level")
}
if len(projD)!=0{
that.Db.Update("proj",projD,Map{"id":projId})
}
}
}
}
}
//查询列表插入
if that.HandlerStr == "/app/task_admin" &&that.Req.Method == "GET"{
that.Req.Form.Set("admin_id",that.Session("admin_id").ToStr())
that.RespFunc= func() {
if that.RespData["status"]!=nil&&that.RespData.GetCeilInt64("status")==0 {
taskAdmin:=that.RespData.GetMap("result").GetSlice("data")
for k,_:=range taskAdmin{
v:=taskAdmin.GetMap(k)
v["task"] = that.Db.Get("task", "*", Map{"id": v.GetCeilInt("task_id")})
}
that.RespData["result"]=Map{"count":that.RespData.GetMap("result").GetCeilInt("count"),"data":taskAdmin}
}
}
}
//查询详情插入
if len(that.RouterString)==3&&strings.Contains(that.HandlerStr ,"/app/task_admin") &&that.Req.Method == "GET"{
that.RespFunc= func() {
if that.RespData["status"]!=nil&&that.RespData.GetCeilInt64("status")==0 {
taskAdmin:=that.RespData.GetMap("result")
taskAdmin["task"] = that.Db.Get("task", "*", Map{"id": taskAdmin.GetCeilInt("task_id")})
taskAdmin["admins"]=that.Db.Select("task",Map{"[><]admin":"admin.id=task.admin_id"},"*",Map{"task_id":taskAdmin.GetCeilInt("task_id"),"ORDER":"modify_time DESC"})
}
}
}
//编辑详情插入
if len(that.RouterString)==3&&strings.Contains(that.HandlerStr ,"/app/task_admin") &&that.Req.Method == "PUT"{
that.RespFunc= func() {
if that.RespData["status"]!=nil&&that.RespData.GetCeilInt64("status")==0 {
taskAdminID:=that.RouterString[2]
taskAdmin:=that.Db.Get("task_admin","*",Map{"id":taskAdminID})
taskAdminStatus:=taskAdmin.GetCeilInt64("status")
that.Log["task_id"]=taskAdmin.GetCeilInt("task_id")
that.Log["type"]=4
//执行者,状态为1部分执行不能审批状态
if taskAdminStatus==1{
that.Log["name"]="执行"
taskData:=Map{}
taskAdmins:=that.Db.Select("task_admin","*",Map{"AND":Map{"task_id":taskAdmin.GetCeilInt("task_id"),"role":0}})
for _,v :=range taskAdmins{
if v.GetCeilInt("status")!=1{
taskData["status"]=4
break
}
}
//全部执行完成,则变更任务为待审批,同时将所有审批者权限设置为待审批,没有执行完成则全部变部分执行完成,审批者不操作
if taskData.GetCeilInt("status")!=4{
taskData["status"]=1
that.Db.Update("task_admin",Map{"status":1},Map{"AND":Map{"task_id":taskAdmin.GetCeilInt("task_id"),"role":Slice{1,3}}})
that.Db.Update("task",Map{"status":1},Map{"id":taskAdmin.GetCeilInt("task_id")})
}else{
that.Db.Update("task",taskData,Map{"id":taskAdmin.GetCeilInt("task_id")})
}
}
//审批者,状态为2已完成执行部分审批或全部审批状态
if taskAdminStatus==2{
that.Log["name"]="审批"
taskData:=Map{}
taskAdmins:=that.Db.Select("task_admin","*",Map{"AND":Map{"task_id":taskAdmin.GetCeilInt("task_id"),"role":Slice{1,3}}})
for _,v :=range taskAdmins{
if v.GetCeilInt("status")!=2{
taskData["status"]=5
break
}
}
//全部审批完成,则变更任务为已审批,同时将所有审批者权限设置为待审批,没有执行完成则全部变部分执行完成,审批者不操作
if taskData.GetCeilInt("status")!=5{
taskData["status"]=2
that.Db.Update("task_admin",Map{"status":2},Map{"AND":Map{"task_id":taskAdmin.GetCeilInt("task_id")}})
that.Db.Update("task",Map{"status":2},Map{"id":taskAdmin.GetCeilInt("task_id")})
}else{
that.Db.Update("task",taskData,Map{"id":taskAdmin.GetCeilInt("task_id")})
}
}
//审批者,状态为3驳回状态则将所有人状态都设置为驳回状态
if taskAdminStatus==3{
that.Log["name"]="驳回"
that.Db.Update("task_admin",Map{"status":3},Map{"AND":Map{"task_id":taskAdmin.GetCeilInt("task_id")}})
that.Db.Update("task",Map{"status":3},Map{"id":taskAdmin.GetCeilInt("task_id")})
}
}
}
}
if that.HandlerStr == "/app/task" &&that.Req.Method == "POST"{
that.RespFunc= func() {
if that.RespData["status"]!=nil&&that.RespData.GetCeilInt64("status")==0{
executorData := ObjToMap(that.Req.FormValue("executor_data"))
approverData := ObjToMap(that.Req.FormValue("approver_data"))
readerData := ObjToMap(that.Req.FormValue("reader_data"))
taskId:=that.RespData.GetCeilInt("result")
task:= that.Db.Get("task","admin_id,name,create_time,modify_time,state,company_id,proj_id,reward,reward_money,reward_description,type,zone_id,extend_data,city_id,status,user_id,zone_id",Map{"id":taskId})
task["task_id"]=taskId
that.Log["task_id"]=taskId
adminId:=task.GetCeilInt64("admin_id")
adminMap:=Map{}
if approverData!=nil{
admins:=approverData.GetMap("admin")
for k,_:=range admins{
admin:=admins.GetMap(k)
if admin==nil{
continue
}
task["admin_id"]=admin.GetCeilInt64("id")
adminMap[task.GetString("admin_id")]=task["admin_id"]
task["role"]=1
that.Db.Insert("task_admin",task)
}
}
if executorData!=nil{
admins:=executorData.GetMap("admin")
for k,_:=range admins{
admin:=admins.GetMap(k)
if admin==nil{
continue
}
task["admin_id"]=admin.GetCeilInt64("id")
//转换为执行&审批者
if adminMap[task.GetString("admin_id")]!=nil{
that.Db.Update("task_admin",Map{"role":3},Map{"AND":Map{"admin_id":task["admin_id"],"task_id":taskId}})
}else {
adminMap[task.GetString("admin_id")]=task["admin_id"]
task["role"]=0
that.Db.Insert("task_admin",task)
}
}
}
if readerData!=nil {
admins := readerData.GetMap("admin")
for k, _ := range admins {
admin := admins.GetMap(k)
if admin == nil {
continue
}
task["admin_id"] = admin.GetCeilInt64("id")
//已经为执行和审批者不再创建监督者
if adminMap[task.GetString("admin_id")] == nil {
task["admin_id"] = adminId
task["role"] = 2
that.Db.Insert("task_admin", task)
}
}
}
}
}
}
return isFinished
})
//appIns.Db.Action(func(db db.HoTimeDB) (isSuccess bool) {

BIN
example/rfcb.exe Normal file

Binary file not shown.

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
.form-file-item .upload-file .el-upload{width:100px;height:auto;line-height:0;background-color:transparent}.form-file-item .el-button--small{height:32px}.el-input-number--mini{width:100px;margin-right:5px}.basic-form-info .el-input-number--mini .el-input{width:100px!important}.basic-form{width:400px}.basic-form .el-input,.basic-form .el-select{width:84px;margin-right:5px}.form-file-item{margin-bottom:5px}.form-file-item .el-upload{width:60px;height:60px;line-height:60px}.form-file-item .file-item .name{width:100px}.form-file-item .name{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.form-list .form-common-item{display:flex;margin-bottom:5px}.form-common-item .name,.form-common-item .value{width:88px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.select-list .select-list-item{display:flex;margin-bottom:5px}.select-list-item .name{width:76px}.select-list-item .name,.select-list-item .value{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.select-list-item .value{width:77px}.select-wrap{text-align:left;margin-bottom:5px}.select-wrap .select-add-name{display:inline-block;width:87px;text-align:right}.select-wrap .el-input{width:84px}.el-input__inner{padding-left:10px;padding-right:5px}.el-upload{height:60px;width:60px;background:#eee;overflow:hidden}.not-show-tab-label .el-tabs__header{display:none}.el-descriptions__body{background:#f0f0f0}.not-show-tab-search{display:none}.el-table__body-wrapper{margin-bottom:4px;padding-bottom:2px}.el-table__body-wrapper::-webkit-scrollbar{width:8px;height:8px}.el-table__body-wrapper::-webkit-scrollbar-track{border-radius:10px;-webkit-box-shadow:inset 0 0 6px hsla(0,0%,93.3%,.3);background-color:#eee}.el-table__body-wrapper::-webkit-scrollbar-thumb{border-radius:10px;-webkit-box-shadow:inset 0 0 6px rgba(145,143,143,.3);background-color:#918f8f}

View File

@ -0,0 +1 @@
.not-show-tab-label .el-tabs__header{display:none}.el-descriptions__body{background:#f0f0f0}.not-show-tab-search{display:none}.el-table__body-wrapper{margin-bottom:4px;padding-bottom:2px}.el-table__body-wrapper::-webkit-scrollbar{width:8px;height:8px}.el-table__body-wrapper::-webkit-scrollbar-track{border-radius:10px;-webkit-box-shadow:inset 0 0 6px hsla(0,0%,93.3%,.3);background-color:#eee}.el-table__body-wrapper::-webkit-scrollbar-thumb{border-radius:10px;-webkit-box-shadow:inset 0 0 6px rgba(145,143,143,.3);background-color:#918f8f}

View File

@ -0,0 +1 @@
.el-upload{height:100px;width:100px;background:#eee;overflow:hidden}.el-upload img[data-v-3a110a5c]{height:100%;width:100%;-o-object-fit:cover;object-fit:cover;display:block}.el-upload i[data-v-3a110a5c]{font-size:40px;margin:30% 31%;display:block}

View File

@ -0,0 +1 @@
.form-file-item .upload-file .el-upload{width:100px;height:auto;line-height:0;background-color:transparent}.form-file-item .el-button--small{height:32px}.el-input-number--mini{width:100px;margin-right:5px}.basic-form .el-input-number--mini .el-input{width:100px!important}.basic-form{width:400px}.basic-form .el-input,.basic-form .el-select{width:84px;margin-right:5px}.form-file-item{margin-bottom:5px}.form-file-item .el-upload{width:60px;height:60px;line-height:60px}.form-file-item .file-item .name{width:100px}.form-file-item .name{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.form-list .form-common-item{display:flex;margin-bottom:5px}.form-common-item .name,.form-common-item .value{width:88px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.select-list .select-list-item{display:flex;margin-bottom:5px}.select-list-item .name{width:76px}.select-list-item .name,.select-list-item .value{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.select-list-item .value{width:77px}.select-wrap{text-align:left;margin-bottom:5px}.select-wrap .select-add-name{display:inline-block;width:87px;text-align:right}.select-wrap .el-input{width:84px}.el-input__inner{padding-left:10px;padding-right:5px}.el-upload,.el-upload-list--picture-card .el-upload-list__item{height:60px;width:60px}.el-upload-list__item.is-success.focusing .el-icon-close-tip{display:none!important}.el-upload{height:100px;width:100px;background:#eee;overflow:hidden}.file-upload .el-upload{background:transparent;width:100%;height:auto;text-align:left;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.file-upload .el-upload .el-button{margin-right:10px}.el-upload img[data-v-d9262c54]{height:100%;width:100%;-o-object-fit:cover;object-fit:cover;display:block}.el-upload i[data-v-d9262c54]{font-size:40px;margin:30% 31%;display:block}

View File

@ -0,0 +1 @@
.not-show-tab-label .el-tabs__header{display:none}.el-descriptions__body{background:#f0f0f0}.not-show-tab-search{display:none}.el-table__body-wrapper{margin-bottom:4px;padding-bottom:2px}.el-table__body-wrapper::-webkit-scrollbar{width:8px;height:8px}.el-table__body-wrapper::-webkit-scrollbar-track{border-radius:10px;-webkit-box-shadow:inset 0 0 6px hsla(0,0%,93.3%,.3);background-color:#eee}.el-table__body-wrapper::-webkit-scrollbar-thumb{border-radius:10px;-webkit-box-shadow:inset 0 0 6px rgba(145,143,143,.3);background-color:#918f8f}

View File

@ -0,0 +1 @@
body[data-v-581864d3],dd[data-v-581864d3],dl[data-v-581864d3],form[data-v-581864d3],h1[data-v-581864d3],h2[data-v-581864d3],h3[data-v-581864d3],h4[data-v-581864d3],h5[data-v-581864d3],h6[data-v-581864d3],html[data-v-581864d3],ol[data-v-581864d3],p[data-v-581864d3],pre[data-v-581864d3],tbody[data-v-581864d3],textarea[data-v-581864d3],tfoot[data-v-581864d3],thead[data-v-581864d3],ul[data-v-581864d3]{margin:0;font-size:14px;font-family:Microsoft YaHei}dl[data-v-581864d3],ol[data-v-581864d3],ul[data-v-581864d3]{padding:0}li[data-v-581864d3]{list-style:none}input[data-v-581864d3]{border:none;outline:none;font-family:Microsoft YaHei;background-color:#fff}a[data-v-581864d3]{font-family:Microsoft YaHei;text-decoration:none}[data-v-581864d3]{margin:0;padding:0}.login[data-v-581864d3]{position:relative;width:100%;height:100%;background-color:#353d56}.login-item[data-v-581864d3]{position:absolute;top:calc(50% - 244px);left:calc(50% - 244px);width:488px;height:488px;padding:80px 0 152px 0;box-sizing:border-box;background-size:468px 468px}.login-item .left-title[data-v-581864d3]{display:inline-block;width:236px;height:100%;border-right:2px solid #88919e;text-align:center;padding-top:68px;box-sizing:border-box}.login-item .left-title p[data-v-581864d3]{font-size:30px;line-height:50px;color:#fff}.login-item .right-content[data-v-581864d3]{display:inline-block;vertical-align:top;padding-left:42px;box-sizing:border-box}.login-item .right-content .login-title[data-v-581864d3]{font-size:16px;color:#fff}.errorMsg[data-v-581864d3]{width:100%;height:34px;line-height:34px;color:red;font-size:14px;overflow:hidden}.login-item .right-content .inputWrap[data-v-581864d3]{width:204px;height:36px;line-height:36px;color:#99a3b2;font-size:14px;border-bottom:3px solid #98a2b1;margin-bottom:10px}.login-item .right-content .inputWrap input[data-v-581864d3]{background-color:transparent;color:#99a3b2}.login-btn[data-v-581864d3]{width:88px;height:36px;text-align:center;line-height:36px;font-size:14px;color:#fff;background-color:#4f619b;border-radius:18px;margin-top:60px;cursor:pointer}

View File

@ -0,0 +1 @@
.left-nav-home-bar{background:#2c3759!important}.left-nav-home-bar,.left-nav-home-bar i{color:#fff!important}.el-submenu .el-menu-item{height:40px;line-height:40px}.el-menu .el-submenu__title{height:46px;line-height:46px}.left-nav-home-bar i{margin-bottom:6px!important}.el-menu-item-group__title{padding:0 0 0 20px}.head-left[data-v-cf253d38],.head-right[data-v-cf253d38]{display:flex;justify-content:center;flex-direction:column}.head-right[data-v-cf253d38]{align-items:flex-end}.el-upload{height:100px;width:100px;background:#eee;overflow:hidden}.el-upload img[data-v-3a110a5c]{height:100%;width:100%;-o-object-fit:cover;object-fit:cover;display:block}.el-upload i[data-v-3a110a5c]{font-size:40px;margin:30% 31%;display:block}

View File

@ -0,0 +1 @@
.el-upload{height:100px;width:100px;background:#eee;overflow:hidden}.el-upload img[data-v-3a110a5c]{height:100%;width:100%;-o-object-fit:cover;object-fit:cover;display:block}.el-upload i[data-v-3a110a5c]{font-size:40px;margin:30% 31%;display:block}

View File

@ -0,0 +1 @@
.form-file-item .upload-file .el-upload{width:100px;height:auto;line-height:0;background-color:transparent}.form-file-item .el-button--small{height:32px}.el-input-number--mini{width:100px;margin-right:5px}.basic-form .el-input-number--mini .el-input{width:100px!important}.basic-form{width:400px}.basic-form .el-input,.basic-form .el-select{width:84px;margin-right:5px}.form-file-item{margin-bottom:5px}.form-file-item .el-upload{width:60px;height:60px;line-height:60px}.form-file-item .file-item .name{width:100px}.form-file-item .name{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.form-list .form-common-item{display:flex;margin-bottom:5px}.form-common-item .name,.form-common-item .value{width:88px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.select-list .select-list-item{display:flex;margin-bottom:5px}.select-list-item .name{width:76px}.select-list-item .name,.select-list-item .value{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.select-list-item .value{width:77px}.select-wrap{text-align:left;margin-bottom:5px}.select-wrap .select-add-name{display:inline-block;width:87px;text-align:right}.select-wrap .el-input{width:84px}.el-input__inner{padding-left:10px;padding-right:5px}.el-upload,.el-upload-list--picture-card .el-upload-list__item{height:60px;width:60px}.el-upload-list__item.is-success.focusing .el-icon-close-tip{display:none!important}.el-upload{height:100px;width:100px;background:#eee;overflow:hidden}.file-upload .el-upload{background:transparent;width:100%;height:auto;text-align:left;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.file-upload .el-upload .el-button{margin-right:10px}.el-upload img[data-v-d9262c54]{height:100%;width:100%;-o-object-fit:cover;object-fit:cover;display:block}.el-upload i[data-v-d9262c54]{font-size:40px;margin:30% 31%;display:block}

View File

@ -0,0 +1 @@
body[data-v-581864d3],dd[data-v-581864d3],dl[data-v-581864d3],form[data-v-581864d3],h1[data-v-581864d3],h2[data-v-581864d3],h3[data-v-581864d3],h4[data-v-581864d3],h5[data-v-581864d3],h6[data-v-581864d3],html[data-v-581864d3],ol[data-v-581864d3],p[data-v-581864d3],pre[data-v-581864d3],tbody[data-v-581864d3],textarea[data-v-581864d3],tfoot[data-v-581864d3],thead[data-v-581864d3],ul[data-v-581864d3]{margin:0;font-size:14px;font-family:Microsoft YaHei}dl[data-v-581864d3],ol[data-v-581864d3],ul[data-v-581864d3]{padding:0}li[data-v-581864d3]{list-style:none}input[data-v-581864d3]{border:none;outline:none;font-family:Microsoft YaHei;background-color:#fff}a[data-v-581864d3]{font-family:Microsoft YaHei;text-decoration:none}[data-v-581864d3]{margin:0;padding:0}.login[data-v-581864d3]{position:relative;width:100%;height:100%;background-color:#353d56}.login-item[data-v-581864d3]{position:absolute;top:calc(50% - 244px);left:calc(50% - 244px);width:488px;height:488px;padding:80px 0 152px 0;box-sizing:border-box;background-size:468px 468px}.login-item .left-title[data-v-581864d3]{display:inline-block;width:236px;height:100%;border-right:2px solid #88919e;text-align:center;padding-top:68px;box-sizing:border-box}.login-item .left-title p[data-v-581864d3]{font-size:30px;line-height:50px;color:#fff}.login-item .right-content[data-v-581864d3]{display:inline-block;vertical-align:top;padding-left:42px;box-sizing:border-box}.login-item .right-content .login-title[data-v-581864d3]{font-size:16px;color:#fff}.errorMsg[data-v-581864d3]{width:100%;height:34px;line-height:34px;color:red;font-size:14px;overflow:hidden}.login-item .right-content .inputWrap[data-v-581864d3]{width:204px;height:36px;line-height:36px;color:#99a3b2;font-size:14px;border-bottom:3px solid #98a2b1;margin-bottom:10px}.login-item .right-content .inputWrap input[data-v-581864d3]{background-color:transparent;color:#99a3b2}.login-btn[data-v-581864d3]{width:88px;height:36px;text-align:center;line-height:36px;font-size:14px;color:#fff;background-color:#4f619b;border-radius:18px;margin-top:60px;cursor:pointer}

View File

@ -0,0 +1 @@
.left-nav-home-bar{background:#2c3759!important}.left-nav-home-bar,.left-nav-home-bar i{color:#fff!important}.el-submenu .el-menu-item{height:40px;line-height:40px}.el-menu .el-submenu__title{height:46px;line-height:46px}.left-nav-home-bar i{margin-bottom:6px!important}.el-menu-item-group__title{padding:0 0 0 20px}.head-left[data-v-cf253d38],.head-right[data-v-cf253d38]{display:flex;justify-content:center;flex-direction:column}.head-right[data-v-cf253d38]{align-items:flex-end}.el-upload{height:100px;width:100px;background:#eee;overflow:hidden}.el-upload img[data-v-3a110a5c]{height:100%;width:100%;-o-object-fit:cover;object-fit:cover;display:block}.el-upload i[data-v-3a110a5c]{font-size:40px;margin:30% 31%;display:block}

View File

@ -0,0 +1 @@
.form-file-item .upload-file .el-upload{width:100px;height:auto;line-height:0;background-color:transparent}.form-file-item .el-button--small{height:32px}.el-input-number--mini{width:100px;margin-right:5px}.basic-form-info .el-input-number--mini .el-input{width:100px!important}.basic-form{width:400px}.basic-form .el-input,.basic-form .el-select{width:84px;margin-right:5px}.form-file-item{margin-bottom:5px}.form-file-item .el-upload{width:60px;height:60px;line-height:60px}.form-file-item .file-item .name{width:100px}.form-file-item .name{width:100%;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.form-list .form-common-item{display:flex;margin-bottom:5px}.form-common-item .name,.form-common-item .value{width:88px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.select-list .select-list-item{display:flex;margin-bottom:5px}.select-list-item .name{width:76px}.select-list-item .name,.select-list-item .value{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.select-list-item .value{width:77px}.select-wrap{text-align:left;margin-bottom:5px}.select-wrap .select-add-name{display:inline-block;width:87px;text-align:right}.select-wrap .el-input{width:84px}.el-input__inner{padding-left:10px;padding-right:5px}.el-upload{height:60px;width:60px;background:#eee;overflow:hidden}.not-show-tab-label .el-tabs__header{display:none}.el-descriptions__body{background:#f0f0f0}.not-show-tab-search{display:none}.el-table__body-wrapper{margin-bottom:4px;padding-bottom:2px}.el-table__body-wrapper::-webkit-scrollbar{width:8px;height:8px}.el-table__body-wrapper::-webkit-scrollbar-track{border-radius:10px;-webkit-box-shadow:inset 0 0 6px hsla(0,0%,93.3%,.3);background-color:#eee}.el-table__body-wrapper::-webkit-scrollbar-thumb{border-radius:10px;-webkit-box-shadow:inset 0 0 6px rgba(145,143,143,.3);background-color:#918f8f}

BIN
example/tpt/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 141 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

View File

@ -0,0 +1,75 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<title>地面图片叠加层</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<style>
body,
html,
#container {
overflow: hidden;
width: 100%;
height: 100%;
margin: 0;
font-family: "微软雅黑";
}
</style>
<script src="//api.map.baidu.com/api?type=webgl&v=1.0&ak=您的密钥"></script>
</head>
<body>
<div id="container"></div>
</body>
</html>
<script>
var map = new BMapGL.Map('container');
map.centerAndZoom(new BMapGL.Point(117.200, 36.2437), 18);
map.enableScrollWheelZoom(true);
map.setTilt(45);
map.setDisplayOptions({
poiText: false, // 隐藏poi标注
poiIcon: false, // 隐藏poi图标
building: false // 隐藏楼块
});
map.clearOverlays();//清除地图覆盖物
//思路:利用行政区划点的集合与外围自定义东南西北形成一个环形遮罩层
//1.获取选中行政区划边框点的集合rs.boundaries[0]
var strs = new Array();
var ENWS = "";
for (var i=0;i<strs.length;i++) {
ENWS += strs[i] + ";"
}
//2.自定义外围边框点的集合
var E_JW = "170.672126, 39.623555;"; //东
var EN_JW = "170.672126, 81.291804;"; //东北角
var N_JW = "105.913641, 81.291804;"; //北
var NW_JW = "-169.604276, 81.291804;"; //西北角
var W_JW = "-169.604276, 38.244136;"; //西
var WS_JW = "-169.604276, -68.045308;"; //西南角
var S_JW = "114.15563, -68.045308;"; //南
var SE_JW = "170.672126, -68.045308 ;"; //东南角
//3.添加环形遮罩层
var ply1 = new BMapGL.Polygon(ENWS + E_JW + SE_JW + S_JW + WS_JW + W_JW + NW_JW + N_JW + EN_JW + E_JW, {strokeColor:"#000",strokeOpacity:0.1,fillColor:"#000",fillOpacity:"0.9"}); //建立多边形覆盖物
map.addOverlay(ply1);//遮罩物是半透明的,如果需要纯色可以多添加几层
map.addOverlay(ply1);//遮罩物是半透
map.addOverlay(ply1);//遮罩物是半透
var pStart = new BMapGL.Point(117.19635, 36.24093);
var pEnd = new BMapGL.Point(117.20350, 36.24764);
var bounds = new BMapGL.Bounds(new BMapGL.Point(pStart.lng, pEnd.lat), new BMapGL.Point(pEnd.lng, pStart.lat));
var imgOverlay = new BMapGL.GroundOverlay(bounds, {
type: 'image',
url: '/jsdemo/img/shouhuimap.png',
opacity: 1
});
map.addOverlay(imgOverlay);
</script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,7 @@
{
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
"rules": [{
"action": "allow",
"page": "*"
}]
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

3
example/tpt/index.html Normal file
View File

@ -0,0 +1,3 @@
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="favicon.ico"><title></title><style>body{
margin: 0px;
}</style><link href="css/chunk-25a9c3c8.172952f0.css" rel="prefetch"><link href="css/chunk-368da0af.c460e209.css" rel="prefetch"><link href="css/chunk-550dc75a.993d1e17.css" rel="prefetch"><link href="css/chunk-69c477a2.26f55e87.css" rel="prefetch"><link href="css/chunk-99497f66.26cbd584.css" rel="prefetch"><link href="css/chunk-c3e0f2d6.f9cf649c.css" rel="prefetch"><link href="js/chunk-25a9c3c8.b8753e3d.js" rel="prefetch"><link href="js/chunk-368da0af.ce39d904.js" rel="prefetch"><link href="js/chunk-550dc75a.d9288626.js" rel="prefetch"><link href="js/chunk-5b2ead63.af868ff8.js" rel="prefetch"><link href="js/chunk-69c477a2.dc1bdb5d.js" rel="prefetch"><link href="js/chunk-99497f66.664e5562.js" rel="prefetch"><link href="js/chunk-a2efa204.8a8a537a.js" rel="prefetch"><link href="js/chunk-c3e0f2d6.b9a0f420.js" rel="prefetch"><link href="js/chunk-d83135a2.4680b3b0.js" rel="prefetch"><link href="css/app.6e46e897.css" rel="preload" as="style"><link href="js/app.1a0b9cd0.js" rel="preload" as="script"><link href="css/app.6e46e897.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but hotime doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="js/app.1a0b9cd0.js"></script></body></html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-368da0af"],{1:function(t,e){},2934:function(t,e,n){"use strict";n.d(e,"e",function(){return r}),n.d(e,"d",function(){return i}),n.d(e,"b",function(){return s}),n.d(e,"c",function(){return c}),n.d(e,"a",function(){return u}),n.d(e,"f",function(){return d}),n.d(e,"g",function(){return l});var e=n("b0c0"),a=n("b775"),e=n("4328"),o=n.n(e);function r(t,e){return Object(a.b)({url:t,method:"GET",params:e})}function i(t,e){return Object(a.b)({url:t,method:"GET",params:e})}function s(t,e){return Object(a.b)({url:t,method:"DELETE",data:o.a.stringify(e)})}function c(t,e){return Object(a.b)({url:t,method:"PUT",data:o.a.stringify(e)})}function u(t,e){return Object(a.b)({url:t,method:"POST",data:o.a.stringify(e)})}function d(t){var e=new FormData;return e.append("file",t,t.name),Object(a.b)({url:"file",headers:{"Content-Type":"multipart/form-data"},method:"POST",data:e})}function l(n,o){var r=document.createElement("input");r.type="file";r.addEventListener("change",function(){var t,e=r.files[0];0!==e.size?((t=new FormData).append("file",e,e.name),t.append("org_id",n.org_id),Object(a.b)({url:"admin/company_inout/upload",headers:{"Content-Type":"multipart/form-data"},method:"POST",data:t}).then(o)):o(null,"文件错误",r)}),r.click()}},"578a":function(t,e,n){"use strict";n.r(e);n("b0c0");var i=n("f2bf");Object(i.N)("data-v-581864d3");var s={class:"login",style:{width:"100%",height:"100vh"}},c={class:"login-item"},u={class:"left-title"},d={class:"right-content"},l=Object(i.o)("p",{class:"login-title"},"登录",-1),f={style:{height:"40px"}},p={class:"inputWrap"},b=Object(i.q)(" 账号:"),m={class:"inputWrap"},h=Object(i.q)(" 密码:");Object(i.L)();var o=n("2934"),r={name:"Login",data:function(){return{showLog:!1,showLogInfo:"",label:"HoTime DashBoard",form:{name:"",password:""}}},methods:{login:function(){var e=this;if(""==this.name||""==this.password)return this.showLogInfo="参数不足!",void(this.showLog=!0);Object(o.a)(window.Hotime.data.name+"/hotime/login",e.form).then(function(t){return 0!=t.status?(e.showLogInfo=t.error.msg,void(e.showLog=!0)):void e.$router.push({path:"/"})})}},mounted:function(){this.label=window.Hotime.data.label}};n("8d39");r.render=function(t,e,n,o,r,a){return Object(i.K)(),Object(i.n)("div",s,[Object(i.o)("div",c,[Object(i.o)("div",u,[Object(i.o)("p",null,Object(i.X)(r.label),1)]),Object(i.o)("div",d,[l,Object(i.o)("div",f,[Object(i.jb)(Object(i.o)("p",{class:"errorMsg"},Object(i.X)(r.showLogInfo),513),[[i.fb,r.showLog]])]),Object(i.o)("p",p,[b,Object(i.jb)(Object(i.o)("input",{type:"text","onUpdate:modelValue":e[0]||(e[0]=function(t){return r.form.name=t}),class:"accountVal"},null,512),[[i.eb,r.form.name]])]),Object(i.o)("p",m,[h,Object(i.jb)(Object(i.o)("input",{type:"password","onUpdate:modelValue":e[1]||(e[1]=function(t){return r.form.password=t}),class:"passwordVal"},null,512),[[i.eb,r.form.password]])]),Object(i.o)("p",{class:"login-btn",onClick:e[2]||(e[2]=function(){return a.login&&a.login.apply(a,arguments)})},"登录")])])])},r.__scopeId="data-v-581864d3";e.default=r},"85dc":function(t,e,n){},"8d39":function(t,e,n){"use strict";n("85dc")},b775:function(t,e,n){"use strict";n.d(e,"a",function(){return c});var o=n("d3b7"),r=n("bc3a"),o=n.n(r),r=n("4328"),a=n.n(r),i=n("7864"),s=n("56d7"),c="/";o.a.defaults.withCredentials=!0,o.a.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded;charset=UTF-8";o=o.a.create({baseURL:c,timeout:2e5});o.interceptors.request.use(function(t){return"get"===t.method&&(t.paramsSerializer=function(t){return a.a.stringify(t,{arrayFormat:"repeat"})}),t.withCredentials=!0,t},function(t){Promise.reject(t)}),o.interceptors.response.use(function(t){return 2!==t.data.statu?t.data:(i.b.Message({showClose:!0,message:"登录信息丢失,请重新登陆!",type:"error",duration:2e3,offset:100}),void s.app.$router.push({path:"/login"}))},function(t){var e="err:"+t,n={};return t.response?n=t.response.data:(-1!=e.indexOf("timeout")?(n.code=500,n.message="请求超时,请稍后再试"):-1!=e.indexOf("Network Error")?(n.code=500,n.message="网络错误,请稍后再试"):(n.code=500,n.message=""+t),n)}),e.b=o}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-6feafdad"],{1:function(t,e){},2934:function(t,e,n){"use strict";n.d(e,"e",function(){return r}),n.d(e,"d",function(){return i}),n.d(e,"b",function(){return s}),n.d(e,"c",function(){return c}),n.d(e,"a",function(){return u}),n.d(e,"f",function(){return d}),n.d(e,"g",function(){return l});var e=n("b0c0"),a=n("b775"),e=n("4328"),o=n.n(e);function r(t,e){return Object(a.b)({url:t,method:"GET",params:e})}function i(t,e){return Object(a.b)({url:t,method:"GET",params:e})}function s(t,e){return Object(a.b)({url:t,method:"DELETE",data:o.a.stringify(e)})}function c(t,e){return Object(a.b)({url:t,method:"PUT",data:o.a.stringify(e)})}function u(t,e){return Object(a.b)({url:t,method:"POST",data:o.a.stringify(e)})}function d(t){var e=new FormData;return e.append("file",t,t.name),Object(a.b)({url:"file",headers:{"Content-Type":"multipart/form-data"},method:"POST",data:e})}function l(n,o){var r=document.createElement("input");r.type="file";r.addEventListener("change",function(){var t,e=r.files[0];0!==e.size?((t=new FormData).append("file",e,e.name),t.append("org_id",n.org_id),Object(a.b)({url:"admin/company_inout/upload",headers:{"Content-Type":"multipart/form-data"},method:"POST",data:t}).then(o)):o(null,"文件错误",r)}),r.click()}},"40a7":function(t,e,n){},"578a":function(t,e,n){"use strict";n.r(e);n("b0c0");var i=n("9f9f");Object(i.N)("data-v-581864d3");var s={class:"login",style:{width:"100%",height:"100vh"}},c={class:"login-item"},u={class:"left-title"},d={class:"right-content"},l=Object(i.o)("p",{class:"login-title"},"登录",-1),f={style:{height:"40px"}},p={class:"inputWrap"},b=Object(i.q)(" 账号:"),m={class:"inputWrap"},h=Object(i.q)(" 密码:");Object(i.L)();var o=n("2934"),r={name:"Login",data:function(){return{showLog:!1,showLogInfo:"",label:"HoTime DashBoard",form:{name:"",password:""}}},methods:{login:function(){var e=this;if(""==this.name||""==this.password)return this.showLogInfo="参数不足!",void(this.showLog=!0);Object(o.a)(window.Hotime.data.name+"/hotime/login",e.form).then(function(t){return 0!=t.status?(e.showLogInfo=t.error.msg,void(e.showLog=!0)):void e.$router.push({path:"/"})})}},mounted:function(){this.label=window.Hotime.data.label}};n("8d39");r.render=function(t,e,n,o,r,a){return Object(i.K)(),Object(i.n)("div",s,[Object(i.o)("div",c,[Object(i.o)("div",u,[Object(i.o)("p",null,Object(i.X)(r.label),1)]),Object(i.o)("div",d,[l,Object(i.o)("div",f,[Object(i.jb)(Object(i.o)("p",{class:"errorMsg"},Object(i.X)(r.showLogInfo),513),[[i.fb,r.showLog]])]),Object(i.o)("p",p,[b,Object(i.jb)(Object(i.o)("input",{type:"text","onUpdate:modelValue":e[0]||(e[0]=function(t){return r.form.name=t}),class:"accountVal"},null,512),[[i.eb,r.form.name]])]),Object(i.o)("p",m,[h,Object(i.jb)(Object(i.o)("input",{type:"password","onUpdate:modelValue":e[1]||(e[1]=function(t){return r.form.password=t}),class:"passwordVal"},null,512),[[i.eb,r.form.password]])]),Object(i.o)("p",{class:"login-btn",onClick:e[2]||(e[2]=function(){return a.login&&a.login.apply(a,arguments)})},"登录")])])])},r.__scopeId="data-v-581864d3";e.default=r},"8d39":function(t,e,n){"use strict";n("40a7")},b775:function(t,e,n){"use strict";n.d(e,"a",function(){return c});var o=n("d3b7"),r=n("bc3a"),o=n.n(r),r=n("4328"),a=n.n(r),i=n("2bea"),s=n("56d7"),c="/";o.a.defaults.withCredentials=!0,o.a.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded;charset=UTF-8";o=o.a.create({baseURL:c,timeout:2e5});o.interceptors.request.use(function(t){return"get"===t.method&&(t.paramsSerializer=function(t){return a.a.stringify(t,{arrayFormat:"repeat"})}),t.withCredentials=!0,t},function(t){Promise.reject(t)}),o.interceptors.response.use(function(t){return 2!==t.data.statu?t.data:(i.b.Message({showClose:!0,message:"登录信息丢失,请重新登陆!",type:"error",duration:2e3,offset:100}),void s.app.$router.push({path:"/login"}))},function(t){var e="err:"+t,n={};return t.response?n=t.response.data:(-1!=e.indexOf("timeout")?(n.code=500,n.message="请求超时,请稍后再试"):-1!=e.indexOf("Network Error")?(n.code=500,n.message="网络错误,请稍后再试"):(n.code=500,n.message=""+t),n)}),e.b=o}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-a2efa204"],{1:function(t,e){},"159b":function(t,e,n){var r,a=n("da84"),i=n("fdbc"),o=n("17c2"),u=n("9112");for(r in i){var c=a[r],c=c&&c.prototype;if(c&&c.forEach!==o)try{u(c,"forEach",o)}catch(t){c.forEach=o}}},"17c2":function(t,e,n){"use strict";var r=n("b727").forEach,n=n("a640")("forEach");t.exports=n?[].forEach:function(t){return r(this,t,1<arguments.length?arguments[1]:void 0)}},2934:function(t,e,n){"use strict";n.d(e,"e",function(){return a}),n.d(e,"d",function(){return o}),n.d(e,"b",function(){return u}),n.d(e,"c",function(){return c}),n.d(e,"a",function(){return s}),n.d(e,"f",function(){return f}),n.d(e,"g",function(){return d});var e=n("b0c0"),i=n("b775"),e=n("4328"),r=n.n(e);function a(t,e){return Object(i.b)({url:t,method:"GET",params:e})}function o(t,e){return Object(i.b)({url:t,method:"GET",params:e})}function u(t,e){return Object(i.b)({url:t,method:"DELETE",data:r.a.stringify(e)})}function c(t,e){return Object(i.b)({url:t,method:"PUT",data:r.a.stringify(e)})}function s(t,e){return Object(i.b)({url:t,method:"POST",data:r.a.stringify(e)})}function f(t){var e=new FormData;return e.append("file",t,t.name),Object(i.b)({url:"file",headers:{"Content-Type":"multipart/form-data"},method:"POST",data:e})}function d(n,r){var a=document.createElement("input");a.type="file";a.addEventListener("change",function(){var t,e=a.files[0];0!==e.size?((t=new FormData).append("file",e,e.name),t.append("org_id",n.org_id),Object(i.b)({url:"admin/company_inout/upload",headers:{"Content-Type":"multipart/form-data"},method:"POST",data:t}).then(r)):r(null,"文件错误",a)}),a.click()}},"83c5":function(t,e,n){"use strict";n("159b");e.a={list:{},constructor:function(){this.list={}},$on:function(t,e){this.list[t]=this.list[t]||[],this.list[t].push(e)},$emit:function(t,e){this.list[t]&&this.list[t].forEach(function(t){t(e)})},$off:function(t){this.list[t]&&delete this.list[t]}}},a640:function(t,e,n){"use strict";var r=n("d039");t.exports=function(t,e){var n=[][t];return!!n&&r(function(){n.call(null,e||function(){throw 1},1)})}},b775:function(t,e,n){"use strict";n.d(e,"a",function(){return c});var r=n("d3b7"),a=n("bc3a"),r=n.n(a),a=n("4328"),i=n.n(a),o=n("2bea"),u=n("56d7"),c="/";r.a.defaults.withCredentials=!0,r.a.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded;charset=UTF-8";r=r.a.create({baseURL:c,timeout:2e5});r.interceptors.request.use(function(t){return"get"===t.method&&(t.paramsSerializer=function(t){return i.a.stringify(t,{arrayFormat:"repeat"})}),t.withCredentials=!0,t},function(t){Promise.reject(t)}),r.interceptors.response.use(function(t){return 2!==t.data.statu?t.data:(o.b.Message({showClose:!0,message:"登录信息丢失,请重新登陆!",type:"error",duration:2e3,offset:100}),void u.app.$router.push({path:"/login"}))},function(t){var e="err:"+t,n={};return t.response?n=t.response.data:(-1!=e.indexOf("timeout")?(n.code=500,n.message="请求超时,请稍后再试"):-1!=e.indexOf("Network Error")?(n.code=500,n.message="网络错误,请稍后再试"):(n.code=500,n.message=""+t),n)}),e.b=r}}]);

View File

@ -0,0 +1 @@
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-a2efa204"],{1:function(t,e){},"159b":function(t,e,n){var r,a=n("da84"),i=n("fdbc"),o=n("17c2"),u=n("9112");for(r in i){var c=a[r],c=c&&c.prototype;if(c&&c.forEach!==o)try{u(c,"forEach",o)}catch(t){c.forEach=o}}},"17c2":function(t,e,n){"use strict";var r=n("b727").forEach,n=n("a640")("forEach");t.exports=n?[].forEach:function(t){return r(this,t,1<arguments.length?arguments[1]:void 0)}},2934:function(t,e,n){"use strict";n.d(e,"e",function(){return a}),n.d(e,"d",function(){return o}),n.d(e,"b",function(){return u}),n.d(e,"c",function(){return c}),n.d(e,"a",function(){return s}),n.d(e,"f",function(){return f}),n.d(e,"g",function(){return d});var e=n("b0c0"),i=n("b775"),e=n("4328"),r=n.n(e);function a(t,e){return Object(i.b)({url:t,method:"GET",params:e})}function o(t,e){return Object(i.b)({url:t,method:"GET",params:e})}function u(t,e){return Object(i.b)({url:t,method:"DELETE",data:r.a.stringify(e)})}function c(t,e){return Object(i.b)({url:t,method:"PUT",data:r.a.stringify(e)})}function s(t,e){return Object(i.b)({url:t,method:"POST",data:r.a.stringify(e)})}function f(t){var e=new FormData;return e.append("file",t,t.name),Object(i.b)({url:"file",headers:{"Content-Type":"multipart/form-data"},method:"POST",data:e})}function d(n,r){var a=document.createElement("input");a.type="file";a.addEventListener("change",function(){var t,e=a.files[0];0!==e.size?((t=new FormData).append("file",e,e.name),t.append("org_id",n.org_id),Object(i.b)({url:"admin/company_inout/upload",headers:{"Content-Type":"multipart/form-data"},method:"POST",data:t}).then(r)):r(null,"文件错误",a)}),a.click()}},"83c5":function(t,e,n){"use strict";n("159b");e.a={list:{},constructor:function(){this.list={}},$on:function(t,e){this.list[t]=this.list[t]||[],this.list[t].push(e)},$emit:function(t,e){this.list[t]&&this.list[t].forEach(function(t){t(e)})},$off:function(t){this.list[t]&&delete this.list[t]}}},a640:function(t,e,n){"use strict";var r=n("d039");t.exports=function(t,e){var n=[][t];return!!n&&r(function(){n.call(null,e||function(){throw 1},1)})}},b775:function(t,e,n){"use strict";n.d(e,"a",function(){return c});var r=n("d3b7"),a=n("bc3a"),r=n.n(a),a=n("4328"),i=n.n(a),o=n("7864"),u=n("56d7"),c="/";r.a.defaults.withCredentials=!0,r.a.defaults.headers.post["Content-Type"]="application/x-www-form-urlencoded;charset=UTF-8";r=r.a.create({baseURL:c,timeout:2e5});r.interceptors.request.use(function(t){return"get"===t.method&&(t.paramsSerializer=function(t){return i.a.stringify(t,{arrayFormat:"repeat"})}),t.withCredentials=!0,t},function(t){Promise.reject(t)}),r.interceptors.response.use(function(t){return 2!==t.data.statu?t.data:(o.b.Message({showClose:!0,message:"登录信息丢失,请重新登陆!",type:"error",duration:2e3,offset:100}),void u.app.$router.push({path:"/login"}))},function(t){var e="err:"+t,n={};return t.response?n=t.response.data:(-1!=e.indexOf("timeout")?(n.code=500,n.message="请求超时,请稍后再试"):-1!=e.indexOf("Network Error")?(n.code=500,n.message="网络错误,请稍后再试"):(n.code=500,n.message=""+t),n)}),e.b=r}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long