|
@@ -1,11 +1,30 @@
|
|
|
<template>
|
|
<template>
|
|
|
- <StatisticsTemplate
|
|
|
|
|
|
|
+
|
|
|
|
|
+<StatisticsTemplate
|
|
|
title="规则统计"
|
|
title="规则统计"
|
|
|
:list="state.forwardCount"
|
|
:list="state.forwardCount"
|
|
|
- />
|
|
|
|
|
|
|
+/>
|
|
|
|
|
+
|
|
|
<a-card style="margin-top: 20px;" >
|
|
<a-card style="margin-top: 20px;" >
|
|
|
<a-row justify="space-between" >
|
|
<a-row justify="space-between" >
|
|
|
<a-col :span="18" >
|
|
<a-col :span="18" >
|
|
|
|
|
+
|
|
|
|
|
+ </a-col>
|
|
|
|
|
+ <a-col>
|
|
|
|
|
+ <a-space>
|
|
|
|
|
+ <a-button type="primary" @click="search">搜索</a-button>
|
|
|
|
|
+ <a-button type="primary" @click="openModal('add', {})" >创建规则</a-button>
|
|
|
|
|
+ </a-space>
|
|
|
|
|
+
|
|
|
|
|
+ </a-col>
|
|
|
|
|
+ </a-row>
|
|
|
|
|
+ <table-pro
|
|
|
|
|
+ style="margin-top: 20px;"
|
|
|
|
|
+ :columns="columns"
|
|
|
|
|
+ :service="RuleController.pageForward"
|
|
|
|
|
+ :serviceParams="queryParams"
|
|
|
|
|
+ >
|
|
|
|
|
+ <template #search >
|
|
|
<a-row style="width: 100%" :gutter="[8,8]" >
|
|
<a-row style="width: 100%" :gutter="[8,8]" >
|
|
|
<a-col :xs="20" :md="12" :xl="5">
|
|
<a-col :xs="20" :md="12" :xl="5">
|
|
|
<a-input allowClear v-model:value="queryParams.ruleId" placeholder="请输入规则id"></a-input>
|
|
<a-input allowClear v-model:value="queryParams.ruleId" placeholder="请输入规则id"></a-input>
|
|
@@ -47,16 +66,43 @@
|
|
|
</a-select>
|
|
</a-select>
|
|
|
</a-col>
|
|
</a-col>
|
|
|
</a-row>
|
|
</a-row>
|
|
|
- </a-col>
|
|
|
|
|
- <a-col>
|
|
|
|
|
- <a-space>
|
|
|
|
|
- <a-button type="primary" @click="search">搜索</a-button>
|
|
|
|
|
- <a-button type="primary" @click="openModal('add', {})" >创建规则</a-button>
|
|
|
|
|
- </a-space>
|
|
|
|
|
-
|
|
|
|
|
- </a-col>
|
|
|
|
|
- </a-row>
|
|
|
|
|
- <a-table
|
|
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template #render="{column, record}" >
|
|
|
|
|
+ <template v-if="column.key === 'id'" >
|
|
|
|
|
+ <a @click="openDetailModal(record.id)">{{record.id}}</a>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-if="column.key === 'subjectResource'" >
|
|
|
|
|
+ <a-tag >{{RuleController.SubjectResourceMap.get(record.subjectResource)?.name}}</a-tag>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-if="column.key === 'subjectEvent'" >
|
|
|
|
|
+ <a-tag >{{RuleController.SubjectEventMap.get(record.subjectEvent)?.name}}</a-tag>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-if="column.key === 'status'" >
|
|
|
|
|
+ <a-switch
|
|
|
|
|
+ v-model:checked="record.status"
|
|
|
|
|
+ checked-children="运行中"
|
|
|
|
|
+ un-checked-children="已停止"
|
|
|
|
|
+ @click="changeStatus(record)"
|
|
|
|
|
+ />
|
|
|
|
|
+ </template>
|
|
|
|
|
+ <template v-if="column.key === 'action'" >
|
|
|
|
|
+ <a-space>
|
|
|
|
|
+ <a @click="openModalDebug(record.id)">调试</a>
|
|
|
|
|
+ <a @click="openDetailModal(record.id)">详情</a>
|
|
|
|
|
+ <a @click="openModal('update', record)">编辑</a>
|
|
|
|
|
+ <a-popconfirm
|
|
|
|
|
+ title="确实要删除吗?"
|
|
|
|
|
+ ok-text="确定"
|
|
|
|
|
+ cancel-text="取消"
|
|
|
|
|
+ @confirm="delForwardRule(record.id)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <a>删除</a>
|
|
|
|
|
+ </a-popconfirm>
|
|
|
|
|
+ </a-space>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </table-pro>
|
|
|
|
|
+ <!-- <a-table
|
|
|
style="margin-top: 20px;"
|
|
style="margin-top: 20px;"
|
|
|
:columns="columns"
|
|
:columns="columns"
|
|
|
:data-source="state.dataSource"
|
|
:data-source="state.dataSource"
|
|
@@ -98,7 +144,7 @@
|
|
|
</a-space>
|
|
</a-space>
|
|
|
</template>
|
|
</template>
|
|
|
</template>
|
|
</template>
|
|
|
- </a-table>
|
|
|
|
|
|
|
+ </a-table> -->
|
|
|
</a-card>
|
|
</a-card>
|
|
|
|
|
|
|
|
<!-- 创建规则 -->
|
|
<!-- 创建规则 -->
|
|
@@ -187,9 +233,6 @@
|
|
|
</a-table>
|
|
</a-table>
|
|
|
<a-empty v-else :image="Empty.PRESENTED_IMAGE_SIMPLE" />
|
|
<a-empty v-else :image="Empty.PRESENTED_IMAGE_SIMPLE" />
|
|
|
</div>
|
|
</div>
|
|
|
- <!-- <div v-if="state.stepCount == 2" >
|
|
|
|
|
- <a-button @click="addForwardRule" >启动规则</a-button>
|
|
|
|
|
- </div> -->
|
|
|
|
|
</modal-pro>
|
|
</modal-pro>
|
|
|
|
|
|
|
|
<modal-pro
|
|
<modal-pro
|
|
@@ -429,7 +472,6 @@
|
|
|
<script lang='ts' setup >
|
|
<script lang='ts' setup >
|
|
|
import { onMounted, reactive, ref } from 'vue'
|
|
import { onMounted, reactive, ref } from 'vue'
|
|
|
import { RuleController } from '@/controller/index'
|
|
import { RuleController } from '@/controller/index'
|
|
|
-import type { FormItemProps } from '@/components/FormPro/index.vue'
|
|
|
|
|
import { Form, Empty, message } from 'ant-design-vue'
|
|
import { Form, Empty, message } from 'ant-design-vue'
|
|
|
import { computed } from '@vue/reactivity'
|
|
import { computed } from '@vue/reactivity'
|
|
|
import TestDialog from './components/testDialog.vue'
|
|
import TestDialog from './components/testDialog.vue'
|
|
@@ -568,9 +610,6 @@ const formProo = ref('')
|
|
|
const testDialogRef = ref('')
|
|
const testDialogRef = ref('')
|
|
|
|
|
|
|
|
let queryParams = reactive({
|
|
let queryParams = reactive({
|
|
|
- page: 1,
|
|
|
|
|
- pageSize: 10,
|
|
|
|
|
- total: 0,
|
|
|
|
|
ruleId: '',
|
|
ruleId: '',
|
|
|
ruleLabel: '',
|
|
ruleLabel: '',
|
|
|
status: '',
|
|
status: '',
|