<template>
  <div>
    <!-- <p>羊小咩相关数据清除</p> -->
    <el-card>
      手机号：<el-input v-model="clearParams.phoneNo" placeholder="请输入手机号" maxlength="11"></el-input>
      <el-button type="primary" icon="el-icon-brush" @click="clearYxmData">清除数据</el-button>
    </el-card>
  </div>
</template>

<script>
import { clearData } from '@/api/effect'
export default {
  data() {
    return {
      clearParams: {
        phoneNo: '',
        namespace: window.sessionStorage.getItem('env')
      }
    }
  },
  methods: {
    clearYxmData() {
      clearData(this.clearParams).then((resp) => {
        if (resp.data.data === true) {
          this.$message.success('数据清除成功！')
        } else {
          return this.$message.error('数据清除失败！')
        }
      }).catch((error) => {
        console.log(error)
        return this.$message.error('数据清除失败，请检查环境或是否正确！')
      })
    }
  }
}
</script>

<style lang="less" scoped>
.el-input {
  width: 200px;
  margin-right: 20px;
}
</style>
