Compare commits

...

10 Commits

Author SHA1 Message Date
fhysy 2f4cd3b940 refactor(system): 调整基础配置并优化地图组件
- 修改高德地图 API 密钥和密钥安全码获取方式
- 调整基础配置中的标题和头部主题颜色
- 修改暗黑主题背景颜色
- 更新开发环境代理配置
2025-04-03 17:00:51 +08:00
XieYongHong 67da9dedf8 fix: 【设备管理-标签】修复输入0,无法在详情显示 2025-03-21 14:24:00 +08:00
XieYongHong 10f77f296b fix: 【设备管理-运行状态】修复界面卡死无法点击 2025-03-11 11:37:10 +08:00
leiqiaochu 5b76b078d2 fix: bug#32748【仪表盘】【2.2/master】当集群部署时,仪表盘获取的集群节点展示需修改为id 2025-01-10 17:24:30 +08:00
leiqiaochu 099db8c2dc fix: bug#31510 2024-12-19 16:13:18 +08:00
leiqiaochu 128652dcd5 fix: bug#32248 2024-12-19 15:34:55 +08:00
qiaochuLei e5966f19e2
fix: bug#32507【通知配置】【2.2】通知管理>>>通知配置访问时,Console报错,界面展示空白 2024-12-06 15:32:46 +08:00
qiaochuLei 92d8c5090e
fix: bug#31587
* fix: 设备映射传值网关id->插件id

* fix: 31587
2024-11-22 09:53:41 +08:00
qiaochuLei 57096169c6
fix: 设备映射传值网关id->插件id
* fix: bug#28724 【菜单管理】【/2.1/2.2】菜单管理新增菜单时,排序需优化(默认为10000开始)

* fix: 设备映射传值网关id->插件id
2024-11-14 15:43:48 +08:00
leiqiaochu 2e2ec80979 fix: bug#17573【设备】插件设备进行映射时,传参ID错误,传入了设备接入网关ID,应该为插件ID 2024-10-31 11:52:22 +08:00
12 changed files with 121 additions and 75 deletions

View File

