自动化立体仓库 - WMS系统
luxiaotao1123
2020-08-01 1ef6817089e2095b2cff7667740330d27ca3d68e
src/main/webapp/static/layuiadmin/lib/admin.js
@@ -377,13 +377,14 @@
      });
    }
    
    //便签
    //秘钥
    ,note: function(othis){
      var mobile = admin.screen() < 2
      ,note = layui.data(setter.tableName).note;
      
      events.note.index = admin.popup({
        title: '便签'
        title: 'WMS 秘钥'
        // title: 'license'
        ,shade: 0
        ,offset: [
          '41px'
@@ -394,16 +395,40 @@
        ,skin: 'layadmin-note layui-anim layui-anim-upbit'
        ,content: '<textarea placeholder="内容"></textarea>'
        ,resize: false
        ,btn: ['添加', '取消']
        ,success: function(layero, index){
          var textarea = layero.find('textarea')
          ,value = note === undefined ? '便签中的内容会存储在本地,这样即便你关掉了浏览器,在下次打开时,依然会读取到上一次的记录。是个非常小巧实用的本地备忘录' : note;
          ,value = note === undefined ? '' : note;
          
          textarea.val(value).focus().on('keyup', function(){
            layui.data(setter.tableName, {
              key: 'note'
              ,value: this.value
          // textarea.val(value).focus().on('keyup', function(){
          //   layui.data(setter.tableName, {
          //     key: 'note'
          //     ,value: this.value
          //   });
          // });
        }
        ,yes: function(index, layero){
          $.ajax({
            url: baseUrl+"/system/secret/auth",
            headers: {'token': localStorage.getItem('token')},
            data: "secret="+note,
            dataType:'json',
            method: 'POST',
            success: function (res) {
              console.log(note)
              if (res.code === 200) {
                layer.msg(res.msg)
              } else if (res.code === 403) {
                top.location.href = baseUrl+"/login";
              } else {
                layer.msg(res.msg)
              }
            }
            });
          });
          layer.close(index);
        }
        ,btn2: function(index, layero){
          layer.close(index);
        }
      })
    }