|
1
|
<script setup lang="ts">
|
1
|
<script setup lang="ts">
|
|
2
|
import { ComponentPublicInstance, computed, ref, unref, watch } from 'vue';
|
2
|
import { ComponentPublicInstance, computed, ref, unref, watch } from 'vue';
|
|
3
|
- import { Card, Tag, Button } from 'ant-design-vue';
|
3
|
+ import { Card, Tag, Button, Tooltip } from 'ant-design-vue';
|
|
4
|
import { Icon } from '/@/components/Icon';
|
4
|
import { Icon } from '/@/components/Icon';
|
|
5
|
import { getFormSchemas, FormFieldsEnum } from './config';
|
5
|
import { getFormSchemas, FormFieldsEnum } from './config';
|
|
6
|
import { CollapseContainer } from '/@/components/Container';
|
6
|
import { CollapseContainer } from '/@/components/Container';
|
|
@@ -9,7 +9,12 @@ |
|
@@ -9,7 +9,12 @@ |
|
9
|
import { ConditionFilterProps, ConditionListItemType } from './type';
|
9
|
import { ConditionFilterProps, ConditionListItemType } from './type';
|
|
10
|
import { ConditionMessageItemType, useConditionFilterMessage } from './useConditionFilterMessage';
|
10
|
import { ConditionMessageItemType, useConditionFilterMessage } from './useConditionFilterMessage';
|
|
11
|
import { useConditionData } from './useConditionData';
|
11
|
import { useConditionData } from './useConditionData';
|
|
12
|
- import { getNewConditionFilterItem } from '.';
|
12
|
+ import {
|
|
|
|
13
|
+ CheckStatusEnum,
|
|
|
|
14
|
+ CheckStatusIconEnum,
|
|
|
|
15
|
+ CheckStatusColorEnum,
|
|
|
|
16
|
+ getNewConditionFilterItem,
|
|
|
|
17
|
+ } from '.';
|
|
13
|
import { useSceneLinkageDrawerContext } from '../SceneLinkageDrawer/sceneLinkageDrawerContext';
|
18
|
import { useSceneLinkageDrawerContext } from '../SceneLinkageDrawer/sceneLinkageDrawerContext';
|
|
14
|
|
19
|
|
|
15
|
const { disabledDrawer } = useSceneLinkageDrawerContext();
|
20
|
const { disabledDrawer } = useSceneLinkageDrawerContext();
|
|
@@ -88,14 +93,14 @@ |
|
@@ -88,14 +93,14 @@ |
|
88
|
<template #title>
|
93
|
<template #title>
|
|
89
|
<section class="flex !p-2">
|
94
|
<section class="flex !p-2">
|
|
90
|
<div class="w-20 flex-grow-0 flex-shrink-0"> 条件筛选 </div>
|
95
|
<div class="w-20 flex-grow-0 flex-shrink-0"> 条件筛选 </div>
|
|
91
|
- <div class="flex flex-wrap">
|
96
|
+ <div class="flex flex-wrap gap-1 mr-4">
|
|
92
|
<template v-for="(item, index) in conditionMessageList" :key="index">
|
97
|
<template v-for="(item, index) in conditionMessageList" :key="index">
|
|
93
|
<Tag class="!rounded-md !m-0 !text-sky-700"> {{ objectModel?.name }} </Tag>
|
98
|
<Tag class="!rounded-md !m-0 !text-sky-700"> {{ objectModel?.name }} </Tag>
|
|
94
|
- <span class="mx-2">{{ item.operation }}</span>
|
99
|
+ <span>{{ item.operation }}</span>
|
|
95
|
<Tag class="!rounded-md !m-0 !text-orange-300">
|
100
|
<Tag class="!rounded-md !m-0 !text-orange-300">
|
|
96
|
{{ item.defaultValue }}
|
101
|
{{ item.defaultValue }}
|
|
97
|
</Tag>
|
102
|
</Tag>
|
|
98
|
- <span class="mx-2" v-if="conditionMessageList.length - 1 !== index">和</span>
|
103
|
+ <span v-if="conditionMessageList.length - 1 !== index">和</span>
|
|
99
|
</template>
|
104
|
</template>
|
|
100
|
</div>
|
105
|
</div>
|
|
101
|
</section>
|
106
|
</section>
|
|
@@ -106,9 +111,11 @@ |
|
@@ -106,9 +111,11 @@ |
|
106
|
v-for="(conditionItem, index) in conditionListElRef"
|
111
|
v-for="(conditionItem, index) in conditionListElRef"
|
|
107
|
:key="conditionItem.key"
|
112
|
:key="conditionItem.key"
|
|
108
|
>
|
113
|
>
|
|
109
|
- <section class="border-2 border-dashed border-gray-200 rounded-lg px-4 py-2 flex-1">
|
|
|
|
110
|
- <!-- -->
|
114
|
+ <section
|
|
|
|
115
|
+ class="border-2 border-dashed border-gray-200 rounded-lg px-4 py-2 flex-1 flex items-center"
|
|
|
|
116
|
+ >
|
|
111
|
<BasicForm
|
117
|
<BasicForm
|
|
|
|
118
|
+ class="flex-auto"
|
|
112
|
:ref="(el) => setConditionRef(conditionItem, el)"
|
119
|
:ref="(el) => setConditionRef(conditionItem, el)"
|
|
113
|
:show-action-button-group="false"
|
120
|
:show-action-button-group="false"
|
|
114
|
layout="horizontal"
|
121
|
layout="horizontal"
|
|
@@ -118,6 +125,15 @@ |
|
@@ -118,6 +125,15 @@ |
|
118
|
:base-col-props="{ span: 24 / getSchemas.length, xl: 8, lg: 12, sm: 24 }"
|
125
|
:base-col-props="{ span: 24 / getSchemas.length, xl: 8, lg: 12, sm: 24 }"
|
|
119
|
@field-value-change="handleConditionFormValueChange"
|
126
|
@field-value-change="handleConditionFormValueChange"
|
|
120
|
/>
|
127
|
/>
|
|
|
|
128
|
+ <Icon
|
|
|
|
129
|
+ :style="{
|
|
|
|
130
|
+ opacity: conditionItem.checkStatus !== CheckStatusEnum.NO_VALIDATE ? 100 : 0,
|
|
|
|
131
|
+ }"
|
|
|
|
132
|
+ :icon="CheckStatusIconEnum[conditionItem.checkStatus!]"
|
|
|
|
133
|
+ :size="20"
|
|
|
|
134
|
+ :class="CheckStatusColorEnum[conditionItem.checkStatus!]"
|
|
|
|
135
|
+ class="transition-opacity duration-500 ease-linear"
|
|
|
|
136
|
+ />
|
|
121
|
</section>
|
137
|
</section>
|
|
122
|
<span
|
138
|
<span
|
|
123
|
class="w-5"
|
139
|
class="w-5"
|
|
@@ -125,13 +141,15 @@ |
|
@@ -125,13 +141,15 @@ |
|
125
|
>
|
141
|
>
|
|
126
|
和
|
142
|
和
|
|
127
|
</span>
|
143
|
</span>
|
|
128
|
- <Icon
|
|
|
|
129
|
- v-if="!disabledDrawer"
|
|
|
|
130
|
- icon="fluent:delete-off-20-regular"
|
|
|
|
131
|
- size="24"
|
|
|
|
132
|
- class="cursor-pointer"
|
|
|
|
133
|
- @click="handleDelete(conditionItem)"
|
|
|
|
134
|
- />
|
144
|
+ <Tooltip title="删除">
|
|
|
|
145
|
+ <Icon
|
|
|
|
146
|
+ v-if="!disabledDrawer"
|
|
|
|
147
|
+ icon="fluent:delete-off-20-regular"
|
|
|
|
148
|
+ size="24"
|
|
|
|
149
|
+ class="cursor-pointer"
|
|
|
|
150
|
+ @click="handleDelete(conditionItem)"
|
|
|
|
151
|
+ />
|
|
|
|
152
|
+ </Tooltip>
|
|
135
|
</main>
|
153
|
</main>
|
|
136
|
<section class="flex mt-4 items-center justify-between">
|
154
|
<section class="flex mt-4 items-center justify-between">
|
|
137
|
<Button v-if="!disabledDrawer" type="primary" @click="handleAdd">
|
155
|
<Button v-if="!disabledDrawer" type="primary" @click="handleAdd">
|