diff --git a/src/gonganxitong/common.go b/src/gonganxitong/common.go index 7dba96f..f68c070 100644 --- a/src/gonganxitong/common.go +++ b/src/gonganxitong/common.go @@ -87,6 +87,18 @@ func (s Table) InputsList(m *ice.Message, list ice.Any, arg ...string) { } m.SortInt(arg[0]).DisplayInputKeyNameIconTitle() } +func (s Table) InputsListRole(m *ice.Message, list ice.Any, arg ...string) { + s.InputsListSkip(m, list, "1", arg...) +} +func (s Table) InputsListSkip(m *ice.Message, list ice.Any, skip string, arg ...string) { + it := reflect.ValueOf(list).MapRange() + for it.Next() { + if it.Key().Int() > kit.Int64(skip) { + m.Push(arg[0], it.Key().Int()).Push(model.NAME, it.Value().String()) + } + } + m.SortInt(arg[0]).DisplayInputKeyNameIconTitle() +} func (s Table) InputsListValue(m *ice.Message, list ice.Any, key string) string { k, e := strconv.ParseInt(key, 10, 64) if e != nil { @@ -100,15 +112,6 @@ func (s Table) InputsListValue(m *ice.Message, list ice.Any, key string) string } return "" } -func (s Table) InputsListRole(m *ice.Message, list ice.Any, arg ...string) { - it := reflect.ValueOf(list).MapRange() - for it.Next() { - if it.Key().Int() > 1 { - m.Push(arg[0], it.Key().Int()).Push(model.NAME, it.Value().String()) - } - } - m.SortInt(arg[0]).DisplayInputKeyNameIconTitle() -} func (s Table) ValueModel(m *ice.Message, action ice.Any, arg ...string) *ice.Message { defer m.Options(db.TARGET, kit.Select(m.CommandKey(), m.Config(db.MODELS))).Set(ice.MSG_OPTION, db.TARGET) defer m.Options(db.MODEL, m.Configv(db.MODEL)).Set(ice.MSG_OPTION, db.MODEL) @@ -135,7 +138,6 @@ func (s Table) ValueList(m *ice.Message, arg []string, fields ...ice.Any) *ice.M defer m.Options(db.FIELDS, fields).Set(ice.MSG_OPTION, db.FIELDS) } if s.ValueModel(m, s.ValueList, arg...); len(arg) > 0 { - kit.If(m.Length() > 0, func() { s.UserPlaceInit(m) }) s.Button(m, "") } return m @@ -242,9 +244,10 @@ func (s Table) UserPlaceRole(m *ice.Message) int { return kit.Int(m.Cmdy(s.Prefix(m, Portal{}), s.UserPlaceRole).Option(model.USER_ROLE)) } func (s Table) UserPlaceInit(m *ice.Message, arg ...string) { - if m.Option(model.PLACE_INIT) == "" { + if m.Option(model.PLACE_INIT) == "" || m.PrefixKey() != m.Option(ice.MSG_INDEX) { return } + m.Info("what %v %v %v", m.Length(), m.PrefixKey(), m.Option(ice.MSG_INDEX)) m.Cmd(s.Prefix(m, Portal{}), "placeCmd", "addCount", model.INIT, 1, m.Option(model.PLACE_UID), m.Option(model.PLACE_INIT)) } func (s Table) DashboardUpdate(m *ice.Message, arg ...string) { diff --git a/src/gonganxitong/model/model.go b/src/gonganxitong/model/model.go index d4b9e01..8fd5791 100644 --- a/src/gonganxitong/model/model.go +++ b/src/gonganxitong/model/model.go @@ -92,6 +92,7 @@ const ( QUERY = "query" ARGS = "args" INIT = "init" + UNIT = "unit" ) type Sess struct { diff --git a/src/gonganxitong/notice.go b/src/gonganxitong/notice.go index d6f1995..cb39b31 100644 --- a/src/gonganxitong/notice.go +++ b/src/gonganxitong/notice.go @@ -40,6 +40,7 @@ func (s notice) List(m *ice.Message, arg ...string) { s.SelectJoinUser(m) kit.If(s.IsLeader(m), func() { m.PushAction(s.Remove) + s.Button(m, "") }, func() { m.Action() }) diff --git a/src/gonganxitong/portal.css b/src/gonganxitong/portal.css index 82dc6fb..c01d4e7 100644 --- a/src/gonganxitong/portal.css +++ b/src/gonganxitong/portal.css @@ -77,13 +77,17 @@ $output fieldset.story>div.output table.content td img { max-width:100%; } $output fieldset.story>div.output table.content tr.user_avatar td img { max-height:128px; max-width:128px; } $output fieldset.story>div.output>div.code { text-align:center; } $output fieldset.story>div.output>div.code>img { display:block; margin:auto; width:100%; max-width:390px; } -$output fieldset.story>div.output>div.code>input[type=button] { background-color:var(--notice-bg-color); color:var(--notice-fg-color); margin-right:10px; float:right; } -$output fieldset.story>div.output>div.code>input[type=button].danger { background-color:var(--danger-bg-color); color:var(--danger-fg-color); } -$output fieldset.story>div.output>div.code>input[type=button][name=cancel] { border:var(--box-border); background-color:var(--danger-bg-color); color:var(--danger-fg-color); } +$output fieldset.story>div.output>div.code>input[type=button] { + background-color:var(--notice-bg-color); color:var(--notice-fg-color); + margin-right:10px; float:right; +} +$output fieldset.story>div.output>div.code>input[type=button].danger { + border:var(--box-danger); background-color:transparent; color:var(--danger-bg-color); +} $output fieldset.story>div.output>div.code div.item.button { margin-top:20px; } $output fieldset.story>div.output>div.code div.item.button input[type=button] { background-color:var(--notice-bg-color); color:var(--notice-fg-color); font-size:18px; min-width:240px; height:36px; } -$output fieldset.story>div.output>div.code div.item.button.danger input[type=button] { background-color:var(--danger-bg-color); color:var(--danger-fg-color); } $output fieldset.story>div.output>div.code div.item.button input[type=button][name=cancel] { border:var(--box-border); background-color:var(--danger-bg-color); color:var(--danger-fg-color); } +$output fieldset.story>div.output>div.code div.item.button.danger input[type=button] { background-color:var(--danger-bg-color); color:var(--danger-fg-color); } $output>fieldset.story>div.output div.item.card>div.output { padding:10px; } $output>fieldset.story>div.output div.item.card>div.output div.output { padding:5px 0; white-space:pre-line; } $output fieldset.story.form>div.output>div.code>input[type=button] { font-size:18px; margin:10px; height:36px; } diff --git a/src/gonganxitong/portal.go b/src/gonganxitong/portal.go index f61a79c..c29ba7b 100644 --- a/src/gonganxitong/portal.go +++ b/src/gonganxitong/portal.go @@ -289,10 +289,10 @@ func (s Portal) DashboardCreate(m *ice.Message, name string, arg ...string) func m.Cmd(s.FindSpaceCmd(m, web.TEAM_RENZHENGSHOUQUAN_AUTH), "dashboard", m.Option(model.AUTH_UID), m.Option(model.DASHBOARD_UID)) return func() { s.DashboardUpdate(m) } } -func (s Portal) DashboardInsert(m *ice.Message, score, title string, index ice.Any, field string, arg ...ice.Any) { +func (s Portal) DashboardInsert(m *ice.Message, score, title, unit string, index ice.Any, field string, arg ...ice.Any) { kit.If(len(arg) == 0, func() { arg = append(arg, s.Keys(s.Place, model.UID), m.Option(s.Keys(s.Place, model.UID))) }) m.Cmd(s.FindSpaceCmd(m, web.TEAM_DASHBOARD_SUMMARY), s.Insert, model.SPACE, m.Option(ice.MSG_USERPOD), model.INDEX, s.Prefix(m, index), - model.QUERY, kit.Format(arg), mdb.FIELD, field, model.TITLE, title, model.SCORE, score, m.OptionSimple(model.DASHBOARD_UID)) + model.QUERY, kit.Format(arg), mdb.FIELD, field, model.TITLE, title, model.SCORE, score, model.UNIT, unit, m.OptionSimple(model.DASHBOARD_UID)) } func (s Portal) DashboardUpdate(m *ice.Message, arg ...string) { if m.Option(model.DASHBOARD_UID) != "" { diff --git a/src/gonganxitong/portal.js b/src/gonganxitong/portal.js index 711af70..b82cfdf 100644 --- a/src/gonganxitong/portal.js +++ b/src/gonganxitong/portal.js @@ -161,9 +161,12 @@ Volcanos(chat.ONACTION, { can.user.isMobile && can._root.Inputs.appendChild(sub._target) can.user.isMobile && can.page.style(can, can._root.Action._output, html.VISIBILITY, html.HIDDEN) sub.Option("city_name", "深圳市") + // sub.Option("city_name", "邹城市") sub.Option("street_name", "航城街道") sub.Option("school_name", "深圳中学") sub.Option("company_name", "云境互联") + // sub.Option("company_name", "老邵木器加工") + sub.Option("store_name", "老邵木器加工") sub.Option("place_name", "易尚三维") sub.Option("queue_name", "二楼产检") sub.Option("reception_name", "科室1") diff --git a/src/gonganxitong/template/model/model.go b/src/gonganxitong/template/model/model.go index c684034..8a61af5 100644 --- a/src/gonganxitong/template/model/model.go +++ b/src/gonganxitong/template/model/model.go @@ -6,7 +6,6 @@ const ( UID = "uid" NAME = "name" TYPE = "type" - ROLE = "role" TITLE = "title" CONTENT = "content" USER_UID = "user_uid" diff --git a/src/huodongzuzhi/model/model.go b/src/huodongzuzhi/model/model.go index 490408b..14e3cca 100644 --- a/src/huodongzuzhi/model/model.go +++ b/src/huodongzuzhi/model/model.go @@ -6,7 +6,6 @@ const ( UID = "uid" NAME = "name" TYPE = "type" - ROLE = "role" TITLE = "title" CONTENT = "content" USER_UID = "user_uid" diff --git a/src/renzhengshouquan/common.go b/src/renzhengshouquan/common.go index 799dc39..77984e3 100644 --- a/src/renzhengshouquan/common.go +++ b/src/renzhengshouquan/common.go @@ -19,14 +19,7 @@ func (s Table) Inputs(m *ice.Message, arg ...string) { case model.USER_AUTH_ROLE: s.InputsListRole(m, UserAuthRoleList, arg...) case model.AUTH_TYPE: - if m.IsTech() { - s.InputsList(m, AuthTypeList, arg...) - } else { - for i, v := range AuthTypeList { - kit.If(i > 0, func() { m.Push(arg[0], i).Push(model.NAME, v) }) - } - m.SortInt(arg[0]).DisplayInputKeyNameIconTitle() - } + s.InputsListSkip(m, AuthTypeList, kit.Select("0", "-1", m.IsTech()), arg...) case model.AUTH_STATUS: s.InputsList(m, AuthStatusList, arg...) case model.FROM_UID: diff --git a/src/renzhengshouquan/model/model.go b/src/renzhengshouquan/model/model.go index d7124e7..48554b3 100644 --- a/src/renzhengshouquan/model/model.go +++ b/src/renzhengshouquan/model/model.go @@ -6,7 +6,6 @@ const ( UID = "uid" NAME = "name" TYPE = "type" - ROLE = "role" STATUS = "status" TITLE = "title" CONTENT = "content" diff --git a/src/renzhengshouquan/portal.go b/src/renzhengshouquan/portal.go index 7c21239..f2aa692 100644 --- a/src/renzhengshouquan/portal.go +++ b/src/renzhengshouquan/portal.go @@ -50,13 +50,13 @@ func (s Portal) PlaceCreate(m *ice.Message, arg ...string) { } func (s Portal) PlaceList(m *ice.Message, arg ...string) *ice.Message { s.Tables(m, "left join auths on user_auths.auth_uid = auths.uid").FieldsWithCreatedAT(m, s.UserPlace, - s.Keys(s.Place, model.NAME), s.Keys(s.Place, model.TYPE), s.Keys(s.Place, model.STATUS), s.Keys(s.UserPlace, model.ROLE), - s.AS(s.Key(s.Place, model.UID), s.Keys(s.Place, model.UID)), s.Keys(s.Street, model.UID), + model.AUTH_NAME, model.AUTH_TYPE, model.AUTH_STATUS, model.USER_AUTH_ROLE, + s.AS(s.Key(s.Place, model.UID), model.AUTH_UID), model.COMPANY_UID, ) if len(arg) == 1 { m.Cmdy(s.UserPlace, s.Table.Select, model.USER_UID, arg[0]) } else if len(arg) == 2 { - m.FieldsSetDetail().Cmdy(s.UserPlace, s.Table.Select, model.USER_UID, arg[0], s.Key(s.UserPlace, s.Keys(s.Place, model.UID)), arg[1]) + m.FieldsSetDetail().Cmdy(s.UserPlace, s.Table.Select, model.USER_UID, arg[0], s.Key(s.UserPlace, model.AUTH_UID), arg[1]) } else { return m } diff --git a/src/yuehaoxitong/model/model.go b/src/yuehaoxitong/model/model.go index d35578f..98a91ca 100644 --- a/src/yuehaoxitong/model/model.go +++ b/src/yuehaoxitong/model/model.go @@ -6,7 +6,6 @@ const ( UID = "uid" NAME = "name" TYPE = "type" - ROLE = "role" STATUS = "status" TITLE = "title" CONTENT = "content" diff --git a/src/yuehaoxitong/portal.go b/src/yuehaoxitong/portal.go index f16bbcc..939c717 100644 --- a/src/yuehaoxitong/portal.go +++ b/src/yuehaoxitong/portal.go @@ -15,9 +15,9 @@ type Portal struct { func (s Portal) AfterPlaceAuth(m *ice.Message, arg ...string) { defer s.DashboardCreate(m, "")() - s.DashboardInsert(m, "1", "订单总量", Schedule{}, "", model.QUEUE_UID, m.Option(model.QUEUE_UID)) - s.DashboardInsert(m, "2", "订单已预约", Schedule{}, "", model.QUEUE_UID, m.Option(model.QUEUE_UID), model.STATUS, SchedulePlan) - s.DashboardInsert(m, "3", "订单已取号", Schedule{}, "", model.QUEUE_UID, m.Option(model.QUEUE_UID), model.STATUS, ScheduleTake) - s.DashboardInsert(m, "4", "订单已完成", Schedule{}, "", model.QUEUE_UID, m.Option(model.QUEUE_UID), model.STATUS, ScheduleFinish) + s.DashboardInsert(m, "1", "订单总量", "order", Schedule{}, "", model.QUEUE_UID, m.Option(model.QUEUE_UID)) + s.DashboardInsert(m, "2", "订单已预约", "order", Schedule{}, "", model.QUEUE_UID, m.Option(model.QUEUE_UID), model.STATUS, SchedulePlan) + s.DashboardInsert(m, "3", "订单已取号", "order", Schedule{}, "", model.QUEUE_UID, m.Option(model.QUEUE_UID), model.STATUS, ScheduleTake) + s.DashboardInsert(m, "4", "订单已完成", "order", Schedule{}, "", model.QUEUE_UID, m.Option(model.QUEUE_UID), model.STATUS, ScheduleFinish) } func init() { gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(userQueue{}, queue{})}) }