ManagedRuleGroupStatement.vue 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <template>
  2. <div>
  3. <!-- 管理规则组名称 -->
  4. <a-form-item :label="$t('network_waf_statement.label.managed_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'
  14. // import { uuid } from '@/utils/utils'
  15. import WindowsMixin from '@/mixins/windows'
  16. export default {
  17. name: 'ManagedRuleGroupStatement',
  18. components: {
  19. BoxShow,
  20. },
  21. mixins: [WindowsMixin, WafMixin],
  22. props: {
  23. type: String,
  24. value: String,
  25. isEdit: Boolean,
  26. ruleGroupId: String,
  27. },
  28. data () {
  29. return {
  30. formLayout: {
  31. wrapperCol: {
  32. span: 20,
  33. },
  34. labelCol: {
  35. span: 4,
  36. },
  37. },
  38. }
  39. },
  40. computed: {
  41. },
  42. watch: {
  43. },
  44. created () {
  45. // this.initData()
  46. },
  47. methods: {
  48. initData () {
  49. if (this.ruleGroupId) {
  50. this.getRuleGroup()
  51. }
  52. },
  53. async getRuleGroup () {
  54. try {
  55. // 获取管理规则组中的子项
  56. // const ruleGroup = await new this.$Manager('waf_rules', 'v2').list({ params: { $t: uuid(), filter: `waf_rule_group_id.in(${[this.ruleGroupId]})` } })
  57. // console.log('规则组', ruleGroup)
  58. // const { id } = ruleGroup
  59. // if (!id) return
  60. // const rules = await new this.$Manager('')
  61. } catch (err) { throw err }
  62. },
  63. },
  64. }
  65. </script>