MatchFieldKey.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <div>
  3. <!-- 匹配字段 -->
  4. <a-form-item :label="matchFieldKeyLabel || $t('network_waf_statement.label.match_field_key')" v-bind="formLayout">
  5. <a-input v-if="isEdit" :value="value" />
  6. <box-show v-else :value="value" />
  7. </a-form-item>
  8. </div>
  9. </template>
  10. <script>
  11. import WafMixin from '../../mixins/waf'
  12. import BoxShow from './BoxShow.vue'
  13. import WindowsMixin from '@/mixins/windows'
  14. export default {
  15. name: 'MatchFieldKeyStatement',
  16. components: { BoxShow },
  17. mixins: [WindowsMixin, WafMixin],
  18. props: {
  19. type: String,
  20. label: String,
  21. value: String,
  22. isEdit: Boolean,
  23. matchField: String,
  24. },
  25. data () {
  26. return {
  27. formLayout: {
  28. wrapperCol: {
  29. span: 20,
  30. },
  31. labelCol: {
  32. span: 4,
  33. },
  34. },
  35. matchFieldList: [
  36. { label: this.$t('network_waf_statement.match_field_key.Header'), value: 'Header' },
  37. { label: this.$t('network_waf_statement.match_field_key.PostArgs'), value: 'PostArgs' },
  38. { label: this.$t('network_waf_statement.match_field_key.Cookie'), value: 'Cookie' },
  39. // { label: this.$t('network_waf_statement.match_field_key.RemoteAddr'), value: 'RemoteAddr' },
  40. ],
  41. }
  42. },
  43. computed: {
  44. matchFieldKeyLabel () {
  45. if (this.label) return this.label
  46. const matchFieldKey = this.matchFieldList.filter(item => item.value === this.matchField)
  47. if (matchFieldKey && matchFieldKey.length) {
  48. return matchFieldKey[0].label
  49. }
  50. return ''
  51. },
  52. },
  53. watch: {
  54. },
  55. created () {
  56. },
  57. methods: {
  58. },
  59. }
  60. </script>