|
@@ -12,6 +12,9 @@ import CommonConstants from '../common/constants/CommonConstants'
|
|
import { getToken, getUserInfo } from '../common/util/request/RequestInstance'
|
|
import { getToken, getUserInfo } from '../common/util/request/RequestInstance'
|
|
import {UserInfo} from '../viewmodel/wms/UserInfo'
|
|
import {UserInfo} from '../viewmodel/wms/UserInfo'
|
|
import UserAuthModel from '../common/util/UserAuthModel';
|
|
import UserAuthModel from '../common/util/UserAuthModel';
|
|
|
|
+import DictInfo from '../viewmodel/DictInfo'
|
|
|
|
+import connection from '@ohos.net.connection';
|
|
|
|
+
|
|
const TAG: string = 'MENU'
|
|
const TAG: string = 'MENU'
|
|
@Entry
|
|
@Entry
|
|
@Component
|
|
@Component
|
|
@@ -119,6 +122,26 @@ struct menu {
|
|
this.loginWms();
|
|
this.loginWms();
|
|
this.connectMQTT();
|
|
this.connectMQTT();
|
|
|
|
|
|
|
|
+ // 查询数据字典放到CommonConstants的DICT_DATA变量中
|
|
|
|
+ let res: DictInfo[] = await WmsRequest.post('/api/v1/sys/dictData/all',)
|
|
|
|
+ if (res && res.length > 0) {
|
|
|
|
+ for (const dict of res) {
|
|
|
|
+ CommonConstants.DICT_DATA.set(dict.dictCode, dict.list)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ try {
|
|
|
|
+ const netHandle = connection.getDefaultNetSync();
|
|
|
|
+ if (netHandle) {
|
|
|
|
+ let connectionProperties = await connection.getConnectionProperties(netHandle)
|
|
|
|
+ if (connectionProperties && connectionProperties.linkAddresses) {
|
|
|
|
+ connectionProperties.linkAddresses.forEach((address: connection.LinkAddress, index: number) => {
|
|
|
|
+ console.info('hhtest', "get address info: " + JSON.stringify(address));
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ } catch (err) {
|
|
|
|
+ console.log('hhtest', err);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|