123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>互助委托书校验配置</title>
- <link rel="stylesheet" href="https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css">
- <link rel="stylesheet" href="../../static/sa.css">
- <script src="../../static/kj/vue.min.js"></script>
- <script src="../../static/kj/element-ui/index.js"></script>
- <script src="../../static/kj/httpVueLoader.js"></script>
- <script src="../../static/kj/jquery.min.js"></script>
- <script src="../../static/kj/layer/layer.js"></script>
- <script src="../../static/sa.js"></script>
- <script src="../../static/kj/upload-util.js"></script>
- <style type="text/css">
- html,body,.vue-box{height: 100%; overflow: hidden;}
- .c-panel{height: calc(100% - 4em); position: relative;}
- .c-panel .c-label{width: 16em;}
- .c-panel .el-input{width: 500px;}
- .c-panel .el-textarea{width: 500px;}
- .logo-img{
- width: 35px;
- height: 35px;
- border-radius: 2px;
- vertical-align: middle;
- margin-right: 0.5em;
- cursor: pointer;
- }
- .s-tab{height: 100%; }
- .el-tabs__content{height: calc(100% - 130px); overflow: auto;}
- </style>
- </head>
- <body>
- <div class="vue-box" style="display: none;" :style="'display: block;'">
- <div class="c-panel" v-if="m != null">
- <!-- tab卡片 -->
- <el-tabs class="s-tab" v-model="activeTab">
- <!-- ---------------------------------- 系统参数 ---------------------------------- -->
- <el-tab-pane label="系统参数" name="tab1">
- <div class="c-item">
- <label class="c-label">是否打开校验互助委托书开关</label>
- <el-switch v-model="m.cooper_entrust" :active-value="1" :inactive-value="2"></el-switch>
- <span class="c-remark" v-if="m.cooper_entrust==1">开启校验</span>
- <span class="c-remark" v-else>关闭校验</span>
- </div>
- </el-tab-pane>
- </el-tabs>
- <!-- 确定按钮 -->
- <div style="position: absolute; bottom: 0px; width: calc(100% - 3em); line-height: 80px; background-color: #FFF;">
- <hr style="height: 2px;">
- <div class="c-item">
- <label class="c-label"></label>
- <el-button type="primary" icon="el-icon-check" @click="ok">保存修改</el-button>
- <el-button type="primary" icon="el-icon-refresh-right" @click="f5">重置</el-button>
- </div>
- </div>
- </div>
- </div>
- <script type="text/javascript">
- // 创建一个默认的配置对象
- function create_m() {
- return {
- cooper_entrust: 2, // 是否校验互助委托书【1校验 2不校验】
- }
- }
- </script>
- <script>
- var app = new Vue({
- el: '.vue-box',
- data: {
- sa: sa, // 超级对象
- m: null, //
- activeTab: 'tab1'
- },
- methods: {
- // 初始化配置
- init: function(str) {
- // 获取
- var cfg = sa.JSONParse(str, {}); // 用户配置
- var default_cfg = create_m(); // 默认配置
- // 遍历
- for (var key in default_cfg) {
- if (cfg[key] !== undefined && cfg[key] !== null) {
- default_cfg[key] = cfg[key];
- }
- }
- // 赋值
- this.m = default_cfg;
- },
- // 刷新
- f5: function() {
- sa.ajax('/sp-admin/SpCfg/getCfg', {
- cfgName: 'cooper_entrust_cfg'
- }, function(res) {
- this.init(res.data);
- }.bind(this));
- },
- // 提交
- ok: function() {
- sa.ajax('/sp-admin/SpCfg/updateCfg', {
- cfgName: 'cooper_entrust_cfg',
- cfgValue: JSON.stringify(this.m)
- }, function(res) {
- sa.ok2('保存成功');
- }.bind(this));
- }
- },
- created: function() {
- this.f5();
- }
- })
- </script>
- </body>
- </html>
|