fix(项目管理): 场景联动调整防抖默认事件和开启,设备触发类型筛选事件

This commit is contained in:
fhysy 2024-09-20 16:47:33 +08:00
parent f9efeb4859
commit 835ee2af5a
3 changed files with 51 additions and 50 deletions

View File

@ -1,12 +1,12 @@
<template> <template>
<div> <div>
<condition-temp <condition-temp
@EventDel="eventDel"
:tempIndex="index"
:info="item"
v-for="(item, index) in conditionList" v-for="(item, index) in conditionList"
:key="index" :key="index"
:info="item"
:propertyList="propertyList" :propertyList="propertyList"
:tempIndex="index"
@EventDel="eventDel"
/> />
</div> </div>
</template> </template>
@ -49,7 +49,8 @@ export default {
getProductCmdList(id) { getProductCmdList(id) {
this.propertyList = []; this.propertyList = [];
getDeviceFunList({ getDeviceFunList({
deviceId: id deviceId: id,
cmdKey:'event'
}).then(res => { }).then(res => {
this.propertyList = this.uniqueFunc([...res.data], 'funKey'); this.propertyList = this.uniqueFunc([...res.data], 'funKey');
// this.propertyList= res.data; // this.propertyList= res.data;

View File

@ -87,7 +87,7 @@ export default {
watch: { watch: {
isAntiShake() { isAntiShake() {
if(this.isAntiShake === false) { if(this.isAntiShake === false) {
this.dataItem['intervalVal'] = 0; this.dataItem['intervalVal'] = 60;
} }
} }
}, },

View File

@ -4,15 +4,15 @@
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['project:scene:add']" v-hasPermi="['project:scene:add']"
icon="el-icon-plus"
plain
size="mini"
type="primary"
@click="handleAdd"
>新增</el-button >新增</el-button
> >
<el-button @click="handleQuery" size="mini">刷新</el-button> <el-button size="mini" @click="handleQuery">刷新</el-button>
</el-col> </el-col>
</el-row> </el-row>
@ -23,51 +23,51 @@
:height="total > 0 ? '470px' : '510px'" :height="total > 0 ? '470px' : '510px'"
> >
<el-table-column <el-table-column
type="index"
label="序号"
align="center"
:index="indexFormatter" :index="indexFormatter"
align="center"
label="序号"
type="index"
width="80px" width="80px"
></el-table-column> ></el-table-column>
<el-table-column <el-table-column
label="场景名称"
width="200px"
align="left" align="left"
label="场景名称"
prop="sceneName" prop="sceneName"
width="200px"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span class="lay-table-textarea" :title="scope.row.sceneName"> <span :title="scope.row.sceneName" class="lay-table-textarea">
{{ scope.row.sceneName }} {{ scope.row.sceneName }}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="场景编码"
align="left" align="left"
width="200" label="场景编码"
prop="sceneCode" prop="sceneCode"
width="200"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span class="lay-table-textarea" :title="scope.row.sceneCode"> <span :title="scope.row.sceneCode" class="lay-table-textarea">
{{ scope.row.sceneCode }} {{ scope.row.sceneCode }}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="场景模式"
align="left" align="left"
width="120" label="场景模式"
prop="relation" prop="relation"
width="120"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span class="lay-table-textarea" :title="scope.row.relation"> <span :title="scope.row.relation" class="lay-table-textarea">
{{ scope.row.relation }} {{ scope.row.relation }}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="状态" align="center" prop="runStatus"> <el-table-column align="center" label="状态" prop="runStatus">
<template slot-scope="scope"> <template slot-scope="scope">
<span class="lay-table-textarea"> <span class="lay-table-textarea">
{{ scope.row.runStatus == "0" ? "启用" : "停止" }} {{ scope.row.runStatus == "0" ? "启用" : "停止" }}
@ -76,70 +76,70 @@
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="创建时间"
align="center" align="center"
width="160px" label="创建时间"
prop="createTime" prop="createTime"
width="160px"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<span class="lay-table-textarea" :title="scope.row.createTime"> <span :title="scope.row.createTime" class="lay-table-textarea">
{{ scope.row.createTime }} {{ scope.row.createTime }}
</span> </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
label="操作"
align="center" align="center"
width="300" label="操作"
prop="alarmTime" prop="alarmTime"
width="300"
> >
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
v-hasPermi="['project:scene:edit']"
icon="el-icon-edit"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit"
v-hasPermi="['project:scene:edit']"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
>编辑</el-button >编辑</el-button
> >
<el-button <el-button
v-hasPermi="['project:scene:remove']"
icon="el-icon-delete"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-delete"
v-hasPermi="['project:scene:remove']"
@click="handleDelete(scope.row)" @click="handleDelete(scope.row)"
>删除</el-button >删除</el-button
> >
<el-button <el-button
size="mini" v-hasPermi="['project:scene:status']"
type="text"
:icon=" :icon="
scope.row.runStatus == '0' scope.row.runStatus == '0'
? 'el-icon-open' ? 'el-icon-open'
: 'el-icon-turn-off' : 'el-icon-turn-off'
" "
v-hasPermi="['project:scene:status']" size="mini"
type="text"
@click="handleChangeStatus(scope.row)" @click="handleChangeStatus(scope.row)"
>{{ scope.row.runStatus == "0" ? "停止" : "启用" }}</el-button >{{ scope.row.runStatus == "0" ? "停止" : "启用" }}</el-button
> >
<el-button <el-button
v-hasPermi="['project:scene:run']"
icon="el-icon-video-play"
size="mini" size="mini"
type="text" type="text"
icon="el-icon-video-play"
v-hasPermi="['project:scene:run']"
@click="handleSingleRun(scope.row)" @click="handleSingleRun(scope.row)"
>执行</el-button >执行</el-button
> >
<el-button <el-button
icon="el-icon-takeaway-box"
size="mini" size="mini"
type="text" type="text"
@click="handleLoggingView(scope.row)" @click="handleLoggingView(scope.row)"
icon="el-icon-takeaway-box"
>指令历史</el-button >指令历史</el-button
> >
</template> </template>
@ -148,9 +148,9 @@
<pagination <pagination
v-show="total > 0" v-show="total > 0"
:total="total"
:page.sync="page.pageNum"
:limit.sync="page.pageSize" :limit.sync="page.pageSize"
:page.sync="page.pageNum"
:total="total"
@pagination="getTableList" @pagination="getTableList"
/> />
</div> </div>
@ -163,12 +163,12 @@
@close="open = false" @close="open = false"
> >
<el-form <el-form
slot="dialog-center"
ref="form" ref="form"
slot="dialog-center"
:model="form" :model="form"
style="padding-right: 20px"
:rules="rules" :rules="rules"
label-width="100px" label-width="100px"
style="padding-right: 20px"
> >
<el-row :gutter="10"> <el-row :gutter="10">
<el-col :span="12"> <el-col :span="12">
@ -212,9 +212,9 @@
</span> </span>
<div> <div>
<e-tag-card <e-tag-card
style="margin-top: 5px"
v-for="(item, idx) in form.triggers" v-for="(item, idx) in form.triggers"
:key="item.guid || getGuid()" :key="item.guid || getGuid()"
style="margin-top: 5px"
type="info" type="info"
> >
<e-scene-triggers <e-scene-triggers
@ -259,9 +259,9 @@
</div> </div>
<div> <div>
<e-tag-card <e-tag-card
style="margin-top: 5px"
v-for="(item, idx) in form.actions" v-for="(item, idx) in form.actions"
:key="item.guid || getGuid()" :key="item.guid || getGuid()"
style="margin-top: 5px"
type="info" type="info"
> >
<e-scene-action <e-scene-action
@ -282,8 +282,8 @@
</e-tag-card> </e-tag-card>
</div> </div>
<el-button <el-button
type="text"
icon="el-icon-plus" icon="el-icon-plus"
type="text"
@click="handleAddAction" @click="handleAddAction"
>新增动作</el-button >新增动作</el-button
> >
@ -291,18 +291,18 @@
</el-row> </el-row>
</el-form> </el-form>
<div slot="dialog-footer" class="dialog-footer"> <div slot="dialog-footer" class="dialog-footer">
<el-button type="primary" size="mini" @click="submitForm" <el-button size="mini" type="primary" @click="submitForm"
> </el-button > </el-button
> >
<el-button @click="cancel" size="mini"> </el-button> <el-button size="mini" @click="cancel"> </el-button>
</div> </div>
</dialog-template> </dialog-template>
</div> </div>
</div> </div>
<e-logging <e-logging
v-if="isLoggingViewShow" v-if="isLoggingViewShow"
:sourceId="loggingSourceId"
:sceneInfo="loggingSourceObject" :sceneInfo="loggingSourceObject"
:sourceId="loggingSourceId"
@handleLinkToHome=" @handleLinkToHome="
() => { () => {
isLoggingViewShow = false; isLoggingViewShow = false;
@ -449,7 +449,7 @@ export default {
orderBy: triggersPop ? triggersPop.orderBy + 1 : 1, orderBy: triggersPop ? triggersPop.orderBy + 1 : 1,
method: "", method: "",
conditions: [], conditions: [],
intervalVal: "", intervalVal: "60",
intervalUnit: "SECONDS", intervalUnit: "SECONDS",
sceneTriggerDevices: [], sceneTriggerDevices: [],
execScript: "", execScript: "",