Merge branch 'dev' of github.com:jetlinks/jetlinks-ui-vue into dev
This commit is contained in:
commit
913560934d
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<template v-if="isPermission">
|
||||
<template v-if="popConfirm">
|
||||
<j-popconfirm :overlayStyle='{minWidth: "180px"}' v-bind="popConfirm" :disabled="!isPermission || props.disabled">
|
||||
<j-popconfirm :overlayStyle='{width: "220px"}' v-bind="popConfirm" :disabled="!isPermission || props.disabled">
|
||||
<j-tooltip v-if="tooltip" v-bind="tooltip">
|
||||
<slot v-if="noButton"></slot>
|
||||
<j-button v-else v-bind="props" :disabled="_isPermission" :style="props.style">
|
||||
|
|
|
@ -135,6 +135,7 @@
|
|||
v-model:value="formData.configuration.authType"
|
||||
:options="Options['auth-types']"
|
||||
@change="changeAuthType"
|
||||
:column="2"
|
||||
/>
|
||||
</j-form-item>
|
||||
<j-form-item
|
||||
|
|
|
@ -257,6 +257,7 @@ const getActions = (
|
|||
state === 'enabled' ? '请先禁用该组件,再删除。' : '删除',
|
||||
},
|
||||
popConfirm: {
|
||||
placement: 'topRight',
|
||||
title: '该操作将会删除下属采集器与点位,确定删除?',
|
||||
onConfirm: async () => {
|
||||
const res = await remove(data.id);
|
||||
|
|
|
@ -212,6 +212,9 @@ const handleClick = () => {
|
|||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
.card-header-left {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.card-item {
|
||||
|
|
|
@ -64,7 +64,8 @@
|
|||
hasPermission="DataCollect/Collector:delete"
|
||||
:popConfirm="{
|
||||
title: `确定删除?`,
|
||||
onConfirm: () => handlDelete(),
|
||||
onConfirm: () =>
|
||||
handlBatchDelete(),
|
||||
}"
|
||||
>
|
||||
<template #icon
|
||||
|
@ -101,9 +102,11 @@
|
|||
>
|
||||
<template #title>
|
||||
<slot name="title">
|
||||
<div class="card-box-title">
|
||||
{{ slotProps.name }}
|
||||
</div>
|
||||
<Ellipsis style="width: calc(100% - 10px)">
|
||||
<div class="card-box-title">
|
||||
{{ slotProps.name }}
|
||||
</div>
|
||||
</Ellipsis>
|
||||
</slot>
|
||||
</template>
|
||||
<template #action>
|
||||
|
@ -184,7 +187,7 @@
|
|||
</p>
|
||||
<p>
|
||||
{{
|
||||
moment(
|
||||
dayjs(
|
||||
propertyValue.get(
|
||||
slotProps.id,
|
||||
)?.timestamp,
|
||||
|
@ -195,24 +198,42 @@
|
|||
</div>
|
||||
|
||||
<div class="card-box-content-right">
|
||||
<div
|
||||
v-if="getRight1(slotProps)"
|
||||
class="card-box-content-right-1"
|
||||
<Ellipsis
|
||||
style="
|
||||
width: calc(100% - 10px);
|
||||
margin-bottom: 10px;
|
||||
"
|
||||
>
|
||||
<span>{{
|
||||
getQuantity(slotProps)
|
||||
}}</span>
|
||||
<span>{{ getAddress(slotProps) }}</span>
|
||||
<span>{{
|
||||
getScaleFactor(slotProps)
|
||||
}}</span>
|
||||
</div>
|
||||
<div class="card-box-content-right-2">
|
||||
<span>{{ getText(slotProps) }}</span>
|
||||
<span>{{
|
||||
getInterval(slotProps)
|
||||
}}</span>
|
||||
</div>
|
||||
<div
|
||||
v-if="getRight1(slotProps)"
|
||||
class="card-box-content-right-1"
|
||||
>
|
||||
<span>
|
||||
{{ getQuantity(slotProps) }}
|
||||
</span>
|
||||
<span>
|
||||
{{ getAddress(slotProps) }}
|
||||
</span>
|
||||
<span>
|
||||
{{ getScaleFactor(slotProps) }}
|
||||
</span>
|
||||
</div>
|
||||
</Ellipsis>
|
||||
<Ellipsis
|
||||
style="
|
||||
width: calc(100% - 10px);
|
||||
margin-bottom: 10px;
|
||||
"
|
||||
>
|
||||
<div class="card-box-content-right-2">
|
||||
<span>{{
|
||||
getText(slotProps)
|
||||
}}</span>
|
||||
<span>{{
|
||||
getInterval(slotProps)
|
||||
}}</span>
|
||||
</div>
|
||||
</Ellipsis>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -262,7 +283,7 @@ import { colorMap, getState } from '../data.ts';
|
|||
import { cloneDeep } from 'lodash-es';
|
||||
import { getWebSocket } from '@/utils/websocket';
|
||||
import { map } from 'rxjs/operators';
|
||||
import moment from 'moment';
|
||||
import dayjs from 'dayjs';
|
||||
|
||||
const props = defineProps({
|
||||
data: {
|
||||
|
@ -404,6 +425,7 @@ const handlEdit = (data: any) => {
|
|||
}
|
||||
current.value = cloneDeep(data);
|
||||
};
|
||||
|
||||
const handlDelete = async (id: string | undefined = undefined) => {
|
||||
spinning.value = true;
|
||||
const res = !id
|
||||
|
@ -416,6 +438,18 @@ const handlDelete = async (id: string | undefined = undefined) => {
|
|||
}
|
||||
spinning.value = false;
|
||||
};
|
||||
|
||||
const handlBatchDelete = () => {
|
||||
if (_selectedRowKeys.value.length === 0) {
|
||||
onlyMessage('请先选择', 'warning');
|
||||
return;
|
||||
} else {
|
||||
console.log(2);
|
||||
|
||||
handlDelete();
|
||||
}
|
||||
};
|
||||
|
||||
const handlBatchUpdate = () => {
|
||||
if (_selectedRowKeys.value.length === 0) {
|
||||
onlyMessage('请先选择', 'warning');
|
||||
|
@ -590,7 +624,7 @@ const handleSearch = (e: any) => {
|
|||
</script>
|
||||
<style lang="less" scoped>
|
||||
.card-box {
|
||||
min-width: 480px;
|
||||
// min-width: 480px;
|
||||
a {
|
||||
color: #474747;
|
||||
z-index: 1;
|
||||
|
@ -638,7 +672,6 @@ const handleSearch = (e: any) => {
|
|||
span {
|
||||
margin: 0 5px 0 0;
|
||||
}
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.card-box-content-right-2 {
|
||||
span {
|
||||
|
|
|
@ -1,5 +1,11 @@
|
|||
<template>
|
||||
<pro-search class="device-search" type="simple" :columns="columns" target="device-instance-running-events" @search="handleSearch" />
|
||||
<pro-search
|
||||
class="device-search"
|
||||
type="simple"
|
||||
:columns="columns"
|
||||
target="device-instance-running-events"
|
||||
@search="handleSearch"
|
||||
/>
|
||||
<JProTable
|
||||
ref="eventsRef"
|
||||
:columns="columns"
|
||||
|
@ -17,13 +23,18 @@
|
|||
</j-button>
|
||||
</template>
|
||||
</JProTable>
|
||||
<j-modal :width="600" v-model:visible="visible" title="详情" class="device-running-event-modal">
|
||||
<JsonViewer :value="info" />
|
||||
<template #footer>
|
||||
<j-button type="primary" @click="visible = false">关闭</j-button>
|
||||
</template>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import dayjs from 'dayjs';
|
||||
import { getEventList } from '@/api/device/instance';
|
||||
import { useInstanceStore } from '@/store/instance';
|
||||
import { Modal } from 'jetlinks-ui-components';
|
||||
import JsonViewer from 'vue-json-viewer';
|
||||
|
||||
const events = defineProps({
|
||||
|
@ -52,13 +63,11 @@ const columns = ref<Record<string, any>>([
|
|||
},
|
||||
]);
|
||||
const params = ref<Record<string, any>>({});
|
||||
const visible = ref<boolean>(false);
|
||||
const info = ref<Record<string, any>>({});
|
||||
|
||||
const _getEventList = (_params: any) =>
|
||||
getEventList(
|
||||
instanceStore.current.id || '',
|
||||
events.data.id || '',
|
||||
_params
|
||||
);
|
||||
getEventList(instanceStore.current.id || '', events.data.id || '', _params);
|
||||
|
||||
watchEffect(() => {
|
||||
if (events.data?.valueType?.type === 'object') {
|
||||
|
@ -69,7 +78,7 @@ watchEffect(() => {
|
|||
dataIndex: `${i.id}_format`,
|
||||
search: {
|
||||
type: i?.valueType?.type || 'string',
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
} else {
|
||||
|
@ -85,20 +94,28 @@ const handleSearch = (_params: any) => {
|
|||
};
|
||||
|
||||
const detail = (_info: any) => {
|
||||
Modal.info({
|
||||
title: () => '详情',
|
||||
width: 850,
|
||||
content: () => h('JsonViewer', {
|
||||
'expand-depth': 5,
|
||||
value: _info
|
||||
}),
|
||||
okText: '关闭',
|
||||
});
|
||||
info.value = _info
|
||||
visible.value = true
|
||||
// Modal.info({
|
||||
// title: () => '详情',
|
||||
// width: 850,
|
||||
// content: () => h('JsonViewer', {
|
||||
// 'expand-depth': 5,
|
||||
// value: _info
|
||||
// }),
|
||||
// okText: '关闭',
|
||||
// });
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less">
|
||||
.device-search {
|
||||
margin: 0 0 24px 0 ;
|
||||
margin: 0 0 24px 0;
|
||||
}
|
||||
|
||||
.device-running-event-modal {
|
||||
.ant-modal-body {
|
||||
padding: 0 20px;
|
||||
}
|
||||
}
|
||||
</style>
|
|
@ -13,7 +13,7 @@
|
|||
<j-row type="flex">
|
||||
<j-col flex="180px">
|
||||
<j-form-item name="photoUrl">
|
||||
<JProUpload v-model="modelRef.photoUrl" />
|
||||
<JProUpload accept="image/*" v-model="modelRef.photoUrl" />
|
||||
</j-form-item>
|
||||
</j-col>
|
||||
<j-col flex="auto">
|
||||
|
|
|
@ -5,9 +5,16 @@
|
|||
<template #title>
|
||||
<div style="display: flex">
|
||||
<h3>配置信息</h3>
|
||||
<div style="margin: 0 0px 0 15px; color: #1d39c4">
|
||||
<AIcon type="EditOutlined" @click="editConfig"/>
|
||||
</div>
|
||||
<!-- <div style="margin: 0 0px 0 15px; color: #1d39c4">
|
||||
<AIcon type="EditOutlined" @click="editConfig" />
|
||||
</div> -->
|
||||
<PermissionButton
|
||||
type="link"
|
||||
@click="editConfig"
|
||||
hasPermission="device/Product:update"
|
||||
>
|
||||
<template #icon><AIcon type="EditOutlined" /></template>
|
||||
</PermissionButton>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<j-row type="flex">
|
||||
<j-col flex="180px">
|
||||
<j-form-item name="photoUrl">
|
||||
<JProUpload v-model="modelRef.photoUrl" />
|
||||
<JProUpload accept="image/*" v-model="modelRef.photoUrl" />
|
||||
</j-form-item>
|
||||
</j-col>
|
||||
<j-col flex="auto">
|
||||
|
|
|
@ -245,12 +245,6 @@ export default {
|
|||
url: '/iot/link/protocol',
|
||||
buttons: [
|
||||
{ id: 'view', name: '查看', enabled: true, granted: true },
|
||||
{
|
||||
id: 'action',
|
||||
name: '启/禁用',
|
||||
enabled: true,
|
||||
granted: true,
|
||||
},
|
||||
{ id: 'delete', name: '删除', enabled: true, granted: true },
|
||||
{
|
||||
id: 'update',
|
||||
|
@ -651,12 +645,6 @@ export default {
|
|||
url: '/iot/link/protocol',
|
||||
buttons: [
|
||||
{ id: 'view', name: '查看', enabled: true, granted: true },
|
||||
{
|
||||
id: 'action',
|
||||
name: '启/禁用',
|
||||
enabled: true,
|
||||
granted: true,
|
||||
},
|
||||
{ id: 'delete', name: '删除', enabled: true, granted: true },
|
||||
{
|
||||
id: 'update',
|
||||
|
|
|
@ -1364,6 +1364,16 @@ export default [
|
|||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 'action',
|
||||
name: '启/禁用',
|
||||
permissions: [
|
||||
{
|
||||
permission: 'firmware-upgrade-task-manager',
|
||||
actions: ['save'],
|
||||
}
|
||||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
|
|
|
@ -2,8 +2,21 @@
|
|||
<template>
|
||||
<page-container>
|
||||
<pro-search :columns="columns" target="recharge-search" @search="handleSearch" />
|
||||
<j-pro-table ref="rechargeRef" :columns="columns" :request="queryRechargeList" model="TABLE"
|
||||
:defaultParams="{ sorts: [{ name: 'createTime', order: 'desc' }] }" :params="params">
|
||||
<j-pro-table
|
||||
ref="rechargeRef"
|
||||
:columns="columns"
|
||||
:request="queryRechargeList"
|
||||
model="TABLE"
|
||||
:defaultParams="{
|
||||
pageSize: 10,
|
||||
sorts: [{ name: 'createTime', order: 'desc' }],
|
||||
}"
|
||||
:pagination="{
|
||||
showSizeChanger: true,
|
||||
pageSizeOptions: ['10', '20', '50', '100'],
|
||||
}"
|
||||
:params="params"
|
||||
>
|
||||
<template #headerTitle>
|
||||
<j-space>
|
||||
<PermissionButton @click="visible = true" :hasPermission="'iot-card/Recharge:pay'" type="primary">
|
||||
|
|
|
@ -44,15 +44,33 @@
|
|||
</j-radio-group>
|
||||
</j-form-item>
|
||||
<j-form-item label="说明" name="description">
|
||||
<j-textarea v-model:value="form.description" showCount :maxlength="200"></j-textarea>
|
||||
<j-textarea
|
||||
v-model:value="form.description"
|
||||
showCount
|
||||
:maxlength="200"
|
||||
></j-textarea>
|
||||
</j-form-item>
|
||||
<PermissionButton type="primary" :loading="loading" @click="handleSave" :hasPermission="['rule-engine/Alarm/Configuration:add','rule-engine/Alarm/Configuration:update']">保存</PermissionButton>
|
||||
<PermissionButton
|
||||
type="primary"
|
||||
:loading="loading"
|
||||
@click="handleSave"
|
||||
:hasPermission="[
|
||||
'rule-engine/Alarm/Configuration:add',
|
||||
'rule-engine/Alarm/Configuration:update',
|
||||
]"
|
||||
>保存</PermissionButton
|
||||
>
|
||||
</j-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { getTargetTypes, save, detail , updata} from '@/api/rule-engine/configuration';
|
||||
import {
|
||||
getTargetTypes,
|
||||
save,
|
||||
detail,
|
||||
updata,
|
||||
} from '@/api/rule-engine/configuration';
|
||||
import { queryLevel } from '@/api/rule-engine/config';
|
||||
import { query } from '@/api/rule-engine/scene';
|
||||
import { getImage } from '@/utils/comm';
|
||||
|
@ -63,15 +81,14 @@ import { useAlarmConfigurationStore } from '@/store/alarm';
|
|||
import { storeToRefs } from 'pinia';
|
||||
import { usePermissionStore } from '@/store/permission';
|
||||
const route = useRoute();
|
||||
const id = route.query?.id;
|
||||
let selectDisable = ref(false);
|
||||
const alarmConfigurationStore = useAlarmConfigurationStore();
|
||||
let { configurationData } = storeToRefs(alarmConfigurationStore);
|
||||
const queryData = () => {
|
||||
if (id) {
|
||||
detail(id).then((res) => {
|
||||
if (route.query?.id) {
|
||||
detail(route.query?.id).then((res) => {
|
||||
if (res.status === 200) {
|
||||
form.value = res?.result
|
||||
form.value = res?.result;
|
||||
// form.level = res?.result?.level;
|
||||
// form.name = res?.result?.name;
|
||||
// form.targetType = res?.result?.targetType;
|
||||
|
@ -84,7 +101,7 @@ const queryData = () => {
|
|||
{
|
||||
column: 'id',
|
||||
termType: 'alarm-bind-rule',
|
||||
value: id,
|
||||
value: route.query?.id,
|
||||
},
|
||||
],
|
||||
type: 'and',
|
||||
|
@ -176,18 +193,22 @@ const handleSave = async () => {
|
|||
formRef.value
|
||||
.validate()
|
||||
.then(async () => {
|
||||
const res = id ? await updata(form.value) : await save(form.value);
|
||||
const res = route.query?.id
|
||||
? await updata(form.value)
|
||||
: await save(form.value);
|
||||
if (res.status === 200) {
|
||||
message.success('操作成功,请配置关联的场景联动');
|
||||
loading.value = false;
|
||||
menuStory.jumpPage(
|
||||
'rule-engine/Alarm/Configuration/Save',
|
||||
{},
|
||||
{ id: res.result?.id },
|
||||
);
|
||||
if (!id) {
|
||||
if (res.result?.id) {
|
||||
menuStory.jumpPage(
|
||||
'rule-engine/Alarm/Configuration/Save',
|
||||
{},
|
||||
{ id: res.result?.id },
|
||||
);
|
||||
}
|
||||
if (!route.query?.id) {
|
||||
configurationData.value.current = res.result;
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
|
@ -196,6 +217,12 @@ const handleSave = async () => {
|
|||
});
|
||||
};
|
||||
queryData();
|
||||
watch(
|
||||
() => route.query?.id,
|
||||
() => {
|
||||
queryData();
|
||||
},
|
||||
);
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.ant-radio-button-wrapper {
|
||||
|
@ -203,7 +230,7 @@ queryData();
|
|||
width: 20%;
|
||||
height: 100%;
|
||||
}
|
||||
.levelSelect{
|
||||
.levelSelect {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
}
|
||||
|
|
|
@ -40,12 +40,13 @@
|
|||
</j-space>
|
||||
</template>
|
||||
</JProTable>
|
||||
<Info v-if="visiable" :data="current" @close="close"/>
|
||||
<Info v-if="visiable" :data="current" @close="close" :description="description"/>
|
||||
</page-container>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { detail, queryHistoryList } from '@/api/rule-engine/log';
|
||||
import { detail as configurationDetail} from '@/api/rule-engine/configuration'
|
||||
import { useRoute } from 'vue-router';
|
||||
import dayjs from 'dayjs';
|
||||
import type { ActionsType } from '@/components/Table/index.vue';
|
||||
|
@ -58,6 +59,7 @@ const route = useRoute();
|
|||
const id = route.params?.id;
|
||||
const { params: routerParams } = useRouterParams()
|
||||
let visiable = ref(false);
|
||||
let description = ref<string>();
|
||||
const columns = [
|
||||
{
|
||||
title: '告警时间',
|
||||
|
@ -168,6 +170,11 @@ watchEffect(async () => {
|
|||
key: 'targetName',
|
||||
});
|
||||
}
|
||||
configurationDetail(res.result?.alarmConfigId).then((res:any)=>{
|
||||
if(res.status === 200){
|
||||
description.value = res.result?.description;
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
const handleSearch = (_params: any) => {
|
||||
|
|
|
@ -1,8 +1,26 @@
|
|||
<template>
|
||||
<j-modal visible title="详情" okText="确定" cancelText="取消" :width="1000" @ok="closeModal" @cancel="closeModal">
|
||||
<j-modal
|
||||
visible
|
||||
title="详情"
|
||||
okText="确定"
|
||||
cancelText="取消"
|
||||
:width="1000"
|
||||
@ok="closeModal"
|
||||
@cancel="closeModal"
|
||||
>
|
||||
<j-descriptions bordered :column="2">
|
||||
<j-descriptions-item v-if="props.data.targetType==='device'" label="告警设备" :span="1">{{props.data?.targetName || ''}}</j-descriptions-item>
|
||||
<j-descriptions-item v-if="props.data.targetType==='device'" label="设备ID" :span="1">{{props.data?.targetId || ''}}</j-descriptions-item>
|
||||
<j-descriptions-item
|
||||
v-if="props.data.targetType === 'device'"
|
||||
label="告警设备"
|
||||
:span="1"
|
||||
>{{ props.data?.targetName || '' }}</j-descriptions-item
|
||||
>
|
||||
<j-descriptions-item
|
||||
v-if="props.data.targetType === 'device'"
|
||||
label="设备ID"
|
||||
:span="1"
|
||||
>{{ props.data?.targetId || '' }}</j-descriptions-item
|
||||
>
|
||||
<j-descriptions-item label="告警名称" :span="1">{{
|
||||
props.data?.alarmConfigName
|
||||
}}</j-descriptions-item>
|
||||
|
@ -23,22 +41,20 @@
|
|||
</Ellipsis>
|
||||
</j-tooltip>
|
||||
</j-descriptions-item>
|
||||
<j-descriptions-item label="告警说明" :span="1"
|
||||
><j-tooltip
|
||||
placement="topLeft"
|
||||
:title="data?.description || ''"
|
||||
>
|
||||
<Ellipsis>
|
||||
<span>
|
||||
{{ data?.description || '' }}
|
||||
</span> </Ellipsis
|
||||
>
|
||||
</j-tooltip></j-descriptions-item
|
||||
>
|
||||
<j-descriptions-item
|
||||
label="告警流水"
|
||||
:span="2"
|
||||
><div style="max-height: 500px; overflow-y: auto;"><JsonViewer :value="JSON.parse(data?.alarmInfo || '{}')" :expand-depth="5"></JsonViewer></div></j-descriptions-item>
|
||||
<j-descriptions-item label="告警说明" :span="1">
|
||||
<Ellipsis style="width: calc(100% - 20px)">
|
||||
<span>
|
||||
{{ description || '' }}
|
||||
</span>
|
||||
</Ellipsis>
|
||||
</j-descriptions-item>
|
||||
<j-descriptions-item label="告警流水" :span="2"
|
||||
><div style="max-height: 500px; overflow-y: auto">
|
||||
<JsonViewer
|
||||
:value="JSON.parse(data?.alarmInfo || '{}')"
|
||||
:expand-depth="5"
|
||||
></JsonViewer></div
|
||||
></j-descriptions-item>
|
||||
</j-descriptions>
|
||||
</j-modal>
|
||||
</template>
|
||||
|
@ -49,11 +65,12 @@ import { Store } from 'jetlinks-store';
|
|||
import JsonViewer from 'vue-json-viewer';
|
||||
const props = defineProps({
|
||||
data: Object,
|
||||
description: String,
|
||||
});
|
||||
const emit = defineEmits(['close'])
|
||||
const emit = defineEmits(['close']);
|
||||
const closeModal = () => {
|
||||
emit('close');
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
</style>
|
|
@ -13,7 +13,7 @@
|
|||
v-model:value="_value"
|
||||
:precision="3"
|
||||
:min="0"
|
||||
:max="6535"
|
||||
:max="65535"
|
||||
>
|
||||
<template #addonAfter>
|
||||
<j-select
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
v-model:value="_value"
|
||||
v-model:source="_source"
|
||||
@select="onChange"
|
||||
valueName="id"
|
||||
>
|
||||
<template v-slot="{ label }">
|
||||
<j-input :value="label" readonly />
|
||||
|
@ -15,6 +16,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import ParamsDropdown from '../../../components/ParamsDropdown';
|
||||
import { handleParamsData } from './index';
|
||||
|
||||
|
@ -101,7 +103,7 @@ const filterParamsData = (type?: string, data?: any[]): any[] => {
|
|||
};
|
||||
|
||||
const upperOptions = computed(() => {
|
||||
return filterParamsData(props.data.valueType?.type, props?.builtInList);
|
||||
return filterParamsData(props.data.valueType?.type, cloneDeep(props?.builtInList));
|
||||
});
|
||||
|
||||
const onChange = () => {
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
v-model:value="propertyModelRef.propertiesValue"
|
||||
v-model:source="propertyModelRef.source"
|
||||
@select="onValueChange"
|
||||
valueName="id"
|
||||
>
|
||||
<template v-slot="{ label }">
|
||||
<j-input readonly :value="label" placeholder="请选择" />
|
||||
|
@ -51,6 +52,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import ParamsDropdown from '../../../components/ParamsDropdown';
|
||||
import { handleParamsData } from './index';
|
||||
const props = defineProps({
|
||||
|
@ -122,7 +124,8 @@ const filterParamsData = (type?: string, data?: any[]): any[] => {
|
|||
};
|
||||
|
||||
const upperOptions = computed(() => {
|
||||
return filterParamsData(getType.value?.valueType?.type, props?.builtInList);
|
||||
const _data = filterParamsData(getType.value?.valueType?.type, cloneDeep(props?.builtInList))
|
||||
return _data
|
||||
});
|
||||
|
||||
const handleOptions = computed(() => {
|
||||
|
@ -162,7 +165,7 @@ const onChange = () => {
|
|||
});
|
||||
};
|
||||
|
||||
const onValueChange = () => {
|
||||
const onValueChange = (val: any) => {
|
||||
const obj = {
|
||||
[`${propertyModelRef.properties}`]: {
|
||||
value: propertyModelRef?.propertiesValue,
|
||||
|
@ -170,7 +173,7 @@ const onValueChange = () => {
|
|||
},
|
||||
};
|
||||
emit('update:value', obj);
|
||||
emit('change', propertyModelRef?.propertiesValue)
|
||||
emit('change', val?.name || val)
|
||||
};
|
||||
|
||||
watch(
|
||||
|
|
|
@ -183,7 +183,7 @@ watch(
|
|||
|
||||
<style lang="less">
|
||||
.action-search {
|
||||
padding: 0 0 24px 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.logo {
|
||||
|
|
|
@ -183,7 +183,7 @@ watch(
|
|||
|
||||
<style lang="less">
|
||||
.action-search {
|
||||
padding: 0 0 24px 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.logo {
|
||||
|
|
|
@ -79,6 +79,7 @@ const formRef = ref();
|
|||
const modelRef = reactive({});
|
||||
|
||||
watchEffect(() => {
|
||||
console.log(props?.value)
|
||||
Object.assign(modelRef, props?.value);
|
||||
});
|
||||
|
||||
|
|
|
@ -91,7 +91,7 @@ const source = computed(() => {
|
|||
});
|
||||
|
||||
const builtInList = ref<any[]>([]);
|
||||
const upperKey = ref();
|
||||
const upperKey = ref(props.value?.upperKey);
|
||||
|
||||
const sourceChange = (val: any) => {
|
||||
emit('update:value', {
|
||||
|
@ -160,6 +160,14 @@ watch(
|
|||
},
|
||||
{ deep: true, immediate: true },
|
||||
);
|
||||
|
||||
watch(
|
||||
() => props.value.upperKey,
|
||||
(newVal) => {
|
||||
upperKey.value = newVal
|
||||
},
|
||||
{ immediate: true },
|
||||
);
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
|
|
@ -176,10 +176,10 @@
|
|||
name="name"
|
||||
:required="true"
|
||||
:rules="[
|
||||
// {
|
||||
// required: true,
|
||||
// message: '请输入名称',
|
||||
// },
|
||||
{
|
||||
required: true,
|
||||
message: '请输入名称',
|
||||
},
|
||||
{
|
||||
max: 64,
|
||||
message: '最多可输入64个字符',
|
||||
|
@ -467,7 +467,7 @@ const checkName = (_: any, value: any) =>
|
|||
resolve('');
|
||||
}
|
||||
} else {
|
||||
reject('请输入名称');
|
||||
resolve('');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -69,7 +69,7 @@ import {
|
|||
select,
|
||||
getMaxDepth,
|
||||
} from './utils';
|
||||
import BaseMenu from './baseMenu';
|
||||
import BaseMenu from '@/views/init-home/data/baseMenu';
|
||||
import type { AntTreeNodeDropEvent } from 'ant-design-vue/es/tree';
|
||||
import { cloneDeep } from 'lodash';
|
||||
import { onlyMessage } from '@/utils/comm';
|
||||
|
|
|
@ -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#c93a8863ed93b90f620d3c011ec79ada218625dd"
|
||||
integrity sha512-ESpadoDCZHkedS0oFgQmuSUvoMLUk2OrCXwB6x4ED4crfKynLJtqjBYeY/f8Eb2TuRTLxElL/qv6dr+MTaJSeQ==
|
||||
resolved "http://47.108.170.157:9013/jetlinks-ui-components/-/jetlinks-ui-components-1.0.5.tgz#531a7cd5cc4069dc299f0efcc92411a4eee369e7"
|
||||
integrity sha512-7VHsz5lVG9PlFkHoJvEown4QARuVuasR+jDa9NNQ+pJSHAtHAeiIO1bpVTQKfE5WCyhCKPnN8yIerJLLzmQ1fA==
|
||||
dependencies:
|
||||
"@vueuse/core" "^9.12.0"
|
||||
ant-design-vue "^3.2.15"
|
||||
|
|
Loading…
Reference in New Issue