| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488 |
- {% load staticfiles %}
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8" />
- <link href="{% static '/lib/bootstrap-3.3.7/css/bootstrap.css' %}" rel="stylesheet">
- <link rel="stylesheet" href="{% static '/lib/font-awesome/4.5.0/css/font-awesome.css' %}">
- <link rel="stylesheet" href="{% static '/lib/css/ace.min.css' %}" />
- <link rel="stylesheet" href="{% static '/lib/css/ace-skins.min.css' %}">
- <link rel="stylesheet" href="{% static '/lib/css/ace-rtl.min.css' %}">
- <link rel="stylesheet" href="{% static '/lib/layui/css/layui.css' %}">
- <link rel="stylesheet" href="{% static '/lib/css/jquery-ui.css' %}" />
- <link rel="stylesheet" href="{% static '/css/loading.css' %}?versions=0.5.0" />
- <link rel="stylesheet" href="{% static '/lib/css/jquery-ui.css' %}" />
- <style type="text/css">
- body {
- overflow: hidden;
- background: #fff;
- }
- .searchCover {
- margin: 20px 0;
- }
- .innerTable {
- padding: 0 1px 0 0;
- min-width: 750px;
- }
- .table,
- .table.table-striped>thead>tr>th {
- text-align: center;
- }
- table td {
- vertical-align: middle !important;
- }
- .nullData {
- width: 100%;
- height: 500px;
- background: #ddd;
- text-align: center;
- line-height: 500px;
- font-size: 20px;
- border: 1px solid #ddd;
- }
- .check,
- #checkAll {
- width: 18px;
- height: 19px;
- vertical-align: middle;
- margin-top: -6px;
- visibility: hidden;
- display: none;
- }
- .my_protocol input[type='checkbox']+span {
- cursor: pointer;
- width: 18px;
- height: 18px;
- background-color: red;
- display: inline-block;
- background: url(/static/img/tick.png) no-repeat center;
- background-position: -19px 0px;
- position: relative;
- top: 3px;
- border: 1px solid #bbb;
- }
- .my_protocol input[type='checkbox']:checked+span {
- background-position-x: 3px;
- background-position-y: 3px;
- }
- .controlModel {
- display: none;
- margin-bottom: 10px;
- }
- .selectedColor {
- background: #faffc2;
- }
- .content {
- overflow-x: scroll;
- }
- .coerce {
- display: inline-block;
- width: 0;
- transition: all .3s;
- opacity: 0;
- height: 33px;
- overflow: hidden;
- vertical-align: middle;
- }
- .coerceBlock {
- width: 109px;
- opacity: 1;
- }
- /* 操作按钮集合 */
- .btnTopGather {
- float: right;
- margin-right: 20px;
- }
- input[disabled] {
- color: #fff !important;
- }
- /* 参数配置弹框样式 */
- .modelTitle {
- float: left;
- width: 100px;
- text-align: right;
- line-height: 30px;
- }
- .modal-body>div {
- margin-bottom: 10px;
- }
- .modal-body div select {
- width: 100px;
- }
- #timeHourParent {
- display: none;
- }
- /* 单个下发指令 */
- .searchCover select {
- border: 1px solid #428BCA;
- }
- .searchCover select:disabled {
- border: 1px solid #D5D5D5;
- }
- /* 参数配置 */
- .modeBody .layui-input {
- line-height: 30px;
- height: 30px;
- }
- .initVal {
- position: absolute;
- left: 14px;
- top: 5px;
- }
- .sliderVal {
- position: absolute;
- right: 8px;
- top: 5px;
- }
- .ui-slider {
- top: 8px;
- left: 30px;
- }
- .layui-form {
- display: inline-block;
- }
- .layui-input {
- height: 30px;
- }
- .layui-card-header {
- font-size: 15px;
- }
- .headerh1 {
- font-weight: 550;
- color: red;
- font-size: 20px;
- }
- </style>
- <body>
- <div class="content">
- <div class="searchCover">
- 设备名称:
- <input type="text" value="" class="fp-user" id="ename" placeholder="请输入设备名称"
- onkeypress="if (event.keyCode == 13) sub_filter();" /> 设备ID:
- <input type="text" value="" id="eId" placeholder="请输入设备ID" onkeypress="if (event.keyCode == 13) sub_filter();" />
- <button type="button" onclick="sub_filter()" class="btn btn-sm btn-primary">筛选</button>
- {% if role == "superuser" or role == "staff" %}
- 设备版本:
- <select name="" onchange="dverSelect(this,'edver')" id="edver" style="width:120px">
- <option value="">所有版本</option>
- <option value="1">版本1</option>
- <option value="2">版本2</option>
- <option value="3">版本3</option>
- <option value="4">版本4</option>
- </select>
- 在线状态:
- <select name="" onchange="dverSelect(this,'is_online')" id="onoffSelect" style="width:120px">
- <option value="">全部</option>
- <option value="1">在线</option>
- <option value="0">离线</option>
- </select>
- 用户:
- <div class="layui-form">
- <div class="layui-input-inline">
- <select name="interest" id="userSelect" lay-filter="userSelect" lay-search>
- <option value="">请选择</option>
- {% for user in user_list %}
- <option value="{{user.username}}">{{user.username}}</option>
- {% endfor %}
- </select>
- </div>
- </div>
- <!-- <select name="" onchange="dverSelect(this,'euserVal')" id="userSelect" style="width:120px">
- <option value="">请选择</option>
- {% for user in user_list %}
- <option value="{{user.username}}">{{user.username}}</option>
- {% endfor %}
- </select> -->
- <button type="button" onclick="exportList()" class="btn btn-sm btn-primary">导出</button>
- {% else %} {% endif %}
- <div class="btnTopGather">
- <!-- <button type="button" class="btn btn-sm btn-primary" id="operationBtn"
- onclick="operation()">操作</button> -->
- <button class="btn btn-sm btn-primary" type="button" onclick="operation()" id="operationBtnA">
- 全部设置
- </button>
- <button class="btn btn-sm btn-info" type="button" onclick="debugging()" id="debugging">
- 调试
- </button>
- <button class="btn btn-sm btn-info" disabled onclick="examineSIM()" id="simsearch">
- <i class="ace-icon fa fa-search align-top bigger-125 icon-on-right"></i>
- SIM卡查询
- </button>
- <!-- 定时时长:
- <select class="worktime-select" disabled id="scdState" onchange="timing('scdState',$(this).val())">
- <OPTION>定时时长</OPTION>
- <OPTION value="0">常亮</OPTION>
- <OPTION value="1">1小时</OPTION>
- <OPTION value="2">2小时</OPTION>
- <OPTION value="3">3小时</OPTION>
- <OPTION value="4">4小时</OPTION>
- <OPTION value="5">5小时</OPTION>
- <OPTION value="6">6小时</OPTION>
- <OPTION value="7">7小时</OPTION>
- </select> -->
- 设备开关:
- <select class="worktime-select" disabled id="equipSwBtn" onchange="timing('equipSwBtn',$(this).val())">
- <!--onchange="SetSwitch($(this))" -->
- <OPTION>设备开关</OPTION>
- <OPTION value="1">开启</OPTION>
- <OPTION value="0">关闭</OPTION>
- </select>
- <input type="button" class="btn btn-sm btn-primary" disabled id="autoClear" onclick="autoClear()" value="自清虫定时">
- <input type="button" class="btn btn-sm btn-primary" disabled id="reportConfig" onclick="reportConfig()"
- value="上传时间间隔配置">
- <input type="button" class="btn btn-sm btn-primary" disabled id="deviceConfig" onclick="deviceConfig()"
- value="定时方式配置">
- <input type="button" class="btn btn-sm btn-primary" disabled id="newStatus" onclick="reloadPage()"
- value="最新状态查询">
- <button type="button" class="btn btn-sm btn-primary" disabled id="operationBtn"
- onclick="coerceshow(this)">操作</button>
- <div class="coerce">
- <button type="button" class="btn btn-sm btn-danger" onclick="popupFrame('升级','ctrl','update')">升级</button>
- <button type="button" class="btn btn-sm btn-danger" onclick="popupFrame('重启','ctrl','reboot')">重启</button>
- </div>
- </div>
- </div>
- <div class="controlModel">
- <!-- 全局定时控制 -->
- <span>
- <img src="{% static '/img/timingIcon.png' %}" style="width: 26px;" alt="定时">
- </span>
- <select class="worktime-select" id="state" onchange="timing($(this))">
- <OPTION>定时时长</OPTION>
- <OPTION value="0">常亮</OPTION>
- <OPTION value="1">1小时</OPTION>
- <OPTION value="2">2小时</OPTION>
- <OPTION value="3">3小时</OPTION>
- <OPTION value="4">4小时</OPTION>
- <OPTION value="5">5小时</OPTION>
- <OPTION value="6">6小时</OPTION>
- <OPTION value="7">7小时</OPTION>
- </select>
- </div>
- <div class="innerTable">
- <table id="datatable" class="table table-striped table-hover">
- <thead>
- <tr>
- <td>
- <div style="position:relative">
- <label class="my_protocol">
- <input type="checkbox" onchange="checkAll($(this))" id="checkAll" name="title-table-checkbox" />
- <span></span>
- </label>
- </div>
- </td>
- <td>设备ID</td>
- <td>设备名称</td>
- <td>在线状态</td>
- <td>设备开关</td>
- <td>工作状态</td>
- <!-- <td>定时模式</td> -->
- <td>定时时长</td>
- <td>清虫间隔</td>
- <td>灯管状态</td>
- <td>光照</td>
- <td>雨控状态</td>
- <td>温控状态</td>
- <td>倾倒状态</td>
- <td>信号强度</td>
- <td>数据上传间隔</td>
- <td>设备版本</td>
- <td>上报时间</td>
- </tr>
- </thead>
- <tbody>
- </tbody>
- </table>
- <div class="fenpei-bottom">
- <input type="hidden" id="totalPage" value={{ nums }}>
- <div id="page" style="text-align: center;"></div>
- </div>
- </div>
- </div>
- <!-- 上传时间间隔设置 -->
- <div class="modal fade" id="reportConfigModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
- <div class="modal-dialog" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-label="Close">
- <span aria-hidden="true">×</span>
- </button>
- <h4 class="modal-title" id="myModalLabel">上传时间间隔</h4>
- </div>
- <div class="modal-body">
- <!-- 1结束 -->
- <div class="form-group lightPattern">
- <label class="col-sm-2 control-label no-padding-right" for="form-field-1">
- <font style="vertical-align: inherit;">
- <font style="vertical-align: inherit;"> 间隔频率 </font>
- </font>
- </label>
- <div class="col-sm-9">
- <span class="initVal">10</span>
- <div class="slider" id="reporttimingLength-slider"></div>
- <span class="sliderVal" id="reporttimingLength">10</span>
- </div>
- <div style="clear:both"></div>
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-sm btn-default" data-dismiss="modal">关闭</button>
- <button type="button" class="btn btn-sm btn-primary" id="saveDattimAutoClearMode"
- onclick="saveDattimAutoClearMode()">保存</button>
- </div>
- </div>
- </div>
- </div>
- <!-- 自清虫定时 -->
- <div class="modal fade" id="autoClearModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
- <div class="modal-dialog" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-label="Close">
- <span aria-hidden="true">×</span>
- </button>
- <h4 class="modal-title" id="myModalLabel">自清虫定时</h4>
- </div>
- <div class="modal-body">
- <!-- 1结束 -->
- <div class="form-group lightPattern">
- <label class="col-sm-2 control-label no-padding-right" for="form-field-1">
- <font style="vertical-align: inherit;">
- <font style="vertical-align: inherit;"> 自清虫频率 </font>
- </font>
- </label>
- <div class="col-sm-9">
- <span class="initVal">10</span>
- <div class="slider" id="timingLength-slider"></div>
- <span class="sliderVal" id="timingLength">10</span>
- </div>
- <div style="clear:both"></div>
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-sm btn-default" data-dismiss="modal">关闭</button>
- <button type="button" class="btn btn-sm btn-primary" id="saveAutoClearMode"
- onclick="saveAutoClearMode()">保存</button>
- </div>
- </div>
- </div>
- </div>
- <!-- 设备参数配置 -->
- <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
- <div class="modal-dialog" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-label="Close">
- <span aria-hidden="true">×</span>
- </button>
- <h4 class="modal-title" id="myModalLabel">参数配置</h4>
- </div>
- <div class="modal-body">
- <div class="clearfix">
- <div class="fl modelTitle">定时模式:</div>
- <div class="fl modeBody">
- <select name="" id="clock">
- <option value="0">光控</option>
- <option value="1">时控</option>
- </select>
- </div>
- </div>
- <div class="clearfix" id="durationParent">
- <div class="fl modelTitle">定时时长:</div>
- <div class="fl modeBody">
- <select name="" id="duration">
- <option value="0">常亮</option>
- <option value="1">1小时</option>
- <option value="2">2小时</option>
- <option value="3">3小时</option>
- <option value="4">4小时</option>
- <option value="5">5小时</option>
- <option value="6">6小时</option>
- <option value="7">7小时</option>
- </select>
- </div>
- </div>
- <div class="clearfix" id="timeHourParent">
- <div class="fl modelTitle">定时时间:</div>
- <div class="fl modeBody">
- <div class="enter-form layui-input-inline">
- <!-- <input type="text" class="layui-input" autocomplete="off" class="laydate-icon" id="timSelectBoxBegin" placeholder="请选择时间段 "> -->
- <select name="" id="begin">
- <option value="0">0点</option>
- <option value="1">1点</option>
- <option value="2">2点</option>
- <option value="3">3点</option>
- <option value="4">4点</option>
- <option value="5">5点</option>
- <option value="6">6点</option>
- <option value="7">7点</option>
- <option value="8">8点</option>
- <option value="9">9点</option>
- <option value="10">10点</option>
- <option value="11">11点</option>
- <option value="12">12点</option>
- <option value="13">13点</option>
- <option value="14">14点</option>
- <option value="15">15点</option>
- <option value="16">16点</option>
- <option value="17">17点</option>
- <option value="18">18点</option>
- <option value="19">19点</option>
- <option value="20">20点</option>
- <option value="21">21点</option>
- <option value="22">22点</option>
- <option value="23">23点</option>
- </select>
- <!-- <input type="hidden" value="" id="begin"> -->
- </div>
- 至
- <div class="enter-form layui-input-inline">
- <select name="" id="end">
- <option value="0">0点</option>
- <option value="1">1点</option>
- <option value="2">2点</option>
- <option value="3">3点</option>
- <option value="4">4点</option>
- <option value="5">5点</option>
- <option value="6">6点</option>
- <option value="7">7点</option>
- <option value="8">8点</option>
- <option value="9">9点</option>
- <option value="10">10点</option>
- <option value="11">11点</option>
- <option value="12">12点</option>
- <option value="13">13点</option>
- <option value="14">14点</option>
- <option value="15">15点</option>
- <option value="16">16点</option>
- <option value="17">17点</option>
- <option value="18">18点</option>
- <option value="19">19点</option>
- <option value="20">20点</option>
- <option value="21">21点</option>
- <option value="22">22点</option>
- <option value="23">23点</option>
- </select>
- <!-- <input type="text" class="layui-input" autocomplete="off" class="laydate-icon" id="timSelectBoxEnd" placeholder="请选择时间段 "> -->
- <!-- <input type="hidden" value="" id="end"> -->
- </div>
- </div>
- </div>
- <!-- <div class="clearfix" id="dSwitchParent">
- <div class="fl modelTitle">设备开关:</div>
- <div class="fl modeBody">
- <select class="worktime-select" id="switchBtn"> onchange="SetSwitch($(this))"
- <OPTION>设备开关</OPTION>
- <OPTION value="1">开启</OPTION>
- <OPTION value="0">关闭</OPTION>
- </select>
- </div>
- </div> -->
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-sm btn-default" data-dismiss="modal">关闭</button>
- <button type="button" class="btn btn-sm btn-primary" id="saveMode" onclick="saveMode()">保存</button>
- </div>
- </div>
- </div>
- </div>
- <!-- loading -->
- <div id="loadingParent">
- <div id="loadCenter">
- <div class="skype-loader">
- <div class="dot">
- <div class="first"></div>
- </div>
- <div class="dot"></div>
- <div class="dot"></div>
- <div class="dot"></div>
- </div>
- Logging in...
- </div>
- </div>
- <!-- 全部设置 -->
- <div id="handleBtns" style="display:none">
- <div style="padding: 20px; background-color: #F2F2F2;" id="">
- <div class="layui-row layui-col-space15">
- <div class="layui-col-md12">
- <div class="layui-card" style="height: 22rem;">
- <div class="layui-card-header">此操作都是对应账号下的<span class="headerh1">所有</span>杀虫灯设备</div>
- <div class="layui-card-body">
- <button type="button" class="btn btn-sm btn-danger" onclick="a()">调试</button>
- 设备开关:
- <select class="worktime-select" onchange="b('equipSwBtn',$(this).val())">
- <!--onchange="SetSwitch($(this))" -->
- <OPTION>设备开关</OPTION>
- <OPTION value="1">开启</OPTION>
- <OPTION value="0">关闭</OPTION>
- </select>
- <!-- <button type="button" class="btn btn-sm btn-danger" onchange="b('equipSwBtn',$(this).val())">设备开关</button> -->
- <button type="button" class="btn btn-sm btn-danger" onclick="c()">上传时间间隔</button>
- <button type="button" class="btn btn-sm btn-danger" onclick="d()">定时方式设置</button>
- <button type="button" class="btn btn-sm btn-danger" onclick="E()">最新状态查询</button>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <!-- 全部设置参数配置 -->
- <div class="modal fade" id="myModalA" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
- <div class="modal-dialog" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-label="Close">
- <span aria-hidden="true">×</span>
- </button>
- <h4 class="modal-title" id="myModalLabel">参数配置</h4>
- </div>
- <div class="modal-body">
- <div class="clearfix">
- <div class="fl modelTitle">定时模式:</div>
- <div class="fl modeBody">
- <select name="" id="clockA">
- <option value="0">光控</option>
- <option value="1">时控</option>
- </select>
- </div>
- </div>
- <div class="clearfix" id="durationParentA">
- <div class="fl modelTitle">定时时长:</div>
- <div class="fl modeBody">
- <select name="" id="durationA">
- <option value="0">常亮</option>
- <option value="1">1小时</option>
- <option value="2">2小时</option>
- <option value="3">3小时</option>
- <option value="4">4小时</option>
- <option value="5">5小时</option>
- <option value="6">6小时</option>
- <option value="7">7小时</option>
- </select>
- </div>
- </div>
- <div class="clearfix" id="timeHourParentA">
- <div class="fl modelTitle">定时时间:</div>
- <div class="fl modeBody">
- <div class="enter-form layui-input-inline">
- <!-- <input type="text" class="layui-input" autocomplete="off" class="laydate-icon" id="timSelectBoxBegin" placeholder="请选择时间段 "> -->
- <select name="" id="beginA">
- <option value="0">0点</option>
- <option value="1">1点</option>
- <option value="2">2点</option>
- <option value="3">3点</option>
- <option value="4">4点</option>
- <option value="5">5点</option>
- <option value="6">6点</option>
- <option value="7">7点</option>
- <option value="8">8点</option>
- <option value="9">9点</option>
- <option value="10">10点</option>
- <option value="11">11点</option>
- <option value="12">12点</option>
- <option value="13">13点</option>
- <option value="14">14点</option>
- <option value="15">15点</option>
- <option value="16">16点</option>
- <option value="17">17点</option>
- <option value="18">18点</option>
- <option value="19">19点</option>
- <option value="20">20点</option>
- <option value="21">21点</option>
- <option value="22">22点</option>
- <option value="23">23点</option>
- </select>
- <!-- <input type="hidden" value="" id="begin"> -->
- </div>
- 至
- <div class="enter-form layui-input-inline">
- <select name="" id="endA">
- <option value="0">0点</option>
- <option value="1">1点</option>
- <option value="2">2点</option>
- <option value="3">3点</option>
- <option value="4">4点</option>
- <option value="5">5点</option>
- <option value="6">6点</option>
- <option value="7">7点</option>
- <option value="8">8点</option>
- <option value="9">9点</option>
- <option value="10">10点</option>
- <option value="11">11点</option>
- <option value="12">12点</option>
- <option value="13">13点</option>
- <option value="14">14点</option>
- <option value="15">15点</option>
- <option value="16">16点</option>
- <option value="17">17点</option>
- <option value="18">18点</option>
- <option value="19">19点</option>
- <option value="20">20点</option>
- <option value="21">21点</option>
- <option value="22">22点</option>
- <option value="23">23点</option>
- </select>
- <!-- <input type="text" class="layui-input" autocomplete="off" class="laydate-icon" id="timSelectBoxEnd" placeholder="请选择时间段 "> -->
- <!-- <input type="hidden" value="" id="end"> -->
- </div>
- </div>
- </div>
- <!-- <div class="clearfix" id="dSwitchParent">
- <div class="fl modelTitle">设备开关:</div>
- <div class="fl modeBody">
- <select class="worktime-select" id="switchBtn"> onchange="SetSwitch($(this))"
- <OPTION>设备开关</OPTION>
- <OPTION value="1">开启</OPTION>
- <OPTION value="0">关闭</OPTION>
- </select>
- </div>
- </div> -->
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-sm btn-default" data-dismiss="modal">关闭</button>
- <button type="button" class="btn btn-sm btn-primary" id="saveMode" onclick="dd()">保存</button>
- </div>
- </div>
- </div>
- </div>
- <!-- 全部设置上传时间间隔设置 -->
- <div class="modal fade" id="interval" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
- <div class="modal-dialog" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <button type="button" class="close" data-dismiss="modal" aria-label="Close">
- <span aria-hidden="true">×</span>
- </button>
- <h4 class="modal-title" id="myModalLabel">上传时间间隔</h4>
- </div>
- <div class="modal-body">
- <!-- 1结束 -->
- <div class="form-group lightPattern">
- <label class="col-sm-2 control-label no-padding-right" for="form-field-1">
- <font style="vertical-align: inherit;">
- <font style="vertical-align: inherit;"> 间隔频率 </font>
- </font>
- </label>
- <div class="col-sm-9">
- <span class="initVal">10</span>
- <div class="slider" id="reporttimingLength-slider2"></div>
- <span class="sliderVal" id="reporttimingLength2">10</span>
- </div>
- <div style="clear:both"></div>
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-sm btn-default" data-dismiss="modal">关闭</button>
- <button type="button" class="btn btn-sm btn-primary" id="saveDattimAutoClearMode" onclick="cc()">保存</button>
- </div>
- </div>
- </div>
- </div>
- <script src="{% static '/lib/js/jquery-2.1.4.min.js' %}"></script>
- <script src="{% static '/lib/layui/layui.all.js' %}"></script>
- <script src="{% static '/js/common.js' %}?versions=0.5.0"></script>
- <script src="{% static '/lib/bootstrap-3.3.7/js/bootstrap.js' %}"></script>
- <script src="{% static '/lib/js/jquery-ui.min.js' %}"></script>
- <!-- <script src="{% static '/assets/js/newdistpicker.js' %}" type="text/javascript" charset="utf-8"></script> -->
- <!-- <script src="{% static '/assets/js/main.js' %}" type="text/javascript" charset="utf-8"></script> -->
- <script type="text/javascript">
- $.ajaxSetup({
- data: { csrfmiddlewaretoken: '{{ csrf_token }}' },
- });
- var parentUserName = $('#parentUserName', parent.document).html();
- if (!(parentUserName == 'admin' || parentUserName == 'user' || parentUserName == 'XPH-DJ')) {
- $('#operationBtn').remove();
- $('.coerce').remove();
- }
- </script>
- <script src="{% static '/js/equipmanage/equipmanage_scd.js' %}?versions=0.5.0" type="text/javascript"></script>
- <script>
- // 上传时间间隔开关
- function reportConfig() {
- var cltDattim = $("#datatable .check:checked").parents('tr').find('.dattim').html(); //间隔
- $('#reporttimingLength').html(cltDattim);
- $("#reporttimingLength-slider").css('width', '85%').slider({
- value: cltDattim,
- range: "min",
- min: 5,
- max: 120,
- step: 5,
- slide: function (event, ui) {
- var val = parseInt(ui.value);
- $('#reporttimingLength').html(val);
- }
- });
- $('#reportConfigModal').modal({
- backdrop: 'static',
- keyboard: false
- })
- }
- function saveDattimAutoClearMode() {
- var reporttimingLength = $('#reporttimingLength').html();
- $.ajax({
- url: 'scd_mqtt',
- type: 'post',
- data: {
- sw: "datt",//上传时间间隔
- topicid: JSON.stringify(topicid),
- dattim: reporttimingLength
- },
- beforeSend: function () {
- $('#loadingParent').show();
- },
- complete: function () {
- setTimeout(function () {
- $('#loadingParent').hide();
- }, 4000)
- },
- success: function (data) {
- if (data == "0") {
- layer.msg("发送成功!")
- $('#reportConfigModal').modal('hide');
- $("#datatable .check:checked").parents('tr').find('.dattim').html(reporttimingLength); //间隔
- }
- else {
- layer.msg("发送失败!")
- }
- }
- })
- }
- // 自清虫开关
- function autoClear() {
- // 判断是否回显
- if (zqc.length == 1) {
- var cltTime = $("#datatable .check:checked").parents('tr').find('.clt').html(); //清虫间隔
- if (cltTime == '--') {
- $("#timingLength-slider").css('width', '85%').slider({
- value: 1,
- range: "min",
- min: 10,
- max: 120,
- step: 10,
- slide: function (event, ui) {
- var val = parseInt(ui.value);
- $('#timingLength').html(val);
- }
- });
- } else {
- $('#timingLength').html(cltTime);
- $("#timingLength-slider").css('width', '85%').slider({
- value: cltTime,
- range: "min",
- min: 10,
- max: 120,
- step: 10,
- slide: function (event, ui) {
- var val = parseInt(ui.value);
- $('#timingLength').html(val);
- }
- });
- }
- } else {
- $('#timingLength').html(10);
- $("#timingLength-slider").css('width', '85%').slider({
- value: 10,
- range: "min",
- min: 10,
- max: 120,
- step: 10,
- slide: function (event, ui) {
- var val = parseInt(ui.value);
- $('#timingLength').html(val);
- }
- });
- }
- $('#autoClearModal').modal({
- backdrop: 'static',
- keyboard: false
- })
- }
- function saveAutoClearMode() {
- var timingLength = $('#timingLength').html();
- $.ajax({
- url: 'scd_mqtt',
- type: 'post',
- data: {
- sw: "clean",//定时
- topicid: JSON.stringify(topicid),
- time: timingLength
- },
- beforeSend: function () {
- $('#loadingParent').show();
- },
- complete: function () {
- setTimeout(function () {
- $('#loadingParent').hide();
- }, 4000)
- },
- success: function (data) {
- if (data == "0") {
- layer.msg("发送成功!")
- $('#autoClearModal').modal('hide')
- }
- else {
- layer.msg("发送失败!")
- }
- }
- })
- }
- // 时控限制
- // $('#begin').on('change',function(){
- // $('#end').html('')
- // var st = parseInt($(this).val())+1;
- // for(var i = st;i<=23;i++){
- // $('#end').append('<option value="'+i+'">'+i+'点</option>')
- // }
- // $('#end').append('<option value="0">0点</option><option value="1">1点</option><option value="2">2点</option><option value="3">3点</option><option value="4">4点</option><option value="5">5点</option>')
- // $('#end').html('<option vlaue"1">1点</option>')
- // if($(this).val())
- // })
- //定时方式配置
- function deviceConfig() {
- $('#myModal').modal({
- backdrop: 'static',
- keyboard: false
- })
- // 判断是否回显
- if (topicid.length == 1) {
- var lConfig = $("#datatable .check:checked").parents('tr').find('.timeLength');
- var lConfigVal = $("#datatable .check:checked").parents('tr').find('.timeLength').html();
- // var dSwitchVal = $("#datatable .check:checked").parents('tr').find('.dSwitch').attr('dSwitch');
- console.log(lConfig.attr('timeswitch'))
- if (lConfig.attr('timeswitch') == 1) { //时控
- $('#clock').val(1);
- $('#timeHourParent').show();
- $('#durationParent').hide();
- $('#timSelectBox').val(lConfigVal);
- var timeArr = lConfigVal.split('-');
- $('#begin').val(timeArr[0]);
- $('#end').val(timeArr[1]);
- $('#dSwitchParent').hide();
- } else {
- $('#clock').val(0);
- $('#timeHourParent').hide();
- $('#durationParent').show();
- $('#dSwitchParent').show();
- if (lConfigVal == '常亮') {
- lConfigVal = 0;
- }
- $('#duration').val(parseInt(lConfigVal));
- }
- // if(dSwitchVal != 0){
- // dSwitchVal = 1;
- // }
- // $('#switchBtn').val(parseInt(dSwitchVal));
- // console.log('回显')
- } else {
- $('#dSwitchParent').show();
- }
- }
- // sim卡查询
- function examineSIM() {
- var iccid;
- $('#datatable .check').each(function () {
- if ($(this).prop('checked') == true) {
- console.log($(this).parents('tr').find('.iccid'))
- iccid = $(this).parents('tr').find('.iccid').val();
- }
- })
- $.ajax({
- url: 'siminfo',
- type: 'post',
- dataType: 'json',
- data: {
- simid: iccid,
- },
- beforeSend: function (XMLHttpRequest) {
- //注意,layer.msg默认3秒自动关闭,如果数据加载耗时比较长,需要设置time
- loadingFlag = layer.msg('请求中,请稍候……', { icon: 16, shade: 0.01, shadeClose: false, time: 60000 });
- },
- success: function (data) {
- console.log(data)
- var dat = data.data;
- if (data.code == 0) {
- var status;
- if (dat.account_status == "0") {
- status = "未知";
- } else if (dat.account_status == "1") {
- status = "测试期";
- } else if (dat.account_status == "2") {
- status = "沉默期";
- } else if (dat.account_status == "3") {
- status = "使用中";
- } else if (dat.account_status == "4") {
- status = "停机";
- } else if (dat.account_status == "5") {
- status = "停机保号";
- } else if (dat.account_status == "6") {
- status = "预销号";
- } else if (dat.account_status == "7") {
- status = "销号";
- }
- var usage;
- if (dat.iccid) {
- usage = dat.data_usage;
- } else {
- usage.innerHTML = '--';
- }
- var balance;
- if (dat.iccid) {
- balance = dat.data_balance;
- } else {
- balance = '--';
- }
- var time;
- if (dat.iccid) {
- var timestamp4 = new Date(dat.expiry_date * 1000);//直接用 new Date(时间戳) 格式转化获得当前时间
- time = timestamp4.toLocaleDateString().replace(/\//g, "-") + " " + timestamp4.toTimeString().substr(0, 8);
- } else {
- time = '--';
- }
- layer.close(loadingFlag);
- layer.open({
- type: 1
- , title: false //不显示标题栏
- , closeBtn: false
- , area: '300px;'
- , shade: 0.8
- , id: 'LAY_layuipro' //设定一个id,防止重复弹出
- , btn: ['我知道了']
- , btnAlign: 'c'
- , moveType: 1 //拖拽模式,0或者1
- , content: '<div style="padding: 50px; line-height: 22px; background-color: #393D49; color: #fff; font-weight: 300;">SIM卡查询结果<br>ICCID:' + iccid + '<br><br>状态:' + status + '<br>套餐:' + dat.data_plan + 'Mb<br>已用流量:' + usage + 'Mb<br>剩余流量:' + balance + 'Mb<br>到期时间:' + time + '</div>'
- , success: function (layero) {
- }
- });
- } else {
- layer.msg('查询失败!');
- }
- }
- })
- }
- // 导出
- function exportList() {
- var onoffSelectVal = $('#onoffSelect').val() || '';
- var edverVal = $('#edver').val() || '';
- var euserVal = $('#userSelect').val() || '';
- if (euserVal) {
- window.location.href = 'scdmanage_explore?dver=' + edverVal + '&is_online=' + onoffSelectVal + '&uname=' + euserVal;
- } else {
- layui.use('layer', function () {
- var layer = layui.layer;
- layer.msg('用户名必选')
- })
- }
- }
- //调试
- function debugging() {
- layer.confirm('确定' + '操作调试' + '?', {
- icon: 3,
- zIndex: 19991016,
- btn: ['确定', '取消'] //按钮
- }, function (index) {
- layer.closeAll()
- debuggingAxaj()
- }, function () {
- });
- }
- function debuggingAxaj() {
- $.ajax({
- url: 'scd_mqtt',
- type: 'post',
- data: {
- sw: 'test',
- topicid: JSON.stringify(topicid)
- },
- beforeSend: function () {
- layer.close(popupIndex)
- $('#loadingParent').show();
- },
- complete: function () {
- setTimeout(function () {
- $('#loadingParent').hide();
- }, 3000)
- },
- success: function (data) {
- if (data == 0) {
- setTimeout(function () {
- layer.msg('设置成功');
- }, 3000)
- }
- },
- })
- }
- //批量操作
- var popupIndex;
- //operation配置弹框
- function operation() {
- //页面层
- popupIndex = layer.open({
- type: 1,
- skin: 'layui-layer-rim', //加上边框
- area: ["40%", '363px'],
- content: $('#handleBtns').html()
- });
- }
- //全部设置功能
- //调试
- function a() {
- layer.close(popupIndex)
- layer.confirm('确定' + '操作调试' + '?', {
- icon: 3,
- zIndex: 19991016,
- btn: ['确定', '取消'] //按钮
- }, function (index) {
- layer.closeAll()
- $.ajax({
- url: 'scd_mqtt_all',
- type: 'post',
- data: {
- sw: 'test',
- },
- beforeSend: function () {
- $('#loadingParent').show();
- },
- complete: function () {
- setTimeout(function () {
- $('#loadingParent').hide();
- }, 3000)
- },
- success: function (data) {
- if (data == 0) {
- setTimeout(function () {
- layer.msg('设置成功');
- }, 3000)
- }
- },
- })
- }, function () {
- });
- }
- //设备开关
- function b(ctrl, val) {
- if (ctrl == 'scdState') {
- var data = {
- sw: "timer",//定时
- ts: 0,
- hours: val
- }
- } else {
- var data = {
- sw: "timer",//开关
- // ts:0,
- ds: val
- }
- }
- $.ajax({
- url: 'scd_mqtt_all',
- type: 'post',
- data: data,
- beforeSend: function () {
- $('#loadingParent').show();
- },
- complete: function () {
- setTimeout(function () {
- $('#loadingParent').hide();
- }, 4000)
- },
- success: function (data) {
- if (data == "0") {
- // $('#myModal').modal('hide');
- var eId = $('#eId').val();
- var ename = $('#ename').val();
- var page = $('.layui-laypage-curr em').eq(1).html();
- var onoffSelectVal = $('#onoffSelect').val() || '';
- var edverVal = $('#edver').val() || '';
- var euserVal = $('#userSelect').val() || '';
- var data = {
- req: "filter",
- ename: ename,
- page: page,
- f_id: eId,
- dver: edverVal,
- is_online: onoffSelectVal,
- uname: euserVal
- }
- setTimeout(function () {
- $.post("equipmanage_scd", data, function (data) {
- $("#datatable tr:not(:first)").html("");
- var msg = $.parseJSON(data);
- if (msg.dat.length > 0) {
- Fill_Table('datatable', msg.dat);
- $('#page').parent().show();
- } else {
- Fill_null_Table('datatable', msg.dat);
- $('#page').parent().hide();
- }
- $('#state').val('定时时长');
- $('#checkAll').prop('checked', false)
- $('#equipSwBtn').attr('disabled', true);
- $('#scdState').attr('disabled', true);
- $('#simsearch').attr('disabled', true);
- $('#debugging').attr('disabled', true);
- $('#deviceConfig').attr('disabled', true);
- $('#newStatus').attr('disabled', true);
- $('#operationBtn').attr('disabled', true);
- $('#reportConfig').attr('disabled', true);
- $('#operationBtn').html('操作');
- $('.coerce').removeClass('coerceBlock');
- });
- }, 4000)
- layer.close(popupIndex)
- setTimeout(function () {
- layer.msg('发送成功!');
- }, 4000)
- }
- else {
- setTimeout(function () {
- layer.msg('发送失败!');
- }, 3000)
- layer.close(popupIndex)
- }
- }
- })
- }
- //上传时间间隔
- function c() {
- var cltDattim = $("#datatable .check:checked").parents('tr').find('.dattim').html(); //间隔
- $('#reporttimingLength2').html(cltDattim);
- $("#reporttimingLength-slider2").css('width', '85%').slider({
- value: cltDattim,
- range: "min",
- min: 5,
- max: 120,
- step: 5,
- slide: function (event, ui) {
- var val = parseInt(ui.value);
- $('#reporttimingLength2').html(val);
- }
- });
- $('#interval').modal({
- backdrop: 'static',
- keyboard: false
- })
- layer.close(popupIndex)
- }
- function cc() {
- var reporttimingLength = $('#reporttimingLength2').html();
- $.ajax({
- url: 'scd_mqtt_all',
- type: 'post',
- data: {
- sw: "datt",//上传时间间隔
- dattim: reporttimingLength
- },
- beforeSend: function () {
- $('#loadingParent').show();
- },
- complete: function () {
- setTimeout(function () {
- $('#loadingParent').hide();
- }, 4000)
- },
- success: function (data) {
- if (data == "0") {
- $('#interval').modal('hide');
- $("#datatable .check:checked").parents('tr').find('.dattim').html(reporttimingLength); //间隔
- layer.close(popupIndex)
- setTimeout(function () {
- layer.msg('发送成功!');
- }, 4000)
- }
- else {
- setTimeout(function () {
- layer.msg('发送失败!');
- }, 4000)
- }
- }
- })
- }
- //定时方式设置
- function d() {
- $('#myModalA').modal({
- backdrop: 'static',
- keyboard: false
- })
- layer.close(popupIndex)
- $('#clockA').val(0);
- $('#timeHourParentA').hide();
- $('#durationParentA').show();
- $('#dSwitchParent').show();
- }
- function dd() {
- var ts = $('#clockA').val();
- var duration = $('#durationA').val();
- var begin = $('#beginA').val();
- var end = $('#endA').val();
- if (ts == 1) {
- if (!begin) {
- layer.tips('请选择时间段', '#timSelectBoxBegin');
- return false;
- } else if (!end) {
- layer.tips('请选择时间段', '#timSelectBoxEnd');
- return false;
- }
- }
- $.ajax({
- url: 'scd_mqtt_all',
- type: 'post',
- data: {
- sw: "timer",//定时
- ts: ts,
- hours: duration,//光控模式下的定时时长
- begin: begin,
- end: end
- },
- beforeSend: function () {
- $('#loadingParent').show();
- },
- complete: function () {
- setTimeout(function () {
- $('#loadingParent').hide();
- }, 4000)
- },
- success: function (data) {
- if (data == "0") {
- layer.close(popupIndex)
- var eId = $('#eId').val();
- var ename = $('#ename').val();
- var page = $('.layui-laypage-curr em').eq(1).html();
- var onoffSelectVal = $('#onoffSelect').val() || '';
- var edverVal = $('#edver').val() || '';
- var euserVal = $('#userSelect').val() || '';
- var data = {
- req: "filter",
- dver: edverVal,
- is_online: onoffSelectVal,
- ename: ename,
- page: page,
- f_id: eId,
- uname: euserVal
- }
- $('#myModalA').modal('hide')
- setTimeout(function () {
- $.post("equipmanage_scd", data, function (data) {
- $("#datatable tr:not(:first)").html("");
- var msg = $.parseJSON(data);
- if (msg.dat.length > 0) {
- Fill_Table('datatable', msg.dat);
- $('#page').parent().show();
- } else {
- Fill_null_Table('datatable', msg.dat);
- $('#page').parent().hide();
- }
- $('#state').val('定时时长');
- $('#checkAll').prop('checked', false)
- $('#simsearch').attr('disabled', true);
- $('#debugging').attr('disabled', true);
- $('#equipSwBtn').attr('disabled', true);
- $('#scdState').attr('disabled', true);
- $('#autoClear').attr('disabled', true);
- $('#deviceConfig').attr('disabled', true);
- $('#newStatus').attr('disabled', true);
- $('#operationBtn').attr('disabled', true);
- $('#reportConfig').attr('disabled', true);
- $('#operationBtn').html('操作');
- $('.coerce').removeClass('coerceBlock');
- });
- }, 4000)
- setTimeout(function () {
- layer.msg('发送成功!');
- }, 4000)
- }
- else {
- setTimeout(function () {
- layer.msg('发送失败!');
- }, 4000)
- layer.close(popupIndex)
- }
- }
- })
- }
- //关闭模态框时清空数据
- $(function () {
- $('#myModalA').on('hidden.bs.modal', function () {
- $('#clockA').val(0);
- $('#durationA').val(0);
- $('#timeHourParentA').hide();
- $('#durationParentA').show();
- $('#timSelectBoxA').val('');
- $('#beginA').val('');
- $('#endA').val('');
- $('#switchBtnA').val('设备开关');
- });
- });
- $('#clockA').on('change', function () {
- if ($(this).val() == 0) {
- $('#timeHourParentA').hide();
- $('#durationParentA').show();
- $('#timSelectBoxA').val('');
- $('#beginA').val('0');
- $('#endA').val('0');
- $('#dSwitchParent').show();
- } else {
- $('#timeHourParentA').show();
- $('#durationParentA').hide();
- $('#durationA').val(0);
- $('#switchBtnA').val('设备开关');
- $('#dSwitchParentA').hide();
- }
- })
- //最新状态查询
- function E() {
- $.ajax({
- type: "post",
- url: 'scd_mqtt_all',
- beforeSend: function () {
- $('#loadingParent').show();
- },
- complete: function () {
- setTimeout(function () {
- $('#loadingParent').hide();
- }, 3000)
- },
- data: {
- "sw": "read",//读取
- "kind": "status"//读取下位机状态
- },
- dataType: "json",
- success: function (data) {
- if (data == "0") {
- var ename = $('#ename').val();
- var eId = $('#eId').val();
- var page = $('.layui-laypage-curr em').eq(1).html();
- var eId = $('#eId').val();
- var onoffSelectVal = $('#onoffSelect').val() || '';
- var edverVal = $('#edver').val() || '';
- var euserVal = $('#userSelect').val() || '';
- var data = {
- req: "filter",
- dver: edverVal,
- is_online: onoffSelectVal,
- ename: ename,
- f_id: eId,
- page: page,
- uname: euserVal
- }
- setTimeout(function () {
- $.post("equipmanage_scd", data, function (data) {
- $("#datatable tr:not(:first)").html("");
- var msg = $.parseJSON(data);
- if (msg.dat.length > 0) {
- Fill_Table('datatable', msg.dat);
- $('#page').parent().show();
- } else {
- Fill_null_Table('datatable', msg.dat);
- $('#page').parent().hide();
- }
- $('#checkAll').prop('checked', false)
- // $('.controlModel').slideUp();
- $('#simsearch').attr('disabled', true);
- $('#debugging').attr('disabled', true);
- $('#equipSwBtn').attr('disabled', true);
- $('#scdState').attr('disabled', true);
- $('#deviceConfig').attr('disabled', true);
- $('#newStatus').attr('disabled', true);
- $('#reportConfig').attr('disabled', true);
- $('#operationBtn').html('操作');
- $('.coerce').removeClass('coerceBlock');
- });
- }, 3000)
- setTimeout(function () {
- layer.msg('发送成功!');
- }, 3000)
- layer.close(popupIndex)
- }
- else {
- setTimeout(function () {
- layer.msg('发送失败!');
- }, 3000)
- }
- }
- })
- }
- </script>
- </body>
- </html>
|