fix: 组件替换
This commit is contained in:
parent
96dce7a98a
commit
430a8c7dc8
|
@ -11,7 +11,11 @@
|
||||||
>
|
>
|
||||||
<template #headerTitle>
|
<template #headerTitle>
|
||||||
<j-space>
|
<j-space>
|
||||||
<PermissionButton type="primary" @click="showModal" hasPermission="rule-engine/Alarm/Configuration:add">
|
<PermissionButton
|
||||||
|
type="primary"
|
||||||
|
@click="showModal"
|
||||||
|
hasPermission="rule-engine/Alarm/Configuration:add"
|
||||||
|
>
|
||||||
<template #icon><AIcon type="PlusOutlined" /></template>
|
<template #icon><AIcon type="PlusOutlined" /></template>
|
||||||
新增
|
新增
|
||||||
</PermissionButton>
|
</PermissionButton>
|
||||||
|
@ -19,65 +23,63 @@
|
||||||
</template>
|
</template>
|
||||||
<template #card="slotProps">
|
<template #card="slotProps">
|
||||||
<CardBox
|
<CardBox
|
||||||
:value="slotProps"
|
:value="slotProps"
|
||||||
:actions="getActions(slotProps, 'card')"
|
:actions="getActions(slotProps, 'card')"
|
||||||
:status="slotProps.state?.value"
|
:status="slotProps.state?.value"
|
||||||
:statusText="slotProps.state?.text"
|
:statusText="slotProps.state?.text"
|
||||||
:statusNames="{
|
:statusNames="{
|
||||||
started: 'processing',
|
started: 'processing',
|
||||||
disable: 'error',
|
disable: 'error',
|
||||||
}"
|
}"
|
||||||
>
|
>
|
||||||
<template #type>
|
<template #type>
|
||||||
<span
|
<span
|
||||||
><img
|
><img
|
||||||
:height="16"
|
:height="16"
|
||||||
:src="typeMap.get(slotProps.triggerType)?.icon"
|
:src="typeMap.get(slotProps.triggerType)?.icon"
|
||||||
style="margin-right: 5px"
|
style="margin-right: 5px"
|
||||||
/>{{
|
/>{{ typeMap.get(slotProps.triggerType)?.text }}</span
|
||||||
typeMap.get(slotProps.triggerType)?.text
|
>
|
||||||
}}</span
|
</template>
|
||||||
>
|
<template #img>
|
||||||
</template>
|
<img :src="typeMap.get(slotProps.triggerType)?.img" />
|
||||||
<template #img>
|
</template>
|
||||||
<img :src="typeMap.get(slotProps.triggerType)?.img" />
|
<template #content>
|
||||||
</template>
|
<Ellipsis style="width: calc(100% - 100px)">
|
||||||
<template #content>
|
<span style="font-size: 16px; font-weight: 600">
|
||||||
<Ellipsis style="width: calc(100% - 100px)">
|
{{ slotProps.name }}
|
||||||
<span style="font-size: 16px; font-weight: 600">
|
</span>
|
||||||
{{ slotProps.name }}
|
</Ellipsis>
|
||||||
</span>
|
<Ellipsis :lineClamp="2">
|
||||||
</Ellipsis>
|
<div class="subTitle">
|
||||||
<Ellipsis :lineClamp="2">
|
说明:{{
|
||||||
<div class="subTitle">
|
slotProps?.description ||
|
||||||
说明:{{
|
typeMap.get(slotProps.triggerType)?.tip
|
||||||
slotProps?.description ||
|
}}
|
||||||
typeMap.get(slotProps.triggerType)?.tip
|
</div>
|
||||||
}}
|
</Ellipsis>
|
||||||
</div>
|
</template>
|
||||||
</Ellipsis>
|
<template #actions="item">
|
||||||
</template>
|
<PermissionButton
|
||||||
<template #actions="item">
|
:disabled="item.disabled"
|
||||||
<PermissionButton
|
:popConfirm="item.popConfirm"
|
||||||
:disabled="item.disabled"
|
:tooltip="{
|
||||||
:popConfirm="item.popConfirm"
|
...item.tooltip,
|
||||||
:tooltip="{
|
}"
|
||||||
...item.tooltip,
|
@click="item.onClick"
|
||||||
}"
|
:hasPermission="'rule-engine/Scene:' + item.key"
|
||||||
@click="item.onClick"
|
>
|
||||||
:hasPermission="'rule-engine/Scene:' + item.key"
|
<AIcon
|
||||||
>
|
type="DeleteOutlined"
|
||||||
<AIcon
|
v-if="item.key === 'delete'"
|
||||||
type="DeleteOutlined"
|
/>
|
||||||
v-if="item.key === 'delete'"
|
<template v-else>
|
||||||
/>
|
<AIcon :type="item.icon" />
|
||||||
<template v-else>
|
<span>{{ item?.text }}</span>
|
||||||
<AIcon :type="item.icon" />
|
</template>
|
||||||
<span>{{ item?.text }}</span>
|
</PermissionButton>
|
||||||
</template>
|
</template>
|
||||||
</PermissionButton>
|
</CardBox>
|
||||||
</template>
|
|
||||||
</CardBox>
|
|
||||||
</template>
|
</template>
|
||||||
</JProTable>
|
</JProTable>
|
||||||
<Save
|
<Save
|
||||||
|
@ -93,7 +95,6 @@
|
||||||
import { query } from '@/api/rule-engine/scene';
|
import { query } from '@/api/rule-engine/scene';
|
||||||
import { unbindScene } from '@/api/rule-engine/configuration';
|
import { unbindScene } from '@/api/rule-engine/configuration';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import SceneCard from '@/views/rule-engine/Scene/SceneCard.vue';
|
|
||||||
import type { ActionsType } from '@/components/Table';
|
import type { ActionsType } from '@/components/Table';
|
||||||
import { getImage } from '@/utils/comm';
|
import { getImage } from '@/utils/comm';
|
||||||
import { message } from 'ant-design-vue/es';
|
import { message } from 'ant-design-vue/es';
|
||||||
|
@ -173,10 +174,10 @@ const showModal = () => {
|
||||||
const closeSave = () => {
|
const closeSave = () => {
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
};
|
};
|
||||||
const saveSuccess = () =>{
|
const saveSuccess = () => {
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
actionRef.value.reload();
|
actionRef.value.reload();
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
</style>
|
</style>
|
Loading…
Reference in New Issue