| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- <div v-loading="loading" class=" b_box" id="app">
- <div class="nav">
- 基础设置
- </div>
- <div class="form_setting_box">
- <el-form label-position="right" label-width="180px" :model="form">
- <el-form-item label="是否开启一键导入功能">
- <el-col :span="15">
- <el-switch v-model="form.is_export" :active-value="1" :inactive-value="0">
- </el-switch>
- </el-col>
- <br/>
- <div class="tips-text" style="line-height: 24px;">
- 配合表单单行文本组件使用,如开启,则会员可以一键导入单行文本内容
- </div>
- </el-form-item>
- <el-form-item label="是否开启协议">
- <el-col :span="15">
- <el-switch v-model="form.agree_on" :active-value="1" :inactive-value="0">
- </el-switch>
- </el-col>
- </el-form-item>
- </el-form>
- <div class="setting_form_brtn_box">
- <!-- <el-button size="small">取消</el-button> -->
- <el-button size="small" type="primary" style="margin-left: 20px;" @click="save">保存</el-button>
- </div>
- </div>
- </div>
- <script>
- new Vue({
- el: '#app',
- data() {
- return {
- loading: true,
- form: {
- is_export: 0,
- agree_on: 0
- }
- }
- },
- created() {
- this.getInfo()
- },
- methods: {
- getInfo() {
- request({
- params: {
- r: 'smart-form/setting/info'
- },
- method: 'GET',
- }).then(res => {
- this.loading = false;
- if (res.data.code == 0) {
- if (res.data.data != null) {
- this.form.is_export = res.data.data.is_export
- this.form.agree_on = res.data.data.agree_on
- }
- } else {
- this.$message.error(res.data.msg);
- }
- })
- },
- save() {
- this.loading = true
- request({
- params: {
- r: 'smart-form/setting/index'
- },
- data: {
- ...this.form
- },
- method: 'post',
- }).then(res => {
- if (res.data.code == 0) {
- this.$message.success(res.data.msg);
- this.getInfo()
- } else {
- this.$message.error(res.data.msg);
- }
- })
- }
- }
- })
- </script>
- <style>
- .setting_form_brtn_box {
- width: 100%;
- margin-top: 80px;
- padding: 0 50px;
- box-sizing: border-box;
- display: flex;
- align-items: center;
- }
- .b_box {
- min-height: 100vh;
- background: #f3f3f3;
- }
- .nav {
- background: #ffffff;
- border-radius: 5px;
- padding: 26px 24px;
- display: flex;
- align-items: center;
- justify-content: space-between;
- margin-bottom: 10px;
- }
- .form_setting_box {
- width: 100%;
- margin-top: 10px;
- background-color: #ffffff;
- border-radius: 8px;
- min-height: 300px;
- padding: 20px;
- box-sizing: border-box;
- }
- .set_label_ti {
- font-size: 14px;
- margin-left: 20px;
- }
- </style>
|