|
@@ -41,6 +41,19 @@
|
|
|
</template>
|
|
|
</t-select-input>
|
|
|
</div>
|
|
|
+ <div v-if="data.pen.hvacDeviceInfo" class="form-item px-12" style="margin-top: -12px">
|
|
|
+ <label style="width: 50px">{{$t('设备')}}</label>
|
|
|
+ <t-cascader
|
|
|
+ v-model="data.pen.hvacDeviceInfo.id"
|
|
|
+ :keys="{ value: 'id' }"
|
|
|
+ :options="deviceList"
|
|
|
+ :placeholder="$t('请选择设备')"
|
|
|
+ filterable
|
|
|
+ clearable
|
|
|
+ :show-all-levels="false"
|
|
|
+ @change="handleDeviceChange"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
<div v-if="isDom" class="form-item px-12" style="margin-top: -12px">
|
|
|
<label style="width: 50px">z-index</label>
|
|
|
<t-input-number
|
|
@@ -1287,7 +1300,7 @@ import Custom from './Custom.vue';
|
|
|
import { useSelection } from '@/services/selections';
|
|
|
import { autoSave, fonts, inTreePanel } from '@/services/common';
|
|
|
import { updatePen } from './pen';
|
|
|
-import { MessagePlugin } from 'tdesign-vue-next';
|
|
|
+import { CascaderChangeContext, CascaderValue, MessagePlugin } from 'tdesign-vue-next';
|
|
|
import { useUser } from '@/services/user';
|
|
|
import { getter, queryURLParams, isDomShapes } from '@meta2d/core';
|
|
|
import { defaultGradientColor, defaultPureColor, fromArrows, toArrows } from '@/services/defaults';
|
|
@@ -1296,6 +1309,13 @@ import { s8 } from '@/services/random';
|
|
|
import { EllipsisIcon, LinkIcon, LinkUnlinkIcon, ChevronDownIcon, FormatVerticalAlignLeftIcon, FormatHorizontalAlignCenterIcon, FormatVerticalAlignCenterIcon, FormatVerticalAlignRightIcon, FormatHorizontalAlignTopIcon, FormatHorizontalAlignBottomIcon } from 'tdesign-icons-vue-next';
|
|
|
import { getToken } from '@le5le/auth-token';
|
|
|
import { getImgUrl } from '@/services/utils';
|
|
|
+import { DeviceItem } from '@/types';
|
|
|
+
|
|
|
+interface Props {
|
|
|
+ deviceList: DeviceItem[];
|
|
|
+}
|
|
|
+
|
|
|
+const props = defineProps<Props>();
|
|
|
|
|
|
const { user } = useUser();
|
|
|
const headers = {
|
|
@@ -1564,6 +1584,11 @@ const changeValue = (prop: string) => {
|
|
|
}
|
|
|
};
|
|
|
|
|
|
+const handleDeviceChange = (value: CascaderValue<DeviceItem>, context: CascaderChangeContext<DeviceItem>) => {
|
|
|
+ data.pen.description = context.node.label
|
|
|
+ Object.assign(data.pen.hvacDeviceInfo, context.node.data)
|
|
|
+}
|
|
|
+
|
|
|
const getThumbImg = async () => {
|
|
|
//改iframe地址后
|
|
|
let arr = data.pen.iframe.split('?');
|