juechafun/01-项目/2604-物联数据中台/操作说明-页面修改-增加示范项目分享页.md

82 lines
1.6 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
#领域/未知
#复盘/0 #临时/备忘 #状态/待处理
## 一句话描述
[________]
---
- 创建src\components\ProjectPreview4.vue
- src\main.js增加
```js
{
    path: "/projectpreview4",
    name: "projectpreview4",
    component: () => import("./components/ProjectPreview4.vue"),
  },
```
- src\components\Project.vue 增加
```js
else if (this.cur_project.pid == 104006) {
routeData = this.$router.resolve({ path: '/projectpreview4' });
}
```
- src\components\Project.vue增加
```js
canShare: function () {
// 102327 校园农场
// 3 竺可桢气象
// 101111 城院附校气象站
// 104006 湘滨小学气象站
return [102327, 3, 101111, 104006].includes(this.cur_project.pid);
},
```
- src\components\ProjectPreview4.vue 修改
```js
<h1 class="dashboard-title">湘滨小学气象</h1>
...
resp = await post(
"/api/projectPreview/selectHistoricalData4",
form_data
);
```
```python
@dataController.route('/projectPreview/selectHistoricalData4', methods=['POST'])
def selectHistoricalData4():
    try:
        userId = request.form.get('uid')
    except Exception as e:
        return []
    topic_dict = {
        191812: "ele1",  # 3    QiWen   瞬时气温(℃) 0
        191816: "ele2",  # 3    ShiDu   瞬时湿度(%rh)   0
        191809: "ele3",  # 3    FengXiang   风向(°) 0
        191808: "ele4",  # 3    Fengsu  瞬时风速(m/s)   0
        191811: "ele5",  # 3    QiYa    瞬时气压(hpa)   0
        191817: "ele6",  # 3    Yushui  5分钟降雨量(mm/分)  0
    }
```