commit
dbeef3d05f
@ -0,0 +1,4 @@ |
||||
Unknown command: "ERR!" |
||||
|
||||
To see a list of supported npm commands, run: |
||||
npm help |
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,137 @@ |
||||
(function (win, lib) { |
||||
var doc = win.document; |
||||
var docEl = doc.documentElement; |
||||
var metaEl = doc.querySelector('meta[name="viewport"]'); |
||||
var flexibleEl = doc.querySelector('meta[name="flexible"]'); |
||||
var dpr = 0; |
||||
var scale = 0; |
||||
var tid; |
||||
var flexible = lib.flexible || (lib.flexible = {}); |
||||
|
||||
if (metaEl) { |
||||
console.warn("将根据已有的meta标签来设置缩放比例"); |
||||
var match = metaEl.getAttribute("content").match(/initial-scale=([d.]+)/); |
||||
if (match) { |
||||
scale = parseFloat(match[1]); |
||||
dpr = parseInt(1 / scale); |
||||
} |
||||
} else if (flexibleEl) { |
||||
var content = flexibleEl.getAttribute("content"); |
||||
if (content) { |
||||
var initialDpr = content.match(/initial-dpr=([d.]+)/); |
||||
var maximumDpr = content.match(/maximum-dpr=([d.]+)/); |
||||
if (initialDpr) { |
||||
dpr = parseFloat(initialDpr[1]); |
||||
scale = parseFloat((1 / dpr).toFixed(2)); |
||||
} |
||||
if (maximumDpr) { |
||||
dpr = parseFloat(maximumDpr[1]); |
||||
scale = parseFloat((1 / dpr).toFixed(2)); |
||||
} |
||||
} |
||||
} |
||||
|
||||
if (!dpr && !scale) { |
||||
// var isAndroid = win.navigator.appVersion.match(/android/gi);
|
||||
var isIPhone = win.navigator.appVersion.match(/iphone/gi); |
||||
var devicePixelRatio = win.devicePixelRatio; |
||||
if (isIPhone) { |
||||
// iOS下,对于2和3的屏,用2倍的方案,其余的用1倍方案
|
||||
if (devicePixelRatio >= 3 && (!dpr || dpr >= 3)) { |
||||
dpr = 3; |
||||
} else if (devicePixelRatio >= 2 && (!dpr || dpr >= 2)) { |
||||
dpr = 2; |
||||
} else { |
||||
dpr = 1; |
||||
} |
||||
} else { |
||||
// 其他设备下,仍旧使用1倍的方案
|
||||
dpr = 1; |
||||
} |
||||
scale = 1 / dpr; |
||||
} |
||||
|
||||
docEl.setAttribute("data-dpr", dpr); |
||||
if (!metaEl) { |
||||
metaEl = doc.createElement("meta"); |
||||
metaEl.setAttribute("name", "viewport"); |
||||
metaEl.setAttribute( |
||||
"content", |
||||
"initial-scale=" + |
||||
scale + |
||||
", maximum-scale=" + |
||||
scale + |
||||
", minimum-scale=" + |
||||
scale + |
||||
", user-scalable=no" |
||||
); |
||||
if (docEl.firstElementChild) { |
||||
docEl.firstElementChild.appendChild(metaEl); |
||||
} else { |
||||
var wrap = doc.createElement("div"); |
||||
wrap.appendChild(metaEl); |
||||
doc.write(wrap.innerHTML); |
||||
} |
||||
} |
||||
|
||||
function refreshRem() { |
||||
var width = docEl.getBoundingClientRect().width; |
||||
if (width / dpr >= 1920) { |
||||
// 这个位置划重点 1920是设计稿的大小 如果你的设计稿是750 那么就需要将1920替换成750
|
||||
width = (docEl.clientWidth / 1920) * 1920; |
||||
} |
||||
var rem = width / 10; |
||||
docEl.style.fontSize = rem + "px"; |
||||
flexible.rem = win.rem = rem; |
||||
} |
||||
|
||||
win.addEventListener( |
||||
"resize", |
||||
function () { |
||||
clearTimeout(tid); |
||||
tid = setTimeout(refreshRem, 300); |
||||
}, |
||||
false |
||||
); |
||||
win.addEventListener( |
||||
"pageshow", |
||||
function (e) { |
||||
if (e.persisted) { |
||||
clearTimeout(tid); |
||||
tid = setTimeout(refreshRem, 300); |
||||
} |
||||
}, |
||||
false |
||||
); |
||||
|
||||
if (doc.readyState === "complete") { |
||||
doc.body.style.fontSize = 12 * dpr + "px"; |
||||
} else { |
||||
doc.addEventListener( |
||||
"DOMContentLoaded", |
||||
function () { |
||||
doc.body.style.fontSize = 12 * dpr + "px"; |
||||
}, |
||||
false |
||||
); |
||||
} |
||||
|
||||
refreshRem(); |
||||
|
||||
flexible.dpr = win.dpr = dpr; |
||||
flexible.refreshRem = refreshRem; |
||||
flexible.rem2px = function (d) { |
||||
var val = parseFloat(d) * this.rem; |
||||
if (typeof d === "string" && d.match(/rem$/)) { |
||||
val += "px"; |
||||
} |
||||
return val; |
||||
}; |
||||
flexible.px2rem = function (d) { |
||||
var val = parseFloat(d) / this.rem; |
||||
if (typeof d === "string" && d.match(/px$/)) { |
||||
val += "rem"; |
||||
} |
||||
return val; |
||||
}; |
||||
})(window, window["lib"] || (window["lib"] = {})); |
@ -1,798 +1,60 @@ |
||||
<template> |
||||
<div class="app-container home"> |
||||
<el-row :gutter="20"> |
||||
<el-col :span="24" :xs="24"> |
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" label-width="88px"> |
||||
<el-form-item label="策略名称:" prop="name"> |
||||
<el-select v-model="data.sceneCode" placeholder="请选择" style="width: 240px" @change="changeSl"> |
||||
<el-option label='所有' :value='0' /> |
||||
<el-option :label='item.label' :value='item.sceneCode' :key="item.sceneCode" v-for="item in queryParams"/> |
||||
</el-select> |
||||
</el-form-item> |
||||
<el-form-item> |
||||
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> |
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button> |
||||
</el-form-item> |
||||
</el-form> |
||||
<el-row :gutter="10" class="mb8"> |
||||
<el-col :span="1.5"> |
||||
<el-button type="primary" icon="Plus" @click="handleAdd">新增</el-button> |
||||
</el-col> |
||||
</el-row> |
||||
<div class="dev_control_table"> |
||||
<el-table :data="data.timingList" height="500px"> |
||||
<el-table-column label="序号" align="center" width="50" type="index"/> |
||||
<el-table-column label="策略名称" align="center" prop="sceneName" width="300"/> |
||||
<el-table-column label="策略描述" align="center" prop="sceneRemark"/> |
||||
<el-table-column label="创建时间" align="center" prop="createTime"/> |
||||
<!-- <el-table-column label="温度" align="center" prop="sceneValue"/>--> |
||||
<el-table-column label="操作" align="center" prop="handle"> |
||||
<template v-slot="scope"> |
||||
<el-button type="primary" size="small" icon="Edit" v-hasPermi="['system:cl:edit']" @click="handleXg(scope.row)">修改</el-button> |
||||
<el-button type="danger" size="small" :icon="Delete" @click="handleDel(scope.row.sceneCode)">删除</el-button> |
||||
</template> |
||||
</el-table-column> |
||||
</el-table> |
||||
<el-pagination |
||||
v-model:current-page="currentPage" |
||||
v-model:page-size="pageSize" |
||||
:page-sizes="[5, 10, 20, 50]" |
||||
:small="small" |
||||
:disabled="disabled" |
||||
:background="background" |
||||
layout="total, sizes, prev, pager, next, jumper" |
||||
:total="data.total" |
||||
@size-change="handleSizeChange" |
||||
@current-change="handleCurrentChange"/> |
||||
</div> |
||||
</el-col> |
||||
</el-row> |
||||
|
||||
|
||||
|
||||
<!-- 新增对话框 --> |
||||
<el-dialog :title="title" v-model="open" width="1100" append-to-body> |
||||
<el-form :model="timingForm" ref="userRef" label-width="88px"> |
||||
<el-row> |
||||
<el-col :span="24"> |
||||
<el-form-item label="策略名称:" prop="sceneName" > |
||||
<el-input v-model="timingForm.sceneName" placeholder="请输入策略名称" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="24"> |
||||
<el-form-item label="策略描述:" prop="sceneRemark" > |
||||
<el-input v-model="timingForm.sceneRemark" placeholder="请输入策略描述" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
|
||||
|
||||
<!-- <span style="width: 60px;display: inline-block ;margin: 20px">第一步</span>--> |
||||
<!-- <el-radio-group v-model="timingForm.isJudge">--> |
||||
<!-- <el-radio :label="1">展开</el-radio>--> |
||||
<!-- <el-radio :label="2">关闭</el-radio>--> |
||||
<!-- </el-radio-group>--> |
||||
<el-collapse v-model="timingForm.num" style="margin-left: 20px" accordion> |
||||
<el-collapse-item title="第一步" :name="1"> |
||||
<span style="width: 50px; margin-left: 20px ">步骤描述:</span> |
||||
<el-input placeholder="请输入步骤描述" style="width: 900px"/> |
||||
<span style="width: 120px;display: inline-block ;margin: 20px">是否有限制条件</span> |
||||
<el-radio-group v-model="timingForm.isJudge"> |
||||
<el-radio :label="1">是</el-radio> |
||||
<el-radio :label="2">否</el-radio> |
||||
</el-radio-group> |
||||
<el-collapse v-model="timingForm.isJudge" style="width: 1000px"> |
||||
<el-collapse-item title="限制条件" :name="1"> |
||||
<span>限制设备:</span> |
||||
<el-select v-model="timingForm.judgeDevice" placeholder="请选择" style="width: 240px"> |
||||
<el-option :label='item.deviceName' :value='item.deviceId' :key="item.deviceId" v-for="item in data.allsblb"/> |
||||
</el-select> |
||||
<span style="width: 70px;display: inline-block ;margin: 20px">限制属性:</span> |
||||
<el-radio-group v-model="timingForm.judgeElement"> |
||||
<el-radio label="thermometer_value">温度</el-radio> |
||||
<el-radio label="thermometer_value_in">进水温度</el-radio> |
||||
<el-radio label="thermometer_value_out">出水温度</el-radio> |
||||
</el-radio-group> |
||||
<span style="width: 70px;display: inline-block ;margin-left: 50px">温度数值:</span> |
||||
<el-input type="number" v-model="timingForm.judgeData" placeholder="请输入" style="width: 80px ; height: 25px" /> |
||||
</el-collapse-item> |
||||
</el-collapse> |
||||
<el-checkbox :indeterminate="data.isIndeterminate" v-model="data.checkAll" @change="handleCheckAllChange">全选</el-checkbox> |
||||
<el-checkbox-group v-model="data.checkedSblb" @change="handleCheckedCitiesChange" style="white-space: normal;display: inline-block"> |
||||
<el-checkbox v-for="item in data.sblb" :label="item.deviceId" :key="item.deviceId" style="margin-bottom: 10px;width: 560px;"> |
||||
<span style="width: 160px;display: inline-block">{{item.deviceName}}</span> |
||||
<span v-for="control in item.controlKey" style="margin-left: 20px"> |
||||
<span style="width: 80px;display: inline-block">{{control.label}}</span> |
||||
<template v-if="control.label === '控制启停'"> |
||||
<el-radio-group v-model="control.value"> |
||||
<el-radio label="1">开启</el-radio> |
||||
<el-radio label="2">关闭</el-radio> |
||||
</el-radio-group> |
||||
</template> |
||||
<template v-else> |
||||
<el-input type="number" v-model="control.value" style="width: 120px ;margin: 10px;height: 25px"/> |
||||
</template> |
||||
</span> |
||||
</el-checkbox> |
||||
</el-checkbox-group> |
||||
|
||||
</el-collapse-item> |
||||
<el-collapse-item title="第二步" :name="2"> |
||||
<span style="width: 50px; margin-left: 20px ">步骤描述:</span> |
||||
<el-input placeholder="请输入步骤描述" style="width: 900px"/> |
||||
<span style="width: 120px;display: inline-block ;margin: 20px">是否有限制条件</span> |
||||
<el-radio-group v-model="timingForm.isJudge"> |
||||
<el-radio :label="1">是</el-radio> |
||||
<el-radio :label="2">否</el-radio> |
||||
</el-radio-group> |
||||
<el-collapse v-model="timingForm.isJudge" style="width: 1000px"> |
||||
<el-collapse-item title="限制条件" :name="1"> |
||||
<span>限制设备:</span> |
||||
<el-select v-model="timingForm.judgeDevice" placeholder="请选择" style="width: 240px"> |
||||
<el-option :label='item.deviceName' :value='item.deviceId' :key="item.deviceId" v-for="item in data.allsblb"/> |
||||
</el-select> |
||||
<span style="width: 70px;display: inline-block ;margin: 20px">限制属性:</span> |
||||
<el-radio-group v-model="timingForm.judgeElement"> |
||||
<el-radio label="thermometer_value">温度</el-radio> |
||||
<el-radio label="thermometer_value_in">进水温度</el-radio> |
||||
<el-radio label="thermometer_value_out">出水温度</el-radio> |
||||
</el-radio-group> |
||||
<span style="width: 70px;display: inline-block ;margin-left: 50px">温度数值:</span> |
||||
<el-input type="number" v-model="timingForm.judgeData" placeholder="请输入" style="width: 80px ; height: 25px" /> |
||||
</el-collapse-item> |
||||
</el-collapse> |
||||
<el-checkbox :indeterminate="data.isIndeterminate" v-model="data.checkAll" @change="handleCheckAllChange">全选</el-checkbox> |
||||
<el-checkbox-group v-model="data.checkedSblb" @change="handleCheckedCitiesChange" style="white-space: normal;display: inline-block"> |
||||
<el-checkbox v-for="item in data.sblb" :label="item.deviceId" :key="item.deviceId" style="margin-bottom: 10px;width: 560px;"> |
||||
<span style="width: 160px;display: inline-block">{{item.deviceName}}</span> |
||||
<span v-for="control in item.controlKey" style="margin-left: 20px"> |
||||
<span style="width: 80px;display: inline-block">{{control.label}}</span> |
||||
<template v-if="control.label === '控制启停'"> |
||||
<el-radio-group v-model="control.value"> |
||||
<el-radio label="1">开启</el-radio> |
||||
<el-radio label="2">关闭</el-radio> |
||||
</el-radio-group> |
||||
</template> |
||||
<template v-else> |
||||
<el-input type="number" v-model="control.value" style="width: 120px ;margin: 10px;height: 25px"/> |
||||
</template> |
||||
</span> |
||||
</el-checkbox> |
||||
</el-checkbox-group> |
||||
|
||||
</el-collapse-item> |
||||
<el-collapse-item title="第三步" :name="3"> |
||||
<span style="width: 50px; margin-left: 20px ">步骤描述:</span> |
||||
<el-input placeholder="请输入步骤描述" style="width: 900px"/> |
||||
<span style="width: 120px;display: inline-block ;margin: 20px">是否有限制条件</span> |
||||
<el-radio-group v-model="timingForm.isJudge"> |
||||
<el-radio :label="1">是</el-radio> |
||||
<el-radio :label="2">否</el-radio> |
||||
</el-radio-group> |
||||
<el-collapse v-model="timingForm.isJudge" style="width: 1000px"> |
||||
<el-collapse-item title="限制条件" :name="1"> |
||||
<span>限制设备:</span> |
||||
<el-select v-model="timingForm.judgeDevice" placeholder="请选择" style="width: 240px"> |
||||
<el-option :label='item.deviceName' :value='item.deviceId' :key="item.deviceId" v-for="item in data.allsblb"/> |
||||
</el-select> |
||||
<span style="width: 70px;display: inline-block ;margin: 20px">限制属性:</span> |
||||
<el-radio-group v-model="timingForm.judgeElement"> |
||||
<el-radio label="thermometer_value">温度</el-radio> |
||||
<el-radio label="thermometer_value_in">进水温度</el-radio> |
||||
<el-radio label="thermometer_value_out">出水温度</el-radio> |
||||
</el-radio-group> |
||||
<span style="width: 70px;display: inline-block ;margin-left: 50px">温度数值:</span> |
||||
<el-input type="number" v-model="timingForm.judgeData" placeholder="请输入" style="width: 80px ; height: 25px" /> |
||||
</el-collapse-item> |
||||
</el-collapse> |
||||
<el-checkbox :indeterminate="data.isIndeterminate" v-model="data.checkAll" @change="handleCheckAllChange">全选</el-checkbox> |
||||
<el-checkbox-group v-model="data.checkedSblb" @change="handleCheckedCitiesChange" style="white-space: normal;display: inline-block"> |
||||
<el-checkbox v-for="item in data.sblb" :label="item.deviceId" :key="item.deviceId" style="margin-bottom: 10px;width: 560px;"> |
||||
<span style="width: 160px;display: inline-block">{{item.deviceName}}</span> |
||||
<span v-for="control in item.controlKey" style="margin-left: 20px"> |
||||
<span style="width: 80px;display: inline-block">{{control.label}}</span> |
||||
<template v-if="control.label === '控制启停'"> |
||||
<el-radio-group v-model="control.value"> |
||||
<el-radio label="1">开启</el-radio> |
||||
<el-radio label="2">关闭</el-radio> |
||||
</el-radio-group> |
||||
</template> |
||||
<template v-else> |
||||
<el-input type="number" v-model="control.value" style="width: 120px ;margin: 10px;height: 25px"/> |
||||
</template> |
||||
</span> |
||||
</el-checkbox> |
||||
</el-checkbox-group> |
||||
|
||||
</el-collapse-item> |
||||
</el-collapse> |
||||
|
||||
<el-collapse v-model="activeNames"> |
||||
<el-collapse-item v-for="item in items" :key="item.id" :title="item.title" :name="item.id"> |
||||
{{ item.content }} |
||||
</el-collapse-item> |
||||
</el-collapse> |
||||
<el-button @click="addStep">添加步骤</el-button> |
||||
|
||||
|
||||
|
||||
|
||||
<!-- <el-col :span="12">--> |
||||
<!-- <el-form-item label="策略列表:" >--> |
||||
<!-- <el-select v-model="timingForm.sceneCode" placeholder="策略列表">--> |
||||
<!-- <el-option v-for="item in data.queryParams" :key="item.sceneCode" :label="item.label" :value="item.sceneCode">--> |
||||
<!-- </el-option>--> |
||||
<!-- </el-select>--> |
||||
<!-- </el-form-item>--> |
||||
<!-- </el-col>--> |
||||
<!-- <el-col :span="12">--> |
||||
<!-- <el-form-item label="设备列表:" >--> |
||||
<!-- <el-select v-model="timingForm.deviceId" placeholder="设备列表">--> |
||||
<!-- <el-option v-for="item in data.sblb" :key="item.deviceId" :label="item.deviceName" :value="item.deviceId">--> |
||||
<!-- </el-option>--> |
||||
<!-- </el-select>--> |
||||
<!-- </el-form-item>--> |
||||
<!-- </el-col>--> |
||||
<!-- <el-col :span="12">--> |
||||
<!-- <el-form-item label="进水温度:" prop="intemp" >--> |
||||
<!-- <el-input v-model="timingForm.intemp" placeholder="进水温度" />--> |
||||
<!-- </el-form-item>--> |
||||
<!-- </el-col>--> |
||||
<!-- <el-col :span="12">--> |
||||
<!-- <el-form-item label="出水温度:" prop="outtemp" >--> |
||||
<!-- <el-input v-model="timingForm.outtemp" placeholder="出水温度" />--> |
||||
<!-- </el-form-item>--> |
||||
<!-- </el-col>--> |
||||
<!-- <el-col :span="24">--> |
||||
<!-- <el-form-item label="温度:" prop="temp">--> |
||||
<!-- <el-input v-model="timingForm.temp" placeholder="温度" maxlength="11" />--> |
||||
<!-- </el-form-item>--> |
||||
<!-- </el-col>--> |
||||
</el-row> |
||||
</el-form> |
||||
<template #footer> |
||||
<div class="dialog-footer"> |
||||
<el-button type="primary" @click="submitForm">确 定</el-button> |
||||
<el-button @click="cancel">取 消</el-button> |
||||
</div> |
||||
</template> |
||||
</el-dialog> |
||||
<!-- 修改对话框 --> |
||||
<el-dialog :title="title1" v-model="open1" width="1000px" append-to-body> |
||||
<el-form :model="timingForm1" ref="userRef" label-width="88px"> |
||||
<el-row> |
||||
<el-col :span="24"> |
||||
<el-form-item label="策略名称:" prop="sceneName"> |
||||
<el-input v-model="timingForm1.sceneName" placeholder="请输入策略名称" maxlength="11" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
<el-col :span="24"> |
||||
<el-form-item label="策略描述:" prop="sceneRemark" > |
||||
<el-input v-model="timingForm1.sceneRemark" placeholder="请输入策略描述" /> |
||||
</el-form-item> |
||||
</el-col> |
||||
<span style="width: 120px;display: inline-block ;margin: 20px">是否有限制条件</span> |
||||
<el-radio-group v-model="timingForm1.isJudge"> |
||||
<el-radio :label="1">是</el-radio> |
||||
<el-radio :label="2">否</el-radio> |
||||
</el-radio-group> |
||||
<el-collapse v-model="timingForm1.isJudge" style="width: 1000px"> |
||||
<el-collapse-item title="限制条件" :name="1"> |
||||
<span>限制设备:</span> |
||||
<el-select v-model="timingForm1.judgeDevice" placeholder="请选择" style="width: 240px"> |
||||
<el-option :label='item.deviceName' :value='item.deviceId' :key="item.deviceId" v-for="item in data.allsblb"/> |
||||
</el-select> |
||||
<span style="width: 70px;display: inline-block ;margin: 20px">限制属性:</span> |
||||
<el-radio-group v-model="timingForm1.judgeElement"> |
||||
<el-radio label="thermometer_value">温度</el-radio> |
||||
<el-radio label="thermometer_value_in">进水温度</el-radio> |
||||
<el-radio label="thermometer_value_out">出水温度</el-radio> |
||||
</el-radio-group> |
||||
<span style="width: 70px;display: inline-block ;margin-left: 50px">温度数值:</span> |
||||
<el-input type="number" v-model="timingForm1.judgeData" placeholder="请输入" style="width: 80px ; height: 25px" /> |
||||
</el-collapse-item> |
||||
</el-collapse> |
||||
<el-checkbox :indeterminate="data.isIndeterminate1" v-model="data.checkAll1" @change="handleCheckAllChange1">全选</el-checkbox> |
||||
<!-- <div class="taber"><span>进水温度</span><span>出水温度</span><span>温度</span></div>--> |
||||
<el-checkbox-group v-model="data.checkedSblb1" @change="handleCheckedCitiesChange1"> |
||||
<el-checkbox v-for="item in data.sblb" :label="item.deviceId" :key="item.deviceId" style="margin-bottom: 10px;width: 560px;"> |
||||
<span style="width: 160px;display: inline-block">{{item.deviceName}}</span> |
||||
<span v-for="control in item.controlKey" style="margin-left: 20px"> |
||||
<span style="width: 80px;display: inline-block">{{control.label}}</span> |
||||
<template v-if="control.label === '控制启停'"> |
||||
<el-radio-group v-model="control.value"> |
||||
<el-radio label="1">开启</el-radio> |
||||
<el-radio label="2">关闭</el-radio> |
||||
</el-radio-group> |
||||
</template> |
||||
<template v-else> |
||||
<el-input type="number" v-model="control.value" style="width: 120px ;margin: 10px;height: 25px"/> |
||||
</template> |
||||
</span> |
||||
</el-checkbox> |
||||
</el-checkbox-group> |
||||
<!-- <el-col :span="24">--> |
||||
<!-- <el-form-item label="设备列表:" >--> |
||||
<!-- <el-select v-model="timingForm1.deviceId" placeholder="设备列表">--> |
||||
<!-- <el-option v-for="item in data.sblb" :key="item.deviceId" :label="item.deviceName" :value="item.deviceId">--> |
||||
<!-- </el-option>--> |
||||
<!-- </el-select>--> |
||||
<!-- </el-form-item>--> |
||||
<!-- </el-col>--> |
||||
<!-- <el-col :span="12">--> |
||||
<!-- <el-form-item label="进水温度:" prop="intemp" >--> |
||||
<!-- <el-input v-model="timingForm1.intemp" placeholder="进水温度" />--> |
||||
<!-- </el-form-item>--> |
||||
<!-- </el-col>--> |
||||
<!-- <el-col :span="12">--> |
||||
<!-- <el-form-item label="出水温度:" prop="outtemp" >--> |
||||
<!-- <el-input v-model="timingForm1.outtemp" placeholder="出水温度" />--> |
||||
<!-- </el-form-item>--> |
||||
<!-- </el-col>--> |
||||
<!-- <el-col :span="13">--> |
||||
<!-- <el-form-item label="温度值:" prop="temp">--> |
||||
<!-- <el-input v-model="timingForm1.temp" placeholder="温度" maxlength="11" />--> |
||||
<!-- </el-form-item>--> |
||||
<!-- </el-col>--> |
||||
</el-row> |
||||
</el-form> |
||||
<template #footer> |
||||
<div class="dialog-footer"> |
||||
<el-button type="primary" @click="submitForm1">确 定</el-button> |
||||
<el-button @click="cancel1">取 消</el-button> |
||||
</div> |
||||
</template> |
||||
</el-dialog> |
||||
<el-radio v-for="(item, index) in celueList" :key="index" v-model="radio" :label="item.sceneName" @change="selectCeLue(item)"> |
||||
<el-timeline> |
||||
<el-timeline-item v-for="(items, index) in item.flow" :key="index" :timestamp="items.timestamp" :hollow="items.hollow" :icon="getIcon(items)" :type="getType(items)"> |
||||
{{items.step}} |
||||
</el-timeline-item> |
||||
</el-timeline> |
||||
</el-radio> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup name="Index"> |
||||
import {ElMessage,ElMessageBox} from 'element-plus' |
||||
import {Delete} from '@element-plus/icons-vue' |
||||
import {ref,reactive,watch,onMounted} from "vue"; |
||||
import {getXl,getTb,postNew,getSb1,postXg,postDel,getSb} from '../../../api/emonitor/api' |
||||
onMounted(()=>{ |
||||
getSb().then((res)=>{ |
||||
console.log('111',res) |
||||
var arr = [] |
||||
for(var i in res.data){ |
||||
arr=arr.concat(res.data[i].children) |
||||
} |
||||
console.log('Allsblb',arr) |
||||
data.allsblb=arr |
||||
}) |
||||
getSb1().then((res)=>{ |
||||
console.log('222',res) |
||||
var arr = [] |
||||
for(var i in res.data){ |
||||
arr=arr.concat(res.data[i].children) |
||||
} |
||||
console.log('sblb',arr) |
||||
data.sblb=arr |
||||
var brr = [] |
||||
for(let a in arr){ |
||||
brr.push(arr[a].deviceId) |
||||
} |
||||
data.AllName=brr |
||||
console.log(brr) |
||||
}) |
||||
getXl().then((res)=>{ |
||||
console.log(res) |
||||
data.queryParams=res.data |
||||
}) |
||||
getTb({ |
||||
"sceneCode": data.sceneCode, |
||||
|
||||
"pageNum": currentPage.value, |
||||
|
||||
"pageSize": pageSize.value |
||||
}).then((res)=>{ |
||||
console.log(res) |
||||
data.timingList=res.rows |
||||
data.total=res.total |
||||
}) |
||||
// postNew().then((res)=>{ |
||||
// console.log(res) |
||||
// }) |
||||
}) |
||||
/** 筛选处理 */ |
||||
const data = reactive({ |
||||
num:1, |
||||
activeNames:0, |
||||
checkAll: false, |
||||
checkedSblb: [], |
||||
checkAll1: false, |
||||
checkedSblb1: [], |
||||
sblb: [], |
||||
allsblb:[], |
||||
AllName:[], |
||||
isIndeterminate: false, |
||||
isIndeterminate1: false, |
||||
total:'', |
||||
timingList:[], |
||||
queryParams: '', |
||||
sceneCode:0, |
||||
dateRange:[], |
||||
postData:[], |
||||
}); |
||||
// const wat = watch(()=> data.sblb,(val) =>{ |
||||
// console.log(val) |
||||
// }) |
||||
//改变 |
||||
function changeSl(){ |
||||
console.log(data.sceneCode) |
||||
} |
||||
//搜索按钮 |
||||
function handleQuery(){ |
||||
getTb({ |
||||
"sceneCode": data.sceneCode, |
||||
|
||||
"pageNum": currentPage.value, |
||||
|
||||
"pageSize": pageSize.value |
||||
}).then((res)=>{ |
||||
console.log(res) |
||||
data.timingList=res.rows |
||||
data.total=res.total |
||||
}) |
||||
} |
||||
//重置按钮 |
||||
function resetQuery(){ |
||||
data.sceneCode=0 |
||||
currentPage.value=1 |
||||
pageSize.value=10 |
||||
getTb({ |
||||
"sceneCode": data.sceneCode, |
||||
|
||||
"pageNum": currentPage.value, |
||||
|
||||
"pageSize": pageSize.value |
||||
}).then((res)=>{ |
||||
console.log(res) |
||||
data.timingList=res.rows |
||||
data.total=res.total |
||||
}) |
||||
} |
||||
function handleCheckAllChange(val) { |
||||
data.checkedSblb = val ? data.AllName : []; |
||||
data.isIndeterminate = false; |
||||
console.log(data.checkedSblb) |
||||
} |
||||
|
||||
function handleCheckedCitiesChange(value) { |
||||
let checkedCount = value.length; |
||||
data.checkAll = checkedCount === data.sblb.length; |
||||
data.isIndeterminate = checkedCount > 0 && checkedCount < data.sblb.length; |
||||
} |
||||
function handleCheckAllChange1(val) { |
||||
data.checkedSblb1 = val ? data.AllName : []; |
||||
data.isIndeterminate1 = false; |
||||
console.log(data.checkedSblb1) |
||||
} |
||||
|
||||
function handleCheckedCitiesChange1(value) { |
||||
let checkedCount = value.length; |
||||
data.checkAll1 = checkedCount === data.sblb.length; |
||||
data.isIndeterminate1 = checkedCount > 0 && checkedCount < data.sblb.length; |
||||
} |
||||
/** 数据表格处理 */ |
||||
|
||||
const currentPage = ref(1) |
||||
const pageSize = ref(10) |
||||
const small = ref(false) |
||||
const background = ref(false) |
||||
const disabled = ref(false) |
||||
const handleSizeChange = (val) => { |
||||
console.log(`${val}`) |
||||
getTb({ |
||||
"sceneCode": data.sceneCode, |
||||
|
||||
"pageNum": currentPage.value, |
||||
|
||||
"pageSize": pageSize.value |
||||
}).then((res)=>{ |
||||
console.log(res) |
||||
data.timingList=res.rows |
||||
data.total=res.total |
||||
}) |
||||
} |
||||
const handleCurrentChange = (val) => { |
||||
console.log(`${val}`) |
||||
getTb({ |
||||
"sceneCode": data.sceneCode, |
||||
|
||||
"pageNum": currentPage.value, |
||||
|
||||
"pageSize": pageSize.value |
||||
}).then((res)=>{ |
||||
console.log(res) |
||||
data.timingList=res.rows |
||||
data.total=res.total |
||||
}) |
||||
} |
||||
|
||||
|
||||
/** 新增策略处理 */ |
||||
const open = ref(false); |
||||
const title = ref(); |
||||
const open1 = ref(false); |
||||
const title1= ref(); |
||||
const activeName = ref('1') |
||||
const timingForm = reactive({ |
||||
num:1, |
||||
sceneName:'', |
||||
sceneRemark:'', |
||||
deviceVos:[], |
||||
isJudge:null, |
||||
judgeDevice:null, |
||||
judgeElement:null, |
||||
judgeData:null |
||||
}) |
||||
const timingForm1 = reactive({ |
||||
sceneName:'', |
||||
sceneRemark:'', |
||||
sceneCode:'', |
||||
deviceVos:[], |
||||
isJudge:null, |
||||
judgeDevice:null, |
||||
judgeElement:null, |
||||
judgeData:null |
||||
// deviceId:'', |
||||
// temp:'', |
||||
// intemp:'', |
||||
// outtemp:'' |
||||
}) |
||||
|
||||
// const watchTime = watch(()=> timingForm.executeTime, (val) => { |
||||
// // console.log(val.toLocaleString()) |
||||
// let date = new Date(val) |
||||
// let hours = date.getHours() |
||||
// let minutes = date.getMinutes() |
||||
// let seconds = date.getSeconds() |
||||
// console.log(`${hours}:${minutes}:${seconds}`) |
||||
// }) |
||||
|
||||
|
||||
|
||||
function handleAdd() { |
||||
open.value = true; |
||||
title.value = "新增策略"; |
||||
}; |
||||
function submitForm() { |
||||
let tempCheckedSblb = []; |
||||
data.checkedSblb.forEach(item => { |
||||
let tempItem = { |
||||
deviceId: item, |
||||
tempList:[] |
||||
}; |
||||
// 根据 item 从 data.sblb 中找到对应的设备信息 |
||||
let deviceInfo = data.sblb.find(sblbItem => sblbItem.deviceId === item); |
||||
if (deviceInfo) { |
||||
console.log(deviceInfo) |
||||
tempItem.tempList = deviceInfo.controlKey |
||||
} |
||||
tempCheckedSblb.push(tempItem); |
||||
timingForm.deviceVos=tempCheckedSblb |
||||
// for(let i in deviceInfo.controlKey){ |
||||
// deviceInfo.controlKey[i].value='' |
||||
// } |
||||
// deviceInfo.controlKey.map(item => { |
||||
// item.value = ''; |
||||
// }); |
||||
}); |
||||
console.log(timingForm) |
||||
postNew(timingForm).then((res)=>{ |
||||
console.log(res) |
||||
ElMessage({type:"success",message:'新增成功!'}) |
||||
handleQuery() |
||||
getXl().then((res)=>{ |
||||
console.log(res) |
||||
data.queryParams=res.data |
||||
}) |
||||
timingForm.sceneName='', |
||||
timingForm.sceneRemark='', |
||||
timingForm.deviceVos=[], |
||||
timingForm.isJudge=2, |
||||
timingForm.judgeDevice=null, |
||||
timingForm.judgeElement=null, |
||||
timingForm.judgeData=null, |
||||
data.checkedSblb=[]; |
||||
data.isIndeterminate=false |
||||
open.value = false; |
||||
data.sblb.map(item => { |
||||
item.controlKey.map(temp => { |
||||
temp.value = ''; |
||||
}); |
||||
}); |
||||
}) |
||||
}; |
||||
function cancel() { |
||||
timingForm.sceneName='', |
||||
timingForm.sceneRemark='', |
||||
timingForm.deviceVos=[]; |
||||
timingForm.isJudge=2, |
||||
timingForm.judgeDevice=null, |
||||
timingForm.judgeElement=null, |
||||
timingForm.judgeData=null |
||||
data.checkedSblb=[]; |
||||
data.isIndeterminate=false |
||||
open.value = false; |
||||
data.sblb.map(item => { |
||||
item.controlKey.map(temp => { |
||||
temp.value = ''; |
||||
}); |
||||
}); |
||||
|
||||
}; |
||||
function handleXg(dat) { |
||||
open1.value = true; |
||||
title1.value = "修改策略"; |
||||
console.log('101111',dat) |
||||
var arr = [] |
||||
for(let i in dat.deviceVos){ |
||||
arr.push(dat.deviceVos[i].deviceId) |
||||
} |
||||
data.checkedSblb1=arr |
||||
for (let i = 0;i < data.sblb.length ;i++ ){ |
||||
var deviceId = data.sblb[i].deviceId |
||||
for (let j = 0;j < dat.deviceVos.length ;j++ ) { |
||||
if ( deviceId === dat.deviceVos[j].deviceId){ |
||||
console.log(dat.deviceVos[j].tempValue) |
||||
data.sblb[i].controlKey = dat.deviceVos[j].tempValue; |
||||
} |
||||
} |
||||
} |
||||
timingForm1.sceneName=dat.sceneName |
||||
timingForm1.sceneRemark=dat.sceneRemark |
||||
timingForm1.sceneCode = dat.sceneCode |
||||
timingForm1.isJudge=dat.isJudge |
||||
timingForm1.judgeDevice=dat.judgeDevice |
||||
timingForm1.judgeElement=dat.judgeElement |
||||
timingForm1.judgeData=dat.judgeData |
||||
}; |
||||
function submitForm1() { |
||||
let tempCheckedSblb = []; |
||||
data.checkedSblb1.forEach(item => { |
||||
let tempItem = { |
||||
deviceId: item, |
||||
tempList:[] |
||||
}; |
||||
// 根据 item 从 data.sblb 中找到对应的设备信息 |
||||
let deviceInfo = data.sblb.find(sblbItem => sblbItem.deviceId === item); |
||||
if (deviceInfo) { |
||||
tempItem.tempList = deviceInfo.controlKey; |
||||
} |
||||
tempCheckedSblb.push(tempItem); |
||||
timingForm1.deviceVos=tempCheckedSblb |
||||
}); |
||||
console.log(timingForm1) |
||||
postXg(timingForm1).then((res)=>{ |
||||
console.log(res) |
||||
ElMessage({type:"success",message:'修改成功!'}) |
||||
getXl().then((res)=>{ |
||||
console.log(res) |
||||
data.queryParams=res.data |
||||
}) |
||||
handleQuery() |
||||
data.sblb.map(item => { |
||||
item.controlKey.map(temp => { |
||||
temp.value = ''; |
||||
}); |
||||
}); |
||||
}) |
||||
open1.value = false; |
||||
timingForm1.sceneName='' |
||||
timingForm1.sceneRemark='' |
||||
timingForm1.sceneCode='' |
||||
timingForm1.deviceVos=[] |
||||
timingForm1.isJudge=2, |
||||
timingForm1.judgeDevice=null, |
||||
timingForm1.judgeElement=null, |
||||
timingForm1.judgeData=null |
||||
}; |
||||
function cancel1() { |
||||
open1.value = false; |
||||
timingForm1.sceneName='' |
||||
timingForm1.sceneRemark='' |
||||
timingForm1.sceneCode='' |
||||
timingForm1.deviceVos=[] |
||||
timingForm1.isJudge=2, |
||||
timingForm1.judgeDevice=null, |
||||
timingForm1.judgeElement=null, |
||||
timingForm1.judgeData=null |
||||
handleQuery() |
||||
data.sblb.map(item => { |
||||
item.controlKey.map(temp => { |
||||
temp.value = ''; |
||||
}); |
||||
}) |
||||
}; |
||||
function handleDel(sceneCode) { |
||||
ElMessageBox.confirm("是否确认删除此策略?", "提示",{ |
||||
confirmButtonText: "确认", |
||||
cancelButtonText: "取消", |
||||
type: "warning" |
||||
}).then(() => { |
||||
console.log(sceneCode) |
||||
postDel({ |
||||
"sceneCode":sceneCode |
||||
}).then((res) => { |
||||
console.log(res) |
||||
ElMessage({type:"success",message:'删除成功!'}) |
||||
getXl().then((res)=>{ |
||||
console.log(res) |
||||
data.queryParams=res.data |
||||
<script> |
||||
import { ref } from 'vue' |
||||
export default { |
||||
setup() { |
||||
const radio = ref('') |
||||
const celueList = ref([ |
||||
{ sceneName: '场景1', |
||||
flow: [ |
||||
{ step: '步骤1', timestamp: '2022-01-01', hollow: true }, |
||||
{ step: '步骤2', timestamp: '2022-01-02', hollow: false, icon: 'el-icon-check', type: 'success' }, |
||||
{ step: '步骤3', timestamp: '2022-01-03', hollow: true }, |
||||
{ step: '步骤4', timestamp: '2022-01-04', hollow: false, icon: 'el-icon-close', type: 'danger' }, |
||||
], |
||||
}, |
||||
{ sceneName: '场景2', |
||||
flow: [ |
||||
{ step: '步骤1', timestamp: '2022-01-01', hollow: true }, |
||||
{ step: '步骤2', timestamp: '2022-01-02', hollow: false, icon: 'el-icon-check', type: 'success' }, |
||||
{ step: '步骤3', timestamp: '2022-01-03', hollow: true }, |
||||
{ step: '步骤4', timestamp: '2022-01-04', hollow: false, icon: 'el-icon-close', type: 'danger' }, |
||||
], |
||||
}, |
||||
]) |
||||
const selectCeLue = (item) => { |
||||
celueList.value.forEach((celue) => { |
||||
celue.flow.forEach((flow) => { |
||||
flow.icon = '' |
||||
flow.type = '' |
||||
}) |
||||
}) |
||||
handleQuery() |
||||
}); |
||||
}) |
||||
} |
||||
|
||||
|
||||
//添加步骤 |
||||
const items = reactive([{ id: 1, title: '第一步', content: '步骤一的内容' }]) |
||||
const activeNames = ref(['1']) |
||||
const addStep = () => { |
||||
const newId = items.length + 1 |
||||
items.push({ id: newId, title: `第${newId}步`, content: `步骤${newId}的内容` }) |
||||
activeNames.value.push(`${newId}`) |
||||
item.flow.forEach((flow) => { |
||||
flow.icon = flow.icon || '' |
||||
flow.type = flow.type || '' |
||||
}) |
||||
console.log(item) |
||||
} |
||||
const getIcon = (item) => { return item.icon || '' } |
||||
const getType = (item) => { return item.type || '' } |
||||
return { radio, celueList, selectCeLue, getIcon, getType, } |
||||
}, |
||||
} |
||||
|
||||
|
||||
|
||||
const { queryParams } = toRefs(data); |
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
|
||||
.dev_control_table{ |
||||
position: relative; |
||||
width: 100%; |
||||
min-height: 745px; |
||||
background-color: #2F3D8A; |
||||
} |
||||
.taber{ |
||||
width: 400px; |
||||
margin-left: 52px; |
||||
display: flex; |
||||
justify-content: flex-start; |
||||
line-height: 32px; |
||||
span{ |
||||
width: 120px; |
||||
&:nth-child(2),&:nth-child(3){ |
||||
margin-left: 20px; |
||||
} |
||||
} |
||||
} |
||||
::v-deep .el-button{ |
||||
border-radius: 2px; |
||||
} |
||||
::v-deep .el-pagination{ |
||||
position: absolute; |
||||
bottom: 10px; |
||||
left: 50%; |
||||
transform: translateX(-50%); |
||||
} |
||||
::v-deep .el-pagination__total{ |
||||
color: #f3ffff; |
||||
} |
||||
::v-deep .el-pagination__jump{ |
||||
color: #f3ffff; |
||||
} |
||||
::v-deep .el-pager{ |
||||
margin: 0 5px; |
||||
} |
||||
::v-deep .el-table .el-table__body-wrapper{ |
||||
background-color: #2F3D8A; |
||||
} |
||||
::v-deep .el-form-item__content{ |
||||
//display: flex; |
||||
} |
||||
::v-deep .el-checkbox { |
||||
width: 560px; |
||||
} |
||||
//::v-deep .el-dialog:not(.is-fullscreen){ |
||||
// width: auto; |
||||
//} |
||||
</style> |
||||
|
||||
|
@ -1,16 +0,0 @@ |
||||
<template> |
||||
<div class="app-container home"> |
||||
<h1>策略管理</h1> |
||||
</div> |
||||
</template> |
||||
|
||||
<script setup name="Index"> |
||||
|
||||
|
||||
|
||||
</script> |
||||
|
||||
<style scoped lang="scss"> |
||||
|
||||
</style> |
||||
|
Loading…
Reference in new issue