Compare commits
288 Commits
master
...
frontend_1
| Author | SHA1 | Date |
|---|---|---|
|
|
ad7aa82afc | |
|
|
dce74b065b | |
|
|
6f1bed50de | |
|
|
279e6f861b | |
|
|
9b16e92277 | |
|
|
70332d353c | |
|
|
c81faba391 | |
|
|
a14993e1b8 | |
|
|
86fe86d72d | |
|
|
9cc5c64fee | |
|
|
054c0a1789 | |
|
|
d4e33c4fd3 | |
|
|
467e7f74d5 | |
|
|
73cacea552 | |
|
|
a249239e77 | |
|
|
415b9b3e46 | |
|
|
625519c2c2 | |
|
|
6e6d29511c | |
|
|
43fc48a3a5 | |
|
|
87a3901694 | |
|
|
2d5cffb78e | |
|
|
0b693760df | |
|
|
a9ed35793a | |
|
|
0106da0c29 | |
|
|
2c6547f5ec | |
|
|
4e4792459c | |
|
|
aba73af268 | |
|
|
34e9047763 | |
|
|
e3d77525dd | |
|
|
818454311f | |
|
|
4d911c93ae | |
|
|
934b2990f1 | |
|
|
6d4923ac8b | |
|
|
2913740e36 | |
|
|
3883b75b3b | |
|
|
300c1f63b2 | |
|
|
4b2e8538b1 | |
|
|
cabdd4c531 | |
|
|
3d94027618 | |
|
|
972d121580 | |
|
|
239009a59b | |
|
|
4bd4fae390 | |
|
|
40f40baf5e | |
|
|
c10a81f271 | |
|
|
f3f7a99b10 | |
|
|
09fb371292 | |
|
|
61ba3c9680 | |
|
|
d0d6919b11 | |
|
|
9ee56a83a7 | |
|
|
954be37aa4 | |
|
|
79010a0f36 | |
|
|
134ca89b9a | |
|
|
eb1f4fb7b3 | |
|
|
348eb137a8 | |
|
|
c440cb0357 | |
|
|
a5b4446202 | |
|
|
d55fc11e24 | |
|
|
3b84d8d87c | |
|
|
1545771196 | |
|
|
2aaccc1193 | |
|
|
0c451fcbed | |
|
|
3b41b6b3d3 | |
|
|
015ba6da70 | |
|
|
c246975914 | |
|
|
8c2ecc89c8 | |
|
|
5fb2faecdc | |
|
|
671bbd5692 | |
|
|
8acc68141d | |
|
|
71e8eb1e37 | |
|
|
7597a444b9 | |
|
|
d01a1faa1a | |
|
|
c27bfd26cf | |
|
|
11cdcdb83c | |
|
|
802b169818 | |
|
|
341000a3b0 | |
|
|
a1748ed05b | |
|
|
1c601a908e | |
|
|
8bab6d7d17 | |
|
|
02f4c47383 | |
|
|
ea52bec18d | |
|
|
3584c72284 | |
|
|
ee84487fe0 | |
|
|
8aa2b92fa6 | |
|
|
6bb9738dc5 | |
|
|
e992a62a5b | |
|
|
5749d20c80 | |
|
|
a7e4d9c1f4 | |
|
|
f68242d2e7 | |
|
|
98b9097ff2 | |
|
|
475229295a | |
|
|
73a7f6d6ca | |
|
|
2fdbafa0c3 | |
|
|
d9effe68c0 | |
|
|
00f91b394a | |
|
|
1e96076576 | |
|
|
66d315069c | |
|
|
af74c4033d | |
|
|
1aa1e592af | |
|
|
cca2215a60 | |
|
|
626d1f1b09 | |
|
|
d6b41e7cb2 | |
|
|
8be71600a2 | |
|
|
1735901ffe | |
|
|
27ac07ad0a | |
|
|
c2bbeb7cdc | |
|
|
4bdbc1daf7 | |
|
|
ae727d0fdd | |
|
|
515abca80f | |
|
|
773f400add | |
|
|
b274c5e4af | |
|
|
af6d748b86 | |
|
|
fd5a2e60e4 | |
|
|
ce4044bf8c | |
|
|
53b84e0c9b | |
|
|
c410d4e2e3 | |
|
|
f7516a9ffe | |
|
|
778f855ee9 | |
|
|
feb99bb10e | |
|
|
b7067082ed | |
|
|
9a8fe13f28 | |
|
|
4ac353a83a | |
|
|
7f39e3029f | |
|
|
086af70f22 | |
|
|
0e96989aaa | |
|
|
9fd0d3caf4 | |
|
|
6328264f90 | |
|
|
2ebd64ab41 | |
|
|
6a26d412c4 | |
|
|
504379f3e3 | |
|
|
81c561d28a | |
|
|
8784a143f1 | |
|
|
9439b82081 | |
|
|
e036fe7e10 | |
|
|
7ffd5135cc | |
|
|
f03fc06949 | |
|
|
4d8e4fa01d | |
|
|
980a8147ce | |
|
|
60a9bdab2e | |
|
|
e9c73d1925 | |
|
|
6f3b51f461 | |
|
|
5eec808514 | |
|
|
9e8edf01b8 | |
|
|
baae63153a | |
|
|
9a491ab1c7 | |
|
|
1f86f382df | |
|
|
7a7b549de3 | |
|
|
9b90d44e34 | |
|
|
c66bdbcc74 | |
|
|
4b7021b45e | |
|
|
3d2266f4a1 | |
|
|
2fae492f2b | |
|
|
5ac798c295 | |
|
|
61143a39f7 | |
|
|
9d067ab748 | |
|
|
1860ac322e | |
|
|
50855a68ce | |
|
|
53d900ca22 | |
|
|
6280850e30 | |
|
|
96ede9b575 | |
|
|
a7e0598951 | |
|
|
487bf5e0c6 | |
|
|
93053025a2 | |
|
|
5409a3c225 | |
|
|
c39ed025b9 | |
|
|
af221e4486 | |
|
|
0f656cfed6 | |
|
|
6b62162e8d | |
|
|
2373b13fc6 | |
|
|
4cc420799e | |
|
|
48bad8a9a6 | |
|
|
adae1ab595 | |
|
|
7bcc08ff0e | |
|
|
6b9263ca1b | |
|
|
8abca803f9 | |
|
|
983780b73b | |
|
|
04b59e281a | |
|
|
9f11895847 | |
|
|
d1910e2497 | |
|
|
268c56e7ce | |
|
|
e251f3fccb | |
|
|
abcd3c1c6f | |
|
|
4b8cd8b9e8 | |
|
|
aff3016e4f | |
|
|
115394106a | |
|
|
ddcde9e1da | |
|
|
6f072b97c9 | |
|
|
ab03f70fd6 | |
|
|
c759c8bc55 | |
|
|
e298748d45 | |
|
|
e04b80ff25 | |
|
|
830fde4bc0 | |
|
|
7ff9552621 | |
|
|
6776fe3f0d | |
|
|
e2f9e0e393 | |
|
|
7d8ad420e4 | |
|
|
356fc1995e | |
|
|
d9da314968 | |
|
|
3951ef325d | |
|
|
a7f7a29d74 | |
|
|
50ee54d6ef | |
|
|
701d90779a | |
|
|
61b10eba26 | |
|
|
45f69d527e | |
|
|
a56d750f2d | |
|
|
aa2efbd42e | |
|
|
6bed84cf3e | |
|
|
330f2f7d54 | |
|
|
b96d006f9c | |
|
|
baa4b52553 | |
|
|
dd2a7d99b6 | |
|
|
e1643a6331 | |
|
|
5f6f014226 | |
|
|
b3e5568216 | |
|
|
cc29006013 | |
|
|
db343353cc | |
|
|
01cd03213e | |
|
|
31a8de5569 | |
|
|
ec3e34ad21 | |
|
|
0d14477705 | |
|
|
74ed165f71 | |
|
|
f2cbf8f9cb | |
|
|
5485a827be | |
|
|
0dfdeee19d | |
|
|
d1e23c58ef | |
|
|
7a6abccf2f | |
|
|
602d06aafc | |
|
|
59b045d457 | |
|
|
97bcc1ac0a | |
|
|
b1cbbec237 | |
|
|
4ce68abe84 | |
|
|
3102a2c0a0 | |
|
|
357410c3e7 | |
|
|
a4ce1ba45a | |
|
|
7db1b6ed37 | |
|
|
4238f345cb | |
|
|
caec1d4bd0 | |
|
|
695c77ca60 | |
|
|
f0294212b2 | |
|
|
f992b2b29e | |
|
|
5583bb0f11 | |
|
|
47879d029a | |
|
|
5ead2c13b2 | |
|
|
389deac133 | |
|
|
b21c54a901 | |
|
|
e767c6aa50 | |
|
|
8ea80a4dbe | |
|
|
fb3f3c721e | |
|
|
d3bbf2da62 | |
|
|
693899f45c | |
|
|
fe2791f815 | |
|
|
54e7d394bb | |
|
|
6ec773ce3d | |
|
|
0774e81fd0 | |
|
|
1111d285c5 | |
|
|
c257cdc5cd | |
|
|
1d85e92997 | |
|
|
e7ed169f94 | |
|
|
9be3b62aaf | |
|
|
6c3f344b92 | |
|
|
ed90f7ce87 | |
|
|
f79150abc9 | |
|
|
8d6ca0b64f | |
|
|
6613b3612c | |
|
|
af12674d7b | |
|
|
7c46ae5db4 | |
|
|
56d79e96b6 | |
|
|
995f7f8b03 | |
|
|
2cf2fdff08 | |
|
|
dc1f5f7302 | |
|
|
49cd27c221 | |
|
|
a4a93ee484 | |
|
|
c940880a9d | |
|
|
3e45254fc1 | |
|
|
a19909d1bf | |
|
|
2f51b56298 | |
|
|
4cc2d3beb1 | |
|
|
ed9fda7fe3 | |
|
|
bd830115d4 | |
|
|
a9142c0e1b | |
|
|
d3c4776bab | |
|
|
a1ea52a934 | |
|
|
05865dc2ef | |
|
|
30d551fe59 | |
|
|
333b5e1a8e | |
|
|
94348aebc4 | |
|
|
1d842d3bf2 | |
|
|
1bdc88cd7c | |
|
|
1a4f64865a |
|
|
@ -35,6 +35,8 @@ nbbuild/
|
|||
dist/
|
||||
nbdist/
|
||||
.nb-gradle/
|
||||
.DS_Store
|
||||
*.png
|
||||
|
||||
######################################################################
|
||||
# Others
|
||||
|
|
|
|||
|
|
@ -0,0 +1,52 @@
|
|||
# 2026-09-08
|
||||
|
||||
## 代码 review(两轮)
|
||||
|
||||
用户要求只 review 不改代码。范围:工作区 53 个改动文件(Java 后端 + Vue 前端)。
|
||||
|
||||
### 改动主体
|
||||
- Excel 注解新增 `decimalFormat` 字段(Excel.java + ExcelUtil.java),21 个 domain 的 BigDecimal 字段加 `@Excel(scale=2, decimalFormat="#,##0.00")`,仅影响导出显示,安全。
|
||||
- 前端多处 `toFixed(2)` → 全局 `formatCurrency`(main.js 已注册 Vue.prototype),安全。
|
||||
- ProductInfo/Mapper/前端新增 `pre_system_type`(预装系统类型)字段,前后端配套完整,配套 SQL:`sql/20290904update.sql`(文件名年份疑为笔误,写的是 2029)。
|
||||
- `OmsInventoryInnerServiceImpl.insertOmsInventoryInner` 应付单生成逻辑重构(核心风险点)。
|
||||
|
||||
### 第一轮发现的问题 → 用户修复后第二轮复核结果
|
||||
1. NPE(quantity/price 为 null 时直接 multiply)→ 已修:`usePurchaseOrder` 条件含 null 检查,null 时回退原公式 ✓
|
||||
2. 重复 setTaxAmount(新旧两行并存)→ 已清理,只留正确行(含税-未税)✓
|
||||
3. vendorInfo 为 null 时 getPayConfigDay() NPE → 已修,传 0 ✓
|
||||
4. 遗留:`vendorInfo != null ? vendorInfo.getPayConfigDay() : 0` 三元混合 Integer/int,payConfigDay 为 null 时仍会拆箱 NPE(原代码同样会炸,非回归)
|
||||
5. 遗留:ExcelUtil 每单元格 createCellStyle,POI 上限 64000 样式,大数据量导出会失败
|
||||
6. 遗留:OrderList.java 文件末尾无换行;oms_web/.DS_Store 未跟踪垃圾文件
|
||||
|
||||
### 业务逻辑一致性结论(H3C 判定)
|
||||
- 新华三(isH3C=true,startsWith("新华三")):条件退化为原条件,金额公式走原逻辑,与原 100% 一致
|
||||
- 非新华三无采购单:innerComplete 默认 true,与原一致
|
||||
### 第三轮复核(用户又修复了一批)
|
||||
1. 三元拆箱 NPE → 已修:`vendorInfo != null && vendorInfo.getPayConfigDay() != null ? ... : 0` ✓
|
||||
2. ExcelUtil CellStyle → 已修:新增 `moneyStyles` Map 缓存(按 decimalFormat 键),HashMap 已导入,ExcelUtil 每次 export 新建实例,缓存作用域正确 ✓
|
||||
3. OrderList.java 末尾换行 → 已补 ✓
|
||||
仍遗留(非代码 bug,提交时注意):isH3C 口径需业务确认(startsWith("新华三"),基于 ProductInfo.vendorName);sql/20290904update.sql 文件名年份笔误(2029);oms_web/.DS_Store 与 ruoyi-admin/.DS_Store 垃圾文件。
|
||||
至此所有代码级问题均已修复,H3C/无采购单场景与原逻辑一致,非新华三+有采购单为有意业务变更。
|
||||
|
||||
### 金额格式统一专项检查(第四轮,只查不改)
|
||||
**统一现状**:全局 formatCurrency(utils/index.js:17,main.js:46 注册,null→'0.00',toLocaleString en-US 2位小数);本次 diff 新增 72 处 formatCurrency(27 个文件);后端 21 个 domain 106 个 @Excel 字段加 decimalFormat。
|
||||
|
||||
**后端 Excel 遗漏**:OmsTicketBill.java:70 taxAmount(税额,活动注解,其余单据均已加)。比率类(taxRate×4、planRate×2、invoiceRate、receiptRate)未加属合理;折扣类(OrderList.discount、ProjectOrderConfigInfo.guidanceDiscount/discount)需确认语义。
|
||||
|
||||
**前端遗漏**:ApplyInvoice.vue:122/129/143 v-else 分支裸显示 unitPrice/amount/taxAmount;writeoff 两 index 的 $modal 提示文案 5 处无千分位(轻微);formatCurrency(x.toFixed(2)) 双重格式化 ~12 处(冗余无害)。
|
||||
|
||||
**体系性发现**:项目存在 7+ 处组件局部 formatAmount/formatAmountNumber 副本(均为存量,非本次新增):purchaseorder/index.vue:589、orderFinance.vue:377(filters)、base/quotation/index.vue:535、ProductConfig.vue:497、approve/all/index.vue:1295(用zh-CN)、projectTransfer.vue:293、project/info/index.vue:491 等。差异:局部版 null→'',全局版 null→'0.00'。后续统一建议收敛到全局 formatCurrency,先定 null 显示口径。
|
||||
|
||||
**formatCurrency 边界**:非数字字符串入参会显示 "NaN"(Number('abc').toLocaleString → "NaN"),建议加 Number.isNaN 保护。convertCurrency(大写金额)依赖 toFixed 字符串,InvoiceInfoView:115 / ApplyInvoice:278 / invoiceExcelUtils.js:147 的 toFixed(2) 必须保留,不是遗漏。
|
||||
|
||||
### 第五轮:全量改动集成测试(mvn 编译 + vue 解析)
|
||||
**Maven 全量编译**(JAVA_HOME=Corretto 8):7 模块 SUCCESS,0 ERROR。Lombok、@Excel 注解、mapper SQL、Service 实现全部对齐。
|
||||
**前端 31 文件 SFC/JS 解析**:用 @vue/compiler-sfc 批量 parse,0 失败(PaymentRefundDetail、ReceiptDetail、ReceivableInvoiceDetail、ApplyInvoice、InvoiceInfoView、EditForm×2、AddForm、receipt/index、writeoff 6 个文件、inventory/inner、ProductConfig、ProjectForm、project/info/index、OrderDetail、PurchaseOrderDetail、PurchaseOrderDetailView、PurchaseOrderSelectDialog、vendorConfirm、system/product、approve/purchaase×2、selectQuotation、projectTransfer、invoiceExcelUtils.js)。
|
||||
|
||||
**本轮新增发现的位置**(前几轮未深查):
|
||||
- ruoyi-admin/logback.xml:把 jiliu 路径换成 kangwenjing 个人本地路径,纯个人配置切换,不影响代码(提交前建议恢复或加 .gitignore 排除)。
|
||||
- dto/InventoryInfoExcelDto.java、dto/warehouse/WarehouseInnerExcelDto.java:innerPrice 加 decimalFormat,已正确 ✓
|
||||
- approve/purchaase/{approve,approved}/index.vue:含税总金额列加 formatter ✓
|
||||
- base/quotation/selectQuotation.vue:discountAmount 加 formatter,字段名语义为"报价金额"(QuotationInfo 表的折扣后金额),没问题 ✓
|
||||
- system/product/index.vue:queryParams 已在 data() 初始声明 preSystemType: null ✓;resetForm 依赖表单模板自动重置 ✓;handleTypeChange 在切换非硬件时清空 preSystemType ✓
|
||||
- OmsTicketBill.java:70 税额仍**漏** decimalFormat(连续两轮没修)。
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
# 2026-09-09 工作日志
|
||||
|
||||
## 全量改动复核 + 集成测试(不动代码)
|
||||
|
||||
**改动规模**:65 文件、+427 / -283 行
|
||||
|
||||
**集成测试结果**:
|
||||
- 后端:`mvn compile -DskipTests`(JAVA_HOME=Corretto 1.8.0_442) → **BUILD SUCCESS**,7 模块 0 ERROR
|
||||
- 前端:31 个 Vue/JS 文件用 `@vue/compiler-sfc` 解析 → **31 ok, 0 fail**
|
||||
|
||||
**本轮发现**:
|
||||
1. `OmsTicketBill.java:70` 税额已加 `decimalFormat = "#,##0.00"`(用户修复)
|
||||
2. SQL 文件名 `20290904` → `20260904`(已改),但文件内注释仍写 `2029-09-04`
|
||||
3. `.gitignore` 已加 `.DS_Store`(用户修复)
|
||||
4. `ruoyi-admin/.DS_Store` 仍被 `git ls-files` 跟踪,需 `git rm --cached` 才能彻底忽略
|
||||
|
||||
**确认正确的覆盖**:
|
||||
- `inventory/inner/index.vue`、`vendorConfirm.vue` — 本次新加 formatter 没问题
|
||||
- `InventoryInfoExcelDto.java`、`WarehouseInnerExcelDto.java` — 入库价已加 decimalFormat
|
||||
- `ProductInfo.java` + `ProductInfoMapper.xml` — preSystemType 字段前后端完整配套
|
||||
- `OmsInventoryInnerServiceImpl.java` — 三处修复(NPE、payConfigDay 拆箱、税金额)均正确
|
||||
|
||||
**仍未修的小遗留**:
|
||||
- `ApplyInvoice.vue:122/129/143` v-else 裸显示(用户上一轮已知,影响小)
|
||||
- 14 处 `formatCurrency(x.toFixed(2))` 双重格式化(冗余但正确)
|
||||
- 7+ 处局部 `formatAmount/formatAmountNumber` 副本(存量代码,本次未改)
|
||||
|
||||
**体系性问题(与本次改动范围无关)**:
|
||||
- 项目里 7+ 处组件局部的 `formatAmount` 副本,行为与全局 `formatCurrency` 略有差异(null 显示空 vs '0.00'),建议后续收敛
|
||||
- `formatCurrency('abc')` 会显示 "NaN",建议加 `Number.isNaN` 保护
|
||||
|
||||
**提交前清单**:
|
||||
- [ ] 修 `sql/20260904update.sql` 注释里的 `2029-09-04` → `2026-09-04`
|
||||
- [ ] `git rm --cached ruoyi-admin/.DS_Store`(.gitignore 已加,但已跟踪文件需手动移除)
|
||||
- [ ] 可选:`git checkout ruoyi-admin/src/main/resources/logback.xml` 恢复个人本地路径
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,70 @@
|
|||
-- =====================================================================
|
||||
-- MCP 只读数据工具 —— 索引脚本(对应方案第 6 章 / 16.4)
|
||||
-- 适用:MySQL 8.0+
|
||||
--
|
||||
-- 【2026-09-23 实测更新】在 oms_test 上核对 information_schema 后发现:
|
||||
-- • P0-1 oms_inventory_outer.idx_outer_code(outer_code) —— 已存在,无需执行
|
||||
-- • P0-2 oms_inventory_outer_detail.idx_outer_code(outer_code) —— 已存在,无需执行
|
||||
-- • P1-1 oms_inventory_inner.idx_order_code(order_code) —— 已存在,无需执行
|
||||
-- • P1-2 oms_purchase_order.idx_vendor_id(vendor_id) —— 已存在,无需执行
|
||||
-- • P1-3 oms_inventory_info 覆盖索引 —— 缺失,已在 oms_test 执行并实测收益
|
||||
-- (建索引耗时 1.3s;按产品聚合 141.8ms → 66.6ms;EXPLAIN 显示 Using index,免回表)
|
||||
--
|
||||
-- 因此本脚本默认全部注释,仅作为「生产执行前的核对与补建」清单使用。
|
||||
-- 执行前请先跑文末的核对语句,确认目标索引是否缺失。
|
||||
-- =====================================================================
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- P0 必加(inventory_flow 出库链路依赖;若缺失将导致按出库单号全表扫描)
|
||||
-- 实测:oms_test 已存在
|
||||
-- ---------------------------------------------------------------------
|
||||
-- ALTER TABLE oms_inventory_outer ADD INDEX idx_outer_code (outer_code), ALGORITHM=INPLACE, LOCK=NONE;
|
||||
-- ALTER TABLE oms_inventory_outer_detail ADD INDEX idx_outer_code (outer_code), ALGORITHM=INPLACE, LOCK=NONE;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- P1 建议
|
||||
-- 实测:P1-1 / P1-2 在 oms_test 已存在
|
||||
-- ---------------------------------------------------------------------
|
||||
-- ALTER TABLE oms_inventory_inner ADD INDEX idx_order_code (order_code), ALGORITHM=INPLACE, LOCK=NONE;
|
||||
-- ALTER TABLE oms_purchase_order ADD INDEX idx_vendor_id (vendor_id), ALGORITHM=INPLACE, LOCK=NONE;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- P1-3 覆盖索引(库存聚合免回表)
|
||||
-- 实测收益显著;但存在写入放大(每次 insert/update 需维护 4 列索引),
|
||||
-- 生产库请由 DBA 结合写入量评估后再执行;回滚语句见文末。
|
||||
-- oms_test 已于 2026-09-23 执行。
|
||||
-- ---------------------------------------------------------------------
|
||||
-- ALTER TABLE oms_inventory_info
|
||||
-- ADD INDEX idx_pc_status_amt (product_code, inventory_status, inner_price, outer_price),
|
||||
-- ALGORITHM=INPLACE, LOCK=NONE;
|
||||
|
||||
-- ---------------------------------------------------------------------
|
||||
-- P2 按表规模触发(当前数据量下无需执行;表增长到 10 万+ 或成为热点时再补)
|
||||
-- 完整编号清单见方案 6.3 节(P2-1 ~ P2-26,其中 P2-3/P2-4/P2-19 已作废)
|
||||
-- ---------------------------------------------------------------------
|
||||
-- ALTER TABLE oms_purchase_order_map ADD INDEX idx_order_id (order_id), ALGORITHM=INPLACE, LOCK=NONE;
|
||||
-- ALTER TABLE oms_purchase_order_map ADD INDEX idx_purchase_id (purchase_id), ALGORITHM=INPLACE, LOCK=NONE;
|
||||
-- ALTER TABLE oms_inventory_info ADD INDEX idx_warehouse_id (warehouse_id), ALGORITHM=INPLACE, LOCK=NONE;
|
||||
-- ALTER TABLE oms_stock_info ADD INDEX idx_order_code (order_code), ALGORITHM=INPLACE, LOCK=NONE;
|
||||
-- ALTER TABLE oms_receivable_receipt_detail ADD INDEX idx_write_off_id (write_off_id), ALGORITHM=INPLACE, LOCK=NONE;
|
||||
-- ALTER TABLE oms_payable_payment_detail ADD INDEX idx_write_off_id (write_off_id), ALGORITHM=INPLACE, LOCK=NONE;
|
||||
-- ALTER TABLE bu_todo_completed ADD INDEX idx_approve_user_time (approve_user, approve_time), ALGORITHM=INPLACE, LOCK=NONE;
|
||||
|
||||
-- =====================================================================
|
||||
-- 执行前核对:列出目标表当前索引(若目标索引已出现则无需再建)
|
||||
-- =====================================================================
|
||||
-- SELECT table_name, index_name, GROUP_CONCAT(column_name ORDER BY seq_in_index) AS cols
|
||||
-- FROM information_schema.statistics
|
||||
-- WHERE table_schema = DATABASE()
|
||||
-- AND table_name IN ('oms_inventory_outer','oms_inventory_outer_detail','oms_inventory_inner',
|
||||
-- 'oms_purchase_order','oms_inventory_info')
|
||||
-- GROUP BY table_name, index_name;
|
||||
|
||||
-- =====================================================================
|
||||
-- 回滚(仅在需要撤销新增索引时执行)
|
||||
-- =====================================================================
|
||||
-- ALTER TABLE oms_inventory_outer DROP INDEX idx_outer_code, ALGORITHM=INPLACE, LOCK=NONE;
|
||||
-- ALTER TABLE oms_inventory_outer_detail DROP INDEX idx_outer_code, ALGORITHM=INPLACE, LOCK=NONE;
|
||||
-- ALTER TABLE oms_inventory_inner DROP INDEX idx_order_code, ALGORITHM=INPLACE, LOCK=NONE;
|
||||
-- ALTER TABLE oms_purchase_order DROP INDEX idx_vendor_id, ALGORITHM=INPLACE, LOCK=NONE;
|
||||
-- ALTER TABLE oms_inventory_info DROP INDEX idx_pc_status_amt, ALGORITHM=INPLACE, LOCK=NONE;
|
||||
|
|
@ -0,0 +1,139 @@
|
|||
你是一个资深 Java 后端工程师,请在当前 Spring Boot(Java8)项目中实现一个完整的 MCP Server,并加入“AI 自动选 Tool(RAG + Tool Routing)”能力。
|
||||
|
||||
# 一、基础 MCP 能力(必须实现)
|
||||
|
||||
1. 提供统一入口:
|
||||
POST /mcp
|
||||
|
||||
2. 实现 JSON-RPC 2.0:
|
||||
|
||||
* initialize
|
||||
* tools/list
|
||||
* tools/call
|
||||
|
||||
3. 返回格式:
|
||||
{
|
||||
"jsonrpc": "2.0",
|
||||
"id": "...",
|
||||
"result": ...
|
||||
}
|
||||
|
||||
# 二、流式能力(必须)
|
||||
|
||||
1. 禁止使用 SseEmitter
|
||||
2. 使用 HttpServletResponse + OutputStream
|
||||
3. 实现 chunked streaming(write + flush)
|
||||
|
||||
# 三、Tool 注册中心(必须)
|
||||
|
||||
实现:
|
||||
|
||||
* McpToolRegistry
|
||||
* register / get / list
|
||||
|
||||
Tool结构:
|
||||
|
||||
* name
|
||||
* description(非常重要,用于向量检索)
|
||||
* inputSchema
|
||||
* handler
|
||||
|
||||
# 四、RAG Tool 检索模块(新增重点)
|
||||
|
||||
实现一个 ToolRetriever 组件:
|
||||
|
||||
1. 构建向量索引(简化实现):
|
||||
|
||||
* 使用内存存储 List<ToolEmbedding>
|
||||
* ToolEmbedding:
|
||||
|
||||
* toolName
|
||||
* description
|
||||
* embedding(double[])
|
||||
|
||||
2. 提供方法:
|
||||
List<McpTool> retrieve(String query, int topK)
|
||||
|
||||
3. embedding 实现(简化):
|
||||
|
||||
* 可使用:
|
||||
|
||||
* 简单 TF-IDF
|
||||
* 或 mock embedding(字符串相似度)
|
||||
* 不依赖外部服务(保证可运行)
|
||||
|
||||
# 五、Tool Router(核心)
|
||||
|
||||
实现 ToolRouter:
|
||||
|
||||
流程:
|
||||
|
||||
1. 接收用户问题 query
|
||||
2. 调用 ToolRetriever → 获取 topK tools
|
||||
3. 构建 prompt(只包含候选 tools)
|
||||
4. 返回候选 tools 给上层(或直接选)
|
||||
|
||||
要求:
|
||||
|
||||
* 不允许返回全部 tools
|
||||
* 默认 topK = 3~5
|
||||
|
||||
# 六、tools/call 升级(关键)
|
||||
|
||||
当 method = tools/call 时:
|
||||
|
||||
1. 如果请求未指定 tool:
|
||||
|
||||
* 自动触发 ToolRouter
|
||||
* 选出最优 tool
|
||||
|
||||
2. 如果指定 tool:
|
||||
|
||||
* 直接执行
|
||||
|
||||
# 七、默认内置工具
|
||||
|
||||
实现:
|
||||
|
||||
1. hello
|
||||
输入:name
|
||||
输出:hello xxx
|
||||
|
||||
2. meeting.summary
|
||||
输入:text
|
||||
输出:模拟总结
|
||||
|
||||
# 八、架构分层(必须)
|
||||
|
||||
* controller
|
||||
* service
|
||||
* registry
|
||||
* retriever(新增)
|
||||
* router(新增)
|
||||
|
||||
# 九、扩展能力(必须预留)
|
||||
|
||||
1. 支持替换为真实向量数据库(如 Milvus / ES)
|
||||
2. 支持 embedding API(OpenAI / 本地模型)
|
||||
3. 支持多 MCP Server(未来扩展)
|
||||
|
||||
# 十、输出要求
|
||||
|
||||
1. 输出完整代码:
|
||||
|
||||
* McpController
|
||||
* McpService
|
||||
* McpToolRegistry
|
||||
* ToolRetriever
|
||||
* ToolRouter
|
||||
* ToolEmbedding
|
||||
* ToolInitializer
|
||||
* McpRequest
|
||||
|
||||
2. 代码必须:
|
||||
|
||||
* 可运行
|
||||
* 无伪代码
|
||||
* 包含必要注释
|
||||
* 代码生成目录在ruoyi-sip/src/main/java/com/ruoyi/sip/llm
|
||||
3. 不要解释,只输出代码
|
||||
|
|
@ -6,3 +6,4 @@ ENV = 'production'
|
|||
|
||||
# 若依管理系统/生产环境
|
||||
VUE_APP_BASE_API = '/prod-api'
|
||||
VUE_APP_SERVICE_HOST = 'wb.oms.unisspace.com'
|
||||
|
|
|
|||
|
|
@ -0,0 +1,219 @@
|
|||
# oms_vue 前端设计体系迁移:sub2api
|
||||
|
||||
本次重构把 `sub2api/frontend` 的设计体系移植进 `oms_vue`(Vue 2.6 + Element UI 2.15 + vue-cli 4),
|
||||
让若依原生的 190+ 个页面统一换上 sub2api 的视觉语言,并提供一套可直接使用的 `Ui*` 组件。
|
||||
|
||||
## 为什么不整体换成 Vue 3 + Vite
|
||||
|
||||
`sub2api/frontend` 是 Vue 3 + Vite + TypeScript + Tailwind,`oms_vue` 是 Vue 2.6 + webpack 4 +
|
||||
Element UI,且 vue-cli 4 依赖 PostCSS 7(Tailwind 3 需要 PostCSS 8)。在 194 个业务页面、
|
||||
后端动态菜单/字典/权限体系不变的前提下整体换栈,收益不抵风险。因此采用
|
||||
**「设计系统等价移植」**:颜色、圆角、阴影、字体、间距、动效全部按 sub2api 的
|
||||
`tailwind.config.js` + `src/style.css` 逐条落成 SCSS 与 CSS 变量,组件按 sub2api 的
|
||||
实现改写为 Vue 2 SFC。视觉结果与 sub2api 一致,业务代码无需换栈。
|
||||
|
||||
## 文件结构
|
||||
|
||||
| 文件 | 作用 |
|
||||
| --- | --- |
|
||||
| `src/assets/styles/tokens-vars.scss` | 设计令牌(纯 SCSS 变量 `$s2-*`),供各 SFC 引入 |
|
||||
| `src/assets/styles/tokens.scss` | 把令牌导出为运行时 CSS 变量 `--s2-*` |
|
||||
| `src/assets/styles/sub2api.scss` | sub2api `style.css` 的组件类(`.s2-btn` / `.s2-card` / `.s2-badge` / `.s2-dialog` …) |
|
||||
| `src/assets/styles/element-variables.scss` | Element UI 编译期主题(蓝色主色 #1890ff、12px 圆角、slate 文字) |
|
||||
| `src/assets/styles/element-overrides.scss` | Element UI 运行期覆盖(按钮渐变、卡片圆角、表格 hover、分页胶囊…) |
|
||||
| `src/assets/styles/sidebar.scss` | sub2api 风格侧边栏(白底 + 圆角胶囊选中态) |
|
||||
| `src/components/ui/` | 从 sub2api 移植的 Vue 2 组件集,`main.js` 里全局注册为 `Ui*` |
|
||||
|
||||
在 SFC 里要用 SCSS 令牌时,样式块首行加:
|
||||
|
||||
```scss
|
||||
<style lang="scss" scoped>
|
||||
@import '~@/assets/styles/tokens-vars.scss';
|
||||
```
|
||||
|
||||
> 说明:曾尝试用 `vue.config.js` 的 `sass.additionalData` 全局注入,vue-cli 4 + sass-loader 10
|
||||
> 下会导致所有 SCSS 报解析错误,因此改为各文件显式引入(与仓库既有写法一致)。
|
||||
|
||||
## 可用组件(全局注册,直接写标签)
|
||||
|
||||
| 组件 | 来源 | 说明 |
|
||||
| --- | --- | --- |
|
||||
| `<ui-icon name size>` | `icons/Icon.vue` | 90+ 线性图标,`size` = xs/sm/md/lg/xl |
|
||||
| `<ui-stat-card>` | `common/StatCard.vue` | 指标卡,支持 `icon` / `change` / `change-type` |
|
||||
| `<ui-card>` | `.card` 类 | `title` + `header` / `footer` 插槽,`body-flush` |
|
||||
| `<ui-page-header>` | `.page-header` 类 | 标题 + 描述 + 右侧操作区 |
|
||||
| `<ui-badge>` / `<ui-status-badge>` | `.badge` / `StatusBadge.vue` | 胶囊徽章、状态点 |
|
||||
| `<ui-empty-state>` | `common/EmptyState.vue` | 空状态,带可选操作按钮 |
|
||||
| `<ui-skeleton>` / `<ui-loading-spinner>` | 同名组件 | 骨架屏、加载指示 |
|
||||
| `<ui-toggle>` / `<ui-tabs>` | `Toggle.vue` / `.tabs` | 开关、分段标签 |
|
||||
| `<ui-search-input>` | `SearchInput.vue` | 带图标 + 防抖 search 事件 |
|
||||
| `<ui-dialog>` / `<ui-confirm-dialog>` | `BaseDialog.vue` / `ConfirmDialog.vue` | 弹窗(Vue 2 下挂载到 body) |
|
||||
| `<ui-pagination>` | `Pagination.vue` | 分页。API 与若依原生 `src/components/Pagination` 完全一致(`total` / `page.sync` / `limit.sync` / `pageSizes` / `pagerCount` / `layout` / `background` / `autoScroll` / `hidden` + `$attrs` 透传),页码仍由 `el-pagination` 渲染,外观由 `element-overrides.scss` 覆盖 |
|
||||
| `<ui-data-table>` | `DataTable.vue` | 列配置式表格:多选、排序、骨架屏、空状态 |
|
||||
| `<ui-table-page-layout>` | `layout/TablePageLayout.vue` | 操作/筛选固定、表格内滚、分页固定的列表页骨架 |
|
||||
|
||||
`<ui-data-table>` 适合新写的、列结构简单的表格;存量密集表格继续用 `el-table`,
|
||||
已通过 `element-overrides.scss` 统一成 sub2api 观感(灰底表头、蓝色 hover、细边框)。
|
||||
|
||||
## 列表页统一结构
|
||||
|
||||
```vue
|
||||
<div class="app-container">
|
||||
<ui-page-header title="客户信息" description="维护最终客户档案">
|
||||
<el-button type="primary" icon="el-icon-plus" @click="handleAdd">新增</el-button>
|
||||
</ui-page-header>
|
||||
|
||||
<div class="filter-card">
|
||||
<el-form :model="queryParams" :inline="true"><!-- 查询条件 --></el-form>
|
||||
</div>
|
||||
|
||||
<div class="table-card">
|
||||
<div class="table-card__toolbar"><!-- 操作按钮 + right-toolbar --></div>
|
||||
<el-table><!-- 或 <ui-data-table> --></el-table>
|
||||
<div class="table-card__footer">
|
||||
<ui-pagination :total="total" :page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
```
|
||||
|
||||
## 本次批量改造范围
|
||||
|
||||
`src/views` 下的标准列表页已批量套上卡片结构,并完成分页组件替换:
|
||||
|
||||
| 改造项 | 命中文件数 |
|
||||
| --- | --- |
|
||||
| `<ui-page-header />`(标题自动取菜单名) | 82 |
|
||||
| `.filter-card` 包裹查询表单 | 89 |
|
||||
| `.table-card` + `__toolbar` + `__footer` | 58 |
|
||||
| `<pagination>` → `<ui-pagination>` | 99 |
|
||||
|
||||
弹窗 / 抽屉里的子组件(`components/*Dialog.vue`、`components/Detail.vue`、
|
||||
`inventory/delivery/Detail.vue`、`manage/delivery/components/Detail.vue`)
|
||||
刻意不加页头,避免在弹窗里重复出现标题。
|
||||
|
||||
被跳过的页面(同页多表格 / 多分页 / 工具栏与表格之间夹了别的内容)保留原结构,
|
||||
需人工确认后再改,清单:
|
||||
|
||||
- `finance/writeoff/**`(抽屉详情、多表格)
|
||||
- `approve/finance/**/components/*Detail.vue`
|
||||
- `inventory/execution/edit.vue`、`inventory/outer/components/OuterForm.vue`
|
||||
- `project/info/ProductConfig.vue`、`project/info/ProjectDetailDrawer.vue`
|
||||
- `manage/order/OrderForm.vue`、`inventory/delivery/Detail.vue`
|
||||
- `finance/payable/components/EditForm.vue`、`finance/receivable/components/EditForm.vue`
|
||||
- `purchaseorder/components/PurchaseOrderDetailView.vue`
|
||||
|
||||
## 功能一致性
|
||||
|
||||
本次重构只改视觉层,业务行为以 HEAD 为准逐文件核对过,规则如下:
|
||||
|
||||
- 109 个批量改造的页面 `<script>` 与 `<style>` 与 HEAD 逐字节一致,模板里的标签 /
|
||||
属性 / `{{ 插值 }}` 多重集也一致(差异只允许是 `class`、`style`、
|
||||
`<pagination>` → `<ui-pagination>`、新增的 `<ui-page-header />` / `<ui-brand-mark>`)。
|
||||
- `src/api`、`src/utils`、`src/directive`、`src/plugins` 以及除 `ui/` 外的
|
||||
`src/components` 零改动。
|
||||
- `<ui-pagination>` 是 `el-pagination` 的封装,不是自研页码,所以
|
||||
`layout` / `pagerCount` / `background` / `autoScroll` 等原有行为全部保留
|
||||
(`inventory/execution/index.vue` 这类定制 `layout`、`page-sizes` 的页面不受影响)。
|
||||
- `views/index.vue`(工作台)的数据口径未变:仍是 `getProjectData(7)` 折线 +
|
||||
`getOrderData(12)` 柱状,`markPoint` 最大最小、`markLine` 平均值、toolbox
|
||||
切换/还原/保存图片都在,只是两张 `el-card` 换成了 `ui-card`。
|
||||
- 侧边栏从「JS 内联配色」改成 `is-dark` class 驱动,浅色 / 深色两种
|
||||
`sideTheme` 都验证过;`variables.scss` 的 `:export` 在 JS 侧已无消费方,改值无副作用。
|
||||
- 折叠宽度统一为 `$s2-sidebar-collapsed`(72px):`sidebar.scss` 的
|
||||
`.hideSidebar` 与 `layout/index.vue` 的 `.fixed-header` 用同一个变量,
|
||||
不会出现表头宽度和侧栏宽度对不齐。
|
||||
- 默认主色 `#409EFF` → `#0d9488`(青绿)→ `#1890ff`(按需求回退为蓝色)、
|
||||
默认侧栏 `theme-dark` → `theme-light`,这两项属于设计体系本身的变更,
|
||||
用户仍可在布局设置里改回来。
|
||||
|
||||
## 换肤(ThemePicker)
|
||||
|
||||
`element-variables.scss` 编译进产物的主色是 `#1890ff`(`$s2-primary-500`),
|
||||
`ThemePicker` 的 `ORIGINAL_THEME` 与 `store/settings.theme` 默认值都已同步为该值,
|
||||
这样首屏不会再注入 `public/styles/theme-chalk/index.css` 里的旧主题。
|
||||
若日后重新编译出不同的主色,记得同步这三处,并重新生成那份静态 CSS
|
||||
(构建后用 `dist/static/css/app.*.css` 覆盖即可)。
|
||||
|
||||
`store/settings.js` 还会忽略缓存里残留的青绿主色(`#0d9488` / `#14b8a6`),
|
||||
避免用户在重构期间点过「保存配置」后又被旧缓存拉回绿色主题。
|
||||
|
||||
|
||||
## 卡片节奏与弹窗内的降级
|
||||
|
||||
`index.scss` 里定义了两条规则,避免批量包裹之后出现「卡片贴卡片」:
|
||||
|
||||
- `.filter-card + .table-card`、`.table-card + .table-card` 之间统一 16px 间距;
|
||||
- `.el-dialog` / `.el-drawer__body` 内部的 `.filter-card`、`.table-card`
|
||||
自动去掉描边、阴影和圆角,弹窗里不会再叠一层卡片;同时把这两处的
|
||||
`overflow` 恢复成 `visible`,否则 `:popper-append-to-body="false"` 的下拉面板
|
||||
(如 `finance/invoice/components/InvoiceInfoView.vue`、`ApplyInvoice.vue`)会被裁切。
|
||||
|
||||
## 弹窗 / 抽屉与 stacking context(重要约束)
|
||||
|
||||
若依的 `el-dialog` / `el-drawer` 默认 `modal-append-to-body` 为 true、
|
||||
`append-to-body` 为 false:遮罩 `.v-modal` 挂在 `<body>`(z-index 2000+),
|
||||
弹层节点却留在页面里。所以布局容器绝对不能形成 stacking context,
|
||||
否则弹层会被自己的遮罩盖住,表现为「点了详情之后整个页面都灰了」。
|
||||
|
||||
已经落地的约束:
|
||||
|
||||
- `.app-container`(`index.scss`)与 `#app .main-container`(`sidebar.scss`)
|
||||
只保留 `position: relative`,不要再加 `z-index`。
|
||||
- `.app-main` 的 sub2api mesh 背景写在元素自身 `background` 上
|
||||
(`background-attachment: fixed`),不再用铺满视口的 `::before` 浮层;
|
||||
当初正是为了盖住那层浮层才给上面两个容器补了 `z-index: 1`。
|
||||
- 弹层组件里再套弹层组件时,内层必须写 `append-to-body`
|
||||
(`finance/payable/components/EditForm.vue`、`finance/receivable/components/EditForm.vue`
|
||||
就是被 `DetailDrawer` 复用后才补的)。
|
||||
|
||||
自查办法:在浏览器里比较 `.v-modal` 与弹层根节点的 `z-index`,
|
||||
再用 `document.elementFromPoint()` 打在弹层中心;命中 `.v-modal`
|
||||
就说明又被遮住了,顺着 `getComputedStyle` 找出带 `z-index` / `transform` /
|
||||
`filter` 的祖先容器即可。
|
||||
|
||||
## 品牌 logo
|
||||
|
||||
侧边栏和登录页的 logo tile 现在用 `<ui-brand-mark>`(`src/components/ui/BrandMark.vue`)
|
||||
画一个反白的等轴立方体,放在主色蓝色渐变块上;原始横向 logo
|
||||
`src/assets/logo/logo.png` 保持不变,`views/tool/build` 等原有引用不受影响。
|
||||
|
||||
之所以用内联 SVG 而不是裁一张新的位图:仓库根 `.gitignore` 里有 `*.png`,
|
||||
新增位图资源不会自动进入版本库(`logo.png` 是在该规则之前就已被跟踪的例外)。
|
||||
如果设计侧要换真正的品牌图形标,记得 `git add -f`。
|
||||
|
||||
## 验证方式
|
||||
|
||||
```bash
|
||||
cd oms_web/oms_vue
|
||||
NODE_OPTIONS=--openssl-legacy-provider npx vue-cli-service build # 生产
|
||||
NODE_OPTIONS=--openssl-legacy-provider npx vue-cli-service build --mode development
|
||||
```
|
||||
|
||||
两条命令均需 `DONE Compiled successfully`。
|
||||
|
||||
批量改造脚本随仓库一起提供,可重复执行:
|
||||
|
||||
```bash
|
||||
node scripts/s2-refactor-list-pages.js # 预演,只打印将要做的改动
|
||||
node scripts/s2-refactor-list-pages.js --apply # 真正写文件
|
||||
```
|
||||
|
||||
脚本带安全阀:任何一次改写如果会减少文件行数,或丢掉 `<script>` / `<style>` /
|
||||
`</template>`,该次改写会被回滚并在日志里报 `lost-*`。因此改造结果可以用
|
||||
「行数不减少 + 块标签数量不减少」做静态审计:
|
||||
|
||||
```bash
|
||||
git diff --name-only | grep '\\.vue$' | while read f; do
|
||||
new=$(wc -l < "$f"); old=$(git show "HEAD:$f" | wc -l)
|
||||
[ "$new" -lt "$old" ] && echo "检查: $f $old -> $new"
|
||||
done
|
||||
```
|
||||
|
||||
## 已知边界
|
||||
|
||||
- `views/tool/build`(表单构建器)与 `views/tool/gen`(代码生成)未纳入批量改造。
|
||||
- 若依自带的 `theme-chalk` 覆盖样式已用新主题重新生成到
|
||||
`public/styles/theme-chalk/index.css`;若后续改了主色,需要重新生成一次,
|
||||
否则换肤的取色起点会不一致。
|
||||
|
|
@ -28,18 +28,20 @@
|
|||
"axios": "0.28.1",
|
||||
"clipboard": "2.0.8",
|
||||
"core-js": "3.37.1",
|
||||
"decimal.js": "10.4.2",
|
||||
"echarts": "5.4.0",
|
||||
"element-ui": "2.15.14",
|
||||
"file-saver": "2.0.5",
|
||||
"fuse.js": "6.4.3",
|
||||
"highlight.js": "9.18.5",
|
||||
"html2canvas": "^1.4.1",
|
||||
"js-beautify": "1.13.0",
|
||||
"js-cookie": "3.0.1",
|
||||
"jsencrypt": "3.0.0-rc.1",
|
||||
"jspdf": "^2.5.1",
|
||||
"jszip": "^3.10.1",
|
||||
"nprogress": "0.2.0",
|
||||
"quill": "2.0.2",
|
||||
"html2canvas": "^1.4.1",
|
||||
"jspdf": "^2.5.1",
|
||||
"screenfull": "5.0.2",
|
||||
"sortablejs": "1.10.2",
|
||||
"splitpanes": "2.4.1",
|
||||
|
|
@ -48,8 +50,7 @@
|
|||
"vue-cropper": "0.5.5",
|
||||
"vue-router": "3.4.9",
|
||||
"vuedraggable": "2.24.3",
|
||||
"vuex": "3.6.0",
|
||||
"decimal.js": "10.4.2"
|
||||
"vuex": "3.6.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "4.4.6",
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -0,0 +1,273 @@
|
|||
/**
|
||||
* sub2api 风格列表页批量改造脚本(幂等,带安全阀)
|
||||
* 详见 docs/sub2api-ui-migration.md
|
||||
*/
|
||||
const fs = require('fs')
|
||||
|
||||
const path = require('path')
|
||||
|
||||
const SKIP_DIRS = ['tool/build', 'tool/gen', 'error', 'dashboard']
|
||||
|
||||
function walk(dir, out = []) {
|
||||
fs.readdirSync(dir, { withFileTypes: true }).forEach(entry => {
|
||||
const full = path.join(dir, entry.name)
|
||||
if (entry.isDirectory()) walk(full, out)
|
||||
else if (entry.name.endsWith('.vue')) out.push(full)
|
||||
})
|
||||
return out
|
||||
}
|
||||
|
||||
/** 找到开始标签真正的 '>',跳过属性值里的 > 号(例如 v-show="total>0") */
|
||||
function findTagEnd(source, ltIndex) {
|
||||
let i = ltIndex + 1
|
||||
let quote = null
|
||||
while (i < source.length) {
|
||||
const ch = source[i]
|
||||
if (quote) {
|
||||
if (ch === quote) quote = null
|
||||
} else if (ch === '"' || ch === "'") {
|
||||
quote = ch
|
||||
} else if (ch === '>') {
|
||||
return i
|
||||
}
|
||||
i += 1
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
||||
/** 找到 fromIndex 处开始标签对应的整段结束位置(含闭合标签) */
|
||||
function matchTag(source, fromIndex, tag) {
|
||||
const openEnd = findTagEnd(source, fromIndex)
|
||||
if (openEnd < 0) return -1
|
||||
if (source[openEnd - 1] === '/') return openEnd + 1
|
||||
// 注意: \b 会把 <el-form-item 误判为 <el-form,这里用名字边界
|
||||
const re = new RegExp(`<(/?)${tag}(?![\\w-])`, 'g')
|
||||
re.lastIndex = openEnd + 1
|
||||
let depth = 1
|
||||
let m
|
||||
while ((m = re.exec(source))) {
|
||||
if (m[1] === '/') {
|
||||
depth -= 1
|
||||
if (depth === 0) {
|
||||
const close = source.indexOf('>', m.index)
|
||||
return close < 0 ? -1 : close + 1
|
||||
}
|
||||
} else {
|
||||
const end = findTagEnd(source, m.index)
|
||||
if (!(end > 0 && source[end - 1] === '/')) depth += 1
|
||||
}
|
||||
}
|
||||
return -1
|
||||
}
|
||||
|
||||
function occurrences(source, needle) {
|
||||
const list = []
|
||||
let i = source.indexOf(needle)
|
||||
while (i >= 0) {
|
||||
list.push(i)
|
||||
i = source.indexOf(needle, i + needle.length)
|
||||
}
|
||||
return list
|
||||
}
|
||||
|
||||
function indentAt(source, index) {
|
||||
const lineStart = source.lastIndexOf('\n', index) + 1
|
||||
const slice = source.slice(lineStart, index)
|
||||
return /^\s*$/.test(slice) ? slice : ''
|
||||
}
|
||||
|
||||
/** 把代码块的缩进整体重排到绝对列宽 target */
|
||||
function shiftBlock(block, target) {
|
||||
const width = line => (line.match(/^[ \t]*/) || [''])[0].replace(/\t/g, ' ').length
|
||||
const lines = block.split('\n')
|
||||
const bodyIndents = lines.slice(1).filter(line => line.trim() !== '').map(width)
|
||||
const canonical = bodyIndents.length ? Math.min(...bodyIndents) : width(lines[0])
|
||||
return lines
|
||||
.map((line, index) => {
|
||||
if (line.trim() === '') return ''
|
||||
// 首行不含原始缩进(它留在前缀里),直接落到目标列
|
||||
const next = index === 0 ? target : Math.max(0, width(line) - canonical + target)
|
||||
return ' '.repeat(next) + line.replace(/^[ \t]+/, '')
|
||||
})
|
||||
.join('\n')
|
||||
}
|
||||
|
||||
function refactor(source, options) {
|
||||
|
||||
// 安全阀:任何一次改写都不允许丢掉 script/style 块或整段模板
|
||||
const countOf = (text, needle) => text.split(needle).length - 1
|
||||
const guarded = (next, label) => {
|
||||
if (countOf(next, '</template>') < countOf(source, '</template>')) return { bad: label + ':lost-template' }
|
||||
if (countOf(next, '<script') < countOf(source, '<script')) return { bad: label + ':lost-script' }
|
||||
if (countOf(next, '<style') < countOf(source, '<style')) return { bad: label + ':lost-style' }
|
||||
if (next.split('\n').length < source.split('\n').length) return { bad: label + ':lost-lines' }
|
||||
return { ok: true }
|
||||
}
|
||||
|
||||
const opts = Object.assign({ header: true, form: true, table: true }, options)
|
||||
const notes = []
|
||||
let out = source
|
||||
|
||||
// ---------- 0. 页面标题区(标题自动取菜单名) ----------
|
||||
if (opts.header && !out.includes('<ui-page-header') && !out.includes('<UiPageHeader')) {
|
||||
const prev = out
|
||||
const rootHits = occurrences(out, 'class="app-container"')
|
||||
if (rootHits.length === 1) {
|
||||
const tagEnd = findTagEnd(out, out.lastIndexOf('<', rootHits[0]))
|
||||
if (tagEnd > 0) {
|
||||
const indent = indentAt(out, out.lastIndexOf('<', rootHits[0])) + ' '
|
||||
out =
|
||||
out.slice(0, tagEnd + 1) +
|
||||
`\n${indent}<ui-page-header />` +
|
||||
out.slice(tagEnd + 1)
|
||||
const g = guarded(out, 'header')
|
||||
if (!g.ok) {
|
||||
out = prev
|
||||
notes.push(g.bad)
|
||||
} else {
|
||||
notes.push('page-header')
|
||||
}
|
||||
}
|
||||
} else if (rootHits.length > 1) {
|
||||
notes.push('skip:multiple-app-container')
|
||||
}
|
||||
}
|
||||
|
||||
// ---------- 1. 查询表单 ----------
|
||||
const formHits = occurrences(out, ':inline="true"')
|
||||
if (opts.form && formHits.length === 1) {
|
||||
const prevForm = out
|
||||
const tagStart = out.lastIndexOf('<el-form', formHits[0])
|
||||
const end = tagStart >= 0 ? matchTag(out, tagStart, 'el-form') : -1
|
||||
if (tagStart >= 0 && end > 0) {
|
||||
const indent = indentAt(out, tagStart)
|
||||
const block = shiftBlock(out.slice(tagStart, end), indent.length + 2)
|
||||
out =
|
||||
out.slice(0, tagStart) +
|
||||
`<div class="filter-card">\n${block}\n${indent}</div>` +
|
||||
out.slice(end)
|
||||
const g = guarded(out, 'filter-card')
|
||||
if (!g.ok) {
|
||||
out = prevForm
|
||||
notes.push(g.bad)
|
||||
} else {
|
||||
notes.push('filter-card')
|
||||
}
|
||||
} else if (tagStart >= 0) {
|
||||
notes.push('el-form-unbalanced')
|
||||
}
|
||||
} else if (formHits.length > 1) {
|
||||
notes.push('skip:multiple-query-forms')
|
||||
}
|
||||
|
||||
// ---------- 2. 工具栏 / 表格 / 分页 ----------
|
||||
const toolbarHits = occurrences(out, '<el-row :gutter="10" class="mb8"')
|
||||
const tableHits = occurrences(out, '<el-table ')
|
||||
const pageHits = occurrences(out, '<pagination')
|
||||
if (opts.table) {
|
||||
if (toolbarHits.length > 1) notes.push('skip:multiple-toolbars')
|
||||
if (tableHits.length > 1) notes.push('skip:multiple-tables')
|
||||
if (pageHits.length > 1) notes.push('skip:multiple-paginations')
|
||||
}
|
||||
|
||||
if (opts.table && toolbarHits.length === 1 && tableHits.length === 1 && pageHits.length <= 1) {
|
||||
const toolbarStart = toolbarHits[0]
|
||||
const toolbarEnd = matchTag(out, toolbarStart, 'el-row')
|
||||
const tableStart = tableHits[0]
|
||||
const tableEnd = matchTag(out, tableStart, 'el-table')
|
||||
const pageStart = pageHits.length === 1 ? pageHits[0] : -1
|
||||
const pageEnd = pageStart >= 0 ? matchTag(out, pageStart, 'pagination') : -1
|
||||
|
||||
if (toolbarEnd < 0) notes.push('el-row-unbalanced')
|
||||
else if (tableEnd < 0) notes.push('el-table-unbalanced')
|
||||
else if (tableStart < toolbarEnd) notes.push('skip:table-before-toolbar')
|
||||
else if (pageStart >= 0 && pageEnd < 0) notes.push('pagination-unbalanced')
|
||||
else if (pageStart >= 0 && pageStart < tableEnd) notes.push('skip:pagination-inside-table')
|
||||
else {
|
||||
const gap = out.slice(toolbarEnd, tableStart)
|
||||
const gapText = gap.replace(/<!--[\s\S]*?-->/g, '').trim()
|
||||
if (gapText !== '') {
|
||||
notes.push('skip:toolbar-table-gap-not-empty')
|
||||
} else {
|
||||
const prevTable = out
|
||||
const indent = indentAt(out, toolbarStart)
|
||||
const base = indent.length
|
||||
const pad = n => ' '.repeat(n)
|
||||
const hasPage = pageStart >= 0
|
||||
const regionEnd = hasPage ? pageEnd : tableEnd
|
||||
const toolbarBlock = shiftBlock(out.slice(toolbarStart, toolbarEnd), base + 4)
|
||||
const tableBlock = shiftBlock(out.slice(tableStart, tableEnd), base + 2)
|
||||
const pageBlock = hasPage
|
||||
? shiftBlock(out.slice(pageStart, pageEnd).replace('<pagination', '<ui-pagination'), base + 4)
|
||||
: ''
|
||||
const rebuilt =
|
||||
`<div class="table-card">\n` +
|
||||
`${pad(base + 2)}<div class="table-card__toolbar">\n${toolbarBlock}\n${pad(base + 2)}</div>\n` +
|
||||
`${tableBlock}` +
|
||||
(hasPage
|
||||
? `\n${pad(base + 2)}<div class="table-card__footer">\n${pageBlock}\n${pad(base + 2)}</div>`
|
||||
: '') +
|
||||
`\n${pad(base)}</div>`
|
||||
out = out.slice(0, toolbarStart) + rebuilt + out.slice(regionEnd)
|
||||
const g = guarded(out, 'table-card')
|
||||
if (!g.ok) {
|
||||
out = prevTable
|
||||
notes.push(g.bad)
|
||||
} else {
|
||||
notes.push(hasPage ? 'table-card+pagination' : 'table-card')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return { out, notes }
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 用法:
|
||||
// node scripts/s2-refactor-list-pages.js # 预演,只打印将要做的改动
|
||||
// node scripts/s2-refactor-list-pages.js --apply # 真正写文件
|
||||
// 可选第二个参数指定目录,默认 src/views
|
||||
const argv = process.argv.slice(2)
|
||||
const APPLY = argv.indexOf('--apply') > -1
|
||||
const target = argv.find(a => !a.startsWith('--')) || path.join(process.cwd(), 'src', 'views')
|
||||
|
||||
const files = walk(target).filter(file => {
|
||||
const rel = path.relative(target, file)
|
||||
return !SKIP_DIRS.some(skip => rel.startsWith(skip))
|
||||
})
|
||||
|
||||
let changed = 0
|
||||
const skipped = []
|
||||
const aborted = []
|
||||
|
||||
files.forEach(file => {
|
||||
const rel = path.relative(target, file)
|
||||
const source = fs.readFileSync(file, 'utf8')
|
||||
// 每一步单独判断,保证脚本可重复执行且不会重复包裹
|
||||
const needsHeader = !source.includes('<ui-page-header') && !source.includes('<UiPageHeader') && source.includes('class="app-container"')
|
||||
const needsForm = !source.includes('class="filter-card"') && source.includes(':inline="true"')
|
||||
const needsTable = !source.includes('class="table-card"') && source.includes('<el-table ')
|
||||
if (!needsHeader && !needsForm && !needsTable) return
|
||||
|
||||
const { out, notes } = refactor(source, { header: needsHeader, form: needsForm, table: needsTable })
|
||||
if (notes.some(n => n.startsWith('lost-'))) aborted.push([rel, notes.join(', ')])
|
||||
if (out !== source) {
|
||||
changed += 1
|
||||
if (APPLY) fs.writeFileSync(file, out)
|
||||
console.log(`REFACTOR ${rel} :: ${notes.join(', ')}`)
|
||||
} else if (notes.length) {
|
||||
skipped.push([rel, notes.join(', ')])
|
||||
}
|
||||
})
|
||||
|
||||
console.log(`\n${APPLY ? 'applied' : 'dry-run'} changed=${changed}`)
|
||||
if (aborted.length) {
|
||||
console.log('ABORTED (安全阀拦截):')
|
||||
aborted.forEach(([f, n]) => console.log(` ${f} :: ${n}`))
|
||||
}
|
||||
if (skipped.length) {
|
||||
console.log('skipped:')
|
||||
skipped.forEach(([f, n]) => console.log(` ${f} :: ${n}`))
|
||||
}
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询审批任务列表
|
||||
export function listApprovalTask(query) {
|
||||
const { pageNum, pageSize, orderByColumn, isAsc, ...body } = query
|
||||
return request({
|
||||
url: '/approve/task/vue/list',
|
||||
method: 'post',
|
||||
params: { pageNum, pageSize, orderByColumn, isAsc },
|
||||
data: body
|
||||
})
|
||||
}
|
||||
|
||||
// 获取审批任务数量统计
|
||||
export function getApprovalTaskTotal() {
|
||||
return request({
|
||||
url: '/approve/task/vue/total',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增流程确认记录
|
||||
export function addTodoConfirm(data) {
|
||||
return request({
|
||||
url: '/approve/task/vue/confirm',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询报价单列表
|
||||
export function listQuotation(query) {
|
||||
return request({
|
||||
url: '/quotation/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询报价单详细
|
||||
export function getQuotation(id) {
|
||||
return request({
|
||||
url: '/quotation/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增报价单
|
||||
export function addQuotation(data) {
|
||||
return request({
|
||||
url: '/quotation/insert',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改报价单
|
||||
export function updateQuotation(data) {
|
||||
return request({
|
||||
url: '/quotation/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除报价单
|
||||
export function delQuotation(id) {
|
||||
return request({
|
||||
url: '/quotation/remove/batch/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
export function exportSingleQuotation(id) {
|
||||
return request({
|
||||
url: '/quotation/export/single/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
import request from '@/utils/request'
|
||||
import { tansParams } from '@/utils/ruoyi'
|
||||
|
||||
// 查询制造商信息列表
|
||||
export function listVendor(query) {
|
||||
|
|
@ -48,7 +49,9 @@ export function exportVendor(query) {
|
|||
return request({
|
||||
url: '/system/vendor/export',
|
||||
method: 'post',
|
||||
params: query
|
||||
data: query,
|
||||
transformRequest: [(params) => tansParams(params)],
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,10 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 按SN码查询库存数据
|
||||
export function listInventoryInfoByProductSn(query) {
|
||||
return request({
|
||||
url: '/sip/dataProcess/inventoryInfoByProductSn',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询项目管理列表
|
||||
export function listProject(query) {
|
||||
return request({
|
||||
url: '/sip/project/vue/list',
|
||||
method: 'post',
|
||||
data: query,
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
// 项目转移负责人
|
||||
export function transferProject(data) {
|
||||
return request({
|
||||
url: '/sip/dataProcess/projectTransfer',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,72 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询财务计收列表
|
||||
export function listCharge(query) {
|
||||
return request({
|
||||
url: '/finance/charge/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询财务计收详细
|
||||
export function getCharge(id) {
|
||||
return request({
|
||||
url: '/finance/charge/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增财务计收
|
||||
export function addCharge(data) {
|
||||
return request({
|
||||
url: '/finance/charge',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改财务计收
|
||||
export function updateCharge(data) {
|
||||
return request({
|
||||
url: '/finance/charge',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
export function revokeCharge(data) {
|
||||
return request({
|
||||
url: '/finance/charge/revoke',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除财务计收
|
||||
export function delCharge(id) {
|
||||
return request({
|
||||
url: '/finance/charge/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
export function applyChargeBiz(data) {
|
||||
return request({
|
||||
url: '/finance/charge/applyBiz' ,
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function returnApplyBiz(data) {
|
||||
return request({
|
||||
url: '/finance/charge/returnApplyBiz' ,
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
export function applyCharge(data) {
|
||||
return request({
|
||||
url: '/finance/charge/apply' ,
|
||||
method: 'put',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,136 @@
|
|||
import request from '@/utils/request'
|
||||
import {tansParams} from "@/utils/ruoyi"
|
||||
|
||||
// 查询销售收票单列表
|
||||
export function listInvoice(query) {
|
||||
return request({
|
||||
url: '/finance/invoice/list',
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询销售收票单详细
|
||||
export function getInvoice(id) {
|
||||
return request({
|
||||
url: '/finance/invoice/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询销售收票单附件
|
||||
export function getInvoiceAttachments(id, params) {
|
||||
return request({
|
||||
url: `/finance/invoice/attachment/${id}`,
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 上传销售收票单附件
|
||||
export function uploadInvoiceAttachment(data) {
|
||||
return request({
|
||||
url: '/finance/invoice/uploadReceipt',
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
},
|
||||
data: data,
|
||||
needLoading: true
|
||||
});
|
||||
}
|
||||
|
||||
// 申请红冲
|
||||
export function redRush(id) {
|
||||
return request({
|
||||
url: '/finance/invoice/applyRefund/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 申请红冲 (提交表单)
|
||||
export function applyRefund(data) {
|
||||
return request({
|
||||
url: '/finance/invoice/applyRefund',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 退回销售收票单
|
||||
export function returnInvoice(id) {
|
||||
return request({
|
||||
url: '/finance/invoice/return/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增销售收票单
|
||||
export function addInvoice(data) {
|
||||
return request({
|
||||
url: '/finance/receivable/mergeAndInitiateInvoice',
|
||||
method: 'post',
|
||||
data: data,
|
||||
needLoading: true
|
||||
})
|
||||
}
|
||||
|
||||
// 查询销售收票单产品明细
|
||||
export function getInvoiceProducts(code) {
|
||||
return request({
|
||||
url: '/finance/invoice/product/' + code,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 申请开票
|
||||
export function applyInvoice(data) {
|
||||
return request({
|
||||
url: '/finance/invoice/apply',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 撤销销售收票单
|
||||
export function revokeInvoice(id) {
|
||||
return request({
|
||||
url: '/finance/invoice/revoke/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询开票审批列表
|
||||
export function listInvoiceApprove(query) {
|
||||
return request({
|
||||
url: '/finance/invoice/approve/list',
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
data: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询已审批开票列表
|
||||
export function listInvoiceApproved(query) {
|
||||
return request({
|
||||
url: '/finance/invoice/approved/list',
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
data: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询开票单详细
|
||||
export function getInvoiceDetail(id) {
|
||||
return request({
|
||||
url: '/finance/invoice/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询收票待审批列表
|
||||
export function listInvoiceReceiptApprove(query) {
|
||||
return request({
|
||||
url: '/finance/ticket/approve/list',
|
||||
method: 'post',
|
||||
data: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询收票已审批列表
|
||||
export function listInvoiceReceiptApproved(query) {
|
||||
return request({
|
||||
url: '/finance/ticket/approved/list',
|
||||
method: 'post',
|
||||
data: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询收票详情
|
||||
export function getInvoiceReceipt(id) {
|
||||
return request({
|
||||
url: '/finance/ticket/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询收票附件
|
||||
export function getInvoiceReceiptAttachments(id,params) {
|
||||
return request({
|
||||
url: '/finance/ticket/attachment/' + id,
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询核销记录列表
|
||||
export function listInvoiceWriteOff(query) {
|
||||
return request({
|
||||
url: '/finance/invoice/writeoff/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询核销详情
|
||||
export function getInvoiceWriteoff(id) {
|
||||
return request({
|
||||
url: '/finance/invoice/writeoff/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 删除核销记录
|
||||
export function delInvoiceWriteoff(ids) {
|
||||
return request({
|
||||
url: '/finance/invoice/writeoff/' + ids,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询采购应付单列表
|
||||
export function listPayable(query) {
|
||||
return request({
|
||||
url: '/finance/payable/list',
|
||||
method: 'post',
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
data: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询采购应付单详情
|
||||
export function getPayable(id) {
|
||||
return request({
|
||||
url: '/finance/payable/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询付款计划列表
|
||||
export function getPaymentPlan(payableBillId) {
|
||||
return request({
|
||||
url: `/finance/payable/plan/${payableBillId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 更新付款计划
|
||||
export function updatePaymentPlan(payableBillId, data) {
|
||||
return request({
|
||||
url: `/finance/payable/plan/${payableBillId}`,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 合并并发起付款
|
||||
export function mergeAndInitiatePayment(data) {
|
||||
return request({
|
||||
url: '/finance/payable/mergeAndInitiatePayment',
|
||||
method: 'post',
|
||||
data: data,
|
||||
needLoading: true
|
||||
})
|
||||
}
|
||||
|
||||
// 合并并发起收票
|
||||
export function mergeAndInitiateReceipt(data) {
|
||||
return request({
|
||||
url: '/finance/payable/mergeAndInitiateReceipt',
|
||||
method: 'post',
|
||||
data: data,
|
||||
needLoading: true
|
||||
})
|
||||
}
|
||||
|
||||
// [PLACEHOLDER] 查询收票计划列表 - Endpoint to be confirmed by user
|
||||
export function getReceivingTicketPlan(payableBillId) {
|
||||
return request({
|
||||
url: `/finance/ticket/plan/${payableBillId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// [PLACEHOLDER] 更新收票计划 - Endpoint to be confirmed by user
|
||||
export function updateReceivingTicketPlan(payableBillId, data) {
|
||||
return request({
|
||||
url: `/finance/ticket/plan/${payableBillId}`,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 同步付款计划至发票计划
|
||||
export function syncToTicketPlan(payableBillId) {
|
||||
return request({
|
||||
url: `/finance/payable/plan/sync/${payableBillId}`,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,210 @@
|
|||
import request from '@/utils/request'
|
||||
import { tansParams } from "@/utils/ruoyi"
|
||||
|
||||
// 查询付款单列表
|
||||
export function listPayment(query) {
|
||||
return request({
|
||||
url: '/finance/payment/list',
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
data: tansParams(query)
|
||||
})
|
||||
}
|
||||
export function exportPayment(query) {
|
||||
return request({
|
||||
url: '/finance/payment/export',
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
data: tansParams(query)
|
||||
})
|
||||
}
|
||||
|
||||
// 查询付款单详细
|
||||
export function getPayment(id) {
|
||||
return request({
|
||||
url: '/finance/payment/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询付款单附件
|
||||
export function getPaymentAttachments(id, params) {
|
||||
return request({
|
||||
url: `/finance/payment/attachment/${id}`,
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
export function deleteFile(id) {
|
||||
return request({
|
||||
url: `/finance/payment/attachment/${id}`,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 上传付款单附件
|
||||
export function uploadPaymentAttachment(data) {
|
||||
return request({
|
||||
url: '/finance/payment/uploadReceipt',
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
},
|
||||
data: data
|
||||
});
|
||||
}
|
||||
|
||||
// 退回付款单
|
||||
export function returnPayment(id) {
|
||||
return request({
|
||||
url: '/finance/payment/returnPayment/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增付款单
|
||||
export function addPaymentFromPayable(data) {
|
||||
return request({
|
||||
url: '/finance/payable/mergeAndInitiatePayment',
|
||||
method: 'post',
|
||||
data: data,
|
||||
needLoading: true
|
||||
})
|
||||
}
|
||||
export function addPayment(data) {
|
||||
return request({
|
||||
url: '/finance/payment/add',
|
||||
method: 'post',
|
||||
data: data,
|
||||
needLoading: true
|
||||
})
|
||||
}
|
||||
|
||||
export function handleRevoke(id) {
|
||||
return request({
|
||||
url: '/finance/payment/revoke',
|
||||
method: 'post',
|
||||
data: {id: id},
|
||||
needLoading: true
|
||||
})
|
||||
}
|
||||
|
||||
// 申请付款
|
||||
export function applyPaymentApi(data) {
|
||||
return request({
|
||||
url: '/finance/payment/applyPayment',
|
||||
method: 'post',
|
||||
data: data,
|
||||
needLoading: true
|
||||
})
|
||||
}
|
||||
|
||||
// 申请退款
|
||||
export function applyRefund(data) {
|
||||
return request({
|
||||
url: '/finance/payment/applyRefund',
|
||||
method: 'post',
|
||||
data: data,
|
||||
needLoading: true
|
||||
})
|
||||
}
|
||||
export function deletePayment(id) {
|
||||
return request({
|
||||
url: '/finance/payment/remove',
|
||||
method: 'post',
|
||||
params:{ids:id},
|
||||
needLoading: true
|
||||
})
|
||||
}
|
||||
|
||||
export function applyRefundApprove(id) {
|
||||
return request({
|
||||
url: '/finance/payment/applyRefundApprove',
|
||||
method: 'post',
|
||||
data: {id: id},
|
||||
needLoading: true
|
||||
})
|
||||
}
|
||||
|
||||
// 查询应付单列表 (用于新增付款单-非预付)
|
||||
export function listPayableBills(query) {
|
||||
return request({
|
||||
url: 'finance/payable/list',
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
data: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询采购订单列表 (用于新增付款单-预付)
|
||||
export function listOrders(query) {
|
||||
return request({
|
||||
url: '/project/order/list',
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
data: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询付款审批列表
|
||||
export function listPaymentApprove(query) {
|
||||
return request({
|
||||
url: '/finance/payment/approve/list',
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
data: tansParams(query)
|
||||
})
|
||||
}
|
||||
|
||||
// 查询已审批付款列表
|
||||
export function listPaymentApproved(query) {
|
||||
return request({
|
||||
url: '/finance/payment/approved/list',
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
data: tansParams(query)
|
||||
})
|
||||
}
|
||||
|
||||
// 查询付款单列表 (核销专用)
|
||||
export function listPaymentForWriteOff(query) {
|
||||
return request({
|
||||
url: '/finance/payment/write-off/list',
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
data: tansParams(query)
|
||||
})
|
||||
}
|
||||
|
||||
// 手工匹配核销
|
||||
export function manualWriteOff(data) {
|
||||
return request({
|
||||
url: '/finance/writeoff',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 新增付款单
|
||||
export function updatePaymentBill(data) {
|
||||
return request({
|
||||
url: '/finance/payment/updatePaymentBill',
|
||||
method: 'post',
|
||||
data: data,
|
||||
needLoading: true
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
import request from '@/utils/request'
|
||||
import {tansParams} from "@/utils/ruoyi";
|
||||
|
||||
// 查询付款退款待审批列表
|
||||
export function listPaymentRefundApprove(query) {
|
||||
return request({
|
||||
url: '/finance/payment/approve/list',
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
data: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询付款退款已审批列表
|
||||
export function listPaymentRefundApproved(query) {
|
||||
return request({
|
||||
url: '/finance/payment/approved/list',
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询付款退款详情
|
||||
export function getPaymentRefund(id) {
|
||||
return request({
|
||||
url: '/finance/paymentRefund/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,122 @@
|
|||
import request from '@/utils/request'
|
||||
import {tansParams} from "@/utils/ruoyi"
|
||||
|
||||
// 查询收票单列表
|
||||
export function listReceipt(query) {
|
||||
return request({
|
||||
url: '/finance/ticket/list',
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
data: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询收票单详细
|
||||
export function getReceipt(id) {
|
||||
return request({
|
||||
url: '/finance/ticket/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询收票单附件
|
||||
export function getReceiptAttachments(id, params) {
|
||||
return request({
|
||||
url: `/finance/ticket/attachment/${id}`,
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 上传收票单附件
|
||||
export function uploadReceiptAttachment(data) {
|
||||
return request({
|
||||
url: '/finance/ticket/uploadReceipt',
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
},
|
||||
data: data,
|
||||
needLoading: true
|
||||
});
|
||||
}
|
||||
|
||||
// 退回收票单
|
||||
export function redRush(id) {
|
||||
return request({
|
||||
url: '/finance/ticket/applyRefund/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function returnReceipt(id) {
|
||||
return request({
|
||||
url: '/finance/ticket/return/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增收票单
|
||||
export function addReceipt(data) {
|
||||
return request({
|
||||
url: '/finance/payable/mergeAndInitiateReceipt',
|
||||
method: 'post',
|
||||
data: data,
|
||||
needLoading: true
|
||||
})
|
||||
}
|
||||
|
||||
// 撤销收票单
|
||||
export function revokeReceipt(id) {
|
||||
return request({
|
||||
url: '/finance/ticket/revoke/' + id,
|
||||
method: 'put'
|
||||
})
|
||||
}
|
||||
|
||||
// 申请红冲(带附件)
|
||||
export function applyRedRush(data) {
|
||||
return request({
|
||||
url: '/finance/ticket/applyRefund',
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
},
|
||||
data: data,
|
||||
needLoading: true
|
||||
})
|
||||
}
|
||||
// 查询收款审批列表
|
||||
export function listReceiptApprove(query) {
|
||||
return request({
|
||||
url: '/finance/receipt/approve/list',
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
data: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询已审批收款列表
|
||||
export function listReceiptApproved(query) {
|
||||
return request({
|
||||
url: '/finance/receipt/approved/list',
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
data: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询收款单详细
|
||||
export function getReceiptDetail(id) {
|
||||
return request({
|
||||
url: '/finance/receipt/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,81 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询销售应收单列表
|
||||
export function listReceivable(query) {
|
||||
return request({
|
||||
url: '/finance/receivable/list',
|
||||
method: 'post',
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
data: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询销售应收单详情
|
||||
export function getReceivable(id) {
|
||||
return request({
|
||||
url: '/finance/receivable/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询收款计划列表
|
||||
export function getReceiptPlan(receivableBillId) {
|
||||
return request({
|
||||
url: `/finance/receivable/plan/${receivableBillId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 更新收款计划
|
||||
export function updateReceiptPlan(receivableBillId, data) {
|
||||
return request({
|
||||
url: `/finance/receivable/plan/${receivableBillId}`,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 合并并发起收款
|
||||
export function mergeAndInitiateReceipt(data) {
|
||||
return request({
|
||||
url: '/finance/receivable/mergeAndInitiateReceipt',
|
||||
method: 'post',
|
||||
data: data,
|
||||
needLoading:true
|
||||
})
|
||||
}
|
||||
|
||||
// 合并并发起开票
|
||||
export function mergeAndInitiateInvoice(data) {
|
||||
return request({
|
||||
url: '/finance/receivable/mergeAndInitiateInvoice',
|
||||
method: 'post',
|
||||
data: data,
|
||||
needLoading:true
|
||||
})
|
||||
}
|
||||
|
||||
// 查询开票计划列表
|
||||
export function getInvoicePlan(receivableBillId) {
|
||||
return request({
|
||||
url: `/finance/receivable/invoice/plan/${receivableBillId}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 更新开票计划
|
||||
export function updateInvoicePlan(receivableBillId, data) {
|
||||
return request({
|
||||
url: `/finance/receivable/invoice/plan/${receivableBillId}`,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 同步收款计划至开票计划
|
||||
export function syncToInvoicePlan(receivableBillId) {
|
||||
return request({
|
||||
url: `/finance/receivable/plan/sync/${receivableBillId}`,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,26 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询销售核销记录列表
|
||||
export function listReceivableWriteOff(query) {
|
||||
return request({
|
||||
url: '/finance/receivable/writeoff/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询销售核销详情
|
||||
export function getReceivableWriteOff(id) {
|
||||
return request({
|
||||
url: '/finance/receivable/writeoff/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 删除销售核销记录
|
||||
export function delReceivableWriteOff(ids) {
|
||||
return request({
|
||||
url: '/finance/receivable/writeoff/' + ids,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,130 @@
|
|||
import request from '@/utils/request'
|
||||
import {tansParams} from "@/utils/ruoyi"
|
||||
|
||||
// 查询收款单列表
|
||||
export function listReceive(query) {
|
||||
return request({
|
||||
url: '/finance/receipt/list',
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
data: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询收款单详细
|
||||
export function getReceive(id) {
|
||||
return request({
|
||||
url: '/finance/receipt/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询收款单附件
|
||||
export function getReceiveAttachments(id, params) {
|
||||
return request({
|
||||
url: `/finance/receipt/attachment/${id}`,
|
||||
method: 'get',
|
||||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 上传收款单附件
|
||||
export function uploadReceiveAttachment(data) {
|
||||
return request({
|
||||
url: '/finance/receipt/uploadReceipt',
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
},
|
||||
data: data,
|
||||
needLoading: true
|
||||
});
|
||||
}
|
||||
|
||||
// 申请红冲
|
||||
export function redRush(id) {
|
||||
return request({
|
||||
url: '/finance/receipt/applyRefund/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 退回收款单
|
||||
export function returnReceive(id) {
|
||||
return request({
|
||||
url: '/finance/receipt/returnReceivable/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增收款单 (Calls Receivable Merge Logic)
|
||||
export function mergeReceivable(data) {
|
||||
return request({
|
||||
url: '/finance/receivable/mergeAndInitiateReceipt',
|
||||
method: 'post',
|
||||
data: data,
|
||||
needLoading: true
|
||||
})
|
||||
}
|
||||
export function addReceipt(data) {
|
||||
return request({
|
||||
url: '/finance/receipt/insert',
|
||||
method: 'post',
|
||||
data: data,
|
||||
needLoading: true
|
||||
})
|
||||
}
|
||||
export function applyReceipt(data) {
|
||||
return request({
|
||||
url: '/finance/receipt/applyReceipt',
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
data: data,
|
||||
needLoading: true
|
||||
})
|
||||
}
|
||||
|
||||
// 申请退款
|
||||
export function submitRefund(data) {
|
||||
return request({
|
||||
url: '/finance/receipt/applyRefund',
|
||||
method: 'post',
|
||||
data: data,
|
||||
needLoading: true
|
||||
})
|
||||
}
|
||||
|
||||
// 查询收款单列表 (核销专用)
|
||||
export function listReceiptForWriteOff(query) {
|
||||
return request({
|
||||
url: '/finance/receipt/write-off/list',
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded'
|
||||
},
|
||||
data: tansParams(query)
|
||||
})
|
||||
}
|
||||
|
||||
// 手工匹配核销
|
||||
export function manualReceiptWriteOff(data) {
|
||||
return request({
|
||||
url: '/finance/receivable/writeoff',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 撤销收款单
|
||||
export function revokeReceipt(id) {
|
||||
return request({
|
||||
url: '/finance/receipt/revoke',
|
||||
method: 'post',
|
||||
data: {id: id},
|
||||
needLoading: true
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询项目报表列表
|
||||
export function listReport(query) {
|
||||
return request({
|
||||
url: '/finance/report/list',
|
||||
method: 'post',
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
data: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询供货商维度报表列表
|
||||
export function listSupplierReport(query) {
|
||||
return request({
|
||||
url: '/finance/report/listSupplier',
|
||||
method: 'post',
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
data: query
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询核销记录列表
|
||||
export function listWriteOff(query) {
|
||||
return request({
|
||||
url: '/finance/writeoff/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
export function listTicketWriteOff(query) {
|
||||
return request({
|
||||
url: '/finance/ticketWriteoff/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询核销详情
|
||||
export function getWriteOff(id) {
|
||||
return request({
|
||||
url: '/finance/writeoff/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
export function getTicketWriteoff(id) {
|
||||
return request({
|
||||
url: '/finance/ticketWriteoff/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 删除核销记录
|
||||
export function delWriteOff(ids) {
|
||||
return request({
|
||||
url: '/finance/writeoff/' + ids,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
export function delTicketWriteoff(ids) {
|
||||
return request({
|
||||
url: '/finance/ticketWriteoff/' + ids,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
|
@ -17,6 +17,14 @@ export function listCompletedFlows(data) {
|
|||
data: data
|
||||
})
|
||||
}
|
||||
// 按业务单号查询待办记录(查看申请详情用)
|
||||
export function listApplyFlows(data) {
|
||||
return request({
|
||||
url: '/flow/todo/apply-list',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 通用审批
|
||||
export function approveTask(data) {
|
||||
return request({
|
||||
|
|
|
|||
|
|
@ -52,6 +52,23 @@ export function recallDelivery(id) {
|
|||
})
|
||||
}
|
||||
|
||||
// 提交出库撤回审批(跨天发货记录)
|
||||
export function recallApply(id, reason, amountChanged) {
|
||||
return request({
|
||||
url: '/inventory/delivery/vue/recall/apply',
|
||||
method: 'post',
|
||||
data: {id, reason, amountChanged}
|
||||
})
|
||||
}
|
||||
|
||||
// 按发货记录 id 检查关联财务单据的审批状态(撤回/作废按钮前置校验)
|
||||
export function checkRecallByDelivery(deliveryId) {
|
||||
return request({
|
||||
url: '/inventory/delivery/vue/recall/check-by-delivery/' + deliveryId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 导出采购合同
|
||||
export function exportDelivery(query) {
|
||||
return request({
|
||||
|
|
@ -80,6 +97,15 @@ export function listProductSn(query) {
|
|||
})
|
||||
}
|
||||
|
||||
// 查询仅维保订单发货可续用的SN(关联项目同产品编码的已发货SN)
|
||||
export function maintenanceSn(query) {
|
||||
return request({
|
||||
url: '/inventory/delivery/vue/maintenanceSn',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
export function removeDelivery(id) {
|
||||
return request({
|
||||
url: '/inventory/delivery/vue/' + id,
|
||||
|
|
|
|||
|
|
@ -71,6 +71,23 @@ export function recallExecution(id) {
|
|||
})
|
||||
}
|
||||
|
||||
// 提交撤单审批申请
|
||||
export function recallExecutionApply(id, reason, amountChanged) {
|
||||
return request({
|
||||
url: '/inventory/execution/vue/recall/apply',
|
||||
method: 'post',
|
||||
data: { id, reason, amountChanged }
|
||||
})
|
||||
}
|
||||
export function exportExecution(data) {
|
||||
return request({
|
||||
url: `/inventory/execution/vue/export`,
|
||||
method: 'post',
|
||||
data: { data },
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
})
|
||||
}
|
||||
|
||||
// 查询出库预览信息
|
||||
export function getCheckOutPreview(data) {
|
||||
return request({
|
||||
|
|
|
|||
|
|
@ -85,3 +85,30 @@ export function getOuterLog(query) {
|
|||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询在途库存
|
||||
export function getPurchaseStock(query) {
|
||||
return request({
|
||||
url: '/inventory/info/vue/purchase-stock',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询锁单
|
||||
export function getBindOrder(query) {
|
||||
return request({
|
||||
url: '/inventory/info/vue/bind-order',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询在库现存
|
||||
export function getInventoryInner(query) {
|
||||
return request({
|
||||
url: '/inventory/info/vue/inventory-inner',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,6 +19,15 @@ export function getInner(id) {
|
|||
})
|
||||
}
|
||||
|
||||
// 查询入库单产品信息列表
|
||||
export function listInnerInventoryInfo(id, query) {
|
||||
return request({
|
||||
url: `${VUE_APP_API_URL}/${id}/inventory-info/list`,
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 新增入库单信息
|
||||
export function addInner(data) {
|
||||
return request({
|
||||
|
|
|
|||
|
|
@ -79,6 +79,14 @@ export function exportDownloadTemplate() {
|
|||
method: 'get'
|
||||
})
|
||||
}
|
||||
// 下载带列表数据的发货导入模板
|
||||
export function exportDownloadTemplateData(data) {
|
||||
return request({
|
||||
url: '/inventory/outer/importTemplateData',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
export function importSnData(formData) {
|
||||
return request({
|
||||
url: '/inventory/outer/vue/importData',
|
||||
|
|
@ -89,3 +97,13 @@ export function importSnData(formData) {
|
|||
data: formData
|
||||
})
|
||||
}
|
||||
export function assignDeliverySnData(formData) {
|
||||
return request({
|
||||
url: '/inventory/outer/vue/assignDeliveryData',
|
||||
method: 'post',
|
||||
headers: {
|
||||
'Content-Type': 'multipart/form-data'
|
||||
},
|
||||
data: formData
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,11 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
function createLoginFormData(data) {
|
||||
const formData = new FormData()
|
||||
Object.keys(data).forEach(key => formData.append(key, data[key]))
|
||||
return formData
|
||||
}
|
||||
|
||||
// 登录方法 - 基于 Session 认证,使用 FormData 格式
|
||||
export function login(username, password, code, rememberMe) {
|
||||
const formData = new FormData()
|
||||
|
|
@ -9,6 +15,40 @@ export function login(username, password, code, rememberMe) {
|
|||
formData.append('rememberMe', rememberMe || false)
|
||||
return request({
|
||||
url: '/login',
|
||||
headers: {
|
||||
isToken: false,
|
||||
'Content-Type': 'multipart/form-data',
|
||||
repeatSubmit: false,
|
||||
allowWarning: true
|
||||
},
|
||||
method: 'post',
|
||||
data: formData
|
||||
})
|
||||
}
|
||||
|
||||
export function resetLoginPwd(data) {
|
||||
const formData = createLoginFormData({
|
||||
username: data.username,
|
||||
newPassword: data.newPassword,
|
||||
confirmPassword: data.confirmPassword,
|
||||
emailCode: data.emailCode
|
||||
})
|
||||
return request({
|
||||
url: '/login/resetPwd',
|
||||
headers: {
|
||||
isToken: false,
|
||||
'Content-Type': 'multipart/form-data',
|
||||
repeatSubmit: false
|
||||
},
|
||||
method: 'post',
|
||||
data: formData
|
||||
})
|
||||
}
|
||||
|
||||
export function sendResetPwdEmailCode(username) {
|
||||
const formData = createLoginFormData({ username })
|
||||
return request({
|
||||
url: '/login/sendResetPwdEmailCode',
|
||||
headers: {
|
||||
isToken: false,
|
||||
'Content-Type': 'multipart/form-data',
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ export function delOrder(id) {
|
|||
export function exportOrder(query) {
|
||||
return request({
|
||||
url: `${baseURL}/export`,
|
||||
method: 'post',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,28 +1,40 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询产品信息
|
||||
export function getProductInfo(serialNumber) {
|
||||
function normalizeSerialNumbers(input) {
|
||||
const values = Array.isArray(input) ? input : [input]
|
||||
return [...new Set(values
|
||||
.map(item => (item || '').toString().trim())
|
||||
.filter(Boolean))]
|
||||
}
|
||||
|
||||
function buildQueryPayload(input) {
|
||||
const serialNumbers = normalizeSerialNumbers(input)
|
||||
return {
|
||||
serialNumber: serialNumbers[0] || '',
|
||||
serialNumbers
|
||||
}
|
||||
}
|
||||
|
||||
export function getProductInfo(serialNumberOrNumbers) {
|
||||
return request({
|
||||
url: '/manage/service/product',
|
||||
method: 'get',
|
||||
params: { serialNumber }
|
||||
method: 'post',
|
||||
data: buildQueryPayload(serialNumberOrNumbers)
|
||||
})
|
||||
}
|
||||
|
||||
// 查询相关合同信息
|
||||
export function getOrderInfo(serialNumber) {
|
||||
export function getOrderInfo(serialNumberOrNumbers) {
|
||||
return request({
|
||||
url: '/manage/service/order',
|
||||
method: 'get',
|
||||
params: { serialNumber }
|
||||
method: 'post',
|
||||
data: buildQueryPayload(serialNumberOrNumbers)
|
||||
})
|
||||
}
|
||||
|
||||
// 查询标准保修信息
|
||||
export function getWarrantyInfo(serialNumber) {
|
||||
export function getWarrantyInfo(serialNumberOrNumbers) {
|
||||
return request({
|
||||
url: '/manage/service/query',
|
||||
method: 'get',
|
||||
params: { serialNumber }
|
||||
method: 'post',
|
||||
data: buildQueryPayload(serialNumberOrNumbers)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +1,14 @@
|
|||
import request from '@/utils/request'
|
||||
import { tansParams } from '@/utils/ruoyi'
|
||||
|
||||
// 查询项目管理列表
|
||||
export function listProject(query) {
|
||||
return request({
|
||||
url: '/sip/project/vue/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
method: 'post',
|
||||
data: query,
|
||||
headers: { 'Content-Type': 'multipart/form-data' },
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
|
@ -49,6 +52,34 @@ export function exportProject(query) {
|
|||
return request({
|
||||
url: '/sip/project/vue/export',
|
||||
method: 'post',
|
||||
params: query
|
||||
data: query,
|
||||
transformRequest: [(params) => tansParams(params)],
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
|
||||
})
|
||||
}
|
||||
|
||||
// 项目收藏
|
||||
export function addCollect(data) {
|
||||
return request({
|
||||
url: '/project/collect/add',
|
||||
method: 'post',
|
||||
data: data,
|
||||
needLoading:true
|
||||
})
|
||||
}
|
||||
export function editJoinTrial(data) {
|
||||
return request({
|
||||
url: '/sip/project/vue/joinTrial',
|
||||
method: 'put',
|
||||
data: data,
|
||||
needLoading:true
|
||||
})
|
||||
}
|
||||
export function exportSingle(id) {
|
||||
return request({
|
||||
url: `/sip/project/vue/joinTrial/export/${id}`,
|
||||
method: 'get',
|
||||
needLoading:true
|
||||
})
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -85,3 +85,57 @@ export function updateFinanceStatus(id, status) {
|
|||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 查询仅维保订单可关联的项目订单(仅正常订单且审批完成)
|
||||
export function relatedCandidateList(query) {
|
||||
return request({
|
||||
url: '/project/order/vue/relatedCandidateList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询产品配货备货明细
|
||||
export function productMatchList(orderCode) {
|
||||
return request({
|
||||
url: '/project/order/vue/productMatchList',
|
||||
method: 'get',
|
||||
params: { orderCode }
|
||||
})
|
||||
}
|
||||
|
||||
// 查询产品配备货绑定信息
|
||||
export function productMatchBindList(orderCode, productCode, params = {}) {
|
||||
return request({
|
||||
url: '/project/order/vue/productMatchBindList',
|
||||
method: 'get',
|
||||
params: { orderCode, productCode, ...params }
|
||||
})
|
||||
}
|
||||
|
||||
// 保存订单关联采购单
|
||||
export function savePurchaseOrderMap(data) {
|
||||
return request({
|
||||
url: '/project/order/vue/purchaseOrderMap',
|
||||
method: 'post',
|
||||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 查询采购单SN码列表
|
||||
export function purchaseSnList(purchaseNo, orderCode, productCode) {
|
||||
return request({
|
||||
url: '/project/order/vue/purchaseSnList',
|
||||
method: 'get',
|
||||
params: { purchaseNo, orderCode, productCode }
|
||||
})
|
||||
}
|
||||
|
||||
// 订单绑定SN码
|
||||
export function bindOrderSnCodes(orderCode, productCode, purchaseNo, orderId, purchaseId, productSnList) {
|
||||
return request({
|
||||
url: '/project/order/vue/bindOrderSnCodes',
|
||||
method: 'post',
|
||||
data: { orderCode, productCode, purchaseNo, orderId, purchaseId, productSnList }
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -106,6 +106,16 @@ export function recallPurchaseorder(id) {
|
|||
method: 'put'
|
||||
})
|
||||
}
|
||||
export function exportPurchaseorder(data) {
|
||||
return request({
|
||||
url: '/sip/purchaseorder/export',
|
||||
method: 'get',
|
||||
params: data,
|
||||
// headers: { 'Content-Type': 'multipart/form-data' },
|
||||
needLoading: true
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
// 查询已审批采购单主表列表
|
||||
export function listApprovedPurchaseorder(query) {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import request from '@/utils/request'
|
||||
import { tansParams } from '@/utils/ruoyi'
|
||||
|
||||
// 查询办事处信息列表
|
||||
export function listAgent(query) {
|
||||
|
|
@ -48,6 +49,8 @@ export function exportAgent(query) {
|
|||
return request({
|
||||
url: '/system/agent/vue/export',
|
||||
method: 'post',
|
||||
params: query
|
||||
data: query,
|
||||
transformRequest: [(params) => tansParams(params)],
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询公司信息列表
|
||||
export function listCompanyInfo(query) {
|
||||
return request({
|
||||
url: '/sip/companyInfo/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询公司信息详细
|
||||
export function getCompanyInfo(id) {
|
||||
return request({
|
||||
url: '/sip/companyInfo/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增公司信息
|
||||
export function addCompanyInfo(data) {
|
||||
return request({
|
||||
url: '/sip/companyInfo',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改公司信息
|
||||
export function updateCompanyInfo(data) {
|
||||
return request({
|
||||
url: '/sip/companyInfo',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除公司信息
|
||||
export function delCompanyInfo(id) {
|
||||
return request({
|
||||
url: '/sip/companyInfo/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
import request from '@/utils/request'
|
||||
import { tansParams } from '@/utils/ruoyi'
|
||||
|
||||
// 查询客户信息列表
|
||||
export function listCustomer(query) {
|
||||
|
|
@ -48,6 +49,8 @@ export function exportCustomer(query) {
|
|||
return request({
|
||||
url: '/system/customer/vue/export',
|
||||
method: 'post',
|
||||
params: query
|
||||
data: query,
|
||||
transformRequest: [(params) => tansParams(params)],
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
|
||||
})
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import request from '@/utils/request'
|
||||
import { tansParams } from '@/utils/ruoyi'
|
||||
|
||||
// 查询产品管理列表
|
||||
export function listProduct(query) {
|
||||
|
|
@ -45,11 +46,13 @@ export function delProduct(id) {
|
|||
|
||||
// 导出产品管理
|
||||
export function exportProduct(query) {
|
||||
return request({
|
||||
url: '/system/product/export',
|
||||
method: 'post',
|
||||
params: query
|
||||
})
|
||||
return request({
|
||||
url: '/system/product/export',
|
||||
method: 'post',
|
||||
data: query,
|
||||
transformRequest: [(params) => tansParams(params)],
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
|
||||
})
|
||||
}
|
||||
|
||||
// a new function that queries a product by its code
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import request from '@/utils/request'
|
||||
import { parseStrEmpty } from "@/utils/ruoyi";
|
||||
|
||||
// 查询用户列表
|
||||
// 鏌ヨ鐢ㄦ埛鍒楄〃
|
||||
export function listUser(query) {
|
||||
return request({
|
||||
url: '/system/user/list',
|
||||
|
|
@ -10,7 +10,7 @@ export function listUser(query) {
|
|||
})
|
||||
}
|
||||
|
||||
// 查询用户详细
|
||||
// 鏌ヨ鐢ㄦ埛璇︾粏
|
||||
export function getUser(userId) {
|
||||
return request({
|
||||
url: '/system/user/' + parseStrEmpty(userId),
|
||||
|
|
@ -18,7 +18,7 @@ export function getUser(userId) {
|
|||
})
|
||||
}
|
||||
|
||||
// 新增用户
|
||||
// 鏂板鐢ㄦ埛
|
||||
export function addUser(data) {
|
||||
return request({
|
||||
url: '/system/user/add',
|
||||
|
|
@ -30,7 +30,7 @@ export function addUser(data) {
|
|||
})
|
||||
}
|
||||
|
||||
// 修改用户
|
||||
// 淇敼鐢ㄦ埛
|
||||
export function updateUser(data) {
|
||||
return request({
|
||||
url: '/system/user',
|
||||
|
|
@ -39,7 +39,7 @@ export function updateUser(data) {
|
|||
})
|
||||
}
|
||||
|
||||
// 删除用户
|
||||
// 鍒犻櫎鐢ㄦ埛
|
||||
export function delUser(userId) {
|
||||
return request({
|
||||
url: '/system/user/' + userId,
|
||||
|
|
@ -47,7 +47,7 @@ export function delUser(userId) {
|
|||
})
|
||||
}
|
||||
|
||||
// 用户密码重置
|
||||
// 鐢ㄦ埛瀵嗙爜閲嶇疆
|
||||
export function resetUserPwd(data) {
|
||||
|
||||
return request({
|
||||
|
|
@ -60,7 +60,7 @@ export function resetUserPwd(data) {
|
|||
})
|
||||
}
|
||||
|
||||
// 用户状态修改
|
||||
// 鐢ㄦ埛鐘舵€佷慨鏀?
|
||||
export function changeUserStatus(userId, status) {
|
||||
const data = {
|
||||
userId,
|
||||
|
|
@ -76,7 +76,7 @@ export function changeUserStatus(userId, status) {
|
|||
})
|
||||
}
|
||||
|
||||
// 查询用户个人信息
|
||||
// 鏌ヨ鐢ㄦ埛涓汉淇℃伅
|
||||
export function getUserProfile() {
|
||||
return request({
|
||||
url: '/system/user/profile/vue',
|
||||
|
|
@ -84,7 +84,7 @@ export function getUserProfile() {
|
|||
})
|
||||
}
|
||||
|
||||
// 修改用户个人信息
|
||||
// 淇敼鐢ㄦ埛涓汉淇℃伅
|
||||
export function updateUserProfile(data) {
|
||||
return request({
|
||||
url: '/system/user/profile',
|
||||
|
|
@ -93,7 +93,7 @@ export function updateUserProfile(data) {
|
|||
})
|
||||
}
|
||||
|
||||
// 用户密码重置
|
||||
// 鐢ㄦ埛瀵嗙爜閲嶇疆
|
||||
export function updateUserPwd(data) {
|
||||
return request({
|
||||
url: '/system/user/profile/resetPwd',
|
||||
|
|
@ -103,7 +103,7 @@ export function updateUserPwd(data) {
|
|||
})
|
||||
}
|
||||
|
||||
// 用户头像上传
|
||||
// 鐢ㄦ埛澶村儚涓婁紶
|
||||
export function uploadAvatar(data) {
|
||||
return request({
|
||||
url: '/system/user/profile/updateAvatar',
|
||||
|
|
@ -113,7 +113,20 @@ export function uploadAvatar(data) {
|
|||
})
|
||||
}
|
||||
|
||||
// 查询授权角色
|
||||
export function getUserBotProfile() {
|
||||
return request({
|
||||
url: '/system/user/profile/bot',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
export function generateUserBotProfile() {
|
||||
return request({
|
||||
url: '/system/user/profile/bot/generate',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
// 鏌ヨ鎺堟潈瑙掕壊
|
||||
export function getAuthRole(userId) {
|
||||
return request({
|
||||
url: '/system/user/vue/authRole/' + userId,
|
||||
|
|
@ -121,7 +134,7 @@ export function getAuthRole(userId) {
|
|||
})
|
||||
}
|
||||
|
||||
// 保存授权角色
|
||||
// 淇濆瓨鎺堟潈瑙掕壊
|
||||
export function updateAuthRole(data) {
|
||||
return request({
|
||||
url: '/system/user/authRole',
|
||||
|
|
@ -130,7 +143,7 @@ export function updateAuthRole(data) {
|
|||
})
|
||||
}
|
||||
|
||||
// 查询部门下拉树结构
|
||||
// 鏌ヨ閮ㄩ棬涓嬫媺鏍戠粨鏋?
|
||||
export function deptTreeSelect() {
|
||||
return request({
|
||||
url: '/system/user/deptTree',
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import request from '@/utils/request'
|
||||
import { tansParams } from '@/utils/ruoyi'
|
||||
|
||||
// 查询仓库基础信息列表
|
||||
export function listInfo(query) {
|
||||
|
|
@ -45,9 +46,11 @@ export function delInfo(id) {
|
|||
|
||||
// 导出仓库基础信息
|
||||
export function exportInfo(query) {
|
||||
return request({
|
||||
url: '/warehouse/info/export',
|
||||
method: 'post',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
return request({
|
||||
url: '/warehouse/info/export',
|
||||
method: 'post',
|
||||
data: query,
|
||||
transformRequest: [(params) => tansParams(params)],
|
||||
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 14 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 8.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 7.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 152 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
|
|
@ -0,0 +1,443 @@
|
|||
/**
|
||||
* Element UI 视觉覆盖层
|
||||
* 编译期变量只能改颜色,圆角/间距/阴影/交互动效需要运行期覆盖,
|
||||
* 这一层把 el-* 组件对齐 sub2api 的观感(大圆角 + 柔光阴影 + 蓝色主色高亮 + 宽松留白)。
|
||||
*/
|
||||
@import './tokens-vars.scss';
|
||||
|
||||
|
||||
/* ============ 基础 ============ */
|
||||
body {
|
||||
background-color: var(--s2-bg-page);
|
||||
color: var(--s2-text-primary);
|
||||
font-family: var(--s2-font-sans);
|
||||
}
|
||||
|
||||
::selection {
|
||||
background: rgba(24, 144, 255, 0.2);
|
||||
color: $s2-primary-900;
|
||||
}
|
||||
|
||||
/* 细滚动条:静止时透明,悬停时出现(sub2api 的行为) */
|
||||
::-webkit-scrollbar {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background: transparent;
|
||||
border-radius: 9999px;
|
||||
transition: background-color 0.2s ease;
|
||||
}
|
||||
|
||||
*:hover::-webkit-scrollbar-thumb {
|
||||
background: rgba(148, 163, 184, 0.45);
|
||||
}
|
||||
|
||||
*:hover::-webkit-scrollbar-thumb:hover {
|
||||
background: rgba(100, 116, 139, 0.7);
|
||||
}
|
||||
|
||||
/* ============ 按钮 ============ */
|
||||
.el-button {
|
||||
border-radius: var(--s2-radius);
|
||||
font-weight: 500;
|
||||
transition: all 0.2s ease-out;
|
||||
|
||||
&:active {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
}
|
||||
|
||||
.el-button--primary {
|
||||
background-image: linear-gradient(90deg, $s2-primary-500, $s2-primary-600);
|
||||
border: none;
|
||||
box-shadow: 0 4px 6px -1px rgba(24, 144, 255, 0.25);
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
background-image: linear-gradient(90deg, $s2-primary-600, $s2-primary-700);
|
||||
border: none;
|
||||
box-shadow: 0 10px 15px -3px rgba(24, 144, 255, 0.28);
|
||||
}
|
||||
|
||||
/* 禁用态:去掉主色渐变,改用中性灰底,避免浅色文字压在饱和底色上看不清 */
|
||||
&.is-disabled,
|
||||
&.is-disabled:focus,
|
||||
&.is-disabled:hover,
|
||||
&.is-disabled.is-plain,
|
||||
&.is-disabled.is-plain:focus,
|
||||
&.is-disabled.is-plain:hover {
|
||||
background-image: none;
|
||||
background-color: var(--s2-bg-muted);
|
||||
border-color: var(--s2-border);
|
||||
color: var(--s2-text-muted);
|
||||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
|
||||
.el-button--success {
|
||||
box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.22);
|
||||
}
|
||||
|
||||
.el-button--danger {
|
||||
box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.22);
|
||||
}
|
||||
|
||||
.el-button--text {
|
||||
color: $s2-primary-600;
|
||||
|
||||
&:hover,
|
||||
&:focus {
|
||||
color: $s2-primary-700;
|
||||
}
|
||||
}
|
||||
|
||||
/* ============ 输入框 ============ */
|
||||
.el-input__inner,
|
||||
.el-textarea__inner {
|
||||
border-radius: var(--s2-radius);
|
||||
transition: border-color 0.2s, box-shadow 0.2s;
|
||||
|
||||
&:focus {
|
||||
border-color: var(--s2-primary);
|
||||
box-shadow: 0 0 0 3px var(--s2-primary-ring);
|
||||
}
|
||||
}
|
||||
|
||||
.el-input.is-disabled .el-input__inner {
|
||||
background-color: var(--s2-bg-muted);
|
||||
border-color: var(--s2-border);
|
||||
color: var(--s2-text-secondary);
|
||||
}
|
||||
|
||||
.el-range-editor.el-input__inner:focus {
|
||||
border-color: var(--s2-primary);
|
||||
box-shadow: 0 0 0 3px var(--s2-primary-ring);
|
||||
}
|
||||
|
||||
/* ============ 表单 ============ */
|
||||
.el-form-item__label {
|
||||
font-weight: 500;
|
||||
color: var(--s2-text-regular);
|
||||
}
|
||||
|
||||
/* ============ 卡片 ============ */
|
||||
.el-card {
|
||||
border-radius: var(--s2-radius-lg);
|
||||
border-color: var(--s2-border-light);
|
||||
box-shadow: var(--s2-shadow-card) !important;
|
||||
}
|
||||
|
||||
.el-card__header {
|
||||
padding: 16px 24px;
|
||||
border-bottom-color: var(--s2-border-light);
|
||||
font-weight: 600;
|
||||
color: var(--s2-text-primary);
|
||||
}
|
||||
|
||||
.el-card__body {
|
||||
padding: 24px;
|
||||
}
|
||||
|
||||
/* ============ 表格 ============ */
|
||||
.el-table {
|
||||
color: var(--s2-text-regular);
|
||||
border-radius: var(--s2-radius);
|
||||
|
||||
th.el-table__cell {
|
||||
background-color: var(--s2-bg-subtle);
|
||||
color: var(--s2-text-secondary);
|
||||
font-weight: 500;
|
||||
padding: 11px 0;
|
||||
}
|
||||
|
||||
td.el-table__cell {
|
||||
padding: 11px 0;
|
||||
border-bottom-color: var(--s2-border-light);
|
||||
}
|
||||
|
||||
.cell {
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
&--border,
|
||||
&--group td.el-table__cell,
|
||||
&--group th.el-table__cell {
|
||||
border-color: var(--s2-border-light);
|
||||
}
|
||||
|
||||
.el-table__body tr.hover-row > td.el-table__cell,
|
||||
.el-table__body tr:hover > td.el-table__cell {
|
||||
background-color: var(--s2-primary-soft);
|
||||
}
|
||||
|
||||
&__footer-wrapper,
|
||||
&__footer {
|
||||
td.el-table__cell {
|
||||
background-color: var(--s2-bg-subtle);
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.el-table--enable-row-transition .el-table__body td.el-table__cell {
|
||||
transition: background-color 0.15s ease;
|
||||
}
|
||||
|
||||
/* ============ 标签 ============ */
|
||||
.el-tag {
|
||||
border-radius: 9999px;
|
||||
border-color: transparent;
|
||||
padding: 0 10px;
|
||||
height: 22px;
|
||||
line-height: 22px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.el-tag--medium {
|
||||
height: 22px;
|
||||
line-height: 22px;
|
||||
}
|
||||
|
||||
.el-tag--small {
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.el-tag--mini {
|
||||
height: 18px;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
.el-tag--info {
|
||||
background-color: var(--s2-bg-muted);
|
||||
color: var(--s2-text-regular);
|
||||
}
|
||||
|
||||
/* ============ 弹窗 / 抽屉 ============ */
|
||||
.el-dialog {
|
||||
border-radius: var(--s2-radius-lg);
|
||||
box-shadow: $s2-shadow-xl;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.el-dialog__header {
|
||||
padding: 18px 24px;
|
||||
border-bottom: 1px solid var(--s2-border-light);
|
||||
}
|
||||
|
||||
.el-dialog__title {
|
||||
font-size: 17px;
|
||||
font-weight: 600;
|
||||
color: var(--s2-text-primary);
|
||||
}
|
||||
|
||||
.el-dialog__headerbtn {
|
||||
top: 16px;
|
||||
right: 16px;
|
||||
}
|
||||
|
||||
.el-dialog__body {
|
||||
padding: 20px 24px;
|
||||
color: var(--s2-text-regular);
|
||||
}
|
||||
|
||||
.el-dialog__footer {
|
||||
padding: 16px 24px;
|
||||
border-top: 1px solid var(--s2-border-light);
|
||||
background: rgba(249, 250, 251, 0.6);
|
||||
}
|
||||
|
||||
.el-drawer__header {
|
||||
margin-bottom: 0;
|
||||
padding: 18px 24px;
|
||||
border-bottom: 1px solid var(--s2-border-light);
|
||||
color: var(--s2-text-primary);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.el-drawer__body {
|
||||
padding: 20px 24px;
|
||||
}
|
||||
|
||||
/* ============ 下拉 / 气泡 ============ */
|
||||
.el-popper {
|
||||
border-radius: var(--s2-radius) !important;
|
||||
border-color: var(--s2-border) !important;
|
||||
box-shadow: $s2-shadow-xl !important;
|
||||
}
|
||||
|
||||
.el-dropdown-menu {
|
||||
border-radius: var(--s2-radius);
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
.el-dropdown-menu__item {
|
||||
border-radius: 8px;
|
||||
color: var(--s2-text-regular);
|
||||
|
||||
&:not(.is-disabled):hover {
|
||||
background-color: var(--s2-bg-muted);
|
||||
color: var(--s2-primary-hover);
|
||||
}
|
||||
}
|
||||
|
||||
.el-select-dropdown__item.selected {
|
||||
color: var(--s2-primary-hover);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* ============ 分页 ============ */
|
||||
.el-pagination {
|
||||
font-weight: 400;
|
||||
color: var(--s2-text-secondary);
|
||||
|
||||
button,
|
||||
.el-pager li {
|
||||
border-radius: 10px;
|
||||
min-width: 32px;
|
||||
height: 32px;
|
||||
line-height: 32px;
|
||||
font-weight: 500;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.el-pager li:not(.disabled).active {
|
||||
background-image: linear-gradient(90deg, $s2-primary-500, $s2-primary-600);
|
||||
color: #fff;
|
||||
box-shadow: 0 4px 6px -1px rgba(24, 144, 255, 0.25);
|
||||
}
|
||||
|
||||
.el-pager li:not(.disabled):hover {
|
||||
color: var(--s2-primary-hover);
|
||||
}
|
||||
|
||||
button:disabled {
|
||||
color: var(--s2-text-muted);
|
||||
}
|
||||
}
|
||||
|
||||
/* ============ 标签页 ============ */
|
||||
.el-tabs__nav-wrap::after {
|
||||
height: 1px;
|
||||
background-color: var(--s2-border-light);
|
||||
}
|
||||
|
||||
.el-tabs__item {
|
||||
font-weight: 500;
|
||||
color: var(--s2-text-secondary);
|
||||
|
||||
&:hover,
|
||||
&.is-active {
|
||||
color: var(--s2-primary-hover);
|
||||
}
|
||||
}
|
||||
|
||||
.el-tabs__active-bar {
|
||||
background-color: var(--s2-primary);
|
||||
height: 3px;
|
||||
border-radius: 9999px;
|
||||
}
|
||||
|
||||
.el-tabs--border-card {
|
||||
border-radius: var(--s2-radius-lg);
|
||||
border-color: var(--s2-border-light);
|
||||
box-shadow: var(--s2-shadow-card);
|
||||
}
|
||||
|
||||
/* ============ 开关 ============ */
|
||||
.el-switch.is-checked .el-switch__core {
|
||||
background-color: var(--s2-primary);
|
||||
border-color: var(--s2-primary);
|
||||
}
|
||||
|
||||
/* ============ 提示 / 通知 ============ */
|
||||
.el-message {
|
||||
border-radius: var(--s2-radius);
|
||||
border-width: 0;
|
||||
box-shadow: $s2-shadow-xl;
|
||||
min-width: 320px;
|
||||
}
|
||||
|
||||
.el-notification {
|
||||
border-radius: var(--s2-radius);
|
||||
border-color: var(--s2-border-light);
|
||||
box-shadow: $s2-shadow-xl;
|
||||
}
|
||||
|
||||
.el-message-box {
|
||||
border-radius: var(--s2-radius-lg);
|
||||
padding-bottom: 16px;
|
||||
}
|
||||
|
||||
.el-message-box__header {
|
||||
padding-bottom: 12px;
|
||||
}
|
||||
|
||||
.el-message-box__title {
|
||||
font-weight: 600;
|
||||
color: var(--s2-text-primary);
|
||||
}
|
||||
|
||||
/* ============ 描述列表 ============ */
|
||||
.el-descriptions__header {
|
||||
font-weight: 600;
|
||||
color: var(--s2-text-primary);
|
||||
}
|
||||
|
||||
.el-descriptions-item__label.is-bordered-label {
|
||||
background: var(--s2-bg-subtle);
|
||||
color: var(--s2-text-secondary);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* ============ 树 / 步骤 / 时间线 ============ */
|
||||
.el-tree-node__content {
|
||||
border-radius: 8px;
|
||||
height: 34px;
|
||||
}
|
||||
|
||||
.el-tree-node__content:hover {
|
||||
background-color: var(--s2-primary-soft);
|
||||
}
|
||||
|
||||
.el-tree-node:focus > .el-tree-node__content,
|
||||
.el-tree-node.is-current > .el-tree-node__content {
|
||||
background-color: var(--s2-primary-soft-strong) !important;
|
||||
color: var(--s2-primary-active);
|
||||
}
|
||||
|
||||
.el-step__head.is-process {
|
||||
color: var(--s2-primary);
|
||||
border-color: var(--s2-primary);
|
||||
}
|
||||
|
||||
.el-step__title.is-process {
|
||||
color: var(--s2-primary);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
/* ============ 面包屑 ============ */
|
||||
.el-breadcrumb {
|
||||
font-size: 14px;
|
||||
line-height: var(--s2-header-height);
|
||||
|
||||
.el-breadcrumb__inner {
|
||||
color: var(--s2-text-secondary);
|
||||
}
|
||||
|
||||
.el-breadcrumb__item:last-child .el-breadcrumb__inner {
|
||||
color: var(--s2-text-primary);
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
/* ============ 空态 ============ */
|
||||
.el-empty__description p {
|
||||
color: var(--s2-text-secondary);
|
||||
}
|
||||
|
|
@ -1,28 +1,57 @@
|
|||
/**
|
||||
* I think element-ui's default theme color is too light for long-term use.
|
||||
* So I modified the default color and you can modify it to your liking.
|
||||
**/
|
||||
* Element UI 主题定制
|
||||
* 目标:让若依原生的 el-* 组件对齐 sub2api 的设计语言
|
||||
* (蓝色主色 / slate 中性色 / 12px 圆角 / 柔和阴影 / system-ui 字体)。
|
||||
*
|
||||
* 这里只覆盖 theme-chalk 的 SCSS 变量,编译期生效,
|
||||
* 运行时的 CSS 变量见 tokens.scss,视觉覆盖层见 element-overrides.scss。
|
||||
*/
|
||||
|
||||
/* theme color */
|
||||
$--color-primary: #1890ff;
|
||||
$--color-success: #13ce66;
|
||||
$--color-warning: #ffba00;
|
||||
$--color-danger: #ff4949;
|
||||
// $--color-info: #1E1E1E;
|
||||
@import './tokens.scss';
|
||||
|
||||
$--button-font-weight: 400;
|
||||
/* ---------- 主题色 ---------- */
|
||||
/* 主色与重构前系统保持一致(#1890ff),600 只用于 hover / 渐变收尾 */
|
||||
$--color-primary: $s2-primary-500;
|
||||
$--color-success: $s2-emerald-500;
|
||||
$--color-warning: $s2-amber-500;
|
||||
$--color-danger: $s2-red-500;
|
||||
$--color-info: $s2-accent-500;
|
||||
|
||||
// $--color-text-regular: #1f2d3d;
|
||||
/* ---------- 文字 ---------- */
|
||||
$--color-text-primary: $s2-gray-900;
|
||||
$--color-text-regular: $s2-gray-700;
|
||||
$--color-text-secondary: $s2-gray-500;
|
||||
$--color-text-placeholder: $s2-gray-400;
|
||||
|
||||
$--border-color-light: #dfe4ed;
|
||||
$--border-color-lighter: #e6ebf5;
|
||||
/* ---------- 边框 / 填充 ---------- */
|
||||
$--border-color-base: $s2-gray-200;
|
||||
$--border-color-light: $s2-gray-200;
|
||||
$--border-color-lighter: $s2-gray-100;
|
||||
$--border-color-extra-light: $s2-gray-50;
|
||||
$--background-color-base: $s2-gray-50;
|
||||
|
||||
$--table-border: 1px solid #dfe6ec;
|
||||
/* ---------- 圆角 ---------- */
|
||||
$--border-radius-base: 10px;
|
||||
$--border-radius-small: 8px;
|
||||
|
||||
/* ---------- 阴影 ---------- */
|
||||
$--box-shadow-light: 0 4px 16px rgba(15, 23, 42, 0.06);
|
||||
$--box-shadow-base: 0 10px 30px rgba(15, 23, 42, 0.1);
|
||||
$--box-shadow-dark: 0 16px 40px rgba(15, 23, 42, 0.14);
|
||||
|
||||
/* ---------- 字体 ---------- */
|
||||
$--button-font-weight: 500;
|
||||
$--font-size-base: 14px;
|
||||
|
||||
/* ---------- 表格 ---------- */
|
||||
$--table-border: 1px solid #{$s2-gray-100};
|
||||
$--table-header-font-color: $s2-gray-500;
|
||||
$--table-font-color: $s2-gray-700;
|
||||
|
||||
/* icon font path, required */
|
||||
$--font-path: '~element-ui/lib/theme-chalk/fonts';
|
||||
|
||||
@import "~element-ui/packages/theme-chalk/src/index";
|
||||
@import '~element-ui/packages/theme-chalk/src/index';
|
||||
|
||||
// the :export directive is the magic sauce for webpack
|
||||
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass
|
||||
|
|
|
|||
|
|
@ -1,7 +1,10 @@
|
|||
@import './variables.scss';
|
||||
@import './mixin.scss';
|
||||
@import './tokens.scss';
|
||||
@import './transition.scss';
|
||||
@import './element-ui.scss';
|
||||
@import './sub2api.scss';
|
||||
@import './element-overrides.scss';
|
||||
@import './sidebar.scss';
|
||||
@import './btn.scss';
|
||||
|
||||
|
|
@ -10,11 +13,11 @@ body {
|
|||
-moz-osx-font-smoothing: grayscale;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
text-rendering: optimizeLegibility;
|
||||
font-family: Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, Microsoft YaHei, Arial, sans-serif;
|
||||
font-family: $s2-font-sans;
|
||||
}
|
||||
|
||||
label {
|
||||
font-weight: 700;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
html {
|
||||
|
|
@ -120,8 +123,121 @@ aside {
|
|||
}
|
||||
|
||||
//main-container全局样式
|
||||
// 对齐 sub2api 的 AppLayout: main { padding: p-4 md:p-6 lg:p-8 }
|
||||
// 注意:这里只能保留 position: relative,不要再加 z-index。
|
||||
// 页面里的 el-dialog / el-drawer 默认不 append-to-body,节点就在本容器内,
|
||||
// 一旦本容器形成 stacking context,挂在 body 上的遮罩层会盖到弹窗上面。
|
||||
.app-container {
|
||||
padding: 20px;
|
||||
position: relative;
|
||||
padding: 16px;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
padding: 24px;
|
||||
}
|
||||
|
||||
@media (min-width: 1024px) {
|
||||
padding: 32px;
|
||||
}
|
||||
}
|
||||
|
||||
// 页面通用容器:卡片之间的垂直节奏(sub2api: flex flex-col gap-6)
|
||||
.page-stack {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 24px;
|
||||
}
|
||||
|
||||
// 查询区卡片:sub2api 把搜索/筛选放在独立的浮动面板里
|
||||
.filter-card {
|
||||
background: var(--s2-bg-card);
|
||||
border: 1px solid var(--s2-border-light);
|
||||
border-radius: var(--s2-radius-lg);
|
||||
box-shadow: var(--s2-shadow-card);
|
||||
padding: 20px 24px 4px;
|
||||
|
||||
.el-form-item {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
// 表格区卡片
|
||||
.table-card {
|
||||
background: var(--s2-bg-card);
|
||||
border: 1px solid var(--s2-border-light);
|
||||
border-radius: var(--s2-radius-lg);
|
||||
box-shadow: var(--s2-shadow-card);
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.table-card__toolbar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
padding: 14px 20px;
|
||||
border-bottom: 1px solid var(--s2-border-light);
|
||||
|
||||
// 工具栏行由 right-toolbar 撑满剩余宽度,并去掉若依自带的下边距
|
||||
.mb8 {
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
.el-col {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
> .top-right-btn,
|
||||
.right-toolbar {
|
||||
margin-left: auto;
|
||||
}
|
||||
}
|
||||
|
||||
// 老结构列表页(查询卡片 + el-row.mb8 工具栏 + 裸表格)的垂直节奏。
|
||||
// 这类页面没有 .page-stack,工具栏原本紧贴查询卡片的下边框、表格又只隔 8px,
|
||||
// 看起来就是挤成一团;这里统一把三段拉开,和新版卡片的节奏保持一致。
|
||||
.filter-card + .mb8,
|
||||
.app-container > .mb8 {
|
||||
margin-top: 20px;
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
|
||||
// 查询卡片最后一行原本只剩 4px 内边距,输入框快贴到边框上
|
||||
.filter-card {
|
||||
padding-bottom: 8px;
|
||||
|
||||
.el-form-item:last-child {
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
}
|
||||
|
||||
// 没套 .table-card 的表格给出卡片边界,表头不再和工具栏糊在一起
|
||||
.app-container > .el-table {
|
||||
border: 1px solid var(--s2-border-light);
|
||||
border-radius: var(--s2-radius-lg);
|
||||
box-shadow: var(--s2-shadow-card);
|
||||
|
||||
.el-table__header-wrapper th:first-child .cell,
|
||||
.el-table__body-wrapper td:first-child .cell {
|
||||
border-top-left-radius: var(--s2-radius-lg);
|
||||
}
|
||||
}
|
||||
|
||||
// 表格放进卡片后不再需要自带的外框线
|
||||
.table-card .el-table,
|
||||
.table-card .el-table__inner-wrapper::before {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.table-card .el-table tr:last-child td.el-table__cell {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.table-card__footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
padding: 12px 20px;
|
||||
border-top: 1px solid var(--s2-border-light);
|
||||
}
|
||||
|
||||
.components-container {
|
||||
|
|
@ -176,3 +292,38 @@ aside {
|
|||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
// 卡片之间的垂直节奏:查询区 -> 表格区 -> 明细表格。
|
||||
// 还有一批列表页(备货管理、在线用户、审批已处理等)查询卡片后面直接跟裸表格,
|
||||
// 中间没有工具栏,两块会完全贴在一起,这里一并拉开。
|
||||
.filter-card + .table-card,
|
||||
.filter-card + .filter-card,
|
||||
.table-card + .table-card,
|
||||
.filter-card + .el-table {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
// 弹窗 / 抽屉内部不叠卡片:去掉筛选区与表格区的描边、阴影和圆角
|
||||
.el-dialog,
|
||||
.el-drawer__body {
|
||||
.filter-card,
|
||||
.table-card {
|
||||
background: transparent;
|
||||
border: none;
|
||||
border-radius: 0;
|
||||
box-shadow: none;
|
||||
// 弹窗内不裁切::popper-append-to-body="false" 的下拉仍需正常展开
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
.filter-card {
|
||||
padding: 0 0 4px;
|
||||
}
|
||||
|
||||
// 弹窗/抽屉里的卡片没有描边,间距是唯一分隔,裸表格同样要留白
|
||||
.filter-card + .table-card,
|
||||
.table-card + .table-card,
|
||||
.filter-card + .el-table {
|
||||
margin-top: 16px;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,6 +104,18 @@
|
|||
margin-left: 1px;
|
||||
}
|
||||
}
|
||||
|
||||
// 固定列覆盖层:强制不透明背景 + 提升层级,防止横向滚动时内容穿透固定列
|
||||
.el-table__fixed,
|
||||
.el-table__fixed-right {
|
||||
background-color: #fff;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
.el-table__fixed .el-table__cell,
|
||||
.el-table__fixed-right .el-table__cell {
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
/** 表单布局 **/
|
||||
|
|
|
|||
|
|
@ -1,31 +1,117 @@
|
|||
#app {
|
||||
/**
|
||||
* 侧边栏
|
||||
* 视觉语言移植自 sub2api AppSidebar.vue:
|
||||
* 白底 + 右侧细分割线,导航项为圆角胶囊,选中态是 primary-50 底 + primary-600 文字。
|
||||
* 布局骨架(固定定位 / 折叠 / 移动端抽屉)沿用若依原有实现。
|
||||
*/
|
||||
|
||||
/* ---------- 菜单行对齐 ---------- */
|
||||
/* 图标盒子尺寸与图标—文案间距,展开态和折叠弹出菜单共用 */
|
||||
$sidebar-icon-size: 16px;
|
||||
$sidebar-icon-gap: 8px;
|
||||
|
||||
/*
|
||||
* 菜单行(一级项 / 分组标题 / 子项)统一用 flex 做视觉居中。
|
||||
* 原来靠 line-height + vertical-align 对齐,SvgIcon 组件自带的
|
||||
* vertical-align: -0.15em 会让图标中心高于文字视觉中心约 3px,
|
||||
* 且不同 viewBox 的图标高低不一;flex 下图标盒子直接对齐行中心。
|
||||
*/
|
||||
@mixin menu-row-align($icon-size: $sidebar-icon-size, $icon-gap: $sidebar-icon-gap) {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.svg-icon,
|
||||
[class^='el-icon-'] {
|
||||
flex: 0 0 auto;
|
||||
display: block;
|
||||
width: $icon-size;
|
||||
height: $icon-size;
|
||||
margin-right: $icon-gap;
|
||||
font-size: $icon-size;
|
||||
line-height: 1;
|
||||
text-align: center;
|
||||
// 图标颜色跟随菜单文字(含 hover / 选中态)
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
// 子级菜单的 Dot 占位点:字形只占画布约 30%,按整格间距点位和文字会显得松散,
|
||||
// 单独收紧后它与文案的视觉距离才和真实图标一致(class 由 Sidebar/Item.vue 打标)
|
||||
.svg-icon.menu-icon-bullet {
|
||||
margin-right: 3px;
|
||||
}
|
||||
|
||||
// 一级菜单没配图标时的空槽位,把图标列留给文案对齐(class 由 Sidebar/Item.vue 打标)
|
||||
.menu-icon-placeholder {
|
||||
flex: 0 0 auto;
|
||||
display: block;
|
||||
position: relative;
|
||||
width: $icon-size;
|
||||
height: $icon-size;
|
||||
margin-right: $icon-gap;
|
||||
}
|
||||
|
||||
// flex 下省略号要由文案自己负责,否则长菜单名会被直接裁掉
|
||||
> span:not(.menu-icon-placeholder) {
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
// 折叠态下 element 会把菜单项内容包进 tooltip 触发层(该层被绝对定位铺满整行,并自带
|
||||
// 内联 display: inline-block 与 padding: 0 20px),这层也要 flex,图标才会跟着行一起居中
|
||||
> .el-tooltip,
|
||||
> .el-tooltip > div:not(.el-tooltip__popper) {
|
||||
display: flex !important;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- 菜单层级(缩进 / 行高 / 引导线) ---------- */
|
||||
/*
|
||||
* Element 的缩进是每个 submenu 祖先 +20px(写成行内 padding-left),再叠加嵌套 .el-menu
|
||||
* 自身的 12px 横向 padding,实际每级 32px;四级菜单文案起点到了 128px,可用宽度不到 80px,
|
||||
* “应收收款核销记录”这类名称会被裁断。这里把横向缩进收回来交给 menu-depth-* 统一控制:
|
||||
* 嵌套菜单不留横向 padding,胶囊左内边距 12px,三级起每级只走 16px,
|
||||
* 层级关系改由竖向引导线表达。类名由 Sidebar/SidebarItem.vue 按递归深度输出(最深 5 级)。
|
||||
*/
|
||||
$sidebar-indent-by-depth: (1: 12px, 2: 28px, 3: 44px, 4: 60px, 5: 76px);
|
||||
$sidebar-row-height: (1: 42px, 2: 38px, 3: 34px, 4: 32px, 5: 32px);
|
||||
|
||||
#app {
|
||||
/* 同上:这里不能带 z-index,否则页面内的弹窗 / 抽屉会被 body 上的遮罩盖住 */
|
||||
.main-container {
|
||||
height: 100%;
|
||||
transition: margin-left .28s;
|
||||
transition: margin-left 0.28s;
|
||||
margin-left: $base-sidebar-width;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.sidebarHide {
|
||||
margin-left: 0!important;
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
|
||||
.sidebar-container {
|
||||
-webkit-transition: width .28s;
|
||||
-webkit-transition: width 0.28s;
|
||||
transition: width 0.28s;
|
||||
width: $base-sidebar-width !important;
|
||||
background-color: $base-menu-background;
|
||||
height: 100%;
|
||||
position: fixed;
|
||||
font-size: 0px;
|
||||
font-size: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 1001;
|
||||
overflow: hidden;
|
||||
-webkit-box-shadow: 2px 0 6px rgba(0,21,41,.35);
|
||||
box-shadow: 0px 0px 8px 0px rgba(0, 0, 0, 0.1);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: $base-menu-light-background;
|
||||
border-right: 1px solid $s2-gray-200;
|
||||
|
||||
&.is-dark {
|
||||
background-color: $base-menu-dark-background;
|
||||
border-right-color: $s2-accent-800;
|
||||
}
|
||||
|
||||
// reset element-ui css
|
||||
.horizontal-collapse-transition {
|
||||
|
|
@ -37,83 +123,204 @@
|
|||
}
|
||||
|
||||
.el-scrollbar__bar.is-vertical {
|
||||
right: 0px;
|
||||
right: 2px;
|
||||
}
|
||||
|
||||
.el-scrollbar {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
&.has-logo {
|
||||
.el-scrollbar {
|
||||
height: calc(100% - 50px);
|
||||
}
|
||||
flex: 1 1 auto;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
.is-horizontal {
|
||||
display: none;
|
||||
}
|
||||
|
||||
a {
|
||||
// 这条 reset 只服务于菜单里的 app-link(每个菜单项外面套一个 a)。
|
||||
// 它带 #app 前缀,特异性高于组件里的 scoped 样式,写宽到整个 sidebar-container
|
||||
// 会把 logo 链接的 display: flex 也压成块级,名称就被挤到图标下面另起一行。
|
||||
.el-menu a {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.svg-icon {
|
||||
margin-right: 16px;
|
||||
}
|
||||
|
||||
.el-menu {
|
||||
border: none;
|
||||
height: 100%;
|
||||
width: 100% !important;
|
||||
background-color: transparent !important;
|
||||
padding: 12px;
|
||||
}
|
||||
|
||||
.el-menu-item, .el-submenu__title {
|
||||
.el-menu-item,
|
||||
.el-submenu__title {
|
||||
@include menu-row-align;
|
||||
overflow: hidden !important;
|
||||
text-overflow: ellipsis !important;
|
||||
white-space: nowrap !important;
|
||||
}
|
||||
// sub2api sidebar-link: 圆角胶囊 + 10px 纵向留白
|
||||
height: 42px;
|
||||
line-height: 42px;
|
||||
margin-bottom: 2px;
|
||||
border-radius: 12px;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: $s2-gray-600;
|
||||
background-color: transparent !important;
|
||||
transition: background-color 0.2s, color 0.2s;
|
||||
|
||||
// menu hover
|
||||
.submenu-title-noDropdown,
|
||||
.el-submenu__title {
|
||||
&:hover {
|
||||
background-color: rgba(0, 0, 0, 0.06) !important;
|
||||
background-color: $s2-gray-100 !important;
|
||||
color: $s2-gray-900 !important;
|
||||
}
|
||||
}
|
||||
|
||||
& .theme-dark .is-active > .el-submenu__title {
|
||||
color: $base-menu-color-active !important;
|
||||
}
|
||||
|
||||
& .nest-menu .el-submenu>.el-submenu__title,
|
||||
& .el-submenu .el-menu-item {
|
||||
min-width: $base-sidebar-width !important;
|
||||
// 选中态:primary-50 胶囊 + 主色文字
|
||||
.el-menu-item.is-active {
|
||||
background-color: $s2-primary-50 !important;
|
||||
color: $s2-primary-600 !important;
|
||||
font-weight: 600;
|
||||
|
||||
&:hover {
|
||||
background-color: rgba(0, 0, 0, 0.06) !important;
|
||||
background-color: $s2-primary-100 !important;
|
||||
color: $s2-primary-700 !important;
|
||||
}
|
||||
}
|
||||
|
||||
& .theme-dark .nest-menu .el-submenu>.el-submenu__title,
|
||||
& .theme-dark .el-submenu .el-menu-item {
|
||||
background-color: $base-sub-menu-background !important;
|
||||
// 嵌套子菜单:横向缩进交给 menu-depth-*,这里只留一点纵向留白
|
||||
.el-menu--inline {
|
||||
position: relative;
|
||||
padding: 0 0 4px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: $base-sub-menu-hover !important;
|
||||
@each $d, $pad in $sidebar-indent-by-depth {
|
||||
$child-h: if($d >= 5, 32px, map-get($sidebar-row-height, $d + 1));
|
||||
|
||||
// Element 的缩进写在行内样式上,覆盖它必须带 !important
|
||||
.el-menu-item.menu-depth-#{$d},
|
||||
.el-submenu.menu-depth-#{$d} > .el-submenu__title {
|
||||
min-width: auto !important;
|
||||
padding-left: $pad !important;
|
||||
height: map-get($sidebar-row-height, $d);
|
||||
line-height: map-get($sidebar-row-height, $d);
|
||||
}
|
||||
|
||||
// 子级组左侧引导线:竖在上一层图标的中心,末端停在最后一行的行高中心
|
||||
.el-submenu.menu-depth-#{$d} > .el-menu--inline::before {
|
||||
content: '';
|
||||
// element-ui 的 .el-menu::before 是 clearfix(display: table),
|
||||
// 绝对定位下表格盒会按内容高度塌成 0,这里必须显式回到 block
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: $child-h / 2 + 6px;
|
||||
left: $pad + $sidebar-icon-size / 2 - 0.5px;
|
||||
width: 1px;
|
||||
background-color: $s2-gray-200;
|
||||
}
|
||||
}
|
||||
|
||||
// 三四级行高更矮,胶囊圆角跟着收一档;标题不再加粗,靠缩进和引导线分层
|
||||
.el-menu-item.menu-depth-3,
|
||||
.el-menu-item.menu-depth-4,
|
||||
.el-menu-item.menu-depth-5,
|
||||
.el-submenu.menu-depth-3 > .el-submenu__title,
|
||||
.el-submenu.menu-depth-4 > .el-submenu__title,
|
||||
.el-submenu.menu-depth-5 > .el-submenu__title {
|
||||
border-radius: 10px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
// 深层叶子行右侧没有展开箭头,收一点留白把宽度让给菜单名,
|
||||
// 否则“应收收款核销记录”这类 8 字名称还是会出省略号
|
||||
.el-menu-item.menu-depth-3,
|
||||
.el-menu-item.menu-depth-4,
|
||||
.el-menu-item.menu-depth-5 {
|
||||
padding-right: 12px !important;
|
||||
}
|
||||
|
||||
// 四级是叶子节点,浅色主题下文字再轻一档;排除选中态避免盖掉主色,
|
||||
// 深色主题沿用 accent-300(gray-500 在深色底上对比度不够)
|
||||
&:not(.is-dark) {
|
||||
.el-menu-item.menu-depth-4:not(.is-active),
|
||||
.el-menu-item.menu-depth-5:not(.is-active) {
|
||||
color: $s2-gray-500;
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- 深色分支 ---------- */
|
||||
&.is-dark {
|
||||
.el-submenu > .el-menu--inline::before {
|
||||
background-color: rgba(255, 255, 255, 0.12);
|
||||
}
|
||||
|
||||
.el-menu-item,
|
||||
.el-submenu__title {
|
||||
color: $s2-accent-300;
|
||||
|
||||
&:hover {
|
||||
background-color: $s2-accent-800 !important;
|
||||
color: #fff !important;
|
||||
}
|
||||
}
|
||||
|
||||
.el-menu-item.is-active {
|
||||
background-color: rgba(24, 144, 255, 0.16) !important;
|
||||
color: $s2-primary-300 !important;
|
||||
|
||||
&:hover {
|
||||
background-color: rgba(24, 144, 255, 0.24) !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ---------- 折叠态 ---------- */
|
||||
.hideSidebar {
|
||||
.sidebar-container {
|
||||
width: 54px !important;
|
||||
width: $s2-sidebar-collapsed !important;
|
||||
|
||||
.el-menu {
|
||||
padding: 12px 8px;
|
||||
}
|
||||
|
||||
.el-menu-item,
|
||||
.el-submenu__title {
|
||||
padding: 0 !important;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
// 折叠态图标位于 tooltip 触发层内,同样水平居中
|
||||
.el-menu-item > .el-tooltip,
|
||||
.el-menu-item > .el-tooltip > div:not(.el-tooltip__popper) {
|
||||
justify-content: center;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.svg-icon,
|
||||
.svg-icon.menu-icon-bullet,
|
||||
.el-menu-item [class^='el-icon-'],
|
||||
.el-submenu__title [class^='el-icon-'] {
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
// 折叠态只留图标:menu-depth-* 的缩进选择器比上面那条更具体,
|
||||
// 不逐层取消掉的话图标会被 padding-left 挤离行中心
|
||||
@each $d, $pad in $sidebar-indent-by-depth {
|
||||
.el-menu-item.menu-depth-#{$d},
|
||||
.el-submenu.menu-depth-#{$d} > .el-submenu__title {
|
||||
padding-left: 0 !important;
|
||||
}
|
||||
}
|
||||
|
||||
// 折叠态没有文案需要对齐,占位槽直接收掉
|
||||
.menu-icon-placeholder {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.main-container {
|
||||
margin-left: 54px;
|
||||
margin-left: $s2-sidebar-collapsed;
|
||||
}
|
||||
|
||||
.submenu-title-noDropdown {
|
||||
|
|
@ -122,30 +329,21 @@
|
|||
|
||||
.el-tooltip {
|
||||
padding: 0 !important;
|
||||
|
||||
.svg-icon {
|
||||
margin-left: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.el-submenu {
|
||||
overflow: hidden;
|
||||
|
||||
&>.el-submenu__title {
|
||||
& > .el-submenu__title {
|
||||
padding: 0 !important;
|
||||
|
||||
.svg-icon {
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.el-menu--collapse {
|
||||
.el-submenu {
|
||||
&>.el-submenu__title {
|
||||
&>span {
|
||||
& > .el-submenu__title {
|
||||
& > span {
|
||||
height: 0;
|
||||
width: 0;
|
||||
overflow: hidden;
|
||||
|
|
@ -161,14 +359,14 @@
|
|||
min-width: $base-sidebar-width !important;
|
||||
}
|
||||
|
||||
// mobile responsive
|
||||
/* ---------- 移动端 ---------- */
|
||||
.mobile {
|
||||
.main-container {
|
||||
margin-left: 0px;
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
.sidebar-container {
|
||||
transition: transform .28s;
|
||||
transition: transform 0.28s;
|
||||
width: $base-sidebar-width !important;
|
||||
}
|
||||
|
||||
|
|
@ -182,7 +380,6 @@
|
|||
}
|
||||
|
||||
.withoutAnimation {
|
||||
|
||||
.main-container,
|
||||
.sidebar-container {
|
||||
transition: none;
|
||||
|
|
@ -190,38 +387,29 @@
|
|||
}
|
||||
}
|
||||
|
||||
// when menu collapsed
|
||||
/* ---------- 折叠后的弹出子菜单 ---------- */
|
||||
.el-menu--vertical {
|
||||
&>.el-menu {
|
||||
.svg-icon {
|
||||
margin-right: 16px;
|
||||
& > .el-menu {
|
||||
.el-menu-item,
|
||||
.el-submenu__title {
|
||||
@include menu-row-align;
|
||||
}
|
||||
}
|
||||
|
||||
.nest-menu .el-submenu>.el-submenu__title,
|
||||
.el-menu-item {
|
||||
&:hover {
|
||||
// you can use $subMenuHover
|
||||
background-color: rgba(0, 0, 0, 0.06) !important;
|
||||
}
|
||||
}
|
||||
& > .el-menu--popup {
|
||||
border-radius: 12px;
|
||||
padding: 6px;
|
||||
box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
|
||||
|
||||
// the scroll bar appears when the subMenu is too long
|
||||
>.el-menu--popup {
|
||||
.el-menu-item,
|
||||
.el-submenu__title {
|
||||
border-radius: 10px;
|
||||
height: 38px;
|
||||
line-height: 38px;
|
||||
}
|
||||
|
||||
// 滚动条
|
||||
max-height: 100vh;
|
||||
overflow-y: auto;
|
||||
|
||||
&::-webkit-scrollbar-track-piece {
|
||||
background: #d3dce6;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
}
|
||||
|
||||
&::-webkit-scrollbar-thumb {
|
||||
background: #99a9bf;
|
||||
border-radius: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,697 @@
|
|||
/**
|
||||
* sub2api 组件样式层
|
||||
* 逐条移植自 sub2api/frontend/src/style.css(Tailwind @apply 展开为等价的纯 CSS),
|
||||
* 类名保持一致,因此 sub2api 的组件可以原样复用。
|
||||
*/
|
||||
@import './tokens-vars.scss';
|
||||
|
||||
|
||||
/* ============ 按钮 ============ */
|
||||
.s2-btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
gap: 8px;
|
||||
border: none;
|
||||
border-radius: var(--s2-radius);
|
||||
padding: 10px 16px;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
line-height: 1.4;
|
||||
white-space: nowrap;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s ease-out;
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
box-shadow: 0 0 0 2px var(--s2-primary-soft), 0 0 0 4px rgba(24, 144, 255, 0.35);
|
||||
}
|
||||
|
||||
&:disabled,
|
||||
&.is-disabled {
|
||||
transform: none;
|
||||
cursor: not-allowed;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
&:active:not(:disabled) {
|
||||
transform: scale(0.98);
|
||||
}
|
||||
}
|
||||
|
||||
.s2-btn-primary {
|
||||
background-image: linear-gradient(90deg, $s2-primary-500, $s2-primary-600);
|
||||
color: #fff;
|
||||
box-shadow: 0 4px 6px -1px rgba(24, 144, 255, 0.25), 0 2px 4px -2px rgba(24, 144, 255, 0.25);
|
||||
|
||||
&:hover:not(:disabled) {
|
||||
background-image: linear-gradient(90deg, $s2-primary-600, $s2-primary-700);
|
||||
box-shadow: 0 10px 15px -3px rgba(24, 144, 255, 0.3), 0 4px 6px -4px rgba(24, 144, 255, 0.3);
|
||||
}
|
||||
}
|
||||
|
||||
.s2-btn-secondary {
|
||||
background: var(--s2-bg-card);
|
||||
color: var(--s2-text-regular);
|
||||
border: 1px solid var(--s2-border);
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||
|
||||
&:hover:not(:disabled) {
|
||||
background: var(--s2-bg-subtle);
|
||||
border-color: var(--s2-border-strong);
|
||||
}
|
||||
}
|
||||
|
||||
.s2-btn-ghost {
|
||||
background: transparent;
|
||||
color: var(--s2-text-secondary);
|
||||
|
||||
&:hover:not(:disabled) {
|
||||
background: var(--s2-bg-muted);
|
||||
color: var(--s2-text-primary);
|
||||
}
|
||||
}
|
||||
|
||||
.s2-btn-danger {
|
||||
background-image: linear-gradient(90deg, $s2-red-500, $s2-red-600);
|
||||
color: #fff;
|
||||
box-shadow: 0 4px 6px -1px rgba(239, 68, 68, 0.25);
|
||||
|
||||
&:hover:not(:disabled) {
|
||||
background-image: linear-gradient(90deg, $s2-red-600, $s2-red-700);
|
||||
}
|
||||
}
|
||||
|
||||
.s2-btn-success {
|
||||
background-image: linear-gradient(90deg, $s2-emerald-500, $s2-emerald-600);
|
||||
color: #fff;
|
||||
box-shadow: 0 4px 6px -1px rgba(16, 185, 129, 0.25);
|
||||
|
||||
&:hover:not(:disabled) {
|
||||
background-image: linear-gradient(90deg, $s2-emerald-600, $s2-emerald-700);
|
||||
}
|
||||
}
|
||||
|
||||
.s2-btn-warning {
|
||||
background-image: linear-gradient(90deg, $s2-amber-500, $s2-amber-600);
|
||||
color: #fff;
|
||||
box-shadow: 0 4px 6px -1px rgba(245, 158, 11, 0.25);
|
||||
|
||||
&:hover:not(:disabled) {
|
||||
background-image: linear-gradient(90deg, $s2-amber-600, $s2-amber-700);
|
||||
}
|
||||
}
|
||||
|
||||
.s2-btn-sm {
|
||||
border-radius: 10px;
|
||||
padding: 6px 12px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.s2-btn-lg {
|
||||
border-radius: var(--s2-radius-lg);
|
||||
padding: 12px 24px;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
.s2-btn-icon {
|
||||
border-radius: var(--s2-radius);
|
||||
padding: 10px;
|
||||
}
|
||||
|
||||
/* ============ 表单控件 ============ */
|
||||
.s2-input {
|
||||
width: 100%;
|
||||
border: 1px solid var(--s2-border);
|
||||
border-radius: var(--s2-radius);
|
||||
background: var(--s2-bg-card);
|
||||
padding: 10px 16px;
|
||||
font-size: 14px;
|
||||
color: var(--s2-text-primary);
|
||||
transition: all 0.2s;
|
||||
|
||||
&::placeholder {
|
||||
color: var(--s2-text-muted);
|
||||
}
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
border-color: var(--s2-primary);
|
||||
box-shadow: 0 0 0 3px var(--s2-primary-ring);
|
||||
}
|
||||
|
||||
&:disabled {
|
||||
cursor: not-allowed;
|
||||
background: var(--s2-bg-muted);
|
||||
}
|
||||
|
||||
&.is-error {
|
||||
border-color: var(--s2-danger);
|
||||
|
||||
&:focus {
|
||||
box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.3);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.s2-input-label {
|
||||
display: block;
|
||||
margin-bottom: 6px;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: var(--s2-text-regular);
|
||||
}
|
||||
|
||||
.s2-input-hint {
|
||||
margin-top: 4px;
|
||||
font-size: 12px;
|
||||
color: var(--s2-text-secondary);
|
||||
}
|
||||
|
||||
.s2-input-error-text {
|
||||
margin-top: 4px;
|
||||
font-size: 12px;
|
||||
color: var(--s2-danger-text);
|
||||
}
|
||||
|
||||
/* ============ 玻璃效果 ============ */
|
||||
.s2-glass {
|
||||
background: rgba(255, 255, 255, 0.82);
|
||||
backdrop-filter: blur(24px);
|
||||
-webkit-backdrop-filter: blur(24px);
|
||||
}
|
||||
|
||||
/* ============ 卡片 ============ */
|
||||
.s2-card {
|
||||
background: var(--s2-bg-card);
|
||||
border: 1px solid var(--s2-border-light);
|
||||
border-radius: var(--s2-radius-lg);
|
||||
box-shadow: var(--s2-shadow-card);
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
.s2-card-hover {
|
||||
&:hover {
|
||||
transform: translateY(-2px);
|
||||
border-color: var(--s2-border);
|
||||
box-shadow: $s2-shadow-card-hover;
|
||||
}
|
||||
}
|
||||
|
||||
.s2-card-glass {
|
||||
background: rgba(255, 255, 255, 0.72);
|
||||
backdrop-filter: blur(24px);
|
||||
-webkit-backdrop-filter: blur(24px);
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
border-radius: var(--s2-radius-lg);
|
||||
box-shadow: $s2-shadow-glass;
|
||||
}
|
||||
|
||||
.s2-card-header {
|
||||
border-bottom: 1px solid var(--s2-border-light);
|
||||
padding: 16px 24px;
|
||||
}
|
||||
|
||||
.s2-card-body {
|
||||
padding: 24px;
|
||||
}
|
||||
|
||||
.s2-card-footer {
|
||||
border-top: 1px solid var(--s2-border-light);
|
||||
padding: 16px 24px;
|
||||
}
|
||||
|
||||
/* ============ 统计卡片 ============ */
|
||||
.s2-stat-card {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
gap: 16px;
|
||||
background: var(--s2-bg-card);
|
||||
border: 1px solid var(--s2-border-light);
|
||||
border-radius: var(--s2-radius-lg);
|
||||
box-shadow: var(--s2-shadow-card);
|
||||
padding: 20px;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
.s2-stat-icon {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border-radius: var(--s2-radius);
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.s2-stat-icon-primary {
|
||||
background: var(--s2-primary-soft-strong);
|
||||
color: var(--s2-primary-hover);
|
||||
}
|
||||
|
||||
.s2-stat-icon-success {
|
||||
background: $s2-emerald-100;
|
||||
color: $s2-emerald-600;
|
||||
}
|
||||
|
||||
.s2-stat-icon-warning {
|
||||
background: $s2-amber-100;
|
||||
color: $s2-amber-600;
|
||||
}
|
||||
|
||||
.s2-stat-icon-danger {
|
||||
background: $s2-red-100;
|
||||
color: $s2-red-600;
|
||||
}
|
||||
|
||||
.s2-stat-value {
|
||||
font-size: 24px;
|
||||
font-weight: 700;
|
||||
color: var(--s2-text-primary);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.s2-stat-label {
|
||||
font-size: 14px;
|
||||
color: var(--s2-text-secondary);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.s2-stat-trend {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
margin-top: 4px;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.s2-stat-trend-up {
|
||||
color: $s2-emerald-600;
|
||||
}
|
||||
|
||||
.s2-stat-trend-down {
|
||||
color: $s2-red-600;
|
||||
}
|
||||
|
||||
/* ============ 原生表格 ============ */
|
||||
.s2-table-container {
|
||||
overflow-x: auto;
|
||||
border: 1px solid var(--s2-border);
|
||||
border-radius: var(--s2-radius);
|
||||
}
|
||||
|
||||
.s2-table {
|
||||
width: 100%;
|
||||
font-size: 14px;
|
||||
border-collapse: collapse;
|
||||
|
||||
th {
|
||||
padding: 12px 16px;
|
||||
text-align: left;
|
||||
font-weight: 500;
|
||||
color: var(--s2-text-secondary);
|
||||
background: var(--s2-bg-subtle);
|
||||
border-bottom: 1px solid var(--s2-border);
|
||||
}
|
||||
|
||||
td {
|
||||
padding: 12px 16px;
|
||||
color: var(--s2-text-regular);
|
||||
border-bottom: 1px solid var(--s2-border-light);
|
||||
}
|
||||
|
||||
tr:last-child td {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
tbody tr {
|
||||
transition: background-color 0.15s;
|
||||
|
||||
&:hover {
|
||||
background: var(--s2-bg-subtle);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* ============ 徽章 ============ */
|
||||
.s2-badge {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
border-radius: var(--s2-radius-full);
|
||||
padding: 2px 10px;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
line-height: 18px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.s2-badge-primary { background: var(--s2-primary-soft-strong); color: $s2-primary-700; }
|
||||
.s2-badge-success { background: var(--s2-success-bg); color: $s2-emerald-700; }
|
||||
.s2-badge-warning { background: var(--s2-warning-bg); color: $s2-amber-700; }
|
||||
.s2-badge-danger { background: var(--s2-danger-bg); color: $s2-red-700; }
|
||||
.s2-badge-gray { background: var(--s2-bg-muted); color: var(--s2-text-regular); }
|
||||
.s2-badge-purple { background: $s2-purple-100; color: $s2-purple-700; }
|
||||
|
||||
/* ============ 下拉菜单 ============ */
|
||||
.s2-dropdown {
|
||||
position: absolute;
|
||||
z-index: 2000;
|
||||
background: var(--s2-bg-card);
|
||||
border: 1px solid var(--s2-border);
|
||||
border-radius: var(--s2-radius);
|
||||
box-shadow: $s2-shadow-xl;
|
||||
padding: 4px 0;
|
||||
transform-origin: top right;
|
||||
animation: s2ScaleIn 0.2s ease-out;
|
||||
}
|
||||
|
||||
.s2-dropdown-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 8px 16px;
|
||||
font-size: 14px;
|
||||
color: var(--s2-text-regular);
|
||||
cursor: pointer;
|
||||
transition: background-color 0.15s;
|
||||
|
||||
&:hover {
|
||||
background: var(--s2-bg-muted);
|
||||
}
|
||||
}
|
||||
|
||||
/* ============ 弹窗 ============ */
|
||||
.s2-dialog-overlay {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
z-index: 2050;
|
||||
background: rgba(15, 23, 42, 0.45);
|
||||
backdrop-filter: blur(4px);
|
||||
-webkit-backdrop-filter: blur(4px);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.s2-dialog {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
max-height: 92vh;
|
||||
background: var(--s2-bg-card);
|
||||
border: 1px solid var(--s2-border-light);
|
||||
border-radius: var(--s2-radius-lg);
|
||||
box-shadow: $s2-shadow-xl;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.s2-dialog-narrow { max-width: 420px; }
|
||||
.s2-dialog-default { max-width: 560px; }
|
||||
.s2-dialog-wide { max-width: 880px; }
|
||||
.s2-dialog-full { max-width: 1120px; }
|
||||
|
||||
.s2-dialog-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
flex-shrink: 0;
|
||||
border-bottom: 1px solid var(--s2-border-light);
|
||||
padding: 16px 24px;
|
||||
}
|
||||
|
||||
.s2-dialog-title {
|
||||
margin: 0;
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: var(--s2-text-primary);
|
||||
}
|
||||
|
||||
.s2-dialog-body {
|
||||
flex: 1 1 auto;
|
||||
overflow-y: auto;
|
||||
padding: 16px 24px;
|
||||
font-size: 14px;
|
||||
color: var(--s2-text-regular);
|
||||
}
|
||||
|
||||
.s2-dialog-footer {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
gap: 12px;
|
||||
flex-shrink: 0;
|
||||
border-top: 1px solid var(--s2-border-light);
|
||||
background: rgba(249, 250, 251, 0.6);
|
||||
padding: 16px 24px;
|
||||
}
|
||||
|
||||
/* 弹窗打开时锁定页面滚动 */
|
||||
body.s2-dialog-open {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.s2-dialog-fade-enter-active { transition: opacity 0.25s ease-out; }
|
||||
.s2-dialog-fade-leave-active { transition: opacity 0.2s ease-in; }
|
||||
.s2-dialog-fade-enter,
|
||||
.s2-dialog-fade-leave-to { opacity: 0; }
|
||||
|
||||
.s2-dialog-fade-enter-active .s2-dialog { transition: transform 0.25s ease-out, opacity 0.25s ease-out; }
|
||||
.s2-dialog-fade-leave-active .s2-dialog { transition: transform 0.2s ease-in, opacity 0.2s ease-in; }
|
||||
.s2-dialog-fade-enter .s2-dialog,
|
||||
.s2-dialog-fade-leave-to .s2-dialog { transform: scale(0.95); opacity: 0; }
|
||||
|
||||
/* ============ 提示条 ============ */
|
||||
.s2-toast {
|
||||
position: fixed;
|
||||
top: 16px;
|
||||
right: 16px;
|
||||
z-index: 3000;
|
||||
min-width: 320px;
|
||||
max-width: 28rem;
|
||||
background: var(--s2-bg-card);
|
||||
border-radius: var(--s2-radius);
|
||||
border-left: 4px solid var(--s2-primary);
|
||||
box-shadow: $s2-shadow-xl;
|
||||
padding: 16px;
|
||||
animation: s2SlideInRight 0.3s ease-out;
|
||||
}
|
||||
|
||||
.s2-toast-success { border-left-color: $s2-emerald-500; }
|
||||
.s2-toast-error { border-left-color: $s2-red-500; }
|
||||
.s2-toast-warning { border-left-color: $s2-amber-500; }
|
||||
.s2-toast-info { border-left-color: var(--s2-primary); }
|
||||
|
||||
/* ============ 页面头部 ============ */
|
||||
.s2-page-header {
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.s2-page-title {
|
||||
margin: 0;
|
||||
font-size: 22px;
|
||||
font-weight: 700;
|
||||
color: var(--s2-text-primary);
|
||||
letter-spacing: 0;
|
||||
}
|
||||
|
||||
.s2-page-description {
|
||||
margin: 4px 0 0;
|
||||
font-size: 14px;
|
||||
color: var(--s2-text-secondary);
|
||||
}
|
||||
|
||||
/* ============ 空状态 ============ */
|
||||
.s2-empty-state {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 48px 16px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.s2-empty-state-icon {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
color: var(--s2-border-strong);
|
||||
}
|
||||
|
||||
.s2-empty-state-title {
|
||||
margin: 20px 0 4px;
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
color: var(--s2-text-primary);
|
||||
}
|
||||
|
||||
.s2-empty-state-description {
|
||||
max-width: 24rem;
|
||||
font-size: 14px;
|
||||
color: var(--s2-text-secondary);
|
||||
}
|
||||
|
||||
/* ============ 加载 / 骨架 ============ */
|
||||
.s2-spinner {
|
||||
display: inline-block;
|
||||
border-radius: 50%;
|
||||
border-style: solid;
|
||||
border-color: currentColor;
|
||||
border-right-color: transparent;
|
||||
animation: s2Spin 0.75s linear infinite;
|
||||
}
|
||||
|
||||
.s2-skeleton {
|
||||
background: var(--s2-bg-muted);
|
||||
animation: s2Pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
|
||||
}
|
||||
|
||||
/* ============ 分隔线 / 标签页 / 进度 / 开关 ============ */
|
||||
.s2-divider {
|
||||
margin: 16px 0;
|
||||
height: 1px;
|
||||
background: var(--s2-border);
|
||||
border: none;
|
||||
}
|
||||
|
||||
.s2-tabs {
|
||||
display: flex;
|
||||
gap: 4px;
|
||||
padding: 4px;
|
||||
border-radius: var(--s2-radius);
|
||||
background: var(--s2-bg-muted);
|
||||
}
|
||||
|
||||
.s2-tab {
|
||||
border-radius: 10px;
|
||||
padding: 8px 16px;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: var(--s2-text-secondary);
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
border: none;
|
||||
background: transparent;
|
||||
|
||||
&:hover {
|
||||
color: var(--s2-text-primary);
|
||||
}
|
||||
}
|
||||
|
||||
.s2-tab-active {
|
||||
background: var(--s2-bg-card);
|
||||
color: var(--s2-text-primary);
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||
}
|
||||
|
||||
.s2-progress {
|
||||
height: 8px;
|
||||
overflow: hidden;
|
||||
border-radius: var(--s2-radius-full);
|
||||
background: var(--s2-bg-muted);
|
||||
}
|
||||
|
||||
.s2-progress-bar {
|
||||
height: 100%;
|
||||
background-image: linear-gradient(90deg, $s2-primary-500, $s2-primary-400);
|
||||
transition: width 0.3s;
|
||||
}
|
||||
|
||||
.s2-switch {
|
||||
position: relative;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
width: 44px;
|
||||
height: 24px;
|
||||
border-radius: var(--s2-radius-full);
|
||||
border: 2px solid transparent;
|
||||
background: var(--s2-border);
|
||||
cursor: pointer;
|
||||
transition: background-color 0.2s;
|
||||
flex-shrink: 0;
|
||||
|
||||
&.is-active {
|
||||
background: var(--s2-primary-hover);
|
||||
}
|
||||
}
|
||||
|
||||
.s2-switch-thumb {
|
||||
pointer-events: none;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
border-radius: 50%;
|
||||
background: #fff;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
|
||||
transform: translateX(0);
|
||||
transition: transform 0.2s;
|
||||
|
||||
.is-active & {
|
||||
transform: translateX(20px);
|
||||
}
|
||||
}
|
||||
|
||||
/* ============ 代码块 ============ */
|
||||
.s2-code {
|
||||
font-family: $s2-font-mono;
|
||||
font-size: 13px;
|
||||
background: var(--s2-bg-muted);
|
||||
border-radius: 4px;
|
||||
padding: 2px 6px;
|
||||
color: var(--s2-primary-hover);
|
||||
}
|
||||
|
||||
/* ============ 全局装饰背景 ============ */
|
||||
.s2-mesh-bg {
|
||||
pointer-events: none;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
background-image: $s2-mesh-gradient;
|
||||
z-index: 0;
|
||||
}
|
||||
|
||||
/* ============ 动画 ============ */
|
||||
@keyframes s2Spin {
|
||||
from { transform: rotate(0deg); }
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
@keyframes s2Pulse {
|
||||
0%, 100% { opacity: 1; }
|
||||
50% { opacity: 0.5; }
|
||||
}
|
||||
|
||||
@keyframes s2FadeIn {
|
||||
from { opacity: 0; }
|
||||
to { opacity: 1; }
|
||||
}
|
||||
|
||||
@keyframes s2SlideUp {
|
||||
from { opacity: 0; transform: translateY(10px); }
|
||||
to { opacity: 1; transform: translateY(0); }
|
||||
}
|
||||
|
||||
@keyframes s2SlideInRight {
|
||||
from { opacity: 0; transform: translateX(20px); }
|
||||
to { opacity: 1; transform: translateX(0); }
|
||||
}
|
||||
|
||||
@keyframes s2ScaleIn {
|
||||
from { opacity: 0; transform: scale(0.95); }
|
||||
to { opacity: 1; transform: scale(1); }
|
||||
}
|
||||
|
||||
.s2-animate-fade-in { animation: s2FadeIn 0.3s ease-out; }
|
||||
.s2-animate-slide-up { animation: s2SlideUp 0.3s ease-out; }
|
||||
.s2-animate-scale-in { animation: s2ScaleIn 0.2s ease-out; }
|
||||
|
|
@ -0,0 +1,107 @@
|
|||
/* 设计令牌(SCSS 变量部分)
|
||||
* 由 vue.config.js 的 sass.prependData 自动注入到所有 <style lang="scss"> 中,
|
||||
* 因此组件里可以直接写 $s2-primary-500、$s2-radius-lg 等变量。
|
||||
* 运行时 CSS 变量(--s2-*)见 tokens.scss。
|
||||
*/
|
||||
/* ---------- 主色 Blue(沿用重构前系统的 #1890ff,色阶按同一主色展开) ---------- */
|
||||
$s2-primary-50: #e6f7ff;
|
||||
$s2-primary-100: #bae7ff;
|
||||
$s2-primary-200: #91d5ff;
|
||||
$s2-primary-300: #69c0ff;
|
||||
$s2-primary-400: #40a9ff;
|
||||
$s2-primary-500: #1890ff;
|
||||
$s2-primary-600: #096dd9;
|
||||
$s2-primary-700: #0050b3;
|
||||
$s2-primary-800: #003a8c;
|
||||
$s2-primary-900: #002766;
|
||||
$s2-primary-950: #001a45;
|
||||
|
||||
/* ---------- 辅助色 深蓝灰 ---------- */
|
||||
$s2-accent-50: #f8fafc;
|
||||
$s2-accent-100: #f1f5f9;
|
||||
$s2-accent-200: #e2e8f0;
|
||||
$s2-accent-300: #cbd5e1;
|
||||
$s2-accent-400: #94a3b8;
|
||||
$s2-accent-500: #64748b;
|
||||
$s2-accent-600: #475569;
|
||||
$s2-accent-700: #334155;
|
||||
$s2-accent-800: #1e293b;
|
||||
$s2-accent-900: #0f172a;
|
||||
$s2-accent-950: #020617;
|
||||
|
||||
/* ---------- 中性灰 ---------- */
|
||||
$s2-gray-50: #f9fafb;
|
||||
$s2-gray-100: #f3f4f6;
|
||||
$s2-gray-200: #e5e7eb;
|
||||
$s2-gray-300: #d1d5db;
|
||||
$s2-gray-400: #9ca3af;
|
||||
$s2-gray-500: #6b7280;
|
||||
$s2-gray-600: #4b5563;
|
||||
$s2-gray-700: #374151;
|
||||
$s2-gray-800: #1f2937;
|
||||
$s2-gray-900: #111827;
|
||||
|
||||
/* ---------- 语义色 ---------- */
|
||||
$s2-emerald-50: #ecfdf5;
|
||||
$s2-emerald-100: #d1fae5;
|
||||
$s2-emerald-500: #10b981;
|
||||
$s2-emerald-600: #059669;
|
||||
$s2-emerald-700: #047857;
|
||||
|
||||
$s2-amber-50: #fffbeb;
|
||||
$s2-amber-100: #fef3c7;
|
||||
$s2-amber-500: #f59e0b;
|
||||
$s2-amber-600: #d97706;
|
||||
$s2-amber-700: #b45309;
|
||||
|
||||
$s2-red-50: #fef2f2;
|
||||
$s2-red-100: #fee2e2;
|
||||
$s2-red-400: #f87171;
|
||||
$s2-red-500: #ef4444;
|
||||
$s2-red-600: #dc2626;
|
||||
$s2-red-700: #b91c1c;
|
||||
|
||||
$s2-blue-50: #eff6ff;
|
||||
$s2-blue-500: #3b82f6;
|
||||
$s2-blue-700: #1d4ed8;
|
||||
|
||||
$s2-purple-100: #f3e8ff;
|
||||
$s2-purple-600: #9333ea;
|
||||
$s2-purple-700: #7e22ce;
|
||||
|
||||
/* ---------- 圆角 ---------- */
|
||||
$s2-radius-sm: 6px;
|
||||
$s2-radius-md: 8px;
|
||||
$s2-radius-lg: 12px;
|
||||
$s2-radius-xl: 12px;
|
||||
$s2-radius-2xl: 16px;
|
||||
$s2-radius-3xl: 24px;
|
||||
$s2-radius-full: 9999px;
|
||||
|
||||
/* ---------- 阴影 ---------- */
|
||||
$s2-shadow-card: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
|
||||
$s2-shadow-card-hover: 0 10px 40px rgba(0, 0, 0, 0.08);
|
||||
$s2-shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.08);
|
||||
$s2-shadow-glass-sm: 0 4px 16px rgba(0, 0, 0, 0.06);
|
||||
$s2-shadow-glow: 0 0 20px rgba(24, 144, 255, 0.25);
|
||||
$s2-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.06);
|
||||
$s2-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
|
||||
|
||||
/* ---------- 字体 ---------- */
|
||||
$s2-font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
|
||||
'Helvetica Neue', Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
|
||||
$s2-font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
||||
|
||||
/* ---------- 布局尺寸 ---------- */
|
||||
$s2-sidebar-width: 256px;
|
||||
$s2-sidebar-collapsed: 72px;
|
||||
$s2-header-height: 64px;
|
||||
$s2-tagsview-height: 44px;
|
||||
|
||||
/* ---------- 渐变 ---------- */
|
||||
$s2-gradient-primary: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
|
||||
$s2-gradient-dark: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
|
||||
$s2-mesh-gradient:
|
||||
radial-gradient(at 40% 20%, rgba(24, 144, 255, 0.1) 0, transparent 50%),
|
||||
radial-gradient(at 80% 0%, rgba(56, 189, 248, 0.07) 0, transparent 50%),
|
||||
radial-gradient(at 0% 50%, rgba(24, 144, 255, 0.07) 0, transparent 50%);
|
||||
|
|
@ -0,0 +1,56 @@
|
|||
/**
|
||||
* 设计令牌入口
|
||||
* 只在 main.js 的全局样式里引入一次:负责把 SCSS 变量导出为运行时 CSS 变量。
|
||||
*/
|
||||
@import './tokens-vars.scss';
|
||||
|
||||
/**
|
||||
* 运行时 CSS 变量:业务代码请优先使用这些变量,
|
||||
* 这样主题切换 / 若依 ThemePicker 覆盖色时只需要改一处。
|
||||
*/
|
||||
:root {
|
||||
--s2-primary: #{$s2-primary-500};
|
||||
--s2-primary-hover: #{$s2-primary-600};
|
||||
--s2-primary-active: #{$s2-primary-700};
|
||||
--s2-primary-soft: #{$s2-primary-50};
|
||||
--s2-primary-soft-strong: #{$s2-primary-100};
|
||||
--s2-primary-border: #{$s2-primary-200};
|
||||
--s2-primary-ring: rgba(24, 144, 255, 0.3);
|
||||
|
||||
--s2-bg-page: #{$s2-gray-50};
|
||||
--s2-bg-card: #ffffff;
|
||||
--s2-bg-subtle: #{$s2-gray-50};
|
||||
--s2-bg-muted: #{$s2-gray-100};
|
||||
--s2-bg-raised: #ffffff;
|
||||
|
||||
--s2-text-primary: #{$s2-gray-900};
|
||||
--s2-text-regular: #{$s2-gray-700};
|
||||
--s2-text-secondary: #{$s2-gray-500};
|
||||
--s2-text-muted: #{$s2-gray-400};
|
||||
--s2-text-inverse: #ffffff;
|
||||
|
||||
--s2-border: #{$s2-gray-200};
|
||||
--s2-border-light: #{$s2-gray-100};
|
||||
--s2-border-strong: #{$s2-gray-300};
|
||||
|
||||
--s2-success: #{$s2-emerald-500};
|
||||
--s2-success-text: #{$s2-emerald-600};
|
||||
--s2-success-bg: #{$s2-emerald-100};
|
||||
--s2-warning: #{$s2-amber-500};
|
||||
--s2-warning-text: #{$s2-amber-600};
|
||||
--s2-warning-bg: #{$s2-amber-100};
|
||||
--s2-danger: #{$s2-red-500};
|
||||
--s2-danger-text: #{$s2-red-600};
|
||||
--s2-danger-bg: #{$s2-red-100};
|
||||
--s2-info: #{$s2-accent-500};
|
||||
--s2-info-text: #{$s2-accent-600};
|
||||
--s2-info-bg: #{$s2-gray-100};
|
||||
|
||||
--s2-radius: #{$s2-radius-lg};
|
||||
--s2-radius-sm: #{$s2-radius-md};
|
||||
--s2-radius-lg: #{$s2-radius-2xl};
|
||||
--s2-shadow-card: #{$s2-shadow-card};
|
||||
--s2-shadow-pop: #{$s2-shadow-xl};
|
||||
--s2-header-height: #{$s2-header-height};
|
||||
--s2-font-sans: #{$s2-font-sans};
|
||||
}
|
||||
|
|
@ -8,18 +8,28 @@ $tiffany: #4AB7BD;
|
|||
$yellow:#FEC171;
|
||||
$panGreen: #30B08F;
|
||||
|
||||
// 默认菜单主题风格
|
||||
$base-menu-color:#bfcbd9;
|
||||
$base-menu-color-active:#f4f4f5;
|
||||
$base-menu-background:#304156;
|
||||
$base-logo-title-color: #ffffff;
|
||||
@import './tokens-vars.scss';
|
||||
|
||||
// 默认菜单主题风格:sub2api 采用浅色侧边栏(白底 + 蓝色主色高亮胶囊)
|
||||
$base-menu-color:$s2-gray-600;
|
||||
$base-menu-color-active:$s2-primary-600;
|
||||
$base-menu-background:#ffffff;
|
||||
$base-logo-title-color: $s2-gray-900;
|
||||
|
||||
// 深色侧边栏(theme-dark 开关保留,配色换成 sub2api 的 dark-900 系)
|
||||
$base-menu-light-color:rgba(0,0,0,.70);
|
||||
$base-menu-light-background:#ffffff;
|
||||
$base-logo-light-title-color: #001529;
|
||||
$base-logo-light-title-color: $s2-gray-900;
|
||||
|
||||
$base-sub-menu-background:#1f2d3d;
|
||||
$base-sub-menu-hover:#001528;
|
||||
$base-sub-menu-background:#ffffff;
|
||||
$base-sub-menu-hover:$s2-gray-100;
|
||||
|
||||
// 深色模式(原 theme-dark 分支)配色
|
||||
$base-menu-dark-color:$s2-accent-300;
|
||||
$base-menu-dark-color-active:$s2-primary-300;
|
||||
$base-menu-dark-background:$s2-accent-900;
|
||||
$base-sub-menu-dark-background:$s2-accent-900;
|
||||
$base-sub-menu-dark-hover:$s2-accent-800;
|
||||
|
||||
// 自定义暗色菜单风格
|
||||
/**
|
||||
|
|
@ -36,18 +46,18 @@ $base-sub-menu-background:#000c17;
|
|||
$base-sub-menu-hover:#001528;
|
||||
*/
|
||||
|
||||
$base-sidebar-width: 200px;
|
||||
$base-sidebar-width: $s2-sidebar-width;
|
||||
|
||||
// the :export directive is the magic sauce for webpack
|
||||
// https://www.bluematador.com/blog/how-to-share-variables-between-js-and-sass
|
||||
:export {
|
||||
menuColor: $base-menu-color;
|
||||
menuColor: $base-menu-dark-color;
|
||||
menuLightColor: $base-menu-light-color;
|
||||
menuColorActive: $base-menu-color-active;
|
||||
menuBackground: $base-menu-background;
|
||||
menuColorActive: $base-menu-dark-color-active;
|
||||
menuBackground: $base-menu-dark-background;
|
||||
menuLightBackground: $base-menu-light-background;
|
||||
subMenuBackground: $base-sub-menu-background;
|
||||
subMenuHover: $base-sub-menu-hover;
|
||||
subMenuBackground: $base-sub-menu-dark-background;
|
||||
subMenuHover: $base-sub-menu-dark-hover;
|
||||
sideBarWidth: $base-sidebar-width;
|
||||
logoTitleColor: $base-logo-title-color;
|
||||
logoLightTitleColor: $base-logo-light-title-color
|
||||
|
|
|
|||
|
|
@ -0,0 +1,69 @@
|
|||
<template>
|
||||
<div>
|
||||
<el-dialog :visible.sync="pdfPreviewVisible" width="80%" append-to-body top="5vh" title="PDF预览">
|
||||
<iframe :src="currentPdfUrl" width="100%" height="600px" frameborder="0"></iframe>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :visible.sync="imagePreviewVisible" width="60%" append-to-body top="5vh" title="图片预览">
|
||||
<img :src="currentImageUrl" style="width: 100%;max-height: 60vh" />
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "GlobalFilePreview",
|
||||
data() {
|
||||
return {
|
||||
pdfPreviewVisible: false,
|
||||
currentPdfUrl: '',
|
||||
imagePreviewVisible: false,
|
||||
currentImageUrl: ''
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
isPdf(filePath) {
|
||||
return filePath && filePath.toLowerCase().endsWith('.pdf');
|
||||
},
|
||||
getFileBaseName(filePath) {
|
||||
if (!filePath) return '';
|
||||
const parts = filePath.split('/');
|
||||
return parts[parts.length - 1] || '';
|
||||
},
|
||||
// 在线查看地址:后端以 inline 方式返回文件(图片/PDF 可直接在浏览器渲染)
|
||||
getViewUrl(filePath, fileName) {
|
||||
const resource = encodeURIComponent(filePath || '');
|
||||
const name = encodeURIComponent(fileName || this.getFileBaseName(filePath));
|
||||
return `${process.env.VUE_APP_BASE_API}/project/order/file/view?filePath=${resource}&fileName=${name}`;
|
||||
},
|
||||
handlePreview(attachment) {
|
||||
if (!attachment || !attachment.filePath) {
|
||||
return;
|
||||
}
|
||||
const filePath = attachment.filePath.toLowerCase();
|
||||
const isImage = /\.(png|jpg|jpeg|gif)$/.test(filePath);
|
||||
if (this.isPdf(filePath)) {
|
||||
this.currentPdfUrl = this.getViewUrl(attachment.filePath, attachment.fileName);
|
||||
this.pdfPreviewVisible = true;
|
||||
} else if (isImage) {
|
||||
this.currentImageUrl = this.getViewUrl(attachment.filePath, attachment.fileName);
|
||||
this.imagePreviewVisible = true;
|
||||
} else {
|
||||
// 浏览器无法直接渲染的格式,改为新窗口打开(由浏览器决定预览或下载)
|
||||
window.open(this.getViewUrl(attachment.filePath, attachment.fileName), '_blank');
|
||||
}
|
||||
},
|
||||
downloadFile(attachment){
|
||||
if (attachment){
|
||||
const link = document.createElement('a');
|
||||
link.href = process.env.VUE_APP_BASE_API + "/common/download/resource?resource=" +attachment.filePath;
|
||||
link.download = attachment.fileName || 'file';
|
||||
link.style.display = 'none';
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
<el-button size="mini" circle icon="el-icon-menu" @click="showColumn()" v-if="showColumnsType == 'transfer'"/>
|
||||
<el-dropdown trigger="click" :hide-on-click="false" style="padding-left: 12px" v-if="showColumnsType == 'checkbox'">
|
||||
<el-button size="mini" circle icon="el-icon-menu" />
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<el-dropdown-menu slot="dropdown" >
|
||||
<!-- 全选/反选 按钮 -->
|
||||
<el-dropdown-item>
|
||||
<el-checkbox :indeterminate="isIndeterminate" v-model="isChecked" @change="toggleCheckAll"> 列展示 </el-checkbox>
|
||||
|
|
@ -183,4 +183,8 @@ export default {
|
|||
background-color: #ccc;
|
||||
margin: 3px auto;
|
||||
}
|
||||
.el-dropdown-menu{
|
||||
max-height: 400px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -1,14 +1,15 @@
|
|||
<template>
|
||||
<el-color-picker
|
||||
v-model="theme"
|
||||
:predefine="['#409EFF', '#1890ff', '#304156','#212121','#11a983', '#13c2c2', '#6959CD', '#f5222d', ]"
|
||||
:predefine="['#1890ff', '#096dd9', '#409EFF', '#13c2c2', '#11a983', '#304156', '#6959CD', '#f5222d', ]"
|
||||
class="theme-picker"
|
||||
popper-class="theme-picker-dropdown"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
const ORIGINAL_THEME = '#409EFF' // default color
|
||||
// 与 element-variables.scss 编译进产物的主色保持一致,否则换肤时的颜色替换会失效
|
||||
const ORIGINAL_THEME = '#1890ff' // default color
|
||||
|
||||
export default {
|
||||
data() {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,23 @@
|
|||
<template>
|
||||
<span :class="['s2-badge', 's2-badge-' + variant]">
|
||||
<slot />
|
||||
</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* 胶囊徽章
|
||||
* 移植自 sub2api/frontend .badge / .badge-* 样式族
|
||||
*/
|
||||
export default {
|
||||
name: 'UiBadge',
|
||||
props: {
|
||||
variant: {
|
||||
type: String,
|
||||
default: 'gray',
|
||||
validator: value =>
|
||||
['primary', 'success', 'warning', 'danger', 'gray', 'purple'].indexOf(value) > -1
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
<template>
|
||||
<svg
|
||||
class="s2-brand-mark"
|
||||
:width="px"
|
||||
:height="px"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<!-- 等轴立方体:沿用 UNISSENSE-OMS 原始图形的切面比例,反白后放到青绿色块上 -->
|
||||
<path d="M12 2.4 20.8 7.3 12 12.2 3.2 7.3Z" fill="currentColor" />
|
||||
<path d="M3 9.05 11.4 13.85V21.6L3 16.8Z" fill="currentColor" opacity="0.55" />
|
||||
<path d="M12.6 13.85 21 9.05V16.8L12.6 21.6Z" fill="currentColor" opacity="0.75" />
|
||||
</svg>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* 品牌图形标(立方体)
|
||||
*
|
||||
* 仓库根 .gitignore 忽略了 *.png,新增位图资源无法直接提交,
|
||||
* 因此侧边栏与登录页的 logo tile 改用内联 SVG 图形标。
|
||||
*/
|
||||
export default {
|
||||
name: 'UiBrandMark',
|
||||
props: {
|
||||
size: { type: [Number, String], default: 24 }
|
||||
},
|
||||
computed: {
|
||||
px() {
|
||||
return `${Number(this.size) || 24}px`
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.s2-brand-mark {
|
||||
display: block;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
<template>
|
||||
<div :class="['s2-card', { 's2-card-hover': hover }]">
|
||||
<div v-if="title || $slots.header" class="s2-card-header">
|
||||
<slot name="header">
|
||||
<span class="s2-card-title">{{ title }}</span>
|
||||
</slot>
|
||||
</div>
|
||||
<div :class="['s2-card-body', { 'is-flush': bodyFlush }]">
|
||||
<slot />
|
||||
</div>
|
||||
<div v-if="$slots.footer" class="s2-card-footer">
|
||||
<slot name="footer" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* 卡片容器
|
||||
* 对应 sub2api/frontend 的 .card / .card-header / .card-body / .card-footer
|
||||
*/
|
||||
export default {
|
||||
name: 'UiCard',
|
||||
props: {
|
||||
title: { type: String, default: '' },
|
||||
hover: { type: Boolean, default: false },
|
||||
// 表格、列表等自带留白的内容用 flush 去掉内边距
|
||||
bodyFlush: { type: Boolean, default: false }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "~@/assets/styles/tokens-vars.scss";
|
||||
|
||||
.s2-card-title {
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
color: $s2-gray-900;
|
||||
}
|
||||
|
||||
.s2-card-body.is-flush {
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,44 @@
|
|||
<template>
|
||||
<ui-dialog :show="show" :title="title" width="narrow" @close="$emit('cancel')">
|
||||
<p style="margin: 0; color: var(--s2-text-secondary);">{{ message }}</p>
|
||||
<slot />
|
||||
|
||||
<template #footer>
|
||||
<button type="button" class="s2-btn s2-btn-secondary" @click="$emit('cancel')">
|
||||
{{ cancelText || '取消' }}
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
:class="['s2-btn', confirmButtonClass]"
|
||||
:disabled="loading"
|
||||
@click="$emit('confirm')"
|
||||
>
|
||||
{{ confirmText || '确定' }}
|
||||
</button>
|
||||
</template>
|
||||
</ui-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* 二次确认弹窗
|
||||
* 移植自 sub2api/frontend src/components/common/ConfirmDialog.vue
|
||||
*/
|
||||
export default {
|
||||
name: 'UiConfirmDialog',
|
||||
props: {
|
||||
show: { type: Boolean, default: false },
|
||||
title: { type: String, default: '操作确认' },
|
||||
message: { type: String, default: '' },
|
||||
confirmText: { type: String, default: '' },
|
||||
cancelText: { type: String, default: '' },
|
||||
danger: { type: Boolean, default: false },
|
||||
loading: { type: Boolean, default: false }
|
||||
},
|
||||
computed: {
|
||||
confirmButtonClass() {
|
||||
return this.danger ? 's2-btn-danger' : 's2-btn-primary'
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,281 @@
|
|||
<template>
|
||||
<div class="s2-data-table">
|
||||
<div v-if="loading" class="s2-data-table__loading">
|
||||
<ui-loading-spinner size="md" color="primary" />
|
||||
</div>
|
||||
|
||||
<div class="s2-data-table__wrapper">
|
||||
<table class="s2-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th v-if="selectable" class="s2-data-table__check">
|
||||
<el-checkbox
|
||||
:value="allSelected"
|
||||
:indeterminate="someSelected"
|
||||
:disabled="!normalizedData.length"
|
||||
@change="toggleAll"
|
||||
/>
|
||||
</th>
|
||||
<th v-if="showIndex" style="width: 64px;">#</th>
|
||||
<th
|
||||
v-for="column in columns"
|
||||
:key="column.key"
|
||||
:style="headerStyle(column)"
|
||||
:class="[column.align ? `is-${column.align}` : '', column.headerClassName]"
|
||||
>
|
||||
<span class="s2-data-table__th-inner">
|
||||
{{ column.label }}
|
||||
<button
|
||||
v-if="column.sortable"
|
||||
type="button"
|
||||
class="s2-data-table__sort"
|
||||
:class="{ 'is-active': sortKey === column.key }"
|
||||
@click="handleSort(column)"
|
||||
>
|
||||
<ui-icon
|
||||
name="sort"
|
||||
size="xs"
|
||||
:style="sortKey === column.key && sortOrder === 'desc' ? 'transform: rotate(180deg)' : ''"
|
||||
/>
|
||||
</button>
|
||||
</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody v-if="!loading || normalizedData.length">
|
||||
<tr
|
||||
v-for="(row, index) in normalizedData"
|
||||
:key="rowId(row, index)"
|
||||
:class="{ 'is-selected': isSelected(row) }"
|
||||
@click="$emit('row-click', row, index)"
|
||||
>
|
||||
<td v-if="selectable" class="s2-data-table__check" @click.stop>
|
||||
<el-checkbox :value="isSelected(row)" @change="toggleRow(row)" />
|
||||
</td>
|
||||
<td v-if="showIndex">{{ (index + 1).toString().padStart(2, '0') }}</td>
|
||||
<td
|
||||
v-for="column in columns"
|
||||
:key="column.key"
|
||||
:class="[column.align ? `is-${column.align}` : '', column.className]"
|
||||
>
|
||||
<slot
|
||||
:name="`cell-${column.key}`"
|
||||
:row="row"
|
||||
:index="index"
|
||||
:value="row[column.key]"
|
||||
>
|
||||
<span :class="{ 's2-data-table__empty-cell': isEmpty(cellValue(column, row)) }">
|
||||
{{ displayValue(column, row) }}
|
||||
</span>
|
||||
</slot>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div v-if="loading && !normalizedData.length" class="s2-data-table__skeleton">
|
||||
<div v-for="n in skeletonRows" :key="n" class="s2-data-table__skeleton-row">
|
||||
<ui-skeleton v-for="column in columns" :key="column.key" height="18px" :width="skeletonWidth(column)" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<slot v-if="!loading && !normalizedData.length" name="empty">
|
||||
<ui-empty-state :description="emptyText" :icon="emptyIcon" />
|
||||
</slot>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* 数据表格
|
||||
* 移植自 sub2api/frontend src/components/common/DataTable.vue 的列配置模型:
|
||||
* columns: [{ key, label, width, align, sortable, formatter, slot }]
|
||||
* 支持多选(v-model)、排序(本地或服务端)、骨架屏、空状态。
|
||||
*
|
||||
* <ui-data-table :data="list" :columns="columns" v-model="selected" selectable>
|
||||
* <template #cell-status="{ row }"><ui-status-badge :status="row.status" :label="row.statusName" /></template>
|
||||
* </ui-data-table>
|
||||
*/
|
||||
export default {
|
||||
name: 'UiDataTable',
|
||||
model: {
|
||||
prop: 'value',
|
||||
event: 'input'
|
||||
},
|
||||
props: {
|
||||
columns: { type: Array, required: true },
|
||||
data: { type: Array, default: () => [] },
|
||||
value: { type: Array, default: () => [] },
|
||||
rowKey: { type: [String, Function], default: 'id' },
|
||||
loading: { type: Boolean, default: false },
|
||||
selectable: { type: Boolean, default: false },
|
||||
showIndex: { type: Boolean, default: false },
|
||||
// 开启后不在本地排序,只抛出 sort-change 交给服务端
|
||||
remoteSort: { type: Boolean, default: false },
|
||||
emptyText: { type: String, default: '暂无数据' },
|
||||
emptyIcon: { type: String, default: 'inbox' },
|
||||
skeletonRows: { type: Number, default: 6 }
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
sortKey: '',
|
||||
sortOrder: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
normalizedData() {
|
||||
if (this.remoteSort || !this.sortKey) return this.data
|
||||
const order = this.sortOrder === 'desc' ? -1 : 1
|
||||
return [...this.data].sort((a, b) => {
|
||||
const left = a[this.sortKey]
|
||||
const right = b[this.sortKey]
|
||||
if (left === right) return 0
|
||||
if (typeof left === 'number' && typeof right === 'number') return (left - right) * order
|
||||
return String(left).localeCompare(String(right), 'zh-CN') * order
|
||||
})
|
||||
},
|
||||
allSelected() {
|
||||
return this.normalizedData.length > 0 && this.normalizedData.every(row => this.isSelected(row))
|
||||
},
|
||||
someSelected() {
|
||||
return this.value.length > 0 && !this.allSelected
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
rowId(row, index) {
|
||||
if (typeof this.rowKey === 'function') return this.rowKey(row)
|
||||
return row[this.rowKey] !== undefined && row[this.rowKey] !== null ? row[this.rowKey] : index
|
||||
},
|
||||
cellValue(column, row) {
|
||||
return row[column.key]
|
||||
},
|
||||
displayValue(column, row) {
|
||||
const value = this.cellValue(column, row)
|
||||
if (typeof column.formatter === 'function') return column.formatter(value, row)
|
||||
if (value === null || value === undefined || value === '') return '-'
|
||||
return value
|
||||
},
|
||||
isEmpty(value) {
|
||||
return value === null || value === undefined || value === ''
|
||||
},
|
||||
headerStyle(column) {
|
||||
const style = {}
|
||||
if (column.width) style.width = /^\d+$/.test(String(column.width)) ? `${column.width}px` : column.width
|
||||
if (column.minWidth) style.minWidth = /^\d+$/.test(String(column.minWidth)) ? `${column.minWidth}px` : column.minWidth
|
||||
return style
|
||||
},
|
||||
skeletonWidth(column) {
|
||||
return column.width && /^\d+$/.test(String(column.width)) ? `${column.width}px` : '60%'
|
||||
},
|
||||
isSelected(row) {
|
||||
return this.value.indexOf(row) > -1
|
||||
},
|
||||
toggleRow(row) {
|
||||
const next = this.isSelected(row)
|
||||
? this.value.filter(item => item !== row)
|
||||
: this.value.concat([row])
|
||||
this.$emit('input', next)
|
||||
this.$emit('selection-change', next)
|
||||
},
|
||||
toggleAll(checked) {
|
||||
const next = checked ? [...this.normalizedData] : []
|
||||
this.$emit('input', next)
|
||||
this.$emit('selection-change', next)
|
||||
},
|
||||
handleSort(column) {
|
||||
if (this.sortKey !== column.key) {
|
||||
this.sortKey = column.key
|
||||
this.sortOrder = 'asc'
|
||||
} else if (this.sortOrder === 'asc') {
|
||||
this.sortOrder = 'desc'
|
||||
} else {
|
||||
this.sortKey = ''
|
||||
this.sortOrder = ''
|
||||
}
|
||||
this.$emit('sort-change', { prop: this.sortKey, order: this.sortOrder })
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "~@/assets/styles/tokens-vars.scss";
|
||||
|
||||
.s2-data-table {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.s2-data-table__wrapper {
|
||||
width: 100%;
|
||||
overflow-x: auto;
|
||||
}
|
||||
|
||||
.s2-data-table__loading {
|
||||
position: absolute;
|
||||
top: 12px;
|
||||
right: 16px;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
.s2-data-table__check {
|
||||
width: 44px;
|
||||
text-align: center !important;
|
||||
}
|
||||
|
||||
.s2-data-table__th-inner {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.s2-data-table__sort {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
padding: 2px;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
background: transparent;
|
||||
color: $s2-gray-400;
|
||||
cursor: pointer;
|
||||
transition: color 0.15s, background-color 0.15s;
|
||||
|
||||
&:hover {
|
||||
color: $s2-gray-600;
|
||||
background: $s2-gray-200;
|
||||
}
|
||||
|
||||
&.is-active {
|
||||
color: $s2-primary-600;
|
||||
}
|
||||
}
|
||||
|
||||
.s2-data-table__skeleton {
|
||||
padding: 16px;
|
||||
}
|
||||
|
||||
.s2-data-table__skeleton-row {
|
||||
display: flex;
|
||||
gap: 24px;
|
||||
align-items: center;
|
||||
padding: 13px 0;
|
||||
border-bottom: 1px solid $s2-gray-100;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
|
||||
.s2-data-table__empty-cell {
|
||||
color: $s2-gray-400;
|
||||
}
|
||||
|
||||
.is-center { text-align: center !important; }
|
||||
.is-right { text-align: right !important; }
|
||||
|
||||
tr.is-selected > td {
|
||||
background: $s2-primary-50;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,163 @@
|
|||
<template>
|
||||
<div
|
||||
v-show="show"
|
||||
:class="['s2-dialog-overlay', { 'is-visible': show }]"
|
||||
:style="overlayStyle"
|
||||
role="dialog"
|
||||
aria-modal="true"
|
||||
@click.self="handleOverlayClick"
|
||||
>
|
||||
<div ref="panel" :class="['s2-dialog', `s2-dialog-${width}`]" @click.stop>
|
||||
<div class="s2-dialog-header">
|
||||
<h3 class="s2-dialog-title">
|
||||
<slot name="title">{{ title }}</slot>
|
||||
</h3>
|
||||
<button v-if="showClose" type="button" class="s2-dialog-close" aria-label="关闭" @click="$emit('close')">
|
||||
<ui-icon name="x" size="md" />
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div ref="body" class="s2-dialog-body">
|
||||
<slot />
|
||||
</div>
|
||||
|
||||
<div v-if="$slots.footer" class="s2-dialog-footer">
|
||||
<slot name="footer" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* 基础弹窗
|
||||
* 移植自 sub2api/frontend src/components/common/BaseDialog.vue(Vue3 Teleport -> Vue2 挂载到 body)
|
||||
*
|
||||
* <ui-dialog :show.sync="open" title="标题" width="wide">
|
||||
* 内容
|
||||
* <template #footer><el-button @click="open=false">取消</el-button></template>
|
||||
* </ui-dialog>
|
||||
*/
|
||||
let zIndexSeed = 2050
|
||||
|
||||
export default {
|
||||
name: 'UiDialog',
|
||||
props: {
|
||||
show: { type: Boolean, default: false },
|
||||
title: { type: String, default: '' },
|
||||
width: {
|
||||
type: String,
|
||||
default: 'normal',
|
||||
validator: v => ['narrow', 'normal', 'wide', 'extra-wide', 'full'].indexOf(v) > -1
|
||||
},
|
||||
closeOnEscape: { type: Boolean, default: true },
|
||||
closeOnClickOutside: { type: Boolean, default: false },
|
||||
showClose: { type: Boolean, default: true },
|
||||
zIndex: { type: Number, default: 0 }
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
resolvedZIndex: zIndexSeed
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
overlayStyle() {
|
||||
return { zIndex: this.zIndex || this.resolvedZIndex }
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
show: {
|
||||
immediate: true,
|
||||
handler(isOpen) {
|
||||
if (isOpen) {
|
||||
zIndexSeed += 1
|
||||
this.resolvedZIndex = zIndexSeed
|
||||
document.body.classList.add('s2-dialog-open')
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.body) this.$refs.body.scrollTop = 0
|
||||
if (this.$refs.panel) {
|
||||
const focusable = this.$refs.panel.querySelector(
|
||||
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
||||
)
|
||||
if (focusable && focusable.focus) focusable.focus()
|
||||
}
|
||||
})
|
||||
} else {
|
||||
document.body.classList.remove('s2-dialog-open')
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// Vue2 没有 Teleport,直接把浮层挂到 body,避免被父级 overflow / transform 裁剪
|
||||
if (this.$el && this.$el.nodeType === 1 && this.$el.parentNode !== document.body) {
|
||||
document.body.appendChild(this.$el)
|
||||
}
|
||||
document.addEventListener('keydown', this.handleKeydown)
|
||||
},
|
||||
beforeDestroy() {
|
||||
// 节点本身交给 Vue 摘除(它按 parentNode 移除),这里只清理全局副作用
|
||||
document.removeEventListener('keydown', this.handleKeydown)
|
||||
document.body.classList.remove('s2-dialog-open')
|
||||
},
|
||||
methods: {
|
||||
handleOverlayClick() {
|
||||
if (this.closeOnClickOutside) this.$emit('close')
|
||||
},
|
||||
handleKeydown(event) {
|
||||
if (this.show && this.closeOnEscape && event.key === 'Escape') {
|
||||
this.$emit('close')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "~@/assets/styles/tokens-vars.scss";
|
||||
|
||||
.s2-dialog-overlay {
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
transition: opacity 0.2s ease-out, visibility 0.2s;
|
||||
|
||||
&.is-visible {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
|
||||
.s2-dialog {
|
||||
transform: scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
.s2-dialog {
|
||||
transform: scale(0.96);
|
||||
transition: transform 0.2s ease-out;
|
||||
}
|
||||
}
|
||||
|
||||
.s2-dialog-narrow { max-width: 420px; }
|
||||
.s2-dialog-normal { max-width: 560px; }
|
||||
.s2-dialog-wide { max-width: 768px; }
|
||||
.s2-dialog-extra-wide { max-width: 1024px; }
|
||||
.s2-dialog-full { max-width: 1280px; }
|
||||
|
||||
.s2-dialog-close {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: -8px -8px -8px 0;
|
||||
padding: 8px;
|
||||
border: none;
|
||||
border-radius: var(--s2-radius);
|
||||
background: transparent;
|
||||
color: var(--s2-text-muted);
|
||||
cursor: pointer;
|
||||
transition: background-color 0.2s, color 0.2s;
|
||||
|
||||
&:hover {
|
||||
background: var(--s2-bg-muted);
|
||||
color: var(--s2-text-regular);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,61 @@
|
|||
<template>
|
||||
<div class="s2-empty-state">
|
||||
<div class="s2-empty-state-icon-wrap">
|
||||
<slot name="icon">
|
||||
<ui-icon :name="icon || 'inbox'" size="xl" class="s2-empty-state-icon" />
|
||||
</slot>
|
||||
</div>
|
||||
<h3 class="s2-empty-state-title">{{ title || '暂无数据' }}</h3>
|
||||
<p v-if="description" class="s2-empty-state-description">{{ description }}</p>
|
||||
<div v-if="actionText || $slots.action" style="margin-top: 24px;">
|
||||
<slot name="action">
|
||||
<router-link v-if="actionTo" :to="actionTo" class="s2-btn s2-btn-primary">
|
||||
<ui-icon name="plus" size="sm" />
|
||||
{{ actionText }}
|
||||
</router-link>
|
||||
<button v-else type="button" class="s2-btn s2-btn-primary" @click="$emit('action')">
|
||||
<ui-icon name="plus" size="sm" />
|
||||
{{ actionText }}
|
||||
</button>
|
||||
</slot>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* 空状态
|
||||
* 移植自 sub2api/frontend src/components/common/EmptyState.vue
|
||||
*/
|
||||
export default {
|
||||
name: 'UiEmptyState',
|
||||
props: {
|
||||
icon: { type: String, default: '' },
|
||||
title: { type: String, default: '' },
|
||||
description: { type: String, default: '' },
|
||||
actionText: { type: String, default: '' },
|
||||
actionTo: { type: [String, Object], default: '' }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "~@/assets/styles/tokens-vars.scss";
|
||||
|
||||
.s2-empty-state-icon-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
margin-bottom: 20px;
|
||||
border-radius: var(--s2-radius-lg);
|
||||
background: $s2-gray-100;
|
||||
}
|
||||
|
||||
.s2-empty-state-icon {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
color: $s2-gray-300;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
<template>
|
||||
<svg
|
||||
:class="['s2-icon', 's2-icon-' + size]"
|
||||
fill="none"
|
||||
viewBox="0 0 24 24"
|
||||
:stroke-width="strokeWidth"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<path stroke-linecap="round" stroke-linejoin="round" :d="iconPath" />
|
||||
</svg>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { icons } from './icons'
|
||||
|
||||
/**
|
||||
* 线性图标
|
||||
* 移植自 sub2api/frontend src/components/icons/Icon.vue(Vue3 -> Vue2)
|
||||
* 用法:<ui-icon name="plus" size="sm" />
|
||||
*/
|
||||
export default {
|
||||
name: 'UiIcon',
|
||||
props: {
|
||||
name: {
|
||||
type: String,
|
||||
required: true,
|
||||
validator: value => icons[value] !== undefined || process.env.NODE_ENV !== 'production'
|
||||
},
|
||||
size: {
|
||||
type: String,
|
||||
default: 'md',
|
||||
validator: value => ['xs', 'sm', 'md', 'lg', 'xl'].indexOf(value) > -1
|
||||
},
|
||||
strokeWidth: {
|
||||
type: [Number, String],
|
||||
default: 1.5
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
iconPath() {
|
||||
return icons[this.name] || ''
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.s2-icon {
|
||||
display: inline-block;
|
||||
flex-shrink: 0;
|
||||
stroke: currentColor;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.s2-icon-xs { width: 12px; height: 12px; }
|
||||
.s2-icon-sm { width: 16px; height: 16px; }
|
||||
.s2-icon-md { width: 20px; height: 20px; }
|
||||
.s2-icon-lg { width: 24px; height: 24px; }
|
||||
.s2-icon-xl { width: 32px; height: 32px; }
|
||||
</style>
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
<template>
|
||||
<span :class="['s2-spinner', `s2-spinner-${size}`, `s2-spinner-${color}`]" role="status" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* 加载指示器
|
||||
* 移植自 sub2api/frontend src/components/common/LoadingSpinner.vue
|
||||
*/
|
||||
export default {
|
||||
name: 'UiLoadingSpinner',
|
||||
props: {
|
||||
size: { type: String, default: 'md', validator: v => ['sm', 'md', 'lg', 'xl'].indexOf(v) > -1 },
|
||||
color: { type: String, default: 'primary', validator: v => ['primary', 'secondary', 'white', 'gray'].indexOf(v) > -1 }
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "~@/assets/styles/tokens-vars.scss";
|
||||
|
||||
.s2-spinner-sm { width: 16px; height: 16px; border-width: 2px; }
|
||||
.s2-spinner-md { width: 32px; height: 32px; border-width: 2px; }
|
||||
.s2-spinner-lg { width: 48px; height: 48px; border-width: 3px; }
|
||||
.s2-spinner-xl { width: 64px; height: 64px; border-width: 4px; }
|
||||
|
||||
.s2-spinner-primary { color: $s2-primary-500; }
|
||||
.s2-spinner-secondary { color: $s2-gray-500; }
|
||||
.s2-spinner-white { color: #fff; }
|
||||
.s2-spinner-gray { color: $s2-gray-400; }
|
||||
</style>
|
||||
|
|
@ -0,0 +1,58 @@
|
|||
<template>
|
||||
<div v-if="displayTitle || $slots.default || description" class="s2-page-header">
|
||||
<div class="s2-page-header-inner">
|
||||
<div style="min-width: 0;">
|
||||
<h1 class="s2-page-title">
|
||||
<slot name="title">{{ displayTitle }}</slot>
|
||||
</h1>
|
||||
<p v-if="description || $slots.description" class="s2-page-description">
|
||||
<slot name="description">{{ description }}</slot>
|
||||
</p>
|
||||
</div>
|
||||
<div v-if="$slots.default" class="s2-page-header-actions">
|
||||
<slot />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* 页面标题区(标题 + 描述 + 右侧操作)
|
||||
* 对应 sub2api/frontend 的 .page-header / .page-title / .page-description
|
||||
*
|
||||
* 不传 title 时自动取当前路由的菜单名($route.meta.title),
|
||||
* 因此列表页可以直接写 <ui-page-header /> 而不必硬编码文案。
|
||||
*/
|
||||
export default {
|
||||
name: 'UiPageHeader',
|
||||
props: {
|
||||
title: { type: String, default: '' },
|
||||
description: { type: String, default: '' }
|
||||
},
|
||||
computed: {
|
||||
displayTitle() {
|
||||
if (this.title) return this.title
|
||||
const meta = this.$route && this.$route.meta
|
||||
return (meta && meta.title) || ''
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.s2-page-header-inner {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
justify-content: space-between;
|
||||
gap: 16px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.s2-page-header-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,120 @@
|
|||
<template>
|
||||
<div :class="{ hidden: hidden }" class="pagination-container">
|
||||
<el-pagination
|
||||
:background="background"
|
||||
:current-page.sync="currentPage"
|
||||
:page-size.sync="pageSize"
|
||||
:layout="layout"
|
||||
:page-sizes="pageSizes"
|
||||
:pager-count="pagerCount"
|
||||
:total="total"
|
||||
v-bind="$attrs"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* 分页组件(sub2api 视觉)
|
||||
*
|
||||
* API 与若依原生 src/components/Pagination 完全一致:同样的 props / emits / autoScroll /
|
||||
* hidden / layout / pagerCount,并通过 v-bind="$attrs" 把剩余属性透传给 el-pagination,
|
||||
* 因此所有存量页面的 <pagination> 可以直接换成 <ui-pagination> 而不改变行为。
|
||||
* 外观(主色选中态、圆角页码、字色)由 assets/styles/element-overrides.scss 覆盖,
|
||||
* 不再自行实现页码,避免与 el-pagination 的行为产生差异。
|
||||
*/
|
||||
import { scrollTo } from '@/utils/scroll-to'
|
||||
|
||||
export default {
|
||||
name: 'UiPagination',
|
||||
inheritAttrs: false,
|
||||
props: {
|
||||
total: {
|
||||
required: true,
|
||||
type: Number
|
||||
},
|
||||
page: {
|
||||
type: Number,
|
||||
default: 1
|
||||
},
|
||||
limit: {
|
||||
type: Number,
|
||||
default: 20
|
||||
},
|
||||
pageSizes: {
|
||||
type: Array,
|
||||
default() {
|
||||
return [10, 20, 30, 50]
|
||||
}
|
||||
},
|
||||
// 移动端页码按钮的数量端默认值5
|
||||
pagerCount: {
|
||||
type: Number,
|
||||
default: document.body.clientWidth < 992 ? 5 : 7
|
||||
},
|
||||
layout: {
|
||||
type: String,
|
||||
default: 'total, sizes, prev, pager, next, jumper'
|
||||
},
|
||||
background: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
autoScroll: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
hidden: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
currentPage: {
|
||||
get() {
|
||||
return this.page
|
||||
},
|
||||
set(val) {
|
||||
this.$emit('update:page', val)
|
||||
}
|
||||
},
|
||||
pageSize: {
|
||||
get() {
|
||||
return this.limit
|
||||
},
|
||||
set(val) {
|
||||
this.$emit('update:limit', val)
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleSizeChange(val) {
|
||||
if (this.currentPage * val > this.total) {
|
||||
this.currentPage = 1
|
||||
}
|
||||
this.$emit('pagination', { page: this.currentPage, limit: val })
|
||||
if (this.autoScroll) {
|
||||
scrollTo(0, 800)
|
||||
}
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.$emit('pagination', { page: val, limit: this.pageSize })
|
||||
if (this.autoScroll) {
|
||||
scrollTo(0, 800)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.pagination-container {
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.pagination-container.hidden {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
# Ui 组件集(源自 sub2api)
|
||||
|
||||
这里存放从 `sub2api/frontend` 移植过来的组件,已在 `src/main.js` 通过 `Vue.use(UiKit)`
|
||||
全局注册,页面里直接写标签即可,不需要 import。
|
||||
|
||||
设计令牌见 `src/assets/styles/tokens-vars.scss`(SCSS 变量)与
|
||||
`src/assets/styles/tokens.scss`(运行时 CSS 变量 `--s2-*`),
|
||||
组件类名见 `src/assets/styles/sub2api.scss`。
|
||||
整体迁移说明见 `docs/sub2api-ui-migration.md`。
|
||||
|
||||
| 本目录文件 | sub2api 原型 | 全局标签 |
|
||||
| --- | --- | --- |
|
||||
| `Icon.vue` + `icons.js` | `components/icons/Icon.vue` | `<ui-icon>` |
|
||||
| `StatCard.vue` | `common/StatCard.vue` | `<ui-stat-card>` |
|
||||
| `Card.vue` | `.card` 组件类 | `<ui-card>` |
|
||||
| `PageHeader.vue` | `.page-header` 组件类 | `<ui-page-header>` |
|
||||
| `Badge.vue` / `StatusBadge.vue` | `.badge` / `common/StatusBadge.vue` | `<ui-badge>` / `<ui-status-badge>` |
|
||||
| `EmptyState.vue` | `common/EmptyState.vue` | `<ui-empty-state>` |
|
||||
| `Skeleton.vue` / `LoadingSpinner.vue` | 同名组件 | `<ui-skeleton>` / `<ui-loading-spinner>` |
|
||||
| `Toggle.vue` / `Tabs.vue` | `common/Toggle.vue` / `.tabs` | `<ui-toggle>` / `<ui-tabs>` |
|
||||
| `SearchInput.vue` | `common/SearchInput.vue` | `<ui-search-input>` |
|
||||
| `Dialog.vue` / `ConfirmDialog.vue` | `common/BaseDialog.vue` / `ConfirmDialog.vue` | `<ui-dialog>` / `<ui-confirm-dialog>` |
|
||||
| `Pagination.vue` | `common/Pagination.vue` | `<ui-pagination>` |
|
||||
| `DataTable.vue` | `common/DataTable.vue` | `<ui-data-table>` |
|
||||
| `TablePageLayout.vue` | `layout/TablePageLayout.vue` | `<ui-table-page-layout>` |
|
||||
|
||||
移植时的差异:
|
||||
|
||||
- Vue 3 `<script setup>` -> Vue 2 Options API;`v-model` 回到 `value` / `input`。
|
||||
- `Teleport` -> 挂载时把浮层节点 append 到 `document.body`。
|
||||
- Tailwind `@apply` -> `sub2api.scss` 里等价的 SCSS;类名统一加 `s2-` 前缀,避免与若依全局样式冲突。
|
||||
- `vue-i18n` 文案 -> 中文字面量(若依未接入 i18n)。
|
||||
- `@vueuse/core` 的防抖 -> 组件内部实现。
|
||||
|
|
@ -0,0 +1,54 @@
|
|||
<template>
|
||||
<div style="position: relative; width: 100%;">
|
||||
<span class="s2-search-icon">
|
||||
<ui-icon name="search" size="sm" />
|
||||
</span>
|
||||
<input
|
||||
:value="value"
|
||||
type="text"
|
||||
class="s2-input"
|
||||
:placeholder="placeholder"
|
||||
style="padding-left: 40px;"
|
||||
@input="handleInput"
|
||||
@keyup.enter="$emit('search', value)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* 带搜索图标的输入框,输入防抖后派发 search 事件
|
||||
* 移植自 sub2api/frontend src/components/common/SearchInput.vue
|
||||
*/
|
||||
export default {
|
||||
name: 'UiSearchInput',
|
||||
props: {
|
||||
value: { type: String, default: '' },
|
||||
placeholder: { type: String, default: '搜索...' },
|
||||
debounce: { type: Number, default: 300 }
|
||||
},
|
||||
beforeDestroy() {
|
||||
clearTimeout(this.timer)
|
||||
},
|
||||
methods: {
|
||||
handleInput(event) {
|
||||
const value = event.target.value
|
||||
this.$emit('input', value)
|
||||
clearTimeout(this.timer)
|
||||
this.timer = setTimeout(() => this.$emit('search', value), this.debounce)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.s2-search-icon {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 14px;
|
||||
transform: translateY(-50%);
|
||||
display: flex;
|
||||
color: var(--s2-text-muted);
|
||||
pointer-events: none;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
<template>
|
||||
<div :class="classes" :style="style" />
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* 骨架屏占位
|
||||
* 移植自 sub2api/frontend src/components/common/Skeleton.vue
|
||||
*/
|
||||
export default {
|
||||
name: 'UiSkeleton',
|
||||
props: {
|
||||
variant: { type: String, default: 'rect', validator: v => ['rect', 'circle', 'text'].indexOf(v) > -1 },
|
||||
width: { type: [String, Number], default: '100%' },
|
||||
height: { type: [String, Number], default: '' }
|
||||
},
|
||||
computed: {
|
||||
classes() {
|
||||
return [
|
||||
's2-skeleton',
|
||||
this.variant === 'circle' ? 'is-circle' : this.variant === 'text' ? 'is-text' : 'is-rect'
|
||||
]
|
||||
},
|
||||
style() {
|
||||
const style = {}
|
||||
if (this.width) style.width = typeof this.width === 'number' ? `${this.width}px` : this.width
|
||||
if (this.height) {
|
||||
style.height = typeof this.height === 'number' ? `${this.height}px` : this.height
|
||||
} else if (this.variant === 'text') {
|
||||
style.height = '1em'
|
||||
style.marginTop = '0.25em'
|
||||
style.marginBottom = '0.25em'
|
||||
}
|
||||
return style
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.s2-skeleton {
|
||||
border-radius: 8px;
|
||||
|
||||
&.is-circle { border-radius: 50%; }
|
||||
&.is-text { border-radius: 4px; }
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,87 @@
|
|||
<template>
|
||||
<div class="s2-stat-card">
|
||||
<div v-if="icon || $slots.icon" :class="['s2-stat-icon', `s2-stat-icon-${iconVariant}`]">
|
||||
<slot name="icon">
|
||||
<ui-icon :name="icon" size="lg" />
|
||||
</slot>
|
||||
</div>
|
||||
<div style="min-width: 0; flex: 1 1 auto;">
|
||||
<p class="s2-stat-label" :title="title">{{ title }}</p>
|
||||
<div class="s2-stat-row">
|
||||
<p class="s2-stat-value" :title="String(formattedValue)">{{ formattedValue }}</p>
|
||||
<span v-if="change !== undefined && change !== null" :class="['s2-stat-trend', trendClass]">
|
||||
<ui-icon
|
||||
v-if="changeType !== 'neutral'"
|
||||
name="arrowUp"
|
||||
size="xs"
|
||||
:style="changeType === 'down' ? 'transform: rotate(180deg)' : ''"
|
||||
/>
|
||||
{{ formattedChange }}
|
||||
</span>
|
||||
</div>
|
||||
<p v-if="description" class="s2-stat-description">{{ description }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* 统计卡片
|
||||
* 移植自 sub2api/frontend src/components/common/StatCard.vue
|
||||
*
|
||||
* <ui-stat-card title="今日出库" :value="128" icon="cube" icon-variant="primary"
|
||||
* :change="12" change-type="up" />
|
||||
*/
|
||||
export default {
|
||||
name: 'UiStatCard',
|
||||
props: {
|
||||
title: { type: String, required: true },
|
||||
value: { type: [Number, String], required: true },
|
||||
// UiIcon 的图标名
|
||||
icon: { type: String, default: '' },
|
||||
iconVariant: {
|
||||
type: String,
|
||||
default: 'primary',
|
||||
validator: v => ['primary', 'success', 'warning', 'danger'].indexOf(v) > -1
|
||||
},
|
||||
change: { type: Number, default: null },
|
||||
changeType: { type: String, default: 'neutral', validator: v => ['up', 'down', 'neutral'].indexOf(v) > -1 },
|
||||
description: { type: String, default: '' },
|
||||
// 自定义数值格式化,例如金额 / 百分比
|
||||
formatValue: { type: Function, default: null }
|
||||
},
|
||||
computed: {
|
||||
formattedValue() {
|
||||
if (this.formatValue) return this.formatValue(this.value)
|
||||
if (typeof this.value === 'number') return this.value.toLocaleString()
|
||||
return this.value
|
||||
},
|
||||
formattedChange() {
|
||||
if (this.change === undefined || this.change === null) return ''
|
||||
return `${Math.abs(this.change)}%`
|
||||
},
|
||||
trendClass() {
|
||||
if (this.changeType === 'up') return 's2-stat-trend-up'
|
||||
if (this.changeType === 'down') return 's2-stat-trend-down'
|
||||
return ''
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "~@/assets/styles/tokens-vars.scss";
|
||||
|
||||
.s2-stat-row {
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
gap: 8px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.s2-stat-description {
|
||||
margin: 6px 0 0;
|
||||
font-size: 12px;
|
||||
color: $s2-gray-400;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,70 @@
|
|||
<template>
|
||||
<div class="s2-status">
|
||||
<span :class="['s2-status-dot', dotClass]" />
|
||||
<span class="s2-status-label">{{ label }}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* 状态点 + 文案
|
||||
* 移植自 sub2api/frontend src/components/common/StatusBadge.vue
|
||||
*/
|
||||
const VARIANT_MAP = {
|
||||
active: 'success',
|
||||
success: 'success',
|
||||
enabled: 'success',
|
||||
yes: 'success',
|
||||
disabled: 'warning',
|
||||
inactive: 'warning',
|
||||
warning: 'warning',
|
||||
pending: 'warning',
|
||||
error: 'danger',
|
||||
danger: 'danger',
|
||||
failed: 'danger',
|
||||
info: 'primary',
|
||||
default: 'gray'
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'UiStatusBadge',
|
||||
props: {
|
||||
status: { type: String, default: 'default' },
|
||||
label: { type: String, default: '' }
|
||||
},
|
||||
computed: {
|
||||
dotClass() {
|
||||
const variant = VARIANT_MAP[this.status] || 'gray'
|
||||
return `s2-status-dot-${variant}`
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "~@/assets/styles/tokens-vars.scss";
|
||||
|
||||
.s2-status {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.s2-status-dot {
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.s2-status-dot-success { background: $s2-emerald-500; }
|
||||
.s2-status-dot-warning { background: $s2-amber-500; }
|
||||
.s2-status-dot-danger { background: $s2-red-500; }
|
||||
.s2-status-dot-primary { background: $s2-primary-500; }
|
||||
.s2-status-dot-gray { background: $s2-gray-400; }
|
||||
|
||||
.s2-status-label {
|
||||
font-size: 14px;
|
||||
color: $s2-gray-700;
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,106 @@
|
|||
<template>
|
||||
<div :class="['s2-table-page', { 'is-mobile': isMobile, 'is-fill': fill }]">
|
||||
<div v-if="$slots.actions" class="s2-table-page__fixed">
|
||||
<slot name="actions" />
|
||||
</div>
|
||||
|
||||
<div v-if="$slots.filters" class="s2-table-page__fixed">
|
||||
<slot name="filters" />
|
||||
</div>
|
||||
|
||||
<div class="s2-table-page__scroll">
|
||||
<div class="s2-table-page__card">
|
||||
<slot name="table" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="$slots.pagination" class="s2-table-page__fixed">
|
||||
<slot name="pagination" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* 列表页布局:操作区 / 筛选区固定,表格区内部滚动,分页固定在底部
|
||||
* 移植自 sub2api/frontend src/components/layout/TablePageLayout.vue
|
||||
*/
|
||||
export default {
|
||||
name: 'UiTablePageLayout',
|
||||
props: {
|
||||
// 需要撑满剩余高度时设为 true(内嵌在 layout 里时常用)
|
||||
fill: { type: Boolean, default: false }
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isMobile: false
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.checkMobile()
|
||||
window.addEventListener('resize', this.checkMobile)
|
||||
},
|
||||
beforeDestroy() {
|
||||
window.removeEventListener('resize', this.checkMobile)
|
||||
},
|
||||
methods: {
|
||||
checkMobile() {
|
||||
this.isMobile = window.innerWidth < 1024
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "~@/assets/styles/tokens-vars.scss";
|
||||
|
||||
.s2-table-page {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 20px;
|
||||
|
||||
&.is-fill {
|
||||
height: calc(100vh - #{$s2-header-height} - #{$s2-tagsview-height} - 64px);
|
||||
}
|
||||
}
|
||||
|
||||
.s2-table-page__fixed {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.s2-table-page__scroll {
|
||||
flex: 1 1 auto;
|
||||
min-height: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.s2-table-page__card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
height: 100%;
|
||||
background: #fff;
|
||||
border: 1px solid $s2-gray-100;
|
||||
border-radius: var(--s2-radius-lg);
|
||||
box-shadow: $s2-shadow-card;
|
||||
|
||||
::v-deep .el-table {
|
||||
flex: 1 1 auto;
|
||||
}
|
||||
}
|
||||
|
||||
.is-mobile {
|
||||
.s2-table-page__scroll {
|
||||
flex: none;
|
||||
min-height: auto;
|
||||
}
|
||||
|
||||
.s2-table-page__card {
|
||||
height: auto;
|
||||
overflow: visible;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
<template>
|
||||
<div class="s2-tabs">
|
||||
<button
|
||||
v-for="item in normalizedItems"
|
||||
:key="item.value"
|
||||
type="button"
|
||||
:class="['s2-tab', { 's2-tab-active': item.value === value }]"
|
||||
@click="$emit('input', item.value)"
|
||||
>
|
||||
{{ item.label }}
|
||||
</button>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* 分段式标签页
|
||||
* 对应 sub2api/frontend 的 .tabs / .tab / .tab-active
|
||||
* items 支持 ['a','b'] 或 [{ label, value }]
|
||||
*/
|
||||
export default {
|
||||
name: 'UiTabs',
|
||||
props: {
|
||||
value: { type: [String, Number], default: '' },
|
||||
items: { type: Array, required: true }
|
||||
},
|
||||
computed: {
|
||||
normalizedItems() {
|
||||
return this.items.map(item =>
|
||||
typeof item === 'object' ? item : { label: item, value: item }
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
<template>
|
||||
<button
|
||||
type="button"
|
||||
role="switch"
|
||||
:aria-checked="String(!!value)"
|
||||
:class="['s2-switch', { 'is-active': !!value }]"
|
||||
@click="toggle"
|
||||
>
|
||||
<span class="s2-switch-thumb" />
|
||||
</button>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* 开关
|
||||
* 移植自 sub2api/frontend src/components/common/Toggle.vue
|
||||
* Vue2 下使用 v-model(value / input)
|
||||
*/
|
||||
export default {
|
||||
name: 'UiToggle',
|
||||
model: {
|
||||
prop: 'value',
|
||||
event: 'input'
|
||||
},
|
||||
props: {
|
||||
value: { type: Boolean, default: false },
|
||||
disabled: { type: Boolean, default: false }
|
||||
},
|
||||
methods: {
|
||||
toggle() {
|
||||
if (this.disabled) return
|
||||
this.$emit('input', !this.value)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -0,0 +1,117 @@
|
|||
// Ported from sub2api frontend src/components/icons/Icon.vue
|
||||
// Single source of truth for the shared UI icon set.
|
||||
|
||||
export const icons = {
|
||||
// Actions
|
||||
play: 'M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.348a1.125 1.125 0 010 1.971l-11.54 6.347a1.125 1.125 0 01-1.667-.985V5.653z',
|
||||
refresh: 'M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0l3.181 3.183a8.25 8.25 0 0013.803-3.7M4.031 9.865a8.25 8.25 0 0113.803-3.7l3.181 3.182m0-4.991v4.99',
|
||||
edit: 'M16.862 4.487l1.687-1.688a1.875 1.875 0 112.652 2.652L10.582 16.07a4.5 4.5 0 01-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 011.13-1.897l8.932-8.931zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0115.75 21H5.25A2.25 2.25 0 013 18.75V8.25A2.25 2.25 0 015.25 6H10',
|
||||
trash: 'M14.74 9l-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 01-2.244 2.077H8.084a2.25 2.25 0 01-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 00-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 013.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 00-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 00-7.5 0',
|
||||
plus: 'M12 4.5v15m7.5-7.5h-15',
|
||||
search: 'M21 21l-5.197-5.197m0 0A7.5 7.5 0 105.196 5.196a7.5 7.5 0 0010.607 10.607z',
|
||||
more: 'M6.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM12.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0zM18.75 12a.75.75 0 11-1.5 0 .75.75 0 011.5 0z',
|
||||
|
||||
// Status & Info
|
||||
chart: 'M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 013 19.875v-6.75zM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V8.625zM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 01-1.125-1.125V4.125z',
|
||||
clock: 'M12 6v6h4.5m4.5 0a9 9 0 11-18 0 9 9 0 0118 0z',
|
||||
link: 'M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244',
|
||||
sync: 'M19.5 12c0-1.232-.046-2.453-.138-3.662a4.006 4.006 0 00-3.7-3.7 48.678 48.678 0 00-7.324 0 4.006 4.006 0 00-3.7 3.7c-.017.22-.032.441-.046.662M19.5 12l3-3m-3 3l-3-3m-12 3c0 1.232.046 2.453.138 3.662a4.006 4.006 0 003.7 3.7 48.656 48.656 0 007.324 0 4.006 4.006 0 003.7-3.7c.017-.22.032-.441.046-.662M4.5 12l3 3m-3-3l-3 3',
|
||||
|
||||
// Navigation
|
||||
chevronDown: 'M19.5 8.25l-7.5 7.5-7.5-7.5',
|
||||
chevronRight: 'M8.25 4.5l7.5 7.5-7.5 7.5',
|
||||
chevronLeft: 'M15.75 19.5L8.25 12l7.5-7.5',
|
||||
|
||||
// UI Elements
|
||||
check: 'M4.5 12.75l6 6 9-13.5',
|
||||
x: 'M6 18L18 6M6 6l12 12',
|
||||
eye: 'M2.036 12.322a1.012 1.012 0 010-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178zM15 12a3 3 0 11-6 0 3 3 0 016 0z',
|
||||
eyeOff: 'M3.98 8.223A10.477 10.477 0 001.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.45 10.45 0 0112 4.5c4.756 0 8.773 3.162 10.065 7.498a10.523 10.523 0 01-4.293 5.774M6.228 6.228L3 3m3.228 3.228l3.65 3.65m7.894 7.894L21 21m-3.228-3.228l-3.65-3.65m0 0a3 3 0 10-4.243-4.243m4.242 4.242L9.88 9.88',
|
||||
cog: 'M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.324.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 011.37.49l1.296 2.247a1.125 1.125 0 01-.26 1.431l-1.003.827c-.293.24-.438.613-.431.992a6.759 6.759 0 010 .255c-.007.378.138.75.43.99l1.005.828c.424.35.534.954.26 1.43l-1.298 2.247a1.125 1.125 0 01-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.57 6.57 0 01-.22.128c-.331.183-.581.495-.644.869l-.213 1.28c-.09.543-.56.941-1.11.941h-2.594c-.55 0-1.02-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 01-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 01-1.369-.49l-1.297-2.247a1.125 1.125 0 01.26-1.431l1.004-.827c.292-.24.437-.613.43-.992a6.932 6.932 0 010-.255c.007-.378-.138-.75-.43-.99l-1.004-.828a1.125 1.125 0 01-.26-1.43l1.297-2.247a1.125 1.125 0 011.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.087.22-.128.332-.183.582-.495.644-.869l.214-1.281z M15 12a3 3 0 11-6 0 3 3 0 016 0z',
|
||||
grid: 'M3.75 6A2.25 2.25 0 016 3.75h2.25A2.25 2.25 0 0110.5 6v2.25a2.25 2.25 0 01-2.25 2.25H6a2.25 2.25 0 01-2.25-2.25V6zM3.75 15.75A2.25 2.25 0 016 13.5h2.25a2.25 2.25 0 012.25 2.25V18a2.25 2.25 0 01-2.25 2.25H6A2.25 2.25 0 013.75 18v-2.25zM13.5 6a2.25 2.25 0 012.25-2.25H18A2.25 2.25 0 0120.25 6v2.25A2.25 2.25 0 0118 10.5h-2.25a2.25 2.25 0 01-2.25-2.25V6zM13.5 15.75a2.25 2.25 0 012.25-2.25H18a2.25 2.25 0 012.25 2.25V18A2.25 2.25 0 0118 20.25h-2.25A2.25 2.25 0 0113.5 18v-2.25z',
|
||||
chat: 'M8.625 12a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H8.25m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0H12m4.125 0a.375.375 0 11-.75 0 .375.375 0 01.75 0zm0 0h-.375M21 12c0 4.556-4.03 8.25-9 8.25a9.764 9.764 0 01-2.555-.337A5.972 5.972 0 015.41 20.97a5.969 5.969 0 01-.474-.065 4.48 4.48 0 00.978-2.025c.09-.457-.133-.901-.467-1.226C3.93 16.178 3 14.189 3 12c0-4.556 4.03-8.25 9-8.25s9 3.694 9 8.25z',
|
||||
lightbulb: 'M12 18v-5.25m0 0a6.01 6.01 0 001.5-.189m-1.5.189a6.01 6.01 0 01-1.5-.189m3.75 7.478a12.06 12.06 0 01-4.5 0m3.75 2.383a14.406 14.406 0 01-3 0M14.25 18v-.192c0-.983.658-1.823 1.508-2.316a7.5 7.5 0 10-7.517 0c.85.493 1.509 1.333 1.509 2.316V18',
|
||||
|
||||
// Navigation & Arrows
|
||||
arrowRight: 'M13.5 4.5L21 12m0 0l-7.5 7.5M21 12H3',
|
||||
arrowLeft: 'M10.5 19.5L3 12m0 0l7.5-7.5M3 12h18',
|
||||
arrowUp: 'M5 10l7-7m0 0l7 7m-7-7v18',
|
||||
arrowDown: 'M19 14l-7 7m0 0l-7-7m7 7V3',
|
||||
arrowsUpDown: 'M3 7.5L7.5 3m0 0L12 7.5M7.5 3v13.5m13.5 0L16.5 21m0 0L12 16.5m4.5 4.5V7.5',
|
||||
chevronUp: 'M5 15l7-7 7 7',
|
||||
externalLink: 'M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14',
|
||||
|
||||
// Status & Indicators
|
||||
checkCircle: 'M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z',
|
||||
xCircle: 'M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z',
|
||||
exclamationCircle: 'M12 9v3.75m9-.75a9 9 0 11-18 0 9 9 0 0118 0zm-9 3.75h.008v.008H12v-.008z',
|
||||
exclamationTriangle: 'M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z',
|
||||
// Awards
|
||||
trophy: 'M16.5 18.75h-9m9 0a3 3 0 013 3h-15a3 3 0 013-3m9 0v-4.5A3.375 3.375 0 0012.75 11.25h-1.5A3.375 3.375 0 008.25 14.25v4.5m8.25-12V6.75a.75.75 0 00-.75-.75h-1.5a.75.75 0 00-.75.75v1.5m0 0V9a.75.75 0 01-.75.75H9.75A.75.75 0 019 9V8.25m0 0V6.75a.75.75 0 00-.75-.75h-1.5a.75.75 0 00-.75.75v1.5m12 0h.008v.008h-.008V8.25zm-12 0h.008v.008H5.25V8.25z',
|
||||
infoCircle: 'M11.25 11.25l.041-.02a.75.75 0 011.063.852l-.708 2.836a.75.75 0 001.063.853l.041-.021M21 12a9 9 0 11-18 0 9 9 0 0118 0zm-9-3.75h.008v.008H12V8.25z',
|
||||
questionCircle: 'M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z',
|
||||
|
||||
// User & Account
|
||||
user: 'M15.75 6a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0zM4.501 20.118a7.5 7.5 0 0114.998 0A17.933 17.933 0 0112 21.75c-2.676 0-5.216-.584-7.499-1.632z',
|
||||
userCircle: 'M5.121 17.804A13.937 13.937 0 0112 16c2.5 0 4.847.655 6.879 1.804M15 10a3 3 0 11-6 0 3 3 0 016 0zm6 2a9 9 0 11-18 0 9 9 0 0118 0z',
|
||||
userPlus: 'M18 9v3m0 0v3m0-3h3m-3 0h-3m-2-5a4 4 0 11-8 0 4 4 0 018 0zM3 20a6 6 0 0112 0v1H3v-1z',
|
||||
users: 'M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z',
|
||||
|
||||
// Files & Documents
|
||||
document: 'M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z',
|
||||
clipboard: 'M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2',
|
||||
copy: 'M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z',
|
||||
inbox: 'M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4',
|
||||
|
||||
// Actions
|
||||
download: 'M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4',
|
||||
upload: 'M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5',
|
||||
filter: 'M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 01-.659 1.591l-5.432 5.432a2.25 2.25 0 00-.659 1.591v2.927a2.25 2.25 0 01-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 00-.659-1.591L3.659 7.409A2.25 2.25 0 013 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0112 3z',
|
||||
globe: 'M12 21a9.004 9.004 0 008.716-6.747M12 21a9.004 9.004 0 01-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 017.843 4.582M12 3a8.997 8.997 0 00-7.843 4.582m15.686 0A11.953 11.953 0 0112 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0121 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0112 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 013 12c0-1.605.42-3.113 1.157-4.418',
|
||||
sort: 'M8.25 15L12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9',
|
||||
|
||||
// Security
|
||||
key: 'M15.75 5.25a3 3 0 013 3m3 0a6 6 0 01-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1121.75 8.25z',
|
||||
lock: 'M16.5 10.5V6.75a4.5 4.5 0 10-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 002.25-2.25v-6.75a2.25 2.25 0 00-2.25-2.25H6.75a2.25 2.25 0 00-2.25 2.25v6.75a2.25 2.25 0 002.25 2.25z',
|
||||
shield: 'M9 12.75L11.25 15 15 9.75m-3-7.036A11.959 11.959 0 013.598 6 11.99 11.99 0 003 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285z',
|
||||
|
||||
// UI Elements
|
||||
menu: 'M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5',
|
||||
calendar: 'M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 012.25-2.25h13.5A2.25 2.25 0 0121 7.5v11.25m-18 0A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75m-18 0v-7.5A2.25 2.25 0 015.25 9h13.5A2.25 2.25 0 0121 11.25v7.5',
|
||||
home: 'M2.25 12l8.954-8.955c.44-.439 1.152-.439 1.591 0L21.75 12M4.5 9.75v10.125c0 .621.504 1.125 1.125 1.125H9.75v-4.875c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125V21h4.125c.621 0 1.125-.504 1.125-1.125V9.75M8.25 21h8.25',
|
||||
terminal: 'M6.75 7.5l3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0021 18V6a2.25 2.25 0 00-2.25-2.25H5.25A2.25 2.25 0 003 6v12a2.25 2.25 0 002.25 2.25z',
|
||||
gift: 'M21 11.25v8.25a1.5 1.5 0 01-1.5 1.5H5.25a1.5 1.5 0 01-1.5-1.5v-8.25M12 4.875A2.625 2.625 0 109.375 7.5H12m0-2.625V7.5m0-2.625A2.625 2.625 0 1114.625 7.5H12m0 0V21m-8.625-9.75h18c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125h-18c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125z',
|
||||
creditCard: 'M2.25 8.25h19.5M2.25 9h19.5m-16.5 5.25h6m-6 2.25h3m-3.75 3h15a2.25 2.25 0 002.25-2.25V6.75A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25v10.5A2.25 2.25 0 004.5 19.5z',
|
||||
mail: 'M21.75 6.75v10.5a2.25 2.25 0 01-2.25 2.25h-15a2.25 2.25 0 01-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0019.5 4.5h-15a2.25 2.25 0 00-2.25 2.25m19.5 0v.243a2.25 2.25 0 01-1.07 1.916l-7.5 4.615a2.25 2.25 0 01-2.36 0L3.32 8.91a2.25 2.25 0 01-1.07-1.916V6.75',
|
||||
|
||||
// Data & Analytics
|
||||
chartBar: 'M9 19v-6a2 2 0 00-2-2H5a2 2 0 00-2 2v6a2 2 0 002 2h2a2 2 0 002-2zm0 0V9a2 2 0 012-2h2a2 2 0 012 2v10m-6 0a2 2 0 002 2h2a2 2 0 002-2m0 0V5a2 2 0 012-2h2a2 2 0 012 2v14a2 2 0 01-2 2h-2a2 2 0 01-2-2z',
|
||||
trendingUp: 'M13 7h8m0 0v8m0-8l-8 8-4-4-6 6',
|
||||
database: 'M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125',
|
||||
cube: 'M20 7l-8-4-8 4m16 0l-8 4m8-4v10l-8 4m0-10L4 7m8 4v10M4 7v10l8 4',
|
||||
|
||||
// Notification
|
||||
bell: 'M15 17h5l-1.405-1.405A2.032 2.032 0 0118 14.158V11a6.002 6.002 0 00-4-5.659V5a2 2 0 10-4 0v.341C7.67 6.165 6 8.388 6 11v3.159c0 .538-.214 1.055-.595 1.436L4 17h5m6 0v1a3 3 0 11-6 0v-1m6 0H9',
|
||||
|
||||
// Misc
|
||||
bolt: 'M13 10V3L4 14h7v7l9-11h-7z',
|
||||
sparkles: 'M9.813 15.904L9 18.75l-.813-2.846a4.5 4.5 0 00-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 003.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 003.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 00-3.09 3.09zM18.259 8.715L18 9.75l-.259-1.035a3.375 3.375 0 00-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 002.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 002.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 00-2.456 2.456z',
|
||||
cloud: 'M2.25 15a4.5 4.5 0 004.5 4.5H18a3.75 3.75 0 001.332-7.257 3 3 0 00-3.758-3.848 5.25 5.25 0 00-10.233 2.33A4.502 4.502 0 002.25 15z',
|
||||
server: 'M5.25 14.25h13.5m-13.5 0a3 3 0 01-3-3m3 3a3 3 0 100 6h13.5a3 3 0 100-6m-16.5-3a3 3 0 013-3h13.5a3 3 0 013 3m-19.5 0a4.5 4.5 0 01.9-2.7L5.737 5.1a3.375 3.375 0 012.7-1.35h7.126c1.062 0 2.062.5 2.7 1.35l2.587 3.45a4.5 4.5 0 01.9 2.7m0 0a3 3 0 01-3 3m0 3h.008v.008h-.008v-.008zm0-6h.008v.008h-.008v-.008zm-3 6h.008v.008h-.008v-.008zm0-6h.008v.008h-.008v-.008z',
|
||||
sun: 'M12 3v2.25m6.364.386l-1.591 1.591M21 12h-2.25m-.386 6.364l-1.591-1.591M12 18.75V21m-4.773-4.227l-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 11-7.5 0 3.75 3.75 0 017.5 0z',
|
||||
moon: 'M21.752 15.002A9.718 9.718 0 0118 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 003 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 009.002-5.998z',
|
||||
book: 'M12 6.042A8.967 8.967 0 006 3.75c-1.052 0-2.062.18-3 .512v14.25A8.987 8.987 0 016 18c2.305 0 4.408.867 6 2.292m0-14.25a8.966 8.966 0 016-2.292c1.052 0 2.062.18 3 .512v14.25A8.987 8.987 0 0018 18a8.967 8.967 0 00-6 2.292m0-14.25v14.25',
|
||||
dollar: 'M12 6v12m-3-2.818l.879.659c1.171.879 3.07.879 4.242 0 1.172-.879 1.172-2.303 0-3.182C13.536 12.219 12.768 12 12 12c-.725 0-1.45-.22-2.003-.659-1.106-.879-1.106-2.303 0-3.182s2.9-.879 4.006 0l.415.33M21 12a9 9 0 11-18 0 9 9 0 0118 0z',
|
||||
ban: 'M18.364 18.364A9 9 0 005.636 5.636m12.728 12.728A9 9 0 015.636 5.636m12.728 12.728L5.636 5.636',
|
||||
login: 'M15.75 9V5.25A2.25 2.25 0 0013.5 3h-6a2.25 2.25 0 00-2.25 2.25v13.5A2.25 2.25 0 007.5 21h6a2.25 2.25 0 002.25-2.25V15m3 0l3-3m0 0l-3-3m3 3H9',
|
||||
swap: 'M7.5 21L3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5',
|
||||
beaker: 'M9.75 3.104v5.714a2.25 2.25 0 01-.659 1.591L5 14.5M9.75 3.104c-.251.023-.501.05-.75.082m.75-.082a24.301 24.301 0 014.5 0m0 0v5.714c0 .597.237 1.17.659 1.591L19.8 15.3M14.25 3.104c.251.023.501.05.75.082M19.8 15.3l-1.57.393A9.065 9.065 0 0112 15a9.065 9.065 0 00-6.23.693L5 14.5m14.8.8l1.402 1.402c1.232 1.232.65 3.318-1.067 3.611A48.309 48.309 0 0112 21c-2.773 0-5.491-.235-8.135-.687-1.718-.293-2.3-2.379-1.067-3.61L5 14.5',
|
||||
cpu: 'M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z',
|
||||
chatBubble: 'M8 10h.01M12 10h.01M16 10h.01M9 16H5a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v8a2 2 0 01-2 2h-5l-5 5v-5z',
|
||||
calculator: 'M9 7h6m0 10v-3m-3 3h.01M9 17h.01M9 14h.01M12 14h.01M15 11h.01M12 11h.01M9 11h.01M7 21h10a2 2 0 002-2V5a2 2 0 00-2-2H7a2 2 0 00-2 2v14a2 2 0 002 2z',
|
||||
fire: 'M17.657 18.657A8 8 0 016.343 7.343S7 9 9 10c0-2 .5-5 2.986-7C14 5 16.09 5.777 17.656 7.343A7.975 7.975 0 0120 13a7.975 7.975 0 01-2.343 5.657z',
|
||||
badge: 'M9 12.75L11.25 15 15 9.75M21 12c0 1.268-.63 2.39-1.593 3.068a3.745 3.745 0 01-1.043 3.296 3.745 3.745 0 01-3.296 1.043A3.745 3.745 0 0112 21c-1.268 0-2.39-.63-3.068-1.593a3.746 3.746 0 01-3.296-1.043 3.745 3.745 0 01-1.043-3.296A3.745 3.745 0 013 12c0-1.268.63-2.39 1.593-3.068a3.745 3.745 0 011.043-3.296 3.746 3.746 0 013.296-1.043A3.746 3.746 0 0112 3c1.268 0 2.39.63 3.068 1.593a3.746 3.746 0 013.296 1.043 3.746 3.746 0 011.043 3.296A3.745 3.745 0 0121 12z',
|
||||
brain: 'M9.75 3.104v5.714a2.25 2.25 0 01-.659 1.591L5 14.5M9.75 3.104c-.251.023-.501.05-.75.082m.75-.082a24.301 24.301 0 014.5 0m0 0v5.714c0 .597.237 1.17.659 1.591L19.8 15.3M14.25 3.104c.251.023.501.05.75.082M19.8 15.3l-1.57.393A9.065 9.065 0 0112 15a9.065 9.065 0 00-6.23.693L5 14.5m0 0l-2.69 2.689c-1.232 1.232-.65 3.318 1.067 3.611A48.309 48.309 0 0012 21c2.773 0 5.491-.235 8.135-.687 1.718-.293 2.3-2.379 1.067-3.61L19.8 15.3M12 8.25a1.5 1.5 0 100-3 1.5 1.5 0 000 3zm0 0v3m-3-1.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3zm0 0h6m-3 4.5a1.5 1.5 0 100-3 1.5 1.5 0 000 3z'
|
||||
}
|
||||
|
||||
export default icons
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
/**
|
||||
* sub2api 设计体系组件集
|
||||
*
|
||||
* 组件与样式移植自 sub2api/frontend(Vue3 + Tailwind),已改写为
|
||||
* Vue2 SFC + SCSS,并在 main.js 里全局注册,页面中可直接使用 <ui-xxx />。
|
||||
*/
|
||||
import UiIcon from './Icon.vue'
|
||||
import UiBrandMark from './BrandMark.vue'
|
||||
import UiBadge from './Badge.vue'
|
||||
import UiStatusBadge from './StatusBadge.vue'
|
||||
import UiStatCard from './StatCard.vue'
|
||||
import UiCard from './Card.vue'
|
||||
import UiPageHeader from './PageHeader.vue'
|
||||
import UiEmptyState from './EmptyState.vue'
|
||||
import UiSkeleton from './Skeleton.vue'
|
||||
import UiLoadingSpinner from './LoadingSpinner.vue'
|
||||
import UiToggle from './Toggle.vue'
|
||||
import UiTabs from './Tabs.vue'
|
||||
import UiSearchInput from './SearchInput.vue'
|
||||
import UiDialog from './Dialog.vue'
|
||||
import UiConfirmDialog from './ConfirmDialog.vue'
|
||||
import UiPagination from './Pagination.vue'
|
||||
import UiDataTable from './DataTable.vue'
|
||||
import UiTablePageLayout from './TablePageLayout.vue'
|
||||
|
||||
const components = {
|
||||
UiIcon,
|
||||
UiBrandMark,
|
||||
UiBadge,
|
||||
UiStatusBadge,
|
||||
UiStatCard,
|
||||
UiCard,
|
||||
UiPageHeader,
|
||||
UiEmptyState,
|
||||
UiSkeleton,
|
||||
UiLoadingSpinner,
|
||||
UiToggle,
|
||||
UiTabs,
|
||||
UiSearchInput,
|
||||
UiDialog,
|
||||
UiConfirmDialog,
|
||||
UiPagination,
|
||||
UiDataTable,
|
||||
UiTablePageLayout
|
||||
}
|
||||
|
||||
const install = Vue => {
|
||||
Object.keys(components).forEach(name => {
|
||||
Vue.component(name, components[name])
|
||||
})
|
||||
}
|
||||
|
||||
export {
|
||||
UiIcon,
|
||||
UiBrandMark,
|
||||
UiBadge,
|
||||
UiStatusBadge,
|
||||
UiStatCard,
|
||||
UiCard,
|
||||
UiPageHeader,
|
||||
UiEmptyState,
|
||||
UiSkeleton,
|
||||
UiLoadingSpinner,
|
||||
UiToggle,
|
||||
UiTabs,
|
||||
UiSearchInput,
|
||||
UiDialog,
|
||||
UiConfirmDialog,
|
||||
UiPagination,
|
||||
UiDataTable,
|
||||
UiTablePageLayout
|
||||
}
|
||||
|
||||
export default { install }
|
||||
|
|
@ -45,55 +45,50 @@ export default {
|
|||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "~@/assets/styles/tokens-vars.scss";
|
||||
|
||||
.app-main {
|
||||
/* 50= navbar 50 */
|
||||
min-height: calc(100vh - 50px);
|
||||
/* 内容区底色 + sub2api 的极淡 mesh 背景。
|
||||
mesh 直接画在自己的 background 上(background-attachment: fixed 保持视口锚定),
|
||||
不再用铺满视口的 ::before 浮层:那种做法要求页面内容再叠一层 z-index 才能盖住它,
|
||||
而 .app-container / .main-container 一旦有 z-index 就会生成 stacking context,
|
||||
把页面里的 el-dialog / el-drawer 困在里面,遮罩(挂在 body 上,z-index 2000+)
|
||||
反而盖到弹窗上面,看起来就是整个页面被蒙住。 */
|
||||
min-height: calc(100vh - #{$s2-header-height});
|
||||
width: 100%;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
background-color: $s2-gray-50;
|
||||
background-image: $s2-mesh-gradient;
|
||||
background-attachment: fixed;
|
||||
}
|
||||
|
||||
.fixed-header + .app-main {
|
||||
overflow-y: auto;
|
||||
scrollbar-gutter: auto;
|
||||
height: calc(100vh - 50px);
|
||||
height: calc(100vh - #{$s2-header-height});
|
||||
min-height: 0px;
|
||||
margin-top: $s2-header-height;
|
||||
}
|
||||
|
||||
.app-main:has(.copyright) {
|
||||
padding-bottom: 36px;
|
||||
}
|
||||
|
||||
.fixed-header + .app-main {
|
||||
margin-top: 50px;
|
||||
}
|
||||
|
||||
.hasTagsView {
|
||||
.app-main {
|
||||
/* 84 = navbar + tags-view = 50 + 34 */
|
||||
min-height: calc(100vh - 84px);
|
||||
/* navbar + tags-view */
|
||||
min-height: calc(100vh - #{$s2-header-height} - #{$s2-tagsview-height});
|
||||
}
|
||||
|
||||
.fixed-header + .app-main {
|
||||
margin-top: 84px;
|
||||
height: calc(100vh - 84px);
|
||||
margin-top: $s2-header-height + $s2-tagsview-height;
|
||||
height: calc(100vh - #{$s2-header-height} - #{$s2-tagsview-height});
|
||||
min-height: 0px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
::-webkit-scrollbar {
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-track {
|
||||
background-color: #f1f1f1;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar-thumb {
|
||||
background-color: #c0c0c0;
|
||||
border-radius: 3px;
|
||||
}
|
||||
/* 滚动条样式统一由 element-overrides.scss 接管 */
|
||||
</style>
|
||||
|
|
|
|||
|
|
@ -25,10 +25,14 @@
|
|||
|
||||
</template>
|
||||
|
||||
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="hover">
|
||||
<el-dropdown class="avatar-container right-menu-item" trigger="hover">
|
||||
<div class="avatar-wrapper">
|
||||
<img :src="avatar" class="user-avatar">
|
||||
<span class="user-nickname"> {{ userName }} </span>
|
||||
<span class="user-avatar">
|
||||
<img v-if="avatar" :src="avatar" alt="">
|
||||
<span v-else class="user-avatar-initial">{{ userInitials }}</span>
|
||||
</span>
|
||||
<span class="user-nickname">{{ userName }}</span>
|
||||
<ui-icon name="chevronDown" size="sm" class="user-caret" />
|
||||
</div>
|
||||
<el-dropdown-menu slot="dropdown">
|
||||
<router-link to="/user/profile">
|
||||
|
|
@ -85,6 +89,10 @@ export default {
|
|||
get() {
|
||||
return this.$store.state.settings.topNav
|
||||
}
|
||||
},
|
||||
userInitials() {
|
||||
const name = String(this.userName || '').trim()
|
||||
return name ? name.slice(0, 1).toUpperCase() : 'U'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
@ -110,99 +118,134 @@ export default {
|
|||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "~@/assets/styles/tokens-vars.scss";
|
||||
|
||||
/* 对齐 sub2api AppHeader:glass + 64px + 底部细分割线 */
|
||||
.navbar {
|
||||
height: 50px;
|
||||
height: $s2-header-height;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
background: #fff;
|
||||
box-shadow: 0 1px 4px rgba(0,21,41,.08);
|
||||
background: rgba(255, 255, 255, 0.82);
|
||||
backdrop-filter: blur(24px);
|
||||
-webkit-backdrop-filter: blur(24px);
|
||||
border-bottom: 1px solid rgba(229, 231, 235, 0.7);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 12px;
|
||||
|
||||
.hamburger-container {
|
||||
line-height: 46px;
|
||||
height: 100%;
|
||||
float: left;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
flex-shrink: 0;
|
||||
border-radius: var(--s2-radius);
|
||||
cursor: pointer;
|
||||
transition: background .3s;
|
||||
-webkit-tap-highlight-color:transparent;
|
||||
transition: background-color 0.2s;
|
||||
-webkit-tap-highlight-color: transparent;
|
||||
|
||||
&:hover {
|
||||
background: rgba(0, 0, 0, .025)
|
||||
background: $s2-gray-100;
|
||||
}
|
||||
}
|
||||
|
||||
.breadcrumb-container {
|
||||
float: left;
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.topmenu-container {
|
||||
position: absolute;
|
||||
left: 50px;
|
||||
}
|
||||
|
||||
.errLog-container {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
flex: 1 1 auto;
|
||||
min-width: 0;
|
||||
margin-left: 8px;
|
||||
}
|
||||
|
||||
.right-menu {
|
||||
float: right;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
height: 100%;
|
||||
line-height: 50px;
|
||||
margin-left: auto;
|
||||
|
||||
&:focus {
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.right-menu-item {
|
||||
display: inline-block;
|
||||
padding: 0 8px;
|
||||
height: 100%;
|
||||
font-size: 18px;
|
||||
color: #5a5e66;
|
||||
vertical-align: text-bottom;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 40px;
|
||||
min-width: 40px;
|
||||
padding: 0 10px;
|
||||
border-radius: var(--s2-radius);
|
||||
font-size: 17px;
|
||||
color: $s2-gray-500;
|
||||
transition: background-color 0.2s, color 0.2s;
|
||||
|
||||
&.hover-effect {
|
||||
cursor: pointer;
|
||||
transition: background .3s;
|
||||
|
||||
&:hover {
|
||||
background: rgba(0, 0, 0, .025)
|
||||
}
|
||||
&.hover-effect:hover {
|
||||
background: $s2-gray-100;
|
||||
color: $s2-gray-900;
|
||||
}
|
||||
}
|
||||
|
||||
.avatar-container {
|
||||
margin-right: 0px;
|
||||
padding-right: 0px;
|
||||
padding: 0 6px;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
background: $s2-gray-100;
|
||||
}
|
||||
|
||||
.avatar-wrapper {
|
||||
margin-top: 10px;
|
||||
right: 8px;
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.user-avatar {
|
||||
cursor: pointer;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.user-avatar {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
flex-shrink: 0;
|
||||
border-radius: var(--s2-radius);
|
||||
overflow: hidden;
|
||||
background-image: $s2-gradient-primary;
|
||||
color: #fff;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
|
||||
|
||||
.user-nickname{
|
||||
position: relative;
|
||||
bottom: 10px;
|
||||
left: 2px;
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
}
|
||||
|
||||
.el-icon-caret-bottom {
|
||||
cursor: pointer;
|
||||
position: absolute;
|
||||
right: -20px;
|
||||
top: 25px;
|
||||
font-size: 12px;
|
||||
.user-avatar-initial {
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.user-nickname {
|
||||
display: none;
|
||||
font-size: 14px;
|
||||
font-weight: 500;
|
||||
color: $s2-gray-700;
|
||||
|
||||
@media (min-width: 768px) {
|
||||
display: inline;
|
||||
}
|
||||
}
|
||||
|
||||
.user-caret {
|
||||
color: $s2-gray-400;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,15 @@
|
|||
<!--
|
||||
* 菜单行内容:图标 + 文案。
|
||||
* 对齐方式(flex 居中、图标尺寸与间距)统一在 assets/styles/sidebar.scss 的 menu-row-align 里,
|
||||
* 这里只负责内容;Dot 这类“占位点”字形需要额外收紧间距,用一个标记 class 传给样式层。
|
||||
-->
|
||||
<script>
|
||||
// 仅用于子级菜单的占位点图标:画布大部分是留白,按整格间距会显得点位和文字离得远
|
||||
const BULLET_ICONS = ['Dot']
|
||||
// 子级菜单漏配 vue_icon 时兜底用的点位图标:菜单树里“子级用点占位”本来就是既有约定,
|
||||
// 直接复用同一个图标,才能和真正的 Dot 行像素对齐(四级菜单目前全部没配图标)
|
||||
const FALLBACK_BULLET = 'Dot'
|
||||
|
||||
export default {
|
||||
name: 'MenuItem',
|
||||
functional: true,
|
||||
|
|
@ -10,14 +21,24 @@ export default {
|
|||
title: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
// 所在层级,一级和子级的“没图标”处理方式不同
|
||||
depth: {
|
||||
type: Number,
|
||||
default: 1
|
||||
}
|
||||
},
|
||||
render(h, context) {
|
||||
const { icon, title } = context.props
|
||||
const { icon, title, depth } = context.props
|
||||
const vnodes = []
|
||||
|
||||
if (icon) {
|
||||
vnodes.push(<svg-icon icon-class={icon}/>)
|
||||
if (icon || depth > 1) {
|
||||
const name = icon || FALLBACK_BULLET
|
||||
const isBullet = BULLET_ICONS.indexOf(name) > -1
|
||||
vnodes.push(<svg-icon icon-class={name} class-name={isBullet ? 'menu-icon-bullet' : undefined}/>)
|
||||
} else {
|
||||
// 一级没配图标的行也要占住图标列,否则同层里有图标和没图标的行文案起点会错开
|
||||
vnodes.push(<span class="menu-icon-placeholder" aria-hidden="true"/>)
|
||||
}
|
||||
|
||||
if (title) {
|
||||
|
|
|
|||
|
|
@ -1,26 +1,15 @@
|
|||
<template>
|
||||
<div class="sidebar-logo-container" :class="{'collapse':collapse}" :style="{ backgroundColor: sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
|
||||
<transition name="sidebarLogoFade">
|
||||
<router-link v-if="collapse" key="collapse" class="sidebar-logo-link" to="/">
|
||||
<div v-if="logo" style="width: 30px; position: absolute; overflow: hidden;">
|
||||
<img :src="logo" class="sidebar-logo"/>
|
||||
</div>
|
||||
<h1 v-else class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
|
||||
</router-link>
|
||||
<router-link v-else key="expand" class="sidebar-logo-link" to="/">
|
||||
<div v-if="logo" style="width: 30px; position: absolute; overflow: hidden;">
|
||||
<img :src="logo" class="sidebar-logo"/>
|
||||
</div>
|
||||
<h1 class="sidebar-title" :style="{ color: sideTheme === 'theme-dark' ? variables.logoTitleColor : variables.logoLightTitleColor }">{{ title }} </h1>
|
||||
</router-link>
|
||||
</transition>
|
||||
<div class="sidebar-logo-container" :class="{ collapse: collapse }">
|
||||
<router-link class="sidebar-logo-link" to="/">
|
||||
<span class="sidebar-logo-mark">
|
||||
<ui-brand-mark :size="22" />
|
||||
</span>
|
||||
<h1 v-show="!collapse" class="sidebar-title">{{ title }}</h1>
|
||||
</router-link>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import logoImg from '@/assets/logo/logo.png'
|
||||
import variables from '@/assets/styles/variables.scss'
|
||||
|
||||
export default {
|
||||
name: 'SidebarLogo',
|
||||
props: {
|
||||
|
|
@ -30,66 +19,76 @@ export default {
|
|||
}
|
||||
},
|
||||
computed: {
|
||||
variables() {
|
||||
return variables
|
||||
},
|
||||
sideTheme() {
|
||||
return this.$store.state.settings.sideTheme
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
title: process.env.VUE_APP_TITLE,
|
||||
logo: logoImg
|
||||
title: process.env.VUE_APP_TITLE
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.sidebarLogoFade-enter-active {
|
||||
transition: opacity 1.5s;
|
||||
}
|
||||
|
||||
.sidebarLogoFade-enter,
|
||||
.sidebarLogoFade-leave-to {
|
||||
opacity: 0;
|
||||
}
|
||||
@import "~@/assets/styles/tokens-vars.scss";
|
||||
|
||||
/* 对齐 sub2api .sidebar-header:h-16 px-6 + 底部细分割线 */
|
||||
.sidebar-logo-container {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 50px;
|
||||
line-height: 50px;
|
||||
background: #2b2f3a;
|
||||
text-align: center;
|
||||
flex-shrink: 0;
|
||||
height: 64px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid $s2-gray-100;
|
||||
padding: 0 16px;
|
||||
overflow: hidden;
|
||||
transition: padding 0.2s ease;
|
||||
|
||||
& .sidebar-logo-link {
|
||||
height: 100%;
|
||||
.is-dark & {
|
||||
border-bottom-color: $s2-accent-800;
|
||||
}
|
||||
|
||||
.sidebar-logo-link {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
width: 100%;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
& .sidebar-logo {
|
||||
.sidebar-logo-mark {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
border-radius: 12px;
|
||||
background-image: $s2-gradient-primary;
|
||||
box-shadow: 0 4px 10px -2px rgba(24, 144, 255, 0.4);
|
||||
color: #fff;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
vertical-align: middle;
|
||||
margin-right: 12px;
|
||||
}
|
||||
|
||||
& .sidebar-title {
|
||||
display: inline-block;
|
||||
margin: 0;
|
||||
color: #fff;
|
||||
font-weight: 600;
|
||||
line-height: 50px;
|
||||
font-size: 14px;
|
||||
font-family: Avenir, Helvetica Neue, Arial, Helvetica, sans-serif;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.sidebar-title {
|
||||
margin: 0;
|
||||
min-width: 0;
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
letter-spacing: 0;
|
||||
line-height: 1.3;
|
||||
color: $s2-gray-900;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
&.collapse {
|
||||
.sidebar-logo {
|
||||
margin-right: 0px;
|
||||
padding: 0 18px;
|
||||
|
||||
.sidebar-logo-link {
|
||||
justify-content: center;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,21 +2,22 @@
|
|||
<div v-if="!item.hidden">
|
||||
<template v-if="hasOneShowingChild(item.children,item) && (!onlyOneChild.children||onlyOneChild.noShowingChildren)&&!item.alwaysShow">
|
||||
<app-link v-if="onlyOneChild.meta" :to="resolvePath(onlyOneChild.path, onlyOneChild.query)">
|
||||
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="{'submenu-title-noDropdown':!isNest}">
|
||||
<item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" />
|
||||
<el-menu-item :index="resolvePath(onlyOneChild.path)" :class="itemClass">
|
||||
<item :icon="onlyOneChild.meta.icon||(item.meta&&item.meta.icon)" :title="onlyOneChild.meta.title" :depth="level" />
|
||||
</el-menu-item>
|
||||
</app-link>
|
||||
</template>
|
||||
|
||||
<el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body>
|
||||
<el-submenu v-else ref="subMenu" :index="resolvePath(item.path)" popper-append-to-body :class="submenuClass">
|
||||
<template slot="title">
|
||||
<item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" />
|
||||
<item v-if="item.meta" :icon="item.meta && item.meta.icon" :title="item.meta.title" :depth="level" />
|
||||
</template>
|
||||
<sidebar-item
|
||||
v-for="(child, index) in item.children"
|
||||
:key="child.path + index"
|
||||
:is-nest="true"
|
||||
:item="child"
|
||||
:depth="level + 1"
|
||||
:base-path="resolvePath(child.path)"
|
||||
class="nest-menu"
|
||||
/>
|
||||
|
|
@ -48,12 +49,34 @@ export default {
|
|||
basePath: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
// 菜单层级,由上层递归传入;样式层按层级控制缩进、行高和层级引导线
|
||||
depth: {
|
||||
type: Number,
|
||||
default: 1
|
||||
}
|
||||
},
|
||||
data() {
|
||||
this.onlyOneChild = null
|
||||
return {}
|
||||
},
|
||||
computed: {
|
||||
// 超过五级不再继续加深缩进,否则深层菜单名会被挤到截断
|
||||
level() {
|
||||
return Math.min(this.depth, 5)
|
||||
},
|
||||
itemClass() {
|
||||
return {
|
||||
'submenu-title-noDropdown': !this.isNest,
|
||||
['menu-depth-' + this.level]: true
|
||||
}
|
||||
},
|
||||
submenuClass() {
|
||||
return {
|
||||
['menu-depth-' + this.level]: true
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
hasOneShowingChild(children = [], parent) {
|
||||
if (!children) {
|
||||
|
|
@ -98,7 +121,9 @@ export default {
|
|||
}
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .el-submenu__title {
|
||||
/* 加粗只留给一二级分组标题;三四级再加粗,四级菜单整棵树会显得很吵 */
|
||||
::v-deep .menu-depth-1 > .el-submenu__title,
|
||||
::v-deep .menu-depth-2 > .el-submenu__title {
|
||||
font-size: 14px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,16 +1,18 @@
|
|||
<template>
|
||||
<div :class="{'has-logo':showLogo}" :style="{ backgroundColor: settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground }">
|
||||
<div class="sidebar-container" :class="{'has-logo':showLogo, 'is-dark': settings.sideTheme === 'theme-dark'}">
|
||||
<logo v-if="showLogo" :collapse="isCollapse" />
|
||||
<el-scrollbar :class="settings.sideTheme" wrap-class="scrollbar-wrapper">
|
||||
<el-menu
|
||||
ref="sideMenu"
|
||||
:default-active="activeMenu"
|
||||
:collapse="isCollapse"
|
||||
:background-color="settings.sideTheme === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground"
|
||||
:text-color="settings.sideTheme === 'theme-dark' ? variables.menuColor : variables.menuLightColor"
|
||||
background-color="transparent"
|
||||
:unique-opened="true"
|
||||
:active-text-color="settings.theme"
|
||||
:collapse-transition="false"
|
||||
mode="vertical"
|
||||
@open="handleMenuOpen"
|
||||
@close="handleMenuClose"
|
||||
>
|
||||
<sidebar-item
|
||||
v-for="(route, index) in sidebarRouters"
|
||||
|
|
@ -24,10 +26,10 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import pathLib from 'path'
|
||||
import { mapGetters, mapState } from "vuex"
|
||||
import Logo from "./Logo"
|
||||
import SidebarItem from "./SidebarItem"
|
||||
import variables from "@/assets/styles/variables.scss"
|
||||
|
||||
export default {
|
||||
components: { SidebarItem, Logo },
|
||||
|
|
@ -46,12 +48,58 @@ export default {
|
|||
showLogo() {
|
||||
return this.$store.state.settings.sidebarLogo
|
||||
},
|
||||
variables() {
|
||||
return variables
|
||||
},
|
||||
isCollapse() {
|
||||
return !this.sidebar.opened
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 监听菜单折叠事件:当折叠"进销存管理"时同步折叠"出库管理"子菜单
|
||||
handleMenuClose(index) {
|
||||
// 在一级路由中找到当前折叠的菜单
|
||||
const closedRoute = this.sidebarRouters.find(route => route.path === index)
|
||||
if (!closedRoute || !closedRoute.children || !closedRoute.children.length) return
|
||||
|
||||
// 找到直属子级中名为"出库管理"的子菜单
|
||||
const outerRoute = closedRoute.children.find(
|
||||
child => !child.hidden && child.meta && child.meta.title === '出库管理'
|
||||
)
|
||||
if (!outerRoute) return
|
||||
|
||||
// 计算"出库管理"在 el-menu 中注册的 index(与展开逻辑保持一致)
|
||||
const outerBasePath = pathLib.resolve(index, outerRoute.path)
|
||||
const outerIndex = pathLib.resolve(outerBasePath, outerRoute.path)
|
||||
|
||||
if (this.$refs.sideMenu) {
|
||||
this.$refs.sideMenu.close(outerIndex)
|
||||
}
|
||||
},
|
||||
// 监听菜单展开事件:当展开的菜单含有"出库管理"子菜单时同步将其展开
|
||||
handleMenuOpen(index) {
|
||||
// 在一级路由中找到当前展开的菜单
|
||||
const openedRoute = this.sidebarRouters.find(route => route.path === index)
|
||||
if (!openedRoute || !openedRoute.children || !openedRoute.children.length) return
|
||||
|
||||
// 找到直属子级中名为"出库管理"且自身含子项的子菜单
|
||||
const outerRoute = openedRoute.children.find(
|
||||
child => !child.hidden && child.meta && child.meta.title === '出库管理'
|
||||
)
|
||||
if (!outerRoute) return
|
||||
|
||||
// 计算"出库管理"对应的 el-menu index
|
||||
// SidebarItem 渲染嵌套菜单时:
|
||||
// 先将 basePath 设为 path.resolve(parentPath, child.path)
|
||||
// 再以新 basePath 计算 el-submenu :index = path.resolve(basePath, child.path)
|
||||
// 因此需要对 child.path 做两次 resolve 才能与注册 index 对齐
|
||||
const outerBasePath = pathLib.resolve(index, outerRoute.path)
|
||||
const outerIndex = pathLib.resolve(outerBasePath, outerRoute.path)
|
||||
|
||||
// 延迟 300ms 展开,确保 el-submenu 子组件已完成挂载并向 el-menu 注册
|
||||
setTimeout(() => {
|
||||
if (this.$refs.sideMenu) {
|
||||
this.$refs.sideMenu.open(outerIndex)
|
||||
}
|
||||
}, 300)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -80,11 +80,9 @@ export default {
|
|||
return route.path === this.$route.path
|
||||
},
|
||||
activeStyle(tag) {
|
||||
if (!this.isActive(tag)) return {}
|
||||
return {
|
||||
"background-color": this.theme,
|
||||
"border-color": this.theme
|
||||
}
|
||||
// 高亮样式改由 CSS 变量驱动(--current-color 由 layout 注入),
|
||||
// 保证与 sub2api 设计体系的浅色胶囊一致
|
||||
return {}
|
||||
},
|
||||
isAffix(tag) {
|
||||
return tag.meta && tag.meta.affix
|
||||
|
|
@ -238,46 +236,70 @@ export default {
|
|||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import "~@/assets/styles/tokens-vars.scss";
|
||||
|
||||
/* 页签改成 sub2api 风格的胶囊 chips */
|
||||
.tags-view-container {
|
||||
height: 34px;
|
||||
height: $s2-tagsview-height;
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
border-bottom: 1px solid #d8dce5;
|
||||
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .12), 0 0 3px 0 rgba(0, 0, 0, .04);
|
||||
background: rgba(255, 255, 255, 0.72);
|
||||
backdrop-filter: blur(24px);
|
||||
-webkit-backdrop-filter: blur(24px);
|
||||
border-bottom: 1px solid rgba(229, 231, 235, 0.7);
|
||||
|
||||
.tags-view-wrapper {
|
||||
.tags-view-item {
|
||||
display: inline-block;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
height: 26px;
|
||||
line-height: 26px;
|
||||
border: 1px solid #d8dce5;
|
||||
color: #495060;
|
||||
background: #fff;
|
||||
padding: 0 8px;
|
||||
font-size: 12px;
|
||||
margin-left: 5px;
|
||||
margin-top: 4px;
|
||||
&:first-of-type {
|
||||
margin-left: 15px;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.tags-view-item {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
position: relative;
|
||||
cursor: pointer;
|
||||
height: 28px;
|
||||
line-height: 28px;
|
||||
border: 1px solid transparent;
|
||||
color: $s2-gray-600;
|
||||
background: $s2-gray-100;
|
||||
padding: 0 12px;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
border-radius: 9999px;
|
||||
margin-left: 8px;
|
||||
margin-top: 8px;
|
||||
transition: background-color 0.2s, color 0.2s;
|
||||
|
||||
&:first-of-type {
|
||||
margin-left: 16px;
|
||||
}
|
||||
|
||||
&:last-of-type {
|
||||
margin-right: 16px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: $s2-gray-200;
|
||||
color: $s2-gray-900;
|
||||
}
|
||||
|
||||
&.active {
|
||||
background: $s2-primary-50;
|
||||
color: var(--current-color, #{$s2-primary-600});
|
||||
font-weight: 600;
|
||||
|
||||
&::before {
|
||||
content: '';
|
||||
display: inline-block;
|
||||
width: 6px;
|
||||
height: 6px;
|
||||
border-radius: 50%;
|
||||
margin-right: 4px;
|
||||
background: currentColor;
|
||||
}
|
||||
&:last-of-type {
|
||||
margin-right: 15px;
|
||||
}
|
||||
&.active {
|
||||
background-color: #42b983;
|
||||
color: #fff;
|
||||
border-color: #42b983;
|
||||
&::before {
|
||||
content: '';
|
||||
background: #fff;
|
||||
display: inline-block;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
position: relative;
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: $s2-primary-100;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -292,18 +314,23 @@ export default {
|
|||
z-index: 3000;
|
||||
position: absolute;
|
||||
list-style-type: none;
|
||||
padding: 5px 0;
|
||||
border-radius: 4px;
|
||||
padding: 4px;
|
||||
border-radius: var(--s2-radius);
|
||||
border: 1px solid $s2-gray-200;
|
||||
font-size: 12px;
|
||||
font-weight: 400;
|
||||
color: #333;
|
||||
box-shadow: 2px 2px 3px 0 rgba(0, 0, 0, .3);
|
||||
color: $s2-gray-700;
|
||||
box-shadow: $s2-shadow-xl;
|
||||
|
||||
li {
|
||||
margin: 0;
|
||||
padding: 7px 16px;
|
||||
padding: 7px 14px;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
background: #eee;
|
||||
background: $s2-gray-100;
|
||||
color: $s2-primary-600;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,13 +96,13 @@ export default {
|
|||
position: fixed;
|
||||
top: 0;
|
||||
right: 0;
|
||||
z-index: 9;
|
||||
z-index: 901;
|
||||
width: calc(100% - #{$base-sidebar-width});
|
||||
transition: width 0.28s;
|
||||
}
|
||||
|
||||
.hideSidebar .fixed-header {
|
||||
width: calc(100% - 54px);
|
||||
width: calc(100% - #{$s2-sidebar-collapsed});
|
||||
}
|
||||
|
||||
.sidebarHide .fixed-header {
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ import './permission' // permission control
|
|||
import { getDicts } from "@/api/system/dict/data"
|
||||
import { getConfigKey } from "@/api/system/config"
|
||||
import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi"
|
||||
import { formatCurrency } from "@/utils"
|
||||
// 分页组件
|
||||
import Pagination from "@/components/Pagination"
|
||||
// 自定义表格工具组件
|
||||
|
|
@ -37,11 +38,14 @@ import ImagePreview from "@/components/ImagePreview"
|
|||
import DictTag from '@/components/DictTag'
|
||||
// 字典数据组件
|
||||
import DictData from '@/components/DictData'
|
||||
// sub2api 设计体系组件集(Ui* 全局注册)
|
||||
import UiKit from '@/components/ui'
|
||||
|
||||
// 全局方法挂载
|
||||
Vue.prototype.getDicts = getDicts
|
||||
Vue.prototype.getConfigKey = getConfigKey
|
||||
Vue.prototype.parseTime = parseTime
|
||||
Vue.prototype.formatCurrency = formatCurrency
|
||||
Vue.prototype.resetForm = resetForm
|
||||
Vue.prototype.addDateRange = addDateRange
|
||||
Vue.prototype.selectDictLabel = selectDictLabel
|
||||
|
|
@ -60,6 +64,7 @@ Vue.component('ImagePreview', ImagePreview)
|
|||
|
||||
Vue.use(directive)
|
||||
Vue.use(plugins)
|
||||
Vue.use(UiKit)
|
||||
DictData.install()
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -5,12 +5,16 @@ import NProgress from 'nprogress'
|
|||
import 'nprogress/nprogress.css'
|
||||
import { isPathMatch } from '@/utils/validate'
|
||||
import { isRelogin } from '@/utils/request'
|
||||
import { isServiceHost } from '@/utils/serviceHost'
|
||||
|
||||
NProgress.configure({ showSpinner: false })
|
||||
|
||||
const whiteList = ['/login', '/register', '/manage/service','/system/vendor/query','/system/partner/query']
|
||||
|
||||
const isWhiteList = (path) => {
|
||||
if (path === '/' && isServiceHost()) {
|
||||
return true
|
||||
}
|
||||
return whiteList.some(pattern => isPathMatch(pattern, path))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -9,13 +9,12 @@ const baseURL = process.env.VUE_APP_BASE_API
|
|||
let downloadLoadingInstance
|
||||
|
||||
export default {
|
||||
name(name, isDelete = true) {
|
||||
download(name, isDelete = true) {
|
||||
var url = baseURL + "/common/download?fileName=" + encodeURIComponent(name) + "&delete=" + isDelete
|
||||
axios({
|
||||
method: 'get',
|
||||
url: url,
|
||||
responseType: 'blob',
|
||||
headers: { 'Authorization': 'Bearer ' + getToken() }
|
||||
}).then((res) => {
|
||||
const isBlob = blobValidate(res.data)
|
||||
if (isBlob) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import Vue from 'vue'
|
||||
import Router from 'vue-router'
|
||||
import { isServiceHost } from '@/utils/serviceHost'
|
||||
|
||||
Vue.use(Router)
|
||||
|
||||
|
|
@ -51,6 +52,20 @@ export const constantRoutes = [
|
|||
component: () => import('@/views/register'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
// sub2api 设计体系的组件预览页,登录后按 URL 访问,不进菜单
|
||||
path: '/ui-preview',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
component: () => import('@/views/ui/preview'),
|
||||
name: 'UiPreview',
|
||||
meta: { title: 'UI 设计体系', icon: 'nested' }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/404',
|
||||
component: () => import('@/views/error/404'),
|
||||
|
|
@ -62,10 +77,10 @@ export const constantRoutes = [
|
|||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '',
|
||||
path: isServiceHost() ? '/admin-root' : '',
|
||||
component: Layout,
|
||||
redirect: 'index',
|
||||
children: [
|
||||
redirect: isServiceHost() ? undefined : 'index',
|
||||
children: isServiceHost() ? [] : [
|
||||
{
|
||||
path: 'index',
|
||||
component: () => import('@/views/index'),
|
||||
|
|
@ -94,6 +109,46 @@ export const constantRoutes = [
|
|||
component: () => import('@/views/approve/approved_order/index'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'paymentLog',
|
||||
component: () => import('@/views/approve/finance/payment/approved/index'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'paymentRedLog',
|
||||
component: () => import('@/views/approve/finance/paymentRefund/approved/index'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'invoiceRedLog',
|
||||
component: () => import('@/views/approve/finance/invoiceRed/approved/index'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'invoiceLog',
|
||||
component: () => import('@/views/approve/finance/invoiceReceipt/approved/index'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'receiptLog',
|
||||
component: () => import('@/views/approve/finance/receipt/approved/index.vue'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'receiptRefoundLog',
|
||||
component: () => import('@/views/approve/finance/receiptRefound/approved/index.vue'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'receivableInvoiceLog',
|
||||
component: () => import('@/views/approve/finance/receivableInvoice/approved/index.vue'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: 'receivableInvoiceRefundLog',
|
||||
component: () => import('@/views/approve/finance/receivableInvoiceRefund/approved/index.vue'),
|
||||
hidden: true
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -112,6 +167,11 @@ export const constantRoutes = [
|
|||
},
|
||||
|
||||
|
||||
{
|
||||
path: isServiceHost() ? '/' : '/service-host-root',
|
||||
component: () => import('@/views/manage/service/index'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/manage/service',
|
||||
component: () => import('@/views/manage/service/index'),
|
||||
|
|
@ -164,6 +224,31 @@ export const dynamicRoutes = [
|
|||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/finance',
|
||||
component: Layout,
|
||||
redirect: 'noRedirect',
|
||||
name: 'Finance',
|
||||
meta: {
|
||||
title: '财务管理',
|
||||
icon: 'money'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: 'payment',
|
||||
component: () => import('@/views/finance/payment/index'),
|
||||
name: 'Payment',
|
||||
meta: { title: '付款单', icon: 'form' }
|
||||
},
|
||||
{
|
||||
path: 'charge',
|
||||
component: () => import('@/views/finance/charge/index'),
|
||||
name: 'Charge',
|
||||
meta: { title: '财务计收', icon: 'money' },
|
||||
permissions: ['finance:charge:list']
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/inventory/execution',
|
||||
component: Layout,
|
||||
|
|
|
|||
|
|
@ -6,8 +6,9 @@ module.exports = {
|
|||
title: '汇智OMS订单管理系统',
|
||||
/**
|
||||
* 侧边栏主题 深色主题theme-dark,浅色主题theme-light
|
||||
* sub2api 设计体系默认使用浅色侧边栏
|
||||
*/
|
||||
sideTheme: 'theme-dark',
|
||||
sideTheme: 'theme-light',
|
||||
|
||||
/**
|
||||
* 系统布局配置
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue