RuleGroupStatement.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <template>
  2. <div>
  3. <!-- 规则组名称 -->
  4. <a-form-item :label="$t('network_waf_statement.label.rule_group_name')" v-bind="formLayout">
  5. <a-input v-if="isEdit" :value="value" />
  6. <box-show v-else :value="value" />
  7. </a-form-item>
  8. <!-- 规则组子项 -->
  9. </div>
  10. </template>
  11. <script>
  12. import WafMixin from '../../mixins/waf'
  13. import BoxShow from './BoxShow.vue'
  14. // import { uuid } from '@/utils/utils'
  15. import WindowsMixin from '@/mixins/windows'
  16. export default {
  17. name: 'RuleGroupStatement',
  18. components: { BoxShow },
  19. mixins: [WindowsMixin, WafMixin],
  20. props: {
  21. type: String,
  22. value: String,
  23. isEdit: Boolean,
  24. ruleGroupId: String,
  25. },
  26. data () {
  27. return {
  28. formLayout: {
  29. wrapperCol: {
  30. span: 20,
  31. },
  32. labelCol: {
  33. span: 4,
  34. },
  35. },
  36. }
  37. },
  38. computed: {
  39. },
  40. watch: {
  41. },
  42. created () {
  43. // this.initData()
  44. },
  45. methods: {
  46. initData () {
  47. if (this.ruleGroupId) {
  48. this.getRuleGroup()
  49. }
  50. },
  51. async getRuleGroup () {
  52. try {
  53. // 获取规则组中的子项
  54. // const ruleGroup = await new this.$Manager('waf_rules', 'v2').list({ params: { $t: uuid(), waf_rule_group_id: this.ruleGroupId } })
  55. // console.log('规则组', ruleGroup)
  56. } catch (err) { throw err }
  57. },
  58. },
  59. }
  60. </script>