Blame view

antis-ncc-admin/src/views/onlineDev/visualPortal/components/JSONArea.vue 1.11 KB
4aba9b59   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
  <template>
    <el-dialog title="数据设置" :close-on-click-modal="false" :visible.sync="visible"
      class="NCC-dialog NCC-dialog_center" lock-scroll width="600px" append-to-body>
      <JSONEditor v-model="responseData" class="preview" />
      <span slot="footer" class="dialog-footer">
        <el-button @click="visible = false">{{$t('common.cancelButton')}}</el-button>
        <el-button type="primary" @click="closeDialog()">{{$t('common.confirmButton')}}</el-button>
      </span>
    </el-dialog>
  </template>
  
  <script>
  import JSONEditor from '@/components/JsonEditor'
  
  export default {
    components: { JSONEditor },
    data() {
      return {
        visible: false,
        responseData: ''
      }
    },
    methods: {
      init(option) {
        this.visible = true
        this.responseData = option
      },
      closeDialog() {
        this.visible = false
        this.$emit('refresh', this.responseData)
      },
    }
  }
  </script>
  <style lang="scss" scoped>
  .NCC-dialog_center {
    >>> .el-dialog__body {
      padding-bottom: 20px !important;
    }
  }
  >>> .preview {
    border: 1px solid #dcdfe6;
  }
  >>> .json-editor {
    height: 430px;
    overflow: auto;
  }
  </style>