<!-- 模板区域 -->
<template>
  <div class="app-container">
    <el-card shadow="always">
      <el-form :model="formInline" label-width="120px">
        <el-form-item label="广告间隔时/秒">
          <el-input v-model="formInline.adInterval" placeholder="广告间隔时/秒" style="width: 400px;"></el-input>
        </el-form-item>
        <el-form-item label="广告每日上限/次">
          <el-input v-model="formInline.dailyAdLimit" placeholder="广告每日上限/次" style="width: 400px;"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="submit">保存</el-button>
        </el-form-item>
      </el-form>
    </el-card>
    <!-- 模板内容 -->
  </div>
</template>

<!-- 行为区域 -->
<script>
import adAgencyApi from "@/api/advertisement/adAgency";
export default {
  // 数据存放区域
  data() {
    return {
      formInline: {

      },
    }
  },
  // 生命周期函数
  created() {
    this.marketconfig();
  },
  // 方法函数
  methods: {
    submit() {
      adAgencyApi.marketConfigUpdate(this.formInline).then(res => {
          if (res.code == '200') {
            this.marketconfig();
            this.$message({
              type: 'success',
              message: res.msg,
            });
          } else {
            this.$message({
              type: 'error',
              message: res.msg,
            });
          }
      })
    },
    marketconfig() {
      adAgencyApi.marketConfigList().then(res => {
        this.formInline = res.data[0];
      })
    },
  },
  // 计算属性
  computed: {
  }
}
</script>
<!-- 样式区域 -->
<style lang='scss' scoped></style>