@ -15,6 +15,7 @@
@cancel="modalVis = false" @cancel="modalVis = false"
@ok="handleModalSubmit" @ok="handleModalSubmit"
destroyOnClose destroyOnClose
:zIndex="1031"
> >
<div style="width: 100%; height: 400px"> <div style="width: 100%; height: 400px">
<el-amap <el-amap
@ -36,11 +37,17 @@
import { initAMapApiLoader } from '@vuemap/vue-amap'; import { initAMapApiLoader } from '@vuemap/vue-amap';
import '@vuemap/vue-amap/dist/style.css'; import '@vuemap/vue-amap/dist/style.css';
import { EnvironmentOutlined } from '@ant-design/icons-vue'; import { EnvironmentOutlined } from '@ant-design/icons-vue';
import { useSystem } from '@/store/system';
import { storeToRefs } from 'pinia'
const system = useSystem();
const {configInfo} = storeToRefs(system);
console.log("configInfo",configInfo)
initAMapApiLoader({ initAMapApiLoader({
// key: '95fa72137f4263f8e64ae01f766ad09c', // key: '95fa72137f4263f8e64ae01f766ad09c',
key: 'a0415acfc35af15f10221bfa5a6850b4', key: configInfo.value.amap.apiKey || '3bef1ec2347fff12a6b7da11af70d194',
securityJsCode: 'cae6108ec3dd222f946d1a7237c78be0', securityJsCode: configInfo.value.amap.secretKey || '259f338768822197a09e3e4959e82cce',
}); });
interface EmitProps { interface EmitProps {

View File

@ -38,7 +38,7 @@ body {
} }
.dark { .dark {
background-color: #3F4960 !important; background-color: #001529 !important;
h1,& .right-content, & .anticon-bell { h1,& .right-content, & .anticon-bell {
color: #fff !important; color: #fff !important;
@ -49,7 +49,7 @@ body {
} }
.ant-menu { .ant-menu {
background-color: #3F4960 !important; background-color: #001529 !important;
.ant-menu-item-selected,& .ant-menu-item-active { .ant-menu-item-selected,& .ant-menu-item-active {
transition: background 0.3s cubic-bezier(0.645, 0.045, 0.355, 1) !important; transition: background 0.3s cubic-bezier(0.645, 0.045, 0.355, 1) !important;
@ -85,10 +85,10 @@ body {
} }
.ant-layout-sider-dark { .ant-layout-sider-dark {
background: #fff !important; background: #001529 !important;
.ant-menu-dark { .ant-menu-dark {
background: #fff !important; background:#001529 !important;
span { span {
color: @DarkMenuItemColor; color: @DarkMenuItemColor;

View File

@ -87,24 +87,32 @@ const handleOk = async () => {
if (dataSource.value.length) { if (dataSource.value.length) {
loading.value = true loading.value = true
const list = (dataSource.value || []) const list = (dataSource.value || [])
.filter((item: any) => item?.key && item?.value) .filter((item: any) => item?.key && (item?.value !== undefined && item?.value !== null))
.map((i: any) => { .map((i: any) => {
const { dataType, ...extra } = i; const { dataType, ...extra } = i;
if (extra.value === 0) {
extra.value = String(extra.value)
}
return { ...extra }; return { ...extra };
}); });
if (list.length) { if (list.length) {
// //
const resp = await saveTags(instanceStore.current?.id || '', list); const resp = await saveTags(instanceStore.current?.id || '', list).finally(()=>{
if (resp.status === 200) { loading.value = false
});
if (resp.success === 200) {
onlyMessage('操作成功!'); onlyMessage('操作成功!');
} }
} }
const _list = (dataSource.value || []).filter((item: any) => item?.key && !item?.value); const _list = (dataSource.value || []).filter((item: any) => item?.key && (item?.value === undefined || item?.value === null));
if (_list.length) { if (_list.length) {
// //
_list.map(async (item: any) => { _list.map(async (item: any) => {
if (item.id) { if (item.id) {
await delTags(instanceStore.current?.id || '', item.id); await delTags(instanceStore.current?.id || '', item.id).catch(()=>{
loading.value = false
});
} }
}); });
} }

View File

@ -86,45 +86,61 @@ const _getEventList = (_params: any) =>
getEventList(instanceStore.current.id || '', events.data.id || '', _params); getEventList(instanceStore.current.id || '', events.data.id || '', _params);
watchEffect(() => { watchEffect(() => {
columns.value = [...defaultColumns]; columns.value = [...defaultColumns];
if (events.data?.valueType?.type === 'object') { if (events.data?.valueType?.type === 'object') {
const eventProperties = cloneDeep(events.data.valueType?.properties || []) const eventProperties = cloneDeep(events.data.valueType?.properties || [])
eventProperties.reverse().map((i: any) => { eventProperties.reverse().map((i: any) => {
if (i.valueType?.type === 'object') { if (['object', 'array'].includes(i.valueType?.type)) {
objectKey.value.push({ objectKey.value.push({
key:i.id, key: i.id,
dataIndex: `${i.id}_format` dataIndex: `${i.id}_format`
});
columns.value.splice(0, 0, {
key: i.id,
title: i.name,
dataIndex: `${i.id}_format`,
search: {
type: i?.valueType?.type || 'string',
rename: i.id,
},
scopedSlots: true,
});
} else {
columns.value.splice(0, 0, {
key: i.id,
title: i.name,
dataIndex: `${i.id}_format`,
search: {
type: i?.valueType?.type || 'string',
rename: i.id,
},
ellipsis: true,
scopedSlots: true,
});
}
}); });
} else {
columns.value.splice(0, 0, { columns.value.splice(0, 0, {
title: '数据', key: i.id,
dataIndex: 'value', title: i.name,
dataIndex: `${i.id}_format`,
search: {
type: 'string',
rename: i.id,
},
scopedSlots: true,
}); });
} } else {
const arr = i?.valueType?.type === 'boolean' ? [
{
label: i?.valueType.falseText,
value: i?.valueType.falseValue
},
{
label: i?.valueType.trueText,
value: i?.valueType.trueValue
},
] : (i?.valueType?.elements || []).map(item => {
return {
label: item.text,
value: item.value
}
})
columns.value.splice(0, 0, {
key: i.id,
title: i.name,
dataIndex: `${i.id}_format`,
search: {
type: componentsType?.[i?.valueType?.type] || 'string',
rename: i.id,
options: arr
},
ellipsis: true,
scopedSlots: true,
});
}
});
} else {
columns.value.splice(0, 0, {
title: '数据',
dataIndex: 'value',
});
}
}); });
const handleSearch = (_params: any) => { const handleSearch = (_params: any) => {

View File

@ -145,12 +145,12 @@ const props = defineProps({
default: undefined, default: undefined,
}, },
type: { type: {
type: String, type: String,
default: 'device', default: 'device',
}, },
internalId: { internalId: {
type: String, type: String,
default: undefined, default: undefined,
}, },
}); });
@ -181,9 +181,10 @@ const queryInkingDevices = (data: string[]) => {
return; return;
} }
const res = await getInkingDevices(data,props.accessId); const res = await getInkingDevices(data, props.accessId);
if (res) { if (res) {
disabledKeys.value = res.result?.map((item) => item.externalId) || []; disabledKeys.value =
res.result?.map((item) => item.externalId) || [];
} }
resolve(true); resolve(true);
@ -250,15 +251,17 @@ const init = async () => {
const resp = await getCommandsByAccess(props.accessId); const resp = await getCommandsByAccess(props.accessId);
if (resp.success && resp.result?.length) { if (resp.success && resp.result?.length) {
// //
const item = resp.result.find(item => item.id === 'QueryDevicePage'); const item = resp.result.find(
(item) => item.id === 'QueryDevicePage',
);
if (item) { if (item) {
showPage.value = true showPage.value = true;
columns.value = item.expands?.terms?.map((t) => ({ columns.value = item.expands?.terms?.map((t) => ({
title: t.name, title: t.name,
dataIndex: t.id, dataIndex: t.id,
search: { search: {
type: t.valueType.type, type: t.valueType.type,
}, },
})); }));
} }
} }

View File

@ -209,6 +209,7 @@ import { useMetadataStore } from '@/store/metadata';
import { omit } from 'lodash-es'; import { omit } from 'lodash-es';
import { Modal } from 'jetlinks-ui-components'; import { Modal } from 'jetlinks-ui-components';
import { testObject, testType, testAliType, testAliObject } from './valideta'; import { testObject, testType, testAliType, testAliObject } from './valideta';
import {TOKEN_KEY} from "@/utils/variable";
const route = useRoute(); const route = useRoute();
const instanceStore = useInstanceStore(); const instanceStore = useInstanceStore();

View File

@ -124,7 +124,7 @@ onMounted(() => {
serverNode().then((resp: any) => { serverNode().then((resp: any) => {
if (resp.success) { if (resp.success) {
serverNodeOptions.value = resp.result.map((item: any) => ({ serverNodeOptions.value = resp.result.map((item: any) => ({
label: item.name, label: item.id,
value: item.id, value: item.id,
})); }));
if (serverNodeOptions.value.length) { if (serverNodeOptions.value.length) {

View File

@ -202,7 +202,7 @@
<script setup lang="ts"> <script setup lang="ts">
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 { usePermissionStore } from '@/store/permission';
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';

View File

@ -220,8 +220,10 @@ const filterType = async (newVal: any) => {
terms: [ terms: [
{ termType: 'eq', column: 'objectTypeName', value: '设备' }, { termType: 'eq', column: 'objectTypeName', value: '设备' },
], ],
}); }).catch(()=>{
if (res.success && res.result.length !== 0) { _typeList[2].disabled = true
})
if (res.success && res.result.length === 0) {
// _typeList.push(TypeMap.relation) // _typeList.push(TypeMap.relation)
// TypeMap.relation.disabled = true; // TypeMap.relation.disabled = true;
_typeList[2].disabled = true _typeList[2].disabled = true

View File

@ -392,7 +392,7 @@ const system = useSystem();
const form = reactive<formType>({ const form = reactive<formType>({
formValue: { formValue: {
title: '', title: '',
headerTheme: 'light', headerTheme: 'dark',
showRecordNumber: true, showRecordNumber: true,
recordNumber: '', recordNumber: '',
apiKey: '', apiKey: '',

View File

@ -229,10 +229,17 @@ const table = reactive({
paging: false, paging: false,
}; };
const resp: any = await getMenuTree_api(params); const resp: any = await getMenuTree_api(params);
const menuArr = resp.result.filter((i:any)=>i.code!=='account-center') const menuArr = resp.result.filter(
(i: any) => i.code !== 'account-center',
);
const lastItem = menuArr[menuArr.length - 1]; const lastItem = menuArr[menuArr.length - 1];
console.log(lastItem, 'lastItem');
//9999 //9999
table.total = lastItem ? lastItem.sortIndex + 1 === 9999 ? 10000 : lastItem.sortIndex + 1 : 1; table.total = lastItem
? lastItem.sortIndex + 1 === 9999
? 10000
: lastItem.sortIndex + 1
: 1;
return { return {
code: resp.message, code: resp.message,
@ -251,7 +258,9 @@ const table = reactive({
}; };
}, },
addChildren: (row: any) => { addChildren: (row: any) => {
const sortIndex = row?.children?.length || 0; const sortIndex = row?.children.sort((a: any, b: any) => {
return b.sortIndex - a.sortIndex;
})[0].sortIndex;
router.push( router.push(
`/system/Menu/detail/:id?pid=${row.id}&basePath=${ `/system/Menu/detail/:id?pid=${row.id}&basePath=${
row.url || '' row.url || ''

View File

@ -91,21 +91,21 @@ export default defineConfig(({ mode}) => {
], ],
server: { server: {
host:'0.0.0.0', host:'0.0.0.0',
port: 8990,
proxy: { proxy: {
[env.VITE_APP_BASE_API]: { [env.VITE_APP_BASE_API]: {
// target: 'http://192.168.32.226:8844', // target: 'http://192.168.32.226:8844',
// target: 'http://192.168.32.244:8881', // target: 'http://192.168.32.244:8881',
// target: 'http://192.168.32.217:8844', //张本地 // target: 'http://192.168.32.217:8844', //张本地
// target: 'http://120.77.179.54:8844', // 120测试 // target: 'http://120.77.179.54:8844', // 120测试
target: 'http://192.168.33.46:8844', // 本地开发环境 // target: 'http://192.168.33.46:8844', // 本地开发环境
// target: 'http://192.168.33.99:8844', // 本地开发环境1 // target: 'http://192.168.33.99:8844', // 本地开发环境1
// target: 'http://192.168.33.6:38848', // 社区版开发环境 // target: 'http://192.168.33.6:31320', // 社区版开发环境
// target: 'http://192.168.32.207:8844', // 刘本地 // target: 'https://demo.jetlinks.cn', // 刘本地
// target: 'http://192.168.32.187:8844', // 谭本地 target: 'http://192.168.1.17:8848', // 谭本地
// target: 'http://192.168.33.66:8844', // 苟本地 // target: 'http://192.168.33.66:8844', // 苟本地
// target: 'http://192.168.35.155:8844', // 王本地 // target: 'http://192.168.32.189:8844', // 王本地
ws: 'ws://192.168.33.46:8844', ws: 'ws://192.168.1.17:8844',
changeOrigin: true, changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '') rewrite: (path) => path.replace(/^\/api/, '')
} }