111
This commit is contained in:
parent
3f7a0f8553
commit
162f23fd3b
41
.cursorrules
Normal file
41
.cursorrules
Normal file
|
@ -0,0 +1,41 @@
|
|||
# 项目背景
|
||||
这是一个基于RuoYi-Vue的共享空间项目后台管理系统,共享空间包含共享茶室、共享棋牌室、共享台球室,主要用于管理空间中的智能开关设备、店铺、房间、商户、用户、订单、支付、设备、设备型号、软硬件管理、保洁管理、财务管理、渠道管理、文章管理等。
|
||||
项目结构:
|
||||
店铺:商户下可以有多个店铺
|
||||
房间:空间,包含大厅、茶室、棋牌室、卫生间等、统称房间。
|
||||
设施:台球、麻将机、房间门、店门等可以安装开关设备的统称为设施。
|
||||
设备:就是一个开关设备,可以控制设施的开关状态。
|
||||
|
||||
|
||||
# 主要框架
|
||||
- Vue2
|
||||
- Element-UI
|
||||
- Axios
|
||||
- Vuex
|
||||
- Vue-Router
|
||||
|
||||
# 编码标准
|
||||
- 变量和函数名使用 camelCase 规范,组件名使用 PascalCase
|
||||
- 组件的样式使用 scoped 属性,避免样式污染
|
||||
- 样式使用scss
|
||||
- props、data、methods、computed、watch 生命周期函数等都使用驼峰命名
|
||||
- 对于全局能够重复使用的组件,尽量封装成组件,并放在 src/components 目录下
|
||||
- 对于业务能够重复使用的组件,尽量封装成组件,并放在 src/views/{模块名}/components 目录下
|
||||
- 所有请求都需要在 src/api/{模块名}.js 文件中定义,并保持统一的命名规范,使用时统一调用
|
||||
- 业务操作尽量封装成方法或组件
|
||||
- table中的数据使用columns定义,具体可以参考其他组件
|
||||
- 保持与现有代码风格一致
|
||||
- 代码需要具有可读性,注释清晰,后续可拓展
|
||||
- 生成的代码需要自动导入相关依赖,这点很重要
|
||||
|
||||
# 项目结构
|
||||
- src/api 目录下存放接口文件
|
||||
- src/assets 目录下存放静态资源
|
||||
- src/components 目录下存放全局组件
|
||||
- src/views 目录下存放页面
|
||||
- src/utils 目录下存放工具类
|
||||
- src/utils/constants.js 目录下存放常量
|
||||
- src/views/system 目录下存放系统相关页面
|
||||
|
||||
# 文档规范
|
||||
- 使用 JSDoc 格式编写函数和组件的注释
|
10
jsconfig.json
Normal file
10
jsconfig.json
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": "./",
|
||||
"paths": {
|
||||
"@/*": ["src/*"]
|
||||
}
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules"]
|
||||
}
|
|
@ -117,6 +117,18 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="位置" align="center" prop="location" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-link
|
||||
type="primary"
|
||||
@click="openMap(scope.row.lng, scope.row.lat)"
|
||||
v-if="scope.row.lng && scope.row.lat"
|
||||
>
|
||||
{{ scope.row.lng }},{{ scope.row.lat }}
|
||||
</el-link>
|
||||
<span v-else>-</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
|
@ -267,8 +279,6 @@ export default {
|
|||
{key: 'contactMobile', visible: true, label: '联系电话', minWidth: null, sortable: true, overflow: false, align: 'center', width: 100},
|
||||
{key: 'picture', visible: true, label: '商户图片', minWidth: null, sortable: true, overflow: false, align: 'center', width: 100},
|
||||
{key: 'address', visible: true, label: '门店地址', minWidth: null, sortable: true, overflow: false, align: 'center', width: 150},
|
||||
{key: 'lng', visible: true, label: '定位经度', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'lat', visible: true, label: '定位纬度', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
{key: 'businessTimeStart', visible: true, label: '营业时间起始', minWidth: "120", sortable: false, overflow: false, align: 'center', width: null},
|
||||
{key: 'businessTimeEnd', visible: true, label: '营业时间结束', minWidth: "120", sortable: false, overflow: false, align: 'center', width: null},
|
||||
{key: 'serverPhone', visible: true, label: '客服电话', minWidth: null, sortable: true, overflow: false, align: 'center', width: null},
|
||||
|
@ -485,6 +495,11 @@ export default {
|
|||
this.download('system/store/export', {
|
||||
...this.queryParams
|
||||
}, `store_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
// 添加打开地图方法
|
||||
openMap(lng, lat) {
|
||||
// 使用高德地图打开位置
|
||||
window.open(`https://uri.amap.com/marker?position=${lng},${lat}&callnative=1`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user