Compare commits
No commits in common. "master" and "v0.0.5" have entirely different histories.
4
LICENSE
@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017-2025 shylinux
|
||||
Copyright (c) 2020 shylinux
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@ -18,4 +18,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
SOFTWARE.
|
3
Makefile
@ -1,11 +1,12 @@
|
||||
binarys = bin/ice.bin
|
||||
version = src/version.go
|
||||
binpack = src/binpack.go
|
||||
option = src/option.go
|
||||
flags = -ldflags "-w -s" -v
|
||||
|
||||
all: def
|
||||
@date +"%Y-%m-%d %H:%M:%S"
|
||||
go build ${flags} -o ${binarys} src/main.go src/option.go ${version} ${binpack} && ./${binarys} forever restart &>/dev/null
|
||||
go build ${flags} -o ${binarys} src/main.go ${option} ${version} ${binpack} && ./${binarys} forever restart &>/dev/null
|
||||
|
||||
def:
|
||||
@[ -f ${version} ] || echo "package main">${version}
|
||||
|
18
README.md
@ -1,11 +1,11 @@
|
||||
# ContextOS
|
||||
ContextOS 通过集群化、模块化、自动化的方式,只用一个 20M 大小的程序文件,就可以在各种设备上,一键启动完整的云计算服务与云研发环境。
|
||||
# Community
|
||||
Community 通过模块化、集群化、自动化的方式,只用一个 20M 大小的程序文件,就可以在各种设备上,一键启动完整的云计算服务与云研发环境。
|
||||
|
||||
## 安装系统
|
||||
### 下载编译
|
||||
## 源码安装
|
||||
### 克隆编译
|
||||
```sh
|
||||
git clone https://shylinux.com/x/ContextOS
|
||||
cd ContextOS; source etc/miss.sh
|
||||
git clone https://shylinux.com/x/community
|
||||
cd community; source etc/miss.sh
|
||||
```
|
||||
|
||||
### 启动服务
|
||||
@ -13,5 +13,7 @@ cd ContextOS; source etc/miss.sh
|
||||
ish_miss_serve
|
||||
```
|
||||
|
||||
### 管理后台
|
||||
打开管理后台 [http://localhost:9020](http://localhost:9020)
|
||||
### 访问网页
|
||||
```sh
|
||||
open http://localhost:9020
|
||||
```
|
||||
|
44
go.mod
@ -1,17 +1,14 @@
|
||||
module shylinux.com/x/community
|
||||
|
||||
go 1.21
|
||||
go 1.20
|
||||
|
||||
require (
|
||||
shylinux.com/x/enterprise v0.0.14
|
||||
shylinux.com/x/golang-story v0.0.32
|
||||
shylinux.com/x/mysql-story v0.6.32
|
||||
)
|
||||
|
||||
require (
|
||||
shylinux.com/x/ice v1.5.74
|
||||
shylinux.com/x/icebergs v1.9.76
|
||||
shylinux.com/x/toolkits v1.0.19
|
||||
shylinux.com/x/enterprise v0.0.4
|
||||
shylinux.com/x/golang-story v0.0.24
|
||||
shylinux.com/x/ice v1.5.44
|
||||
shylinux.com/x/icebergs v1.9.44
|
||||
shylinux.com/x/mysql-story v0.6.18
|
||||
shylinux.com/x/toolkits v1.0.14
|
||||
)
|
||||
|
||||
require (
|
||||
@ -21,35 +18,14 @@ require (
|
||||
)
|
||||
|
||||
require (
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1095
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ocr v1.0.1046
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/smh v1.0.1051
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sms v1.0.1047
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke v1.0.1095
|
||||
github.com/wechatpay-apiv3/wechatpay-go v0.2.20
|
||||
)
|
||||
|
||||
require (
|
||||
filippo.io/edwards25519 v1.1.0 // indirect
|
||||
github.com/dustin/go-humanize v1.0.1 // indirect
|
||||
github.com/emersion/go-imap v1.2.1 // indirect
|
||||
github.com/emersion/go-message v0.15.0 // indirect
|
||||
github.com/emersion/go-sasl v0.0.0-20200509203442-7bfe0ed36a21 // indirect
|
||||
github.com/emersion/go-textwrapper v0.0.0-20200911093747-65d896831594 // indirect
|
||||
github.com/glebarez/go-sqlite v1.21.2 // indirect
|
||||
github.com/glebarez/sqlite v1.11.0 // indirect
|
||||
github.com/go-sql-driver/mysql v1.9.0 // indirect
|
||||
github.com/google/uuid v1.3.0 // indirect
|
||||
github.com/go-sql-driver/mysql v1.7.0 // indirect
|
||||
github.com/jinzhu/inflection v1.0.0 // indirect
|
||||
github.com/jinzhu/now v1.1.5 // indirect
|
||||
github.com/mattn/go-isatty v0.0.17 // indirect
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec // indirect
|
||||
golang.org/x/sys v0.21.0 // indirect
|
||||
golang.org/x/text v0.22.0 // indirect
|
||||
golang.org/x/text v0.16.0 // indirect
|
||||
gorm.io/driver/mysql v1.5.7 // indirect
|
||||
gorm.io/gorm v1.25.12 // indirect
|
||||
modernc.org/libc v1.22.5 // indirect
|
||||
modernc.org/mathutil v1.5.0 // indirect
|
||||
modernc.org/memory v1.5.0 // indirect
|
||||
modernc.org/sqlite v1.23.1 // indirect
|
||||
gorm.io/gorm v1.25.11 // indirect
|
||||
)
|
||||
|
230
go.sum
@ -1,16 +1,13 @@
|
||||
filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
|
||||
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
|
||||
github.com/agiledragon/gomonkey v2.0.2+incompatible h1:eXKi9/piiC3cjJD1658mEE2o3NjkJ5vDLgYjCQu0Xlw=
|
||||
github.com/agiledragon/gomonkey v2.0.2+incompatible/go.mod h1:2NGfXu1a80LLr2cmWXGBDaHEjb1idR6+FVlX5T3D9hw=
|
||||
github.com/chzyer/logex v1.2.0/go.mod h1:9+9sk7u7pGNWYMkh0hdiL++6OeibzJccyQU4p4MedaY=
|
||||
github.com/chzyer/readline v1.5.0/go.mod h1:x22KAscuvRqlLoK9CsoYsmxoXZMMFVyOl86cAH8qUic=
|
||||
github.com/chzyer/test v0.0.0-20210722231415-061457976a23/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/PuerkitoBio/goquery v1.9.1/go.mod h1:cW1n6TmIMDoORQU5IU/P1T3tGFunOeXEpGP2WHRwkbY=
|
||||
github.com/andybalholm/cascadia v1.3.2/go.mod h1:7gtRlve5FxPPgIgX36uWBX58OdBsSS6lUvCFb+h7KvU=
|
||||
github.com/bgould/http v0.0.0-20190627042742-d268792bdee7/go.mod h1:BTqvVegvwifopl4KTEDth6Zezs9eR+lCWhvGKvkxJHE=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk=
|
||||
github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY=
|
||||
github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto=
|
||||
github.com/dhowden/itl v0.0.0-20170329215456-9fbe21093131/go.mod h1:eVWQJVQ67aMvYhpkDwaH2Goy2vo6v8JCMfGXfQ9sPtw=
|
||||
github.com/dhowden/plist v0.0.0-20141002110153-5db6e0d9931a/go.mod h1:sLjdR6uwx3L6/Py8F+QgAfeiuY87xuYGwCDqRFrvCzw=
|
||||
github.com/dhowden/tag v0.0.0-20240417053706-3d75831295e8/go.mod h1:apkPC/CR3s48O2D7Y++n1XWEpgPNNCjXYga3PPbJe2E=
|
||||
github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7joQ8SYLhZwfeOo6Ts=
|
||||
github.com/emersion/go-imap v1.2.1 h1:+s9ZjMEjOB8NzZMVTM3cCenz2JrQIGGo5j1df19WjTA=
|
||||
github.com/emersion/go-imap v1.2.1/go.mod h1:Qlx1FSx2FTxjnjWpIlVNEuX+ylerZQNFE5NsmKFSejY=
|
||||
github.com/emersion/go-message v0.15.0 h1:urgKGqt2JAc9NFJcgncQcohHdiYb803YTH9OQwHBHIY=
|
||||
@ -19,196 +16,201 @@ github.com/emersion/go-sasl v0.0.0-20200509203442-7bfe0ed36a21 h1:OJyUGMJTzHTd1X
|
||||
github.com/emersion/go-sasl v0.0.0-20200509203442-7bfe0ed36a21/go.mod h1:iL2twTeMvZnrg54ZoPDNfJaJaqy0xIQFuBdrLsmspwQ=
|
||||
github.com/emersion/go-textwrapper v0.0.0-20200911093747-65d896831594 h1:IbFBtwoTQyw0fIM5xv1HF+Y+3ZijDR839WMulgxCcUY=
|
||||
github.com/emersion/go-textwrapper v0.0.0-20200911093747-65d896831594/go.mod h1:aqO8z8wPrjkscevZJFVE1wXJrLpC5LtJG7fqLOsPb2U=
|
||||
github.com/glebarez/go-sqlite v1.21.2 h1:3a6LFC4sKahUunAmynQKLZceZCOzUthkRkEAl9gAXWo=
|
||||
github.com/glebarez/go-sqlite v1.21.2/go.mod h1:sfxdZyhQjTM2Wry3gVYWaW072Ri1WMdWJi0k6+3382k=
|
||||
github.com/glebarez/sqlite v1.11.0 h1:wSG0irqzP6VurnMEpFGer5Li19RpIRi2qvQz++w0GMw=
|
||||
github.com/glebarez/sqlite v1.11.0/go.mod h1:h8/o8j5wiAsqSPoWELDUdJXhjAhsVliSn7bWZjOhrgQ=
|
||||
github.com/frankban/quicktest v1.10.2/go.mod h1:K+q6oSqb0W0Ininfk863uOk1lMy69l/P6txr3mVT54s=
|
||||
github.com/glerchundi/subcommands v0.0.0-20181212083838-923a6ccb11f8/go.mod h1:r0g3O7Y5lrWXgDfcFBRgnAKzjmPgTzwoMC2ieB345FY=
|
||||
github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
|
||||
github.com/go-logfmt/logfmt v0.5.1/go.mod h1:WYhtIu8zTZfxdn5+rREduYbwxfcBr/Vr6KEVveWlfTs=
|
||||
github.com/go-ole/go-ole v1.2.6/go.mod h1:pprOEPIfldk/42T2oK7lQ4v4JSDwmV0As9GaiUsvbm0=
|
||||
github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc=
|
||||
github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
|
||||
github.com/go-sql-driver/mysql v1.9.0 h1:Y0zIbQXhQKmQgTp44Y1dp3wTXcn804QoTptLZT1vtvo=
|
||||
github.com/go-sql-driver/mysql v1.9.0/go.mod h1:pDetrLJeA3oMujJuvXc8RJoasr589B6A9fwzD3QMrqw=
|
||||
github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/godbus/dbus/v5 v5.1.0/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26 h1:Xim43kblpZXfIBQsbuBVKCudVG457BR2GZFIz3uw3hQ=
|
||||
github.com/google/pprof v0.0.0-20221118152302-e6195bd50e26/go.mod h1:dDKJzRmX4S37WGHujM7tX//fmj1uioxKzKxz3lo4HJo=
|
||||
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
|
||||
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/ianlancetaylor/demangle v0.0.0-20220319035150-800ac71e25c2/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w=
|
||||
github.com/google/shlex v0.0.0-20191202100458-e7afc7fbc510/go.mod h1:pupxD2MaaD3pAXIBCelhxNneeOaAeabZDe5s4K6zSpQ=
|
||||
github.com/hajimehoshi/go-jisx0208 v1.0.0/go.mod h1:yYxEStHL7lt9uL+AbdWgW9gBumwieDoZCiB1f/0X0as=
|
||||
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
|
||||
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
|
||||
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
|
||||
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
|
||||
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8=
|
||||
github.com/klauspost/cpuid/v2 v2.2.3/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY=
|
||||
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||
github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
|
||||
github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
|
||||
github.com/mattn/go-sqlite3 v1.14.16/go.mod h1:2eHXhiwb8IkHr+BDWZGa96P6+rkvnG63S2DGjv9HUNg=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
|
||||
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/mattn/go-sqlite3 v1.14.22/go.mod h1:Uh1q+B4BYcTPb+yiD3kU8Ct7aC0hY9fxUwlHK0RXw+Y=
|
||||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646/go.mod h1:jpp1/29i3P1S/RLdc7JQKbRpFeM1dOBd8T9ki5s+AY8=
|
||||
github.com/pelletier/go-toml v1.6.0/go.mod h1:5N711Q9dKgbdkxHL+MEfF31hpT7l0S0s/t2kKREewys=
|
||||
github.com/peterbourgon/ff/v3 v3.1.2/go.mod h1:XNJLY8EIl6MjMVjBS4F0+G0LYoAqs0DTa4rmHHukKDE=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20200410134404-eec4a21b6bb0/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec h1:W09IVJc94icq4NjY3clb7Lk8O1qJ8BdBEF8z0ibU0rE=
|
||||
github.com/remyoudompheng/bigfft v0.0.0-20230129092748-24d4a6f8daec/go.mod h1:qqbHyh8v60DhA7CoWK5oRCqLrMHRGoxYCSS9EjAz6Eo=
|
||||
github.com/sago35/go-bdf v0.0.0-20200313142241-6c17821c91c4/go.mod h1:rOebXGuMLsXhZAC6mF/TjxONsm45498ZyzVhel++6KM=
|
||||
github.com/saltosystems/winrt-go v0.0.0-20240509164145-4f7860a3bd2b/go.mod h1:CIltaIm7qaANUIvzr0Vmz71lmQMAIbGJ7cvgzX7FMfA=
|
||||
github.com/shirou/gopsutil v3.21.11+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA=
|
||||
github.com/sirupsen/logrus v1.5.0/go.mod h1:+F7Ogzej0PZc/94MaYx/nvG9jOFMD2osvC3s+Squfpo=
|
||||
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
|
||||
github.com/soypat/cyw43439 v0.0.0-20240609122733-da9153086796/go.mod h1:1Otjk6PRhfzfcVHeWMEeku/VntFqWghUwuSQyivb2vE=
|
||||
github.com/soypat/natiu-mqtt v0.5.1/go.mod h1:xEta+cwop9izVCW7xOx2W+ct9PRMqr0gNVkvBPnQTc4=
|
||||
github.com/soypat/saleae v0.0.0-20230402180913-3584b7515dae/go.mod h1:9SV+w6E9YK/BePxdxYGXthkrRztHJCQlojWOjAxW3M4=
|
||||
github.com/soypat/seqs v0.0.0-20240527012110-1201bab640ef/go.mod h1:oCVCNGCHMKoBj97Zp9znLbQ1nHxpkmOY9X+UAGzOxc8=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||
github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA=
|
||||
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.5/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1046/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1047/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1051/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1095 h1:chwhz7qiknR6hz/gVpQszRSL2Bw/jXNz9dHmY0tWelE=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/common v1.0.1095/go.mod h1:r5r4xbfxSaeR04b166HGsBa/R4U3SueirEUpXGuw+Q0=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ocr v1.0.1046 h1:P8TrTPEWu4GjnEMyNgdYmV5jXigGtDMn+sVTLJJvW0c=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/ocr v1.0.1046/go.mod h1:ifVagKrjnvy/ibrvLZjsELEh5WdRtchM8xyUlF88BNg=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/smh v1.0.1051 h1:P7q/ROrOi/M/VzM4ADMeALj94zJaW/zIGvJ6xe5BBkw=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/smh v1.0.1051/go.mod h1:dVFt5mYSzAtQ2uLOBavl9G4KHrjJJOCLqtrzvW+h0tg=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sms v1.0.1047 h1:FF8uERgTL9NKxgUHrKHbVefETVL3J6DeL9t6qvIT5yI=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/sms v1.0.1047/go.mod h1:3tgFFSlybx6XyhvLWpnSjWYFMedTyQC9oyh8CH1Ak28=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke v1.0.1095 h1:l7SQnVkft1vPdfE/gv/ee2wBj54+hacPzchjs4gnGgw=
|
||||
github.com/tencentcloud/tencentcloud-sdk-go/tencentcloud/tke v1.0.1095/go.mod h1:7V6/Y6tPk0jL21YAevsuDSBSN3nU5XFRBR6CFsTLhJE=
|
||||
github.com/wechatpay-apiv3/wechatpay-go v0.2.20 h1:gS8oFn1bHGnyapR2Zb4aqTV6l4kJWgbtqjCq6k1L9DQ=
|
||||
github.com/wechatpay-apiv3/wechatpay-go v0.2.20/go.mod h1:A254AUBVB6R+EqQFo3yTgeh7HtyqRRtN2w9hQSOrd4Q=
|
||||
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||
github.com/tdakkota/win32metadata v0.1.0/go.mod h1:77e6YvX0LIVW+O81fhWLnXAxxcyu/wdZdG7iwed7Fyk=
|
||||
github.com/tinygo-org/cbgo v0.0.4/go.mod h1:7+HgWIHd4nbAz0ESjGlJ1/v9LDU1Ox8MGzP9mah/fLk=
|
||||
github.com/tinygo-org/pio v0.0.0-20231216154340-cd888eb58899/go.mod h1:LU7Dw00NJ+N86QkeTGjMLNkYcEYMor6wTDpTCu0EaH8=
|
||||
github.com/tklauser/go-sysconf v0.3.13/go.mod h1:zwleP4Q4OehZHGn4CYZDipCgg9usW5IJePewFCGVEa0=
|
||||
github.com/tklauser/numcpus v0.7.0/go.mod h1:bb6dMVcj8A42tSE7i32fsIUCbQNllK5iDguyOZRUzAY=
|
||||
github.com/valyala/fastjson v1.6.3/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY=
|
||||
github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
github.com/yuin/goldmark v1.5.5/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||
github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.1.0/go.mod h1:RecgLatLF4+eUMCP1PoPZQb+cVrJcOPbHkTkbkB9sbw=
|
||||
golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
|
||||
golang.org/x/crypto v0.13.0/go.mod h1:y6Z2r+Rw4iayiXXAIxJIDAJ1zMW4yaTpebo8fPOliYc=
|
||||
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
|
||||
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
|
||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM=
|
||||
golang.org/x/exp v0.0.0-20230728194245-b0cb94b80691/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc=
|
||||
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
|
||||
golang.org/x/image v0.0.0-20220617043117-41969df76e82/go.mod h1:doUCurBvlfPMKfmIpRIywoHmhN3VyhnoFDbvIEWF4hY=
|
||||
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
|
||||
golang.org/x/mod v0.6.0/go.mod h1:4mET923SAdbXp2ki8ey+zGs1SLqsuM2Y0uvdZR/fUNI=
|
||||
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.11.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.12.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
|
||||
golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
|
||||
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
|
||||
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
|
||||
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
|
||||
golang.org/x/net v0.15.0/go.mod h1:idbUs1IY1+zTqbi8yxTbhexhEEk5ur9LInksu6HrEpk=
|
||||
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
|
||||
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
|
||||
golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y=
|
||||
golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220310020820-b874c991c1a5/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220624220833-87e55d714810/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
|
||||
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
||||
golang.org/x/telemetry v0.0.0-20240228155512-f48c80bd79b2/go.mod h1:TeRTkGYfJXctD9OcfyVLyj2J3IxLnKwHJR8f4D8a3YE=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
|
||||
golang.org/x/term v0.7.0/go.mod h1:P32HKFT3hSsZrRxla30E9HqToFYAQPCMs/zFMBUFqPY=
|
||||
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
|
||||
golang.org/x/term v0.11.0/go.mod h1:zC9APTIj3jG3FdV/Ons+XE1riIZXG4aZ4GTHiPZJPIU=
|
||||
golang.org/x/term v0.12.0/go.mod h1:owVbMEjm3cBLCHdkQu9b1opXd4ETQWc3BhuQGKgXgvU=
|
||||
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
|
||||
golang.org/x/term v0.20.0/go.mod h1:8UkIAJTvZgivsXaD6/pH6U9ecQzZ45awqEOzuCvwpFY=
|
||||
golang.org/x/term v0.21.0/go.mod h1:ooXLefLobQVslOqselCNF4SxFAaoS6KujMbsGzSDmX0=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
||||
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
|
||||
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
|
||||
golang.org/x/text v0.22.0 h1:bofq7m3/HAFvbF51jz3Q9wLg3jkvSPuiZu/pD1XwgtM=
|
||||
golang.org/x/text v0.22.0/go.mod h1:YRoo4H8PVmsu+E3Ou7cqLVH8oXWIHVoX0jqUWALQhfY=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.0.0-20201124115921-2c860bdd6e78/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
|
||||
golang.org/x/tools v0.1.11/go.mod h1:SgwaegtQh8clINPpECJMqnxLv9I09HLqnW3RMqW0CA4=
|
||||
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
|
||||
golang.org/x/tools v0.2.0/go.mod h1:y4OqIKeOV/fWJetJ8bXPU1sEVniLMIyDAZWeHdV+NTA=
|
||||
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
|
||||
golang.org/x/tools v0.13.0/go.mod h1:HvlwmtVNQAhOuCjW7xxvovg8wbNq7LwfXh/k7wXUl58=
|
||||
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gorm.io/driver/mysql v1.5.7 h1:MndhOPYOfEp2rHKgkZIhJ16eVUIRf2HmzgoPmh7FCWo=
|
||||
gorm.io/driver/mysql v1.5.7/go.mod h1:sEtPWMiqiN1N1cMXoXmBbd8C6/l+TESwriotuRRpkDM=
|
||||
gorm.io/driver/sqlite v1.5.6/go.mod h1:U+J8craQU6Fzkcvu8oLeAQmi50TkwPEhHDEjQZXDah4=
|
||||
gorm.io/gorm v1.25.7-0.20240204074919-46816ad31dde/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8=
|
||||
gorm.io/gorm v1.25.7/go.mod h1:hbnx/Oo0ChWMn1BIhpy1oYozzpM15i4YPuHDmfYtwg8=
|
||||
gorm.io/gorm v1.25.12 h1:I0u8i2hWQItBq1WfE0o2+WuL9+8L21K9e2HHSTE/0f8=
|
||||
gorm.io/gorm v1.25.12/go.mod h1:xh7N7RHfYlNc5EmcI/El95gXusucDrQnHXe0+CgWcLQ=
|
||||
lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk=
|
||||
lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk=
|
||||
modernc.org/cc/v3 v3.37.0/go.mod h1:vtL+3mdHx/wcj3iEGz84rQa8vEqR6XM84v5Lcvfph20=
|
||||
modernc.org/cc/v3 v3.40.0/go.mod h1:/bTg4dnWkSXowUO6ssQKnOV0yMVxDYNIsIrzqTFDGH0=
|
||||
modernc.org/ccgo/v3 v3.0.0-20220904174949-82d86e1b6d56/go.mod h1:YSXjPL62P2AMSxBphRHPn7IkzhVHqkvOnRKAKh+W6ZI=
|
||||
modernc.org/ccgo/v3 v3.16.13-0.20221017192402-261537637ce8/go.mod h1:fUB3Vn0nVPReA+7IG7yZDfjv1TMWjhQP8gCxrFAtL5g=
|
||||
modernc.org/ccgo/v3 v3.16.13/go.mod h1:2Quk+5YgpImhPjv2Qsob1DnZ/4som1lJTodubIcoUkY=
|
||||
modernc.org/ccorpus v1.11.6/go.mod h1:2gEUTrWqdpH2pXsmTM1ZkjeSrUWDpjMu2T6m29L/ErQ=
|
||||
modernc.org/httpfs v1.0.6/go.mod h1:7dosgurJGp0sPaRanU53W4xZYKh14wfzX420oZADeHM=
|
||||
modernc.org/libc v1.17.4/go.mod h1:WNg2ZH56rDEwdropAJeZPQkXmDwh+JCA1s/htl6r2fA=
|
||||
modernc.org/libc v1.20.3/go.mod h1:ZRfIaEkgrYgZDl6pa4W39HgN5G/yDW+NRmNKZBDFrk0=
|
||||
modernc.org/libc v1.21.4/go.mod h1:przBsL5RDOZajTVslkugzLBj1evTue36jEomFQOoYuI=
|
||||
modernc.org/libc v1.22.5 h1:91BNch/e5B0uPbJFgqbxXuOnxBQjlS//icfQEGmvyjE=
|
||||
modernc.org/libc v1.22.5/go.mod h1:jj+Z7dTNX8fBScMVNRAYZ/jF91K8fdT2hYMThc3YjBY=
|
||||
modernc.org/mathutil v1.5.0 h1:rV0Ko/6SfM+8G+yKiyI830l3Wuz1zRutdslNoQ0kfiQ=
|
||||
modernc.org/mathutil v1.5.0/go.mod h1:mZW8CKdRPY1v87qxC/wUdX5O1qDzXMP5TH3wjfpga6E=
|
||||
modernc.org/memory v1.3.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU=
|
||||
modernc.org/memory v1.4.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU=
|
||||
modernc.org/memory v1.5.0 h1:N+/8c5rE6EqugZwHii4IFsaJ7MUhoWX07J5tC/iI5Ds=
|
||||
modernc.org/memory v1.5.0/go.mod h1:PkUhL0Mugw21sHPeskwZW4D6VscE/GQJOnIpCnW6pSU=
|
||||
modernc.org/opt v0.1.1/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0=
|
||||
modernc.org/opt v0.1.3/go.mod h1:WdSiB5evDcignE70guQKxYUl14mgWtbClRi5wmkkTX0=
|
||||
modernc.org/sqlite v1.23.1 h1:nrSBg4aRQQwq59JpvGEQ15tNxoO5pX/kUjcRNwSAGQM=
|
||||
modernc.org/sqlite v1.23.1/go.mod h1:OrDj17Mggn6MhE+iPbBNf7RGKODDE9NFT0f3EwDzJqk=
|
||||
modernc.org/strutil v1.1.3/go.mod h1:MEHNA7PdEnEwLvspRMtWTNnp2nnyvMfkimT1NKNAGbw=
|
||||
modernc.org/tcl v1.15.2/go.mod h1:3+k/ZaEbKrC8ePv8zJWPtBSW0V7Gg9g8rkmhI1Kfs3c=
|
||||
modernc.org/token v1.0.1/go.mod h1:UGzOrNV1mAFSEB63lOFHIpNRUVMvYTc6yu1SMY/XTDM=
|
||||
modernc.org/z v1.7.3/go.mod h1:Ipv4tsdxZRbQyLq9Q1M6gdbkxYzdlrciF2Hi/lS7nWE=
|
||||
shylinux.com/x/enterprise v0.0.14 h1:gxxAtMt4sLy8+HN10jJipZ6xa0it/rllZZGKwWILJ2Q=
|
||||
shylinux.com/x/enterprise v0.0.14/go.mod h1:RR4LfgQMgy8ckZuga6pEvEl9TxF3gbfHN+Mh3Jhk1GI=
|
||||
gorm.io/gorm v1.25.11 h1:/Wfyg1B/je1hnDx3sMkX+gAlxrlZpn6X0BXRlwXlvHg=
|
||||
gorm.io/gorm v1.25.11/go.mod h1:xh7N7RHfYlNc5EmcI/El95gXusucDrQnHXe0+CgWcLQ=
|
||||
shylinux.com/x/enterprise v0.0.4 h1:aLppC1qK/kGrUMDCqKS9YGUaDEcEZpnlcVbVQahxFBk=
|
||||
shylinux.com/x/enterprise v0.0.4/go.mod h1:sBLCMzaz612zlLlTFB93e302dYOy4aS856xaXqyBNJg=
|
||||
shylinux.com/x/go-git/v5 v5.6.7 h1:WD5QSco7m3QooPCgdvQ6/GyGIFPun8C+hex5N41LYlk=
|
||||
shylinux.com/x/go-git/v5 v5.6.7/go.mod h1:Qb0lA+uIrofZg8NQerhYcJHgGWixFqvS6p3aJ/L5Nlk=
|
||||
shylinux.com/x/go-qrcode v0.0.3 h1:RMo+Vidbgq3HatLBj7DDXcTbTLFUwzis5K7TqBkD38U=
|
||||
shylinux.com/x/go-qrcode v0.0.3/go.mod h1:KAbtU+KwiiABMZ/CJ0zh9PI2AX82Uf9rRYcQ4ODm4po=
|
||||
shylinux.com/x/go-sql-mysql v0.0.2/go.mod h1:lHjRMZz5Lii6U+49fhkbCWgsnL+yux54SYJYWqASN8Y=
|
||||
shylinux.com/x/golang-story v0.0.32 h1:7xu28iREL2cuZzf80luJwI9BWptow+ME00L1lgyjmDI=
|
||||
shylinux.com/x/golang-story v0.0.32/go.mod h1:NsI5fULu3q7o2b+VzZ5tiJ3+0pUTjE9DdQxa870htmw=
|
||||
shylinux.com/x/ice v1.5.73/go.mod h1:uGI73gYkk+FiJt5qmy/aYhoKRJ4wobcJk3WrPGh8Waw=
|
||||
shylinux.com/x/ice v1.5.74 h1:5hTPmchO79b1d2+/DwBDLiG2WkTL65G/hOEAcGJVeB8=
|
||||
shylinux.com/x/ice v1.5.74/go.mod h1:/XAib8Ha+z6jzLRs2Pig+qxDx4C8dT8Vfaq2InJ/lkU=
|
||||
shylinux.com/x/icebergs v1.9.75/go.mod h1:3Bdp3tjzw+hUKJF+kR8pfsrbjAf72DVZmCaE8/MPFtk=
|
||||
shylinux.com/x/icebergs v1.9.76 h1:SHOTbiO+jh09GEFzoo8t8kmR1BCu+zkNCpdfxPCLeu0=
|
||||
shylinux.com/x/icebergs v1.9.76/go.mod h1:3Bdp3tjzw+hUKJF+kR8pfsrbjAf72DVZmCaE8/MPFtk=
|
||||
shylinux.com/x/mysql-story v0.6.32 h1:Q274WFJ09ocnf8nhlQnKr02FMMdPYBLWqu2IjTVqGiM=
|
||||
shylinux.com/x/mysql-story v0.6.32/go.mod h1:8HCeDUV6ghaIeJD1IEhSeSOfVC9wEI93y2G9QBLtJJY=
|
||||
shylinux.com/x/golang-story v0.0.24 h1:0gzXdo4sIw9LxoNaEOueEDKC+Cb0IGcFAi44vigoVf8=
|
||||
shylinux.com/x/golang-story v0.0.24/go.mod h1:G0WEOJ0gCYR2tOs1ggyMBBrUMqJEgJjyvdFjN3VpNoM=
|
||||
shylinux.com/x/ice v1.5.41/go.mod h1:hMhVMhUlsimwFcsPIH+J/tO8O8I0WEqg1NYyqdhULxE=
|
||||
shylinux.com/x/ice v1.5.44 h1:jRDnJrLrg1jmvCEHPz7C5KkI0UZGn7t9M6IPs2B+rhE=
|
||||
shylinux.com/x/ice v1.5.44/go.mod h1:/ze8UI3sUpdx8S/Qadr8xYRvLIri4P93Mkwi4b9EmEk=
|
||||
shylinux.com/x/icebergs v1.9.39/go.mod h1:rUqDj1pzd6uPj7+klEn+doqXiWlb/24/batRyBB5ppo=
|
||||
shylinux.com/x/icebergs v1.9.44 h1:IxT1ipYtUZj52d3AHbxu73fmzxMyXPOO7RR+Qv60aoI=
|
||||
shylinux.com/x/icebergs v1.9.44/go.mod h1:/BcFEB/6Dd70Owmb3wsA9NYShHQwmSH74xn9pNudRMg=
|
||||
shylinux.com/x/mysql-story v0.6.18 h1:MmeA2VP4pmClo58c1Qau2mkhvUz5o2od+mnhC8RKrok=
|
||||
shylinux.com/x/mysql-story v0.6.18/go.mod h1:Am+fx/T9pEeUepoX0eoSM53Qu0xVcQKpLGdBNC+x43A=
|
||||
shylinux.com/x/toolkits v0.7.10/go.mod h1:CHDJarGlDkg60kVsvMLYL/a5hAnRLEOShiEsMOuEp0Q=
|
||||
shylinux.com/x/toolkits v1.0.19 h1:Nrx0xYRc5ph1WS66EZ1hJUCe+2FdSWQ4QP6tBlguikQ=
|
||||
shylinux.com/x/toolkits v1.0.19/go.mod h1:CHDJarGlDkg60kVsvMLYL/a5hAnRLEOShiEsMOuEp0Q=
|
||||
shylinux.com/x/toolkits v1.0.13/go.mod h1:CHDJarGlDkg60kVsvMLYL/a5hAnRLEOShiEsMOuEp0Q=
|
||||
shylinux.com/x/toolkits v1.0.14 h1:ysp9Yl0YjVqtGn/KXQnKfjn3/3RYgVdll2WOYUscd9c=
|
||||
shylinux.com/x/toolkits v1.0.14/go.mod h1:CHDJarGlDkg60kVsvMLYL/a5hAnRLEOShiEsMOuEp0Q=
|
||||
shylinux.com/x/websocket v0.0.4 h1:AJpwblePoOpiE6C8NrvgNYpKTotXMLrDDX2chTvx44Q=
|
||||
shylinux.com/x/websocket v0.0.4/go.mod h1:3UGWkjTu3ie5NAZen7J+uLPBrO7DFeKloj6Jxo13Oiw=
|
||||
tinygo.org/x/bluetooth v0.10.0/go.mod h1:t/Vm2a/rslsBoqFQKCBsWQw/cmRicQq+8Tl3tj5RCRI=
|
||||
tinygo.org/x/drivers v0.14.0/go.mod h1:uT2svMq3EpBZpKkGO+NQHjxjGf1f42ra4OnMMwQL2aI=
|
||||
tinygo.org/x/drivers v0.15.1/go.mod h1:uT2svMq3EpBZpKkGO+NQHjxjGf1f42ra4OnMMwQL2aI=
|
||||
tinygo.org/x/drivers v0.16.0/go.mod h1:uT2svMq3EpBZpKkGO+NQHjxjGf1f42ra4OnMMwQL2aI=
|
||||
tinygo.org/x/drivers v0.19.0/go.mod h1:uJD/l1qWzxzLx+vcxaW0eY464N5RAgFi1zTVzASFdqI=
|
||||
tinygo.org/x/drivers v0.25.0/go.mod h1:v+mXaA4cgpz/YZJ3ZPm/86bYQJAXTaYtMkHlVwbodbw=
|
||||
tinygo.org/x/drivers v0.26.1-0.20230922160320-ed51435c2ef6/go.mod h1:X7utcg3yfFUFuKLOMTZD56eztXMjpkcf8OHldfTBsjw=
|
||||
tinygo.org/x/tinyfont v0.2.1/go.mod h1:eLqnYSrFRjt5STxWaMeOWJTzrKhXqpWw7nU3bPfKOAM=
|
||||
tinygo.org/x/tinyfont v0.3.0/go.mod h1:+TV5q0KpwSGRWnN+ITijsIhrWYJkoUCp9MYELjKpAXk=
|
||||
tinygo.org/x/tinyfont v0.4.0/go.mod h1:7nVj3j3geqBoPDzpFukAhF1C8AP9YocMsZy0HSAcGCA=
|
||||
tinygo.org/x/tinyfs v0.1.0/go.mod h1:ysc8Y92iHfhTXeyEM9+c7zviUQ4fN9UCFgSOFfMWv20=
|
||||
tinygo.org/x/tinyterm v0.1.0/go.mod h1:/DDhNnGwNF2/tNgHywvyZuCGnbH3ov49Z/6e8LPLRR4=
|
||||
tinygo.org/x/tinyterm v0.3.0/go.mod h1:F1pQjxEwNZQIc5czeJSBtk57ucEvbR4u7vHaLhWhHtg=
|
||||
|
@ -1,105 +0,0 @@
|
||||
package api
|
||||
|
||||
const GONGANXITONG_PORTAL = "web.team.gonganxitong.portal"
|
||||
const GONGANXITONG_ALLOW = "web.team.gonganxitong.allow"
|
||||
const GONGANXITONG_APPLY = "web.team.gonganxitong.apply"
|
||||
const GONGANXITONG_CITY = "web.team.gonganxitong.city"
|
||||
const GONGANXITONG_CONTRACT = "web.team.gonganxitong.contract"
|
||||
const GONGANXITONG_CREDIT = "web.team.gonganxitong.credit"
|
||||
const GONGANXITONG_DOCUMENT = "web.team.gonganxitong.document"
|
||||
const GONGANXITONG_DOMAIN = "web.team.gonganxitong.domain"
|
||||
const GONGANXITONG_EMAIL = "web.team.gonganxitong.email"
|
||||
const GONGANXITONG_EVENT = "web.team.gonganxitong.event"
|
||||
const GONGANXITONG_MARKET = "web.team.gonganxitong.market"
|
||||
const GONGANXITONG_MEETING = "web.team.gonganxitong.meeting"
|
||||
const GONGANXITONG_MEMBER = "web.team.gonganxitong.member"
|
||||
const GONGANXITONG_MESSAGE = "web.team.gonganxitong.message"
|
||||
const GONGANXITONG_NOTICE = "web.team.gonganxitong.notice"
|
||||
const GONGANXITONG_PAYMENTLIST = "web.team.gonganxitong.paymentlist"
|
||||
const GONGANXITONG_PHOTO = "web.team.gonganxitong.photo"
|
||||
const GONGANXITONG_QRCODE = "web.team.gonganxitong.qrcode"
|
||||
const GONGANXITONG_RECENT = "web.team.gonganxitong.recent"
|
||||
const GONGANXITONG_SERVICE = "web.team.gonganxitong.service"
|
||||
const GONGANXITONG_SETTING = "web.team.gonganxitong.setting"
|
||||
const GONGANXITONG_STREET = "web.team.gonganxitong.street"
|
||||
const GONGANXITONG_SUPPORT = "web.team.gonganxitong.support"
|
||||
const GONGANXITONG_USER = "web.team.gonganxitong.user"
|
||||
const HUODONGZUZHI_ACTIVITY = "web.team.huodongzuzhi.activity"
|
||||
const HUODONGZUZHI_PORTAL = "web.team.huodongzuzhi.portal"
|
||||
const HUODONGZUZHI_ALLOW = "web.team.huodongzuzhi.allow"
|
||||
const HUODONGZUZHI_APPLY = "web.team.huodongzuzhi.apply"
|
||||
const HUODONGZUZHI_CONTRACT = "web.team.huodongzuzhi.contract"
|
||||
const HUODONGZUZHI_CREDIT = "web.team.huodongzuzhi.credit"
|
||||
const HUODONGZUZHI_DOCUMENT = "web.team.huodongzuzhi.document"
|
||||
const HUODONGZUZHI_EVENT = "web.team.huodongzuzhi.event"
|
||||
const HUODONGZUZHI_MARKET = "web.team.huodongzuzhi.market"
|
||||
const HUODONGZUZHI_MEETING = "web.team.huodongzuzhi.meeting"
|
||||
const HUODONGZUZHI_MEMBER = "web.team.huodongzuzhi.member"
|
||||
const HUODONGZUZHI_MESSAGE = "web.team.huodongzuzhi.message"
|
||||
const HUODONGZUZHI_NOTICE = "web.team.huodongzuzhi.notice"
|
||||
const HUODONGZUZHI_PAYMENTLIST = "web.team.huodongzuzhi.paymentlist"
|
||||
const HUODONGZUZHI_PHOTO = "web.team.huodongzuzhi.photo"
|
||||
const HUODONGZUZHI_QRCODE = "web.team.huodongzuzhi.qrcode"
|
||||
const HUODONGZUZHI_RECENT = "web.team.huodongzuzhi.recent"
|
||||
const HUODONGZUZHI_SERVICE = "web.team.huodongzuzhi.service"
|
||||
const HUODONGZUZHI_SETTING = "web.team.huodongzuzhi.setting"
|
||||
const HUODONGZUZHI_SUPPORT = "web.team.huodongzuzhi.support"
|
||||
const RENZHENGSHOUQUAN_ADMIN = "web.team.renzhengshouquan.admin"
|
||||
const RENZHENGSHOUQUAN_PORTAL = "web.team.renzhengshouquan.portal"
|
||||
const RENZHENGSHOUQUAN_ALLOW = "web.team.renzhengshouquan.allow"
|
||||
const RENZHENGSHOUQUAN_APPLY = "web.team.renzhengshouquan.apply"
|
||||
const RENZHENGSHOUQUAN_AUTH = "web.team.renzhengshouquan.auth"
|
||||
const RENZHENGSHOUQUAN_CERT = "web.team.renzhengshouquan.cert"
|
||||
const RENZHENGSHOUQUAN_CONTRACT = "web.team.renzhengshouquan.contract"
|
||||
const RENZHENGSHOUQUAN_CREDIT = "web.team.renzhengshouquan.credit"
|
||||
const RENZHENGSHOUQUAN_DOCUMENT = "web.team.renzhengshouquan.document"
|
||||
const RENZHENGSHOUQUAN_DOMAIN = "web.team.renzhengshouquan.domain"
|
||||
const RENZHENGSHOUQUAN_EVENT = "web.team.renzhengshouquan.event"
|
||||
const RENZHENGSHOUQUAN_EXTERNAL_TENCENT_MEETING = "web.team.renzhengshouquan.external.tencent.meeting"
|
||||
const RENZHENGSHOUQUAN_EXTERNAL_TENCENTCLOUD_REALNAME_REALNAM = "web.team.renzhengshouquan.external.tencentcloud.realname.realnam"
|
||||
const RENZHENGSHOUQUAN_EXTERNAL_TENCENTCLOUD_SMH_SMH = "web.team.renzhengshouquan.external.tencentcloud.smh.smh"
|
||||
const RENZHENGSHOUQUAN_EXTERNAL_TENCENTCLOUD_SMS_SMS = "web.team.renzhengshouquan.external.tencentcloud.sms.sms"
|
||||
const RENZHENGSHOUQUAN_EXTERNAL_TENCENTCLOUD_TENCENTCLOUD = "web.team.renzhengshouquan.external.tencentcloud.tencentcloud"
|
||||
const RENZHENGSHOUQUAN_EXTERNAL_TENCENTDOCUMENT_TENCENTDOCUME = "web.team.renzhengshouquan.external.tencentdocument.tencentdocume"
|
||||
const RENZHENGSHOUQUAN_EXTERNAL_TENCENTMEETING_TENCENTMEETING = "web.team.renzhengshouquan.external.tencentmeeting.tencentmeeting"
|
||||
const RENZHENGSHOUQUAN_EXTERNAL_WEIXINPAYMENT_WEIXINPAYMENT = "web.team.renzhengshouquan.external.weixinpayment.weixinpayment"
|
||||
const RENZHENGSHOUQUAN_MARKET = "web.team.renzhengshouquan.market"
|
||||
const RENZHENGSHOUQUAN_MEETING = "web.team.renzhengshouquan.meeting"
|
||||
const RENZHENGSHOUQUAN_MEMBER = "web.team.renzhengshouquan.member"
|
||||
const RENZHENGSHOUQUAN_MESSAGE = "web.team.renzhengshouquan.message"
|
||||
const RENZHENGSHOUQUAN_NOTICE = "web.team.renzhengshouquan.notice"
|
||||
const RENZHENGSHOUQUAN_PAYMENTLIST = "web.team.renzhengshouquan.paymentlist"
|
||||
const RENZHENGSHOUQUAN_PHOTO = "web.team.renzhengshouquan.photo"
|
||||
const RENZHENGSHOUQUAN_PROFILE = "web.team.renzhengshouquan.profile"
|
||||
const RENZHENGSHOUQUAN_QRCODE = "web.team.renzhengshouquan.qrcode"
|
||||
const RENZHENGSHOUQUAN_RECENT = "web.team.renzhengshouquan.recent"
|
||||
const RENZHENGSHOUQUAN_SERVICE = "web.team.renzhengshouquan.service"
|
||||
const RENZHENGSHOUQUAN_SETTING = "web.team.renzhengshouquan.setting"
|
||||
const RENZHENGSHOUQUAN_SUPPORT = "web.team.renzhengshouquan.support"
|
||||
const YUEHAOXITONG_PORTAL = "web.team.yuehaoxitong.portal"
|
||||
const YUEHAOXITONG_ALLOW = "web.team.yuehaoxitong.allow"
|
||||
const YUEHAOXITONG_APPLY = "web.team.yuehaoxitong.apply"
|
||||
const YUEHAOXITONG_CALL = "web.team.yuehaoxitong.call"
|
||||
const YUEHAOXITONG_CONTRACT = "web.team.yuehaoxitong.contract"
|
||||
const YUEHAOXITONG_CREDIT = "web.team.yuehaoxitong.credit"
|
||||
const YUEHAOXITONG_DOCUMENT = "web.team.yuehaoxitong.document"
|
||||
const YUEHAOXITONG_EVENT = "web.team.yuehaoxitong.event"
|
||||
const YUEHAOXITONG_HISTORY = "web.team.yuehaoxitong.history"
|
||||
const YUEHAOXITONG_MARKET = "web.team.yuehaoxitong.market"
|
||||
const YUEHAOXITONG_MEETING = "web.team.yuehaoxitong.meeting"
|
||||
const YUEHAOXITONG_MEMBER = "web.team.yuehaoxitong.member"
|
||||
const YUEHAOXITONG_MESSAGE = "web.team.yuehaoxitong.message"
|
||||
const YUEHAOXITONG_NOTICE = "web.team.yuehaoxitong.notice"
|
||||
const YUEHAOXITONG_OPEN = "web.team.yuehaoxitong.open"
|
||||
const YUEHAOXITONG_PAYMENTLIST = "web.team.yuehaoxitong.paymentlist"
|
||||
const YUEHAOXITONG_PHOTO = "web.team.yuehaoxitong.photo"
|
||||
const YUEHAOXITONG_PLAN = "web.team.yuehaoxitong.plan"
|
||||
const YUEHAOXITONG_QRCODE = "web.team.yuehaoxitong.qrcode"
|
||||
const YUEHAOXITONG_RECENT = "web.team.yuehaoxitong.recent"
|
||||
const YUEHAOXITONG_RECEPTION = "web.team.yuehaoxitong.reception"
|
||||
const YUEHAOXITONG_SCHEDULE = "web.team.yuehaoxitong.schedule"
|
||||
const YUEHAOXITONG_SERVICE = "web.team.yuehaoxitong.service"
|
||||
const YUEHAOXITONG_SETTING = "web.team.yuehaoxitong.setting"
|
||||
const YUEHAOXITONG_SUPPORT = "web.team.yuehaoxitong.support"
|
||||
const YUEHAOXITONG_TAKE = "web.team.yuehaoxitong.take"
|
||||
const YUEHAOXITONG_VOLUME = "web.team.yuehaoxitong.volume"
|
@ -1,82 +0,0 @@
|
||||
package api
|
||||
|
||||
const JIAOCAIZILIAO_PORTAL = "web.team.jiaocaiziliao.portal"
|
||||
const JIAOCAIZILIAO_ALLOW = "web.team.jiaocaiziliao.allow"
|
||||
const JIAOCAIZILIAO_APPLY = "web.team.jiaocaiziliao.apply"
|
||||
const JIAOCAIZILIAO_CONTRACT = "web.team.jiaocaiziliao.contract"
|
||||
const JIAOCAIZILIAO_CREDIT = "web.team.jiaocaiziliao.credit"
|
||||
const JIAOCAIZILIAO_DOCUMENT = "web.team.jiaocaiziliao.document"
|
||||
const JIAOCAIZILIAO_EVENT = "web.team.jiaocaiziliao.event"
|
||||
const JIAOCAIZILIAO_MARKET = "web.team.jiaocaiziliao.market"
|
||||
const JIAOCAIZILIAO_MEETING = "web.team.jiaocaiziliao.meeting"
|
||||
const JIAOCAIZILIAO_MEMBER = "web.team.jiaocaiziliao.member"
|
||||
const JIAOCAIZILIAO_MESSAGE = "web.team.jiaocaiziliao.message"
|
||||
const JIAOCAIZILIAO_NOTICE = "web.team.jiaocaiziliao.notice"
|
||||
const JIAOCAIZILIAO_OFFICIAL = "web.team.jiaocaiziliao.official"
|
||||
const JIAOCAIZILIAO_PAYMENTLIST = "web.team.jiaocaiziliao.paymentlist"
|
||||
const JIAOCAIZILIAO_PHOTO = "web.team.jiaocaiziliao.photo"
|
||||
const JIAOCAIZILIAO_QRCODE = "web.team.jiaocaiziliao.qrcode"
|
||||
const JIAOCAIZILIAO_RECENT = "web.team.jiaocaiziliao.recent"
|
||||
const JIAOCAIZILIAO_SERVICE = "web.team.jiaocaiziliao.service"
|
||||
const JIAOCAIZILIAO_SETTING = "web.team.jiaocaiziliao.setting"
|
||||
const JIAOCAIZILIAO_SUPPORT = "web.team.jiaocaiziliao.support"
|
||||
const JIAOWUXITONG_PORTAL = "web.team.jiaowuxitong.portal"
|
||||
const JIAOWUXITONG_ALLOW = "web.team.jiaowuxitong.allow"
|
||||
const JIAOWUXITONG_APPLY = "web.team.jiaowuxitong.apply"
|
||||
const JIAOWUXITONG_CONTRACT = "web.team.jiaowuxitong.contract"
|
||||
const JIAOWUXITONG_CREDIT = "web.team.jiaowuxitong.credit"
|
||||
const JIAOWUXITONG_DOCUMENT = "web.team.jiaowuxitong.document"
|
||||
const JIAOWUXITONG_EVENT = "web.team.jiaowuxitong.event"
|
||||
const JIAOWUXITONG_HOMEWORK = "web.team.jiaowuxitong.homework"
|
||||
const JIAOWUXITONG_MARKET = "web.team.jiaowuxitong.market"
|
||||
const JIAOWUXITONG_MEETING = "web.team.jiaowuxitong.meeting"
|
||||
const JIAOWUXITONG_MEMBER = "web.team.jiaowuxitong.member"
|
||||
const JIAOWUXITONG_MESSAGE = "web.team.jiaowuxitong.message"
|
||||
const JIAOWUXITONG_NOTICE = "web.team.jiaowuxitong.notice"
|
||||
const JIAOWUXITONG_PAYMENTLIST = "web.team.jiaowuxitong.paymentlist"
|
||||
const JIAOWUXITONG_PHOTO = "web.team.jiaowuxitong.photo"
|
||||
const JIAOWUXITONG_QRCODE = "web.team.jiaowuxitong.qrcode"
|
||||
const JIAOWUXITONG_RECENT = "web.team.jiaowuxitong.recent"
|
||||
const JIAOWUXITONG_SERVICE = "web.team.jiaowuxitong.service"
|
||||
const JIAOWUXITONG_SETTING = "web.team.jiaowuxitong.setting"
|
||||
const JIAOWUXITONG_SUPPORT = "web.team.jiaowuxitong.support"
|
||||
const KAOSHIXITONG_PORTAL = "web.team.kaoshixitong.portal"
|
||||
const KAOSHIXITONG_ALLOW = "web.team.kaoshixitong.allow"
|
||||
const KAOSHIXITONG_APPLY = "web.team.kaoshixitong.apply"
|
||||
const KAOSHIXITONG_CONTRACT = "web.team.kaoshixitong.contract"
|
||||
const KAOSHIXITONG_CREDIT = "web.team.kaoshixitong.credit"
|
||||
const KAOSHIXITONG_DOCUMENT = "web.team.kaoshixitong.document"
|
||||
const KAOSHIXITONG_EVENT = "web.team.kaoshixitong.event"
|
||||
const KAOSHIXITONG_MARKET = "web.team.kaoshixitong.market"
|
||||
const KAOSHIXITONG_MEETING = "web.team.kaoshixitong.meeting"
|
||||
const KAOSHIXITONG_MEMBER = "web.team.kaoshixitong.member"
|
||||
const KAOSHIXITONG_MESSAGE = "web.team.kaoshixitong.message"
|
||||
const KAOSHIXITONG_NOTICE = "web.team.kaoshixitong.notice"
|
||||
const KAOSHIXITONG_PAYMENTLIST = "web.team.kaoshixitong.paymentlist"
|
||||
const KAOSHIXITONG_PHOTO = "web.team.kaoshixitong.photo"
|
||||
const KAOSHIXITONG_QRCODE = "web.team.kaoshixitong.qrcode"
|
||||
const KAOSHIXITONG_QUESTION = "web.team.kaoshixitong.question"
|
||||
const KAOSHIXITONG_RECENT = "web.team.kaoshixitong.recent"
|
||||
const KAOSHIXITONG_SERVICE = "web.team.kaoshixitong.service"
|
||||
const KAOSHIXITONG_SETTING = "web.team.kaoshixitong.setting"
|
||||
const KAOSHIXITONG_SUPPORT = "web.team.kaoshixitong.support"
|
||||
const ZAIXIANKETANG_PORTAL = "web.team.zaixianketang.portal"
|
||||
const ZAIXIANKETANG_ALLOW = "web.team.zaixianketang.allow"
|
||||
const ZAIXIANKETANG_APPLY = "web.team.zaixianketang.apply"
|
||||
const ZAIXIANKETANG_CONTRACT = "web.team.zaixianketang.contract"
|
||||
const ZAIXIANKETANG_CREDIT = "web.team.zaixianketang.credit"
|
||||
const ZAIXIANKETANG_DOCUMENT = "web.team.zaixianketang.document"
|
||||
const ZAIXIANKETANG_EVENT = "web.team.zaixianketang.event"
|
||||
const ZAIXIANKETANG_LESSON = "web.team.zaixianketang.lesson"
|
||||
const ZAIXIANKETANG_MARKET = "web.team.zaixianketang.market"
|
||||
const ZAIXIANKETANG_MEETING = "web.team.zaixianketang.meeting"
|
||||
const ZAIXIANKETANG_MEMBER = "web.team.zaixianketang.member"
|
||||
const ZAIXIANKETANG_MESSAGE = "web.team.zaixianketang.message"
|
||||
const ZAIXIANKETANG_NOTICE = "web.team.zaixianketang.notice"
|
||||
const ZAIXIANKETANG_PAYMENTLIST = "web.team.zaixianketang.paymentlist"
|
||||
const ZAIXIANKETANG_PHOTO = "web.team.zaixianketang.photo"
|
||||
const ZAIXIANKETANG_QRCODE = "web.team.zaixianketang.qrcode"
|
||||
const ZAIXIANKETANG_RECENT = "web.team.zaixianketang.recent"
|
||||
const ZAIXIANKETANG_SERVICE = "web.team.zaixianketang.service"
|
||||
const ZAIXIANKETANG_SETTING = "web.team.zaixianketang.setting"
|
||||
const ZAIXIANKETANG_SUPPORT = "web.team.zaixianketang.support"
|
@ -1,106 +0,0 @@
|
||||
package api
|
||||
|
||||
const GONGYINGLIAN_PORTAL = "web.team.gongyinglian.portal"
|
||||
const GONGYINGLIAN_ALLOW = "web.team.gongyinglian.allow"
|
||||
const GONGYINGLIAN_APPLY = "web.team.gongyinglian.apply"
|
||||
const GONGYINGLIAN_BRAND = "web.team.gongyinglian.brand"
|
||||
const GONGYINGLIAN_CONTRACT = "web.team.gongyinglian.contract"
|
||||
const GONGYINGLIAN_CREDIT = "web.team.gongyinglian.credit"
|
||||
const GONGYINGLIAN_DOCUMENT = "web.team.gongyinglian.document"
|
||||
const GONGYINGLIAN_EVENT = "web.team.gongyinglian.event"
|
||||
const GONGYINGLIAN_EXPENSE = "web.team.gongyinglian.expense"
|
||||
const GONGYINGLIAN_EXPRESS = "web.team.gongyinglian.express"
|
||||
const GONGYINGLIAN_GOODS = "web.team.gongyinglian.goods"
|
||||
const GONGYINGLIAN_LOAN = "web.team.gongyinglian.loan"
|
||||
const GONGYINGLIAN_MARKET = "web.team.gongyinglian.market"
|
||||
const GONGYINGLIAN_MATERIAL = "web.team.gongyinglian.material"
|
||||
const GONGYINGLIAN_MEETING = "web.team.gongyinglian.meeting"
|
||||
const GONGYINGLIAN_MEMBER = "web.team.gongyinglian.member"
|
||||
const GONGYINGLIAN_MESSAGE = "web.team.gongyinglian.message"
|
||||
const GONGYINGLIAN_NOTICE = "web.team.gongyinglian.notice"
|
||||
const GONGYINGLIAN_ORDER = "web.team.gongyinglian.order"
|
||||
const GONGYINGLIAN_PAYMENT = "web.team.gongyinglian.payment"
|
||||
const GONGYINGLIAN_PAYMENTLIST = "web.team.gongyinglian.paymentlist"
|
||||
const GONGYINGLIAN_PHOTO = "web.team.gongyinglian.photo"
|
||||
const GONGYINGLIAN_PRODUCE = "web.team.gongyinglian.produce"
|
||||
const GONGYINGLIAN_PRODUCT = "web.team.gongyinglian.product"
|
||||
const GONGYINGLIAN_PURCHASE = "web.team.gongyinglian.purchase"
|
||||
const GONGYINGLIAN_QRCODE = "web.team.gongyinglian.qrcode"
|
||||
const GONGYINGLIAN_QUALITY = "web.team.gongyinglian.quality"
|
||||
const GONGYINGLIAN_RECENT = "web.team.gongyinglian.recent"
|
||||
const GONGYINGLIAN_REFUND = "web.team.gongyinglian.refund"
|
||||
const GONGYINGLIAN_RETURN = "web.team.gongyinglian.return"
|
||||
const GONGYINGLIAN_SELL = "web.team.gongyinglian.sell"
|
||||
const GONGYINGLIAN_SERVICE = "web.team.gongyinglian.service"
|
||||
const GONGYINGLIAN_SETTING = "web.team.gongyinglian.setting"
|
||||
const GONGYINGLIAN_SHOP = "web.team.gongyinglian.shop"
|
||||
const GONGYINGLIAN_SUPPORT = "web.team.gongyinglian.support"
|
||||
const GONGYINGLIAN_WAREHOUSE = "web.team.gongyinglian.warehouse"
|
||||
const GUANLIXITONG_PORTAL = "web.team.guanlixitong.portal"
|
||||
const GUANLIXITONG_ALLOW = "web.team.guanlixitong.allow"
|
||||
const GUANLIXITONG_APPLY = "web.team.guanlixitong.apply"
|
||||
const GUANLIXITONG_CONFERENCE = "web.team.guanlixitong.conference"
|
||||
const GUANLIXITONG_CONTRACT = "web.team.guanlixitong.contract"
|
||||
const GUANLIXITONG_CREDIT = "web.team.guanlixitong.credit"
|
||||
const GUANLIXITONG_DOCUMENT = "web.team.guanlixitong.document"
|
||||
const GUANLIXITONG_EMPLOYEE = "web.team.guanlixitong.employee"
|
||||
const GUANLIXITONG_EQUIPMENT = "web.team.guanlixitong.equipment"
|
||||
const GUANLIXITONG_EVENT = "web.team.guanlixitong.event"
|
||||
const GUANLIXITONG_INTERVIEW = "web.team.guanlixitong.interview"
|
||||
const GUANLIXITONG_INVENTORY = "web.team.guanlixitong.inventory"
|
||||
const GUANLIXITONG_MARKET = "web.team.guanlixitong.market"
|
||||
const GUANLIXITONG_MEETING = "web.team.guanlixitong.meeting"
|
||||
const GUANLIXITONG_MEMBER = "web.team.guanlixitong.member"
|
||||
const GUANLIXITONG_MESSAGE = "web.team.guanlixitong.message"
|
||||
const GUANLIXITONG_NOTICE = "web.team.guanlixitong.notice"
|
||||
const GUANLIXITONG_PAYMENTLIST = "web.team.guanlixitong.paymentlist"
|
||||
const GUANLIXITONG_PHOTO = "web.team.guanlixitong.photo"
|
||||
const GUANLIXITONG_PROCUREMENT = "web.team.guanlixitong.procurement"
|
||||
const GUANLIXITONG_QRCODE = "web.team.guanlixitong.qrcode"
|
||||
const GUANLIXITONG_RECENT = "web.team.guanlixitong.recent"
|
||||
const GUANLIXITONG_RECRUITMENT = "web.team.guanlixitong.recruitment"
|
||||
const GUANLIXITONG_RESUME = "web.team.guanlixitong.resume"
|
||||
const GUANLIXITONG_SERVICE = "web.team.guanlixitong.service"
|
||||
const GUANLIXITONG_SETTING = "web.team.guanlixitong.setting"
|
||||
const GUANLIXITONG_SUPPORT = "web.team.guanlixitong.support"
|
||||
const GUANLIXITONG_TARGET = "web.team.guanlixitong.target"
|
||||
const SHICHANGYINGXIAO_PORTAL = "web.team.shichangyingxiao.portal"
|
||||
const SHICHANGYINGXIAO_ALLOW = "web.team.shichangyingxiao.allow"
|
||||
const SHICHANGYINGXIAO_APPLY = "web.team.shichangyingxiao.apply"
|
||||
const SHICHANGYINGXIAO_CONTRACT = "web.team.shichangyingxiao.contract"
|
||||
const SHICHANGYINGXIAO_CREDIT = "web.team.shichangyingxiao.credit"
|
||||
const SHICHANGYINGXIAO_DOCUMENT = "web.team.shichangyingxiao.document"
|
||||
const SHICHANGYINGXIAO_EVENT = "web.team.shichangyingxiao.event"
|
||||
const SHICHANGYINGXIAO_MARKET = "web.team.shichangyingxiao.market"
|
||||
const SHICHANGYINGXIAO_MEETING = "web.team.shichangyingxiao.meeting"
|
||||
const SHICHANGYINGXIAO_MEMBER = "web.team.shichangyingxiao.member"
|
||||
const SHICHANGYINGXIAO_MESSAGE = "web.team.shichangyingxiao.message"
|
||||
const SHICHANGYINGXIAO_NOTICE = "web.team.shichangyingxiao.notice"
|
||||
const SHICHANGYINGXIAO_PAYMENTLIST = "web.team.shichangyingxiao.paymentlist"
|
||||
const SHICHANGYINGXIAO_PHOTO = "web.team.shichangyingxiao.photo"
|
||||
const SHICHANGYINGXIAO_PROMOTION = "web.team.shichangyingxiao.promotion"
|
||||
const SHICHANGYINGXIAO_QRCODE = "web.team.shichangyingxiao.qrcode"
|
||||
const SHICHANGYINGXIAO_RECENT = "web.team.shichangyingxiao.recent"
|
||||
const SHICHANGYINGXIAO_SERVICE = "web.team.shichangyingxiao.service"
|
||||
const SHICHANGYINGXIAO_SETTING = "web.team.shichangyingxiao.setting"
|
||||
const SHICHANGYINGXIAO_SUPPORT = "web.team.shichangyingxiao.support"
|
||||
const ZIJINLIAN_PORTAL = "web.team.zijinlian.portal"
|
||||
const ZIJINLIAN_ALLOW = "web.team.zijinlian.allow"
|
||||
const ZIJINLIAN_APPLY = "web.team.zijinlian.apply"
|
||||
const ZIJINLIAN_CONTRACT = "web.team.zijinlian.contract"
|
||||
const ZIJINLIAN_CREDIT = "web.team.zijinlian.credit"
|
||||
const ZIJINLIAN_DOCUMENT = "web.team.zijinlian.document"
|
||||
const ZIJINLIAN_EVENT = "web.team.zijinlian.event"
|
||||
const ZIJINLIAN_INVESTMENT = "web.team.zijinlian.investment"
|
||||
const ZIJINLIAN_MARKET = "web.team.zijinlian.market"
|
||||
const ZIJINLIAN_MEETING = "web.team.zijinlian.meeting"
|
||||
const ZIJINLIAN_MEMBER = "web.team.zijinlian.member"
|
||||
const ZIJINLIAN_MESSAGE = "web.team.zijinlian.message"
|
||||
const ZIJINLIAN_NOTICE = "web.team.zijinlian.notice"
|
||||
const ZIJINLIAN_PAYMENTLIST = "web.team.zijinlian.paymentlist"
|
||||
const ZIJINLIAN_PHOTO = "web.team.zijinlian.photo"
|
||||
const ZIJINLIAN_QRCODE = "web.team.zijinlian.qrcode"
|
||||
const ZIJINLIAN_RECENT = "web.team.zijinlian.recent"
|
||||
const ZIJINLIAN_SERVICE = "web.team.zijinlian.service"
|
||||
const ZIJINLIAN_SETTING = "web.team.zijinlian.setting"
|
||||
const ZIJINLIAN_SUPPORT = "web.team.zijinlian.support"
|
@ -1,24 +0,0 @@
|
||||
package api
|
||||
|
||||
const DASHBOARD_PORTAL = "web.team.dashboard.portal"
|
||||
const DASHBOARD_ALLOW = "web.team.dashboard.allow"
|
||||
const DASHBOARD_APPLY = "web.team.dashboard.apply"
|
||||
const DASHBOARD_CONTRACT = "web.team.dashboard.contract"
|
||||
const DASHBOARD_CREDIT = "web.team.dashboard.credit"
|
||||
const DASHBOARD_DASHBOARD = "web.team.dashboard.dashboard"
|
||||
const DASHBOARD_EVENT = "web.team.dashboard.event"
|
||||
const DASHBOARD_MARKET = "web.team.dashboard.market"
|
||||
const DASHBOARD_MEETING = "web.team.dashboard.meeting"
|
||||
const DASHBOARD_MEMBER = "web.team.dashboard.member"
|
||||
const DASHBOARD_MESSAGE = "web.team.dashboard.message"
|
||||
const DASHBOARD_NOTICE = "web.team.dashboard.notice"
|
||||
const DASHBOARD_PAYMENTLIST = "web.team.dashboard.paymentlist"
|
||||
const DASHBOARD_PHOTO = "web.team.dashboard.photo"
|
||||
const DASHBOARD_QRCODE = "web.team.dashboard.qrcode"
|
||||
const DASHBOARD_RECENT = "web.team.dashboard.recent"
|
||||
const DASHBOARD_SERVICE = "web.team.dashboard.service"
|
||||
const DASHBOARD_SETTING = "web.team.dashboard.setting"
|
||||
const DASHBOARD_SUMMARY = "web.team.dashboard.summary"
|
||||
const DASHBOARD_SUPPORT = "web.team.dashboard.support"
|
||||
const DEVELOPMENT_PORTAL = "web.team.development.portal"
|
||||
const DEVELOPMENT_ALLOW = "web.team.development.allow"
|
@ -1,7 +0,0 @@
|
||||
spark project "云时代的新型操作系统,既要完全自给自足,又要任意互联互通" `
|
||||
<b>用户场景:</b>
|
||||
<b>认证授权:</b>
|
||||
<b>约号系统:</b>
|
||||
<b>活动组织:</b>
|
||||
`
|
||||
spark product
|
@ -1,11 +0,0 @@
|
||||
navmenu `
|
||||
"{{ .Title }}" /
|
||||
_
|
||||
"下 载" download/
|
||||
"文 档" started/
|
||||
"开 发" development/
|
||||
_
|
||||
"应 用" "https://web.shylinux.com/s/20240724-community"
|
||||
"源 码" "https://git.shylinux.com/web/community"
|
||||
"社 区" "https://bbs.shylinux.com"
|
||||
`
|
@ -1,2 +0,0 @@
|
||||
body.width1 $output div.item.card div.title span.role { margin-left:auto; }
|
||||
body.width1 $output div.item.card div.title div.action { top:24px; }
|
@ -9,84 +9,79 @@ import (
|
||||
|
||||
type allow struct {
|
||||
Table
|
||||
user user
|
||||
apply apply
|
||||
order string `data:"503"`
|
||||
role string `data:"leader"`
|
||||
event event
|
||||
portal Portal
|
||||
order string `data:"92"`
|
||||
role string `data:"creator"`
|
||||
create string `name:"create apply_uid* place_uid* user_uid* status*"`
|
||||
reject string `name:"reject" role:"void"`
|
||||
approve string `name:"approve" role:"void"`
|
||||
}
|
||||
|
||||
func (s allow) Create(m *ice.Message, arg ...string) {
|
||||
s.Insert(m.Spawn(), arg...)
|
||||
s.SendMessage(s.GetCommandUID(m), m.Option(model.FROM_USER_UID), "")
|
||||
s.SendTemplate(m, "", "", m.Trans("please allow", "权限审批 请处理"))
|
||||
s.Table.Create(m, arg...)
|
||||
m.Options(m.Cmd(s.Prefix(m, s.portal), s.portal.SelectCommand, m.PrefixKey()).AppendSimple(model.COMMAND_UID))
|
||||
s.SendMessage(m, m.Option(model.FROM_USER_UID), m.Option(model.USER_UID))
|
||||
s.sendTemplate(m, m.Trans("please process role allow", "请处理 权限审批"))
|
||||
}
|
||||
func (s allow) List(m *ice.Message, arg ...string) {
|
||||
s.Tables(m, s.apply).FieldsWithCreatedAT(m, s.apply,
|
||||
s.Key(s.apply, model.USER_UID),
|
||||
s.AS(s.Key(s.apply, model.ROLE), s.Keys(s.UserPlace, model.ROLE)), model.BEGIN_TIME, model.END_TIME,
|
||||
s.AS(s.Key(s, model.UID), model.ALLOW_UID), model.ALLOW_STATUS,
|
||||
s.Tables(m, s.apply, "left join users on applies.user_uid = users.uid").FieldsWithCreatedAT(m, s.apply,
|
||||
model.USER_AVATAR, model.USER_NAME,
|
||||
s.Key(s, model.PLACE_UID), s.AS(s.Key(s.apply, model.ROLE), s.Keys(s.UserPlace, model.ROLE)), model.ALLOW_STATUS,
|
||||
model.BEGIN_TIME, model.END_TIME, s.AS(s.Key(s, model.UID), model.ALLOW_UID),
|
||||
)
|
||||
if len(arg) == 1 {
|
||||
// s.Select(m, s.Key(s, model.PLACE_UID), arg[0], s.Key(s, model.USER_UID), m.Option(model.USER_UID)).Action()
|
||||
s.Select(m, s.Key(s, model.PLACE_UID), arg[0]).Action()
|
||||
if m.Length() == 0 {
|
||||
m.Cmdy(s.Prefix(m, qrcode{}), qrcode{}.ApplyQRCode, arg[0]).SetAppend().Action()
|
||||
return
|
||||
}
|
||||
s.Table.Select(m, s.Key(s, model.USER_UID), m.Option(model.USER_UID), s.Key(s, model.PLACE_UID), arg[0])
|
||||
kit.If(m.Length() == 0, func() { m.Echo(m.Trans("wait apply", "等待申请")) })
|
||||
} else if len(arg) == 2 {
|
||||
// s.SelectDetail(m, s.Key(s, model.PLACE_UID), arg[0], s.Key(s, model.USER_UID), m.Option(model.USER_UID), s.Key(s.apply, model.UID), arg[1])
|
||||
s.SelectDetail(m, s.Key(s, model.PLACE_UID), arg[0], s.Key(s.apply, model.UID), arg[1])
|
||||
m.Table(func(value ice.Maps) {
|
||||
if AllowStatus(kit.Int(value[model.ALLOW_STATUS])) != AllowCreate {
|
||||
s.DoneMessage(m)
|
||||
}
|
||||
})
|
||||
s.Table.SelectDetail(m, s.Key(s, model.USER_UID), m.Option(model.USER_UID), s.Key(s, model.PLACE_UID), arg[0], s.Key(s.apply, model.UID), arg[1])
|
||||
} else {
|
||||
return
|
||||
}
|
||||
s.RenameAppend(m, model.PLACE_UID, s.Keys(s.Place, model.UID)).SelectJoin(m, s.Place, model.NAME, model.TYPE)
|
||||
m.Table(func(value ice.Maps) {
|
||||
if AllowStatus(kit.Int(value[model.ALLOW_STATUS])) == AllowCreate {
|
||||
m.PushButton(s.Reject, s.Approve)
|
||||
} else {
|
||||
m.PushButton()
|
||||
s.DoneMessage(m)
|
||||
}
|
||||
})
|
||||
s.SelectJoinUser(m)
|
||||
s.DisplayBase(m, "").DisplayCSS("")
|
||||
}).Action()
|
||||
s.DisplayBase(m, "")
|
||||
}
|
||||
func (s allow) Reject(m *ice.Message, arg ...string) {
|
||||
s.process(m, AllowCreate, AllowRejected, "❌", m.Trans("allow rejected", "权限审批 已驳回"))
|
||||
s.process(m, AllowCreate, AllowRejected, "❌", m.Trans("rejected role allow", "已驳回 权限审批"))
|
||||
}
|
||||
func (s allow) Approve(m *ice.Message, arg ...string) {
|
||||
s.process(m, AllowCreate, AllowApproved, "✅", m.Trans("allow approved", "权限审批 已通过"))
|
||||
s.process(m, AllowCreate, AllowApproved, "✅", m.Trans("approved role allow", "已通过 权限审批"))
|
||||
}
|
||||
func init() { ice.TeamCtxCmd(allow{Table: newTable()}) }
|
||||
|
||||
func (s allow) process(m *ice.Message, from, to AllowStatus, icon string, title string) {
|
||||
defer m.ToastProcess()()
|
||||
if s.changeStatus(m, from, to); m.IsErr() {
|
||||
return
|
||||
}
|
||||
m.Cmdy(s.Prefix(m, s.apply), m.ActionKey(), m.Option(model.UID)).ProcessRefresh()
|
||||
style := kit.Select("notice", "danger", kit.Int(m.Option(model.ROLE)) == 2)
|
||||
s.RecordEvent(m, kit.JoinWord(icon, title, kit.Cut(m.Option(model.UID), 6), s.TransRole(m, "", style), m.Option(model.USER_NAME)), m.Option(model.UID))
|
||||
s.RecordEvent(m, kit.JoinWord(icon, title, kit.Cut(m.Option(model.UID), 6), s.TransRole(m), m.Option(model.USER_NAME)), m.Option(model.UID))
|
||||
s.DoneMessage(m)
|
||||
}
|
||||
func (s allow) changeStatus(m *ice.Message, from, to AllowStatus, arg ...string) *ice.Message {
|
||||
// msg := s.Select(m.Spawn(), model.UID, m.Option(model.ALLOW_UID), model.USER_UID, m.Option(model.USER_UID))
|
||||
args := []string{model.UID, m.Option(model.ALLOW_UID), model.USER_UID, m.Option(model.USER_UID)}
|
||||
if s.IsLeader(m) {
|
||||
args = []string{model.UID, m.Option(model.ALLOW_UID)}
|
||||
}
|
||||
msg := s.Select(m.Spawn(), args...)
|
||||
if !m.WarnNotFound(msg.Length() == 0, m.Option(model.ALLOW_UID)) {
|
||||
|
||||
func init() { ice.TeamCtxCmd(allow{Table: newTable()}) }
|
||||
|
||||
func (s allow) changeStatus(m *ice.Message, from, todo AllowStatus, arg ...string) *ice.Message {
|
||||
msg := s.Table.Select(m.Spawn(), model.UID, m.Option(model.ALLOW_UID), model.USER_UID, m.Option(model.USER_UID))
|
||||
if !m.WarnNotFound(msg.Length() == 0, m.Option(model.UID)) {
|
||||
if status := AllowStatus(kit.Int(msg.Append(model.STATUS))); !m.WarnNotValid(status != from, status.String()) {
|
||||
s.Update(m.Spawn(), kit.Dict(model.STATUS, to), args...)
|
||||
s.Table.Update(m, kit.Dict(model.STATUS, todo), model.UID, m.Option(model.ALLOW_UID))
|
||||
}
|
||||
}
|
||||
return msg
|
||||
}
|
||||
func (s allow) sendTemplate(m *ice.Message, info string) *ice.Message {
|
||||
s.Table.SendTemplate(m, m.Option(model.USER_NAME), m.Append(model.USER_UID), info)
|
||||
return m
|
||||
}
|
||||
|
||||
type AllowStatus int
|
||||
|
||||
|
@ -1,9 +1,12 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) { var USER_PLACE_ROLE = msg.Option("_user_place_role")
|
||||
can.onimport.myView(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.user_name, can.onimport.textView(can, value, USER_PLACE_ROLE), can.onimport.titleAction(can, value)]},
|
||||
{view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value), can.onimport.textView(can, value)]},
|
||||
_init: function(can, msg) { can.onimport.shareTitle(can, msg)
|
||||
var PLACE_NAME = msg.Option("_place_name"), PLACE_TYPE = msg.Option("_place_type")
|
||||
var USER_PLACE_ROLE = msg.Option("_user_place_role"), STREET_NAME = msg.Option("_street_name"), ALLOW_STATUS = "allow_status"
|
||||
can.onimport.itemcards(can, msg, function(value) { var status = value[ALLOW_STATUS]; return [
|
||||
{view: html.TITLE, list: [value.user_name, can.onimport.textView(can, value, USER_PLACE_ROLE)]},
|
||||
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at), can.onimport.textView(can, value, ALLOW_STATUS)]},
|
||||
{view: html.STATUS, list: [value.begin_time.split(" ")[0], value.end_time.split(" ")[0]]},
|
||||
{view: html.STATUS, list: [value.city_name, value[STREET_NAME]]},
|
||||
] })
|
||||
},
|
||||
})
|
||||
|
Before Width: | Height: | Size: 2.2 KiB |
@ -9,119 +9,112 @@ import (
|
||||
|
||||
type apply struct {
|
||||
Table
|
||||
order string `data:"502"`
|
||||
role string `data:"leader"`
|
||||
user user
|
||||
event event
|
||||
portal Portal
|
||||
order string `data:"91"`
|
||||
role string `data:"creator"`
|
||||
create string `name:"create user_place_role*:select begin_time:select@date end_time:select@date" role:"void"`
|
||||
cancel string `name:"cancel" role:"void"`
|
||||
submit string `name:"submit" role:"void"`
|
||||
}
|
||||
|
||||
func (s apply) Init(m *ice.Message, arg ...string) {
|
||||
USER_PLACE_ROLE := s.Keys(s.UserPlace, model.ROLE)
|
||||
m.Design(s.Create, "", kit.JoinWord(USER_PLACE_ROLE+"*:select", "begin_time:select@date", "end_time:select@date"))
|
||||
s.Table.Init(m, arg...)
|
||||
place_uid, user_place_role := s.Keys(s.Place, model.UID), s.Keys(s.UserPlace, model.ROLE)
|
||||
m.Design(s.Create, "", user_place_role+"*:select")
|
||||
m.Design(s.List, "", place_uid+" uid auto")
|
||||
}
|
||||
func (s apply) Inputs(m *ice.Message, arg ...string) {
|
||||
s.UserPlace.Inputs(m, arg...)
|
||||
}
|
||||
func (s apply) Create(m *ice.Message, arg ...string) {
|
||||
PLACE_UID, USER_PLACE_ROLE := s.Keys(s.Place, model.UID), s.Keys(s.UserPlace, model.ROLE)
|
||||
arg = kit.TransArgKeys(arg, PLACE_UID, model.PLACE_UID, USER_PLACE_ROLE, model.ROLE)
|
||||
s.Insert(m, kit.Simple(arg, model.PLACE_UID, m.Option(PLACE_UID), m.OptionSimple(model.USER_UID))...)
|
||||
PLACE_UID := s.Keys(s.Place, model.UID)
|
||||
USER_PLACE_ROLE := s.Keys(s.UserPlace, model.ROLE)
|
||||
arg = kit.TransArgKeys(arg, PLACE_UID, model.PLACE_UID)
|
||||
arg = kit.TransArgKeys(arg, USER_PLACE_ROLE, model.ROLE)
|
||||
s.Table.Create(m, kit.Simple(model.PLACE_UID, m.Option(PLACE_UID), arg, m.OptionSimple(model.USER_UID), model.STATUS, ApplyCreate)...)
|
||||
m.ProcessRewrite(model.UID, m.Result())
|
||||
}
|
||||
func (s apply) List(m *ice.Message, arg ...string) {
|
||||
s.FieldsWithCreatedAT(m, s, model.USER_UID, model.APPLY_STATUS,
|
||||
s.AS(s.Key(s, model.ROLE), s.Keys(s.UserPlace, model.ROLE)), model.BEGIN_TIME, model.END_TIME)
|
||||
s.Tables(m, s.user).FieldsWithCreatedAT(m, s, model.USER_AVATAR, model.USER_NAME,
|
||||
model.PLACE_UID, s.AS(s.Key(s, model.ROLE), s.Keys(s.UserPlace, model.ROLE)), model.APPLY_STATUS,
|
||||
model.BEGIN_TIME, model.END_TIME,
|
||||
)
|
||||
if len(arg) == 1 {
|
||||
s.Select(m, model.PLACE_UID, arg[0], model.USER_UID, m.Option(model.USER_UID))
|
||||
if m.Length() == 0 {
|
||||
m.Action()
|
||||
}
|
||||
s.Table.Select(m, model.USER_UID, m.Option(model.USER_UID), model.PLACE_UID, arg[0])
|
||||
kit.If(m.Length() == 0, func() { m.EchoInfoButton("") })
|
||||
} else if len(arg) == 2 {
|
||||
s.SelectDetail(m, model.PLACE_UID, arg[0], model.USER_UID, m.Option(model.USER_UID), model.UID, arg[1])
|
||||
s.Table.SelectDetail(m, model.USER_UID, m.Option(model.USER_UID), model.PLACE_UID, arg[0], s.Key(s, model.UID), arg[1])
|
||||
switch ApplyStatus(kit.Int(m.Append(model.APPLY_STATUS))) {
|
||||
case ApplyCreate:
|
||||
m.PushButton(s.Cancel, s.Submit)
|
||||
case ApplySubmit:
|
||||
m.EchoQRCode(s.Link(m, arg[0], s.Prefix(m, allow{}), arg[1])).Echo("请让管理员扫码或等待审批")
|
||||
defer func() { m.Echo("<img class='avatar' src='%s'/>", m.Resource(m.Append(model.USER_AVATAR))) }()
|
||||
m.EchoQRCode(s.portal.Link(m, arg[0], ice.GetTypeKey(allow{}), arg[1]))
|
||||
case ApplyRejected, ApplyApproved:
|
||||
s.DoneMessage(m)
|
||||
}
|
||||
} else {
|
||||
return
|
||||
}
|
||||
s.SelectJoinUser(m)
|
||||
s.RenameAppend(m, model.PLACE_UID, s.Keys(s.Place, model.UID)).SelectJoin(m, s.Place, model.NAME, model.TYPE)
|
||||
m.Table(func(value ice.Maps) {
|
||||
if ApplyStatus(kit.Int(value[model.APPLY_STATUS])) == ApplyCreate {
|
||||
m.PushButton(s.Cancel, s.Submit)
|
||||
} else {
|
||||
m.PushButton()
|
||||
}
|
||||
})
|
||||
s.DisplayBase(m, "")
|
||||
}
|
||||
func (s apply) Cancel(m *ice.Message, arg ...string) {
|
||||
s.changeStatus(m, ApplyCreate, ApplyCancel)
|
||||
}
|
||||
func (s apply) ApplyCreate(m *ice.Message, arg ...string) {
|
||||
m.Option(model.UID, m.Cmdy("", s.Create, s.Keys(s.UserPlace, model.ROLE), "3").Result())
|
||||
m.Cmdy("", s.Submit)
|
||||
}
|
||||
func (s Table) ApplyCreate(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(s.Prefix(m, apply{}), s.ApplyCreate)
|
||||
}
|
||||
func (s Table) ApplyCheck(m *ice.Message, arg ...string) {
|
||||
if m.Cmd(s.Prefix(m, apply{}), arg[0]).Length() == 0 {
|
||||
m.EchoInfoButton("请申请加入团队", s.ApplyCreate)
|
||||
} else {
|
||||
m.Echo("\n「权限申请」已提交\n请等待「管理员」审批\n然后刷新界面查看最新状态")
|
||||
}
|
||||
}
|
||||
func (s apply) Submit(m *ice.Message, arg ...string) {
|
||||
msg := s.changeStatus(m, ApplyCreate, ApplySubmit)
|
||||
if m.WarnNotValid(msg.IsErr()) {
|
||||
return
|
||||
}
|
||||
role, style := UserPlaceCreator, ""
|
||||
defer m.ToastProcess()()
|
||||
role := UserPlaceCreator
|
||||
switch UserPlaceRole(kit.Int(msg.Append(model.ROLE))) {
|
||||
case UserPlaceLandlord:
|
||||
role, style = UserPlaceCreator, "danger"
|
||||
default:
|
||||
role, style = UserPlaceLandlord, "notice"
|
||||
role = UserPlaceCreator
|
||||
case UserPlaceTenant, UserPlaceAdmin:
|
||||
role = UserPlaceLandlord
|
||||
}
|
||||
msg = m.Cmd(s.UserPlace, s.Select, m.OptionSimple(s.Keys(s.Place, model.UID)), model.ROLE, role)
|
||||
if msg.Length() == 0 && style == "notice" {
|
||||
msg = m.Cmd(s.UserPlace, s.Select, m.OptionSimple(s.Keys(s.Place, model.UID)), model.ROLE, UserPlaceCreator)
|
||||
}
|
||||
if m.WarnNotFound(msg.Length() == 0, role.String()) {
|
||||
return
|
||||
}
|
||||
m.Option(model.FROM_USER_UID, m.Option(model.USER_UID))
|
||||
m.Cmd(s.Prefix(m, allow{}), s.Create, model.APPLY_UID, m.Option(model.UID), model.PLACE_UID, m.Option(s.Keys(s.Place, model.UID)), msg.AppendSimple(model.USER_UID), model.STATUS, AllowCreate)
|
||||
s.RecordEvent(m, kit.JoinWord("🕑", m.Trans("apply submit", "权限申请 已提交"), kit.Cut(m.Option(model.UID), 6), s.TransRole(m, "", style), m.Option(model.USER_NAME)), m.Option(model.UID))
|
||||
s.RecordEvent(m, kit.JoinWord("🕑", m.Trans("apply submit", "已提交 权限申请"), kit.Cut(m.Option(model.UID), 6), s.TransRole(m), m.Option(model.USER_NAME)), m.Option(model.UID))
|
||||
s.SendMessage(m, msg.Append(model.USER_UID), m.Option(model.USER_UID))
|
||||
}
|
||||
func (s apply) Reject(m *ice.Message, arg ...string) {
|
||||
msg := s.changeStatus(m, ApplySubmit, ApplyRejected)
|
||||
s.SendTemplate(msg, "", "", m.Trans("apply rejected", "权限申请 已驳回"))
|
||||
m.Option(model.ROLE, msg.Append(model.ROLE))
|
||||
s.sendTemplate(msg, m.Trans("rejected role apply", "已驳回 权限申请"))
|
||||
}
|
||||
func (s apply) Approve(m *ice.Message, arg ...string) {
|
||||
msg := s.changeStatus(m, ApplySubmit, ApplyApproved)
|
||||
if msg.IsErr() {
|
||||
return
|
||||
}
|
||||
m.Cmd(s.UserPlace, s.Insert, s.Keys(s.Place, model.UID), msg.Append(model.PLACE_UID), msg.AppendSimple(model.USER_UID, model.ROLE))
|
||||
s.SendTemplate(msg, "", "", m.Trans("apply approved", "权限申请 已通过"))
|
||||
m.Option(model.ROLE, msg.Append(model.ROLE))
|
||||
m.Cmd(s.UserPlace, s.Create, msg.AppendSimple(model.USER_UID, model.ROLE), s.Keys(s.Place, model.UID), msg.Append(model.PLACE_UID))
|
||||
s.sendTemplate(msg, m.Trans("approved role apply", "已通过 权限申请"))
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(apply{Table: newTable()}) }
|
||||
|
||||
func (s apply) changeStatus(m *ice.Message, from, to ApplyStatus, arg ...string) *ice.Message {
|
||||
msg := s.Select(m.Spawn(), m.OptionSimple(model.UID)...)
|
||||
func (s apply) changeStatus(m *ice.Message, from, todo ApplyStatus, arg ...string) *ice.Message {
|
||||
msg := s.Table.Select(m.Spawn(), m.OptionSimple(model.UID)...)
|
||||
if !m.WarnNotFound(msg.Length() == 0, m.Option(model.UID)) {
|
||||
if status := ApplyStatus(kit.Int(msg.Append(model.STATUS))); !m.WarnNotValid(status != from, status.String()) {
|
||||
s.Update(m, kit.Dict(model.STATUS, to), m.OptionSimple(model.UID)...)
|
||||
s.Table.Update(m, kit.Dict(model.STATUS, todo), m.OptionSimple(model.UID)...)
|
||||
}
|
||||
}
|
||||
return msg
|
||||
}
|
||||
func (s apply) sendTemplate(m *ice.Message, info string) *ice.Message {
|
||||
s.Table.SendTemplate(m, "", m.Append(model.USER_UID), info)
|
||||
return m
|
||||
}
|
||||
|
||||
type ApplyStatus int
|
||||
|
||||
|
@ -1,16 +1,12 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) { var USER_PLACE_ROLE = msg.Option("_user_place_role")
|
||||
can.onimport.myView(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.user_name, can.onimport.textView(can, value, USER_PLACE_ROLE)]},
|
||||
{view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value), can.onimport.textView(can, value)]},
|
||||
_init: function(can, msg) { can.onimport.shareTitle(can, msg)
|
||||
var PLACE_NAME = msg.Option("_place_name"), PLACE_TYPE = msg.Option("_place_type")
|
||||
var USER_PLACE_ROLE = msg.Option("_user_place_role"), STREET_NAME = msg.Option("_street_name"), APPLY_STATUS = "apply_status"
|
||||
can.onimport.itemcards(can, msg, function(value) { var status = value[APPLY_STATUS]; return [
|
||||
{view: html.TITLE, list: [value[PLACE_NAME], can.onimport.textView(can, value, PLACE_TYPE), can.onimport.textView(can, value, USER_PLACE_ROLE)]},
|
||||
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at), can.onimport.textView(can,value, APPLY_STATUS)]},
|
||||
{view: html.STATUS, list: [value.begin_time.split(" ")[0], value.end_time.split(" ")[0]]},
|
||||
{view: html.STATUS, list: [value.city_name, value[STREET_NAME]]},
|
||||
] })
|
||||
if (msg.Length() == 0) { var target = can.page.Append(can, can._output, [{view: html.CODE, list: [{view: [mdb.INFO, "", "请创建权限申请"]}]}])._target
|
||||
can.runAction({}, mdb.INPUTS, [USER_PLACE_ROLE], function(msg) { msg.Table(function(value) {
|
||||
can.onappend.input(can, {type: html.BUTTON, name: value.name, value: "我是"+can.user.trans(can, value.name, null, "value."+USER_PLACE_ROLE), style: value[USER_PLACE_ROLE] == "2"? html.DANGER: html.NOTICE, onclick: function(event) {
|
||||
can.runAction(event, mdb.CREATE, [USER_PLACE_ROLE, value[USER_PLACE_ROLE]])
|
||||
}}, "", target)
|
||||
}) }), can.onappend.style(can, html.FORM)
|
||||
}
|
||||
},
|
||||
})
|
||||
})
|
Before Width: | Height: | Size: 2.2 KiB |
@ -3,44 +3,18 @@ package gonganxitong
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
|
||||
"shylinux.com/x/community/src/api"
|
||||
"shylinux.com/x/community/src/gonganxitong/model"
|
||||
)
|
||||
|
||||
type city struct {
|
||||
Table
|
||||
list string `name:"list city_name auto" role:"void"`
|
||||
authCreate string `name:"authCreate" role:"tech"`
|
||||
}
|
||||
type city struct{ Table }
|
||||
|
||||
func (s user) Init(m *ice.Message, arg ...string) {
|
||||
cmdPortal[m.PrefixKey()] = api.GONGANXITONG_PORTAL
|
||||
}
|
||||
func (s street) Init(m *ice.Message, arg ...string) {
|
||||
cmdPortal[m.PrefixKey()] = api.GONGANXITONG_PORTAL
|
||||
}
|
||||
func (s city) Init(m *ice.Message, arg ...string) {
|
||||
cmdPortal[m.PrefixKey()] = api.GONGANXITONG_PORTAL
|
||||
}
|
||||
func (s city) FindOrCreateByName(m *ice.Message, arg ...string) {
|
||||
if msg := m.Cmd(s, s.Select, model.NAME, arg[1]); msg.Length() == 0 {
|
||||
msg := m.Cmd(s, s.Insert, model.NAME, arg[1])
|
||||
msg := m.Cmd(s, s.Create, model.NAME, arg[1])
|
||||
arg[0], arg[1] = model.CITY_UID, msg.Result()
|
||||
} else {
|
||||
arg[0], arg[1] = model.CITY_UID, msg.Append(model.UID)
|
||||
}
|
||||
}
|
||||
func (s city) List(m *ice.Message, arg ...string) {
|
||||
if len(arg) == 0 {
|
||||
s.Select(m).Action()
|
||||
} else if len(arg) == 1 {
|
||||
s.SelectDetail(m, model.NAME, arg[0])
|
||||
if m.Append(model.AUTH_UID) == "" && m.IsTech() {
|
||||
m.EchoInfoButton(m.Trans("please auth city", "请申请城市认证"), s.AuthCreate)
|
||||
}
|
||||
}
|
||||
}
|
||||
func (s city) AuthCreate(m *ice.Message, arg ...string) {
|
||||
s.Table.AuthCreate(m, 1, "", m.OptionSimple(model.NAME)...)
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(city{}) }
|
||||
|
@ -1,12 +1,7 @@
|
||||
package gonganxitong
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"strings"
|
||||
|
||||
"shylinux.com/x/ice"
|
||||
"shylinux.com/x/icebergs/base/nfs"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/community/src/gonganxitong/model"
|
||||
@ -14,68 +9,16 @@ import (
|
||||
|
||||
type command struct {
|
||||
Table
|
||||
service service
|
||||
modify string `name:"modify service_uid index name icon"`
|
||||
update string `name:"update service_uid icon name index"`
|
||||
}
|
||||
|
||||
func CommandUID(m *ice.Message, cmd string) string {
|
||||
return kit.Hashs(m.Option(model.SERVICE_UID), cmd)
|
||||
}
|
||||
func (s command) Modify(m *ice.Message, arg ...string) {
|
||||
uid := CommandUID(m, m.Option(model.INDEX))
|
||||
if s.Select(m.Spawn(), model.UID, uid).Length() == 0 {
|
||||
s.Insert(m, kit.Simple(arg, model.UID, uid)...)
|
||||
} else {
|
||||
s.Update(m, kit.Dict(arg), model.UID, uid)
|
||||
func (s command) Update(m *ice.Message, arg ...string) {
|
||||
uid := kit.Hashs(m.Option(model.SERVICE_UID), m.Option(model.INDEX))
|
||||
if s.Table.Select(m.Spawn(), model.UID, uid).Length() == 0 {
|
||||
s.Table.Create(m, kit.Simple(model.UID, uid, m.OptionSimple(model.SERVICE_UID, model.INDEX))...)
|
||||
}
|
||||
s.Table.Update(m, kit.Dict(arg), model.UID, uid)
|
||||
m.SetResult().Echo(uid)
|
||||
}
|
||||
func (s command) Autogen(m *ice.Message, arg ...string) {
|
||||
space, portal := map[string][]string{}, map[string][]string{}
|
||||
s.List(m).Table(func(value ice.Maps) {
|
||||
if strings.HasSuffix(value[model.INDEX], ".allow") {
|
||||
space[value[model.SPACE]] = append(space[value[model.SPACE]], strings.ReplaceAll(value[model.INDEX], ".allow", ".portal"))
|
||||
}
|
||||
space[value[model.SPACE]] = append(space[value[model.SPACE]], value[model.INDEX])
|
||||
portal[value[model.PORTAL]] = append(portal[value[model.PORTAL]], value[model.INDEX])
|
||||
})
|
||||
for p, v := range space {
|
||||
nfs.Create(m.Message, "src/api/"+p+".go", func(w io.Writer) {
|
||||
fmt.Fprintf(w, "package api\n\n")
|
||||
for _, v := range v {
|
||||
fmt.Fprintf(w, "const %s = \"%s\"\n", strings.ToUpper(strings.ReplaceAll(strings.TrimPrefix(v, "web.team."), ".", "_")), v)
|
||||
}
|
||||
})
|
||||
}
|
||||
nfs.Create(m.Message, "src/api/space.go", func(w io.Writer) {
|
||||
fmt.Fprintf(w, "package api\n\n")
|
||||
fmt.Fprintf(w, "var Space = map[string]string{\n")
|
||||
defer fmt.Fprintf(w, "}\n")
|
||||
for space, cmd := range space {
|
||||
kit.For(cmd, func(cmd string) { fmt.Fprintf(w, "\"%s\": \"%s\",\n", cmd, space) })
|
||||
}
|
||||
})
|
||||
nfs.Create(m.Message, "src/api/portal.go", func(w io.Writer) {
|
||||
fmt.Fprintf(w, "package api\n\n")
|
||||
fmt.Fprintf(w, "var Portal = map[string]string{\n")
|
||||
defer fmt.Fprintf(w, "}\n")
|
||||
for portal, cmd := range portal {
|
||||
kit.For(cmd, func(cmd string) { fmt.Fprintf(w, "\"%s\": \"%s\",\n", cmd, portal) })
|
||||
}
|
||||
})
|
||||
}
|
||||
func (s command) Cache(m *ice.Message, arg ...string) {
|
||||
kit.For(cmdPortal, func(k, v string) { m.Push(model.SPACE, cmdSpace[k]).Push(model.PORTAL, v).Push(model.INDEX, k) })
|
||||
m.Sort("space,portal,index")
|
||||
}
|
||||
func (s command) List(m *ice.Message, arg ...string) *ice.Message {
|
||||
s.Tables(m, s.service).Fields(m, s.Key(s, model.UPDATED_AT),
|
||||
s.Key(s, model.INDEX), s.AS(s.Key(s.service, "`"+model.INDEX+"`"), model.PORTAL), s.AS(model.NODENAME, model.SPACE),
|
||||
).Orders(m, "`space`,`commands`.`index`").Limit(m, 3000).Select(m).Action(s.Cache, s.Autogen)
|
||||
return m
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(command{}) }
|
||||
|
||||
var cmdPortal = map[string]string{}
|
||||
var cmdSpace = map[string]string{}
|
||||
|
@ -1,25 +0,0 @@
|
||||
package gonganxitong
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
|
||||
"shylinux.com/x/community/src/gonganxitong/model"
|
||||
)
|
||||
|
||||
type comment struct{ Table }
|
||||
|
||||
func (s comment) Create(m *ice.Message, arg ...string) {
|
||||
s.Insert(m, append(arg, m.OptionSimple(model.MARKET_UID, model.USER_UID)...)...)
|
||||
}
|
||||
func (s comment) List(m *ice.Message, arg ...string) {
|
||||
if len(arg) == 1 {
|
||||
s.Select(m, model.MARKET_UID, arg[0])
|
||||
} else if len(arg) == 2 {
|
||||
s.SelectDetail(m, model.MARKET_UID, arg[0], model.UID, arg[1])
|
||||
} else {
|
||||
return
|
||||
}
|
||||
s.SelectJoinUser(m)
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(comment{}) }
|
@ -4,19 +4,15 @@ import (
|
||||
"path"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"shylinux.com/x/ice"
|
||||
icebergs "shylinux.com/x/icebergs"
|
||||
"shylinux.com/x/icebergs/base/aaa"
|
||||
"shylinux.com/x/icebergs/base/ctx"
|
||||
"shylinux.com/x/icebergs/base/mdb"
|
||||
"shylinux.com/x/icebergs/base/nfs"
|
||||
"shylinux.com/x/icebergs/base/web"
|
||||
"shylinux.com/x/icebergs/base/web/html"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/community/src/api"
|
||||
"shylinux.com/x/community/src/gonganxitong/model"
|
||||
"shylinux.com/x/mysql-story/src/db"
|
||||
)
|
||||
@ -25,85 +21,43 @@ type UserPlacer interface {
|
||||
Placer
|
||||
}
|
||||
type Placer interface {
|
||||
Keys(target ice.Any, k string) string
|
||||
Inputs(m *ice.Message, arg ...string)
|
||||
Select(m *ice.Message, arg ...string) *ice.Message
|
||||
RewriteAppend(m *ice.Message, arg ...string) *ice.Message
|
||||
TransValue(m *ice.Message, key string, arg ...string) string
|
||||
TransRole(m *ice.Message, arg ...string) string
|
||||
}
|
||||
type Container interface {
|
||||
Keys(target ice.Any, k string) string
|
||||
FindOrCreateByName(m *ice.Message, arg ...string)
|
||||
}
|
||||
|
||||
type Table struct {
|
||||
db.Table
|
||||
UserPlace UserPlacer
|
||||
Place Placer
|
||||
Street Container
|
||||
STREET_UID string
|
||||
PLACE_UID string
|
||||
checkRole string `name:"checkRole role"`
|
||||
inputs string `name:"inputs" role:"void"`
|
||||
list string `name:"list place_uid uid auto" role:"void"`
|
||||
marketInsert string `name:"marketInsert domain_uid* title* content" style:"notice" role:"leader"`
|
||||
pushPublic string `name:"pushPublic domain_uid* title* content" role:"leader"`
|
||||
memberList string `name:"memberList" role:"void"`
|
||||
noticeList string `name:"noticeList" role:"void"`
|
||||
marketPlaceInfo string `name:"marketPlaceInfo" role:"void"`
|
||||
messagePlaceInfo string `name:"messagePlaceInfo" role:"void"`
|
||||
applyCreate string `name:"applyCreate" role:"void"`
|
||||
UserPlace UserPlacer
|
||||
Place Placer
|
||||
Street Container
|
||||
checkRole string `name:"checkRole role"`
|
||||
inputs string `name:"inputs" role:"void"`
|
||||
list string `name:"list place_uid uid auto" role:"void"`
|
||||
}
|
||||
|
||||
func (s Table) LoadTrans(m *ice.Message, arg ...string) {
|
||||
// m.Option("_iconslib", "https://img.icons8.com/officel/80/")
|
||||
p := kit.FileLine(1, 100)
|
||||
if m.PrefixKey() != api.GONGANXITONG_PORTAL {
|
||||
ice.LoadTrans(m.Spawn(kit.Dict("_template", path.Join(path.Dir(p), "portal.json"))).Message, m.CommandKey(), m.GetCommand().Command)
|
||||
}
|
||||
h := ctx.GetCmdFile(m.Message, m.PrefixKey())
|
||||
kit.If(strings.HasPrefix(h, "/p/src/"), func() { h = strings.TrimPrefix(h, "/p/") })
|
||||
nfs.Exists(m.Message, kit.ExtChange(h, "png"), func(p string) {
|
||||
cmd := m.Target().Commands[m.CommandKey()]
|
||||
cmd.Icon = m.Resource(p)
|
||||
})
|
||||
if path.Dir(h) != path.Dir(p) && m.CommandKey() != web.PORTAL {
|
||||
ice.LoadTrans(m.Spawn(kit.Dict("_template", path.Join(path.Dir(h), "portal.json"))).Message, m.CommandKey(), m.GetCommand().Command)
|
||||
}
|
||||
}
|
||||
func (s Table) Init(m *ice.Message, arg ...string) {
|
||||
s.LoadTrans(m, arg...)
|
||||
s.Table.Init(m, arg...)
|
||||
}
|
||||
func (s Table) AfterInit(m *ice.Message, arg ...string) {
|
||||
m.Cmd("applications", mdb.REMOVE, kit.Hashs(","+m.PrefixKey()+","))
|
||||
func (s Table) BeforeMigrate(m *ice.Message, arg ...string) {
|
||||
s.Table.BeforeMigrate(m, arg...)
|
||||
kit.If(m.GetCommand().Icon, func() { Portal{}.Show(m) })
|
||||
}
|
||||
func (s Table) AfterMigrate(m *ice.Message, arg ...string) {
|
||||
kit.If(m.GetCommand().Icon, func() { Portal{}.Show(m) })
|
||||
}
|
||||
func (s Table) BeforeAction(m *ice.Message, arg ...string) *ice.Message {
|
||||
return m
|
||||
}
|
||||
func (s Table) Inputs(m *ice.Message, arg ...string) {
|
||||
switch arg[0] {
|
||||
case model.USER_PLACE_ROLE:
|
||||
s.InputsListRole(m, UserPlaceRoleList, arg...)
|
||||
case model.PLACE_TYPE:
|
||||
s.InputsList(m, PlaceTypeList, arg...)
|
||||
case model.DOMAIN_UID:
|
||||
s.AutoCmdy(m, api.GONGANXITONG_DOMAIN).DisplayInputKeyNameIconTitle()
|
||||
case model.FROM_USER_UID, model.TO_USER_UID:
|
||||
m.Cmdy(s.Prefix(m, member{}), m.Option(model.PLACE_UID)).Cut(model.USER_UID, model.USER_NAME, model.USER_AVATAR)
|
||||
m.RenameAppend(model.USER_UID, arg[0], model.NAME, model.USER_NAME, model.USER_AVATAR, mdb.ICONS)
|
||||
m.DisplayInputKeyNameIconTitle()
|
||||
default:
|
||||
s.Table.Inputs(m, arg...)
|
||||
}
|
||||
}
|
||||
func (s Table) InputsUID(m *ice.Message, arg []string, target ice.Any, args ...string) {
|
||||
s.Fields(m, model.UID, model.TITLE)
|
||||
m.Cmdy(target, s.Select, args).RenameAppend(model.UID, arg[0])
|
||||
m.DisplayInputKeyNameIconTitle()
|
||||
}
|
||||
func (s Table) InputsList(m *ice.Message, list ice.Any, arg ...string) {
|
||||
it := reflect.ValueOf(list).MapRange()
|
||||
for it.Next() {
|
||||
@ -111,18 +65,6 @@ 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 {
|
||||
@ -136,232 +78,119 @@ func (s Table) InputsListValue(m *ice.Message, list ice.Any, key string) string
|
||||
}
|
||||
return ""
|
||||
}
|
||||
func (s Table) TransPrice(m *ice.Message, arg []string, field ...string) []string {
|
||||
kit.If(len(field) == 0, func() { field = append(field, "price", "amount") })
|
||||
for i := 0; i < len(arg)-1; i += 2 {
|
||||
if kit.IndexOf(field, arg[i]) > -1 {
|
||||
arg[i+1] = kit.Format(kit.Int(kit.Float(arg[i+1]) * 100))
|
||||
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())
|
||||
}
|
||||
}
|
||||
return arg
|
||||
m.SortInt(arg[0]).DisplayInputKeyNameIconTitle()
|
||||
}
|
||||
func (s Table) ValueModel(m *ice.Message, action ice.Any, arg ...string) *ice.Message {
|
||||
defer m.Options(db.DB, m.Configv(db.DB)).Set(ice.MSG_OPTION, db.DB)
|
||||
defer m.Options(db.MODEL, m.Configv(db.MODEL)).Set(ice.MSG_OPTION, db.MODEL)
|
||||
defer m.Options(db.TARGET, kit.Select(m.CommandKey(), m.Config(db.MODELS))).Set(ice.MSG_OPTION, db.TARGET)
|
||||
kit.For(db.CommonField, func(k string) { arg = kit.TransArgKeys(arg, s.Keys(m.Option(db.TARGET), k), k) })
|
||||
return m.Options(arg).Cmdy(s.PrefixPortal(m), action, arg)
|
||||
}
|
||||
func (s Table) ValueCreate(m *ice.Message, arg ...string) {
|
||||
s.TransPrice(m, arg)
|
||||
s.ValueModel(m, s.ValueCreate, arg...)
|
||||
s.RecordEventWithName(m, "")
|
||||
func (s Table) Create(m *ice.Message, arg ...string) {
|
||||
s.Table.Create(m, arg...)
|
||||
s.UserPlaceInit(m)
|
||||
}
|
||||
func (s Table) ValueRemove(m *ice.Message, arg ...string) {
|
||||
s.ValueModel(m, s.ValueRemove, arg...)
|
||||
s.RecordEventWithName(m, "")
|
||||
}
|
||||
func (s Table) ValueModify(m *ice.Message, arg ...string) {
|
||||
s.TransPrice(m, arg)
|
||||
s.ValueModel(m, s.ValueModify, arg...)
|
||||
s.RecordEventWithName(m, "")
|
||||
}
|
||||
func (s Table) ValueList(m *ice.Message, arg []string, fields ...ice.Any) *ice.Message {
|
||||
if len(arg) > 0 {
|
||||
kit.If(len(fields) == 0, func() { fields = kit.TransArgs(kit.Split(m.Config(mdb.FIELDS), ",", ",")) })
|
||||
defer m.Options(db.FIELDS, fields).Set(ice.MSG_OPTION, db.FIELDS)
|
||||
}
|
||||
if s.ValueModel(m, s.ValueList, arg...); len(arg) == 1 {
|
||||
s.UserPlaceInit(m)
|
||||
if s.IsWorker(m) {
|
||||
s.Button(m, "", s.Create)
|
||||
func (s Table) List(m *ice.Message, arg ...string) *ice.Message {
|
||||
if m.IsTech() {
|
||||
if len(arg) == 0 {
|
||||
s.Select(m)
|
||||
} else if len(arg) == 2 {
|
||||
s.SelectDetail(m, model.UID, arg[1])
|
||||
}
|
||||
}
|
||||
return m
|
||||
// return s.SelectJoinUser(m)
|
||||
}
|
||||
func (s Table) Create(m *ice.Message, arg ...string) { s.ValueCreate(m, arg...) }
|
||||
func (s Table) Remove(m *ice.Message, arg ...string) { s.ValueRemove(m, arg...) }
|
||||
func (s Table) Modify(m *ice.Message, arg ...string) { s.ValueModify(m, arg...) }
|
||||
func (s Table) List(m *ice.Message, arg ...string) *ice.Message {
|
||||
return s.ValueList(m, arg)
|
||||
}
|
||||
func (s Table) FieldsDefault(m *ice.Message, arg ...string) Table {
|
||||
if m.Option(mdb.SELECT) == "" {
|
||||
if fields := m.Config(mdb.FIELDS); fields != "" {
|
||||
s.Table.FieldsWithCreatedAT(m, kit.Select(m.CommandKey(), m.Config(db.MODELS)), kit.TransArgs(kit.Split(fields, ",", ","))...)
|
||||
}
|
||||
}
|
||||
return s
|
||||
}
|
||||
func (s Table) LeftJoinValue(m *ice.Message, value, place ice.Any, arg ...string) string {
|
||||
model := s.ToLower(kit.TypeName(value))
|
||||
models := s.TableName(model)
|
||||
_model := s.ToLower(kit.TypeName(place))
|
||||
_models := s.TableName(_model)
|
||||
return kit.Format("LEFT JOIN %s ON %s.%s_uid = %s.uid AND %s.user_uid = '%s'", models, models, _model, _models, models, m.Option("user_uid"))
|
||||
}
|
||||
func (s Table) Select(m *ice.Message, arg ...string) *ice.Message {
|
||||
s.FieldsDefault(m).Table.Select(m, arg...)
|
||||
s.Table.Select(m, arg...)
|
||||
kit.If(m.Length() > 0, func() { s.UserPlaceInit(m) })
|
||||
return m
|
||||
}
|
||||
func (s Table) InsertIfNeed(m *ice.Message, arg ...string) {
|
||||
kit.If(m.Cmd("", s.Select, arg).Length() == 0, func() { m.Cmd("", s.Insert, arg) })
|
||||
}
|
||||
func (s Table) InsertOrUpdate(m *ice.Message, arg []string, args ...string) {
|
||||
if s.Select(m, args...).Length() > 0 {
|
||||
s.Update(m, arg, args...)
|
||||
} else {
|
||||
s.Insert(m, arg...)
|
||||
}
|
||||
}
|
||||
func (s Table) SelectDetail(m *ice.Message, arg ...string) *ice.Message {
|
||||
return s.FieldsDefault(m).Table.SelectDetail(m, arg...)
|
||||
return s.Table.SelectDetail(m, arg...)
|
||||
}
|
||||
func (s Table) SelectJoinUser(m *ice.Message, arg ...string) *ice.Message {
|
||||
kit.If(len(arg) == 0, func() { arg = append(arg, model.NAME, model.AVATAR) })
|
||||
return s.SelectJoin(m, user{}, arg...)
|
||||
func (s Table) SelectJoinUser(m *ice.Message) *ice.Message {
|
||||
return s.SelectJoin(m, user{}, model.NAME, model.AVATAR)
|
||||
}
|
||||
func (s Table) SelectJoinCity(m *ice.Message, arg ...string) *ice.Message {
|
||||
kit.If(len(arg) == 0, func() { arg = append(arg, model.NAME) })
|
||||
return s.SelectJoin(m, city{}, arg...)
|
||||
func (s Table) SelectJoinCity(m *ice.Message) *ice.Message {
|
||||
return s.SelectJoin(m, city{}, model.NAME)
|
||||
}
|
||||
func (s Table) SelectJoinAuth(m *ice.Message, arg ...string) *ice.Message {
|
||||
if kit.IndexOf(m.Appendv(model.AUTH_TYPE), model.AUTH_TYPE) > -1 {
|
||||
return m
|
||||
func (s Table) SelectJoinAuth(m *ice.Message) *ice.Message {
|
||||
if ice.Info.NodeName == "20240724-community" {
|
||||
return s.SelectJoin(m, "web.team.renzhengshouquan.auth", model.STATUS)
|
||||
} else {
|
||||
defer m.Options(ice.MSG_USERROLE, aaa.TECH).Options(ice.MSG_USERROLE, aaa.VOID)
|
||||
return s.SelectJoin(m, []string{web.SPACE, "ops.20240724-community", "web.team.renzhengshouquan.auth"}, model.STATUS)
|
||||
}
|
||||
kit.If(len(arg) == 0, func() {
|
||||
arg = append(arg, model.NAME, model.INFO, model.TYPE, model.STATUS, model.AVATAR, model.BACKGROUND, model.DASHBOARD_UID)
|
||||
})
|
||||
defer s.SaveBack(m, ice.MSG_USERPOD, ice.MSG_USERROLE)()
|
||||
return s.SelectJoin(m, s.findSpaceCmd(m, api.RENZHENGSHOUQUAN_AUTH), arg...)
|
||||
}
|
||||
func (s Table) SelectJoinRecent(m *ice.Message, PLACE_UID string, arg ...string) *ice.Message {
|
||||
PLACE_UID = kit.Select(model.PLACE_UID, PLACE_UID)
|
||||
if m.Length() == 0 {
|
||||
return m
|
||||
}
|
||||
kit.If(len(arg) == 0, func() { arg = append(arg, model.CITY_NAME, model.STREET_NAME, model.PLACE_NAME) })
|
||||
list := []string{}
|
||||
m.Table(func(value ice.Maps) { kit.If(value[PLACE_UID], func(v string) { list = kit.AddUniq(list, v) }) })
|
||||
msg := m.Spawn()
|
||||
s.Fields(msg, kit.JoinFields("DISTINCT place_uid", kit.JoinFields(arg...)))
|
||||
recents := msg.CmdMap(recent{}, s.SelectList, model.PLACE_UID, list, model.PLACE_UID)
|
||||
m.Table(func(value ice.Maps) {
|
||||
recent := recents[value[PLACE_UID]]
|
||||
kit.For(arg, func(k string) { m.Push(k, recent[k]) })
|
||||
})
|
||||
return m
|
||||
}
|
||||
func (s Table) SelectJoinService(m *ice.Message, arg ...string) *ice.Message {
|
||||
kit.If(len(arg) == 0, func() { arg = append(arg, model.NODENAME, model.INDEX, model.NAME, model.ICON) })
|
||||
return s.SelectJoin(m, service{}, arg...)
|
||||
func (s Table) RenameAppend(m *ice.Message, arg ...string) Table {
|
||||
m.RenameAppend(arg...)
|
||||
return s
|
||||
}
|
||||
func (s Table) RewriteAppend(m *ice.Message, arg ...string) *ice.Message {
|
||||
m.RewriteAppend(func(value, key string, index int) string {
|
||||
if value != "" && kit.IsIn(key, model.BACKGROUND, model.AVATAR) {
|
||||
value = m.Resource(value)
|
||||
}
|
||||
if _, e := strconv.ParseInt(value, 10, 64); e != nil {
|
||||
return value
|
||||
}
|
||||
switch key {
|
||||
case model.USER_PLACE_ROLE:
|
||||
value = UserPlaceRole(kit.Int(value)).String()
|
||||
case model.MEMBER_STATUS:
|
||||
value = MemberStatus(kit.Int(value)).String()
|
||||
case model.PLACE_TYPE:
|
||||
value = PlaceType(kit.Int(value)).String()
|
||||
case model.AUTH_STATUS:
|
||||
value = AuthStatus(kit.Int(value)).String()
|
||||
case model.APPLY_STATUS:
|
||||
value = ApplyStatus(kit.Int(value)).String()
|
||||
case model.ALLOW_STATUS:
|
||||
value = AllowStatus(kit.Int(value)).String()
|
||||
case model.MESSAGE_STATUS:
|
||||
value = MessageStatus(kit.Int(value)).String()
|
||||
case model.PAYMENTLIST_STATUS:
|
||||
value = PaymentStatus(kit.Int(value)).String()
|
||||
}
|
||||
return value
|
||||
})
|
||||
return m
|
||||
}
|
||||
func (s Table) Update(m *ice.Message, data ice.Any, arg ...string) {
|
||||
if len(arg) == 0 {
|
||||
arg = append(arg, model.UID, kit.Select(m.Option(model.UID), m.Option(s.Keys(m.CommandKey(), model.UID))))
|
||||
func (s Table) TablesWithRole(m *ice.Message, arg []string, userPlace UserPlacer, place Placer, target Placer, fields ...ice.Any) *ice.Message {
|
||||
s.Tables(m, kit.JoinWord("INNER JOIN", s.TableName(kit.TypeName(userPlace)),
|
||||
"ON", s.Key(target, model.USER_UID), "=", s.Key(userPlace, model.USER_UID),
|
||||
"AND", s.Key(target, s.Keys(place, model.UID)), "=", s.Key(userPlace, s.Keys(place, model.UID)),
|
||||
"AND", s.Key(userPlace, model.DELETED_AT), "IS NULL",
|
||||
)).FieldsWithCreatedAT(m, target, append([]ice.Any{s.Key(target, model.USER_UID), s.AS(s.Key(userPlace, model.ROLE), s.Keys(userPlace, model.ROLE))}, fields...)...)
|
||||
if len(arg) == 1 {
|
||||
s.Table.Select(m, s.Key(target, s.Keys(place, model.UID)), arg[0])
|
||||
} else if len(arg) == 2 {
|
||||
s.Table.SelectDetail(m, s.Key(target, s.Keys(place, model.UID)), arg[0], s.Key(target, model.UID), arg[1])
|
||||
} else {
|
||||
return m
|
||||
}
|
||||
return s.SelectJoinUser(m)
|
||||
}
|
||||
func (s Table) Update(m *ice.Message, data ice.Map, arg ...string) {
|
||||
data[model.OPERATOR] = m.Option(model.USER_UID)
|
||||
s.Table.Update(m, data, arg...)
|
||||
}
|
||||
func (s Table) UpdateAuth(m *ice.Message, arg ...string) {
|
||||
s.Update(m, kit.Dict(model.AUTH_UID, arg[0]), arg[1:]...)
|
||||
}
|
||||
func (s Table) UpdateField(m *ice.Message, arg ...string) {
|
||||
s.Update(m, kit.Dict(arg[0], arg[1]), arg[2:]...)
|
||||
}
|
||||
func (s Table) UploadUpdate(m *ice.Message, field, uid string, arg ...string) {
|
||||
if m.IsErr() {
|
||||
return
|
||||
}
|
||||
p := m.UploadSave(path.Join(nfs.USR, kit.Select(field, m.Option(model.FIELD)), uid) + nfs.PS)
|
||||
s.Update(m, kit.Dict(kit.Select(m.Option(model.FIELD), field), p), model.UID, uid)
|
||||
}
|
||||
func (s Table) UploadCreate(m *ice.Message, field, uid string, arg ...string) string {
|
||||
if m.IsErr() {
|
||||
return ""
|
||||
}
|
||||
p := m.UploadSave(path.Join(nfs.USR, kit.Select(field, m.Option(model.FIELD)), uid) + nfs.PS)
|
||||
s.Create(m, kit.Select(m.Option(model.FIELD), field), p, model.UID, uid, model.USER_UID, m.Option(model.USER_UID))
|
||||
return p
|
||||
}
|
||||
func (s Table) ChangeStatus(m *ice.Message, place_uid, uid string, from, to int, arg ...string) *ice.Message {
|
||||
msg := s.ValueList(m.Spawn(), []string{place_uid, uid}, model.STATUS)
|
||||
if !m.WarnNotValid(msg.Length() == 0 || from != kit.Int(msg.Append(mdb.STATUS)), kit.Format("%v != %v", from, kit.Int(msg.Append(mdb.STATUS)))) {
|
||||
func (s Table) ChangeStatus(m *ice.Message, uid string, from, to int, arg ...string) *ice.Message {
|
||||
msg := s.Select(m.Spawn(), model.UID, uid)
|
||||
if !m.WarnNotValid(kit.Int(msg.Append(mdb.STATUS)) != int(from)) {
|
||||
s.Update(m, kit.Dict(mdb.STATUS, to, arg), model.UID, uid)
|
||||
}
|
||||
return m
|
||||
}
|
||||
func (s Table) CheckRole(m *ice.Message, arg ...string) {
|
||||
role := UserPlaceRole(s.UserPlaceRole(m))
|
||||
m.WarnNotRight(!kit.IsIn(role.String(), append(arg, UserPlaceCreator.String())...), role.String())
|
||||
}
|
||||
func (s Table) IsVisitor(m *ice.Message) bool {
|
||||
if role := kit.Int(m.Option(model.USER_ROLE)); role == 0 {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
func (s Table) IsCreator(m *ice.Message) bool {
|
||||
if role := kit.Int(m.Option(model.USER_ROLE)); role == 1 {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
func (s Table) IsLeader(m *ice.Message) bool {
|
||||
if role := kit.Int(m.Option(model.USER_ROLE)); role == 1 || role == 2 {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
func (s Table) IsWorker(m *ice.Message) bool {
|
||||
if role := kit.Int(m.Option(model.USER_ROLE)); role == 1 || role == 2 || role == 3 {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
func (s Table) UserPlaceRole(m *ice.Message) int {
|
||||
return kit.Int(m.Cmdy(s.PrefixPortal(m), s.UserPlaceRole).Option(model.USER_ROLE))
|
||||
return kit.Int(m.Cmdx(s.Prefix(m, Portal{}), "userPlaceRole"))
|
||||
}
|
||||
func (s Table) CheckRole(m *ice.Message, arg ...string) {
|
||||
m.ErrorNotImplement()
|
||||
}
|
||||
func (s Table) UserPlaceInit(m *ice.Message, arg ...string) {
|
||||
if m.Option(model.PLACE_INIT) == "" || m.PrefixKey() != m.Option(ice.MSG_INDEX) {
|
||||
if m.Option(model.PLACE_INIT) == "" {
|
||||
return
|
||||
}
|
||||
m.Cmd(s.PrefixPortal(m), Portal{}.PlaceCmd, "addCount", model.INIT, 1, m.Option(model.PLACE_UID), m.Option(model.PLACE_INIT))
|
||||
m.Cmd(s.Prefix(m, Portal{}), "placeCmd", "addCount", model.INIT, 1, m.Option(model.PLACE_UID), m.Option(model.PLACE_INIT))
|
||||
}
|
||||
func (s Table) RecordEvent(m *ice.Message, info string, arg ...string) {
|
||||
m.Cmd(s.PrefixPortal(m), s.RecordEvent, info, arg)
|
||||
m.Cmd(s.Prefix(m, Portal{}), s.RecordEvent, info, arg)
|
||||
}
|
||||
func (s Table) RecordEventWithName(m *ice.Message, info string, arg ...string) {
|
||||
uid := kit.Select(m.Result(), m.Option(model.UID))
|
||||
@ -371,124 +200,39 @@ func (s Table) RecordEventWithName(m *ice.Message, info string, arg ...string) {
|
||||
info = "✅ " + info
|
||||
case "placeRemove", mdb.REMOVE:
|
||||
info = "❌ " + info
|
||||
case "placeAuth", mdb.MODIFY:
|
||||
info = "🕑 " + info
|
||||
default:
|
||||
case "placeAuth":
|
||||
info = "🕑 " + info
|
||||
}
|
||||
})
|
||||
s.RecordEvent(m, kit.JoinWord(info, kit.Cut(uid, 6), kit.Select(m.Option(model.NAME), m.Option(model.TITLE))), uid)
|
||||
s.RecordEvent(m, kit.JoinWord(info, kit.Cut(uid, 6), kit.Select(m.Option(model.TITLE), m.Option(model.NAME))), uid)
|
||||
}
|
||||
func (s Table) MemberList(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(s.Prefix(m, member{}), arg)
|
||||
func (s Table) GetCommands(m *ice.Message, key string, arg ...string) []string {
|
||||
kit.If(len(arg) == 0, func() { arg = append(arg, m.Option(s.Keys(s.Place, model.UID)), m.Option(model.UID)) })
|
||||
return kit.Simple(m.OptionSimple(key), ctx.ARGS, kit.Join(arg), m.OptionSimple(model.CITY_NAME, model.STREET_NAME, model.PLACE_NAME))
|
||||
}
|
||||
func (s Table) CityList(m *ice.Message, arg ...string) *ice.Message {
|
||||
m.Cmdy(city{}, arg).RenameAppend(model.NAME, model.CITY_NAME)
|
||||
return m
|
||||
}
|
||||
func (s Table) CityCmd(m *ice.Message, arg ...ice.Any) *ice.Message {
|
||||
return m.Cmd(append([]ice.Any{city{}}, arg...)...)
|
||||
}
|
||||
func (s Table) CreditCmdy(m *ice.Message, arg ...ice.Any) *ice.Message {
|
||||
return m.Cmdy(append([]ice.Any{s.Prefix(m, credit{})}, arg...)...)
|
||||
}
|
||||
func (s Table) SettingCmdy(m *ice.Message, arg ...ice.Any) *ice.Message {
|
||||
return m.Cmdy(append([]ice.Any{s.Prefix(m, setting{})}, arg...)...)
|
||||
}
|
||||
func (s Table) AuthCreate(m *ice.Message, authType int, fromUID string, arg ...string) {
|
||||
m.Info("what %v", m.Option(model.NAME))
|
||||
s.AutoCmdy(m, api.RENZHENGSHOUQUAN_PORTAL, Portal{}.PlaceCreate,
|
||||
model.AUTH_NAME, m.Option(model.NAME), model.AUTH_INFO, m.Option(model.INFO),
|
||||
model.AUTH_TYPE, authType, model.FROM_UID, kit.Select(ice.AUTO, fromUID),
|
||||
model.SERVICE_UID, m.Option(model.SERVICE_UID),
|
||||
)
|
||||
s.Update(m, kit.Dict(m.OptionSimple(model.AUTH_UID)), arg...)
|
||||
}
|
||||
func (s Table) SpideCreate(m *ice.Message, arg ...string) {
|
||||
m.Cmd(web.SPIDE, mdb.CREATE, arg)
|
||||
}
|
||||
func (s Table) PlaceIsAuthed(m *ice.Message, arg ...string) *ice.Message {
|
||||
if msg := m.Cmd(s.Place, s.Select, model.UID, arg[0]); msg.Append(model.AUTH_UID) == "" {
|
||||
m.Echo("本服务暂未申请认证,请到<用户名片>申请认证")
|
||||
return nil
|
||||
} else if m.Cmd(api.RENZHENGSHOUQUAN_AUTH, s.Select, model.UID, msg.Append(model.AUTH_UID)).Append(model.AUTH_STATUS) != "2" {
|
||||
m.Echo("本服务认证申请中,请等待审批")
|
||||
return nil
|
||||
} else {
|
||||
return msg
|
||||
}
|
||||
}
|
||||
func (s Table) StreetAuthUID(m *ice.Message, arg ...string) string {
|
||||
if msg := s.PlaceIsAuthed(m, arg...); msg != nil {
|
||||
return m.Cmd(s.Street, s.Select, model.UID, msg.Append(s.STREET_UID)).Append(model.AUTH_UID)
|
||||
}
|
||||
return ""
|
||||
}
|
||||
func (s Table) DashboardUpdate(m *ice.Message, arg ...string) {
|
||||
if m.IsErr() {
|
||||
return
|
||||
}
|
||||
m.Cmd(s.Prefix(m, Portal{}), s.DashboardUpdate)
|
||||
}
|
||||
func (s Table) MessagePlaceEnter(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(message{}, "placeEnter", arg)
|
||||
}
|
||||
func (s Table) MessagePlaceInfo(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(message{}, "placeInfo", arg)
|
||||
}
|
||||
func (s Table) MarketPlaceEnter(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(market{}, "placeEnter", arg)
|
||||
}
|
||||
func (s Table) MarketPlaceInfo(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(market{}, "placeInfo", arg)
|
||||
}
|
||||
func (s Table) MarketInsert(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(s.Prefix(m, Portal{}), s.MarketInsert, arg)
|
||||
}
|
||||
func (s Table) PushPublic(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(s.Prefix(m, Portal{}), s.PushPublic, arg)
|
||||
}
|
||||
func (s Table) ServiceList(m *ice.Message, arg ...string) *ice.Message {
|
||||
return m.Cmd(s.Prefix(m, service{}), arg)
|
||||
}
|
||||
func (s Table) GetCommandUID(m *ice.Message, arg ...string) *ice.Message {
|
||||
m.Option(model.COMMAND_UID, CommandUID(m, kit.Select(m.PrefixKey(), arg, 0)))
|
||||
return m
|
||||
}
|
||||
func (s Table) SendMessage(m *ice.Message, from, to string, arg ...string) {
|
||||
if m.IsErr() {
|
||||
return
|
||||
}
|
||||
kit.If(len(arg) == 0, func() { arg = append(arg, m.Option(model.PLACE_UID), kit.Select(m.Option(model.UID), m.Result())) })
|
||||
m.Spawn(ice.Maps{db.DB: ""}).Cmd(s.Prefix(m, message{}), s.Create,
|
||||
model.FROM_USER_UID, kit.Select(m.Option(model.USER_UID), from), model.TO_USER_UID, kit.Select(m.Option(model.USER_UID), to),
|
||||
m.OptionSimple(model.COMMAND_UID), model.ARGS, kit.Join(arg), m.OptionSimple(model.TITLE, model.CONTENT),
|
||||
)
|
||||
func (s Table) SendMessage(m *ice.Message, from_user_uid, to_user_uid string, arg ...string) {
|
||||
m.Spawn(ice.Maps{db.DB: ""}).Cmd(message{}, s.Create, model.FROM_USER_UID, from_user_uid, model.TO_USER_UID, to_user_uid, s.GetCommands(m, model.COMMAND_UID, arg...))
|
||||
}
|
||||
func (s Table) DoneMessage(m *ice.Message, arg ...string) {
|
||||
if m.Option(model.MESSAGE_UID) != "" {
|
||||
m.Spawn(ice.Maps{db.DB: ""}).Cmd(s.Prefix(m, message{}), message{}.Done, kit.Dict(model.UID, m.Option(model.MESSAGE_UID)))
|
||||
m.Spawn(ice.Maps{db.DB: ""}).Cmd(message{}, message{}.Done, kit.Dict(model.UID, m.Option(model.MESSAGE_UID)))
|
||||
}
|
||||
}
|
||||
func (s Table) SendTemplate(m *ice.Message, from, to, title string, arg ...string) {
|
||||
if m.IsErr() {
|
||||
return
|
||||
}
|
||||
m.Cmd(s.PrefixPortal(m), s.SendTemplate, m.PrefixKey(), from, to, title, arg)
|
||||
m.Cmd(Portal{}, m.PrefixKey(), from, to, title, arg)
|
||||
}
|
||||
func (s Portal) SendTemplate(m *ice.Message, arg ...string) {
|
||||
name := kit.Select("", arg, 4)
|
||||
if name == "" {
|
||||
name = kit.JoinWord(m.Option(model.CITY_NAME), m.Option(model.STREET_NAME), kit.Select(m.Option(model.PLACE_NAME), m.Option(s.Keys(s.Place, model.NAME))))
|
||||
name = m.Option(s.Keys(s.Place, model.NAME)) + " " + s.Place.TransValue(m, s.Keys(s.UserPlace, model.ROLE))
|
||||
}
|
||||
uid, place_uid := kit.Select(m.Option(model.UID), arg, 5), kit.Select("", arg, 6)
|
||||
kit.If(place_uid == "", func() { place_uid = m.Option(s.Keys(s.Place, model.UID)) })
|
||||
link := m.Cmdx("", s.Link, place_uid, arg[0], uid)
|
||||
s.AutoCmd(m, user{}, s.SendTemplate, arg[1], arg[2], link, kit.JoinWord(m.Option(model.PORTAL_NAME), arg[3]), name, kit.Cut(uid, 6))
|
||||
}
|
||||
func (s Table) Button(m *ice.Message, info string, arg ...ice.Any) *ice.Message {
|
||||
kit.If(!m.IsErr() && m.Length() == 0, func() { m.Options(ctx.STYLE, html.FORM).EchoInfoButton(info, arg...).Action() }, func() { m.Action(arg...) })
|
||||
return m
|
||||
link := Portal{}.Link(m, place_uid, arg[0], uid)
|
||||
m.Cmd(user{}, s.SendTemplate, arg[1], arg[2], link, arg[3], name, kit.Cut(uid, 6))
|
||||
}
|
||||
func (s Table) DisplayBase(m *ice.Message, file string) *ice.Message {
|
||||
if s.Place != nil {
|
||||
@ -512,8 +256,7 @@ func (s Table) Display(m *ice.Message, file string) *ice.Message {
|
||||
}
|
||||
if m.Template(file) == "" {
|
||||
if m.CommandKey() == web.PORTAL {
|
||||
// file = m.Resource(path.Join(base, "portal.js"))
|
||||
file = m.Resource(path.Join(sub, "portal.js"))
|
||||
file = m.Resource(path.Join(base, "portal.js"))
|
||||
} else {
|
||||
file = m.Resource(path.Join(base, "common.js"))
|
||||
}
|
||||
@ -531,7 +274,7 @@ func (s Table) TransValue(m *ice.Message, key string, arg ...string) string {
|
||||
func (s Table) TransRole(m *ice.Message, arg ...string) string {
|
||||
value := kit.Select(m.Option(s.Keys(s.UserPlace, model.ROLE)), arg, 0)
|
||||
role := s.Place.TransValue(m, s.Keys(s.UserPlace, model.ROLE), arg...)
|
||||
return kit.Format(`<span class="role %s %s">%s</span>`, value, kit.Select("", arg, 1), role)
|
||||
return kit.Format(`<span class="role %s">%s</span>`, value, role)
|
||||
}
|
||||
|
||||
func (s Table) Prefix(m *ice.Message, target ice.Any) string {
|
||||
@ -540,110 +283,56 @@ func (s Table) Prefix(m *ice.Message, target ice.Any) string {
|
||||
func (s Table) PrefixPortal(m *ice.Message) string {
|
||||
return m.Prefix(kit.TypeName(Portal{}))
|
||||
}
|
||||
func (s Table) findSpaceCmd(m *ice.Message, cmd ice.Any) ice.Any {
|
||||
cmds := ice.GetTypeKey(cmd)
|
||||
if space, ok := cmdSpace[cmds]; ok && space != ice.Info.NodeName {
|
||||
m.Options(ice.MSG_USERROLE, aaa.TECH, ice.MSG_USERPOD, space)
|
||||
return []string{web.SPACE, kit.Keys(ice.OPS, space), cmds}
|
||||
}
|
||||
return cmd
|
||||
}
|
||||
func (s Table) SaveBack(m *ice.Message, arg ...string) func() {
|
||||
list := []string{}
|
||||
kit.For(arg, func(k string) { list = append(list, m.Option(k)) })
|
||||
return func() {
|
||||
kit.For(arg, func(i int, k string) { m.Option(k, list[i]) })
|
||||
}
|
||||
}
|
||||
func (s Table) SpaceOpsCmdy(m *ice.Message, arg ...ice.Any) *ice.Message {
|
||||
return s.SpaceCmdy(m, ice.OPS, arg...)
|
||||
}
|
||||
func (s Table) SpaceOpsCmd(m *ice.Message, arg ...ice.Any) *ice.Message {
|
||||
return s.SpaceCmd(m, ice.OPS, arg...)
|
||||
}
|
||||
func (s Table) SpaceCmdy(m *ice.Message, space string, arg ...ice.Any) *ice.Message {
|
||||
return m.Cmdy(append([]ice.Any{web.SPACE, space, kit.Dict(ice.MSG_USERROLE, aaa.TECH)}, arg...)...)
|
||||
}
|
||||
func (s Table) SpaceCmd(m *ice.Message, space string, arg ...ice.Any) *ice.Message {
|
||||
return m.Cmd(append([]ice.Any{web.SPACE, space, kit.Dict(ice.MSG_USERROLE, aaa.TECH)}, arg...)...)
|
||||
}
|
||||
func (s Table) AutoCmdy(m *ice.Message, arg ...ice.Any) *ice.Message {
|
||||
defer s.SaveBack(m, ice.MSG_USERPOD, ice.MSG_USERROLE)()
|
||||
return m.Cmdy(append([]ice.Any{s.findSpaceCmd(m, arg[0])}, arg[1:]...)...)
|
||||
}
|
||||
func (s Table) AutoCmd(m *ice.Message, arg ...ice.Any) *ice.Message {
|
||||
return m.Cmd(append([]ice.Any{s.findSpaceCmd(m, arg[0])}, arg[1:]...)...)
|
||||
}
|
||||
func (s Table) ProcessPodCmd(m, msg *ice.Message, arg ...string) *ice.Message {
|
||||
m.ProcessPodCmd(msg.Append(web.SPACE), msg.Append(ctx.INDEX), kit.Split(msg.Append(ctx.ARGS)))
|
||||
m.Push(ice.FIELD_OPTION, kit.Format(kit.Dict(arg)))
|
||||
return m
|
||||
if space == ice.Info.NodeName {
|
||||
return m.Cmd(arg...)
|
||||
} else {
|
||||
return m.Cmd(append([]ice.Any{web.SPACE, kit.Keys(ice.OPS, space)}, arg...)...)
|
||||
}
|
||||
}
|
||||
func (s Table) Link(m *ice.Message, arg ...string) string {
|
||||
return m.Cmdx(s.PrefixPortal(m), s.Link, arg)
|
||||
return Portal{}.Link(m, arg...)
|
||||
}
|
||||
|
||||
type Tables struct{ Table }
|
||||
|
||||
func (s Tables) BeforeMigrate(m *ice.Message, arg ...string) {}
|
||||
|
||||
func newTable() Table { return Table{UserPlace: userPlace{}, Place: place{}, Street: street{}} }
|
||||
func newTables() Tables { return Tables{Table: newTable()} }
|
||||
func newTable() Table { return NewTable(userPlace{}, place{}, street{}) }
|
||||
func NewTable(userPlace UserPlacer, place Placer, street Container) Table {
|
||||
return Table{UserPlace: userPlace, Place: place, Street: street, STREET_UID: street.Keys(street, model.UID), PLACE_UID: place.Keys(place, model.UID)}
|
||||
return Table{UserPlace: userPlace, Place: place, Street: street}
|
||||
}
|
||||
func NewTables(userPlace UserPlacer, place Placer, street Container) Tables {
|
||||
return Tables{Table: NewTable(userPlace, place, street)}
|
||||
}
|
||||
func NewPortal(userPlace UserPlacer, place Placer, street Container) Portal {
|
||||
return Portal{Table: NewTable(userPlace, place, street)}
|
||||
return Portal{Table: Table{UserPlace: userPlace, Place: place, Street: street}}
|
||||
}
|
||||
func (s Portal) getTable() Table { return s.Table }
|
||||
|
||||
func PortalCmd(portal ice.Any) {
|
||||
h := kit.FileLine(-1, 100)
|
||||
p := kit.Keys("web.team", kit.ModPath(-1))
|
||||
table := portal.(interface{ getTable() Table }).getTable()
|
||||
tables := Tables{Table: table}
|
||||
base := kit.FileLine(1, 100)
|
||||
cmd := func(name string, data ice.Any) {
|
||||
_, cmd := ice.Cmd(kit.Keys(p, name), data)
|
||||
if cmd == nil {
|
||||
return
|
||||
}
|
||||
cmd.RawHand = path.Join(path.Dir(h), name+".go")
|
||||
what := kit.FileLine(1, 100)
|
||||
// cmd.Icon = path.Join(path.Dir(what), name) + ".png"
|
||||
nfs.Exists(ice.Pulse, path.Join(path.Dir(what), name)+".png", func(p string) {
|
||||
cmd.Icon = "/p/src/gonganxitong/" + name + ".png?pod=20240724-community"
|
||||
// ice.Pulse.Resource(p)
|
||||
cmd.Actions[ice.CTX_INIT].Hand = icebergs.MergeHand(cmd.Actions[ice.CTX_INIT].Hand, func(m *icebergs.Message, arg ...string) {
|
||||
ice.LoadTrans(m.Spawn(kit.Dict("_template", path.Join(path.Dir(base), "portal.json"))), m.CommandKey(), cmd)
|
||||
ice.LoadTrans(m, m.CommandKey(), cmd)
|
||||
mdb.Config(m, db.DOMAIN, "gonganxitong")
|
||||
})
|
||||
cmd.Actions[ice.CTX_INIT].Hand = icebergs.MergeHand(func(m *icebergs.Message, arg ...string) {
|
||||
m.Design(mdb.LIST, "", kit.JoinWord(table.Keys(table.Place, model.UID), model.UID, ice.AUTO))
|
||||
mdb.Config(m, db.DOMAIN, kit.PathName(1))
|
||||
}, cmd.Actions[ice.CTX_INIT].Hand)
|
||||
}
|
||||
table := portal.(interface{ getTable() Table }).getTable()
|
||||
cmd("portal", portal)
|
||||
|
||||
cmd("goodslist", goodslist{Table: table})
|
||||
cmd("quotalist", quotalist{Table: table})
|
||||
cmd("spendlist", spendlist{Table: table})
|
||||
cmd("paymentlist", paymentlist{Table: table})
|
||||
cmd("meeting", meeting{Table: table})
|
||||
cmd("document", document{Table: table})
|
||||
cmd("contract", contract{Table: table})
|
||||
cmd("photo", photo{Table: table})
|
||||
|
||||
cmd("credit", credit{Tables: tables})
|
||||
cmd("member", member{Tables: tables})
|
||||
cmd("setting", setting{Table: table})
|
||||
cmd("qrcode", qrcode{Tables: tables})
|
||||
cmd("search", search{Tables: Tables{Table: table}})
|
||||
cmd("qrcode", qrcode{Tables: Tables{Table: table}})
|
||||
cmd("event", event{Table: table})
|
||||
cmd("apply", apply{Table: table})
|
||||
cmd("allow", allow{Table: table})
|
||||
cmd("notice", notice{Table: table})
|
||||
cmd("market", market{Table: table})
|
||||
cmd("message", message{Table: table})
|
||||
cmd("recent", recent{Table: table})
|
||||
cmd("member", member{Tables: Tables{Table: table}})
|
||||
cmd("message", message{})
|
||||
cmd("recent", recent{})
|
||||
cmd("service", service{Table: table})
|
||||
cmd("support", support{Table: table})
|
||||
cmd("support", support{})
|
||||
}
|
||||
|
@ -1,14 +1,13 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
_init: function(can, msg) { can.onimport.shareTitle && can.onimport.shareTitle(can, msg)
|
||||
var PLACE_NAME = msg.Option("_place_name"), PLACE_TYPE = msg.Option("_place_type"), USER_PLACE_ROLE = msg.Option("_user_place_role")
|
||||
PLACE_TYPE || can.core.List(msg.append, function(key) { can.base.endWith(key, "_type") && (PLACE_TYPE = key), can.base.endWith(key, "_role") && (USER_PLACE_ROLE = key) })
|
||||
can.onimport.myView(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list:[
|
||||
value.title||value.name||value.user_name, can.onimport.textView(can, value, PLACE_TYPE), can.onimport.textView(can, value, USER_PLACE_ROLE),
|
||||
can.onimport.titleAction(can, value),
|
||||
can.onimport.itemcards(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list:[value.title||value.name||value.user_name,
|
||||
can.onimport.textView(can, value, PLACE_TYPE), can.onimport.textView(can, value, USER_PLACE_ROLE),
|
||||
]},
|
||||
{view: html.STATUS, list: [value.city_name, value.company_name||value.street_name, value.place_name]},
|
||||
{view: html.STATUS, list: [value.uid && value.uid.slice(0, 6), can.onimport.timeView(can, value), value.user_name]},
|
||||
{view: html.STATUS, list: [value.city_name, value.street_name, value.company_name]},
|
||||
{view: html.STATUS, list: [value.uid && value.uid.slice(0, 6), can.base.TimeTrim(value.created_at||value.updated_at)]},
|
||||
value.address && {view: html.STATUS, list: [value.address]},
|
||||
value.content && {view: html.OUTPUT, list: [value.content]},
|
||||
value.info && {view: html.OUTPUT, list: [value.info]},
|
||||
|
@ -1,19 +0,0 @@
|
||||
package gonganxitong
|
||||
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
type contract struct {
|
||||
Table
|
||||
order string `data:"95"`
|
||||
auth string `data:"issued"`
|
||||
role string `data:"leader,worker"`
|
||||
fields string `data:"title"`
|
||||
create string `name:"create title*" role:"leader"`
|
||||
remove string `name:"remove" role:"leader"`
|
||||
}
|
||||
|
||||
func (s contract) List(m *ice.Message, arg ...string) {
|
||||
m.Echo("功能正在开发中,敬请等待。")
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(contract{Table: newTable()}) }
|
@ -1,10 +0,0 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.page.Append(can, can._output, [
|
||||
{view: html.ITEM, list: [{type: html.INPUT, data: {type: html.TEXT}, onblur: function() {
|
||||
can.sup.onimport.size(can.sup, can.sup.ConfHeight(), can.sup.ConfWidth())
|
||||
can.onmotion.delay(can, function() { can._root.Action.onlayout._init(can) })
|
||||
}}]},
|
||||
])
|
||||
},
|
||||
})
|
@ -1,73 +0,0 @@
|
||||
package gonganxitong
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/community/src/api"
|
||||
"shylinux.com/x/community/src/gonganxitong/model"
|
||||
)
|
||||
|
||||
type credit struct {
|
||||
Tables
|
||||
user user
|
||||
city city
|
||||
order string `data:"101"`
|
||||
authService string `name:"authService" role:"void"`
|
||||
authCompany string `name:"authCompany" role:"void"`
|
||||
authPersonal string `name:"authPersonal" role:"void"`
|
||||
authCity string `name:"authCity" role:"void"`
|
||||
}
|
||||
|
||||
func (s credit) List(m *ice.Message, arg ...string) {
|
||||
msg := m.Cmd(s.Place, s.Select, model.UID, arg[0])
|
||||
if msg.Append(model.AUTH_UID) != "" {
|
||||
m.ProcessField(api.RENZHENGSHOUQUAN_PROFILE, msg.Append(model.AUTH_UID))
|
||||
return
|
||||
}
|
||||
if !s.IsLeader(m) {
|
||||
m.Echo("本服务暂未申请认证")
|
||||
return
|
||||
}
|
||||
m.SetResult().EchoInfoButton("请申请服务认证", s.AuthService)
|
||||
|
||||
msg = m.Cmd(s.Street, s.Select, model.UID, msg.Append(s.Keys(s.Street, model.UID)))
|
||||
if msg.Append(model.AUTH_UID) != "" {
|
||||
return
|
||||
}
|
||||
m.SetResult().EchoInfoButton("请申请公司认证", s.AuthCompany)
|
||||
|
||||
msg = m.Cmd(s.city, s.Select, model.UID, msg.Append(model.CITY_UID))
|
||||
if msg.Append(model.AUTH_UID) != "" {
|
||||
if msg := m.Cmd(s.user, s.Select, model.UID, m.Option(model.USER_UID)); msg.Append(model.AUTH_UID) == "" {
|
||||
m.SetResult().EchoInfoButton("请申请个人认证", s.AuthPersonal)
|
||||
}
|
||||
return
|
||||
}
|
||||
m.SetResult().EchoInfoButton("请申请城市认证", s.AuthCity)
|
||||
}
|
||||
func (s credit) AuthService(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(s.PrefixPortal(m), Portal{}.PlaceAuth, kit.Dict(s.placeInfo(m).AppendSimple())).ProcessRefresh()
|
||||
}
|
||||
func (s credit) AuthCompany(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(s.Street, s.AuthCreate, kit.Dict(s.streetInfo(m).AppendSimple(model.NAME, model.INFO, model.UID, model.CITY_UID)))
|
||||
}
|
||||
func (s credit) AuthPersonal(m *ice.Message, arg ...string) {
|
||||
msg := m.Cmd(s.city, s.Select, model.NAME, m.Option(model.CITY_NAME))
|
||||
m.Cmdy(s.user, s.AuthCreate, kit.Dict(msg.AppendSimple(model.AUTH_UID)))
|
||||
}
|
||||
func (s credit) AuthCity(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(s.city, s.AuthCreate, kit.Dict(s.cityInfo(m).AppendSimple(model.NAME, model.INFO)))
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(credit{Tables: newTables()}) }
|
||||
|
||||
func (s credit) placeInfo(m *ice.Message, arg ...string) *ice.Message {
|
||||
return m.Cmd(s.Place, s.Select, model.UID, m.Option(s.Keys(s.Place, model.UID)))
|
||||
}
|
||||
func (s credit) streetInfo(m *ice.Message, arg ...string) *ice.Message {
|
||||
return m.Cmd(s.Street, s.Select, model.UID, s.placeInfo(m).Append(s.Keys(s.Street, model.UID)))
|
||||
}
|
||||
func (s credit) cityInfo(m *ice.Message, arg ...string) *ice.Message {
|
||||
return m.Cmd(s.city, s.Select, model.UID, s.streetInfo(m).Append(model.CITY_UID))
|
||||
}
|
Before Width: | Height: | Size: 4.5 KiB |
@ -1,47 +0,0 @@
|
||||
package gonganxitong
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
|
||||
"shylinux.com/x/community/src/gonganxitong/model"
|
||||
)
|
||||
|
||||
type document struct {
|
||||
Table
|
||||
order string `data:"94"`
|
||||
auth string `data:"issued"`
|
||||
role string `data:"leader,worker"`
|
||||
fields string `data:"folder_id,vendor,user_uid"`
|
||||
open string `name:"open" style:"notice" role:"void"`
|
||||
}
|
||||
|
||||
func (s document) Config(m *ice.Message, arg ...string) {
|
||||
s.InsertOrUpdate(m, arg, m.OptionSimple(model.PLACE_UID)...)
|
||||
}
|
||||
func (s document) List(m *ice.Message, arg ...string) {
|
||||
s.cmdy(m, DocumentVendor.Folder).PushAction(s.Open).Display("")
|
||||
if len(arg) == 1 {
|
||||
s.SpendlistCheck(m, 0)
|
||||
}
|
||||
}
|
||||
func (s document) Open(m *ice.Message, arg ...string) {
|
||||
m.ProcessOpen(m.Option(model.LINK))
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(document{Table: newTable()}) }
|
||||
|
||||
func (s document) cmdy(m *ice.Message, action ice.Any, arg ...string) *ice.Message {
|
||||
if m.Option(model.AUTH_UID, s.StreetAuthUID(m, m.Option(model.PLACE_UID))) == "" {
|
||||
return m
|
||||
}
|
||||
if msg := s.Select(m.Spawn(), m.OptionSimple(model.PLACE_UID)...); msg.Append("folder_id") == "" {
|
||||
m.Echo("本服务暂未配置,请联系公司管理员配置")
|
||||
} else {
|
||||
m.Cmdy(msg.Append(model.VENDOR), action, m.Option(model.AUTH_UID), msg.Append("folder_id"))
|
||||
}
|
||||
return m
|
||||
}
|
||||
|
||||
var DocumentVendor interface {
|
||||
Folder(m *ice.Message, arg ...string) *ice.Message
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.onimport.myView(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.name+"."+value.type, can.onimport.titleAction(can, value)]},
|
||||
{view: html.STATUS, list: [value.ownerName, can.onimport.timeView(can, value)]},
|
||||
] })
|
||||
},
|
||||
})
|
@ -1,37 +0,0 @@
|
||||
package gonganxitong
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
|
||||
"shylinux.com/x/community/src/gonganxitong/model"
|
||||
)
|
||||
|
||||
type domain struct {
|
||||
Table
|
||||
fields string `name:"name,order"`
|
||||
create string `name:"create name* info" role:"tech"`
|
||||
remove string `name:"remove" role:"tech"`
|
||||
list string `name:"list domain_uid auto" role:"void"`
|
||||
}
|
||||
|
||||
func (s domain) Create(m *ice.Message, arg ...string) { s.Insert(m, arg...) }
|
||||
func (s domain) Modify(m *ice.Message, arg ...string) {
|
||||
s.Update(m, arg, model.UID, m.Option(model.DOMAIN_UID))
|
||||
}
|
||||
func (s domain) Remove(m *ice.Message, arg ...string) {
|
||||
s.Delete(m.Options(model.UID, m.Option(model.DOMAIN_UID)))
|
||||
}
|
||||
func (s domain) List(m *ice.Message, arg ...string) {
|
||||
s.Fields(m, model.UID, model.NAME, "order")
|
||||
if len(arg) == 0 {
|
||||
s.Select(m).RenameAppend(model.UID, model.DOMAIN_UID).Action()
|
||||
m.SortInt("order")
|
||||
} else if len(arg) == 1 {
|
||||
s.SelectDetail(m, model.UID, arg[0])
|
||||
}
|
||||
if m.IsTech() {
|
||||
m.PushAction(s.Remove).Action(s.Create)
|
||||
}
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(domain{}) }
|
@ -30,6 +30,7 @@ func (s email) List(m *ice.Message, arg ...string) {
|
||||
}
|
||||
}
|
||||
func (s email) Apply(m *ice.Message, arg ...string) {
|
||||
defer m.ToastProcess()()
|
||||
msg := m.Cmd(s.user, s.user.Select, model.UID, m.Option(model.USER_UID))
|
||||
if m.Warn(msg.Append(model.EMAIL) != "", m.Trans("email already exists", "邮箱已存在")) {
|
||||
return
|
||||
@ -41,6 +42,7 @@ func (s email) Apply(m *ice.Message, arg ...string) {
|
||||
kit.If(!m.IsErr(), func() { m.Cmdy(s.user, s.user.Email, m.Option(aaa.USERNAME)) })
|
||||
}
|
||||
func (s email) Reset(m *ice.Message, arg ...string) {
|
||||
defer m.ToastProcess()()
|
||||
msg := m.Cmd(s.user, s.user.Select, model.UID, m.Option(model.USER_UID))
|
||||
if m.WarnNotFound(msg.Append(model.EMAIL) == "", model.EMAIL) {
|
||||
return
|
||||
|
@ -2,31 +2,40 @@ package gonganxitong
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
"shylinux.com/x/icebergs/base/ctx"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/community/src/gonganxitong/model"
|
||||
)
|
||||
|
||||
type event struct {
|
||||
Table
|
||||
order string `data:"504"`
|
||||
role string `data:"leader"`
|
||||
user user
|
||||
command command
|
||||
service service
|
||||
order string `data:"93"`
|
||||
role string `data:"creator"`
|
||||
}
|
||||
|
||||
func (s event) List(m *ice.Message, arg ...string) {
|
||||
s.FieldsWithCreatedAT(m, s, model.USER_UID, model.INFO)
|
||||
s.Tables(m, s.user, s.command, s.service).FieldsWithCreatedAT(m, s,
|
||||
model.USER_AVATAR, model.USER_NAME, model.INFO,
|
||||
s.Key(s, model.CITY_NAME), s.Key(s, model.STREET_NAME), s.Key(s, model.PLACE_NAME),
|
||||
model.SERVICE_NAME,
|
||||
)
|
||||
if len(arg) == 1 {
|
||||
s.Select(m, model.PLACE_UID, arg[0]).Action()
|
||||
} else if len(arg) == 2 {
|
||||
s.SelectDetail(m, model.PLACE_UID, arg[0], model.UID, arg[1])
|
||||
s.SelectDetail(m, model.PLACE_UID, arg[0], s.Key(s, model.UID), arg[1])
|
||||
} else {
|
||||
return
|
||||
}
|
||||
s.SelectJoinUser(m)
|
||||
s.DisplayBase(m, "")
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(event{Table: newTable()}) }
|
||||
|
||||
func (s event) Record(m *ice.Message, info string, arg ...string) {
|
||||
m.Cmd(s.Prefix(m, s), s.Insert, m.OptionSimple(model.PLACE_UID, model.USER_UID), model.INFO, info)
|
||||
m.Cmd(s.Prefix(m, s), s.Create, m.OptionSimple(model.COMMAND_UID, model.PLACE_UID, model.USER_UID), model.INFO, info,
|
||||
m.OptionSimple(model.CITY_NAME, model.STREET_NAME, model.PLACE_NAME), model.OPERATE, m.ActionKey(), ctx.ARGS, kit.Join(arg, ","))
|
||||
}
|
||||
|
@ -1,8 +1,9 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.onimport.myView(can, msg, function(value) { return [
|
||||
_init: function(can, msg) { can.onimport.shareTitle(can, msg)
|
||||
can.onimport.itemcards(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.user_name, can.onimport.timeView(can, value)]},
|
||||
{view: html.STATUS, list: [value.info]},
|
||||
// {view: html.STATUS, list: [value.city_name, value.street_name, value.service_name]},
|
||||
{view: html.OUTPUT, list: [value.info]},
|
||||
] })
|
||||
},
|
||||
})
|
Before Width: | Height: | Size: 2.1 KiB |
@ -1,10 +0,0 @@
|
||||
package gonganxitong
|
||||
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
type favor struct {
|
||||
Table
|
||||
thumb
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(favor{}) }
|
@ -1,118 +0,0 @@
|
||||
package gonganxitong
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"shylinux.com/x/ice"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/community/src/api"
|
||||
"shylinux.com/x/community/src/gonganxitong/model"
|
||||
)
|
||||
|
||||
type goodslist struct {
|
||||
Table
|
||||
quotalist quotalist
|
||||
spendlist spendlist
|
||||
paymentlist paymentlist
|
||||
order string `data:"91"`
|
||||
auth string `data:"issued"`
|
||||
role string `data:"leader,worker"`
|
||||
fields string `data:"name,amount,title,content,user_uid"`
|
||||
create string `name:"create name* amount* title* content*" role:"leader"`
|
||||
remove string `name:"remove" role:"leader"`
|
||||
request string `name:"request" help:"购买" style:"notice" role:"void"`
|
||||
response string `name:"response" role:"void"`
|
||||
}
|
||||
|
||||
func (s goodslist) AfterMigrate(m *ice.Message, arg ...string) {
|
||||
s.Table.AfterMigrate(m, arg...)
|
||||
if s.PrefixPortal(m) == api.RENZHENGSHOUQUAN_PORTAL {
|
||||
s.insert(m, "service", "3-1", "1000", "基础版")
|
||||
s.insert(m, "service", "3-2", "3000", "高级版")
|
||||
s.insert(m, "service", "3-3", "5000", "旗舰版")
|
||||
s.insert(m, "company", "4-1", "10000", "企业基础版")
|
||||
s.insert(m, "company", "4-2", "30000", "企业高级版")
|
||||
s.insert(m, "company", "4-3", "50000", "企业旗舰版")
|
||||
s.insert(m, "school", "5-1", "10000", "教育基础版")
|
||||
s.insert(m, "school", "5-2", "30000", "教育高级版")
|
||||
s.insert(m, "school", "5-3", "50000", "教育旗舰版")
|
||||
s.insert(m, "street", "6-1", "10000", "社区基础版")
|
||||
s.insert(m, "street", "6-2", "30000", "社区高级版")
|
||||
s.insert(m, "street", "6-3", "50000", "社区旗舰版")
|
||||
}
|
||||
}
|
||||
func (s goodslist) Create(m *ice.Message, arg ...string) {
|
||||
s.Insert(m, kit.Simple(s.TransPrice(m, arg, model.AMOUNT), m.OptionSimple(model.PLACE_UID, model.USER_UID))...)
|
||||
s.RecordEventWithName(m, "")
|
||||
}
|
||||
func (s goodslist) List(m *ice.Message, arg ...string) {
|
||||
if len(arg) == 1 {
|
||||
if s.PrefixPortal(m) == api.RENZHENGSHOUQUAN_PORTAL {
|
||||
msg := m.Cmd(api.RENZHENGSHOUQUAN_AUTH, s.Select, model.UID, arg[0])
|
||||
switch kit.Int(msg.Append(model.AUTH_TYPE)) {
|
||||
case 3:
|
||||
s.Select(m, model.PLACE_UID, "service")
|
||||
case 4:
|
||||
s.Select(m, model.PLACE_UID, "company")
|
||||
case 5:
|
||||
s.Select(m, model.PLACE_UID, "school")
|
||||
case 6:
|
||||
s.Select(m, model.PLACE_UID, "street")
|
||||
}
|
||||
m.PushAction(s.Request).Action()
|
||||
} else {
|
||||
if s.IsLeader(m) {
|
||||
s.Select(m, model.PLACE_UID, "service")
|
||||
m.PushAction(s.Request).Action()
|
||||
}
|
||||
msg := s.Select(m.Spawn(), model.PLACE_UID, arg[0])
|
||||
if s.IsLeader(m) {
|
||||
msg.PushAction(s.Request, s.Remove).Action(s.Create)
|
||||
} else {
|
||||
msg.PushAction(s.Request).Action()
|
||||
}
|
||||
m.Copy(msg)
|
||||
s.SelectJoinUser(m)
|
||||
}
|
||||
m.Display("")
|
||||
} else if len(arg) == 2 {
|
||||
m.Cmdy(s.Prefix(m, s.quotalist), s.Select, model.GOODSLIST_UID, arg[1])
|
||||
m.EchoInfoButton("请购买会员", s.Request).Action()
|
||||
m.Display("quotalist.js")
|
||||
}
|
||||
}
|
||||
func (s goodslist) Request(m *ice.Message, arg ...string) {
|
||||
if msg := s.Select(m.Spawn(), m.OptionSimple(model.UID)...); msg.IsErr() {
|
||||
m.Copy(msg)
|
||||
} else if _msg := m.Cmd(s.Prefix(m, s.paymentlist), s.Create, model.GOODSLIST_UID, m.Option(model.UID),
|
||||
model.AMOUNT, kit.Float(msg.Append(model.AMOUNT))/100, msg.AppendSimple(model.TITLE, model.CONTENT)); _msg.IsErr() {
|
||||
m.Copy(_msg)
|
||||
} else {
|
||||
m.Options(msg.AppendSimple(model.AMOUNT, model.TITLE, model.CONTENT))
|
||||
m.Cmdy(s.Prefix(m, s.paymentlist), m.ActionKey(), m.PrefixKey(), "", m.Option(model.PLACE_UID), _msg.Result())
|
||||
m.Push(model.PAYMENTLIST_UID, _msg.Result())
|
||||
}
|
||||
}
|
||||
func (s goodslist) Response(m *ice.Message, arg ...string) {
|
||||
if m.Cmdy(s.Prefix(m, s.paymentlist), m.ActionKey(), arg).IsErr() {
|
||||
return
|
||||
}
|
||||
t := time.Now().AddDate(0, 1, 0)
|
||||
msg := m.Cmd(s.Prefix(m, s.paymentlist), s.Select, model.UID, arg[1])
|
||||
m.Cmd(s.Prefix(m, s.quotalist), s.Select, msg.AppendSimple(model.GOODSLIST_UID)).Table(func(value ice.Maps) {
|
||||
m.Cmd(s.Prefix(m, s.spendlist), s.Insert, model.PLACE_UID, arg[0], msg.AppendSimple(model.USER_UID), model.PAYMENTLIST_UID, arg[1],
|
||||
model.QUOTALIST_UID, value[model.UID], model.EXPIRE_TIME, t.Format(ice.MOD_TIME), model.VENDOR, value[model.VENDOR], model.TOTAL, value[model.TOTAL])
|
||||
})
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(goodslist{Table: newTable()}) }
|
||||
|
||||
func (s goodslist) insert(m *ice.Message, auth, level, amount string, arg ...string) {
|
||||
uid := kit.Hashs(auth, level)
|
||||
if s.Select(m.Spawn(), model.UID, uid).Length() > 0 {
|
||||
return
|
||||
}
|
||||
s.Insert(m, model.UID, uid, model.PLACE_UID, auth, model.NAME, level,
|
||||
model.AMOUNT, amount, model.TITLE, kit.Select("", arg, 0), model.CONTENT, kit.Select("", arg, 1))
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.onimport.myView(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.title, "¥ "+value.amount/100+" / 月", can.onimport.titleAction(can, value)]},
|
||||
{view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value), value.user_name]},
|
||||
{view: html.OUTPUT, list: [value.content]},
|
||||
] })
|
||||
},
|
||||
})
|
@ -1,54 +0,0 @@
|
||||
package gonganxitong
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"shylinux.com/x/ice"
|
||||
"shylinux.com/x/icebergs/base/aaa"
|
||||
"shylinux.com/x/icebergs/base/mdb"
|
||||
"shylinux.com/x/icebergs/base/web"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
)
|
||||
|
||||
type grant struct {
|
||||
Tables
|
||||
sess sess
|
||||
confirm string `name:"confirm" role:"void"`
|
||||
list string `name:"list name auto" help:"扫码授权" role:"void"`
|
||||
}
|
||||
|
||||
func (s grant) List(m *ice.Message, arg ...string) {
|
||||
if m.Option(ice.FROM_DAEMON) == "" {
|
||||
m.EchoQRCode(m.MergePodCmd("", m.PrefixKey(), ice.FROM_DAEMON, m.Option(ice.MSG_DAEMON)))
|
||||
} else {
|
||||
m.EchoInfoButton("请授权登录", s.Confirm)
|
||||
}
|
||||
kit.If(m.IsTech(), func() { m.Action(s.Header) })
|
||||
}
|
||||
func (s grant) Header(m *ice.Message, arg ...string) {
|
||||
m.AddHeaderLogin(mdb.PLUGIN, "weixin", "微信扫码", "9")
|
||||
// m.Cmd(web.SPACE, ice.OPS, web.SERVE, ice.MAIN, s.PrefixPortal(m), m.Option(ice.MSG_USERPOD))
|
||||
}
|
||||
func (s grant) Confirm(m *ice.Message, arg ...string) {
|
||||
if m.WarnNotAllow(m.Option(ice.MSG_METHOD) == http.MethodGet) {
|
||||
return
|
||||
} else if m.WarnNotLogin(m.Option(ice.MSG_USERNAME) == "") || m.WarnNotValid(m.Option(ice.FROM_DAEMON) == "", ice.FROM_DAEMON) {
|
||||
return
|
||||
} else if msg := s.spaceInfo(m); m.WarnNotFound(msg.Append(mdb.TYPE) == "", m.Option(web.SPACE)) {
|
||||
return
|
||||
} else {
|
||||
m.Info("what %v", msg.FormatsMeta(nil))
|
||||
defer m.ProcessOpen(msg.Append(mdb.TEXT))
|
||||
m.Option(ice.MSG_USERIP, msg.Append(aaa.IP))
|
||||
m.Option(ice.MSG_USERUA, msg.Append(aaa.UA))
|
||||
msg := m.Cmd(s.sess, s.Create)
|
||||
m.Cmd(web.SPACE, m.Option(ice.FROM_DAEMON), ice.MSG_SESSID, msg.Option(ice.MSG_SESSID))
|
||||
m.Echo(ice.SUCCESS)
|
||||
}
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(grant{Tables: newTables()}) }
|
||||
|
||||
func (s grant) spaceInfo(m *ice.Message, arg ...string) *ice.Message {
|
||||
return m.Cmd(web.SPACE, kit.Keys(kit.Slice(kit.Split(m.Option(ice.FROM_DAEMON), "."), 0, -1)))
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
$output div.item.card div.output div.title {
|
||||
margin-top:10px;
|
||||
}
|
||||
$output div.item.card div.output {
|
||||
padding:20px 10px;
|
||||
}
|
@ -1,96 +0,0 @@
|
||||
package gonganxitong
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/community/src/gonganxitong/model"
|
||||
)
|
||||
|
||||
type market struct {
|
||||
Table
|
||||
domain domain
|
||||
command command
|
||||
service service
|
||||
thumb thumb
|
||||
comment comment
|
||||
favor favor
|
||||
order string `data:"901"`
|
||||
create string `name:"create domain_uid* title* content" role:"void"`
|
||||
remove string `name:"remove" role:"void"`
|
||||
thumbToggle string `name:"thumbToggle" role:"void"`
|
||||
commentCreate string `name:"commentCreate content*" role:"void"`
|
||||
favorToggle string `name:"favorToggle" role:"void"`
|
||||
shareCreate string `name:"shareCreate" role:"void"`
|
||||
}
|
||||
|
||||
func (s market) Create(m *ice.Message, arg ...string) {
|
||||
s.Insert(m, append(arg, m.OptionSimple(model.PLACE_UID, model.USER_UID, model.COMMAND_UID, model.ARGS)...)...)
|
||||
}
|
||||
func (s market) List(m *ice.Message, arg ...string) {
|
||||
s.Tables(m, s.command, s.service, s.LeftJoinValue(m, s.thumb, s), s.LeftJoinValue(m, s.favor, s)).FieldsWithCreatedAT(m, s,
|
||||
s.Key(s, model.USER_UID), model.PLACE_UID, model.SERVICE_NAME, model.TITLE, model.CONTENT,
|
||||
model.THUMB_COUNT, model.COMMENT_COUNT, model.FAVOR_COUNT, model.SHARE_COUNT, model.THUMB_STATUS, model.FAVOR_STATUS,
|
||||
s.AS(model.NODENAME, model.SPACE), s.Key(s.command, model.INDEX), model.ARGS,
|
||||
model.COMMAND_NAME,
|
||||
)
|
||||
if len(arg) < 2 {
|
||||
if m.Option(model.DOMAIN_UID) != "" {
|
||||
s.Select(m, m.OptionSimple(model.DOMAIN_UID)...)
|
||||
} else {
|
||||
s.Select(m)
|
||||
}
|
||||
m.Action()
|
||||
} else if len(arg) == 2 {
|
||||
msg := s.Select(m.Spawn(), s.Key(s, model.UID), arg[1])
|
||||
s.ProcessPodCmd(m, msg, model.MARKET_UID, arg[1])
|
||||
} else {
|
||||
return
|
||||
}
|
||||
s.SelectJoinRecent(m, model.PLACE_UID)
|
||||
s.SelectJoinUser(m, model.NAME, model.AVATAR, model.AUTH_UID)
|
||||
s.SelectJoinAuth(m)
|
||||
s.DisplayBase(m, "").DisplayCSS("")
|
||||
}
|
||||
func (s market) ThumbToggle(m *ice.Message, arg ...string) {
|
||||
m.OptionDefault(model.MARKET_UID, m.Option(model.UID))
|
||||
if kit.Int(m.Cmdx(s.thumb, s.thumb.Toggle))%2 == 1 {
|
||||
s.AddCount(m, model.THUMB_COUNT, "1")
|
||||
} else {
|
||||
s.AddCount(m, model.THUMB_COUNT, "-1")
|
||||
}
|
||||
}
|
||||
func (s market) CommentCreate(m *ice.Message, arg ...string) {
|
||||
m.OptionDefault(model.MARKET_UID, m.Option(model.UID))
|
||||
m.Cmd(s.comment, s.Insert, arg)
|
||||
s.AddCount(m, model.COMMENT_COUNT, "1")
|
||||
}
|
||||
func (s market) FavorToggle(m *ice.Message, arg ...string) {
|
||||
m.OptionDefault(model.MARKET_UID, m.Option(model.UID))
|
||||
if kit.Int(m.Cmdx(s.favor, s.favor.Toggle))%2 == 1 {
|
||||
s.AddCount(m, model.FAVOR_COUNT, "1")
|
||||
} else {
|
||||
s.AddCount(m, model.FAVOR_COUNT, "-1")
|
||||
}
|
||||
}
|
||||
func (s market) ShareCreate(m *ice.Message, arg ...string) {
|
||||
s.AddCount(m, model.SHARE_COUNT, "1")
|
||||
}
|
||||
func (s market) PlaceEnter(m *ice.Message, arg ...string) {
|
||||
// m.ProcessField()
|
||||
}
|
||||
func (s market) PlaceInfo(m *ice.Message, arg ...string) {
|
||||
s.Tables(m, s.command, s.service, s.LeftJoinValue(m, s.thumb, s), s.LeftJoinValue(m, s.favor, s)).FieldsWithCreatedAT(m, s,
|
||||
s.Key(s, model.USER_UID), model.PLACE_UID, model.SERVICE_NAME, model.TITLE, model.CONTENT,
|
||||
model.THUMB_COUNT, model.COMMENT_COUNT, model.FAVOR_COUNT, model.SHARE_COUNT, model.THUMB_STATUS, model.FAVOR_STATUS,
|
||||
s.AS(model.NODENAME, model.SPACE), s.Key(s.command, model.INDEX), model.ARGS,
|
||||
model.COMMAND_NAME,
|
||||
)
|
||||
s.Select(m, s.Key(s, model.UID), m.Option(model.MARKET_UID))
|
||||
s.SelectJoinRecent(m, model.PLACE_UID)
|
||||
s.SelectJoinUser(m, model.NAME, model.AVATAR, model.AUTH_UID)
|
||||
s.SelectJoinAuth(m)
|
||||
m.PushAction(s.MarketPlaceEnter)
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(market{Table: newTable()}) }
|
@ -1,47 +0,0 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) { can.ui = can.page.Append(can, can._output, [html.TABS, html.LIST])
|
||||
can.runAction({}, ctx.RUN, ["web.team.gonganxitong.domain"], function(msg) { var domain_uid = can.misc.Cookie(can, "domain_uid")
|
||||
can.page.Append(can, can.ui.tabs, [{view: [[html.ITEM, domain_uid? "": html.SELECT], "", "全部"], onclick: function(event) { can.misc.Cookie(can, "domain_uid", "")
|
||||
can.onmotion.select(can, can.ui.tabs, html.DIV_ITEM, event.target), can.run(event, [], function(msg) { can.onimport._data(can, msg) })
|
||||
}}])
|
||||
can.page.Append(can, can.ui.tabs, msg.Table(function(value) {
|
||||
return {view: [[html.ITEM, value.domain_uid == domain_uid? html.SELECT: ""], "", value.name], onclick: function(event) { can.misc.Cookie(can, "domain_uid", value.domain_uid)
|
||||
can.onmotion.select(can, can.ui.tabs, html.DIV_ITEM, event.target), can.run(event, [], function(msg) { can.onimport._data(can, msg) })
|
||||
}}
|
||||
}))
|
||||
}), can.onimport._data(can, msg)
|
||||
},
|
||||
_data: function(can, msg) { can.onmotion.clear(can, can.ui.list)
|
||||
can.onimport.itemcards(can, msg, function(value) { return [
|
||||
{view: html.STATUS, list: [
|
||||
{text: [value.user_name, "", aaa.USERNAME]}, can.onimport.authView(can, value), can.onimport.timeView(can, value),
|
||||
]},
|
||||
{view: html.STATUS, list: [
|
||||
{text: [value.city_name, "", "city"]},
|
||||
{text: [value.street_name, "", "street"]},
|
||||
{text: [value.place_name, "", "place"]},
|
||||
{text: [value.service_name, "", "service"]},
|
||||
]},
|
||||
{view: html.TITLE, list: [value.command_name, value.title]},
|
||||
{view: html.OUTPUT, list: [value.content]},
|
||||
{view: html.ACTION, list: [
|
||||
{view: html.ITEM, list: [{icon: "bi bi-hand-thumbs-up"}, {text: value.thumb_count||"点赞"}], onclick: function(event) {
|
||||
can.onimport.thumbs(event, can, value, "thumbToggle")
|
||||
}, className: value.thumb_status%2==1? "done": ""},
|
||||
{view: html.ITEM, list: [{icon: "bi bi-chat-left-text"}, {text: value.comment_count||"评论"}], onclick: function(event) {
|
||||
can.onimport.thumbs(event, can, value, "commentCreate")
|
||||
}},
|
||||
{view: html.ITEM, list: [{icon: "bi bi-star"}, {text: value.favor_count||"收藏"}], onclick: function(event) {
|
||||
can.onimport.thumbs(event, can, value, "favorToggle")
|
||||
}, className: value.favor_status%2==1? "done": ""},
|
||||
{view: html.ITEM, list: [{icon: "bi bi-box-arrow-up"}, {text: value.share_count||"分享"}], onclick: function(event) {
|
||||
can.onimport.thumbs(event, can, value, "shareCreate")
|
||||
}},
|
||||
]},
|
||||
] })
|
||||
},
|
||||
thumbs: function(event, can, value, button) { can.onkeymap.prevent(event)
|
||||
var target = can.page.SelectOne(can, event.currentTarget, html.SPAN)
|
||||
can.runAction(can.request(event, value), button, [], function(msg) { target.innerHTML = msg.Result() })
|
||||
},
|
||||
})
|
@ -1,16 +0,0 @@
|
||||
$fieldset.detail { margin-top:0 !important; height:100%; }
|
||||
$output.detail { background-color:#646566 !important; text-align:center; height:100% !important; }
|
||||
$output.detail div.detail { border-radius:10px; background-color:var(--output-bg-color); padding:10px 10px 40px; margin:80px auto 10px; max-width:360px; position:relative; }
|
||||
$output.detail div.title { font-size:20px; }
|
||||
$output.detail div.meeting_code { font-size:18px; margin:10px; }
|
||||
$output.detail div.status { color:var(--notice-bg-color); }
|
||||
$output.detail div.time { border-bottom:dashed 1px gray; font-size:24px; white-space:pre; padding-bottom:20px; display:flex; justify-content:space-around; align-items: center; }
|
||||
$output.detail div.span_time { color:gray; font-size:12px; }
|
||||
$output.detail div.span_time div.zone { margin-top:5px; }
|
||||
$output.detail div.date { color:gray; font-size:12px; margin-top:5px; }
|
||||
$output.detail img.qrcode { width:200px !important; }
|
||||
$output.detail div.logo { background-color:white; position:absolute; padding:3px 3px 0; bottom:calc(170px - 23px); left: calc(50% - 23px); }
|
||||
$output.detail div.logo img { height:40px; }
|
||||
$output.detail div.action input { border:var(--box-notice); background-color:var(--notice-bg-color); color:var(--notice-fg-color); font-size:18px; height:40px; width:100%; max-width:360px; }
|
||||
body.dark $output.detail { background-color:#33363a !important; }
|
||||
body.width1 $output.detail img.qrcode { border:var(--box-border); border-radius:5px; margin:40px; margin-bottom:10px; }
|
@ -1,68 +0,0 @@
|
||||
package gonganxitong
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
|
||||
"shylinux.com/x/community/src/gonganxitong/model"
|
||||
)
|
||||
|
||||
type meeting struct {
|
||||
Table
|
||||
order string `data:"93"`
|
||||
auth string `data:"issued"`
|
||||
role string `data:"leader,worker"`
|
||||
fields string `data:"user_id,vendor"`
|
||||
config string `name:"config place_uid* user_uid* user_id* vendor*"`
|
||||
create string `name:"create subject* start_time*:select@date end_time*:select@date" role:"worker"`
|
||||
modify string `name:"modify subject* start_time*:select@date end_time*:select@date" role:"worker"`
|
||||
cancel string `name:"cancel" role:"worker"`
|
||||
enter string `name:"enter" help:"入会" style:"notice" role:"worker"`
|
||||
}
|
||||
|
||||
func (s meeting) Config(m *ice.Message, arg ...string) {
|
||||
s.InsertOrUpdate(m, arg, m.OptionSimple(model.PLACE_UID)...)
|
||||
}
|
||||
func (s meeting) Create(m *ice.Message, arg ...string) { s.cmdy(m, s.MeetingPost, arg...) }
|
||||
func (s meeting) Modify(m *ice.Message, arg ...string) { s.cmdy(m, s.MeetingPut, arg...) }
|
||||
func (s meeting) Cancel(m *ice.Message, arg ...string) { s.cmdy(m, s.MeetingCancel, arg...) }
|
||||
func (s meeting) Enter(m *ice.Message, arg ...string) { m.ProcessOpen(m.Option(model.LINK)) }
|
||||
func (s meeting) List(m *ice.Message, arg ...string) {
|
||||
if s.cmdy(m, s.MeetingList, arg[1:]...); m.Length() > 0 {
|
||||
if len(arg) == 1 {
|
||||
m.PushAction(s.Enter, s.Modify, s.Cancel).Action(s.Create).Display("").DisplayCSS("")
|
||||
s.SpendlistCheck(m, 0)
|
||||
} else if m.IsMobileUA() {
|
||||
m.EchoQRCode(m.Append(model.LINK)).Display("").DisplayCSS("")
|
||||
} else {
|
||||
m.EchoQRCode(m.Append(model.LINK)).Display("").DisplayCSS("")
|
||||
// m.EchoIFrame(m.Append(model.LINK)).SetAppend()
|
||||
}
|
||||
}
|
||||
}
|
||||
func (s meeting) MeetingList(m *ice.Message, arg ...string) {}
|
||||
func (s meeting) MeetingPost(m *ice.Message, arg ...string) {}
|
||||
func (s meeting) MeetingPut(m *ice.Message, arg ...string) {}
|
||||
func (s meeting) MeetingCancel(m *ice.Message, arg ...string) {}
|
||||
|
||||
func init() { ice.TeamCtxCmd(meeting{Table: newTable()}) }
|
||||
|
||||
var MeetingVendor interface {
|
||||
UserList(m *ice.Message, arg ...string) *ice.Message
|
||||
MeetingList(m *ice.Message, arg ...string) *ice.Message
|
||||
MeetingPost(m *ice.Message, arg ...string) *ice.Message
|
||||
MeetingPut(m *ice.Message, arg ...string) *ice.Message
|
||||
MeetingCancel(m *ice.Message, arg ...string) *ice.Message
|
||||
}
|
||||
|
||||
func (s meeting) cmdy(m *ice.Message, action ice.Any, arg ...string) {
|
||||
if m.Option(model.AUTH_UID, s.StreetAuthUID(m, m.Option(model.PLACE_UID))) == "" {
|
||||
return
|
||||
}
|
||||
msg := s.Select(m.Spawn(), m.OptionSimple(model.PLACE_UID)...)
|
||||
if msg.Append(model.VENDOR) == "" {
|
||||
m.Echo("本服务暂未配置,请联系公司管理员配置")
|
||||
return
|
||||
} else {
|
||||
m.Cmdy(msg.Append(model.VENDOR), action, arg)
|
||||
}
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) { can.page.ClassList.del(can, can._fields, "detail"), can.page.ClassList.del(can, can._output, "detail")
|
||||
if (can.Option(UID)) { can.page.ClassList.add(can, can._fields, "detail"), can.page.ClassList.add(can, can._target, "detail")
|
||||
var start_time = msg.Append("start_time").split(" "), end_time = msg.Append("end_time").split(" ")
|
||||
can.ui = can.page.Append(can, can._output, [
|
||||
{view: "detail", list: [
|
||||
{view: ["title", "", msg.Append("subject")]},
|
||||
{view: ["meeting_code", "", msg.Append(UID)]},
|
||||
{view: ["status", "", "待开始"]},
|
||||
{view: "time", list: [
|
||||
{view: "start_time", list: [{view: ["hour", "", start_time[1]]}, {view: ["date", "", start_time[0]]}]},
|
||||
{view: ["span_time"], list: [{view: ["span", "", msg.Append("span_time")]}, {view: ["zone", "", "(GMT+08:00)"]}]},
|
||||
{view: "end_time", list: [{view: ["hour", "", end_time[1]]}, {view: ["date", "", end_time[0]]}]},
|
||||
]},
|
||||
{view: ["qrcode", "", msg.Result()]},
|
||||
{view: ["logo"], list: [{img: "https://meeting.tencent.com/static/imgs/detail/qrcode_icon2x.png"}]},
|
||||
{view: ["tips", "", "请使用手机端【腾讯会议App】扫码入会"]},
|
||||
]},
|
||||
{view: "action", list: [
|
||||
{type: html.INPUT, data: {type: html.BUTTON}, name: "join", value: "入会", onclick: function(event) {
|
||||
can.runAction(can.request(event, msg.Table()[0]), "join")
|
||||
}},
|
||||
]},
|
||||
])
|
||||
msg.Option("_share_title", msg.Append("subject"))
|
||||
msg.Option("_share_content", [msg.Append(UID), msg.Append("start_time")].join("\n"))
|
||||
} else {
|
||||
can.onimport.myView(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.subject, can.onimport.titleAction(can, value)]},
|
||||
{view: html.STATUS, list: [value.start_time, "~", value.end_time.split(" ")[1]]},
|
||||
] })
|
||||
}
|
||||
},
|
||||
})
|
@ -1,2 +0,0 @@
|
||||
body.width1 $output>div.item.myself div.title span { font-weight:bold; }
|
||||
body.width1 $output>div.item.card div.title span.role { margin-left:auto; }
|
@ -2,59 +2,18 @@ package gonganxitong
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
"shylinux.com/x/icebergs/base/web/html"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/community/src/gonganxitong/model"
|
||||
)
|
||||
|
||||
type member struct {
|
||||
Tables
|
||||
user user
|
||||
order string `data:"102"`
|
||||
role string `data:"leader,worker,server"`
|
||||
remove string `name:"remove" role:"void"`
|
||||
enable string `name:"enable" role:"void"`
|
||||
disable string `name:"disable" role:"void"`
|
||||
promote string `name:"promote" role:"void"`
|
||||
demote string `name:"demote" role:"void"`
|
||||
user user
|
||||
order string `data:"80"`
|
||||
}
|
||||
|
||||
func (s member) Remove(m *ice.Message, arg ...string) {
|
||||
if s.IsLeader(m) {
|
||||
m.Cmdy(s.UserPlace, s.Delete, s.option(m, model.ROLE, kit.Format(UserPlaceTenant), model.STATUS, kit.Format(MemberDisabled)))
|
||||
s.recordEvent(m, "❌", m.Trans("remove member", "删除成员"), html.DANGER)
|
||||
}
|
||||
}
|
||||
func (s member) Disable(m *ice.Message, arg ...string) {
|
||||
if s.IsLeader(m) {
|
||||
m.Cmdy(s.UserPlace, s.UpdateField, model.STATUS, MemberDisabled, s.option(m, model.ROLE, kit.Format(UserPlaceTenant)))
|
||||
s.recordEvent(m, "❌", m.Trans("disable member", "禁用成员"), html.DANGER)
|
||||
}
|
||||
}
|
||||
func (s member) Demote(m *ice.Message, arg ...string) {
|
||||
if s.IsCreator(m) {
|
||||
m.Cmdy(s.UserPlace, s.UpdateField, model.ROLE, kit.Format(UserPlaceTenant), s.option(m))
|
||||
s.recordEvent(m, "❌", m.Trans("demote worker", "降级成为工作人员"), html.DANGER)
|
||||
}
|
||||
}
|
||||
func (s member) Promote(m *ice.Message, arg ...string) {
|
||||
if s.IsCreator(m) {
|
||||
m.Cmdy(s.UserPlace, s.UpdateField, model.ROLE, kit.Format(UserPlaceLandlord), s.option(m))
|
||||
s.recordEvent(m, "✅", m.Trans("promote leader", "升级成为管理人员"), html.NOTICE)
|
||||
}
|
||||
}
|
||||
func (s member) Enable(m *ice.Message, arg ...string) {
|
||||
if s.IsLeader(m) {
|
||||
m.Cmdy(s.UserPlace, s.UpdateField, model.STATUS, MemberNormal, s.option(m, model.ROLE, kit.Format(UserPlaceTenant)))
|
||||
s.recordEvent(m, "✅", m.Trans("enable member", "启用成员"), html.NOTICE)
|
||||
}
|
||||
}
|
||||
func (s member) List(m *ice.Message, arg ...string) {
|
||||
USER_PLACE_ROLE := s.Keys(s.UserPlace, model.ROLE)
|
||||
s.Limit(m, 1000)
|
||||
user_uid, isLeader, isCreator := m.Option(model.USER_UID), s.IsLeader(m), s.IsCreator(m)
|
||||
s.FieldsWithCreatedAT(m, s.UserPlace, model.USER_UID, s.Keys(s.UserPlace, model.ROLE), s.AS(s.Key(s.UserPlace, model.STATUS), model.MEMBER_STATUS))
|
||||
s.Table.FieldsWithCreatedAT(m, s.UserPlace, model.USER_UID, s.Keys(s.UserPlace, model.ROLE))
|
||||
if len(arg) == 1 {
|
||||
m.Cmdy(s.UserPlace, s.Select, s.Keys(s.Place, model.UID), arg[0]).Action()
|
||||
} else if len(arg) == 2 {
|
||||
@ -62,86 +21,7 @@ func (s member) List(m *ice.Message, arg ...string) {
|
||||
} else {
|
||||
return
|
||||
}
|
||||
defer m.Sort(kit.Fields(model.MEMBER_STATUS, USER_PLACE_ROLE, "auth_status", model.CREATED_AT))
|
||||
m.Table(func(value ice.Maps) {
|
||||
if !m.FieldsIsDetail() {
|
||||
if user_uid == value[model.USER_UID] {
|
||||
m.Push("who", "myself")
|
||||
} else {
|
||||
m.Push("who", "")
|
||||
}
|
||||
}
|
||||
button := []ice.Any{}
|
||||
if MemberStatus(kit.Int(value[model.MEMBER_STATUS])) == MemberNormal {
|
||||
if isCreator {
|
||||
switch kit.Int(value[USER_PLACE_ROLE]) {
|
||||
case 2:
|
||||
button = append(button, s.Demote)
|
||||
case 3:
|
||||
button = append(button, s.Promote)
|
||||
}
|
||||
}
|
||||
if isLeader {
|
||||
switch kit.Int(value[USER_PLACE_ROLE]) {
|
||||
case 3:
|
||||
button = append(button, s.Disable)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if isCreator {
|
||||
button = append(button, s.Enable, s.Remove)
|
||||
} else if isLeader {
|
||||
switch kit.Int(value[USER_PLACE_ROLE]) {
|
||||
case 3:
|
||||
button = append(button, s.Enable, s.Remove)
|
||||
}
|
||||
}
|
||||
}
|
||||
m.PushButton(button...)
|
||||
})
|
||||
s.SelectJoinUser(m, model.NAME, model.INFO, model.AVATAR, model.AUTH_UID)
|
||||
s.SelectJoinAuth(m)
|
||||
s.DisplayBase(m, "").DisplayCSS("")
|
||||
m.Echo("count: %d", m.Length())
|
||||
s.SelectJoinUser(m)
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(member{Tables: newTables()}) }
|
||||
|
||||
func (s member) option(m *ice.Message, arg ...string) []string {
|
||||
return kit.Simple(m.OptionSimple(s.Keys(s.Place, model.UID), model.UID), arg)
|
||||
}
|
||||
func (s member) recordEvent(m *ice.Message, icon, title, style string, arg ...string) {
|
||||
s.RecordEvent(m, kit.JoinWord(icon, title, kit.Cut(m.Option(model.UID), 6), s.TransRole(m, "", style), m.Option(model.USER_NAME)), m.Option(model.UID))
|
||||
}
|
||||
|
||||
type MemberStatus int
|
||||
|
||||
const (
|
||||
MemberNormal MemberStatus = iota
|
||||
MemberDisabled
|
||||
)
|
||||
|
||||
var MemberStatusList = map[MemberStatus]string{
|
||||
MemberNormal: "normal",
|
||||
MemberDisabled: "disabled",
|
||||
}
|
||||
|
||||
func (s MemberStatus) String() string { return MemberStatusList[s] }
|
||||
|
||||
type AuthStatus int
|
||||
|
||||
const (
|
||||
AuthCreate AuthStatus = iota
|
||||
AuthRequest
|
||||
AuthIssued
|
||||
AuthRevoked
|
||||
)
|
||||
|
||||
var AuthStatusList = map[AuthStatus]string{
|
||||
AuthCreate: "create",
|
||||
AuthRequest: "request",
|
||||
AuthIssued: "issued",
|
||||
AuthRevoked: "revoked",
|
||||
}
|
||||
|
||||
func (s AuthStatus) String() string { return AuthStatusList[s] }
|
||||
|
@ -1,16 +0,0 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) { var USER_PLACE_ROLE = msg.Option("_user_place_role")
|
||||
if (msg.IsDetail()) { msg.Option("_share_title", msg.Append("user_name")) }
|
||||
can.onimport.myView(can, msg, function(value) { value._style = [value.who, value.member_status]
|
||||
return [
|
||||
{view: html.TITLE, list: [value.user_name,
|
||||
can.onimport.authView(can, value), can.onimport.textView(can, value, USER_PLACE_ROLE),
|
||||
value.member_status != "normal" && can.onimport.textView(can, value, "member_status"),
|
||||
// can.onimport.titleAction(can, value),
|
||||
]},
|
||||
{view: html.STATUS, list: [value.auth_info||value.user_info]},
|
||||
can.onimport.titleAction(can, value),
|
||||
]
|
||||
})
|
||||
},
|
||||
})
|
Before Width: | Height: | Size: 5.5 KiB |
@ -2,6 +2,9 @@ package gonganxitong
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
"shylinux.com/x/icebergs/base/ctx"
|
||||
"shylinux.com/x/icebergs/base/web"
|
||||
"shylinux.com/x/icebergs/base/web/html"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/community/src/gonganxitong/model"
|
||||
@ -11,41 +14,22 @@ type message struct {
|
||||
Table
|
||||
command command
|
||||
service service
|
||||
order string `data:"902"`
|
||||
create string `name:"create from_user_uid to_user_uid"`
|
||||
remove string `name:"remove" role:"void"`
|
||||
order string `data:"100"`
|
||||
read string `name:"read" role:"void"`
|
||||
done string `name:"done" role:"void"`
|
||||
sticky string `name:"sticky" role:"void"`
|
||||
unSticky string `name:"unSticky" role:"void"`
|
||||
}
|
||||
|
||||
func (s message) Create(m *ice.Message, arg ...string) {
|
||||
arg = append(arg, model.PLACE_UID, m.Option(s.Keys(s.Place, model.UID)))
|
||||
kit.If(m.Option(model.ARGS) == "", func() {
|
||||
arg = append(arg, model.ARGS, kit.JoinFields(m.Option(s.Keys(s.Place, model.UID)), m.Option(model.UID)))
|
||||
})
|
||||
s.Insert(m, arg...)
|
||||
}
|
||||
func (s message) Remove(m *ice.Message, arg ...string) {
|
||||
s.Delete(m, arg...)
|
||||
}
|
||||
func (s message) List(m *ice.Message, arg ...string) {
|
||||
s.Tables(m, s.command, s.service).FieldsWithCreatedAT(m, s,
|
||||
model.FROM_USER_UID, model.COMMAND_NAME, model.MESSAGE_STATUS, model.SCORE,
|
||||
model.PLACE_UID, model.SERVICE_NAME,
|
||||
s.AS(model.NODENAME, model.SPACE), s.Key(s.command, model.INDEX), model.ARGS,
|
||||
model.TITLE, model.CONTENT,
|
||||
model.FROM_USER_UID, s.Key(s, model.PLACE_NAME), s.Key(s.command, model.NAME), model.SCORE, model.MESSAGE_STATUS,
|
||||
s.AS(model.NODENAME, model.SPACE), s.Key(s.command, model.INDEX), model.OPERATE, model.ARGS,
|
||||
s.Key(s, model.CITY_NAME), s.Key(s, model.STREET_NAME), model.SERVICE_NAME,
|
||||
)
|
||||
if len(arg) < 2 {
|
||||
args := []string{model.TO_USER_UID, m.Option(model.USER_UID)}
|
||||
kit.If(m.Option(model.MESSAGE_STATUS), func(p string) {
|
||||
for i, v := range MessageStatusList {
|
||||
kit.If(v == p, func() { args = append(args, model.STATUS, kit.Format(i)) })
|
||||
}
|
||||
})
|
||||
s.Orders(m, s.Desc(model.SCORE), s.Desc(model.CREATED_AT))
|
||||
s.Select(m, args...).Table(func(value ice.Maps) {
|
||||
s.Select(m, model.TO_USER_UID, m.Option(model.USER_UID)).Table(func(value ice.Maps) {
|
||||
button := []ice.Any{}
|
||||
if value[model.SCORE] == "0" {
|
||||
button = append(button, s.Sticky)
|
||||
@ -63,24 +47,21 @@ func (s message) List(m *ice.Message, arg ...string) {
|
||||
m.PushButton(button...)
|
||||
}).Action()
|
||||
m.RenameAppend(model.FROM_USER_UID, model.USER_UID)
|
||||
s.SelectJoinRecent(m, model.PLACE_UID)
|
||||
// s.SelectJoinUser(m)
|
||||
s.SelectJoinUser(m)
|
||||
s.DisplayBase(m, "")
|
||||
|
||||
msg := m.Spawn()
|
||||
s.Fields(msg, "status, count(*) AS count").Groups(msg, model.STATUS).Orders(msg, model.STATUS)
|
||||
s.Select(msg, args...).Table(func(value ice.Maps) {
|
||||
switch status := kit.Int(value[model.STATUS]); m.CommandKey() {
|
||||
default:
|
||||
m.Echo(MessageStatus(status).String()).Echo(": ")
|
||||
m.Echo(value[model.COUNT]).Echo("\n")
|
||||
}
|
||||
})
|
||||
|
||||
} else if len(arg) == 2 {
|
||||
msg := s.SelectDetail(m.Spawn(), model.TO_USER_UID, m.Option(model.USER_UID), s.Key(s, model.UID), arg[1])
|
||||
s.ProcessPodCmd(m, msg, model.MESSAGE_UID, arg[1])
|
||||
if MessageStatus(kit.Int(msg.Append(model.STATUS))) == MessageCreate {
|
||||
m.ProcessPodCmd(msg.Append(web.SPACE), msg.Append(ctx.INDEX), kit.Split(msg.Append(ctx.ARGS)))
|
||||
m.RewriteAppend(func(value, key string, index int) string {
|
||||
kit.If(key == ctx.STYLE, func() { value = html.OUTPUT })
|
||||
kit.If(key == web.SPACE, func() { value = m.Appendv("_space")[index] })
|
||||
return value
|
||||
})
|
||||
if m.Append(web.SPACE) != "" {
|
||||
m.Optionv(ice.FIELD_PREFIX, ctx.ACTION, ctx.RUN, kit.Join(kit.Slice(kit.Split(msg.Append(ctx.INDEX), "."), 0, -1), ".")+".portal", ctx.ACTION, ctx.RUN, msg.Append(ctx.INDEX))
|
||||
}
|
||||
m.Option("field.option", kit.Format(kit.Dict(model.MESSAGE_UID, arg[1])))
|
||||
if m.Option(model.MESSAGE_STATUS) == MessageCreate.String() {
|
||||
s.update(m.Spawn(kit.Dict(model.UID, arg[1])), kit.Dict(model.STATUS, MessageRead), model.STATUS, MessageCreate)
|
||||
}
|
||||
}
|
||||
@ -97,30 +78,12 @@ func (s message) Sticky(m *ice.Message, arg ...string) {
|
||||
func (s message) UnSticky(m *ice.Message, arg ...string) {
|
||||
s.update(m, ice.Map{model.SCORE: 0})
|
||||
}
|
||||
func (s message) PlaceEnter(m *ice.Message, arg ...string) {
|
||||
// m.ProcessField()
|
||||
}
|
||||
func (s message) PlaceInfo(m *ice.Message, arg ...string) {
|
||||
s.Tables(m, s.command, s.service).FieldsWithCreatedAT(m, s,
|
||||
model.FROM_USER_UID, model.COMMAND_NAME, model.MESSAGE_STATUS, model.SCORE,
|
||||
model.PLACE_UID, model.SERVICE_NAME,
|
||||
s.AS(model.NODENAME, model.SPACE), s.Key(s.command, model.INDEX), model.ARGS,
|
||||
model.TITLE, model.CONTENT,
|
||||
)
|
||||
s.Select(m, s.Key(s, model.UID), m.Option(model.MESSAGE_UID))
|
||||
m.RenameAppend(model.FROM_USER_UID, model.USER_UID)
|
||||
s.SelectJoinRecent(m, model.PLACE_UID)
|
||||
s.SelectJoinUser(m, model.NAME, model.AVATAR, model.AUTH_UID)
|
||||
s.SelectJoinAuth(m)
|
||||
m.PushAction(s.MessagePlaceEnter)
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(message{Table: newTable()}) }
|
||||
|
||||
func (s message) update(m *ice.Message, data ice.Map, arg ...ice.Any) {
|
||||
s.Table.Update(m, data, kit.Simple(model.TO_USER_UID, m.Option(model.USER_UID), m.OptionSimple(model.UID), arg)...)
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(message{}) }
|
||||
|
||||
type MessageStatus int
|
||||
|
||||
const (
|
||||
|
@ -1,20 +1,17 @@
|
||||
var MESSAGE_STATUS = "message_status"
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.onimport.myTabs(can, MESSAGE_STATUS, ["all", "create", "read", "done"])
|
||||
can.onimport.myView(can, msg, function(value) { var args = can.core.Split(value.args)
|
||||
value.icons = value.user_avatar||value.icons; if (value.score > 0) { value._style = ["sticky"] }
|
||||
if (msg.IsDetail()) { var value = msg.TableDetail(); msg.Option("_share_title", value.place_name+" "+value.name) }
|
||||
can.onimport.itemcards(can, msg, function(value) { var args = can.core.Split(value.args)
|
||||
value.icons = value.user_avatar||value.icon; if (value.score > 0) { value._style = ["sticky"] }
|
||||
return [
|
||||
{view: html.TITLE, list: [
|
||||
value.command_name, value.title, can.onimport.textView(can, value),
|
||||
]},
|
||||
{view: html.STATUS, list: [
|
||||
value.detail||(args[1]||"").slice(0, 6),
|
||||
can.onimport.timeView(can, value), value.user_name,
|
||||
]},
|
||||
{view: html.STATUS, list: [value.city_name, value.street_name, value.place_name, value.service_name]},
|
||||
{view: html.OUTPUT, list: [value.content]},
|
||||
{view: html.TITLE, list: [value.place_name, value.name, (args[1]||"").slice(0, 6), value.message_status != "done" && can.onimport.textView(can, value, "message_status", mdb.STATUS)]},
|
||||
{view: html.STATUS, list: [value.city_name, value.street_name, value.service_name]},
|
||||
{view: html.STATUS, list: [can.base.TimeTrim(value.created_at), value.user_name]},
|
||||
value.info && {view: html.OUTPUT, list: [value.info]},
|
||||
]
|
||||
}, function(event, value) { var args = can.core.Split(value.args)[1]||""
|
||||
can.onexport.title(can, [value.place_name, value.name, args.slice(0, 6)].join(" "))
|
||||
can.Option(UID, value.uid), can.Update(can.request(event, value))
|
||||
})
|
||||
},
|
||||
})
|
||||
})
|
@ -3,124 +3,70 @@ package model
|
||||
import "shylinux.com/x/mysql-story/src/db"
|
||||
|
||||
const (
|
||||
UID = "uid"
|
||||
NAME = "name"
|
||||
INFO = "info"
|
||||
TYPE = "type"
|
||||
ROLE = "role"
|
||||
STATUS = "status"
|
||||
TITLE = "title"
|
||||
CONTENT = "content"
|
||||
AVATAR = "avatar"
|
||||
BACKGROUND = "background"
|
||||
CREATED_AT = "created_at"
|
||||
UPDATED_AT = "updated_at"
|
||||
DELETED_AT = "deleted_at"
|
||||
USER_UID = "user_uid"
|
||||
USER_NAME = "user_name"
|
||||
USER_INFO = "user_info"
|
||||
USER_ROLE = "user_role"
|
||||
USER_AVATAR = "user_avatar"
|
||||
USER_BACKGROUND = "user_background"
|
||||
USER_PLACE_ROLE = "user_place_role"
|
||||
MEMBER_UID = "member_uid"
|
||||
MEMBER_STATUS = "member_status"
|
||||
PLACE_UID = "place_uid"
|
||||
PLACE_NAME = "place_name"
|
||||
PLACE_TYPE = "place_type"
|
||||
PLACE_INIT = "place_init"
|
||||
PLACE_ADDRESS = "place_address"
|
||||
STREET_UID = "street_uid"
|
||||
STREET_NAME = "street_name"
|
||||
STREET_INFO = "street_info"
|
||||
STREET_AVATAR = "street_avatar"
|
||||
STREET_BACKGROUND = "street_background"
|
||||
SCHOOL_NAME = "school_name"
|
||||
COMPANY_NAME = "company_name"
|
||||
CITY_UID = "city_uid"
|
||||
CITY_NAME = "city_name"
|
||||
CITY_INFO = "city_info"
|
||||
CITY_AVATAR = "city_avatar"
|
||||
CITY_BACKGROUND = "city_background"
|
||||
AUTH_UID = "auth_uid"
|
||||
AUTH_NAME = "auth_name"
|
||||
AUTH_INFO = "auth_info"
|
||||
AUTH_TYPE = "auth_type"
|
||||
AUTH_STATUS = "auth_status"
|
||||
AUTH_AVATAR = "auth_avatar"
|
||||
AUTH_BACKGROUND = "auth_background"
|
||||
PAYMENTLIST_STATUS = "paymentlist_status"
|
||||
DASHBOARD_UID = "dashboard_uid"
|
||||
DASHBOARD_NAME = "dashboard_name"
|
||||
DASHBOARD_TYPE = "dashboard_type"
|
||||
STORAGE_UID = "storage_uid"
|
||||
STORAGE_NAME = "storage_name"
|
||||
STORAGE_TYPE = "storage_type"
|
||||
QRCODE_TYPE = "qrcode_type"
|
||||
APPLY_UID = "apply_uid"
|
||||
APPLY_STATUS = "apply_status"
|
||||
ALLOW_UID = "allow_uid"
|
||||
ALLOW_STATUS = "allow_status"
|
||||
EVENT_UID = "event_uid"
|
||||
DOMAIN_UID = "domain_uid"
|
||||
DOMAIN_NAME = "domain_name"
|
||||
MARKET_UID = "market_uid"
|
||||
COMMAND_UID = "command_uid"
|
||||
COMMAND_ICON = "command_icon"
|
||||
COMMAND_NAME = "command_name"
|
||||
MESSAGE_UID = "message_uid"
|
||||
MESSAGE_STATUS = "message_status"
|
||||
SERVICE_UID = "service_uid"
|
||||
SERVICE_ICON = "service_icon"
|
||||
SERVICE_NAME = "service_name"
|
||||
SERVICE_TYPE = "service_type"
|
||||
SERVICE_STATUS = "service_status"
|
||||
THUMB_COUNT = "thumb_count"
|
||||
FAVOR_COUNT = "favor_count"
|
||||
COMMENT_COUNT = "comment_count"
|
||||
SHARE_COUNT = "share_count"
|
||||
THUMB_STATUS = "thumb_status"
|
||||
FAVOR_STATUS = "favor_status"
|
||||
FROM_UID = "from_uid"
|
||||
FROM_USER_UID = "from_user_uid"
|
||||
TO_USER_UID = "to_user_uid"
|
||||
BEGIN_TIME = "begin_time"
|
||||
END_TIME = "end_time"
|
||||
OPEN_ID = "open_id"
|
||||
USER_ID = "user_id"
|
||||
VENDOR = "vendor"
|
||||
PHONE = "phone"
|
||||
EMAIL = "email"
|
||||
ADDRESS = "address"
|
||||
PORTAL = "portal"
|
||||
PORTAL_NAME = "portal_name"
|
||||
NODE_NAME = "node_name"
|
||||
NODENAME = "nodename"
|
||||
NODETYPE = "nodetype"
|
||||
SPACE = "space"
|
||||
INDEX = "index"
|
||||
FIELD = "field"
|
||||
ICON = "icon"
|
||||
ARGS = "args"
|
||||
INIT = "init"
|
||||
QUERY = "query"
|
||||
VALUE = "value"
|
||||
SCORE = "score"
|
||||
LEVEL = "level"
|
||||
UNIT = "unit"
|
||||
LINK = "link"
|
||||
AMOUNT = "amount"
|
||||
ACCESS_TOKEN = "access_token"
|
||||
EXPIRE_TIME = "expire_time"
|
||||
PRICE = "price"
|
||||
TOTAL = "total"
|
||||
COUNT = "count"
|
||||
GOODSLIST_UID = "goodslist_uid"
|
||||
QUOTALIST_UID = "quotalist_uid"
|
||||
PAYMENTLIST_UID = "paymentlist_uid"
|
||||
SPENDLIST_UID = "spendlist_uid"
|
||||
SPACE_ID = "space_id"
|
||||
SIZE = "size"
|
||||
ID = "id"
|
||||
UID = "uid"
|
||||
NAME = "name"
|
||||
INFO = "info"
|
||||
TYPE = "type"
|
||||
ROLE = "role"
|
||||
STATUS = "status"
|
||||
TITLE = "title"
|
||||
CONTENT = "content"
|
||||
CREATOR = "creator"
|
||||
OPERATOR = "operator"
|
||||
CREATED_AT = "created_at"
|
||||
UPDATED_AT = "updated_at"
|
||||
DELETED_AT = "deleted_at"
|
||||
USER_UID = "user_uid"
|
||||
USER_NAME = "user_name"
|
||||
USER_AVATAR = "user_avatar"
|
||||
USER_PLACE_ROLE = "user_place_role"
|
||||
PLACE_UID = "place_uid"
|
||||
PLACE_NAME = "place_name"
|
||||
PLACE_TYPE = "place_type"
|
||||
PLACE_INIT = "place_init"
|
||||
PLACE_ADDRESS = "place_address"
|
||||
STREET_UID = "street_uid"
|
||||
STREET_NAME = "street_name"
|
||||
COMPANY_NAME = "company_name"
|
||||
CITY_UID = "city_uid"
|
||||
CITY_NAME = "city_name"
|
||||
AUTH_UID = "auth_uid"
|
||||
AUTH_NAME = "auth_name"
|
||||
AUTH_TYPE = "auth_type"
|
||||
AUTH_STATUS = "auth_status"
|
||||
QRCODE_TYPE = "qrcode_type"
|
||||
APPLY_UID = "apply_uid"
|
||||
APPLY_STATUS = "apply_status"
|
||||
ALLOW_UID = "allow_uid"
|
||||
ALLOW_STATUS = "allow_status"
|
||||
EVENT_UID = "event_uid"
|
||||
COMMAND_UID = "command_uid"
|
||||
MESSAGE_UID = "message_uid"
|
||||
MESSAGE_STATUS = "message_status"
|
||||
SERVICE_UID = "service_uid"
|
||||
SERVICE_ICON = "service_icon"
|
||||
SERVICE_NAME = "service_name"
|
||||
SERVICE_TYPE = "service_type"
|
||||
SERVICE_STATUS = "service_status"
|
||||
FROM_UID = "from_uid"
|
||||
FROM_USER_UID = "from_user_uid"
|
||||
TO_USER_UID = "to_user_uid"
|
||||
BEGIN_TIME = "begin_time"
|
||||
END_TIME = "end_time"
|
||||
OPEN_ID = "open_id"
|
||||
EMAIL = "email"
|
||||
AVATAR = "avatar"
|
||||
ADDRESS = "address"
|
||||
TABLES = "tables"
|
||||
SCORE = "score"
|
||||
NODE_NAME = "node_name"
|
||||
NODENAME = "nodename"
|
||||
SPACE = "space"
|
||||
OPERATE = "operate"
|
||||
INDEX = "index"
|
||||
ARGS = "args"
|
||||
INIT = "init"
|
||||
)
|
||||
|
||||
type Sess struct {
|
||||
@ -132,6 +78,8 @@ type Sess struct {
|
||||
type User struct {
|
||||
db.ModelWithAuth
|
||||
OpenID string `gorm:"type:char(32);index"`
|
||||
Avatar string `gorm:"type:varchar(255)"`
|
||||
Name string `gorm:"type:varchar(32)"`
|
||||
Email string `gorm:"type:varchar(64)"`
|
||||
}
|
||||
type UserPlace struct {
|
||||
@ -153,86 +101,6 @@ type City struct {
|
||||
Name string `gorm:"type:varchar(64);index"`
|
||||
}
|
||||
|
||||
type Goodslist struct {
|
||||
db.ModelWithUID
|
||||
PlaceUID string `gorm:"type:char(32);index"`
|
||||
UserUID string `gorm:"type:char(32)"`
|
||||
Name string `gorm:"type:varchar(32)"`
|
||||
Title string `gorm:"type:varchar(64)"`
|
||||
Content string `gorm:"type:varchar(128)"`
|
||||
Amount int `gorm:"default:0"`
|
||||
ExpireTime db.Time
|
||||
}
|
||||
type Paymentlist struct {
|
||||
db.ModelWithUID
|
||||
PlaceUID string `gorm:"type:char(32);index"`
|
||||
UserUID string `gorm:"type:char(32)"`
|
||||
GoodslistUID string `gorm:"type:char(32)"`
|
||||
VendorUID string `gorm:"type:char(32)"`
|
||||
Vendor string `gorm:"type:varchar(128)"`
|
||||
Title string `gorm:"type:varchar(128)"`
|
||||
Content string `gorm:"type:varchar(128)"`
|
||||
Amount int32 `gorm:"default:0"`
|
||||
Status uint8 `gorm:"default:0"`
|
||||
Type uint8 `gorm:"default:0"`
|
||||
}
|
||||
type Quotalist struct {
|
||||
db.ModelWithUID
|
||||
PlaceUID string `gorm:"type:char(32);index"`
|
||||
UserUID string `gorm:"type:char(32)"`
|
||||
GoodslistUID string `gorm:"type:char(32);index"`
|
||||
Title string `gorm:"type:varchar(64)"`
|
||||
Content string `gorm:"type:varchar(128)"`
|
||||
Vendor string `gorm:"type:varchar(128)"`
|
||||
Total int `gorm:"default:0"`
|
||||
}
|
||||
type Spendlist struct {
|
||||
db.ModelWithUID
|
||||
PlaceUID string `gorm:"type:char(32);index"`
|
||||
UserUID string `gorm:"type:char(32)"`
|
||||
PaymentlistUID string `gorm:"type:char(32);index"`
|
||||
QuotalistUID string `gorm:"type:char(32)"`
|
||||
Vendor string `gorm:"type:varchar(128)"`
|
||||
Total int `gorm:"default:0"`
|
||||
Count int `gorm:"default:0"`
|
||||
ExpireTime db.Time
|
||||
}
|
||||
type Meeting struct {
|
||||
db.ModelWithUID
|
||||
PlaceUID string `gorm:"type:char(32);index"`
|
||||
UserUID string `gorm:"type:char(32)"`
|
||||
Vendor string `gorm:"type:varchar(128)"`
|
||||
UserID string `gorm:"type:varchar(32)"`
|
||||
}
|
||||
type Document struct {
|
||||
db.ModelWithUID
|
||||
PlaceUID string `gorm:"type:char(32);index"`
|
||||
UserUID string `gorm:"type:char(32)"`
|
||||
FolderID string `gorm:"type:varchar(128)"`
|
||||
Vendor string `gorm:"type:varchar(128)"`
|
||||
}
|
||||
type Contract struct {
|
||||
db.ModelWithUID
|
||||
PlaceUID string `gorm:"type:char(32);index"`
|
||||
UserUID string `gorm:"type:char(32)"`
|
||||
}
|
||||
type Photo struct {
|
||||
db.ModelWithUID
|
||||
PlaceUID string `gorm:"type:char(32);index"`
|
||||
UserUID string `gorm:"type:char(32)"`
|
||||
SpaceID string `gorm:"type:varchar(128)"`
|
||||
AccessToken string `gorm:"type:varchar(512)"`
|
||||
Vendor string `gorm:"type:varchar(128)"`
|
||||
ExpireTime db.Time
|
||||
}
|
||||
|
||||
type Setting struct {
|
||||
db.ModelWithUID
|
||||
PlaceUID string `gorm:"type:char(32);index"`
|
||||
UserUID string `gorm:"type:char(32);index"`
|
||||
Name string `gorm:"type:varchar(64)"`
|
||||
Value string `gorm:"type:varchar(255)"`
|
||||
}
|
||||
type Apply struct {
|
||||
db.ModelWithUID
|
||||
PlaceUID string `gorm:"type:char(32);index:idx_place"`
|
||||
@ -244,85 +112,40 @@ type Apply struct {
|
||||
}
|
||||
type Allow struct {
|
||||
db.ModelWithUID
|
||||
ApplyUID string `gorm:"type:char(32)"`
|
||||
PlaceUID string `gorm:"type:char(32);index:idx_place"`
|
||||
UserUID string `gorm:"type:char(32);index:idx_place"`
|
||||
ApplyUID string `gorm:"type:char(32)"`
|
||||
Status uint8 `gorm:"default:0"`
|
||||
}
|
||||
type Event struct {
|
||||
db.ModelWithUID
|
||||
PlaceUID string `gorm:"type:char(32);index"`
|
||||
UserUID string `gorm:"type:char(32)"`
|
||||
Info string `gorm:"type:varchar(255)"`
|
||||
}
|
||||
type Notice struct {
|
||||
db.ModelContent
|
||||
PlaceUID string `gorm:"type:char(32);index"`
|
||||
UserUID string `gorm:"type:char(32)"`
|
||||
}
|
||||
|
||||
type Domain struct {
|
||||
db.ModelNameInfo
|
||||
Order int `gorm:"default:0"`
|
||||
}
|
||||
type Market struct {
|
||||
db.ModelContent
|
||||
DomainUID string `gorm:"type:char(32);index"`
|
||||
CommandUID string `gorm:"type:char(32)"`
|
||||
PlaceUID string `gorm:"type:char(32)"`
|
||||
Args string `gorm:"type:varchar(128)"`
|
||||
ThumbCount int `gorm:"default:0"`
|
||||
CommentCount int `gorm:"default:0"`
|
||||
FavorCount int `gorm:"default:0"`
|
||||
ShareCount int `gorm:"default:0"`
|
||||
}
|
||||
type Thumb struct {
|
||||
db.ModelWithUID
|
||||
MarketUID string `gorm:"type:char(32);index"`
|
||||
UserUID string `gorm:"type:char(32);index"`
|
||||
Status uint `gorm:"default:0"`
|
||||
}
|
||||
type Comment struct {
|
||||
db.ModelWithUID
|
||||
MarketUID string `gorm:"type:char(32);index"`
|
||||
UserUID string `gorm:"type:char(32);index"`
|
||||
FromUID string `gorm:"type:char(32)"`
|
||||
Content string
|
||||
}
|
||||
type Favor struct {
|
||||
db.ModelWithUID
|
||||
MarketUID string `gorm:"type:char(32);index"`
|
||||
UserUID string `gorm:"type:char(32);index"`
|
||||
Status uint `gorm:"default:0"`
|
||||
}
|
||||
type Command struct {
|
||||
db.ModelWithUID
|
||||
ServiceUID string `gorm:"type:char(32)"`
|
||||
Index string `gorm:"type:varchar(128)"`
|
||||
Name string `gorm:"type:varchar(32)"`
|
||||
Icon string `gorm:"type:varchar(128)"`
|
||||
db.ModelCommand
|
||||
CommandUID string `gorm:"type:char(32)"`
|
||||
PlaceUID string `gorm:"type:char(32);index"`
|
||||
UserUID string `gorm:"type:char(32)"`
|
||||
Info string `gorm:"type:varchar(255)"`
|
||||
}
|
||||
type Message struct {
|
||||
db.ModelContent
|
||||
db.ModelCommand
|
||||
CommandUID string `gorm:"type:char(32)"`
|
||||
FromUserUID string `gorm:"type:char(32)"`
|
||||
ToUserUID string `gorm:"type:char(32);index"`
|
||||
CommandUID string `gorm:"type:char(32)"`
|
||||
PlaceUID string `gorm:"type:char(32)"`
|
||||
Args string `gorm:"type:varchar(128)"`
|
||||
Status uint `gorm:"default:0"`
|
||||
Score uint `gorm:"default:0"`
|
||||
}
|
||||
type Recent struct {
|
||||
db.ModelWithUID
|
||||
db.ModelCommand
|
||||
UserUID string `gorm:"type:char(32);index"`
|
||||
PlaceUID string `gorm:"type:char(32);index"`
|
||||
ServiceUID string `gorm:"type:char(32)"`
|
||||
PlaceName string `gorm:"type:varchar(64)"`
|
||||
StreetName string `gorm:"type:varchar(64)"`
|
||||
CityName string `gorm:"type:varchar(64)"`
|
||||
AuthStatus uint8 `gorm:"default:0"`
|
||||
Score uint8 `gorm:"default:0"`
|
||||
}
|
||||
type Command struct {
|
||||
db.ModelWithUID
|
||||
ServiceUID string `gorm:"type:char(32);index:idx_service"`
|
||||
Index string `gorm:"type:varchar(64);index:idx_service"`
|
||||
Name string `gorm:"type:varchar(32)"`
|
||||
Icon string `gorm:"type:varchar(128)"`
|
||||
}
|
||||
type Service struct {
|
||||
db.ModelWithUID
|
||||
Icon string `gorm:"type:varchar(128)"`
|
||||
@ -332,23 +155,22 @@ type Service struct {
|
||||
Version string `gorm:"type:varchar(32)"`
|
||||
Domain string `gorm:"type:varchar(255)"`
|
||||
Portal string `gorm:"type:varchar(255)"`
|
||||
Nodetype string `gorm:"type:varchar(32)"`
|
||||
Nodename string `gorm:"type:varchar(32)"`
|
||||
Nodetype string `gorm:"type:varchar(32)"`
|
||||
Pathname string `gorm:"type:varchar(255)"`
|
||||
Hostname string `gorm:"type:varchar(32)"`
|
||||
}
|
||||
type Support struct {
|
||||
db.ModelContent
|
||||
PlaceUID string `gorm:"type:char(32);index"`
|
||||
db.ModelWithUID
|
||||
FromUserUID string `gorm:"type:char(32);index"`
|
||||
ToUserUID string `gorm:"type:char(32);index"`
|
||||
Title string `gorm:"type:varchar(64)"`
|
||||
Content string
|
||||
}
|
||||
|
||||
func init() {
|
||||
db.CmdModels("",
|
||||
&Sess{}, &User{}, &UserPlace{}, &Place{}, &Street{}, &City{},
|
||||
&Goodslist{}, &Paymentlist{}, &Quotalist{}, &Spendlist{},
|
||||
&Meeting{}, &Document{}, &Contract{}, &Photo{},
|
||||
&Setting{}, &Apply{}, &Allow{}, &Event{}, &Notice{},
|
||||
&Domain{}, &Market{}, &Thumb{}, &Comment{}, &Favor{},
|
||||
&Command{}, &Message{}, &Recent{}, &Service{}, &Support{},
|
||||
&Apply{}, &Allow{}, &Event{}, &Message{}, &Recent{}, &Command{}, &Service{}, &Support{},
|
||||
)
|
||||
}
|
||||
|
@ -1,53 +0,0 @@
|
||||
package gonganxitong
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/community/src/gonganxitong/model"
|
||||
)
|
||||
|
||||
type notice struct {
|
||||
Table
|
||||
order string `data:"505"`
|
||||
role string `data:"leader"`
|
||||
fields string `data:"title,content,user_uid"`
|
||||
create string `name:"create title* content*" role:"void"`
|
||||
remove string `name:"remove" role:"void"`
|
||||
}
|
||||
|
||||
func (s notice) Create(m *ice.Message, arg ...string) {
|
||||
if m.WarnNotRight(!s.IsLeader(m)) {
|
||||
return
|
||||
}
|
||||
m.Option(model.PLACE_UID, m.Option(s.Keys(s.Place, model.UID)))
|
||||
s.Insert(m, kit.Simple(arg, m.OptionSimple(model.PLACE_UID, model.USER_UID))...)
|
||||
s.RecordEventWithName(m, "")
|
||||
}
|
||||
func (s notice) Remove(m *ice.Message, arg ...string) {
|
||||
if m.WarnNotRight(!s.IsLeader(m)) {
|
||||
return
|
||||
}
|
||||
m.Option(model.PLACE_UID, m.Option(s.Keys(s.Place, model.UID)))
|
||||
s.Delete(m, m.OptionSimple(model.PLACE_UID, model.UID)...)
|
||||
s.RecordEventWithName(m, "")
|
||||
}
|
||||
func (s notice) List(m *ice.Message, arg ...string) {
|
||||
if len(arg) == 1 {
|
||||
s.Select(m, model.PLACE_UID, arg[0])
|
||||
} else if len(arg) == 2 {
|
||||
s.SelectDetail(m, model.PLACE_UID, arg[0], model.UID, arg[1])
|
||||
} else {
|
||||
return
|
||||
}
|
||||
kit.If(s.IsLeader(m), func() {
|
||||
if m.PushAction(s.Remove); m.Length() == 0 {
|
||||
s.Button(m, "")
|
||||
}
|
||||
}, func() {
|
||||
m.Action()
|
||||
})
|
||||
s.SelectJoinUser(m)
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(notice{Table: newTable()}) }
|
Before Width: | Height: | Size: 2.3 KiB |
@ -1,88 +0,0 @@
|
||||
package gonganxitong
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/community/src/gonganxitong/model"
|
||||
)
|
||||
|
||||
type paymentlist struct {
|
||||
Table
|
||||
order string `data:"92"`
|
||||
auth string `data:"issued"`
|
||||
role string `data:"leader,worker"`
|
||||
fields string `data:"amount,title,content,paymentlist_status,goodslist_uid,user_uid"`
|
||||
create string `name:"create amount* title* content" role:"leader"`
|
||||
request string `name:"request" help:"支付" style:"notice" role:"void"`
|
||||
response string `name:"response" role:"void"`
|
||||
}
|
||||
|
||||
func (s paymentlist) Create(m *ice.Message, arg ...string) {
|
||||
s.Insert(m, kit.Simple(s.TransPrice(m, arg, model.AMOUNT), m.OptionSimple(model.PLACE_UID, model.USER_UID))...)
|
||||
s.RecordEventWithName(m, "")
|
||||
}
|
||||
func (s paymentlist) List(m *ice.Message, arg ...string) {
|
||||
if len(arg) == 1 {
|
||||
s.Select(m, model.PLACE_UID, arg[0], model.USER_UID, m.Option(model.USER_UID))
|
||||
} else if len(arg) == 2 {
|
||||
s.SelectDetail(m, model.PLACE_UID, arg[0], model.USER_UID, m.Option(model.USER_UID), model.UID, arg[1])
|
||||
if PaymentStatus(kit.Int(m.Append(model.PAYMENTLIST_STATUS))) == PaymentCreate {
|
||||
if !m.IsWeixinUA() {
|
||||
m.EchoQRCode(s.Link(m, arg[0], m.PrefixKey(), arg[1])).Echo("请用微信扫码支付")
|
||||
}
|
||||
} else {
|
||||
m.SetAppend().Cmdy(s.Prefix(m, spendlist{}), arg).Action()
|
||||
return
|
||||
}
|
||||
} else {
|
||||
return
|
||||
}
|
||||
m.Table(func(value ice.Maps) {
|
||||
switch PaymentStatus(kit.Int(value[model.PAYMENTLIST_STATUS])) {
|
||||
case PaymentCreate:
|
||||
m.PushButton(s.Request)
|
||||
case PaymentSuccess:
|
||||
m.PushButton()
|
||||
default:
|
||||
m.PushButton()
|
||||
}
|
||||
}).Display("").Action()
|
||||
s.SelectJoinUser(m)
|
||||
}
|
||||
func (s paymentlist) Request(m *ice.Message, arg ...string) {
|
||||
s.cmdy(m, m.ActionKey(), kit.Simple(kit.Select(m.PrefixKey(), arg, 0), kit.Select("", arg, 1),
|
||||
kit.Select(m.Option(model.PLACE_UID), arg, 2), kit.Select(m.Option(model.UID), arg, 3), kit.Slice(arg, 4))...)
|
||||
}
|
||||
func (s paymentlist) Response(m *ice.Message, arg ...string) {
|
||||
if !s.cmdy(m, m.ActionKey(), arg...).IsErr() {
|
||||
s.Update(m, kit.Dict(model.STATUS, PaymentSuccess), model.PLACE_UID, arg[0], model.UID, arg[1])
|
||||
}
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(paymentlist{Table: newTable()}) }
|
||||
|
||||
func (s paymentlist) cmdy(m *ice.Message, action ice.Any, arg ...string) *ice.Message {
|
||||
return m.Cmdy(PaymentVendor, action, arg)
|
||||
}
|
||||
|
||||
type PaymentStatus int
|
||||
|
||||
const (
|
||||
PaymentCreate PaymentStatus = iota
|
||||
PaymentSuccess
|
||||
PaymentFailure
|
||||
)
|
||||
|
||||
var PaymentStatusList = map[PaymentStatus]string{
|
||||
PaymentCreate: "create",
|
||||
PaymentSuccess: "success",
|
||||
PaymentFailure: "failure",
|
||||
}
|
||||
|
||||
func (s PaymentStatus) String() string { return PaymentStatusList[s] }
|
||||
|
||||
var PaymentVendor interface {
|
||||
Request(m *ice.Message, arg ...string)
|
||||
Response(m *ice.Message, arg ...string)
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.onimport.myView(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.title, "¥ "+(value.amount/100), can.onimport.titleAction(can, value)]},
|
||||
{view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value), value.user_name]},
|
||||
{view: html.OUTPUT, list: [value.content]},
|
||||
] })
|
||||
},
|
||||
})
|
@ -1,67 +0,0 @@
|
||||
package gonganxitong
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/community/src/gonganxitong/model"
|
||||
)
|
||||
|
||||
type photo struct {
|
||||
Table
|
||||
order string `data:"96"`
|
||||
auth string `data:"issued"`
|
||||
role string `data:"leader,worker"`
|
||||
fields string `data:"space_id,access_token,expire_time,vendor"`
|
||||
upload string `name:"upload" role:"worker"`
|
||||
rename string `name:"rename newname" role:"worker"`
|
||||
trash string `name:"trash" role:"worker"`
|
||||
}
|
||||
|
||||
func (s photo) Config(m *ice.Message, arg ...string) {
|
||||
s.InsertOrUpdate(m, arg, m.OptionSimple(model.PLACE_UID)...)
|
||||
}
|
||||
func (s photo) List(m *ice.Message, arg ...string) {
|
||||
s.cmdy(m, PhotoVendor.Folder, kit.Slice(arg, 1)...)
|
||||
m.PushAction(s.Rename, s.Trash).Display("")
|
||||
if len(arg) == 1 {
|
||||
s.Button(m, "请上传文件", s.Upload)
|
||||
s.SpendlistCheck(m, 0)
|
||||
}
|
||||
}
|
||||
func (s photo) Upload(m *ice.Message, arg ...string) {
|
||||
if up := kit.Simple(m.Optionv(ice.MSG_UPLOAD)); s.SpendlistCheck(m, kit.Int(up[2])) {
|
||||
s.cmdy(m, "")
|
||||
s.SpendlistUpdate(m, m.Append(model.SIZE))
|
||||
}
|
||||
}
|
||||
func (s photo) Rename(m *ice.Message, arg ...string) {
|
||||
s.cmdy(m, "")
|
||||
}
|
||||
func (s photo) Trash(m *ice.Message, arg ...string) {
|
||||
s.cmdy(m, "")
|
||||
s.SpendlistUpdate(m, m.Append(model.SIZE))
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(photo{Table: newTable()}) }
|
||||
|
||||
func (s photo) cmdy(m *ice.Message, action ice.Any, arg ...string) {
|
||||
if m.Option(model.AUTH_UID, s.StreetAuthUID(m, m.Option(model.PLACE_UID))) == "" {
|
||||
return
|
||||
}
|
||||
if msg := s.Select(m.Spawn(), m.OptionSimple(model.PLACE_UID)...); msg.Append(model.SPACE_ID) == "" {
|
||||
m.Echo("本服务暂未配置,请联系公司管理员配置")
|
||||
} else {
|
||||
kit.If(action == "", func() { action = m.ActionKey() })
|
||||
_msg := m.Cmd(msg.Append(model.VENDOR), PhotoVendor.Token, msg.Append(model.SPACE_ID), msg.Append(model.ACCESS_TOKEN), msg.Append(model.EXPIRE_TIME))
|
||||
m.Cmdy(msg.Append(model.VENDOR), action, m.Option(model.AUTH_UID), msg.Append(model.SPACE_ID), _msg.Append(model.ACCESS_TOKEN), arg)
|
||||
}
|
||||
}
|
||||
|
||||
var PhotoVendor interface {
|
||||
Folder(m *ice.Message, arg ...string)
|
||||
Upload(m *ice.Message, arg ...string)
|
||||
Rename(m *ice.Message, arg ...string)
|
||||
Trash(m *ice.Message, arg ...string)
|
||||
Token(m *ice.Message, arg ...string)
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.onimport.myView(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.name]},
|
||||
{view: html.STATUS, list: [can.base.Size(value.size), can.base.TimeTrim(value.modify_time)]},
|
||||
] })
|
||||
},
|
||||
})
|
@ -10,9 +10,10 @@ type PlaceType int
|
||||
|
||||
const (
|
||||
PlaceHouse PlaceType = iota
|
||||
PlaceHotel
|
||||
PlaceStore
|
||||
PlaceOffice
|
||||
PlaceSchool
|
||||
PlaceOffice
|
||||
PlacePublic
|
||||
PlaceFactory
|
||||
PlaceHospital
|
||||
@ -20,9 +21,10 @@ const (
|
||||
|
||||
var PlaceTypeList = map[PlaceType]string{
|
||||
PlaceHouse: "house",
|
||||
PlaceHotel: "hotel",
|
||||
PlaceStore: "store",
|
||||
PlaceOffice: "office",
|
||||
PlaceSchool: "school",
|
||||
PlaceOffice: "office",
|
||||
PlacePublic: "public",
|
||||
PlaceFactory: "factory",
|
||||
PlaceHospital: "hospital",
|
||||
|
Before Width: | Height: | Size: 243 KiB |
@ -1,200 +1,68 @@
|
||||
$body:not(.mobile) { background-color:var(--notice-bg-color); }
|
||||
$body.dark { --plugin-bg-color:#0d1117; --output-bg-color:#171a22; }
|
||||
$body.width1.light { --plugin-bg-color:#f4f5f9; --output-bg-color:#fefefd; }
|
||||
$body.width1.light { --plugin-bg-color:#f4f5f9; --output-bg-color:white; }
|
||||
$body.width1.light { --plugin-bg-color:#f3f3f4; --output-bg-color:white; --notice-bg-color:#006fff; }
|
||||
$body.width1 fieldset.Action div.input.float { position:static; }
|
||||
$body.width1 fieldset.Action div.input.float table { width:100%; }
|
||||
$body.width1 div.upload.float div.action { display:flex; }
|
||||
$body.width1 div.upload.float div.action div.item.upload { flex-grow:1; }
|
||||
$body.width1 div.upload.float div.action div.item.upload input { width:100%; }
|
||||
$body.width1 $action div.item.text.filter { flex-grow:1; }
|
||||
$action { background-color:transparent; position:absolute; top:0; width:100%; z-index:1; display:none; }
|
||||
$action div.item:last-child { margin-right:10px; }
|
||||
$action div.item.text.filter input { width:100%; }
|
||||
$action div.item { margin-left:10px; margin-right:0; padding:0; height:48px; align-items:center; }
|
||||
$action div.item.button input { border:none; background-color:var(--plugin-bg-color); color:var(--notice-bg-color); min-width:60px; display:unset; }
|
||||
$action div.item.button input:hover { background-color:var(--hover-bg-color); }
|
||||
$action div.item.button span { display:none; }
|
||||
$action div.item.button i { display:none; }
|
||||
$output div.title div.action div.item.notice input { background-color:var(--notice-bg-color); color:var(--notice-fg-color); }
|
||||
$output { background-color:var(--plugin-bg-color); }
|
||||
$output>div.header { background-image:linear-gradient(var(--notice-bg-color), var(--plugin-bg-color)); height:240px; width:100%; position:absolute; left:0; }
|
||||
$body.light $output>div.header { background-image:linear-gradient(#dbe7fe, var(--plugin-bg-color)); height:240px; width:100%; position:absolute; left:0; }
|
||||
$output>div.header img { height:100%; width:100%; object-fit:cover; }
|
||||
$output>div.action>div.list { margin:0 10px; }
|
||||
$output div.output>div.code { font-size:16px; position:relative; }
|
||||
$output div.output>div.code img.avatar {
|
||||
border-radius:10px; object-fit:cover; --qrcode-icon-height:48px;
|
||||
height:var(--qrcode-icon-height) !important; width:var(--qrcode-icon-height) !important;
|
||||
position:absolute; top:calc(50% - var(--qrcode-icon-height) / 2 - 16px); left:calc(50% - var(--qrcode-icon-height) / 2);
|
||||
}
|
||||
$output>div>div.code { margin-bottom:20px; display:flex; flex-direction:column; align-items:center; }
|
||||
$output>div>div.list { border-radius:10px; background-color:var(--output-bg-color); padding:10px; margin:10px; }
|
||||
$output>div>div.list.myplace>div.output { padding:0 10px; max-height:320px; }
|
||||
$output>div>div.list.myplace>div.output>div.item>div.output div.title span.type { line-height:18px; }
|
||||
$output>div>div.list.myplace>div.output>div.item>div.output div.title span.role { line-height:18px; }
|
||||
$output>div>div.list.myplace>div.output>div.item>div.output div.title { margin-bottom:5px; }
|
||||
$output>div>div.list.mynotice { cursor:pointer; }
|
||||
$output>div>div.list.mynotice:not(.hide) { display:flex; align-items:center; }
|
||||
$output>div>div.list.mynotice>span.title { flex-grow:1; margin:0 5px; }
|
||||
$output>div>div.list.mynotice>span:not(.title) { white-space:pre; }
|
||||
$output>div>div.list.mynotice>span:first-child { background-color:var(--hover-bg-color); color:var(--notice-bg-color); padding:0 5px; margin-right:5px; }
|
||||
$output>div>div.list.mynotice>span:last-child { color:gray; }
|
||||
$output>div>div.list.mylist>fieldset>div.output { max-height:none !important; }
|
||||
$output>div>div.list>div.title { font-weight:bold; display:flex; align-items:center; border-left:var(--box-notice3); padding-left:10px; }
|
||||
body.width1 $output fieldset.story>div.output>div.place_info { min-height:68px; }
|
||||
body.width1 $output fieldset.story>div.output>div.place_info>div.item>div.output { background-color:var(--plugin-bg-color); }
|
||||
body.width1 $output fieldset.story>div.output>table.detail tr.user_name { display:none; }
|
||||
body.width1 $output fieldset.story>div.output>table.detail tr.user_avatar { display:none; }
|
||||
body.width1 $output fieldset.story>div.output>table.detail tr.created_at { display:none; }
|
||||
$output>div>div.list.myallow>div.title { border-left:var(--box-danger3); padding-left:10px; }
|
||||
$output>div>div.list.myorder>div.title { border-left:var(--box-danger3); padding-left:10px; }
|
||||
$output div.item.card { margin-bottom:2px; }
|
||||
$output div.item.card>div.output>div { width:100%; }
|
||||
$output div.item.card div.title { width:100%; display:flex; align-items:center; }
|
||||
$output div.item.card div.title span.auth { font-size:14px; }
|
||||
$output div.item.card div.title span.time { position:absolute; right:0; font-size:12px; color:gray; }
|
||||
$output div.item.card div.status span { word-break:break-all; }
|
||||
$output div.item.card img { border-radius:5px; padding:0; margin:0; margin-right:10px; height:48px; width:48px; }
|
||||
$output div.item.card.sticky>div.output { background-color:var(--plugin-bg-color); color:var(--notice-bg-color); }
|
||||
$output>div>div.list { box-shadow:var(--box-shadow); border-radius:10px; background-color:var(--output-bg-color); padding:10px; margin:10px; }
|
||||
$output>div>div.list>div.title { font-weight:bold; display:flex; align-items:center; }
|
||||
$output>div>div.list>div.title span:first-child { flex-grow:1; }
|
||||
$output>div>div.list>div.title div.action div.item.filter input:focus { width:320px; transition:width 0.5s; }
|
||||
$output>div>div.list>div.title div.action div.item.filter input { transition:width 0.8s; }
|
||||
$output>div>div.list>div.title div.action { overflow:hidden; }
|
||||
$output>div>div.list>div.title div.action div.item { margin-right:5px; }
|
||||
$output>div>div.list>div.title div.action div.item.button.icons input { display:none; }
|
||||
$output>div>div.list>div.role:not(.hide) { display:flex; align-items:center; justify-content:space-around; }
|
||||
$output>div>div.list>div.role span { padding:5px; cursor:pointer; white-space:pre; }
|
||||
$output>div>div.list>div.role span:not(.select) { color:gray; }
|
||||
$output>div>div.list>div.role span { padding:5px; cursor:pointer; }
|
||||
$output>div>div.list>div.role span.select { border-bottom:var(--box-notice); }
|
||||
$output>div>div.list>div.role span.creator.select { border-bottom:var(--box-danger); }
|
||||
$output>div>div.list>div.role span.landlord.select { border-bottom:var(--box-danger); }
|
||||
$output>div>div.list>div.role span.teacher.select { border-bottom:var(--box-danger); }
|
||||
$output>div>div.list>div.role span.leader.select { border-bottom:var(--box-danger); }
|
||||
$output>div>div.list>div.role span.boss.select { border-bottom:var(--box-danger); }
|
||||
$output>div>div.list>div.role span:not(.select) { color:gray; }
|
||||
$output>div>div.list>div.output>div.item.index:not(.hide) { padding:5px 10px; display:flex; flex-direction:column; align-items:center; float:left; }
|
||||
$output>div>div.list>div.output>div.item.index img { height:36px; width:36px; object-fit:contain; }
|
||||
$output>div>div.list>div.output>div.item.index i { font-size:22px; padding:5px; }
|
||||
$output>div>div.list>div.output>div.item.index span { font-size:12px; white-space:pre; max-width:80px; }
|
||||
$output>div>div.list div.code { text-align:center; }
|
||||
$output>div>div.list div.code input { background-color:var(--notice-bg-color); color:var(--notice-fg-color); font-size:18px; margin:auto; min-width:200px; display:block; margin-top:10px; }
|
||||
$output>div>div.list fieldset.story>div.output { background-color:var(--plugin-bg-color); }
|
||||
$output div.head>img { height:200px; width:100%; object-fit:cover; }
|
||||
$output div.head div.item.card img { border-radius:25px; }
|
||||
$output div.head>div.item.card div.title div.item.button i { display:none; }
|
||||
$output div.tabs { height:32px; display:flex; position:unset; }
|
||||
$output div.tabs span { padding:5px 10px; }
|
||||
$output div.tabs span.select { background-color:var(--output-bg-color); color:var(--hover-fg-color); }
|
||||
$output div.item.card:not(:last-child) { margin-bottom:2px; }
|
||||
$output div.item.card>div.output>div { width:100%; width:calc(100% - 53px); overflow:hidden; }
|
||||
$output div.item.card div.title { width:100%; display:flex; position:relative; }
|
||||
$output div.item.card div.title span.type { line-height:22px; }
|
||||
$output div.item.card div.title span.status { line-height:22px; }
|
||||
$output div.item.card div.title span.price { color:var(--danger-bg-color); margin-left:auto; }
|
||||
$output div.item.card div.title span.auth { font-size:14px; padding:3px; }
|
||||
$output div.item.card div.title span.time { position:absolute; right:0; font-size:12px; color:gray; }
|
||||
$output div.item.card div.title span:first-child { word-break:break-all; }
|
||||
$output fieldset.story>div.item.card div.title span { line-height:26px; }
|
||||
$output div.item.title { border-left:var(--box-notice3); margin-left:10px; padding:10px; background-color:var(--plugin-bg-color); }
|
||||
$output div.item.title.dealList { border-left:var(--box-danger3); }
|
||||
$output div.item.title.meetList { border-left:var(--box-danger3); }
|
||||
$body div.inputs>div.input.float>div.action { display:flex; }
|
||||
$output div.item.card div.title div.action input { margin-right:0; }
|
||||
$output div.item.card div.status span { word-break:break-all; }
|
||||
$output div.item.card img { border-radius:5px; padding:0; margin:0; margin-right:10px; height:48px; width:48px; min-width:48px; object-fit:cover; }
|
||||
$output div.item.card div.container img { margin-right:0; height:100%; width:100%; }
|
||||
$output div.item.card div.container>div.action { position:relative; float:right; }
|
||||
body:not(.mobile) $output div.item.card div.container>div.action { display:none; }
|
||||
body.mobile $output div.item.card div.container>div.title>span.status { margin-left:auto; }
|
||||
$output div.item.card.sticky>div.output { background-color:var(--plugin-bg-color); color:var(--notice-bg-color); }
|
||||
// $action div.item.notice input[type=button] { border:var(--box-notice); color:var(--notice-bg-color); }
|
||||
$action div.item input[type=button] { min-width:20px; padding:0 5px; }
|
||||
$action div.item input[type=button] { color:var(--notice-bg-color); }
|
||||
// $action div.item input[type=button] { border:var(--box-notice); color:var(--notice-bg-color); }
|
||||
// $action div.item.text input { border:var(--box-notice); color:var(--notice-bg-color); }
|
||||
// $action div.item.text input { color:var(--notice-bg-color); }
|
||||
// $action div.item.text i { color:var(--notice-bg-color); }
|
||||
$action div.item.danger input[type=button] { border:var(--box-danger); color:var(--danger-bg-color); }
|
||||
$output input.notice[type=button]:hover { border:var(--box-notice); background-color:var(--notice-bg-color); color:var(--notice-fg-color); }
|
||||
$output input.notice[type=button]:not(:hover) { background-color:transparent; color:var(--notice-bg-color); }
|
||||
$output input.danger[type=button]:not(:hover) { color:var(--danger-bg-color); }
|
||||
$output input.danger[type=button]:hover { background-color:var(--danger-bg-color); color:var(--danger-fg-color); }
|
||||
$output input[type=button][name=submit] { background-color:var(--notice-bg-color); color:var(--notice-fg-color); }
|
||||
$output span.type { border:none; border-radius:5px; background-color:var(--hover-bg-color); color:var(--notice-bg-color); font-size:var(--status-font-size); line-height:22px; padding:2px 8px; }
|
||||
$output span.role { border:none; border-radius:5px; background-color:var(--hover-bg-color); color:var(--notice-bg-color); font-size:var(--status-font-size); line-height:22px; padding:2px 8px; }
|
||||
$output span.level { border:none; border-radius:5px; background-color:var(--hover-bg-color); color:var(--notice-bg-color); font-size:var(--status-font-size); line-height:22px; padding:2px 8px; }
|
||||
$output span.status { border:none; border-radius:5px; background-color:var(--hover-bg-color); color:var(--notice-bg-color); font-size:var(--status-font-size); line-height:22px; padding:2px 8px; }
|
||||
$output span.type.danger { color:var(--danger-bg-color); }
|
||||
$output span.role.danger { color:var(--danger-bg-color); }
|
||||
$output span.level.danger { color:var(--danger-bg-color); }
|
||||
$output span.status.danger { color:var(--danger-bg-color); }
|
||||
$output table.content { background-color:var(--output-bg-color); }
|
||||
$output table.content td.action input.icons { display:unset; }
|
||||
$output table.content td.action i { display:none; }
|
||||
$output table.content.detail thead { display:none; }
|
||||
$output table.content.detail td.action input { padding:0 10px; min-width:60px; }
|
||||
$output>div>div.list>div.output>div.item.index img { height:48px; width:48px; object-fit:contain; }
|
||||
$output>div>div.list>div.action { display:flex; justify-content:center; }
|
||||
$output>div>div.list>div.action div.item { margin-right:5px; }
|
||||
$output>div>div.list>div.action div.item input[type=button] { color:var(--notice-bg-color); border:none; }
|
||||
$output>div>div.list>div.action div.item i { display:none; }
|
||||
// $output>div.output>div.list:last-child { margin-bottom:0; }
|
||||
$output>div.action div.item.button { margin-right:5px; }
|
||||
$output>div.action div.item.button input { border:none; color:var(--notice-bg-color); min-width:60px; float:left; }
|
||||
$output>div.action div.item.button input:hover { background-color:var(--hover-bg-color); }
|
||||
$output>div.action div.item.button span { display:none; }
|
||||
$output>div.action div.item.button i { display:none; }
|
||||
$output input[type=button][name=submit] { background-color:var(--notice-bg-color); color:var(--notice-fg-color); padding:0 20px; }
|
||||
$output input[type=button][name=cancel] { background-color:var(--danger-bg-color); color:var(--danger-fg-color); padding:0 20px; }
|
||||
$output input[type=button][name=reject] { background-color:var(--danger-bg-color); color:var(--danger-fg-color); padding:0 20px; }
|
||||
$output input[type=button][name=approve] { background-color:var(--notice-bg-color); color:var(--notice-fg-color); padding:0 20px; }
|
||||
$output span.type { border:var(--box-notice); color:var(--notice-bg-color); padding:0 3px; }
|
||||
$output span.role { border:var(--box-notice); color:var(--notice-bg-color); padding:0 3px; }
|
||||
$output span.type.danger { border:var(--box-danger); color:var(--danger-bg-color); }
|
||||
$output span.role.danger { border:var(--box-danger); color:var(--danger-bg-color); }
|
||||
$output span.status.danger { border:var(--box-danger); color:var(--danger-bg-color); }
|
||||
$output table.content.detail tr.action input.icons { display:unset; }
|
||||
$output table.content.detail tr.action i { display:none; }
|
||||
$output table.content.detail tr.uid { display:none; }
|
||||
$output table.content.detail input { border:none; }
|
||||
$output>div.output>div.code { padding:10px; }
|
||||
$output>fieldset.story { margin-top:48px; }
|
||||
$output table.content td.action input.icons { display:unset; }
|
||||
$output table.content td.action i { display:none; }
|
||||
$output fieldset.form>div.output>div.code>input[type=button] { font-size:18px; margin:10px; height:36px; }
|
||||
$output fieldset>div.output>div.code>input[type=button] { background-color:var(--notice-bg-color); color:var(--notice-fg-color); margin-right:10px; min-width:80px; float:right; }
|
||||
$output fieldset>div.output>div.code>input[type=button].danger { background-color:var(--danger-bg-color); color:var(--danger-fg-color); }
|
||||
$output fieldset>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 fieldset.story { position:absolute; top:0; height:100%; width:100%; }
|
||||
$output fieldset.story { box-shadow:none; }
|
||||
$output fieldset.story>legend { display:none; }
|
||||
$output fieldset.story>form.option { display:none; }
|
||||
$output fieldset.story>div.action { display:none; }
|
||||
$output fieldset.story>div.status { display:none; }
|
||||
$output>fieldset.story>div.output { background-color:var(--plugin-bg-color); }
|
||||
$output fieldset.story>div.output div.code { padding:0; }
|
||||
$output fieldset.story>div.output { background-color:var(--plugin-bg-color); }
|
||||
$output fieldset.story>div.output table.content td { box-shadow:none; }
|
||||
$output fieldset.story>div.output table.content.detail td:last-child { text-align:left; }
|
||||
$output fieldset.story>div.output table.content tr.uid { display:none; }
|
||||
$output fieldset.story>div.output table.content td img { max-width:100%; }
|
||||
$output fieldset.story>div.output table.content tr.icon td img { max-height:128px; max-width:128px; }
|
||||
$output fieldset.story>div.output table.content tr.user_avatar td img { max-height:128px; max-width:128px; }
|
||||
$output fieldset.story>div.output table.content tr.auth_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 { display:flex; flex-direction:column; row-gap:10px; margin-top:20px; margin-bottom:20px; }
|
||||
$output fieldset.story>div.output>div.code>img { display:block; margin:auto; width:100%; max-width:320px; }
|
||||
$output fieldset.story>div.output>div.code>input[type=button] { background-color:var(--notice-bg-color); color:var(--notice-fg-color); 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 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; width:100%; }
|
||||
$output>fieldset.story>div.output div.item.card.loaded>div.output { background-color:var(--plugin-bg-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; }
|
||||
// $output>fieldset.story.web.team.renzhengshouquan.profile { margin-top:0; }
|
||||
// $output>fieldset.story.web.team.credit { margin-top:0; }
|
||||
$output>fieldset.story.web.team.credit>div.output>div.code { margin-top:64px; }
|
||||
$output>fieldset.message div.tabs span.select { border-top:var(--box-border); }
|
||||
$output>fieldset.message div.tabs span.create.select { border-top:var(--box-danger); }
|
||||
$output>fieldset.message div.tabs span.read.select { border-top:var(--box-notice); }
|
||||
$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.qrcode table.content td { text-align:center; }
|
||||
$output>fieldset.market>div.output>div.tabs { display:flex; width:100%; overflow:auto; height:30px; position:sticky; top:0; z-index:1; }
|
||||
$output>fieldset.market>div.output>div.tabs>div.item { padding:5px 10px; float:left; white-space:pre; }
|
||||
$output>fieldset.market>div.output>div.tabs>div.item.select { border-top:var(--box-danger); background-color:var(--output-bg-color); color:var(--danger-bg-color); font-weight:bold; position:sticky; left:0; right:0; }
|
||||
$output>fieldset.market>div.output>div.list div.item.card img { border-radius:50%; height:40px; width:40px; min-width:40px; }
|
||||
$output>fieldset.market>div.output>div.list div.item.card div.status { font-size:12px; }
|
||||
$output>fieldset.market>div.output>div.list div.item.card div.status>span.username { color:var(--body-fg-color); font-size:14px; }
|
||||
$output>fieldset.market>div.output>div.list div.item.card div.status>span.time { float:right; }
|
||||
$output>fieldset.market>div.output>div.list div.item.card div.output div.action { color:gray; font-size:14px; width:100%; max-width:100%; display:flex; justify-content:space-around; position:relative; }
|
||||
$output>fieldset.market>div.output>div.list div.item.card div.output div.action i { margin-right:5px; }
|
||||
$output>fieldset.market>div.output>div.list div.item.card div.output div.action div.item.done { color:var(--notice-bg-color); }
|
||||
$output.background>div.output { padding-top:80px; }
|
||||
$output.public>div>div.list:not(.mylist)>div.title { display:none; }
|
||||
$output.public>div>div.list.myplace>div.output { padding:0; }
|
||||
$output.public>div>div.list.myplace div.item.card div.output { padding:0; }
|
||||
body.dark $output>div>div.list.mynotice>span:first-child { background-color:var(--hover-bg-color); color:yellow; white-space:pre; }
|
||||
body.width1 fieldset.panel.Action>div.output { background-color:var(--plugin-bg-color); }
|
||||
body.width1 div.input.float { margin:0; width:100% !important; max-width:100% !important; }
|
||||
body.width1 div.input.float input[name=submit] { background-color:var(--notice-bg-color); color:var(--notice-fg-color); }
|
||||
body.width1 $output>div>div.list>div.title div.action div.item.filter input:focus { width:200px; transition:width 0.5s; }
|
||||
body.width6 $output>div.output>div.code img.avatar { top:183px; }
|
||||
body:not(.width1) $output div.item.card { flex-direction:row-reverse; }
|
||||
body:not(.width1) $output div.item.card>div.action { position:static; flex-shrink:0; }
|
||||
body:not(.width1) $output div.item.card>div.output { flex-grow:1; }
|
||||
body:not(.width1) $output div.item.card div.title div.action { display:none; }
|
||||
$output>fieldset.qrcode div.code { text-align:center; }
|
||||
body.light.mobile { --plugin-bg-color:#f4f5f9; --output-bg-color:#fefefd; }
|
||||
body.mobile $output>div>div.list div.item.index span { font-size:12px; white-space:pre; }
|
||||
body.mobile fieldset.panel.Action>div.output { background-color:var(--plugin-bg-color); }
|
||||
body:not(.mobile) $output>fieldset.story>div.output div.item.card:not(:hover) { background-color:var(--output-bg-color); }
|
||||
body:not(.mobile) $output div.tabs span:hover { background-color:var(--hover-bg-color); }
|
||||
body:not(.mobile) $output>div>div.list>div.role span:hover { background-color:var(--hover-bg-color); }
|
||||
body:not(.mobile) $output fieldset.story>div.output>div.code>input[type=button]:hover { border:var(--box-notice); background-color:transparent; color:var(--notice-bg-color); }
|
||||
body:not(.mobile) $action div.item.notice input[type=button]:hover { background-color:var(--notice-bg-color); color:var(--notice-fg-color); }
|
||||
body.en $output>fieldset table.content td:first-child { max-width:190px; min-width:100px; width:unset;}
|
||||
body.en $output>fieldset table.content td { padding: 10px 5px; }
|
||||
fieldset.web.team.storage.file div.item.card div.title span:first-child { flex-grow:1; }
|
||||
$fieldset { box-shadow:none; }
|
||||
body.en $output>fieldset table.content td:first-child { max-width:180px; width:unset;}
|
@ -1,19 +1,14 @@
|
||||
package gonganxitong
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"shylinux.com/x/ice"
|
||||
"shylinux.com/x/icebergs/base/aaa"
|
||||
"shylinux.com/x/icebergs/base/ctx"
|
||||
"shylinux.com/x/icebergs/base/mdb"
|
||||
"shylinux.com/x/icebergs/base/tcp"
|
||||
"shylinux.com/x/icebergs/base/web"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
"shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/community/src/api"
|
||||
"shylinux.com/x/community/src/gonganxitong/model"
|
||||
"shylinux.com/x/mysql-story/src/db"
|
||||
)
|
||||
|
||||
type Portal struct {
|
||||
@ -24,32 +19,37 @@ type Portal struct {
|
||||
event event
|
||||
message message
|
||||
recent recent
|
||||
command command
|
||||
service service
|
||||
export string `data:"true"`
|
||||
short string `data:"index"`
|
||||
field string `data:"time,icons,name,index,order,enable,type,auth,role,view,init,portal"`
|
||||
field string `data:"time,icons,name,index,order,enable,init,type,role,view,command_uid"`
|
||||
create string `name:"create index name icons"`
|
||||
list string `name:"list place_uid index uid auto" role:"void"`
|
||||
placeCreate string `name:"placeCreate city_name* street_name* place_name* place_type:select address" icon:"bi bi-plus-circle" role:"void"`
|
||||
placeRemove string `name:"placeRemove" role:"void"`
|
||||
placeCreate string `name:"placeCreate city_name* street_name* place_type*:select place_name* address*" icon:"bi bi-plus-square-dotted" role:"void"`
|
||||
placeRemove string `name:"placeRemove uid*" role:"void"`
|
||||
placeAuth string `name:"placeAuth" role:"void"`
|
||||
placeSearch string `name:"placeSearch" icon:"bi bi-search" role:"void"`
|
||||
scanQRCode string `name:"scanQRCode type text" icon:"bi bi-qr-code-scan" role:"void"`
|
||||
}
|
||||
|
||||
func (s Portal) Init(m *ice.Message, arg ...string) {
|
||||
m.Design(s.List, "", kit.JoinWord(s.Keys(s.Place, model.UID), ctx.INDEX, model.UID, ice.AUTO))
|
||||
s.LoadTrans(m, arg...)
|
||||
s.Hash.Init(m, arg...)
|
||||
m.Design(s.List, "", kit.JoinWord(s.Keys(s.Place, model.UID), ctx.INDEX, model.UID, ice.AUTO))
|
||||
}
|
||||
func (s Portal) Exit(m *ice.Message, arg ...string) {
|
||||
mdb.HashSelectUpdate(m.Message, "", func(value ice.Map) { delete(value, model.COMMAND_UID); delete(value, mdb.TARGET) })
|
||||
mdb.HashSelectUpdate(m.Message, "", func(value ice.Map) {
|
||||
delete(value, model.COMMAND_UID)
|
||||
delete(value, mdb.TARGET)
|
||||
if value[mdb.ENABLE] == ice.TRUE {
|
||||
delete(value, mdb.ENABLE)
|
||||
}
|
||||
delete(value, mdb.ICONS)
|
||||
delete(value, mdb.NAME)
|
||||
})
|
||||
s.Hash.Exit(m, arg...)
|
||||
}
|
||||
func (s Portal) BeforeMigrate(m *ice.Message, arg ...string) {
|
||||
return
|
||||
if m.Cmd(web.CODE_MYSQL_CLIENT).Length() == 0 {
|
||||
if s.AutoCmd(m, web.CODE_MYSQL_CLIENT).Table(func(value ice.Maps) { m.Cmd(web.CODE_MYSQL_CLIENT, s.Create, aaa.SESS, "", kit.Simple(value)) }).Length() == 0 {
|
||||
m.Cmd(web.CODE_MYSQL_CLIENT, s.Create, aaa.SESS, "mysql", "driver", "mysql", "database", "mysql", tcp.HOST, "localhost", tcp.PORT, "10001", aaa.USERNAME, "root", aaa.PASSWORD, "root")
|
||||
}
|
||||
}
|
||||
}
|
||||
func (s Portal) AfterMigrate(m *ice.Message, arg ...string) {
|
||||
if name := kit.Select("", kit.Split(m.PrefixKey(), "."), -2); !m.Exists("src/" + name) {
|
||||
@ -57,234 +57,111 @@ func (s Portal) AfterMigrate(m *ice.Message, arg ...string) {
|
||||
}
|
||||
cmd := m.GetCommand()
|
||||
m.Cmdy(s.Prefix(m, s.service), s.Table.Update, ctx.INDEX, m.PrefixKey(), mdb.NAME, cmd.Help+" "+ice.Info.Title(), mdb.ICON, m.Resource(kit.Select(ice.Info.NodeIcon, cmd.Icon)))
|
||||
m.Cmd(command{}).Table(func(value ice.Maps) {
|
||||
if kit.HasSuffix(value[model.INDEX], ".allow") {
|
||||
cmdPortal[kit.ReplaceAll(value[model.INDEX], ".allow", ".portal")] = value[model.PORTAL]
|
||||
cmdSpace[kit.ReplaceAll(value[model.INDEX], ".allow", ".portal")] = value[model.SPACE]
|
||||
}
|
||||
cmdPortal[value[model.INDEX]] = value[model.PORTAL]
|
||||
cmdSpace[value[model.INDEX]] = value[model.SPACE]
|
||||
})
|
||||
}
|
||||
func (s Portal) Inputs(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(s.Place, m.ActionKey(), arg)
|
||||
}
|
||||
func (s Portal) Command(m *ice.Message, arg ...string) {
|
||||
if cmdPortal[arg[0]] != "" && cmdPortal[arg[0]] != m.PrefixKey() {
|
||||
s.AutoCmdy(m, cmdPortal[arg[0]], ctx.ACTION, m.ActionKey(), arg)
|
||||
} else {
|
||||
ctx.Command(m.Message, arg...)
|
||||
}
|
||||
}
|
||||
func (s Portal) Run(m *ice.Message, arg ...string) {
|
||||
if m.Option(model.MESSAGE_UID) != "" {
|
||||
msg := m.Cmd(message{}, s.Table.Select, model.UID, m.Option(model.MESSAGE_UID))
|
||||
m.Option(s.Keys(s.Place, model.UID), msg.Append(model.PLACE_UID))
|
||||
m.Option(model.PLACE_UID, msg.Append(model.PLACE_UID))
|
||||
}
|
||||
if cmdPortal[arg[0]] != "" && cmdPortal[arg[0]] != m.PrefixKey() {
|
||||
s.AutoCmdy(m, cmdPortal[arg[0]], ctx.ACTION, m.ActionKey(), arg)
|
||||
return
|
||||
}
|
||||
s.DisplayBase(m, "common.js")
|
||||
m.Option(model.SERVICE_UID, ServiceUID(m))
|
||||
m.Option(model.COMMAND_UID, CommandUID(m, arg[0]))
|
||||
m.OptionDefault(model.PLACE_UID, m.Option(s.Keys(s.Place, model.UID)))
|
||||
m.Search(arg[0], func(key string, cmd *ice.Command) {
|
||||
role := cmd.Role
|
||||
sub, role := "", cmd.Role
|
||||
if len(arg) > 1 && arg[1] == ctx.ACTION {
|
||||
if action, ok := cmd.Actions[arg[2]]; ok {
|
||||
role = action.Role
|
||||
sub, role = arg[2], action.Role
|
||||
}
|
||||
} else if len(arg) > 1 {
|
||||
if action, ok := cmd.Actions[arg[1]]; ok {
|
||||
role = action.Role
|
||||
} else {
|
||||
m.Option(s.Keys(s.Place, model.UID), arg[1])
|
||||
defer s.SelectJoinUser(m)
|
||||
sub, role = arg[1], action.Role
|
||||
}
|
||||
} else {
|
||||
defer s.SelectJoinUser(m)
|
||||
}
|
||||
if action, ok := cmd.Actions["beforeAction"]; ok {
|
||||
action.Hand(m.Message, arg[1:]...)
|
||||
}
|
||||
if s.UserPlaceRole(m); kit.IsIn(role, "", aaa.VOID, aaa.TECH, aaa.ROOT) {
|
||||
if kit.IsIn(role, "", aaa.VOID) {
|
||||
kit.If(!ctx.PodCmd(m.Message, arg) && aaa.Right(m.Message, arg), func() { m.Cmdy(arg) })
|
||||
} else {
|
||||
if role == "worker" {
|
||||
if !m.WarnNotRight(!s.IsWorker(m)) {
|
||||
m.Cmdy(arg)
|
||||
}
|
||||
} else if role == "leader" {
|
||||
if !m.WarnNotRight(!s.IsLeader(m)) {
|
||||
m.Cmdy(arg)
|
||||
}
|
||||
} else if !m.Cmdy(s.Place, s.CheckRole, kit.Split(role)).IsErr() {
|
||||
if !m.Cmdy(arg[0], s.CheckRole, role).IsErr() {
|
||||
m.Cmdy(arg)
|
||||
}
|
||||
}
|
||||
if len(arg) > 0 && strings.HasSuffix(arg[0], ".portal") {
|
||||
return
|
||||
}
|
||||
if kit.IndexOf(arg, mdb.INPUTS) == -1 {
|
||||
if sub != mdb.INPUTS {
|
||||
s.Place.RewriteAppend(m)
|
||||
}
|
||||
})
|
||||
}
|
||||
func (s Portal) List(m *ice.Message, arg ...string) {
|
||||
if m.Option(mdb.VIEW) == mdb.TABLE || len(arg) > 0 && arg[0] == mdb.TABLE {
|
||||
s.Hash.List(m, kit.Slice(arg, 1)...).PushAction(mdb.DETAIL, s.Hash.Remove).Action().SortInt(mdb.ORDER)
|
||||
if m.Option(mdb.VIEW) == mdb.TABLE {
|
||||
s.Hash.List(m, arg...).PushAction(mdb.DETAIL, s.Remove).SortInt(mdb.ORDER)
|
||||
return
|
||||
}
|
||||
if m.Option(model.USER_UID) == "" {
|
||||
if msg := m.Cmd(s.user, s.Table.Select, model.OPEN_ID, m.Option(ice.MSG_USERNAME)); msg.Length() == 0 {
|
||||
msg := m.Cmd(s.user, s.Table.Create, m.Option(ice.MSG_USERNAME), "", m.OptionDefault(ice.MSG_USERNICK, m.Option(ice.MSG_USERNAME)))
|
||||
m.ProcessCookie(model.USER_UID, msg.Result())
|
||||
} else {
|
||||
m.ProcessCookie(model.USER_UID, msg.Append(model.UID))
|
||||
}
|
||||
return
|
||||
}
|
||||
if m.Cmd(s.user, s.Table.Select, model.UID, m.Option(model.USER_UID)).Length() == 0 {
|
||||
m.Cmd(s.user, s.Table.Insert, model.UID, m.Option(model.USER_UID), model.OPEN_ID, m.Option(ice.MSG_USERNAME), model.NAME, m.OptionDefault(ice.MSG_USERNICK, m.Option(ice.MSG_USERNAME)))
|
||||
}
|
||||
m.Option(model.SERVICE_UID, ServiceUID(m))
|
||||
if len(arg) == 0 {
|
||||
m.Cmdy(m.PrefixKey(), s.PlaceList, m.Option(model.USER_UID)).PushAction(s.PlaceRemove).Action(s.PlaceCreate)
|
||||
kit.If(m.Length() > 0, func() { m.EchoQRCode(m.Cmdx("", s.Link)) })
|
||||
s.Button(m, "", s.PlaceCreate)
|
||||
} else {
|
||||
if msg := s.PlaceListOption(m, arg...); arg[0] != "" && msg.Length() > 0 {
|
||||
defer s.AddRecent(msg, arg[0])
|
||||
defer m.EchoQRCode(m.Cmdx("", s.Link, arg[0]))
|
||||
USER_PLACE_ROLE := s.Keys(s.UserPlace, model.ROLE)
|
||||
m.Cmdy(m.PrefixKey(), s.PlaceList, m.Option(model.USER_UID)).Table(func(value ice.Maps) {
|
||||
switch UserPlaceRole(kit.Int(value[USER_PLACE_ROLE])) {
|
||||
case UserPlaceCreator, UserPlaceLandlord:
|
||||
if value[model.AUTH_STATUS] == "" {
|
||||
m.PushButton(s.PlaceAuth, s.PlaceRemove)
|
||||
break
|
||||
}
|
||||
fallthrough
|
||||
default:
|
||||
m.PushButton(s.PlaceRemove)
|
||||
}
|
||||
}).Action(s.PlaceCreate, s.ScanQRCode, s.PlaceSearch)
|
||||
kit.If(!m.IsErr() && m.Length() == 0, func() { m.EchoInfoButton("", s.PlaceCreate, s.ScanQRCode, s.PlaceSearch) })
|
||||
} else if len(arg) == 1 {
|
||||
if arg[0] != "" {
|
||||
msg := s.PlaceListOption(m, arg...)
|
||||
m.Option(model.PLACE_NAME, msg.Append(s.Keys(s.Place, model.NAME)))
|
||||
m.Option(model.STREET_NAME, msg.Append(s.Keys(s.Street, model.NAME)))
|
||||
s.AddRecent(msg, arg[0])
|
||||
}
|
||||
s.Hash.List(m).SortInt(mdb.ORDER)
|
||||
m.RewriteAppend(func(value, key string, index int) string {
|
||||
if key == "icons" {
|
||||
value = m.Resource(value)
|
||||
}
|
||||
return value
|
||||
})
|
||||
} else if len(arg) == 2 {
|
||||
s.PlaceListOption(m, arg...)
|
||||
m.Option(model.COMMAND_UID, s.Hash.List(m.Spawn(), arg[1]).Append(model.COMMAND_UID))
|
||||
m.Cmdy(ctx.COMMAND, arg[1]).Push(ctx.ARGS, arg[0])
|
||||
} else {
|
||||
m.FieldsSetDetail().Cmdy(arg[1], mdb.SELECT, model.UID, arg[2]).Action()
|
||||
}
|
||||
s.Place.RewriteAppend(m)
|
||||
if true {
|
||||
p := kit.ExtChange(m.Resource(ctx.GetCmdFile(m.Message, m.PrefixKey())), "js")
|
||||
defer func() { m.Option(ice.MSG_DISPLAY, p+","+m.Option(ice.MSG_DISPLAY)) }()
|
||||
}
|
||||
s.DisplayBase(m, "").DisplayCSS("")
|
||||
}
|
||||
func (s Portal) PlaceListOption(m *ice.Message, arg ...string) *ice.Message {
|
||||
msg := m.Cmd("", s.PlaceList, m.Option(model.USER_UID), arg[0])
|
||||
msg := m.Cmd(m.PrefixKey(), s.PlaceList, m.Option(model.USER_UID), arg[0])
|
||||
if msg.Length() == 0 {
|
||||
msg = m.Cmd(s.Place, s.Table.Select, model.UID, arg[0])
|
||||
if msg.Length() == 0 {
|
||||
return msg
|
||||
}
|
||||
msg.Push(s.Keys(s.UserPlace, model.ROLE), "0")
|
||||
msg.RenameAppend(model.NAME, s.Keys(s.Place, model.NAME),
|
||||
model.INFO, s.Keys(s.Place, model.INFO),
|
||||
model.AVATAR, s.Keys(s.Place, model.AVATAR),
|
||||
model.TYPE, s.Keys(s.Place, model.TYPE),
|
||||
)
|
||||
msg.RenameAppend(model.NAME, s.Keys(s.Place, model.NAME), model.TYPE, s.Keys(s.Place, model.TYPE))
|
||||
s.SelectJoin(msg, s.Street, model.NAME, model.CITY_UID)
|
||||
s.SelectJoinCity(msg)
|
||||
s.SelectJoinAuth(msg)
|
||||
}
|
||||
if kit.Int(msg.Append(s.Keys(s.UserPlace, model.ROLE))) == 0 {
|
||||
msg.Append(model.DASHBOARD_UID, "")
|
||||
}
|
||||
s.Place.RewriteAppend(msg)
|
||||
m.Options(msg.AppendSimple(model.CITY_NAME, s.Keys(s.Street, model.NAME),
|
||||
s.Keys(s.Place, model.NAME), s.Keys(s.Place, model.TYPE), s.Keys(s.UserPlace, model.ROLE), model.MEMBER_STATUS,
|
||||
model.AUTH_STATUS, model.AUTH_NAME, model.AUTH_INFO, model.AUTH_AVATAR, model.AUTH_BACKGROUND, model.DASHBOARD_UID,
|
||||
))
|
||||
m.Option(model.STREET_NAME, msg.Append(s.Keys(s.Street, model.NAME)))
|
||||
m.Option(model.PLACE_NAME, msg.Append(s.Keys(s.Place, model.NAME)))
|
||||
m.Options(msg.AppendSimple(model.AUTH_STATUS, s.Keys(s.Place, model.NAME), s.Keys(s.Place, model.TYPE), s.Keys(s.UserPlace, model.ROLE), s.Keys(s.Street, model.NAME), model.CITY_NAME))
|
||||
return msg
|
||||
}
|
||||
func (s Portal) PlaceCreate(m *ice.Message, arg ...string) {
|
||||
defer m.ToastProcess()()
|
||||
if s.city.FindOrCreateByName(m, arg...); m.IsErr() {
|
||||
return
|
||||
} else if s.Street.FindOrCreateByName(m, arg...); m.IsErr() {
|
||||
return
|
||||
}
|
||||
prefix := s.Keys(s.Place, "")
|
||||
for i := 0; i < len(arg); i += 2 {
|
||||
arg[i] = kit.TrimPrefix(arg[i], prefix)
|
||||
}
|
||||
if m.Options(arg).Cmdy(s.Place, s.Insert, arg[2:]).IsErr() {
|
||||
name := m.Option(s.Keys(s.Place, model.NAME))
|
||||
arg = kit.TransArgKeys(arg, s.Keys(s.Place, model.TYPE), model.TYPE)
|
||||
arg = kit.TransArgKeys(arg, s.Keys(s.Place, model.NAME), model.NAME)
|
||||
if m.Cmdy(s.Place, s.Create, arg[2:]).IsErr() {
|
||||
return
|
||||
}
|
||||
s.RecordEventWithName(m.Options(s.Keys(s.Place, model.UID), m.Result()), "")
|
||||
s.RecordEventWithName(m.Options(mdb.NAME, name, s.Keys(s.Place, model.UID), m.Result()), "")
|
||||
args := kit.Simple(m.OptionSimple(s.Keys(s.Place, model.UID), model.USER_UID), model.ROLE, UserPlaceCreator)
|
||||
m.SetResult().Cmdy(s.UserPlace, s.Insert, args)
|
||||
args = append(args, s.Keys(s.UserPlace, model.UID), m.Result())
|
||||
m.Options(args).Cmd("", s.AfterPlaceCreate, args)
|
||||
m.SetResult().Cmdy(s.UserPlace, s.Create, args)
|
||||
}
|
||||
func (s Portal) PlaceRemove(m *ice.Message, arg ...string) {
|
||||
m.Cmd("", s.BeforePlaceRemove, m.OptionSimple(model.USER_UID, model.UID))
|
||||
defer m.ToastProcess()()
|
||||
m.Cmdy(s.UserPlace, s.Delete, m.OptionSimple(model.USER_UID, model.UID))
|
||||
}
|
||||
func (s Portal) PlaceCheck(m *ice.Message, arg ...string) {
|
||||
if m.PrefixKey() == api.RENZHENGSHOUQUAN_PORTAL {
|
||||
return
|
||||
}
|
||||
s.Tables(m, kit.Format("LEFT JOIN %s ON %s = %s and %s IS NULL",
|
||||
s.TableNames(s.UserPlace),
|
||||
s.Key(s.UserPlace, s.Keys(s.Place, model.UID)),
|
||||
s.Key(s.Place, model.UID),
|
||||
s.Key(s.UserPlace, model.DELETED_AT),
|
||||
)).Fields(m,
|
||||
s.Key(s.Place, model.UID),
|
||||
s.Key(s.Place, model.NAME),
|
||||
s.Key(s.Place, model.INFO),
|
||||
s.Key(s.Place, model.AUTH_UID),
|
||||
)
|
||||
m.Cmdy(s.Place, s.Table.Select, kit.Format("%s IS NULL", model.USER_UID))
|
||||
m.Table(func(value ice.Maps) { m.Push(model.INDEX, m.PrefixKey()) }).DisplayTable()
|
||||
}
|
||||
func (s Portal) PlaceTrash(m *ice.Message, arg ...string) {
|
||||
m.Cmd(s.PrefixPortal(m), s.AfterPlaceTrash)
|
||||
defer m.Cmd(s.PrefixPortal(m), s.BeforePlaceTrash)
|
||||
m.Option("__place_uid", s.Keys(s.Place, model.UID))
|
||||
for key, _ := range m.Target().Commands {
|
||||
if strings.HasPrefix(key, "_") {
|
||||
continue
|
||||
}
|
||||
if kit.IsIn(key, "cleanup", "portal", "service") {
|
||||
continue
|
||||
}
|
||||
if s.Key(s.UserPlace, model.UID) == kit.Keys(s.TableName(key), model.UID) {
|
||||
continue
|
||||
}
|
||||
if s.Key(s.Place, model.UID) == kit.Keys(s.TableName(key), model.UID) {
|
||||
continue
|
||||
}
|
||||
m.Cmdy(m.Prefix(key), s.PlaceTrash)
|
||||
}
|
||||
if m.Cmd(s.Place, s.Delete); m.PrefixKey() == api.RENZHENGSHOUQUAN_PORTAL {
|
||||
m.Cmd(s.UserPlace, s.RemoveBy, model.AUTH_UID, m.Option(model.UID))
|
||||
}
|
||||
m.DisplayTable()
|
||||
}
|
||||
func (s Table) PlaceTrash(m *ice.Message, arg ...string) {
|
||||
if m.Configv("db") == nil {
|
||||
return
|
||||
}
|
||||
if m.Push("key", m.PrefixKey()); s.Place == nil {
|
||||
s.RemoveBy(m, kit.Format("%s = ?", m.Option("__place_uid")), m.Option(model.UID))
|
||||
m.Push("table", s.TableName(m.CommandKey())).Push(model.PLACE_UID, m.Option("__place_uid"))
|
||||
} else {
|
||||
s.RemoveBy(m, "place_uid = ?", m.Option(model.UID))
|
||||
m.Push("table", s.TableNames(s.Place)).Push(model.PLACE_UID, "place_uid")
|
||||
}
|
||||
}
|
||||
func (s Portal) PlaceList(m *ice.Message, arg ...string) *ice.Message {
|
||||
s.Tables(m, s.Place).FieldsWithCreatedAT(m, s.UserPlace, s.Keys(s.Place, model.UID),
|
||||
s.Tables(m, s.Place).FieldsWithCreatedAT(m, s.UserPlace, model.AUTH_UID, model.INIT,
|
||||
s.Keys(s.Place, model.NAME), s.Keys(s.Place, model.TYPE), s.Keys(s.UserPlace, model.ROLE),
|
||||
s.Key(s.Place, model.INIT), s.AS(s.Key(s.UserPlace, model.STATUS), model.MEMBER_STATUS),
|
||||
s.Keys(s.Street, model.UID), model.AUTH_UID,
|
||||
s.Keys(s.Place, model.UID), s.Keys(s.Street, model.UID),
|
||||
)
|
||||
if len(arg) == 1 {
|
||||
m.Cmdy(s.UserPlace, s.Table.Select, model.USER_UID, arg[0])
|
||||
@ -299,124 +176,38 @@ func (s Portal) PlaceList(m *ice.Message, arg ...string) *ice.Message {
|
||||
return m
|
||||
}
|
||||
func (s Portal) PlaceAuth(m *ice.Message, arg ...string) {
|
||||
if m.Option(model.AUTH_UID) != "" {
|
||||
return
|
||||
}
|
||||
msg := m.Cmd(s.Place, s.Table.Select, model.UID, m.Option(s.Keys(s.Place, model.UID)))
|
||||
street := m.Cmd(s.Street, s.Table.Select, model.UID, msg.Append(s.Keys(s.Street, model.UID)))
|
||||
m.Option(model.COMPANY_NAME, street.Append(model.NAME))
|
||||
m.Option(s.Keys(s.Street, model.NAME), street.Append(model.NAME))
|
||||
m.Option(s.Keys(s.Place, model.NAME), msg.Append(model.NAME))
|
||||
s.AutoCmdy(m, api.RENZHENGSHOUQUAN_PORTAL, s.PlaceCreate,
|
||||
model.AUTH_NAME, msg.Append(model.NAME), model.AUTH_TYPE, 3, model.FROM_UID, street.Append(model.AUTH_UID),
|
||||
model.SERVICE_UID, ServiceUID(m), model.PLACE_UID, msg.Append(model.UID),
|
||||
)
|
||||
m.Cmd(s.Place, s.UpdateField, m.OptionSimple(model.AUTH_UID), model.UID, msg.Append(model.UID))
|
||||
s.RecordEventWithName(m.Options(msg.AppendSimple(model.NAME, model.UID)), "")
|
||||
msg.Append(model.AUTH_UID, m.Option(model.AUTH_UID))
|
||||
msg.Cmd(s.Prefix(msg, s), s.AfterPlaceAuth)
|
||||
}
|
||||
|
||||
func (s Portal) ValueCreate(m *ice.Message, arg ...string) {
|
||||
s.Table.Insert(m, kit.Simple(arg, m.OptionSimple(s.Keys(s.Place, model.UID), model.USER_UID))...)
|
||||
}
|
||||
func (s Portal) ValueRemove(m *ice.Message, arg ...string) {
|
||||
s.Table.Delete(m, m.OptionSimple(s.Keys(s.Place, model.UID), model.UID)...)
|
||||
}
|
||||
func (s Portal) ValueModify(m *ice.Message, arg ...string) {
|
||||
s.Table.Update(m, kit.Dict(arg), m.OptionSimple(s.Keys(s.Place, model.UID), model.UID)...)
|
||||
}
|
||||
func (s Portal) ValueList(m *ice.Message, arg ...string) {
|
||||
PLACE_UID := s.Keys(s.Place, model.UID)
|
||||
if len(arg) == 0 {
|
||||
if m.Option(PLACE_UID) != "" {
|
||||
s.Table.Select(m, m.OptionSimple(PLACE_UID)...)
|
||||
if m.Option(model.AUTH_UID) == "" {
|
||||
place_uid := m.Option(s.Keys(s.Place, model.UID))
|
||||
place_name := m.Option(s.Keys(s.Place, model.NAME))
|
||||
m.Option(model.COMPANY_NAME, m.Option(s.Keys(s.Street, model.NAME)))
|
||||
msg := s.SpaceCmd(m, "20240724-community", "web.team.renzhengshouquan.portal", "placeCreate", m.OptionSimple(model.CITY_NAME, model.COMPANY_NAME),
|
||||
model.AUTH_TYPE, ice.AUTO, model.AUTH_NAME, place_name, model.FROM_UID, ice.AUTO)
|
||||
if msg.IsErr() {
|
||||
m.Copy(msg)
|
||||
return
|
||||
}
|
||||
return
|
||||
}
|
||||
s.Table.FieldsWithCreatedAT(m, m.Option(db.TARGET), m.Optionv(mdb.FIELDS).([]ice.Any)...)
|
||||
if len(arg) == 1 {
|
||||
s.Table.Select(m, PLACE_UID, arg[0]).Action(s.Create)
|
||||
} else if len(arg) == 2 {
|
||||
s.Table.SelectDetail(m, PLACE_UID, arg[0], model.UID, arg[1])
|
||||
m.Cmd(s.Place, s.UpdateAuth, msg.Option(model.AUTH_UID), model.UID, place_uid)
|
||||
s.RecordEventWithName(m.Options(model.NAME, place_name, model.UID, place_uid), "")
|
||||
} else {
|
||||
return
|
||||
}
|
||||
if s.IsVisitor(m) {
|
||||
m.Action()
|
||||
} else {
|
||||
m.PushAction(s.Remove)
|
||||
m.ProcessHold()
|
||||
}
|
||||
}
|
||||
func (s Portal) BeforePlaceCreate(m *ice.Message, arg ...string) {}
|
||||
func (s Portal) AfterPlaceCreate(m *ice.Message, arg ...string) {}
|
||||
func (s Portal) BeforePlaceRemove(m *ice.Message, arg ...string) {}
|
||||
func (s Portal) AfterPlaceRemove(m *ice.Message, arg ...string) {}
|
||||
func (s Portal) BeforePlaceTrash(m *ice.Message, arg ...string) {}
|
||||
func (s Portal) AfterPlaceTrash(m *ice.Message, arg ...string) {}
|
||||
func (s Portal) BeforePlaceAuth(m *ice.Message, arg ...string) {}
|
||||
func (s Portal) AfterPlaceAuth(m *ice.Message, arg ...string) {}
|
||||
|
||||
func (s Portal) AddRecent(m *ice.Message, arg ...string) {
|
||||
args := kit.Simple(model.PLACE_UID, arg[0], m.OptionSimple(model.SERVICE_UID, model.PLACE_NAME, model.STREET_NAME, model.CITY_NAME))
|
||||
kit.If(kit.IsIn(m.Append(model.AUTH_STATUS), "2", "issued"), func() { args = append(args, model.AUTH_STATUS, "2") })
|
||||
m.Cmd(s.Prefix(m, s.recent), s.Create, args)
|
||||
func (s Portal) PlaceSearch(m *ice.Message, arg ...string) {
|
||||
m.ProcessRewrite(model.INDEX, s.Prefix(m, search{}))
|
||||
}
|
||||
func (s Portal) RecordEvent(m *ice.Message, arg ...string) {
|
||||
s.event.Record(m.Spawn(kit.Dict(model.PLACE_UID, m.Option(s.Keys(s.Place, model.UID)))), arg[0], arg[1:]...)
|
||||
}
|
||||
func (s Portal) MarketInsert(m *ice.Message, arg ...string) {
|
||||
// m.Option(model.PLACE_UID, m.Option(s.Keys(s.Place, model.UID)))
|
||||
m.Option(ctx.ARGS, kit.Join([]string{m.Option(model.PLACE_UID), m.Option(model.UID)}))
|
||||
m.Cmdy(s.Prefix(m, market{}), s.Create, arg)
|
||||
}
|
||||
func (s Portal) PushPublic(m *ice.Message, arg ...string) {
|
||||
m.Option(model.PLACE_UID, m.Option(s.Keys(s.Place, model.UID)))
|
||||
m.Option(ctx.ARGS, kit.Join([]string{m.Option(model.PLACE_UID), m.Option(model.UID)}))
|
||||
m.Cmdy(s.Prefix(m, market{}), s.Create, arg)
|
||||
}
|
||||
func (s Portal) DashboardCreate(m *ice.Message, name string, arg ...string) func() {
|
||||
defer s.SaveBack(m, ice.MSG_USERPOD)()
|
||||
kit.If(name == "", func() { name = m.Option(s.Keys(s.Place, model.NAME)) })
|
||||
s.AutoCmdy(m, api.DASHBOARD_PORTAL, s.PlaceCreate, m.OptionSimple(model.CITY_NAME, model.COMPANY_NAME), model.DASHBOARD_NAME, name, model.DASHBOARD_TYPE, "0")
|
||||
s.AutoCmd(m, api.RENZHENGSHOUQUAN_AUTH, s.UpdateField, m.OptionSimple(model.DASHBOARD_UID), model.UID, m.Option(model.AUTH_UID))
|
||||
return func() { s.DashboardUpdate(m) }
|
||||
}
|
||||
func (s Portal) DashboardInsert(m *ice.Message, score int, title, unit string, index ice.Any, field string, arg ...ice.Any) {
|
||||
kit.If(len(arg) == 0, func() { arg = append(arg, m.OptionSimple(s.Keys(s.Place, model.UID))) })
|
||||
s.AutoCmd(m, api.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, model.UNIT, unit, m.OptionSimple(model.DASHBOARD_UID))
|
||||
}
|
||||
func (s Portal) DashboardUpdate(m *ice.Message, arg ...string) {
|
||||
if m.Option(model.DASHBOARD_UID) != "" {
|
||||
s.AutoCmd(m, api.DASHBOARD_SUMMARY, "scan", kit.Dict(m.OptionSimple(model.DASHBOARD_UID)))
|
||||
}
|
||||
}
|
||||
func (s Portal) StorageCreate(m *ice.Message, name string, arg ...string) {
|
||||
kit.If(name == "", func() { name = m.Option(s.Keys(s.Place, model.NAME)) })
|
||||
// s.AutoCmdy(m, api.STORAGE_PORTAL, s.PlaceCreate, m.OptionSimple(model.CITY_NAME, model.COMPANY_NAME), model.STORAGE_NAME, name, model.STORAGE_TYPE, "0")
|
||||
s.AutoCmd(m, api.RENZHENGSHOUQUAN_AUTH, s.UpdateField, m.OptionSimple(model.STORAGE_UID))
|
||||
}
|
||||
func (s Portal) StorageInsert(m *ice.Message, title, content string) {
|
||||
// s.AutoCmd(m, api.STORAGE_FILE, s.Insert, model.TITLE, title, model.CONTENT, content, m.OptionSimple(model.STORAGE_UID, model.USER_UID))
|
||||
}
|
||||
func (s Table) NoticeList(m *ice.Message, arg ...string) {
|
||||
s.Limit(m, 1)
|
||||
m.Cmdy(s.Prefix(m, notice{}), arg)
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(Portal{Table: newTable()}) }
|
||||
|
||||
func (s Portal) UserPlaceRole(m *ice.Message, arg ...string) *ice.Message {
|
||||
if m.Option(model.USER_ROLE) == "" {
|
||||
msg := m.Cmd(s.UserPlace, s.Table.Select, m.OptionSimple(s.Keys(s.Place, model.UID), model.USER_UID))
|
||||
if MemberStatus(kit.Int(msg.Append(model.STATUS))) == MemberNormal {
|
||||
m.Option(model.USER_ROLE, msg.Append(model.ROLE))
|
||||
} else {
|
||||
m.Option(model.USER_ROLE, "0")
|
||||
func (s Portal) ScanQRCode(m *ice.Message, arg ...string) {
|
||||
defer m.ToastProcess()()
|
||||
if m.Option(mdb.TYPE) == mdb.TEXT {
|
||||
m.Cmdy(s.UserPlace, s.Create, s.Key(s.Place, model.UID), m.Option(mdb.TEXT), m.OptionSimple(model.USER_UID), model.ROLE, UserPlaceVisitor)
|
||||
} else if m.Option(mdb.TYPE) == web.LINK {
|
||||
args := m.ParseURL(m.Option(mdb.TEXT))
|
||||
if len(args) > 1 && args[1] == s.Prefix(m, apply{}) {
|
||||
m.Cmdy(s.UserPlace, s.Create, s.Keys(s.Place, model.UID), args[0], m.OptionSimple(model.USER_UID), model.ROLE, UserPlaceVisitor)
|
||||
}
|
||||
}
|
||||
return m
|
||||
}
|
||||
func (s Portal) UserPlaceRole(m *ice.Message, arg ...string) {
|
||||
m.Echo(m.Cmd(s.UserPlace, s.Table.Select, m.OptionSimple(s.Keys(s.Place, model.UID), model.USER_UID)).Append(model.ROLE))
|
||||
}
|
||||
func (s Portal) UserPlaceCmd(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(s.UserPlace, arg)
|
||||
@ -424,44 +215,48 @@ func (s Portal) UserPlaceCmd(m *ice.Message, arg ...string) {
|
||||
func (s Portal) PlaceCmd(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(s.Place, arg)
|
||||
}
|
||||
func (s Portal) RecordEvent(m *ice.Message, arg ...string) {
|
||||
s.event.Record(m.Spawn(kit.Dict(model.PLACE_UID, m.Option(s.Keys(s.Place, model.UID)))), arg[0], arg[1:]...)
|
||||
}
|
||||
func (s Portal) AddRecent(m *ice.Message, arg ...string) {
|
||||
m.Options(m.ConfigSimple(model.SERVICE_UID))
|
||||
if kit.IsIn(m.Append(model.AUTH_STATUS), "2", "issued") {
|
||||
m.Cmd(s.Prefix(m, s.recent), s.Create, s.GetCommands(m, model.SERVICE_UID, arg...), model.AUTH_STATUS, "2")
|
||||
} else {
|
||||
m.Cmd(s.Prefix(m, s.recent), s.Create, s.GetCommands(m, model.SERVICE_UID, arg...))
|
||||
}
|
||||
}
|
||||
|
||||
func (s Portal) CommandUpdate(m *ice.Message, arg ...string) {
|
||||
func init() { ice.TeamCtxCmd(Portal{Table: newTable()}) }
|
||||
|
||||
func (s Portal) UpdateCommand(m *ice.Message, arg ...string) {
|
||||
m.Config(model.SERVICE_UID, arg[0])
|
||||
s.Hash.Select(m.Spawn()).Table(func(value ice.Maps) {
|
||||
m.Cmdx(command{}, s.Table.Modify, model.SERVICE_UID, arg[0], model.INDEX, value[model.INDEX], model.NAME, value[model.NAME], mdb.ICON, value[mdb.ICONS])
|
||||
uid := m.Cmdx(s.command, s.Table.Update, model.SERVICE_UID, arg[0], mdb.ICON, value[mdb.ICONS], model.NAME, value[model.NAME], model.INDEX, value[model.INDEX])
|
||||
s.Hash.Modify(m, ctx.INDEX, value[ctx.INDEX], model.COMMAND_UID, uid)
|
||||
})
|
||||
}
|
||||
func (s Portal) CommandSelect(m *ice.Message, arg ...string) {
|
||||
func (s Portal) SelectCommand(m *ice.Message, arg ...string) {
|
||||
s.Hash.Select(m, arg...)
|
||||
}
|
||||
|
||||
func (s Portal) Create(m *ice.Message, arg ...string) {
|
||||
args := m.OptionSimple(ctx.INDEX)
|
||||
args := []string{ctx.INDEX, m.Option(ctx.INDEX)}
|
||||
msg := s.Hash.Select(m.Spawn(), m.Option(ctx.INDEX))
|
||||
kit.If(msg.Length() > 0, func() { args = append(args, mdb.TIME, msg.Append(mdb.TIME)) })
|
||||
m.Search(m.Option(ctx.INDEX), func(key string, cmd *ice.Command) {
|
||||
args = append(args, mdb.NAME, cmd.Help, mdb.ICONS, cmd.Icon)
|
||||
kit.For([]string{mdb.ORDER, mdb.TYPE, aaa.ROLE, aaa.AUTH, mdb.VIEW}, func(key string) {
|
||||
kit.For([]string{mdb.ORDER, mdb.TYPE, aaa.ROLE, mdb.VIEW}, func(key string) {
|
||||
value := m.Conf(m.Option(ctx.INDEX), kit.Keym(key))
|
||||
args = append(args, key, kit.Select(value, msg.Append(key)))
|
||||
})
|
||||
})
|
||||
s.Hash.Create(m, args...)
|
||||
}
|
||||
func (s Portal) Remove(m *ice.Message, arg ...string) { s.Hash.Remove(m, arg...) }
|
||||
func (s Portal) Modify(m *ice.Message, arg ...string) { s.Hash.Modify(m, arg...) }
|
||||
func (s Portal) Show(m *ice.Message, arg ...string) {
|
||||
m.Cmd(s.Prefix(m, s), s.Create, ctx.INDEX, m.PrefixKey())
|
||||
}
|
||||
func (s Portal) Link(m *ice.Message, arg ...string) *ice.Message {
|
||||
if len(arg) == 0 {
|
||||
return m.Echo(m.MergePodCmd("", s.Prefix(m, s)))
|
||||
}
|
||||
p := m.MergePodCmd("", s.Prefix(m, s), s.Keys(s.Place, model.UID), arg[0])
|
||||
if len(arg) == 1 {
|
||||
return m.Echo(p)
|
||||
}
|
||||
h := kit.TrimSuffix(kit.Join([]string{arg[0], kit.Select("", arg, 1), kit.Select("", arg, 2)}, ":"), ":", ":")
|
||||
return m.Echo(p + "#" + h)
|
||||
func (s Portal) Link(m *ice.Message, arg ...string) string {
|
||||
return m.MergePodCmd("", s.Prefix(m, s)) + "#" + kit.TrimSuffix(kit.Join([]string{arg[0], kit.Select(s.Prefix(m, apply{}), arg, 1), kit.Select("", arg, 2)}, ":"), ":")
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(Portal{Table: newTable()}) }
|
||||
|
@ -1,300 +1,274 @@
|
||||
var UID = "uid", PLACE_UID = "place_uid", PLACE_NAME = "place_name", PLACE_TYPE = "place_type", STREET_NAME = "street_name", CITY_NAME = "city_name"
|
||||
var USER_UID = "user_uid", USER_ROLE = "user_role", AUTH_UID = "auth_uid", AUTH_TYPE = "auth_type"
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.onappend.style(can, html.OUTPUT), can.onimport.myPortal(can, msg)
|
||||
if (can.user.isMobile && can.isCmdMode()) { can.onappend.style(can, html.OUTPUT)
|
||||
can.onmotion.delay(can, function() { can.sup.onimport.size(can.sup, window.innerHeight, window.innerWidth) })
|
||||
can.onmotion.delay(can, function() { can.sup.onimport.size(can.sup, window.innerHeight, window.innerWidth) }, 300)
|
||||
can.onmotion.delay(can, function() { can.sup.onimport.size(can.sup, window.innerHeight, window.innerWidth) }, 3000)
|
||||
}
|
||||
can.onimport.myPortal(can, msg)
|
||||
},
|
||||
otherList: function(can, msg, action) { if (!msg.IsDetail()) { return } typeof action == "string" && (action = [action])
|
||||
can.core.Next(action, function(action, next) {
|
||||
can.run(can.request({}, {uid: msg.Append(UID)}), action, function(msg) { if (msg.Length() == 0) { return next() }
|
||||
can.page.Append(can, can._output, [{view: [[html.ITEM, html.TITLE, action], "", can.user.trans(can, action)]}])
|
||||
can.onappend.plugin(can, {index: can.ConfIndex()}, function(sub) { can.onimport.myField(can, sub)
|
||||
sub.run = function(event, cmds, cb) {
|
||||
if (!cmds || cmds.length == 0) { cb(msg) } else { can.run(event, cmds, cb) }
|
||||
}, next()
|
||||
sub.onexport.output = function(_sub, msg) {
|
||||
_sub.onaction.carddetail = function(event, _sub, value) {
|
||||
can.onimport.myStory(can, {index: msg.Option("_command"), args: [msg.Option("place_uid"), value.uid]})
|
||||
return true
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
qrcode: function(can, msg, avatar, target) { target = target||can.ui.output, can.onappend.board(can, msg, target)
|
||||
can.page.Append(can, can.page.SelectOne(can, target, "div.code"), [{img: can.misc.Resource(can, avatar||can.ConfIcons()||can.user.info.favicon), className: "avatar"}])
|
||||
typeStyle: function(can, value, key) { return can.Conf("_trans.value."+key+".style."+value[key])||"" },
|
||||
roleStyle: function(can, value, key) { return can.Conf("_trans.value."+key+".style."+value[key])||"" },
|
||||
timeView: function(can, value) { return {text: [can.base.TimeTrim(value.updated_at||value.created_at), "", "time"]} },
|
||||
authView: function(can, value) {
|
||||
return can.base.isIn(value.auth_status, "issued", "2") && {view: ["auth", html.SPAN], list: [{icon: "bi bi-patch-check-fill", style: {color: "var(--notice-bg-color)"}}]}
|
||||
},
|
||||
myValue: function(can, value) { return [
|
||||
{view: html.TITLE, list: [value.auth_name||value._name, can.onimport.authView(can, value),
|
||||
{text: [value.__type, "", [mdb.TYPE, value._type, value._type_style]]}, value._role != "visitor" && {text: [value.__role, "", [aaa.ROLE, value._role, value._role_style]]},
|
||||
{view: html.TITLE, list: [value._name,
|
||||
can.base.isIn(value.auth_status, "issued", "2") && {view: ["auth", html.SPAN], list: [{icon: "bi bi-patch-check-fill", style: {color: "var(--notice-bg-color)"}}]},
|
||||
{text: [value.__type, "", [mdb.TYPE, value._type, value._type_style]]},
|
||||
value._role != "visitor" && {text: [value.__role, "", [aaa.ROLE, value._role, value._role_style]]},
|
||||
]},
|
||||
can.ConfIndex() != "web.team.renzhengshouquan.portal" && {view: html.STATUS, list: [value.city_name, value._street, can.ConfHelp(), can.user.info.titles]},
|
||||
{view: html.STATUS, list: [value.auth_info||value._info]},
|
||||
{view: html.STATUS, list: [value.uid.slice(0, 6), value.city_name, value._street]},
|
||||
] },
|
||||
myTrans: function(can, value) {
|
||||
var PLACE_UID = can.Conf("_place_uid"), PLACE_NAME = can.Conf("_place_name"), PLACE_TYPE = can.Conf("_place_type")
|
||||
var USER_PLACE_ROLE = can.Conf("_user_place_role"), STREET_NAME = can.Conf("_street_name")
|
||||
value.icons = value.icons||value.avatar||value.auth_avatar||can.Conf(can.core.Keys("_trans.value", PLACE_TYPE, mdb.ICONS, value[PLACE_TYPE]||"what"))
|
||||
value._uid = value[PLACE_UID], value._name = value[PLACE_NAME], value._street = value[STREET_NAME]
|
||||
value._type = value[PLACE_TYPE], value.__type = can.user.transValue(can, value, PLACE_TYPE), value._type_style = can.onimport.typeStyle(can, value, PLACE_TYPE)
|
||||
value._role = value[USER_PLACE_ROLE], value.__role = can.user.transValue(can, value, USER_PLACE_ROLE), value._role_style = can.onimport.roleStyle(can, value, USER_PLACE_ROLE)
|
||||
return value
|
||||
},
|
||||
myTitle: function(can, name, help, target) {
|
||||
can.page.Appends(can, target||can.ui.list, [{view: html.TITLE, list: [{text: can.user.trans(can, name, help)}]}])
|
||||
},
|
||||
myPortal: function(can, msg) { can.sup.current = {}
|
||||
can.page.tagis(document.body, "body.width1") && (can.user.isMobile = true, can.sup.user.isMobile = true)
|
||||
can.onmotion.delay(can, function() {
|
||||
can.page.tagis(document.body, "body.width1") && (can.user.isMobile = true, can.sup.user.isMobile = true)
|
||||
}, 300)
|
||||
can.core.List(["_place_uid", "_place_name", "_place_type", "_user_place_role", "_street_name"], function(key) { can.Conf(key, msg.Option(key)) })
|
||||
var PLACE_UID = can.Conf("_place_uid"), PLACE_NAME = can.Conf("_place_name"), PLACE_TYPE = can.Conf("_place_type")
|
||||
var USER_PLACE_ROLE = can.Conf("_user_place_role"), STREET_NAME = can.Conf("_street_name")
|
||||
can.user.isMobile && (can.db.hash = [])
|
||||
can.isCmdMode() && (can.db.hash = can.base.Obj(can.misc.SearchHash(can), can.db.hash)), can.db.hash[0] && can.onexport.place(can, can.db.hash[0])
|
||||
if (can.sup._goback) { can.db.hash = can.db.hash.slice(0, 1) }
|
||||
if (can.db.hash.length > 1 && can.db.hash[1]) {
|
||||
can.sup.current = can.onimport.myTrans(can, kit.Dict(msg.OptionSimple(PLACE_UID, PLACE_NAME, PLACE_TYPE, USER_PLACE_ROLE, STREET_NAME, CITY_NAME)))
|
||||
return can.runAction({}, ctx.COMMAND, [can.db.hash[1]], function(msg) { msg.Table(function(value) {
|
||||
value.args = [can.db.hash[0]].concat(can.db.hash.slice(2)), can.onimport.myStory(can, value)
|
||||
}) })
|
||||
myPortal: function(can, msg) {
|
||||
var PLACE_UID = msg.Option("_place_uid"), PLACE_NAME = msg.Option("_place_name"), PLACE_TYPE = msg.Option("_place_type")
|
||||
var USER_PLACE_ROLE = msg.Option("_user_place_role"), STREET_NAME = msg.Option("_street_name")
|
||||
can.isCmdMode() && (can.db.hash = can.base.Obj(can.misc.SearchHash(can), can.db.hash)), can.db.hash[0] && can.onexport.session(can, PLACE_UID, can.db.hash[0])
|
||||
if (can.Option(PLACE_UID) == "" && can.Option(ctx.INDEX) == "") {
|
||||
if (can.db.hash.length > 1 && can.db.hash[0]) { return can.Option(PLACE_UID, can.db.hash[0]), can.Option(ctx.INDEX, can.db.hash[1]), can.Update() }
|
||||
can.ui = can.page.Append(can, can._output, [
|
||||
{view: html.OUTPUT, list: ["mydebug.list", "myplace.list", "myinit.list", "myindex.list", "myallow.list"]},
|
||||
{view: html.ACTION, list: ["myorder.list"]},
|
||||
])
|
||||
can.onimport.myDebug(can, msg, can.ui.mydebug)
|
||||
var uid = can.onimport.myPlace(can, msg, can.ui.myplace, PLACE_UID, PLACE_NAME, PLACE_TYPE)
|
||||
msg.Length() > 0? can.run({}, [uid], function(msg) { can._index_msg = msg
|
||||
can.onimport.myIndex(can, msg, can.ui.myindex, PLACE_UID, USER_PLACE_ROLE), can.onimport.selectIndex(can, can.sup.current)
|
||||
can.onimport.myAllow(can, msg, can.ui.myallow, PLACE_UID, USER_PLACE_ROLE)
|
||||
can.onimport.myOrder(can, msg, can.ui.myorder, PLACE_UID, USER_PLACE_ROLE)
|
||||
}): can.run({}, [uid], function(msg) { can._index_msg = msg
|
||||
can.onimport.myOrder(can, msg, can.ui.myorder, PLACE_UID, USER_PLACE_ROLE)
|
||||
}), can.ui.place_count = msg.Length()
|
||||
} else if (can.Option(ctx.INDEX) == "") {
|
||||
can.sup._back_args = [can.Option(PLACE_UID)]
|
||||
can.ui = can.page.Append(can, can._output, [
|
||||
{view: html.OUTPUT, list: ["myplace.list", "myindex.list", "myallow.list"]},
|
||||
{view: html.ACTION, list: ["myorder.list"]},
|
||||
])
|
||||
var _msg = can.request({}, {_user_place_role: msg.Option("_user_place_role"), _street_name: msg.Option("_street_name")}); _msg.Push(kit.Dict(
|
||||
UID, "", PLACE_UID, can.Option(PLACE_UID), PLACE_NAME, msg.Option(PLACE_NAME), PLACE_TYPE, msg.Option(PLACE_TYPE), USER_PLACE_ROLE, msg.Option(USER_PLACE_ROLE),
|
||||
STREET_NAME, msg.Option(STREET_NAME), CITY_NAME, msg.Option(CITY_NAME),
|
||||
"auth_status", msg.Option("auth_status"),
|
||||
))
|
||||
_msg.Option(ice.MSG_ACTION, msg.Option(USER_PLACE_ROLE) == "visitor"? '["placeSearch"]': '["placeCreate","scanQRCode","placeSearch"]')
|
||||
can.onimport.myPlace(can, _msg, can.ui.myplace, PLACE_UID, PLACE_NAME, PLACE_TYPE)
|
||||
can.onimport.myIndex(can, msg, can.ui.myindex, PLACE_UID, USER_PLACE_ROLE), can.onimport.selectIndex(can, can.sup.current)
|
||||
can.onimport.myAllow(can, msg, can.ui.myallow, PLACE_UID, USER_PLACE_ROLE)
|
||||
can.onimport.myOrder(can, msg, can.ui.myorder, PLACE_UID, USER_PLACE_ROLE)
|
||||
} else {
|
||||
}
|
||||
can.ui = can.page.Append(can, can._output, [{view: html.HEADER},
|
||||
{view: html.OUTPUT, list: ["myplace.list", "myinit.list", "mycount.list", "mynotice.list", "myindex.list", "myallow.list", "mylist.list"]},
|
||||
{view: html.ACTION, list: ["myorder.list"]},
|
||||
])
|
||||
can.onmotion.hidden(can, can.ui.myinit)
|
||||
can.onmotion.hidden(can, can.ui.mycount)
|
||||
can.onmotion.hidden(can, can.ui.mynotice)
|
||||
can.onmotion.hidden(can, can.ui.myallow)
|
||||
can.onmotion.hidden(can, can.ui.mylist)
|
||||
function showIndex(msg) { if (msg.Length() == 0) { return }
|
||||
can.onimport.myCount(can, msg, can.ui.mycount)
|
||||
can.onimport.myNotice(can, msg, can.ui.mynotice)
|
||||
can.onimport.myIndex(can, msg, can.ui.myindex), can.onexport.index(can, can.sup.current)
|
||||
can.onimport.myAllow(can, msg, can.ui.myallow)
|
||||
can.onimport.myOrder(can, msg, can.ui.myorder)
|
||||
}
|
||||
if (can.Option(PLACE_UID) == "") { var uid = can.onimport.myPlace(can, msg, can.ui.myplace)
|
||||
if (msg.Length() > 0) { msg.Echo(can.ConfHelp()+" "+can.user.info.titles)
|
||||
can.misc.isDebug(can) && can.onimport.qrcode(can, msg)
|
||||
}
|
||||
msg.Length() > 0? can.run({}, [uid], function(msg) { showIndex(can._index_msg = msg) }): can.run({}, [uid], function(msg) { can.onimport.myOrder(can, can._index_msg = msg, can.ui.myorder) })
|
||||
} else { can.onappend.style(can, "public", can._output)
|
||||
var _msg = can.request({}); if (msg.Option(PLACE_NAME)) { _msg.Push(kit.Dict(UID, "", msg.OptionSimple(
|
||||
PLACE_UID, PLACE_NAME, PLACE_TYPE, USER_PLACE_ROLE, STREET_NAME, CITY_NAME,
|
||||
"member_status", "auth_status", "auth_name", "auth_info", "auth_avatar", "auth_background", "dashboard_uid",
|
||||
))) } can.onimport.myPlace(can, _msg, can.ui.myplace)
|
||||
if (_msg.Length() == 0) { can.onimport.myOrder(can, msg, can.ui.myorder) } else { showIndex(can._index_msg = msg) }
|
||||
can.user.agent.init(can, [msg.Option(CITY_NAME), msg.Option(STREET_NAME), msg.Option("auth_info")].join(" "), msg.Option("auth_avatar"))
|
||||
msg.Echo([msg.Option(CITY_NAME), msg.Option(STREET_NAME), msg.Option(PLACE_NAME)].join(" "))
|
||||
can.onexport.value(can, can.sup.current)
|
||||
can.misc.isDebug(can) && can.onimport.qrcode(can, msg, can.sup.current.auth_avatar)
|
||||
can.onimport.story(can, msg, can._output, PLACE_UID, PLACE_NAME, STREET_NAME)
|
||||
}
|
||||
},
|
||||
myPlace: function(can, msg, target) { var place_uid
|
||||
myTrans: function(can, value, PLACE_UID, PLACE_NAME, PLACE_TYPE, USER_PLACE_ROLE, STREET_NAME) {
|
||||
value.icons = can.Conf(can.core.Keys("_trans.value", PLACE_TYPE, mdb.ICONS, value[PLACE_TYPE]))
|
||||
value._uid = value[PLACE_UID], value._name = value[PLACE_NAME], value._street = value[STREET_NAME]
|
||||
value._type = value[PLACE_TYPE], value.__type = can.user.transValue(can, value, PLACE_TYPE)
|
||||
value._role = value[USER_PLACE_ROLE], value.__role = can.user.transValue(can, value, USER_PLACE_ROLE)
|
||||
value._type_style = can.onimport.typeStyle(can, value, PLACE_TYPE)
|
||||
value._role_style = can.onimport.roleStyle(can, value, USER_PLACE_ROLE)
|
||||
value.icons = can.Conf(can.core.Keys("_trans.value", PLACE_TYPE, mdb.ICONS, value[PLACE_TYPE]))
|
||||
},
|
||||
myDebug: function(can, msg, target, PLACE_UID, USER_PLACE_ROLE) {
|
||||
can.onmotion.hidden(can, target)
|
||||
can.page.Append(can, target, [{view: html.TITLE, list: [{text: can.user.trans(can, "My Debug", "我的调试")}]}])
|
||||
can.page.Append(can, target, [{text: window.innerWidth+", "+window.innerHeight}])
|
||||
},
|
||||
myPlace: function(can, msg, target, PLACE_UID, PLACE_NAME, PLACE_TYPE) { var place_uid
|
||||
can.page.Append(can, target, [{view: html.TITLE, list: [
|
||||
{text: can.user.trans(can, "My "+can.base.capital(can.Conf("_place_name").replace("_name", "")), null, html.INPUT)},
|
||||
msg.Length() > 5 && {view: html.ACTION, _init: function(target) { can.onmotion.delay(can, function() { can.onappend.filter(can, target, can.ui._target) }) }},
|
||||
msg.Option(ice.MSG_ACTION) && {view: html.ACTION, _init: function(target) { can.onappend._action(can, msg.Option(ice.MSG_ACTION), target) }}
|
||||
]}]), can.ui._target = can.page.Append(can, target||can._output, [html.OUTPUT])._target
|
||||
msg.Length() > 0 && can.page.Append(can, can.ui._target, msg.Table(function(value) { can.onimport.myTrans(can, value)
|
||||
place_uid = place_uid||value._uid, value._uid == can.onexport.place(can) && (place_uid = value._uid), place_uid == value._uid && (can.sup.current = value)
|
||||
return can.onimport.itemcard(can, value, can.onimport.myValue(can, value), function(event) { can.onexport.value(can, value) })
|
||||
})), msg.Length() == 0 && msg.Result() && can.onappend.board(can, msg.Result(), can.ui._target)
|
||||
{text: can.user.trans(can, "My "+can.base.capital(PLACE_NAME.replace("_name", "")), null, html.INPUT)},
|
||||
{view: html.ACTION, _init: function(target) { msg.Option(ice.MSG_ACTION) && can.onappend._action(can, msg.Option(ice.MSG_ACTION), target) }}
|
||||
]}])
|
||||
var USER_PLACE_ROLE = msg.Option("_user_place_role"), STREET_NAME = msg.Option("_street_name")
|
||||
can.ui._target = can.page.Append(can, target||can._output, [html.OUTPUT])._target
|
||||
msg.Length() > 0 && can.page.Append(can, can.ui._target, msg.Table(function(value) {
|
||||
place_uid = place_uid||value[PLACE_UID], value[PLACE_UID] == can.onexport.session(can, PLACE_UID) && (place_uid = value[PLACE_UID])
|
||||
place_uid == value[PLACE_UID] && (can.sup.current = value)
|
||||
can.onimport.myTrans(can, value, PLACE_UID, PLACE_NAME, PLACE_TYPE, USER_PLACE_ROLE, STREET_NAME)
|
||||
return can.onimport.itemcard(can, value, can.onimport.myValue(can, value, PLACE_UID, PLACE_NAME, STREET_NAME), function(event) {
|
||||
can.onexport.value(can, value, PLACE_UID, PLACE_NAME)
|
||||
})
|
||||
})), can.page.Append(can, target, [{view: html.ACTION, _init: function(target) { can.onappend._action(can, msg.Option(ice.MSG_ACTION), target) }}])
|
||||
return place_uid||""
|
||||
},
|
||||
myInit: function(can, msg, value, target) { if (!msg) { return } can.onmotion.toggle(can, target, !!value._init)
|
||||
if (can.onmotion.cache(can, function() { return value._uid }, target)) { return }
|
||||
msg.Table(function(val) { if (parseInt(val.init) == parseInt(value.init)+1) { value._init = true, val.args = [value._uid]
|
||||
can.onimport.myTitle(can, "My Init", "我的初始化", target)
|
||||
can.onappend.plugin(can, val, function(sub) { var run = sub.run; sub.run = function(event, cmds, cb) { can.onimport.myField(can, sub)
|
||||
run(can.request(event, {place_uid: value._uid, place_init: value.init}), cmds, function(msg) {
|
||||
if (cmds[1] == mdb.CREATE || cmds.length == 1 && msg.Length() > 0) {
|
||||
can._root.Inputs && can.onmotion.clear(can, can._root.Inputs), can.onmotion.clearInput(can), can.Update()
|
||||
} else {
|
||||
cb(msg)
|
||||
myInit: function(can, msg, value, target) { if (!msg) { return }
|
||||
can.onmotion.hidden(can, target)
|
||||
can.page.Append(can, target, [{view: html.TITLE, list: [{text: can.user.trans(can, "My Init", "我的初始化")}]}])
|
||||
msg.Table(function(val) {
|
||||
if (parseInt(val.init) == parseInt(value.init)+1) { val.args = [value._uid], val.style = html.OUTPUT, value._init = true
|
||||
debugger
|
||||
can.onappend.plugin(can, val, function(sub) { var run = sub.run
|
||||
sub.run = function(event, cmds, cb) {
|
||||
run(can.request(event, {place_uid: value._uid, place_init: value.init}), cmds, function(msg) {
|
||||
if (cmds[1] == mdb.CREATE || cmds.length == 1 && msg.Length() > 0) {
|
||||
debugger
|
||||
can.onmotion.clearInput(can), can.Update() } else { cb(msg) }
|
||||
})
|
||||
}
|
||||
})
|
||||
}, can.onmotion.toggle(can, target, !!value._init) }, target)
|
||||
} })
|
||||
},
|
||||
myCount: function(can, value, target) {
|
||||
var show = can.onmotion.toggle(can, target, !!value.dashboard_uid && (!value.member_status || value.member_status == "normal"))
|
||||
if (can.onmotion.cache(can, function() { return value._uid }, target) || !show) { return } can.onimport.myTitle(can, "My Count", "我的数据", target)
|
||||
can.onappend.plugin(can._root.Action, {width: can.ConfWidth()-40, space: "20240903-operation", index: "web.team.dashboard.summary", args: [value.dashboard_uid]}, function(sub) {
|
||||
can.onmotion.toggle(can, target, value._count = true)
|
||||
}, target)
|
||||
},
|
||||
myNotice: function(can, value, target) { if (value._notice_hide) { return can.onmotion.toggle(can, target, false) }
|
||||
if (can.onmotion.cache(can, function() { return value._uid }, target)) { return can.onmotion.toggle(can, target, true) }
|
||||
target.onclick = function() {
|
||||
can.onimport.myStory(can, {index: can.ConfIndex().split(".").slice(0, -1).concat(["notice"]).join("."), args: [value._uid]})
|
||||
}
|
||||
can.runAction({}, "noticeList", [value._uid], function(msg) {
|
||||
if (msg.Length() == 0) { value._notice_hide = true; return can.onmotion.hidden(can, target) } can.onmotion.toggle(can, target, true)
|
||||
can.page.Append(can, target, [
|
||||
{text: can.user.trans(can, "[ notice ]", " [ 公告 ] ")}, {text: can.base.TimeTrim(msg.Append("created_at"))}, {text: " "},
|
||||
{text: [msg.Append("title"), "", "title"]}, {text: can.user.trans(can, "more >", "更多 >")},
|
||||
])
|
||||
}, target)
|
||||
}
|
||||
})
|
||||
},
|
||||
myList: function(can, msg, target) { var width = (can.ConfWidth()-40)/parseInt((can.ConfWidth()-40)/60);
|
||||
(can.page.tagis(document.body, "body.width1") || can.user.isMobile && !can.user.isLandscape()) && (width = (can.ConfWidth()-40)/5)
|
||||
myList: function(can, msg, target, PLACE_UID, USER_PLACE_ROLE) {
|
||||
var width = (can.ConfWidth()-40)/parseInt((can.ConfWidth()-40)/100); can.user.isMobile && !can.user.isLandscape() && (width = (can.ConfWidth()-40)/4)
|
||||
can.page.Append(can, target, msg.Table(function(value) { if (value.enable == ice.FALSE) { return }
|
||||
if ((value.portal || value.public) && can.page.tagis(can._output, "div.output.public")) {
|
||||
can.onimport.myTitle(can, value.index, value.name, can.ui.mylist), can.onmotion.toggle(can, can.ui.mylist, true)
|
||||
can.onappend.plugin(can, {index: value.index, args: [can.sup.current._uid], width: can.ConfWidth()-40}, function(sub) {
|
||||
sub.onimport._field = function(msg) { msg.Table(function(value) { can.onimport.myStory(can, value) }) }
|
||||
sub.onexport.output = function(_sub, msg) {
|
||||
_sub.onaction.carddetail = function(event, _sub, value) {
|
||||
can.onimport.myStory(can, {index: sub.ConfIndex(), args: [can.sup.current._uid, value.uid]})
|
||||
return true
|
||||
}
|
||||
}
|
||||
}, can.ui.mylist)
|
||||
}
|
||||
var cmd = value.index.split(".").pop()
|
||||
return {view: [[html.ITEM, ctx.INDEX].concat(
|
||||
value.type? [mdb.TYPE]: [], can.core.Split(value.type||""), value.role? [aaa.ROLE]: [], can.core.Split(value.role||""),
|
||||
value.auth, value.view,
|
||||
value.type? [mdb.TYPE]: [], can.core.Split(value.type||""),
|
||||
value.role? [aaa.ROLE]: [], can.core.Split(value.role||""),
|
||||
)], style: {width: width}, list: [
|
||||
cmd == "market"? {icon: "bi bi-ubuntu"}:
|
||||
cmd == "message"? {icon: "bi bi-card-checklist"}:
|
||||
cmd == "recent"? {icon: "bi bi-clock-history"}:
|
||||
cmd == "service"? {icon: "bi bi-box"}:
|
||||
cmd == "support"? {icon: "bi bi-opencollective"}:
|
||||
cmd == "qrcode"? {icon: "bi bi-qr-code"}:
|
||||
cmd == "apply"? {icon: "bi bi-pencil-square"}:
|
||||
cmd == "allow"? {icon: "bi bi-clipboard-check"}:
|
||||
cmd == "event"? {icon: "bi bi-calendar4-week"}:
|
||||
cmd == "notice"? {icon: "bi bi-megaphone"}:
|
||||
{img: can.misc.ResourceIcons(can, value.icons)},
|
||||
{text: can.user.trans(can, value.index.split(".").pop(), value.name)},
|
||||
{img: can.misc.ResourceIcons(can, value.icons)}, {text: can.user.trans(can, value.index.split(".").pop(), value.name)},
|
||||
], onclick: function(event) {
|
||||
can.onimport.myStory(can, {space: can.ConfSpace(), index: value.index, args: [can.onexport.place(can)||can.misc.Search(can, can.Conf("_place_uid"))]})
|
||||
can.page.ClassList.del(can, can._fields, "_back"), can.page.ClassList.add(can, can._fields, "_goto")
|
||||
can.Option(PLACE_UID, can.onexport.session(can, PLACE_UID)), can.Option(ctx.INDEX, value.index), can.Update()
|
||||
}}
|
||||
}))
|
||||
},
|
||||
mySplit: function(can, msg, target, min, max) {
|
||||
var _msg = can.request(); msg.Table(function(value) { if (min < value.order && value.order < max) { _msg.Push(value) } })
|
||||
var output = can.page.Append(can, target, [html.OUTPUT])._target; can.onimport.myList(can, _msg, output)
|
||||
},
|
||||
myIndex: function(can, msg, target) { can.onimport.myTitle(can, "My Index", "我的应用", target)
|
||||
var list = ["visitor", "creator", "landlord", "teacher", "leader", "boss", "tenant", "student", "worker", "custom", "admin", "parent", "server"]
|
||||
var _list = can.Conf("_trans.value."+can.Conf("_user_place_role"))
|
||||
can.core.Item(_list, function(key) { list.indexOf(key) == -1 && list.push(key) })
|
||||
var role = can.page.Append(can, target, [{view: aaa.ROLE, list: can.core.List(list, function(key) {
|
||||
var value = _list[key]; if (!value) { return } if (can.base.isIn(key, ctx.STYLE, mdb.ICONS)) { return }
|
||||
return {text: [can.user.trans(can, key, value), "", key], onclick: function(event) {
|
||||
can.onexport.value(can, can.sup.current), can.onexport.index(can, can.sup.current, key), can.onmotion.select(can, role, html.SPAN, event.target)
|
||||
myIndex: function(can, msg, target, PLACE_UID, USER_PLACE_ROLE) {
|
||||
can.page.Append(can, target, [{view: html.TITLE, list: [{text: can.user.trans(can, "My Index", "我的应用")}]}])
|
||||
var role = can.page.Append(can, target, [{view: aaa.ROLE, list: can.core.Item(can.Conf("_trans.value."+USER_PLACE_ROLE), function(key, value) {
|
||||
if (can.base.isIn(key, ctx.STYLE, mdb.ICONS)) { return }
|
||||
return {text: [can.user.trans(can, key, value), "", key], onclick: function(event) { can.onexport.value(can, can.sup.current, PLACE_UID)
|
||||
can.onimport.selectIndex(can, can.sup.current, key), can.onmotion.select(can, role, html.SPAN, event.target)
|
||||
}}
|
||||
}) }])._target; can.ui.role = role
|
||||
can.onimport.mySplit(can, msg, target, 0, 500)
|
||||
var _msg = can.request(); msg.Table(function(value) { if (value.order < 90) { _msg.Push(value) } })
|
||||
var output = can.page.Append(can, target, [html.OUTPUT])._target
|
||||
can.onimport.myList(can, _msg, output, PLACE_UID, USER_PLACE_ROLE)
|
||||
},
|
||||
myAllow: function(can, msg, target) { can.onimport.myTitle(can, "My Allow", "我的权限", target)
|
||||
can.onimport.mySplit(can, msg, target, 500, 900)
|
||||
myAllow: function(can, msg, target, PLACE_UID, USER_PLACE_ROLE) {
|
||||
can.page.Append(can, target, [{view: html.TITLE, list: [{text: can.user.trans(can, "My Allow", "我的权限")}]}])
|
||||
var _msg = can.request(); msg.Table(function(value) { if (value.order > 89 && value.order < 100) { _msg.Push(value) } })
|
||||
var output = can.page.Append(can, target, [html.OUTPUT])._target
|
||||
can.onimport.myList(can, _msg, output, PLACE_UID, USER_PLACE_ROLE)
|
||||
},
|
||||
myOrder: function(can, msg, target) { can.onimport.myTitle(can, "My Order", "我的系统", target)
|
||||
can.onimport.mySplit(can, msg, target, 900, 1000), can.onimport.layout(can), can.onexport.value(can, can.sup.current)
|
||||
can.onmotion.delay(can, function() { can.onimport.layout(can) }, 30)
|
||||
can.onmotion.delay(can, function() { can.onimport.layout(can) }, 300)
|
||||
myOrder: function(can, msg, target, PLACE_UID, USER_PLACE_ROLE) {
|
||||
can.page.Append(can, target, [{view: html.TITLE, list: [{text: can.user.trans(can, "My Order", "我的系统")}]}])
|
||||
var _msg = can.request(); msg.Table(function(value) { if (value.order > 99) { _msg.Push(value) } })
|
||||
var output = can.page.Append(can, target, [html.OUTPUT])._target
|
||||
can.onimport.myList(can, _msg, output, PLACE_UID, USER_PLACE_ROLE)
|
||||
can.onimport.layout(can), can.onexport.value(can, can.sup.current, PLACE_UID)
|
||||
},
|
||||
layout: function(can) {
|
||||
can.ui.tabs && can.ui.list && can.page.styleHeight(can, can.ui.list, can.ConfHeight()-can.ui.tabs.offsetHeight)
|
||||
if (can.ui.action && can.ui.output) {
|
||||
// can.page.style(can, can.ui.output, html.HEIGHT, (can.user.isMobile? window.innerHeight: can.ConfHeight()) - can.ui.action.offsetHeight)
|
||||
can.page.style(can, can.ui.output, html.HEIGHT, (can.ConfHeight()) - can.ui.action.offsetHeight)
|
||||
}
|
||||
},
|
||||
})
|
||||
Volcanos(chat.ONACTION, {
|
||||
beforeInputs: function(event, can, button, sub) {
|
||||
can.user.isMobile && can.page.style(can, sub._target, html.LEFT, (can.page.width()-sub._target.offsetWidth)/2, html.TOP, 0)
|
||||
can.user.isMobile && can.page.style(can, sub._target, html.MAX_HEIGHT, can.page.height())
|
||||
can.user.isMobile && can._root.Inputs && 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", "深圳市")
|
||||
if (!can.misc.isDebug(can)) { return }
|
||||
sub.Option("street_name", "粤海街道")
|
||||
sub.Option("school_name", "深圳中学")
|
||||
sub.Option("company_name", "云轩领航")
|
||||
sub.Option("place_name", "软件产业基地")
|
||||
sub.Option("queue_name", "二楼产检")
|
||||
sub.Option("group_name", "销售部-华东地区")
|
||||
sub.Option("class_name", "初一二班")
|
||||
sub.Option("exam_name", "初一期末考试")
|
||||
sub.Option("store_name", "老邵木器加工")
|
||||
sub.Option("capital_name", "国资委")
|
||||
sub.Option("channel_name", "公众号")
|
||||
sub.Option("cloud_name", "系统云")
|
||||
sub.Option("repos_name", "contexts")
|
||||
sub.Option("story_name", "ContextOS")
|
||||
sub.Option("reception_name", "科室1")
|
||||
sub.Option("volume_amount", "100")
|
||||
sub.Option("grade", "2024级")
|
||||
},
|
||||
afterInputs: function(event, can, button, sub) {
|
||||
can.onmotion.delay(can, function() { can._root.Action.onlayout._init(can) })
|
||||
can.user.isMobile && can.page.style(can, can._root.Action._output, html.VISIBILITY, "")
|
||||
can.user.isMobile && can.page.style(can, can._root.Action._target, html.DISPLAY, "")
|
||||
can.user.isMobile && can.onmotion.toggle(can, can._output, true)
|
||||
},
|
||||
request: function(event, can) {
|
||||
can.runAction(event, "request", [], function(msg) { if(msg.IsErr()) { return can.user.toastFailure(can, msg.Result()) }
|
||||
WeixinJSBridge.invoke('getBrandWCPayRequest', msg.Table()[0], function(res) {
|
||||
if (res.err_msg == "get_brand_wcpay_request:ok") {
|
||||
can.Update(), can.onimport.myStory(can, {index: "web.team.gonganxitong.paymentlist", args: [msg.Option("place_uid"), msg.Append("paymentlist_uid")]})
|
||||
} else if (res.err_msg == "get_brand_wcpay_request:cancel") {
|
||||
can.user.toast(can, "支付取消")
|
||||
} else {
|
||||
can.user.toast(can, "支付失败")
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
})
|
||||
Volcanos(chat.ONEXPORT, {
|
||||
place: function(can, value) { return can.onexport.session(can, PLACE_UID, value) },
|
||||
value: function(can, value) { if (!value || !value._uid) { return } can.sup.current = value, can.onexport.index(can, can.sup.current)
|
||||
can.onexport.place(can, value._uid), can.onexport.hash(can, value._uid), can.onexport.title(can, value._name, can.ConfHelp())
|
||||
can.user.agent.init(can, value.city_name+" "+value._street)
|
||||
can.page.Select(can, can.ui._target, "div.item.card.uid-"+value._uid, function(target) {
|
||||
can.onmotion.select(can, can.ui._target, html.DIV_ITEM, target)
|
||||
can.onmotion.scrollIntoView(can, target)
|
||||
})
|
||||
var status = !value.member_status || value.member_status == "normal"
|
||||
can.ui.myinit && can.onimport.myInit(can, can._index_msg, value, can.ui.myinit)
|
||||
can.ui.mycount && can.onimport.myCount(can, value, can.ui.mycount)
|
||||
can.ui.mynotice && can.onimport.myNotice(can, value, can.ui.mynotice)
|
||||
can.ui.myallow && can.onmotion.toggle(can, can.ui.myallow, status && (value._role == "creator" || parseInt(value._role) > 0 || can.page.Select(can, can.ui.myallow, "div.item.index.role."+value._role).length > 0))
|
||||
can.ui.myindex && can.onmotion.toggle(can, can.ui.myindex, status)
|
||||
if (!can.onmotion.cache(can, function() { return value._uid }, can.ui.header) && value.auth_background) {
|
||||
// can.page.Append(can, can.ui.header, [{img: value.auth_background}])
|
||||
// can.page.ClassList.set(can, can._output, "background", !!can.ui.header.innerHTML)
|
||||
}
|
||||
can.onimport.myOption(can.sup)
|
||||
},
|
||||
index: function(can, value, role) { role = role||value._role
|
||||
selectIndex: function(can, value, role) { role = role||value._role
|
||||
can.ui.role && can.onmotion.toggle(can, can.ui.role, value._role == "creator")
|
||||
parseInt(role) > 0 || can.ui.role && can.onmotion.select(can, can.ui.role, html.SPAN, can.page.SelectOne(can, can.ui.role, "span."+role))
|
||||
can.ui.role && can.onmotion.select(can, can.ui.role, html.SPAN, can.page.SelectOne(can, can.ui.role, "span."+role))
|
||||
can.page.Select(can, can.ui.myindex, html.DIV_ITEM, function(target) { var list = target.className.split(" ")
|
||||
if (list.indexOf(log.DEBUG) > -1 && !can.misc.isDebug(can)) {
|
||||
if (list.indexOf(mdb.TYPE) > -1 && list.indexOf(value._type) == -1) {
|
||||
can.onmotion.toggle(can, target, false)
|
||||
} else if (list.indexOf(aaa.TECH) > -1 && !can.user.isTechOrRoot(can)) {
|
||||
can.onmotion.toggle(can, target, false)
|
||||
} else if (list.indexOf(mdb.TYPE) > -1 && list.indexOf(value._type) == -1) {
|
||||
can.onmotion.toggle(can, target, false)
|
||||
} else if (list.indexOf(aaa.ROLE) > -1 && (list.indexOf(role) == -1 && role != "creator")) {
|
||||
can.onmotion.toggle(can, target, false)
|
||||
} else if (list.indexOf("issued") > -1 && value.auth_status != "issued") {
|
||||
} else if (list.indexOf(aaa.ROLE) > -1 && list.indexOf(role) == -1) {
|
||||
can.onmotion.toggle(can, target, false)
|
||||
} else {
|
||||
can.onmotion.toggle(can, target, true)
|
||||
}
|
||||
})
|
||||
},
|
||||
story: function(can, msg, target, PLACE_UID, PLACE_NAME, STREET_NAME) {
|
||||
msg.Table(function(value) { function goback() {} function reload() {}
|
||||
var list = [can.page.button(can, can.user.trans(can, "goback", "返回"), function(event) { goback() }), can.page.button(can, can.user.trans(can, "reload", "刷新"), function(event) { reload() })]
|
||||
var ui = can.page.Append(can, can._output, [{view: html.ACTION}])
|
||||
if (can.db.hash.length > 2 && can.db.hash[0] && can.db.hash[2]) { value.args = [can.db.hash[0], can.db.hash[2]] }
|
||||
value.style = html.OUTPUT, value.height = can.ConfHeight()-html.ACTION_HEIGHT
|
||||
can.onappend.plugin(can, value, function(sub) { sub.sup = can
|
||||
can.core.List(["_trans", "_icons", "_style", "_trans.input", "_trans.value"], function(key) {
|
||||
var value = sub.Conf(key); value && can.core.Item(can.Conf(key), function(k, v) { value[k] = value[k]||v })
|
||||
})
|
||||
can.onexport.title(can, sub.Conf(PLACE_NAME, msg.Option(PLACE_NAME)), value.help)
|
||||
sub.onexport.title = function(sub) { can.onexport.title.apply(can.onexport, [can].concat(can.core.List(arguments).slice(1))) }
|
||||
var run = sub.run; sub.run = function(event, cmds, cb) {
|
||||
run(can.request(event, {
|
||||
city_name: msg.Option(CITY_NAME), street_name: msg.Option(STREET_NAME), place_name: msg.Option(PLACE_NAME),
|
||||
command_uid: msg.Option("command_uid"), portal_name: can.ConfHelp(),
|
||||
}), cmds, cb)
|
||||
}
|
||||
can.page.Appends(can, ui.action, list)
|
||||
goback = function() { can.page.ClassList.add(can, can._fields, "_back")
|
||||
can.onexport.hash(can, ""), can.Option(PLACE_UID, ""), can.Option(ctx.INDEX, ""), can.Update()
|
||||
}
|
||||
reload = function() { sub.Update(), can.onmotion.delay(can, function() { can.user.toastSuccess(can, "reload") }, 300) }
|
||||
sub.onexport._output = function(_sub, msg) {
|
||||
can.core.Item(can.onimport, function(key, value) { _sub.onimport[key] = _sub.onimport[key]||value })
|
||||
can.core.Item(can.onexport, function(key, value) { _sub.onexport[key] = _sub.onexport[key]||value })
|
||||
}
|
||||
sub.onexport.output = function(_sub, msg) { can.onappend.style(sub, html.OUTPUT)
|
||||
can.page.styleHeight(can, _sub._target, can.ConfHeight() - 32)
|
||||
_sub.onimport._option = function(_sub, uid, index, place_uid) {
|
||||
can.Option(PLACE_UID, place_uid), can.Option(ctx.INDEX, index)
|
||||
can.onexport.hash(can, place_uid||can.Option(PLACE_UID), index||can.Option(ctx.INDEX), uid), can.Update()
|
||||
}
|
||||
_sub.onexport.title = function(_sub, title) {
|
||||
title? can.onexport.title(can, title): can.onexport.title(can, sub.Conf(PLACE_NAME), sub.ConfHelp(), msg.Option("_share_title")||"")
|
||||
}
|
||||
can.onexport.hash(can, can.Option(PLACE_UID), value.index, sub.Option(UID))
|
||||
can.onexport.title(can, sub.Conf(PLACE_NAME), sub.ConfHelp(), msg.Option("_share_title")||"")
|
||||
can.user.agent.init(can, msg.Option("_share_content"), msg.Option("_share_icons")||value.icons)
|
||||
can.page.Appends(can, ui.action, list), msg.Option(ice.MSG_ACTION) && can.onappend._action(sub, msg.Option(ice.MSG_ACTION), ui.action, null, true)
|
||||
goback = function() { can.page.ClassList.add(can, can._fields, "_back")
|
||||
if (_sub.onaction._goback && _sub.onaction._goback(_sub)) { return } can.Update()
|
||||
}
|
||||
_sub.onaction._goback = function(_sub) {
|
||||
if (sub.Option(UID)) {
|
||||
can.onexport.hash(can, can.Option(PLACE_UID), can.Option(ctx.INDEX)), sub.Option(UID, ""), sub.Update()
|
||||
} else {
|
||||
if (can.sup._back_args) {
|
||||
can.onexport.hash(can, ""), can.Option(PLACE_UID, can.sup._back_args[0]), can.Option(ctx.INDEX, ""), can.Update()
|
||||
} else {
|
||||
can.onexport.hash(can, ""), can.Option(PLACE_UID, ""), can.Option(ctx.INDEX, ""), can.Update()
|
||||
}
|
||||
}
|
||||
}
|
||||
reload = function() {
|
||||
if (_sub.onaction._reload) { return _sub.onaction._reload(_sub) }
|
||||
sub.Update(), can.onmotion.delay(can, function() { can.user.toastSuccess(can, "reload") }, 300)
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
plugin: function(can, value) { var action = can._root.Action
|
||||
var sup = can.sup.sup
|
||||
value.space = value.space||sup.ConfSpace(), value.index = value.index||sup.ConfIndex()
|
||||
var key = [value.space, value.index, value.args].join(","), sub = action._plugins[key]
|
||||
if (sub) {
|
||||
can.page.SelectChild(can, action._output, html.FIELDSET_PLUGIN, function(target) { can.onmotion.toggle(can, target, target == sub._target) })
|
||||
sub.onimport.size(sub, window.innerHeight, window.innerWidth), can.user.title((value._title||"")+" "+sub.ConfHelp())
|
||||
return
|
||||
}
|
||||
can.misc.localStorage(can, [value.space, value.index, mdb.HASH].join(","), value.args? [value.args[0]]: "")
|
||||
var args = value.args; args && (value.args = [args[0]]); value.type = html.PLUGIN, value.style = html.OUTPUT
|
||||
can._root.Action.onappend.plugin(can._root.Action, value, function(sub) { action._plugins[key] = sub
|
||||
sub._back_args = value.args
|
||||
can.page.SelectChild(can, action._output, html.FIELDSET_PLUGIN, function(target) { can.onmotion.toggle(can, target, target == sub._target) })
|
||||
sub.onimport.size(sub, window.innerHeight, window.innerWidth), can.user.title((value._title||"")+" "+sub.ConfHelp())
|
||||
sub.onexport.title = function(can, title) { can.user.title(can.core.List(arguments).slice(1).join(" ")) }
|
||||
}, action._output)
|
||||
},
|
||||
float: function(can, value, cb) { value.style = html.OUTPUT
|
||||
can.onappend.plugin(can, value, function(sub) { var _goback = can.onaction._goback
|
||||
can.onaction._goback = function() { can.onaction._goback = _goback, can.page.Remove(can, sub._target), can.onexport.title(can); return true }
|
||||
can.onaction._reload = function() { sub.Update(), can.onmotion.delay(can, function() { can.user.toastSuccess(can, "reload") }, 300) }
|
||||
sub.onexport.output = function(_sub, msg) { can.onexport.title(can, sub.ConfHelp()+" "+msg.Option("_share_title"))
|
||||
sub.onimport.size(sub, window.innerHeight-html.ACTION_HEIGHT, window.innerWidth, false)
|
||||
}
|
||||
cb && cb(sub)
|
||||
})
|
||||
},
|
||||
layout: function(can) { can.ui.action && can.ui.output && can.onmotion.delay(can, function() {
|
||||
can.page.style(can, can.ui.output, html.HEIGHT, can.ConfHeight() - can.ui.action.offsetHeight)
|
||||
}) },
|
||||
})
|
||||
Volcanos(chat.ONEXPORT, {
|
||||
value: function(can, value, PLACE_UID) { if (!value) { return }
|
||||
can.sup.current = value, can.onimport.selectIndex(can, can.sup.current)
|
||||
can.onexport.session(can, PLACE_UID, value._uid), can.onexport.hash(can, value._uid)
|
||||
can.onexport.title(can, value._name, can.ConfHelp()), can.user.agent.init(can)
|
||||
can.page.Select(can, can.ui._target, "div.item.card.uid-"+value._uid, function(item) { can.onmotion.select(can, can.ui._target, html.DIV_ITEM, item) })
|
||||
can.ui.myallow && can.onmotion.toggle(can, can.ui.myallow, can.page.Select(can, can.ui.myallow, "div.item.index.role."+value._role).length > 0)
|
||||
can.ui.myinit && can.onmotion.delay(can, function() { can.onmotion.toggle(can, can.ui.myinit, !!value._init) })
|
||||
if (!can._index_msg || can.onmotion.cache(can, function() { return value._uid }, can.ui.myinit)) { return }
|
||||
can.ui.myinit && can.onimport.myInit(can, can._index_msg, value, can.ui.myinit)
|
||||
},
|
||||
share_title: function(can, msg, title, role) {
|
||||
msg.Option("_share_icons", msg.Append("user_avatar"))
|
||||
msg.Option("_share_content", can.user.transValue(can, msg, role)+" "+msg.Append("user_name"))
|
||||
},
|
||||
})
|
||||
|
@ -1,105 +1,99 @@
|
||||
{
|
||||
"portal": "用户场景", "placeCreate": "创建", "placeRemove": "删除",
|
||||
"credit": "用户名片", "member": "组织成员",
|
||||
"goodslist": "在线商城", "paymentlist": "在线支付",
|
||||
"meeting": "在线会议", "document": "在线文档", "contract": "在线合同", "photo": "在线相册",
|
||||
"email": "邮箱配置", "setting": "服务配置",
|
||||
"qrcode": "场景码", "event": "事件流", "apply": "权限申请", "allow": "权限审批", "notice": "通知公告",
|
||||
"domain": "领域分类", "market": "人民广场", "message": "消息待办", "recent": "最近访问", "service": "服务发现", "support": "客服支持",
|
||||
"portal": "用户场景",
|
||||
"placeCreate": "创建", "placeRemove": "删除", "placeAuth": "认证",
|
||||
"placeSearch": "搜索", "scanQRCode": "扫码",
|
||||
"qrcode": "场景码", "event": "事件流", "apply": "权限申请", "allow": "权限审批",
|
||||
"email": "邮箱配置", "member": "场景成员", "placeUser": "场景成员",
|
||||
"message": "消息待办", "recent": "最近访问", "service": "服务发现", "support": "客服支持",
|
||||
"cancel": "取消", "submit": "提交", "finish": "完成", "reject": "驳回", "approve": "通过",
|
||||
"read": "已读", "done": "完成", "sticky": "置顶", "unSticky": "取消置顶",
|
||||
"autogen": "生成", "compile": "编译", "oauth": "授权", "project": "项目",
|
||||
"marketInsert": "推广",
|
||||
"marketPlaceEnter": "进入",
|
||||
"pushPublic": "推广",
|
||||
"process": "开始",
|
||||
"applyCreate": "申请权限",
|
||||
"commentCreate": "评论", "applyQRCode": "邀请码",
|
||||
"user": "用户信息", "city": "城市信息", "street": "街道信息", "school": "学校信息", "company": "公司信息",
|
||||
"auth": "认证", "authCreate": "认证申请", "authCity": "城市认证", "authPersonal": "个人认证", "authService": "服务认证", "authCompany": "公司认证",
|
||||
"config": "配置", "code": "编程", "data": "数据", "cache": "缓存",
|
||||
"promote": "升级", "demote": "降级",
|
||||
"icons": {
|
||||
"market": "bi bi-ubuntu",
|
||||
"message": "bi bi-card-checklist",
|
||||
"goodslist": "https://img.icons8.com/officel/80/online-store.png",
|
||||
"paymentlist": "https://img.icons8.com/officel/80/online-payment-with-a-credit-card.png",
|
||||
"meeting": "https://img.icons8.com/officel/80/video-conference.png",
|
||||
"document": "https://img.icons8.com/officel/80/documents.png",
|
||||
"contract": "https://img.icons8.com/officel/80/agreement.png",
|
||||
"photo": "https://img.icons8.com/officel/80/ios-photos.png"
|
||||
"qrcode": "https://img.icons8.com/officel/80/qr-code.png",
|
||||
"event": "https://img.icons8.com/officel/80/property-with-timer.png",
|
||||
"apply": "https://img.icons8.com/officel/80/edit-property.png",
|
||||
"allow": "https://img.icons8.com/officel/80/receipt-approved.png",
|
||||
"email": "https://img.icons8.com/officel/80/reading-confirmation.png",
|
||||
"member": "https://img.icons8.com/officel/80/person-at-home.png",
|
||||
"placeUser": "https://img.icons8.com/officel/80/person-at-home.png",
|
||||
"message": "https://img.icons8.com/officel/80/test-partial-passed.png",
|
||||
"recent": "https://img.icons8.com/officel/80/multiple-smartphones.png",
|
||||
"service": "https://img.icons8.com/officel/80/activity-grid.png",
|
||||
"support": "https://img.icons8.com/officel/80/customer-support.png"
|
||||
},
|
||||
"style": {
|
||||
"marketPlaceEnter": "notice",
|
||||
"reject": "danger",
|
||||
"approve": "notice",
|
||||
"disable": "danger",
|
||||
"enable": "notice",
|
||||
"placeRemove": "danger",
|
||||
"authPersonal": "notice"
|
||||
"placeRemove": "danger"
|
||||
},
|
||||
"input": {
|
||||
"process_time": "开始时间",
|
||||
"plan_status": "计划状态",
|
||||
"task_count": "任务数量",
|
||||
"My Place": "我的场景",
|
||||
"user_uid": "用户",
|
||||
"user_name": "用户昵称",
|
||||
"user_info": "用户信息",
|
||||
"user_avatar": "用户头像",
|
||||
"user_background": "用户背景",
|
||||
"user_place_role": "成员角色",
|
||||
"user_place_role": "用户角色",
|
||||
"place_uid": "场景",
|
||||
"place_name": "场景名称",
|
||||
"place_type": "场景类型",
|
||||
"place_address": "场景地址",
|
||||
"message_status": "消息状态",
|
||||
"street_name": "街道名称",
|
||||
"school_name": "学校名称",
|
||||
"company_uid": "公司",
|
||||
"company_name": "公司名称",
|
||||
"city_name": "城市名称",
|
||||
"city_info": "城市信息",
|
||||
"auth_name": "认证主体",
|
||||
"auth_info": "认证信息",
|
||||
"auth_type": "认证类型",
|
||||
"auth_status": "认证状态",
|
||||
"auth_avatar": "认证头像",
|
||||
"auth_background": "认证背景",
|
||||
"paymentlist_status": "支付状态",
|
||||
"qrcode_type": "链接类型",
|
||||
"apply_status": "申请状态",
|
||||
"allow_status": "审批状态",
|
||||
"member_status": "成员状态",
|
||||
"domain_uid": "领域分类",
|
||||
"message_status": "消息状态",
|
||||
"service_name": "服务名称",
|
||||
"begin_time": "起始时间",
|
||||
"end_time": "结束时间",
|
||||
"start_time": "开始时间",
|
||||
"cancel_time": "取消时间",
|
||||
"finish_time": "完成时间",
|
||||
"created_at": "创建时间",
|
||||
"operator": "操作人",
|
||||
"operate": "操作",
|
||||
"address": "场景地址",
|
||||
"auth": "认证",
|
||||
"init": "初始化",
|
||||
"info": "详情",
|
||||
"class": "基类",
|
||||
"table": "应用"
|
||||
},
|
||||
"value": {
|
||||
"apply_status": {
|
||||
"create": "待提交 🕑",
|
||||
"cancel": "已取消 ❌",
|
||||
"submit": "已提交 🕑",
|
||||
"rejected": "已驳回 ❌",
|
||||
"approved": "已通过 ✅"
|
||||
},
|
||||
"allow_status": {
|
||||
"create": "待审批 🕑",
|
||||
"rejected": "已驳回 ❌",
|
||||
"approved": "已通过 ✅"
|
||||
},
|
||||
"user_place_role": {
|
||||
"visitor": "访客",
|
||||
"creator": "创建人",
|
||||
"landlord": "房东",
|
||||
"tenant": "租客",
|
||||
"admin": "管家",
|
||||
"admin": "管理员",
|
||||
"style": {
|
||||
"creator": "danger",
|
||||
"landlord": "danger"
|
||||
}
|
||||
},
|
||||
"message_status": {
|
||||
"create": "未读",
|
||||
"read": "待办",
|
||||
"done": "完成",
|
||||
"style": {
|
||||
"create": "danger"
|
||||
}
|
||||
},
|
||||
"service_type": {
|
||||
"worker": "空间"
|
||||
},
|
||||
"service_status": {
|
||||
"online": "在线"
|
||||
},
|
||||
"qrcode_type": {
|
||||
"portal": "门户首页",
|
||||
"apply": "权限申请"
|
||||
},
|
||||
"place_type": {
|
||||
"house": "住宅",
|
||||
"hotel": "宾馆",
|
||||
@ -119,65 +113,6 @@
|
||||
"factory": "https://img.icons8.com/officel/80/manufacturing.png",
|
||||
"hospital": "https://img.icons8.com/officel/80/clinic.png"
|
||||
}
|
||||
},
|
||||
"auth_type": {
|
||||
"root": "官方",
|
||||
"city": "城市",
|
||||
"personal": "个人",
|
||||
"service": "服务",
|
||||
"company": "公司",
|
||||
"style": {
|
||||
"root": "danger",
|
||||
"city": "danger",
|
||||
"personal": "danger"
|
||||
}
|
||||
},
|
||||
"auth_status": {
|
||||
"create": "🕑 待认证",
|
||||
"request": "🕑 待认证",
|
||||
"issued": "✅ 已认证",
|
||||
"revoked": "❌ 已吊销"
|
||||
},
|
||||
"setting": {
|
||||
"profile": "将本服务展示到个人名片"
|
||||
},
|
||||
"qrcode_type": {
|
||||
"portal": "门户首页",
|
||||
"apply": "权限申请"
|
||||
},
|
||||
"apply_status": {
|
||||
"create": "🕑 待提交",
|
||||
"cancel": "❌ 已取消",
|
||||
"submit": "🕑 已提交",
|
||||
"rejected": "❌ 已驳回",
|
||||
"approved": "✅ 已通过"
|
||||
},
|
||||
"allow_status": {
|
||||
"create": "🕑 待审批",
|
||||
"rejected": "❌ 已驳回",
|
||||
"approved": "✅ 已通过"
|
||||
},
|
||||
"member_status": {
|
||||
"normal": "正常",
|
||||
"disabled": "❌ 已禁用",
|
||||
"style": {
|
||||
"disabled": "danger"
|
||||
}
|
||||
},
|
||||
"message_status": {
|
||||
"all": "全部",
|
||||
"create": "未读",
|
||||
"read": "待办",
|
||||
"done": "完成",
|
||||
"style": {
|
||||
"create": "danger"
|
||||
}
|
||||
},
|
||||
"service_type": {
|
||||
"worker": "空间"
|
||||
},
|
||||
"service_status": {
|
||||
"online": "在线"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
49
src/gonganxitong/portal.shy
Normal file
@ -0,0 +1,49 @@
|
||||
chapter "用户场景"
|
||||
refer `
|
||||
公众号 https://mp.weixin.qq.com/cgi-bin/home?t=home/index&lang=zh_CN&token=494166701
|
||||
ICON https://igoutu.cn/icons/officel
|
||||
GORM https://gorm.io/docs/indexes.html
|
||||
`
|
||||
field web.chat.wx.access
|
||||
field web.chat.wx.menu
|
||||
field web.code.mysql.client
|
||||
field web.code.mysql.query args `mysql gonganxitong`
|
||||
field web.code.db.models
|
||||
field web.code.db.mysql
|
||||
order `
|
||||
sess.go
|
||||
user.go
|
||||
userPlace.go
|
||||
placeUser.go
|
||||
place.go
|
||||
street.go
|
||||
city.go
|
||||
|
||||
qrcode.go
|
||||
apply.go
|
||||
apply.js
|
||||
allow.go
|
||||
allow.js
|
||||
event.go
|
||||
event.js
|
||||
|
||||
common.go
|
||||
common.js
|
||||
portal.css
|
||||
portal.go
|
||||
portal.js
|
||||
portal.json
|
||||
portal.shy
|
||||
|
||||
message.go
|
||||
message.js
|
||||
recent.go
|
||||
recent.js
|
||||
search.go
|
||||
search.js
|
||||
command.go
|
||||
service.go
|
||||
service.js
|
||||
support.go
|
||||
email.go
|
||||
`
|
@ -2,44 +2,31 @@ package gonganxitong
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/community/src/gonganxitong/model"
|
||||
)
|
||||
|
||||
type qrcode struct {
|
||||
Tables
|
||||
apply apply
|
||||
portal Portal
|
||||
order string `data:"501"`
|
||||
role string `data:"leader"`
|
||||
applyQRCode string `name:"applyQRCode" help:"邀请码" role:"void"`
|
||||
placeQRCode string `name:"placeQRCode" help:"场景码" role:"void"`
|
||||
portal Portal
|
||||
order string `data:"90"`
|
||||
role string `data:"creator"`
|
||||
apply string `name:"apply" role:"void"`
|
||||
}
|
||||
|
||||
func (s qrcode) ApplyQRCode(m *ice.Message, arg ...string) {
|
||||
m.Option(ice.MSG_FG, "blue")
|
||||
func (s qrcode) Apply(m *ice.Message, arg ...string) {
|
||||
s.info(m, arg[0], "apply")
|
||||
s.EchoQRCode(m, arg[0], s.Prefix(m, s.apply)).Echo("请让申请人扫码,然后审批权限")
|
||||
}
|
||||
func (s qrcode) PlaceQRCode(m *ice.Message, arg ...string) {
|
||||
s.info(m, arg[0], "portal")
|
||||
s.EchoQRCode(m, arg[0]).Echo(kit.JoinWord(m.Append(model.CITY_NAME), m.Append(s.Keys(s.Street, model.NAME)), m.Append(s.Keys(s.Place, model.NAME))))
|
||||
m.Option(ice.MSG_FG, "blue")
|
||||
m.EchoQRCode(s.Link(m, arg[0]))
|
||||
}
|
||||
func (s qrcode) List(m *ice.Message, arg ...string) {
|
||||
s.PlaceQRCode(m, arg[0])
|
||||
s.info(m, arg[0], "portal")
|
||||
m.EchoQRCode(m.MergePodCmd("", s.Prefix(m, s.portal), s.Keys(s.Place, model.UID), arg[0]))
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(qrcode{Tables: newTables()}) }
|
||||
|
||||
func (s Table) EchoQRCode(m *ice.Message, arg ...string) *ice.Message {
|
||||
m.EchoQRCode(s.Link(m, arg...)).Echo("<img class='avatar' src='%s'/>", m.Resource(kit.Select(ice.Info.NodeIcon, m.Option(model.AUTH_AVATAR))))
|
||||
return m
|
||||
}
|
||||
func (s qrcode) info(m *ice.Message, place_uid, cmd string) *ice.Message {
|
||||
m.Cmdy(s.Prefix(m, s.portal), s.portal.PlaceList, m.Option(model.USER_UID), place_uid)
|
||||
m.Option(model.AUTH_AVATAR, m.Append(model.AUTH_AVATAR))
|
||||
m.Cut(model.CITY_NAME, s.Keys(s.Street, model.NAME), s.Keys(s.Place, model.NAME))
|
||||
m.Push(model.QRCODE_TYPE, cmd).Action(s.ApplyQRCode, s.PlaceQRCode)
|
||||
return m
|
||||
func (s qrcode) info(m *ice.Message, place_uid, typ string) {
|
||||
m.Cmdy(s.Prefix(m, s.portal), s.portal.PlaceList, m.Option(model.USER_UID), place_uid).Cut(model.CITY_NAME, s.Keys(s.Street, model.NAME), s.Keys(s.Place, model.NAME))
|
||||
m.Push(model.QRCODE_TYPE, typ).Action(s.Apply)
|
||||
}
|
||||
|
Before Width: | Height: | Size: 2.0 KiB |
@ -1,78 +0,0 @@
|
||||
package gonganxitong
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/community/src/api"
|
||||
"shylinux.com/x/community/src/gonganxitong/model"
|
||||
)
|
||||
|
||||
type quotalist struct {
|
||||
Table
|
||||
fields string `data:"place_uid,title,content,vendor,total"`
|
||||
}
|
||||
|
||||
func (s quotalist) AfterMigrate(m *ice.Message, arg ...string) {
|
||||
s.Table.AfterMigrate(m, arg...)
|
||||
if s.PrefixPortal(m) == api.RENZHENGSHOUQUAN_PORTAL {
|
||||
s.insert(m, "service", "3-1", 10, "10人", "在线会议人数上限", api.GONGANXITONG_MEETING)
|
||||
s.insert(m, "service", "3-2", 30, "30人", "在线会议人数上限", api.GONGANXITONG_MEETING)
|
||||
s.insert(m, "service", "3-3", 50, "50人", "在线会议人数上限", api.GONGANXITONG_MEETING)
|
||||
|
||||
s.insert(m, "service", "3-1", 100*1024*1024, "100M", "在线文档存储容量", api.GONGANXITONG_DOCUMENT)
|
||||
s.insert(m, "service", "3-2", 300*1024*1024, "300M", "在线文档存储容量", api.GONGANXITONG_DOCUMENT)
|
||||
s.insert(m, "service", "3-3", 500*1024*1024, "500M", "在线文档存储容量", api.GONGANXITONG_DOCUMENT)
|
||||
|
||||
s.insert(m, "service", "3-1", 1024*1024*1024, "1G", "在线相册存储容量", api.GONGANXITONG_PHOTO)
|
||||
s.insert(m, "service", "3-2", 3*1024*1024*1024, "3G", "在线相册存储容量", api.GONGANXITONG_PHOTO)
|
||||
s.insert(m, "service", "3-3", 5*1024*1024*1024, "5G", "在线相册存储容量", api.GONGANXITONG_PHOTO)
|
||||
|
||||
s.insert(m, "company", "4-1", 10, "10个", "服务认证数量上限", api.RENZHENGSHOUQUAN_AUTH)
|
||||
s.insert(m, "company", "4-2", 30, "30个", "服务认证数量上限", api.RENZHENGSHOUQUAN_AUTH)
|
||||
s.insert(m, "company", "4-3", 50, "50个", "服务认证数量上限", api.RENZHENGSHOUQUAN_AUTH)
|
||||
|
||||
s.insert(m, "school", "5-1", 10, "10个", "服务认证数量上限", api.RENZHENGSHOUQUAN_AUTH)
|
||||
s.insert(m, "school", "5-2", 30, "30个", "服务认证数量上限", api.RENZHENGSHOUQUAN_AUTH)
|
||||
s.insert(m, "school", "5-3", 50, "50个", "服务认证数量上限", api.RENZHENGSHOUQUAN_AUTH)
|
||||
|
||||
s.insert(m, "street", "6-1", 10, "10个", "服务认证数量上限", api.RENZHENGSHOUQUAN_AUTH)
|
||||
s.insert(m, "street", "6-2", 30, "30个", "服务认证数量上限", api.RENZHENGSHOUQUAN_AUTH)
|
||||
s.insert(m, "street", "6-3", 50, "50个", "服务认证数量上限", api.RENZHENGSHOUQUAN_AUTH)
|
||||
}
|
||||
}
|
||||
func (s quotalist) Matrix(m *ice.Message, arg ...string) {
|
||||
msg := m.Spawn()
|
||||
s.Tables(msg, goodslist{})
|
||||
s.Fields(msg, "goodslist_title", "quotalist_title", "quotalists.content", "amount")
|
||||
list := []string{}
|
||||
data := kit.Dict()
|
||||
amount := map[string]string{}
|
||||
s.Select(msg).Table(func(value ice.Maps) {
|
||||
kit.Value(data, kit.Keys(value["quotalist_title"], value["goodslist_title"]), value[model.CONTENT])
|
||||
kit.If(kit.IndexOf(list, value["goodslist_title"]) == -1, func() { list = append(list, value["goodslist_title"]) })
|
||||
amount[value["goodslist_title"]] = value[model.AMOUNT]
|
||||
})
|
||||
kit.For(data, func(key string, value ice.Any) {
|
||||
m.Push("会员定价", key)
|
||||
kit.For(list, func(k string) { m.Push(k, kit.Format(kit.Value(value, k))) })
|
||||
})
|
||||
m.Push("会员定价", "会员价/月")
|
||||
kit.For(list, func(k string) { m.Push(k, kit.Format("¥ %v", kit.Float(amount[k])/100)) })
|
||||
m.DisplayTable()
|
||||
}
|
||||
func (s quotalist) List(m *ice.Message, arg ...string) {
|
||||
s.Matrix(m)
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(quotalist{Table: newTable()}) }
|
||||
|
||||
func (s quotalist) insert(m *ice.Message, auth, level string, total int, content, title string, arg ...string) {
|
||||
uid := kit.Hashs(auth, level, kit.Select(m.PrefixKey(), arg, 0))
|
||||
if s.Select(m.Spawn(), model.UID, uid).Length() > 0 {
|
||||
return
|
||||
}
|
||||
s.Insert(m, model.UID, uid, model.PLACE_UID, auth,
|
||||
model.GOODSLIST_UID, kit.Hashs(auth, level), model.TITLE, title, model.CONTENT, content,
|
||||
model.TOTAL, kit.Format(total), model.VENDOR, kit.Select(m.PrefixKey(), arg, 0))
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.onimport.myView(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.title]},
|
||||
{view: html.OUTPUT, list: [value.content]},
|
||||
] }, function(event) {})
|
||||
},
|
||||
})
|
@ -12,8 +12,8 @@ import (
|
||||
type recent struct {
|
||||
Table
|
||||
service service
|
||||
order string `data:"903"`
|
||||
create string `name:"create place_uid service_uid"`
|
||||
order string `data:"101"`
|
||||
create string `name:"create service_uid args"`
|
||||
remove string `name:"remove" role:"void"`
|
||||
open string `name:"open" role:"void"`
|
||||
sticky string `name:"sticky" role:"void"`
|
||||
@ -21,23 +21,25 @@ type recent struct {
|
||||
}
|
||||
|
||||
func (s recent) Create(m *ice.Message, arg ...string) {
|
||||
if args := m.OptionSimple(model.USER_UID, model.PLACE_UID); s.Select(m, args...).Length() == 0 {
|
||||
s.Insert(m, kit.Simple(arg, model.UPDATED_AT, m.Time(), m.OptionSimple(model.USER_UID))...)
|
||||
if args := m.OptionSimple(model.USER_UID, model.SERVICE_UID, ctx.ARGS); s.Table.Select(m, args...).Length() == 0 {
|
||||
s.Table.Create(m, kit.Simple(arg, model.UPDATED_AT, m.Time(), m.OptionSimple(model.USER_UID))...)
|
||||
} else {
|
||||
s.Update(m, kit.Dict(arg), args...)
|
||||
s.Table.Update(m, kit.Dict(m.OptionSimple(model.AUTH_STATUS)), args...)
|
||||
}
|
||||
}
|
||||
func (s recent) Remove(m *ice.Message, arg ...string) {
|
||||
s.Delete(m, m.OptionSimple(model.USER_UID, model.UID)...)
|
||||
s.Table.Delete(m, m.OptionSimple(model.USER_UID, model.UID)...)
|
||||
}
|
||||
func (s recent) List(m *ice.Message, arg ...string) {
|
||||
if len(arg) < 2 {
|
||||
s.Tables(m, s.service).Fields(m, s.Key(s, model.UID), s.Key(s, model.UPDATED_AT),
|
||||
model.SERVICE_ICON, model.SERVICE_NAME, s.Key(s, model.AUTH_STATUS), model.SCORE,
|
||||
s.Tables(m, s.service).Fields(m,
|
||||
model.SERVICE_ICON, model.SERVICE_NAME,
|
||||
s.AS(model.NODENAME, model.SPACE), model.INDEX, model.ARGS, s.Key(s, model.AUTH_STATUS), model.SCORE,
|
||||
s.Key(s, model.UID), s.Key(s, model.UPDATED_AT),
|
||||
s.Key(s, model.CITY_NAME), s.Key(s, model.STREET_NAME), s.Key(s, model.PLACE_NAME),
|
||||
s.AS(model.NODENAME, model.SPACE), model.INDEX, model.PLACE_UID,
|
||||
).Orders(m, s.Desc(model.SCORE), s.Desc(s.Key(s, model.UPDATED_AT)))
|
||||
s.Select(m, model.USER_UID, m.Option(model.USER_UID)).Action()
|
||||
)
|
||||
s.Orders(m, s.Desc(model.SCORE), s.Desc(model.UPDATED_AT))
|
||||
s.Select(m, model.USER_UID, m.Option(model.USER_UID))
|
||||
} else if len(arg) == 2 {
|
||||
s.SelectDetail(m, model.USER_UID, m.Option(model.USER_UID), model.UID, arg[1])
|
||||
}
|
||||
@ -47,17 +49,17 @@ func (s recent) List(m *ice.Message, arg ...string) {
|
||||
} else {
|
||||
m.PushButton(s.UnSticky, s.Remove)
|
||||
}
|
||||
})
|
||||
}).Action()
|
||||
s.DisplayBase(m, "")
|
||||
}
|
||||
func (s recent) Open(m *ice.Message, arg ...string) {
|
||||
m.ProcessOpen(web.S(m.Option(web.SPACE)) + web.C(m.Option(ctx.INDEX)) + "#" + kit.Join(kit.Split(m.Option(ctx.ARGS)), ":"))
|
||||
}
|
||||
func (s recent) Sticky(m *ice.Message, arg ...string) {
|
||||
s.Update(m, ice.Map{model.SCORE: 100}, m.OptionSimple(model.USER_UID, model.UID)...)
|
||||
s.Table.Update(m, ice.Map{model.SCORE: 100}, m.OptionSimple(model.USER_UID, model.UID)...)
|
||||
}
|
||||
func (s recent) UnSticky(m *ice.Message, arg ...string) {
|
||||
s.Update(m, ice.Map{model.SCORE: 0}, m.OptionSimple(model.USER_UID, model.UID)...)
|
||||
s.Table.Update(m, ice.Map{model.SCORE: 0}, m.OptionSimple(model.USER_UID, model.UID)...)
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(recent{Table: newTable()}) }
|
||||
func init() { ice.TeamCtxCmd(recent{}) }
|
||||
|
@ -1,15 +1,14 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.onimport.myView(can, msg, function(value) { value._style = []; if (value.score > 0) { value._style = ["sticky"] }
|
||||
if (can._stacks_root._stacks[[value.space,value.index, value.place_uid].join(",")]) { value._style.push("loaded") }
|
||||
value.icons = can.misc.Resource(can, value.service_icon.split("?")[0], value.space)
|
||||
_init: function(can, msg) { can.onimport.shareTitle(can, msg)
|
||||
can.onimport.itemcards(can, msg, function(value) { var args = can.core.Split(value.args)
|
||||
value.icons = can.misc.Resource(can, value.service_icon, value.space); if (value.score > 0) { value._style = ["sticky"] }
|
||||
var sub = can._root.Action._plugins[[value.space, value.index, args[0]].join(",")]
|
||||
return [
|
||||
{view: html.TITLE, list: [value.place_name, can.onimport.authView(can, value), can.onimport.timeView(can, value)]},
|
||||
{view: html.TITLE, list: [value.place_name, can.onimport.authView(can, value), sub? {text: ["load", "", mdb.STATUS]}: "", can.onimport.timeView(can, value)]},
|
||||
{view: html.STATUS, list: [value.city_name, value.street_name, value.service_name]},
|
||||
]
|
||||
}, function(event, value) { can.onaction._goback(event, function() {
|
||||
// can.onimport.myPlugin(can, {space: value.space, index: value.index, args: [value.place_uid]})
|
||||
can.onimport.myStory(can, {space: value.space, index: value.index, args: [value.place_uid]})
|
||||
}) })
|
||||
}, function(event, value) { var args = can.core.Split(value.args); can.onaction._goback(can)
|
||||
can.onimport.plugin(can, {_title: value.place_name, space: value.space, index: value.index, args: [args[0]]})
|
||||
})
|
||||
},
|
||||
})
|
||||
})
|
Before Width: | Height: | Size: 2.5 KiB |
@ -14,11 +14,11 @@ func (s search) List(m *ice.Message, arg ...string) {
|
||||
} else if len(arg) == 2 {
|
||||
m.FieldsSetDetail().Cmdy(s.Place, s.Select, model.UID, arg[1]).Action()
|
||||
}
|
||||
m.RenameAppend(model.TYPE, s.Keys(s.Place, model.TYPE))
|
||||
m.RenameAppend(model.TYPE, s.Keys(s.Place, model.TYPE), model.CREATOR, model.USER_UID)
|
||||
s.SelectJoin(m, s.Street, model.NAME, model.CITY_UID)
|
||||
s.SelectJoinCity(m)
|
||||
s.SelectJoinUser(m)
|
||||
s.DisplayBase(m, "")
|
||||
s.Display(m, "")
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(search{Tables: newTables()}) }
|
||||
|
@ -1,13 +1,14 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.onimport.myView(can, msg, function(value) {
|
||||
_init: function(can, msg) { can.onimport.shareTitle(can, msg)
|
||||
can.onimport.itemcards(can, msg, function(value) {
|
||||
return [
|
||||
{view: html.TITLE, list: [value.name||value.title||value.user_name]},
|
||||
{view: html.STATUS, list: [value.uid && value.uid.slice(0, 6), can.onimport.timeView(can, value)]},
|
||||
{view: html.STATUS, list: [value.uid && value.uid.slice(0, 6), can.base.TimeTrim(value.created_at||value.updated_at)]},
|
||||
{view: html.STATUS, list: [value.city_name, value.street_name, value.company_name]},
|
||||
{view: html.OUTPUT, list: [value.info||value.content]},
|
||||
]
|
||||
}, function(event, value) { can.onaction._goback(can)
|
||||
}, function(event, value) {
|
||||
// can.onaction._goback(can)
|
||||
can.onimport.plugin(can, {args: [value.uid]})
|
||||
})
|
||||
},
|
||||
|
@ -6,7 +6,6 @@ import (
|
||||
|
||||
"shylinux.com/x/ice"
|
||||
"shylinux.com/x/icebergs/base/aaa"
|
||||
"shylinux.com/x/icebergs/base/cli"
|
||||
"shylinux.com/x/icebergs/base/ctx"
|
||||
"shylinux.com/x/icebergs/base/mdb"
|
||||
"shylinux.com/x/icebergs/base/nfs"
|
||||
@ -15,118 +14,99 @@ import (
|
||||
"shylinux.com/x/icebergs/core/code"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/community/src/api"
|
||||
"shylinux.com/x/community/src/gonganxitong/model"
|
||||
)
|
||||
|
||||
type service struct {
|
||||
Table
|
||||
order string `data:"904"`
|
||||
order string `data:"102"`
|
||||
update string `name:"update index name icon"`
|
||||
autogen string `name:"autogen name* help* class* table* dream" icon:"bi bi-plus-square-dotted"`
|
||||
autogen string `name:"autogen name* help* class* table*" icon:"bi bi-plus-square-dotted"`
|
||||
oauth string `name:"oauth" icon:"bi bi-shield-fill-check"`
|
||||
open string `name:"open" role:"void"`
|
||||
conf string `name:"conf" role:"void"`
|
||||
}
|
||||
|
||||
func ServiceUID(m *ice.Message) string {
|
||||
return kit.Hashs(ice.Info.Hostname, ice.Info.Pwd, m.Prefix(web.PORTAL))
|
||||
}
|
||||
func (s service) Inputs(m *ice.Message, arg ...string) {
|
||||
switch s.Table.Inputs(m, arg...); arg[0] {
|
||||
case web.DREAM:
|
||||
m.Cut(arg[0])
|
||||
}
|
||||
}
|
||||
func (s service) Update(m *ice.Message, arg ...string) {
|
||||
uid := ServiceUID(m)
|
||||
if s.Select(m.Spawn(), model.UID, uid).Length() == 0 {
|
||||
s.Insert(m, kit.Simple(model.UID, uid, model.INDEX, m.Prefix(web.PORTAL), tcp.NODETYPE, ice.Info.NodeType, tcp.NODENAME, ice.Info.NodeName, nfs.PATHNAME, ice.Info.Pwd, tcp.HOSTNAME, ice.Info.Hostname)...)
|
||||
uid := kit.Hashs(ice.Info.Hostname, ice.Info.Pwd, m.Option(ctx.INDEX))
|
||||
if s.Table.Select(m.Spawn(), model.UID, uid).Length() == 0 {
|
||||
s.Table.Create(m, kit.Simple(model.UID, uid, m.OptionSimple(mdb.ICON, mdb.NAME, ctx.INDEX), nfs.PATHNAME, ice.Info.Pwd, tcp.HOSTNAME, ice.Info.Hostname)...)
|
||||
m.Cmd(s.PrefixPortal(m)).Table(func(value ice.Maps) { m.Cmd(s.PrefixPortal(m), mdb.MODIFY, value[ctx.INDEX], mdb.ENABLE, ice.TRUE) })
|
||||
}
|
||||
s.Table.Update(m, kit.Dict(arg, m.OptionSimple(mdb.NAME, mdb.ICON), nfs.MODULE, ice.Info.Make.Module, nfs.VERSION, ice.Info.Make.Versions()), model.UID, uid)
|
||||
m.Cmd(s.PrefixPortal(m), Portal{}.CommandUpdate, uid)
|
||||
}
|
||||
func (s service) Oauth(m *ice.Message, arg ...string) {
|
||||
m.Options(m.Cmd(web.CHAT_WX_ACCESS).AppendSimple())
|
||||
m.Option("sess_cmd", kit.JoinWord(m.Prefix(aaa.SESS), mdb.CREATE))
|
||||
m.Option("user_cmd", kit.JoinWord(m.Prefix(aaa.USER), mdb.CREATE))
|
||||
m.Cmd(web.SPACE, ice.OPS, ctx.CONFIG, web.CHAT_WX_AGENT, web.SPACE, m.Option(ice.MSG_USERPOD))
|
||||
m.Cmd(web.CHAT_WX_ACCESS, web.OAUTH)
|
||||
m.Cmd(grant{}, web.HEADER)
|
||||
m.ProcessHold()
|
||||
s.Table.Update(m, kit.Dict(arg, m.OptionSimple(mdb.NAME, mdb.ICON),
|
||||
nfs.MODULE, ice.Info.Make.Module, nfs.VERSION, ice.Info.Make.Versions(),
|
||||
tcp.NODENAME, ice.Info.NodeName, tcp.NODETYPE, ice.Info.NodeType,
|
||||
web.DOMAIN, ice.Info.Make.Domain, web.PORTAL, ctx.GetCmdFile(m.Message, m.Prefix(web.PORTAL)),
|
||||
), model.UID, uid)
|
||||
m.Cmd(s.PrefixPortal(m), "updateCommand", uid)
|
||||
}
|
||||
func (s service) Autogen(m *ice.Message, arg ...string) {
|
||||
p, table := path.Join(nfs.SRC, m.Option(mdb.NAME)), m.Option(mdb.TABLE)
|
||||
m.Option(nfs.MODULE, m.Cmdx(web.SPACE, m.Option(web.DREAM), code.AUTOGEN, code.IMPORT, m.Option(mdb.NAME)))
|
||||
m.Option("CLASS", strings.ToUpper(m.Option(mdb.CLASS)))
|
||||
m.Option("Class", kit.Capital(m.Option(mdb.CLASS)))
|
||||
m.Option("class", kit.LowerCapital(m.Option(mdb.CLASS)))
|
||||
m.Option("TABLE", strings.ToUpper(table))
|
||||
m.Option("Table", kit.Capital(table))
|
||||
m.Option("table", kit.LowerCapital(table))
|
||||
m.Option("what", kit.LowerCapital(table))
|
||||
msg := m.Cmd(api.GONGANXITONG_SERVICE)
|
||||
cmd := func(arg ...string) { m.Cmd(web.SPACE, m.Option(web.DREAM), arg) }
|
||||
if m.Option(web.DREAM) != "" {
|
||||
option := func(ctx, mod string) { cmd(code.AUTOGEN, code.IMPORT, mod, ctx, nfs.SRC_OPTION_GO) }
|
||||
option("shylinux.com/x/ice", "devops")
|
||||
option("shylinux.com/x/ice", "portal")
|
||||
demo := func(p string) { cmd(nfs.SAVE, p, m.Cmdx(nfs.CAT, p)) }
|
||||
demo("src/template/web.code.autogen/demo.go")
|
||||
demo("src/template/web.code.go/demo.go")
|
||||
demo("src/template/web.code.js/demo.js")
|
||||
defer cmd(cli.SYSTEM, "go", "mod", "tidy")
|
||||
}
|
||||
save := func(name string, arg ...string) {
|
||||
cmd(nfs.DEFS, path.Join(p, name), msg.Template("template/"+kit.Select(name, arg, 0)))
|
||||
}
|
||||
save("model/model.go")
|
||||
save("common.go")
|
||||
save("portal.go")
|
||||
save("portal.json")
|
||||
save("user"+m.Option("Class")+".go", "userClass.go")
|
||||
save(m.Option("class")+".go", "class.go")
|
||||
m.Option("TABLE", strings.ToUpper(m.Option(mdb.TABLE)))
|
||||
m.Option("Table", kit.Capital(m.Option(mdb.TABLE)))
|
||||
m.Option("table", kit.LowerCapital(m.Option(mdb.TABLE)))
|
||||
code.AutogenImport(m.Message, m.Option(mdb.NAME))
|
||||
m.Option(nfs.MODULE, path.Join(code.AutogenMod(m.Message), nfs.SRC, m.Option(mdb.NAME)))
|
||||
p, from := path.Join(nfs.SRC, m.Option(mdb.NAME)), "template/"
|
||||
msg := m.Cmd("web.team.gonganxitong.service")
|
||||
m.Cmd(nfs.DEFS, path.Join(p, "model/model.go"), msg.Template(from+"model/model.go"))
|
||||
m.Cmd(nfs.DEFS, path.Join(p, "common.go"), msg.Template(from+"common.go"))
|
||||
m.Cmd(nfs.DEFS, path.Join(p, "portal.go"), msg.Template(from+"portal.go"))
|
||||
m.Cmd(nfs.DEFS, path.Join(p, "portal.json"), msg.Template(from+"portal.json"))
|
||||
m.Cmd(nfs.DEFS, path.Join(p, "user"+m.Option("Class")+".go"), msg.Template(from+"userClass.go"))
|
||||
m.Cmd(nfs.DEFS, path.Join(p, m.Option("class")+".go"), msg.Template(from+"class.go"))
|
||||
kit.For(kit.Split(m.Option(mdb.TABLE)), func(table string) {
|
||||
msg.Option(mdb.TABLE, kit.LowerCapital(table))
|
||||
save(table+".go", "homework.go")
|
||||
save(table+".js", "homework.js")
|
||||
m.Cmd(nfs.DEFS, path.Join(p, m.Option(mdb.TABLE)+".go"), msg.Template(from+"homework.go"))
|
||||
m.Cmd(nfs.DEFS, path.Join(p, m.Option(mdb.TABLE)+".js"), msg.Template(from+"homework.js"))
|
||||
})
|
||||
}
|
||||
func (s service) Compile(m *ice.Message, arg ...string) {
|
||||
m.Cmdy(code.VIMER, code.COMPILE)
|
||||
}
|
||||
func (s service) Oauth(m *ice.Message, arg ...string) {
|
||||
defer m.ToastProcess()()
|
||||
m.Options(m.Cmd(web.CHAT_WX_ACCESS).AppendSimple())
|
||||
m.Option("user_cmd", kit.JoinWord(m.Prefix(aaa.USER), mdb.CREATE))
|
||||
m.Option("sess_cmd", kit.JoinWord(m.Prefix(aaa.SESS), mdb.CREATE))
|
||||
m.Cmd(web.CHAT_WX_ACCESS, web.OAUTH)
|
||||
m.Cmd(web.SPACE, ice.OPS, ctx.CONFIG, web.CHAT_WX_AGENT, web.SPACE, m.Option(ice.MSG_USERPOD))
|
||||
m.ProcessHold()
|
||||
}
|
||||
func (s service) List(m *ice.Message, arg ...string) {
|
||||
if len(arg) < 2 {
|
||||
s.Orders(m, s.Desc(model.UPDATED_AT)).Select(m)
|
||||
if len(arg) == 2 {
|
||||
s.Table.SelectDetail(m, model.UID, arg[1])
|
||||
} else {
|
||||
s.SelectDetail(m, model.UID, arg[1])
|
||||
s.Orders(m, s.Desc(model.UPDATED_AT)).Select(m)
|
||||
}
|
||||
list := m.CmdMap(web.SPACE, ice.OPS, web.SPACE, mdb.NAME)
|
||||
m.Table(func(value ice.Maps) {
|
||||
if _, ok := list[value[tcp.NODENAME]]; ok && value[ctx.INDEX] != "" {
|
||||
if m.Cmd(web.SPACE, ice.OPS, web.SPACE, value[tcp.NODENAME], value[ctx.INDEX], kit.Dict(mdb.VIEW, mdb.TABLE)).Length() > 0 {
|
||||
m.Push(mdb.STATUS, web.ONLINE)
|
||||
return
|
||||
}
|
||||
}
|
||||
m.Push(mdb.STATUS, "")
|
||||
})
|
||||
if m.IsTech() {
|
||||
m.PushAction(s.Open, s.Conf, s.Code, s.Data).Action(s.Oauth, s.Autogen)
|
||||
m.PushAction(s.Open, s.Conf, s.Project).Action(s.Autogen, s.Compile, s.Oauth)
|
||||
} else {
|
||||
m.PushAction(s.Open).Action()
|
||||
}
|
||||
m.RenameAppend(model.NODENAME, model.SPACE, model.NODETYPE, model.SERVICE_TYPE, mdb.STATUS, model.SERVICE_STATUS)
|
||||
s.DisplayBase(m, "")
|
||||
m.Sort("status,updated_at", []string{web.ONLINE}, ice.STR_R).Display("")
|
||||
m.RenameAppend("nodetype", model.SERVICE_TYPE, mdb.STATUS, model.SERVICE_STATUS)
|
||||
}
|
||||
func (s service) Open(m *ice.Message, arg ...string) {
|
||||
s.spaceOpen(m, m.Option(ctx.INDEX))
|
||||
m.ProcessOpen(web.S(m.Option(tcp.NODENAME)) + web.C(m.Option(ctx.INDEX)))
|
||||
}
|
||||
func (s service) Conf(m *ice.Message, arg ...string) {
|
||||
s.spaceOpen(m, m.Option(ctx.INDEX), mdb.VIEW, mdb.TABLE)
|
||||
m.ProcessOpen(web.S(m.Option(tcp.NODENAME)) + web.C(m.Option(ctx.INDEX)) + "?view=table")
|
||||
}
|
||||
func (s service) Code(m *ice.Message, arg ...string) {
|
||||
s.spaceOpen(m, code.VIMER, nfs.PATH, nfs.SRC, nfs.FILE, s.name(m)+"/portal.go")
|
||||
}
|
||||
func (s service) Data(m *ice.Message, arg ...string) {
|
||||
s.spaceOpen(m, web.CODE_MYSQL_QUERY, aaa.SESS, "mysql", mdb.DATABASE, s.name(m))
|
||||
func (s service) Project(m *ice.Message, arg ...string) {
|
||||
m.ProcessOpen(web.S(m.Option(tcp.NODENAME)) + web.C(web.CODE_VIMER) + "?path=src/&file=" + strings.Split(kit.Select("", strings.Split(m.Option(web.PORTAL), "/src/"), 1), "?")[0])
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(service{}) }
|
||||
|
||||
func (s service) name(m *ice.Message) string {
|
||||
return kit.Select("", strings.Split(m.Option(ctx.INDEX), "."), -2)
|
||||
}
|
||||
func (s service) spaceOpen(m *ice.Message, index string, arg ...ice.Any) {
|
||||
m.ProcessOpen(kit.MergeURL(web.S(m.Option(web.SPACE))+web.C(index), arg...))
|
||||
}
|
||||
|
@ -1,15 +1,13 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.onimport.myView(can, msg, function(value) {
|
||||
value.icons = can.misc.Resource(can, value.icon.split("?")[0], value.space)
|
||||
return [
|
||||
{view: html.TITLE, list: [value.name]},
|
||||
{view: html.STATUS, list: [value.index]},
|
||||
{view: html.STATUS, list: [value.module, value.version]},
|
||||
]
|
||||
}, function(event, value) { can.onaction._goback(event, function() {
|
||||
// can.onimport.myPlugin(can, {space: value.space, index: value.index})
|
||||
can.onimport.myStory(can, {space: value.space, index: value.index})
|
||||
}) })
|
||||
can.onimport.itemcards(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.name, can.onimport.textView(can, value, "service_type"), can.onimport.textView(can, value, "service_status")]},
|
||||
// {view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.updated_at)]},
|
||||
{view: html.STATUS, list: [value.index]},
|
||||
{view: html.STATUS, list: [value.module, value.version]},
|
||||
// {view: html.STATUS, list: [value.domain.split("?")[0]]},
|
||||
] }, function(event, value) { can.onaction._goback(can)
|
||||
can.onimport.plugin(can, {space: value.space||value.nodename, index: value.index})
|
||||
})
|
||||
},
|
||||
})
|
Before Width: | Height: | Size: 2.4 KiB |
@ -16,11 +16,11 @@ type sess struct {
|
||||
}
|
||||
|
||||
func (s sess) Create(m *ice.Message, arg ...string) {
|
||||
s.Insert(m, model.USER_UID, m.Option(model.USER_UID), web.AGENT, m.Option(ice.MSG_USERUA), aaa.IP, m.Option(ice.MSG_USERIP))
|
||||
m.ProcessCookie(ice.MSG_SESSID, m.Option(ice.MSG_SESSID, kit.JoinWord(web.SPACE, m.Option(ice.MSG_USERPOD), m.PrefixKey(), aaa.CHECK, m.Result())), "-2")
|
||||
s.Table.Create(m, model.USER_UID, m.Option(model.USER_UID), web.AGENT, m.Option(ice.MSG_USERUA), aaa.IP, m.Option(ice.MSG_USERIP))
|
||||
m.ProcessCookie(ice.MSG_SESSID, kit.JoinWord(web.SPACE, m.Option(ice.MSG_USERPOD), m.PrefixKey(), aaa.CHECK, m.Result()), "-2")
|
||||
}
|
||||
func (s sess) Check(m *ice.Message, arg ...string) {
|
||||
msg := s.Select(m.Spawn(), model.UID, arg[0])
|
||||
msg := s.Table.Select(m.Spawn(), model.UID, arg[0])
|
||||
msg = m.Cmd(s.user, s.Select, model.UID, msg.Append(model.USER_UID))
|
||||
m.Option(ice.MSG_USERROLE, aaa.VOID)
|
||||
m.Option(ice.MSG_USERNAME, msg.Append(model.UID))
|
||||
|
@ -1,6 +0,0 @@
|
||||
$output>div.item { border-radius:10px; background-color:var(--output-bg-color); padding:10px; margin:10px; display:flex; align-items:center; }
|
||||
$output>div.item span.name { flex-grow:1; }
|
||||
$output>div.item span.outer { background-color:gray; border-radius:12px; padding:2px; height:24px; width:40px; display:inline-block; float:right; }
|
||||
$output>div.item span.inner { border-radius:10px; background-color:white; height:20px; width:20px; display:inline-block; }
|
||||
$output>div.item span.outer.on { background-color:var(--notice-bg-color); }
|
||||
$output>div.item span.outer.on span.inner { float:right; }
|
@ -1,56 +0,0 @@
|
||||
package gonganxitong
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/community/src/gonganxitong/model"
|
||||
)
|
||||
|
||||
type setting struct {
|
||||
Table
|
||||
recent recent
|
||||
service service
|
||||
order string `data:"103"`
|
||||
role string `data:"leader,worker,server"`
|
||||
short string `data:"name"`
|
||||
field string `data:"name,type,help"`
|
||||
fields string `data:"name,value"`
|
||||
create string `name:"create name* type* help" role:"tech"`
|
||||
update string `name:"update" role:"void"`
|
||||
placeTrash string `name:"placeTrash" help:"删除数据" style:"danger" role:"leader"`
|
||||
}
|
||||
|
||||
func (s setting) Init(m *ice.Message, arg ...string) {
|
||||
s.Table.Init(m, arg...)
|
||||
s.Create(m, model.NAME, SETTING_PROFILE, model.TYPE, SETTING_RADIO)
|
||||
}
|
||||
func (s setting) Create(m *ice.Message, arg ...string) {
|
||||
s.Hash.Create(m, arg...)
|
||||
}
|
||||
func (s setting) Update(m *ice.Message, arg ...string) {
|
||||
m.OptionDefault(model.PLACE_UID, m.Option(s.Keys(s.Place, model.UID)))
|
||||
if s.Table.Select(m.Spawn(), m.OptionSimple(model.PLACE_UID, model.USER_UID, model.NAME)...).Length() == 0 {
|
||||
s.Table.Insert(m, m.OptionSimple(model.PLACE_UID, model.USER_UID, model.NAME, model.VALUE)...)
|
||||
} else {
|
||||
s.Table.Update(m, kit.Dict(m.OptionSimple(model.VALUE)), m.OptionSimple(model.PLACE_UID, model.USER_UID, model.NAME)...)
|
||||
}
|
||||
}
|
||||
func (s setting) List(m *ice.Message, arg ...string) {
|
||||
if len(arg) == 1 {
|
||||
data := ice.Maps{}
|
||||
msg := s.Select(m.Spawn(), model.PLACE_UID, arg[0], model.USER_UID, m.Option(model.USER_UID))
|
||||
msg.Table(func(value ice.Maps) { data[value[model.NAME]] = value[model.VALUE] })
|
||||
s.Hash.List(m).Table(func(value ice.Maps) { m.Push(model.VALUE, data[value[model.NAME]]) }).Action()
|
||||
} else if len(arg) == 2 {
|
||||
s.SelectDetail(m, model.PLACE_UID, arg[0], model.USER_UID, m.Option(model.USER_UID), model.NAME, arg[1])
|
||||
}
|
||||
s.DisplayBase(m, "").DisplayCSS("")
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(setting{Table: newTable()}) }
|
||||
|
||||
const (
|
||||
SETTING_RADIO = "radio"
|
||||
SETTING_PROFILE = "profile"
|
||||
)
|
@ -1,13 +0,0 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.page.Append(can, can._output, msg.Table(function(value) {
|
||||
return {view: html.ITEM, list: [{text: [can.user.trans(can, value.name, null, "value.setting"), "", mdb.NAME]}, can.onimport[value.type](can, value)]}
|
||||
}))
|
||||
},
|
||||
radio: function(can, value) {
|
||||
return {text: ["", "", ["outer", value.value]], list: [{text: ["", "", "inner"]}], onclick: function(event) {
|
||||
if (value.value == "on") { value.value = "off" } else { value.value = "on" }
|
||||
can.runAction(can.request(event, value, can.Option(), {_toast: value.name}), mdb.UPDATE, [])
|
||||
}}
|
||||
},
|
||||
})
|
Before Width: | Height: | Size: 5.5 KiB |
@ -1,56 +0,0 @@
|
||||
package gonganxitong
|
||||
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"shylinux.com/x/ice"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/community/src/gonganxitong/model"
|
||||
)
|
||||
|
||||
type spendlist struct {
|
||||
Table
|
||||
fields string `data:"vendor,total,count,expire_time"`
|
||||
}
|
||||
|
||||
func (s spendlist) List(m *ice.Message, arg ...string) {
|
||||
if len(arg) == 2 {
|
||||
s.Tables(m, quotalist{})
|
||||
s.Fields(m, "quotalists.title,quotalists.content,expire_time,spendlists.vendor,spendlists.total,count")
|
||||
s.Select(m, s.Key(s, model.PLACE_UID), arg[0], model.PAYMENTLIST_UID, arg[1]).Display("")
|
||||
}
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(spendlist{Table: newTable()}) }
|
||||
|
||||
func (s Table) SpendlistCheck(m *ice.Message, size int) bool {
|
||||
if size == 0 && m.Length() == 0 {
|
||||
return true
|
||||
}
|
||||
if size == 0 && m.Result() != "" {
|
||||
return true
|
||||
}
|
||||
msg := m.Cmd(s.Prefix(m, spendlist{}), s.Select, m.OptionSimple(model.PLACE_UID), model.VENDOR, m.PrefixKey())
|
||||
m.Echo("%s / %s",
|
||||
strings.TrimSuffix(kit.FmtSize(kit.Int(msg.Append(model.COUNT))), "B"),
|
||||
strings.TrimSuffix(kit.FmtSize(kit.Int(msg.Append(model.TOTAL))), "B"),
|
||||
)
|
||||
m.Option(model.SPENDLIST_UID, msg.Option(model.UID))
|
||||
if kit.Int(msg.Append(model.COUNT))+size >= kit.Int(msg.Append(model.TOTAL)) {
|
||||
if !m.Warn(size > 0, "存储空间不足,请及时续费或清理空间") {
|
||||
m.SetResult()
|
||||
m.Echo("<span style='color:red'>存储空间不足,请及时续费或清理空间</span>").Action()
|
||||
}
|
||||
return false
|
||||
}
|
||||
kit.If(size > 0, func() { s.SpendlistCount(m, size) })
|
||||
return true
|
||||
}
|
||||
func (s Table) SpendlistCount(m *ice.Message, size int) {
|
||||
m.Cmd(s.Prefix(m, spendlist{}), s.AddCount, model.COUNT, size, m.Option(model.SPENDLIST_UID))
|
||||
}
|
||||
func (s Table) SpendlistUpdate(m *ice.Message, size string) {
|
||||
msg := m.Cmd(s.Prefix(m, spendlist{}), s.Select, model.PLACE_UID, m.Option(model.PLACE_UID), model.VENDOR, m.PrefixKey())
|
||||
m.Options(model.UID, msg.Append(model.UID)).Cmd(s.Prefix(m, spendlist{}), s.Modify, model.COUNT, size)
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.onimport.myView(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.title||value.vendor]},
|
||||
{view: html.STATUS, list: [value.expire_time]},
|
||||
{view: html.OUTPUT, list: [can.base.Size(value.count), " / ", can.base.Size(value.total)]},
|
||||
] }, function(event) {})
|
||||
},
|
||||
})
|
@ -2,45 +2,19 @@ package gonganxitong
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/community/src/gonganxitong/model"
|
||||
)
|
||||
|
||||
type street struct {
|
||||
Table
|
||||
city city
|
||||
modify string `name:"modify info" role:"tech"`
|
||||
list string `name:"list city_name street_name auto" role:"void"`
|
||||
authCreate string `name:"authCreate" role:"tech"`
|
||||
}
|
||||
type street struct{ Table }
|
||||
|
||||
func (s street) FindOrCreateByName(m *ice.Message, arg ...string) {
|
||||
if msg := m.Cmd(s, s.Select, model.CITY_UID, arg[1], model.NAME, arg[3]); msg.Length() == 0 {
|
||||
msg := m.Cmd(s, s.Insert, model.CITY_UID, arg[1], model.NAME, arg[3])
|
||||
msg := m.Cmd(s, s.Create, model.CITY_UID, arg[1], model.NAME, arg[3])
|
||||
arg[2], arg[3] = model.STREET_UID, msg.Result()
|
||||
} else {
|
||||
arg[2], arg[3] = model.STREET_UID, msg.Append(model.UID)
|
||||
}
|
||||
}
|
||||
func (s street) Modify(m *ice.Message, arg ...string) {
|
||||
s.Update(m, kit.Dict(m.OptionSimple(model.INFO)), m.OptionSimple(model.UID)...)
|
||||
}
|
||||
func (s street) List(m *ice.Message, arg ...string) {
|
||||
if len(arg) == 0 {
|
||||
m.Cmdy(s.city).RenameAppend(model.NAME, model.CITY_NAME)
|
||||
} else if msg := m.Cmd(s.city, arg[0]); len(arg) == 1 {
|
||||
s.Select(m, model.CITY_UID, msg.Append(model.UID)).Action()
|
||||
} else if len(arg) == 2 {
|
||||
s.SelectDetail(m, model.CITY_UID, msg.Append(model.UID), model.NAME, arg[1])
|
||||
if m.Append(model.AUTH_UID) == "" && m.IsTech() {
|
||||
m.EchoInfoButton("请申请街道认证", s.AuthCreate)
|
||||
}
|
||||
}
|
||||
}
|
||||
func (s street) AuthCreate(m *ice.Message, arg ...string) {
|
||||
msg := m.Cmd("web.team.gonganxitong.city", s.Select, model.UID, m.Option(model.CITY_UID))
|
||||
s.Table.AuthCreate(m, 6, msg.Append(model.AUTH_UID), m.OptionSimple(model.UID)...)
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(street{}) }
|
||||
|
@ -1,7 +0,0 @@
|
||||
$output>div.list { background-color:var(--output-bg-color); height:calc(100% - 32px - 20px); }
|
||||
$output>div.list>div.item.card { margin:10px; display:flex; align-items:start; }
|
||||
$output>div.list>div.item.card>div.container { flex-grow:1; }
|
||||
$output>div.send { padding:10px; width:100%; display:flex; align-items:center; position:fixed; bottom:0; }
|
||||
$output>div.send input[type=text] { flex-grow:1; }
|
||||
$output>div.send input[type=button] { background-color:var(--notice-bg-color); color:var(--notice-fg-color); }
|
||||
$output>div.send span.button { background-color:var(--notice-bg-color); color:var(--notice-fg-color); padding:10px; margin-left:-3px; height:32px; display:flex; align-items:center; }
|
@ -1,29 +1,12 @@
|
||||
package gonganxitong
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/community/src/gonganxitong/model"
|
||||
)
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
type support struct {
|
||||
Table
|
||||
order string `data:"905"`
|
||||
create string `name:"create title content" role:"void"`
|
||||
order string `data:"103"`
|
||||
}
|
||||
|
||||
func (s support) Create(m *ice.Message, arg ...string) {
|
||||
m.OptionDefault(model.PLACE_UID, m.Option(s.Keys(s.Place, model.UID)))
|
||||
s.Insert(m, kit.Simple(arg, m.OptionSimple(model.PLACE_UID, model.USER_UID))...)
|
||||
}
|
||||
func (s support) List(m *ice.Message, arg ...string) {
|
||||
if len(arg) == 1 {
|
||||
s.Orders(m, model.CREATED_AT)
|
||||
s.Select(m, model.USER_UID, m.Option(model.USER_UID)).Action()
|
||||
}
|
||||
s.SelectJoinUser(m)
|
||||
s.DisplayBase(m, "").DisplayCSS("")
|
||||
}
|
||||
func (s support) List(m *ice.Message, arg ...string) {}
|
||||
|
||||
func init() { ice.TeamCtxCmd(support{Table: newTable()}) }
|
||||
func init() { ice.TeamCtxCmd(support{}) }
|
||||
|
@ -1,20 +0,0 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) { var target
|
||||
can.ui = can.page.Append(can, can._output, [html.LIST, {view: "send", list: [
|
||||
{type: html.INPUT, data: {type: html.TEXT}, onfocus: function(event) {
|
||||
target = event.target
|
||||
}, onblur: function(event) {
|
||||
}},
|
||||
{text: [can.user.trans(can, "send"), "", html.BUTTON], onclick: function(event) {
|
||||
can.runAction(can.request(event, {_handle: ice.TRUE}), mdb.CREATE, [html.TITLE, "", html.CONTENT, target.value])
|
||||
}},
|
||||
]}])
|
||||
can.page.Append(can, can.ui.list, msg.Table(function(value) {
|
||||
return {view: html.ITEM_CARD, list: [{img: value.user_avatar}, {view: html.CONTAINER, list: [
|
||||
value.title && {view: html.TITLE, list: [{text: value.title}]},
|
||||
{view: html.STATUS, list: [{text: value.user_name}, can.onimport.timeView(can, value)]},
|
||||
{view: html.CONTENT, list: [{text: value.content}]},
|
||||
]}]}
|
||||
}))
|
||||
},
|
||||
})
|
Before Width: | Height: | Size: 2.3 KiB |
@ -35,6 +35,11 @@ func (s Table) RewriteAppend(m *ice.Message, arg ...string) *ice.Message {
|
||||
})
|
||||
return s.Table.RewriteAppend(m)
|
||||
}
|
||||
func (s Table) CheckRole(m *ice.Message, arg ...string) *ice.Message {
|
||||
role := User{{.Option "Class"}}Role(kit.Int(m.Cmd(user{{.Option "Class"}}{}, s.Select, m.OptionSimple(model.{{.Option "CLASS"}}_UID, model.USER_UID)).Append(model.ROLE)))
|
||||
m.WarnNotRight(!kit.IsIn(role.String(), append(arg, User{{.Option "Class"}}Creator.String())...), role.String())
|
||||
return m
|
||||
}
|
||||
|
||||
type Tables struct { Table }
|
||||
|
||||
|
@ -1,15 +1,25 @@
|
||||
package {{.Option "name"}}
|
||||
|
||||
import "shylinux.com/x/ice"
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"{{.Option "module"}}/model"
|
||||
)
|
||||
|
||||
type {{.Option "table"}} struct {
|
||||
Table
|
||||
order string `data:"1"`
|
||||
fields string `data:"title,content,user_uid"`
|
||||
create string `name:"create title* content*" role:"leader"`
|
||||
remove string `name:"remove" role:"leader"`
|
||||
{{.Option "class"}} {{.Option "class"}}
|
||||
user{{.Option "Class"}} user{{.Option "Class"}}
|
||||
create string `name:"create title* content*" role:"leader"`
|
||||
}
|
||||
|
||||
func (s {{.Option "table"}}) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") }
|
||||
func (s {{.Option "table"}}) Create(m *ice.Message, arg ...string) {
|
||||
s.Table.Create(m, kit.Simple(arg, m.OptionSimple(model.USER_UID, model.{{.Option "CLASS"}}_UID))...)
|
||||
s.RecordEventWithName(m, "")
|
||||
}
|
||||
func (s {{.Option "table"}}) List(m *ice.Message, arg ...string) {
|
||||
s.TablesWithRole(m, arg, s.user{{.Option "Class"}}, s.{{.Option "class"}}, s, model.TITLE, model.CONTENT).Display("")
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd({{.Option "table"}}{}) }
|
||||
|
@ -1,9 +1,9 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.onimport.myView(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.title||value.name]},
|
||||
{view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value), value.user_name]},
|
||||
{view: html.OUTPUT, list: [value.content||value.info]},
|
||||
_init: function(can, msg) { can.onimport.shareTitle(can, msg)
|
||||
can.onimport.itemcards(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.title]},
|
||||
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at), value.user_name]},
|
||||
{view: html.OUTPUT, list: [value.content]},
|
||||
] })
|
||||
},
|
||||
})
|
||||
|
@ -5,8 +5,8 @@ import "shylinux.com/x/mysql-story/src/db"
|
||||
const (
|
||||
UID = "uid"
|
||||
NAME = "name"
|
||||
INFO = "info"
|
||||
TYPE = "type"
|
||||
ROLE = "role"
|
||||
TITLE = "title"
|
||||
CONTENT = "content"
|
||||
USER_UID = "user_uid"
|
||||
@ -14,7 +14,9 @@ const (
|
||||
{{.Option "CLASS"}}_UID = "{{.Option "class"}}_uid"
|
||||
{{.Option "CLASS"}}_NAME = "{{.Option "class"}}_name"
|
||||
{{.Option "CLASS"}}_TYPE = "{{.Option "class"}}_type"
|
||||
{{.Option "TABLE"}}_UID = "{{.Option "what"}}_uid"
|
||||
{{.Option "TABLE"}}_UID = "{{.Option "table"}}_uid"
|
||||
COMPANY_UID = "company_uid"
|
||||
CITY_UID = "city_uid"
|
||||
)
|
||||
|
||||
type User{{.Option "Class"}} struct {
|
||||
|
@ -6,8 +6,10 @@ import (
|
||||
)
|
||||
|
||||
type Portal struct {
|
||||
guanlixitong.Portal
|
||||
placeCreate string `name:"placeCreate city_name* company_name* {{.Option "class"}}_name* {{.Option "class"}}_type:select" role:"void"`
|
||||
gonganxitong.Portal
|
||||
placeCreate string `name:"placeCreate city_name* company_name* {{.Option "class"}}_name*" role:"void"`
|
||||
}
|
||||
|
||||
func init() { gonganxitong.PortalCmd(Portal{Portal: guanlixitong.NewPortal(user{{.Option "Class"}}{}, {{.Option "class"}}{})}) }
|
||||
func init() {
|
||||
gonganxitong.PortalCmd(Portal{Portal: gonganxitong.NewPortal(user{{.Option "Class"}}{}, {{.Option "class"}}{}, guanlixitong.Company{})})
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
{
|
||||
"portal": "{{.Option "help"}}",
|
||||
"{{.Option "what"}}": "场景应用",
|
||||
"{{.Option "table"}}": "场景应用",
|
||||
"icons": {
|
||||
"{{.Option "what"}}": "https://img.icons8.com/officel/80/activity-grid.png"
|
||||
"{{.Option "table"}}": "https://img.icons8.com/officel/80/activity-grid.png"
|
||||
},
|
||||
"input": {
|
||||
"My {{.Option "Class"}}": "我的场景",
|
||||
"user_{{.Option "class"}}_role": "成员角色",
|
||||
"user_{{.Option "class"}}_role": "用户角色",
|
||||
"{{.Option "class"}}_name": "场景名称",
|
||||
"{{.Option "class"}}_type": "场景类型"
|
||||
},
|
||||
|
@ -1,15 +1,27 @@
|
||||
package {{.Option "name"}}
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
|
||||
"shylinux.com/x/enterprise/src/guanlixitong"
|
||||
)
|
||||
import "shylinux.com/x/ice"
|
||||
|
||||
type user{{.Option "Class"}} struct{ Table }
|
||||
|
||||
func init() { ice.TeamCtxCmd(user{{.Option "Class"}}{}) }
|
||||
func init() { ice.TeamCtxCmd(user{}) }
|
||||
|
||||
type User{{.Option "Class"}}Role = guanlixitong.UserGroupRole
|
||||
type User{{.Option "Class"}}Role int
|
||||
|
||||
var User{{.Option "Class"}}RoleList = guanlixitong.UserGroupRoleList
|
||||
const (
|
||||
User{{.Option "Class"}}Visitor User{{.Option "Class"}}Role = iota
|
||||
User{{.Option "Class"}}Creator
|
||||
User{{.Option "Class"}}Leader
|
||||
User{{.Option "Class"}}Worker
|
||||
User{{.Option "Class"}}Server
|
||||
)
|
||||
|
||||
var User{{.Option "Class"}}RoleList = map[User{{.Option "Class"}}Role]string{
|
||||
User{{.Option "Class"}}Visitor: "visitor",
|
||||
User{{.Option "Class"}}Creator: "creator",
|
||||
User{{.Option "Class"}}Leader: "leader",
|
||||
User{{.Option "Class"}}Worker: "worker",
|
||||
User{{.Option "Class"}}Server: "server",
|
||||
}
|
||||
|
||||
func (s User{{.Option "Class"}}Role) String() string { return User{{.Option "Class"}}RoleList[s] }
|
||||
|
@ -1,22 +0,0 @@
|
||||
package gonganxitong
|
||||
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/community/src/gonganxitong/model"
|
||||
)
|
||||
|
||||
type thumb struct{ Table }
|
||||
|
||||
func (s thumb) Toggle(m *ice.Message, arg ...string) {
|
||||
if msg := s.Select(m.Spawn(), m.OptionSimple(model.MARKET_UID, model.USER_UID)...); msg.Length() == 0 {
|
||||
s.Insert(m.Spawn(), kit.Simple(m.OptionSimple(model.MARKET_UID, model.USER_UID), model.STATUS, 1)...)
|
||||
m.Echo("1")
|
||||
} else {
|
||||
s.AddCount(m.Spawn(), model.STATUS, "1", msg.Append(model.UID))
|
||||
m.Echo(kit.Format(kit.Int(msg.Append(model.STATUS)) + 1))
|
||||
}
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(thumb{}) }
|
@ -1,12 +1,10 @@
|
||||
package gonganxitong
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"shylinux.com/x/ice"
|
||||
"shylinux.com/x/icebergs/base/aaa"
|
||||
"shylinux.com/x/icebergs/base/mdb"
|
||||
"shylinux.com/x/icebergs/base/nfs"
|
||||
"shylinux.com/x/icebergs/base/web"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
@ -16,82 +14,47 @@ import (
|
||||
|
||||
type user struct {
|
||||
Table
|
||||
setting setting
|
||||
template string `data:"4b-Z_r8dZmm1pHdd2h4A10VVYX4OIHvemlLjsHKBj2s"`
|
||||
create string `name:"create open_id* avatar usernick"`
|
||||
modify string `name:"modify info" role:"void"`
|
||||
list string `name:"list uid auto" role:"void"`
|
||||
email string `name:"email email*"`
|
||||
setCookie string `name:"setCookie" help:"切换" role:"void"`
|
||||
sendCookie string `name:"sendCookie" help:"授权" role:"void"`
|
||||
community string `data:"20240724-community"`
|
||||
template string `data:"4b-Z_r8dZmm1pHdd2h4A10VVYX4OIHvemlLjsHKBj2s"`
|
||||
create string `name:"create open_id* usernick avatar"`
|
||||
email string `name:"email email*"`
|
||||
}
|
||||
|
||||
func (s user) Create(m *ice.Message, arg ...string) {
|
||||
m.OptionDefault(aaa.AVATAR, m.Option(ice.MSG_AVATAR), aaa.USERNICK, m.Option(ice.MSG_USERNICK))
|
||||
if msg := s.Table.Select(m.Spawn(), m.OptionSimple(model.OPEN_ID)...); msg.Length() == 0 {
|
||||
s.Insert(m, kit.Simple(m.OptionSimple(model.OPEN_ID, model.AVATAR), model.NAME, m.Option(aaa.USERNICK))...)
|
||||
if m.IsTech() {
|
||||
m.OptionDefault(aaa.AVATAR, m.Option(ice.MSG_AVATAR))
|
||||
m.OptionDefault(aaa.USERNICK, m.Option(ice.MSG_USERNICK))
|
||||
}
|
||||
if s.Table.Select(m, m.OptionSimple(model.OPEN_ID)...).Length() == 0 {
|
||||
s.Table.Create(m, kit.Simple(m.OptionSimple(model.OPEN_ID, model.AVATAR), model.NAME, m.Option(aaa.USERNICK))...)
|
||||
m.Option(model.USER_UID, m.Result())
|
||||
} else {
|
||||
s.Update(m, kit.Dict(m.OptionSimple(model.AVATAR), model.NAME, m.Option(aaa.USERNICK)), msg.AppendSimple(model.UID)...)
|
||||
m.Option(model.USER_UID, msg.Append(model.UID))
|
||||
s.Table.Update(m, kit.Dict(m.OptionSimple(model.AVATAR), model.NAME, m.Option(aaa.USERNICK)), m.AppendSimple(model.UID)...)
|
||||
m.Option(model.USER_UID, m.Append(model.UID))
|
||||
}
|
||||
}
|
||||
func (s user) Modify(m *ice.Message, arg ...string) {
|
||||
s.Update(m, kit.Dict(m.OptionSimple(model.INFO)), model.UID, m.Option(model.USER_UID))
|
||||
}
|
||||
func (s user) Remove(m *ice.Message, arg ...string) {
|
||||
s.Delete(m, m.OptionSimple(model.UID)...)
|
||||
}
|
||||
func (s user) List(m *ice.Message, arg ...string) {
|
||||
if len(arg) == 0 {
|
||||
if m.IsTech() {
|
||||
s.Limit(m, 300)
|
||||
s.Select(m, arg...).Table(func(value ice.Maps) {
|
||||
if value[model.UID] != m.Option(model.USER_UID) {
|
||||
m.PushButton(s.SetCookie)
|
||||
} else {
|
||||
m.PushButton()
|
||||
}
|
||||
})
|
||||
m.EchoQRCode(m.MergePodCmd("", m.PrefixKey()+"/action/sendCookie", ice.FROM_DAEMON, m.Option(ice.MSG_DAEMON))).Echo("<br/>").Echo("请扫码授权")
|
||||
m.StatusTimeCount(mdb.TOTAL, s.SelectTotal(m))
|
||||
}
|
||||
} else {
|
||||
s.SelectDetail(m, model.UID, arg[0])
|
||||
if m.Append(model.AUTH_UID) == "" && arg[0] == m.Option(model.USER_UID) {
|
||||
m.EchoInfoButton("请申请个人认证", s.AuthCreate)
|
||||
}
|
||||
}
|
||||
}
|
||||
func (s user) SelectTotal(m *ice.Message, arg ...string) string {
|
||||
msg := m.Spawn()
|
||||
s.Fields(msg, "count(*) AS total")
|
||||
return s.Select(msg, arg...).Append(model.TOTAL)
|
||||
}
|
||||
func (s user) Email(m *ice.Message, arg ...string) {
|
||||
s.Table.Update(m, kit.Dict(m.OptionSimple(model.EMAIL)))
|
||||
}
|
||||
func (s user) AuthCreate(m *ice.Message, arg ...string) {
|
||||
msg := s.Select(m.Spawn(), model.UID, m.Option(model.USER_UID))
|
||||
if msg.Length() == 0 {
|
||||
s.Insert(m.Spawn(), model.UID, m.Option(model.USER_UID), model.NAME, m.Option(ice.MSG_USERNAME))
|
||||
m.Options(model.NAME, m.Option(ice.MSG_USERNAME))
|
||||
} else {
|
||||
m.Options(msg.AppendSimple(model.NAME, model.INFO))
|
||||
}
|
||||
s.Table.AuthCreate(m, 2, m.Option(model.AUTH_UID))
|
||||
}
|
||||
func (s user) SendCookie(m *ice.Message, arg ...string) {
|
||||
if m.Option(ice.MSG_METHOD) == http.MethodGet {
|
||||
m.EchoInfoButton("请确认授权", s.SendCookie)
|
||||
} else {
|
||||
m.Cmd(web.SPACE, m.Option(ice.FROM_DAEMON), "cookie", m.Option(model.USER_UID), model.USER_UID)
|
||||
if m.IsTech() {
|
||||
s.Table.List(m, arg...).Table(func(value ice.Maps) {
|
||||
if value[model.UID] != m.Option(model.USER_UID) {
|
||||
m.PushButton(s.SetCookie)
|
||||
} else {
|
||||
m.PushButton()
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
func (s user) SetCookie(m *ice.Message, arg ...string) {
|
||||
m.ProcessCookie(model.USER_UID, m.Option(model.UID))
|
||||
}
|
||||
func (s user) Email(m *ice.Message, arg ...string) {
|
||||
s.Table.Update(m, kit.Dict(m.OptionSimple(model.EMAIL)), model.UID, m.Option(model.USER_UID))
|
||||
}
|
||||
func (s user) SendTemplate(m *ice.Message, arg ...string) { // from uid url type name hash
|
||||
if ice.Info.NodeName != m.Config("community") {
|
||||
m.AdminCmd(web.SPACE, m.Config("community"), m.PrefixKey(), m.ActionKey(), arg, kit.Dict(ice.MSG_USERROLE, aaa.TECH))
|
||||
return
|
||||
}
|
||||
msg := s.Select(m, model.UID, kit.Select(m.Option(model.USER_UID), arg, 1))
|
||||
m.Cmdy("web.chat.wx.template", "", m.Config(nfs.TEMPLATE), msg.Append(model.OPEN_ID), kit.Select("", arg, 2),
|
||||
"thing7", kit.Select("", arg, 3), "thing12", kit.Select("", arg, 4), "character_string2", kit.Cut(kit.Select("", arg, 5), 6),
|
||||
|
@ -1,15 +1,25 @@
|
||||
package huodongzuzhi
|
||||
|
||||
import "shylinux.com/x/ice"
|
||||
import (
|
||||
"shylinux.com/x/ice"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
|
||||
"shylinux.com/x/community/src/huodongzuzhi/model"
|
||||
)
|
||||
|
||||
type activity struct {
|
||||
Table
|
||||
fields string `data:"title,content,user_uid"`
|
||||
create string `name:"create title* content*" role:"leader"`
|
||||
modify string `name:"modify title* content*" role:"leader"`
|
||||
remove string `name:"remove" role:"leader"`
|
||||
group group
|
||||
userGroup userGroup
|
||||
create string `name:"create title* content*" role:"leader"`
|
||||
}
|
||||
|
||||
func (s activity) List(m *ice.Message, arg ...string) { s.ValueList(m, arg).Display("") }
|
||||
func (s activity) Create(m *ice.Message, arg ...string) {
|
||||
s.Table.Create(m, kit.Simple(arg, m.OptionSimple(model.USER_UID, model.GROUP_UID))...)
|
||||
s.RecordEventWithName(m, "")
|
||||
}
|
||||
func (s activity) List(m *ice.Message, arg ...string) {
|
||||
s.TablesWithRole(m, arg, s.userGroup, s.group, s, model.TITLE, model.CONTENT).Display("")
|
||||
}
|
||||
|
||||
func init() { ice.TeamCtxCmd(activity{}) }
|
||||
|
@ -1,8 +1,8 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg) {
|
||||
can.onimport.myView(can, msg, function(value) { return [
|
||||
_init: function(can, msg) { can.onimport.shareTitle(can, msg)
|
||||
can.onimport.itemcards(can, msg, function(value) { return [
|
||||
{view: html.TITLE, list: [value.title]},
|
||||
{view: html.STATUS, list: [value.uid.slice(0, 6), can.onimport.timeView(can, value), value.user_name]},
|
||||
{view: html.STATUS, list: [value.uid.slice(0, 6), can.base.TimeTrim(value.created_at), value.user_name]},
|
||||
{view: html.OUTPUT, list: [value.content]},
|
||||
] })
|
||||
},
|
||||
|
@ -5,8 +5,8 @@ import "shylinux.com/x/mysql-story/src/db"
|
||||
const (
|
||||
UID = "uid"
|
||||
NAME = "name"
|
||||
INFO = "info"
|
||||
TYPE = "type"
|
||||
ROLE = "role"
|
||||
TITLE = "title"
|
||||
CONTENT = "content"
|
||||
USER_UID = "user_uid"
|
||||
@ -15,6 +15,8 @@ const (
|
||||
GROUP_NAME = "group_name"
|
||||
GROUP_TYPE = "group_type"
|
||||
ACTIVITY_UID = "activity_uid"
|
||||
COMPANY_UID = "company_uid"
|
||||
CITY_UID = "city_uid"
|
||||
)
|
||||
|
||||
type UserGroup struct {
|
||||
|