Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
6596016642
|
@ -73,11 +73,11 @@
|
||||||
import { PropType } from 'vue';
|
import { PropType } from 'vue';
|
||||||
import { DeleteOutlined, PlusOutlined } from '@ant-design/icons-vue';
|
import { DeleteOutlined, PlusOutlined } from '@ant-design/icons-vue';
|
||||||
import { useProductStore } from '@/store/product';
|
import { useProductStore } from '@/store/product';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import { useRuleEditorStore } from '@/store/ruleEditor';
|
import { useRuleEditorStore } from '@/store/ruleEditor';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { getWebSocket } from '@/utils/websocket';
|
import { getWebSocket } from '@/utils/websocket';
|
||||||
import { PropertyMetadata } from '@/views/device/Product/typings';
|
import { PropertyMetadata } from '@/views/device/Product/typings';
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -137,7 +137,7 @@ const runScript = () => {
|
||||||
}
|
}
|
||||||
if (!props.virtualRule?.script) {
|
if (!props.virtualRule?.script) {
|
||||||
isBeginning.value = true;
|
isBeginning.value = true;
|
||||||
message.warning('请编辑规则');
|
onlyMessage('请编辑规则', 'warning');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ws.value = getWebSocket(`virtual-property-debug-${props.id}-${new Date().getTime()}`,
|
ws.value = getWebSocket(`virtual-property-debug-${props.id}-${new Date().getTime()}`,
|
||||||
|
|
|
@ -105,13 +105,12 @@
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts" name="Debug">
|
<script setup lang="ts" name="Debug">
|
||||||
import { PropType } from 'vue';
|
import { PropType } from 'vue';
|
||||||
import { DeleteOutlined, PlusOutlined } from '@ant-design/icons-vue';
|
|
||||||
import { useProductStore } from '@/store/product';
|
import { useProductStore } from '@/store/product';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import { useRuleEditorStore } from '@/store/ruleEditor';
|
import { useRuleEditorStore } from '@/store/ruleEditor';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { getWebSocket } from '@/utils/websocket';
|
import { getWebSocket } from '@/utils/websocket';
|
||||||
import { PropertyMetadata } from '@/views/device/Product/typings';
|
import { PropertyMetadata } from '@/views/device/Product/typings';
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
virtualRule: Object as PropType<Record<any, any>>,
|
virtualRule: Object as PropType<Record<any, any>>,
|
||||||
|
@ -176,7 +175,7 @@ const runScript = () => {
|
||||||
}
|
}
|
||||||
if (!props.virtualRule?.script) {
|
if (!props.virtualRule?.script) {
|
||||||
isBeginning.value = true;
|
isBeginning.value = true;
|
||||||
message.warning('请编辑规则');
|
onlyMessage('请编辑规则', 'warning');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
ws.value = getWebSocket(
|
ws.value = getWebSocket(
|
||||||
|
|
|
@ -10,7 +10,9 @@
|
||||||
<div class="list-item-left">
|
<div class="list-item-left">
|
||||||
<div class="header">
|
<div class="header">
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<div>{{ props.data?.topicName }}</div>
|
<div>
|
||||||
|
{{ props.data?.topicName }}
|
||||||
|
</div>
|
||||||
<span :style="{color: state === 'unread' ? 'red' : '#AAAAAA'}">{{ state === 'unread' ? '未读' : '已读' }}</span>
|
<span :style="{color: state === 'unread' ? 'red' : '#AAAAAA'}">{{ state === 'unread' ? '未读' : '已读' }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="time">
|
<div class="time">
|
||||||
|
@ -126,25 +128,31 @@ const read = (type: '_read' | '_unread') => {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
// margin-bottom: 10px;
|
|
||||||
|
|
||||||
.title {
|
.title {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
width: calc(100% - 120px);
|
||||||
|
|
||||||
div {
|
div {
|
||||||
color: rgba(0, 0, 0, 0.85);
|
color: rgba(0, 0, 0, 0.85);
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
margin-right: 10px;
|
margin-right: 10px;
|
||||||
|
max-width: calc(100% - 40px);
|
||||||
|
white-space: nowrap;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
span {
|
span {
|
||||||
color: red;
|
color: red;
|
||||||
font-size: 13px;
|
font-size: 13px;
|
||||||
|
width: 30px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.time {
|
.time {
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
color: rgba(0, 0, 0, 0.45);
|
color: rgba(0, 0, 0, 0.45);
|
||||||
|
width: 120px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,6 @@ import {
|
||||||
templateDownload,
|
templateDownload,
|
||||||
} from '@/api/device/instance';
|
} from '@/api/device/instance';
|
||||||
import { EventSourcePolyfill } from 'event-source-polyfill';
|
import { EventSourcePolyfill } from 'event-source-polyfill';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
|
|
||||||
type Emits = {
|
type Emits = {
|
||||||
(e: 'update:modelValue', data: string[]): void;
|
(e: 'update:modelValue', data: string[]): void;
|
||||||
|
@ -138,7 +137,7 @@ const submitData = async (fileUrl: string) => {
|
||||||
};
|
};
|
||||||
source.onopen = () => {};
|
source.onopen = () => {};
|
||||||
} else {
|
} else {
|
||||||
message.error('请先上传文件');
|
onlyMessage('请先上传文件', 'error');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -149,9 +149,9 @@ import {
|
||||||
getSearchHistory,
|
getSearchHistory,
|
||||||
saveSearchHistory,
|
saveSearchHistory,
|
||||||
} from '@/api/comm';
|
} from '@/api/comm';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import LivePlayer from '@/components/Player/index.vue';
|
import LivePlayer from '@/components/Player/index.vue';
|
||||||
import MediaTool from '@/components/Player/mediaTool.vue';
|
import MediaTool from '@/components/Player/mediaTool.vue';
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
type Player = {
|
type Player = {
|
||||||
id?: string;
|
id?: string;
|
||||||
|
@ -347,10 +347,10 @@ const saveHistory = async () => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
getHistory();
|
getHistory();
|
||||||
message.success('保存成功');
|
onlyMessage('保存成功');
|
||||||
formRef.value.resetFields();
|
formRef.value.resetFields();
|
||||||
} else {
|
} else {
|
||||||
message.error('保存失败');
|
onlyMessage('保存失败', 'error');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((err: any) => {
|
.catch((err: any) => {
|
||||||
|
|
|
@ -56,10 +56,9 @@
|
||||||
|
|
||||||
<script lang="ts" setup name='JProUpload'>
|
<script lang="ts" setup name='JProUpload'>
|
||||||
import { UploadChangeParam, UploadProps } from 'ant-design-vue';
|
import { UploadChangeParam, UploadProps } from 'ant-design-vue';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import { FILE_UPLOAD } from '@/api/comm';
|
import { FILE_UPLOAD } from '@/api/comm';
|
||||||
import { TOKEN_KEY } from '@/utils/variable';
|
import { TOKEN_KEY } from '@/utils/variable';
|
||||||
import {getBase64, LocalStore} from '@/utils/comm';
|
import {getBase64, LocalStore, onlyMessage} from '@/utils/comm';
|
||||||
import { CSSProperties } from 'vue';
|
import { CSSProperties } from 'vue';
|
||||||
import ImageCropper from './Cropper.vue';
|
import ImageCropper from './Cropper.vue';
|
||||||
|
|
||||||
|
@ -132,7 +131,7 @@ const handleChange = (info: UploadChangeParam) => {
|
||||||
}
|
}
|
||||||
if (info.file.status === 'error') {
|
if (info.file.status === 'error') {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
message.error('上传失败');
|
onlyMessage('上传失败', 'error');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -141,15 +140,15 @@ const beforeUpload = (file: UploadProps['fileList'][number]) => {
|
||||||
const maxSize = props.size || 2 // 最大值
|
const maxSize = props.size || 2 // 最大值
|
||||||
if (!isType) {
|
if (!isType) {
|
||||||
if (props.errorMessage) {
|
if (props.errorMessage) {
|
||||||
message.error(props.errorMessage);
|
onlyMessage(props.errorMessage, 'error');
|
||||||
} else {
|
} else {
|
||||||
message.error(`请上传正确格式的图片`);
|
onlyMessage(`请上传正确格式的图片`, 'error');
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const isSize = file.size / 1024 / 1024 < maxSize;
|
const isSize = file.size / 1024 / 1024 < maxSize;
|
||||||
if (!isSize) {
|
if (!isSize) {
|
||||||
message.error(`图片大小必须小于${maxSize}M`);
|
onlyMessage(`图片大小必须小于${maxSize}M`, 'error');
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -426,7 +426,7 @@ import {
|
||||||
queryProductList,
|
queryProductList,
|
||||||
} from '@/api/northbound/alicloud';
|
} from '@/api/northbound/alicloud';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { message } from 'jetlinks-ui-components';
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
@ -547,7 +547,7 @@ const saveBtn = () => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
formRef.value.resetFields();
|
formRef.value.resetFields();
|
||||||
router.push('/iot/northbound/AliCloud');
|
router.push('/iot/northbound/AliCloud');
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,8 +138,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { query, _undeploy, _deploy, _delete } from '@/api/northbound/alicloud';
|
import { query, _undeploy, _deploy, _delete } from '@/api/northbound/alicloud';
|
||||||
import type { ActionsType } from '@/views/device/Instance/typings';
|
import type { ActionsType } from '@/views/device/Instance/typings';
|
||||||
import { getImage } from '@/utils/comm';
|
import { getImage, onlyMessage } from '@/utils/comm';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import { useMenuStore } from 'store/menu';
|
import { useMenuStore } from 'store/menu';
|
||||||
import BadgeStatus from '@/components/BadgeStatus/index.vue';
|
import BadgeStatus from '@/components/BadgeStatus/index.vue';
|
||||||
|
|
||||||
|
@ -264,10 +263,10 @@ const getActions = (
|
||||||
response = await _deploy(data.id);
|
response = await _deploy(data.id);
|
||||||
}
|
}
|
||||||
if (response && response.status === 200) {
|
if (response && response.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
instanceRef.value?.reload();
|
instanceRef.value?.reload();
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败!');
|
onlyMessage('操作失败!', 'error');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -287,10 +286,10 @@ const getActions = (
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
const resp = await _delete(data.id);
|
const resp = await _delete(data.id);
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
instanceRef.value?.reload();
|
instanceRef.value?.reload();
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败!');
|
onlyMessage('操作失败!', 'error');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -487,8 +487,8 @@ import {
|
||||||
detail,
|
detail,
|
||||||
} from '@/api/northbound/dueros';
|
} from '@/api/northbound/dueros';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import { useMenuStore } from '@/store/menu';
|
import { useMenuStore } from '@/store/menu';
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
const menuStory = useMenuStore();
|
const menuStory = useMenuStore();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
@ -708,7 +708,7 @@ const saveBtn = async () => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
formRef.value.resetFields();
|
formRef.value.resetFields();
|
||||||
menuStory.jumpPage('Northbound/DuerOS');
|
menuStory.jumpPage('Northbound/DuerOS');
|
||||||
}
|
}
|
||||||
|
|
|
@ -150,8 +150,7 @@ import {
|
||||||
queryTypes,
|
queryTypes,
|
||||||
} from '@/api/northbound/dueros';
|
} from '@/api/northbound/dueros';
|
||||||
import type { ActionsType } from '@/views/device/Instance/typings';
|
import type { ActionsType } from '@/views/device/Instance/typings';
|
||||||
import { getImage } from '@/utils/comm';
|
import { getImage, onlyMessage } from '@/utils/comm';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import { useMenuStore } from 'store/menu';
|
import { useMenuStore } from 'store/menu';
|
||||||
import BadgeStatus from '@/components/BadgeStatus/index.vue';
|
import BadgeStatus from '@/components/BadgeStatus/index.vue';
|
||||||
|
|
||||||
|
@ -303,10 +302,10 @@ const getActions = (
|
||||||
response = await _deploy(data.id);
|
response = await _deploy(data.id);
|
||||||
}
|
}
|
||||||
if (response && response.status === 200) {
|
if (response && response.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
instanceRef.value?.reload();
|
instanceRef.value?.reload();
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败!');
|
onlyMessage('操作失败!', 'error');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -326,10 +325,10 @@ const getActions = (
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
const resp = await _delete(data.id);
|
const resp = await _delete(data.id);
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
instanceRef.value?.reload();
|
instanceRef.value?.reload();
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败!');
|
onlyMessage('操作失败!', 'error');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -124,10 +124,9 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang='ts' name='AccountBind'>
|
<script setup lang='ts' name='AccountBind'>
|
||||||
import { getImage, LocalStore } from '@/utils/comm'
|
import { getImage, LocalStore, onlyMessage } from '@/utils/comm'
|
||||||
import { TOKEN_KEY } from '@/utils/variable'
|
import { TOKEN_KEY } from '@/utils/variable'
|
||||||
import { Form } from 'ant-design-vue'
|
import { Form } from 'ant-design-vue'
|
||||||
import { message } from 'ant-design-vue'
|
|
||||||
|
|
||||||
import { applicationInfo, bindAccount } from '@/api/bind'
|
import { applicationInfo, bindAccount } from '@/api/bind'
|
||||||
import { code, authLogin, userDetail } from '@/api/login'
|
import { code, authLogin, userDetail } from '@/api/login'
|
||||||
|
@ -196,7 +195,7 @@ const handleBind = async () => {
|
||||||
const code = getUrlCode()
|
const code = getUrlCode()
|
||||||
const res = await bindAccount(code)
|
const res = await bindAccount(code)
|
||||||
console.log('bindAccount: ', res)
|
console.log('bindAccount: ', res)
|
||||||
message.success('绑定成功')
|
onlyMessage('绑定成功')
|
||||||
goRedirect()
|
goRedirect()
|
||||||
setTimeout(() => window.close(), 1000)
|
setTimeout(() => window.close(), 1000)
|
||||||
}
|
}
|
||||||
|
@ -263,7 +262,7 @@ const handleLoginBind = () => {
|
||||||
const res = await authLogin(params)
|
const res = await authLogin(params)
|
||||||
console.log('res: ', res)
|
console.log('res: ', res)
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
message.success('登录成功')
|
onlyMessage('登录成功')
|
||||||
LocalStore.set(TOKEN_KEY, res.result!.token as string)
|
LocalStore.set(TOKEN_KEY, res.result!.token as string)
|
||||||
goRedirect()
|
goRedirect()
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,8 +22,8 @@
|
||||||
class="code-item"
|
class="code-item"
|
||||||
width="100%"
|
width="100%"
|
||||||
height="100%"
|
height="100%"
|
||||||
|
sandbox="allow-forms allow-scripts allow-same-origin allow-popups"
|
||||||
:src="url"
|
:src="url"
|
||||||
sandbox="allow-scripts allow-same-origin allow-popups"
|
|
||||||
v-if="!loading"
|
v-if="!loading"
|
||||||
></iframe>
|
></iframe>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
<template>
|
<template>
|
||||||
<j-modal width="350px" visible @cancel="emit('close')" :footer="null">
|
<j-modal width="350px" visible @cancel="emit('close')" :footer="null">
|
||||||
<template v-if="getType === 'notifier-dingTalk'">
|
<template v-if="getType === 'notifier-dingTalk'">
|
||||||
<div class="tip">暂未开发</div>
|
<div class="tip">绑定账号:{{ info }}</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="getType === 'notifier-weixin'">
|
<template v-else-if="getType === 'notifier-weixin'">
|
||||||
<div class="tip">暂未开发</div>
|
<div class="tip">绑定账号:{{ info }}</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="getType === 'notifier-email'">
|
<template v-else-if="getType === 'notifier-email'">
|
||||||
<div class="tip"> 绑定账号:{{ user.userInfos?.email }}</div>
|
<div class="tip">绑定账号:{{ user.userInfos?.email }}</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<div class="tip">绑定账号:{{ user.userInfos?.telephone }}</div>
|
<div class="tip">绑定账号:{{ user.userInfos?.telephone }}</div>
|
||||||
|
@ -17,16 +17,8 @@
|
||||||
<j-button
|
<j-button
|
||||||
@click="onBind"
|
@click="onBind"
|
||||||
type="primary"
|
type="primary"
|
||||||
v-if="
|
|
||||||
[
|
|
||||||
'notifier-email',
|
|
||||||
'notifier-voice',
|
|
||||||
'notifier-sms',
|
|
||||||
].includes(getType)
|
|
||||||
"
|
|
||||||
>更换绑定账号</j-button
|
>更换绑定账号</j-button
|
||||||
>
|
>
|
||||||
<j-button v-else @click="emit('close')">确定</j-button>
|
|
||||||
</div>
|
</div>
|
||||||
</j-modal>
|
</j-modal>
|
||||||
<EditInfo
|
<EditInfo
|
||||||
|
@ -35,14 +27,24 @@
|
||||||
@close="editInfoVisible = false"
|
@close="editInfoVisible = false"
|
||||||
@save="onSave"
|
@save="onSave"
|
||||||
/>
|
/>
|
||||||
|
<Bind
|
||||||
|
@close="visible = false"
|
||||||
|
v-if="visible"
|
||||||
|
:data="props.data"
|
||||||
|
:current="current"
|
||||||
|
@save="onBindSave"
|
||||||
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import { getIsBindThird } from '@/api/account/notificationSubscription';
|
||||||
import { useUserInfo } from '@/store/userInfo';
|
import { useUserInfo } from '@/store/userInfo';
|
||||||
import EditInfo from '../../EditInfo/index.vue';
|
import EditInfo from '../../EditInfo/index.vue';
|
||||||
|
import Bind from './Bind.vue';
|
||||||
|
|
||||||
const user = useUserInfo();
|
const user = useUserInfo();
|
||||||
const emit = defineEmits(['close', 'save', 'unsubscribe']);
|
const emit = defineEmits(['close', 'save', 'unsubscribe']);
|
||||||
|
const info = ref<any>(null);
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
// 外层数据
|
// 外层数据
|
||||||
|
@ -57,13 +59,22 @@ const props = defineProps({
|
||||||
});
|
});
|
||||||
|
|
||||||
const editInfoVisible = ref<boolean>(false);
|
const editInfoVisible = ref<boolean>(false);
|
||||||
|
const visible = ref<boolean>(false);
|
||||||
|
|
||||||
const getType = computed(() => {
|
const getType = computed(() => {
|
||||||
return props.current?.channelProvider;
|
return props.current?.channelProvider;
|
||||||
});
|
});
|
||||||
|
|
||||||
const onBind = () => {
|
const onBind = () => {
|
||||||
editInfoVisible.value = true;
|
if (
|
||||||
|
['notifier-voice', 'notifier-sms', 'notifier-email'].includes(
|
||||||
|
props.current?.channelProvider,
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
editInfoVisible.value = true;
|
||||||
|
} else {
|
||||||
|
visible.value = true
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const onSave = () => {
|
const onSave = () => {
|
||||||
|
@ -73,24 +84,34 @@ const onSave = () => {
|
||||||
emit('close');
|
emit('close');
|
||||||
};
|
};
|
||||||
|
|
||||||
// 更换绑定账号
|
const onBindSave = () => {
|
||||||
const onAccountChange = (_data: any) => {
|
emit('save', props.current);
|
||||||
// current.value = _data;
|
emit('close');
|
||||||
// if (
|
}
|
||||||
// ['notifier-voice', 'notifier-sms', 'notifier-email'].includes(
|
|
||||||
// _data?.channelProvider,
|
const handleSearch = async () => {
|
||||||
// )
|
if (
|
||||||
// ) {
|
!['notifier-voice', 'notifier-sms', 'notifier-email'].includes(
|
||||||
// editInfoVisible.value = true;
|
props.current?.channelProvider,
|
||||||
// } else {
|
)
|
||||||
// visible.value = true;
|
) {
|
||||||
// }
|
const resp: any = await getIsBindThird();
|
||||||
|
const _item = (resp?.result || []).find((item: any) => {
|
||||||
|
return (
|
||||||
|
props.current?.channelConfiguration?.notifierId ===
|
||||||
|
item?.provider
|
||||||
|
);
|
||||||
|
});
|
||||||
|
if (_item) {
|
||||||
|
info.value = _item?.providerName
|
||||||
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
watch(
|
watch(
|
||||||
() => props.current,
|
() => props.current,
|
||||||
() => {
|
() => {
|
||||||
// handleSearch();
|
handleSearch();
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
immediate: true,
|
immediate: true,
|
||||||
|
|
|
@ -45,10 +45,9 @@
|
||||||
|
|
||||||
<script lang="ts" setup name='JProUpload'>
|
<script lang="ts" setup name='JProUpload'>
|
||||||
import { UploadChangeParam, UploadProps } from 'ant-design-vue';
|
import { UploadChangeParam, UploadProps } from 'ant-design-vue';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import { FILE_UPLOAD } from '@/api/comm';
|
import { FILE_UPLOAD } from '@/api/comm';
|
||||||
import { TOKEN_KEY } from '@/utils/variable';
|
import { TOKEN_KEY } from '@/utils/variable';
|
||||||
import { getBase64, LocalStore } from '@/utils/comm';
|
import { getBase64, LocalStore, onlyMessage } from '@/utils/comm';
|
||||||
import { CSSProperties } from 'vue';
|
import { CSSProperties } from 'vue';
|
||||||
import ImageCropper from '@/components/Upload/Cropper.vue';
|
import ImageCropper from '@/components/Upload/Cropper.vue';
|
||||||
|
|
||||||
|
@ -116,7 +115,7 @@ const handleChange = (info: UploadChangeParam) => {
|
||||||
}
|
}
|
||||||
if (info.file.status === 'error') {
|
if (info.file.status === 'error') {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
message.error('上传失败');
|
onlyMessage('上传失败', 'error');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -125,15 +124,15 @@ const beforeUpload = (file: UploadProps['fileList'][number]) => {
|
||||||
const maxSize = props.size || 2; // 最大值
|
const maxSize = props.size || 2; // 最大值
|
||||||
if (!isType) {
|
if (!isType) {
|
||||||
if (props.errorMessage) {
|
if (props.errorMessage) {
|
||||||
message.error(props.errorMessage);
|
onlyMessage(props.errorMessage, 'error');
|
||||||
} else {
|
} else {
|
||||||
message.error(`请上传正确格式的图片`);
|
onlyMessage(`请上传正确格式的图片`, 'error');
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const isSize = file.size / 1024 / 1024 < maxSize;
|
const isSize = file.size / 1024 / 1024 < maxSize;
|
||||||
if (!isSize) {
|
if (!isSize) {
|
||||||
message.error(`图片大小必须小于${maxSize}M`);
|
onlyMessage(`图片大小必须小于${maxSize}M`, 'error');
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,11 +47,12 @@
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts" name="modifyModal">
|
<script setup lang="ts" name="modifyModal">
|
||||||
import { PropType } from 'vue';
|
import { PropType } from 'vue';
|
||||||
import { Form, message } from 'jetlinks-ui-components';
|
import { Form } from 'jetlinks-ui-components';
|
||||||
import { queryTree, saveTree, updateTree } from '@/api/device/category';
|
import { queryTree, saveTree, updateTree } from '@/api/device/category';
|
||||||
import { ValidateErrorEntity } from 'ant-design-vue/es/form/interface';
|
import { ValidateErrorEntity } from 'ant-design-vue/es/form/interface';
|
||||||
import { list } from '@/api/iot-card/home';
|
import { list } from '@/api/iot-card/home';
|
||||||
import { number } from 'echarts';
|
import { number } from 'echarts';
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
const emits = defineEmits(['refresh']);
|
const emits = defineEmits(['refresh']);
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
|
@ -136,11 +137,11 @@ const submitData = async () => {
|
||||||
}
|
}
|
||||||
const res = await saveTree(addParams.value);
|
const res = await saveTree(addParams.value);
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
emits('refresh');
|
emits('refresh');
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败!');
|
onlyMessage('操作失败!', 'error');
|
||||||
}
|
}
|
||||||
} else if (props.isAdd === 2) {
|
} else if (props.isAdd === 2) {
|
||||||
const id = updateObj.value.id;
|
const id = updateObj.value.id;
|
||||||
|
@ -152,11 +153,11 @@ const submitData = async () => {
|
||||||
};
|
};
|
||||||
const res = await updateTree(id, updateParams);
|
const res = await updateTree(id, updateParams);
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
emits('refresh');
|
emits('refresh');
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败!');
|
onlyMessage('操作失败!', 'error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -192,7 +193,7 @@ const show = async (row: any) => {
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
} else if (props.isChild === 2) {
|
} else if (props.isChild === 2) {
|
||||||
if (row.level === 5) {
|
if (row.level === 5) {
|
||||||
message.warning('树形结构最多添加5层');
|
onlyMessage('树形结构最多添加5层', 'warning');
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
} else {
|
} else {
|
||||||
addObj.value = row;
|
addObj.value = row;
|
||||||
|
|
|
@ -80,7 +80,7 @@
|
||||||
import { queryTree, deleteTree } from '@/api/device/category';
|
import { queryTree, deleteTree } from '@/api/device/category';
|
||||||
import type { ActionsType } from '@/components/Table/index.vue';
|
import type { ActionsType } from '@/components/Table/index.vue';
|
||||||
import ModifyModal from './components/modifyModal/index.vue';
|
import ModifyModal from './components/modifyModal/index.vue';
|
||||||
import { message } from 'jetlinks-ui-components';
|
import { onlyMessage } from '@/utils/comm';
|
||||||
const expandedRowKeys = ref<any>([]);
|
const expandedRowKeys = ref<any>([]);
|
||||||
const tableRef = ref<Record<string, any>>({});
|
const tableRef = ref<Record<string, any>>({});
|
||||||
const modifyRef = ref();
|
const modifyRef = ref();
|
||||||
|
@ -194,10 +194,10 @@ const getActions = (
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
const resp = await deleteTree(data.id);
|
const resp = await deleteTree(data.id);
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
tableRef.value.reload();
|
tableRef.value.reload();
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败!');
|
onlyMessage('操作失败!', 'error');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -91,9 +91,9 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { query, bindDevice } from '@/api/device/instance';
|
import { query, bindDevice } from '@/api/device/instance';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import { useInstanceStore } from '@/store/instance';
|
import { useInstanceStore } from '@/store/instance';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
const instanceStore = useInstanceStore();
|
const instanceStore = useInstanceStore();
|
||||||
const { detail } = storeToRefs(instanceStore);
|
const { detail } = storeToRefs(instanceStore);
|
||||||
|
@ -177,7 +177,7 @@ const cancelSelect = () => {
|
||||||
|
|
||||||
const handleOk = () => {
|
const handleOk = () => {
|
||||||
if (_selectedRowKeys.value.length === 0) {
|
if (_selectedRowKeys.value.length === 0) {
|
||||||
message.warning('请选择需要绑定的设备');
|
onlyMessage('请选择需要绑定的设备', 'warning');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
btnLoading.value = true;
|
btnLoading.value = true;
|
||||||
|
@ -185,7 +185,7 @@ const handleOk = () => {
|
||||||
.then((resp) => {
|
.then((resp) => {
|
||||||
emit('change', true);
|
emit('change', true);
|
||||||
cancelSelect();
|
cancelSelect();
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
btnLoading.value = false;
|
btnLoading.value = false;
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { treeEdgeMap, saveEdgeMap, addDevice } from '@/api/device/instance';
|
import { treeEdgeMap, saveEdgeMap, addDevice } from '@/api/device/instance';
|
||||||
import { message } from 'jetlinks-ui-components';
|
import { onlyMessage } from '@/utils/comm';
|
||||||
const _props = defineProps({
|
const _props = defineProps({
|
||||||
metaData: {
|
metaData: {
|
||||||
type: Array,
|
type: Array,
|
||||||
|
@ -132,7 +132,7 @@ const _delete = (_key: string) => {
|
||||||
|
|
||||||
const handleClick = async () => {
|
const handleClick = async () => {
|
||||||
if (!rightList.value.length) {
|
if (!rightList.value.length) {
|
||||||
message.warning('请选择采集器');
|
onlyMessage('请选择采集器', 'warning');
|
||||||
} else {
|
} else {
|
||||||
const params: any[] = [];
|
const params: any[] = [];
|
||||||
rightList.value.map((item: any) => {
|
rightList.value.map((item: any) => {
|
||||||
|
@ -159,11 +159,11 @@ const handleClick = async () => {
|
||||||
requestList: filterParms,
|
requestList: filterParms,
|
||||||
});
|
});
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
_emits('save');
|
_emits('save');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
message.error('暂无对应属性的映射');
|
onlyMessage('暂无对应属性的映射', 'error');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (filterParms && filterParms.length !== 0) {
|
if (filterParms && filterParms.length !== 0) {
|
||||||
|
@ -175,12 +175,12 @@ const handleClick = async () => {
|
||||||
requestList: filterParms,
|
requestList: filterParms,
|
||||||
});
|
});
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
_emits('save');
|
_emits('save');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
message.error('暂无对应属性的映射');
|
onlyMessage('暂无对应属性的映射', 'error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,8 +132,8 @@ import {
|
||||||
} from '@/api/device/instance';
|
} from '@/api/device/instance';
|
||||||
import MSelect from './MSelect.vue';
|
import MSelect from './MSelect.vue';
|
||||||
import PatchMapping from './PatchMapping.vue';
|
import PatchMapping from './PatchMapping.vue';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import { inject } from 'vue';
|
import { inject } from 'vue';
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
title: '名称',
|
title: '名称',
|
||||||
|
@ -225,7 +225,7 @@ const unbind = async (id: string) => {
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
_emit('getEdgeMap');
|
_emit('getEdgeMap');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -248,7 +248,7 @@ const onSave = async () => {
|
||||||
if (form.value) {
|
if (form.value) {
|
||||||
formRef.value.validateFields().then(async () => {
|
formRef.value.validateFields().then(async () => {
|
||||||
if (modelRef.dataSource.length === 0) {
|
if (modelRef.dataSource.length === 0) {
|
||||||
message.error('请配置物模型');
|
onlyMessage('请配置物模型', 'error');
|
||||||
} else {
|
} else {
|
||||||
channelList.value.forEach((item: any) => {
|
channelList.value.forEach((item: any) => {
|
||||||
modelRef.dataSource.forEach((i: any) => {
|
modelRef.dataSource.forEach((i: any) => {
|
||||||
|
@ -290,7 +290,7 @@ const onSave = async () => {
|
||||||
const save = async (item: any) => {
|
const save = async (item: any) => {
|
||||||
const res = await saveEdgeMap(instanceStore.current.id, item);
|
const res = await saveEdgeMap(instanceStore.current.id, item);
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
message.success('保存成功');
|
onlyMessage('保存成功');
|
||||||
_emit('close');
|
_emit('close');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -116,10 +116,10 @@ import type { ActionsType } from '@/components/Table';
|
||||||
import { query, unbindDevice, unbindBatchDevice } from '@/api/device/instance';
|
import { query, unbindDevice, unbindBatchDevice } from '@/api/device/instance';
|
||||||
import { useInstanceStore } from '@/store/instance';
|
import { useInstanceStore } from '@/store/instance';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
import { message } from 'ant-design-vue';
|
|
||||||
import BindChildDevice from './BindChildDevice/index.vue';
|
import BindChildDevice from './BindChildDevice/index.vue';
|
||||||
import { usePermissionStore } from '@/store/permission';
|
import { usePermissionStore } from '@/store/permission';
|
||||||
import SaveChild from './SaveChild/index.vue';
|
import SaveChild from './SaveChild/index.vue';
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
const instanceStore = useInstanceStore();
|
const instanceStore = useInstanceStore();
|
||||||
const { detail } = storeToRefs(instanceStore);
|
const { detail } = storeToRefs(instanceStore);
|
||||||
|
@ -242,7 +242,7 @@ const getActions = (data: Partial<Record<string, any>>): ActionsType[] => {
|
||||||
);
|
);
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
childDeviceRef.value?.reload();
|
childDeviceRef.value?.reload();
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -281,12 +281,12 @@ const handleUnBind = async () => {
|
||||||
_selectedRowKeys.value,
|
_selectedRowKeys.value,
|
||||||
);
|
);
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
cancelSelect();
|
cancelSelect();
|
||||||
childDeviceRef.value?.reload();
|
childDeviceRef.value?.reload();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
message.warning('请勾选需要解绑的数据');
|
onlyMessage('请勾选需要解绑的数据', 'warning');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import { Badge, Button, message, Popconfirm, Space } from "jetlinks-ui-components"
|
import { Badge, Button, Popconfirm, Space } from "jetlinks-ui-components"
|
||||||
import TitleComponent from '@/components/TitleComponent/index.vue'
|
import TitleComponent from '@/components/TitleComponent/index.vue'
|
||||||
import styles from './index.module.less'
|
import styles from './index.module.less'
|
||||||
import type { ListProps } from './util'
|
import type { ListProps } from './util'
|
||||||
|
@ -14,6 +14,7 @@ import { deployDevice } from "@/api/initHome"
|
||||||
import PermissionButton from '@/components/PermissionButton/index.vue'
|
import PermissionButton from '@/components/PermissionButton/index.vue'
|
||||||
import { useMenuStore } from "@/store/menu"
|
import { useMenuStore } from "@/store/menu"
|
||||||
import BindParentDevice from '../../components/BindParentDevice/index.vue'
|
import BindParentDevice from '../../components/BindParentDevice/index.vue'
|
||||||
|
import { onlyMessage } from "@/utils/comm"
|
||||||
|
|
||||||
type TypeProps = 'network' | 'child-device' | 'media' | 'cloud' | 'channel'
|
type TypeProps = 'network' | 'child-device' | 'media' | 'cloud' | 'channel'
|
||||||
|
|
||||||
|
@ -128,7 +129,7 @@ const Status = defineComponent({
|
||||||
unref(gateway)?.channelId,
|
unref(gateway)?.channelId,
|
||||||
);
|
);
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
list.value = modifyArrayList(
|
list.value = modifyArrayList(
|
||||||
list.value,
|
list.value,
|
||||||
{
|
{
|
||||||
|
@ -176,10 +177,10 @@ const Status = defineComponent({
|
||||||
resolve({});
|
resolve({});
|
||||||
}, time);
|
}, time);
|
||||||
} else {
|
} else {
|
||||||
message.error('请求发生错误')
|
onlyMessage('请求发生错误', 'error')
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
message.error('设备不含accessId')
|
onlyMessage('设备不含accessId', 'error')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
@ -296,7 +297,7 @@ const Status = defineComponent({
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
const resp = await startGateway(unref(device).accessId || '');
|
const resp = await startGateway(unref(device).accessId || '');
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
list.value = modifyArrayList(
|
list.value = modifyArrayList(
|
||||||
list.value,
|
list.value,
|
||||||
{
|
{
|
||||||
|
@ -328,10 +329,10 @@ const Status = defineComponent({
|
||||||
resolve({});
|
resolve({});
|
||||||
}, time);
|
}, time);
|
||||||
} else {
|
} else {
|
||||||
message.error('请求发生错误')
|
onlyMessage('请求发生错误', 'error')
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
message.error('设备不含accessId')
|
onlyMessage('设备不含accessId', 'error')
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (unref(gateway)?.state?.value === 'enabled') {
|
if (unref(gateway)?.state?.value === 'enabled') {
|
||||||
|
@ -426,7 +427,7 @@ const Status = defineComponent({
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
const resp = await startGateway(unref(device).accessId || '');
|
const resp = await startGateway(unref(device).accessId || '');
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
list.value = modifyArrayList(
|
list.value = modifyArrayList(
|
||||||
list.value,
|
list.value,
|
||||||
{
|
{
|
||||||
|
@ -540,7 +541,7 @@ const Status = defineComponent({
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
const resp = await _deploy(response?.result?.id || '');
|
const resp = await _deploy(response?.result?.id || '');
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
list.value = modifyArrayList(
|
list.value = modifyArrayList(
|
||||||
list.value,
|
list.value,
|
||||||
{
|
{
|
||||||
|
@ -650,7 +651,7 @@ const Status = defineComponent({
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
const resp = await _deployProduct(unref(device).productId || '');
|
const resp = await _deployProduct(unref(device).productId || '');
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
list.value = modifyArrayList(
|
list.value = modifyArrayList(
|
||||||
list.value,
|
list.value,
|
||||||
{
|
{
|
||||||
|
@ -729,7 +730,7 @@ const Status = defineComponent({
|
||||||
const resp = await _deploy(unref(device)?.id || '');
|
const resp = await _deploy(unref(device)?.id || '');
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
instanceStore.current.state = { value: 'offline', text: '离线' }
|
instanceStore.current.state = { value: 'offline', text: '离线' }
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
list.value = modifyArrayList(
|
list.value = modifyArrayList(
|
||||||
list.value,
|
list.value,
|
||||||
{
|
{
|
||||||
|
@ -1510,7 +1511,7 @@ const Status = defineComponent({
|
||||||
list.value = [...cloudInitList];
|
list.value = [...cloudInitList];
|
||||||
arr = [diagnoseGateway, diagnoseProduct, diagnoseDevice, diagnoseCTWing, diagnoseOnenet];
|
arr = [diagnoseGateway, diagnoseProduct, diagnoseDevice, diagnoseCTWing, diagnoseOnenet];
|
||||||
} else if (providerType === 'channel') {
|
} else if (providerType === 'channel') {
|
||||||
message.error('未开发');
|
onlyMessage('未开发', 'error');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (arr.length > 0) {
|
if (arr.length > 0) {
|
||||||
|
@ -1642,7 +1643,7 @@ const Status = defineComponent({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (flag) {
|
if (flag) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
}
|
}
|
||||||
}}>一键修复</Button>
|
}}>一键修复</Button>
|
||||||
}
|
}
|
||||||
|
@ -1738,7 +1739,7 @@ const Status = defineComponent({
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
const resp = await _deploy(response?.result?.id || '');
|
const resp = await _deploy(response?.result?.id || '');
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
list.value = modifyArrayList(
|
list.value = modifyArrayList(
|
||||||
list.value,
|
list.value,
|
||||||
{
|
{
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { treeEdgeMap, saveEdgeMap } from '@/api/device/instance';
|
import { treeEdgeMap, saveEdgeMap } from '@/api/device/instance';
|
||||||
import { message } from 'ant-design-vue/es';
|
import { onlyMessage } from '@/utils/comm';
|
||||||
const _props = defineProps({
|
const _props = defineProps({
|
||||||
metaData: {
|
metaData: {
|
||||||
type: Array,
|
type: Array,
|
||||||
|
@ -128,7 +128,7 @@ const _delete = (_key: string) => {
|
||||||
|
|
||||||
const handleClick = async () => {
|
const handleClick = async () => {
|
||||||
if (!rightList.value.length) {
|
if (!rightList.value.length) {
|
||||||
message.warning('请选择采集器');
|
onlyMessage('请选择采集器', 'warning');
|
||||||
} else {
|
} else {
|
||||||
const params: any[] = [];
|
const params: any[] = [];
|
||||||
rightList.value.map((item: any) => {
|
rightList.value.map((item: any) => {
|
||||||
|
@ -151,11 +151,11 @@ const handleClick = async () => {
|
||||||
requestList: filterParms,
|
requestList: filterParms,
|
||||||
});
|
});
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
_emits('save');
|
_emits('save');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
message.error('暂无对应属性的映射');
|
onlyMessage('暂无对应属性的映射', 'error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -45,9 +45,9 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ComponentInternalInstance } from 'vue';
|
import { ComponentInternalInstance } from 'vue';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import { useInstanceStore } from '@/store/instance';
|
import { useInstanceStore } from '@/store/instance';
|
||||||
import { execute } from '@/api/device/instance';
|
import { execute } from '@/api/device/instance';
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
const instanceStore = useInstanceStore();
|
const instanceStore = useInstanceStore();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
@ -115,7 +115,7 @@ const handleExecute = async (func: any) => {
|
||||||
JSON.parse(func.json),
|
JSON.parse(func.json),
|
||||||
);
|
);
|
||||||
if (!success) return;
|
if (!success) return;
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
func.executeResult = result instanceof Array ? result[0] : result;
|
func.executeResult = result instanceof Array ? result[0] : result;
|
||||||
proxy?.$forceUpdate();
|
proxy?.$forceUpdate();
|
||||||
};
|
};
|
||||||
|
|
|
@ -106,9 +106,9 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ComponentInternalInstance } from 'vue';
|
import { ComponentInternalInstance } from 'vue';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import { useInstanceStore } from '@/store/instance';
|
import { useInstanceStore } from '@/store/instance';
|
||||||
import { execute } from '@/api/device/instance';
|
import { execute } from '@/api/device/instance';
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
const instanceStore = useInstanceStore();
|
const instanceStore = useInstanceStore();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
@ -207,7 +207,7 @@ const handleExecute = async (func: any) => {
|
||||||
obj,
|
obj,
|
||||||
);
|
);
|
||||||
if (!success) return;
|
if (!success) return;
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
executeResult.value = result instanceof Array ? result[0] : result;
|
executeResult.value = result instanceof Array ? result[0] : result;
|
||||||
proxy?.$forceUpdate();
|
proxy?.$forceUpdate();
|
||||||
})
|
})
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { modify } from '@/api/device/instance';
|
import { modify } from '@/api/device/instance';
|
||||||
import { useInstanceStore } from '@/store/instance';
|
import { useInstanceStore } from '@/store/instance';
|
||||||
import { message } from 'jetlinks-ui-components';
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
const emit = defineEmits(['close', 'save']);
|
const emit = defineEmits(['close', 'save']);
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ const saveBtn = () => {
|
||||||
configuration: { ...values }
|
configuration: { ...values }
|
||||||
})
|
})
|
||||||
if(resp.status === 200){
|
if(resp.status === 200){
|
||||||
message.success('操作成功!')
|
onlyMessage('操作成功!')
|
||||||
emit('save');
|
emit('save');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -101,8 +101,8 @@ import {
|
||||||
_deploy,
|
_deploy,
|
||||||
configurationReset,
|
configurationReset,
|
||||||
} from '@/api/device/instance';
|
} from '@/api/device/instance';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import Save from './Save.vue';
|
import Save from './Save.vue';
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
const instanceStore = useInstanceStore();
|
const instanceStore = useInstanceStore();
|
||||||
const visible = ref<boolean>(false);
|
const visible = ref<boolean>(false);
|
||||||
|
@ -132,7 +132,7 @@ const deployBtn = async () => {
|
||||||
if (instanceStore.current.id) {
|
if (instanceStore.current.id) {
|
||||||
const resp = await _deploy(instanceStore.current.id);
|
const resp = await _deploy(instanceStore.current.id);
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
instanceStore.refresh(instanceStore.current.id);
|
instanceStore.refresh(instanceStore.current.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -142,7 +142,7 @@ const resetBtn = async () => {
|
||||||
if (instanceStore.current.id) {
|
if (instanceStore.current.id) {
|
||||||
const resp = await configurationReset(instanceStore.current.id);
|
const resp = await configurationReset(instanceStore.current.id);
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('恢复默认配置成功');
|
onlyMessage('恢复默认配置成功');
|
||||||
instanceStore.refresh(instanceStore.current.id);
|
instanceStore.refresh(instanceStore.current.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { queryUserListNoPaging, saveRelations } from '@/api/device/instance';
|
import { queryUserListNoPaging, saveRelations } from '@/api/device/instance';
|
||||||
import { useInstanceStore } from '@/store/instance';
|
import { useInstanceStore } from '@/store/instance';
|
||||||
import { message } from 'jetlinks-ui-components';
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
const emit = defineEmits(['close', 'save']);
|
const emit = defineEmits(['close', 'save']);
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ const saveBtn = () => {
|
||||||
if(param.length && instanceStore.current.id){
|
if(param.length && instanceStore.current.id){
|
||||||
const resp = await saveRelations(instanceStore.current.id, param);
|
const resp = await saveRelations(instanceStore.current.id, param);
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
emit('save');
|
emit('save');
|
||||||
formRef.value.resetFields();
|
formRef.value.resetFields();
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,9 +49,9 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { useInstanceStore } from '@/store/instance';
|
import { useInstanceStore } from '@/store/instance';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { saveTags, delTags } from '@/api/device/instance'
|
import { saveTags, delTags } from '@/api/device/instance'
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
const emit = defineEmits(['close', 'save']);
|
const emit = defineEmits(['close', 'save']);
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ const handleOk = async () => {
|
||||||
// 填值
|
// 填值
|
||||||
const resp = await saveTags(instanceStore.current?.id || '', list);
|
const resp = await saveTags(instanceStore.current?.id || '', list);
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const _list = (dataSource.value || []).filter((item: any) => item?.key && !item?.value);
|
const _list = (dataSource.value || []).filter((item: any) => item?.key && !item?.value);
|
||||||
|
|
|
@ -159,6 +159,7 @@ import {
|
||||||
} from '@/api/device/instance';
|
} from '@/api/device/instance';
|
||||||
import { message } from 'jetlinks-ui-components';
|
import { message } from 'jetlinks-ui-components';
|
||||||
import { isBoolean } from 'lodash';
|
import { isBoolean } from 'lodash';
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
const defaultValue =
|
const defaultValue =
|
||||||
'//解码函数\r\nfunction decode(context) {\r\n //原始报文\r\n var buffer = context.payload();\r\n // 转为json\r\n // var json = context.json();\r\n //mqtt 时通过此方法获取topic\r\n // var topic = context.topic();\r\n\r\n // 提取变量\r\n // var topicVars = context.pathVars("/{deviceId}/**",topic)\r\n //温度属性\r\n var temperature = buffer.getShort(3) * 10;\r\n //湿度属性\r\n var humidity = buffer.getShort(6) * 10;\r\n return {\r\n "temperature": temperature,\r\n "humidity": humidity\r\n };\r\n}\r\n';
|
'//解码函数\r\nfunction decode(context) {\r\n //原始报文\r\n var buffer = context.payload();\r\n // 转为json\r\n // var json = context.json();\r\n //mqtt 时通过此方法获取topic\r\n // var topic = context.topic();\r\n\r\n // 提取变量\r\n // var topicVars = context.pathVars("/{deviceId}/**",topic)\r\n //温度属性\r\n var temperature = buffer.getShort(3) * 10;\r\n //湿度属性\r\n var humidity = buffer.getShort(6) * 10;\r\n return {\r\n "temperature": temperature,\r\n "humidity": humidity\r\n };\r\n}\r\n';
|
||||||
|
@ -210,7 +211,7 @@ const rest = async () => {
|
||||||
);
|
);
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
getDeviceCode();
|
getDeviceCode();
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
//获取topic
|
//获取topic
|
||||||
|
@ -275,7 +276,7 @@ const save = async () => {
|
||||||
item,
|
item,
|
||||||
);
|
);
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
message.success('保存成功');
|
onlyMessage('保存成功');
|
||||||
getDeviceCode();
|
getDeviceCode();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -296,7 +297,7 @@ const debug = () => {
|
||||||
});
|
});
|
||||||
isTest.value = true;
|
isTest.value = true;
|
||||||
} else {
|
} else {
|
||||||
message.error('请输入topic');
|
onlyMessage('请输入topic', 'error');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (url.value !== '') {
|
if (url.value !== '') {
|
||||||
|
@ -313,7 +314,7 @@ const debug = () => {
|
||||||
});
|
});
|
||||||
isTest.value = true;
|
isTest.value = true;
|
||||||
} else {
|
} else {
|
||||||
message.error('请输入url');
|
onlyMessage('请输入url', 'error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -96,7 +96,7 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { queryMetric, saveMetric } from '@/api/device/instance';
|
import { queryMetric, saveMetric } from '@/api/device/instance';
|
||||||
import { useInstanceStore } from '@/store/instance';
|
import { useInstanceStore } from '@/store/instance';
|
||||||
import { message } from 'jetlinks-ui-components';
|
import { onlyMessage } from '@/utils/comm';
|
||||||
import { isNumber } from 'lodash-es';
|
import { isNumber } from 'lodash-es';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -191,7 +191,7 @@ const handleSave = () => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
emit('close');
|
emit('close');
|
||||||
formRef.value.resetFields();
|
formRef.value.resetFields();
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { setProperty } from '@/api/device/instance';
|
import { setProperty } from '@/api/device/instance';
|
||||||
import { useInstanceStore } from '@/store/instance';
|
import { useInstanceStore } from '@/store/instance';
|
||||||
import { message } from 'jetlinks-ui-components';
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
|
@ -105,7 +105,7 @@ const handleSave = () => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
emit('close');
|
emit('close');
|
||||||
formRef.value.resetFields();
|
formRef.value.resetFields();
|
||||||
}
|
}
|
||||||
|
|
|
@ -105,8 +105,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { getImage } from '@/utils/comm';
|
import { getImage, onlyMessage } from '@/utils/comm';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import ValueDetail from './ValueDetail.vue';
|
import ValueDetail from './ValueDetail.vue';
|
||||||
import { getType, imgMap, imgList, videoList, fileList } from './index';
|
import { getType, imgMap, imgList, videoList, fileList } from './index';
|
||||||
|
|
||||||
|
@ -149,9 +148,9 @@ const getDetail = (_type: string) => {
|
||||||
let flag: string = '';
|
let flag: string = '';
|
||||||
if (_type === 'img') {
|
if (_type === 'img') {
|
||||||
if (isHttps && value?.formatValue.indexOf('http:') !== -1) {
|
if (isHttps && value?.formatValue.indexOf('http:') !== -1) {
|
||||||
message.error('域名为https时,不支持访问http地址');
|
onlyMessage('域名为https时,不支持访问http地址', 'error');
|
||||||
} else if (temp.value) {
|
} else if (temp.value) {
|
||||||
message.error('该图片无法访问');
|
onlyMessage('该图片无法访问', 'error');
|
||||||
} else {
|
} else {
|
||||||
flag =
|
flag =
|
||||||
['.jpg', '.png'].find((item) =>
|
['.jpg', '.png'].find((item) =>
|
||||||
|
@ -162,11 +161,11 @@ const getDetail = (_type: string) => {
|
||||||
}
|
}
|
||||||
} else if (_type === 'video') {
|
} else if (_type === 'video') {
|
||||||
if (isHttps && value?.formatValue.indexOf('http:') !== -1) {
|
if (isHttps && value?.formatValue.indexOf('http:') !== -1) {
|
||||||
message.error('域名为https时,不支持访问http地址');
|
onlyMessage('域名为https时,不支持访问http地址', 'error');
|
||||||
} else if (
|
} else if (
|
||||||
['.rmvb', '.mvb'].some((item) => value?.formatValue.includes(item))
|
['.rmvb', '.mvb'].some((item) => value?.formatValue.includes(item))
|
||||||
) {
|
) {
|
||||||
message.error('当前仅支持播放.mp4,.flv,.m3u8格式的视频');
|
onlyMessage('当前仅支持播放.mp4,.flv,.m3u8格式的视频', 'error');
|
||||||
} else {
|
} else {
|
||||||
flag =
|
flag =
|
||||||
['.m3u8', '.flv', '.mp4'].find((item) =>
|
['.m3u8', '.flv', '.mp4'].find((item) =>
|
||||||
|
|
|
@ -85,10 +85,10 @@ import Detail from './Detail/index.vue';
|
||||||
import Indicators from './Indicators.vue';
|
import Indicators from './Indicators.vue';
|
||||||
import { getProperty } from '@/api/device/instance';
|
import { getProperty } from '@/api/device/instance';
|
||||||
import { useInstanceStore } from '@/store/instance';
|
import { useInstanceStore } from '@/store/instance';
|
||||||
import { message } from 'ant-design-vue';
|
|
||||||
import { getWebSocket } from '@/utils/websocket';
|
import { getWebSocket } from '@/utils/websocket';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
import { queryDashboard } from '@/api/comm';
|
import { queryDashboard } from '@/api/comm';
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
|
@ -194,7 +194,7 @@ const getActions = (data: Partial<Record<string, any>>) => {
|
||||||
data.id,
|
data.id,
|
||||||
);
|
);
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -51,8 +51,8 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { query, bindDevice } from '@/api/device/instance';
|
import { query, bindDevice } from '@/api/device/instance';
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
|
|
||||||
const emit = defineEmits(['cancel', 'ok']);
|
const emit = defineEmits(['cancel', 'ok']);
|
||||||
|
|
||||||
|
@ -151,7 +151,7 @@ const onSelectChange = (keys: string[]) => {
|
||||||
|
|
||||||
const handleOk = () => {
|
const handleOk = () => {
|
||||||
if (_selectedRowKeys.value.length === 0) {
|
if (_selectedRowKeys.value.length === 0) {
|
||||||
message.warning('请选择需要绑定的设备');
|
onlyMessage('请选择需要绑定的设备', 'warning');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
btnLoading.value = true;
|
btnLoading.value = true;
|
||||||
|
@ -159,7 +159,7 @@ const handleOk = () => {
|
||||||
.then((resp) => {
|
.then((resp) => {
|
||||||
if(resp.status === 200){
|
if(resp.status === 200){
|
||||||
emit('ok', _selectedRowKeys.value[0]);
|
emit('ok', _selectedRowKeys.value[0]);
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { treeMapping, saveMapping } from '@/api/device/instance';
|
import { treeMapping, saveMapping } from '@/api/device/instance';
|
||||||
import { message } from 'jetlinks-ui-components';
|
import { onlyMessage } from '@/utils/comm';
|
||||||
const _props = defineProps({
|
const _props = defineProps({
|
||||||
type: {
|
type: {
|
||||||
type: String,
|
type: String,
|
||||||
|
@ -135,7 +135,7 @@ const _delete = (_key: string) => {
|
||||||
|
|
||||||
const handleClick = async () => {
|
const handleClick = async () => {
|
||||||
if (!rightList.value.length) {
|
if (!rightList.value.length) {
|
||||||
message.warning('请选择采集器');
|
onlyMessage('请选择采集器', 'warning');
|
||||||
} else {
|
} else {
|
||||||
const params: any[] = [];
|
const params: any[] = [];
|
||||||
rightList.value.map((item: any) => {
|
rightList.value.map((item: any) => {
|
||||||
|
@ -154,11 +154,11 @@ const handleClick = async () => {
|
||||||
if (filterParms && filterParms.length !== 0) {
|
if (filterParms && filterParms.length !== 0) {
|
||||||
const res = await saveMapping(_props.deviceId, _props.type, filterParms);
|
const res = await saveMapping(_props.deviceId, _props.type, filterParms);
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
_emits('save');
|
_emits('save');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
message.error('暂无对应属性的映射');
|
onlyMessage('暂无对应属性的映射', 'error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -122,7 +122,7 @@ import {
|
||||||
} from '@/api/device/instance';
|
} from '@/api/device/instance';
|
||||||
import MSelect from '../MSelect.vue';
|
import MSelect from '../MSelect.vue';
|
||||||
import PatchMapping from './PatchMapping.vue';
|
import PatchMapping from './PatchMapping.vue';
|
||||||
import { message } from 'ant-design-vue/es';
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
|
@ -246,7 +246,7 @@ const unbind = async (id: string) => {
|
||||||
id,
|
id,
|
||||||
]);
|
]);
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
handleSearch();
|
handleSearch();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -275,7 +275,7 @@ const onSave = () => {
|
||||||
arr,
|
arr,
|
||||||
);
|
);
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
handleSearch();
|
handleSearch();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,8 +124,7 @@ import EdgeMap from './EdgeMap/index.vue';
|
||||||
import Parsing from './Parsing/index.vue';
|
import Parsing from './Parsing/index.vue';
|
||||||
import Log from './Log/index.vue';
|
import Log from './Log/index.vue';
|
||||||
import { _deploy, _disconnect } from '@/api/device/instance';
|
import { _deploy, _disconnect } from '@/api/device/instance';
|
||||||
import { message } from 'jetlinks-ui-components';
|
import { getImage, onlyMessage } from '@/utils/comm';
|
||||||
import { getImage } from '@/utils/comm';
|
|
||||||
import { getWebSocket } from '@/utils/websocket';
|
import { getWebSocket } from '@/utils/websocket';
|
||||||
import { useMenuStore } from '@/store/menu';
|
import { useMenuStore } from '@/store/menu';
|
||||||
import { useRouterParams } from '@/utils/hooks/useParams';
|
import { useRouterParams } from '@/utils/hooks/useParams';
|
||||||
|
@ -305,7 +304,7 @@ const handleAction = async () => {
|
||||||
if (instanceStore.current?.id) {
|
if (instanceStore.current?.id) {
|
||||||
const resp = await _deploy(instanceStore.current?.id);
|
const resp = await _deploy(instanceStore.current?.id);
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
instanceStore.refresh(instanceStore.current?.id);
|
instanceStore.refresh(instanceStore.current?.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -315,7 +314,7 @@ const handleDisconnect = async () => {
|
||||||
if (instanceStore.current?.id) {
|
if (instanceStore.current?.id) {
|
||||||
const resp = await _disconnect(instanceStore.current?.id);
|
const resp = await _disconnect(instanceStore.current?.id);
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
instanceStore.refresh(instanceStore.current?.id);
|
instanceStore.refresh(instanceStore.current?.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -324,7 +323,7 @@ const handleDisconnect = async () => {
|
||||||
const handleRefresh = async () => {
|
const handleRefresh = async () => {
|
||||||
if (instanceStore.current?.id) {
|
if (instanceStore.current?.id) {
|
||||||
await instanceStore.refresh(instanceStore.current?.id);
|
await instanceStore.refresh(instanceStore.current?.id);
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,6 @@ import { LocalStore, onlyMessage } from '@/utils/comm';
|
||||||
import { downloadFileByUrl } from '@/utils/utils';
|
import { downloadFileByUrl } from '@/utils/utils';
|
||||||
import { deviceImport, templateDownload } from '@/api/device/instance';
|
import { deviceImport, templateDownload } from '@/api/device/instance';
|
||||||
import { EventSourcePolyfill } from 'event-source-polyfill';
|
import { EventSourcePolyfill } from 'event-source-polyfill';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
product: {
|
product: {
|
||||||
|
@ -173,7 +172,7 @@ const submitData = async (fileUrl: string) => {
|
||||||
};
|
};
|
||||||
source.onopen = () => {};
|
source.onopen = () => {};
|
||||||
} else {
|
} else {
|
||||||
message.error('请先上传文件');
|
onlyMessage('请先上传文件', 'error');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -134,8 +134,7 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { queryNoPagingPost } from '@/api/device/product';
|
import { queryNoPagingPost } from '@/api/device/product';
|
||||||
import { isExists, update } from '@/api/device/instance';
|
import { isExists, update } from '@/api/device/instance';
|
||||||
import { getImage } from '@/utils/comm';
|
import { getImage, onlyMessage } from '@/utils/comm';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
|
|
||||||
const emit = defineEmits(['close', 'save']);
|
const emit = defineEmits(['close', 'save']);
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -217,7 +216,7 @@ const handleSave = () => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
emit('save');
|
emit('save');
|
||||||
formRef.value.resetFields();
|
formRef.value.resetFields();
|
||||||
}
|
}
|
||||||
|
|
|
@ -306,8 +306,7 @@ import {
|
||||||
batchDeployDevice,
|
batchDeployDevice,
|
||||||
batchDeleteDevice,
|
batchDeleteDevice,
|
||||||
} from '@/api/device/instance';
|
} from '@/api/device/instance';
|
||||||
import { getImage, LocalStore } from '@/utils/comm';
|
import { getImage, LocalStore, onlyMessage } from '@/utils/comm';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import Import from './Import/modal.vue';
|
import Import from './Import/modal.vue';
|
||||||
import Export from './Export/index.vue';
|
import Export from './Export/index.vue';
|
||||||
import Process from './Process/index.vue';
|
import Process from './Process/index.vue';
|
||||||
|
@ -671,10 +670,10 @@ const getActions = (
|
||||||
response = await _deploy(data.id);
|
response = await _deploy(data.id);
|
||||||
}
|
}
|
||||||
if (response && response.status === 200) {
|
if (response && response.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
instanceRef.value?.reload();
|
instanceRef.value?.reload();
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败!');
|
onlyMessage('操作失败!', 'error');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -694,10 +693,10 @@ const getActions = (
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
const resp = await _delete(data.id);
|
const resp = await _delete(data.id);
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
instanceRef.value?.reload();
|
instanceRef.value?.reload();
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败!');
|
onlyMessage('操作失败!', 'error');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -763,12 +762,12 @@ const syncDeviceStatus = () => {
|
||||||
|
|
||||||
const delSelectedDevice = async () => {
|
const delSelectedDevice = async () => {
|
||||||
if (!_selectedRowKeys.value.length) {
|
if (!_selectedRowKeys.value.length) {
|
||||||
message.error('请选择设备');
|
onlyMessage('请选择设备', 'error');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const resp = await batchDeleteDevice(_selectedRowKeys.value);
|
const resp = await batchDeleteDevice(_selectedRowKeys.value);
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
_selectedRowKeys.value = [];
|
_selectedRowKeys.value = [];
|
||||||
instanceRef.value?.reload();
|
instanceRef.value?.reload();
|
||||||
}
|
}
|
||||||
|
@ -776,12 +775,12 @@ const delSelectedDevice = async () => {
|
||||||
|
|
||||||
// const activeSelectedDevice = async () => {
|
// const activeSelectedDevice = async () => {
|
||||||
// if(!_selectedRowKeys.value.length){
|
// if(!_selectedRowKeys.value.length){
|
||||||
// message.error('请选择设备')
|
// onlyMessage('请选择设备', 'error')
|
||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
// const resp = await batchDeployDevice(_selectedRowKeys.value);
|
// const resp = await batchDeployDevice(_selectedRowKeys.value);
|
||||||
// if (resp.status === 200) {
|
// if (resp.status === 200) {
|
||||||
// message.success('操作成功!');
|
// onlyMessage('操作成功!');
|
||||||
// _selectedRowKeys.value = [];
|
// _selectedRowKeys.value = [];
|
||||||
// instanceRef.value?.reload();
|
// instanceRef.value?.reload();
|
||||||
// }
|
// }
|
||||||
|
@ -789,12 +788,12 @@ const delSelectedDevice = async () => {
|
||||||
|
|
||||||
const disabledSelectedDevice = async () => {
|
const disabledSelectedDevice = async () => {
|
||||||
if (!_selectedRowKeys.value.length) {
|
if (!_selectedRowKeys.value.length) {
|
||||||
message.error('请选择设备');
|
onlyMessage('请选择设备', 'error');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const resp = await batchUndeployDevice(_selectedRowKeys.value);
|
const resp = await batchUndeployDevice(_selectedRowKeys.value);
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
_selectedRowKeys.value = [];
|
_selectedRowKeys.value = [];
|
||||||
instanceRef.value?.reload();
|
instanceRef.value?.reload();
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,8 +117,8 @@ import {
|
||||||
testCode,
|
testCode,
|
||||||
saveProductCode,
|
saveProductCode,
|
||||||
} from '@/api/device/instance';
|
} from '@/api/device/instance';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import { isBoolean } from 'lodash';
|
import { isBoolean } from 'lodash';
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
const defaultValue =
|
const defaultValue =
|
||||||
'//解码函数\r\nfunction decode(context) {\r\n //原始报文\r\n var buffer = context.payload();\r\n // 转为json\r\n // var json = context.json();\r\n //mqtt 时通过此方法获取topic\r\n // var topic = context.topic();\r\n\r\n // 提取变量\r\n // var topicVars = context.pathVars("/{deviceId}/**",topic)\r\n //温度属性\r\n var temperature = buffer.getShort(3) * 10;\r\n //湿度属性\r\n var humidity = buffer.getShort(6) * 10;\r\n return {\r\n "temperature": temperature,\r\n "humidity": humidity\r\n };\r\n}\r\n';
|
'//解码函数\r\nfunction decode(context) {\r\n //原始报文\r\n var buffer = context.payload();\r\n // 转为json\r\n // var json = context.json();\r\n //mqtt 时通过此方法获取topic\r\n // var topic = context.topic();\r\n\r\n // 提取变量\r\n // var topicVars = context.pathVars("/{deviceId}/**",topic)\r\n //温度属性\r\n var temperature = buffer.getShort(3) * 10;\r\n //湿度属性\r\n var humidity = buffer.getShort(6) * 10;\r\n return {\r\n "temperature": temperature,\r\n "humidity": humidity\r\n };\r\n}\r\n';
|
||||||
|
@ -202,7 +202,7 @@ const save = async () => {
|
||||||
};
|
};
|
||||||
const res = await saveProductCode(productStore.current.id, item);
|
const res = await saveProductCode(productStore.current.id, item);
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
message.success('保存成功');
|
onlyMessage('保存成功');
|
||||||
getProductCode();
|
getProductCode();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -223,7 +223,7 @@ const debug = () => {
|
||||||
});
|
});
|
||||||
isTest.value = true;
|
isTest.value = true;
|
||||||
} else {
|
} else {
|
||||||
message.error('请输入topic');
|
onlyMessage('请输入topic', 'error');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (url.value !== '') {
|
if (url.value !== '') {
|
||||||
|
@ -240,7 +240,7 @@ const debug = () => {
|
||||||
});
|
});
|
||||||
isTest.value = true;
|
isTest.value = true;
|
||||||
} else {
|
} else {
|
||||||
message.error('请输入url');
|
onlyMessage('请输入url', 'error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
@ -125,9 +125,8 @@
|
||||||
|
|
||||||
<script setup lang='ts' name='accessModal'>
|
<script setup lang='ts' name='accessModal'>
|
||||||
import type { PropType } from 'vue'
|
import type { PropType } from 'vue'
|
||||||
import { getImage } from '@/utils/comm';
|
import { getImage, onlyMessage } from '@/utils/comm';
|
||||||
import { queryList, getAccessConfig } from '@/api/device/product'
|
import { queryList, getAccessConfig } from '@/api/device/product'
|
||||||
import { message } from 'jetlinks-ui-components'
|
|
||||||
import { useMenuStore } from '@/store/menu';
|
import { useMenuStore } from '@/store/menu';
|
||||||
import { getProductByPluginId } from '@/api/link/plugin'
|
import { getProductByPluginId } from '@/api/link/plugin'
|
||||||
import { getProviders } from '@/api/link/accessConfig'
|
import { getProviders } from '@/api/link/accessConfig'
|
||||||
|
@ -297,7 +296,7 @@ const submitData = async () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
message.error('请选择接入方式');
|
onlyMessage('请选择接入方式', 'error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -274,7 +274,7 @@
|
||||||
<script lang="ts" setup name='AccessConfig'>
|
<script lang="ts" setup name='AccessConfig'>
|
||||||
import { useProductStore } from '@/store/product';
|
import { useProductStore } from '@/store/product';
|
||||||
import { ConfigMetadata } from '@/views/device/Product/typings';
|
import { ConfigMetadata } from '@/views/device/Product/typings';
|
||||||
import { Empty, message } from 'jetlinks-ui-components';
|
import { Empty } from 'jetlinks-ui-components';
|
||||||
import Title from '../Title/index.vue';
|
import Title from '../Title/index.vue';
|
||||||
import { usePermissionStore } from '@/store/permission';
|
import { usePermissionStore } from '@/store/permission';
|
||||||
import { steps, steps1 } from './util';
|
import { steps, steps1 } from './util';
|
||||||
|
@ -306,6 +306,7 @@ import AccessModal from './accessModal.vue'
|
||||||
import MetaDataModal from './metadataModal.vue'
|
import MetaDataModal from './metadataModal.vue'
|
||||||
import { getPluginData, getProductByPluginId, savePluginData } from '@/api/link/plugin'
|
import { getPluginData, getProductByPluginId, savePluginData } from '@/api/link/plugin'
|
||||||
import { detail as queryPluginAccessDetail } from '@/api/link/accessConfig'
|
import { detail as queryPluginAccessDetail } from '@/api/link/accessConfig'
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
const productStore = useProductStore();
|
const productStore = useProductStore();
|
||||||
const tableRef = ref();
|
const tableRef = ref();
|
||||||
|
@ -799,7 +800,7 @@ const updateAccessData = async (id: string, values: any) => {
|
||||||
});
|
});
|
||||||
submitLoading.value = false
|
submitLoading.value = false
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
productStore.current!.storePolicy = storePolicy;
|
productStore.current!.storePolicy = storePolicy;
|
||||||
if ((window as any).onTabSaveSuccess) {
|
if ((window as any).onTabSaveSuccess) {
|
||||||
if (resp.result) {
|
if (resp.result) {
|
||||||
|
|
|
@ -36,10 +36,9 @@
|
||||||
|
|
||||||
<script lang='ts' setup name='MetadataModal'>
|
<script lang='ts' setup name='MetadataModal'>
|
||||||
import { useProductStore } from '@/store/product';
|
import { useProductStore } from '@/store/product';
|
||||||
import { getImage } from '@/utils/comm'
|
import { getImage, onlyMessage } from '@/utils/comm'
|
||||||
import { storeToRefs } from 'pinia'
|
import { storeToRefs } from 'pinia'
|
||||||
import { modify, updateDevice } from '@/api/device/product'
|
import { modify, updateDevice } from '@/api/device/product'
|
||||||
import { message } from 'jetlinks-ui-components'
|
|
||||||
import { savePluginData } from '@/api/link/plugin'
|
import { savePluginData } from '@/api/link/plugin'
|
||||||
|
|
||||||
type Emit = {
|
type Emit = {
|
||||||
|
@ -150,7 +149,7 @@ const updateAccessData = async (id: string, values: any, metadata: string) => {
|
||||||
});
|
});
|
||||||
loading.value = false
|
loading.value = false
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
productStore.current!.storePolicy = storePolicy;
|
productStore.current!.storePolicy = storePolicy;
|
||||||
if ((window as any).onTabSaveSuccess) {
|
if ((window as any).onTabSaveSuccess) {
|
||||||
if (resp.result) {
|
if (resp.result) {
|
||||||
|
|
|
@ -120,9 +120,7 @@ import {
|
||||||
getDeviceNumber,
|
getDeviceNumber,
|
||||||
getProtocolDetail,
|
getProtocolDetail,
|
||||||
} from '@/api/device/product';
|
} from '@/api/device/product';
|
||||||
import { message } from 'jetlinks-ui-components';
|
import { getImage, handleParamsToString, onlyMessage } from '@/utils/comm';
|
||||||
import { getImage, handleParamsToString } from '@/utils/comm';
|
|
||||||
import encodeQuery from '@/utils/encodeQuery';
|
|
||||||
import { useMenuStore } from '@/store/menu';
|
import { useMenuStore } from '@/store/menu';
|
||||||
import { useRouterParams } from '@/utils/hooks/useParams';
|
import { useRouterParams } from '@/utils/hooks/useParams';
|
||||||
|
|
||||||
|
@ -199,7 +197,7 @@ const handleDeploy = async () => {
|
||||||
if (productStore.current.id) {
|
if (productStore.current.id) {
|
||||||
const resp = await _deploy(productStore.current.id);
|
const resp = await _deploy(productStore.current.id);
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
productStore.refresh(productStore.current.id);
|
productStore.refresh(productStore.current.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -212,7 +210,7 @@ const handleUndeploy = async () => {
|
||||||
if (productStore.current.id) {
|
if (productStore.current.id) {
|
||||||
const resp = await _undeploy(productStore.current.id);
|
const resp = await _undeploy(productStore.current.id);
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
productStore.refresh(productStore.current.id);
|
productStore.refresh(productStore.current.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,10 +116,9 @@
|
||||||
import { category } from '@/api/device/product';
|
import { category } from '@/api/device/product';
|
||||||
import { Form } from 'jetlinks-ui-components';
|
import { Form } from 'jetlinks-ui-components';
|
||||||
import { getImage } from '@/utils/comm.ts';
|
import { getImage } from '@/utils/comm.ts';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import DialogTips from '../DialogTips/index.vue';
|
import DialogTips from '../DialogTips/index.vue';
|
||||||
import { useProductStore } from '@/store/product';
|
import { useProductStore } from '@/store/product';
|
||||||
import { filterTreeSelectNode, filterSelectNode } from '@/utils/comm';
|
import { filterTreeSelectNode, filterSelectNode, onlyMessage } from '@/utils/comm';
|
||||||
import { FILE_UPLOAD } from '@/api/comm';
|
import { FILE_UPLOAD } from '@/api/comm';
|
||||||
import { isInput } from '@/utils/regular';
|
import { isInput } from '@/utils/regular';
|
||||||
import type { Rule } from 'ant-design-vue/es/form';
|
import type { Rule } from 'ant-design-vue/es/form';
|
||||||
|
@ -316,12 +315,12 @@ const submitData = () => {
|
||||||
const res = await addProduct(form);
|
const res = await addProduct(form);
|
||||||
loading.value = false
|
loading.value = false
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
message.success('保存成功!');
|
onlyMessage('保存成功!');
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
emit('success');
|
emit('success');
|
||||||
dialogRef.value.show(res.result.id);
|
dialogRef.value.show(res.result.id);
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败');
|
onlyMessage('操作失败', 'error');
|
||||||
}
|
}
|
||||||
} else if (props.isAdd === 2) {
|
} else if (props.isAdd === 2) {
|
||||||
// 编辑
|
// 编辑
|
||||||
|
@ -335,11 +334,11 @@ const submitData = () => {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
});
|
});
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
message.success('保存成功!');
|
onlyMessage('保存成功!');
|
||||||
emit('success');
|
emit('success');
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败');
|
onlyMessage('操作失败', 'error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -174,8 +174,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import server from '@/utils/request';
|
import server from '@/utils/request';
|
||||||
import type { ActionsType } from '@/components/Table/index.vue';
|
import type { ActionsType } from '@/components/Table/index.vue';
|
||||||
import { getImage } from '@/utils/comm';
|
import { getImage, onlyMessage } from '@/utils/comm';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import {
|
import {
|
||||||
getProviders,
|
getProviders,
|
||||||
category,
|
category,
|
||||||
|
@ -334,10 +333,10 @@ const getActions = (
|
||||||
response = await _deploy(data.id);
|
response = await _deploy(data.id);
|
||||||
}
|
}
|
||||||
if (response && response.status === 200) {
|
if (response && response.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
tableRef.value?.reload();
|
tableRef.value?.reload();
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败!');
|
onlyMessage('操作失败!', 'error');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -354,10 +353,10 @@ const getActions = (
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
const resp = await deleteProduct(data.id);
|
const resp = await deleteProduct(data.id);
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
tableRef.value?.reload();
|
tableRef.value?.reload();
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败!');
|
onlyMessage('操作失败!', 'error');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -390,7 +389,7 @@ const beforeUpload = (file: any) => {
|
||||||
const text = result.target?.result;
|
const text = result.target?.result;
|
||||||
console.log('text: ', text);
|
console.log('text: ', text);
|
||||||
if (!file.type.includes('json')) {
|
if (!file.type.includes('json')) {
|
||||||
message.error('请上传json格式文件');
|
onlyMessage('请上传json格式文件', 'error');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
|
@ -398,18 +397,18 @@ const beforeUpload = (file: any) => {
|
||||||
// 设置导入的产品状态为未发布
|
// 设置导入的产品状态为未发布
|
||||||
data.state = 0;
|
data.state = 0;
|
||||||
if (Array.isArray(data)) {
|
if (Array.isArray(data)) {
|
||||||
message.error('请上传json格式文件');
|
onlyMessage('请上传json格式文件', 'error');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
delete data.state;
|
delete data.state;
|
||||||
const res = await updateDevice(data);
|
const res = await updateDevice(data);
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
tableRef.value?.reload();
|
tableRef.value?.reload();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} catch {
|
} catch {
|
||||||
// message.error('请上传json格式文件');
|
// onlyMessage('请上传json格式文件', 'error');
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
|
@ -14,7 +14,6 @@ import { useInstanceStore } from '@/store/instance';
|
||||||
import { useMetadataStore } from '@/store/metadata';
|
import { useMetadataStore } from '@/store/metadata';
|
||||||
import { useProductStore } from '@/store/product';
|
import { useProductStore } from '@/store/product';
|
||||||
import { ProductItem } from '@/views/device/Product/typings';
|
import { ProductItem } from '@/views/device/Product/typings';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import type { FormInstance } from 'ant-design-vue/es';
|
import type { FormInstance } from 'ant-design-vue/es';
|
||||||
import { updateMetadata, asyncUpdateMetadata } from '../../metadata'
|
import { updateMetadata, asyncUpdateMetadata } from '../../metadata'
|
||||||
import { detail } from '@/api/device/instance';
|
import { detail } from '@/api/device/instance';
|
||||||
|
@ -23,6 +22,7 @@ import BaseForm from './BaseForm.vue';
|
||||||
import { PropType } from 'vue';
|
import { PropType } from 'vue';
|
||||||
import { _deploy } from '@/api/device/product';
|
import { _deploy } from '@/api/device/product';
|
||||||
import { cloneDeep } from 'lodash';
|
import { cloneDeep } from 'lodash';
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
type: {
|
type: {
|
||||||
|
@ -79,7 +79,7 @@ const save = reactive({
|
||||||
const list = (_metadata[type] as any[]) || []
|
const list = (_metadata[type] as any[]) || []
|
||||||
if (formValue.id) {
|
if (formValue.id) {
|
||||||
if (metadataStore.model.action === 'add' && list.some(item => item.id === formValue.id)) {
|
if (metadataStore.model.action === 'add' && list.some(item => item.id === formValue.id)) {
|
||||||
message.error('标识已存在')
|
onlyMessage('标识已存在', 'error')
|
||||||
save.loading = false
|
save.loading = false
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -116,20 +116,14 @@ const save = reactive({
|
||||||
const res = await _deploy(id as string)
|
const res = await _deploy(id as string)
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
save.resetMetadata();
|
save.resetMetadata();
|
||||||
message.success({
|
onlyMessage('操作成功!');
|
||||||
key: 'metadata',
|
|
||||||
content: '操作成功!',
|
|
||||||
});
|
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败!');
|
onlyMessage('操作失败!', 'error');
|
||||||
}
|
}
|
||||||
// Store.set('product-deploy', deploy);
|
// Store.set('product-deploy', deploy);
|
||||||
} else {
|
} else {
|
||||||
// save.resetMetadata();
|
// save.resetMetadata();
|
||||||
message.success({
|
onlyMessage('操作成功!');
|
||||||
key: 'metadata',
|
|
||||||
content: '操作成功!',
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
metadataStore.set('edit', false)
|
metadataStore.set('edit', false)
|
||||||
metadataStore.set('item', {})
|
metadataStore.set('item', {})
|
||||||
|
@ -138,7 +132,7 @@ const save = reactive({
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败!');
|
onlyMessage('操作失败!', 'error');
|
||||||
}
|
}
|
||||||
save.loading = false
|
save.loading = false
|
||||||
})
|
})
|
||||||
|
|
|
@ -75,10 +75,11 @@ import { useInstanceStore } from '@/store/instance'
|
||||||
import { useProductStore } from '@/store/product'
|
import { useProductStore } from '@/store/product'
|
||||||
import { useMetadataStore } from '@/store/metadata'
|
import { useMetadataStore } from '@/store/metadata'
|
||||||
import PermissionButton from '@/components/PermissionButton/index.vue'
|
import PermissionButton from '@/components/PermissionButton/index.vue'
|
||||||
import { TablePaginationConfig, message } from 'ant-design-vue/es'
|
import { TablePaginationConfig } from 'ant-design-vue/es'
|
||||||
import { asyncUpdateMetadata, removeMetadata } from '../metadata'
|
import { asyncUpdateMetadata, removeMetadata } from '../metadata'
|
||||||
import Edit from './Edit/index.vue'
|
import Edit from './Edit/index.vue'
|
||||||
import { ColumnProps } from 'ant-design-vue/es/table'
|
import { ColumnProps } from 'ant-design-vue/es/table'
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
interface Props {
|
interface Props {
|
||||||
type: MetadataType;
|
type: MetadataType;
|
||||||
target: 'product' | 'device';
|
target: 'product' | 'device';
|
||||||
|
@ -164,7 +165,7 @@ const handleAddClick = () => {
|
||||||
metadataStore.set('type', type)
|
metadataStore.set('type', type)
|
||||||
metadataStore.set('action', 'add')
|
metadataStore.set('action', 'add')
|
||||||
if (props.target === 'device' && !instanceStore.detail?.independentMetadata) {
|
if (props.target === 'device' && !instanceStore.detail?.independentMetadata) {
|
||||||
message.warning('修改物模型后会脱离产品物模型')
|
onlyMessage('修改物模型后会脱离产品物模型', 'warning')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -186,7 +187,7 @@ const handleEditClick = (record: MetadataItem) => {
|
||||||
metadataStore.model.type = type;
|
metadataStore.model.type = type;
|
||||||
metadataStore.model.action = 'edit';
|
metadataStore.model.action = 'edit';
|
||||||
if (props.target === 'device' && !instanceStore.detail?.independentMetadata) {
|
if (props.target === 'device' && !instanceStore.detail?.independentMetadata) {
|
||||||
message.warning('修改物模型后会脱离产品物模型');
|
onlyMessage('修改物模型后会脱离产品物模型', 'warning');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,13 +214,13 @@ const removeItem = async (record: MetadataItem) => {
|
||||||
const _currentData = removeMetadata(type, [record], target === 'device' ? instanceStore.current : productStore.detail);
|
const _currentData = removeMetadata(type, [record], target === 'device' ? instanceStore.current : productStore.detail);
|
||||||
const result = await asyncUpdateMetadata(target, _currentData);
|
const result = await asyncUpdateMetadata(target, _currentData);
|
||||||
if (result.status === 200) {
|
if (result.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
// Store.set(SystemConst.REFRESH_METADATA_TABLE, true);
|
// Store.set(SystemConst.REFRESH_METADATA_TABLE, true);
|
||||||
metadataStore.model.edit = false;
|
metadataStore.model.edit = false;
|
||||||
metadataStore.model.item = {};
|
metadataStore.model.item = {};
|
||||||
resetMetadata();
|
resetMetadata();
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败!');
|
onlyMessage('操作失败!', 'error');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -26,13 +26,13 @@
|
||||||
</j-drawer>
|
</j-drawer>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts" name="Cat">
|
<script setup lang="ts" name="Cat">
|
||||||
import { message } from 'ant-design-vue/es';
|
|
||||||
import { downloadObject } from '@/utils/utils'
|
import { downloadObject } from '@/utils/utils'
|
||||||
import { useInstanceStore } from '@/store/instance';
|
import { useInstanceStore } from '@/store/instance';
|
||||||
import { useProductStore } from '@/store/product';
|
import { useProductStore } from '@/store/product';
|
||||||
import type { Key } from 'ant-design-vue/es/_util/type';
|
import type { Key } from 'ant-design-vue/es/_util/type';
|
||||||
import { convertMetadata, getCodecs, detail as productDetail } from '@/api/device/product';
|
import { convertMetadata, getCodecs, detail as productDetail } from '@/api/device/product';
|
||||||
import { detail } from '@/api/device/instance'
|
import { detail } from '@/api/device/instance'
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
visible: boolean;
|
visible: boolean;
|
||||||
|
@ -81,7 +81,7 @@ const handleExport = async () => {
|
||||||
'YYYY/MM/DD',
|
'YYYY/MM/DD',
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
message.error('请先配置物模型');
|
onlyMessage('请先配置物模型', 'error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -61,11 +61,10 @@ import { queryNoPagingPost, convertMetadata, modify } from '@/api/device/product
|
||||||
import type { DefaultOptionType } from 'ant-design-vue/es/select';
|
import type { DefaultOptionType } from 'ant-design-vue/es/select';
|
||||||
import type { UploadProps, UploadFile, UploadChangeParam } from 'ant-design-vue/es';
|
import type { UploadProps, UploadFile, UploadChangeParam } from 'ant-design-vue/es';
|
||||||
import type { DeviceMetadata } from '@/views/device/Product/typings'
|
import type { DeviceMetadata } from '@/views/device/Product/typings'
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import { useInstanceStore } from '@/store/instance'
|
import { useInstanceStore } from '@/store/instance'
|
||||||
import { useProductStore } from '@/store/product';
|
import { useProductStore } from '@/store/product';
|
||||||
import { FILE_UPLOAD } from '@/api/comm';
|
import { FILE_UPLOAD } from '@/api/comm';
|
||||||
import { getToken } from '@/utils/comm';
|
import { getToken, onlyMessage } from '@/utils/comm';
|
||||||
import { useMetadataStore } from '@/store/metadata';
|
import { useMetadataStore } from '@/store/metadata';
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
@ -216,12 +215,12 @@ const handleImport = async () => {
|
||||||
result = await modify(id as string, { id, metadata: JSON.stringify(metadata) }).catch(err => err)
|
result = await modify(id as string, { id, metadata: JSON.stringify(metadata) }).catch(err => err)
|
||||||
}
|
}
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
message.success('导入成功')
|
onlyMessage('导入成功')
|
||||||
}
|
}
|
||||||
loading.value = false
|
loading.value = false
|
||||||
} else {
|
} else {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
// message.error('物模型数据不正确!')
|
// onlyMessage('物模型数据不正确!', 'error')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (props?.type === 'device') {
|
if (props?.type === 'device') {
|
||||||
|
@ -239,7 +238,7 @@ const handleImport = async () => {
|
||||||
if (
|
if (
|
||||||
!(!!_object?.properties || !!_object?.events || !!_object?.functions || !!_object?.tags)
|
!(!!_object?.properties || !!_object?.events || !!_object?.functions || !!_object?.tags)
|
||||||
) {
|
) {
|
||||||
message.error('物模型数据不正确')
|
onlyMessage('物模型数据不正确', 'error')
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -257,7 +256,7 @@ const handleImport = async () => {
|
||||||
}
|
}
|
||||||
loading.value = false
|
loading.value = false
|
||||||
if (resp.success) {
|
if (resp.success) {
|
||||||
message.success('导入成功')
|
onlyMessage('导入成功')
|
||||||
}
|
}
|
||||||
if (props?.type === 'device') {
|
if (props?.type === 'device') {
|
||||||
await instanceStore.refresh(id as string)
|
await instanceStore.refresh(id as string)
|
||||||
|
@ -270,7 +269,7 @@ const handleImport = async () => {
|
||||||
close();
|
close();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
loading.value = false
|
loading.value = false
|
||||||
message.error(e === 'error' ? '物模型数据不正确' : '上传json格式的物模型文件')
|
onlyMessage(e === 'error' ? '物模型数据不正确' : '上传json格式的物模型文件', 'error')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
<script setup lang="ts" name="Metadata">
|
<script setup lang="ts" name="Metadata">
|
||||||
import PermissionButton from '@/components/PermissionButton/index.vue'
|
import PermissionButton from '@/components/PermissionButton/index.vue'
|
||||||
import { deleteMetadata } from '@/api/device/instance.js'
|
import { deleteMetadata } from '@/api/device/instance.js'
|
||||||
import { message } from 'ant-design-vue'
|
import { message } from 'jetlinks-ui-components';
|
||||||
import { useInstanceStore } from '@/store/instance'
|
import { useInstanceStore } from '@/store/instance'
|
||||||
import Import from './Import/index.vue'
|
import Import from './Import/index.vue'
|
||||||
import Cat from './Cat/index.vue'
|
import Cat from './Cat/index.vue'
|
||||||
|
|
|
@ -156,8 +156,7 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { queryNoPagingPost } from '@/api/device/product';
|
import { queryNoPagingPost } from '@/api/device/product';
|
||||||
import { isExists, update } from '@/api/device/instance';
|
import { isExists, update } from '@/api/device/instance';
|
||||||
import { getImage } from '@/utils/comm';
|
import { getImage, onlyMessage } from '@/utils/comm';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import SaveProduct from '@/views/media/Device/Save/SaveProduct.vue';
|
import SaveProduct from '@/views/media/Device/Save/SaveProduct.vue';
|
||||||
|
|
||||||
const emit = defineEmits(['close', 'save']);
|
const emit = defineEmits(['close', 'save']);
|
||||||
|
@ -253,7 +252,7 @@ const handleSave = () => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
});
|
});
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
emit('save');
|
emit('save');
|
||||||
formRef.value.resetFields();
|
formRef.value.resetFields();
|
||||||
}
|
}
|
||||||
|
|
|
@ -208,10 +208,9 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { queryGatewayList, queryNoPagingPost } from '@/api/device/product';
|
import { queryGatewayList, queryNoPagingPost } from '@/api/device/product';
|
||||||
import { queryTree } from '@/api/device/category';
|
import { queryTree } from '@/api/device/category';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import { ActionsType } from '@/views/device/Instance/typings';
|
import { ActionsType } from '@/views/device/Instance/typings';
|
||||||
import { useMenuStore } from '@/store/menu';
|
import { useMenuStore } from '@/store/menu';
|
||||||
import { getImage } from '@/utils/comm';
|
import { getImage, onlyMessage } from '@/utils/comm';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { query, _delete, _deploy, _undeploy } from '@/api/device/instance';
|
import { query, _delete, _deploy, _undeploy } from '@/api/device/instance';
|
||||||
import { restPassword } from '@/api/edge/device';
|
import { restPassword } from '@/api/edge/device';
|
||||||
|
@ -440,10 +439,10 @@ const getActions = (
|
||||||
response = await _deploy(data.id);
|
response = await _deploy(data.id);
|
||||||
}
|
}
|
||||||
if (response && response.status === 200) {
|
if (response && response.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
edgeDeviceRef.value?.reload();
|
edgeDeviceRef.value?.reload();
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败!');
|
onlyMessage('操作失败!', 'error');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -475,7 +474,7 @@ const getActions = (
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
restPassword(data.id).then((resp: any) => {
|
restPassword(data.id).then((resp: any) => {
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
edgeDeviceRef.value?.reload();
|
edgeDeviceRef.value?.reload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -499,10 +498,10 @@ const getActions = (
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
const resp = await _delete(data.id);
|
const resp = await _delete(data.id);
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
edgeDeviceRef.value?.reload();
|
edgeDeviceRef.value?.reload();
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败!');
|
onlyMessage('操作失败!', 'error');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -156,10 +156,9 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { queryNoPagingPost } from '@/api/device/instance';
|
import { queryNoPagingPost } from '@/api/device/instance';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import { ActionsType } from '@/views/device/Instance/typings';
|
import { ActionsType } from '@/views/device/Instance/typings';
|
||||||
import { useMenuStore } from '@/store/menu';
|
import { useMenuStore } from '@/store/menu';
|
||||||
import { getImage } from '@/utils/comm';
|
import { getImage, onlyMessage } from '@/utils/comm';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { query, _delete, _start, _stop } from '@/api/edge/resource';
|
import { query, _delete, _start, _stop } from '@/api/edge/resource';
|
||||||
import Save from './Save/index.vue';
|
import Save from './Save/index.vue';
|
||||||
|
@ -340,10 +339,10 @@ const getActions = (
|
||||||
response = await _start([data.id]);
|
response = await _start([data.id]);
|
||||||
}
|
}
|
||||||
if (response && response.status === 200) {
|
if (response && response.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
edgeResourceRef.value?.reload();
|
edgeResourceRef.value?.reload();
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败!');
|
onlyMessage('操作失败!', 'error');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -363,10 +362,10 @@ const getActions = (
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
const resp = await _delete(data.id);
|
const resp = await _delete(data.id);
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
edgeResourceRef.value?.reload();
|
edgeResourceRef.value?.reload();
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败!');
|
onlyMessage('操作失败!', 'error');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { bootConfig } from '../typing';
|
import { bootConfig } from '../typing';
|
||||||
import { useMenuStore } from '@/store/menu';
|
import { useMenuStore } from '@/store/menu';
|
||||||
import { message } from 'ant-design-vue';
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
const { jumpPage: _jumpPage } = useMenuStore();
|
const { jumpPage: _jumpPage } = useMenuStore();
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ const jumpPage = (item: bootConfig) => {
|
||||||
if (item.auth === undefined || item.auth) {
|
if (item.auth === undefined || item.auth) {
|
||||||
_jumpPage(item.link, item.params);
|
_jumpPage(item.link, item.params);
|
||||||
} else {
|
} else {
|
||||||
message.warning('暂无权限,请联系管理员');
|
onlyMessage('暂无权限,请联系管理员', 'warning');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -25,9 +25,9 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { message } from 'ant-design-vue';
|
|
||||||
import { bootConfig } from '../typing';
|
import { bootConfig } from '../typing';
|
||||||
import { useMenuStore } from '@/store/menu';
|
import { useMenuStore } from '@/store/menu';
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
cardData: Array<bootConfig>,
|
cardData: Array<bootConfig>,
|
||||||
|
@ -40,7 +40,7 @@ const jumpPage = (item: bootConfig) => {
|
||||||
if (item.auth === undefined || item.auth) {
|
if (item.auth === undefined || item.auth) {
|
||||||
_jumpPage(item.link, item.params);
|
_jumpPage(item.link, item.params);
|
||||||
} else {
|
} else {
|
||||||
message.warning('暂无权限,请联系管理员');
|
onlyMessage('暂无权限,请联系管理员', 'warning');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -26,9 +26,9 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { PropType } from 'vue';
|
import { PropType } from 'vue';
|
||||||
import { message } from 'ant-design-vue';
|
|
||||||
import { recommendList } from '../typing';
|
import { recommendList } from '../typing';
|
||||||
import { useMenuStore } from '@/store/menu';
|
import { useMenuStore } from '@/store/menu';
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
const { jumpPage: _jumpPage } = useMenuStore();
|
const { jumpPage: _jumpPage } = useMenuStore();
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ const props = defineProps({
|
||||||
// 跳转页面
|
// 跳转页面
|
||||||
const jumpPage = (row: recommendList) => {
|
const jumpPage = (row: recommendList) => {
|
||||||
if (row.auth === false) {
|
if (row.auth === false) {
|
||||||
return message.warning('暂无权限,请联系管理员');
|
return onlyMessage('暂无权限,请联系管理员', 'warning');
|
||||||
}
|
}
|
||||||
row.onClick ? row.onClick(row) : _jumpPage(row.linkUrl, row.params);
|
row.onClick ? row.onClick(row) : _jumpPage(row.linkUrl, row.params);
|
||||||
};
|
};
|
||||||
|
|
|
@ -42,8 +42,8 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import StatusLabel from '../StatusLabel.vue';
|
import StatusLabel from '../StatusLabel.vue';
|
||||||
import { getDeviceList_api } from '@/api/home';
|
import { getDeviceList_api } from '@/api/home';
|
||||||
import { message } from 'ant-design-vue';
|
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
const emits = defineEmits(['confirm', 'update:visible']);
|
const emits = defineEmits(['confirm', 'update:visible']);
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
@ -53,7 +53,7 @@ const props = defineProps<{
|
||||||
// 弹窗控制
|
// 弹窗控制
|
||||||
const confirm = () => {
|
const confirm = () => {
|
||||||
if (selectedKeys.value.length < 1) {
|
if (selectedKeys.value.length < 1) {
|
||||||
return message.warn('请选择设备');
|
return onlyMessage('请选择设备', 'warning');
|
||||||
}
|
}
|
||||||
emits('confirm', selectedKeys.value[0]);
|
emits('confirm', selectedKeys.value[0]);
|
||||||
emits('update:visible', false);
|
emits('update:visible', false);
|
||||||
|
|
|
@ -263,12 +263,12 @@
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { modalState, formState, logoState } from '../data/interface';
|
import { modalState, formState, logoState } from '../data/interface';
|
||||||
import { Form, message } from 'jetlinks-ui-components';
|
import { Form } from 'jetlinks-ui-components';
|
||||||
import { FILE_UPLOAD } from '@/api/comm';
|
import { FILE_UPLOAD } from '@/api/comm';
|
||||||
import {
|
import {
|
||||||
save,
|
save,
|
||||||
} from '@/api/initHome';
|
} from '@/api/initHome';
|
||||||
import { LocalStore, getImage } from '@/utils/comm';
|
import { LocalStore, getImage, onlyMessage } from '@/utils/comm';
|
||||||
import { TOKEN_KEY } from '@/utils/variable';
|
import { TOKEN_KEY } from '@/utils/variable';
|
||||||
import { SystemConst } from '@/utils/consts';
|
import { SystemConst } from '@/utils/consts';
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
|
@ -375,12 +375,12 @@ const saveBasicInfo = () => {
|
||||||
const beforeLogoUpload = (file: any) => {
|
const beforeLogoUpload = (file: any) => {
|
||||||
const isType: any = imageTypes.value.includes(file.type);
|
const isType: any = imageTypes.value.includes(file.type);
|
||||||
if (!isType) {
|
if (!isType) {
|
||||||
message.error(`请上传.jpg.png.jfif.pjp.pjpeg.jpeg格式的图片`);
|
onlyMessage(`请上传.jpg.png.jfif.pjp.pjpeg.jpeg格式的图片`, 'error');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const isSize = file.size / 1024 / 1024 < 4;
|
const isSize = file.size / 1024 / 1024 < 4;
|
||||||
if (!isSize) {
|
if (!isSize) {
|
||||||
message.error(`图片大小必须小于${4}M`);
|
onlyMessage(`图片大小必须小于${4}M`, 'error');
|
||||||
}
|
}
|
||||||
return isType && isSize;
|
return isType && isSize;
|
||||||
};
|
};
|
||||||
|
@ -404,12 +404,12 @@ const handleChangeLogo = (info: any) => {
|
||||||
const beforeIconUpload = (file: any) => {
|
const beforeIconUpload = (file: any) => {
|
||||||
const isType = iconTypes.value.includes(file.type);
|
const isType = iconTypes.value.includes(file.type);
|
||||||
if (!isType) {
|
if (!isType) {
|
||||||
message.error('请上传ico格式的图片');
|
onlyMessage('请上传ico格式的图片', 'error');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const isSize = file.size / 1024 / 1024 < 1;
|
const isSize = file.size / 1024 / 1024 < 1;
|
||||||
if (!isSize) {
|
if (!isSize) {
|
||||||
message.error('支持1M以内的图片');
|
onlyMessage('支持1M以内的图片', 'error');
|
||||||
}
|
}
|
||||||
return isType && isSize;
|
return isType && isSize;
|
||||||
};
|
};
|
||||||
|
@ -432,12 +432,12 @@ const changeIconUpload = (info: any) => {
|
||||||
const beforeBackUpload = (file: any) => {
|
const beforeBackUpload = (file: any) => {
|
||||||
const isType = imageTypes.value.includes(file.type);
|
const isType = imageTypes.value.includes(file.type);
|
||||||
if (!isType) {
|
if (!isType) {
|
||||||
message.error(`请上传.jpg.png.jfif.pjp.pjpeg.jpeg格式的图片`);
|
onlyMessage(`请上传.jpg.png.jfif.pjp.pjpeg.jpeg格式的图片`, 'error');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const isSize = file.size / 1024 / 1024 < 4;
|
const isSize = file.size / 1024 / 1024 < 4;
|
||||||
if (!isSize) {
|
if (!isSize) {
|
||||||
message.error(`图片大小必须小于${4}M`);
|
onlyMessage(`图片大小必须小于${4}M`, 'error');
|
||||||
}
|
}
|
||||||
return isType && isSize;
|
return isType && isSize;
|
||||||
};
|
};
|
||||||
|
|
|
@ -117,7 +117,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { getImage } from '@/utils/comm';
|
import { getImage, onlyMessage } from '@/utils/comm';
|
||||||
import {
|
import {
|
||||||
saveNetwork,
|
saveNetwork,
|
||||||
getResourcesCurrent,
|
getResourcesCurrent,
|
||||||
|
@ -131,7 +131,6 @@ import {
|
||||||
} from '@/api/initHome';
|
} from '@/api/initHome';
|
||||||
import { modalState } from '../data/interface';
|
import { modalState } from '../data/interface';
|
||||||
import type { Rule } from 'ant-design-vue/es/form';
|
import type { Rule } from 'ant-design-vue/es/form';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
/**
|
/**
|
||||||
* 初始化数据状态
|
* 初始化数据状态
|
||||||
|
@ -321,7 +320,7 @@ const saveCurrentData = () => {
|
||||||
const { optionPorts, isSucessInit } = toRefs(initialization);
|
const { optionPorts, isSucessInit } = toRefs(initialization);
|
||||||
const handelSave = () => {
|
const handelSave = () => {
|
||||||
formRef.value.validate().then(() => {
|
formRef.value.validate().then(() => {
|
||||||
message.success('保存成功');
|
onlyMessage('保存成功');
|
||||||
flag.value = true;
|
flag.value = true;
|
||||||
visible.value = false;
|
visible.value = false;
|
||||||
});
|
});
|
||||||
|
|
|
@ -67,8 +67,7 @@ import InitData from './InitData/index.vue';
|
||||||
import { getInit, saveInit } from '@/api/initHome';
|
import { getInit, saveInit } from '@/api/initHome';
|
||||||
import { BASE_API_PATH, TOKEN_KEY } from '@/utils/variable';
|
import { BASE_API_PATH, TOKEN_KEY } from '@/utils/variable';
|
||||||
import { FILE_UPLOAD } from '@/api/comm';
|
import { FILE_UPLOAD } from '@/api/comm';
|
||||||
import { LocalStore } from '@/utils/comm';
|
import { onlyMessage } from '@/utils/comm';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import { useUserInfo } from '@/store/userInfo';
|
import { useUserInfo } from '@/store/userInfo';
|
||||||
const basicRef = ref();
|
const basicRef = ref();
|
||||||
const roleRef = ref();
|
const roleRef = ref();
|
||||||
|
@ -121,7 +120,7 @@ const submitData = async () => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
// 当前数据是否成功提交
|
// 当前数据是否成功提交
|
||||||
if (basicRes && menuRes && roleRes && initDataRes) {
|
if (basicRes && menuRes && roleRes && initDataRes) {
|
||||||
message.success('保存成功');
|
onlyMessage('保存成功');
|
||||||
// // 记录初始化数据,跳转首页
|
// // 记录初始化数据,跳转首页
|
||||||
const res = await saveInit();
|
const res = await saveInit();
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
|
|
|
@ -46,7 +46,7 @@
|
||||||
<script setup lang='ts'>
|
<script setup lang='ts'>
|
||||||
import { queryUnbounded, bind } from '@/api/iot-card/cardManagement'
|
import { queryUnbounded, bind } from '@/api/iot-card/cardManagement'
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
import { message } from 'jetlinks-ui-components'
|
import { onlyMessage } from '@/utils/comm'
|
||||||
|
|
||||||
const emit = defineEmits(['change'])
|
const emit = defineEmits(['change'])
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ const handleOk = () => {
|
||||||
bind(props.cardId, _selectedRowKeys.value[0])
|
bind(props.cardId, _selectedRowKeys.value[0])
|
||||||
.then((resp: any) => {
|
.then((resp: any) => {
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功')
|
onlyMessage('操作成功')
|
||||||
emit('change', true)
|
emit('change', true)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -145,10 +145,10 @@ const getConfig = async () => {
|
||||||
// .then((resp: any) => {
|
// .then((resp: any) => {
|
||||||
// totalCount.value = resp.result.total;
|
// totalCount.value = resp.result.total;
|
||||||
// importStatus.value = true;
|
// importStatus.value = true;
|
||||||
// message.success('导入成功');
|
// onlyMessage('导入成功');
|
||||||
// })
|
// })
|
||||||
// .catch((err) => {
|
// .catch((err) => {
|
||||||
// message.error(err.response.data.message || '导入失败');
|
// onlyMessage(err.response.data.message || '导入失败', 'error');
|
||||||
// })
|
// })
|
||||||
// .finally(() => {
|
// .finally(() => {
|
||||||
// loading.value = false;
|
// loading.value = false;
|
||||||
|
|
|
@ -103,8 +103,7 @@ import {
|
||||||
add,
|
add,
|
||||||
edit,
|
edit,
|
||||||
} from '@/api/iot-card/cardManagement';
|
} from '@/api/iot-card/cardManagement';
|
||||||
import { message } from 'jetlinks-ui-components';
|
import { onlyMessage } from '@/utils/comm';
|
||||||
import { OperatorList, TypeList } from '@/views/iot-card/data';
|
|
||||||
|
|
||||||
const emit = defineEmits(['change']);
|
const emit = defineEmits(['change']);
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
|
@ -248,7 +247,7 @@ const handleOk = () => {
|
||||||
: await edit(toRaw(modelRef)).catch(err => err);
|
: await edit(toRaw(modelRef)).catch(err => err);
|
||||||
btnLoading.value = false;
|
btnLoading.value = false;
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功')
|
onlyMessage('操作成功')
|
||||||
emit('change', true);
|
emit('change', true);
|
||||||
formRef.value.resetFields();
|
formRef.value.resetFields();
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,6 @@ import { TOKEN_KEY } from '@/utils/variable';
|
||||||
import { LocalStore, onlyMessage } from '@/utils/comm';
|
import { LocalStore, onlyMessage } from '@/utils/comm';
|
||||||
import { downloadFileByUrl } from '@/utils/utils';
|
import { downloadFileByUrl } from '@/utils/utils';
|
||||||
import { exportCard, _import } from '@/api/iot-card/cardManagement';
|
import { exportCard, _import } from '@/api/iot-card/cardManagement';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
|
|
||||||
type Emits = {
|
type Emits = {
|
||||||
(e: 'update:modelValue', data: string[]): void;
|
(e: 'update:modelValue', data: string[]): void;
|
||||||
|
@ -102,7 +101,8 @@ const uploadChange = async (info: Record<string, any>) => {
|
||||||
_import(props.product, { fileUrl: resp.result })
|
_import(props.product, { fileUrl: resp.result })
|
||||||
.then((response: any) => {
|
.then((response: any) => {
|
||||||
count.value = response.result?.total || 0
|
count.value = response.result?.total || 0
|
||||||
message.success('导入成功');
|
onlyMessage('导入成功');
|
||||||
|
errMessage.value = '';
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
errMessage.value = err?.response?.data?.message || '导入失败'
|
errMessage.value = err?.response?.data?.message || '导入失败'
|
||||||
|
|
|
@ -415,9 +415,8 @@ import {
|
||||||
removeCards,
|
removeCards,
|
||||||
unbind,
|
unbind,
|
||||||
} from '@/api/iot-card/cardManagement';
|
} from '@/api/iot-card/cardManagement';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import type { CardManagement } from './typing';
|
import type { CardManagement } from './typing';
|
||||||
import { getImage } from '@/utils/comm';
|
import { getImage, onlyMessage } from '@/utils/comm';
|
||||||
import BindDevice from './BindDevice.vue';
|
import BindDevice from './BindDevice.vue';
|
||||||
import Import from './Import.vue';
|
import Import from './Import.vue';
|
||||||
import Export from './Export.vue';
|
import Export from './Export.vue';
|
||||||
|
@ -635,7 +634,7 @@ const getActions = (
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
unbind(data.id).then((resp: any) => {
|
unbind(data.id).then((resp: any) => {
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
cardManageRef.value?.reload();
|
cardManageRef.value?.reload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -687,21 +686,21 @@ const getActions = (
|
||||||
if (data.cardStateType?.value === 'toBeActivated') {
|
if (data.cardStateType?.value === 'toBeActivated') {
|
||||||
changeDeploy(data.id).then((resp) => {
|
changeDeploy(data.id).then((resp) => {
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
cardManageRef.value?.reload();
|
cardManageRef.value?.reload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (data.cardStateType?.value === 'deactivate') {
|
} else if (data.cardStateType?.value === 'deactivate') {
|
||||||
resumption(data.id).then((resp) => {
|
resumption(data.id).then((resp) => {
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
cardManageRef.value?.reload();
|
cardManageRef.value?.reload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
unDeploy(data.id).then((resp) => {
|
unDeploy(data.id).then((resp) => {
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
cardManageRef.value?.reload();
|
cardManageRef.value?.reload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -722,10 +721,10 @@ const getActions = (
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
const resp: any = await del(data.id);
|
const resp: any = await del(data.id);
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
cardManageRef.value?.reload();
|
cardManageRef.value?.reload();
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败!');
|
onlyMessage('操作失败!', 'error');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -833,7 +832,7 @@ const bindDevice = (val: boolean) => {
|
||||||
*/
|
*/
|
||||||
const handleActive = () => {
|
const handleActive = () => {
|
||||||
if (!_selectedRowKeys.value.length) {
|
if (!_selectedRowKeys.value.length) {
|
||||||
return message.warn('请选择数据');
|
return onlyMessage('请选择数据', 'warning');
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
_selectedRowKeys.value.length >= 10 &&
|
_selectedRowKeys.value.length >= 10 &&
|
||||||
|
@ -841,11 +840,11 @@ const handleActive = () => {
|
||||||
) {
|
) {
|
||||||
changeDeployBatch(_selectedRowKeys.value).then((res: any) => {
|
changeDeployBatch(_selectedRowKeys.value).then((res: any) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
message.warn('仅支持同一个运营商下且最少10条数据,最多100条数据');
|
onlyMessage('仅支持同一个运营商下且最少10条数据,最多100条数据', 'warning');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -859,11 +858,11 @@ const handleStop = () => {
|
||||||
) {
|
) {
|
||||||
unDeployBatch(_selectedRowKeys.value).then((res: any) => {
|
unDeployBatch(_selectedRowKeys.value).then((res: any) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
message.warn('仅支持同一个运营商下且最少10条数据,最多100条数据');
|
onlyMessage('仅支持同一个运营商下且最少10条数据,最多100条数据', 'warning');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -877,11 +876,11 @@ const handleResumption = () => {
|
||||||
) {
|
) {
|
||||||
resumptionBatch(_selectedRowKeys.value).then((res: any) => {
|
resumptionBatch(_selectedRowKeys.value).then((res: any) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
message.warn('仅支持同一个运营商下且最少10条数据,最多100条数据');
|
onlyMessage('仅支持同一个运营商下且最少10条数据,最多100条数据', 'warning');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -892,7 +891,7 @@ const handleSync = () => {
|
||||||
sync().then((res: any) => {
|
sync().then((res: any) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
cardManageRef.value?.reload();
|
cardManageRef.value?.reload();
|
||||||
message.success('同步状态成功');
|
onlyMessage('同步状态成功');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -902,12 +901,12 @@ const handleSync = () => {
|
||||||
*/
|
*/
|
||||||
const handelRemove = async () => {
|
const handelRemove = async () => {
|
||||||
if (!_selectedRowKeys.value.length) {
|
if (!_selectedRowKeys.value.length) {
|
||||||
message.error('请选择数据');
|
onlyMessage('请选择数据', 'error');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const resp = await removeCards(_selectedRowKeys.value.map( v => ({ id:v })));
|
const resp = await removeCards(_selectedRowKeys.value.map( v => ({ id:v })));
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
_selectedRowKeys.value = [];
|
_selectedRowKeys.value = [];
|
||||||
// _selectedRow.value = [];
|
// _selectedRow.value = [];
|
||||||
cardManageRef.value?.reload();
|
cardManageRef.value?.reload();
|
||||||
|
|
|
@ -88,14 +88,13 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts" name='IotCardHome'>
|
<script setup lang="ts" name='IotCardHome'>
|
||||||
import { getImage } from '@/utils/comm';
|
import { getImage, onlyMessage } from '@/utils/comm';
|
||||||
import Guide from '../components/Guide.vue';
|
import Guide from '../components/Guide.vue';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { queryFlow, list } from '@/api/iot-card/home';
|
import { queryFlow, list } from '@/api/iot-card/home';
|
||||||
import * as echarts from 'echarts';
|
import * as echarts from 'echarts';
|
||||||
import { useMenuStore } from '@/store/menu';
|
import { useMenuStore } from '@/store/menu';
|
||||||
import { usePermissionStore } from '@/store/permission';
|
import { usePermissionStore } from '@/store/permission';
|
||||||
import { message } from 'jetlinks-ui-components'
|
|
||||||
|
|
||||||
const { proxy } = <any>getCurrentInstance();
|
const { proxy } = <any>getCurrentInstance();
|
||||||
|
|
||||||
|
@ -180,7 +179,7 @@ const pieChartData = ref<any[]>([
|
||||||
|
|
||||||
const jumpPage = (data: GuideItemProps) => {
|
const jumpPage = (data: GuideItemProps) => {
|
||||||
if (!data.auth){
|
if (!data.auth){
|
||||||
message.warning('暂无权限,请联系管理员');
|
onlyMessage('暂无权限,请联系管理员', 'warning');
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (data.key === 'EQUIPMENT') {
|
if (data.key === 'EQUIPMENT') {
|
||||||
|
|
|
@ -132,9 +132,9 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import PlatformType from '@/views/iot-card/components/PlatformType.vue';
|
import PlatformType from '@/views/iot-card/components/PlatformType.vue';
|
||||||
import { queryById, save, update } from '@/api/iot-card/platform';
|
import { queryById, save, update } from '@/api/iot-card/platform';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import Doc from '../doc/index.vue';
|
import Doc from '../doc/index.vue';
|
||||||
import { platformTypeList } from '../../data'
|
import { platformTypeList } from '../../data'
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
@ -219,7 +219,7 @@ const handleSave = async () => {
|
||||||
? await save(formData)
|
? await save(formData)
|
||||||
: await update({ id: route.params.id, ...formData });
|
: await update({ id: route.params.id, ...formData });
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
message.success('保存成功!');
|
onlyMessage('保存成功!');
|
||||||
router.back();
|
router.back();
|
||||||
}
|
}
|
||||||
saveBtnLoading.value = false;
|
saveBtnLoading.value = false;
|
||||||
|
|
|
@ -85,9 +85,8 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { getImage } from '@/utils/comm';
|
import { getImage, onlyMessage } from '@/utils/comm';
|
||||||
import type { ActionsType } from '@/components/Table';
|
import type { ActionsType } from '@/components/Table';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import { queryList, update, del } from '@/api/iot-card/platform';
|
import { queryList, update, del } from '@/api/iot-card/platform';
|
||||||
import { useMenuStore } from 'store/menu'
|
import { useMenuStore } from 'store/menu'
|
||||||
const menuStory = useMenuStore()
|
const menuStory = useMenuStore()
|
||||||
|
@ -150,7 +149,7 @@ const columns = [
|
||||||
const statusUpdate = async (data: any) => {
|
const statusUpdate = async (data: any) => {
|
||||||
const res = await update(data);
|
const res = await update(data);
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
platformRef.value?.reload();
|
platformRef.value?.reload();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -222,10 +221,10 @@ const getActions = (
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
const resp: any = await del(data.id);
|
const resp: any = await del(data.id);
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
platformRef.value?.reload();
|
platformRef.value?.reload();
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败!');
|
onlyMessage('操作失败!', 'error');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -68,7 +68,6 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { queryPlatformNoPage, recharge } from '@/api/iot-card/cardManagement';
|
import { queryPlatformNoPage, recharge } from '@/api/iot-card/cardManagement';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import { PaymentMethod } from '@/views/iot-card/data';
|
import { PaymentMethod } from '@/views/iot-card/data';
|
||||||
import { onlyMessage } from '@/utils/comm'
|
import { onlyMessage } from '@/utils/comm'
|
||||||
|
|
||||||
|
@ -168,7 +167,7 @@ const handleOk = () => {
|
||||||
btnLoading.value = false;
|
btnLoading.value = false;
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
if (resp.result === '失败') {
|
if (resp.result === '失败') {
|
||||||
message.error('缴费失败')
|
onlyMessage('缴费失败', 'error')
|
||||||
} else if(!resp.result) {
|
} else if(!resp.result) {
|
||||||
onlyMessage('操作过于频繁,请稍后再试!', 'warning')
|
onlyMessage('操作过于频繁,请稍后再试!', 'warning')
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -75,8 +75,8 @@ import { ID_Rule, Max_Length_64, Max_Length_200, RequiredStringFn } from '@/comp
|
||||||
import UploadFile from './UploadFile.vue'
|
import UploadFile from './UploadFile.vue'
|
||||||
import { FileUploadResult } from '@/views/link/plugin/typings'
|
import { FileUploadResult } from '@/views/link/plugin/typings'
|
||||||
import { add, update, vailIdFn } from '@/api/link/plugin'
|
import { add, update, vailIdFn } from '@/api/link/plugin'
|
||||||
import { message } from 'jetlinks-ui-components'
|
|
||||||
import { TypeMap } from './util'
|
import { TypeMap } from './util'
|
||||||
|
import { onlyMessage } from '@/utils/comm'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
data: {
|
data: {
|
||||||
|
@ -139,7 +139,7 @@ const handleSave = async () => {
|
||||||
const resp = props.data.id ? await update(modelRef).catch(() => { success: false }) : await add(modelRef).catch(() => { success: false })
|
const resp = props.data.id ? await update(modelRef).catch(() => { success: false }) : await add(modelRef).catch(() => { success: false })
|
||||||
loading.value = false
|
loading.value = false
|
||||||
if (resp.success) {
|
if (resp.success) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
if (route.query.save && (window as any).onTabSaveSuccess) {
|
if (route.query.save && (window as any).onTabSaveSuccess) {
|
||||||
(window as any).onTabSaveSuccess(resp);
|
(window as any).onTabSaveSuccess(resp);
|
||||||
setTimeout(() => window.close(), 300);
|
setTimeout(() => window.close(), 300);
|
||||||
|
|
|
@ -134,9 +134,8 @@
|
||||||
|
|
||||||
<script setup lang='ts' name='PluginIndex'>
|
<script setup lang='ts' name='PluginIndex'>
|
||||||
import SaveModal from './Save.vue'
|
import SaveModal from './Save.vue'
|
||||||
import { getImage } from '@/utils/comm'
|
import { getImage, onlyMessage } from '@/utils/comm'
|
||||||
import { queryPage, removeFn, getTypes } from '@/api/link/plugin'
|
import { queryPage, removeFn, getTypes } from '@/api/link/plugin'
|
||||||
import { message } from 'jetlinks-ui-components'
|
|
||||||
import { TypeMap } from './util'
|
import { TypeMap } from './util'
|
||||||
|
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
|
@ -247,10 +246,10 @@ const getActions = (data: any) => {
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
const resp = await removeFn(data.id);
|
const resp = await removeFn(data.id);
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
instanceRef.value?.reload();
|
instanceRef.value?.reload();
|
||||||
} else {
|
} else {
|
||||||
message.error(resp?.message || '操作失败!');
|
onlyMessage(resp?.message || '操作失败!', 'error');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -67,7 +67,7 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import CascadeApi from '@/api/media/cascade';
|
import CascadeApi from '@/api/media/cascade';
|
||||||
import { message } from 'jetlinks-ui-components';
|
import { onlyMessage } from '@/utils/comm';
|
||||||
import { PropType } from 'vue';
|
import { PropType } from 'vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
@ -171,7 +171,7 @@ const onSelectChange = (keys: string[]) => {
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const handleSave = async () => {
|
const handleSave = async () => {
|
||||||
if (!_selectedRowKeys.value.length) {
|
if (!_selectedRowKeys.value.length) {
|
||||||
message.error('请勾选数据');
|
onlyMessage('请勾选数据', 'error');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
|
@ -181,11 +181,11 @@ const handleSave = async () => {
|
||||||
);
|
);
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
if (resp.success) {
|
if (resp.success) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
_vis.value = false;
|
_vis.value = false;
|
||||||
emit('submit');
|
emit('submit');
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败!');
|
onlyMessage('操作失败!', 'error');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -156,8 +156,8 @@
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import CascadeApi from '@/api/media/cascade';
|
import CascadeApi from '@/api/media/cascade';
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
import type { ActionsType } from '@/views/device/Instance/typings';
|
import type { ActionsType } from '@/views/device/Instance/typings';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import BindChannel from './BindChannel/index.vue';
|
import BindChannel from './BindChannel/index.vue';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
@ -275,10 +275,10 @@ const getActions = (
|
||||||
[data.channelId],
|
[data.channelId],
|
||||||
);
|
);
|
||||||
if (resp.success) {
|
if (resp.success) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
listRef.value?.reload();
|
listRef.value?.reload();
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败!');
|
onlyMessage('操作失败!', 'error');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -292,7 +292,7 @@ const getActions = (
|
||||||
*/
|
*/
|
||||||
const handleMultipleUnbind = async () => {
|
const handleMultipleUnbind = async () => {
|
||||||
if (!_selectedRowKeys.value.length) {
|
if (!_selectedRowKeys.value.length) {
|
||||||
message.error('请先选择需要解绑的通道列表');
|
onlyMessage('请先选择需要解绑的通道列表', 'error');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const channelIds = listRef.value?._dataSource
|
const channelIds = listRef.value?._dataSource
|
||||||
|
@ -303,10 +303,10 @@ const handleMultipleUnbind = async () => {
|
||||||
channelIds,
|
channelIds,
|
||||||
);
|
);
|
||||||
if (resp.success) {
|
if (resp.success) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
listRef.value?.reload();
|
listRef.value?.reload();
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败!');
|
onlyMessage('操作失败!', 'error');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -316,7 +316,7 @@ const handleMultipleUnbind = async () => {
|
||||||
const gbID = ref('');
|
const gbID = ref('');
|
||||||
const loading = ref(false);
|
const loading = ref(false);
|
||||||
const handleSave = async (data: any) => {
|
const handleSave = async (data: any) => {
|
||||||
if (!gbID.value) message.error('请输入国标ID');
|
if (!gbID.value) onlyMessage('请输入国标ID', 'error');
|
||||||
if (!valid.value?.passed) return;
|
if (!valid.value?.passed) return;
|
||||||
|
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
|
@ -325,12 +325,12 @@ const handleSave = async (data: any) => {
|
||||||
});
|
});
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
if (resp.success) {
|
if (resp.success) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
listRef.value?.reload();
|
listRef.value?.reload();
|
||||||
valid.value = undefined;
|
valid.value = undefined;
|
||||||
gbID.value = '';
|
gbID.value = '';
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败!');
|
onlyMessage('操作失败!', 'error');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -558,8 +558,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { getImage } from '@/utils/comm';
|
import { getImage, onlyMessage } from '@/utils/comm';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import CascadeApi from '@/api/media/cascade';
|
import CascadeApi from '@/api/media/cascade';
|
||||||
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
@ -753,7 +752,7 @@ const handleSubmit = () => {
|
||||||
btnLoading.value = true;
|
btnLoading.value = true;
|
||||||
CascadeApi[id ? 'update' : 'save'](params)
|
CascadeApi[id ? 'update' : 'save'](params)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
router.back();
|
router.back();
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
|
|
|
@ -153,8 +153,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import CascadeApi from '@/api/media/cascade';
|
import CascadeApi from '@/api/media/cascade';
|
||||||
import type { ActionsType } from '@/views/device/Instance/typings';
|
import type { ActionsType } from '@/views/device/Instance/typings';
|
||||||
import { message } from 'jetlinks-ui-components';
|
import { getImage, onlyMessage } from '@/utils/comm';
|
||||||
import { getImage } from '@/utils/comm';
|
|
||||||
import Publish from './Publish/index.vue';
|
import Publish from './Publish/index.vue';
|
||||||
|
|
||||||
import { useMenuStore } from 'store/menu';
|
import { useMenuStore } from 'store/menu';
|
||||||
|
@ -353,10 +352,10 @@ const getActions = (
|
||||||
: await CascadeApi.enabled(data.id);
|
: await CascadeApi.enabled(data.id);
|
||||||
|
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
listRef.value?.reload();
|
listRef.value?.reload();
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败!');
|
onlyMessage('操作失败!', 'error');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -376,10 +375,10 @@ const getActions = (
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
const resp = await CascadeApi.del(data.id);
|
const resp = await CascadeApi.del(data.id);
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
listRef.value?.reload();
|
listRef.value?.reload();
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败!');
|
onlyMessage('操作失败!', 'error');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -167,8 +167,8 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import ChannelApi from '@/api/media/channel';
|
import ChannelApi from '@/api/media/channel';
|
||||||
import { PropType } from 'vue';
|
import { PropType } from 'vue';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import type { Rule } from 'ant-design-vue/es/form';
|
import type { Rule } from 'ant-design-vue/es/form';
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
|
||||||
|
@ -305,11 +305,11 @@ const handleSubmit = () => {
|
||||||
: await ChannelApi.save(extraFormData);
|
: await ChannelApi.save(extraFormData);
|
||||||
btnLoading.value = false;
|
btnLoading.value = false;
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
_vis.value = false;
|
_vis.value = false;
|
||||||
emit('submit');
|
emit('submit');
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败');
|
onlyMessage('操作失败', 'error');
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch((err: any) => {
|
.catch((err: any) => {
|
||||||
|
|
|
@ -149,6 +149,7 @@ import Live from './Live/index.vue';
|
||||||
import Tree from './Tree/index.vue';
|
import Tree from './Tree/index.vue';
|
||||||
import { cloneDeep } from 'lodash-es';
|
import { cloneDeep } from 'lodash-es';
|
||||||
import { useElementSize } from '@vueuse/core';
|
import { useElementSize } from '@vueuse/core';
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
const menuStory = useMenuStore();
|
const menuStory = useMenuStore();
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
|
@ -294,10 +295,10 @@ const getActions = (
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
const resp = await ChannelApi.del(data.id);
|
const resp = await ChannelApi.del(data.id);
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
listRef.value?.reload();
|
listRef.value?.reload();
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败!');
|
onlyMessage('操作失败!', 'error');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { recordsItemType } from './typings';
|
import type { recordsItemType } from './typings';
|
||||||
import playBackApi from '@/api/media/playback';
|
import playBackApi from '@/api/media/playback';
|
||||||
import { message } from 'jetlinks-ui-components';
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
type: string;
|
type: string;
|
||||||
|
@ -46,7 +46,7 @@ const downLoadCloud = (item: recordsItemType) => {
|
||||||
})
|
})
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
message.success(
|
onlyMessage(
|
||||||
'操作成功。上传云端需要一定时间,请稍后查看云端数据',
|
'操作成功。上传云端需要一定时间,请稍后查看云端数据',
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,6 +38,7 @@ import type { recordsItemType } from './typings';
|
||||||
import type { Dayjs } from 'dayjs';
|
import type { Dayjs } from 'dayjs';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
import { useElementSize } from '@vueuse/core';
|
import { useElementSize } from '@vueuse/core';
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
export type TimeChangeType = {
|
export type TimeChangeType = {
|
||||||
endTime: Dayjs;
|
endTime: Dayjs;
|
||||||
|
@ -185,7 +186,7 @@ watch(
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
props.onChange(undefined);
|
props.onChange(undefined);
|
||||||
message.error('没有可播放的视频资源');
|
onlyMessage('没有可播放的视频资源', 'error');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
onChange(
|
onChange(
|
||||||
|
@ -199,7 +200,7 @@ watch(
|
||||||
} else if (localToServer && localToServer.startTime) {
|
} else if (localToServer && localToServer.startTime) {
|
||||||
// 本地跳转云端但是无资源
|
// 本地跳转云端但是无资源
|
||||||
props.onChange(undefined);
|
props.onChange(undefined);
|
||||||
message.error('没有可播放的视频资源');
|
onlyMessage('没有可播放的视频资源', 'error');
|
||||||
list.value = [];
|
list.value = [];
|
||||||
} else {
|
} else {
|
||||||
// 啥都没有
|
// 啥都没有
|
||||||
|
|
|
@ -167,9 +167,8 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import DeviceApi from '@/api/media/device';
|
import DeviceApi from '@/api/media/device';
|
||||||
import { getImage } from '@/utils/comm';
|
import { getImage, onlyMessage } from '@/utils/comm';
|
||||||
import { gatewayType } from '@/views/media/Device/typings';
|
import { gatewayType } from '@/views/media/Device/typings';
|
||||||
import { providerType } from '../const';
|
import { providerType } from '../const';
|
||||||
import { usePermissionStore } from '@/store/permission';
|
import { usePermissionStore } from '@/store/permission';
|
||||||
|
@ -296,7 +295,7 @@ const handleOk = () => {
|
||||||
);
|
);
|
||||||
if (deployResp.success) {
|
if (deployResp.success) {
|
||||||
emit('save', { ...res.result });
|
emit('save', { ...res.result });
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
handleCancel();
|
handleCancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -297,8 +297,7 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { getImage } from '@/utils/comm';
|
import { getImage, onlyMessage } from '@/utils/comm';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import DeviceApi from '@/api/media/device';
|
import DeviceApi from '@/api/media/device';
|
||||||
import { PROVIDER_OPTIONS } from '@/views/media/Device/const';
|
import { PROVIDER_OPTIONS } from '@/views/media/Device/const';
|
||||||
import type { ProductType } from '@/views/media/Device/typings';
|
import type { ProductType } from '@/views/media/Device/typings';
|
||||||
|
@ -417,7 +416,7 @@ const handleSubmit = () => {
|
||||||
? await DeviceApi.save(params)
|
? await DeviceApi.save(params)
|
||||||
: await DeviceApi.update(params);
|
: await DeviceApi.update(params);
|
||||||
if (res?.success) {
|
if (res?.success) {
|
||||||
message.success('保存成功');
|
onlyMessage('保存成功');
|
||||||
history.back();
|
history.back();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -164,8 +164,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import DeviceApi from '@/api/media/device';
|
import DeviceApi from '@/api/media/device';
|
||||||
import type { ActionsType } from '@/views/device/Instance/typings';
|
import type { ActionsType } from '@/views/device/Instance/typings';
|
||||||
import { message } from 'jetlinks-ui-components';
|
import { getImage, onlyMessage } from '@/utils/comm';
|
||||||
import { getImage } from '@/utils/comm';
|
|
||||||
import { PROVIDER_OPTIONS } from '@/views/media/Device/const';
|
import { PROVIDER_OPTIONS } from '@/views/media/Device/const';
|
||||||
import { providerType } from './const';
|
import { providerType } from './const';
|
||||||
import encodeQuery from '@/utils/encodeQuery';
|
import encodeQuery from '@/utils/encodeQuery';
|
||||||
|
@ -375,7 +374,7 @@ const getActions = (
|
||||||
onClick: async () => {
|
onClick: async () => {
|
||||||
const res = await DeviceApi.updateChannels(data.id);
|
const res = await DeviceApi.updateChannels(data.id);
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
message.success('通道更新成功');
|
onlyMessage('通道更新成功');
|
||||||
listRef.value?.reload();
|
listRef.value?.reload();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -393,10 +392,10 @@ const getActions = (
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
const resp = await DeviceApi.del(data.id);
|
const resp = await DeviceApi.del(data.id);
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
listRef.value?.reload();
|
listRef.value?.reload();
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败!');
|
onlyMessage('操作失败!', 'error');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -93,9 +93,9 @@ import { usePermissionStore } from '@/store/permission';
|
||||||
import type { bootConfig, recommendList } from '@/views/home/typing';
|
import type { bootConfig, recommendList } from '@/views/home/typing';
|
||||||
|
|
||||||
import deviceApi from '@/api/media/device';
|
import deviceApi from '@/api/media/device';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
|
|
||||||
import { useMenuStore } from 'store/menu';
|
import { useMenuStore } from 'store/menu';
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
const menuStory = useMenuStore();
|
const menuStory = useMenuStore();
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ const deviceStepDetails: recommendList[] = [
|
||||||
if (hasPermission('media/Device:view')) {
|
if (hasPermission('media/Device:view')) {
|
||||||
visible.value = true;
|
visible.value = true;
|
||||||
} else {
|
} else {
|
||||||
message.warning('暂无权限,请联系管理员');
|
onlyMessage('暂无权限,请联系管理员', 'warning');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -218,7 +218,7 @@ const handleSubmit = () => {
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
message.warning('请选择设备');
|
onlyMessage('请选择设备', 'warning');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -112,13 +112,13 @@ import type {
|
||||||
TemplateFormData,
|
TemplateFormData,
|
||||||
IVariableDefinitions,
|
IVariableDefinitions,
|
||||||
} from '@/views/notice/Template/types';
|
} from '@/views/notice/Template/types';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
|
|
||||||
import ToUser from '@/views/notice/Template/Detail/components/ToUser.vue';
|
import ToUser from '@/views/notice/Template/Detail/components/ToUser.vue';
|
||||||
import ToOrg from '@/views/notice/Template/Detail/components/ToOrg.vue';
|
import ToOrg from '@/views/notice/Template/Detail/components/ToOrg.vue';
|
||||||
import ToTag from '@/views/notice/Template/Detail/components/ToTag.vue';
|
import ToTag from '@/views/notice/Template/Detail/components/ToTag.vue';
|
||||||
import type { Rule } from 'ant-design-vue/es/form';
|
import type { Rule } from 'ant-design-vue/es/form';
|
||||||
import { phoneRegEx } from '@/utils/validate';
|
import { phoneRegEx } from '@/utils/validate';
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
type Emits = {
|
type Emits = {
|
||||||
(e: 'update:visible', data: boolean): void;
|
(e: 'update:visible', data: boolean): void;
|
||||||
|
@ -246,7 +246,7 @@ const handleOk = () => {
|
||||||
ConfigApi.debug(params, props.data.id, formData.value.templateId)
|
ConfigApi.debug(params, props.data.id, formData.value.templateId)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
handleCancel();
|
handleCancel();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -323,9 +323,8 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { getImage } from '@/utils/comm';
|
import { getImage, onlyMessage } from '@/utils/comm';
|
||||||
import { Form } from 'jetlinks-ui-components';
|
import { Form } from 'jetlinks-ui-components';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import type { ConfigFormData } from '../types';
|
import type { ConfigFormData } from '../types';
|
||||||
import {
|
import {
|
||||||
NOTICE_METHOD,
|
NOTICE_METHOD,
|
||||||
|
@ -555,7 +554,7 @@ const handleSubmit = () => {
|
||||||
res = await configApi.update(formData.value);
|
res = await configApi.update(formData.value);
|
||||||
}
|
}
|
||||||
if (res?.success) {
|
if (res?.success) {
|
||||||
message.success('保存成功');
|
onlyMessage('保存成功');
|
||||||
if (route.query?.notifyType) {
|
if (route.query?.notifyType) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
window?.onTabSaveSuccess(res.result);
|
window?.onTabSaveSuccess(res.result);
|
||||||
|
|
|
@ -135,9 +135,9 @@
|
||||||
<script setup lang="ts" name="SyncUser">
|
<script setup lang="ts" name="SyncUser">
|
||||||
import configApi from '@/api/notice/config';
|
import configApi from '@/api/notice/config';
|
||||||
import { PropType } from 'vue';
|
import { PropType } from 'vue';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import type { ActionsType } from '@/views/device/Instance/typings';
|
import type { ActionsType } from '@/views/device/Instance/typings';
|
||||||
import { Form } from 'ant-design-vue';
|
import { Form } from 'ant-design-vue';
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
const useForm = Form.useForm;
|
const useForm = Form.useForm;
|
||||||
|
|
||||||
|
@ -268,7 +268,7 @@ const getActions = (
|
||||||
configApi
|
configApi
|
||||||
.unBindUser({ bindingId: data.bindId }, data.bindId)
|
.unBindUser({ bindingId: data.bindId }, data.bindId)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
getTableData();
|
getTableData();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -298,12 +298,12 @@ const handleAutoBind = async () => {
|
||||||
|
|
||||||
if (props.data.type === 'dingTalk') {
|
if (props.data.type === 'dingTalk') {
|
||||||
configApi.dingTalkBindUser(params, props.data.id).then(() => {
|
configApi.dingTalkBindUser(params, props.data.id).then(() => {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
getTableData();
|
getTableData();
|
||||||
});
|
});
|
||||||
} else if (props.data.type === 'weixin') {
|
} else if (props.data.type === 'weixin') {
|
||||||
configApi.weChatBindUser(params, props.data.id).then(() => {
|
configApi.weChatBindUser(params, props.data.id).then(() => {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
getTableData();
|
getTableData();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -473,7 +473,7 @@ const handleBindSubmit = () => {
|
||||||
configApi
|
configApi
|
||||||
.dingTalkBindUser([params], props.data.id)
|
.dingTalkBindUser([params], props.data.id)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
bindVis.value = false;
|
bindVis.value = false;
|
||||||
getTableData();
|
getTableData();
|
||||||
})
|
})
|
||||||
|
@ -484,7 +484,7 @@ const handleBindSubmit = () => {
|
||||||
configApi
|
configApi
|
||||||
.weChatBindUser([params], props.data.id)
|
.weChatBindUser([params], props.data.id)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
bindVis.value = false;
|
bindVis.value = false;
|
||||||
getTableData();
|
getTableData();
|
||||||
})
|
})
|
||||||
|
|
|
@ -209,14 +209,13 @@
|
||||||
import ConfigApi from '@/api/notice/config';
|
import ConfigApi from '@/api/notice/config';
|
||||||
import type { ActionsType } from '@/views/device/Instance/typings';
|
import type { ActionsType } from '@/views/device/Instance/typings';
|
||||||
|
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
|
|
||||||
import { NOTICE_METHOD, MSG_TYPE } from '@/views/notice/const';
|
import { NOTICE_METHOD, MSG_TYPE } from '@/views/notice/const';
|
||||||
import SyncUser from './SyncUser/index.vue';
|
import SyncUser from './SyncUser/index.vue';
|
||||||
import Debug from './Debug/index.vue';
|
import Debug from './Debug/index.vue';
|
||||||
import Log from './Log/index.vue';
|
import Log from './Log/index.vue';
|
||||||
import { downloadObject } from '@/utils/utils';
|
import { downloadObject } from '@/utils/utils';
|
||||||
import { useMenuStore } from 'store/menu';
|
import { useMenuStore } from 'store/menu';
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
const menuStory = useMenuStore();
|
const menuStory = useMenuStore();
|
||||||
|
|
||||||
|
@ -332,19 +331,19 @@ const beforeUpload = (file: any) => {
|
||||||
const text = result.target?.result;
|
const text = result.target?.result;
|
||||||
console.log('text: ', text);
|
console.log('text: ', text);
|
||||||
if (!file.type.includes('json')) {
|
if (!file.type.includes('json')) {
|
||||||
message.error('请上传json格式文件');
|
onlyMessage('请上传json格式文件', 'error');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const data = JSON.parse(text || '{}');
|
const data = JSON.parse(text || '{}');
|
||||||
const { success } = await ConfigApi.update(data);
|
const { success } = await ConfigApi.update(data);
|
||||||
if (success) {
|
if (success) {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
configRef.value.reload();
|
configRef.value.reload();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} catch {
|
} catch {
|
||||||
// message.error('请上传json格式文件');
|
// onlyMessage('请上传json格式文件', 'error');
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
@ -401,10 +400,10 @@ const getActions = (
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
const resp = await ConfigApi.del(data.id);
|
const resp = await ConfigApi.del(data.id);
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
configRef.value?.reload();
|
configRef.value?.reload();
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败!');
|
onlyMessage('操作失败!', 'error');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -112,13 +112,13 @@ import type {
|
||||||
IVariableDefinitions,
|
IVariableDefinitions,
|
||||||
BindConfig,
|
BindConfig,
|
||||||
} from '@/views/notice/Template/types';
|
} from '@/views/notice/Template/types';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
|
|
||||||
import ToUser from '../Detail/components/ToUser.vue';
|
import ToUser from '../Detail/components/ToUser.vue';
|
||||||
import ToOrg from '../Detail/components/ToOrg.vue';
|
import ToOrg from '../Detail/components/ToOrg.vue';
|
||||||
import ToTag from '../Detail/components/ToTag.vue';
|
import ToTag from '../Detail/components/ToTag.vue';
|
||||||
import type { Rule } from 'ant-design-vue/es/form';
|
import type { Rule } from 'ant-design-vue/es/form';
|
||||||
import { phoneRegEx } from '@/utils/validate';
|
import { phoneRegEx } from '@/utils/validate';
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
type Emits = {
|
type Emits = {
|
||||||
(e: 'update:visible', data: boolean): void;
|
(e: 'update:visible', data: boolean): void;
|
||||||
|
@ -247,7 +247,7 @@ const handleOk = () => {
|
||||||
TemplateApi.debug(params, formData.value.configId, props.data.id)
|
TemplateApi.debug(params, formData.value.configId, props.data.id)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
handleCancel();
|
handleCancel();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
@ -738,9 +738,9 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { getImage } from '@/utils/comm';
|
import { getImage, onlyMessage } from '@/utils/comm';
|
||||||
import { UploadChangeParam } from 'ant-design-vue';
|
import { UploadChangeParam } from 'ant-design-vue';
|
||||||
import { message, Form } from 'jetlinks-ui-components';
|
import { Form } from 'jetlinks-ui-components';
|
||||||
import type { IVariableDefinitions, TemplateFormData } from '../types';
|
import type { IVariableDefinitions, TemplateFormData } from '../types';
|
||||||
import {
|
import {
|
||||||
NOTICE_METHOD,
|
NOTICE_METHOD,
|
||||||
|
@ -1247,7 +1247,7 @@ const handleSubmit = () => {
|
||||||
: await templateApi.save(formData.value);
|
: await templateApi.save(formData.value);
|
||||||
|
|
||||||
if (res?.success) {
|
if (res?.success) {
|
||||||
message.success('保存成功');
|
onlyMessage('保存成功');
|
||||||
if (route.query?.notifyType) {
|
if (route.query?.notifyType) {
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
window?.onTabSaveSuccess(res.result);
|
window?.onTabSaveSuccess(res.result);
|
||||||
|
|
|
@ -207,12 +207,12 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import TemplateApi from '@/api/notice/template';
|
import TemplateApi from '@/api/notice/template';
|
||||||
import type { ActionsType } from '@/views/device/Instance/typings';
|
import type { ActionsType } from '@/views/device/Instance/typings';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import { NOTICE_METHOD, MSG_TYPE } from '@/views/notice/const';
|
import { NOTICE_METHOD, MSG_TYPE } from '@/views/notice/const';
|
||||||
import Debug from './Debug/index.vue';
|
import Debug from './Debug/index.vue';
|
||||||
import Log from './Log/index.vue';
|
import Log from './Log/index.vue';
|
||||||
import { downloadObject } from '@/utils/utils';
|
import { downloadObject } from '@/utils/utils';
|
||||||
import { useMenuStore } from 'store/menu';
|
import { useMenuStore } from 'store/menu';
|
||||||
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
|
||||||
const menuStory = useMenuStore();
|
const menuStory = useMenuStore();
|
||||||
|
|
||||||
|
@ -330,19 +330,19 @@ const beforeUpload = (file: any) => {
|
||||||
const text = result.target?.result;
|
const text = result.target?.result;
|
||||||
console.log('text: ', text);
|
console.log('text: ', text);
|
||||||
if (!file.type.includes('json')) {
|
if (!file.type.includes('json')) {
|
||||||
message.error('请上传json格式文件');
|
onlyMessage('请上传json格式文件', 'error');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
const data = JSON.parse(text || '{}');
|
const data = JSON.parse(text || '{}');
|
||||||
const { success } = await TemplateApi.update(data);
|
const { success } = await TemplateApi.update(data);
|
||||||
if (success) {
|
if (success) {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
configRef.value.reload();
|
configRef.value.reload();
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
} catch {
|
} catch {
|
||||||
// message.error('请上传json格式文件');
|
// onlyMessage('请上传json格式文件', 'error');
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
@ -399,10 +399,10 @@ const getActions = (
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
const resp = await TemplateApi.del(data.id);
|
const resp = await TemplateApi.del(data.id);
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
configRef.value?.reload();
|
configRef.value?.reload();
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败!');
|
onlyMessage('操作失败!', 'error');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -50,7 +50,8 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { saveOutputData } from '@/api/rule-engine/config';
|
import { saveOutputData } from '@/api/rule-engine/config';
|
||||||
import { Form, message } from 'jetlinks-ui-components';
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
import { Form } from 'jetlinks-ui-components';
|
||||||
const useForm = Form.useForm;
|
const useForm = Form.useForm;
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const Myprops = defineProps({
|
const Myprops = defineProps({
|
||||||
|
@ -89,7 +90,7 @@ const save = () => {
|
||||||
exchangeType: 'consume',
|
exchangeType: 'consume',
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
emit('saveSuc');
|
emit('saveSuc');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -60,7 +60,8 @@
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { saveOutputData } from '@/api/rule-engine/config';
|
import { saveOutputData } from '@/api/rule-engine/config';
|
||||||
import { Form, message } from 'jetlinks-ui-components';
|
import { onlyMessage } from '@/utils/comm';
|
||||||
|
import { Form } from 'jetlinks-ui-components';
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const useForm = Form.useForm;
|
const useForm = Form.useForm;
|
||||||
const Myprops = defineProps({
|
const Myprops = defineProps({
|
||||||
|
@ -99,7 +100,7 @@ const save = () => {
|
||||||
exchangeType: 'producer',
|
exchangeType: 'producer',
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
emit('saveSuc');
|
emit('saveSuc');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -82,10 +82,9 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { getImage } from '@/utils/comm';
|
import { getImage, onlyMessage } from '@/utils/comm';
|
||||||
import { queryLevel, saveLevel } from '@/api/rule-engine/config';
|
import { queryLevel, saveLevel } from '@/api/rule-engine/config';
|
||||||
import { LevelItem } from './typing';
|
import { LevelItem } from './typing';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import Io from './Io/index.vue';
|
import Io from './Io/index.vue';
|
||||||
const list = ref([
|
const list = ref([
|
||||||
{
|
{
|
||||||
|
@ -110,7 +109,7 @@ getAlarmLevel();
|
||||||
const handleSaveLevel = async () => {
|
const handleSaveLevel = async () => {
|
||||||
saveLevel(levels.value).then((res) => {
|
saveLevel(levels.value).then((res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -80,8 +80,7 @@ import {
|
||||||
} from '@/api/rule-engine/configuration';
|
} from '@/api/rule-engine/configuration';
|
||||||
import { queryLevel } from '@/api/rule-engine/config';
|
import { queryLevel } from '@/api/rule-engine/config';
|
||||||
import { query } from '@/api/rule-engine/scene';
|
import { query } from '@/api/rule-engine/scene';
|
||||||
import { getImage } from '@/utils/comm';
|
import { getImage, onlyMessage } from '@/utils/comm';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import { useMenuStore } from '@/store/menu';
|
import { useMenuStore } from '@/store/menu';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { useAlarmConfigurationStore } from '@/store/alarm';
|
import { useAlarmConfigurationStore } from '@/store/alarm';
|
||||||
|
@ -204,7 +203,7 @@ const handleSave = async () => {
|
||||||
? await updata(form.value)
|
? await updata(form.value)
|
||||||
: await save(form.value);
|
: await save(form.value);
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
message.success('操作成功,请配置关联的场景联动');
|
onlyMessage('操作成功,请配置关联的场景联动');
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
if (res.result?.id) {
|
if (res.result?.id) {
|
||||||
menuStory.jumpPage(
|
menuStory.jumpPage(
|
||||||
|
|
|
@ -84,8 +84,7 @@
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { query } from '@/api/rule-engine/scene';
|
import { query } from '@/api/rule-engine/scene';
|
||||||
import { bindScene } from '@/api/rule-engine/configuration';
|
import { bindScene } from '@/api/rule-engine/configuration';
|
||||||
import { getImage } from '@/utils/comm';
|
import { getImage, onlyMessage } from '@/utils/comm';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
const columns = [
|
const columns = [
|
||||||
{
|
{
|
||||||
title: '名称',
|
title: '名称',
|
||||||
|
@ -217,11 +216,11 @@ const saveCorrelation = async () => {
|
||||||
});
|
});
|
||||||
const res = await bindScene([...list]);
|
const res = await bindScene([...list]);
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
emit('saveScene');
|
emit('saveScene');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
message.error('请选择至少一条数据');
|
onlyMessage('请选择至少一条数据', 'error');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const closeModal = () => {
|
const closeModal = () => {
|
||||||
|
|
|
@ -99,8 +99,7 @@ import { query } from '@/api/rule-engine/scene';
|
||||||
import { unbindScene } from '@/api/rule-engine/configuration';
|
import { unbindScene } from '@/api/rule-engine/configuration';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import type { ActionsType } from '@/components/Table';
|
import type { ActionsType } from '@/components/Table';
|
||||||
import { getImage } from '@/utils/comm';
|
import { getImage, onlyMessage } from '@/utils/comm';
|
||||||
import { message } from 'jetlinks-ui-components';
|
|
||||||
import Save from './Save/index.vue';
|
import Save from './Save/index.vue';
|
||||||
import { useAlarmConfigurationStore } from '@/store/alarm';
|
import { useAlarmConfigurationStore } from '@/store/alarm';
|
||||||
import { storeToRefs } from 'pinia';
|
import { storeToRefs } from 'pinia';
|
||||||
|
@ -157,7 +156,7 @@ const getActions = (
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
const res = await unbindScene(id, [data.id]);
|
const res = await unbindScene(id, [data.id]);
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
actionRef.value.reload();
|
actionRef.value.reload();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -21,13 +21,13 @@ import Base from './Base/index.vue';
|
||||||
import Scene from './Scene/index.vue';
|
import Scene from './Scene/index.vue';
|
||||||
import Log from './Log/indev.vue';
|
import Log from './Log/indev.vue';
|
||||||
import { useRoute } from 'vue-router';
|
import { useRoute } from 'vue-router';
|
||||||
import { message } from 'ant-design-vue';
|
import { onlyMessage } from '@/utils/comm';
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const changeTabs = (e: any) => {
|
const changeTabs = (e: any) => {
|
||||||
if (route.query?.id) {
|
if (route.query?.id) {
|
||||||
activeKey.value = e;
|
activeKey.value = e;
|
||||||
} else {
|
} else {
|
||||||
message.error('请先保存基础配置');
|
onlyMessage('请先保存基础配置', 'error');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const activeKey = ref('1');
|
const activeKey = ref('1');
|
||||||
|
|
|
@ -198,8 +198,7 @@ import {
|
||||||
import { queryLevel } from '@/api/rule-engine/config';
|
import { queryLevel } from '@/api/rule-engine/config';
|
||||||
import { Store } from 'jetlinks-store';
|
import { Store } from 'jetlinks-store';
|
||||||
import type { ActionsType } from '@/components/Table/index.vue';
|
import type { ActionsType } from '@/components/Table/index.vue';
|
||||||
import { message } from 'jetlinks-ui-components';
|
import { getImage, onlyMessage } from '@/utils/comm';
|
||||||
import { getImage } from '@/utils/comm';
|
|
||||||
import { useMenuStore } from '@/store/menu';
|
import { useMenuStore } from '@/store/menu';
|
||||||
import encodeQuery from '@/utils/encodeQuery';
|
import encodeQuery from '@/utils/encodeQuery';
|
||||||
const params = ref<Record<string, any>>({});
|
const params = ref<Record<string, any>>({});
|
||||||
|
@ -393,10 +392,10 @@ const getActions = (
|
||||||
});
|
});
|
||||||
_execute(scene).then((res) => {
|
_execute(scene).then((res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
message.success('操作成功');
|
onlyMessage('操作成功');
|
||||||
tableRef.value?.reload();
|
tableRef.value?.reload();
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败');
|
onlyMessage('操作失败', 'error');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
@ -443,10 +442,10 @@ const getActions = (
|
||||||
response = await _disable(data.id);
|
response = await _disable(data.id);
|
||||||
}
|
}
|
||||||
if (response && response.status === 200) {
|
if (response && response.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
tableRef.value?.reload();
|
tableRef.value?.reload();
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败!');
|
onlyMessage('操作失败!', 'error');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -466,10 +465,10 @@ const getActions = (
|
||||||
onConfirm: async () => {
|
onConfirm: async () => {
|
||||||
const resp = await remove(data.id);
|
const resp = await remove(data.id);
|
||||||
if (resp.status === 200) {
|
if (resp.status === 200) {
|
||||||
message.success('操作成功!');
|
onlyMessage('操作成功!');
|
||||||
tableRef.value?.reload();
|
tableRef.value?.reload();
|
||||||
} else {
|
} else {
|
||||||
message.error('操作失败!');
|
onlyMessage('操作失败!', 'error');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue