Merge branch 'dev' into dev-dictionary
# Conflicts: # src/views/device/Instance/Detail/ChildDevice/index.vue
This commit is contained in:
commit
6a2250cbf3
2
.npmrc
2
.npmrc
|
@ -1,2 +1,2 @@
|
|||
always-auth=true
|
||||
registry=http://registry.jetlinks.cn/
|
||||
registry=https://registry.npmjs.org/
|
||||
|
|
12
README.md
12
README.md
|
@ -48,6 +48,18 @@ yarn dev:force
|
|||
|
||||
此处可以更改系统名称、主题色、系统logo、浏览器页签等
|
||||
|
||||
#### 主题色
|
||||
|
||||
```javascript
|
||||
// src/App.vue
|
||||
|
||||
ConfigProvider.config({
|
||||
theme: {
|
||||
primaryColor: "#315efb"
|
||||
}
|
||||
})
|
||||
```
|
||||
|
||||
#### 2.默认配置
|
||||
|
||||
在代码根目录找到`config\config.ts`文件
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
"event-source-polyfill": "^1.0.31",
|
||||
"global": "^4.4.0",
|
||||
"jetlinks-store": "^0.0.3",
|
||||
"jetlinks-ui-components": "^1.0.33",
|
||||
"jetlinks-ui-components": "^1.0.34-2",
|
||||
"js-cookie": "^3.0.1",
|
||||
"jsencrypt": "^3.3.2",
|
||||
"less": "^4.1.3",
|
||||
|
|
|
@ -15,7 +15,11 @@ const system = useSystem();
|
|||
const {configInfo} = storeToRefs(system);
|
||||
|
||||
system.setDocumentTitle()
|
||||
|
||||
ConfigProvider.config({
|
||||
theme: {
|
||||
primaryColor: "#315efb"
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
</div>
|
||||
</div>
|
||||
<div class="editor">
|
||||
<j-monaco-editor v-if="loading" v-model:model-value="_value" theme="vs" ref="editor" language="javascript" :registrationTypescript="typescriptTip"
|
||||
<j-monaco-editor v-if="loading" v-model:model-value="_value" theme="vs" ref="editor" language="javascript" :registrationTypescript="typescriptTip" :registrationTips="registrationTips"
|
||||
:init="editorInit"/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -41,11 +41,13 @@ import {
|
|||
} from '@/api/device/instance';
|
||||
import { useInstanceStore } from '@/store/instance';
|
||||
import { useProductStore } from '@/store/product';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import { inject } from 'vue'
|
||||
interface Props {
|
||||
mode?: 'advance' | 'simple';
|
||||
id?: string;
|
||||
value?: string;
|
||||
tips?: Array<any>
|
||||
}
|
||||
const props = defineProps<Props>()
|
||||
const target = inject('target')
|
||||
|
@ -71,28 +73,9 @@ type SymbolType = {
|
|||
const typescriptTip = reactive({
|
||||
typescript: ''
|
||||
})
|
||||
|
||||
const queryCode = () => {
|
||||
let id = ''
|
||||
if(target==='device'){
|
||||
id = instanceStore.current.id
|
||||
queryTypescript(id).then(res => {
|
||||
if (res.status===200) {
|
||||
typescriptTip.typescript = res.result
|
||||
}
|
||||
})
|
||||
}else if(target ==='product'){
|
||||
id = productStore.current.id
|
||||
queryProductTs(id).then(res => {
|
||||
if (res.status===200) {
|
||||
typescriptTip.typescript = res.result
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
queryCode()
|
||||
|
||||
const registrationTips = ref<any>({
|
||||
name: 'javascript'
|
||||
})
|
||||
const editorInit = (editor: any, monaco: any) => {
|
||||
monaco.languages.typescript.javascriptDefaults.setDiagnosticsOptions({
|
||||
noSemanticValidation: true,
|
||||
|
@ -200,11 +183,27 @@ const _value = computed({
|
|||
})
|
||||
|
||||
const loading = ref(false)
|
||||
onMounted(() => {
|
||||
setTimeout(() => {
|
||||
loading.value = true;
|
||||
}, 100);
|
||||
})
|
||||
const queryCode = () => {
|
||||
registrationTips.value.suggestions = cloneDeep(props.tips)
|
||||
let id = ''
|
||||
if(target==='device'){
|
||||
id = instanceStore.current.id
|
||||
queryTypescript(id).then(res => {
|
||||
if (res.status===200) {
|
||||
typescriptTip.typescript = res.result
|
||||
}
|
||||
})
|
||||
}else if(target ==='product'){
|
||||
id = productStore.current.id
|
||||
queryProductTs(id).then(res => {
|
||||
if (res.status===200) {
|
||||
typescriptTip.typescript = res.result
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
const addOperatorValue = (val: string) => {
|
||||
editor.value?.insert(val)
|
||||
|
@ -220,6 +219,13 @@ defineExpose({
|
|||
addOperatorValue
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
setTimeout(() => {
|
||||
loading.value = true;
|
||||
}, 100);
|
||||
})
|
||||
|
||||
queryCode()
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.editor-box {
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
mode="advance"
|
||||
key="advance"
|
||||
v-model:value="_value"
|
||||
:tips="tips"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -59,7 +60,8 @@ import Editor from './Editor/index.vue';
|
|||
import Debug from './Debug/index.vue';
|
||||
import Operator from './Operator/index.vue';
|
||||
import { FULL_CODE } from 'jetlinks-ui-components/es/DataTable'
|
||||
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
import { PropertyMetadata } from '@/views/device/Product/typings';
|
||||
interface Emits {
|
||||
(e: 'save', data: string | undefined): void;
|
||||
(e: 'close'): void;
|
||||
|
@ -77,7 +79,7 @@ const props = defineProps({
|
|||
const _value = ref<string | undefined>(props.value);
|
||||
const _disabled = ref<boolean>(true);
|
||||
const fullRef = inject(FULL_CODE);
|
||||
|
||||
const tips = ref<any[]>([])
|
||||
const handleCancel = () => {
|
||||
emit('close');
|
||||
};
|
||||
|
@ -98,6 +100,29 @@ const addOperatorValue = (val: string) => {
|
|||
editor.value.addOperatorValue(val);
|
||||
};
|
||||
|
||||
const getAllCrud = () => {
|
||||
const list = cloneDeep(props.propertiesOptions)?.filter((i:any)=>
|
||||
props?.id !== i.id
|
||||
)
|
||||
console.log(list,'list')
|
||||
// 转化为语法提示
|
||||
list.forEach(item => {
|
||||
console.log(item)
|
||||
const config = item
|
||||
tips.value.push({
|
||||
label: `${config.name}$recent实时值`,
|
||||
insertText:`$recent ("${config.id}")`,
|
||||
kind: 18,
|
||||
})
|
||||
tips.value.push({
|
||||
label: `${config.name}上一值`,
|
||||
insertText: `$lastState("${config.id}"))`,
|
||||
kind: 18
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
watch(() => _value.value, () => {
|
||||
_disabled.value = true
|
||||
})
|
||||
|
@ -105,6 +130,7 @@ watch(() => _value.value, () => {
|
|||
const onSuccess = (bool: boolean) => {
|
||||
_disabled.value = bool;
|
||||
}
|
||||
getAllCrud()
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.header {
|
||||
|
|
|
@ -107,8 +107,6 @@ const jump = (item: any) => {
|
|||
router.push(item.path)
|
||||
}
|
||||
|
||||
|
||||
|
||||
watchEffect(() => {
|
||||
if (router.currentRoute) {
|
||||
const paths = router.currentRoute.value.matched
|
||||
|
@ -116,6 +114,10 @@ watchEffect(() => {
|
|||
basicLayout.value.openKeys = paths.map(item => item.path)
|
||||
console.log(paths) //
|
||||
}
|
||||
|
||||
if (route.query?.layout === 'false') {
|
||||
basicLayout.value.pure = true
|
||||
}
|
||||
})
|
||||
|
||||
const toDoc = () => window.open('http://doc.v2.jetlinks.cn/');
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<template>
|
||||
<template v-if="isPermission">
|
||||
<template v-if="popConfirm">
|
||||
<j-popconfirm :overlayStyle='{width: "220px"}' v-bind="popConfirm" :disabled="!isPermission || props.disabled">
|
||||
<j-popconfirm :disabled="!isPermission || props.disabled" :overlayStyle='{width: "220px", zIndex: 1075 }' v-bind="popConfirm">
|
||||
<j-tooltip v-if="tooltip" v-bind="tooltip">
|
||||
<slot v-if="noButton"></slot>
|
||||
<j-button v-else v-bind="props" :disabled="_isPermission" :style="props.style">
|
||||
|
@ -120,4 +120,4 @@ const _isPermission = computed(() =>
|
|||
</script>
|
||||
<style scoped lang="less">
|
||||
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
@ -4,7 +4,7 @@ import store from './store'
|
|||
import components from './components'
|
||||
import router from './router'
|
||||
import './style.less'
|
||||
|
||||
import 'ant-design-vue/dist/antd.variable.min.css'
|
||||
import dayjs from 'dayjs';
|
||||
import 'dayjs/locale/zh-cn';
|
||||
dayjs.locale('zh-cn');
|
||||
|
|
|
@ -89,4 +89,4 @@ export const useSystem = defineStore('system', {
|
|||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
|
|
@ -30,9 +30,9 @@ body {
|
|||
|
||||
.ant-pro-top-nav-header {
|
||||
.ant-menu-item {
|
||||
padding: 0 10px !important;
|
||||
&:not(:first-child) {
|
||||
margin-left: 8px !important;
|
||||
padding: 0 14px !important;
|
||||
&:first-child {
|
||||
padding: 0 10px !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,8 +71,8 @@ export const isNoCommunity = !(localStorage.getItem(SystemConst.VERSION_CODE) ==
|
|||
|
||||
/**
|
||||
* 生成随机数
|
||||
* @param length
|
||||
* @returns
|
||||
* @param length
|
||||
* @returns
|
||||
*/
|
||||
export const randomString = (length?: number) => {
|
||||
const tempLength = length || 32;
|
||||
|
@ -87,8 +87,8 @@ export const randomString = (length?: number) => {
|
|||
|
||||
/**
|
||||
* 时间戳转时分秒文本
|
||||
* @param time
|
||||
* @returns
|
||||
* @param time
|
||||
* @returns
|
||||
*/
|
||||
export const timestampFormat = (time: number) => {
|
||||
let hour = 0;
|
||||
|
@ -182,4 +182,4 @@ export const EventEmitter = {
|
|||
})
|
||||
return this
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,6 +90,7 @@ import {
|
|||
} from '@/utils/consts';
|
||||
import { usePermissionStore } from '@/store/permission';
|
||||
import RoleShow from './components/RoleShow/index.vue';
|
||||
import {isNoCommunity} from "@/utils/utils";
|
||||
|
||||
const imageTypes = reactive([
|
||||
'image/jpeg',
|
||||
|
@ -103,7 +104,8 @@ const imageTypes = reactive([
|
|||
const user = useUserInfo();
|
||||
|
||||
type KeyType = 'HomeView' | 'BindThirdAccount' | 'Subscribe' | 'StationMessage';
|
||||
const list: { key: KeyType; title: string }[] = [
|
||||
console.log(isNoCommunity)
|
||||
const list: { key: KeyType; title: string }[] = isNoCommunity ? [
|
||||
{
|
||||
key: 'HomeView',
|
||||
title: '首页视图',
|
||||
|
@ -120,6 +122,19 @@ const list: { key: KeyType; title: string }[] = [
|
|||
key: 'StationMessage',
|
||||
title: '站内信',
|
||||
},
|
||||
] : [
|
||||
{
|
||||
key: 'HomeView',
|
||||
title: '首页视图',
|
||||
},
|
||||
{
|
||||
key: 'Subscribe',
|
||||
title: '我的订阅',
|
||||
},
|
||||
{
|
||||
key: 'StationMessage',
|
||||
title: '站内信',
|
||||
},
|
||||
];
|
||||
|
||||
const tabs = {
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
></j-col>
|
||||
<j-col :span="6"
|
||||
><TopCard
|
||||
title="今日设备信息量"
|
||||
title="今日设备消息量"
|
||||
:footer="messageFooter"
|
||||
:value="dayMessage"
|
||||
>
|
||||
|
|
|
@ -1,106 +1,60 @@
|
|||
<template>
|
||||
<SaveChild
|
||||
v-if="childVisible"
|
||||
@close-child-save="closeChildSave"
|
||||
:childData="_current"
|
||||
/>
|
||||
<SaveChild v-if="childVisible" @close-child-save="closeChildSave" :childData="_current" />
|
||||
<div v-else>
|
||||
<pro-search
|
||||
:columns="columns"
|
||||
target="child-device"
|
||||
@search="handleSearch"
|
||||
class="device-child-device-search"
|
||||
/>
|
||||
<pro-search :columns="columns" target="child-device" @search="handleSearch" class="device-child-device-search" />
|
||||
<!-- <j-divider /> -->
|
||||
<JProTable
|
||||
ref="childDeviceRef"
|
||||
:columns="columns"
|
||||
:request="query"
|
||||
:bodyStyle="{
|
||||
padding: 0
|
||||
}"
|
||||
:defaultParams="{
|
||||
terms: [
|
||||
{
|
||||
column: 'parentId',
|
||||
value: detail?.id || '',
|
||||
termType: 'eq',
|
||||
},
|
||||
],
|
||||
}"
|
||||
:rowSelection="{
|
||||
selectedRowKeys: _selectedRowKeys,
|
||||
onChange: onSelectChange,
|
||||
}"
|
||||
:params="params"
|
||||
:model="'TABLE'"
|
||||
>
|
||||
<JProTable ref="childDeviceRef" :columns="columns" :request="query" :bodyStyle="{
|
||||
padding: 0
|
||||
}" :defaultParams="{
|
||||
terms: [
|
||||
{
|
||||
column: 'parentId',
|
||||
value: detail?.id || '',
|
||||
termType: 'eq',
|
||||
},
|
||||
],
|
||||
}" :rowSelection="{
|
||||
selectedRowKeys: _selectedRowKeys,
|
||||
onChange: onSelectChange,
|
||||
}" :params="params" :model="'TABLE'">
|
||||
<template #rightExtraRender>
|
||||
<j-space>
|
||||
<PermissionButton
|
||||
type="primary"
|
||||
v-if="
|
||||
detail?.accessProvider === 'official-edge-gateway'
|
||||
"
|
||||
hasPermission="device/Instance:update"
|
||||
@click="
|
||||
_current = {};
|
||||
childVisible = true;
|
||||
"
|
||||
>新增并绑定</PermissionButton
|
||||
>
|
||||
<PermissionButton
|
||||
type="primary"
|
||||
@click="visible = true"
|
||||
hasPermission="device/Instance:update"
|
||||
>
|
||||
绑定</PermissionButton
|
||||
>
|
||||
<PermissionButton
|
||||
type="primary"
|
||||
hasPermission="device/Instance:update"
|
||||
:popConfirm="{
|
||||
title: '确定解绑吗?',
|
||||
onConfirm: handleUnBind,
|
||||
}"
|
||||
>批量解除</PermissionButton
|
||||
>
|
||||
<PermissionButton type="primary" v-if="detail?.accessProvider === 'official-edge-gateway'
|
||||
" hasPermission="device/Instance:update" @click="
|
||||
_current = {};
|
||||
childVisible = true;
|
||||
">新增并绑定</PermissionButton>
|
||||
<PermissionButton type="primary" @click="visible = true" hasPermission="device/Instance:update">
|
||||
绑定</PermissionButton>
|
||||
<PermissionButton type="primary" hasPermission="device/Instance:update" :popConfirm="{
|
||||
title: '确定解绑吗?',
|
||||
onConfirm: handleUnBind,
|
||||
}">批量解除</PermissionButton>
|
||||
</j-space>
|
||||
</template>
|
||||
<template #registryTime="slotProps">
|
||||
{{
|
||||
slotProps.registryTime
|
||||
? moment(slotProps.registryTime).format(
|
||||
'YYYY-MM-DD HH:mm:ss',
|
||||
)
|
||||
: ''
|
||||
? moment(slotProps.registryTime).format(
|
||||
'YYYY-MM-DD HH:mm:ss',
|
||||
)
|
||||
: ''
|
||||
}}
|
||||
</template>
|
||||
<template #state="slotProps">
|
||||
<j-badge
|
||||
:text="slotProps.state.text"
|
||||
:status="statusMap.get(slotProps.state.value)"
|
||||
/>
|
||||
<j-badge :text="slotProps.state.text" :status="statusMap.get(slotProps.state.value)" />
|
||||
</template>
|
||||
<template #action="slotProps">
|
||||
<j-space :size="16">
|
||||
<template
|
||||
v-for="i in getActions(slotProps, 'table')"
|
||||
:key="i.key"
|
||||
>
|
||||
<PermissionButton
|
||||
v-if="i.key !== 'update' || detail.accessProvider === 'official-edge-gateway'"
|
||||
:disabled="i.disabled"
|
||||
:popConfirm="i.popConfirm"
|
||||
:tooltip="{
|
||||
<template v-for="i in getActions(slotProps, 'table')" :key="i.key">
|
||||
<PermissionButton v-if="i.key !== 'update' || detail.accessProvider === 'official-edge-gateway'"
|
||||
:disabled="i.disabled" :popConfirm="i.popConfirm" :tooltip="{
|
||||
...i.tooltip,
|
||||
}"
|
||||
@click="i.onClick"
|
||||
type="link"
|
||||
style="padding: 0px"
|
||||
:hasPermission="'device/Instance:' + i.key"
|
||||
>
|
||||
<template #icon><AIcon :type="i.icon" /></template>
|
||||
}" @click="i.onClick" type="link" style="padding: 0px"
|
||||
:hasPermission="'device/Instance:' + i.key">
|
||||
<template #icon>
|
||||
<AIcon :type="i.icon" />
|
||||
</template>
|
||||
</PermissionButton>
|
||||
</template>
|
||||
</j-space>
|
||||
|
@ -113,7 +67,7 @@
|
|||
<script setup lang="ts">
|
||||
import moment from 'moment';
|
||||
import type { ActionsType } from '@/components/Table';
|
||||
import {query, unbindDevice, unbindBatchDevice, queryByParent , deleteDeviceMapping} from '@/api/device/instance';
|
||||
import { query, unbindDevice, unbindBatchDevice, queryByParent, deleteDeviceMapping } from '@/api/device/instance';
|
||||
import { useInstanceStore } from '@/store/instance';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import BindChildDevice from './BindChildDevice/index.vue';
|
||||
|
@ -241,10 +195,12 @@ const getActions = (data: Partial<Record<string, any>>): ActionsType[] => {
|
|||
data.id,
|
||||
{},
|
||||
);
|
||||
const res = await deleteDeviceMapping(
|
||||
detail.value.id,
|
||||
{deviceIds:[data.id]}
|
||||
)
|
||||
if (instanceStore.current.accessProvider === 'official-edge-gateway') {
|
||||
const res = await deleteDeviceMapping(
|
||||
detail.value.id,
|
||||
{ ids: [data.id] }
|
||||
)
|
||||
}
|
||||
if (resp.status === 200) {
|
||||
childDeviceRef.value?.reload();
|
||||
onlyMessage('操作成功!');
|
||||
|
@ -285,11 +241,13 @@ const handleUnBind = async () => {
|
|||
detail.value.id,
|
||||
_selectedRowKeys.value,
|
||||
);
|
||||
if (resp.status === 200) {
|
||||
if (instanceStore.current.accessProvider === 'official-edge-gateway') {
|
||||
const res = await deleteDeviceMapping(
|
||||
detail.value.id,
|
||||
{ids:[_selectedRowKeys.value]}
|
||||
{ ids: [_selectedRowKeys.value] }
|
||||
)
|
||||
}
|
||||
if (resp.status === 200) {
|
||||
onlyMessage('操作成功!');
|
||||
cancelSelect();
|
||||
childDeviceRef.value?.reload();
|
||||
|
@ -316,7 +274,7 @@ const closeBindDevice = (val: boolean) => {
|
|||
const closeChildSave = () => {
|
||||
childVisible.value = false;
|
||||
};
|
||||
onMounted(()=>{
|
||||
onMounted(() => {
|
||||
console.log(detail.value.accessProvider)
|
||||
})
|
||||
</script>
|
||||
|
|
|
@ -1806,4 +1806,4 @@ const Status = defineComponent({
|
|||
},
|
||||
})
|
||||
|
||||
export default Status
|
||||
export default Status
|
||||
|
|
|
@ -177,7 +177,7 @@ const newFunctions = computed(() => {
|
|||
required: tableItem.expands?.required
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
result.push({
|
||||
...func,
|
||||
table: array,
|
||||
|
@ -197,7 +197,7 @@ const handleExecute = async (func: any) => {
|
|||
.then(async () => {
|
||||
const obj = {};
|
||||
func.table.forEach((item: any) => {
|
||||
if (item.type === 'object') {
|
||||
if (item.type === 'object' && item.value) {
|
||||
obj[item.id] = JSON.parse(item.value);
|
||||
} else {
|
||||
obj[item.id] = item.value;
|
||||
|
|
|
@ -313,8 +313,9 @@ const submitData = () => {
|
|||
if (form.id === '') {
|
||||
form.id = undefined;
|
||||
}
|
||||
const res = await addProduct(form);
|
||||
loading.value = false
|
||||
const res = await addProduct(form).finally(()=>{
|
||||
loading.value = false
|
||||
});
|
||||
if (res.status === 200) {
|
||||
onlyMessage('保存成功!');
|
||||
visible.value = false;
|
||||
|
|
|
@ -65,16 +65,13 @@
|
|||
<AIcon type="SettingOutlined" />
|
||||
配置
|
||||
</j-button>
|
||||
|
||||
|
||||
</j-tooltip>
|
||||
<PermissionButton
|
||||
v-else
|
||||
:has-permission="`${permission}:update`"
|
||||
type="link"
|
||||
key="inputs"
|
||||
>
|
||||
<InputParams v-model:value="data.record.inputs" />
|
||||
</PermissionButton>
|
||||
<InputParams
|
||||
v-else
|
||||
v-model:value="data.record.inputs"
|
||||
:has-permission="`${permission}:update`"
|
||||
/>
|
||||
</template>
|
||||
<template #output="{ data }">
|
||||
{{ data.record.output?.type }}
|
||||
|
@ -99,14 +96,11 @@
|
|||
配置
|
||||
</j-button>
|
||||
</j-tooltip>
|
||||
<PermissionButton
|
||||
v-else
|
||||
:has-permission="`${permission}:update`"
|
||||
type="link"
|
||||
key="properties"
|
||||
>
|
||||
<ConfigParams v-model:value="data.record.valueType" />
|
||||
</PermissionButton>
|
||||
<ConfigParams
|
||||
v-else
|
||||
v-model:value="data.record.valueType"
|
||||
:has-permission="`${permission}:update`"
|
||||
/>
|
||||
</template>
|
||||
<template #outInput>
|
||||
object
|
||||
|
@ -127,22 +121,17 @@
|
|||
配置
|
||||
</j-button> -->
|
||||
<!-- </j-tooltip> -->
|
||||
<PermissionButton
|
||||
:has-permission="`${permission}:update`"
|
||||
type="link"
|
||||
key="setting"
|
||||
:tooltip="target === 'device' && productNoEdit.id?.includes?.(data.record.id) ? {
|
||||
title: '继承自产品物模型的数据不支持删除',
|
||||
} : undefined"
|
||||
>
|
||||
<OtherSetting
|
||||
<OtherSetting
|
||||
v-model:value="data.record.expands"
|
||||
:id="data.record.id"
|
||||
:disabled="target === 'device' && productNoEdit.id?.includes?.(data.record.id)"
|
||||
:record="data.record"
|
||||
:type="data.record.valueType.type"
|
||||
:has-permission="`${permission}:update`"
|
||||
:tooltip="target === 'device' && productNoEdit.id?.includes?.(data.record.id) ? {
|
||||
title: '继承自产品物模型的数据不支持删除',
|
||||
} : undefined"
|
||||
/>
|
||||
</PermissionButton>
|
||||
|
||||
</template>
|
||||
<template #action="{data}">
|
||||
|
@ -563,4 +552,4 @@ onBeforeRouteLeave((to, from, next) => { // 设备管理外路由跳转
|
|||
justify-content: space-between;
|
||||
padding-bottom: 16px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
@ -6,7 +6,15 @@
|
|||
<template #config="{ data }">
|
||||
<ConfigModal v-model:value="data.record.valueType" :showOther="false" />
|
||||
</template>
|
||||
<ModelButton />
|
||||
<PermissionButton
|
||||
key="properties"
|
||||
:has-permission="hasPermission"
|
||||
style="padding-left: 0;"
|
||||
type="link"
|
||||
>
|
||||
<AIcon type="SettingOutlined" />
|
||||
配置
|
||||
</PermissionButton>
|
||||
</DataTableObject>
|
||||
</template>
|
||||
|
||||
|
@ -23,7 +31,7 @@ import {omit} from "lodash-es";
|
|||
import {TypeStringMap, validatorConfig} from "../../columns";
|
||||
|
||||
const columns = [
|
||||
{
|
||||
{
|
||||
title: '参数标识',
|
||||
dataIndex: 'id',
|
||||
type: 'text',
|
||||
|
@ -52,7 +60,7 @@ const columns = [
|
|||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
{
|
||||
title: '参数名称',
|
||||
dataIndex: 'name',
|
||||
type: 'text',
|
||||
|
@ -139,6 +147,7 @@ const props = defineProps({
|
|||
type: Array as PropType<{ label: string; value: string }[]>,
|
||||
default: () => [],
|
||||
},
|
||||
hasPermission: String,
|
||||
});
|
||||
|
||||
const value = ref(props.value.properties);
|
||||
|
@ -151,7 +160,7 @@ const confirm = (data: any) => {
|
|||
})
|
||||
|
||||
console.log('ConfigParams',newObject)
|
||||
|
||||
|
||||
emit('update:value', {
|
||||
properties: newObject,
|
||||
type: 'object',
|
||||
|
|
|
@ -9,7 +9,14 @@
|
|||
<template #config="{ data }">
|
||||
<ConfigModal v-model:value="data.record.valueType" :showOther="false" />
|
||||
</template>
|
||||
<ModelButton />
|
||||
<PermissionButton
|
||||
key="properties"
|
||||
:has-permission="hasPermission"
|
||||
type="link"
|
||||
>
|
||||
<AIcon type="SettingOutlined" />
|
||||
配置
|
||||
</PermissionButton>
|
||||
</DataTableObject>
|
||||
</template>
|
||||
|
||||
|
@ -43,6 +50,7 @@ const props = defineProps({
|
|||
type: Array as PropType<{ label: string; value: string }[]>,
|
||||
default: () => [],
|
||||
},
|
||||
hasPermission: String,
|
||||
});
|
||||
const formItemContext = Form.useInjectFormItemContext();
|
||||
|
||||
|
|
|
@ -17,4 +17,4 @@ const props = defineProps({
|
|||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
@ -120,7 +120,7 @@ const validator = (_: any, value: any) => {
|
|||
}
|
||||
|
||||
const typeValidator = (_: any, value: any) => {
|
||||
if (value === undefined) {
|
||||
if (value === undefined || value === null) {
|
||||
return Promise.reject(validatorTip())
|
||||
}
|
||||
if (type === 'string' && value?.length > 64) {
|
||||
|
@ -146,7 +146,7 @@ const handleValueByType = (value: any, isRange: boolean = false) => {
|
|||
|
||||
const confirm = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
formRef.value.validate().then(() => {
|
||||
formRef.value.validate().then((res) => {
|
||||
let value = props.value.range === true ? formData.rangeValue : formData.value
|
||||
|
||||
if (['int', 'long'].includes(type)) {
|
||||
|
|
|
@ -51,8 +51,17 @@
|
|||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<ModelButton :disabled="disabled"/>
|
||||
<PermissionButton
|
||||
key="setting"
|
||||
:disabled="disabled"
|
||||
:has-permission="hasPermission"
|
||||
:tooltip="tooltip"
|
||||
style="padding-left: 0;"
|
||||
type="link"
|
||||
>
|
||||
<AIcon type="SettingOutlined" />
|
||||
配置
|
||||
</PermissionButton>
|
||||
</j-popconfirm-modal>
|
||||
</template>
|
||||
|
||||
|
@ -88,6 +97,8 @@ const props = defineProps({
|
|||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
hasPermission: String,
|
||||
tooltip: Object
|
||||
})
|
||||
|
||||
const fullRef = inject(FULL_CODE);
|
||||
|
@ -225,4 +236,4 @@ watch(() => props.value, () => {
|
|||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
@ -31,7 +31,7 @@ const handle = async (appId: string, url: string) => {
|
|||
let menuUrl: any = url;
|
||||
if (res.status === 200) {
|
||||
if (res.result.page.routeType === 'hash') {
|
||||
menuUrl = `/#${url}`;
|
||||
menuUrl = `#${url}`;
|
||||
}
|
||||
if (res.result.provider === 'internal-standalone') {
|
||||
const urlStandalone = `${res.result.page.baseUrl}/api/application/sso/${appId}/login?redirect=${menuUrl}?layout=false`;
|
||||
|
|
|
@ -5,12 +5,12 @@ const Webhook = () => {
|
|||
<div class={'doc'}>
|
||||
<h1>1. 概述</h1>
|
||||
<div>
|
||||
webhook是一个接收HTTP请求的URL(本平台默认只支持HTTP
|
||||
POST请求),实现了Webhook的第三方系统可以基于该URL订阅本平台系统信息,本平台按配置把特定的事件结果推送到指定的地址,便于系统做后续处理。
|
||||
WebHook是一个接收HTTP请求的URL(本平台默认只支持HTTP
|
||||
POST请求),实现了WebHook的第三方系统可以基于该URL订阅本平台系统信息,本平台按配置把特定的事件结果推送到指定的地址,便于系统做后续处理。
|
||||
</div>
|
||||
<h1>2.通知配置说明</h1>
|
||||
<h2>1、Webhook</h2>
|
||||
<div>Webhook地址。</div>
|
||||
<h2>1、WebHook</h2>
|
||||
<div>WebHook地址。</div>
|
||||
|
||||
<h2>2、请求头</h2>
|
||||
<div>
|
||||
|
|
|
@ -278,12 +278,12 @@
|
|||
<!-- webhook -->
|
||||
<template v-if="formData.type === 'webhook'">
|
||||
<j-form-item
|
||||
label="Webhook"
|
||||
label="WebHook"
|
||||
v-bind="validateInfos['configuration.url']"
|
||||
>
|
||||
<j-input
|
||||
v-model:value="formData.configuration.url"
|
||||
placeholder="请输入Webhook"
|
||||
placeholder="请输入WebHook"
|
||||
/>
|
||||
</j-form-item>
|
||||
<j-form-item label="请求头">
|
||||
|
|
|
@ -28,7 +28,7 @@ export const NOTICE_METHOD: INoticeMethod[] = [
|
|||
value: 'sms',
|
||||
},
|
||||
{
|
||||
label: 'webhook',
|
||||
label: 'WebHook',
|
||||
value: 'webhook',
|
||||
},
|
||||
];
|
||||
|
@ -75,7 +75,7 @@ export const MSG_TYPE = {
|
|||
],
|
||||
webhook: [
|
||||
{
|
||||
label: 'webhook',
|
||||
label: 'WebHook',
|
||||
value: 'http',
|
||||
logo: getImage('/notice/webhook.png'),
|
||||
},
|
||||
|
|
|
@ -192,6 +192,12 @@ const columns = [
|
|||
hideInTable: true,
|
||||
search: {
|
||||
type: 'treeSelect',
|
||||
componentProps: {
|
||||
fieldNames: {
|
||||
label: 'name',
|
||||
value: 'value',
|
||||
},
|
||||
},
|
||||
options: () => new Promise((resolve) => {
|
||||
getTreeData_api({ paging: false }).then((resp: any) => {
|
||||
const formatValue = (list: any[]) => {
|
||||
|
@ -260,4 +266,4 @@ const handleClick = (detail: any) => {
|
|||
padding-right: 0px;
|
||||
padding-left: 0px;
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
@ -263,7 +263,6 @@ const productQuery = (p: any) => {
|
|||
}
|
||||
sorts.push({ name: 'createTime', order: 'desc' });
|
||||
p.sorts = sorts;
|
||||
console.log('productQuery',p)
|
||||
return queryProductList(p);
|
||||
};
|
||||
|
||||
|
|
|
@ -162,4 +162,4 @@ watchEffect(() => {
|
|||
|
||||
<style scoped lang='less'>
|
||||
@import './index.less';
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
@ -196,4 +196,4 @@ watchEffect(() => {
|
|||
display: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
|
|
@ -3738,10 +3738,10 @@ jetlinks-store@^0.0.3:
|
|||
resolved "https://registry.npmjs.org/jetlinks-store/-/jetlinks-store-0.0.3.tgz"
|
||||
integrity sha512-AZf/soh1hmmwjBZ00fr1emuMEydeReaI6IBTGByQYhTmK1Zd5pQAxC7WLek2snRAn/HHDgJfVz2hjditKThl6Q==
|
||||
|
||||
jetlinks-ui-components@^1.0.33:
|
||||
version "1.0.33"
|
||||
resolved "http://registry.jetlinks.cn/jetlinks-ui-components/-/jetlinks-ui-components-1.0.33.tgz#49ce2b8c1e7be66272864728d5df82f834ec4490"
|
||||
integrity sha512-vYUP4MhzO6r0golmKqO8lHk8w5ldhAkgXWZfFII1Zoa7JtUwveqpSywTU23iSmCN+4muPaSLvHw713k6OdzLmg==
|
||||
jetlinks-ui-components@^1.0.34-2:
|
||||
version "1.0.34-2"
|
||||
resolved "https://registry.npmjs.org/jetlinks-ui-components/-/jetlinks-ui-components-1.0.34-2.tgz#8acd9f5dd4e5baa89703391620c80545c60ea98d"
|
||||
integrity sha512-Z8/TRoJut1CuGsXXkzUYwvmKdQ1FhvXc46uK308M76Ezv4iJIGphwt1ancqVst0+WRBWoG6ps2ZsBbqCSQB7Rg==
|
||||
dependencies:
|
||||
"@vueuse/core" "^9.12.0"
|
||||
"@vueuse/router" "^9.13.0"
|
||||
|
|
Loading…
Reference in New Issue