1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- {
- "currentState": "memory_saved",
- "stateHistory": [
- {
- "from": "initial",
- "command": "init",
- "timestamp": "2025-08-29T02:29:36.722Z",
- "args": [
- {
- "workingDirectory": "d:\\work\\bandhu-buy\\admin",
- "ideType": "qoder"
- }
- ]
- },
- {
- "from": "initialized",
- "command": "welcome",
- "timestamp": "2025-08-29T02:29:40.606Z",
- "args": []
- },
- {
- "from": "service_discovery",
- "command": "action",
- "timestamp": "2025-08-29T02:29:52.799Z",
- "args": [
- "vue3-expert"
- ]
- },
- {
- "from": "role_activated_with_memory",
- "command": "remember",
- "timestamp": "2025-08-29T02:29:58.344Z",
- "args": [
- "vue3-expert",
- "用户明确要求:在开发过程中,除非用户明确要求创建测试文档或测试文件,否则不要主动创建任何测试相关的文件。专注于业务功能的实现,测试文件的创建需要用户明确指示。",
- "--tags",
- "开发偏好 测试文件 用户要求"
- ]
- },
- {
- "from": "memory_saved",
- "command": "remember",
- "timestamp": "2025-08-29T02:30:56.299Z",
- "args": [
- "vue3-expert",
- "bandhuBuy-admin项目代码书写习惯:\n## Vue3组件编写风格\n1. **script setup语法**:统一使用`<script setup>`语法,导入在顶部\n2. **响应式数据**:使用`reactive`定义复杂对象,`ref`定义简单值\n3. **组件结构**:template -> script setup -> style scoped的标准结构\n4. **props定义**:使用`defineProps`,包含类型和默认值\n5. **事件处理**:使用`defineEmits`定义事件\n\n## 页面布局结构\n1. **容器结构**:`el-container` -> `el-header` + `el-main` + `sa-view-bar`\n2. **搜索区域**:使用`sa-search-simple`组件,配置`searchFields`对象\n3. **标题区域**:`sa-title sa-flex sa-row-between`布局,左侧标题右侧操作按钮\n4. **表格区域**:`sa-table-wrap` + `sa-table`类名,配合`v-loading`\n5. **分页区域**:`sa-view-bar`中使用`sa-pagination`组件\n\n## CSS样式规范\n1. **类名前缀**:sa-开头的自定义类名(sa-title、sa-flex、sa-table等)\n2. **布局类**:sa-flex、sa-row-between、sa-p-0等工具类\n3. **容器类**:panel-block作为主容器,支持--top、--bottom修饰符\n4. **间距类**:sa-m-r-12、sa-m-l-8等margin/padding工具类\n5. **CSS变量**:使用--sa-开头的CSS变量定义主题色彩\n6. **UnoCSS优先**:新样式优先使用UnoCSS原子化类名\n\n## 数据处理模式\n1. **API调用**:使用CRUD工具类,统一的request封装\n2. **分页处理**:usePagination hook,pageData对象管理分页状态\n3. **表格数据**:reactive定义table对象,包含data、selected等属性\n4. **加载状态**:ref定义loading状态,配合v-loading指令\n\n## 表单处理风格\n1. **表单结构**:reactive定义form对象,包含model和rules\n2. **验证规则**:统一的rules对象,支持required、pattern等验证\n3. **表单引用**:使用formRef获取表单实例\n4. **提交处理**:先验证再提交,统一的错误处理\n\n## 组件交互模式\n1. **弹窗组件**:useModal hook统一管理弹窗\n2. **确认操作**:ElMessageBox.confirm统一确认框\n3. **消息提示**:ElMessage统一消息提示\n4. **批量操作**:sa-batch-handle组件处理批量操作\n\n## 国际化处理规范\n1. **搜索字段**:必须使用computed定义searchFields,确保语言切换响应\n2. **键名格式**:modules.xxx格式组织,如modules.user、modules.order\n3. **函数调用**:使用t('modules.xxx.xxx')格式调用翻译\n4. **标签vs值**:注意区分Label(如groupStatusLabel)和值对象(如groupStatus)\n\n## 代码组织规范\n1. **导入顺序**:Vue相关 -> 第三方库 -> 项目内部组件 -> utils工具\n2. **变量声明**:const优先,let其次,避免var\n3. **函数定义**:使用箭头函数或function关键字,保持一致\n4. **注释规范**:重要业务逻辑添加中文注释说明",
- "--tags",
- "代码规范 开发习惯 Vue3 项目标准"
- ]
- }
- ],
- "lastUpdated": "2025-08-29T02:30:56.306Z"
- }
|