server-cfg.html 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <title>服务器私有配置</title>
  6. <!-- 所有的 css js 资源 -->
  7. <link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
  8. <link rel="stylesheet" href="../../static/sa.css">
  9. <script src="../../static/kj/vue.min.js"></script>
  10. <script src="../../static/kj/element-ui/index.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,
  17. body,
  18. .vue-box {
  19. height: 100%;
  20. overflow: hidden;
  21. }
  22. /* .vue-box{padding: 0px;} */
  23. .c-panel {
  24. height: calc(100% - 4em);
  25. position: relative;
  26. }
  27. .c-panel .c-label {
  28. width: 10em;
  29. }
  30. .c-panel .el-input {
  31. width: 500px;
  32. }
  33. .c-panel .el-textarea {
  34. width: 500px;
  35. }
  36. .logo-img {
  37. width: 35px;
  38. height: 35px;
  39. border-radius: 2px;
  40. vertical-align: middle;
  41. margin-right: 0.5em;
  42. cursor: pointer;
  43. }
  44. .s-tab {
  45. height: 100%;
  46. }
  47. .el-tabs__content {
  48. height: calc(100% - 130px);
  49. overflow: auto;
  50. }
  51. /* 让头像样式小一点 */
  52. .c-item-mline {
  53. width: 600px;
  54. }
  55. .c-item-mline .image-box-2 {
  56. width: 60px;
  57. height: 100px;
  58. }
  59. .c-item-mline .image-box-2 img {
  60. width: 60px;
  61. height: 60px;
  62. }
  63. .c-item-mline .image-box-2.up_img {
  64. height: 60px;
  65. }
  66. .c-item-mline .image-box-2.up_img img {
  67. margin: 15px;
  68. width: 30px;
  69. height: 30px;
  70. }
  71. .item-num .el-input__inner {
  72. width: 130px;
  73. }
  74. </style>
  75. </head>
  76. <body>
  77. <div class="vue-box" style="display: none;" :style="'display: block;'">
  78. <div class="c-panel" v-if="m != null">
  79. <el-tabs class="s-tab" v-model="activeTab">
  80. <!-- ---------------------------------- 系统参数 ---------------------------------- -->
  81. <el-tab-pane label="参数设置" name="tab1">
  82. <sa-item type="enum" name="设备端备案" v-model="m.termianlFilling" :jv="{1: '允许', 0: '禁止'}" jtype="1"
  83. br>
  84. </sa-item>
  85. <sa-item type="enum" name="行程卡限制" v-model="m.tourLimit" :jv="{1: '开启', 0: '关闭'}" jtype="1">
  86. </sa-item><span>开启:近期去过中高风险区不予开闸;关闭:不限制</span>
  87. <br />
  88. <div class="c-item">
  89. <label class="c-label">
  90. 核酸时效(小时内):</label>
  91. <el-input-number step-strictly :step="24" class="item-num" v-model="m.acidLimit" :min="0"
  92. :max="72" size="mini">
  93. </el-input-number>
  94. <span style="margin-left: 10px;">0表示不限制</span>
  95. </div>
  96. <br />
  97. <sa-item type="enum" name="核酸校验模式" v-model="m.verifyMode" :jv="{0: '不校验', 1: '高中风险地区', 2: '高中低风险地区'}" jtype="1">
  98. </sa-item>
  99. <br />
  100. <div class="c-item">
  101. <label class="c-label">
  102. 体温阈值(℃):</label>
  103. <el-input-number class="item-num" v-model="m.minTemperature" :min="1" size="mini">
  104. </el-input-number>
  105. <span style="margin-left: 10px;">大于此阈值不予开闸</span>
  106. </div>
  107. <sa-item type="enum" name="是否发送预警通知" v-model="m.sendAlarm" :jv="{1: '发送', 0: '不发送'}" jtype="1"
  108. br>
  109. </sa-item>
  110. <sa-item name="短信签名" v-model="m.smsSign" br>
  111. </sa-item>
  112. </el-tab-pane>
  113. </el-tabs>
  114. <div
  115. style="position: absolute; bottom: 0px; width: calc(100% - 3em); line-height: 80px; background-color: #FFF;">
  116. <hr style="height: 2px;">
  117. <div class="c-item">
  118. <label class="c-label"></label>
  119. <el-button type="primary" icon="el-icon-check" @click="ok">保存修改</el-button>
  120. <el-button type="primary" icon="el-icon-refresh-right" @click="f5">重置</el-button>
  121. </div>
  122. </div>
  123. </div>
  124. </div>
  125. <script type="text/javascript">
  126. // 创建一个默认的配置对象
  127. function create_m() {
  128. return {
  129. termianlFilling: 1,
  130. minTemperature: 37.0,
  131. tourLimit: 1,
  132. verifyMode:0,
  133. acidLimit: 24,
  134. sendAlarm: 1, // 新用户默认头像
  135. smsSign: '钦州码头智慧湾卡口智能防疫系统'
  136. }
  137. }
  138. </script>
  139. <script>
  140. var app = new Vue({
  141. components: {
  142. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  143. },
  144. el: '.vue-box',
  145. data: {
  146. sa: sa, // 超级对象
  147. m: null, //
  148. activeTab: 'tab1'
  149. },
  150. methods: {
  151. // 初始化配置
  152. init: function(str) {
  153. // 获取
  154. var cfg = sa.JSONParse(str, {}); // 用户配置
  155. var default_cfg = create_m(); // 默认配置
  156. // 遍历
  157. for (var key in default_cfg) {
  158. if (cfg[key] !== undefined && cfg[key] !== null) {
  159. default_cfg[key] = cfg[key];
  160. }
  161. }
  162. // 赋值
  163. this.m = default_cfg;
  164. },
  165. // 刷新
  166. f5: function() {
  167. sa.ajax('/SpCfg/getCfg', {
  168. cfgName: 'server_cfg'
  169. }, function(res) {
  170. this.init(res.data);
  171. }.bind(this));
  172. },
  173. // 提交
  174. ok: function() {
  175. sa.ajax('/SpCfg/updateCfg', {
  176. cfgName: 'server_cfg',
  177. cfgValue: JSON.stringify(this.m)
  178. }, function(res) {
  179. sa.ok2('保存成功');
  180. }.bind(this));
  181. }
  182. },
  183. created: function() {
  184. this.f5();
  185. }
  186. })
  187. </script>
  188. </body>
  189. </html>