runbir-tools 1.0.5 → 1.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -211
- package/dist/runbir-tools.es.js +3 -3
- package/dist/runbir-tools.umd.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,217 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 软博工具包
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
这是一个基于vue3开发的工具包
|
|
4
4
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
- ⚡️ [Vite](https://vitejs.dev/) - 下一代前端工具链
|
|
8
|
-
- 🖖 [Vue 3](https://vuejs.org/) - 渐进式 JavaScript 框架
|
|
9
|
-
- 🦾 [TypeScript](https://www.typescriptlang.org/) - 类型安全的 JavaScript 超集
|
|
10
|
-
- 📦 [PNPM](https://pnpm.io/) - 快速、节省磁盘空间的包管理器
|
|
11
|
-
- 💅 [Sass](https://sass-lang.com/) - 专业级的 CSS 扩展语言
|
|
12
|
-
- 📅 [Day.js](https://day.js.org/) - 轻量级日期处理库
|
|
13
|
-
- 📊 [Vue-ECharts](https://github.com/ecomfe/vue-echarts) - ECharts 图表组件
|
|
14
|
-
- 🎨 [Element Plus](https://element-plus.org/) - Vue 3 组件库
|
|
15
|
-
- � [ESLint](https://eslint.org/) - 可插拔的 JavaScript 代码检查工具
|
|
16
|
-
- 🐶 [Husky](https://typicode.github.io/husky/) - Git 钩子工具
|
|
17
|
-
- 🚫 [lint-staged](https://github.com/okonet/lint-staged) - 对暂存的 Git 文件运行 linter
|
|
18
|
-
|
|
19
|
-
## 项目结构
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
├── .husky/ # Git钩子配置
|
|
23
|
-
│ ├── pre-commit # 提交前执行的脚本
|
|
24
|
-
│ └── commit-msg # commit信息校验
|
|
25
|
-
├── .vscode/ # VSCode配置
|
|
26
|
-
│ ├── settings.json # 编辑器设置
|
|
27
|
-
│ └── extensions.json # 推荐插件
|
|
28
|
-
├── public/ # 静态资源目录
|
|
29
|
-
│ └── vue.svg # 网站图标
|
|
30
|
-
├── src/ # 源代码目录
|
|
31
|
-
│ ├── assets/ # 静态资源
|
|
32
|
-
│ │ ├── fonts/ # 字体文件
|
|
33
|
-
│ │ ├── images/ # 图片资源
|
|
34
|
-
│ │ └── styles/ # 样式文件
|
|
35
|
-
│ │ ├── _mixins.scss # SCSS混入
|
|
36
|
-
│ │ └── _variables.scss # SCSS变量
|
|
37
|
-
│ ├── components/ # 公共组件
|
|
38
|
-
│ ├── composables/ # 组合式函数
|
|
39
|
-
│ ├── router/ # 路由配置
|
|
40
|
-
│ │ └── index.ts # 路由入口
|
|
41
|
-
│ ├── services/ # API服务
|
|
42
|
-
│ │ └── api-client.ts # 请求封装
|
|
43
|
-
│ ├── stores/ # 状态管理
|
|
44
|
-
│ │ ├── index.ts # Store入口
|
|
45
|
-
│ │ └── modules/ # Store模块
|
|
46
|
-
│ ├── types/ # 类型定义
|
|
47
|
-
│ ├── utils/ # 工具函数
|
|
48
|
-
│ ├── view/ # 页面组件
|
|
49
|
-
│ ├── App.vue # 根组件
|
|
50
|
-
│ ├── main.ts # 应用入口
|
|
51
|
-
│ ├── style.css # 全局样式
|
|
52
|
-
│ └── vite-env.d.ts # 环境变量类型
|
|
53
|
-
├── .env # 基础环境变量
|
|
54
|
-
├── .env.development # 开发环境变量
|
|
55
|
-
├── .env.production # 生产环境变量
|
|
56
|
-
├── .gitignore # Git忽略规则
|
|
57
|
-
├── .prettierrc.cjs # Prettier配置
|
|
58
|
-
├── auto-imports.d.ts # 自动导入声明
|
|
59
|
-
├── components.d.ts # 组件类型声明
|
|
60
|
-
├── eslint.config.js # ESLint配置
|
|
61
|
-
├── index.html # HTML入口
|
|
62
|
-
├── package.json # 项目配置
|
|
63
|
-
├── pnpm-lock.yaml # 依赖锁文件
|
|
64
|
-
├── README.md # 项目说明
|
|
65
|
-
├── tsconfig.app.json # 应用TS配置
|
|
66
|
-
├── tsconfig.json # 基础TS配置
|
|
67
|
-
├── tsconfig.node.json # Node环境TS配置
|
|
68
|
-
└── vite.config.ts # Vite配置
|
|
69
|
-
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
## 快速开始
|
|
73
|
-
|
|
74
|
-
### 安装依赖
|
|
75
|
-
|
|
76
|
-
```bash
|
|
77
|
-
pnpm install
|
|
78
|
-
```
|
|
79
|
-
|
|
80
|
-
### 开发模式
|
|
81
|
-
|
|
82
|
-
```bash
|
|
83
|
-
pnpm dev
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
### 生产构建
|
|
87
|
-
|
|
88
|
-
```bash
|
|
89
|
-
pnpm build
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
### 预览生产构建
|
|
93
|
-
|
|
94
|
-
```bash
|
|
95
|
-
pnpm preview
|
|
96
|
-
```
|
|
97
|
-
|
|
98
|
-
### 代码检查
|
|
99
|
-
|
|
100
|
-
```bash
|
|
101
|
-
pnpm lint
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
### 格式化代码
|
|
105
|
-
|
|
106
|
-
```bash
|
|
107
|
-
pnpm format
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
### 初始化 Git 钩子
|
|
111
|
-
|
|
112
|
-
```bash
|
|
113
|
-
pnpm prepare
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
### 运行测试(开发模式)
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
pnpm test
|
|
120
|
-
```
|
|
121
|
-
|
|
122
|
-
### 运行测试(CI 模式)
|
|
123
|
-
|
|
124
|
-
```bash
|
|
125
|
-
pnpm test:run
|
|
126
|
-
```
|
|
127
|
-
|
|
128
|
-
### 生成覆盖率报告
|
|
129
|
-
|
|
130
|
-
```bash
|
|
131
|
-
pnpm coverage
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
## 主要依赖说明
|
|
135
|
-
|
|
136
|
-
### Element Plus 使用
|
|
137
|
-
|
|
138
|
-
项目已集成 Element Plus 组件库,自动按需导入配置已完成。使用方式:
|
|
139
|
-
|
|
140
|
-
```typescript
|
|
141
|
-
// 在组件中直接使用
|
|
142
|
-
<el-button type="primary">按钮</el-button>
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
### Vue-ECharts 使用
|
|
146
|
-
|
|
147
|
-
项目已集成 Vue-ECharts 图表库,采用全局按需注册的方式,使用方式:
|
|
148
|
-
|
|
149
|
-
```typescript
|
|
150
|
-
// 在main.ts 中注册
|
|
151
|
-
import { BarChart, LineChart, PieChart } from 'echarts/charts'
|
|
152
|
-
|
|
153
|
-
use([
|
|
154
|
-
CanvasRenderer,
|
|
155
|
-
BarChart,
|
|
156
|
-
LineChart,
|
|
157
|
-
PieChart,
|
|
158
|
-
GridComponent,
|
|
159
|
-
TooltipComponent,
|
|
160
|
-
LegendComponent,
|
|
161
|
-
TitleComponent,
|
|
162
|
-
])
|
|
163
|
-
```
|
|
5
|
+
## 基于ol的快速开发组件
|
|
164
6
|
|
|
165
7
|
```typescript
|
|
166
|
-
// 在组件中使用
|
|
167
|
-
<template>
|
|
168
|
-
<v-chart class="chart" :option="option" />
|
|
169
|
-
</template>
|
|
170
8
|
|
|
171
|
-
<script setup>
|
|
172
|
-
import type { EChartsOption } from 'echarts'
|
|
173
|
-
|
|
174
|
-
const options = ref<EChartsOption>({
|
|
175
|
-
// 配置项
|
|
176
|
-
})
|
|
177
|
-
</script>
|
|
178
|
-
```
|
|
179
|
-
|
|
180
|
-
### Day.js 使用
|
|
181
|
-
|
|
182
|
-
项目已集成 Day.js 日期处理库,推荐使用方式:
|
|
183
|
-
|
|
184
|
-
```typescript
|
|
185
|
-
import dayjs from 'dayjs'
|
|
186
|
-
|
|
187
|
-
// 格式化日期
|
|
188
|
-
const formattedDate = dayjs().format('YYYY-MM-DD HH:mm:ss')
|
|
189
9
|
```
|
|
190
|
-
|
|
191
|
-
## Git 提交规范
|
|
192
|
-
|
|
193
|
-
项目使用 [Conventional Commits](https://www.conventionalcommits.org/) 规范,提交前会自动运行 lint-staged 进行检查。
|
|
194
|
-
|
|
195
|
-
## 编辑器配置
|
|
196
|
-
|
|
197
|
-
推荐使用 [VSCode](https://code.visualstudio.com/) 并安装以下插件:
|
|
198
|
-
|
|
199
|
-
- [Vue - Official](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar) - Vue 3 官方支持
|
|
200
|
-
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) - 代码检查
|
|
201
|
-
- [Prettier](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode) - 代码格式化
|
|
202
|
-
- [Stylelint](https://marketplace.visualstudio.com/items?itemName=stylelint.vscode-stylelint) - CSS/SCSS 检查
|
|
203
|
-
- [Element Plus Snippets](https://marketplace.visualstudio.com/items?itemName=ElementPlus.element-plus-snippets) - Element Plus 代码片段
|
|
204
|
-
|
|
205
|
-
## 代码规范
|
|
206
|
-
|
|
207
|
-
- 组件使用 `PascalCase` 命名
|
|
208
|
-
- 组合式函数使用 `camelCase` 命名并以 `use` 开头
|
|
209
|
-
- 类型定义使用 `PascalCase` 命名并以 `Type` 结尾
|
|
210
|
-
- 接口定义使用 `PascalCase` 命名并以 `Interface` 结尾
|
|
211
|
-
- 枚举使用 `PascalCase` 命名
|
|
212
|
-
- Element Plus 组件保持原标签名 (如 `<el-button>`)
|
|
213
|
-
- ECharts 相关变量以 `chart` 为前缀
|
|
214
|
-
|
|
215
|
-
## 浏览器支持
|
|
216
|
-
|
|
217
|
-
项目默认支持现代浏览器,如需兼容旧版浏览器,请自行配置 `@vitejs/plugin-legacy`。
|
package/dist/runbir-tools.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".map[data-v-
|
|
1
|
+
(function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".map[data-v-0a4735ce]{width:100%;height:100%}@keyframes rotate-0a4735ce{0%{transform:rotate(0)}to{transform:rotate(360deg)}}")),document.head.appendChild(e)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
2
|
var ze = Object.defineProperty;
|
|
3
3
|
var Ve = (s, e, t) => e in s ? ze(s, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[e] = t;
|
|
4
4
|
var se = (s, e, t) => Ve(s, typeof e != "symbol" ? e + "" : e, t);
|
|
@@ -24528,7 +24528,7 @@ const _hoisted_1 = {
|
|
|
24528
24528
|
props.options.event && props.options.event.register.forEach((e) => {
|
|
24529
24529
|
s.add(e);
|
|
24530
24530
|
}), s.add("pointermove"), map.on([...s], (e) => {
|
|
24531
|
-
switch (props.options.event.register.includes(e.type) && props.options.event.callback(e), e.type) {
|
|
24531
|
+
switch (props.options.event && props.options.event.register.includes(e.type) && props.options.event.callback(e), e.type) {
|
|
24532
24532
|
case "pointermove":
|
|
24533
24533
|
handlePointermove(e);
|
|
24534
24534
|
break;
|
|
@@ -24618,7 +24618,7 @@ const _hoisted_1 = {
|
|
|
24618
24618
|
for (const [i, n] of e)
|
|
24619
24619
|
t[i] = n;
|
|
24620
24620
|
return t;
|
|
24621
|
-
}, VueOl = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-
|
|
24621
|
+
}, VueOl = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-0a4735ce"]]), plugin = {
|
|
24622
24622
|
install(s) {
|
|
24623
24623
|
s.component("VueOl", VueOl);
|
|
24624
24624
|
}
|