|
@@ -1,6 +1,9 @@
|
|
|
<template>
|
|
|
<div class="props">
|
|
|
- <div class="real-times" v-if="pen.realTimes && pen.realTimes.length">
|
|
|
+ <div
|
|
|
+ class="real-times"
|
|
|
+ v-if="props.pen.realTimes && props.pen.realTimes.length"
|
|
|
+ >
|
|
|
<div class="grid head">
|
|
|
<div class="title">数据名</div>
|
|
|
<div class="title">值</div>
|
|
@@ -9,7 +12,7 @@
|
|
|
<t-icon name="more" />
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="grid" v-for="(item, i) in pen.realTimes">
|
|
|
+ <div class="grid" v-for="(item, i) in props.pen.realTimes">
|
|
|
<t-tooltip :content="item.key" placement="top">
|
|
|
<label class="label">{{ item.label }}</label>
|
|
|
</t-tooltip>
|
|
@@ -429,7 +432,7 @@ const {
|
|
|
proxy: { $forceUpdate },
|
|
|
}: any = getCurrentInstance();
|
|
|
|
|
|
-const { pen } = defineProps<{
|
|
|
+const props = defineProps<{
|
|
|
pen: any;
|
|
|
}>();
|
|
|
|
|
@@ -596,9 +599,9 @@ let timer: any;
|
|
|
|
|
|
onBeforeMount(() => {
|
|
|
// realTimesOptions - 扩展的动态数据下拉列表
|
|
|
- if (pen.realTimesOptions) {
|
|
|
+ if (props.pen.realTimesOptions) {
|
|
|
options.value[options.value.length - 1].divider = true;
|
|
|
- options.value.push(...pen.realTimesOptions);
|
|
|
+ options.value.push(...props.pen.realTimesOptions);
|
|
|
}
|
|
|
|
|
|
timer = setInterval($forceUpdate, 1000);
|
|
@@ -606,11 +609,11 @@ onBeforeMount(() => {
|
|
|
|
|
|
const addRealTime = (e: any) => {
|
|
|
if (e.keywords) {
|
|
|
- if (!pen.realTimes) {
|
|
|
- pen.realTimes = [];
|
|
|
+ if (!props.pen.realTimes) {
|
|
|
+ props.pen.realTimes = [];
|
|
|
}
|
|
|
|
|
|
- pen.realTimes.push({
|
|
|
+ props.pen.realTimes.push({
|
|
|
label: e.content,
|
|
|
key: e.value,
|
|
|
type: e.type,
|
|
@@ -640,8 +643,8 @@ const onChangeLabel = () => {
|
|
|
};
|
|
|
|
|
|
const onConfirmData = () => {
|
|
|
- if (!pen.realTimes) {
|
|
|
- pen.realTimes = [];
|
|
|
+ if (!props.pen.realTimes) {
|
|
|
+ props.pen.realTimes = [];
|
|
|
}
|
|
|
if (!addDataDialog.data.label || !addDataDialog.data.key) {
|
|
|
MessagePlugin.error('数据名或属性名不能为空!');
|
|
@@ -649,14 +652,14 @@ const onConfirmData = () => {
|
|
|
}
|
|
|
|
|
|
if (addDataDialog.header === '添加动态数据') {
|
|
|
- const found = pen.realTimes.findIndex((item: any) => {
|
|
|
+ const found = props.pen.realTimes.findIndex((item: any) => {
|
|
|
return item.key === addDataDialog.data.key;
|
|
|
});
|
|
|
if (found > -1) {
|
|
|
MessagePlugin.error('已经存在相同属性数据!');
|
|
|
return;
|
|
|
}
|
|
|
- pen.realTimes.push(addDataDialog.data);
|
|
|
+ props.pen.realTimes.push(addDataDialog.data);
|
|
|
}
|
|
|
|
|
|
addDataDialog.show = false;
|
|
@@ -670,7 +673,7 @@ const onMenuMore = (e: any, item: any, i: number) => {
|
|
|
addDataDialog.show = true;
|
|
|
break;
|
|
|
case 'delete':
|
|
|
- pen.realTimes.splice(i, 1);
|
|
|
+ props.pen.realTimes.splice(i, 1);
|
|
|
break;
|
|
|
default:
|
|
|
break;
|
|
@@ -781,7 +784,7 @@ const getBindsDesc = (item: any) => {
|
|
|
};
|
|
|
|
|
|
const changeValue = (prop: string) => {
|
|
|
- updatePen(pen, prop);
|
|
|
+ updatePen(props.pen, prop);
|
|
|
};
|
|
|
|
|
|
const onTrigger = (item: any) => {
|