Merge branch 'dev' of github.com:jetlinks/jetlinks-ui-vue into dev
This commit is contained in:
commit
9fb80e4123
|
@ -1,170 +0,0 @@
|
|||
<template>
|
||||
<Tooltip ref="tooltipRef" placement="top" v-bind="props.tooltip">
|
||||
<template v-if="props.tooltip" #title>
|
||||
<slot></slot>
|
||||
<slot name="tooltip"></slot>
|
||||
</template>
|
||||
<span
|
||||
ref="triggerRef"
|
||||
v-bind="triggerAttrs()"
|
||||
@click="handleClickRef"
|
||||
@mouseenter="
|
||||
[
|
||||
props.expandTrigger === 'click'
|
||||
? getTooltipDisabled()
|
||||
: undefined,
|
||||
]
|
||||
"
|
||||
>
|
||||
<slot></slot>
|
||||
</span>
|
||||
</Tooltip>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { Tooltip, TooltipProps } from 'ant-design-vue';
|
||||
|
||||
import { computed, mergeProps, PropType, ref, useAttrs } from 'vue';
|
||||
|
||||
// define class name
|
||||
const jEllipsis = 'j-ellipsis';
|
||||
const jEllipsisCursorClass = 'j-ellipsis-cursor';
|
||||
const jEllipsisLineClampClass = 'j-ellipsis-line-clamp';
|
||||
|
||||
const props = defineProps({
|
||||
/** expand by */
|
||||
expandTrigger: {
|
||||
type: String as PropType<'click'>,
|
||||
default: undefined,
|
||||
},
|
||||
/** multiline ellipsis */
|
||||
lineClamp: {
|
||||
type: [Number, String] as PropType<string | number>,
|
||||
default: 1,
|
||||
},
|
||||
/** a-tooltip props */
|
||||
tooltip: {
|
||||
type: [Boolean, Object] as PropType<TooltipProps | boolean>,
|
||||
default: true,
|
||||
},
|
||||
});
|
||||
|
||||
const attrs = useAttrs();
|
||||
|
||||
function triggerAttrs() {
|
||||
return {
|
||||
...mergeProps(attrs, {
|
||||
class: [
|
||||
jEllipsis,
|
||||
props.lineClamp !== undefined
|
||||
? jEllipsisLineClampClass
|
||||
: undefined,
|
||||
props.expandTrigger === 'click'
|
||||
? jEllipsisCursorClass
|
||||
: undefined,
|
||||
],
|
||||
style: ellipsisStyleRef.value,
|
||||
}),
|
||||
};
|
||||
}
|
||||
|
||||
const expandedRef = ref(false);
|
||||
const tooltipRef = ref<HTMLElement | null>(null);
|
||||
const triggerRef = ref<HTMLElement | null>(null);
|
||||
|
||||
const ellipsisStyleRef = computed(() => {
|
||||
const { lineClamp } = props;
|
||||
const { value: expanded } = expandedRef;
|
||||
if (lineClamp !== undefined) {
|
||||
return {
|
||||
textOverflow: '',
|
||||
'-webkit-line-clamp': expanded ? '' : lineClamp,
|
||||
};
|
||||
} else {
|
||||
return {
|
||||
textOverflow: expanded ? '' : 'ellipsis',
|
||||
'-webkit-line-clamp': '',
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
function syncCursorStyle(trigger: HTMLElement, tooltipDisabled: boolean): void {
|
||||
if (props.expandTrigger === 'click' && !tooltipDisabled) {
|
||||
syncTriggerClass(trigger, jEllipsisCursorClass, 'add');
|
||||
} else {
|
||||
syncTriggerClass(trigger, jEllipsisCursorClass, 'remove');
|
||||
}
|
||||
}
|
||||
|
||||
function getTooltipDisabled(): boolean {
|
||||
let tooltipDisabled = false;
|
||||
const { value: expanded } = expandedRef;
|
||||
if (expanded) return true;
|
||||
const { value: trigger } = triggerRef;
|
||||
if (trigger) {
|
||||
syncEllipsisStyle(trigger);
|
||||
tooltipDisabled = trigger.scrollHeight <= trigger.offsetHeight;
|
||||
|
||||
syncCursorStyle(trigger, tooltipDisabled);
|
||||
}
|
||||
return tooltipDisabled;
|
||||
}
|
||||
|
||||
const handleClickRef = computed(() => {
|
||||
return props.expandTrigger === 'click'
|
||||
? () => {
|
||||
const { value: expanded } = expandedRef;
|
||||
expandedRef.value = !expanded;
|
||||
}
|
||||
: undefined;
|
||||
});
|
||||
|
||||
function syncEllipsisStyle(trigger: HTMLElement): void {
|
||||
if (!trigger) return;
|
||||
const latestStyle = ellipsisStyleRef.value;
|
||||
const lineClampClass = jEllipsisLineClampClass;
|
||||
if (props.lineClamp !== undefined) {
|
||||
syncTriggerClass(trigger, lineClampClass, 'add');
|
||||
} else {
|
||||
syncTriggerClass(trigger, lineClampClass, 'remove');
|
||||
}
|
||||
for (const key in latestStyle) {
|
||||
if ((trigger.style as any)[key] !== (latestStyle as any)[key]) {
|
||||
(trigger.style as any)[key] = (latestStyle as any)[key];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function syncTriggerClass(
|
||||
trigger: HTMLElement,
|
||||
styleClass: string,
|
||||
action: 'add' | 'remove',
|
||||
): void {
|
||||
if (action === 'add') {
|
||||
if (!trigger.classList.contains(styleClass)) {
|
||||
trigger.classList.add(styleClass);
|
||||
}
|
||||
} else {
|
||||
if (trigger.classList.contains(styleClass)) {
|
||||
trigger.classList.remove(styleClass);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style scoped lang='less'>
|
||||
.j-ellipsis {
|
||||
overflow: hidden;
|
||||
vertical-align: bottom;
|
||||
}
|
||||
|
||||
.j-ellipsis-cursor {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.j-ellipsis-line-clamp {
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
word-break: break-all;
|
||||
white-space: normal;
|
||||
}
|
||||
</style>
|
|
@ -9,8 +9,8 @@ import NormalUpload from './NormalUpload/index.vue'
|
|||
import FileFormat from './FileFormat/index.vue'
|
||||
import JProUpload from './Upload/index.vue'
|
||||
import { BasicLayoutPage, BlankLayoutPage } from './Layout'
|
||||
import { PageContainer, AIcon } from 'jetlinks-ui-components'
|
||||
import Ellipsis from './Ellipsis/index.vue'
|
||||
import { PageContainer, AIcon, Ellipsis } from 'jetlinks-ui-components'
|
||||
// import Ellipsis from './Ellipsis/index.vue'
|
||||
import JEmpty from './Empty/index.vue'
|
||||
import AMapComponent from './AMapComponent/index.vue'
|
||||
import PathSimplifier from './AMapComponent/PathSimplifier.vue'
|
||||
|
|
|
@ -3,6 +3,8 @@ import { systemVersion } from '@/api/comm'
|
|||
import { useMenuStore } from './menu'
|
||||
import { getDetails_api } from '@/api/system/basis';
|
||||
import type { ConfigInfoType } from '@/views/system/Basis/typing';
|
||||
import { LocalStore } from '@/utils/comm'
|
||||
import { SystemConst } from '@/utils/consts'
|
||||
|
||||
type SystemStateType = {
|
||||
isCommunity: boolean;
|
||||
|
@ -22,6 +24,7 @@ export const useSystem = defineStore('system', {
|
|||
const resp = await systemVersion()
|
||||
if (resp.success && resp.result) {
|
||||
const isCommunity = resp.result.edition === 'community'
|
||||
LocalStore.set(SystemConst.VERSION_CODE, resp.result.edition)
|
||||
this.isCommunity = isCommunity
|
||||
// 获取菜单
|
||||
const menu = useMenuStore()
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
import { isNoCommunity } from '@/utils/utils';
|
||||
|
||||
// 过滤网关类型
|
||||
export const accessConfigTypeFilter = (data: any[], filterKey: string = 'id'): any[] => {
|
||||
if (!data) return []
|
||||
const filterKeys = !isNoCommunity ?
|
||||
[
|
||||
'mqtt-server-gateway',
|
||||
'http-server-gateway',
|
||||
'mqtt-client-gateway',
|
||||
'tcp-server-gateway',
|
||||
'plugin_gateway'
|
||||
] : ['plugin_gateway']
|
||||
return data.filter(item => !filterKeys.includes(item[filterKey])).map( item => ({ ...item, label: item.name, value: item.id}))
|
||||
}
|
|
@ -16,4 +16,12 @@ export const phoneRegEx = (value: string) => {
|
|||
export const passwordRegEx = (value: string) => {
|
||||
const password = new RegExp(/^\S*(?=\S{8,})(?=\S*\d)(?=\S*[A-Z])(?=\S*[a-z])\S*$/)
|
||||
return password.test(value)
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 判断是否为正确的IP地址
|
||||
*/
|
||||
export const testIP = (value: string) => {
|
||||
const ip =
|
||||
/^([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.([0-9]|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])$/;
|
||||
return ip.test(value);
|
||||
};
|
|
@ -309,6 +309,7 @@ import BadgeStatus from '@/components/BadgeStatus/index.vue';
|
|||
import BatchDropdown from '@/components/BatchDropdown/index.vue';
|
||||
import { BatchActionsType } from '@/components/BatchDropdown/types';
|
||||
import {useRouterParams} from "@/utils/hooks/useParams";
|
||||
import { accessConfigTypeFilter } from '@/utils/setting'
|
||||
|
||||
const instanceRef = ref<Record<string, any>>({});
|
||||
const params = ref<Record<string, any>>({});
|
||||
|
@ -417,12 +418,17 @@ const columns = [
|
|||
options: () =>
|
||||
new Promise((resolve) => {
|
||||
getProviders().then((resp: any) => {
|
||||
resolve(
|
||||
resp.result.map((item: any) => ({
|
||||
label: item.name,
|
||||
value: `accessProvider is ${item.id}`,
|
||||
})),
|
||||
);
|
||||
const data = resp.result || []
|
||||
resolve(accessConfigTypeFilter(data).map(item => ({
|
||||
...item,
|
||||
value: `accessProvider is ${item.id}`
|
||||
})))
|
||||
// resolve(
|
||||
// resp.result.map((item: any) => ({
|
||||
// label: item.name,
|
||||
// value: `accessProvider is ${item.id}`,
|
||||
// })),
|
||||
// );
|
||||
});
|
||||
}),
|
||||
},
|
||||
|
|
|
@ -419,7 +419,7 @@ import { marked } from 'marked';
|
|||
import type { TableColumnType } from 'ant-design-vue';
|
||||
import { useMenuStore } from '@/store/menu';
|
||||
import _ from 'lodash';
|
||||
import encodeQuery from '@/utils/encodeQuery';
|
||||
import { accessConfigTypeFilter } from '@/utils/setting'
|
||||
|
||||
const tableRef = ref();
|
||||
const formRef = ref();
|
||||
|
@ -434,7 +434,6 @@ marked.setOptions({
|
|||
});
|
||||
const simpleImage = ref(Empty.PRESENTED_IMAGE_SIMPLE);
|
||||
const visible = ref<boolean>(false);
|
||||
const listData = ref<string[]>([]);
|
||||
const access = ref({});
|
||||
const config = ref<any>({});
|
||||
const metadata = ref<ConfigMetadata>({ properties: [] });
|
||||
|
@ -501,35 +500,10 @@ const query = reactive({
|
|||
search: {
|
||||
type: 'select',
|
||||
options: async () => {
|
||||
return new Promise((res) => {
|
||||
return new Promise((resolve) => {
|
||||
getProviders().then((resp: any) => {
|
||||
listData.value = [];
|
||||
if (isNoCommunity) {
|
||||
(resp?.result || []).map((item: any) => {
|
||||
if (item.id != 'plugin_gateway') {
|
||||
listData.value.push({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
listData.value = (resp?.result || [])
|
||||
.filter((i: any) =>
|
||||
[
|
||||
'mqtt-server-gateway',
|
||||
'http-server-gateway',
|
||||
'mqtt-client-gateway',
|
||||
'tcp-server-gateway',
|
||||
].includes(i.id),
|
||||
)
|
||||
.map((item: any) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
// }
|
||||
}
|
||||
res(listData.value);
|
||||
const data = resp.result || []
|
||||
resolve(accessConfigTypeFilter(data))
|
||||
});
|
||||
});
|
||||
},
|
||||
|
@ -961,7 +935,8 @@ const getData = async (accessId?: string) => {
|
|||
);
|
||||
getProviders().then((resp) => {
|
||||
if (resp.status === 200) {
|
||||
dataSource.value = resp.result;
|
||||
const data = resp.result || []
|
||||
dataSource.value = accessConfigTypeFilter(data as any[]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
@ -182,6 +182,7 @@ import Save from './Save/index.vue';
|
|||
import { useMenuStore } from 'store/menu';
|
||||
import { useRoute } from 'vue-router';
|
||||
import {useRouterParams} from "@/utils/hooks/useParams";
|
||||
import { accessConfigTypeFilter } from '@/utils/setting'
|
||||
/**
|
||||
* 表格数据
|
||||
*/
|
||||
|
@ -442,37 +443,11 @@ const query = reactive({
|
|||
dataIndex: 'accessProvider',
|
||||
search: {
|
||||
type: 'select',
|
||||
options: async () => {
|
||||
return new Promise((res) => {
|
||||
options: () => {
|
||||
return new Promise((resolve) => {
|
||||
getProviders().then((resp: any) => {
|
||||
listData.value = [];
|
||||
// const list = () => {
|
||||
if (isNoCommunity) {
|
||||
(resp?.result || []).map((item: any) => {
|
||||
if (item.id != 'plugin_gateway') {
|
||||
listData.value.push({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
listData.value = (resp?.result || [])
|
||||
.filter((i: any) =>
|
||||
[
|
||||
'mqtt-server-gateway',
|
||||
'http-server-gateway',
|
||||
'mqtt-client-gateway',
|
||||
'tcp-server-gateway',
|
||||
].includes(i.id),
|
||||
)
|
||||
.map((item: any) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
// }
|
||||
}
|
||||
res(listData.value);
|
||||
const data = resp.result || []
|
||||
resolve(accessConfigTypeFilter(data))
|
||||
});
|
||||
});
|
||||
},
|
||||
|
|
|
@ -42,6 +42,8 @@ export default [
|
|||
actions: ['query'],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
},
|
||||
{
|
||||
code: 'notice',
|
||||
|
@ -182,6 +184,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "支持", value: "support" },
|
||||
supportDataAccess: true
|
||||
},
|
||||
{
|
||||
code: 'notice/Template',
|
||||
|
@ -301,6 +305,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "支持", value: "support" },
|
||||
supportDataAccess: true
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -344,6 +350,8 @@ export default [
|
|||
actions: ['find-geo'],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
},
|
||||
{
|
||||
code: 'device/Product',
|
||||
|
@ -354,7 +362,6 @@ export default [
|
|||
url: '/iot/device/Product',
|
||||
icon: 'icon-chanpin',
|
||||
sortIndex: 2,
|
||||
accessSupport: 'support',
|
||||
assetType: 'product',
|
||||
showPage: ['device-product'],
|
||||
permissions: [
|
||||
|
@ -535,6 +542,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "支持", value: "support" },
|
||||
supportDataAccess: true
|
||||
},
|
||||
{
|
||||
code: 'device/Instance',
|
||||
|
@ -545,7 +554,8 @@ export default [
|
|||
url: '/iot/device/Instance',
|
||||
icon: 'icon-shebei',
|
||||
sortIndex: 3,
|
||||
accessSupport: 'support',
|
||||
accessSupport: { text: "支持", value: "support" },
|
||||
supportDataAccess: true,
|
||||
assetType: 'device',
|
||||
showPage: ['device-instance'],
|
||||
permissions: [
|
||||
|
@ -752,7 +762,8 @@ export default [
|
|||
sortIndex: 4,
|
||||
url: '/iot/device/Category',
|
||||
icon: 'icon-chanpinfenlei',
|
||||
accessSupport: 'support',
|
||||
accessSupport: { text: "支持", value: "support" },
|
||||
supportDataAccess: true,
|
||||
assetType: 'deviceCategory',
|
||||
showPage: ['device-category'],
|
||||
permissions: [],
|
||||
|
@ -832,6 +843,8 @@ export default [
|
|||
actions: ['query'],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
},
|
||||
{
|
||||
code: 'link/AccessConfig',
|
||||
|
@ -956,6 +969,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
},
|
||||
{
|
||||
code: 'link/Protocol',
|
||||
|
@ -1026,6 +1041,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
},
|
||||
{
|
||||
code: 'Log',
|
||||
|
@ -1048,6 +1065,8 @@ export default [
|
|||
},
|
||||
],
|
||||
buttons: [],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
},
|
||||
{
|
||||
code: 'link/Type',
|
||||
|
@ -1124,6 +1143,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
},
|
||||
{
|
||||
code: 'link/Certificate',
|
||||
|
@ -1178,6 +1199,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "支持", value: "support" },
|
||||
supportDataAccess: true
|
||||
},
|
||||
{
|
||||
code: 'media/Stream',
|
||||
|
@ -1242,125 +1265,9 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
},
|
||||
// {
|
||||
// code: 'link/Channel',
|
||||
// name: '通道配置',
|
||||
// owner: 'iot',
|
||||
// //parentId: '1-4',
|
||||
// //id: '1-4-8',
|
||||
// sortIndex: 8,
|
||||
// url: '/iot/link/Channel',
|
||||
// icon: 'icon-zidingyiguize',
|
||||
// showPage: ['media-server'],
|
||||
// permissions: [],
|
||||
// children: [
|
||||
// {
|
||||
// code: 'link/Channel/Opcua',
|
||||
// name: 'OPC UA',
|
||||
// owner: 'iot',
|
||||
// //parentId: '1-4-8',
|
||||
// //id: '1-4-8-1',
|
||||
// sortIndex: 1,
|
||||
// url: '/iot/link/Channel/Opcua',
|
||||
// icon: 'icon-zhilianshebei',
|
||||
// showPage: ['opc-client'],
|
||||
// permissions: [
|
||||
// { permission: 'opc-device-bind', actions: ['query'] },
|
||||
// { permission: 'opc-point', actions: ['query'] },
|
||||
// { permission: 'opc-client', actions: ['query'] },
|
||||
// ],
|
||||
// buttons: [
|
||||
// {
|
||||
// id: 'view',
|
||||
// name: '设备接入',
|
||||
// permissions: [
|
||||
// { permission: 'opc-point', actions: ['query'] },
|
||||
// { permission: 'opc-device-bind', actions: ['query'] },
|
||||
// { permission: 'opc-client', actions: ['query'] },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// id: 'action',
|
||||
// name: '启/禁用',
|
||||
// permissions: [
|
||||
// { permission: 'opc-point', actions: ['query', 'save'] },
|
||||
// { permission: 'opc-client', actions: ['query', 'save'] },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// id: 'update',
|
||||
// name: '编辑',
|
||||
// permissions: [
|
||||
// { permission: 'opc-point', actions: ['query', 'save'] },
|
||||
// { permission: 'opc-device-bind', actions: ['query', 'save'] },
|
||||
// { permission: 'opc-client', actions: ['query', 'save'] },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// id: 'delete',
|
||||
// name: '删除',
|
||||
// permissions: [
|
||||
// { permission: 'opc-point', actions: ['query', 'delete'] },
|
||||
// { permission: 'opc-device-bind', actions: ['query', 'delete'] },
|
||||
// { permission: 'opc-client', actions: ['query', 'delete'] },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// id: 'add',
|
||||
// name: '新增',
|
||||
// permissions: [
|
||||
// { permission: 'opc-point', actions: ['query', 'save'] },
|
||||
// { permission: 'opc-device-bind', actions: ['query', 'save'] },
|
||||
// { permission: 'opc-client', actions: ['query', 'save'] },
|
||||
// ],
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// code: 'link/Channel/Modbus',
|
||||
// name: 'Modbus',
|
||||
// owner: 'iot',
|
||||
// //parentId: '1-4-8',
|
||||
// //id: '1-4-8-2',
|
||||
// sortIndex: 2,
|
||||
// url: '/iot/link/Channel/Modbus',
|
||||
// icon: 'icon-changjingliandong',
|
||||
// showPage: ['modbus-master'],
|
||||
// permissions: [
|
||||
// { permission: 'modbus-point', actions: ['query', 'save', 'delete'] },
|
||||
// { permission: 'modbus-master', actions: ['query', 'save', 'delete'] },
|
||||
// ],
|
||||
// buttons: [
|
||||
// {
|
||||
// id: 'update',
|
||||
// name: '编辑',
|
||||
// permissions: [{ permission: 'modbus-master', actions: ['query', 'save'] }],
|
||||
// },
|
||||
// {
|
||||
// id: 'action',
|
||||
// name: '启/禁用',
|
||||
// permissions: [{ permission: 'modbus-master', actions: ['query', 'save'] }],
|
||||
// },
|
||||
// {
|
||||
// id: 'view',
|
||||
// name: '设备接入',
|
||||
// permissions: [{ permission: 'modbus-master', actions: ['query', 'save'] }],
|
||||
// },
|
||||
// {
|
||||
// id: 'delete',
|
||||
// name: '删除',
|
||||
// permissions: [{ permission: 'modbus-master', actions: ['query', 'delete'] }],
|
||||
// },
|
||||
// {
|
||||
// id: 'add',
|
||||
// name: '新增',
|
||||
// permissions: [{ permission: 'modbus-master', actions: ['query', 'save'] }],
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
{
|
||||
code: 'device/Firmware',
|
||||
name: '远程升级',
|
||||
|
@ -1458,6 +1365,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -1493,6 +1402,8 @@ export default [
|
|||
{ permission: 'things-collector', actions: ['query'] },
|
||||
],
|
||||
buttons: [],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
},
|
||||
{
|
||||
code: 'DataCollect/Channel',
|
||||
|
@ -1624,6 +1535,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "支持", value: "support" },
|
||||
supportDataAccess: true
|
||||
},
|
||||
{
|
||||
code: 'DataCollect/Collector',
|
||||
|
@ -1755,6 +1668,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "支持", value: "support" },
|
||||
supportDataAccess: true
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -1787,6 +1702,8 @@ export default [
|
|||
{ permission: 'alarm-record', actions: ['query'] },
|
||||
],
|
||||
buttons: [],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
},
|
||||
{
|
||||
code: 'rule-engine/Alarm/Config',
|
||||
|
@ -1809,6 +1726,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
},
|
||||
{
|
||||
code: 'rule-engine/Alarm/Configuration',
|
||||
|
@ -1920,6 +1839,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "支持", value: "support" },
|
||||
supportDataAccess: true
|
||||
},
|
||||
{
|
||||
code: 'rule-engine/Alarm/Log',
|
||||
|
@ -1970,6 +1891,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -2061,6 +1984,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
},
|
||||
{
|
||||
code: 'Northbound/AliCloud',
|
||||
|
@ -2137,6 +2062,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -2295,6 +2222,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "支持", value: "support" },
|
||||
supportDataAccess: true
|
||||
},
|
||||
{
|
||||
code: 'rule-engine/Scene',
|
||||
|
@ -2445,6 +2374,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "支持", value: "support" },
|
||||
supportDataAccess: true
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -2566,6 +2497,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
},
|
||||
{
|
||||
code: 'edge/Resource',
|
||||
|
@ -2641,6 +2574,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -2656,8 +2591,6 @@ export default [
|
|||
url: '/media',
|
||||
icon: 'icon-shipinwangguan',
|
||||
sortIndex: 2,
|
||||
accessSupport: 'indirect',
|
||||
indirectMenus: ['1-3-3'],
|
||||
permissions: [],
|
||||
buttons: [],
|
||||
children: [
|
||||
|
@ -2673,6 +2606,8 @@ export default [
|
|||
permissions: [],
|
||||
buttons: [],
|
||||
showPage: ['media-device'],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
},
|
||||
{
|
||||
code: 'media/DashBoard',
|
||||
|
@ -2691,6 +2626,8 @@ export default [
|
|||
],
|
||||
buttons: [],
|
||||
showPage: ['dashboard', 'media-device'],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
},
|
||||
{
|
||||
code: 'media/Device',
|
||||
|
@ -2811,6 +2748,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
},
|
||||
{
|
||||
code: 'media/SplitScreen',
|
||||
|
@ -2845,6 +2784,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
},
|
||||
{
|
||||
code: 'media/Cascade',
|
||||
|
@ -2954,6 +2895,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "支持", value: "support" },
|
||||
supportDataAccess: true
|
||||
},
|
||||
],
|
||||
},
|
||||
|
@ -3007,6 +2950,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
},
|
||||
{
|
||||
code: 'system/User',
|
||||
|
@ -3095,6 +3040,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "支持", value: "support" },
|
||||
supportDataAccess: true
|
||||
},
|
||||
{
|
||||
code: 'system/Department',
|
||||
|
@ -3291,6 +3238,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "支持", value: "support" },
|
||||
supportDataAccess: true
|
||||
},
|
||||
{
|
||||
code: 'system/Role',
|
||||
|
@ -3366,6 +3315,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "支持", value: "support" },
|
||||
supportDataAccess: true
|
||||
},
|
||||
{
|
||||
code: 'system/Menu',
|
||||
|
@ -3393,17 +3344,6 @@ export default [
|
|||
},
|
||||
],
|
||||
},
|
||||
// 超管才具备该权限
|
||||
// {
|
||||
// id: 'setting',
|
||||
// name: '配置',
|
||||
// permissions: [
|
||||
// {
|
||||
// permission: 'menu',
|
||||
// actions: ['query', 'save', 'grant'],
|
||||
// },
|
||||
// ],
|
||||
// },
|
||||
{
|
||||
id: 'update',
|
||||
name: '编辑',
|
||||
|
@ -3459,6 +3399,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
},
|
||||
{
|
||||
code: 'system/Permission',
|
||||
|
@ -3547,44 +3489,9 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
},
|
||||
// {
|
||||
// code: 'system/Platforms',
|
||||
// name: '第三方平台',
|
||||
// owner: 'iot',
|
||||
// //parentId: '3',
|
||||
// //id: '3-7',
|
||||
// sortIndex: 7,
|
||||
// url: '/system/platforms',
|
||||
// icon: 'icon-xitongguanli1',
|
||||
// permissions: [{ permission: 'open-api', actions: ['query', 'save', 'delete'] }],
|
||||
// buttons: [
|
||||
// {
|
||||
// id: 'empowerment',
|
||||
// name: '赋权',
|
||||
// permissions: [
|
||||
// { permission: 'user-third-party-manager', actions: ['save'] },
|
||||
// { permission: 'open-api', actions: ['save'] },
|
||||
// ],
|
||||
// },
|
||||
// {
|
||||
// id: 'password',
|
||||
// name: '重置密码',
|
||||
// permissions: [{ permission: 'open-api', actions: ['save'] }],
|
||||
// },
|
||||
// {
|
||||
// id: 'delete',
|
||||
// name: '删除',
|
||||
// permissions: [{ permission: 'open-api', actions: ['delete'] }],
|
||||
// },
|
||||
// {
|
||||
// id: 'update',
|
||||
// name: '编辑',
|
||||
// permissions: [{ permission: 'open-api', actions: ['save'] }],
|
||||
// },
|
||||
// { id: 'add', name: '新增', permissions: [{ permission: 'open-api', actions: ['save'] }] },
|
||||
// ],
|
||||
// },
|
||||
{
|
||||
code: 'system/Relationship',
|
||||
name: '关系配置',
|
||||
|
@ -3638,6 +3545,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
},
|
||||
{
|
||||
code: 'system/DataSource',
|
||||
|
@ -3720,6 +3629,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "支持", value: "support" },
|
||||
supportDataAccess: true
|
||||
},
|
||||
{
|
||||
code: 'system/Platforms/Setting',
|
||||
|
@ -3767,6 +3678,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
},
|
||||
{
|
||||
code: 'system/Apply',
|
||||
|
@ -3859,6 +3772,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
},
|
||||
{
|
||||
code: 'system/License',
|
||||
|
@ -3955,6 +3870,8 @@ export default [
|
|||
icon: 'icon-keshihua',
|
||||
showPage: ['network-flow'],
|
||||
permissions: [{ permission: 'network-flow', actions: ['query'] }],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
},
|
||||
{
|
||||
path: '5Hpl-O2m8',
|
||||
|
@ -4115,6 +4032,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
},
|
||||
{
|
||||
path: '5Hpl-ZjAG',
|
||||
|
@ -4159,6 +4078,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
},
|
||||
{
|
||||
path: '5Hpl-eS9h',
|
||||
|
@ -4229,6 +4150,8 @@ export default [
|
|||
],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
},
|
||||
{
|
||||
path: '5Hpl-cL34',
|
||||
|
@ -4247,6 +4170,8 @@ export default [
|
|||
actions: ['query'],
|
||||
},
|
||||
],
|
||||
accessSupport: { text: "不支持", value: "unsupported" },
|
||||
supportDataAccess: false
|
||||
},
|
||||
],
|
||||
},
|
||||
|
|
|
@ -51,6 +51,7 @@ import Channel from '../components/Channel/index.vue';
|
|||
import Edge from '../components/Edge/index.vue';
|
||||
import Cloud from '../components/Cloud/index.vue';
|
||||
import { getProviders, detail } from '@/api/link/accessConfig';
|
||||
import { accessConfigTypeFilter } from '@/utils/setting'
|
||||
|
||||
const route = useRoute();
|
||||
const id = route.params.id as string;
|
||||
|
@ -140,7 +141,8 @@ const getTypeList = (result: Record<string, any>) => {
|
|||
const queryProviders = async () => {
|
||||
const resp: any = await getProviders();
|
||||
if (resp.status === 200) {
|
||||
dataSource.value = getTypeList(resp.result);
|
||||
const data = resp.result || []
|
||||
dataSource.value = getTypeList(accessConfigTypeFilter(data as any[]));
|
||||
// dataSource.value = getTypeList(resp.result)[0].list.filter(
|
||||
// (item) => item.name !== '插件设备接入',
|
||||
// );
|
||||
|
@ -151,7 +153,8 @@ const getProvidersData = async () => {
|
|||
if (id !== ':id') {
|
||||
getProviders().then((response: any) => {
|
||||
if (response.status === 200) {
|
||||
const list = getTypeList(response.result);
|
||||
const data = response.result || []
|
||||
const list = getTypeList(accessConfigTypeFilter(data as any[]));
|
||||
dataSource.value = list.filter(
|
||||
(item: any) =>
|
||||
item.channel === 'network' ||
|
||||
|
|
|
@ -188,6 +188,7 @@ import {
|
|||
} from '@/api/link/accessConfig';
|
||||
import { onlyMessage } from '@/utils/comm';
|
||||
import { useMenuStore } from 'store/menu';
|
||||
import { accessConfigTypeFilter } from '@/utils/setting'
|
||||
|
||||
const menuStory = useMenuStore();
|
||||
const tableRef = ref<Record<string, any>>({});
|
||||
|
@ -318,12 +319,7 @@ const getActions = (data: Partial<Record<string, any>>): ActionsType[] => {
|
|||
const getProvidersList = async () => {
|
||||
const res: any = await getProviders();
|
||||
providersList.value = res.result;
|
||||
providersOptions.value = (res?.result || [])
|
||||
?.map((item: any) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}))
|
||||
.filter((item: any) => item.value !== 'plugin_gateway'); // todo 暂时不做插件接入
|
||||
providersOptions.value = accessConfigTypeFilter(res.result || [])
|
||||
};
|
||||
getProvidersList();
|
||||
|
||||
|
|
|
@ -62,6 +62,7 @@ import { queryTree } from '@/api/device/category'
|
|||
import { getTreeData_api } from '@/api/system/department'
|
||||
import { isNoCommunity } from '@/utils/utils'
|
||||
import { getImage } from '@/utils/comm'
|
||||
import { accessConfigTypeFilter } from '@/utils/setting'
|
||||
|
||||
type Emit = {
|
||||
(e: 'update:rowKey', data: string): void
|
||||
|
@ -115,23 +116,7 @@ const columns = [
|
|||
search: {
|
||||
type: 'select',
|
||||
options: () => getProviders().then((resp: any) => {
|
||||
if (isNoCommunity) {
|
||||
return (resp?.result || []).map((item: any) => ({
|
||||
label: item.name,
|
||||
value: item.id
|
||||
}))
|
||||
} else {
|
||||
return (resp?.result || []).filter((item: any) => [
|
||||
'mqtt-server-gateway',
|
||||
'http-server-gateway',
|
||||
'mqtt-client-gateway',
|
||||
'tcp-server-gateway',
|
||||
].includes(item.id))
|
||||
.map((item: any) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}))
|
||||
}
|
||||
return accessConfigTypeFilter(resp.result || [])
|
||||
})
|
||||
}
|
||||
},
|
||||
|
|
|
@ -74,6 +74,7 @@ import { queryTree } from '@/api/device/category';
|
|||
import { getTreeData_api } from '@/api/system/department';
|
||||
import { isNoCommunity } from '@/utils/utils';
|
||||
import { getImage } from '@/utils/comm';
|
||||
import { accessConfigTypeFilter } from '@/utils/setting'
|
||||
|
||||
type Emit = {
|
||||
(e: 'update:rowKey', data: string): void;
|
||||
|
@ -127,26 +128,8 @@ const columns = [
|
|||
type: 'select',
|
||||
options: () =>
|
||||
getProviders().then((resp: any) => {
|
||||
if (isNoCommunity) {
|
||||
return (resp?.result || []).map((item: any) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
} else {
|
||||
return (resp?.result || [])
|
||||
.filter((item: any) =>
|
||||
[
|
||||
'mqtt-server-gateway',
|
||||
'http-server-gateway',
|
||||
'mqtt-client-gateway',
|
||||
'tcp-server-gateway',
|
||||
].includes(item.id),
|
||||
)
|
||||
.map((item: any) => ({
|
||||
label: item.name,
|
||||
value: item.id,
|
||||
}));
|
||||
}
|
||||
const data = resp.result || []
|
||||
return accessConfigTypeFilter(data)
|
||||
}),
|
||||
},
|
||||
},
|
||||
|
|
|
@ -58,12 +58,14 @@ const checkDeviceDelete = async () => {
|
|||
formTouchOff()
|
||||
return
|
||||
}
|
||||
const deviceList = item!.selectorValues?.map(item => item.value) || []
|
||||
const deviceResp = await deviceQuery({ terms: [{ terms: [{ column: 'id', termType: 'in', value: deviceList.toString() }]}]})
|
||||
if (deviceResp.success && (deviceResp.result as any)?.total < (item!.selectorValues?.length || 0)) { // 某一个设备被删除
|
||||
_data.value.branches![props.branchesName].then[props.thenName].actions[props.name].device!.selectorValues = undefined
|
||||
formTouchOff()
|
||||
return
|
||||
if (item?.selector === 'fixed') {
|
||||
const deviceList = item!.selectorValues?.map(item => item.value) || []
|
||||
const deviceResp = await deviceQuery({ terms: [{ terms: [{ column: 'id', termType: 'in', value: deviceList.toString() }]}]})
|
||||
if (deviceResp.success && (deviceResp.result as any)?.total < (item!.selectorValues?.length || 0)) { // 某一个设备被删除
|
||||
_data.value.branches![props.branchesName].then[props.thenName].actions[props.name].device!.selectorValues = undefined
|
||||
formTouchOff()
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -107,9 +107,11 @@ const onKeys: string[] = EventSubscribeKeys({
|
|||
action: props.actionName
|
||||
})
|
||||
|
||||
EventEmitter.subscribe(onKeys, (d: any) => {
|
||||
const handleRequest = () => {
|
||||
columnRequest()
|
||||
})
|
||||
}
|
||||
|
||||
EventEmitter.subscribe(onKeys, handleRequest)
|
||||
|
||||
provide('filter-params', columnOptions)
|
||||
|
||||
|
@ -241,6 +243,10 @@ nextTick(() => {
|
|||
columnRequest()
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
EventEmitter.unSubscribe(onKeys, handleRequest)
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
|
|
@ -560,44 +560,6 @@ const rules = [{
|
|||
}
|
||||
}]
|
||||
|
||||
const formTouchOff = () => {
|
||||
console.log('formTouchOff')
|
||||
formItemContext.onFieldChange()
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验当前执行动作的设备或者产品是否删除
|
||||
*/
|
||||
const checkDeviceDelete = async () => {
|
||||
const item = _data.value.branches![props.branchesName].then[props.thenName].actions[props.name].device
|
||||
const proResp = await queryProductList({ terms: [{ terms: [{ column: 'id', termType: 'eq', value: item!.productId }]}]})
|
||||
if (proResp.success && (proResp.result as any)?.total === 0) { // 产品已删除
|
||||
_data.value.branches![props.branchesName].then[props.thenName].actions[props.name].device!.productId = undefined
|
||||
formTouchOff()
|
||||
return
|
||||
}
|
||||
const deviceList = item!.selectorValues?.map(item => item.value) || []
|
||||
const deviceResp = await deviceQuery({ terms: [{ terms: [{ column: 'id', termType: 'in', value: deviceList.toString() }]}]})
|
||||
if (deviceResp.success && (deviceResp.result as any)?.total < (item!.selectorValues?.length || 0)) { // 某一个设备被删除
|
||||
_data.value.branches![props.branchesName].then[props.thenName].actions[props.name].device!.selectorValues = undefined
|
||||
formTouchOff()
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验当前执行动作的通知配置、消息模板是否删除
|
||||
*/
|
||||
const checkNoticeDelete = () => {
|
||||
|
||||
}
|
||||
|
||||
nextTick(() => {
|
||||
if (_data.value.branches![props.branchesName].then[props.thenName].actions[props.name]?.executor === 'device') {
|
||||
checkDeviceDelete()
|
||||
}
|
||||
})
|
||||
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
|
|
@ -221,7 +221,7 @@ const showDouble = computed(() => {
|
|||
} else {
|
||||
metricOption.value = []
|
||||
}
|
||||
return isRange && !isMetric
|
||||
return isRange && !isMetric.value
|
||||
})
|
||||
|
||||
const mouseover = () => {
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
import { BranchesThen } from '@/views/rule-engine/Scene/typings'
|
||||
|
||||
export const ContextKey = 'columnOptions'
|
||||
|
||||
export const handleParamsData = (data: any[], key: string = 'column'): any[] => {
|
||||
|
@ -12,7 +14,7 @@ export const handleParamsData = (data: any[], key: string = 'column'): any[] =>
|
|||
}
|
||||
|
||||
export const thenRules = [{
|
||||
validator(_: string, value: any) {
|
||||
validator(_: string, value: BranchesThen[]) {
|
||||
if (!value || (value && !value.length) || !value.some(item => item.actions && item.actions.length)) {
|
||||
return Promise.reject('至少配置一个执行动作')
|
||||
}
|
||||
|
|
|
@ -824,7 +824,15 @@
|
|||
placeholder="请输入redirectUrl"
|
||||
/>
|
||||
</j-form-item>
|
||||
<j-form-item label="IP白名单">
|
||||
<j-form-item
|
||||
label="IP白名单"
|
||||
:name="['apiServer', 'ipWhiteList']"
|
||||
:rules="[
|
||||
{
|
||||
validator: validateIP,
|
||||
},
|
||||
]"
|
||||
>
|
||||
<j-textarea
|
||||
v-model:value="form.data.apiServer.ipWhiteList"
|
||||
placeholder="请输入IP白名单,多个地址回车分隔,不填默认均可访问"
|
||||
|
@ -1432,6 +1440,7 @@
|
|||
<script setup lang="ts">
|
||||
import { BASE_API_PATH, TOKEN_KEY } from '@/utils/variable';
|
||||
import { LocalStore, filterSelectNode } from '@/utils/comm';
|
||||
import { testIP } from '@/utils/validate';
|
||||
|
||||
import {
|
||||
getDepartmentList_api,
|
||||
|
@ -1454,6 +1463,7 @@ import {
|
|||
import { randomString } from '@/utils/utils';
|
||||
import { cloneDeep, difference } from 'lodash';
|
||||
import { useMenuStore } from '@/store/menu';
|
||||
import { Rule } from 'ant-design-vue/lib/form';
|
||||
|
||||
const emit = defineEmits(['changeApplyType']);
|
||||
const routeQuery = useRoute().query;
|
||||
|
@ -1836,7 +1846,7 @@ function getErrorNum(
|
|||
}
|
||||
}
|
||||
|
||||
const imageTypes = ref(['image/jpg', 'image/png']);
|
||||
const imageTypes = ref(['image/jpg', 'image/png', 'image/jpeg']);
|
||||
const beforeLogoUpload = (file: any) => {
|
||||
const isType: any = imageTypes.value.includes(file.type);
|
||||
if (!isType) {
|
||||
|
@ -1871,6 +1881,23 @@ function clearNullProp(obj: object) {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 验证IP合法性
|
||||
* @param _rule
|
||||
* @param value
|
||||
*/
|
||||
const validateIP = (_rule: Rule, value: string) => {
|
||||
const ipList = value?.split(/[\n,]/g).filter((i: string) => i && i.trim());
|
||||
const errorIPList = ipList.filter(
|
||||
(f: string) => !testIP(f.replace(/\s*/g, '')),
|
||||
);
|
||||
return new Promise((resolve, reject) => {
|
||||
!errorIPList.length
|
||||
? resolve('')
|
||||
: reject(`[${errorIPList}]不是正确的IP地址`);
|
||||
});
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
|
|
|
@ -3700,8 +3700,8 @@ jetlinks-store@^0.0.3:
|
|||
|
||||
jetlinks-ui-components@^1.0.5:
|
||||
version "1.0.5"
|
||||
resolved "http://47.108.170.157:9013/jetlinks-ui-components/-/jetlinks-ui-components-1.0.5.tgz#6a3cc76cd6d98319e070da597bfcf146fa12d375"
|
||||
integrity sha512-ASPqiWprK2v4/zQIYxOytjkVFgx+AkBaD5Klg2ik88y9uDAW/Ylvqa91v149znihU1y8Q2Nm2PXvUSJFD7HPpw==
|
||||
resolved "http://47.108.170.157:9013/jetlinks-ui-components/-/jetlinks-ui-components-1.0.5.tgz#27312836506c4833dcaaef075e1d3c694d75ae4d"
|
||||
integrity sha512-oum7zipoDUVkm/tPd7yu+mw9mR5NmfBcvBf49ebf55s+nz4zyArFOITzldQJ3Wx6BwaUUH/BiDwskHH+KgBVyg==
|
||||
dependencies:
|
||||
"@vueuse/core" "^9.12.0"
|
||||
ant-design-vue "^3.2.15"
|
||||
|
|
Loading…
Reference in New Issue