style: 优化场景联动回显校验
This commit is contained in:
parent
9594893a50
commit
8b9330a58d
|
@ -58,6 +58,7 @@ const checkDeviceDelete = async () => {
|
|||
formTouchOff()
|
||||
return
|
||||
}
|
||||
if (item?.selector === 'fixed') {
|
||||
const deviceList = item!.selectorValues?.map(item => item.value) || []
|
||||
const deviceResp = await deviceQuery({ terms: [{ terms: [{ column: 'id', termType: 'in', value: deviceList.toString() }]}]})
|
||||
if (deviceResp.success && (deviceResp.result as any)?.total < (item!.selectorValues?.length || 0)) { // 某一个设备被删除
|
||||
|
@ -66,6 +67,7 @@ const checkDeviceDelete = async () => {
|
|||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验当前执行动作的通知配置、消息模板是否删除
|
||||
|
|
|
@ -107,9 +107,11 @@ const onKeys: string[] = EventSubscribeKeys({
|
|||
action: props.actionName
|
||||
})
|
||||
|
||||
EventEmitter.subscribe(onKeys, (d: any) => {
|
||||
const handleRequest = () => {
|
||||
columnRequest()
|
||||
})
|
||||
}
|
||||
|
||||
EventEmitter.subscribe(onKeys, handleRequest)
|
||||
|
||||
provide('filter-params', columnOptions)
|
||||
|
||||
|
@ -241,6 +243,10 @@ nextTick(() => {
|
|||
columnRequest()
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
EventEmitter.unSubscribe(onKeys, handleRequest)
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
|
|
@ -221,7 +221,7 @@ const showDouble = computed(() => {
|
|||
} else {
|
||||
metricOption.value = []
|
||||
}
|
||||
return isRange && !isMetric
|
||||
return isRange && !isMetric.value
|
||||
})
|
||||
|
||||
const mouseover = () => {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import { BranchesThen } from '@/views/rule-engine/Scene/typings'
|
||||
|
||||
export const ContextKey = 'columnOptions'
|
||||
|
||||
export const handleParamsData = (data: any[], key: string = 'column'): any[] => {
|
||||
|
@ -12,7 +14,7 @@ export const handleParamsData = (data: any[], key: string = 'column'): any[] =>
|
|||
}
|
||||
|
||||
export const thenRules = [{
|
||||
validator(_: string, value: any) {
|
||||
validator(_: string, value: BranchesThen[]) {
|
||||
if (!value || (value && !value.length) || !value.some(item => item.actions && item.actions.length)) {
|
||||
return Promise.reject('至少配置一个执行动作')
|
||||
}
|
||||
|
|
|
@ -3700,8 +3700,8 @@ jetlinks-store@^0.0.3:
|
|||
|
||||
jetlinks-ui-components@^1.0.5:
|
||||
version "1.0.5"
|
||||
resolved "http://47.108.170.157:9013/jetlinks-ui-components/-/jetlinks-ui-components-1.0.5.tgz#593185f6313895485b59e9a79bc920c63374d84d"
|
||||
integrity sha512-dkSOmatSPLHlV91YdTcHWO2wfwriUIZKEuLd5bJF2GsO9SvDMyJ2YJ4n/3fkklOoL5albhY37iX2Ot3A+7QYwA==
|
||||
resolved "http://47.108.170.157:9013/jetlinks-ui-components/-/jetlinks-ui-components-1.0.5.tgz#6a3cc76cd6d98319e070da597bfcf146fa12d375"
|
||||
integrity sha512-ASPqiWprK2v4/zQIYxOytjkVFgx+AkBaD5Klg2ik88y9uDAW/Ylvqa91v149znihU1y8Q2Nm2PXvUSJFD7HPpw==
|
||||
dependencies:
|
||||
"@vueuse/core" "^9.12.0"
|
||||
ant-design-vue "^3.2.15"
|
||||
|
|
Loading…
Reference in New Issue