Parcourir la source

feat: 指数趋势,指数聚合空白页面

yanglzh il y a 1 an
Parent
commit
eefc8c10a6

+ 34 - 0
src/views/iot/dataAnalysis/IndicatorAggregation/index.vue

@@ -0,0 +1,34 @@
+<template>
+  <div class="page">
+    <el-card shadow="nover">
+      <el-form inline>
+        <el-form-item label="分类名称">
+          <el-input v-model="params.name" placeholder="请输入分类名称" @keyup.enter="getData" class="w-50" clearable />
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" class="ml10" @click="getData">
+            <el-icon>
+              <ele-Search />
+            </el-icon>
+            查询
+          </el-button>
+        </el-form-item>
+      </el-form>
+    </el-card>
+  </div>
+</template>
+
+<script lang="ts" setup>
+import { ref, toRefs, reactive, onMounted, defineComponent } from 'vue';
+import { ElMessageBox, ElMessage } from 'element-plus';
+import api from '/@/api/device';
+
+const params = reactive({
+  name: ''
+})
+
+function getData() {
+  
+}
+
+</script>

+ 78 - 0
src/views/iot/dataAnalysis/exponentialTrend/index.vue

@@ -0,0 +1,78 @@
+<template>
+  <div class="page">
+    <el-card shadow="nover">
+      <el-form inline>
+        <el-form-item label="选择产品" prop="productKey">
+          <el-select v-model="params.productKey" filterable placeholder="请选择产品" @change="productChange">
+            <el-option v-for="item in productList" :key="item.key" :label="item.name" :value="item.key">
+              <span style="float: left">{{ item.name }}</span>
+              <span style="float: right; font-size: 13px">{{ item.key }}</span>
+            </el-option>
+          </el-select>
+        </el-form-item>
+
+        <el-form-item label="选择设备" prop="deviceKey">
+          <el-select v-model="params.deviceKey" filterable placeholder="请选择设备" @change="deviceChange">
+            <el-option v-for="item in deviceList" :key="item.key" :label="item.name" :value="item.key">
+              <span style="float: left">{{ item.name }}</span>
+              <span style="float: right; font-size: 13px">{{ item.key }}</span>
+            </el-option>
+          </el-select>
+        </el-form-item>
+
+        <el-form-item label="选择属性" prop="deviceKey">
+          <el-select v-model="params.deviceKey" filterable placeholder="请选择属性" @change="deviceChange">
+            <el-option v-for="item in deviceList" :key="item.key" :label="item.name" :value="item.key">
+              <span style="float: left">{{ item.name }}</span>
+              <span style="float: right; font-size: 13px">{{ item.key }}</span>
+            </el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" class="ml10" @click="getData">
+            <el-icon>
+              <ele-Search />
+            </el-icon>
+            查询
+          </el-button>
+        </el-form-item>
+      </el-form>
+    </el-card>
+  </div>
+</template>
+
+<script lang="ts" setup>
+import { ref, toRefs, reactive, onMounted, defineComponent } from 'vue';
+import { ElMessageBox, ElMessage } from 'element-plus';
+import api from '/@/api/device';
+
+const productList = ref<any[]>([])
+const deviceList = ref<any[]>([])
+
+const params = reactive({
+  productKey: '',
+  deviceKey: '',
+})
+
+
+api.product.getLists({ status: 1 }).then((res: any) => {
+  productList.value = res.product || [];
+});
+
+function getData() {
+
+}
+
+function productChange(productKey: string) {
+  params.deviceKey = ''
+  deviceList.value = []
+  api.device.allList({ productKey }).then((res: any) => {
+    deviceList.value = res.device;
+  });
+}
+
+function deviceChange() {
+
+}
+
+</script>

+ 21 - 1
src/views/iot/device/product/component/dataParse.vue

@@ -17,6 +17,26 @@ import { ElMessage } from 'element-plus';
 import api from '/@/api/device';
 import { useRoute } from 'vue-router';
 
+const emptyFunction = `
+// 下面是预制的空的方法,请不要修改函数名称,直接在内部编写函数即可
+
+// 此处是设备功能调用应答数据解析
+function parse (data) {
+
+	// 此处编写对数据的处理
+
+	return data
+}
+
+
+// 此处是设备功能调用发送数据解析
+function send (data) {
+
+	// 此处编写对数据的处理
+
+	return data
+}
+`
 const route = useRoute();
 
 const emit = defineEmits(['updateScript'])
@@ -31,7 +51,7 @@ const content = ref('')
 const mirrorRef = ref()
 
 onMounted(() => {
-	content.value = props.script!
+	content.value = props.script! || emptyFunction
 })
 
 function saveCode() {