Signed-off-by: zhangchao <zhangchao338@huawei.com>
This commit is contained in:
zhangchao 2022-07-12 15:04:10 +08:00
parent a2e75db8a0
commit 355352e830
4 changed files with 18 additions and 1 deletions

View File

@ -63,6 +63,9 @@ const RdbStoreConfig = {
'app_icon_id INTEGER, ' +
'app_label_id INTEGER, ' +
'app_name TEXT, ' +
'is_system_app INTEGER, ' +
'is_uninstallAble INTEGER, ' +
'key_name TEXT, ' +
'install_time TEXT)'
},

View File

@ -389,6 +389,9 @@ export default class RdbStoreManager {
'app_icon_id': dockInfoList[i].appIconId,
'app_label_id': dockInfoList[i].appLabelId,
'app_name': dockInfoList[i].appName,
'is_system_app': this.booleanToNumber(dockInfoList[i].isSystemApp),
'is_uninstallAble': this.booleanToNumber(dockInfoList[i].isUninstallAble),
'key_name': dockInfoList[i].keyName,
'install_time': dockInfoList[i].installTime
}
let ret = await this.mRdbStore.insert(RdbStoreConfig.SmartDock.TABLE_NAME, smartdockDbItem);
@ -430,6 +433,9 @@ export default class RdbStoreManager {
itemInfo.appLabelId = resultSet.getLong(resultSet.getColumnIndex('app_label_id'));
itemInfo.appName = resultSet.getString(resultSet.getColumnIndex('app_name'));
itemInfo.installTime = resultSet.getString(resultSet.getColumnIndex('install_time'));
itemInfo.isSystemApp = this.numberToBoolean(resultSet.getLong(resultSet.getColumnIndex('is_system_app')));
itemInfo.isUninstallAble = this.numberToBoolean(resultSet.getLong(resultSet.getColumnIndex('is_uninstallAble')));
itemInfo.keyName = resultSet.getString(resultSet.getColumnIndex('key_name'));
resultList.push(itemInfo);
isLast = resultSet.goToNextRow();
Log.showInfo(TAG, `querySmartDock while isLast:${isLast}`);

View File

@ -267,7 +267,7 @@ export default struct FormItem {
TapGesture({ count: 2 })
.onAction((event: GestureEvent) => {
Log.showInfo(TAG, 'mouse double click');
this.mPageDesktopViewModel.onAppDoubleClick(this.formItem.abilityName, this.formItem.bundleNam, this.formItem.moduleName);
this.mPageDesktopViewModel.onAppDoubleClick(this.formItem.abilityName, this.formItem.bundleName, this.formItem.moduleName);
})
)
)

View File

@ -107,6 +107,8 @@ export default class SmartDockModel {
dockItemInfo.keyName = `${dockItemInfo.bundleName}${dockItemInfo.abilityName}${dockItemInfo.moduleName}`;
dockItemInfo.appIconId = typeof (appData) === 'undefined' ? dockItemInfo.appIconId : appData.appIconId;
dockItemInfo.appLabelId = typeof (appData) === 'undefined' ? dockItemInfo.appLabelId : appData.appLabelId;
dockItemInfo.isSystemApp = typeof (appData) === 'undefined' ? dockItemInfo.isSystemApp : appData.isSystemApp;
dockItemInfo.isUninstallAble = typeof (appData) === 'undefined' ? dockItemInfo.isUninstallAble : appData.isUninstallAble;
dockItemInfo.installTime = typeof (appData) === 'undefined' ? dockItemInfo.installTime : appData.installTime;
residentList.push(dockItemInfo);
} else if (dockDataList[i].itemType == CommonConstants.TYPE_CARD) {
@ -120,6 +122,8 @@ export default class SmartDockModel {
dockItemInfo.keyName = `${dockItemInfo.bundleName}${dockItemInfo.abilityName}${dockItemInfo.moduleName}`;
dockItemInfo.appIconId = typeof (dockDataList[i].appIconId) != 'undefined' ? dockDataList[i].appIconId : dockDataList[i].iconId.id;
dockItemInfo.appLabelId = typeof (dockDataList[i].appLabelId) != 'undefined' ? dockDataList[i].appLabelId : dockDataList[i].labelId.id;
dockItemInfo.isSystemApp = typeof (dockDataList[i].isSystemApp) === 'undefined' ? true : dockDataList[i].isSystemApp;
dockItemInfo.isUninstallAble = typeof (dockDataList[i].isUninstallAble) === 'undefined' ? true : dockDataList[i].isUninstallAble;
const loadAppName = await this.mResourceManager
.getAppNameSync(dockItemInfo.appLabelId, dockItemInfo.bundleName, dockItemInfo.moduleName, '');
dockItemInfo.appName = loadAppName;
@ -219,6 +223,8 @@ export default class SmartDockModel {
dockItemInfo.keyName = appInfo.keyName;
dockItemInfo.appIconId = appInfo.appIconId;
dockItemInfo.appLabelId = appInfo.appLabelId;
dockItemInfo.isSystemApp = appInfo.isSystemApp;
dockItemInfo.isUninstallAble = appInfo.isUninstallAble;
if (dockItemCount == 0 || index == undefined || index >= dockItemCount || index < 0) {
this.mResidentList.push(dockItemInfo);
} else {
@ -519,6 +525,8 @@ export default class SmartDockModel {
dockItemInfo.appIconId = appInfo.appIconId;
dockItemInfo.appLabelId = appInfo.appLabelId;
dockItemInfo.installTime = appInfo.installTime;
dockItemInfo.isSystemApp = appInfo.isSystemApp;
dockItemInfo.isUninstallAble = appInfo.isUninstallAble;
resistDockItem[i] = dockItemInfo;
AppStorage.SetOrCreate('residentList', resistDockItem);
}