Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fdb9f5109f | ||
|
|
5a080f502d | ||
|
|
04c12e2076 | ||
|
|
84bbf2faf4 | ||
|
|
5d7b8526f4 | ||
|
|
651e7e16f3 | ||
|
|
8af636641f | ||
|
|
8305129c73 | ||
|
|
57cb98f49e | ||
|
|
c7a295521d | ||
|
|
2f4ee76b7b | ||
|
|
27ce68a76e | ||
|
|
3a7502f106 | ||
|
|
479f7b22a7 | ||
|
|
0baba07707 | ||
|
|
6f4b3f07d4 | ||
|
|
a3ddb90a8a | ||
|
|
5a19a4ed79 | ||
|
|
9980ea1264 | ||
|
|
f5faa29018 | ||
|
|
be0dac6bfa | ||
|
|
1b812bc9c9 | ||
|
|
ac67215c78 | ||
|
|
0621ef1ede | ||
|
|
0264d41428 | ||
|
|
d1a371d257 | ||
|
|
e7f70f46a8 | ||
|
|
b774d2e733 | ||
|
|
2819f96dfd | ||
|
|
bdc8898b93 | ||
|
|
49f15b8a05 | ||
|
|
2bd7ef3b80 | ||
|
|
4f36ff9ceb | ||
|
|
b2307f583f | ||
|
|
ec696d5187 | ||
|
|
f9f97db272 | ||
|
|
3250de382a | ||
|
|
97090eb08b | ||
|
|
e46df62c0b | ||
|
|
297934f862 | ||
|
|
19e1bbc9d7 | ||
|
|
e2c937f424 | ||
|
|
4d9da5e3a6 | ||
|
|
93249cf5f5 | ||
|
|
1d34e5745d | ||
|
|
f52ce4136e | ||
|
|
7e239a0c73 | ||
|
|
41f4dade91 | ||
|
|
9bf2d3dbb1 | ||
|
|
449696af04 | ||
|
|
302aec52a6 | ||
|
|
357c0edb52 | ||
|
|
0ded3cce9f | ||
|
|
0f7101983e | ||
|
|
e91ce14408 | ||
|
|
c3fbfeefa8 | ||
|
|
aa3dafa932 | ||
|
|
08fa15db24 | ||
|
|
a7ae4db2fb | ||
|
|
a0f104d1b4 | ||
|
|
2c7d6cdf0a | ||
|
|
efd3b57826 | ||
|
|
0e3bd97c55 | ||
|
|
59226875f3 | ||
|
|
696d8f1fff | ||
|
|
4279f99be1 | ||
|
|
a53ce07228 |
@@ -1,11 +0,0 @@
|
|||||||
node_modules
|
|
||||||
src
|
|
||||||
public
|
|
||||||
config
|
|
||||||
dist/base
|
|
||||||
dist/ld
|
|
||||||
dist/_verify
|
|
||||||
.git
|
|
||||||
.workbuddy
|
|
||||||
*.log
|
|
||||||
vite.config.ts.timestamp-*
|
|
||||||
@@ -1,9 +1,8 @@
|
|||||||
# 开发环境 (dev):仅 vite dev 加载(--mode dev)。值可自由指本地或线上地址。
|
# 开发环境 (dev):仅 vite dev 加载(--mode dev)。值可自由指本地或线上地址。
|
||||||
# build 产物不读此文件(build 默认 production mode,只认 .env / .env.production,两者均不存在),
|
# build 产物不读此文件(build 默认 production mode,只认 .env / .env.production,两者均不存在),
|
||||||
# 线上环境差异全部由 projman 的 env-config-{目标}.json 承担。
|
# 线上环境差异全部由 projman 的 env-config-{目标}.json 承担(后端 GET /api/env-config?target=front 下发)。
|
||||||
VITE_BASE_HOST=http://base.bestsch.com
|
VITE_BASE_HOST=https://base.bestsch.com
|
||||||
VITE_SSO_HOST=http://sso.yunhaixingtong.com
|
VITE_SSO_HOST=http://sso.yunhaixingtong.com
|
||||||
VITE_SERVICE_HOST=http://localhost:8060
|
VITE_SERVICE_HOST=http://localhost:8070
|
||||||
VITE_ZIYUANKU_HOST=https://base.bestsch.com/BschZyk
|
VITE_FILE_HOST=http://localhost:8130/
|
||||||
VITE_ZHUANXIANG_HOST=https://base.bestsch.com/BschZncpd
|
|
||||||
VITE_IS_MOCK=false
|
VITE_IS_MOCK=false
|
||||||
|
|||||||
@@ -0,0 +1,112 @@
|
|||||||
|
name: build
|
||||||
|
|
||||||
|
# 前端应用 CI(照 notice/front build.yml 模板):构建 → 打包 zip → 推 Nexus raw → webhook 通知 projman 建档
|
||||||
|
# 触发:push 到 main / 手动 Run workflow
|
||||||
|
# userhome 应用 deployMode=auto:webhook 建档后 projman 自动发布前端版本(下载 zip → persist → Caddy 切链)
|
||||||
|
# 凭据不走仓库 Secrets:runner 与 projman 同机,Nexus 凭据与部署令牌均从宿主 prod.env / projman DB 直读
|
||||||
|
# (NEXUS_USER 缺省 admin;DEPLOY_TOKEN = app_identity code=proj11-deploy 的明文,与 webhook 校验同源)
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [ main ]
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container:
|
||||||
|
image: docker:24
|
||||||
|
options: --network infra-infra-net
|
||||||
|
steps:
|
||||||
|
- name: 安装 git / curl / zip(alpine)
|
||||||
|
run: |
|
||||||
|
# 统一走 aliyun 源:dl-cdn 时段性被拦会卡满 60s×2(2026-10-20 事故)
|
||||||
|
sed -i 's#dl-cdn.alpinelinux.org#mirrors.aliyun.com#g' /etc/apk/repositories
|
||||||
|
apk add --no-cache git curl zip
|
||||||
|
|
||||||
|
# 内网 Gitea 无法访问 GitHub 拉 actions/checkout,手动 clone 本仓库
|
||||||
|
- name: 拉取源码(内网无 GitHub,手动 clone 本仓库)
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
run: |
|
||||||
|
git clone --depth 1 --branch main "http://x-access-token:${GITHUB_TOKEN}@gitea.yunhaixingtong.com/${{ github.repository }}.git" /tmp/src
|
||||||
|
cp -a /tmp/src/. .
|
||||||
|
rm -rf /tmp/src
|
||||||
|
COMMIT_MSG=$(git log -1 --pretty=%s | tr '\n' ' ' | sed 's/["\\]/ /g' | cut -c1-200)
|
||||||
|
echo "COMMIT_MSG=${COMMIT_MSG}" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
|
# 凭据:宿主 prod.env(Nexus)+ projman DB(部署令牌);经 docker.sock 起一次性容器读取,不回显
|
||||||
|
- name: 读取凭据(prod.env + projman DB)
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
PWD_DB=$(docker run --rm -v /opt/docker/projman-deploy:/pe:ro alpine sh -c "grep '^PROJMAN_DB_PASSWORD=' /pe/prod.env | head -1 | cut -d= -f2-")
|
||||||
|
NXUSER=$(docker run --rm -v /opt/docker/projman-deploy:/pe:ro alpine sh -c "grep '^PROJMAN_NEXUS_USER=' /pe/prod.env | head -1 | cut -d= -f2-")
|
||||||
|
NXPASS=$(docker run --rm -v /opt/docker/projman-deploy:/pe:ro alpine sh -c "grep '^PROJMAN_NEXUS_PASSWORD=' /pe/prod.env | head -1 | cut -d= -f2-")
|
||||||
|
TOKEN=$(docker exec -e MYSQL_PWD="$PWD_DB" mysql8 mysql -uroot -N -e \
|
||||||
|
"select secret_text from app_identity where code='proj11-deploy' and purpose='deploy_token' limit 1" bsch_projman \
|
||||||
|
| tr -d '[:space:]')
|
||||||
|
[ -n "$NXUSER" ] || NXUSER=admin
|
||||||
|
[ -n "$NXPASS" ] || { echo 'Nexus 凭据缺失'; exit 1; }
|
||||||
|
[ -n "$TOKEN" ] || { echo 'userhome 部署令牌缺失'; exit 1; }
|
||||||
|
echo "NEXUS_USER=${NXUSER}" >> "$GITHUB_ENV"
|
||||||
|
echo "NEXUS_PASSWORD=${NXPASS}" >> "$GITHUB_ENV"
|
||||||
|
echo "DEPLOY_TOKEN=${TOKEN}" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
|
# 前端构建:独立 node 容器(容器名全局唯一,防并发互踩——2026-09-10 三仓同推事故)
|
||||||
|
- name: 构建前端(node 容器)
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
BUILD_CONTAINER="frontbuild-${GITHUB_RUN_ID:-0}-$(date +%s)"
|
||||||
|
echo "BUILD_CONTAINER=${BUILD_CONTAINER}"
|
||||||
|
docker rm -f "$BUILD_CONTAINER" 2>/dev/null || true
|
||||||
|
# npm 缓存落宿主持久目录,跨构建复用(照 notice/service 的 m2 缓存做法);无此卷则每次从零下载 754 个包
|
||||||
|
mkdir -p /opt/docker/projman-npm-cache
|
||||||
|
docker run -d --name "$BUILD_CONTAINER" \
|
||||||
|
-v /opt/docker/projman-npm-cache:/root/.npm \
|
||||||
|
-w /build node:20 sleep 3600
|
||||||
|
docker cp "${PWD}/." "$BUILD_CONTAINER":/build/
|
||||||
|
docker exec "$BUILD_CONTAINER" sh -c '
|
||||||
|
set -e
|
||||||
|
cd /build
|
||||||
|
# 内网到 registry.npmjs.org 跨境极慢(实测 npm install 12分46秒/754 包),切国内镜像
|
||||||
|
npm config set registry https://registry.npmmirror.com
|
||||||
|
if [ -f .npmrc ]; then sed -i "/SASS_BINARY_PATH/d" .npmrc; fi
|
||||||
|
# 本仓不提交 lock(.gitignore 忽略 yarn.lock/package-lock 均无),npm ci 无 lock 必 EUSAGE——用 install。
|
||||||
|
# --ignore-scripts:依赖里的 node-sass@6 是 webpack 遗留(vite 5 实际走 dart-sass),
|
||||||
|
# 其 node-gyp 编译在 node:20 无预编译包必炸;esbuild 二进制走 optionalDependencies 不受影响。
|
||||||
|
# --prefer-offline:优先用 /root/.npm 缓存,避免重复下载
|
||||||
|
npm install --ignore-scripts --no-audit --no-fund --loglevel=error --prefer-offline
|
||||||
|
npm run build
|
||||||
|
'
|
||||||
|
echo "=== dist 产物 ==="
|
||||||
|
docker exec "$BUILD_CONTAINER" sh -c 'ls -la /build/dist/ | head -20'
|
||||||
|
docker cp "$BUILD_CONTAINER":/build/dist ./dist
|
||||||
|
docker rm -f "$BUILD_CONTAINER"
|
||||||
|
echo "BUILD CHECK OK"
|
||||||
|
|
||||||
|
# 打包 dist → zip(vite outDir 直出 dist/,zip 根目录直接是 index.html/css/js)
|
||||||
|
- name: 打包产物
|
||||||
|
run: |
|
||||||
|
TAG=$(echo "$GITHUB_SHA" | cut -c1-8)
|
||||||
|
ZIP_FILE="userhome-front-${TAG}.zip"
|
||||||
|
cd dist && zip -r "../${ZIP_FILE}" . && cd ..
|
||||||
|
echo "ZIP_FILE=${ZIP_FILE}" >> "$GITHUB_ENV"
|
||||||
|
echo "TAG=${TAG}" >> "$GITHUB_ENV"
|
||||||
|
ls -la "${ZIP_FILE}"
|
||||||
|
|
||||||
|
- name: 上传产物到 Nexus
|
||||||
|
run: |
|
||||||
|
set -e
|
||||||
|
NEXUS_URL="http://nexus.yunhaixingtong.com:8081/repository/front-hosted/${ZIP_FILE}"
|
||||||
|
curl -sSf -X PUT -u "${NEXUS_USER}:${NEXUS_PASSWORD}" --upload-file "${ZIP_FILE}" "${NEXUS_URL}"
|
||||||
|
echo "NEXUS_URL=${NEXUS_URL}" >> "$GITHUB_ENV"
|
||||||
|
echo "uploaded to ${NEXUS_URL}"
|
||||||
|
|
||||||
|
# 通知 projman:webhook 建档(type=front);userhome deployMode=auto → 建档后自动发布
|
||||||
|
- name: 通知 projman 建档(auto 发布)
|
||||||
|
run: |
|
||||||
|
curl -sSf -X POST "http://192.168.10.160:8090/projman/api/deploy/webhook" \
|
||||||
|
-H "Content-Type: application/json" \
|
||||||
|
-H "X-Deploy-Token: ${DEPLOY_TOKEN}" \
|
||||||
|
-d "{\"app\":\"userhome\",\"front\":\"front\",\"tag\":\"${TAG}\",\"sha\":\"${GITHUB_SHA}\",\"message\":\"${COMMIT_MSG}\",\"nexusUrl\":\"${NEXUS_URL}\"}"
|
||||||
|
echo "webhook 建档完成,auto 模式将自动发布"
|
||||||
@@ -1,88 +0,0 @@
|
|||||||
name: deploy-userbase-front
|
|
||||||
|
|
||||||
# 前端部署(方案 B:不打包镜像,直接部署静态文件 + 软链接版本控制)
|
|
||||||
# 触发:push 到 main(已启用仓库 Actions,push 自动部署)/ 手动 Run workflow
|
|
||||||
# 核心:vite build --mode prod -> dist/prod
|
|
||||||
# -> 拷贝到 /data/www/userbase/releases/<version>/
|
|
||||||
# -> 原子切换 /data/www/userbase/front 软链接指向新版本
|
|
||||||
# -> 保留最近 5 个版本,更早自动清理(秒级回滚)
|
|
||||||
# 不再构建/推送 nginx 镜像;Caddy 已改为 file_server(root=/srv/userbase=/data/www/userbase)。
|
|
||||||
# 依赖:160 宿主的 docker daemon(runner 已挂 docker.sock),且 runner valid_volumes 已放行 /data/www/**。无需 NEXUS secret。
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main]
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
build-and-deploy:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
# docker:24 自带 docker CLI,复用宿主 docker daemon(act_runner v0.6.1 已挂载 docker.sock)。
|
|
||||||
# 切勿再声明 volumes: docker.sock(会报 Duplicate mount point)。
|
|
||||||
container:
|
|
||||||
image: docker:24
|
|
||||||
steps:
|
|
||||||
- name: Install git (alpine)
|
|
||||||
run: apk add --no-cache git
|
|
||||||
|
|
||||||
# 内网 Gitea 无法访问 github.com 拉取 actions/checkout,改为直接 clone 本仓库
|
|
||||||
- name: Checkout (manual, internal Gitea)
|
|
||||||
run: |
|
|
||||||
git clone --depth 1 --branch main http://192.168.10.160:3000/${GITHUB_REPOSITORY}.git /tmp/src
|
|
||||||
cp -a /tmp/src/. .
|
|
||||||
rm -rf /tmp/src
|
|
||||||
|
|
||||||
# 构建 + 部署:在 node:20 容器里完成(源码经 docker cp 传入,并挂载宿主 /data/www/userbase)
|
|
||||||
- name: Build & Deploy (symlink versioning)
|
|
||||||
run: |
|
|
||||||
set -e
|
|
||||||
# 版本号:short sha + 时间戳(可改为 git tag 优先,见下)
|
|
||||||
VERSION="$(echo ${GITHUB_SHA} | cut -c1-7)-$(date +%Y%m%d-%H%M)"
|
|
||||||
echo "Deploying version: $VERSION"
|
|
||||||
|
|
||||||
docker rm -f frontbuild 2>/dev/null || true
|
|
||||||
docker run -d --name frontbuild \
|
|
||||||
-e VERSION="$VERSION" \
|
|
||||||
-v /data/www/userbase:/data/www/userbase \
|
|
||||||
-w /build node:20 sleep 3600
|
|
||||||
|
|
||||||
# 源码拷入构建容器(绕过 act 工作区非宿主路径的坑,与 service 的 mavenbuild 一致)
|
|
||||||
docker cp "${PWD}/." frontbuild:/build/
|
|
||||||
|
|
||||||
docker exec frontbuild sh -c '
|
|
||||||
set -e
|
|
||||||
cd /build
|
|
||||||
# 去掉 Windows 专用 sass 二进制路径(Linux 容器内该路径无效,否则 build 报错)
|
|
||||||
# .npmrc 被 gitignore、CI 克隆下来没有它,故仅在存在时才删(缺失不报错)
|
|
||||||
if [ -f .npmrc ]; then sed -i "/SASS_BINARY_PATH/d" .npmrc; fi
|
|
||||||
npm ci
|
|
||||||
npm run build:prod
|
|
||||||
'
|
|
||||||
|
|
||||||
# 部署:首次把真实目录 front 迁入 releases/initial 并建软链;之后均为软链替换
|
|
||||||
docker exec frontbuild sh -c '
|
|
||||||
set -e
|
|
||||||
cd /build
|
|
||||||
# ---- 首次初始化:front 当前是真实目录,无法直接 ln -sfn 覆盖 ----
|
|
||||||
if [ ! -L /data/www/userbase/front ]; then
|
|
||||||
mkdir -p /data/www/userbase/releases
|
|
||||||
mv /data/www/userbase/front /data/www/userbase/releases/initial
|
|
||||||
# 相对软链:Caddy 容器内 /data/www/userbase 挂在 /srv/userbase,
|
|
||||||
# 绝对路径在容器内解析不到,必须用相对路径(相对 front 所在目录)
|
|
||||||
ln -sfn releases/initial /data/www/userbase/front
|
|
||||||
echo "INIT: front -> releases/initial (保留上线前状态用于回滚)"
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p /data/www/userbase/releases/$VERSION
|
|
||||||
cp -r /build/dist/prod/. /data/www/userbase/releases/$VERSION/
|
|
||||||
# 原子切换:front 此时已是软链接,ln -sfn 直接替换指向(必须用相对路径)
|
|
||||||
ln -sfn releases/$VERSION /data/www/userbase/front
|
|
||||||
echo "current symlink ->"; ls -la /data/www/userbase/front
|
|
||||||
# 清理旧版本,保留最近 5 个(initial 也会被计入,最多保留 5 个含 initial)
|
|
||||||
cd /data/www/userbase/releases
|
|
||||||
ls -1t | tail -n +6 | while read d; do echo "rm old: $d"; rm -rf "$d"; done
|
|
||||||
echo "remaining versions:"; ls -1t
|
|
||||||
'
|
|
||||||
|
|
||||||
docker rm -f frontbuild
|
|
||||||
echo "DEPLOY OK: $VERSION"
|
|
||||||
@@ -1,6 +1,3 @@
|
|||||||
# WorkBuddy local state
|
|
||||||
.workbuddy/
|
|
||||||
|
|
||||||
# Logs
|
# Logs
|
||||||
logs
|
logs
|
||||||
*.log
|
*.log
|
||||||
@@ -15,6 +12,20 @@ dist
|
|||||||
dist-ssr
|
dist-ssr
|
||||||
*.local
|
*.local
|
||||||
|
|
||||||
|
# 视觉取证 harness(本地临时用,不进 git;与 harness-* 同类)
|
||||||
|
.vite-card-harness
|
||||||
|
dist_card_harness
|
||||||
|
card-harness.html
|
||||||
|
card-harness.vite.config.ts
|
||||||
|
src/card-harness-main.ts
|
||||||
|
|
||||||
|
# 小组件内置化取证 harness(同一类,本地临时)
|
||||||
|
dist_widget_harness
|
||||||
|
widget-harness.html
|
||||||
|
widget-harness.vite.config.ts
|
||||||
|
src/widget-harness-main.ts
|
||||||
|
.tmp-build
|
||||||
|
|
||||||
yarn.lock
|
yarn.lock
|
||||||
.npmrc
|
.npmrc
|
||||||
# Editor directories and files
|
# Editor directories and files
|
||||||
@@ -27,4 +38,3 @@ yarn.lock
|
|||||||
*.njsproj
|
*.njsproj
|
||||||
*.sln
|
*.sln
|
||||||
*.sw?
|
*.sw?
|
||||||
*.timestamp-*.mjs
|
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
{
|
||||||
|
"extends": [
|
||||||
|
"development"
|
||||||
|
],
|
||||||
|
"hints": {
|
||||||
|
"compat-api/css": [
|
||||||
|
"default",
|
||||||
|
{
|
||||||
|
"ignore": [
|
||||||
|
"user-select"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
|
||||||
|
}
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
// 纠正当前 api:gen 产物中命名空间的大小写错误
|
|
||||||
// 映射依据:后端 service 下真实的 *Controller 类名 -> PascalCase 命名空间
|
|
||||||
const fs = require('fs');
|
|
||||||
const map = {
|
|
||||||
Approle: 'AppRole',
|
|
||||||
Appsettings: 'AppSettings',
|
|
||||||
Groupauthz: 'GroupAuthz',
|
|
||||||
Pushsubscription: 'PushSubscription',
|
|
||||||
Signkeyinternal: 'SignKeyInternal',
|
|
||||||
Sysgroup: 'SysGroup',
|
|
||||||
Sysuser: 'SysUser',
|
|
||||||
};
|
|
||||||
const targets = ['src/api/apiDefinitions.ts', 'src/api/globals.d.ts'];
|
|
||||||
for (const f of targets) {
|
|
||||||
let s = fs.readFileSync(f, 'utf8');
|
|
||||||
for (const [wrong, correct] of Object.entries(map)) {
|
|
||||||
// 带引号 key:'Sysgroup. -> 'SysGroup.
|
|
||||||
s = s.split(`'${wrong}.`).join(`'${correct}.`);
|
|
||||||
// 裸引用(globals.d.ts 里的 interface/属性声明):Sysgroup: -> SysGroup: / Sysgroup. -> SysGroup.
|
|
||||||
s = s.split(`${wrong}:`).join(`${correct}:`);
|
|
||||||
s = s.split(`${wrong}.`).join(`${correct}.`);
|
|
||||||
}
|
|
||||||
fs.writeFileSync(f, s);
|
|
||||||
console.log('fixed', f);
|
|
||||||
}
|
|
||||||
console.log('done');
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
import type { GeneratorConfig } from "@alova/wormhole";
|
|
||||||
|
|
||||||
export default {
|
|
||||||
generator: [
|
|
||||||
{
|
|
||||||
input: "http://localhost:8060/v3/api-docs",
|
|
||||||
// 文档平台类型
|
|
||||||
platform: "swagger",
|
|
||||||
|
|
||||||
// 生成代码的输出目录
|
|
||||||
output: "src/api",
|
|
||||||
// 响应数据的媒体类型
|
|
||||||
responseMediaType: "application/json",
|
|
||||||
// 请求体数据的媒体类型
|
|
||||||
bodyMediaType: "application/json",
|
|
||||||
// 生成的 API 版本
|
|
||||||
version: 1,
|
|
||||||
// 生成代码类型
|
|
||||||
type: "typescript",
|
|
||||||
// 全局 API 名称
|
|
||||||
global: "Apis",
|
|
||||||
splitImplementation: true,
|
|
||||||
implementation: "inline",
|
|
||||||
// API 处理函数
|
|
||||||
handleApi: apiDescriptor => {
|
|
||||||
// 过滤掉已废弃的 API
|
|
||||||
if (apiDescriptor.deprecated) {
|
|
||||||
return undefined;
|
|
||||||
}
|
|
||||||
// 优先使用后端显式声明的 operationId(稳定、可读、无重名后缀),
|
|
||||||
// 仅在 operationId 缺失时回退到 summary。切勿用 summary 覆盖 operationId,
|
|
||||||
// 否则中文/长文本 summary 会变成方法名导致运行时查不到。
|
|
||||||
const newOpId = apiDescriptor.operationId ?? apiDescriptor.summary?.trim();
|
|
||||||
const url = apiDescriptor.url.replace(/^\/{platform}\//, "/api/");
|
|
||||||
// springdoc 默认把 Controller 类名转为 kebab tag(如 base-controller),
|
|
||||||
// 而业务代码统一用 Pascal 无 Controller 的命名空间(如 Base)调用。
|
|
||||||
// 这里剥掉 -controller 后缀并转为 PascalCase,使 wormhole 生成的
|
|
||||||
// API 路径(Base.getUserInfo 等)与 Apis.Base.xxx 调用风格一致。
|
|
||||||
// 由于转换结果是合法 JS 标识符,wormhole 会原样保留、不做 camelCase 改写。
|
|
||||||
// springdoc v3 的 tag 有两种形态,都要能正确转为 PascalCase 且无 Controller 后缀:
|
|
||||||
// - Pascal+Controller:SysGroupController -> SysGroup
|
|
||||||
// - kebab+controller:sys-group-controller -> SysGroup
|
|
||||||
// 关键:剥掉尾部 Controller 后,要在 camelCase 边界补空格再逐段首字母大写,
|
|
||||||
// 否则 SysGroup -> Sysgroup(后面全被 toLowerCase 压成小写)会让运行时查不到。
|
|
||||||
const toNamespace = (tag: string): string => {
|
|
||||||
const stripped = tag.replace(/controller$/i, "");
|
|
||||||
const withSpaces = stripped.replace(/([a-z0-9])([A-Z])/g, "$1 $2");
|
|
||||||
const parts = withSpaces.split(/[^a-zA-Z0-9]+/).filter(Boolean);
|
|
||||||
return parts
|
|
||||||
.map((p: string) => p.charAt(0).toUpperCase() + p.slice(1).toLowerCase())
|
|
||||||
.join("");
|
|
||||||
};
|
|
||||||
if (Array.isArray(apiDescriptor.tags)) {
|
|
||||||
apiDescriptor.tags = apiDescriptor.tags.map(toNamespace);
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
|
||||||
...apiDescriptor,
|
|
||||||
operationId: newOpId, // 关键:改掉它
|
|
||||||
url,
|
|
||||||
};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
} as GeneratorConfig;
|
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
/* 一次性校验脚本(默认头像轮 2026-09-30):parse + compileScript + compileTemplate + compileStyle(preprocessLang) */
|
||||||
|
const { parse, compileScript, compileTemplate, compileStyle } = require("@vue/compiler-sfc");
|
||||||
|
const fs = require("fs");
|
||||||
|
|
||||||
|
const files = [
|
||||||
|
"D:/SoftProject/yunhai/YschTheme/assets-src/pc/UserAvatar.vue",
|
||||||
|
"D:/SoftProject/yunhai/UserHome/front/src/components/UserAvatar.vue",
|
||||||
|
"D:/SoftProject/yunhai/UserHome/front/src/views/Settings.vue",
|
||||||
|
"D:/SoftProject/yunhai/UserHome/front/src/views/ThemePreview.vue",
|
||||||
|
"D:/SoftProject/yunhai/UserHome/front/src/components/AppHeader.vue",
|
||||||
|
"D:/SoftProject/yunhai/UserHome/front/src/components/UserInfoModal.vue",
|
||||||
|
"D:/SoftProject/yunhai/UserHome/front/src/App.vue",
|
||||||
|
"D:/SoftProject/yunhai/UserBase/front/src/components/UserAvatar.vue",
|
||||||
|
"D:/SoftProject/yunhai/UserBase/front/src/components/layout.vue",
|
||||||
|
"D:/SoftProject/yunhai/Notice/front/src/components/UserAvatar.vue",
|
||||||
|
"D:/SoftProject/yunhai/Notice/front/src/components/layout.vue",
|
||||||
|
];
|
||||||
|
|
||||||
|
let bad = 0;
|
||||||
|
for (const f of files) {
|
||||||
|
const src = fs.readFileSync(f, "utf8");
|
||||||
|
const { descriptor, errors } = parse(src, { filename: f });
|
||||||
|
const fail = msg => {
|
||||||
|
bad++;
|
||||||
|
console.log("FAIL", f, "::", msg);
|
||||||
|
};
|
||||||
|
if (errors && errors.length) {
|
||||||
|
fail("parse: " + errors.map(e => e.message || String(e)).join(" | "));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
compileScript(descriptor, { id: "check" });
|
||||||
|
} catch (e) {
|
||||||
|
fail("script: " + e.message);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (descriptor.template) {
|
||||||
|
const t = compileTemplate({ source: descriptor.template.content, filename: f, id: "check" });
|
||||||
|
if (t.errors && t.errors.length) {
|
||||||
|
fail("template: " + t.errors.map(e => e.message || String(e)).join(" | "));
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (const s of descriptor.styles) {
|
||||||
|
const r = compileStyle({ source: s.content, filename: f, id: "check", scoped: !!s.scoped, preprocessLang: s.lang });
|
||||||
|
if (r.errors && r.errors.length) {
|
||||||
|
fail(`style(lang=${s.lang}): ` + r.errors.map(e => e.message || String(e)).join(" | "));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!bad) console.log("OK ", f);
|
||||||
|
}
|
||||||
|
console.log(bad ? `\n${bad} 处失败` : "\n全部通过");
|
||||||
|
process.exit(bad ? 1 : 0);
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
.app-container{width:92px;height:100px;border-radius:2px;margin:10px 15px;cursor:pointer;display:flex;flex-direction:column;text-align:center;justify-content:center;align-items:center;-webkit-user-select:none;user-select:none;transition:background-color .2s ease-in-out}.app-container:hover,.app-container__focus{background-color:#ffffff4d}.app-container a{display:inline-block;width:90%;height:85%}.app-container img{width:60px;height:60px;object-fit:cover;border-radius:18%;display:inline-block}.app-container .app-name{margin-top:2px;color:#fff;font-weight:500;max-width:99%;overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap}.app-container__mask{margin-right:40px;margin-bottom:20px}.app-container__mask .app-name{color:#344449}.app-container__mask:hover,.app-container__mask+.app-container__focus{background-color:#ffffff80}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
.header-container{background:transparent;transition:all .3s;box-shadow:0 10px 20px #cbcbcb17;height:var(--appHeaderH);background-color:#577afb;width:100%}.header-container .icon-box{margin:0 24px;cursor:pointer;background-repeat:no-repeat;background-position:30px center;background-size:14px}.header-container .icon-btn{background:transparent;height:24px;width:24px;line-height:24px;box-sizing:border-box;border-radius:2px;transition:all .5s}.header-container .icon-btn i{color:#fff;font-size:22px;font-weight:100}.header-container .icon-btn.active{transform:rotate(90deg)}.header-container .delimiter{width:2px;border-left:1px solid rgba(255,255,255,.5);height:20px}.header-container h4{font-size:19px;color:#fff;margin-left:12px;font-weight:700;font-family:SimSun}.header-container .school-bg{position:absolute;top:0;height:100%;width:100%;left:0;right:0;z-index:-1}.header-container .header-aside{max-width:260px;height:var(--appHeaderH)}.header-container .header-aside img{float:left;width:28px;height:28px;border-radius:50%;cursor:pointer}.header-container .header-aside .name{max-width:90px;color:#fff;margin:0 32px 0 14px}.header-container .header-aside a{outline:none}.header-container .header-aside a:hover{opacity:.8}.header-container .header-aside .logout{padding:5px;margin:0 25px}.header-container .header-aside .logout i{color:#fff;font-size:18px}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}html,body,#app{height:100%;width:100%;overflow:hidden}body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;scroll-behavior:smooth;-webkit-overflow-scrolling:touch}a{text-decoration:none}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
@charset "UTF-8";[bsch-title]{position:relative}[bsch-title]:hover:after{opacity:1;transition:all .1s ease .5s;visibility:visible}[bsch-title]:after{content:attr(bsch-title);position:absolute;padding:5px 10px;bottom:-30px;left:100%;border-radius:4px;color:#fff;background-color:#504f4fcc;box-shadow:0 0 4px #00000029;font-size:14px;white-space:nowrap;visibility:hidden;opacity:0;z-index:2}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
.my-table{width:100%;border-bottom:1px solid #c7c7c7;border-right:1px solid #c7c7c7;border-collapse:separate}.my-table .td-title{background:#fafafa;vertical-align:middle;color:#111;font-weight:550}.my-table th{background:#fafafa;height:20px;line-height:20px;padding:12px}.my-table td{height:20px;line-height:20px;padding:12px}.my-table th,.my-table td{border-top:1px solid #c7c7c7;border-left:1px solid #c7c7c7;margin-left:-1px;margin-top:-1px;text-align:center}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;vertical-align:baseline}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:"";content:none}table{border-collapse:collapse;border-spacing:0}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
table.small-table{border:1px solid #ebeef5;border-radius:5px}table.small-table th{background-color:#fafafa;border-bottom:1px solid #ebeef5;padding:10px 20px}table.small-table td{padding:5px 20px}table.small-table tr:first-child td{padding-top:10px}table.small-table tr:last-child td{padding-bottom:10px}table.small-table .input-box{width:100px;vertical-align:text-bottom;display:inline-block}table.small-table .ivu-input-wrapper{vertical-align:text-bottom}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
.stats-container{background:#fff;height:calc(100% - var(--appHeaderH));padding:16px 24px}.widget-ul{display:flex;flex-wrap:wrap;gap:12px;height:60px}.widget-ul li{width:140px;height:60px;padding:6px 16px;border-radius:4px;border:1px solid #ebeef5;background:#f6f8f9}.widget-ul .title{font-size:12px;font-style:normal;font-weight:400;line-height:24px;color:#333}.widget-ul .target{font-size:16px;font-style:normal;font-weight:700;line-height:24px;color:#333}.search-wrap{background:#f7f7f7;padding:10px 12px;height:52px}.search-wrap_sel{width:180px!important;float:left}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
.status-color-1{color:#969799}.status-color-2{color:#e6a23c}.status-color-3{color:#45b972}.status-color-4{color:#eb0404}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
@charset "UTF-8";
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
.widget-wrap{width:380px;min-height:200px;z-index:100;border-radius:5px;background:#00000059}.widget-wrap .widget-header{display:flex;height:48px}.widget-wrap .widget-header .widget-header-drag{flex:2 auto;cursor:move}.widget-wrap .widget-header .operate-btn{padding:12px;height:38px}.widget-wrap .widget-header .operate-btn svg{cursor:pointer;width:24px;flex-shrink:1}.widget-wrap .widget-header .operate-btn:nth-child(2){padding-left:0}.widget-wrap .widget-body{padding:0 4px 18px;height:calc(100% - 48px)}.widget-wrap .widget-body .widget-item{border-radius:6px;background:#fffffff2;overflow:hidden;margin:18px 14px 0}.widget-wrap .widget-body .widget-item:first-child{margin-top:0}.widget-wrap .widget-body .widget-app-header{height:46px;display:flex;padding:0 16px;justify-content:space-between;align-items:center;border-bottom:1px solid #e9e9e9;color:#344449;font-weight:700;font-size:16px}.widget-wrap .widget-body .widget-app-header svg{cursor:pointer}.widget-wrap .widget-body iframe{width:100%;display:block;min-height:150px}.widget-wrap__drag{background:#fff9}.widget-wrap__drag .widget-header{background:#ffffff80}.widget-empty-box{height:calc(100% - 30px);display:flex;align-items:center;justify-content:center;flex-direction:column;color:#828c96}.widget-empty-box h4{font-weight:500;margin-top:20px}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
<svg xmlns="http://www.w3.org/2000/svg" fill="currentColor" viewBox="0 0 1024 1024" width="1em" height="1em"><path d="M740.238222 573.781333a29.013333 29.013333 0 0 1-38.968889 12.743111A395.036444 395.036444 0 0 0 519.964444 543.288889c-222.776889 0-404.252444 181.475556-404.252444 404.252444a29.013333 29.013333 0 0 1-28.842667 28.899556 29.013333 29.013333 0 0 1-28.899555-28.899556c0-209.123556 139.832889-385.991111 330.638222-442.766222a245.191111 245.191111 0 0 1-114.062222-206.904889A245.873778 245.873778 0 0 1 519.964444 52.337778a245.873778 245.873778 0 0 1 245.475556 245.475555c0 87.04-45.511111 163.384889-113.777778 206.904889a444.871111 444.871111 0 0 1 75.776 30.321778c14.222222 7.224889 19.911111 24.576 12.743111 38.741333z m-407.893333-275.968c0 103.424 84.195556 187.676444 187.733333 187.676445 103.424 0 187.676444-84.195556 187.676445-187.733334 0-103.424-84.195556-187.676444-187.733334-187.676444-103.424 0-187.676444 84.195556-187.676444 187.733333z m601.884444 465.863111c23.324444 12.117333 38.172444 36.181333 38.456889 62.577778a71.111111 71.111111 0 0 1-40.220444 63.488 38.343111 38.343111 0 0 0-17.294222 17.066667c-2.389333 4.551111-5.063111 8.931556-7.68 13.255111a42.325333 42.325333 0 0 0-6.542223 24.576c1.251556 26.453333-12.231111 50.972444-35.100444 64.227556-22.869333 13.255111-50.801778 12.515556-73.159111-1.706667a43.747556 43.747556 0 0 0-24.576-6.485333 159.288889 159.288889 0 0 1-15.132445 0 39.651556 39.651556 0 0 0-23.608889 6.485333 70.428444 70.428444 0 0 1-39.936 12.288 70.257778 70.257778 0 0 1-70.257777-74.126222 50.403556 50.403556 0 0 0-5.063111-23.552c-1.422222-2.446222-3.128889-4.835556-4.551112-7.452445-1.422222-2.446222-2.673778-5.12-4.096-7.736889a53.76 53.76 0 0 0-17.806222-16.099555 70.428444 70.428444 0 0 1-38.513778-62.805334 71.111111 71.111111 0 0 1 40.220445-63.544888 39.594667 39.594667 0 0 0 17.294222-17.066667c2.161778-4.323556 4.551111-8.704 7.224889-12.743111a41.642667 41.642667 0 0 0 6.485333-25.031111 70.428444 70.428444 0 0 1 108.999111-62.805334 39.253333 39.253333 0 0 0 24.803556 6.940445c4.835556-0.227556 9.898667-0.227556 14.677333 0a39.253333 39.253333 0 0 0 23.608889-6.485334c22.357333-15.132444 51.768889-16.384 75.093334-2.844444 22.926222 13.198222 36.522667 38.229333 35.100444 64.682667a50.403556 50.403556 0 0 0 5.063111 23.608889c1.422222 2.389333 3.128889 4.778667 4.551111 7.395555 1.479111 2.446222 2.673778 5.12 4.096 7.736889 2.161778 4.096 10.808889 12.515556 17.806222 16.156444z m-22.698666 83.000889a24.632889 24.632889 0 0 0 13.482666-20.195555 22.186667 22.186667 0 0 0-12.231111-19.968c-13.027556-6.542222-30.606222-20.935111-38.741333-37.091556-0.739556-1.934222-1.934222-3.584-2.901333-5.518222-1.194667-1.934222-2.161778-3.868444-3.413334-5.518222-9.841778-14.961778-13.425778-37.546667-12.743111-51.996445a22.186667 22.186667 0 0 0-11.036444-20.707555 22.869333 22.869333 0 0 0-24.064 0.967111 86.471111 86.471111 0 0 1-52.679111 14.904889c-3.640889 0-6.997333-0.227556-10.638223 0a90.851556 90.851556 0 0 1-53.134222-14.677334 22.186667 22.186667 0 1 0-34.702222 19.740445c0.967111 19.000889-3.811556 37.546667-13.937778 53.475555-1.934222 2.844444-3.584 5.973333-5.290667 9.102223a87.381333 87.381333 0 0 1-39.253333 38.229333 22.755556 22.755556 0 0 0-12.970667 20.252444 22.186667 22.186667 0 0 0 12.288 19.911112c12.970667 6.542222 30.549333 20.992 38.741334 37.091555 0.739556 1.934222 1.934222 3.640889 2.844444 5.575111 1.251556 1.877333 2.218667 3.811556 3.413334 5.518222 9.841778 14.904889 13.482667 37.546667 12.743111 51.939556a22.186667 22.186667 0 0 0 34.872889 19.740444c15.416889-10.581333 33.450667-15.872 52.736-14.904888 3.584 0.227556 7.395556 0.227556 11.036444 0 18.545778-0.739556 36.864 4.096 52.508444 14.222222 6.997333 4.551111 15.985778 4.835556 23.324445 0.682666a22.072889 22.072889 0 0 0 11.036444-20.48 88.007111 88.007111 0 0 1 13.994667-52.394666c1.934222-3.128889 3.811556-6.542222 5.518222-9.671111 8.931556-16.839111 22.357333-30.037333 39.253334-38.229334z m-188.871111-85.447111a76.231111 76.231111 0 0 1 103.936 27.932445c10.126222 17.578667 12.8 38.001778 7.452444 57.457777a75.491556 75.491556 0 0 1-73.102222 56.149334 75.889778 75.889778 0 0 1-38.286222-141.539556z m64.512 72.704a26.112 26.112 0 0 0-2.901334-20.707555 27.875556 27.875556 0 0 0-37.774222-10.353778 26.965333 26.965333 0 0 0-13.027556 16.839111 29.013333 29.013333 0 0 0 2.901334 20.935111 27.534222 27.534222 0 0 0 37.774222 10.126222 26.965333 26.965333 0 0 0 13.027556-16.839111z"></path></svg>
|
||||||
|
After Width: | Height: | Size: 4.4 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 27 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 25 KiB |
|
After Width: | Height: | Size: 26 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 23 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 24 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 23 KiB |
@@ -0,0 +1 @@
|
|||||||
|
*::-webkit-scrollbar{width:10px;height:10px}*::-webkit-scrollbar-thumb{background-color:#0000000d;border-radius:10px;-webkit-box-shadow:inset 1px 1px 0 rgba(0,0,0,.1)}*:hover::-webkit-scrollbar-thumb{background-color:#0003;border-radius:10px;-webkit-box-shadow:inset 1px 1px 0 rgba(0,0,0,.1)}*::-webkit-scrollbar-thumb:hover{background-color:#0000004d;-webkit-box-shadow:inset 1px 1px 0 rgba(0,0,0,.1)}*::-webkit-scrollbar-track{border-radius:10px;-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,0);background-color:#fff}*::-webkit-scrollbar-track:hover{-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.4);background-color:#00000003}.scroll2::-webkit-scrollbar{width:10px;height:10px}.scroll2::-webkit-scrollbar-track{border-radius:10px;-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,0);background-color:#fff}.scroll2::-webkit-scrollbar-thumb{background-color:#0000000d;border-radius:10px;-webkit-box-shadow:inset 1px 1px 0 rgba(0,0,0,.1)}.scroll2:hover::-webkit-scrollbar-thumb{background-color:#0003;border-radius:10px;-webkit-box-shadow:inset 1px 1px 0 rgba(0,0,0,.1)}.scroll2::-webkit-scrollbar-track:hover{-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.4)}.scroll2::-webkit-scrollbar-thumb:hover{-webkit-box-shadow:inset 0 0 6px rgba(0,0,0,.4)}
|
||||||
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 542 KiB |
@@ -0,0 +1 @@
|
|||||||
|
.lightapp-wrap{height:calc(100% - var(--headerH));overflow:hidden}.lightapp-wrap .left-box{width:180px;float:left;height:100%;border-right:1px solid #ccc}.lightapp-wrap .left-box h3{font-weight:400;margin:0;padding:10px 0 10px 20px;font-size:28px;height:50px;line-height:50px;letter-spacing:2px;box-sizing:content-box}.lightapp-wrap .left-box .group-ul{width:100%}.lightapp-wrap .left-box .group-ul li{padding-left:30px;text-align:left;height:38px;line-height:38px;border-radius:5px;margin:0 10px;transition:all .3s ease-in-out;cursor:pointer;-webkit-user-select:none;user-select:none}.lightapp-wrap .left-box .group-ul li:hover{background-color:#f1f6ff}.lightapp-wrap .left-box .group-ul li.active{background-color:#f9f9f9}.lightapp-wrap .left-box .group-ul li.active{padding-left:40px}.lightapp-wrap .right-box{margin-left:180px;padding:0 20px;height:100%}.lightapp-wrap .right-box h4.title{font-size:20px;height:50px;font-weight:400;border-bottom:1px solid #ccc;display:flex;justify-content:space-between;align-items:center}.lightapp-wrap .right-box .app-main-box{height:calc(100% - 50px);padding:20px 0}.lightapp-wrap .right-box ul.app-ul li{cursor:pointer;text-align:center;float:left;margin:0 20px 20px 0;width:140px;height:200px;background:#fff;border:1px solid #ddd;position:relative;transition:.16s all;border-radius:4px;box-shadow:0 1px 2px #0000001a}.lightapp-wrap .right-box ul.app-ul li:hover{box-shadow:0 10px 50px #0000001a,0 20px 30px #0000000d}.lightapp-wrap .right-box ul.app-ul li .app-box{width:90%;margin:15px auto 0;display:flex;flex-direction:column;align-items:center;font-size:13px}.lightapp-wrap .right-box ul.app-ul li .app-box img{width:60px;height:60px;object-fit:cover;border-radius:18%;display:inline-block}.lightapp-wrap .right-box ul.app-ul li .app-box .app-name,.lightapp-wrap .right-box ul.app-ul li .app-box .app-desc{margin-top:8px;line-height:16px;height:32px;display:flex;align-items:center}.lightapp-wrap .right-box ul.app-ul li .app-box .app-desc{margin:5px 0 8px;color:#aaa}.lightapp-wrap .right-box ul.app-ul li .operate-box{position:absolute;right:0;top:0;width:30px;height:30px;display:flex;align-items:center;justify-content:center;border-radius:3px}.lightapp-wrap .right-box ul.app-ul li .operate-box:hover{background-color:#f2f2f2}
|
||||||
|
After Width: | Height: | Size: 186 KiB |
@@ -0,0 +1,6 @@
|
|||||||
|
<svg width="30" height="30" viewBox="0 0 30 30" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M6.51133 11.9177C5.79328 11.9177 5.09135 11.7047 4.49432 11.3058C3.89729 10.9069 3.43196 10.3399 3.15719 9.67646C2.88241 9.01306 2.81053 8.28308 2.95064 7.57883C3.09075 6.87458 3.43655 6.22769 3.9443 5.71998C4.45206 5.21226 5.09898 4.86651 5.80324 4.72646C6.5075 4.58641 7.23748 4.65835 7.90085 4.93318C8.56423 5.208 9.13121 5.67338 9.5301 6.27044C9.92898 6.86751 10.1419 7.56945 10.1418 8.2875C10.1411 9.25012 9.75837 10.1731 9.07767 10.8538C8.39697 11.5344 7.47395 11.9171 6.51133 11.9177ZM6.51133 6.53203C6.16413 6.53203 5.82473 6.63499 5.53604 6.82788C5.24736 7.02078 5.02236 7.29494 4.88949 7.61571C4.75662 7.93648 4.72186 8.28945 4.78959 8.62998C4.85733 8.9705 5.02452 9.2833 5.27003 9.52881C5.51553 9.77431 5.82833 9.9415 6.16885 10.0092C6.50938 10.077 6.86235 10.0422 7.18312 9.90934C7.50389 9.77648 7.77806 9.55147 7.97095 9.26279C8.16384 8.9741 8.2668 8.6347 8.2668 8.2875C8.26587 7.82232 8.08058 7.37647 7.75154 7.04764C7.42249 6.71881 6.97652 6.53382 6.51133 6.53321V6.53203ZM23.5659 11.9177C22.8479 11.9177 22.1459 11.7049 21.5488 11.306C20.9518 10.9071 20.4864 10.3401 20.2116 9.67666C19.9367 9.01327 19.8648 8.28328 20.0049 7.57901C20.145 6.87474 20.4907 6.22783 20.9985 5.72008C21.5062 5.21233 22.1532 4.86656 22.8574 4.72648C23.5617 4.58641 24.2917 4.65833 24.9551 4.93315C25.6185 5.20797 26.1855 5.67334 26.5844 6.27041C26.9833 6.86748 27.1962 7.56944 27.1961 8.2875C27.1949 9.24993 26.8121 10.1726 26.1316 10.8531C25.451 11.5337 24.5283 11.9165 23.5659 11.9177ZM23.5659 6.53203C23.2187 6.53198 22.8793 6.63488 22.5906 6.82774C22.3018 7.0206 22.0768 7.29475 21.9439 7.61551C21.811 7.93628 21.7761 8.28925 21.8439 8.6298C21.9116 8.97034 22.0787 9.28317 22.3242 9.5287C22.5697 9.77424 22.8825 9.94146 23.223 10.0092C23.5636 10.077 23.9166 10.0422 24.2373 9.90937C24.5581 9.77651 24.8323 9.55151 25.0252 9.26282C25.2181 8.97413 25.3211 8.63471 25.3211 8.2875C25.3202 7.82237 25.1349 7.37656 24.8059 7.04774C24.477 6.71892 24.0311 6.5339 23.5659 6.53321V6.53203ZM6.55615 25.3638C5.83811 25.3638 5.1362 25.1508 4.53917 24.7519C3.94215 24.353 3.47682 23.786 3.20204 23.1226C2.92726 22.4592 2.85536 21.7293 2.99544 21.025C3.13553 20.3208 3.48129 19.6739 3.98902 19.1662C4.49676 18.6584 5.14364 18.3127 5.84788 18.1726C6.55213 18.0325 7.28209 18.1044 7.94547 18.3792C8.60886 18.654 9.17586 19.1193 9.57478 19.7163C9.9737 20.3134 10.1866 21.0153 10.1866 21.7333C10.1855 22.6958 9.80269 23.6186 9.12208 24.2992C8.44147 24.9798 7.51868 25.3627 6.55615 25.3638ZM6.55615 19.9781C6.20894 19.9781 5.86953 20.0811 5.58084 20.274C5.29215 20.4669 5.06714 20.7411 4.93428 21.0619C4.80143 21.3827 4.76668 21.7356 4.83444 22.0762C4.9022 22.4167 5.06942 22.7295 5.31495 22.975C5.56049 23.2205 5.87331 23.3877 6.21386 23.4554C6.55441 23.5231 6.90738 23.4883 7.22815 23.3554C7.54891 23.2224 7.82306 22.9974 8.01592 22.7087C8.20877 22.4199 8.31168 22.0805 8.31162 21.7333C8.31093 21.268 8.12574 20.8219 7.79667 20.4929C7.4676 20.1639 7.02149 19.9787 6.55615 19.9781ZM23.5659 25.3638C22.8479 25.3638 22.1459 25.151 21.5489 24.7521C20.9518 24.3532 20.4864 23.7862 20.2116 23.1228C19.9368 22.4594 19.8648 21.7295 20.0049 21.0252C20.1449 20.321 20.4907 19.674 20.9984 19.1663C21.5061 18.6585 22.153 18.3127 22.8573 18.1726C23.5615 18.0325 24.2915 18.1044 24.9549 18.3792C25.6183 18.6539 26.1853 19.1193 26.5842 19.7163C26.9832 20.3133 27.1961 21.0153 27.1961 21.7333C27.195 22.6958 26.8122 23.6185 26.1317 24.2991C25.4511 24.9797 24.5284 25.3626 23.5659 25.3638ZM23.5659 19.9781C23.2187 19.9781 22.8793 20.081 22.5905 20.2739C22.3018 20.4667 22.0767 20.7409 21.9438 21.0617C21.8109 21.3825 21.7761 21.7354 21.8439 22.076C21.9116 22.4166 22.0788 22.7294 22.3243 22.9749C22.5698 23.2204 22.8827 23.3876 23.2232 23.4553C23.5638 23.5231 23.9168 23.4883 24.2376 23.3554C24.5583 23.2225 24.8325 22.9974 25.0254 22.7087C25.2182 22.42 25.3212 22.0805 25.3211 21.7333C25.3204 21.268 25.1353 20.822 24.8062 20.493C24.4772 20.164 24.0312 19.9788 23.5659 19.9781ZM15.1732 22.2041C14.4552 22.2042 13.7532 21.9913 13.1561 21.5924C12.559 21.1934 12.0937 20.6264 11.8189 19.963C11.5441 19.2996 11.4722 18.5696 11.6122 17.8653C11.7523 17.1611 12.0981 16.5141 12.6059 16.0064C13.1137 15.4987 13.7606 15.1529 14.4649 15.0129C15.1692 14.8728 15.8992 14.9448 16.5626 15.2197C17.226 15.4945 17.793 15.9599 18.1918 16.5571C18.5907 17.1542 18.8035 17.8561 18.8034 18.5742C18.8022 19.5366 18.4193 20.4592 17.7388 21.1397C17.0582 21.8201 16.1356 22.2029 15.1732 22.2041ZM15.1732 16.8185C14.826 16.8184 14.4866 16.9213 14.1979 17.1141C13.9092 17.307 13.6841 17.5811 13.5512 17.9019C13.4183 18.2226 13.3835 18.5756 13.4512 18.9161C13.5188 19.2567 13.686 19.5695 13.9314 19.815C14.1769 20.0606 14.4897 20.2278 14.8302 20.2956C15.1707 20.3634 15.5237 20.3287 15.8445 20.1959C16.1653 20.0631 16.4395 19.8381 16.6324 19.5495C16.8253 19.2608 16.9284 18.9214 16.9284 18.5742C16.9279 18.1088 16.7428 17.6627 16.4138 17.3335C16.0848 17.0044 15.6386 16.8192 15.1732 16.8185Z" />
|
||||||
|
<path d="M7.27539 10.6952L8.68788 9.4621L13.967 15.5094L12.5545 16.7425L7.27539 10.6952ZM17.424 16.7428L16.0115 15.5097L21.2906 9.46245L22.7031 10.6956L17.424 16.7428Z" />
|
||||||
|
<path d="M14.3686 10.2044C14.8105 9.76241 15.2524 9.76241 15.6944 10.2044L23.4424 17.9523C23.8843 18.3943 23.8843 18.8362 23.4424 19.2782C23.0004 19.7201 22.5585 19.7201 22.1166 19.2782L14.3686 11.5302C13.9266 11.0882 13.9266 10.6463 14.3686 10.2044Z" />
|
||||||
|
<path d="M6.61954 19.2634C6.1776 18.8214 6.1776 18.3795 6.61954 17.9375L14.3675 10.1895C14.8095 9.74761 15.2514 9.74761 15.6934 10.1895C16.1353 10.6315 16.1353 11.0734 15.6934 11.5154L7.94537 19.2634C7.50343 19.7053 7.06148 19.7053 6.61954 19.2634Z" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 5.6 KiB |
|
After Width: | Height: | Size: 5.1 KiB |
|
After Width: | Height: | Size: 44 KiB |
|
After Width: | Height: | Size: 12 KiB |
@@ -0,0 +1,46 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<title>Document</title>
|
||||||
|
<script src="./js/bschcrypto.min.js"></script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div style="overflow: hidden">
|
||||||
|
<div style="width: 45%; float: left">
|
||||||
|
<textarea id="textarea1" rows="5" style="width: 100%"></textarea>
|
||||||
|
<br />
|
||||||
|
<button onclick="decrypt()">decrypt</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="width: 45%; float: right">
|
||||||
|
<textarea id="textarea2" rows="5" style="width: 100%"></textarea>
|
||||||
|
<br />
|
||||||
|
<button onclick="encrypt()">encrypt</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
<br />
|
||||||
|
<textarea id="textarea3" rows="5" style="width: 100%"></textarea>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const bschCrypto = new BschCryptoUtil();
|
||||||
|
function decrypt() {
|
||||||
|
var data = document.getElementById("textarea1").value;
|
||||||
|
console.log(data);
|
||||||
|
const plaintext = bschCrypto.decrypt(data);
|
||||||
|
console.log(plaintext);
|
||||||
|
document.getElementById("textarea3").value = JSON.stringify(plaintext);
|
||||||
|
}
|
||||||
|
|
||||||
|
function encrypt() {
|
||||||
|
var data = document.getElementById("textarea2").value;
|
||||||
|
const ciphertext = bschCrypto.encrypt(data);
|
||||||
|
console.log(ciphertext);
|
||||||
|
document.getElementById("textarea3").value = ciphertext;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
After Width: | Height: | Size: 3.4 KiB |
@@ -0,0 +1,16 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh-CN">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<title>harness-取证</title>
|
||||||
|
<script type="module" crossorigin src="./assets/harness-yV9bTKyt.js"></script>
|
||||||
|
<link rel="stylesheet" crossorigin href="./assets/harness-BT-Hyg0t.css">
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="app"></div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
|
After Width: | Height: | Size: 13 KiB |
|
After Width: | Height: | Size: 11 KiB |
|
After Width: | Height: | Size: 74 KiB |
|
After Width: | Height: | Size: 3.7 KiB |
|
After Width: | Height: | Size: 186 KiB |
@@ -0,0 +1,47 @@
|
|||||||
|
(function (global) {
|
||||||
|
/* ---------- 1. 默认 16 字节密钥 ---------- */
|
||||||
|
const DEFAULT_KEY_WA = CryptoJS.MD5("bsch2025"); // WordArray(16 byte)
|
||||||
|
|
||||||
|
class BschCryptoUtil {
|
||||||
|
#aesKey;
|
||||||
|
|
||||||
|
constructor(key) {
|
||||||
|
// 支持外部传入字符串或 WordArray,默认用隐藏后的 MD5
|
||||||
|
this.#aesKey = key != null ? key : DEFAULT_KEY_WA;
|
||||||
|
}
|
||||||
|
|
||||||
|
encrypt(data) {
|
||||||
|
const message = typeof data === "string" ? data : JSON.stringify(data);
|
||||||
|
const encrypted = CryptoJS.AES.encrypt(message, this.#aesKey, {
|
||||||
|
mode: CryptoJS.mode.ECB,
|
||||||
|
padding: CryptoJS.pad.Pkcs7,
|
||||||
|
});
|
||||||
|
return encrypted.toString(); // Base64
|
||||||
|
}
|
||||||
|
|
||||||
|
decrypt(cipherText) {
|
||||||
|
if (!cipherText) throw new Error("cipherText is empty");
|
||||||
|
const decrypted = CryptoJS.AES.decrypt(cipherText, this.#aesKey, {
|
||||||
|
mode: CryptoJS.mode.ECB,
|
||||||
|
padding: CryptoJS.pad.Pkcs7,
|
||||||
|
});
|
||||||
|
const plain = decrypted.toString(CryptoJS.enc.Utf8);
|
||||||
|
if (!plain) throw new Error("decrypt failed");
|
||||||
|
try {
|
||||||
|
return JSON.parse(plain);
|
||||||
|
} catch (_) {
|
||||||
|
return plain;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static encrypt(data, key) {
|
||||||
|
return new BschCryptoUtil(key).encrypt(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
static decrypt(cipherText, key) {
|
||||||
|
return new BschCryptoUtil(key).decrypt(cipherText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/* ---------- 6. 暴露到全局 ---------- */
|
||||||
|
global.BschCryptoUtil = BschCryptoUtil;
|
||||||
|
})(typeof window !== "undefined" ? window : this);
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
"use strict";function _instanceof(n,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](n):n instanceof e}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!_instanceof(a,n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t)}function _classPrivateFieldInitSpec(e,t,a){_checkPrivateRedeclaration(e,t),t.set(e,a)}function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object");}function _classPrivateFieldGet(s,a){return s.get(_assertClassBrand(s,a))}function _classPrivateFieldSet(s,a,r){return s.set(_assertClassBrand(s,a),r),r}function _assertClassBrand(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object");}var _isDev=new WeakMap();var _appId=new WeakMap();var BschLoadUtil=function(){function BschLoadUtil(){_classCallCheck(this,BschLoadUtil);_classPrivateFieldInitSpec(this,_isDev,false);_classPrivateFieldInitSpec(this,_appId,null);if(!BschLoadUtil.instance){this.isSelf=window.self===window.top;_classPrivateFieldSet(_appId,this,this.uuid());this.ticket=null;this.roleInfo={roleId:null,schId:null,childId:null};BschLoadUtil.instance=this}return BschLoadUtil.instance}return _createClass(BschLoadUtil,[{key:"getTicket",value:function getTicket(){if(!_classPrivateFieldGet(_isDev,this)){var ticket=this.getUrlParam("ticket"),roleInfoStr=this.getUrlParam("role");var roleInfo=this.roleDecode(roleInfoStr);this.ticket=ticket;this.roleInfo=roleInfo}return{ticket:this.ticket,roleInfo:this.roleInfo}}},{key:"goBackDesktop",value:function goBackDesktop(){if(_classPrivateFieldGet(_isDev,this)){console.error("调试模式,无效操作!");return}parent.postMessage(JSON.stringify({id:_classPrivateFieldGet(_appId,this),code:1}),"*")}},{key:"reloadParent",value:function reloadParent(){if(_classPrivateFieldGet(_isDev,this)){console.error("调试模式,无效操作!");return}parent.postMessage(JSON.stringify({id:_classPrivateFieldGet(_appId,this),code:2}),"*")}},{key:"showUserInfo",value:function showUserInfo(){if(_classPrivateFieldGet(_isDev,this)){console.error("调试模式,无效操作!");return}parent.postMessage(JSON.stringify({id:_classPrivateFieldGet(_appId,this),code:3}),"*")}},{key:"roleDecode",value:function roleDecode(roleInfoStr){try{var str=window.atob(roleInfoStr);str=decodeURIComponent(str);var obj=JSON.parse(str);return obj}catch(error){console.error(error);return{id:null,ticket:"",roleInfo:{}}}}},{key:"setDevTicket",value:function setDevTicket(ticket,roleInfo){if(this.isSelf){this.ticket=ticket;this.roleInfo=roleInfo;_classPrivateFieldSet(_isDev,this,true)}}},{key:"getIsSelf",value:function getIsSelf(){if(_classPrivateFieldGet(_isDev,this))return false;else return this.isSelf}},{key:"getUrlParam",value:function getUrlParam(name){var reg=new RegExp("(^|&)"+name+"=([^&]*)(&|$)");var r=window.location.search.substr(1).match(reg);if(r!=null)return unescape(r[2]);else return null}},{key:"uuid",value:function uuid(){return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,function(c){var r=Math.random()*16|0,v=c=="x"?r:r&0x3|0x8;return v.toString(16)})}}],[{key:"getInstance",value:function getInstance(){if(!this.instance){return this.instance=new BschLoadUtil()}return this.instance}}])}();
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
"use strict";function _instanceof(n,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](n):n instanceof e}function _typeof(o){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(o){return typeof o}:function(o){return o&&"function"==typeof Symbol&&o.constructor===Symbol&&o!==Symbol.prototype?"symbol":typeof o},_typeof(o)}function _classCallCheck(a,n){if(!_instanceof(a,n))throw new TypeError("Cannot call a class as a function");}function _defineProperties(e,r){for(var t=0;t<r.length;t++){var o=r[t];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,_toPropertyKey(o.key),o)}}function _createClass(e,r,t){return r&&_defineProperties(e.prototype,r),t&&_defineProperties(e,t),Object.defineProperty(e,"prototype",{writable:!1}),e}function _toPropertyKey(t){var i=_toPrimitive(t,"string");return"symbol"==_typeof(i)?i:i+""}function _toPrimitive(t,r){if("object"!=_typeof(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var i=e.call(t,r||"default");if("object"!=_typeof(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return("string"===r?String:Number)(t)}function _classPrivateFieldInitSpec(e,t,a){_checkPrivateRedeclaration(e,t),t.set(e,a)}function _checkPrivateRedeclaration(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object");}function _classPrivateFieldGet(s,a){return s.get(_assertClassBrand(s,a))}function _classPrivateFieldSet(s,a,r){return s.set(_assertClassBrand(s,a),r),r}function _assertClassBrand(e,t,n){if("function"==typeof e?e===t:e.has(t))return arguments.length<3?t:n;throw new TypeError("Private element is not present on this object");}var _isDev=new WeakMap();var _appId=new WeakMap();var BschLoadUtil=function(){function BschLoadUtil(){_classCallCheck(this,BschLoadUtil);_classPrivateFieldInitSpec(this,_isDev,false);_classPrivateFieldInitSpec(this,_appId,null);if(!BschLoadUtil.instance){this.isSelf=window.self===window.top;_classPrivateFieldSet(_appId,this,this.uuid());this.ticket=null;this.roleInfo={userId:null,roleId:null,schId:null,childId:null};BschLoadUtil.instance=this}return BschLoadUtil.instance}return _createClass(BschLoadUtil,[{key:"getTicket",value:function getTicket(){if(!_classPrivateFieldGet(_isDev,this)){var ticket=this.getUrlParam("ticket"),roleInfoStr=this.getUrlParam("role");var roleInfo=this.roleDecode(roleInfoStr);this.ticket=ticket;this.roleInfo=roleInfo}return{ticket:this.ticket,roleInfo:this.roleInfo}}},{key:"goBackDesktop",value:function goBackDesktop(){if(_classPrivateFieldGet(_isDev,this)){console.error("调试模式,无效操作!");return}parent.postMessage(JSON.stringify({id:_classPrivateFieldGet(_appId,this),code:1}),"*")}},{key:"reloadParent",value:function reloadParent(){if(_classPrivateFieldGet(_isDev,this)){console.error("调试模式,无效操作!");return}parent.postMessage(JSON.stringify({id:_classPrivateFieldGet(_appId,this),code:2}),"*")}},{key:"showUserInfo",value:function showUserInfo(){if(_classPrivateFieldGet(_isDev,this)){console.error("调试模式,无效操作!");return}parent.postMessage(JSON.stringify({id:_classPrivateFieldGet(_appId,this),code:3}),"*")}},{key:"roleDecode",value:function roleDecode(roleInfoStr){try{var str=window.atob(roleInfoStr);str=decodeURIComponent(str);var obj=JSON.parse(str);return obj}catch(error){console.error(error);return{id:null,ticket:"",roleInfo:{}}}}},{key:"setDevTicket",value:function setDevTicket(ticket,roleInfo){if(this.isSelf){this.ticket=ticket;this.roleInfo=roleInfo;_classPrivateFieldSet(_isDev,this,true)}}},{key:"getIsSelf",value:function getIsSelf(){if(_classPrivateFieldGet(_isDev,this))return false;else return this.isSelf}},{key:"getUrlParam",value:function getUrlParam(name){var reg=new RegExp("(^|&)"+name+"=([^&]*)(&|$)");var r=window.location.search.substr(1).match(reg);if(r!=null)return unescape(r[2]);else return null}},{key:"uuid",value:function uuid(){return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,function(c){var r=Math.random()*16|0,v=c=="x"?r:r&0x3|0x8;return v.toString(16)})}}],[{key:"getInstance",value:function getInstance(){if(!this.instance){return this.instance=new BschLoadUtil()}return this.instance}}])}();
|
||||||
@@ -0,0 +1,128 @@
|
|||||||
|
/**
|
||||||
|
* 数字基座内嵌加载帮助类
|
||||||
|
*/
|
||||||
|
|
||||||
|
class BschLoadUtil {
|
||||||
|
#isDev = false;
|
||||||
|
#appId = null;
|
||||||
|
#headerInfo = {};
|
||||||
|
constructor() {
|
||||||
|
if (!BschLoadUtil.instance) {
|
||||||
|
this.isSelf = window.self === window.top;
|
||||||
|
this.ticket = null;
|
||||||
|
this.roleInfo = {
|
||||||
|
roleId: null,
|
||||||
|
schId: null,
|
||||||
|
childId: null,
|
||||||
|
};
|
||||||
|
BschLoadUtil.instance = this;
|
||||||
|
}
|
||||||
|
return BschLoadUtil.instance;
|
||||||
|
}
|
||||||
|
getTicket() {
|
||||||
|
if (this.#isDev) return Promise.resolve({ ticket: this.ticket, roleInfo: this.roleInfo });
|
||||||
|
else
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
window.addEventListener(
|
||||||
|
"message",
|
||||||
|
e => {
|
||||||
|
var { id, ticket, roleInfo, headerInfo } = this.roleDecode(e.data);
|
||||||
|
this.#appId = id;
|
||||||
|
this.#headerInfo = headerInfo;
|
||||||
|
this.ticket = ticket;
|
||||||
|
this.roleInfo = roleInfo;
|
||||||
|
resolve({ ticket, roleInfo });
|
||||||
|
},
|
||||||
|
false
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
replaceHeaderStyle(el) {
|
||||||
|
if (this.#headerInfo == null) return false;
|
||||||
|
const { appName, avatar, username } = this.#headerInfo;
|
||||||
|
let headerStr = `
|
||||||
|
<header class="header-container fix">
|
||||||
|
<h4 class="fl align-middle">${appName}</h4>
|
||||||
|
<div class="header-aside fr">
|
||||||
|
<img id="js_comp_user_phone" src="${avatar}" class="fl align-middle">
|
||||||
|
<a id="js_comp_user_name" class="name fl align-middle text-ellipsis" href="javascript:void(0);">${username}</a>
|
||||||
|
<div class="delimiter fl align-middle"></div>
|
||||||
|
<a href="javascript:;" id="js_comp_operate" class="logout fl align-middle" title="返回桌面">
|
||||||
|
<i class="iconfont icon-shouye"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</header>
|
||||||
|
`;
|
||||||
|
const _this = this;
|
||||||
|
$(el).append(headerStr);
|
||||||
|
$(el)
|
||||||
|
.find("#js_comp_user_phone")
|
||||||
|
.click(() => _this.showUserInfo());
|
||||||
|
$(el)
|
||||||
|
.find("#js_comp_user_name")
|
||||||
|
.click(() => _this.showUserInfo());
|
||||||
|
$(el)
|
||||||
|
.find("#js_comp_operate")
|
||||||
|
.click(() => _this.goBackDesktop());
|
||||||
|
}
|
||||||
|
|
||||||
|
goBackDesktop() {
|
||||||
|
if (this.#isDev) {
|
||||||
|
console.error("调试模式,无效操作!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
parent.postMessage(JSON.stringify({ id: this.#appId, code: 1 }), "*");
|
||||||
|
}
|
||||||
|
|
||||||
|
reloadParent() {
|
||||||
|
if (this.#isDev) {
|
||||||
|
console.error("调试模式,无效操作!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
parent.postMessage(JSON.stringify({ id: this.#appId, code: 2 }), "*");
|
||||||
|
}
|
||||||
|
|
||||||
|
showUserInfo() {
|
||||||
|
if (this.#isDev) {
|
||||||
|
console.error("调试模式,无效操作!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
parent.postMessage(JSON.stringify({ id: this.#appId, code: 3 }), "*");
|
||||||
|
}
|
||||||
|
|
||||||
|
roleDecode(roleInfoStr) {
|
||||||
|
try {
|
||||||
|
var str = window.atob(roleInfoStr);
|
||||||
|
str = decodeURIComponent(str);
|
||||||
|
var obj = JSON.parse(str);
|
||||||
|
return obj;
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
return {
|
||||||
|
id: null,
|
||||||
|
ticket: "",
|
||||||
|
roleInfo: {},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setDevTicket(ticket, roleInfo) {
|
||||||
|
if (this.isSelf) {
|
||||||
|
this.ticket = ticket;
|
||||||
|
this.roleInfo = roleInfo;
|
||||||
|
this.#isDev = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
getIsSelf() {
|
||||||
|
if (this.#isDev) return false;
|
||||||
|
else return this.isSelf;
|
||||||
|
}
|
||||||
|
|
||||||
|
static getInstance() {
|
||||||
|
if (!this.instance) {
|
||||||
|
return (this.instance = new BschLoadUtil());
|
||||||
|
}
|
||||||
|
return this.instance;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,106 @@
|
|||||||
|
/**
|
||||||
|
* 数字基座内嵌加载帮助类
|
||||||
|
*/
|
||||||
|
|
||||||
|
class BschLoadUtil {
|
||||||
|
#isDev = false;
|
||||||
|
#appId = null;
|
||||||
|
constructor() {
|
||||||
|
if (!BschLoadUtil.instance) {
|
||||||
|
this.isSelf = window.self === window.top;
|
||||||
|
this.#appId = this.uuid();
|
||||||
|
this.ticket = null;
|
||||||
|
this.roleInfo = {
|
||||||
|
userId: null,
|
||||||
|
roleId: null,
|
||||||
|
schId: null,
|
||||||
|
childId: null,
|
||||||
|
};
|
||||||
|
BschLoadUtil.instance = this;
|
||||||
|
}
|
||||||
|
return BschLoadUtil.instance;
|
||||||
|
}
|
||||||
|
getTicket() {
|
||||||
|
if (!this.#isDev) {
|
||||||
|
const ticket = this.getUrlParam("ticket"),
|
||||||
|
roleInfoStr = this.getUrlParam("role");
|
||||||
|
var roleInfo = this.roleDecode(roleInfoStr);
|
||||||
|
this.ticket = ticket;
|
||||||
|
this.roleInfo = roleInfo;
|
||||||
|
}
|
||||||
|
return { ticket: this.ticket, roleInfo: this.roleInfo };
|
||||||
|
}
|
||||||
|
|
||||||
|
goBackDesktop() {
|
||||||
|
if (this.#isDev) {
|
||||||
|
console.error("调试模式,无效操作!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
parent.postMessage(JSON.stringify({ id: this.#appId, code: 1 }), "*");
|
||||||
|
}
|
||||||
|
|
||||||
|
reloadParent() {
|
||||||
|
if (this.#isDev) {
|
||||||
|
console.error("调试模式,无效操作!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
parent.postMessage(JSON.stringify({ id: this.#appId, code: 2 }), "*");
|
||||||
|
}
|
||||||
|
|
||||||
|
showUserInfo() {
|
||||||
|
if (this.#isDev) {
|
||||||
|
console.error("调试模式,无效操作!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
parent.postMessage(JSON.stringify({ id: this.#appId, code: 3 }), "*");
|
||||||
|
}
|
||||||
|
|
||||||
|
roleDecode(roleInfoStr) {
|
||||||
|
try {
|
||||||
|
var str = window.atob(roleInfoStr);
|
||||||
|
str = decodeURIComponent(str);
|
||||||
|
var obj = JSON.parse(str);
|
||||||
|
return obj;
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error);
|
||||||
|
return {
|
||||||
|
id: null,
|
||||||
|
ticket: "",
|
||||||
|
roleInfo: {},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
setDevTicket(ticket, roleInfo) {
|
||||||
|
if (this.isSelf) {
|
||||||
|
this.ticket = ticket;
|
||||||
|
this.roleInfo = roleInfo;
|
||||||
|
this.#isDev = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
getIsSelf() {
|
||||||
|
if (this.#isDev) return false;
|
||||||
|
else return this.isSelf;
|
||||||
|
}
|
||||||
|
|
||||||
|
getUrlParam(name) {
|
||||||
|
let reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
|
||||||
|
let r = window.location.search.substr(1).match(reg);
|
||||||
|
if (r != null) return unescape(r[2]);
|
||||||
|
else return null;
|
||||||
|
}
|
||||||
|
uuid() {
|
||||||
|
return "xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g, function (c) {
|
||||||
|
let r = (Math.random() * 16) | 0,
|
||||||
|
v = c == "x" ? r : (r & 0x3) | 0x8;
|
||||||
|
return v.toString(16);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
static getInstance() {
|
||||||
|
if (!this.instance) {
|
||||||
|
return (this.instance = new BschLoadUtil());
|
||||||
|
}
|
||||||
|
return this.instance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 7.3 KiB |
|
After Width: | Height: | Size: 3.4 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 933 B |
|
After Width: | Height: | Size: 5.4 KiB |
@@ -0,0 +1,628 @@
|
|||||||
|
/*
|
||||||
|
* JQuery zTree excheck v3.5.28
|
||||||
|
* http://treejs.cn/
|
||||||
|
*
|
||||||
|
* Copyright (c) 2010 Hunter.z
|
||||||
|
*
|
||||||
|
* Licensed same as jquery - MIT License
|
||||||
|
* http://www.opensource.org/licenses/mit-license.php
|
||||||
|
*
|
||||||
|
* email: hunter.z@263.net
|
||||||
|
* Date: 2017-01-20
|
||||||
|
*/
|
||||||
|
(function($){
|
||||||
|
//default consts of excheck
|
||||||
|
var _consts = {
|
||||||
|
event: {
|
||||||
|
CHECK: "ztree_check"
|
||||||
|
},
|
||||||
|
id: {
|
||||||
|
CHECK: "_check"
|
||||||
|
},
|
||||||
|
checkbox: {
|
||||||
|
STYLE: "checkbox",
|
||||||
|
DEFAULT: "chk",
|
||||||
|
DISABLED: "disable",
|
||||||
|
FALSE: "false",
|
||||||
|
TRUE: "true",
|
||||||
|
FULL: "full",
|
||||||
|
PART: "part",
|
||||||
|
FOCUS: "focus"
|
||||||
|
},
|
||||||
|
radio: {
|
||||||
|
STYLE: "radio",
|
||||||
|
TYPE_ALL: "all",
|
||||||
|
TYPE_LEVEL: "level"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//default setting of excheck
|
||||||
|
_setting = {
|
||||||
|
check: {
|
||||||
|
enable: false,
|
||||||
|
autoCheckTrigger: false,
|
||||||
|
chkStyle: _consts.checkbox.STYLE,
|
||||||
|
nocheckInherit: false,
|
||||||
|
chkDisabledInherit: false,
|
||||||
|
radioType: _consts.radio.TYPE_LEVEL,
|
||||||
|
chkboxType: {
|
||||||
|
"Y": "ps",
|
||||||
|
"N": "ps"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data: {
|
||||||
|
key: {
|
||||||
|
checked: "checked"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
callback: {
|
||||||
|
beforeCheck:null,
|
||||||
|
onCheck:null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//default root of excheck
|
||||||
|
_initRoot = function (setting) {
|
||||||
|
var r = data.getRoot(setting);
|
||||||
|
r.radioCheckedList = [];
|
||||||
|
},
|
||||||
|
//default cache of excheck
|
||||||
|
_initCache = function(treeId) {},
|
||||||
|
//default bind event of excheck
|
||||||
|
_bindEvent = function(setting) {
|
||||||
|
var o = setting.treeObj,
|
||||||
|
c = consts.event;
|
||||||
|
o.bind(c.CHECK, function (event, srcEvent, treeId, node) {
|
||||||
|
event.srcEvent = srcEvent;
|
||||||
|
tools.apply(setting.callback.onCheck, [event, treeId, node]);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
_unbindEvent = function(setting) {
|
||||||
|
var o = setting.treeObj,
|
||||||
|
c = consts.event;
|
||||||
|
o.unbind(c.CHECK);
|
||||||
|
},
|
||||||
|
//default event proxy of excheck
|
||||||
|
_eventProxy = function(e) {
|
||||||
|
var target = e.target,
|
||||||
|
setting = data.getSetting(e.data.treeId),
|
||||||
|
tId = "", node = null,
|
||||||
|
nodeEventType = "", treeEventType = "",
|
||||||
|
nodeEventCallback = null, treeEventCallback = null;
|
||||||
|
|
||||||
|
if (tools.eqs(e.type, "mouseover")) {
|
||||||
|
if (setting.check.enable && tools.eqs(target.tagName, "span") && target.getAttribute("treeNode"+ consts.id.CHECK) !== null) {
|
||||||
|
tId = tools.getNodeMainDom(target).id;
|
||||||
|
nodeEventType = "mouseoverCheck";
|
||||||
|
}
|
||||||
|
} else if (tools.eqs(e.type, "mouseout")) {
|
||||||
|
if (setting.check.enable && tools.eqs(target.tagName, "span") && target.getAttribute("treeNode"+ consts.id.CHECK) !== null) {
|
||||||
|
tId = tools.getNodeMainDom(target).id;
|
||||||
|
nodeEventType = "mouseoutCheck";
|
||||||
|
}
|
||||||
|
} else if (tools.eqs(e.type, "click")) {
|
||||||
|
if (setting.check.enable && tools.eqs(target.tagName, "span") && target.getAttribute("treeNode"+ consts.id.CHECK) !== null) {
|
||||||
|
tId = tools.getNodeMainDom(target).id;
|
||||||
|
nodeEventType = "checkNode";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (tId.length>0) {
|
||||||
|
node = data.getNodeCache(setting, tId);
|
||||||
|
switch (nodeEventType) {
|
||||||
|
case "checkNode" :
|
||||||
|
nodeEventCallback = _handler.onCheckNode;
|
||||||
|
break;
|
||||||
|
case "mouseoverCheck" :
|
||||||
|
nodeEventCallback = _handler.onMouseoverCheck;
|
||||||
|
break;
|
||||||
|
case "mouseoutCheck" :
|
||||||
|
nodeEventCallback = _handler.onMouseoutCheck;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var proxyResult = {
|
||||||
|
stop: nodeEventType === "checkNode",
|
||||||
|
node: node,
|
||||||
|
nodeEventType: nodeEventType,
|
||||||
|
nodeEventCallback: nodeEventCallback,
|
||||||
|
treeEventType: treeEventType,
|
||||||
|
treeEventCallback: treeEventCallback
|
||||||
|
};
|
||||||
|
return proxyResult
|
||||||
|
},
|
||||||
|
//default init node of excheck
|
||||||
|
_initNode = function(setting, level, n, parentNode, isFirstNode, isLastNode, openFlag) {
|
||||||
|
if (!n) return;
|
||||||
|
var checkedKey = setting.data.key.checked;
|
||||||
|
if (typeof n[checkedKey] == "string") n[checkedKey] = tools.eqs(n[checkedKey], "true");
|
||||||
|
n[checkedKey] = !!n[checkedKey];
|
||||||
|
n.checkedOld = n[checkedKey];
|
||||||
|
if (typeof n.nocheck == "string") n.nocheck = tools.eqs(n.nocheck, "true");
|
||||||
|
n.nocheck = !!n.nocheck || (setting.check.nocheckInherit && parentNode && !!parentNode.nocheck);
|
||||||
|
if (typeof n.chkDisabled == "string") n.chkDisabled = tools.eqs(n.chkDisabled, "true");
|
||||||
|
n.chkDisabled = !!n.chkDisabled || (setting.check.chkDisabledInherit && parentNode && !!parentNode.chkDisabled);
|
||||||
|
if (typeof n.halfCheck == "string") n.halfCheck = tools.eqs(n.halfCheck, "true");
|
||||||
|
n.halfCheck = !!n.halfCheck;
|
||||||
|
n.check_Child_State = -1;
|
||||||
|
n.check_Focus = false;
|
||||||
|
n.getCheckStatus = function() {return data.getCheckStatus(setting, n);};
|
||||||
|
|
||||||
|
if (setting.check.chkStyle == consts.radio.STYLE && setting.check.radioType == consts.radio.TYPE_ALL && n[checkedKey] ) {
|
||||||
|
var r = data.getRoot(setting);
|
||||||
|
r.radioCheckedList.push(n);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//add dom for check
|
||||||
|
_beforeA = function(setting, node, html) {
|
||||||
|
var checkedKey = setting.data.key.checked;
|
||||||
|
if (setting.check.enable) {
|
||||||
|
data.makeChkFlag(setting, node);
|
||||||
|
html.push("<span ID='", node.tId, consts.id.CHECK, "' class='", view.makeChkClass(setting, node), "' treeNode", consts.id.CHECK, (node.nocheck === true?" style='display:none;'":""),"></span>");
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//update zTreeObj, add method of check
|
||||||
|
_zTreeTools = function(setting, zTreeTools) {
|
||||||
|
zTreeTools.checkNode = function(node, checked, checkTypeFlag, callbackFlag) {
|
||||||
|
var checkedKey = this.setting.data.key.checked;
|
||||||
|
if (node.chkDisabled === true) return;
|
||||||
|
if (checked !== true && checked !== false) {
|
||||||
|
checked = !node[checkedKey];
|
||||||
|
}
|
||||||
|
callbackFlag = !!callbackFlag;
|
||||||
|
|
||||||
|
if (node[checkedKey] === checked && !checkTypeFlag) {
|
||||||
|
return;
|
||||||
|
} else if (callbackFlag && tools.apply(this.setting.callback.beforeCheck, [this.setting.treeId, node], true) == false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (tools.uCanDo(this.setting) && this.setting.check.enable && node.nocheck !== true) {
|
||||||
|
node[checkedKey] = checked;
|
||||||
|
var checkObj = $$(node, consts.id.CHECK, this.setting);
|
||||||
|
if (checkTypeFlag || this.setting.check.chkStyle === consts.radio.STYLE) view.checkNodeRelation(this.setting, node);
|
||||||
|
view.setChkClass(this.setting, checkObj, node);
|
||||||
|
view.repairParentChkClassWithSelf(this.setting, node);
|
||||||
|
if (callbackFlag) {
|
||||||
|
this.setting.treeObj.trigger(consts.event.CHECK, [null, this.setting.treeId, node]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
zTreeTools.checkAllNodes = function(checked) {
|
||||||
|
view.repairAllChk(this.setting, !!checked);
|
||||||
|
}
|
||||||
|
|
||||||
|
zTreeTools.getCheckedNodes = function(checked) {
|
||||||
|
var childKey = this.setting.data.key.children;
|
||||||
|
checked = (checked !== false);
|
||||||
|
return data.getTreeCheckedNodes(this.setting, data.getRoot(this.setting)[childKey], checked);
|
||||||
|
}
|
||||||
|
|
||||||
|
zTreeTools.getChangeCheckedNodes = function() {
|
||||||
|
var childKey = this.setting.data.key.children;
|
||||||
|
return data.getTreeChangeCheckedNodes(this.setting, data.getRoot(this.setting)[childKey]);
|
||||||
|
}
|
||||||
|
|
||||||
|
zTreeTools.setChkDisabled = function(node, disabled, inheritParent, inheritChildren) {
|
||||||
|
disabled = !!disabled;
|
||||||
|
inheritParent = !!inheritParent;
|
||||||
|
inheritChildren = !!inheritChildren;
|
||||||
|
view.repairSonChkDisabled(this.setting, node, disabled, inheritChildren);
|
||||||
|
view.repairParentChkDisabled(this.setting, node.getParentNode(), disabled, inheritParent);
|
||||||
|
}
|
||||||
|
|
||||||
|
var _updateNode = zTreeTools.updateNode;
|
||||||
|
zTreeTools.updateNode = function(node, checkTypeFlag) {
|
||||||
|
if (_updateNode) _updateNode.apply(zTreeTools, arguments);
|
||||||
|
if (!node || !this.setting.check.enable) return;
|
||||||
|
var nObj = $$(node, this.setting);
|
||||||
|
if (nObj.get(0) && tools.uCanDo(this.setting)) {
|
||||||
|
var checkObj = $$(node, consts.id.CHECK, this.setting);
|
||||||
|
if (checkTypeFlag == true || this.setting.check.chkStyle === consts.radio.STYLE) view.checkNodeRelation(this.setting, node);
|
||||||
|
view.setChkClass(this.setting, checkObj, node);
|
||||||
|
view.repairParentChkClassWithSelf(this.setting, node);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//method of operate data
|
||||||
|
_data = {
|
||||||
|
getRadioCheckedList: function(setting) {
|
||||||
|
var checkedList = data.getRoot(setting).radioCheckedList;
|
||||||
|
for (var i=0, j=checkedList.length; i<j; i++) {
|
||||||
|
if(!data.getNodeCache(setting, checkedList[i].tId)) {
|
||||||
|
checkedList.splice(i, 1);
|
||||||
|
i--; j--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return checkedList;
|
||||||
|
},
|
||||||
|
getCheckStatus: function(setting, node) {
|
||||||
|
if (!setting.check.enable || node.nocheck || node.chkDisabled) return null;
|
||||||
|
var checkedKey = setting.data.key.checked,
|
||||||
|
r = {
|
||||||
|
checked: node[checkedKey],
|
||||||
|
half: node.halfCheck ? node.halfCheck : (setting.check.chkStyle == consts.radio.STYLE ? (node.check_Child_State === 2) : (node[checkedKey] ? (node.check_Child_State > -1 && node.check_Child_State < 2) : (node.check_Child_State > 0)))
|
||||||
|
};
|
||||||
|
return r;
|
||||||
|
},
|
||||||
|
getTreeCheckedNodes: function(setting, nodes, checked, results) {
|
||||||
|
if (!nodes) return [];
|
||||||
|
var childKey = setting.data.key.children,
|
||||||
|
checkedKey = setting.data.key.checked,
|
||||||
|
onlyOne = (checked && setting.check.chkStyle == consts.radio.STYLE && setting.check.radioType == consts.radio.TYPE_ALL);
|
||||||
|
results = !results ? [] : results;
|
||||||
|
for (var i = 0, l = nodes.length; i < l; i++) {
|
||||||
|
if (nodes[i].nocheck !== true && nodes[i].chkDisabled !== true && nodes[i][checkedKey] == checked) {
|
||||||
|
results.push(nodes[i]);
|
||||||
|
if(onlyOne) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
data.getTreeCheckedNodes(setting, nodes[i][childKey], checked, results);
|
||||||
|
if(onlyOne && results.length > 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return results;
|
||||||
|
},
|
||||||
|
getTreeChangeCheckedNodes: function(setting, nodes, results) {
|
||||||
|
if (!nodes) return [];
|
||||||
|
var childKey = setting.data.key.children,
|
||||||
|
checkedKey = setting.data.key.checked;
|
||||||
|
results = !results ? [] : results;
|
||||||
|
for (var i = 0, l = nodes.length; i < l; i++) {
|
||||||
|
if (nodes[i].nocheck !== true && nodes[i].chkDisabled !== true && nodes[i][checkedKey] != nodes[i].checkedOld) {
|
||||||
|
results.push(nodes[i]);
|
||||||
|
}
|
||||||
|
data.getTreeChangeCheckedNodes(setting, nodes[i][childKey], results);
|
||||||
|
}
|
||||||
|
return results;
|
||||||
|
},
|
||||||
|
makeChkFlag: function(setting, node) {
|
||||||
|
if (!node) return;
|
||||||
|
var childKey = setting.data.key.children,
|
||||||
|
checkedKey = setting.data.key.checked,
|
||||||
|
chkFlag = -1;
|
||||||
|
if (node[childKey]) {
|
||||||
|
for (var i = 0, l = node[childKey].length; i < l; i++) {
|
||||||
|
var cNode = node[childKey][i];
|
||||||
|
var tmp = -1;
|
||||||
|
if (setting.check.chkStyle == consts.radio.STYLE) {
|
||||||
|
if (cNode.nocheck === true || cNode.chkDisabled === true) {
|
||||||
|
tmp = cNode.check_Child_State;
|
||||||
|
} else if (cNode.halfCheck === true) {
|
||||||
|
tmp = 2;
|
||||||
|
} else if (cNode[checkedKey]) {
|
||||||
|
tmp = 2;
|
||||||
|
} else {
|
||||||
|
tmp = cNode.check_Child_State > 0 ? 2:0;
|
||||||
|
}
|
||||||
|
if (tmp == 2) {
|
||||||
|
chkFlag = 2; break;
|
||||||
|
} else if (tmp == 0){
|
||||||
|
chkFlag = 0;
|
||||||
|
}
|
||||||
|
} else if (setting.check.chkStyle == consts.checkbox.STYLE) {
|
||||||
|
if (cNode.nocheck === true || cNode.chkDisabled === true) {
|
||||||
|
tmp = cNode.check_Child_State;
|
||||||
|
} else if (cNode.halfCheck === true) {
|
||||||
|
tmp = 1;
|
||||||
|
} else if (cNode[checkedKey] ) {
|
||||||
|
tmp = (cNode.check_Child_State === -1 || cNode.check_Child_State === 2) ? 2 : 1;
|
||||||
|
} else {
|
||||||
|
tmp = (cNode.check_Child_State > 0) ? 1 : 0;
|
||||||
|
}
|
||||||
|
if (tmp === 1) {
|
||||||
|
chkFlag = 1; break;
|
||||||
|
} else if (tmp === 2 && chkFlag > -1 && i > 0 && tmp !== chkFlag) {
|
||||||
|
chkFlag = 1; break;
|
||||||
|
} else if (chkFlag === 2 && tmp > -1 && tmp < 2) {
|
||||||
|
chkFlag = 1; break;
|
||||||
|
} else if (tmp > -1) {
|
||||||
|
chkFlag = tmp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
node.check_Child_State = chkFlag;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//method of event proxy
|
||||||
|
_event = {
|
||||||
|
|
||||||
|
},
|
||||||
|
//method of event handler
|
||||||
|
_handler = {
|
||||||
|
onCheckNode: function (event, node) {
|
||||||
|
if (node.chkDisabled === true) return false;
|
||||||
|
var setting = data.getSetting(event.data.treeId),
|
||||||
|
checkedKey = setting.data.key.checked;
|
||||||
|
if (tools.apply(setting.callback.beforeCheck, [setting.treeId, node], true) == false) return true;
|
||||||
|
node[checkedKey] = !node[checkedKey];
|
||||||
|
view.checkNodeRelation(setting, node);
|
||||||
|
var checkObj = $$(node, consts.id.CHECK, setting);
|
||||||
|
view.setChkClass(setting, checkObj, node);
|
||||||
|
view.repairParentChkClassWithSelf(setting, node);
|
||||||
|
setting.treeObj.trigger(consts.event.CHECK, [event, setting.treeId, node]);
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
onMouseoverCheck: function(event, node) {
|
||||||
|
if (node.chkDisabled === true) return false;
|
||||||
|
var setting = data.getSetting(event.data.treeId),
|
||||||
|
checkObj = $$(node, consts.id.CHECK, setting);
|
||||||
|
node.check_Focus = true;
|
||||||
|
view.setChkClass(setting, checkObj, node);
|
||||||
|
return true;
|
||||||
|
},
|
||||||
|
onMouseoutCheck: function(event, node) {
|
||||||
|
if (node.chkDisabled === true) return false;
|
||||||
|
var setting = data.getSetting(event.data.treeId),
|
||||||
|
checkObj = $$(node, consts.id.CHECK, setting);
|
||||||
|
node.check_Focus = false;
|
||||||
|
view.setChkClass(setting, checkObj, node);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//method of tools for zTree
|
||||||
|
_tools = {
|
||||||
|
|
||||||
|
},
|
||||||
|
//method of operate ztree dom
|
||||||
|
_view = {
|
||||||
|
checkNodeRelation: function(setting, node) {
|
||||||
|
var pNode, i, l,
|
||||||
|
childKey = setting.data.key.children,
|
||||||
|
checkedKey = setting.data.key.checked,
|
||||||
|
r = consts.radio;
|
||||||
|
if (setting.check.chkStyle == r.STYLE) {
|
||||||
|
var checkedList = data.getRadioCheckedList(setting);
|
||||||
|
if (node[checkedKey]) {
|
||||||
|
if (setting.check.radioType == r.TYPE_ALL) {
|
||||||
|
for (i = checkedList.length-1; i >= 0; i--) {
|
||||||
|
pNode = checkedList[i];
|
||||||
|
if (pNode[checkedKey] && pNode != node) {
|
||||||
|
pNode[checkedKey] = false;
|
||||||
|
checkedList.splice(i, 1);
|
||||||
|
|
||||||
|
view.setChkClass(setting, $$(pNode, consts.id.CHECK, setting), pNode);
|
||||||
|
if (pNode.parentTId != node.parentTId) {
|
||||||
|
view.repairParentChkClassWithSelf(setting, pNode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
checkedList.push(node);
|
||||||
|
} else {
|
||||||
|
var parentNode = (node.parentTId) ? node.getParentNode() : data.getRoot(setting);
|
||||||
|
for (i = 0, l = parentNode[childKey].length; i < l; i++) {
|
||||||
|
pNode = parentNode[childKey][i];
|
||||||
|
if (pNode[checkedKey] && pNode != node) {
|
||||||
|
pNode[checkedKey] = false;
|
||||||
|
view.setChkClass(setting, $$(pNode, consts.id.CHECK, setting), pNode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (setting.check.radioType == r.TYPE_ALL) {
|
||||||
|
for (i = 0, l = checkedList.length; i < l; i++) {
|
||||||
|
if (node == checkedList[i]) {
|
||||||
|
checkedList.splice(i, 1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if (node[checkedKey] && (!node[childKey] || node[childKey].length==0 || setting.check.chkboxType.Y.indexOf("s") > -1)) {
|
||||||
|
view.setSonNodeCheckBox(setting, node, true);
|
||||||
|
}
|
||||||
|
if (!node[checkedKey] && (!node[childKey] || node[childKey].length==0 || setting.check.chkboxType.N.indexOf("s") > -1)) {
|
||||||
|
view.setSonNodeCheckBox(setting, node, false);
|
||||||
|
}
|
||||||
|
if (node[checkedKey] && setting.check.chkboxType.Y.indexOf("p") > -1) {
|
||||||
|
view.setParentNodeCheckBox(setting, node, true);
|
||||||
|
}
|
||||||
|
if (!node[checkedKey] && setting.check.chkboxType.N.indexOf("p") > -1) {
|
||||||
|
view.setParentNodeCheckBox(setting, node, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
makeChkClass: function(setting, node) {
|
||||||
|
var checkedKey = setting.data.key.checked,
|
||||||
|
c = consts.checkbox, r = consts.radio,
|
||||||
|
fullStyle = "";
|
||||||
|
if (node.chkDisabled === true) {
|
||||||
|
fullStyle = c.DISABLED;
|
||||||
|
} else if (node.halfCheck) {
|
||||||
|
fullStyle = c.PART;
|
||||||
|
} else if (setting.check.chkStyle == r.STYLE) {
|
||||||
|
fullStyle = (node.check_Child_State < 1)? c.FULL:c.PART;
|
||||||
|
} else {
|
||||||
|
fullStyle = node[checkedKey] ? ((node.check_Child_State === 2 || node.check_Child_State === -1) ? c.FULL:c.PART) : ((node.check_Child_State < 1)? c.FULL:c.PART);
|
||||||
|
}
|
||||||
|
var chkName = setting.check.chkStyle + "_" + (node[checkedKey] ? c.TRUE : c.FALSE) + "_" + fullStyle;
|
||||||
|
chkName = (node.check_Focus && node.chkDisabled !== true) ? chkName + "_" + c.FOCUS : chkName;
|
||||||
|
return consts.className.BUTTON + " " + c.DEFAULT + " " + chkName;
|
||||||
|
},
|
||||||
|
repairAllChk: function(setting, checked) {
|
||||||
|
if (setting.check.enable && setting.check.chkStyle === consts.checkbox.STYLE) {
|
||||||
|
var checkedKey = setting.data.key.checked,
|
||||||
|
childKey = setting.data.key.children,
|
||||||
|
root = data.getRoot(setting);
|
||||||
|
for (var i = 0, l = root[childKey].length; i<l ; i++) {
|
||||||
|
var node = root[childKey][i];
|
||||||
|
if (node.nocheck !== true && node.chkDisabled !== true) {
|
||||||
|
node[checkedKey] = checked;
|
||||||
|
}
|
||||||
|
view.setSonNodeCheckBox(setting, node, checked);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
repairChkClass: function(setting, node) {
|
||||||
|
if (!node) return;
|
||||||
|
data.makeChkFlag(setting, node);
|
||||||
|
if (node.nocheck !== true) {
|
||||||
|
var checkObj = $$(node, consts.id.CHECK, setting);
|
||||||
|
view.setChkClass(setting, checkObj, node);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
repairParentChkClass: function(setting, node) {
|
||||||
|
if (!node || !node.parentTId) return;
|
||||||
|
var pNode = node.getParentNode();
|
||||||
|
view.repairChkClass(setting, pNode);
|
||||||
|
view.repairParentChkClass(setting, pNode);
|
||||||
|
},
|
||||||
|
repairParentChkClassWithSelf: function(setting, node) {
|
||||||
|
if (!node) return;
|
||||||
|
var childKey = setting.data.key.children;
|
||||||
|
if (node[childKey] && node[childKey].length > 0) {
|
||||||
|
view.repairParentChkClass(setting, node[childKey][0]);
|
||||||
|
} else {
|
||||||
|
view.repairParentChkClass(setting, node);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
repairSonChkDisabled: function(setting, node, chkDisabled, inherit) {
|
||||||
|
if (!node) return;
|
||||||
|
var childKey = setting.data.key.children;
|
||||||
|
if (node.chkDisabled != chkDisabled) {
|
||||||
|
node.chkDisabled = chkDisabled;
|
||||||
|
}
|
||||||
|
view.repairChkClass(setting, node);
|
||||||
|
if (node[childKey] && inherit) {
|
||||||
|
for (var i = 0, l = node[childKey].length; i < l; i++) {
|
||||||
|
var sNode = node[childKey][i];
|
||||||
|
view.repairSonChkDisabled(setting, sNode, chkDisabled, inherit);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
repairParentChkDisabled: function(setting, node, chkDisabled, inherit) {
|
||||||
|
if (!node) return;
|
||||||
|
if (node.chkDisabled != chkDisabled && inherit) {
|
||||||
|
node.chkDisabled = chkDisabled;
|
||||||
|
}
|
||||||
|
view.repairChkClass(setting, node);
|
||||||
|
view.repairParentChkDisabled(setting, node.getParentNode(), chkDisabled, inherit);
|
||||||
|
},
|
||||||
|
setChkClass: function(setting, obj, node) {
|
||||||
|
if (!obj) return;
|
||||||
|
if (node.nocheck === true) {
|
||||||
|
obj.hide();
|
||||||
|
} else {
|
||||||
|
obj.show();
|
||||||
|
}
|
||||||
|
obj.attr('class', view.makeChkClass(setting, node));
|
||||||
|
},
|
||||||
|
setParentNodeCheckBox: function(setting, node, value, srcNode) {
|
||||||
|
var childKey = setting.data.key.children,
|
||||||
|
checkedKey = setting.data.key.checked,
|
||||||
|
checkObj = $$(node, consts.id.CHECK, setting);
|
||||||
|
if (!srcNode) srcNode = node;
|
||||||
|
data.makeChkFlag(setting, node);
|
||||||
|
if (node.nocheck !== true && node.chkDisabled !== true) {
|
||||||
|
node[checkedKey] = value;
|
||||||
|
view.setChkClass(setting, checkObj, node);
|
||||||
|
if (setting.check.autoCheckTrigger && node != srcNode) {
|
||||||
|
setting.treeObj.trigger(consts.event.CHECK, [null, setting.treeId, node]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (node.parentTId) {
|
||||||
|
var pSign = true;
|
||||||
|
if (!value) {
|
||||||
|
var pNodes = node.getParentNode()[childKey];
|
||||||
|
for (var i = 0, l = pNodes.length; i < l; i++) {
|
||||||
|
if ((pNodes[i].nocheck !== true && pNodes[i].chkDisabled !== true && pNodes[i][checkedKey])
|
||||||
|
|| ((pNodes[i].nocheck === true || pNodes[i].chkDisabled === true) && pNodes[i].check_Child_State > 0)) {
|
||||||
|
pSign = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (pSign) {
|
||||||
|
view.setParentNodeCheckBox(setting, node.getParentNode(), value, srcNode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
setSonNodeCheckBox: function(setting, node, value, srcNode) {
|
||||||
|
if (!node) return;
|
||||||
|
var childKey = setting.data.key.children,
|
||||||
|
checkedKey = setting.data.key.checked,
|
||||||
|
checkObj = $$(node, consts.id.CHECK, setting);
|
||||||
|
if (!srcNode) srcNode = node;
|
||||||
|
|
||||||
|
var hasDisable = false;
|
||||||
|
if (node[childKey]) {
|
||||||
|
for (var i = 0, l = node[childKey].length; i < l; i++) {
|
||||||
|
var sNode = node[childKey][i];
|
||||||
|
view.setSonNodeCheckBox(setting, sNode, value, srcNode);
|
||||||
|
if (sNode.chkDisabled === true) hasDisable = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (node != data.getRoot(setting) && node.chkDisabled !== true) {
|
||||||
|
if (hasDisable && node.nocheck !== true) {
|
||||||
|
data.makeChkFlag(setting, node);
|
||||||
|
}
|
||||||
|
if (node.nocheck !== true && node.chkDisabled !== true) {
|
||||||
|
node[checkedKey] = value;
|
||||||
|
if (!hasDisable) node.check_Child_State = (node[childKey] && node[childKey].length > 0) ? (value ? 2 : 0) : -1;
|
||||||
|
} else {
|
||||||
|
node.check_Child_State = -1;
|
||||||
|
}
|
||||||
|
view.setChkClass(setting, checkObj, node);
|
||||||
|
if (setting.check.autoCheckTrigger && node != srcNode && node.nocheck !== true && node.chkDisabled !== true) {
|
||||||
|
setting.treeObj.trigger(consts.event.CHECK, [null, setting.treeId, node]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
_z = {
|
||||||
|
tools: _tools,
|
||||||
|
view: _view,
|
||||||
|
event: _event,
|
||||||
|
data: _data
|
||||||
|
};
|
||||||
|
$.extend(true, $.fn.zTree.consts, _consts);
|
||||||
|
$.extend(true, $.fn.zTree._z, _z);
|
||||||
|
|
||||||
|
var zt = $.fn.zTree,
|
||||||
|
tools = zt._z.tools,
|
||||||
|
consts = zt.consts,
|
||||||
|
view = zt._z.view,
|
||||||
|
data = zt._z.data,
|
||||||
|
event = zt._z.event,
|
||||||
|
$$ = tools.$;
|
||||||
|
|
||||||
|
data.exSetting(_setting);
|
||||||
|
data.addInitBind(_bindEvent);
|
||||||
|
data.addInitUnBind(_unbindEvent);
|
||||||
|
data.addInitCache(_initCache);
|
||||||
|
data.addInitNode(_initNode);
|
||||||
|
data.addInitProxy(_eventProxy, true);
|
||||||
|
data.addInitRoot(_initRoot);
|
||||||
|
data.addBeforeA(_beforeA);
|
||||||
|
data.addZTreeTools(_zTreeTools);
|
||||||
|
|
||||||
|
var _createNodes = view.createNodes;
|
||||||
|
view.createNodes = function(setting, level, nodes, parentNode, index) {
|
||||||
|
if (_createNodes) _createNodes.apply(view, arguments);
|
||||||
|
if (!nodes) return;
|
||||||
|
view.repairParentChkClassWithSelf(setting, parentNode);
|
||||||
|
}
|
||||||
|
var _removeNode = view.removeNode;
|
||||||
|
view.removeNode = function(setting, node) {
|
||||||
|
var parentNode = node.getParentNode();
|
||||||
|
if (_removeNode) _removeNode.apply(view, arguments);
|
||||||
|
if (!node || !parentNode) return;
|
||||||
|
view.repairChkClass(setting, parentNode);
|
||||||
|
view.repairParentChkClass(setting, parentNode);
|
||||||
|
}
|
||||||
|
|
||||||
|
var _appendNodes = view.appendNodes;
|
||||||
|
view.appendNodes = function(setting, level, nodes, parentNode, index, initFlag, openFlag) {
|
||||||
|
var html = "";
|
||||||
|
if (_appendNodes) {
|
||||||
|
html = _appendNodes.apply(view, arguments);
|
||||||
|
}
|
||||||
|
if (parentNode) {
|
||||||
|
data.makeChkFlag(setting, parentNode);
|
||||||
|
}
|
||||||
|
return html;
|
||||||
|
}
|
||||||
|
})(jQuery);
|
||||||
@@ -0,0 +1,95 @@
|
|||||||
|
/*-------------------------------------
|
||||||
|
zTree Style
|
||||||
|
|
||||||
|
version: 3.4
|
||||||
|
author: Hunter.z
|
||||||
|
email: hunter.z@263.net
|
||||||
|
website: http://code.google.com/p/jquerytree/
|
||||||
|
|
||||||
|
-------------------------------------*/
|
||||||
|
.ztree * {padding:0; margin:0; font-size:14px; font-family: Verdana, Arial, Helvetica, AppleGothic, sans-serif}
|
||||||
|
.ztree {margin:0; padding:5px; color:#333}
|
||||||
|
.ztree li{padding:0; margin:0; list-style:none; line-height:17px; text-align:left; white-space:nowrap; outline:0}
|
||||||
|
.ztree li ul{ margin:0; padding:0 0 0 18px}
|
||||||
|
.ztree li ul.line{ background:url(./img/line_conn.png) 0 0 repeat-y;}
|
||||||
|
|
||||||
|
.ztree li a {padding-right:3px; margin:0; cursor:pointer; height:21px; color:#333; background-color: transparent; text-decoration:none; vertical-align:top; display: inline-block}
|
||||||
|
.ztree li a:hover {text-decoration:underline}
|
||||||
|
.ztree li a.curSelectedNode {padding-top:0px; background-color:#e5e5e5; color:black; height:21px; opacity:0.8;}
|
||||||
|
.ztree li a.curSelectedNode_Edit {padding-top:0px; background-color:#e5e5e5; color:black; height:21px; border:1px #666 solid; opacity:0.8;}
|
||||||
|
.ztree li a.tmpTargetNode_inner {padding-top:0px; background-color:#aaa; color:white; height:21px; border:1px #666 solid;
|
||||||
|
opacity:0.8; filter:alpha(opacity=80)}
|
||||||
|
.ztree li a.tmpTargetNode_prev {}
|
||||||
|
.ztree li a.tmpTargetNode_next {}
|
||||||
|
.ztree li a input.rename {height:14px; width:80px; padding:0; margin:0;
|
||||||
|
font-size:12px; border:1px #585956 solid; *border:0px}
|
||||||
|
.ztree li span {line-height:21px; margin-right:2px}
|
||||||
|
.ztree li span.button {line-height:0; margin:0; padding: 0; width:21px; height:21px; display: inline-block; vertical-align:middle;
|
||||||
|
border:0 none; cursor: pointer;outline:none;
|
||||||
|
background-color:transparent; background-repeat:no-repeat; background-attachment: scroll;
|
||||||
|
background-image:url("./img/bootstrap.png");}
|
||||||
|
|
||||||
|
.ztree li span.button.chk {width:13px; height:13px; margin:0 2px; cursor: auto}
|
||||||
|
.ztree li span.button.chk.checkbox_false_full {background-position: -5px -5px;}
|
||||||
|
.ztree li span.button.chk.checkbox_false_full_focus {background-position: -5px -26px;}
|
||||||
|
.ztree li span.button.chk.checkbox_false_part {background-position: -5px -48px;}
|
||||||
|
.ztree li span.button.chk.checkbox_false_part_focus {background-position: -5px -68px;}
|
||||||
|
.ztree li span.button.chk.checkbox_false_disable {background-position: -5px -89px;}
|
||||||
|
.ztree li span.button.chk.checkbox_true_full {background-position: -26px -5px;}
|
||||||
|
.ztree li span.button.chk.checkbox_true_full_focus {background-position: -26px -26px;}
|
||||||
|
.ztree li span.button.chk.checkbox_true_part {background-position: -26px -48px;}
|
||||||
|
.ztree li span.button.chk.checkbox_true_part_focus {background-position: -26px -68px;}
|
||||||
|
.ztree li span.button.chk.checkbox_true_disable {background-position: -26px -89px;}
|
||||||
|
.ztree li span.button.chk.radio_false_full {background-position: -47px -5px;}
|
||||||
|
.ztree li span.button.chk.radio_false_full_focus {background-position: -47px -26px;}
|
||||||
|
.ztree li span.button.chk.radio_false_part {background-position: -47px -47px;}
|
||||||
|
.ztree li span.button.chk.radio_false_part_focus {background-position: -47px -68px;}
|
||||||
|
.ztree li span.button.chk.radio_false_disable {background-position: -47px -89px;}
|
||||||
|
.ztree li span.button.chk.radio_true_full {background-position: -68px -5px;}
|
||||||
|
.ztree li span.button.chk.radio_true_full_focus {background-position: -68px -26px;}
|
||||||
|
.ztree li span.button.chk.radio_true_part {background-position: -68px -47px;}
|
||||||
|
.ztree li span.button.chk.radio_true_part_focus {background-position: -68px -68px;}
|
||||||
|
.ztree li span.button.chk.radio_true_disable {background-position: -68px -89px;}
|
||||||
|
|
||||||
|
.ztree li span.button.switch {width:21px; height:21px}
|
||||||
|
.ztree li span.button.root_open{background-position:-105px -63px}
|
||||||
|
.ztree li span.button.root_close{background-position:-126px -63px}
|
||||||
|
.ztree li span.button.roots_open{background-position: -105px 0;}
|
||||||
|
.ztree li span.button.roots_close{background-position: -126px 0;}
|
||||||
|
.ztree li span.button.center_open{background-position: -105px -21px;}
|
||||||
|
.ztree li span.button.center_close{background-position: -126px -21px;}
|
||||||
|
.ztree li span.button.bottom_open{background-position: -105px -42px;}
|
||||||
|
.ztree li span.button.bottom_close{background-position: -126px -42px;}
|
||||||
|
.ztree li span.button.noline_open{background-position: -105px -84px;}
|
||||||
|
.ztree li span.button.noline_close{background-position: -126px -84px;}
|
||||||
|
.ztree li span.button.root_docu{ background:none;}
|
||||||
|
.ztree li span.button.roots_docu{background-position: -84px 0;}
|
||||||
|
.ztree li span.button.center_docu{background-position: -84px -21px;}
|
||||||
|
.ztree li span.button.bottom_docu{background-position: -84px -42px;}
|
||||||
|
.ztree li span.button.noline_docu{ background:none;}
|
||||||
|
|
||||||
|
.ztree li span.button.ico_open{margin-right:2px; background-position: -147px -21px; vertical-align:top; *vertical-align:middle}
|
||||||
|
.ztree li span.button.ico_close{margin-right:2px; margin-right:2px; background-position: -147px 0; vertical-align:top; *vertical-align:middle}
|
||||||
|
.ztree li span.button.ico_docu{margin-right:2px; background-position: -147px -43px; vertical-align:top; *vertical-align:middle}
|
||||||
|
.ztree li span.button.edit {margin-left:2px; margin-right: -1px; background-position: -189px -21px; vertical-align:top; *vertical-align:middle}
|
||||||
|
.ztree li span.button.edit:hover {
|
||||||
|
background-position: -168px -21px;
|
||||||
|
}
|
||||||
|
.ztree li span.button.remove {margin-left:2px; margin-right: -1px; background-position: -189px -42px; vertical-align:top; *vertical-align:middle}
|
||||||
|
.ztree li span.button.remove:hover {
|
||||||
|
background-position: -168px -42px;
|
||||||
|
}
|
||||||
|
.ztree li span.button.add {margin-left:2px; margin-right: -1px; background-position: -189px 0; vertical-align:top; *vertical-align:middle}
|
||||||
|
.ztree li span.button.add:hover {
|
||||||
|
background-position: -168px 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.tmpTargetzTree {background-color:#FFE6B0; opacity:0.8; filter:alpha(opacity=80)}
|
||||||
|
|
||||||
|
span.tmpzTreeMove_arrow {width:16px; height:21px; display: inline-block; padding:0; margin:2px 0 0 1px; border:0 none; position:absolute;
|
||||||
|
background-color:transparent; background-repeat:no-repeat; background-attachment: scroll;
|
||||||
|
background-position:-168px -84px; background-image:url("./img/bootstrap.png");}
|
||||||
|
|
||||||
|
ul.ztree.zTreeDragUL {margin:0; padding:0; position:absolute; width:auto; height:auto;overflow:hidden; background-color:#cfcfcf; border:1px #00B83F dotted; opacity:0.8; filter:alpha(opacity=80)}
|
||||||
|
.ztreeMask {z-index:10000; background-color:#cfcfcf; opacity:0.0; filter:alpha(opacity=0); position:absolute}
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
.ztree li span.button {background-image:url("./img/bootstrap3.png");}
|
||||||
|
span.tmpzTreeMove_arrow {background-image:url("./img/bootstrap3.png");}
|
||||||
|
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
.app-container{width:92px;height:100px;border-radius:2px;margin:10px 15px;cursor:pointer;display:flex;flex-direction:column;text-align:center;justify-content:center;align-items:center;-webkit-user-select:none;user-select:none;transition:background-color .2s ease-in-out}.app-container:hover,.app-container__focus{background-color:#ffffff4d}.app-container a{display:inline-block;width:90%;height:85%}.app-container img{width:60px;height:60px;object-fit:cover;border-radius:18%;display:inline-block}.app-container .app-name{margin-top:2px;color:#fff;font-weight:500;max-width:99%;overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;white-space:nowrap}.app-container__mask{margin-right:40px;margin-bottom:20px}.app-container__mask .app-name{color:#344449}.app-container__mask:hover,.app-container__mask+.app-container__focus{background-color:#ffffff80}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
.header-container{background:transparent;transition:all .3s;box-shadow:0 10px 20px #cbcbcb17;height:var(--appHeaderH);background-color:#577afb;width:100%}.header-container .icon-box{margin:0 24px;cursor:pointer;background-repeat:no-repeat;background-position:30px center;background-size:14px}.header-container .icon-btn{background:transparent;height:24px;width:24px;line-height:24px;box-sizing:border-box;border-radius:2px;transition:all .5s}.header-container .icon-btn i{color:#fff;font-size:22px;font-weight:100}.header-container .icon-btn.active{transform:rotate(90deg)}.header-container .delimiter{width:2px;border-left:1px solid rgba(255,255,255,.5);height:20px}.header-container h4{font-size:19px;color:#fff;margin-left:12px;font-weight:700;font-family:SimSun}.header-container .school-bg{position:absolute;top:0;height:100%;width:100%;left:0;right:0;z-index:-1}.header-container .header-aside{max-width:260px;height:var(--appHeaderH)}.header-container .header-aside img{float:left;width:28px;height:28px;border-radius:50%;cursor:pointer}.header-container .header-aside .name{max-width:90px;color:#fff;margin:0 32px 0 14px}.header-container .header-aside a{outline:none}.header-container .header-aside a:hover{opacity:.8}.header-container .header-aside .logout{padding:5px;margin:0 25px}.header-container .header-aside .logout i{color:#fff;font-size:18px}
|
||||||