Vue3 + Vite + view-ui-plus 前端源码,含流程工作台、实例详情、 任务处理、管理端(定义/实例/映射/回调)等页面。 保留远程 .gitea/workflows/build.yml CI 配置。
This commit is contained in:
@@ -0,0 +1,11 @@
|
|||||||
|
# 开发环境 (dev):仅 vite dev --mode dev 加载;build 产物不读任何 .env.*
|
||||||
|
# (.env.base/.env.ld/.env.prod 已删,线上由 /api/env-config?target=front 运行时下发)。
|
||||||
|
# ⚠️ VITE_* 仅本地开发生效。
|
||||||
|
# API 走 /api 同源相对路径(vite proxy 转发到本地后端 8101),
|
||||||
|
# 规避后端 CAS 过滤器不回 CORS 头导致的跨域拦截;SSO/基础平台用真实环境
|
||||||
|
VITE_BASE_HOST=http://base.yunhaixingtong.com
|
||||||
|
VITE_SSO_HOST=http://sso.yunhaixingtong.com
|
||||||
|
VITE_SERVICE_HOST=
|
||||||
|
VITE_ZIYUANKU_HOST=https://base.bestsch.com/BschZyk
|
||||||
|
VITE_ZHUANXIANG_HOST=https://base.bestsch.com/BschZncpd
|
||||||
|
VITE_IS_MOCK=false
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# 本地纯前端调试模式:仅 vite dev --mode mock 加载(build 产物不读任何 .env.*,
|
||||||
|
# 线上由 /api/env-config?target=front 运行时下发)。后端 SSO/base 不可达时启用内置 mock
|
||||||
|
# 启动:npm run dev:mock
|
||||||
|
VITE_BASE_HOST=
|
||||||
|
VITE_SSO_HOST=
|
||||||
|
VITE_SERVICE_HOST=http://localhost:8101
|
||||||
|
VITE_ZIYUANKU_HOST=
|
||||||
|
VITE_ZHUANXIANG_HOST=
|
||||||
|
VITE_IS_MOCK=true
|
||||||
+29
@@ -0,0 +1,29 @@
|
|||||||
|
# Logs
|
||||||
|
logs
|
||||||
|
*.log
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
pnpm-debug.log*
|
||||||
|
lerna-debug.log*
|
||||||
|
|
||||||
|
node_modules
|
||||||
|
dist
|
||||||
|
dist-ssr
|
||||||
|
*.local
|
||||||
|
|
||||||
|
yarn.lock
|
||||||
|
.npmrc
|
||||||
|
# Editor directories and files
|
||||||
|
.vscode/*
|
||||||
|
!.vscode/extensions.json
|
||||||
|
.idea
|
||||||
|
.DS_Store
|
||||||
|
*.suo
|
||||||
|
*.ntvs*
|
||||||
|
*.njsproj
|
||||||
|
*.sln
|
||||||
|
*.sw?
|
||||||
|
|
||||||
|
# scratch
|
||||||
|
.temp
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
module.exports = {
|
||||||
|
extends: ["airbnb", "prettier", "prettier/react"],
|
||||||
|
singleQuote: false, // 是否强制使用单引号
|
||||||
|
printWidth: 120, // 超过最大值换行
|
||||||
|
tabWidth: 4,
|
||||||
|
htmlWhitespaceSensitivity: "ignore",
|
||||||
|
semi: true, // 结尾是否使用分号
|
||||||
|
//disableLanguages: ["vue"], // 不格式化vue文件,vue文件的格式化单独设置
|
||||||
|
endOfLine: "auto",
|
||||||
|
arrowParens: "avoid", // 箭头函数参数括号 默认avoid 可选 avoid| always
|
||||||
|
};
|
||||||
|
//如需显示webpack目录,运行以下命令
|
||||||
|
// npm run eject
|
||||||
|
//如需配合使eslint生效,运行以下命令
|
||||||
|
//npm install --save-dev eslint-plugin-prettier
|
||||||
@@ -1,3 +1,56 @@
|
|||||||
# flow-center-front
|
# 通知公告前端(Vue3 + Vite + view-ui-plus)
|
||||||
|
|
||||||
managed by projman
|
## 本地启动
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm install
|
||||||
|
```
|
||||||
|
|
||||||
|
### 1)纯前端调试(推荐,后端不可用时)
|
||||||
|
|
||||||
|
本地连不上 `sso.yunhaixingtong.com` / `base.yunhaixingtong.com` 时,后端 CAS 过滤器会拦截
|
||||||
|
`/api/*` 请求导致所有接口失败。此时使用内置 mock 调试前端页面:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run dev:mock
|
||||||
|
```
|
||||||
|
|
||||||
|
- 启用 `src/assets/mock/noticeapi.ts` 中的内存 mock(vite-plugin-mock),覆盖全部页面接口:
|
||||||
|
用户/菜单、发文部门字典、通知增删改查、阅读情况、联系组、选择用户树、附件上传等。
|
||||||
|
- mock 数据为内存态,刷新页面即还原;修改 mock 文件后需重启 dev server 才生效。
|
||||||
|
- mock 模式下请求走 vite 同源(`host.config.ts` 中 `serviceHost` 为空串)。
|
||||||
|
|
||||||
|
### 2)连接后端调试
|
||||||
|
|
||||||
|
```bash
|
||||||
|
npm run dev
|
||||||
|
```
|
||||||
|
|
||||||
|
- `.env.dev`:`VITE_SERVICE_HOST=http://localhost:8070/notice`(Java 后端,见 `../service`)。
|
||||||
|
- 后端需要能访问 CAS(`yh.sso.server-url-prefix`)与用户中心(`yh.open.*`),否则接口 302/失败。
|
||||||
|
|
||||||
|
## 主要页面
|
||||||
|
|
||||||
|
| 路由 | 页面 |
|
||||||
|
| --- | --- |
|
||||||
|
| `/notice/newnotice` | 通知发送(新建/编辑 `?serid=`/转发 `?fid=`,wangeditor 富文本) |
|
||||||
|
| `/notice/notice_list` | 已发通知 |
|
||||||
|
| `/notice/notice_accept` | 已收通知(左列表 + 右详情,打印/转发/附件) |
|
||||||
|
| `/notice/manage` | 通知列表(管理端) |
|
||||||
|
| `/notice/setting` | 应用设置(发文部门卡片 + 自定义组) |
|
||||||
|
| `/notice/notice_details` | 通知详情(`type=0` 管理视角含阅读进度/编辑/打印,`type=1` 查看) |
|
||||||
|
|
||||||
|
## 关键组件
|
||||||
|
|
||||||
|
- `components/UserCheckModal.vue`:选择用户弹窗(组织树勾选 + 已选列表,移植自旧前端
|
||||||
|
`oldfront/src/components/userCheck.vue`)。
|
||||||
|
- `components/UserCheckInput.vue`:通知对象选择(全部用户/指定用户,移植自旧
|
||||||
|
`user_check_input.vue`)。
|
||||||
|
- `components/NoticeUpload.vue`:通知附件上传(选择文件 + 200MB 限制,移植自旧
|
||||||
|
`uploadFile.vue`)。
|
||||||
|
- 发文部门卡片:见 `views/notice/NoticeSetting.vue`,样式与交互对齐 UserBase「应用类型」
|
||||||
|
(`UserBase/front/src/views/app/AppCategory.vue`),额外支持停用/启用。
|
||||||
|
|
||||||
|
## 统计说明
|
||||||
|
|
||||||
|
统计相关前端已按需求移除(`Notice_statis` 接口封装、菜单、图标等),后期统计不在本应用内做。
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
import type { GeneratorConfig } from "@alova/wormhole";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
generator: [
|
||||||
|
{
|
||||||
|
input: "http://localhost:8070/v2/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;
|
||||||
|
}
|
||||||
|
const newOpId = apiDescriptor.summary?.trim() || apiDescriptor.operationId;
|
||||||
|
const url = apiDescriptor.url.replace(/^\/{platform}\//, "/api/");
|
||||||
|
|
||||||
|
return {
|
||||||
|
...apiDescriptor,
|
||||||
|
operationId: newOpId, // 关键:改掉它
|
||||||
|
url: apiDescriptor.url.replace(/^\/{platform}\//, "/api/"),
|
||||||
|
};
|
||||||
|
},
|
||||||
|
},
|
||||||
|
],
|
||||||
|
} as GeneratorConfig;
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
//铃铛debug
|
||||||
|
window.conf = {
|
||||||
|
baseHost: "http://basedebug.bestsch.com",
|
||||||
|
ssoHost: "http://ssodebug.bestsch.com",
|
||||||
|
serviceHost: "http://basedebug.bestsch.com/QualityEvaluate",
|
||||||
|
};
|
||||||
+45
@@ -0,0 +1,45 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh-CN">
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<link rel="icon" type="image/svg+xml" href="../../favicon.ico" />
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
|
<!-- 运行时配置引导:在任何应用模块执行前同步拉取 /<contextPath>/api/env-config
|
||||||
|
(后端免登录端点,projman 配置管理在线维护),替代生产构建环境变量。
|
||||||
|
必须同步:host.config.ts 在模块求值期就读 window.__APP_CONFIG__;失败/本地开发
|
||||||
|
(根路径,段数不足 2)则不设置:本地走 .env.dev/.env.mock(VITE_*),线上走同域推导兜底。
|
||||||
|
target = URL 第 2 段目录名:本应用产物部署于 /{contextPath}/front/,故为 front,
|
||||||
|
对应后端配置键 yh.env-config.source.front(环境变量 YH_ENV_CONFIG_SOURCE_FRONT)。
|
||||||
|
注意:同步 XHR 不支持 timeout 属性(赋值会抛 InvalidAccessError),依赖内网快速失败 -->
|
||||||
|
<script>
|
||||||
|
(function () {
|
||||||
|
try {
|
||||||
|
var seg = location.pathname.split("/").filter(Boolean);
|
||||||
|
if (seg.length < 2) return; // 本地开发(根路径):走 .env.dev / .env.mock
|
||||||
|
var xhr = new XMLHttpRequest();
|
||||||
|
xhr.open("GET", "/" + seg[0] + "/api/env-config?target=" + encodeURIComponent(seg[1]), false);
|
||||||
|
xhr.send(null);
|
||||||
|
if (xhr.status === 200) {
|
||||||
|
var conf = JSON.parse(xhr.responseText);
|
||||||
|
if (conf && typeof conf === "object") window.__APP_CONFIG__ = conf;
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
/* 拉取失败保持未设置,走同域推导兜底 */
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
</script>
|
||||||
|
<title><%- title %></title>
|
||||||
|
<link rel="stylesheet" href="./libs/ztree/zTreeStyle.css" />
|
||||||
|
<script src="./libs/jquery.min.js"></script>
|
||||||
|
<script src="./libs/lodash.min.js"></script>
|
||||||
|
<script src="./libs/ztree/jquery.ztree.all.min.js"></script>
|
||||||
|
<%- injectScript %>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="app"></div>
|
||||||
|
<script type="module" src="/src/main.ts"></script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
Generated
+11279
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,52 @@
|
|||||||
|
{
|
||||||
|
"name": "flow-center",
|
||||||
|
"private": true,
|
||||||
|
"version": "0.0.0",
|
||||||
|
"nodeversion": "20.19.4",
|
||||||
|
"type": "module",
|
||||||
|
"scripts": {
|
||||||
|
"dev": "vite --mode dev",
|
||||||
|
"dev:mock": "vite --mode mock",
|
||||||
|
"build": "vite build --mode base",
|
||||||
|
"build:base": "vite build --mode base",
|
||||||
|
"build:ld": "vite build --mode ld",
|
||||||
|
"build:prod": "vite build --mode prod",
|
||||||
|
"preview": "vite preview",
|
||||||
|
"api:gen": "alova gen -f"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@open-file-viewer/core": "^0.1.43",
|
||||||
|
"@open-file-viewer/vue": "^0.1.43",
|
||||||
|
"@types/lodash": "^4.14.196",
|
||||||
|
"@wangeditor/editor": "^5.1.23",
|
||||||
|
"@wangeditor/editor-for-vue": "^5.1.12",
|
||||||
|
"alova": "^3.4.0",
|
||||||
|
"axios": "^0.24.0",
|
||||||
|
"lodash": "^4.17.21",
|
||||||
|
"mitt": "^3.0.1",
|
||||||
|
"mockjs": "^1.1.0",
|
||||||
|
"pdfjs-dist": "^4.10.38",
|
||||||
|
"pinia": "^2.1.4",
|
||||||
|
"sass": "^1.64.1",
|
||||||
|
"view-ui-plus": "^1.3.16",
|
||||||
|
"vite-plugin-mock": "2.9.6",
|
||||||
|
"vue": "^3.4.19",
|
||||||
|
"vue-router": "4",
|
||||||
|
"vuedraggable": "^4.1.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@alova/wormhole": "^1.5.0",
|
||||||
|
"@types/node": "^20.4.4",
|
||||||
|
"@unocss/preset-rem-to-px": "^66.6.0",
|
||||||
|
"@unocss/preset-uno": "^66.6.0",
|
||||||
|
"@vitejs/plugin-vue": "^5.0.4",
|
||||||
|
"fast-glob": "^3.3.2",
|
||||||
|
"typescript": "^5.2.2",
|
||||||
|
"unocss": "^66.6.0",
|
||||||
|
"unplugin-auto-import": "0.18.3",
|
||||||
|
"vite": "^5.1.4",
|
||||||
|
"vite-plugin-html": "^3.2.2",
|
||||||
|
"vite-plugin-svg-icons": "^2.0.1",
|
||||||
|
"vue-tsc": "^1.8.27"
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,3 @@
|
|||||||
|
àRCopyright 1990-2009 Adobe Systems Incorporated.
|
||||||
|
All rights reserved.
|
||||||
|
See ./LICENSEáCNS2-H
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,3 @@
|
|||||||
|
àRCopyright 1990-2009 Adobe Systems Incorporated.
|
||||||
|
All rights reserved.
|
||||||
|
See ./LICENSEá ETen-B5-H` ^
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,4 @@
|
|||||||
|
àRCopyright 1990-2009 Adobe Systems Incorporated.
|
||||||
|
All rights reserved.
|
||||||
|
See ./LICENSE!!�º]aX!!]`�21�> �p�z�$]‚�"R‚d�-Uƒ7�*„
4„%�+ „Z „{�/…%…<�9K…b�1]†.�"‡‰`]‡,�"]ˆ
|
||||||
|
�"]ˆh�"]‰F�"]Š$�"]‹�"]‹`�"]Œ>�"]��"]�z�"]ŽX�"]�6�"]��"]�r�"]‘P�"]’.�"]“�"]“j�"]”H�"]•&�"]–�"]–b�"]—@�"]˜�"]˜|�"]™Z�"]š8�"]›�"]›t�"]œR�"]�0�"]ž�"]žl�"]ŸJ�"] (�"]¡�"]¡d�"]¢B�"]£ �"X£~�']¤W�"]¥5�"]¦�"]¦q�"]§O�"]¨-�"]©�"]©i�"]ªG�"]«%�"]¬�"]¬a�"]?�"]®�"]®{�"]¯Y�"]°7�"]±�"]±s�"]²Q�"]³/�"]´
�"]´k�"]µI�"]¶'�"]·�"]·c�"]¸A�"]¹�"]¹}�"]º[�"]»9
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user