Compare commits

..

No commits in common. "2f4cd3b9404b4be8de4543ffd7f9427413ee3b62" and "0ced59c0848568fd30282febf84a73e28fc052cf" have entirely different histories.

12 changed files with 75 additions and 121 deletions

View File

@ -15,7 +15,6 @@
@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
@ -37,17 +36,11 @@
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: configInfo.value.amap.apiKey || '3bef1ec2347fff12a6b7da11af70d194', key: 'a0415acfc35af15f10221bfa5a6850b4',
securityJsCode: configInfo.value.amap.secretKey || '259f338768822197a09e3e4959e82cce', securityJsCode: 'cae6108ec3dd222f946d1a7237c78be0',
}); });
interface EmitProps { interface EmitProps {

View File

@ -38,7 +38,7 @@ body {
} }
.dark { .dark {
background-color: #001529 !important; background-color: #3F4960 !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: #001529 !important; background-color: #3F4960 !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: #001529 !important; background: #fff !important;
.ant-menu-dark { .ant-menu-dark {
background:#001529 !important; background: #fff !important;
span { span {
color: @DarkMenuItemColor; color: @DarkMenuItemColor;

View File

@ -87,32 +87,24 @@ 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 !== undefined && item?.value !== null)) .filter((item: any) => item?.key && item?.value)
.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).finally(()=>{ const resp = await saveTags(instanceStore.current?.id || '', list);
loading.value = false if (resp.status === 200) {
});
if (resp.success === 200) {
onlyMessage('操作成功!'); onlyMessage('操作成功!');
} }
} }
const _list = (dataSource.value || []).filter((item: any) => item?.key && (item?.value === undefined || item?.value === null)); const _list = (dataSource.value || []).filter((item: any) => item?.key && !item?.value);
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).catch(()=>{ await delTags(instanceStore.current?.id || '', item.id);
loading.value = false
});
} }
}); });
} }

View File

@ -86,61 +86,45 @@ 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 (['object', 'array'].includes(i.valueType?.type)) { if (i.valueType?.type === 'object') {
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, {
key: i.id, title: '数据',
title: i.name, dataIndex: 'value',
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,10 +181,9 @@ 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 = disabledKeys.value = res.result?.map((item) => item.externalId) || [];
res.result?.map((item) => item.externalId) || [];
} }
resolve(true); resolve(true);
@ -251,17 +250,15 @@ 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( const item = resp.result.find(item => item.id === 'QueryDevicePage');
(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,7 +209,6 @@ 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.id, label: item.name,
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,10 +220,8 @@ const filterType = async (newVal: any) => {
terms: [ terms: [
{ termType: 'eq', column: 'objectTypeName', value: '设备' }, { termType: 'eq', column: 'objectTypeName', value: '设备' },
], ],
}).catch(()=>{ });
_typeList[2].disabled = true if (res.success && res.result.length !== 0) {
})
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: 'dark', headerTheme: 'light',
showRecordNumber: true, showRecordNumber: true,
recordNumber: '', recordNumber: '',
apiKey: '', apiKey: '',

View File

@ -229,17 +229,10 @@ 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( const menuArr = resp.result.filter((i:any)=>i.code!=='account-center')
(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 table.total = lastItem ? lastItem.sortIndex + 1 === 9999 ? 10000 : lastItem.sortIndex + 1 : 1;
? lastItem.sortIndex + 1 === 9999
? 10000
: lastItem.sortIndex + 1
: 1;
return { return {
code: resp.message, code: resp.message,
@ -258,9 +251,7 @@ const table = reactive({
}; };
}, },
addChildren: (row: any) => { addChildren: (row: any) => {
const sortIndex = row?.children.sort((a: any, b: any) => { const sortIndex = row?.children?.length || 0;
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:31320', // 社区版开发环境 // target: 'http://192.168.33.6:38848', // 社区版开发环境
// target: 'https://demo.jetlinks.cn', // 刘本地 // target: 'http://192.168.32.207:8844', // 刘本地
target: 'http://192.168.1.17:8848', // 谭本地 // target: 'http://192.168.32.187:8844', // 谭本地
// target: 'http://192.168.33.66:8844', // 苟本地 // target: 'http://192.168.33.66:8844', // 苟本地
// target: 'http://192.168.32.189:8844', // 王本地 // target: 'http://192.168.35.155:8844', // 王本地
ws: 'ws://192.168.1.17:8844', ws: 'ws://192.168.33.46:8844',
changeOrigin: true, changeOrigin: true,
rewrite: (path) => path.replace(/^\/api/, '') rewrite: (path) => path.replace(/^\/api/, '')
} }