|
|
@@ -1,5 +1,40 @@
|
|
|
-# Vue 3 + TypeScript + Vite
|
|
|
+## 华新镇产权单位和企业信息采集小程序
|
|
|
|
|
|
-This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.
|
|
|
+### 20260909
|
|
|
|
|
|
-Learn more about the recommended Project Setup and IDE Support in the [Vue Docs TypeScript Guide](https://vuejs.org/guide/typescript/overview.html#project-setup).
|
|
|
+- 构建工具与技术栈升级
|
|
|
+ - 构建从 Vue CLI(vue-cli-service)+ Babel 迁移到 Vite
|
|
|
+ - 源码从 JavaScript 全量改写为 TypeScript,接入 vue-tsc 类型检查
|
|
|
+ - 移除 core-js / babel 相关依赖,新增 pinia、dayjs、@element-plus/icons-vue
|
|
|
+- 目录结构分层重构,新增以下分层目录:
|
|
|
+
|
|
|
+| 目录 | 说明 |
|
|
|
+| --- | --- |
|
|
|
+| api | 后端接口封装(auth、content) |
|
|
|
+| composables | 可复用逻辑(表单、草稿、提示、滚动定位) |
|
|
|
+| constants | 集中管理 API 基地址、栏目 id、模型 id 等常量 |
|
|
|
+| layouts | 页面框架布局(TabBarLayout) |
|
|
|
+| stores | Pinia 状态管理 |
|
|
|
+| styles | 抽离的全局样式(style.css、form.css) |
|
|
|
+| types | TypeScript 类型定义(property、enterprise 等) |
|
|
|
+| utils | 通用工具(request、crypto、format、validators) |
|
|
|
+
|
|
|
+- 状态管理改造
|
|
|
+ - 引入 Pinia,新增 auth store 统一维护登录态(token / user)
|
|
|
+ - 登录不再持久化明文密码,并清理历史遗留的 password
|
|
|
+- 路由改造
|
|
|
+ - 抽出 TabBarLayout 作为主框架,home / property / enterprise / myrecord 改为嵌套子路由
|
|
|
+ - 页面组件改为按需懒加载
|
|
|
+ - 新增全局前置守卫:受保护页面(requiresAuth)未登录时跳转登录页并携带 redirect
|
|
|
+- 巨型页面拆分(视图只保留页面骨架,表单逻辑抽离为 composable + 子组件)
|
|
|
+ - EnterprisePage 由 2586 行精简至 333 行,逻辑抽离到 useEnterpriseForm,拆出 LocationEditor、YearlyMoneyList 组件
|
|
|
+ - PropertyPage 由 2144 行精简至 288 行,逻辑抽离到 usePropertyForm,拆出 BuildingCard、FloorCard、OperatorList 组件
|
|
|
+- 通用组件沉淀
|
|
|
+ - 新增 FormField、RadioGroup、CheckboxGroup、SearchSelect、PageHeader、SuccessToast 等通用组件
|
|
|
+- 通用逻辑沉淀(composables)
|
|
|
+ - useDraft:进入「查看」前保存草稿快照、退出时还原
|
|
|
+ - useSuccessToast:统一的成功提示
|
|
|
+ - useScrollToError:校验失败时滚动定位到错误项
|
|
|
+- 接口层统一封装
|
|
|
+ - 新增 utils/request 统一 axios 实例(内容平台基地址、urlencoded、请求拦截自动携带 Token)
|
|
|
+ - api/auth、api/content 统一封装登录与内容平台的增删改查
|