|
@@ -1,5 +1,17 @@
|
|
<template>
|
|
<template>
|
|
<div class="props">
|
|
<div class="props">
|
|
|
|
+ <t-space direction="vertical" class="py-16 w-full">
|
|
|
|
+
|
|
|
|
+ <div class="form-item px-16">
|
|
|
|
+ <label style="width: 50px">ID</label>
|
|
|
|
+ <t-input
|
|
|
|
+ class="w-full"
|
|
|
|
+ placeholder="ID"
|
|
|
|
+ :value="props.pen.id"
|
|
|
|
+ @change="changeID($event)"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ </t-space>
|
|
<t-collapse
|
|
<t-collapse
|
|
:defaultValue="['1', '2', '3','4', '7']"
|
|
:defaultValue="['1', '2', '3','4', '7']"
|
|
expandIconPlacement="right"
|
|
expandIconPlacement="right"
|
|
@@ -229,12 +241,12 @@
|
|
</div>
|
|
</div>
|
|
</t-collapse-panel>
|
|
</t-collapse-panel>
|
|
<t-collapse-panel value="3" header="数据">
|
|
<t-collapse-panel value="3" header="数据">
|
|
- <div class="t-space-item">
|
|
|
|
|
|
+ <!-- <div class="t-space-item">
|
|
<div class="form-item py-12">
|
|
<div class="form-item py-12">
|
|
<label style="width: 76px">{{$t('关联设备')}}</label>
|
|
<label style="width: 76px">{{$t('关联设备')}}</label>
|
|
<t-input class="w-full" v-model="props.pen.deviceId" @change="changeValue('deviceId')" :placeholder="$t('设备ID')"></t-input>
|
|
<t-input class="w-full" v-model="props.pen.deviceId" @change="changeValue('deviceId')" :placeholder="$t('设备ID')"></t-input>
|
|
</div>
|
|
</div>
|
|
- </div>
|
|
|
|
|
|
+ </div> -->
|
|
<template v-if="props.pen.name==='tablePlus'">
|
|
<template v-if="props.pen.name==='tablePlus'">
|
|
<div class="t-space-item">
|
|
<div class="t-space-item">
|
|
<div v-if="cell.row!==undefined" class="flex between form-item py-12">
|
|
<div v-if="cell.row!==undefined" class="flex between form-item py-12">
|
|
@@ -259,7 +271,7 @@
|
|
<div class="grid head">
|
|
<div class="grid head">
|
|
<div class="title">{{$t('数据名')}}</div>
|
|
<div class="title">{{$t('数据名')}}</div>
|
|
<div class="title">{{$t('值')}}</div>
|
|
<div class="title">{{$t('值')}}</div>
|
|
- <div class="title" style="text-align: center;">{{$t('绑定')}}</div>
|
|
|
|
|
|
+ <!-- <div class="title" style="text-align: center;">{{$t('绑定')}}</div> -->
|
|
<div class="title" style="text-align: center;">{{$t('操作')}}</div>
|
|
<div class="title" style="text-align: center;">{{$t('操作')}}</div>
|
|
|
|
|
|
<!-- <div class="actions">
|
|
<!-- <div class="actions">
|
|
@@ -304,13 +316,19 @@
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
- <div style="text-align: center;">
|
|
|
|
|
|
+ <div class="flex">
|
|
|
|
+ <div class="mr-8" style="text-align: center;">
|
|
<t-tooltip :content="getBindsDesc(item)" placement="top">
|
|
<t-tooltip :content="getBindsDesc(item)" placement="top">
|
|
<link-icon class="hover ml-4"
|
|
<link-icon class="hover ml-4"
|
|
:class="{ primary: item.enableMock || item.bind?.id }"
|
|
:class="{ primary: item.enableMock || item.bind?.id }"
|
|
@click="onBind(item)"/>
|
|
@click="onBind(item)"/>
|
|
</t-tooltip>
|
|
</t-tooltip>
|
|
</div>
|
|
</div>
|
|
|
|
+ <div class="mr-8" @click="gotoTrigger(item.trigger)" style="text-align: center;">
|
|
|
|
+ <t-tooltip :content="item.trigger!==undefined?'配置了状态':''" placement="top">
|
|
|
|
+ <ErrorCircleIcon class="hover" :class="{ primary: item.trigger!==undefined }" />
|
|
|
|
+ </t-tooltip>
|
|
|
|
+ </div>
|
|
<div style="text-align: center;">
|
|
<div style="text-align: center;">
|
|
<!-- <t-tooltip :content="item.triggers?.length || '状态'">
|
|
<!-- <t-tooltip :content="item.triggers?.length || '状态'">
|
|
<t-badge
|
|
<t-badge
|
|
@@ -327,7 +345,8 @@
|
|
@click="addTrigger(item, $event, i)"
|
|
@click="addTrigger(item, $event, i)"
|
|
:minColumnWidth="120"
|
|
:minColumnWidth="120"
|
|
>
|
|
>
|
|
- <ViewListIcon class="hover"/>
|
|
|
|
|
|
+ <!-- <ViewListIcon class="hover"/> -->
|
|
|
|
+ <MoreIcon class="hover"/>
|
|
<template #dropdown>
|
|
<template #dropdown>
|
|
<t-dropdown-menu >
|
|
<t-dropdown-menu >
|
|
<t-dropdown-item v-for="(option) in triggerOptions" :value="option.value">
|
|
<t-dropdown-item v-for="(option) in triggerOptions" :value="option.value">
|
|
@@ -339,6 +358,7 @@
|
|
</template>
|
|
</template>
|
|
</t-dropdown>
|
|
</t-dropdown>
|
|
</div>
|
|
</div>
|
|
|
|
+ </div>
|
|
<!-- <div class="actions">
|
|
<!-- <div class="actions">
|
|
<t-dropdown
|
|
<t-dropdown
|
|
:options="moreOptions"
|
|
:options="moreOptions"
|
|
@@ -932,7 +952,7 @@ import Actions from './Actions.vue';
|
|
import { useSelection } from '@/services/selections';
|
|
import { useSelection } from '@/services/selections';
|
|
import { defaultGradientColor, defaultPureColor } from '@/services/defaults';
|
|
import { defaultGradientColor, defaultPureColor } from '@/services/defaults';
|
|
import { getLe5le3d, getLe5leV, getLe5le2d } from '@/services/api';
|
|
import { getLe5le3d, getLe5leV, getLe5le2d } from '@/services/api';
|
|
-import { EllipsisIcon, MoreIcon, LinkIcon, RelativityIcon, AddRectangleIcon, SearchIcon ,DeleteIcon, ArrowRightIcon, CloseIcon, ChevronLeftDoubleIcon, AddIcon, ViewListIcon, CheckIcon, HelpCircleIcon } from 'tdesign-icons-vue-next';
|
|
|
|
|
|
+import { EllipsisIcon, MoreIcon, LinkIcon, RelativityIcon, AddRectangleIcon, SearchIcon ,DeleteIcon, ArrowRightIcon, CloseIcon, ChevronLeftDoubleIcon, AddIcon, ViewListIcon, CheckIcon, HelpCircleIcon, ErrorCircleIcon } from 'tdesign-icons-vue-next';
|
|
import { s8 } from '@/services/random';
|
|
import { s8 } from '@/services/random';
|
|
import { importExcel } from '@/services/excel';
|
|
import { importExcel } from '@/services/excel';
|
|
import { importCSV } from '@/services/file';
|
|
import { importCSV } from '@/services/file';
|
|
@@ -991,6 +1011,11 @@ const options = ref<any>([
|
|
content: $t('文字'),
|
|
content: $t('文字'),
|
|
// keywords: true,
|
|
// keywords: true,
|
|
},
|
|
},
|
|
|
|
+ {
|
|
|
|
+ value: 'deviceId',
|
|
|
|
+ content: '关联设备',
|
|
|
|
+ keywords: true,
|
|
|
|
+ },
|
|
{
|
|
{
|
|
value: 'progress',
|
|
value: 'progress',
|
|
content: $t('进度'),
|
|
content: $t('进度'),
|
|
@@ -1185,6 +1210,23 @@ const penTree: any = ref([]);
|
|
|
|
|
|
let timer: any;
|
|
let timer: any;
|
|
|
|
|
|
|
|
+const changeID = (value: any) => {
|
|
|
|
+ if (!value) {
|
|
|
|
+ // initPenData();
|
|
|
|
+ MessagePlugin.error('id 不能为空');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ const oldID: string = props.pen.id;
|
|
|
|
+ try {
|
|
|
|
+ meta2d.changePenId(oldID, value);
|
|
|
|
+ // initPenData();
|
|
|
|
+ } catch (error) {
|
|
|
|
+ console.warn(error.message);
|
|
|
|
+ MessagePlugin.error('id 修改失败,请检查 id 是否重复');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+};
|
|
|
|
+
|
|
onBeforeMount(() => {
|
|
onBeforeMount(() => {
|
|
// realTimesOptions - 扩展的动态数据下拉列表
|
|
// realTimesOptions - 扩展的动态数据下拉列表
|
|
if (props.pen.realTimesOptions) {
|
|
if (props.pen.realTimesOptions) {
|
|
@@ -1791,6 +1833,7 @@ watch(
|
|
if(props.pen.children?.length){
|
|
if(props.pen.children?.length){
|
|
childrenPens.value = getAllChildren(meta2d.store.pens[props.pen.id],meta2d.store);
|
|
childrenPens.value = getAllChildren(meta2d.store.pens[props.pen.id],meta2d.store);
|
|
}
|
|
}
|
|
|
|
+ getRealTimesTrigger();
|
|
}
|
|
}
|
|
);
|
|
);
|
|
|
|
|
|
@@ -1799,8 +1842,35 @@ onMounted(() => {
|
|
if(props.pen.children?.length){
|
|
if(props.pen.children?.length){
|
|
childrenPens.value = getAllChildren(meta2d.store.pens[props.pen.id],meta2d.store);
|
|
childrenPens.value = getAllChildren(meta2d.store.pens[props.pen.id],meta2d.store);
|
|
}
|
|
}
|
|
|
|
+ getRealTimesTrigger();
|
|
});
|
|
});
|
|
|
|
|
|
|
|
+const getRealTimesTrigger = ()=>{
|
|
|
|
+ if(!props.pen.triggers?.length){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ props.pen.realTimes?.forEach((real)=>{
|
|
|
|
+ let shouldBreak = false;
|
|
|
|
+ props.pen.triggers.forEach((item,index)=>{
|
|
|
|
+ if (shouldBreak) return;
|
|
|
|
+ item.status.forEach((_item)=>{
|
|
|
|
+ const trigger = _item.conditions.filter((i)=>i.key===real.key);
|
|
|
|
+ if(trigger?.length){
|
|
|
|
+ real.trigger = index;
|
|
|
|
+ shouldBreak = true;
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ });
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+const gotoTrigger = (i:any)=>{
|
|
|
|
+ if(i===undefined){
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ emit('tabchange',i);
|
|
|
|
+}
|
|
|
|
+
|
|
const changeCValue = (prop: string, pen:Pen)=>{
|
|
const changeCValue = (prop: string, pen:Pen)=>{
|
|
updatePen(pen, prop);
|
|
updatePen(pen, prop);
|
|
selections.pen[prop] = getter(pen, prop);
|
|
selections.pen[prop] = getter(pen, prop);
|
|
@@ -1964,7 +2034,7 @@ const addTrigger = (item:any, e:any, i:any) => {
|
|
break;
|
|
break;
|
|
case 'switch':
|
|
case 'switch':
|
|
props.pen.triggers.push({
|
|
props.pen.triggers.push({
|
|
- "name": e.content,
|
|
|
|
|
|
+ "name": "状态切换",
|
|
"status": [
|
|
"status": [
|
|
{
|
|
{
|
|
"name": $t("满足条件,切换到状态1"),
|
|
"name": $t("满足条件,切换到状态1"),
|
|
@@ -2009,7 +2079,7 @@ const addTrigger = (item:any, e:any, i:any) => {
|
|
break;
|
|
break;
|
|
case 'warning':
|
|
case 'warning':
|
|
props.pen.triggers.push({
|
|
props.pen.triggers.push({
|
|
- "name": e.content,
|
|
|
|
|
|
+ "name": "条件告警",
|
|
"status": [
|
|
"status": [
|
|
{
|
|
{
|
|
"name": $t("满足条件,触发告警"),
|
|
"name": $t("满足条件,触发告警"),
|
|
@@ -2055,7 +2125,7 @@ const addTrigger = (item:any, e:any, i:any) => {
|
|
break;
|
|
break;
|
|
case 'warningAnimate':
|
|
case 'warningAnimate':
|
|
props.pen.triggers.push({
|
|
props.pen.triggers.push({
|
|
- "name": e.content,
|
|
|
|
|
|
+ "name": "条件动画",
|
|
"status": [
|
|
"status": [
|
|
{
|
|
{
|
|
"name": $t("满足条件,触发动画执行"),
|
|
"name": $t("满足条件,触发动画执行"),
|
|
@@ -2362,6 +2432,10 @@ const watcher = watch(
|
|
}
|
|
}
|
|
);
|
|
);
|
|
|
|
|
|
|
|
+const moreDataDialog = reactive({
|
|
|
|
+ show:false
|
|
|
|
+})
|
|
|
|
+
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
meta2d.on('click',getPenData);
|
|
meta2d.on('click',getPenData);
|
|
leaderPen.value = meta2d.store.pens[props.pen.formId];
|
|
leaderPen.value = meta2d.store.pens[props.pen.formId];
|
|
@@ -2381,7 +2455,7 @@ onUnmounted(() => {
|
|
height: 100%;
|
|
height: 100%;
|
|
|
|
|
|
.grid {
|
|
.grid {
|
|
- grid-template-columns: 70px 70px 50px 65px;
|
|
|
|
|
|
+ grid-template-columns: 80px 110px 75px;
|
|
padding: 0 12px;
|
|
padding: 0 12px;
|
|
|
|
|
|
&.head {
|
|
&.head {
|
|
@@ -2421,6 +2495,9 @@ onUnmounted(() => {
|
|
font-size: 10px;
|
|
font-size: 10px;
|
|
line-height: 28px;
|
|
line-height: 28px;
|
|
color: var(--color-desc);
|
|
color: var(--color-desc);
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ white-space: nowrap;
|
|
|
|
+ text-overflow: ellipsis;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -2436,7 +2513,7 @@ onUnmounted(() => {
|
|
}
|
|
}
|
|
|
|
|
|
& > div {
|
|
& > div {
|
|
- width: 72px;
|
|
|
|
|
|
+ /* width: 72px; */
|
|
&.t-switch {
|
|
&.t-switch {
|
|
width: fit-content;
|
|
width: fit-content;
|
|
margin-left: 4px;
|
|
margin-left: 4px;
|