Authored by 鲁尚清

【无】停机计划的停机模式数据字典方式获取

@@ -508,19 +508,41 @@ layui.define(['table', 'form', 'laydate', 'admin', 'layer', 'laytpl', 'common', @@ -508,19 +508,41 @@ layui.define(['table', 'form', 'laydate', 'admin', 'layer', 'laytpl', 'common',
508 function openEditHtml(id) { 508 function openEditHtml(id) {
509 var url = 'baseconfig/shutdownplan/add'; 509 var url = 'baseconfig/shutdownplan/add';
510 var params = {}; 510 var params = {};
  511 + //lsq 新增时弹框显示新增,编辑时显示编辑 2022-08-04
  512 + let titleName='新增';
511 if (id) { 513 if (id) {
512 - params['cutoverId'] = id 514 + params['cutoverId'] = id;
  515 + titleName='编辑';
513 } 516 }
514 view('commonViewModel').render(url).then(function (res) { 517 view('commonViewModel').render(url).then(function (res) {
515 layer.open({ 518 layer.open({
516 id: 'shutdownplanEditHtml', 519 id: 'shutdownplanEditHtml',
517 content: laytpl(res.body).render(JSON.stringify(params)), 520 content: laytpl(res.body).render(JSON.stringify(params)),
518 btn: ['保存', '取消'], 521 btn: ['保存', '取消'],
519 - title: `<a class="layui-icon layui-icon-edit win_title_icon"></a>停机计划编辑`, 522 + title: `<a class="layui-icon layui-icon-edit win_title_icon"></a>停机计划`+titleName,
520 type: '1', 523 type: '1',
521 resize: false, 524 resize: false,
522 area: ['80%', '90%'], 525 area: ['80%', '90%'],
523 success: function (indexm, layero) { 526 success: function (indexm, layero) {
  527 + //start 停机模式从数据字典中获取 2022-05-24
  528 + admin.req({
  529 + url: common.domainName + '/api-web/manage/ddic/findSucDdics/shutdown_plan_mode'
  530 + , method: 'POST'
  531 + , async: false
  532 + }).done(function (res) {
  533 + let radioData=res.data;
  534 + let htmlRadio='';
  535 + if(radioData && radioData.length>0){
  536 + radioData.map(item=>{
  537 + htmlRadio+=`<input type="radio" data-sort="`+item.ddicSort+`" name="cutoverMode" lay-filter="shutdownplanMode" value="`+item.ddicSort+`" title="`+item.ddicName+`">`
  538 + })
  539 + }
  540 + $('#shutdownDdic').html(htmlRadio);
  541 + $('#shutdownDdic [data-sort]:first-child').attr("checked",true)
  542 + }).error(function (error) {
  543 + console.error(error);
  544 + });
  545 + //end lsq 2022-05-24
524 }, 546 },
525 yes: function (index, layero) { 547 yes: function (index, layero) {
526 $("#saveshutdownplanBtn").trigger("click"); 548 $("#saveshutdownplanBtn").trigger("click");
@@ -39,10 +39,7 @@ @@ -39,10 +39,7 @@
39 <div class="layui-form-item"> 39 <div class="layui-form-item">
40 <label class="layui-form-label" style="min-width: 120px!important;max-width: 120px!important;">停机模式<span 40 <label class="layui-form-label" style="min-width: 120px!important;max-width: 120px!important;">停机模式<span
41 style="color: red">*</span></label> 41 style="color: red">*</span></label>
42 - <div class="layui-input-block">  
43 - <input checked lay-filter="shutdownplanMode" name="cutoverMode" title="暂停告警" type="radio" value="1">  
44 - <input lay-filter="shutdownplanMode" name="cutoverMode" title="暂停采集" type="radio" value="2">  
45 - <input lay-filter="shutdownplanMode" name="cutoverMode" title="暂停通知" type="radio" value="3"> 42 + <div class="layui-input-block" id="shutdownDdic">
46 </div> 43 </div>
47 </div> 44 </div>
48 <div class="layui-form-item"> 45 <div class="layui-form-item">