# enniot-cloud-self

> "自有平台设置"

Latest version **0.0.1** (published 2021-01-05) · ISC license · 0 weekly downloads

## Install

```sh
npm install enniot-cloud-self
pnpm add enniot-cloud-self
yarn add enniot-cloud-self
bun add enniot-cloud-self
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2021-01-05 |
| First published | 2021-01-05 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | myy |
| Maintainers | npm-rookie |
| Keywords | Own |

## Links

- npm: https://www.npmjs.com/package/enniot-cloud-self
- npm.io page: https://npm.io/package/enniot-cloud-self

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 0.0.1 (latest) — 2021-01-05

## README

## 目录结构

```
── enniot-cloud-self
    ├── OwnPlatform.vue
    ├── README.md
    ├── OwnPlatform.json
    └── package.json
```



## Props

| 参数   | 说明                                                         | 类型   | 可选值 | 默认值 |
| ------ | ------------------------------------------------------------ | ------ | ------ | ------ |
| schema | 规定 form 格式的 json 文件                                   | json   | —      | —      |
| data   | 用于将后台读取的数据填入 form 组件；以及获取 form 中数据，并将这些数据打包作为参数提交。 | object | —      | —      |

## Data

| 参数            | 说明           | 类型    | 可选值     | 默认值 |
| --------------- | -------------- | ------- | ---------- | ------ |
| status          | 启用           | Boolean | true/false | —      |
| protocol        | 通信协议       | string  | HTTP/MQTT  | —      |
| service_address | 服务器地址     | string  | —          | —      |
| service_port    | 端口号         | string  | —          | —      |
| heart_interval  | 心跳包间隔(秒) | int     | —          | —      |
| product_id      | 产品编号       | string  | —          | —      |
| device_eui      | 设备编号       | string  | —          | —      |
| username        | 用户名         | string  | —          | —      |
| password        | 密码           | string  | —          | —      |

## Usage

```vue
<template>
	<el-row>
       <!--      自有平台设置界面-->
          <el-tab-pane
            label="自有平台设置"
            name="self"
            ref="selfTab"
            v-loading="loading"
          >
            <OwnPlatform ref="selfPlatform" :data="this.selfForm" style="width: 60%">				</OwnPlatform>
            <el-button
              type="primary"
              style="margin-left: 900px"
              @click="onOwnSubmit()"
            >
              保存
            </el-button>
          </el-tab-pane>
     </el-tabs>
  </el-row>
</template>

<script>
	import baseUrl from "@/service/api";
    import IoTPlarform from '@/views/components/IoTPlatform/IoTPlatform.vue';
    export default {
        components: {
          IoTPlatform,  
        },
        data() {
            return {
      			iotForm: {
        			type: 'IoT',
      			},
            }
        },
        methods: {
            // 自有平台查询
            async onGetOwnForm() {
              const api = `${baseUrl}/api/cloud/self`;
              const res = await this.$api.get(api);
              this.selfForm = res;
            },
            //  自有平台修改
            async onOwnSubmit() {
              const isValid = await this.$refs.selfPlatform.validate();
              if (isValid) {
                const api = `${baseUrl}/api/cloud/self`;
                await this.$api.post(api, this.selfForm, {target: this.$refs.selfTab});
                await this.onGetOwnForm();
              }
            },
    }
        
```

---
_Source: https://npm.io/package/enniot-cloud-self · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
