Blame view

antis-ncc-admin/src/views/system/cache/Form.vue 1.7 KB
03207d5d   wwk   1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
  <template>
    <transition name="el-zoom-in-center">
      <div class="NCC-preview-main">
        <div class="NCC-common-page-header">
          <el-page-header @back="goBack" content="查看缓存" />
          <div class="options">
            <el-button @click="goBack()">{{$t('common.cancelButton')}}</el-button>
          </div>
        </div>
        <el-form ref="dataForm" :model="dataForm" label-width="100px" class="main">
          <el-form-item label="STRING" prop="name">
            <el-input v-model="dataForm.name" placeholder="STRING" />
          </el-form-item>
          <el-form-item label="VALUE" prop="value" class="value-item">
            <el-input v-model="dataForm.value" placeholder="VALUE" type="textarea" :rows="30" />
          </el-form-item>
        </el-form>
      </div>
    </transition>
  </template>
  
  <script>
  import { CacheManageInfo } from '@/api/system/cacheManage'
  
  export default {
    data() {
      return {
        visible: false,
        dataForm: {
          name: '',
          value: '',
        }
      }
    },
    methods: {
      init(id) {
        this.dataForm.name = id || ''
        this.visible = true
        this.$nextTick(() => {
          if (this.dataForm.name) {
            CacheManageInfo(this.dataForm.name).then(res => {
              this.dataForm = res.data
            }).catch(() => {
              this.visible = false
            })
          }
        })
      },
      goBack() {
        this.$emit('close')
      }
    }
  }
  </script>
  <style lang="scss" scoped>
  .main {
    display: flex;
    flex-direction: column;
    .value-item {
      flex: 1;
      margin-bottom: 0;
      >>> .el-form-item__content {
        height: 100%;
        .el-textarea {
          height: 100%;
          .el-textarea__inner {
            height: 100%;
          }
        }
      }
    }
  }
  </style>