cooper_entrust-cfg.html 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <title>互助委托书校验配置</title>
  6. <link rel="stylesheet" href="https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css">
  7. <link rel="stylesheet" href="../../static/sa.css">
  8. <script src="../../static/kj/vue.min.js"></script>
  9. <script src="../../static/kj/element-ui/index.js"></script>
  10. <script src="../../static/kj/httpVueLoader.js"></script>
  11. <script src="../../static/kj/jquery.min.js"></script>
  12. <script src="../../static/kj/layer/layer.js"></script>
  13. <script src="../../static/sa.js"></script>
  14. <script src="../../static/kj/upload-util.js"></script>
  15. <style type="text/css">
  16. html,body,.vue-box{height: 100%; overflow: hidden;}
  17. .c-panel{height: calc(100% - 4em); position: relative;}
  18. .c-panel .c-label{width: 16em;}
  19. .c-panel .el-input{width: 500px;}
  20. .c-panel .el-textarea{width: 500px;}
  21. .logo-img{
  22. width: 35px;
  23. height: 35px;
  24. border-radius: 2px;
  25. vertical-align: middle;
  26. margin-right: 0.5em;
  27. cursor: pointer;
  28. }
  29. .s-tab{height: 100%; }
  30. .el-tabs__content{height: calc(100% - 130px); overflow: auto;}
  31. </style>
  32. </head>
  33. <body>
  34. <div class="vue-box" style="display: none;" :style="'display: block;'">
  35. <div class="c-panel" v-if="m != null">
  36. <!-- tab卡片 -->
  37. <el-tabs class="s-tab" v-model="activeTab">
  38. <!-- ---------------------------------- 系统参数 ---------------------------------- -->
  39. <el-tab-pane label="系统参数" name="tab1">
  40. <div class="c-item">
  41. <label class="c-label">是否打开校验互助委托书开关</label>
  42. <el-switch v-model="m.cooper_entrust" :active-value="1" :inactive-value="2"></el-switch>
  43. <span class="c-remark" v-if="m.cooper_entrust==1">开启校验</span>
  44. <span class="c-remark" v-else>关闭校验</span>
  45. </div>
  46. </el-tab-pane>
  47. </el-tabs>
  48. <!-- 确定按钮 -->
  49. <div style="position: absolute; bottom: 0px; width: calc(100% - 3em); line-height: 80px; background-color: #FFF;">
  50. <hr style="height: 2px;">
  51. <div class="c-item">
  52. <label class="c-label"></label>
  53. <el-button type="primary" icon="el-icon-check" @click="ok">保存修改</el-button>
  54. <el-button type="primary" icon="el-icon-refresh-right" @click="f5">重置</el-button>
  55. </div>
  56. </div>
  57. </div>
  58. </div>
  59. <script type="text/javascript">
  60. // 创建一个默认的配置对象
  61. function create_m() {
  62. return {
  63. cooper_entrust: 2, // 是否校验互助委托书【1校验 2不校验】
  64. }
  65. }
  66. </script>
  67. <script>
  68. var app = new Vue({
  69. el: '.vue-box',
  70. data: {
  71. sa: sa, // 超级对象
  72. m: null, //
  73. activeTab: 'tab1'
  74. },
  75. methods: {
  76. // 初始化配置
  77. init: function(str) {
  78. // 获取
  79. var cfg = sa.JSONParse(str, {}); // 用户配置
  80. var default_cfg = create_m(); // 默认配置
  81. // 遍历
  82. for (var key in default_cfg) {
  83. if (cfg[key] !== undefined && cfg[key] !== null) {
  84. default_cfg[key] = cfg[key];
  85. }
  86. }
  87. // 赋值
  88. this.m = default_cfg;
  89. },
  90. // 刷新
  91. f5: function() {
  92. sa.ajax('/sp-admin/SpCfg/getCfg', {
  93. cfgName: 'cooper_entrust_cfg'
  94. }, function(res) {
  95. this.init(res.data);
  96. }.bind(this));
  97. },
  98. // 提交
  99. ok: function() {
  100. sa.ajax('/sp-admin/SpCfg/updateCfg', {
  101. cfgName: 'cooper_entrust_cfg',
  102. cfgValue: JSON.stringify(this.m)
  103. }, function(res) {
  104. sa.ok2('保存成功');
  105. }.bind(this));
  106. }
  107. },
  108. created: function() {
  109. this.f5();
  110. }
  111. })
  112. </script>
  113. </body>
  114. </html>