|
|
@@ -32,6 +32,7 @@
|
|
|
</template>
|
|
|
<template v-if="column.key === 'action'" >
|
|
|
<a-space>
|
|
|
+ <a @click="openModal('preview', record)" >详情</a>
|
|
|
<a @click="openModal('update', record)" >编辑</a>
|
|
|
<a-popconfirm
|
|
|
title="确实要删除吗?"
|
|
|
@@ -49,7 +50,7 @@
|
|
|
|
|
|
<modal-pro
|
|
|
style="width: 1400px;"
|
|
|
- label="创建转发规则"
|
|
|
+ :label=" state.opraState !== 'preview' ? '创建转发规则' : '查看详情'"
|
|
|
:visible="state.visible"
|
|
|
@cancel="state.visible = false"
|
|
|
@ok="ok"
|
|
|
@@ -61,22 +62,19 @@
|
|
|
>
|
|
|
<a-form :labelCol="{span: 2}" :wapperCol="{span: 12}" >
|
|
|
<a-form-item label="规则名称" v-bind="validateInfos.ruleLabel">
|
|
|
- <a-input v-model:value="bodyParamsState.ruleLabel" ></a-input>
|
|
|
+ <span v-if=" state.opraState === 'preview'" >{{bodyParamsState.ruleLabel}}</span>
|
|
|
+ <a-input v-else v-model:value="bodyParamsState.ruleLabel" ></a-input>
|
|
|
</a-form-item >
|
|
|
<a-form-item label='规则描述'>
|
|
|
+ <span v-if=" state.opraState === 'preview'" >{{bodyParamsState.ruleDescription}}</span>
|
|
|
<a-textarea
|
|
|
+ v-else
|
|
|
v-model:value="bodyParamsState.ruleDescription"
|
|
|
placeholder="请输入规则描述"
|
|
|
:auto-size="{ minRows: 2, maxRows: 5 }"
|
|
|
/>
|
|
|
</a-form-item>
|
|
|
</a-form>
|
|
|
-
|
|
|
- <!-- <form-pro
|
|
|
- :labelCol="{span: 2}"
|
|
|
- :formProps="formProps"
|
|
|
- ref="formProRef"
|
|
|
- /> -->
|
|
|
</a-card>
|
|
|
<a-card
|
|
|
title="触发条件"
|
|
|
@@ -85,7 +83,8 @@
|
|
|
<a-row class="condition" >
|
|
|
<a-col span="12" >
|
|
|
需满足
|
|
|
- <a-dropdown >
|
|
|
+ <span v-if="state.opraState === 'preview'">{{bodyParamsState.conditionLogic}}</span>
|
|
|
+ <a-dropdown v-else>
|
|
|
<a class="ant-dropdown-link" @click.prevent>
|
|
|
{{bodyParamsState.conditionLogic === 'AND' ? '全部' : '任意一个'}}
|
|
|
<DownOutlined />
|
|
|
@@ -104,12 +103,12 @@
|
|
|
以下条件:
|
|
|
</a-col>
|
|
|
<a-col class="df" span="12" >
|
|
|
- <a-button type="primary" @click="openFormVisible('conditions')">添加条件</a-button>
|
|
|
+ <a-button v-if="state.opraState !== 'preview'" type="primary" @click="openFormVisible('conditions')">添加条件</a-button>
|
|
|
</a-col>
|
|
|
<a-col :span="24" v-if="deviceDataSource.length" >
|
|
|
<a-table
|
|
|
style="width: 100%;margin-top: 10px;"
|
|
|
- :columns="conditionColumns.DEVICE_DATA"
|
|
|
+ :columns="state.opraState !== 'preview' ? conditionColumns.DEVICE_DATA : conditionColumns.DEVICE_DATA.slice(0, conditionColumns.DEVICE_DATA.length - 1)"
|
|
|
:data-source="deviceDataSource"
|
|
|
size="small"
|
|
|
:pagination="false"
|
|
|
@@ -126,7 +125,7 @@
|
|
|
<a-col :span="24" v-if="deviceSessionSource.length" >
|
|
|
<a-table
|
|
|
style="width: 100%;margin-top: 10px;"
|
|
|
- :columns="conditionColumns.DEVICE_SESSION"
|
|
|
+ :columns="state.opraState !== 'preview' ? conditionColumns.DEVICE_SESSION : conditionColumns.DEVICE_SESSION.slice(0, conditionColumns.DEVICE_SESSION.length - 1)"
|
|
|
:data-source="deviceSessionSource"
|
|
|
size="small"
|
|
|
:pagination="false"
|
|
|
@@ -146,7 +145,7 @@
|
|
|
<a-col :span="24" v-if="dailyTimerSource.length" >
|
|
|
<a-table
|
|
|
style="width: 100%;margin-top: 10px;"
|
|
|
- :columns="conditionColumns.DAILY_TIMER"
|
|
|
+ :columns="state.opraState !== 'preview' ? conditionColumns.DAILY_TIMER : conditionColumns.DAILY_TIMER.slice(0, conditionColumns.DAILY_TIMER.length - 1)"
|
|
|
:data-source="dailyTimerSource"
|
|
|
size="small"
|
|
|
:pagination="false"
|
|
|
@@ -174,12 +173,12 @@
|
|
|
:bordered="false"
|
|
|
>
|
|
|
<a-row style="width: 100%;" >
|
|
|
- <a-col :span="24" class="df" ><a-button type="primary" @click="openFormVisible('actions')" >添加动作</a-button></a-col>
|
|
|
+ <a-col :span="24" class="df" ><a-button v-if="state.opraState !== 'preview'" type="primary" @click="openFormVisible('actions')" >添加动作</a-button></a-col>
|
|
|
<a-row style="width: 100%;" v-if="bodyParamsState.actions.length">
|
|
|
<a-col :span="24" v-if="deviceCmdsource.length" >
|
|
|
<a-table
|
|
|
style="width: 100%;margin-top: 10px;"
|
|
|
- :columns="actionsColumns.DEVICE_CMD"
|
|
|
+ :columns="state.opraState !== 'preview' ? actionsColumns.DEVICE_CMD : actionsColumns.DEVICE_CMD.slice(0, actionsColumns.DEVICE_CMD.length - 1)"
|
|
|
:data-source="deviceCmdsource"
|
|
|
size="small"
|
|
|
:pagination="false"
|
|
|
@@ -196,7 +195,7 @@
|
|
|
<a-col :span="24" v-if="reportWarnSource.length" >
|
|
|
<a-table
|
|
|
style="width: 100%;margin-top: 10px;"
|
|
|
- :columns="actionsColumns.REPORT_WARN"
|
|
|
+ :columns="state.opraState !== 'preview' ? actionsColumns.REPORT_WARN : actionsColumns.REPORT_WARN.slice(0, actionsColumns.REPORT_WARN.length - 1)"
|
|
|
:data-source="reportWarnSource"
|
|
|
size="small"
|
|
|
:pagination="false"
|
|
|
@@ -213,7 +212,7 @@
|
|
|
<a-col :span="24" v-if="resumeWarnSource.length" >
|
|
|
<a-table
|
|
|
style="width: 100%;margin-top: 10px;"
|
|
|
- :columns="actionsColumns.RESUME_WARN"
|
|
|
+ :columns="state.opraState !== 'preview' ? actionsColumns.RESUME_WARN : actionsColumns.RESUME_WARN.slice(0, actionsColumns.RESUME_WARN.length - 1)"
|
|
|
:data-source="resumeWarnSource"
|
|
|
size="small"
|
|
|
:pagination="false"
|
|
|
@@ -230,7 +229,7 @@
|
|
|
<a-col :span="24" v-if="noticeSource.length" >
|
|
|
<a-table
|
|
|
style="width: 100%;margin-top: 10px;"
|
|
|
- :columns="actionsColumns.NOTICE"
|
|
|
+ :columns="state.opraState !== 'preview' ? actionsColumns.NOTICE : actionsColumns.NOTICE.slice(0, actionsColumns.NOTICE.length - 1)"
|
|
|
:data-source="noticeSource"
|
|
|
size="small"
|
|
|
:pagination="false"
|
|
|
@@ -932,7 +931,13 @@ const { resetFields, validate, validateInfos } = useForm(bodyParamsState, {
|
|
|
ruleLabel: [{ required: true, message: '请填写联动规则名称' }]
|
|
|
})
|
|
|
|
|
|
-const openModal = (_opraState: 'add' | 'update', record: any) => {
|
|
|
+const changeStatus = async (record) => RuleController.updateLinkStatus({ id: record.id, status: record.status })
|
|
|
+
|
|
|
+const changeConditionLogic = (record: string) => {
|
|
|
+ bodyParamsState.conditionLogic = record
|
|
|
+}
|
|
|
+
|
|
|
+const openModal = (_opraState: 'add' | 'update' | 'preview', record: any) => {
|
|
|
state.visible = true
|
|
|
state.opraState = _opraState
|
|
|
getLinkPageById(record.id)
|
|
|
@@ -962,6 +967,11 @@ const ok = async () => {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+const delLinkRule = async (id: string) => {
|
|
|
+ await RuleController.delLink(id)
|
|
|
+ getLinkPage()
|
|
|
+}
|
|
|
+
|
|
|
// 选择设备
|
|
|
const selectDevice = () => {
|
|
|
const _device = selectDeviceRef.value.getSelectDevice()
|