!131 优化代码目录

Merge pull request !131 from HaixiangW/master
This commit is contained in:
openharmony_ci 2024-11-05 03:19:16 +00:00 committed by Gitee
commit 3a891509bc
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
16 changed files with 446 additions and 446 deletions

View File

@ -24,52 +24,13 @@ import router from '@ohos.router';
import { CustomContentDialog } from '@ohos.arkui.advanced.Dialog';
import CmShowSysCredPresenter from '../presenter/CmShowSysCredPresenter';
import { NavEntryKey } from '../common/NavEntryKey';
import { CredSystemDetailParam } from './picker/CredSystemDetailPage';
import { CredUserDetailParam } from './picker/CredUserDetailPage';
import { SheetParam } from './picker/SheetParam';
import { CredSystemDetailParam } from './detail/CredSystemDetailPage';
import { CredUserDetailParam } from './detail/CredUserDetailPage';
import { SheetParam } from '../common/util/SheetParam';
import { DialogComponent } from './detail/AuthorizedAppManagementPage';
const COPIES_NUM: number = 12;
@Component
export struct DialogComponent {
@Link uidItem: CmShowAppCredPresenter;
private appName: string = '';
private appImage: string = '';
private indexNum: number = 0;
onChanged?: () => void;
build() {
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Row() {
Image(this.appImage)
.width($r('app.float.credentials_app_image_wh'))
.height($r('app.float.credentials_app_image_hg'))
Text(this.appName)
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Medium)
.margin({ left: $r('app.float.credentials_app_name_margin') })
}
.alignItems(VerticalAlign.Center)
Toggle({ type: ToggleType.Switch, isOn: true })
.width($r('app.float.credentials_app_Toggle_wh'))
.height($r('app.float.credentials_app_Toggle_hg'))
.selectedColor($r('app.color.credentials_app_Toggle_selectColor'))
.onChange((isOn: boolean) => {
this.uidItem.appInfoList[this.indexNum].status = isOn;
if (!isOn) {
this.onChanged?.();
}
})
.margin({ right: $r('app.float.wh_value_16') })
}.height($r('app.float.wh_value_72'))
}
}
@Component
export struct componentPublic {
private alias: string = '';

View File

@ -27,8 +27,8 @@ import FileIoModel from '../model/FileIoModel';
import CmInstallPresenter from '../presenter/CmInstallPresenter';
import { BusinessError } from '@ohos.base';
import { RouterFileVo } from '../model/CertManagerVo/RouterInfoVo';
import { CredPwdInputParam } from './picker/CredPwdInputPage';
import { SheetParam } from './picker/SheetParam';
import { CredPwdInputParam } from './detail/CredPwdInputPage';
import { SheetParam } from '../common/util/SheetParam';
import FilterParams from '../common/constants/FileFilterParams';
const COPIES_NUM: number = 12;

View File

@ -22,7 +22,7 @@ import router from '@ohos.router';
import promptAction from '@ohos.promptAction';
import { CustomContentDialog } from '@ohos.arkui.advanced.Dialog';
import { NavEntryKey } from '../common/NavEntryKey';
import { SheetParam } from './picker/SheetParam';
import { SheetParam } from '../common/util/SheetParam';
const DISPLAY_DURATION: number = 2000;
const COPIES_NUM: number = 12;

View File

@ -17,9 +17,8 @@ import HeadComponent from '../../common/component/headComponent';
import { WidthPercent } from '../../common/util/ConfigData';
import { AppAuthorVo } from '../../model/CertManagerVo/AppAuthorVo';
import CmShowAppCredPresenter from '../../presenter/CmShowAppCredPresenter';
import { DialogComponent } from '../cerEvidenceFa';
import { BusinessError } from '@ohos.base';
import { SheetParam } from './SheetParam';
import { SheetParam } from '../../common/util/SheetParam';
import { NavEntryKey } from '../../common/NavEntryKey';
const TAG: string = 'AuthorizedAppManagementPage: ';
@ -32,6 +31,46 @@ export class AuthorizedAppManagementParam {
}
}
@Component
export struct DialogComponent {
@Link uidItem: CmShowAppCredPresenter;
private appName: string = '';
private appImage: string = '';
private indexNum: number = 0;
onChanged?: () => void;
build() {
Flex({ justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }) {
Row() {
Image(this.appImage)
.width($r('app.float.credentials_app_image_wh'))
.height($r('app.float.credentials_app_image_hg'))
Text(this.appName)
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Medium)
.margin({ left: $r('app.float.credentials_app_name_margin') })
}
.alignItems(VerticalAlign.Center)
Toggle({ type: ToggleType.Switch, isOn: true })
.width($r('app.float.credentials_app_Toggle_wh'))
.height($r('app.float.credentials_app_Toggle_hg'))
.selectedColor($r('app.color.credentials_app_Toggle_selectColor'))
.onChange((isOn: boolean) => {
this.uidItem.appInfoList[this.indexNum].status = isOn;
if (!isOn) {
this.onChanged?.();
}
})
.margin({ right: $r('app.float.wh_value_16') })
}.height($r('app.float.wh_value_72'))
}
}
@Component
export struct AuthorizedAppManagementPage {
private stack?: NavPathStack;

View File

@ -0,0 +1,375 @@
/**
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import HeadComponent from '../../common/component/headComponent';
import { NavEntryKey } from '../../common/NavEntryKey';
import { WidthPercent } from '../../common/util/ConfigData';
import CmShowSysCaPresenter from '../../presenter/CmShowSysCaPresenter';
import { SheetParam } from '../../common/util/SheetParam';
@Component
export struct DialogSubjectComponent {
private map?: Map<string, string>;
private subjectNameCN: string = '';
private subjectNameO: string = '';
private subjectNameOU: string = '';
private serial: string = '';
aboutToAppear() {
if (this.map != null) {
let subjectNameCN = this.map.get('常用名称:');
if (subjectNameCN !== undefined) {
this.subjectNameCN = subjectNameCN;
}
let subjectNameO = this.map.get('组织:');
if (subjectNameO !== undefined) {
this.subjectNameO = subjectNameO;
}
let subjectNameOU = this.map.get('组织单位:');
if (subjectNameOU !== undefined) {
this.subjectNameOU = subjectNameOU;
}
let serial = this.map.get('序列号:');
if (serial !== undefined) {
this.serial = serial;
}
}
}
build() {
Column() {
Text($r('app.string.DialogSubjectComponent_firText'))
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
.margin({
top: $r('app.float.sys_elements_margin_vertical_l')
})
Text(this.subjectNameCN)
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
Text($r('app.string.DialogSubjectComponent_secText'))
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
.margin({
top: $r('app.float.sys_elements_margin_vertical_m')
})
Text(this.subjectNameO)
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
Text($r('app.string.DialogSubjectComponent_thdText'))
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
.margin({
top: $r('app.float.sys_elements_margin_vertical_m')
})
Text(this.subjectNameOU)
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
Text($r('app.string.DialogSubjectComponent_fouText'))
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
.margin({
top: $r('app.float.sys_elements_margin_vertical_m')
})
Text(this.serial)
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
}.alignItems(HorizontalAlign.Start);
}
}
@Component
export struct DialogIssuerComponent {
private map?: Map<string, string>;
private issuerNameCN: string = '';
private issuerNameO: string = '';
private issuerNameOU: string = '';
aboutToAppear() {
if (this.map != null) {
let issuerNameCN = this.map.get('常用名称:');
if (issuerNameCN !== undefined) {
this.issuerNameCN = issuerNameCN;
}
let issuerNameO = this.map.get('组织:');
if (issuerNameO !== undefined) {
this.issuerNameO = issuerNameO;
}
let issuerNameOU = this.map.get('组织单位:');
if (issuerNameOU !== undefined) {
this.issuerNameOU = issuerNameOU;
}
}
}
build() {
Column() {
Text($r('app.string.DialogSubjectComponent_firText'))
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
.margin({
top: $r('app.float.sys_elements_margin_vertical_l')
})
Text(this.issuerNameCN)
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
Text($r('app.string.DialogSubjectComponent_secText'))
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
.margin({
top: $r('app.float.sys_elements_margin_vertical_m')
})
Text(this.issuerNameO)
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
Text($r('app.string.DialogSubjectComponent_thdText'))
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
.margin({
top: $r('app.float.sys_elements_margin_vertical_m')
})
Text(this.issuerNameOU)
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
}.alignItems(HorizontalAlign.Start);
}
}
@Component
export struct DialogDateComponent {
private map?: Map<string, string>;
private notBefore: string = '';
private notAfter: string = '';
aboutToAppear() {
if (this.map != null) {
let notBefore = this.map.get('颁发时间:');
if (notBefore != undefined) {
this.notBefore = notBefore;
}
let notAfter = this.map.get('有效期至:');
if (notAfter != undefined) {
this.notAfter = notAfter;
}
}
}
build() {
Column() {
Text($r('app.string.DialogSubjectComponent_fifText'))
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
.margin({
top: $r('app.float.sys_elements_margin_vertical_l')
})
Text(this.notBefore)
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
Text($r('app.string.DialogSubjectComponent_sixText'))
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
.margin({
top: $r('app.float.sys_elements_margin_vertical_m')
})
Text(this.notAfter)
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
}.alignItems(HorizontalAlign.Start);
}
}
@Component
export struct DialogFingerPrintComponent {
private fingerprintSha256: string = '';
build() {
Column() {
Text($r('app.string.CustomDialogExample_FingerPrint_text'))
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
.margin({
top: $r('app.float.sys_elements_margin_vertical_l')
})
Text(this.fingerprintSha256)
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
.margin({
right: $r('app.float.wh_value_24')
})
}.alignItems(HorizontalAlign.Start);
}
}
@Component
export struct CaSystemDetailPage {
@State mShowSysCaPresenter: CmShowSysCaPresenter = CmShowSysCaPresenter.getInstance();
private stack?: NavPathStack;
@State headRectHeight: number = 64;
@State headRectHeightReal: number = 0;
@Prop sheetParam: SheetParam;
private scroller: Scroller = new Scroller();
@State scrollerHeight: number = 0;
build() {
NavDestination() {
Stack({ alignContent: Alignment.Top }) {
Column() {
HeadComponent({ headName: $r('app.string.CustomDialogExample_firText'), isStartBySheet: true, onBackClicked: () => {
this.stack?.pop();
} })
.margin({
left: $r('app.float.wh_value_12'),
top: 8
})
}.zIndex(1)
.onAreaChange((oldArea, newArea) => {
this.headRectHeight = newArea.height as number;
this.headRectHeightReal = newArea.height as number;
})
Stack({ alignContent: Alignment.TopEnd }) {
Scroll(this.scroller) {
this.buildContent()
}
.padding({
left: 16, right: 16,
bottom: $r('app.float.wh_value_24')
})
.align(Alignment.Top)
.scrollable(ScrollDirection.Vertical)
.edgeEffect(EdgeEffect.Spring)
.scrollBar(BarState.Off)
.width(WidthPercent.WH_100_100)
.height(WidthPercent.WH_AUTO)
.constraintSize({
minHeight: this.getScrollMinHeight()
}).onAreaChange((oldArea, newArea) => {
this.scrollerHeight = newArea.height as number;
})
Column() {
ScrollBar({
scroller: this.scroller,
direction: ScrollBarDirection.Vertical,
state: BarState.Auto
}).margin({
bottom: $r('app.float.wh_value_24')
})
}.height(this.scrollerHeight)
}.padding({
top: this.headRectHeight
})
}
}
.hideTitleBar(true)
.width(WidthPercent.WH_100_100)
.height(this.sheetParam?.lastSheetPage === NavEntryKey.CA_SYSTEM_DETAIL_ENTRY ?
WidthPercent.WH_AUTO : this.sheetParam?.sheetMinHeight)
.backgroundColor($r('sys.color.background_secondary'))
.onReady((ctx: NavDestinationContext) => {
this.stack = ctx.pathStack;
})
}
getScrollMinHeight() {
if (this.sheetParam === undefined || this.headRectHeightReal === 0 ||
this.sheetParam.sheetMinHeight < this.headRectHeightReal) {
return 0;
}
return this.sheetParam.sheetMinHeight - this.headRectHeightReal;
}
@Builder
private buildContent() {
Column() {
Text(this.mShowSysCaPresenter.certInfo.certAlias)
.fontSize($r('sys.float.ohos_id_text_size_body1'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Medium)
.margin({
top: $r('app.float.wh_value_8'),
bottom: $r('app.float.wh_value_24')
})
.alignSelf(ItemAlign.Start)
Text($r('app.string.CustomDialogExample_firListItem_text'))
.fontSize($r('sys.float.ohos_id_text_size_body1'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Medium)
DialogSubjectComponent({ map: this.mShowSysCaPresenter.certInfo.subjectNameMap })
Text($r('app.string.CustomDialogExample_secListItem_text'))
.fontSize($r('sys.float.ohos_id_text_size_body1'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Medium)
.margin({
top: $r('app.float.wh_value_24')
})
DialogIssuerComponent({ map: this.mShowSysCaPresenter.certInfo.issuerNameMap })
Text($r('app.string.CustomDialogExample_thdListItem_text'))
.fontSize($r('sys.float.ohos_id_text_size_body1'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Medium)
.margin({
top: $r('app.float.wh_value_24')
})
DialogDateComponent({ map: this.mShowSysCaPresenter.certInfo.dateMap })
Text($r('app.string.CustomDialogExample_fouListItem_text'))
.fontSize($r('sys.float.ohos_id_text_size_body1'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Medium)
.margin({
top: $r('app.float.wh_value_24')
})
DialogFingerPrintComponent({ fingerprintSha256: this.mShowSysCaPresenter.certInfo.fingerprintSha256 })
}
.alignItems(HorizontalAlign.Start)
.width(WidthPercent.WH_100_100)
}
}

View File

@ -21,10 +21,10 @@ import {
DialogFingerPrintComponent,
DialogIssuerComponent,
DialogSubjectComponent
} from '../trustedCa';
} from './CaSystemDetailPage';
import { AlertDialog } from '@ohos.arkui.advanced.Dialog';
import { BusinessError } from '@ohos.base';
import { SheetParam } from './SheetParam';
import { SheetParam } from '../../common/util/SheetParam';
import { NavEntryKey } from '../../common/NavEntryKey';
const TAG: string = 'CaUserDetailPage: ';

View File

@ -20,7 +20,7 @@ import { CMModelErrorCode } from '../../model/CertMangerModel';
import { RouterFileVo } from '../../model/CertManagerVo/RouterInfoVo';
import { GlobalContext } from '../../common/GlobalContext';
import CmInstallPresenter from '../../presenter/CmInstallPresenter';
import { SheetParam } from './SheetParam';
import { SheetParam } from '../../common/util/SheetParam';
import { NavEntryKey } from '../../common/NavEntryKey';
const TAG: string = 'CredPwdInputPage: ';

View File

@ -18,7 +18,7 @@ import { WidthPercent } from '../../common/util/ConfigData';
import { AlertDialog, CustomContentDialog } from '@ohos.arkui.advanced.Dialog';
import { BusinessError } from '@ohos.base';
import CmShowSysCredPresenter from '../../presenter/CmShowSysCredPresenter';
import { SheetParam } from './SheetParam';
import { SheetParam } from '../../common/util/SheetParam';
import { NavEntryKey } from '../../common/NavEntryKey';
const TAG: string = 'CredSystemDetailPage: ';

View File

@ -20,7 +20,7 @@ import { BusinessError } from '@ohos.base';
import CmShowAppCredPresenter from '../../presenter/CmShowAppCredPresenter';
import { NavEntryKey } from '../../common/NavEntryKey';
import { AuthorizedAppManagementParam } from './AuthorizedAppManagementPage';
import { SheetParam } from './SheetParam';
import { SheetParam } from '../../common/util/SheetParam';
const TAG: string = 'CredUserDetailPage: ';

View File

@ -16,7 +16,7 @@
import { NavEntryKey } from '../../common/NavEntryKey';
import { WidthPercent } from '../../common/util/ConfigData';
import { TrustedEvidence } from '../trustedCa';
import { SheetParam } from './SheetParam';
import { SheetParam } from '../../common/util/SheetParam';
@Component
export struct CaCertPage {

View File

@ -1,162 +0,0 @@
/**
* Copyright (c) 2024-2024 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import HeadComponent from '../../common/component/headComponent';
import { NavEntryKey } from '../../common/NavEntryKey';
import { WidthPercent } from '../../common/util/ConfigData';
import CmShowSysCaPresenter from '../../presenter/CmShowSysCaPresenter';
import {
DialogDateComponent,
DialogFingerPrintComponent,
DialogIssuerComponent,
DialogSubjectComponent
} from '../trustedCa';
import { SheetParam } from './SheetParam';
@Component
export struct CaSystemDetailPage {
@State mShowSysCaPresenter: CmShowSysCaPresenter = CmShowSysCaPresenter.getInstance();
private stack?: NavPathStack;
@State headRectHeight: number = 64;
@State headRectHeightReal: number = 0;
@Prop sheetParam: SheetParam;
private scroller: Scroller = new Scroller();
@State scrollerHeight: number = 0;
build() {
NavDestination() {
Stack({ alignContent: Alignment.Top }) {
Column() {
HeadComponent({ headName: $r('app.string.CustomDialogExample_firText'), isStartBySheet: true, onBackClicked: () => {
this.stack?.pop();
} })
.margin({
left: $r('app.float.wh_value_12'),
top: 8
})
}.zIndex(1)
.onAreaChange((oldArea, newArea) => {
this.headRectHeight = newArea.height as number;
this.headRectHeightReal = newArea.height as number;
})
Stack({ alignContent: Alignment.TopEnd }) {
Scroll(this.scroller) {
this.buildContent()
}
.padding({
left: 16, right: 16,
bottom: $r('app.float.wh_value_24')
})
.align(Alignment.Top)
.scrollable(ScrollDirection.Vertical)
.edgeEffect(EdgeEffect.Spring)
.scrollBar(BarState.Off)
.width(WidthPercent.WH_100_100)
.height(WidthPercent.WH_AUTO)
.constraintSize({
minHeight: this.getScrollMinHeight()
}).onAreaChange((oldArea, newArea) => {
this.scrollerHeight = newArea.height as number;
})
Column() {
ScrollBar({
scroller: this.scroller,
direction: ScrollBarDirection.Vertical,
state: BarState.Auto
}).margin({
bottom: $r('app.float.wh_value_24')
})
}.height(this.scrollerHeight)
}.padding({
top: this.headRectHeight
})
}
}
.hideTitleBar(true)
.width(WidthPercent.WH_100_100)
.height(this.sheetParam?.lastSheetPage === NavEntryKey.CA_SYSTEM_DETAIL_ENTRY ?
WidthPercent.WH_AUTO : this.sheetParam?.sheetMinHeight)
.backgroundColor($r('sys.color.background_secondary'))
.onReady((ctx: NavDestinationContext) => {
this.stack = ctx.pathStack;
})
}
getScrollMinHeight() {
if (this.sheetParam === undefined || this.headRectHeightReal === 0 ||
this.sheetParam.sheetMinHeight < this.headRectHeightReal) {
return 0;
}
return this.sheetParam.sheetMinHeight - this.headRectHeightReal;
}
@Builder
private buildContent() {
Column() {
Text(this.mShowSysCaPresenter.certInfo.certAlias)
.fontSize($r('sys.float.ohos_id_text_size_body1'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Medium)
.margin({
top: $r('app.float.wh_value_8'),
bottom: $r('app.float.wh_value_24')
})
.alignSelf(ItemAlign.Start)
Text($r('app.string.CustomDialogExample_firListItem_text'))
.fontSize($r('sys.float.ohos_id_text_size_body1'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Medium)
DialogSubjectComponent({ map: this.mShowSysCaPresenter.certInfo.subjectNameMap })
Text($r('app.string.CustomDialogExample_secListItem_text'))
.fontSize($r('sys.float.ohos_id_text_size_body1'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Medium)
.margin({
top: $r('app.float.wh_value_24')
})
DialogIssuerComponent({ map: this.mShowSysCaPresenter.certInfo.issuerNameMap })
Text($r('app.string.CustomDialogExample_thdListItem_text'))
.fontSize($r('sys.float.ohos_id_text_size_body1'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Medium)
.margin({
top: $r('app.float.wh_value_24')
})
DialogDateComponent({ map: this.mShowSysCaPresenter.certInfo.dateMap })
Text($r('app.string.CustomDialogExample_fouListItem_text'))
.fontSize($r('sys.float.ohos_id_text_size_body1'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Medium)
.margin({
top: $r('app.float.wh_value_24')
})
DialogFingerPrintComponent({ fingerprintSha256: this.mShowSysCaPresenter.certInfo.fingerprintSha256 })
}
.alignItems(HorizontalAlign.Start)
.width(WidthPercent.WH_100_100)
}
}

View File

@ -19,12 +19,12 @@ import { NavEntryKey } from '../../common/NavEntryKey';
import { CaCertPage } from './CaCertPage';
import { CredListPage } from './CredListPage';
import { InstallPage } from './InstallPage';
import { CaSystemDetailPage } from './CaSystemDetailPage';
import { CaUserDetailPage } from './CaUserDetailPage';
import { CredSystemDetailPage } from './CredSystemDetailPage';
import { CredUserDetailPage } from './CredUserDetailPage';
import { AuthorizedAppManagementPage } from './AuthorizedAppManagementPage';
import { CredPwdInputPage } from './CredPwdInputPage';
import { CaSystemDetailPage } from '../detail/CaSystemDetailPage';
import { CaUserDetailPage } from '../detail/CaUserDetailPage';
import { CredSystemDetailPage } from '../detail/CredSystemDetailPage';
import { CredUserDetailPage } from '../detail/CredUserDetailPage';
import { AuthorizedAppManagementPage } from '../detail/AuthorizedAppManagementPage';
import { CredPwdInputPage } from '../detail/CredPwdInputPage';
import Want from '@ohos.app.ability.Want';
import deviceInfo from '@ohos.deviceInfo';
import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSession';
@ -32,7 +32,7 @@ import { TrustedEvidence } from '../trustedCa';
import { evidenceList } from '../cerEvidenceFa';
import { CertInstallFromStorage } from '../certInstallFromStorage';
import window from '@ohos.window';
import { SheetParam } from './SheetParam';
import { SheetParam } from '../../common/util/SheetParam';
import uiExtensionHost from '@ohos.uiExtensionHost';
import { BusinessError } from '@ohos.base';
import PreventScreenshotsPresenter from '../../model/PreventScreenshotsModel';

View File

@ -16,7 +16,7 @@
import { NavEntryKey } from '../../common/NavEntryKey';
import { WidthPercent } from '../../common/util/ConfigData';
import { evidenceList } from '../cerEvidenceFa';
import { SheetParam } from './SheetParam';
import { SheetParam } from '../../common/util/SheetParam';
@Component
export struct CredListPage {

View File

@ -16,7 +16,7 @@
import { NavEntryKey } from '../../common/NavEntryKey';
import { WidthPercent } from '../../common/util/ConfigData';
import { CertInstallFromStorage } from '../certInstallFromStorage';
import { SheetParam } from './SheetParam';
import { SheetParam } from '../../common/util/SheetParam';
@Component
export struct InstallPage {

View File

@ -24,230 +24,17 @@ import ComponentConfig from '../common/component/ComponentConfig';
import router from '@ohos.router';
import { CustomContentDialog } from '@ohos.arkui.advanced.Dialog';
import { NavEntryKey } from '../common/NavEntryKey';
import { CaUserDetailParam } from './picker/CaUserDetailPage';
import { SheetParam } from './picker/SheetParam';
import { CaUserDetailParam } from './detail/CaUserDetailPage';
import { SheetParam } from '../common/util/SheetParam';
import {
DialogDateComponent,
DialogFingerPrintComponent,
DialogIssuerComponent,
DialogSubjectComponent
} from './detail/CaSystemDetailPage';
const COPIES_NUM: number = 12;
@Component
export struct DialogSubjectComponent {
private map?: Map<string, string>;
private subjectNameCN: string = '';
private subjectNameO: string = '';
private subjectNameOU: string = '';
private serial: string = '';
aboutToAppear() {
if (this.map != null) {
let subjectNameCN = this.map.get('常用名称:');
if (subjectNameCN !== undefined) {
this.subjectNameCN = subjectNameCN;
}
let subjectNameO = this.map.get('组织:');
if (subjectNameO !== undefined) {
this.subjectNameO = subjectNameO;
}
let subjectNameOU = this.map.get('组织单位:');
if (subjectNameOU !== undefined) {
this.subjectNameOU = subjectNameOU;
}
let serial = this.map.get('序列号:');
if (serial !== undefined) {
this.serial = serial;
}
}
}
build() {
Column() {
Text($r('app.string.DialogSubjectComponent_firText'))
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
.margin({
top: $r('app.float.sys_elements_margin_vertical_l')
})
Text(this.subjectNameCN)
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
Text($r('app.string.DialogSubjectComponent_secText'))
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
.margin({
top: $r('app.float.sys_elements_margin_vertical_m')
})
Text(this.subjectNameO)
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
Text($r('app.string.DialogSubjectComponent_thdText'))
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
.margin({
top: $r('app.float.sys_elements_margin_vertical_m')
})
Text(this.subjectNameOU)
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
Text($r('app.string.DialogSubjectComponent_fouText'))
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
.margin({
top: $r('app.float.sys_elements_margin_vertical_m')
})
Text(this.serial)
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
}.alignItems(HorizontalAlign.Start);
}
}
@Component
export struct DialogIssuerComponent {
private map?: Map<string, string>;
private issuerNameCN: string = '';
private issuerNameO: string = '';
private issuerNameOU: string = '';
aboutToAppear() {
if (this.map != null) {
let issuerNameCN = this.map.get('常用名称:');
if (issuerNameCN !== undefined) {
this.issuerNameCN = issuerNameCN;
}
let issuerNameO = this.map.get('组织:');
if (issuerNameO !== undefined) {
this.issuerNameO = issuerNameO;
}
let issuerNameOU = this.map.get('组织单位:');
if (issuerNameOU !== undefined) {
this.issuerNameOU = issuerNameOU;
}
}
}
build() {
Column() {
Text($r('app.string.DialogSubjectComponent_firText'))
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
.margin({
top: $r('app.float.sys_elements_margin_vertical_l')
})
Text(this.issuerNameCN)
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
Text($r('app.string.DialogSubjectComponent_secText'))
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
.margin({
top: $r('app.float.sys_elements_margin_vertical_m')
})
Text(this.issuerNameO)
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
Text($r('app.string.DialogSubjectComponent_thdText'))
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
.margin({
top: $r('app.float.sys_elements_margin_vertical_m')
})
Text(this.issuerNameOU)
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
}.alignItems(HorizontalAlign.Start);
}
}
@Component
export struct DialogDateComponent {
private map?: Map<string, string>;
private notBefore: string = '';
private notAfter: string = '';
aboutToAppear() {
if (this.map != null) {
let notBefore = this.map.get('颁发时间:');
if (notBefore != undefined) {
this.notBefore = notBefore;
}
let notAfter = this.map.get('有效期至:');
if (notAfter != undefined) {
this.notAfter = notAfter;
}
}
}
build() {
Column() {
Text($r('app.string.DialogSubjectComponent_fifText'))
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
.margin({
top: $r('app.float.sys_elements_margin_vertical_l')
})
Text(this.notBefore)
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
Text($r('app.string.DialogSubjectComponent_sixText'))
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
.margin({
top: $r('app.float.sys_elements_margin_vertical_m')
})
Text(this.notAfter)
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
}.alignItems(HorizontalAlign.Start);
}
}
@Component
export struct DialogFingerPrintComponent {
private fingerprintSha256: string = '';
build() {
Column() {
Text($r('app.string.CustomDialogExample_FingerPrint_text'))
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
.margin({
top: $r('app.float.sys_elements_margin_vertical_l')
})
Text(this.fingerprintSha256)
.fontSize($r('sys.float.ohos_id_text_size_body2'))
.fontColor($r('sys.color.ohos_id_color_text_primary'))
.fontWeight(FontWeight.Regular)
.margin({
right: $r('app.float.wh_value_24')
})
}.alignItems(HorizontalAlign.Start);
}
}
@Component
struct ComponentSystem {
private certAlias: string = '';