作者 xiaoqiu

首次提交

正在显示 186 个修改的文件 包含 9860 行增加0 行删除
不能预览此文件类型
/node_modules
/oh_modules
/local.properties
/.idea
**/build
/.hvigor
.cxx
/.clangd
/.clang-format
/.clang-tidy
**/.test
/.appanalyzer
\ No newline at end of file
... ...
{
"app": {
"bundleName": "com.example.fireMaintenanceAssistant",
"vendor": "example",
"versionCode": 1000000,
"versionName": "1.0.0",
"icon": "$media:app_icon",
"label": "$string:app_name"
}
}
... ...
{
"string": [
{
"name": "app_name",
"value": "消防维保助手"
}
]
}
... ...
{
"app": {
"products": [
{
"name": "default",
"signingConfig": "default",
"compatibleSdkVersion": "5.0.0(12)",
"runtimeOS": "HarmonyOS",
"buildOption": {
"strictMode": {
"caseSensitiveCheck": true,
"useNormalizedOHMUrl": true
}
}
}
],
"buildModeSet": [
{
"name": "debug"
},
{
"name": "release"
}
],
"signingConfigs": [
{
"name": "default",
"type": "HarmonyOS",
"material": {
"storePassword": "0000001ABFA3098F4A58FE591F6AE225CCEC2D4131BF649B5FC7FE780DD745742DE3ABAB9759886B99E2",
"certpath": "/Users/king/Desktop/harmonyos/keyStoreFile/fireMaintenance/fireMaintenance.cer",
"keyAlias": "fireMaintenance",
"keyPassword": "0000001A018F4E9B269FEF764B4C7E6047DE40E22254B5479AFE815F863B88716EB4C6D67B6CF97C10C4",
"profile": "/Users/king/Desktop/harmonyos/keyStoreFile/fireMaintenance/fireMaintananceRelease.p7b",
"signAlg": "SHA256withECDSA",
"storeFile": "/Users/king/Desktop/harmonyos/keyStoreFile/fireMaintenance/fireMaintenance.p12"
}
}
]
},
"modules": [
{
"name": "entry",
"srcPath": "./entry",
"targets": [
{
"name": "default",
"applyToProducts": [
"default"
]
}
]
}
]
}
\ No newline at end of file
... ...
{
"files": [
"**/*.ets"
],
"ignore": [
"**/src/ohosTest/**/*",
"**/src/test/**/*",
"**/src/mock/**/*",
"**/node_modules/**/*",
"**/oh_modules/**/*",
"**/build/**/*",
"**/.preview/**/*"
],
"ruleSet": [
"plugin:@performance/recommended",
"plugin:@typescript-eslint/recommended"
],
"rules": {
}
}
\ No newline at end of file
... ...
不能预览此文件类型
/node_modules
/oh_modules
/.preview
/build
/.cxx
/.test
\ No newline at end of file
... ...
{
"apiType": "stageMode",
"buildOption": {
},
"buildOptionSet": [
{
"name": "release",
"arkOptions": {
"obfuscation": {
"ruleOptions": {
"enable": false,
"files": [
"./obfuscation-rules.txt"
]
}
}
}
},
],
"targets": [
{
"name": "default"
},
{
"name": "ohosTest",
}
]
}
\ No newline at end of file
... ...
import { hapTasks } from '@ohos/hvigor-ohos-plugin';
export default {
system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
}
... ...
# Define project specific obfuscation rules here.
# You can include the obfuscation configuration files in the current module's build-profile.json5.
#
# For more details, see
# https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5
# Obfuscation options:
# -disable-obfuscation: disable all obfuscations
# -enable-property-obfuscation: obfuscate the property names
# -enable-toplevel-obfuscation: obfuscate the names in the global scope
# -compact: remove unnecessary blank spaces and all line feeds
# -remove-log: remove all console.* statements
# -print-namecache: print the name cache that contains the mapping from the old names to new names
# -apply-namecache: reuse the given cache file
# Keep options:
# -keep-property-name: specifies property names that you want to keep
# -keep-global-name: specifies names that you want to keep in the global scope
-enable-property-obfuscation
-enable-toplevel-obfuscation
-enable-filename-obfuscation
-enable-export-obfuscation
\ No newline at end of file
... ...
{
"name": "entry",
"version": "1.0.0",
"description": "Please describe the basic information.",
"main": "",
"author": "",
"license": "",
"dependencies": {}
}
... ...
不能预览此文件类型
不能预览此文件类型
import https from './request'
// 获取上传秘钥参数
export interface cosKeyTest {
msg: string;
code: number;
data: cosKeyData;
}
export interface cosKeyData {
credentials: cosKeyCredentials;
requestId: string;
expiration: string;
startTime: number;
expiredTime: number;
coskey: string;
preSignedUrl: string;
}
export interface cosKeyCredentials {
tmpSecretId: string;
tmpSecretKey: string;
sessionToken: string;
}
// 获取上传秘钥
export const getCosKey = (filename: string) => {
return https<cosKeyTest>({
url: '/system/COS/getTempKey',
method: 'get',
params: {
filename
}
})
}
interface cosParams {
cosKey: string,
relateId: number
}
// 上传视频
export const uploadVideoOrImg = (data: cosParams) => {
return https({
url: '/maintenance/report/uploadVedio',
method: 'post',
headers: {
"Content-Type": 'application/json'
},
data
})
}
\ No newline at end of file
... ...
import https from './request'
export interface noticeTest {
total: number;
rows: noticeRow[];
code: number;
msg: string;
}
export interface noticeDetailTest {
data: noticeRow;
code: number;
msg: string;
}
export interface noticeRow {
createBy?: string;
createTime?: string;
updateBy?: string;
updateTime?: null | string;
remark?: null;
noticeId?: number;
noticeTitle: string;
noticeType: string;
noticeContent: string;
status?: string;
}
export interface noticeParams {
pageNum: number
pageSize: number
noticeTitle?: string
createBy?: string
status?: string
noticeType?: string
}
// 获取公告列表
export const getNoticeList = (data: noticeParams) => {
return https<noticeTest>({
url: '/system/notice/list',
method: 'get',
params: data
})
}
// 获取公告详情
export const getNoticeDetail = (id: number) => {
return https<noticeDetailTest>({
url: `/system/notice/${id}`,
method: 'get',
})
}
\ No newline at end of file
... ...
export interface quarterTest {
msg: string;
code: number;
data: quarterType[];
}
export interface quarterType {
createBy: string;
createTime: string;
updateBy: null;
updateTime: null;
remark: null;
dictCode: number;
dictSort: number;
dictLabel: string;
dictValue: string;
dictType: string;
cssClass: null;
listClass: string;
isDefault: string;
status: string;
default: boolean;
}
... ...
import https from './request'
import { RecordsList, QueryParams, addParamsType, equipmentTest, LatestProjectTest,
companyPersonTest, reportDetailTest, MalfunctionListTest, MalfunctionListRow,
InitTest, realNameTest, orderTest,configTest,
recordTest, orderParams, recordParams, editType
} from './recordsType'
import { quarterTest } from './options/optionsType'
// 获取维保记录列表
export const getRecordsList = (data: QueryParams) => {
return https<RecordsList>({
url: '/maintenance/report/list',
method: 'get',
params: data
})
}
// 新增维保记录
export const addRecords = (data: addParamsType) => {
return https({
url: '/maintenance/report',
method: 'post',
data
})
}
// 修改维保记录
export const updateRecords = (data: addParamsType) => {
return https({
url: '/maintenance/report',
method: 'put',
data
})
}
interface deleteType{
reportId: number,
state: string
}
// 操作维保记录信息
export const deleteRecords = (data: deleteType) => {
return https({
url: '/maintenance/report/updateInfo',
method: 'post',
data
})
}
// 获取仪器设备列表
export const getEquipmentList = (data: QueryParams) => {
return https<equipmentTest>({
url: '/system/equipment/list',
method: 'get',
params: data
})
}
// 获取主要消防措施列表
export const getLatestProjectList = (type: string) => {
return https<LatestProjectTest>({
url: '/maintenance/project/latestProject',
method: 'get',
params: {
type
}
})
}
// 获取记录类型列表
export const getMaintenanceType = () => {
return https<quarterTest>({
url: '/system/dict/data/type/maintenance_system_type',
method: 'get'
})
}
// 获取记录状态列表
export const getMaintenanceState = () => {
return https<quarterTest>({
url: '/system/dict/data/type/report_state',
method: 'get'
})
}
// 获取公司维保人员人员列表
export const getCompanyPersonList = (data: QueryParams) => {
return https<companyPersonTest>({
url: '/system/companyPerson/list',
method: 'get',
params: data
})
}
// 获取维保详情
export const getReportDetail = (reportId: number) => {
return https<reportDetailTest>({
url: `/maintenance/report/view/${reportId}`,
method: 'get'
})
}
export interface downloadUrl {
code: number
data: string
msg: string
}
// 获取图片视频地址链接
export const getDownloadUrl = (cosKey: string, type: number) => {
return https<downloadUrl>({
url: `/system/COS/getDownloadUrl`,
method: 'get',
params: {
cosKey,
type
}
})
}
interface MalfunctionListType{
pageNum: number,
pageSize: number,
reportId: number
}
// 获取消防设施故障处理单
export const getMalfunctionList = (data: MalfunctionListType) => {
return https<MalfunctionListTest>({
url: `/maintenance/malfunction/list`,
method: 'get',
params: data
})
}
// 修改消防设施故障处理单
export const updateMalfunctionList = (data:editType) => {
return https({
url: `/maintenance/malfunction/updateList`,
method: 'post',
data
})
}
// 获取原始记录详情及签名
export const getInitDetail = (reportId: number) => {
return https<InitTest>({
url: `/maintenance/report/view/${reportId}`,
method: 'get'
})
}
// 根据报告编号获取实名信息
export const getSelectByReportNo = (reportNo: string) => {
return https<realNameTest>({
url: `/maintenance/verification/selectByReportNo`,
method: 'get',
params: {
reportNo
}
})
}
// 查询订单记录
export const getOrderList = (data: orderParams) => {
return https<orderTest>({
url: `/system/order/list`,
method: 'get',
params: data
})
}
// 查询消耗记录
export const getRecordList = (data: recordParams) => {
return https<recordTest>({
url: `/system/record/list`,
method: 'get',
params: data
})
}
// 查询支付来源
export const getOrderSource = () => {
return https<quarterTest>({
url: `/system/dict/data/type/pay_source`,
method: 'get'
})
}
// 查询订单状态
export const getOrderState = () => {
return https<quarterTest>({
url: `/system/dict/data/type/orders_state`,
method: 'get'
})
}
// 获取参数详情
export const getConfigDetail = (configId: number) => {
return https<configTest>({
url: `/system/config/${configId}`,
method: 'get'
})
}
// 完成签名
export const successReport = (reportId: number) => {
return https<configTest>({
url: `/maintenance/report/validReport`,
method: 'post',
data: {
reportId
}
})
}
// 退回签名
export const returnSing = (reportId: number) => {
return https<configTest>({
url: `/maintenance/report/backToEdit`,
method: 'post',
data: {
reportId
}
})
}
// 导入月度记录
export const importRecord = (fromReportId: number, toReportId:number) => {
return https({
url: `/maintenance/malfunction/importMalfunction`,
method: 'get',
params: {
fromReportId,
toReportId
}
})
}
\ No newline at end of file
... ...
// 查询支付订单列表
export interface orderParams {
pageNum: number
pageSize: number
orderNo?: string
amount?: number
comboName?: string
companyId: number
companyName?: string
state?: string
source?: string
}
// 查询消费记录订单列表
export interface recordParams {
pageNum: number
pageSize: number
reportName?: string
companyId: number
companyName?: string
createUserId?: number
reportNo?: string
}
// 查询维保列表参数类型
export interface QueryParams {
pageNum: number
pageSize: number
reportName?: string
reportNo?: string
applyCompanyName?: string
companyName?: string
stateQuery?: string
reportType?: string
beginMaintenanceTime?: string
endMaintenanceTime?: string
companyId?: number
technicalDirectorId?: number
state?: string
personId?: number
personName?: string
}
// 原始记录列表类型
export interface RecordsList {
total: number;
rows: Row[];
code: number;
msg: string;
}
// 原始记录类型
export interface Row {
createBy: null;
createTime: null;
updateBy: null;
updateTime: null;
remark: null;
reportId: number;
reportName: string;
reportNo: string;
address: null;
applyCompanyId: null;
applyCompanyName: string;
companyId: number;
companyName: string;
applyPerson: null;
applyDate: null;
buildUse: null;
buildHeight: null;
buildArea: null;
aboveGroundLayers: null;
undeGroundLayers: null;
projectSize: null;
fireFacilities: string;
basis: null;
result: null | string;
requirement: null;
equipment: null | string;
maintenancePeople: null | string;
maintenanceTime: null | string;
technicalDirectorId: string;
technicalDirector: null;
approvePersonId: null;
approvePerson: null;
allowPerson: null;
state: string;
reportType: string;
city: null;
county: null;
projectNature: null;
reportTime: null | string;
contractId: null;
contractName: null;
contractStartTime: null;
contractEndTime: null;
buildType: null;
fireDanger: null;
otherBuildType: null;
regionCode: null;
maintenanceArea: null;
maintenanceEndTime: null | string;
instanceId: null;
processKey: null;
contractImg: null;
proveImg: null;
smallestState: null;
projectArea: null;
maintenancePeopleId: null;
praticeImg: null | string;
reportPeriod: null;
stateQuery: null;
reportFinishTime: null | string;
projectList: null;
signList: null;
firstPartySign: null;
malfunctionList: null;
}
// 添加维保记录参数类型
export interface addParamsType {
aboveGroundLayers?: string | null
address?: string | null
allowPerson?: string | null
applyCompanyId?: number | null
applyCompanyName: string | null
applyDate?: string | null
applyPerson?: string
approvePerson: string
approvePersonId: number
basis?: string | null
buildArea?: number | null
buildHeight?: number | null
buildUse?: string | null
companyId?: number | null
contractId?: number | null
equipment?: string | null
equipmentList?: string[] | null
fireFacilities?: string | null
linkMan?: string | null
linkTel?: string | null
maintenanceDate?: string[] | null
maintenanceEndTime?: string
maintenancePeople?: string
maintenancePeopleList?: string[]
maintenanceTime?: string
projectList?: projectType[]
projectSize?: string | null
reportId?: number | null
reportName?: string | null
reportNo?: string | null
reportTime?: string | null
reportType?: string | null
requirement?: string | null
result?: string | null
safeMan?: string | null
safeSignDate?: string | null
state?: string | null
technicalDirector?: string | null
technicalDirectorId?: string
undeGroundLayers?: string | null
}
export interface projectType{
projectId: number
}
// 维保详情类型
export interface reportDetailTest {
msg: string;
code: number;
data: reportDetailData;
}
export interface reportDetailData {
createBy?: null;
createTime?: null;
updateBy?: null;
updateTime?: null;
remark?: null;
reportId?: number;
reportName: string;
reportNo: string;
address?: null;
applyCompanyId?: null;
applyCompanyName: string;
companyId?: number;
companyName: string;
applyPerson?: null;
applyDate?: null;
buildUse?: null;
buildHeight?: null;
buildArea?: null;
aboveGroundLayers?: null;
undeGroundLayers?: null;
projectSize?: null;
fireFacilities: string;
basis?: null;
result: string;
requirement?: null;
equipment: string;
maintenancePeople: string;
maintenanceTime: string;
technicalDirectorId?: string;
technicalDirector?: null;
approvePersonId?: null;
approvePerson?: null;
allowPerson?: null;
state: string;
reportType: string;
city?: null;
county?: null;
projectNature?: null;
reportTime: string;
contractId?: null;
contractName?: null;
contractStartTime?: null;
contractEndTime?: null;
buildType?: null;
fireDanger?: null;
otherBuildType?: null;
regionCode?: null;
maintenanceArea?: null;
maintenanceEndTime: string;
instanceId?: null;
processKey?: null;
contractImg?: null;
proveImg?: null;
smallestState?: null;
projectArea?: null;
maintenancePeopleId?: null;
praticeImg?: null;
reportPeriod?: null;
stateQuery?: null;
reportFinishTime?: null;
projectList: ProjectList[];
signList?: [];
firstPartySign?: [];
malfunctionList?: [];
equipmentList: string[];
maintenancePeopleList: string[]
}
export interface ProjectList {
createBy: null;
createTime: null;
updateBy: null;
updateTime: string;
remark: null;
relateId: number;
reportId: number;
projectId: number;
projectName: string;
englishName: string;
state: string;
cosKey: null | string;
vedioTIme: null;
vedioState: null;
itemList: ItemList[];
}
export interface ItemList {
relateId: number;
itemId: number;
itemName: string;
itemEnglishName: string;
maintainceContent: string;
editTemplate: string;
viewTemplate: string;
orderNum: number;
rowspan: number;
showItemName: number;
position: string;
num: string;
proportion: string;
state: string;
record: recordType;
}
export interface recordType {
record1?: string
record2?: string
record3?: string
record4?: string
record5?: string
}
// 获取设备仪器类型
export interface equipmentTest {
code: number
msg: string
total: number
rows: equipmentType[]
}
export interface equipmentType {
buyDate: string
certificateNo: string
companyId: number
companyName: string
createBy: string | null
createTime: string
endDate: string
equipmentId: number
equipmentName: string
equipmentPicture: string | null
isCheckEquipment: boolean | null
manufacturer: string
remark: string | null
remarks: string
specifications: string
startDate: string
state: number
updateBy: string | null
updateTime: string | null
verificationReportPicture: string | null
}
// 主要消防措施类型
export interface LatestProjectTest {
msg: string;
code: number;
data: LatestProjectDatum[];
}
export interface LatestProjectDatum {
createBy: string | null;
createTime: string;
updateBy: string | null;
updateTime: string | null;
remark: string | null;
projectId: number;
projectName: string;
type: number;
version: string;
projectOrder: number;
englishName: string | null;
}
// 获取公司在职人员列表
export interface companyPersonTest {
total: number;
rows: companyPersonRow[];
code: number;
msg: string;
}
export interface companyPersonRow {
companyId: number;
companyName: string;
personId: number;
personName: string;
idNo: string;
certificateId: number | null;
certificateName: string;
certificateLevel: string;
memo: string | null;
state: string;
createTime: string;
relateId: number;
personalImg: string;
}
// 消防设施故障处理列表类型
export interface MalfunctionListTest {
total: number;
rows: MalfunctionListRow[];
code: number;
msg: string;
}
export interface MalfunctionListRow {
malfunctionId?: number;
findTime?: null | string;
findPeople?: null;
malfunctionPart: string;
malfunctionDes: string;
isStop?: null;
isRecord?: null;
security: string;
maintenanceTime?: null;
maintenancePeople?: null;
maintenanceMethod: string;
malfunctionConfirm: string;
reportId?: number;
version?: number;
maintenanceComment?: null | string;
applyCompanyComment?: null | string;
remark: null | string;
companyName?: null | string;
applyCompanyName?: string;
}
// 新增、修改、删除类型
export interface editType {
reportId: number;
list: MalfunctionListRow[]
}
// 原始记录详情类型
export interface InitTest {
msg: string;
code: number;
data: InitData;
}
export interface InitData {
createBy?: null;
createTime?: null;
updateBy?: null;
updateTime?: null;
remark?: null;
reportId?: number;
reportName: string;
reportNo: string;
address?: null;
applyCompanyId?: null;
applyCompanyName?: string;
companyId?: number;
companyName?: string;
applyPerson?: null;
applyDate?: null;
buildUse?: null;
buildHeight?: null;
buildArea?: null;
aboveGroundLayers?: null;
undeGroundLayers?: null;
projectSize?: null;
fireFacilities?: string;
basis?: null;
result?: null;
requirement?: null;
equipment?: string;
maintenancePeople?: string;
maintenanceTime?: string;
technicalDirectorId?: string;
technicalDirector?: null;
approvePersonId?: null;
approvePerson?: null;
allowPerson?: null;
state?: string;
reportType?: string;
city?: null;
county?: null;
projectNature?: null;
reportTime?: string;
contractId?: null;
contractName?: null;
contractStartTime?: null;
contractEndTime?: null;
buildType?: null;
fireDanger?: null;
otherBuildType?: null;
regionCode?: null;
maintenanceArea?: null;
maintenanceEndTime?: string;
instanceId?: null;
processKey?: null;
contractImg?: null;
proveImg?: null;
smallestState?: null;
projectArea?: null;
maintenancePeopleId?: null;
praticeImg?: null;
reportPeriod?: null;
stateQuery?: null;
reportFinishTime?: string;
projectList?: ProjectList[];
signList?: InitFirstPartySign[];
firstPartySign?: InitFirstPartySign[];
malfunctionList?: InitMalfunctionList[];
}
export interface InitFirstPartySign {
createBy: null;
createTime: null;
updateBy: null;
updateTime: null;
remark: null;
signId: number;
type: number;
signPic: string;
signHash: string;
signEncrypt: string;
username: string;
reportId: number;
signTime: string;
}
export interface InitMalfunctionList {
malfunctionId: number;
findTime: string;
findPeople: null;
malfunctionPart: string;
malfunctionDes: string;
isStop: null;
isRecord: null;
security: string;
maintenanceTime: null;
maintenancePeople: null;
maintenanceMethod: string;
malfunctionConfirm: string;
reportId: number;
version: number;
maintenanceComment: string;
applyCompanyComment: string;
remark: string;
companyName: null;
applyCompanyName: null;
}
export interface InitProjectList {
createBy: null;
createTime: null;
updateBy: null;
updateTime: string;
remark: null;
relateId: number;
reportId: number;
projectId: number;
projectName: string;
englishName: string;
state: string;
cosKey: string;
vedioTIme: null;
vedioState: null;
itemList: ItemList[];
}
export interface InitItemList {
relateId: number;
itemId: number;
itemName: string;
itemEnglishName: string;
maintainceContent: string;
editTemplate: string;
viewTemplate: string;
orderNum: number;
rowspan: number;
showItemName: number;
position: string;
num: string;
proportion: string;
state: string;
record: Record;
}
export interface Record {
record4: string;
record3: string;
record2: string;
record1: string;
}
// 实名信息类型
export interface realNameTest {
msg: string;
code: number;
data: realNameDatum[];
}
export interface realNameDatum {
reportId: number;
reportName: string;
reportNo: string;
realName: string;
idNo: string;
openId: string;
signTime: string;
}
// 订单列表类型
export interface orderTest {
total: number;
rows: orderRow[];
code: number;
msg: string;
}
export interface orderRow {
orderId: number;
orderNo: string;
amount: number;
comboId: number;
comboName: string;
companyId: number;
companyName: string;
bean: number;
state: number;
invoice: null | string;
source: number;
createTime: string;
expireTime: string;
payInfo: orderPayInfo;
}
export interface orderPayInfo {
"createBy": string
"createTime": string
"updateBy": string
"updateTime": string
"remark": string
"payId": number
"orderId": number
"appId": string,
"nonceStr": string,
"paySign": string,
"signType": string,
"prepayId": string,
"timeStamp": string,
"packageValue": string,
"partnerid": number,
"codeUrl": string
}
// 消耗记录类型
export interface recordTest {
total: number;
rows: recordRow[];
code: number;
msg: string;
}
export interface recordRow {
createBy: null;
createTime: string;
updateBy: null;
updateTime: null;
remark: string;
recordId: number;
reportId: number;
reportNo: string;
reportName: string;
companyId: number;
companyName: string;
createUserId: number;
createUserName: string;
costBean: number;
remainBean: number;
}
// 参数详情类型
export interface configTest {
msg: string;
code: number;
data: configData;
}
export interface configData {
createBy: string;
createTime: string;
updateBy: string;
updateTime: null;
remark: string;
configId: number;
configName: string;
configKey: string;
configValue: string;
configType: string;
}
\ No newline at end of file
... ...
import axios, { AxiosResponse, AxiosError, InternalAxiosRequestConfig } from '@ohos/axios'
import preferencesUtil from '../utils/preferences'
import loginOut from '../utils/loginOut'
import { promptAction } from '@kit.ArkUI';
import { router } from '@kit.ArkUI'
import baseUrl from '../utils/baseUrl'
let https = axios.create({
baseURL: baseUrl,
// baseURL: "https://xfappht.crgx.net",
timeout: 10000,
headers: { 'Content-Type': 'application/json' }
})
// 请求拦截
https.interceptors.request.use(async (config: InternalAxiosRequestConfig) => {
if(!config.headers.unToken){
config.headers.Authorization = preferencesUtil.get('XF_TOKEN', '') as string
}
return config
})
// 相应拦截
https.interceptors.response.use(async (res: AxiosResponse) => {
// 未设置状态码则默认成功状态
const code: number = res.data.code || 200;
// 获取错误信息
const msg: string = res.data.msg
// 二进制数据则直接返回
if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') {
return res.data
}
if (code === 401) {
promptAction.showToast({
message: '身份验证失败。请重新登录'
})
await loginOut()
router.replaceUrl({
url: 'pages/Login'
})
return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
} else if (code === 500) {
promptAction.showToast({
message: msg,
})
return Promise.reject(new Error(msg))
} else if (code === 601) {
promptAction.showToast({
message: msg,
})
return Promise.reject('error')
} else if (code !== 200) {
promptAction.showToast({
message: msg,
})
return Promise.reject('error')
} else {
return res
}
}, (Error: AxiosError) => {
promptAction.showToast({
message: Error.message,
})
return Promise.reject(Error)
})
export default https
\ No newline at end of file
... ...
import { QueryParams } from './recordsType'
import https from './request'
import { loginType, userForm, personTest, personCertificateTest, CertificateTest, personCertificateRow, personData, companyWalletTest, InfoTest, companyTest,
companyData, headerTest, formType, headerRow,comBoTest, addType
} from './userType'
// 用户登录
export const login = (data: userForm) => {
return https<loginType>({
url: '/login',
method: 'post',
data,
headers: {
unToken: true
}
})
}
// 退出登录
export const loginOut = () => {
return https({
url: '/logout',
method: 'post',
headers: {
unToken: true
}
})
}
export interface updateStateParams {
relateId: number
state: string
}
// 离职申请
export const updateState = (data: updateStateParams) => {
return https({
url: '/system/companyPerson/updateState',
method: 'post',
data
})
}
// 获取账号信息
export const getInfo = () => {
return https<InfoTest>({
url: '/getInfo',
method: 'get'
})
}
// 获取个人信息
export const getPersonInfo = () => {
return https<personTest>({
url: '/system/person/currentPerson',
method: 'get'
})
}
// 获取公司管理员信息
export const getCompanyInfo = () => {
return https<companyTest>({
url: '/system/company/currentCompany',
method: 'get'
})
}
// 更新个人信息
export const updateCompanyInfo = (data: companyData) => {
return https({
url: '/system/company',
method: 'put',
data
})
}
// 获取公司管理员获取员工信息
export const getPersonDetail = (personId: number) => {
return https<personTest>({
url: `/system/person/${personId}`,
method: 'get'
})
}
// 更新个人信息
export const updatePersonInfo = (data: personData) => {
return https({
url: '/system/person',
method: 'put',
data
})
}
export interface emailType {
code: number
msg: string
data: string
}
// 获取邮箱验证码
export const getEmailCode = (email: string) => {
return https<emailType>({
url: '/system/forgetPwd/registValidEmail',
method: 'post',
data: email
})
}
export interface certificateParams {
pageNum: number
pageSize: number
personId?: number
companyId?: number
}
// 获取个人证书信息
export const getPersonalCertificate = (data: certificateParams) => {
return https<personCertificateTest>({
url: '/system/personalCertificate/list',
method: 'get',
params: data
})
}
// 修改个人证书信息
export const updatePersonalCertificate = (data: personCertificateRow) => {
return https({
url: '/system/personalCertificate',
method: 'put',
data
})
}
// 添加个人证书信息
export const addPersonalCertificate = (data: personCertificateRow) => {
return https({
url: '/system/personalCertificate',
method: 'post',
data
})
}
// 获取证书列表
export const getCertificateList = (data: certificateParams) => {
return https<CertificateTest>({
url: '/system/certificate/list',
method: 'get',
params: data
})
}
// 获取公司余额信息
export const getCompanyWallet = (data: certificateParams) => {
return https<companyWalletTest>({
url: '/system/wallet/list',
method: 'get',
params: data
})
}
// 用户修改密码
export const updatePassword = (oldPassword: string, newPassword: string) => {
return https<companyWalletTest>({
url: '/system/user/profile/updatePwd',
method: 'put',
params: {
oldPassword,
newPassword
}
})
}
// 用户重置密码
export const resetPassword = (data: formType) => {
return https({
url: '/system/forgetPwd/resetPwd',
method: 'post',
data
})
}
// 获取公司开票信息
export const getHeaderInfo = (data: QueryParams) => {
return https<headerTest>({
url: '/system/header/list',
method: 'get',
params: data
})
}
// 修改新增开票信息
export const addHeaderInfo = (data: headerRow) => {
return https({
url: '/system/header',
method: 'post',
data
})
}
// 修改开票信息
export const updateHeaderInfo = (data: headerRow) => {
return https({
url: '/system/header',
method: 'put',
data
})
}
// 获取充值套餐
export const getComboList = (data: QueryParams) => {
return https<comBoTest>({
url: '/system/combo/list',
method: 'get',
params: data
})
}
export interface beanType {
code: number
msg: string
}
// 获取报告豆比例
export const getBean = () => {
return https<beanType>({
url: '/system/config/configKey/bean.config.proportion',
method: 'get',
})
}
// 获取是否可以上传云存储
export const getCloudDown = () => {
return https<beanType>({
url: '/system/config/configKey/permission.uploadVedio',
method: 'get',
})
}
// 获取是否收费
export const getPay = () => {
return https<beanType>({
url: '/system/config/configKey/permission.charge',
method: 'get',
})
}
export interface queryUserNameType {
code: number
msg: string
data: number
}
// 检查用户名是否被使用
export const queryUsername = (userName: string) => {
return https<queryUserNameType>({
url: '/system/user/checkUserName',
method: 'get',
params: {
userName
}
})
}
export interface queryIdNoType {
code: number
msg: string
row: [],
total: number
}
// 检查身份证号是否被使用
export const queryIdNo = (idNo: string) => {
return https<queryIdNoType>({
url: '/system/person/list',
method: 'get',
params: {
pageNum: 1,
pageSize: 1,
idNo
}
})
}
// 注册个人用户
export const userRegister = (data: personData) => {
return https({
url: '/system/person/register',
method: 'post',
data
})
}
// 注册企业用户
export const companyRegister = (data: companyData) => {
return https({
url: '/system/company/register',
method: 'post',
data
})
}
// 公司新增员工
export const companyAdd = (data: addType) => {
return https<beanType>({
url: '/system/companyPerson',
method: 'post',
data
})
}
... ...
export interface requestType {
msg: string,
code: number
}
// 登录成功参数类型
export interface loginType extends requestType {
token: string
}
export interface userForm {
username: string,
password: string,
rememberMe?: boolean
}
// 用户个人信息参数类型
export interface personTest extends requestType {
data: personData;
}
export interface personData {
createBy?: string;
createTime?: string;
updateBy?: string;
updateTime?: string;
remark?: string;
personId: number;
personName: string;
email: string;
gender: string;
birthDate: string;
idNo: string;
phone: string;
personalImg: string;
idImgFront: string;
idImgBack: string;
address: string;
userId: number;
username: string;
state: string;
companyId: number;
code?: string
password?: string
}
// 公司个人信息类型
export interface companyTest {
msg: string;
code: number;
data: companyData;
}
export interface companyData {
createBy?: null;
createTime?: null;
updateBy?: null;
updateTime?: string;
remark?: null;
companyId: number;
companyName: string;
province: string;
city: string;
county: string;
address: string;
legalPerson?: null;
lpTel?: null;
linkMan: string;
lmTel: string;
companyTel: null;
fax?: null;
postCode: null;
email: string;
website?: null;
floorage?: number;
siteVoucher?: string;
businessLicenseNo: string;
businessStartTime: null;
businessEndTime: null;
businessLicensePic: string;
businessScope?: null;
peopleNum?: number;
companyIntroduce?: null;
registeredCapital?: null;
compangyPic: string;
memo?: null;
state?: string;
companyType?: string;
isShow?: null;
isValidVedio?: null;
userId: number;
username: string;
level: null;
regionCode: null;
levelModifyDate: null;
endTime: string;
password?: string
}
// 个人证书信息
export interface personCertificateTest {
total: number;
rows: personCertificateRow[];
code: number;
msg: string;
}
export interface personCertificateRow {
createBy?: null;
createTime?: null;
updateBy?: null;
updateTime?: null;
remark?: string | null;
relateId?: number;
certificateName: string;
certificateLevel: string;
personId?: number;
personName?: string;
certificateId?: number;
certificateNo?: string;
validStartTime?: null;
validEndTime?: null;
issueDate?: string;
certificateImg?: string;
memo?: null;
state?: string;
}
// 证书列表
export interface CertificateTest {
total: number;
rows: CertificateRow[];
code: number;
msg: string;
}
export interface CertificateRow {
createBy: null;
createTime: null;
updateBy: null;
updateTime: null;
remark: null;
certificateId: number;
certificateType: string;
certificateName: string;
certificateLevel: string;
}
// 公司余额斗列表
export interface companyWalletTest {
total: number;
rows: companyWalletRow[];
code: number;
msg: string;
}
export interface companyWalletRow {
createBy: null;
createTime: null;
updateBy: null;
updateTime: null;
remark: null;
walletId: number;
companyId: number;
bean: number
}
// 账号信息类型
export interface InfoTest {
msg: string;
code: number;
permissions: string[];
roles: string[];
user: InfoUser;
}
export interface InfoUser {
createBy: string;
createTime: string;
updateBy: null;
updateTime: null;
remark: null;
userId: number;
deptId: null;
userName: string;
nickName: string;
email: string;
phonenumber: string;
sex: string;
avatar: string;
password: string;
status: string;
delFlag: string;
loginIp: string;
loginDate: string;
dept: null;
roles: InfoRole[];
roleIds: null;
postIds: null;
roleId: null;
openId: string;
admin: boolean;
}
export interface InfoRole {
createBy: null;
createTime: null;
updateBy: null;
updateTime: null;
remark: null;
roleId: number;
roleName: string;
roleKey: string;
roleSort: number;
dataScope: string;
menuCheckStrictly: boolean;
deptCheckStrictly: boolean;
status: string;
delFlag: null;
flag: boolean;
menuIds: null;
deptIds: null;
permissions: string[];
admin: boolean;
}
// 开票信息类型
export interface headerTest {
total: number;
rows: headerRow[];
code: number;
msg: string;
}
export interface headerRow {
headerId?: number;
account: string;
bank: string;
address: string;
phone: string;
companyId: string;
companyName: string;
businessLicenseNo: string;
}
// 套餐类型
export interface comBoTest {
total: number;
rows: comBoRow[];
code: number;
msg: string;
}
export interface comBoRow {
createBy: null;
createTime: null;
updateBy: null;
updateTime: null;
remark: null;
comboId: number;
comboName: string;
comboPrice: number;
bean: number;
comboOrder: number;
state: string;
}
// 重置密码参数
export interface formType {
againPassword: string
code: string
email: string
password: string
type: number
username?: string
}
// 新增员工参数
export interface addType {
idNo: string,
personName: string,
relateId?: null
}
\ No newline at end of file
... ...
import { useCascadeAreaData } from '../utils/getArea'
@Component
export default struct AreaPicker {
@State cascade: TextCascadePickerRangeContent[] = useCascadeAreaData() //省市区列表数据
@Link value: string[] //选中值例如:['北京市','北京市','东城区']
private onChange: (value: string[], index: number[]) => void = () => {
} //选择改变回调函数
build() {
TextPicker({ range: this.cascade, value: this.value })
.canLoop(false)
.textStyle({
font: {
size: '14fp'
}
})
.selectedTextStyle({
font: {
size: '16fp'
}
})
.onChange((value: string | string[], index: number | number[]) => {
this.onChange(value as string[], index as number[])
this.value = value as string[]
})
}
}
... ...
import { router } from '@kit.ArkUI'
import { AxiosResponse } from '@ohos/axios'
import { getNoticeList, noticeTest, noticeParams, noticeRow } from '../api/notice'
import { getCompanyPersonList } from '../api/originalRecords'
import { companyPersonTest, companyPersonRow } from '../api/recordsType'
import preferencesUtils from '../utils/preferences'
import baseUrl from '../utils/baseUrl'
@Component
export default struct HomePage {
@State searchValue: string = ''
@State params: noticeParams = {
pageNum: 1,
pageSize: 10
}
@State noticeList: noticeRow[] = []
@State noticeTitleList: string[] = []
@State personList: companyPersonRow[] = []
roleName = preferencesUtils.get('XF_ROLE_NAME', '')
async aboutToAppear() {
getNoticeList(this.params).then((res: AxiosResponse<noticeTest>) => {
this.noticeList = res.data.rows
this.noticeTitleList = res.data.rows.map((item: noticeRow) => item.noticeTitle)
})
if(this.roleName == 'company') {
let companyId = preferencesUtils.get('XF_COMPANY_ID', '')
const personRes: AxiosResponse<companyPersonTest> = await getCompanyPersonList({pageNum: 1, pageSize: 10, companyId: Number(companyId), state: '2' })
this.personList = personRes.data.rows
}
}
build() {
Scroll(){
Column(){
Search({value: $$this.searchValue, placeholder: '请输入原始记录名称'}).backgroundColor('#fff')
.searchButton('搜索')
.onSubmit((value) => {
router.pushUrl({
url: 'pages/MaintenanceRecords',
params: {
reportName: value
}
})
})
Column(){
Text('维保原始记录').fontSize(18).lineHeight(24).fontColor('#fff').fontWeight(600)
Text('查看所有维保记录').fontSize(10).lineHeight(13).fontColor('#CACBFD').margin({bottom: 18, top: 2})
Row(){
Text('立即查看').fontSize(12).fontColor('#36278D').lineHeight(16)
Image($r('app.media.right_1')).width(16).margin({left: 5})
}.width(80).height(20).backgroundColor(Color.White).borderRadius(10).justifyContent(FlexAlign.Center)
}.width('100%').height(100).backgroundImage($r('app.media.bg_1'))
.backgroundImageSize({width: '100%', height: 100}).margin({top: 15}).alignItems(HorizontalAlign.Start)
.padding({top: 10, left: 20}).onClick(() => {
router.pushUrl({
url: 'pages/MaintenanceRecords'
})
})
Column(){
Text('操作手册').fontSize(18).lineHeight(24).fontColor('#fff').fontWeight(600)
Text('查看APP操作手册').fontSize(10).lineHeight(13).fontColor('#B5E9E6').margin({bottom: 18, top: 2})
Row(){
Text('立即查看').fontSize(12).fontColor('#1D8F90').lineHeight(16)
Image($r('app.media.right_2')).width(16).margin({left: 5})
}.width(80).height(20).backgroundColor(Color.White).borderRadius(10).justifyContent(FlexAlign.Center)
}.width('100%').height(100).backgroundImage($r('app.media.bg_2'))
.backgroundImageSize({width: '100%', height: 100}).margin({top: 15}).alignItems(HorizontalAlign.Start)
.padding({top: 10, left: 20}).onClick(() => {
router.pushUrl({
url: 'pages/OperationManual'
})
})
// 通知栏
Row(){
Row(){
Image($r('app.media.notice')).width(16).margin({right: 5})
Text('公告').fontSize(13).fontColor('3d3d3d')
}.width(75).backgroundColor('#F0FAFF').height(30).borderRadius(15).justifyContent(FlexAlign.Center)
Text(this.noticeTitleList.join(' '))
.fontColor('#3d3d3d').fontSize(12).layoutWeight(1).textOverflow({overflow: TextOverflow.MARQUEE})
}.width('100%').height(30).backgroundColor('#fff').borderRadius(15).margin({top: 15})
// 企业人员
Column(){
Row(){
Row(){
Text().width(4).height(20).backgroundColor('#6D9DFF').margin({right: 10})
Text('企业人员').fontSize(16).lineHeight(21).fontColor('#3d3d3d').fontWeight(600)
}
Row(){
Text('更多').fontSize(12).fontColor('#999').margin({right: 3})
Image($r('app.media.two_right')).width('12')
}.onClick(() => {
router.pushUrl({
url: 'pages/PersonList'
})
})
}.justifyContent(FlexAlign.SpaceBetween).width('100%')
Column(){
ForEach(this.personList, (item: companyPersonRow, index: number) => {
Row(){
Row({space: 10}){
Image(baseUrl + item.personalImg).width(60).height(60).borderRadius(10)
Column(){
Text(item.personName).fontSize(14).fontWeight(600).lineHeight(19).margin({bottom: 5})
.fontColor('#3d3d3d').textOverflow({overflow: TextOverflow.Ellipsis}).maxLines(1)
Text(item.createTime).fontColor('#999').fontSize(12).lineHeight(16)
}.alignItems(HorizontalAlign.Start)
}.layoutWeight(1)
Image($r('app.media.right_3')).width(12)
}.width('100%').justifyContent(FlexAlign.SpaceBetween)
.border({width: {bottom: this.personList.length == index + 1 ? 0 : 1}, color: '#eee'}).padding({top: 15, bottom: 15})
.onClick(() => {
router.pushUrl({
url: 'pages/PersonDetail',
params: {
personId: item.personId
}
})
})
})
}.margin({top: 15})
}.width('100%').padding(15).borderRadius(10).backgroundColor('#fff').margin({top: 15})
.visibility(this.roleName == 'company' ? Visibility.Visible : Visibility.None)
// 通知公告
Column(){
Row(){
Row(){
Text().width(4).height(20).backgroundColor('#6D9DFF').margin({right: 10})
Text('通知公告').fontSize(16).lineHeight(21).fontColor('#3d3d3d').fontWeight(600)
}
Row(){
Text('更多').fontSize(12).fontColor('#999').margin({right: 3})
Image($r('app.media.two_right')).width('12')
}.onClick(() => {
router.pushUrl({
url: 'pages/NoticeList'
})
})
}.justifyContent(FlexAlign.SpaceBetween).width('100%')
Column(){
ForEach(this.noticeList, (item: noticeRow, index: number) => {
Row(){
Column(){
Text(item.noticeTitle).fontSize(14).fontWeight(600).lineHeight(19).margin({bottom: 5})
.fontColor('#3d3d3d').textOverflow({overflow: TextOverflow.Ellipsis}).maxLines(1)
Text(item.createTime).fontColor('#999').fontSize(12).lineHeight(16)
}.alignItems(HorizontalAlign.Start).layoutWeight(1)
Image($r('app.media.right_3')).width(12)
}.width('100%').justifyContent(FlexAlign.SpaceBetween)
.border({width: {bottom: this.noticeList.length == index + 1 ? 0 : 1}, color: '#eee'}).padding({top: 15, bottom: 15})
.onClick(() => {
router.pushUrl({
url: 'pages/NoticeDetail',
params: {
id: item.noticeId
}
})
})
})
}.margin({top: 15})
}.width('100%').padding(15).borderRadius(10).backgroundColor('#fff').margin({top: 15})
}.width('100%')
.padding({left: 15, right: 15, bottom: 30})
}.height('100%').scrollBar(BarState.Off).linearGradient({colors: [['#E1EEFF', 0], ['#F2F3F7', 0.3]]})
}
}
\ No newline at end of file
... ...
@Component
struct InputVerify{
@Link textValue: string
@Prop errorInfo: string
build() {
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('姓名')
}.width(80)
TextInput({placeholder: '请输入姓名', text: this.textValue})
.backgroundColor('#fff').layoutWeight(1)
.showError(this.errorInfo).onChange(() => {
if(this.textValue.length == 0) {
this.errorInfo = '此处不能为空'
} else {
}
})
}.border({width: {bottom: 1}, color: '#eee'})
}
}
\ No newline at end of file
... ...
import { router } from '@kit.ArkUI'
import preferencesUtil from '../utils/preferences'
import loginOut from '../utils/loginOut'
import { personData, personCertificateRow, companyWalletTest, companyWalletRow, companyData } from '../api/userType'
import baseUrl from '../utils/baseUrl'
import { getCompanyPersonList } from '../api/originalRecords'
import { companyPersonTest, companyPersonRow } from '../api/recordsType'
import { getCompanyWallet, updateState } from '../api/user'
import { AxiosResponse } from '@ohos/axios'
import { promptAction } from '@kit.ArkUI'
import LoadingDialog from '../dialog/LoadingDialog'
import updatePasswordDialog from '../dialog/updatePasswordDialog'
@Extend(Text)
function textExtend() {
.fontSize(14).lineHeight(19).fontColor('#3d3d3d')
}
@Extend(Text)
function textRight() {
.fontSize(14).lineHeight(19).fontColor('#999')
}
let getTextInfo = (state: string | null) => {
if(state == '0') {
return '已离职'
} else if(state == '1') {
return '确认从业'
} else if(state == '2') {
return '确认离职'
} else {
return ''
}
}
@Component
export default struct MainPage {
dialogController: CustomDialogController = new CustomDialogController({
builder: updatePasswordDialog(),
cornerRadius: 10
})
loadingController: CustomDialogController = new CustomDialogController({
builder: LoadingDialog(),
customStyle: true,
offset: { dx: 0, dy: 0 },
alignment: DialogAlignment.Center,
autoCancel: false
})
@Link userInfo: personData
@Link companyInfo: companyData
@Link personCertificateInfo: personCertificateRow
@State walletData: companyWalletRow | null = null
@State companyData: companyPersonRow | null = null
@Link isEdit: boolean
roleName = preferencesUtil.get('XF_ROLE_NAME', '')
async aboutToAppear() {
let personId = preferencesUtil.get('XF_PERSON_ID', 0)
let companyId = preferencesUtil.get('XF_COMPANY_ID', 0)
if(this.roleName == 'person' && preferencesUtil.get('XF_PERSON_INFO', '')) {
this.userInfo = JSON.parse(preferencesUtil.get('XF_PERSON_INFO', '') as string)
}
if(this.roleName == 'person' || this.roleName == 'unapprovedPerson') {
// 获取公司人员个人信息
const companyInfo: AxiosResponse<companyPersonTest> = await getCompanyPersonList({pageNum: 1, pageSize: 10, personId: Number(personId)})
this.companyData = companyInfo.data.rows[0]
}
// 获取公司钱包信息
const walletInfo: AxiosResponse<companyWalletTest> = await getCompanyWallet({pageNum: 1, pageSize: 10, companyId: Number(companyId)})
this.walletData = walletInfo.data.rows[0]
}
build() {
Stack(){
Column(){
Row(){
Image((baseUrl + this.userInfo?.personalImg) || $r('app.media.userAvatar')).width(80).height(80).borderRadius(40).margin({right: 10})
Text(this.userInfo?.personName).fontSize(16).lineHeight(21).fontWeight(600).fontColor('#fff')
}.width('100%').padding({left: 15,right: 15}).margin({top: 44})
.visibility(this.roleName == 'person' || this.roleName == 'unapprovedPerson' ? Visibility.Visible: Visibility.None)
Row(){
Row(){
Image((baseUrl + this.companyInfo?.businessLicensePic) || $r('app.media.userAvatar')).width(60).height(60).borderRadius(30).margin({right: 10})
Text(this.companyInfo?.companyName).fontSize(14).lineHeight(21).fontWeight(600).fontColor('#fff')
}.layoutWeight(1).justifyContent(FlexAlign.Start)
Column({space: 4}){
Image($r('app.media.wallet')).width(30)
Text(this.walletData?.bean.toString() + '(豆)').fontSize(12).fontColor('#fff')
}.width(80).onClick(() => {
router.pushUrl({
url: "pages/MyWallet"
})
})
}.width('100%').padding({left: 10,right: 10}).margin({top: 44})
.visibility(this.roleName == 'company' ? Visibility.Visible: Visibility.None)
}.width('100%').height(256).padding({left: 15,right: 15})
.linearGradient({angle: 63 ,colors: [['#1B65FD', 0], ['#6D9DFF', 0.5]]})
List(){
// 公司基本信息
ListItem(){
Column(){
Row(){
Text('基本信息').fontWeight(600).textExtend()
Row(){
Text('编辑').fontSize(12).fontColor('#999')
Image($r('app.media.right_4')).width(12).margin({left: 4})
}.onClick(() => {
router.pushUrl({
url: 'pages/EditCompanyInfo'
})
})
}.padding(10).border({width: {bottom: 2}, color: '#eee'})
.justifyContent(FlexAlign.SpaceBetween).width('100%')
Column(){
Row(){
Row(){
Image($r('app.media.username')).width(16).margin({right: 5})
Text('用户名').textExtend()
}
Text(this.companyInfo?.username).textRight()
}.width('100%').justifyContent(FlexAlign.SpaceBetween)
.border({width: {bottom: 1}, color: '#eee'})
.padding({top: 15, bottom: 15})
Row(){
Row(){
Image($r('app.media.enterprise')).width(16).margin({right: 5})
Text('企业名称').textExtend()
}
Text(this.companyInfo?.companyName).textRight()
}.width('100%').justifyContent(FlexAlign.SpaceBetween)
.border({width: {bottom: 1}, color: '#eee'})
.padding({top: 15, bottom: 15})
Row(){
Row(){
Image($r('app.media.business_license')).width(16).margin({right: 5})
Text('营业执照编号').textExtend()
}
Text(this.companyInfo?.businessLicenseNo).textRight()
}.width('100%').justifyContent(FlexAlign.SpaceBetween)
.border({width: {bottom: 1}, color: '#eee'})
.padding({top: 15, bottom: 15})
Row(){
Row(){
Image($r('app.media.idcard')).width(16).margin({right: 5})
Text('联系人').textExtend()
}
Text(this.companyInfo?.linkMan).textRight()
}.width('100%').justifyContent(FlexAlign.SpaceBetween)
.border({width: {bottom: 1}, color: '#eee'})
.padding({top: 15, bottom: 15})
Row(){
Row(){
Image($r('app.media.phone')).width(16).margin({right: 5})
Text('联系人手机号').textExtend()
}
Text(this.companyInfo?.lmTel).textRight()
}.width('100%').justifyContent(FlexAlign.SpaceBetween)
.border({width: {bottom: 1}, color: '#eee'})
.padding({top: 15, bottom: 15})
Row(){
Row(){
Image($r('app.media.email')).width(16).margin({right: 5})
Text('电子邮箱').textExtend()
}
Text(this.companyInfo?.email).textRight()
}.width('100%').justifyContent(FlexAlign.SpaceBetween)
.padding({top: 15, bottom: 15})
.border({width: {bottom: 1}, color: '#eee'})
}.padding({left: 10, right: 10})
}.width('100%').backgroundColor('#fff').borderRadius(10).clip(true)
}.visibility(this.roleName == 'company' ? Visibility.Visible: Visibility.None).margin({bottom: 10})
// 个人基本信息
ListItem(){
Column(){
Row(){
Text('基本信息').fontWeight(600).textExtend()
Row(){
Text('编辑').fontSize(12).fontColor('#999')
Image($r('app.media.right_4')).width(12).margin({left: 4})
}.onClick(() => {
router.pushUrl({
url: 'pages/EditUser'
})
})
}.padding(10).border({width: {bottom: 2}, color: '#eee'})
.justifyContent(FlexAlign.SpaceBetween).width('100%')
Column(){
Row(){
Row(){
Image($r('app.media.username')).width(16).margin({right: 5})
Text('用户名').textExtend()
}
Text(this.userInfo?.username).textRight()
}.width('100%').justifyContent(FlexAlign.SpaceBetween)
.border({width: {bottom: 1}, color: '#eee'})
.padding({top: 15, bottom: 15})
Row(){
Row(){
Image($r('app.media.idcard')).width(16).margin({right: 5})
Text('身份证号').textExtend()
}
Text(this.userInfo?.idNo).textRight()
}.width('100%').justifyContent(FlexAlign.SpaceBetween)
.border({width: {bottom: 1}, color: '#eee'})
.padding({top: 15, bottom: 15})
Row(){
Row(){
Image($r('app.media.sex')).width(16).margin({right: 5})
Text('性别').textExtend()
}
Text(this.userInfo?.gender == '0' ? '男' : '女').textRight()
}.width('100%').justifyContent(FlexAlign.SpaceBetween)
.border({width: {bottom: 1}, color: '#eee'})
.padding({top: 15, bottom: 15})
Row(){
Row(){
Image($r('app.media.phone')).width(16).margin({right: 5})
Text('手机号码').textExtend()
}
Text(this.userInfo?.phone).textRight()
}.width('100%').justifyContent(FlexAlign.SpaceBetween)
.border({width: {bottom: 1}, color: '#eee'})
.padding({top: 15, bottom: 15})
Row(){
Row(){
Image($r('app.media.email')).width(16).margin({right: 5})
Text('电子邮箱').textExtend()
}
Text(this.userInfo?.email).textRight()
}.width('100%').justifyContent(FlexAlign.SpaceBetween)
.padding({top: 15, bottom: 15})
.border({width: {bottom: 1}, color: '#eee'})
Row(){
Row(){
Image($r('app.media.brithday')).width(16).margin({right: 5})
Text('出生日期').textExtend()
}
Text(this.userInfo?.birthDate).textRight()
}.width('100%').justifyContent(FlexAlign.SpaceBetween)
.padding({top: 15, bottom: 15})
}.padding({left: 10, right: 10})
}.width('100%').backgroundColor('#fff').borderRadius(10).clip(true)
}.visibility(this.roleName == 'person' || this.roleName == 'unapprovedPerson' ? Visibility.Visible: Visibility.None).margin({bottom: 10})
// 证书信息
ListItem(){
Column(){
Row(){
Row({ space: 5 }){
Text('证书信息').fontWeight(600).textExtend()
}
Row(){
Text(this.isEdit ? '编辑' : '添加').fontSize(12).fontColor('#999')
Image($r('app.media.right_4')).width(12).margin({left: 4})
}.onClick(() => {
router.pushUrl({
url: 'pages/CertificateInfo'
})
})
}.padding(10).border({width: {bottom: 2}, color: '#eee'})
.justifyContent(FlexAlign.SpaceBetween).width('100%')
Column(){
Row(){
Row(){
Image($r('app.media.certificate_type')).width(16).margin({right: 5})
Text('证书类型').textExtend()
}
Text(`${this.personCertificateInfo?.certificateLevel}${this.personCertificateInfo?.certificateName}`).textRight()
}.width('100%').justifyContent(FlexAlign.SpaceBetween)
.border({width: {bottom: 1}, color: '#eee'})
.padding({top: 15, bottom: 15})
Row(){
Row(){
Image($r('app.media.certificate_num')).width(16).margin({right: 5})
Text('证书编号').textExtend()
}
Text(this.personCertificateInfo?.certificateNo).textRight()
}.width('100%').justifyContent(FlexAlign.SpaceBetween)
.border({width: {bottom: 1}, color: '#eee'})
.padding({top: 15, bottom: 15})
Row(){
Row(){
Image($r('app.media.date')).width(16).margin({right: 5})
Text('颁发时间').textExtend()
}
Text(this.personCertificateInfo?.issueDate).textRight()
}.width('100%').justifyContent(FlexAlign.SpaceBetween)
.padding({top: 15, bottom: 15})
}.padding({left: 10, right: 10})
}.width('100%').backgroundColor('#fff').borderRadius(10).clip(true)
}.visibility(this.roleName == 'person' || this.roleName == 'unapprovedPerson' ? Visibility.Visible: Visibility.None).margin({bottom: 10})
// 从业信息
ListItem(){
Column(){
Row(){
Text('从业信息').fontWeight(600).textExtend()
Image($r('app.media.refresh')).width(12)
.onClick(async () => {
this.loadingController.open()
let personId = preferencesUtil.get('XF_PERSON_ID', 0)
const companyInfo: AxiosResponse<companyPersonTest> = await getCompanyPersonList({pageNum: 1, pageSize: 10, personId: Number(personId)})
if(companyInfo.data.rows.length > 0) {
this.companyData = companyInfo.data.rows[0]
}
this.loadingController.close()
})
}.padding(10).border({width: {bottom: 2}, color: '#eee'})
.justifyContent(FlexAlign.Start).width('100%')
Column(){
Row(){
Row(){
Image($r('app.media.enterprise')).width(16).margin({right: 5})
Text('所属公司').textExtend()
}
Text(this.companyData?.companyName).textRight()
}.width('100%').justifyContent(FlexAlign.SpaceBetween)
.border({width: {bottom: 1}, color: '#eee'})
.padding({top: 15, bottom: 15})
Row(){
Row(){
Image($r('app.media.certificate_num')).width(16).margin({right: 5})
Text('报告豆余额').textExtend()
}
Text(`${this.walletData?.bean}`).textRight()
}.width('100%').justifyContent(FlexAlign.SpaceBetween)
.border({width: {bottom: 1}, color: '#eee'})
.padding({top: 15, bottom: 15})
Row(){
Row(){
Image($r('app.media.date')).width(16).margin({right: 5})
Text('添加时间').textExtend()
}
Text(this.companyData?.createTime).textRight()
}.width('100%').justifyContent(FlexAlign.SpaceBetween)
.border({width: {bottom: 1}, color: '#eee'})
.padding({top: 15, bottom: 15})
}.padding({left: 10, right: 10})
Row(){
Row(){
Image($r('app.media.edit')).width(16).margin({right: 5})
Text('操作').textExtend()
}
Text(getTextInfo(this.companyData?.state || '0')).width(80).height(25)
.backgroundColor(this.companyData?.state == '1' ? '#1890ff' : '#C80000')
.fontSize(14).textAlign(TextAlign.Center).fontColor('#fff').borderRadius(8)
.visibility(this.companyData?.state == '0' ? Visibility.None : Visibility.Visible)
.onClick(() => {
AlertDialog.show({
title: '提示',
message: this.companyData?.state == '2' ? `是否从${this.companyData?.companyName}离职` : `是否在${this.companyData?.companyName}就职`,
alignment: DialogAlignment.Center,
primaryButton: {
value: '取消',
action: () => {
console.info('Callback when the first button is clicked')
}
},
secondaryButton: {
enabled: true,
defaultFocus: true,
style: DialogButtonStyle.HIGHLIGHT,
value: '确认',
action: async () => {
if(this.companyData?.state == '2') {
await updateState({ relateId: this.companyData?.relateId, state: '0' })
promptAction.showToast({
message: '已成功离职',
duration: 2000
})
await loginOut()
router.replaceUrl({
url: 'pages/Login'
})
}else {
await updateState({ relateId: this.companyData?.relateId, state: '2' })
promptAction.showToast({
message: '已恢复职位,请重新登录获取新数据',
duration: 2000
})
await loginOut()
router.replaceUrl({
url: 'pages/Login'
})
}
}
}
})
})
}.width('100%').justifyContent(FlexAlign.SpaceBetween)
.padding({top: 15, bottom: 15, left: 10, right: 10})
}.width('100%').backgroundColor('#fff').borderRadius(10).clip(true)
}.visibility(this.roleName == 'person' || this.roleName == 'unapprovedPerson' ? Visibility.Visible: Visibility.None).margin({bottom: 10})
// APP信息
ListItem(){
Column(){
Row(){
Text('APP信息').fontWeight(600).textExtend()
}.padding(10).border({width: {bottom: 2}, color: '#eee'})
.justifyContent(FlexAlign.SpaceBetween).width('100%')
Column(){
Row(){
Row(){
Image($r('app.media.user_agreement')).width(16).margin({right: 5})
Text('用户协议').textExtend()
}
Image($r('app.media.right_4')).width(12).margin({left: 4})
}.width('100%').justifyContent(FlexAlign.SpaceBetween)
.border({width: {bottom: 1}, color: '#eee'})
.padding({top: 15, bottom: 15}).onClick(() => {
router.pushUrl({
url: 'pages/UserAgreement'
})
})
Row(){
Row(){
Image($r('app.media.privacy')).width(16).margin({right: 5})
Text('隐私政策').textExtend()
}
Image($r('app.media.right_4')).width(12).margin({left: 4})
}.width('100%').justifyContent(FlexAlign.SpaceBetween)
.border({width: {bottom: 1}, color: '#eee'})
.padding({top: 15, bottom: 15}).onClick(() => {
router.pushUrl({
url: 'pages/PrivacyPolicy'
})
})
Row(){
Row(){
Image($r('app.media.delete')).width(16).margin({right: 5})
Text('注销协议').textExtend()
}
Image($r('app.media.right_4')).width(12).margin({left: 4})
}.width('100%').justifyContent(FlexAlign.SpaceBetween)
.padding({top: 15, bottom: 15}).onClick(() => {
router.pushUrl({
url: 'pages/CancellationAgreement'
})
})
}.padding({left: 10, right: 10})
}.width('100%').backgroundColor('#fff').borderRadius(10).clip(true)
}.margin({bottom: 10})
// 操作按钮
ListItem(){
Column({space: 10}){
Text('修改密码').width('100%').height(50).backgroundColor('#4ECDBE').borderRadius(10)
.fontSize(16).fontColor(Color.White).fontWeight(600).textAlign(TextAlign.Center)
.onClick(() => {
this.dialogController.open()
})
Text('退出登录').width('100%').height(50).backgroundColor('#6D9DFF').borderRadius(10)
.fontSize(16).fontColor(Color.White).fontWeight(600).textAlign(TextAlign.Center)
.onClick(() => {
AlertDialog.show({
title: '提示',
message: '是否退出登录?',
autoCancel: true,
alignment: DialogAlignment.Center,
gridCount: 4,
offset: { dx: 0, dy: -20 },
buttonDirection: DialogButtonDirection.HORIZONTAL,
buttons: [
{
value: '取消',
action: () => {
console.info('Callback when button1 is clicked')
}
},
{
value: '确认',
action: async () => {
await loginOut()
router.replaceUrl({
url: 'pages/Login'
})
}
}
],
cancel: () => {
console.info('Closed callbacks')
}
})
})
Column(){
Text('http://xfapp.crgx.net').fontSize(10).fontColor('#999').lineHeight(18)
Text('非广西消防救援总队官方出品Copyright@广西世纪创软信息技术有限公司').fontSize(10).fontColor('#999').lineHeight(18)
.maxLines(2).textAlign(TextAlign.Center)
}
}
}
}.margin({left: 15, right: 15, top: 144}).borderRadius(10).scrollBar(BarState.Off).layoutWeight(1)
}.height('100%').backgroundColor('#f3f2f7').alignContent(Alignment.Top).padding({bottom: 20})
}
}
\ No newline at end of file
... ...
import { webview } from '@kit.ArkWeb'
import { HmParseHTML } from "@wuyan/html_parse"
import { InitProjectList, ItemList } from '../api/recordsType'
@Component
export default struct ProjectItem{
@Prop itemInfo: InitProjectList
webviewController: webview.WebviewController = new webview.WebviewController()
build() {
Column(){
// 头部详情
List({space: 10}){
ForEach(this.itemInfo.itemList, (item: ItemList) => {
ListItem(){
Column({space: 5}){
HmParseHTML({
htmlStr: item.itemName, // 富文本内容-必传
baseFontColor: '#000',
baseFontSize: 14
})
Column(){
Text('项目保养内容:').fontColor('#999').fontSize(12)
HmParseHTML({
htmlStr: item.maintainceContent, // 富文本内容-必传
baseFontColor: '#999',
baseFontSize: 12,
})
}.alignItems(HorizontalAlign.Start)
Row({space: 10}){
Text('部位').fontSize(14).fontWeight(700).fontColor('#000').width(100)
Text(item.position).layoutWeight(1).fontSize(12).fontColor('#999').textAlign(TextAlign.Start)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row({space: 10}){
Text('抽查数量:').fontSize(14).fontWeight(700).fontColor('#000').width(100)
Text(item.num).layoutWeight(1).fontSize(12).fontColor('#999').textAlign(TextAlign.Start)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row({space: 10}){
Text('抽查比例 (%):').fontSize(14).fontWeight(700).fontColor('#000').width(100)
Text(item.proportion).layoutWeight(1).fontSize(12).fontColor('#999').textAlign(TextAlign.Start)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Column(){
Text('实测记录').fontSize(14).fontWeight(700).fontColor('#000')
Web({
src: `data:text/html, ${item.viewTemplate.replace(new RegExp('<input', 'g'), '<input style="width: 30px;height: 30px"')}`,
controller: this.webviewController,
renderMode: RenderMode.SYNC_RENDER
}).layoutMode(WebLayoutMode.FIT_CONTENT).defaultFontSize(30)
}.alignItems(HorizontalAlign.Start)
}.alignItems(HorizontalAlign.Start)
}.backgroundColor('#fff').padding(10).borderRadius(4)
})
}.layoutWeight(1).backgroundColor('#f2f3f7')
}.height('100%').width('100%')
}
}
\ No newline at end of file
... ...
import { InitData } from '../api/recordsType'
import { getMaintenanceType } from '../api/originalRecords'
import { InitFirstPartySign } from '../api/recordsType'
import { quarterTest, quarterType } from '../api/options/optionsType'
import { AxiosResponse } from '@ohos/axios'
import { HmParseHTML } from "@wuyan/html_parse"
import baseUrl from '../utils/baseUrl'
@Component
export default struct RecordsHome {
@Prop info: InitData
// 记录类型列表
@State maintenanceTypeList: quarterType[] = []
// 获取类型
getType = (arr: quarterType[], value: string): string => {
const newValue = arr.filter((item: quarterType) => item.dictValue == value)
return newValue[0]?.dictLabel || '月度'
}
// 获取时间范围
getTimeFrame = (startTime: string | null | undefined, endTime: string | null | undefined) => {
if(startTime != null && endTime != null){
return `${startTime} 至 ${endTime}`
} else if(startTime != null) {
return startTime
} else {
return ''
}
}
// 获取签名
getSign = (index: number) => {
if(this.info.signList) {
let signList: InitFirstPartySign[] = this.info.signList
return baseUrl + signList[index]?.signPic
} else {
return ''
}
}
// 获取签名
getFirstSign = (index: number) => {
if(this.info.firstPartySign) {
let firstPartySignList: InitFirstPartySign[] = this.info.firstPartySign
return baseUrl + firstPartySignList[index]?.signPic
} else {
return ''
}
}
aboutToAppear(){
getMaintenanceType().then((res: AxiosResponse<quarterTest>) => {
this.maintenanceTypeList = res.data.data
})
}
build() {
Scroll(){
Column(){
Text(`项目编号:${this.info.reportNo}`).fontSize(12).fontColor('#000').fontWeight(700)
Text('建筑消防设施维护保养记录表').fontSize(16).fontColor('#000').fontWeight(700).width('100%').textAlign(TextAlign.Center).margin({bottom: 10, top: 10})
Text(`(${this.getType(this.maintenanceTypeList, this.info.reportType)})`).fontSize(12).fontColor('#666').padding({top: 10, bottom: 10})
.border({width: {bottom: 1},color: '#eee'})
.width('100%').textAlign(TextAlign.Center)
.margin({bottom: 10})
Row(){
Text('维保项目名称:').fontSize(12).fontColor('#999').width(120)
Text(this.info.reportName).fontSize(12).fontColor('#999')
}.padding({top: 10, bottom: 10}).border({width: {bottom: 1},color: '#eee'}).width('100%')
Row(){
Text('维护委托单位:').fontSize(12).fontColor('#999').width(120)
Text(this.info.applyCompanyName).fontSize(12).fontColor('#999')
}.padding({top: 10, bottom: 10}).border({width: {bottom: 1},color: '#eee'}).width('100%')
Row(){
Text('维护机构:').fontSize(12).fontColor('#999').width(120)
Text(this.info.companyName).fontSize(12).fontColor('#999')
}.padding({top: 10, bottom: 10}).border({width: {bottom: 1},color: '#eee'}).width('100%')
Row(){
Text('维保日期:').fontSize(12).fontColor('#999').width(120)
Text(this.getTimeFrame(this.info?.maintenanceTime, this.info?.maintenanceEndTime)).fontSize(12).fontColor('#999')
}.padding({top: 10, bottom: 10}).border({width: {bottom: 1},color: '#eee'}).width('100%')
Row(){
Text('维护保养人员签字:').fontSize(12).fontColor('#999').width(120)
Image(this.getSign(0)).width(80).height(40).margin({left: 20})
}.padding({top: 10, bottom: 10}).border({width: {bottom: 1},color: '#eee'}).width('100%')
Row(){
Column(){
Text('委托单位见证人签字:').fontSize(12).fontColor('#999').margin({bottom: 4})
Text('(签字人作为委托单位见证人对本消防原始记录表已仔细核对不存在弄虚作假,本电子签名经委托方、受委托方认可具有法律效应)').fontSize(10).fontColor('#999')
}.width(120)
Image(this.getFirstSign(0)).width(80).height(40).margin({left: 20})
}.padding({top: 10, bottom: 10}).border({width: {bottom: 1},color: '#eee'}).width('100%')
Column(){
Text('使用仪器设备及编号:').fontSize(12).fontColor('#999').margin({bottom: 4})
Text(this.info.equipment).fontSize(12).fontColor('#999')
}.padding({top: 10, bottom: 10}).border({width: {bottom: 1},color: '#eee'}).width('100%').alignItems(HorizontalAlign.Start)
Row(){
Text('综合评述:').fontSize(12).fontColor('#999')
HmParseHTML({
htmlStr: this.info?.result || '<p>无</p>',
baseFontSize: 12,
baseFontColor: '#999'
})
}.padding({top: 10, bottom: 10}).border({width: {bottom: 1},color: '#eee'}).width('100%')
Column(){
Text('注:').margin({bottom: 10}).width('100%').textAlign(TextAlign.Start).fontSize(12).fontColor('#000')
Column(){
Text('1.对发现的问题应及时处理,当场不能处置的要填报《消防设施故障处理单》。').fontSize(12).fontColor('#000')
Text('2.表中未包含的消防设施维护保养项目,消防设施维护保养单位可参考表格样式自行制定原始记录表。').fontSize(12).fontColor('#000')
Text('3.如消防技术规范有更新,消防设施维护保养单位可根据最新规范要求自行更新原始记录表。').fontSize(12).fontColor('#000')
}.padding({left: 20})
}.margin({top: 20})
}.width('100%').alignItems(HorizontalAlign.Start).justifyContent(FlexAlign.Start)
.padding({left: 10, right: 10, bottom: 30, top: 30})
}.width('100%').height('100%').scrollBar(BarState.Off).backgroundColor('#fff').borderRadius(10)
}
}
\ No newline at end of file
... ...
let getInfoColor = (index: string | undefined) => {
let colorStr: string = ''
switch (index) {
case '1': colorStr = '#909399';break;
case '2': colorStr = '#1890ff';break;
case '4': colorStr = '#ffba00';break;
case '3': colorStr = '#13ce66';break;
default : colorStr = '#909399'
}
return colorStr
}
let getInfoBgColor = (index: string | undefined) => {
let colorStr: string = ''
switch (index) {
case '1': colorStr = '#f4f4f5';break;
case '2': colorStr = '#e8f4ff';break;
case '4': colorStr = '#fff8e6';break;
case '3': colorStr = '#e7faf0';break;
default : colorStr = '#f4f4f5'
}
return colorStr
}
let getInfoBorderColor = (index: string | undefined) => {
let colorStr: string = ''
switch (index) {
case '1': colorStr = '#e9e9eb';break;
case '2': colorStr = '#d1e9ff';break;
case '4': colorStr = '#fff1cc';break;
case '3': colorStr = '#d0f5e0';break;
default : colorStr = '#f4f4f5'
}
return colorStr
}
let getStateInfoColor = (index: string | undefined) => {
let colorStr: string = ''
switch (index) {
case '4': colorStr = '#909399';break;
case '0': colorStr = '#1890ff';break;
case '5': colorStr = '#ffba00';break;
case '2': colorStr = '#ff4949';break;
case '1': colorStr = '#13ce66';break;
default : colorStr = '#909399'
}
return colorStr
}
let getStateInfoBgColor = (index: string | undefined) => {
let colorStr: string = ''
switch (index) {
case '4': colorStr = '#f4f4f5';break;
case '0': colorStr = '#e8f4ff';break;
case '5': colorStr = '#fff8e6';break;
case '2': colorStr = '#ffeded';break;
case '1': colorStr = '#e7faf0';break;
default : colorStr = '#f4f4f5'
}
return colorStr
}
let getStateInfoBorderColor = (index: string | undefined) => {
let colorStr: string = ''
switch (index) {
case '4': colorStr = '#e9e9eb';break;
case '0': colorStr = '#d1e9ff';break;
case '5': colorStr = '#fff1cc';break;
case '2': colorStr = '#ffdbdb';break;
case '1': colorStr = '#d0f5e0';break;
default : colorStr = '#f4f4f5'
}
return colorStr
}
@Component
export default struct ThemeStaticTest {
@Prop textValue: string
@Prop type: string = '0'
// 获取维保记录类型
MaintenanceType = (index: string | undefined): string => {
let str: string = ''
switch (index) {
case '1': str = '月度';break;
case '2': str = '季度';break;
case '4': str = '半年度';break;
case '3': str = '年度';break;
default : str = ''
}
return str
}
// 获取维保记录状态
MaintenanceState = (index: string | undefined): string => {
let str: string = ''
switch (index) {
case '0': str = '编辑中';break;
case '1': str = '已签发';break;
case '2': str = '已删除';break;
case '3': str = '正常(除”删除“外)';break;
case '4': str = '待维保人员签字';break;
case '5': str = '待甲方签字';break;
default : str = ''
}
return str
}
build() {
if(this.type == '0') {
Text(this.MaintenanceType(this.textValue))
.padding({left: 6, right: 6})
.borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).fontColor(getInfoColor(this.textValue))
.backgroundColor(getInfoBgColor(this.textValue)).borderColor(getInfoBorderColor(this.textValue))
} else if(this.type == '1'){
Text(this.MaintenanceState(this.textValue)).padding({left: 6, right: 6})
.borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).fontColor(getStateInfoColor(this.textValue))
.backgroundColor(getStateInfoBgColor(this.textValue)).borderColor(getStateInfoBorderColor(this.textValue))
}
}
}
\ No newline at end of file
... ...
@Extend(Text) function info () {
.fontColor('#909399').backgroundColor('#f4f4f5')
.borderColor('#e9e9eb')
}
@Extend(Text) function primary () {
.fontColor('#1890ff').backgroundColor('#e8f4ff')
.borderColor('#d1e9ff')
}
@Extend(Text) function warning () {
.fontColor('#ffba00').backgroundColor('#fff8e6')
.borderColor('#fff1cc')
}
@Extend(Text) function success () {
.fontColor('#13ce66').backgroundColor('#e7faf0')
.borderColor('#d0f5e0')
}
@Extend(Text) function danger () {
.fontColor('#ff4949').backgroundColor('#ffeded')
.borderColor('#ffdbdb')
}
@Component
export default struct ThemeTest {
@Prop theme: string
@Prop textValue: string
build() {
if(this.theme == 'info') {
Text(this.textValue).padding({left: 6, right: 6})
.borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).info()
} else if(this.theme == 'primary'){
Text(this.textValue).padding({left: 6, right: 6})
.borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).primary()
} else if(this.theme == 'warning'){
Text(this.textValue).padding({left: 6, right: 6})
.borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).warning()
} else if(this.theme == 'success'){
Text(this.textValue).padding({left: 6, right: 6})
.borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).success()
} else if(this.theme == 'danger'){
Text(this.textValue).padding({left: 6, right: 6})
.borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).danger()
}
}
}
\ No newline at end of file
... ...
import { orderRow } from '../api/recordsType'
import { quarterType } from '../api/options/optionsType'
@Extend(Text) function info () {
.fontColor('#909399').backgroundColor('#f4f4f5')
.borderColor('#e9e9eb')
}
@Extend(Text) function primary () {
.fontColor('#1890ff').backgroundColor('#e8f4ff')
.borderColor('#d1e9ff')
}
@Extend(Text) function warning () {
.fontColor('#ffba00').backgroundColor('#fff8e6')
.borderColor('#fff1cc')
}
@Extend(Text) function success () {
.fontColor('#13ce66').backgroundColor('#e7faf0')
.borderColor('#d0f5e0')
}
@Extend(Text) function danger () {
.fontColor('#ff4949').backgroundColor('#ffeded')
.borderColor('#ffdbdb')
}
interface listClassType {
listClass: string,
dictLabel: string
}
@Component
export default struct orderItem {
@Prop orderInfo: orderRow
@Prop sourceList: quarterType[]
@Prop stateList: quarterType[]
getSource = () => {
let listClassObj: listClassType = { listClass: 'info', dictLabel: '小程序' }
let sourceValue: string = this.orderInfo?.source.toString()
let newArr = this.sourceList.filter((item: quarterType) => item.dictValue == sourceValue)
return newArr[0] || listClassObj
}
getState = () => {
let listClassObj: listClassType = { listClass: 'info', dictLabel: '未支付' }
let stateValue: string = this.orderInfo.state.toString()
let newArr = this.stateList.filter((item: quarterType) => item.dictValue == stateValue)
return newArr[0] || listClassObj
}
build() {
Row(){
Column({space: 5}){
Text(`订单编号:${this.orderInfo?.orderNo}`).fontSize(14).fontColor('#000').fontWeight(600)
Row(){
Text(`套餐:${this.orderInfo?.comboName}`).fontSize(12).fontColor('#999').margin({right: 5})
if(this.getSource().listClass == 'info') {
Text(this.getSource().dictLabel).padding({left: 10, right: 10})
.borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).info()
} else if(this.getSource().listClass == 'primary'){
Text(this.getSource().dictLabel).padding({left: 10, right: 10})
.borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).primary()
} else if(this.getSource().listClass == 'warning'){
Text(this.getSource().dictLabel).padding({left: 10, right: 10})
.borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).warning()
} else if(this.getSource().listClass == 'success'){
Text(this.getSource().dictLabel).padding({left: 10, right: 10})
.borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).success()
} else if(this.getSource().listClass == 'danger'){
Text(this.getSource().dictLabel).padding({left: 10, right: 10})
.borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).danger()
}
}
Row(){
Text(`金额:${this.orderInfo?.amount}`).fontSize(12).fontColor('#999').margin({right: 5})
if(this.getState().listClass == 'info') {
Text(this.getState().dictLabel).padding({left: 10, right: 10})
.borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).info()
} else if(this.getState().listClass == 'primary'){
Text(this.getState().dictLabel).padding({left: 10, right: 10})
.borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).primary()
} else if(this.getState().listClass == 'warning'){
Text(this.getState().dictLabel).padding({left: 10, right: 10})
.borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).warning()
} else if(this.getState().listClass == 'success'){
Text(this.getState().dictLabel).padding({left: 10, right: 10})
.borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).success()
} else if(this.getState().listClass == 'danger'){
Text(this.getState().dictLabel).padding({left: 10, right: 10})
.borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).danger()
}
}
Text(`时间:${this.orderInfo?.createTime}`).fontSize(12).fontColor('#999')
}.alignItems(HorizontalAlign.Start)
Text(`+${this.orderInfo?.bean}`).fontStyle(14).fontStyle(FontStyle.Italic).fontColor('#1890ff').fontWeight(600)
}.padding({top: 20, bottom: 20, left: 10, right: 10})
.border({width: {bottom: 1}, color: '#eee'}).width('100%')
.justifyContent(FlexAlign.SpaceBetween)
}
}
\ No newline at end of file
... ...
import { companyAdd, beanType } from '../api/user'
import { addType } from '../api/userType'
import { promptAction } from '@kit.ArkUI'
import { AxiosResponse } from '@ohos/axios'
@CustomDialog
export default struct AddPersonDialog {
controller: CustomDialogController = new CustomDialogController({builder: ''})
@State addForm : addType = {
personName: '',
idNo: ''
}
build() {
Column(){
Text('添加人员').margin({top: 20})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('姓名')
}.width(90)
TextInput({placeholder: '请输入姓名', text: $$this.addForm.personName})
.backgroundColor('#fff').layoutWeight(1)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('身份证号')
}.width(90)
TextInput({placeholder: '请输入身份证号', text: $$this.addForm.idNo})
.backgroundColor('#fff').layoutWeight(1)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Text('取消').layoutWeight(1).fontSize(16).height(60).fontColor('#606266')
.textAlign(TextAlign.Center)
.onClick(() => {
this.controller.close()
})
Text('确定').layoutWeight(1).fontSize(16).height(60).fontColor('#1890ff')
.textAlign(TextAlign.Center)
.onClick(async () => {
const res: AxiosResponse<beanType> = await companyAdd(this.addForm)
promptAction.showToast({message: res.data.msg})
this.controller.close()
})
}
}.width('100%').backgroundColor('#fff')
}
}
\ No newline at end of file
... ...
import AreaPicker from '../components/AreaPicker'
@CustomDialog
export default struct AreaPickerDialog {
private dialogController: CustomDialogController //弹窗控制器
@State value: string[] = [] //选中值
//确认关闭选择改变回调
onChange: (value: string[]) => void = () => {
}
private defaultValue: string[] = []; //首次打开选中值
aboutToAppear(): void {
//记录打开时候的默认值
this.defaultValue = this.value
if (Array.isArray(this.value) && this.value.length < 3) {
this.value = ['北京市', '北京市', '东城区']; //设置默认值
}
}
build() {
Column({ space: 50 }) {
//头部确认、取消操作行
Row() {
Text('取消')
.fontColor('#909090')
.onClick(() => {
this.dialogController.close()
})
Text('请选择省市区')
Text('确定')
.fontColor('#0A7EE6')
.onClick(() => {
//和首次打开值对比
if (this.defaultValue.join('') !== this.value.join('')) {
this.onChange(this.value)
}
this.dialogController.close()
})
}
.width('100%')
.justifyContent(FlexAlign.SpaceBetween)
//地区选择器
AreaPicker({ value: this.value })
}
.backgroundColor(Color.White)
.borderRadius(24)
.padding(20)
.width('93%')
}
}
... ...
import { personCertificateRow, CertificateRow } from '../api/userType'
@CustomDialog
export default struct CertificateDialog {
controller: CustomDialogController = new CustomDialogController({builder: ''})
@State select: number = 0
@Prop certificateList: string[] = []
@Link selectValue: string
@Link personCertificateInfo: personCertificateRow
@Link certificateData: CertificateRow[]
build() {
Column({ space: 50 }) {
//头部确认、取消操作行
Row() {
Text('取消')
.fontColor('#909090')
.onClick(() => {
this.selectValue = this.certificateList[0]
this.personCertificateInfo.certificateId = this.certificateData[0].certificateId
this.controller.close()
})
Text('请选择证书类型')
Text('确定')
.fontColor('#0A7EE6')
.onClick(() => {
this.controller.close()
})
}
.width('100%')
.justifyContent(FlexAlign.SpaceBetween)
//证书选择器
TextPicker({ range: this.certificateList, selected: this.select })
.canLoop(false).divider(null)
.width('93%')
.onChange((value: string | string[], index: number | number[]) => {
this.selectValue = value as string
let newArr = this.certificateData.filter((item: CertificateRow) => item.certificateLevel + item.certificateName == value )
this.personCertificateInfo.certificateId = newArr[0]?.certificateId || 1
})
}
.backgroundColor(Color.White)
.borderRadius(24)
.padding(20)
.width('93%')
}
}
\ No newline at end of file
... ...
import { promptAction } from '@kit.ArkUI'
@CustomDialog
export default struct UserCommit{
controller: CustomDialogController = new CustomDialogController({builder: ''})
@State count: number = 3
@State rememberSelect: boolean = false
aboutToAppear(): void {
let timer = setInterval(() => {
this.count--
if(this.count <= 0){
this.count = 0
clearInterval(timer)
}
}, 1000)
}
build() {
Column({space: 10}){
Text('承诺书').fontSize(20).lineHeight(21).fontColor('#606266').fontWeight(600).margin({bottom: 20})
.margin({top: 60})
Text('为规范消防技术服务机构从业活动,保障消防技术服务质量,提高社会整体火灾防控能力,保护群众生命财产安全。本机构承诺如下:').fontSize(12).fontColor('#606266')
Column({space: 10}){
Text('一、严格遵守有关法律、法规和消防技术规范,按照消防技术服务标准开展服务活动。')
.fontSize(12).fontColor('#606266').textIndent(24)
Text('二、从业条件符合《社会消防技术服务机构管理规定》(应急部令第7号)文件要求。').fontSize(12).fontColor('#606266').textIndent(24)
Text('三、所有从业人员均取得相应的职业资格证书。').fontSize(12).fontColor('#606266').textIndent(24)
Text('四、注册消防工程师未同时在2个(含本数)以上消防技术服务机构执业,且未在其他机关、团体、企业、事业单位兼职。').fontSize(12).fontColor('#606266').textIndent(24)
Text('五、在承接业务时,明确每个项目的负责人,且由注册消防工程师担任。').fontSize(12).fontColor('#606266').textIndent(24)
Text('六、营业执照、从业人员、设备配备信息在本机构显著位置公示。').fontSize(12).fontColor('#606266').textIndent(24)
Text('七、加强消防技术服务质量管理,保证消防原始记录真实、准确、完整、规范,不出具虚假消防原始记录。').fontSize(12).fontColor('#606266').textIndent(24)
Text('八、加强从业人员职业道德教育,开展职业技能培训,自觉提升消防技术服务水平。').fontSize(12).fontColor('#606266').textIndent(24)
Text('九、上传至该系统的材料均属实。').fontSize(12).fontColor('#606266').textIndent(24)
Text('本机构自觉接受有关部门的监督管理,严格遵守本承诺,\n' +
'如有违反,愿意承担相应的法律责任。')
.textIndent(24).fontSize(12).fontColor('#606266')
}.alignItems(HorizontalAlign.Start)
Row({space: 5}){
Checkbox({ group: 'password' })
.select(this.rememberSelect)
.selectedColor('#1890ff')
.shape(CheckBoxShape.ROUNDED_SQUARE)
.width(16).height(16)
.mark({
size: 10,
strokeWidth: 5
})
.onChange((value: boolean) => {
this.rememberSelect = value
})
Text('我已阅读《承诺书》,并严格按照承诺书《承诺书》内容执行').fontSize(12).fontColor('#606266')
}.width('100%').justifyContent(FlexAlign.Start)
Text(`请仔细阅读承诺书(${this.count}s后可关闭)`)
.fontSize(14).fontColor('#fff').fontWeight(600).textAlign(TextAlign.Center)
.margin({top: 60}).width('100%').border({width: {top: 1}, color: '#fff'}).padding({top: 10, bottom: 10})
.visibility(this.count > 0 ? Visibility.Visible : Visibility.None).backgroundColor('#1890ff')
.borderRadius(10).opacity(0.5)
Text('前往注册')
.fontSize(14).fontColor('#fff').fontWeight(600).textAlign(TextAlign.Center)
.margin({top: 60}).width('100%').border({width: {top: 1}, color: '#fff'}).padding({top: 10, bottom: 10})
.visibility(this.count == 0 ? Visibility.Visible : Visibility.None).backgroundColor('#1890ff')
.borderRadius(10)
.onClick(() => {
if(!this.rememberSelect){
return promptAction.showToast({message: '请选勾选同意承诺书'})
}
this.controller.close()
})
}.backgroundColor('#fff').width('100%').padding(10).borderRadius(10).height('100%')
}
}
\ No newline at end of file
... ...
import { noticeRow } from '../api/notice'
import { HmParseHTML } from "@wuyan/html_parse"
@CustomDialog
export default struct DialogTip{
controller: CustomDialogController = new CustomDialogController({builder: ''})
cancel: Function = () => {}
confirm: Function = () => {}
@Prop noticeDetail: noticeRow
@State count: number = 5
aboutToAppear(): void {
let timer = setInterval(() => {
this.count--
if(this.count <= 0){
this.count = 0
clearInterval(timer)
}
}, 1000)
}
build() {
Column({space: 10}){
Text('- 温馨提示 -').fontSize(16).lineHeight(21).fontColor('#fff').fontWeight(600).margin({bottom: 20})
HmParseHTML({
htmlStr: this.noticeDetail?.noticeContent || '', // 富文本内容-必传
baseFontColor: '#fff',
baseFontSize: 14
})
Text(`我已知晓(${this.count}s后可关闭)`)
.fontSize(16).lineHeight(21).fontColor('#1890ff').fontWeight(600).textAlign(TextAlign.Center)
.margin({top: 60}).width('100%').border({width: {top: 1}, color: '#fff'}).padding({top: 20, bottom: 20})
.visibility(this.count > 0 ? Visibility.Visible : Visibility.None)
Text('我已知晓')
.fontSize(16).lineHeight(21).fontColor('#1890ff').fontWeight(600).textAlign(TextAlign.Center)
.margin({top: 60}).width('100%').border({width: {top: 1}, color: '#fff'}).padding({top: 20, bottom: 20})
.visibility(this.count == 0 ? Visibility.Visible : Visibility.None)
.onClick(() => {
this.confirm()
this.controller.close()
})
}.backgroundImage($r('app.media.login_back'))
.backgroundImageSize({width: '100%'}).width('100%')
.backgroundImagePosition(Alignment.Center)
.padding({top: 20,left: 13, right: 13})
}
}
\ No newline at end of file
... ...
import { getRecordsList } from '../api/originalRecords'
import { quarterType } from '../api/options/optionsType'
import { QueryParams, RecordsList, Row } from '../api/recordsType'
import { AxiosResponse } from '@ohos/axios'
import preferencesUtil from '../utils/preferences'
@CustomDialog
export default struct FilterDialog {
controller: CustomDialogController = new CustomDialogController({builder: ''})
cancel: Function = () => {}
confirm: Function = () => {}
@Prop typeLists: quarterType[]
@Prop statusLists: quarterType[]
@Link recordsList: Row[]
@Link params: QueryParams
@Link totalAll: number
build() {
Column({space: 10}){
Row(){
Row({space: 10}){
Text().width(3).height(20).backgroundColor('#6D9DFF')
Text('筛选条件').fontSize(14)
}
Image($r('app.media.close')).width(20).onClick(() => this.controller.close())
}.width('100%').justifyContent(FlexAlign.SpaceBetween).margin({bottom: 20})
Column({space: 10}){
Text('消防设施使用管理单位')
TextInput({text: $$this.params.applyCompanyName,placeholder: '请输入管理单位名称'}).backgroundColor('#fff')
.border({width: {bottom: 1}, color: '#eee'}).borderRadius(0)
}.alignItems(HorizontalAlign.Start)
Column({space: 10}){
Text('记录编号')
TextInput({text: $$this.params.reportNo, placeholder: '请输入记录编号'}).backgroundColor('#fff')
.border({width: {bottom: 1}, color: '#eee'}).borderRadius(0)
}.alignItems(HorizontalAlign.Start)
Column({space: 10}){
Text('记录类型')
Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Start, alignItems: ItemAlign.Start, wrap: FlexWrap.Wrap }) {
ForEach(this.typeLists, (item: quarterType) => {
Row() {
Radio({ value: item.dictValue, group: 'radioGroup' })
.radioStyle({ checkedBackgroundColor: '#1890ff' })
.height(15)
.width(15)
.onChange(() => {
this.params.reportType = item.dictValue
})
Text(item.dictLabel)
}.margin({right: 5,bottom: 5})
})
}
}.alignItems(HorizontalAlign.Start)
Column({space: 10}){
Text('状态')
Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Start, alignItems: ItemAlign.Start, wrap: FlexWrap.Wrap }) {
ForEach(this.statusLists, (item: quarterType) => {
Row() {
Radio({ value: item.dictValue, group: 'radioGroup2' })
.radioStyle({ checkedBackgroundColor: '#1890ff' })
.height(15)
.width(15)
.onChange(() => {
this.params.stateQuery = item.dictValue
console.log(JSON.stringify(this.params))
})
Text(item.dictLabel)
}.margin({right: 5,bottom: 5})
})
}
}.alignItems(HorizontalAlign.Start)
Row(){
Text('开始日期')
Text(this.params.beginMaintenanceTime || '选择开始日期').padding({top: 8, bottom: 8, left: 16, right: 16})
.backgroundColor('#fff').layoutWeight(1).fontColor('#999').onClick(() => {
CalendarPickerDialog.show({
onAccept: (value) => {
this.params.beginMaintenanceTime = JSON.stringify(value).slice(1, 11)
}
})
})
}
Row(){
Text('结束日期')
Text(this.params.endMaintenanceTime || '选择结束日期').padding({top: 8, bottom: 8, left: 16, right: 16})
.backgroundColor('#fff').layoutWeight(1).fontColor('#999').onClick(() => {
CalendarPickerDialog.show({
onAccept: (value) => {
this.params.endMaintenanceTime = JSON.stringify(value).slice(1, 11)
}
})
})
}
Row({space: 20}){
Button('搜索').layoutWeight(1).onClick(() => {
getRecordsList(this.params).then((res: AxiosResponse<RecordsList>) => {
this.recordsList = res.data.rows
this.totalAll = res.data.total
this.controller.close()
})
})
Button('重置').layoutWeight(1).backgroundColor('#fff').fontColor('#666')
.borderColor('#eee').borderWidth(1)
.onClick(() => {
this.params = {
pageSize: 10,
pageNum: 1,
stateQuery: '3'
}
const companyId: number = preferencesUtil.get('XF_COMPANY_ID', 0) as number
const personId: number = preferencesUtil.get('XF_PERSON_ID', 0) as number
this.params.companyId = companyId
this.params.technicalDirectorId = personId
getRecordsList(this.params).then((res: AxiosResponse<RecordsList>) => {
this.recordsList = res.data.rows
this.totalAll = res.data.total
this.controller.close()
})
})
}.margin({top: 20})
}.width('100%').alignItems(HorizontalAlign.Start).padding(20)
}
}
\ No newline at end of file
... ...
import { quarterType } from '../api/options/optionsType'
import { orderParams } from '../api/recordsType'
import preferencesUtils from '../utils/preferences'
let companyId = preferencesUtils.get('XF_COMPANY_ID', '') as number
@CustomDialog
export default struct FilterOrderDialog {
controller: CustomDialogController = new CustomDialogController({builder: ''})
reset: () => void = () => {}
confirm: () => void = () => {}
@Link params: orderParams
@Prop sourceList: quarterType[]
@Prop stateList: quarterType[]
build() {
Column({space: 10}){
Row(){
Row({space: 10}){
Text().width(3).height(20).backgroundColor('#6D9DFF')
Text('筛选条件').fontSize(14)
}
Image($r('app.media.close')).width(20).onClick(() => this.controller.close())
}.width('100%').justifyContent(FlexAlign.SpaceBetween).margin({bottom: 20})
Column({space: 10}){
Text('订单编号')
TextInput({text: $$this.params.orderNo ,placeholder: '请输入订单编号'}).backgroundColor('#fff')
.border({width: {bottom: 1}, color: '#eee'}).borderRadius(0)
}.alignItems(HorizontalAlign.Start)
Column({space: 10}){
Text('金额')
TextInput({text: $$this.params.amount, placeholder: '请输入金额'}).backgroundColor('#fff')
.border({width: {bottom: 1}, color: '#eee'}).borderRadius(0).type(InputType.Number)
}.alignItems(HorizontalAlign.Start)
Column({space: 10}){
Text('套餐')
TextInput({text: $$this.params.comboName,placeholder: '请输入套餐'}).backgroundColor('#fff')
.border({width: {bottom: 1}, color: '#eee'}).borderRadius(0)
}.alignItems(HorizontalAlign.Start)
Column({space: 10}){
Text('公司')
TextInput({text: $$this.params.companyName,placeholder: '请输入公司名称'}).backgroundColor('#fff')
.border({width: {bottom: 1}, color: '#eee'}).borderRadius(0)
}.alignItems(HorizontalAlign.Start)
Column({space: 10}){
Text('状态')
Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Start, alignItems: ItemAlign.Start, wrap: FlexWrap.Wrap }) {
ForEach(this.stateList, (item: quarterType) => {
Row() {
Radio({ value: item.dictValue, group: 'radioGroup' })
.radioStyle({ checkedBackgroundColor: '#1890ff' })
.height(15)
.width(15)
.onChange(() => {
this.params.state = item.dictValue
})
Text(item.dictLabel)
}.margin({right: 5,bottom: 5})
})
}
}.alignItems(HorizontalAlign.Start)
Column({space: 10}){
Text('支付来源')
Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Start, alignItems: ItemAlign.Start, wrap: FlexWrap.Wrap }) {
ForEach(this.sourceList, (item: quarterType) => {
Row() {
Radio({ value: item.dictValue, group: 'radioGroup2' })
.radioStyle({ checkedBackgroundColor: '#1890ff' })
.height(15)
.width(15)
.onChange(() => {
this.params.source = item.dictValue
})
Text(item.dictLabel)
}.margin({right: 5,bottom: 5})
})
}
}.alignItems(HorizontalAlign.Start)
Row({space: 20}){
Button('搜索').layoutWeight(1).onClick(() => {
this.confirm()
this.controller.close()
console.log(JSON.stringify(this.params))
})
Button('重置').layoutWeight(1).backgroundColor('#fff').fontColor('#666')
.borderColor('#eee').borderWidth(1)
.onClick(() => {
this.params = {
pageNum: 1,
pageSize: 10,
companyId: companyId
}
this.reset()
this.controller.close()
})
}.margin({top: 20})
}.width('100%').alignItems(HorizontalAlign.Start).padding(20).backgroundColor('#fff')
}
}
\ No newline at end of file
... ...
import { recordParams } from '../api/recordsType'
import preferencesUtils from '../utils/preferences'
let companyId = preferencesUtils.get('XF_COMPANY_ID', '') as number
@CustomDialog
export default struct FilterRecordDialog {
controller: CustomDialogController = new CustomDialogController({builder: ''})
reset: () => void = () => {}
confirm: () => void = () => {}
@Link recordParams: recordParams
build() {
Column({space: 10}){
Row(){
Row({space: 10}){
Text().width(3).height(20).backgroundColor('#6D9DFF')
Text('筛选条件').fontSize(14)
}
Image($r('app.media.close')).width(20).onClick(() => this.controller.close())
}.width('100%').justifyContent(FlexAlign.SpaceBetween).margin({bottom: 20})
Column({space: 10}){
Text('原始记录名称')
TextInput({text: $$this.recordParams.reportName ,placeholder: '请输入原始记录名称'}).backgroundColor('#fff')
.border({width: {bottom: 1}, color: '#eee'}).borderRadius(0)
}.alignItems(HorizontalAlign.Start)
Column({space: 10}){
Text('公司')
TextInput({text: $$this.recordParams.companyName, placeholder: '请输入公司名称'}).backgroundColor('#fff')
.border({width: {bottom: 1}, color: '#eee'}).borderRadius(0)
}.alignItems(HorizontalAlign.Start)
Column({space: 10}){
Text('创建用户')
TextInput({text: $$this.recordParams.createUserId, placeholder: '请输入创建用户'}).backgroundColor('#fff')
.border({width: {bottom: 1}, color: '#eee'}).borderRadius(0)
}.alignItems(HorizontalAlign.Start)
Row({space: 20}){
Button('搜索').layoutWeight(1).onClick(() => {
this.confirm()
this.controller.close()
})
Button('重置').layoutWeight(1).backgroundColor('#fff').fontColor('#666')
.borderColor('#eee').borderWidth(1)
.onClick(() => {
this.recordParams = {
pageNum: 1,
pageSize: 10,
companyId: companyId
}
this.reset()
this.controller.close()
})
}.margin({top: 20})
}.width('100%').alignItems(HorizontalAlign.Start).padding(20).backgroundColor('#fff')
}
}
\ No newline at end of file
... ...
import { Row, QueryParams, RecordsList } from '../api/recordsType'
import { getRecordsList, importRecord } from '../api/originalRecords'
import { AxiosResponse } from '@ohos/axios'
import preferencesUtil from '../utils/preferences'
import { promptAction } from '@kit.ArkUI'
let companyId: number = preferencesUtil.get('XF_COMPANY_ID', 0) as number
@CustomDialog
export default struct ImportRecordsDialog{
controller: CustomDialogController = new CustomDialogController({builder: ''})
//回调函数
onChange: () => void = () => {}
@Prop applyCompanyName: string
@Prop reportId: number
@State recordsList: Row[] = []
@State searchValue: string = ''
async aboutToAppear() {
let params: QueryParams = {
pageNum: 1,
pageSize: 20,
applyCompanyName: this.applyCompanyName,
companyId: companyId
}
const result: AxiosResponse<RecordsList> = await getRecordsList(params)
this.recordsList = result.data.rows
}
build() {
Column(){
Row(){
Search({ value: $$this.searchValue, placeholder: '请输入【记录编号】' })
.searchButton('搜索', {
fontSize: 12
})
.width('95%')
.height(30)
.backgroundColor('#fff')
.placeholderColor(Color.Grey)
.placeholderFont({ size: 12, weight: 400 })
.textFont({ size: 12, weight: 400 })
.layoutWeight(1)
.onSubmit(async () => {
this.recordsList = []
let params: QueryParams = {
pageNum: 1,
pageSize: 10,
applyCompanyName: this.applyCompanyName,
companyId: companyId,
reportType: '1',
reportNo: this.searchValue
}
const result: AxiosResponse<RecordsList> = await getRecordsList(params)
this.recordsList = result.data.rows
})
}.padding({left: 5, right: 5}).borderRadius(10)
List({space: 10}){
ForEach(this.recordsList, (item: Row) => {
ListItem(){
Row({space: 10}){
Column({space: 10}){
Row(){
Image($r('app.media.project')).width(16).margin({right: 10})
Text(item.reportName).fontSize(12).fontColor('#333').maxLines(2)
.textOverflow({overflow: TextOverflow.Ellipsis})
}
Row(){
Image($r('app.media.company')).width(16).margin({right: 10})
Text(item.applyCompanyName).fontSize(12).fontColor('#999')
}
Row(){
Image($r('app.media.numberNo')).width(16).margin({right: 10})
Text(item.reportNo).fontSize(12).fontColor('#999')
}
Row(){
Image($r('app.media.dateTime')).width(16).margin({right: 10})
Text(`${item.maintenanceTime}~${item.maintenanceEndTime || ''}`).fontSize(12).fontColor('#999')
}
}.alignItems(HorizontalAlign.Start).layoutWeight(1)
Text('导入').fontSize(14).fontColor('#1890ff')
.onClick(() => {
AlertDialog.show({
title: '',
message: '删除后无法找回,确认删除全部故障处理记录并提交?',
autoCancel: true,
alignment: DialogAlignment.Center,
gridCount: 4,
offset: { dx: 0, dy: -20 },
buttonDirection: DialogButtonDirection.HORIZONTAL,
buttons: [
{
value: '取消',
action: () => {
console.info('Callback when button1 is clicked')
}
},
{
value: '确认',
action: async () => {
await importRecord(item.reportId,this.reportId)
this.onChange()
this.controller.close()
promptAction.showToast({message: '更新成功'})
}
}
],
cancel: () => {
console.info('Closed callbacks')
}
})
})
}.borderRadius(10).padding(10).backgroundColor('#fff').width('100%')
}
})
}.padding({top: 10, bottom: 20, left: 10, right: 10})
}.constraintSize({maxHeight: '60%'}).backgroundColor('#f2f3f7')
}
}
\ No newline at end of file
... ...
@CustomDialog
export default struct LoadingDialog{
controller: CustomDialogController = new CustomDialogController({builder: ''})
build() {
Column({space: 10}){
LoadingProgress().height(32).color(Color.White)
Text("加载中...").fontSize(16).margin({ left: 20 }).fontColor('#fff')
}
}
}
\ No newline at end of file
... ...
@CustomDialog
export default struct PhotoBrowser {
controller: CustomDialogController = new CustomDialogController({builder: ''})
@State count: number = 0
@Prop imagesList: ResourceStr[] | string[] = []
build() {
Swiper(){
ForEach(this.imagesList, (str: string | ResourceStr, index)=>{
Image(str)
.width('100%')
.height('100%')
.objectFit(ImageFit.Auto)
})
}
.index(this.count)
.loop(false)
.backgroundColor(Color.Black)
.indicator(
new DotIndicator().color(Color.White)
)
.width('100%')
.height('100%')
.onClick(()=>{
this.controller.close()
})
}
}
\ No newline at end of file
... ...
import { router } from '@kit.ArkUI'
@Extend(Text) function textCommon () {
.width('100%').height(60)
.textAlign(TextAlign.Center)
.backgroundColor('#fff')
}
@CustomDialog
export default struct SelectRegDialog{
controller: CustomDialogController = new CustomDialogController({builder: ''})
build() {
Column(){
Text('请选择注册类型').textCommon().fontSize(12).fontColor('#999')
.border({width: {bottom: 1}, color: '#eee'})
Text('个人用户').textCommon().fontSize(14).fontColor('#000')
.border({width: {bottom: 1}, color: '#eee'})
.onClick(() => {
this.controller.close()
router.pushUrl({
url: 'pages/UserRegister'
})
})
Text('维保机构').textCommon().fontSize(14).fontColor('#000')
.margin({bottom: 10})
.onClick(() => {
this.controller.close()
router.pushUrl({
url: 'pages/Register'
})
})
Text('取消').textCommon().fontSize(14).fontColor('#000')
.onClick(() => {
this.controller.close()
})
}.backgroundColor('#f2f3f7').width('100%')
}
}
\ No newline at end of file
... ...
import AreaPicker from '../components/AreaPicker'
@CustomDialog
export default struct AreaPickerDialog {
private dialogController: CustomDialogController //弹窗控制器
@State value: string[] = [] //选中值
//确认关闭选择改变回调
private onChange: (value: string[]) => void = () => {
}
private defaultValue: string[] = []; //首次打开选中值
aboutToAppear(): void {
//记录打开时候的默认值
this.defaultValue = this.value
if (Array.isArray(this.value) && this.value.length < 3) {
this.value = ['月度']; //设置默认值
}
}
build() {
Column({ space: 50 }) {
//头部确认、取消操作行
Row() {
Text('取消')
.fontColor('#909090')
.onClick(() => {
this.dialogController.close()
})
Text('请选择记录类型')
Text('确定')
.fontColor('#0A7EE6')
.onClick(() => {
//和首次打开值对比
if (this.defaultValue.join('') !== this.value.join('')) {
this.onChange(this.value)
}
this.dialogController.close()
})
}
.width('100%')
.justifyContent(FlexAlign.SpaceBetween)
//地区选择器
AreaPicker({ value: this.value })
}
.backgroundColor(Color.White)
.borderRadius(24)
.padding(20)
.width('93%')
}
}
... ...
@CustomDialog
export default struct DialogTip{
controller: CustomDialogController = new CustomDialogController({builder: ''})
cancel: Function = () => {}
confirm: Function = () => {}
build() {
Column({space: 10}){
Text('上传视频/图片提示').fontSize(16).lineHeight(21).fontColor('#fff').fontWeight(600).margin({bottom: 20})
Text('已上传视频/图片会为你保留15个自然日,请及时下载并上传到正式报告系统中。').fontSize(16).fontColor('#fff')
Text('我已知晓')
.fontSize(16).lineHeight(21).fontColor('#fff').fontWeight(600).textAlign(TextAlign.Center)
.width('100%').padding({top: 20, bottom: 20})
.onClick(() => {
this.controller.close()
AppStorage.setOrCreate('isShowTip', true)
})
}.backgroundImage($r('app.media.login_back'))
.backgroundImageSize({width: '100%'}).width('100%')
.backgroundImagePosition(Alignment.Center)
.padding({top: 20,left: 13, right: 13})
}
}
\ No newline at end of file
... ...
import { promptAction } from '@kit.ArkUI'
@CustomDialog
export default struct UserCommit{
controller: CustomDialogController = new CustomDialogController({builder: ''})
@State count: number = 3
@State rememberSelect: boolean = false
aboutToAppear(): void {
let timer = setInterval(() => {
this.count--
if(this.count <= 0){
this.count = 0
clearInterval(timer)
}
}, 1000)
}
build() {
Column({space: 10}){
Text('承诺书').fontSize(20).lineHeight(21).fontColor('#606266').fontWeight(600).margin({bottom: 20})
.margin({top: 60})
Text('本人承诺在本系统中自主录入的所有信息真实有效,并将按照相关法律法规的要求,及时、准确录入后续变更信息。').fontSize(12).fontColor('#606266').textIndent(24)
Text('本人承诺严格遵守相关法律法规和标准规范,并按照客观独立、合法公正、诚实信用的原则,从事消防设施维护保养检测和消防安全评估等消防技术服务活动,并在本系统录入消防技术服务项目原始记录情况。')
.fontSize(12).fontColor('#606266').textIndent(24)
Text('本人承诺主动接受并配合消防救援机构和其他行政主管部门的监督管理。以上承诺如不属实,或者违反上述承诺的,本人依法依规承担相应的法律责任。')
.textIndent(24).fontSize(12).fontColor('#606266')
Row({space: 5}){
Checkbox({ group: 'password' })
.select(this.rememberSelect)
.selectedColor('#1890ff')
.shape(CheckBoxShape.ROUNDED_SQUARE)
.width(16).height(16)
.mark({
size: 10,
strokeWidth: 5
})
.onChange((value: boolean) => {
this.rememberSelect = value
})
Text('我已阅读《承诺书》,并严格按照承诺书《承诺书》内容执行').fontSize(12).fontColor('#606266')
}.width('100%').justifyContent(FlexAlign.Start)
Text(`请仔细阅读承诺书(${this.count}s后可关闭)`)
.fontSize(14).fontColor('#fff').fontWeight(600).textAlign(TextAlign.Center)
.margin({top: 60}).width('100%').border({width: {top: 1}, color: '#fff'}).padding({top: 10, bottom: 10})
.visibility(this.count > 0 ? Visibility.Visible : Visibility.None).backgroundColor('#1890ff')
.borderRadius(10).opacity(0.5)
Text('前往注册')
.fontSize(14).fontColor('#fff').fontWeight(600).textAlign(TextAlign.Center)
.margin({top: 60}).width('100%').border({width: {top: 1}, color: '#fff'}).padding({top: 10, bottom: 10})
.visibility(this.count == 0 ? Visibility.Visible : Visibility.None).backgroundColor('#1890ff')
.borderRadius(10)
.onClick(() => {
if(!this.rememberSelect){
return promptAction.showToast({message: '请选勾选同意承诺书'})
}
this.controller.close()
})
}.backgroundColor('#fff').width('100%').padding(10).borderRadius(10).height('100%')
}
}
\ No newline at end of file
... ...
import { promptAction } from '@kit.ArkUI'
import { updatePassword } from '../api/user'
@CustomDialog
export default struct updatePasswordDialog{
controller: CustomDialogController = new CustomDialogController({builder: ''})
@State oldPassword: string = ''
@State newPassword: string = ''
@State requirePassword: string = ''
build() {
Column(){
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('旧密码')
}.width(90)
TextInput({placeholder: '请输入旧密码', text: $$this.oldPassword})
.backgroundColor('#fff').layoutWeight(1).type(InputType.Password)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('新密码')
}.width(90)
TextInput({placeholder: '请输入新密码', text: $$this.newPassword})
.backgroundColor('#fff').layoutWeight(1).type(InputType.Password)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('确认密码')
}.width(90)
TextInput({placeholder: '请确认密码', text: $$this.requirePassword})
.backgroundColor('#fff').layoutWeight(1).type(InputType.Password)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row({space: 10}){
Text('取消').layoutWeight(1).textAlign(TextAlign.Center).onClick(() => {
this.controller.close()
})
Text('确认').layoutWeight(1).fontColor('#1890ff').textAlign(TextAlign.Center)
.onClick(async () => {
if(this.oldPassword == '' && this.newPassword == '' && this.requirePassword == '') {
promptAction.showToast({
message: '请正确填写内容',
duration: 2000
})
} else if(this.newPassword == this.oldPassword) {
promptAction.showToast({
message: '新密码和旧密码不能相同',
duration: 2000
})
} else if(this.newPassword !== this.requirePassword) {
promptAction.showToast({
message: '两次密码输入不同',
duration: 2000
})
} else {
await updatePassword(this.oldPassword, this.newPassword)
promptAction.showToast({
message: '修改成功',
duration: 2000
})
this.controller.close()
}
})
}.width('100%').padding({top: 10, bottom: 10})
}.backgroundColor('#fff').width('100%')
.padding({top: 20,left: 13, right: 13})
}
}
\ No newline at end of file
... ...
import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit';
import { hilog } from '@kit.PerformanceAnalysisKit';
import { window } from '@kit.ArkUI';
export default class EntryAbility extends UIAbility {
onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate');
}
onDestroy(): void {
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy');
}
onWindowStageCreate(windowStage: window.WindowStage): void {
// Main window is created, set main page for this ability
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate');
windowStage.loadContent('pages/Login', (err) => {
if (err.code) {
hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
return;
}
hilog.info(0x0000, 'testTag', 'Succeeded in loading the content.');
});
}
onWindowStageDestroy(): void {
// Main window is destroyed, release UI related resources
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy');
}
onForeground(): void {
// Ability has brought to foreground
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground');
}
onBackground(): void {
// Ability has back to background
hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground');
}
}
... ...
import { hilog } from '@kit.PerformanceAnalysisKit';
import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit';
export default class EntryBackupAbility extends BackupExtensionAbility {
async onBackup() {
hilog.info(0x0000, 'testTag', 'onBackup ok');
}
async onRestore(bundleVersion: BundleVersion) {
hilog.info(0x0000, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion));
}
}
\ No newline at end of file
... ...
import {
addParamsType,
LatestProjectTest,
LatestProjectDatum,
equipmentTest,
equipmentType,
companyPersonTest,
companyPersonRow,
reportDetailTest,
reportDetailData,
projectType,
RecordsList
} from '../api/recordsType'
import { quarterType, quarterTest } from '../api/options/optionsType'
import { getMaintenanceType, getLatestProjectList, getEquipmentList, addRecords, getCompanyPersonList, getReportDetail, updateRecords, getRecordsList } from '../api/originalRecords'
import { AxiosResponse } from '@ohos/axios'
import preferencesUtil from '../utils/preferences'
import { router, promptAction } from '@kit.ArkUI'
interface routerParams {
reportId: number
}
let params = router.getParams() as routerParams
let reportId: number | undefined = params?.reportId
// 查看原始记录编号是否存在
let queryReportNo = async (reportNo: string) => {
let res: AxiosResponse<RecordsList> = await getRecordsList({pageNum: 1, pageSize: 10, reportNo})
return res.data.total > 0
}
// 模糊查询
//模糊查询1:利用字符串的indexOf方法
function searchByIndexOf(keyWord: string, list: equipmentType[]){
if(!(list instanceof Array)){
return ;
}
let len = list.length;
let arr: equipmentType[] = []
for(let i = 0;i < len;i++){
//如果字符串中不包含目标字符会返回-1
if(list[i].equipmentName.indexOf(keyWord) >= 0){
arr.push(list[i]);
}
}
return arr;
}
@Entry
@Component
struct EditUser {
@Builder indicatorBuilder(icon: ResourceStr) {
Image(icon)
}
searchController: SearchController = new SearchController()
// 添加维保记录类型参数
@State addForm: addParamsType = {
reportName: '',
reportNo: '',
approvePerson: '',
approvePersonId: 0,
applyCompanyId: null,
applyCompanyName: '',
fireFacilities: '',
result: '',
equipment: '',
maintenancePeople: '',
maintenanceTime: '起始日期',
state: '',
reportType: '1',
reportTime: '',
maintenanceEndTime: '结束日期',
projectList: [],
equipmentList: [],
maintenancePeopleList: [],
technicalDirectorId: ''
}
personId = preferencesUtil.get('XF_PERSON_ID', 0)
// 回显数据使用
@State viewEquipmentList: string[] = []
@State fireFacilitiesList: string[] = []
@State PeopleList: string[] = []
@State isEdit: boolean = false
// 公司在职人员列表
@State companyPersonList: companyPersonRow[] = []
// 选择维保记录类型
@State recordsType: quarterType[] = []
// 主要消防措施选择列表
@State latestProjectList: LatestProjectDatum[] = []
// 仪器设备选择列表
@State equipmentList: equipmentType[] = []
// 初始设备列表
@State initEquipmentList: equipmentType[] = []
@State errorMsg: string = ''
flag: boolean = true
async aboutToAppear() {
this.isEdit = reportId !== undefined
if(reportId){
this.addForm.reportId = reportId
const res: AxiosResponse<reportDetailTest> = await getReportDetail(reportId)
let result: reportDetailData = res.data.data
this.addForm.reportName = result.reportName
this.addForm.applyCompanyName = result.applyCompanyName
this.addForm.reportNo = result.reportNo
this.addForm.reportType = result.reportType
this.addForm.maintenanceTime = result.maintenanceTime
this.addForm.maintenanceEndTime = result.maintenanceEndTime
this.addForm.equipmentList = result.equipment.split(',')
this.addForm.fireFacilities = result.fireFacilities
this.addForm.maintenancePeople = result.maintenancePeople
this.addForm.result = result.result.replace(/<.*?>/g, '')
this.addForm.state = result.state
this.addForm.technicalDirectorId = result.technicalDirectorId
this.addForm.maintenancePeopleList = result.technicalDirectorId?.split(',')
this.addForm.projectList = result.projectList.map(item => {
return { projectId: item.projectId } as projectType
})
this.fireFacilitiesList = this.addForm.fireFacilities.split('、')
this.viewEquipmentList = result.equipment.split(',')
this.PeopleList = result.technicalDirectorId?.split(',') || []
}
getMaintenanceType().then((res: AxiosResponse<quarterTest>) => {
this.recordsType = res.data.data
})
// 获取消防设施
getLatestProjectList(this.addForm.reportType as string).then((res: AxiosResponse<LatestProjectTest>) => {
this.latestProjectList = res.data.data
})
const companyId: number = preferencesUtil.get('XF_COMPANY_ID', 0) as number
this.addForm.companyId = companyId
// 获取仪器设备
getEquipmentList({pageNum: 1, pageSize: 500, companyId: companyId }).then((res: AxiosResponse<equipmentTest>) => {
this.equipmentList = res.data.rows
this.initEquipmentList = res.data.rows
})
getCompanyPersonList({pageNum: 1, pageSize: 200, companyId: companyId, state: '2' }).then((res: AxiosResponse<companyPersonTest>) => {
this.companyPersonList = res.data.rows
})
}
@State changeValue: string = '';
@State text: string = "请选择维保记录类型"
@State index: number = 2
@State space: number = 8
@State arrowPosition: ArrowPosition = ArrowPosition.END
build() {
Column(){
Scroll(){
Column(){
Column(){
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('项目名称')
}.width(90)
TextInput({placeholder: '请输入项目名称', text: $$this.addForm.reportName})
.backgroundColor('#fff').layoutWeight(1)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Text('原始记录编号一经创建,不可修改,请谨慎').fontSize(12).fontColor('#ffba00').width('100%').textAlign(TextAlign.Start)
.padding({top: 10, left: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('项目编号')
}.width(90)
Row({ space: 5 }){
TextInput({placeholder: '请输入项目编号', text: $$this.addForm.reportNo})
.backgroundColor('#fff').showError(this.errorMsg).onBlur(async () => {
this.errorMsg = await queryReportNo(this.addForm.reportNo as string) ? '此原始记录编号已被使用' : ''
})
}.layoutWeight(1)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
.visibility(this.isEdit ? Visibility.None : Visibility.Visible)
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('项目编号')
}.width(90)
Row({ space: 5 }){
Text(this.addForm.reportNo).fontColor('#c0c4cc')
.fontSize(16).padding({top: 8, bottom: 8, left: 16, right: 16})
}.layoutWeight(1)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
.visibility(this.isEdit ? Visibility.Visible : Visibility.None)
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('维保起始日期')
}.width(120)
Text(this.addForm.maintenanceTime).padding({top: 8, bottom: 8, left: 16, right: 16})
.backgroundColor('#fff').layoutWeight(1).fontColor('#000').onClick(() => {
CalendarPickerDialog.show({
onAccept: (value) => {
this.addForm.maintenanceTime = JSON.stringify(value).slice(1, 11)
}
})
})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('维保结束日期')
}.width(120)
Text(this.addForm.maintenanceEndTime).padding({top: 8, bottom: 8, left: 16, right: 16})
.backgroundColor('#fff').layoutWeight(1).fontColor('#000').onClick(() => {
CalendarPickerDialog.show({
onAccept: (value) => {
this.addForm.maintenanceEndTime = JSON.stringify(value).slice(1, 11)
}
})
})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Column({space: 10}){
Row(){
Image($r('app.media.require')).width(20)
Text('项目负责人')
}.width('100%').justifyContent(FlexAlign.Start)
Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Start, alignItems: ItemAlign.Start, wrap: FlexWrap.Wrap }) {
ForEach(this.companyPersonList, (children: companyPersonRow) => {
Row() {
Radio({ value: children.personId.toString(), group: 'radioGroup',
indicatorType:RadioIndicatorType.TICK,
}).height(14).width(14).checked(this.addForm.approvePersonId == children.personId)
Text(children.personName).fontSize(14)
}
})
Text('公司暂无人员').visibility(this.companyPersonList.length == 0 ? Visibility.Visible : Visibility.None)
}.margin({right:15})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Column({space: 10}){
Row(){
Image($r('app.media.require')).width(20)
Text('维保人员')
}.width('100%').justifyContent(FlexAlign.Start)
Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Start, alignItems: ItemAlign.Start, wrap: FlexWrap.Wrap }) {
Row(){
CheckboxGroup({ group: 'checkboxGroup3' })
.checkboxShape(CheckBoxShape.ROUNDED_SQUARE)
.selectedColor('#1890ff')
.onChange((itemName: CheckboxGroupResult) => {
this.addForm.maintenancePeople = itemName.name.join(',')
})
.mark({
strokeColor:Color.White,
size: 12,
strokeWidth: 2
})
.unselectedColor('#eee')
.width(15)
.height(15)
Text('选择全部').fontSize(14)
}.margin({right: 10})
ForEach(this.companyPersonList, (children: companyPersonRow) => {
Row(){
Checkbox({ name: children.personName, group: 'checkboxGroup3' })
.selectedColor('#1890ff')
.select(this.PeopleList.includes(children.personId.toString()))
.shape(CheckBoxShape.ROUNDED_SQUARE)
.onChange((value: boolean) => {
if(value){
this.addForm.maintenancePeopleList?.push(children.personId.toString())
}else {
this.addForm.maintenancePeopleList = this.addForm.maintenancePeopleList?.filter((item: string) => item !== children.personId.toString())
}
this.addForm.technicalDirectorId = this.addForm.maintenancePeopleList?.join(',')
})
.mark({
strokeColor:Color.White,
size: 12,
strokeWidth: 2
})
.unselectedColor('#eee')
.width(15)
.height(15)
Text(children.personName).fontSize(14)
}.margin({right: 10})
})
Text('公司暂无人员').visibility(this.companyPersonList.length == 0 ? Visibility.Visible : Visibility.None)
}.margin({right:15})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Column(){
Row(){
Image($r('app.media.require')).width(20)
Text('消防设施使用管理单位')
}.justifyContent(FlexAlign.Start).width('100%')
TextInput({placeholder: '请输入消防设施管理单位', text: $$this.addForm.applyCompanyName})
.backgroundColor('#fff')
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Text('备注')
}.width(100)
TextArea({
text: $$this.addForm.result,
placeholder: '请输入内容'
}).layoutWeight(1).height(80).borderRadius(5).backgroundColor('#fff')
.border({width: 1, color: "#eee"})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Column(){
Row(){
Image($r('app.media.require')).width(20)
Text('维保记录类型')
}.width('100%').justifyContent(FlexAlign.Start).margin({bottom: 8})
Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Start, alignItems: ItemAlign.Start, wrap: FlexWrap.Wrap }) {
ForEach(this.recordsType, (item: quarterType) => {
Stack(){
Row() {
Radio({ value: item.dictValue, group: 'radioGroup' })
.radioStyle({ checkedBackgroundColor: '#1890ff' })
.height(15)
.width(15)
.checked(item.dictValue == this.addForm.reportType)
Text(item.dictLabel)
}.margin({right: 5,bottom: 5})
Row().width(80).height(30).backgroundColor(Color.White).opacity(0.1)
.onClick(() => {
this.addForm.reportType = item.dictValue
if(this.flag) {
this.addForm.projectList = []
this.fireFacilitiesList = []
this.addForm.fireFacilities = ''
this.flag = false
getLatestProjectList(item.dictValue).then((res: AxiosResponse<LatestProjectTest>) => {
this.latestProjectList = res.data.data
this.flag = true
})
}
})
}
})
}
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Column({space: 10}){
Row(){
Image($r('app.media.require')).width(20)
Text('主要消防设施')
}.width('100%').justifyContent(FlexAlign.Start)
Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center, wrap: FlexWrap.Wrap }) {
Row(){
CheckboxGroup({ group: 'checkboxGroup' })
.checkboxShape(CheckBoxShape.ROUNDED_SQUARE)
.selectedColor('#1890ff')
.onChange((itemName: CheckboxGroupResult) => {
this.addForm.fireFacilities = itemName.name.join('、')
})
.mark({
strokeColor:Color.White,
size: 12,
strokeWidth: 2
})
.unselectedColor('#eee')
.width(15)
.height(15)
Text('选择全部').fontSize(14)
}.margin({right: 10})
ForEach(this.latestProjectList, (children: LatestProjectDatum) => {
Row(){
Checkbox({ name: children.projectName, group: 'checkboxGroup' })
.selectedColor('#1890ff')
.select(this.fireFacilitiesList.includes(children.projectName))
.shape(CheckBoxShape.ROUNDED_SQUARE)
.onChange((value) => {
if(value){
this.addForm.projectList?.push({ projectId: children.projectId })
} else {
this.addForm.projectList = this.addForm.projectList?.filter((item) => item.projectId !== children.projectId)
}
})
.mark({
strokeColor:Color.White,
size: 12,
strokeWidth: 2
})
.unselectedColor('#eee')
.width(15)
.height(15)
Text(children.projectName).fontSize(14)
}.margin({right: 10})
})
}.margin({right:15})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Column({space: 10}){
Row(){
Row(){
Text('仪器设备')
}.margin({right: 10})
Search({ placeholder: '请输入关键字' })
.searchButton('搜索', {
fontSize: 12
})
.width('95%')
.height(30)
.backgroundColor('#fff')
.placeholderColor(Color.Grey)
.placeholderFont({ size: 12, weight: 400 })
.textFont({ size: 12, weight: 400 })
.layoutWeight(1)
.onSubmit((value) => {
if(value.trim() == '') {
this.equipmentList = this.initEquipmentList
} else {
this.equipmentList = searchByIndexOf(value, this.initEquipmentList) as equipmentType[]
}
})
}.width('100%').justifyContent(FlexAlign.Start)
Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center, wrap: FlexWrap.Wrap }) {
Row(){
CheckboxGroup({ group: 'checkboxGroup2' })
.checkboxShape(CheckBoxShape.ROUNDED_SQUARE)
.selectedColor('#1890ff')
.onChange((itemName: CheckboxGroupResult) => {
this.addForm.equipmentList = itemName.name
this.addForm.equipment = itemName.name.join(',')
})
.mark({
strokeColor:Color.White,
size: 12,
strokeWidth: 2
})
.unselectedColor('#eee')
.width(15)
.height(15)
Text('选择全部').fontSize(14)
}.margin({right: 10})
ForEach(this.equipmentList, (children: equipmentType) => {
Row(){
Checkbox({ name: children.equipmentName, group: 'checkboxGroup2' })
.selectedColor('#1890ff')
.select(this.viewEquipmentList.includes(children.equipmentName))
.shape(CheckBoxShape.ROUNDED_SQUARE)
.mark({
strokeColor:Color.White,
size: 12,
strokeWidth: 2
})
.unselectedColor('#eee')
.width(15)
.height(15)
Text(children.equipmentName).fontSize(14)
}.margin({right: 10})
})
}.margin({right:15})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
}.backgroundColor('#fff').width('100%').padding({left: 5, right: 5}).borderRadius(10)
}.padding(10).margin({bottom: 20, top: 10})
}.layoutWeight(1).scrollBar(BarState.Off)
Row(){
Text('提交').borderRadius(5).width('100%').height(30).fontColor('#fff')
.backgroundColor('#1B65FD').fontSize(14).textAlign(TextAlign.Center)
.onClick(async () => {
if(this.addForm.reportName == '') {
return promptAction.showToast({message: '项目名称为必填项'})
} else if(this.addForm.reportNo == '') {
return promptAction.showToast({message: '项目编号为必填项'})
} else if(this.addForm.applyCompanyName == ''){
return promptAction.showToast({message: '消防设施管理单位为必填项'})
} else if(this.addForm.maintenanceTime == '请选择起始日期' || this.addForm.maintenanceEndTime == '请选择结束日期'){
return promptAction.showToast({message: '维保日期为必填项'})
} else if(this.addForm.fireFacilities == ''){
return promptAction.showToast({message: '至少选择一下消防设施'})
} else if(this.addForm.maintenancePeople == ''){
return promptAction.showToast({message: '请选择维保人员'})
}
if(this.errorMsg !== '') {
return promptAction.showToast({message: '校验失败'})
}
if(!this.addForm.maintenancePeopleList?.includes(this.personId.toString())){
return promptAction.showToast({message: '本人必须在维护人员中'})
}
if(this.isEdit){
console.log(JSON.stringify(this.addForm))
await updateRecords(this.addForm)
promptAction.showToast({
message: '更新成功'
})
} else {
this.addForm.maintenanceDate = [this.addForm.maintenanceTime as string, this.addForm.maintenanceEndTime as string]
await addRecords(this.addForm)
promptAction.showToast({
message: '添加成功'
})
}
})
}.width('100%').height(40).backgroundColor('#fff').padding({left: 10, right: 10})
}.width('100%').height('100%').backgroundColor('#f2f3f7')
}
}
\ No newline at end of file
... ...
import preferencesUtil from '../utils/preferences'
import { promptAction } from '@kit.ArkUI';
import { AxiosResponse } from '@ohos/axios'
import { headerTest, headerRow, companyData } from '../api/userType'
import { getHeaderInfo, updateHeaderInfo, addHeaderInfo } from '../api/user'
let companyId = preferencesUtil.get('XF_COMPANY_ID', 65) as number
@Entry
@Component
struct EditUser {
@Builder indicatorBuilder(icon: ResourceStr) {
Image(icon)
}
@State companyInfo: companyData = {
createBy: null,
createTime: null,
updateBy: null,
updateTime: '',
remark: null,
companyId: 65,
companyName: '',
province: '',
city: '',
county: '',
address: '',
legalPerson: null,
lpTel: null,
linkMan: '',
lmTel: '',
companyTel: null,
fax: null,
postCode: null,
email: '',
website: null,
floorage: 0,
siteVoucher: '',
businessLicenseNo: '',
businessStartTime: null,
businessEndTime: null,
businessLicensePic: '',
businessScope: null,
peopleNum: 0,
companyIntroduce: null,
registeredCapital: null,
compangyPic: '',
memo: null,
state: '',
companyType: '',
isShow: null,
isValidVedio: null,
userId: 0,
username: '',
level: null,
regionCode: null,
levelModifyDate: null,
endTime: '',
}
@State isEdit: boolean = false
@State headerInfo: headerRow = {
account: '',
bank: '',
address: '',
phone: '',
companyId: '',
companyName: '',
businessLicenseNo: ''
}
async onPageShow() {
if(preferencesUtil.get('XF_COMPANY_INFO', '') !== '') {
this.companyInfo = JSON.parse(preferencesUtil.get('XF_COMPANY_INFO', '') as string)
this.headerInfo.businessLicenseNo = this.companyInfo.businessLicenseNo
this.headerInfo.companyName = this.companyInfo.companyName
}
let res: AxiosResponse<headerTest> = await getHeaderInfo({pageSize: 1, pageNum: 1, companyId: companyId})
this.isEdit = res.data.rows.length > 0
if(res.data.rows.length > 0){
this.headerInfo = res.data.rows[0]
}
}
build() {
Column(){
Column(){
Column(){
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('公司名称')
}.margin({right: 15})
Text(this.headerInfo?.companyName).layoutWeight(1).padding({top: 10, bottom: 10})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('统一信用代码')
}.margin({right: 15})
Text(this.headerInfo?.businessLicenseNo).layoutWeight(1).padding({top: 10, bottom: 10})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('对公账户')
}
TextInput({placeholder: '请输入对公账户', text: $$this.headerInfo.account})
.backgroundColor('#fff').layoutWeight(1).type(InputType.Number)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('开户行')
}
TextInput({placeholder: '请输入开户行', text: $$this.headerInfo.bank})
.backgroundColor('#fff').layoutWeight(1)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('公司电话')
}
TextInput({placeholder: '请输入公司电话', text: $$this.headerInfo.phone})
.backgroundColor('#fff').layoutWeight(1)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('公司地址')
}
TextInput({placeholder: '请输入公司地址', text: $$this.headerInfo.address})
.backgroundColor('#fff').layoutWeight(1)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
}.backgroundColor('#fff').width('100%').padding({left: 5, right: 5}).borderRadius(10)
}.padding(10).margin({bottom: 20, top: 10}).width('100%').layoutWeight(1)
Row({ space: 10}){
Text('提交').borderRadius(5).layoutWeight(1).height(30).fontColor('#fff')
.backgroundColor('#1B65FD').fontSize(14).textAlign(TextAlign.Center)
.onClick(async () => {
if(this.isEdit) {
await updateHeaderInfo(this.headerInfo)
promptAction.showToast({
message: '修改成功',
duration: 2000
})
} else {
await addHeaderInfo(this.headerInfo)
promptAction.showToast({
message: '新增成功',
duration: 2000
})
}
})
}.width('100%').height(40).backgroundColor('#fff').padding({left: 10, right: 10})
}.width('100%').height('100%').backgroundColor('#f2f3f7')
}
}
\ No newline at end of file
... ...
@Entry
@Component
struct CancellationAgreement {
build() {
Scroll(){
Column({space: 10}){
Text('消防维保助手账号注销协议').textAlign(TextAlign.Center).width('100%')
Column({space: 10}){
Text('尊敬的用户,您好!在您正式开始下一步消防维保助手账号注销流程前,我们特意为您作出如下重要提示:注销消防维保助手账号是不可恢复的操作,注销消防维保助手账号后,您将无法找回您通过该账号添加或绑定的任何内容和信息,即使您选择相同的身份证号/统一社会信用代码再次注册账号并使 用消防维保助手产品及服务。').fontSize(12)
Text('为了避免给您带来不便,请您在注销消防维保助手账号之前慎重考虑,如您经过慎重考虑后仍决定注销消防维保助手账号的,请您务必先行仔细阅读并充分理解本《消防维保助手账号注销协议》(下或称“本协议”)的全部内容,特别是加粗部分。').fontSize(12)
Text('您应该具备中华人民共和国法律规定的与您签署本协议之行为相应的民事行为能力。若您不具备与您签署本协议之行为相适应的民事行为能力,请您在您的监护人陪同下阅读并进行相应操作,并确保监护人同意您的所有行为。在此情况下,您及您的监护人应依照法律相关规定承担由此导致的一切后果。').fontSize(12)
Text('本协议未尽事宜,可参照《消防维保助手隐私政策》。如本协议与前述规则存在冲突的,以本协议为准。如您对本协议有任何疑问,请发送邮件至我们的客服邮箱:【weiyi@crgx.net】。您阅读《消防维保助手账号注销协议》并点击“我已阅读并同意注销协议”的,即视为您同意与广西世纪创软信息技术有限公司达成本协议,并自愿接受本协议所有条款的约束。').fontSize(12)
Text('一、消防维保助手账号注销后您应当承担的后果').fontSize(12)
Text('您理解并同意,消防维保助手账号一旦注销,您自愿承担其所(可能)产生的后果,该等后果包括但不限于:\n' +
'1. 消防维保助手账号注销后,您将无法再以该账号登录/使用/继续使用消防维保助手产品及服务;且该账号将无法被恢复,即使您在账号注销后以相同身份证号/统一社会信用代码再次向广西世纪创软信息技术有限公司申请注册消防维保助手账号,此时该账号将默认为新的注册账号。因此,我们善意地提醒您在申请注销前对需要备份的内容和信息提前自行做好备份。\n' +
'2. 消防维保助手账号注销后,您曾通过该账号登录、使用消防维保助手产品及服务下的所有内容、信息、数据、记录将会被删除或匿名化处理(但法律法规另有规定除外),前述内容、信息、数据、记录被删除或匿名化处理后您无法再检索、访问、传输、获取、继续使用和找回,也无权要求我们找回。该等内容、信息、数据或记录包括但不限于:\n' +
'(1)该账号下您的个人信息(包括但不限于个人用户:个人照片、身份证国徽面照片、身份证人像面照片、姓名、手机号、邮箱、性别、出生日期;机构用户:公司名称、所在地区、营业执照编号、营业执照扫描件、联系人姓名、联系人手机号、联系人邮箱等);\n' +
'(2)该账号下您曾创建和编辑的内容(包括但不限于维保原始记录、确认公司从业);\n' +
'(3)该账号下的其他所有内容、信息、数据、记录。\n' +
'3. 消防维保助手账号注销后,广西世纪创软信息技术有限公司将会对该账号下的全部权益(如有)做清除处理。您理解并同意通过注销消防维保助手账号的方式放弃该账号在消防维保助手产品及服务使用期间已产生但尚未消耗完毕的权益及未来可能产生预期利益,该等权益或预期利益包括但不限于:该账号下您充值的会费未到期状态下可使用的功能等,该账号下其他已产生但尚未消耗的权益或未来可能产生的预期利益。\n' +
'4. 消防维保助手账号一旦注销,您通过该账号与我们曾签署过的相关用户协议、其他权利义务文件将相应终止,除非广西世纪创软信息技术有限公司与您已约定继续有效或法律法规另有规定。\n' +
'5. 其他因消防维保助手账号注销所(可能)产生的后果。').fontSize(12)
Text('在您向广西世纪创软信息技术有限公司申请/继续申请注销消防维保助手账号之前,为保障您的账号安全和财产权益,您应确保您申请注销的消防维保助手账号已同时具备以下条件,该等条件包括但不限于:\n' +
'1.该账号是您本人通过官方渠道进行注册的,且符合广西世纪创软信息技术有限公司所有平台规范。\n' +
'2.该账号无任何安全风险,包括但不限于1)该账号在申请注销期间无未处理完毕的(被)投诉、举报;2)该账号在申请注销期间未处于非法的被检查状态、被限制的状态;3)该账号在最近1个月内无异常登录记录、无修改密码等敏感操作;4)以及无其他安全风险。\n' +
'3.机构账号的会费权益已过期。即使该账户的会费从同意消防维保助手账号注册协议开始计算到权益终止不超过15个自然日的时间,您均同意以注销账号的方式放弃前述相关权益。\n' +
'4.不存在任何由于该账号被注销而导致的未了解的合同关系与其他基于该账号的存在而产生的或维持的权利义务,以及广西世纪创软信息技术有限公司认为注销该账号会由此产生未了结的权利义务而产生纠纷的情况。\n' +
'5.其他应满足的条件。\n' +
'您需要首先尝试自行核实并确认是否满足上述全部条件,如您无法自行处理或在处理过程中有任何疑问,可通过邮件weiyi@crgx.net联系协助处理。').fontSize(12)
Text('三、如何注销消防维保助手账号?').fontSize(12)
Text('1. 您需按照广西世纪创软信息技术有限公司官方渠道提供的操作指引进行注销操作。在消防维保助手移动端,完成注销账号的操作。\n' +
'2. 您已经仔细阅读与充分理解、且同意本《消防维保助手账号注销协议》的全部内容;同时您已自行检查并确认满足本协议的第二条项下账号注销所具备的全部条件。\n' +
'3. 在您满足本协议第三条第2款后,我们将根据您的账号安全状态以及使用情况进行初步检测,以初步判断该账号是否符合注销条件。如我们在初步判断后,发现您的账号不符和注销条件的,您的申请可能会失败,您需要在满足全部注销条件后再行申请注销。如我们对您的账号初步检测和判断后认为其初步符合注销条件的,我们将对您进行身份验证,以确保您系该账号的合法使用人,有权对该账号提交注销申请。您理解并同意,我们对您的账号是否符合注销条件可能仅做初步检测和判断,部分条件依赖于您的自行检查和确认;您确保已经自行检查并确认满足本协议第二条项下注销所需具备的全部条件,并承诺接受由此(可能)带来的所有后果。\n' +
'4. 在您通过身份验证和各项提醒并最终点击“提交注销申请”后,视为您已成功向广西世纪创软信息技术有限公司提交了消防维保助手账号注销申请,但是此并不意味着该账号必然完全符合注销条件。提交申请后,账号立即被冻结,无法正常使用,广西世纪创软信息技术有限公司会在15个工作日内,通过weiyi@crgx.net邮箱发送审核结果到您注册时填写的邮箱中。如消防维保助手账号注销申请未通过,则在收到邮件之时起,该申请注销账号恢复正常使用;如消防维保助手账号注销申请通过,则该申请注销账号将被永久注销,不得恢复。\n' +
'5. 您理解并同意,在您申请注销消防维保助手账号期间,如我们需要对相关交易、投诉或其他与您的账号相关的事项进行核实的,或者我们有其他合理的理由的,我们有权冻结您的该账号且暂时不为您提供注销服务。\n' +
'6. 您理解并同意,即使您的消防维保助手账号被注销了,也并不代表减轻或免除您理应根据相关法律法规、相关协议、规则等(可能)需要承担的法律责任。\n').fontSize(12)
Text('四、 适用法律及争议解决').fontSize(12)
Text('本协议适用中华人民共和国的法律,并且排除一切冲突法规定的适用。如出现纠纷,双方应尽量友好协商解决;协商不成时,任何乙方均有权向被告所在地人民法院提起诉讼').fontSize(12)
Text('广西世纪创软信息技术有限公司').fontSize(12)
Text('我已阅读并同意协议').width('100%').height(30).fontSize(14).fontColor('#fff').borderWidth(1).borderColor('#ff4949')
.backgroundColor('#ff4949').textAlign(TextAlign.Center).borderRadius(4)
}.alignItems(HorizontalAlign.Start)
}.width('100%').alignItems(HorizontalAlign.Start).padding(10)
}
}
}
\ No newline at end of file
... ...
import preferencesUtil from '../utils/preferences'
import { personCertificateTest, personCertificateRow, CertificateTest, CertificateRow } from '../api/userType'
import baseUrl from '../utils/baseUrl'
import { getPersonalCertificate, getCertificateList, updatePersonalCertificate, addPersonalCertificate } from '../api/user'
import { AxiosResponse } from '@ohos/axios'
import CertificateDialog from '../dialog/CertificateDialog'
import PhotoBrowser from '../dialog/PhotoBrowserDialog'
import { uploadFile, uploadResult } from '../utils/uploadFile'
import { request } from '@kit.BasicServicesKit'
import { promptAction } from '@kit.ArkUI';
let personId = preferencesUtil.get('XF_PERSON_ID', 0) as number
@Entry
@Component
struct EditUser {
private selectedDate: Date = new Date()
@State personCertificateInfo: personCertificateRow = {
certificateName: '',
certificateLevel: '',
certificateNo: '',
certificateId: 1,
certificateImg: '',
issueDate: '选择日期',
personId
}
@State selectValue: string = '请选择证书类型'
@State certificateData: CertificateRow[] = []
@State certificateList: string[] = []
@State isEdit: boolean = false
async aboutToAppear() {
console.log(JSON.stringify(personId))
const result: AxiosResponse<personCertificateTest> = await getPersonalCertificate({pageNum: 1, pageSize: 10, personId: Number(personId)})
const res: AxiosResponse<CertificateTest> = await getCertificateList({pageNum: 1, pageSize: 10})
this.isEdit = result.data.rows.length > 0
if(result.data.rows.length > 0 ) {
this.personCertificateInfo = result.data.rows[0]
this.selectValue = this.personCertificateInfo?.certificateLevel + this.personCertificateInfo?.certificateName
}
this.certificateData = res.data.rows
this.certificateList = res.data.rows.map((item: CertificateRow) => item.certificateLevel + item.certificateName)
this.personCertificateInfo.certificateId = this.certificateData[0].certificateId
}
dialogController: CustomDialogController = new CustomDialogController({
builder: CertificateDialog({
certificateList: this.certificateList,
selectValue: this.selectValue,
certificateData: this.certificateData,
personCertificateInfo: this.personCertificateInfo
})
})
photoBrowserController: CustomDialogController = new CustomDialogController({
builder: PhotoBrowser({ imagesList: [baseUrl + this.personCertificateInfo.certificateImg]}),
customStyle: true,
offset: { dx: 0, dy: 0 },
alignment: DialogAlignment.Top,
})
build() {
Column(){
Column(){
Column(){
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('证书类型')
}.width(90)
Text(this.selectValue == '' ? '选择证书类型' : this.selectValue).layoutWeight(1).padding({left: 8,right: 8, top: 16, bottom: 16})
.onClick(() => {
this.dialogController.open()
})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('证书编号')
}.width(90)
TextInput({placeholder: '请输入证书编号', text: $$this.personCertificateInfo.certificateNo})
.backgroundColor('#fff').layoutWeight(1).type(InputType.Email)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('颁发日期')
}.width(90)
Text(this.personCertificateInfo.issueDate).padding({top: 8, bottom: 8, left: 16, right: 16})
.backgroundColor('#fff').layoutWeight(1).fontColor('#000').onClick(() => {
CalendarPickerDialog.show({
selected: this.selectedDate,
onAccept: (value) => {
this.personCertificateInfo.issueDate = JSON.stringify(value).slice(1, 11)
}
})
})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('证书扫描件')
}.width(90)
Row({space: 20}){
Image(this.personCertificateInfo.certificateImg !== '' ? baseUrl + this.personCertificateInfo.certificateImg : $r('app.media.certificateCard')).width(120).height(120)
.onClick(async () => {
let that = this
let uploader = await uploadFile() as request.UploadTask
// 3. 监控上传错误
uploader.on('fail', (err) => {
console.log('上传错误--->', JSON.stringify(err))
})
// 4. 获取服务器返回来的数据
uploader.on('headerReceive',(res)=>{
let uploadInfo = JSON.parse(res['body']) as uploadResult
that.personCertificateInfo.certificateImg = uploadInfo.fileName
})
})
}.layoutWeight(1).margin({left: 20})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Text('备注')
}.width(100)
TextArea({
text: $$this.personCertificateInfo.memo,
placeholder: '请输入内容'
}).layoutWeight(1).height(80).borderRadius(5).backgroundColor('#fff')
.border({width: 1, color: "#eee"})
}.padding({top: 10, bottom: 10})
}.backgroundColor('#fff').width('100%').padding({left: 5, right: 5}).borderRadius(10)
}.padding(10).margin({bottom: 20, top: 10}).layoutWeight(1)
Row({ space: 10 }){
Text('提交').borderRadius(5).layoutWeight(1).height(30).fontColor('#fff')
.backgroundColor('#1B65FD').fontSize(14).textAlign(TextAlign.Center)
.onClick(async () => {
if(this.personCertificateInfo?.certificateNo == '') {
return promptAction.showToast({message: '证书编号不能为空'})
} else if(this.personCertificateInfo?.issueDate == '') {
return promptAction.showToast({message: '日期不能为空'})
}
if(this.isEdit) {
await updatePersonalCertificate(this.personCertificateInfo)
promptAction.showToast({
message: '更新成功,点击刷新查看数据'
})
} else {
await addPersonalCertificate(this.personCertificateInfo)
promptAction.showToast({
message: '添加成功,点击刷新查看新数据'
})
}
})
Text('图片预览').borderRadius(5).layoutWeight(1).height(30).fontColor('#fff')
.backgroundColor('#1B65FD').fontSize(14).textAlign(TextAlign.Center)
.onClick(() => {
this.photoBrowserController.open()
})
}.width('100%').height(40).backgroundColor('#fff').padding({left: 10, right: 10})
}.width('100%').height('100%').backgroundColor('#f2f3f7')
}
}
\ No newline at end of file
... ...
import { router, promptAction } from '@kit.ArkUI'
import { pasteboard } from '@kit.BasicServicesKit';
import preferencesUtils from '../utils/preferences'
import { AxiosResponse } from '@ohos/axios'
import { HmParseHTML } from "@wuyan/html_parse"
import { BusinessError } from '@kit.BasicServicesKit';
import { uploadFileByTask, selectImgOrVideo } from '../utils/uploadCloud'
import { basePath } from '../utils/baseUrl'
import {getCloudDown, beanType} from '../api/user'
import loadingDialog from '../dialog/LoadingDialog'
import UploadTipDialog from '../dialog/UploadTipDialog'
import { getReportDetail, getMalfunctionList, deleteRecords, successReport, returnSing } from '../api/originalRecords'
import { reportDetailTest, reportDetailData, ProjectList, MalfunctionListTest, MalfunctionListRow, configTest } from '../api/recordsType'
import { pushOutsideWeb } from '../utils/pushOutsideWeb'
import ThemeStaticTest from '../components/ThemeStaticText'
interface routerParams {
reportId: number
}
let roleName = preferencesUtils.get('XF_ROLE_NAME', '')
let params = router.getParams() as routerParams
let reportId = params.reportId
let personId = preferencesUtils.get('XF_PERSON_ID', '')
@Entry
@Component
struct DetailRecords {
@State reportDetail: reportDetailData | null = null
@State projectList: ProjectList[] = []
@State malfunctionList: MalfunctionListRow[] = []
@State findTime: string = ''
@State applyCompanyComment: string = ''
@State maintenanceComment: string = ''
@State isShowCloudDown: boolean = false
aboutToAppear(): void {
if(!AppStorage.get('isShowTip')) {
this.uploadController.open()
}
}
async onPageShow() {
this.loadingController.open()
// 是否可以上传云存储
let cloudDown: AxiosResponse<beanType> = await getCloudDown()
this.isShowCloudDown = cloudDown.data.msg == 'true'
// 获取维保记录详情
const detail: AxiosResponse<reportDetailTest> = await getReportDetail(reportId)
this.reportDetail = detail.data.data
this.projectList = this.reportDetail.projectList
this.loadingController.close()
// 获取设施故障列表
const malfunction: AxiosResponse<MalfunctionListTest> = await getMalfunctionList({ pageNum: 1, pageSize: 500, reportId })
this.malfunctionList = malfunction.data.rows
if(this.malfunctionList.length > 0){
this.findTime = this.malfunctionList[0].findTime as string
this.applyCompanyComment = this.malfunctionList[0].applyCompanyComment as string
this.maintenanceComment = this.malfunctionList[0].maintenanceComment as string
}
}
loadingController: CustomDialogController = new CustomDialogController({
builder: loadingDialog(),
customStyle: true,
offset: { dx: 0, dy: 0 },
alignment: DialogAlignment.Center,
autoCancel: false
})
uploadController: CustomDialogController = new CustomDialogController({
builder: UploadTipDialog(),
cornerRadius: 10
})
// 复制甲方签名至剪切板
copyText = (text: string) => {
const pasteboardData = pasteboard.createData(pasteboard.MIMETYPE_TEXT_PLAIN, text);
const systemPasteboard = pasteboard.getSystemPasteboard();
systemPasteboard.setData(pasteboardData); // 将数据放入剪切板
systemPasteboard.getData().then((data) => {
if (data) {
promptAction.showToast({ message: '复制成功' });
} else {
promptAction.showToast({ message: '复制失败' });
}
})
}
build() {
Scroll(){
Column({space: 10}){
// 概况
Column(){
Row(){
Row(){
Text().width(3).height(16).backgroundColor('#1890ff').margin({right: 10})
Text('概况').fontSize(12).fontColor('#999')
}
Row(){
Image($r('app.media.edit_1')).width(12)
Text('修改概况').fontColor('#1890ff').fontSize(12).margin({left: 3, right: 3})
Image($r('app.media.right_arrow')).width(12)
}.onClick(() => {
router.pushUrl({
url: 'pages/AddRecords',
params: {
reportId: this.reportDetail?.reportId
}
})
})
.visibility(this.reportDetail?.state == '5' || this.reportDetail?.state == '1' ? Visibility.None : Visibility.Visible)
}.border({width: {bottom: 1}, color: '#eee'}).justifyContent(FlexAlign.SpaceBetween).width('100%').padding(5)
Row(){
Text('消防设施使用单位').fontSize(12).fontColor('#999')
Text(this.reportDetail?.applyCompanyName || '').fontColor('#999').fontSize(12).margin({left: 3, right: 3})
}.border({width: {bottom: 1}, color: '#eee'}).padding(10).justifyContent(FlexAlign.SpaceBetween).width('100%')
Row(){
Text('项目名称').fontSize(12).fontColor('#999')
Text(this.reportDetail?.reportName || '').fontColor('#999').fontSize(12).margin({left: 3, right: 3})
}.border({width: {bottom: 1}, color: '#eee'}).padding(10).justifyContent(FlexAlign.SpaceBetween).width('100%')
Row(){
Text('项目编号').fontSize(12).fontColor('#999')
Text(this.reportDetail?.reportNo || '').fontColor('#999').fontSize(12).margin({left: 3, right: 3})
}.border({width: {bottom: 1}, color: '#eee'}).padding(10).justifyContent(FlexAlign.SpaceBetween).width('100%')
Row(){
Text('维保记录类型').fontSize(12).fontColor('#999')
ThemeStaticTest({
textValue: this.reportDetail?.reportType,
type: '0'
})
}.border({width: {bottom: 1}, color: '#eee'}).padding(10).justifyContent(FlexAlign.SpaceBetween).width('100%')
Row(){
Text('状态').fontSize(12).fontColor('#999')
ThemeStaticTest({
textValue: this.reportDetail?.state,
type: '1'
})
}.border({width: {bottom: 1}, color: '#eee'}).padding(10).justifyContent(FlexAlign.SpaceBetween).width('100%')
Row(){
Text('创建日期').fontSize(12).fontColor('#999')
Text(this.reportDetail?.reportTime || '').fontColor('#999').fontSize(12).margin({left: 3, right: 3})
}.border({width: {bottom: 1}, color: '#eee'}).padding(10).justifyContent(FlexAlign.SpaceBetween).width('100%')
Row(){
Text('维保日期').fontSize(12).fontColor('#999')
Text(this.reportDetail?.maintenanceTime || '').fontColor('#999').fontSize(12).margin({left: 3, right: 3})
}.border({width: {bottom: 1}, color: '#eee'}).padding(10).justifyContent(FlexAlign.SpaceBetween).width('100%')
Row(){
Text('完成日期').fontSize(12).fontColor('#999')
Text(this.reportDetail?.maintenanceEndTime || '').fontColor('#999').fontSize(12).margin({left: 3, right: 3})
}.border({width: {bottom: 1}, color: '#eee'}).padding(10).justifyContent(FlexAlign.SpaceBetween).width('100%')
Row(){
Text('维保人员').fontSize(12).fontColor('#999')
Text(this.reportDetail?.maintenancePeople || '').fontColor('#999').fontSize(12).margin({left: 3, right: 3})
}.border({width: {bottom: 1}, color: '#eee'}).padding(10).justifyContent(FlexAlign.SpaceBetween).width('100%')
Row(){
Text('甲方签字').fontSize(12).fontColor('#999')
Row({space: 5}){
Image($r('app.media.share')).width(14)
Text('分享签名').fontSize(12).fontColor('#1890ff')
}.onClick(() => {
AlertDialog.show({
title: '分享签名提示',
message: `出于对多个甲方见证人签名的考虑,在甲方签名完成后,仍是"待甲方签名"的状态,需【维保公司账号】前往【更多操作】-->【完成】`,
alignment: DialogAlignment.Center,
primaryButton: {
value: '取消',
action: () => {
console.info('Callback when the first button is clicked')
}
},
secondaryButton: {
enabled: true,
defaultFocus: true,
style: DialogButtonStyle.HIGHLIGHT,
value: '确认',
action: async () => {
console.log(`https://xfappht.crgx.net/report/record?id=${reportId}&token=${preferencesUtils.get('XF_TOKEN', '')}&time=${new Date().getTime()}&type=firstPartySign&username=${preferencesUtils.get('XF_USERNAME', '')}`)
this.copyText(`https://xfappht.crgx.net/report/record?id=${reportId}&token=${preferencesUtils.get('XF_TOKEN', '')}&time=${new Date().getTime()}&type=firstPartySign&username=${preferencesUtils.get('XF_USERNAME', '')}`)
}
}
})
})
}.border({width: {bottom: 1}, color: '#eee'}).padding(10).justifyContent(FlexAlign.SpaceBetween).width('100%')
.visibility(this.reportDetail?.state == '1' || this.reportDetail?.state == '5' ? Visibility.Visible : Visibility.None)
Column({space: 5}){
Text('仪器设备').fontSize(12).fontColor('#999')
Text(this.reportDetail?.equipment || '').fontColor('#999').fontSize(12).margin({left: 3, right: 3})
}.border({width: {bottom: 1}, color: '#eee'}).padding(10).alignItems(HorizontalAlign.Start).width('100%')
Row(){
Text('备注').fontSize(12).fontColor('#999').margin({right: 10})
HmParseHTML({
htmlStr: this.reportDetail?.result || '<p>无</p>',
baseFontSize: 12,
baseFontColor: '#999'
})
}.padding(10).justifyContent(FlexAlign.SpaceBetween)
}.backgroundColor('#fff').borderRadius(10).padding(10).width('100%')
// 主要消防措施
Column({space: 10}){
Row(){
Row(){
Text().width(3).height(16).backgroundColor('#1890ff').margin({right: 10})
Text('主要消防措施').fontSize(12).fontColor('#999')
}
Row(){
Image($r('app.media.edit_1')).width(12)
Text('查看记录').fontColor('#1890ff').fontSize(12).margin({left: 3, right: 3})
Image($r('app.media.right_arrow')).width(12)
}.onClick(() => {
if(personId !== '') {
router.pushUrl({
url: 'pages/LookRecords',
params: {
reportId: this.reportDetail?.reportId,
pid: personId
}
})
} else {
router.pushUrl({
url: 'pages/LookRecordCompany',
params: {
reportId: this.reportDetail?.reportId
}
})
}
})
}.justifyContent(FlexAlign.SpaceBetween).width('100%').margin({bottom: 10})
ForEach(this.projectList, (item: ProjectList, index) => {
Column({space: 5}){
Row(){
Row({space: 5}){
Text((index + 1).toString()).padding(10).borderRadius(5)
.backgroundColor(Color.Gray).fontSize('#666')
Text(item.projectName).fontSize(12).fontColor('#999')
}
Row(){
Text('查看视频/图片内容').fontSize(12).fontColor('#1890ff')
Image($r('app.media.right_arrow')).width(12)
}.visibility(this.isShowCloudDown && item.cosKey !== null ? Visibility.Visible : Visibility.None)
.onClick(() => {
router.pushUrl({
url: 'pages/VideoDetail',
params: {
cosKey: item.cosKey,
relateId: item.relateId
}
})
})
}.width('100%').justifyContent(FlexAlign.SpaceBetween)
Row(){
Text(item.updateTime).fontSize(12).fontColor('#999')
Text(item.state == '0' ? '未编辑' : '已编辑')
.padding({left: 6, right: 6})
.borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).fontColor(item.state == '0' ? '#ff4949' : '#13ce66')
.backgroundColor(item.state == '0' ? '#ffeded' : '#e7faf0').borderColor(item.state == '0' ? '#ffdbdb' : '#d0f5e0')
}.width('100%').justifyContent(FlexAlign.SpaceBetween)
Row(){
Row(){
Image($r('app.media.photo')).width(12).margin({right: 4})
Text('上传视频/图片').fontSize(12).fontColor('#1890ff')
}.layoutWeight(1).justifyContent(FlexAlign.Center)
.visibility(this.isShowCloudDown ? Visibility.Visible : Visibility.None)
.onClick(async () => {
// 上传文件到腾讯云存储
try {
let key: string = item.cosKey == null ? '' : item.cosKey
let systemPhotoImagePath: string = await selectImgOrVideo() // 选择文件
this.loadingController.open()
await uploadFileByTask(key, item.relateId, systemPhotoImagePath)
this.loadingController.close()
} catch (error) {
let err: BusinessError = error as BusinessError;
console.error(`Invoke uploadFile failed, code is ${err.code}, message is ${err.message}`);
}
})
Text().width(2).height(16).backgroundColor('#eee').visibility(this.isShowCloudDown ? Visibility.Visible : Visibility.None)
Row(){
Image($r('app.media.edit_1')).width(12).margin({right: 4})
Text('编辑详情').fontSize(12).fontColor('#1890ff').onClick(() => {
router.pushUrl({
url: 'pages/FireProtectionDetail',
params: item
})
})
}.layoutWeight(1).justifyContent(FlexAlign.Center)
}.width('100%').padding({top: 5}).border({width: {top: 1}, color: '#eee'})
.visibility(item.state == '0' ? Visibility.Visible : Visibility.None)
}.padding({top: 10, left: 10, right: 10, bottom: 10}).borderWidth(1).borderColor('#eee').shadow({ radius: 5, color: Color.Gray }).borderRadius(5)
})
}.backgroundColor('#fff').borderRadius(10).padding(10).width('100%')
// 消防设施故障处理单
Column({space: 10}){
Row(){
Row(){
Text().width(3).height(16).backgroundColor('#1890ff').margin({right: 10})
Text('消防设施故障处理单').fontSize(12).fontColor('#999')
}
Row(){
Image($r('app.media.edit_1')).width(12)
Text('故障维修').fontColor('#1890ff').fontSize(12).margin({left: 3, right: 3})
Image($r('app.media.right_arrow')).width(12)
}.onClick(() => {
router.pushUrl({
url: 'pages/FailureMaintenance',
params: {
applyCompanyName: this.reportDetail?.applyCompanyName,
companyName: this.reportDetail?.companyName,
reportName: this.reportDetail?.reportName,
reportId: this.reportDetail?.reportId,
reportType: this.reportDetail?.reportType
}
})
})
.visibility(this.reportDetail?.state == '5' || this.reportDetail?.state == '1' ? Visibility.None : Visibility.Visible)
}.justifyContent(FlexAlign.SpaceBetween).width('100%').margin({bottom: 10})
Column(){
Row(){
Text('发现时间:').fontSize(12).fontColor('#999')
Text(this.findTime).fontColor('#999').fontSize(12).margin({left: 3, right: 3})
}.border({width: {bottom: 1}, color: '#eee'}).padding(10).justifyContent(FlexAlign.Start).width('100%')
ForEach(this.malfunctionList, (malfunction: MalfunctionListRow, index: number) => {
Column({space: 4}){
Row({space: 10}){
Text((index + 1).toString()).width(30).height(30).backgroundColor(Color.Gray)
.borderWidth(1).borderColor('#eee').borderRadius(4).textAlign(TextAlign.Center)
Text(malfunction.malfunctionPart)
}.margin({bottom: 10})
Text(`故障情况及影响:${malfunction.malfunctionDes}`).fontSize(12).fontColor('#999')
Text(`采取的应急措施:${malfunction.security}`).fontSize(12).fontColor('#999')
Text(`更换设备及材料情况:${malfunction.maintenanceMethod}`).fontSize(12).fontColor('#999')
Text(`处理结果:${malfunction.malfunctionConfirm}`).fontSize(12).fontColor('#999')
Text(`备注:${malfunction.remark || '无'}`).fontSize(12).fontColor('#999')
}.border({width: {bottom: 1}, color: '#eee'}).width('100%')
.padding(10).alignItems(HorizontalAlign.Start)
})
Row(){
Text('维护保养单位意见:').fontSize(12).fontColor('#999')
Text(this.maintenanceComment).fontColor('#999').fontSize(12).margin({left: 3, right: 3})
}.padding(10).justifyContent(FlexAlign.Start).width('100%')
Row(){
Text('委托单位意见:').fontSize(12).fontColor('#999')
Text(this.applyCompanyComment).fontColor('#999').fontSize(12).margin({left: 3, right: 3})
}.padding(10).justifyContent(FlexAlign.Start).width('100%')
}.width('100%').alignItems(HorizontalAlign.Start)
.visibility(this.malfunctionList.length > 0 ? Visibility.Visible : Visibility.None)
Column(){
Image($r('app.media.emptyData')).width(100)
Text('暂无维修数据').fontSize(12).fontColor('#999').textAlign(TextAlign.Center).margin({top: 5})
}.visibility(this.malfunctionList.length == 0 ? Visibility.Visible : Visibility.None)
}.backgroundColor('#fff').borderRadius(10).padding(10).width('100%')
// 更多操作
Column(){
Row(){
Row(){
Text().width(3).height(16).backgroundColor('#1890ff').margin({right: 10})
Text('操作').fontSize(12).fontColor('#999')
}
}.border({width: {bottom: 1}, color: '#eee'}).justifyContent(FlexAlign.Start).width('100%').padding(5)
Row(){
Row(){
Image($r('app.media.trash_can')).width(16)
Text('删除').fontColor('#1890ff').fontSize(12).margin({left: 3, right: 3}).fontWeight(500)
}
Image($r('app.media.right_arrow')).width(16)
}.padding(10).justifyContent(FlexAlign.SpaceBetween).width('100%').border({width: {bottom: 1}, color: '#eee'})
.visibility(this.reportDetail?.state == '1' ? Visibility.None : Visibility.Visible)
.onClick(() => {
AlertDialog.show({
title: '删除提示',
message: `维保原始记录一经删除,无法找回,确认删除${this.reportDetail?.reportName}(${this.reportDetail?.reportNo})的原始记录吗?`,
alignment: DialogAlignment.Center,
primaryButton: {
value: '取消',
action: () => {
console.info('Callback when the first button is clicked')
}
},
secondaryButton: {
enabled: true,
defaultFocus: true,
style: DialogButtonStyle.HIGHLIGHT,
value: '确认',
action: async () => {
await deleteRecords({reportId, state: '2'})
router.back()
}
}
})
})
Row(){
Row(){
Image($r('app.media.finish')).width(16)
Text('完成').fontColor('#1890ff').fontSize(12).margin({left: 3, right: 3})
}
Image($r('app.media.right_arrow')).width(16)
}.border({width: {bottom: 1}, color: '#eee'}).padding(10).justifyContent(FlexAlign.SpaceBetween).width('100%')
.visibility(this.reportDetail?.state == '5' && roleName == 'company' ? Visibility.Visible : Visibility.None)
.onClick(async () => {
AlertDialog.show({
title: '提示',
message: `完成签发后不可退回修改,确认完成吗`,
alignment: DialogAlignment.Center,
primaryButton: {
value: '取消',
action: () => {
console.info('Callback when the first button is clicked')
}
},
secondaryButton: {
enabled: true,
defaultFocus: true,
style: DialogButtonStyle.HIGHLIGHT,
value: '确认',
action: async () => {
await successReport(reportId)
await deleteRecords({reportId, state: '1'})
promptAction.showToast({message: '修改完成'})
}
}
})
})
Row(){
Row(){
Image($r('app.media.returnUpdate')).width(16)
Text('修改原始记录').fontColor('#1890ff').fontSize(12).margin({left: 3, right: 3})
}
Image($r('app.media.right_arrow')).width(16)
}.border({width: {bottom: 1}, color: '#eee'}).padding(10).justifyContent(FlexAlign.SpaceBetween).width('100%')
.visibility(this.reportDetail?.state == '5' && roleName == 'company' ? Visibility.Visible : Visibility.None)
.onClick(async () => {
AlertDialog.show({
title: '重要提示',
message: `退回编辑会清除所有的维保人员签名和甲方签名,确认退回?`,
alignment: DialogAlignment.Center,
primaryButton: {
value: '取消',
action: () => {
console.info('Callback when the first button is clicked')
}
},
secondaryButton: {
enabled: true,
defaultFocus: true,
style: DialogButtonStyle.HIGHLIGHT,
value: '确认',
action: async () => {
const res: AxiosResponse<configTest> = await returnSing(reportId)
promptAction.showToast({message: res.data.msg})
const detail: AxiosResponse<reportDetailTest> = await getReportDetail(reportId)
this.reportDetail = detail.data.data
}
}
})
})
// Row(){
// Row(){
// Image($r('app.media.lookView')).width(16)
// Text('预览统计').fontColor('#1890ff').fontSize(12).margin({left: 3, right: 3})
// }
// Image($r('app.media.right_arrow')).width(16)
// }.border({width: {bottom: 1}, color: '#eee'}).padding(10).justifyContent(FlexAlign.SpaceBetween).width('100%')
// .onClick(() => {
// pushOutsideWeb(`https://xfwbzs.crgx.net/report/preview?id=${reportId}`)
// })
Row(){
Row(){
Image($r('app.media.document')).width(16)
Text('自动报告').fontColor('#1890ff').fontSize(12).margin({left: 3, right: 3})
}
Image($r('app.media.right_arrow')).width(16)
}.border({width: {bottom: 1}, color: '#eee'}).padding(10).justifyContent(FlexAlign.SpaceBetween).width('100%')
.visibility(this.reportDetail?.state == '1' ? Visibility.Visible : Visibility.None)
.onClick(() => {
pushOutsideWeb(`${basePath}/report/view?id=${reportId}`)
})
Row(){
Row(){
Image($r('app.media.setting')).width(16)
Text('导出PDF').fontColor('#1890ff').fontSize(12).margin({left: 3, right: 3})
}
Image($r('app.media.right_arrow')).width(16)
}.border({width: {bottom: 1}, color: '#eee'}).padding(10).justifyContent(FlexAlign.SpaceBetween).width('100%')
.visibility(this.reportDetail?.state == '1' ? Visibility.Visible : Visibility.None)
.onClick(() => {
pushOutsideWeb(`${basePath}/report/view?id=${reportId}`)
})
}.backgroundColor('#fff').borderRadius(10).padding(10).width('100%')
}.width('100%')
}.height('100%').backgroundColor('#f2f3f7').padding(10)
}
}
\ No newline at end of file
... ...
import AreaPickerDialog from '../dialog/AreaPickerDialog'
import { companyTest, companyData } from '../api/userType'
import preferencesUtil from '../utils/preferences'
import baseUrl from '../utils/baseUrl'
import { ValidateInputHandle } from '../utils/validateInputHandle'
import { updateCompanyInfo, getEmailCode, getCompanyInfo } from '../api/user'
import { promptAction } from '@kit.ArkUI';
import { AxiosResponse } from '@ohos/axios'
import PhotoBrowser from '../dialog/PhotoBrowserDialog'
import { uploadFile, uploadResult } from '../utils/uploadFile'
import { request } from '@kit.BasicServicesKit'
@Entry
@Component
struct EditUser {
@Builder indicatorBuilder(icon: ResourceStr) {
Image(icon)
}
@State isShowCode: boolean = false
@State companyInfo: companyData = JSON.parse(preferencesUtil.get('XF_COMPANY_INFO', '') as string)
@State pickerValue:string[] = [this.companyInfo.province, this.companyInfo.city, this.companyInfo.county] //省市区选中值
@State photoList: string[] = [baseUrl + this.companyInfo.businessLicensePic]
@State initEmail: string = this.companyInfo.email
areaController: CustomDialogController = new CustomDialogController({
builder: AreaPickerDialog({
value: this.pickerValue,//首次默认选中值
onChange: (value:string[]) => {//选择改变回调
this.pickerValue = value
this.companyInfo.address = this.pickerValue.join(' ')
this.companyInfo.province = this.pickerValue[0]
this.companyInfo.city = this.pickerValue[1]
this.companyInfo.county = this.pickerValue[2]
}
}),
customStyle: true
})
photoBrowserController: CustomDialogController = new CustomDialogController({
builder: PhotoBrowser({ imagesList: this.photoList}),
customStyle: true,
offset: { dx: 0, dy: 0 },
alignment: DialogAlignment.Top,
})
build() {
Column(){
Column(){
Column(){
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('公司名称')
}.width(90)
Text(this.companyInfo.companyName).layoutWeight(1).padding({top: 10, bottom: 10})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('邮箱')
}.width(90)
TextInput({placeholder: '请输入邮箱', text: $$this.companyInfo.email})
.backgroundColor('#fff').layoutWeight(1).type(InputType.Email)
.onChange((value) => {
this.isShowCode = this.initEmail !== value
})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('验证码')
}.width(90)
Row(){
TextInput({placeholder: '请输入验证码', text: $$this.companyInfo.postCode})
.backgroundColor('#fff').layoutWeight(1).type(InputType.Email)
Text('获取验证码').fontSize(12).backgroundColor('#1890ff').borderRadius(5)
.padding({top: 4, bottom: 4, left: 10, right: 10}).fontColor('#fff')
.onClick(async () => {
await getEmailCode(this.companyInfo.email)
promptAction.showToast({
message: '已发送至邮箱,请查收'
})
})
}.layoutWeight(1)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
.visibility(this.isShowCode ? Visibility.Visible : Visibility.None)
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('联系人')
}.width(90)
TextInput({placeholder: '请输入身份证号', text: $$this.companyInfo.linkMan})
.backgroundColor('#fff').layoutWeight(1)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('联系人手机')
}
TextInput({placeholder: '请输入手机号', text: $$this.companyInfo.lmTel})
.backgroundColor('#fff').layoutWeight(1).type(InputType.PhoneNumber)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('统一社会信用代码')
}
TextInput({placeholder: '请输入手机号', text: $$this.companyInfo.businessLicenseNo})
.backgroundColor('#fff').layoutWeight(1)
.showError(ValidateInputHandle(this.companyInfo.businessLicenseNo, 'businessLicenseNo') ? '' : '请正确输入社会统一信用代码')
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('营业执照')
}.width(90)
Column({space: 5}){
Image(baseUrl + this.companyInfo.businessLicensePic || $r('app.media.certificateCard')).width(80)
.onClick(async () => {
let that = this
let uploader = await uploadFile() as request.UploadTask
// 3. 监控上传错误
uploader.on('fail', (err) => {
console.log('上传错误--->', JSON.stringify(err))
})
// 4. 获取服务器返回来的数据
uploader.on('headerReceive',(res)=>{
let uploadInfo = JSON.parse(res['body']) as uploadResult
that.companyInfo.businessLicensePic = uploadInfo.fileName as string
})
})
Text('请上传营业执照副本才是扫描件').fontSize(12).fontColor('#999')
Text('图片大小: 1M以内,文件最大尺寸(px): 3508*2480').fontSize(12).fontColor('#666')
}.layoutWeight(1).margin({left: 20}).alignItems(HorizontalAlign.Start)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('地址')
}.width(70)
Text(this.pickerValue.join(' ')).layoutWeight(1).padding({top: 8, bottom: 8, left: 16, right: 16})
.backgroundColor('#fff').fontColor('#999').textOverflow({overflow: TextOverflow.Ellipsis}).maxLines(2)
.onClick(() => {
this.areaController?.open()
})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
}.backgroundColor('#fff').width('100%').padding({left: 5, right: 5}).borderRadius(10)
}.padding(10).margin({bottom: 20, top: 10}).width('100%').layoutWeight(1)
Row({ space: 10}){
Text('提交').borderRadius(5).layoutWeight(1).height(30).fontColor('#fff')
.backgroundColor('#1B65FD').fontSize(14).textAlign(TextAlign.Center)
.onClick(async () => {
if(this.companyInfo?.businessLicenseNo == '') {
return promptAction.showToast({message: '社会统一代码不能为空'})
} else if(this.companyInfo?.email == '') {
return promptAction.showToast({message: '邮箱不能为空'})
} else if(this.companyInfo?.linkMan == '') {
return promptAction.showToast({message: '联系人不能为空'})
} else if(this.companyInfo?.lmTel == '') {
return promptAction.showToast({message: '手机号不能为空'})
}
await updateCompanyInfo(this.companyInfo)
const info: AxiosResponse<companyTest> = await getCompanyInfo()
preferencesUtil.set('XF_COMPANY_INFO', JSON.stringify(info.data.data))
this.companyInfo = JSON.parse(preferencesUtil.get('XF_COMPANY_INFO', '') as string)
promptAction.showToast({
message: '修改成功',
duration: 2000
})
})
Text('图片预览').borderRadius(5).layoutWeight(1).height(30).fontColor('#fff')
.backgroundColor('#1B65FD').fontSize(14).textAlign(TextAlign.Center)
.onClick(async () => {
this.photoBrowserController.open()
})
}.width('100%').height(40).backgroundColor('#fff').padding({left: 10, right: 10})
}.width('100%').height('100%').backgroundColor('#f2f3f7')
}
}
\ No newline at end of file
... ...
import AreaPickerDialog from '../dialog/AreaPickerDialog'
import { ValidateInputHandle } from '../utils/validateInputHandle'
import { personData, personTest } from '../api/userType'
import preferencesUtil from '../utils/preferences'
import baseUrl from '../utils/baseUrl'
import { updatePersonInfo, getPersonInfo, getEmailCode } from '../api/user'
import { promptAction } from '@kit.ArkUI';
import { AxiosResponse } from '@ohos/axios'
import PhotoBrowser from '../dialog/PhotoBrowserDialog'
import { uploadFile, uploadResult } from '../utils/uploadFile'
import { request } from '@kit.BasicServicesKit'
@Entry
@Component
struct EditUser {
@Builder indicatorBuilder(icon: ResourceStr) {
Image(icon)
}
@State isShowCode: boolean = false
@State userInfo: personData = JSON.parse(preferencesUtil.get('XF_PERSON_INFO', '') as string)
@State pickerValue:string[] = ['广西壮族自治区','南宁市','青秀区']//省市区选中值
@State photoList: string[] = [baseUrl + this.userInfo.personalImg, baseUrl + this.userInfo.idImgFront, baseUrl + this.userInfo.idImgBack,]
@State initEmail: string = this.userInfo.email
areaController: CustomDialogController = new CustomDialogController({
builder: AreaPickerDialog({
value:this.pickerValue,//首次默认选中值
onChange: (value:string[]) => {//选择改变回调
this.pickerValue = value
this.userInfo.address = this.pickerValue.join(' ')
}
}),
customStyle: true
})
private selectedDate: Date = new Date('2000-01-01')
photoBrowserController: CustomDialogController = new CustomDialogController({
builder: PhotoBrowser({ imagesList: this.photoList}),
customStyle: true,
offset: { dx: 0, dy: 0 },
alignment: DialogAlignment.Top,
})
aboutToAppear(): void {
console.log(JSON.stringify(this.userInfo))
}
build() {
Column(){
Scroll(){
Column(){
Column(){
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('姓名')
}.width(90)
TextInput({placeholder: '请输入姓名', text: $$this.userInfo.personName})
.backgroundColor('#fff').layoutWeight(1)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('邮箱')
}.width(90)
TextInput({placeholder: '请输入邮箱', text: $$this.userInfo.email})
.backgroundColor('#fff').layoutWeight(1).type(InputType.Email)
.showError(ValidateInputHandle(this.userInfo.email, 'email') ? '' : '请正确输入邮箱')
.onChange((value) => {
this.isShowCode = this.initEmail !== value
})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('验证码')
}.width(90)
Row(){
TextInput({placeholder: '请输入验证码', text: $$this.userInfo.code})
.backgroundColor('#fff').layoutWeight(1)
Text('获取验证码').fontSize(12).backgroundColor('#1890ff').borderRadius(5)
.padding({top: 4, bottom: 4, left: 10, right: 10}).fontColor('#fff')
.onClick(async () => {
await getEmailCode(this.userInfo.email)
promptAction.showToast({
message: '已发送至邮箱,请查收'
})
})
}.layoutWeight(1)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
.visibility(this.isShowCode ? Visibility.Visible : Visibility.None)
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('性别')
}.width(90)
Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) {
Row() {
Radio({ value: '0', group: 'radioGroup',
indicatorType:RadioIndicatorType.CUSTOM,
indicatorBuilder:()=>{this.indicatorBuilder($r('app.media.man'))}
}).checked(this.userInfo.gender == '0')
.height(20)
.width(20)
.onChange(() => {
this.userInfo.gender = '0'
})
Text('男')
}
Row() {
Radio({ value: '1', group: 'radioGroup',
indicatorType:RadioIndicatorType.CUSTOM,
indicatorBuilder:()=>{this.indicatorBuilder($r('app.media.pain_woman'))}
}).checked(this.userInfo.gender == '1')
.height(20)
.width(20)
.onChange(() => {
this.userInfo.gender = '1'
})
Text('女')
}
}
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('出生日期')
}.width(90)
Text(this.userInfo.birthDate).padding({top: 8, bottom: 8, left: 16, right: 16})
.backgroundColor('#fff').layoutWeight(1).fontColor('#000').onClick(() => {
CalendarPickerDialog.show({
selected: this.selectedDate,
onAccept: (value) => {
this.userInfo.birthDate = JSON.stringify(value).slice(1, 11)
}
})
})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('身份证号')
}.width(90)
TextInput({placeholder: '请输入身份证号', text: $$this.userInfo.idNo})
.backgroundColor('#fff').layoutWeight(1).type(InputType.Number)
.showError(ValidateInputHandle(this.userInfo.idNo, 'idCard') ? '' : '请正确输入身份证')
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('手机号')
}.width(90)
TextInput({placeholder: '请输入手机号', text: $$this.userInfo.phone})
.backgroundColor('#fff').layoutWeight(1).type(InputType.PhoneNumber)
.showError(ValidateInputHandle(this.userInfo.phone, 'phone') ? '' : '请正确输入手机号')
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('个人照片')
}.width(90)
Row(){
Image(baseUrl + this.userInfo.personalImg || $r('app.media.userAvatar')).width(80)
.onClick(async () => {
let that = this
let uploader = await uploadFile() as request.UploadTask
// 3. 监控上传错误
uploader.on('fail', (err) => {
console.log('上传错误--->', JSON.stringify(err))
})
// 4. 获取服务器返回来的数据
uploader.on('headerReceive',(res)=>{
let uploadInfo = JSON.parse(res['body']) as uploadResult
that.userInfo.personalImg = uploadInfo.fileName as string
})
})
}.layoutWeight(1).margin({left: 20})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('证件正面')
}.width(90)
Row(){
Image(baseUrl + this.userInfo.idImgFront || $r('app.media.idCard')).width(120)
.onClick(async () => {
let that = this
let uploader = await uploadFile() as request.UploadTask
// 3. 监控上传错误
uploader.on('fail', (err) => {
console.log('上传错误--->', JSON.stringify(err))
})
// 4. 获取服务器返回来的数据
uploader.on('headerReceive',(res)=>{
let uploadInfo = JSON.parse(res['body']) as uploadResult
that.userInfo.idImgFront = uploadInfo.fileName as string
})
})
}.layoutWeight(1).margin({left: 20})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('证件反面')
}.width(90)
Row(){
Image(baseUrl + this.userInfo.idImgBack || $r('app.media.unIdCard')).width(120)
.onClick(async () => {
let that = this
let uploader = await uploadFile() as request.UploadTask
// 3. 监控上传错误
uploader.on('fail', (err) => {
console.log('上传错误--->', JSON.stringify(err))
})
// 4. 获取服务器返回来的数据
uploader.on('headerReceive',(res)=>{
let uploadInfo = JSON.parse(res['body']) as uploadResult
that.userInfo.idImgBack = uploadInfo.fileName as string
})
})
}.layoutWeight(1).margin({left: 20})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('地址')
}.width(70)
Text(this.pickerValue.join(' ')).layoutWeight(1).padding({top: 8, bottom: 8, left: 16, right: 16})
.backgroundColor('#fff').fontColor('#999').textOverflow({overflow: TextOverflow.Ellipsis}).maxLines(2)
.onClick(() => {
this.areaController?.open()
})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
}.backgroundColor('#fff').width('100%').padding({left: 5, right: 5}).borderRadius(10)
}.padding(10).margin({bottom: 20, top: 10})
}.layoutWeight(1).scrollBar(BarState.Off)
Row({ space: 10}){
Text('提交').borderRadius(5).layoutWeight(1).height(30).fontColor('#fff')
.backgroundColor('#1B65FD').fontSize(14).textAlign(TextAlign.Center)
.onClick(async () => {
if(this.userInfo?.personName == '') {
return promptAction.showToast({message: '姓名不能为空'})
} else if(this.userInfo?.email == '') {
return promptAction.showToast({message: '邮箱不能为空'})
} else if(this.userInfo?.idNo == '') {
return promptAction.showToast({message: '身份证不能为空'})
} else if(this.userInfo?.phone == '') {
return promptAction.showToast({message: '手机号不能为空'})
} else if(this.userInfo?.idImgFront == '') {
return promptAction.showToast({message: '身份证件不能为空'})
} else if(this.userInfo?.idImgBack == '') {
return promptAction.showToast({message: '身份证件不能为空'})
} else if(this.userInfo?.personalImg == '') {
return promptAction.showToast({message: '请上传头像'})
}
await updatePersonInfo(this.userInfo)
const info: AxiosResponse<personTest> = await getPersonInfo()
preferencesUtil.set('XF_PERSON_INFO', JSON.stringify(info.data.data))
this.userInfo = JSON.parse(preferencesUtil.get('XF_PERSON_INFO', '') as string)
promptAction.showToast({
message: '修改成功',
duration: 2000
})
})
Text('图片预览').borderRadius(5).layoutWeight(1).height(30).fontColor('#fff')
.backgroundColor('#1B65FD').fontSize(14).textAlign(TextAlign.Center)
.onClick(async () => {
this.photoBrowserController.open()
})
}.width('100%').height(40).backgroundColor('#fff').padding({left: 10, right: 10})
}.width('100%').height('100%').backgroundColor('#f2f3f7')
}
}
\ No newline at end of file
... ...
import { router, promptAction } from '@kit.ArkUI'
import { getMalfunctionList, updateMalfunctionList } from '../api/originalRecords'
import { MalfunctionListTest, MalfunctionListRow } from '../api/recordsType'
import { AxiosResponse } from '@ohos/axios'
import ThemeStaticTest from '../components/ThemeStaticText'
import ImportRecordDialog from '../dialog/ImportRecordsDialog'
interface routerParams {
applyCompanyName: string
companyName: string
reportName: string
reportId: number
reportType: string
}
@Extend(Text) function primary () {
.fontColor('#1890ff').backgroundColor('#e8f4ff')
.borderColor('#d1e9ff')
}
@Extend(Text) function danger () {
.fontColor('#ff4949').backgroundColor('#ffeded')
.borderColor('#ffdbdb')
}
interface newArrType {
malfunctionPart: string
malfunctionDes: string
security: string
maintenanceMethod: string
malfunctionConfirm: string
}
// 判断是否填写正确数值
let testArr = (arr: MalfunctionListRow[]): boolean => {
let newArr: newArrType[] = arr.map(item => {
return {
malfunctionPart: item.malfunctionPart,
malfunctionDes: item.malfunctionDes,
security: item.security,
maintenanceMethod: item.maintenanceMethod,
malfunctionConfirm: item.malfunctionConfirm
} as newArrType
})
return newArr.every(arrItem => arrItem.malfunctionPart !== '' && arrItem.malfunctionDes !== '' && arrItem.security !== '' && arrItem.maintenanceMethod !== '' && arrItem.malfunctionConfirm !== '')
}
let routerQuery = router.getParams() as routerParams
@Entry
@Component
struct FailureMaintenance {
@State message: string = 'Hello World';
@State malfunctionList: MalfunctionListRow[] = [
{
applyCompanyComment: "",
applyCompanyName: '',
companyName: '',
findTime: '请选择日期',
maintenanceComment: "",
maintenanceMethod: "",
malfunctionConfirm: "",
malfunctionDes: "",
malfunctionPart: "",
remark: '',
security: "",
reportId: routerQuery.reportId
}
]
@State findTime: string | null |undefined = ''
@State maintenanceComment: string | null |undefined = ''
@State applyCompanyComment: string | null |undefined = ''
ImportController: CustomDialogController = new CustomDialogController({
builder: ImportRecordDialog({
applyCompanyName: routerQuery.applyCompanyName,
reportId: routerQuery.reportId,
onChange: async () => {
const malfunction: AxiosResponse<MalfunctionListTest> = await getMalfunctionList({ pageNum: 1, pageSize: 500, reportId: routerQuery?.reportId })
if(malfunction.data.rows.length !== 0) {
this.malfunctionList = malfunction.data.rows
}
this.findTime = this.malfunctionList[0]?.findTime
this.maintenanceComment = this.malfunctionList[0]?.maintenanceComment
this.applyCompanyComment = this.malfunctionList[0]?.applyCompanyComment
}
}),
customStyle: true,
offset: { dx: 0, dy: 0 },
alignment: DialogAlignment.Bottom,
cornerRadius: 10
})
async aboutToAppear() {
// 获取设施故障列表
const malfunction: AxiosResponse<MalfunctionListTest> = await getMalfunctionList({ pageNum: 1, pageSize: 500, reportId: routerQuery?.reportId })
if(malfunction.data.rows.length !== 0) {
this.malfunctionList = malfunction.data.rows
}
this.findTime = this.malfunctionList[0]?.findTime
this.maintenanceComment = this.malfunctionList[0]?.maintenanceComment
this.applyCompanyComment = this.malfunctionList[0]?.applyCompanyComment
}
build() {
Column(){
Column(){
Column(){
// 基本信息
Row(){
Text('委托单位:').width(120)
Text(routerQuery?.applyCompanyName).fontSize(14)
}.border({width: {bottom: 1}, color: '#eee'}).padding(10).width('100%').justifyContent(FlexAlign.Start)
Row(){
Text('项目类型:').width(120)
ThemeStaticTest({
textValue: routerQuery.reportType
})
}.border({width: {bottom: 1}, color: '#eee'}).padding(10).width('100%').justifyContent(FlexAlign.Start)
Row(){
Text('维护保养单位:').width(120)
Text(routerQuery?.companyName).fontSize(14)
}.border({width: {bottom: 1}, color: '#eee'}).padding(10).width('100%').justifyContent(FlexAlign.Start)
Row(){
Text('维护保养项目:').width(120)
Text(routerQuery?.reportName).fontSize(14)
}.border({width: {bottom: 1}, color: '#eee'}).padding(10).width('100%').justifyContent(FlexAlign.Start)
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('发现日期:')
}.width(120)
Text(this.findTime).padding({top: 8, bottom: 8, left: 16, right: 16}).fontSize(14)
.backgroundColor('#fff').layoutWeight(1).fontColor('#000').onClick(() => {
CalendarPickerDialog.show({
onAccept: (value) => {
this.findTime = JSON.stringify(value).slice(1, 11)
this.malfunctionList[0].findTime = JSON.stringify(value).slice(1, 11)
}
})
})
}.padding({top: 10, bottom: 10})
// 故障信息
List(){
ForEach(this.malfunctionList, (item: MalfunctionListRow, index: number) => {
ListItem(){
Column(){
Row(){
Text((index + 1).toString()).width(40).height(40).textAlign(TextAlign.Center).borderRadius(4)
.backgroundColor('#fafafa')
Row({space: 10}){
Text('新增').width(120).height(30).textAlign(TextAlign.Center).primary().
borderWidth(1).borderRadius(4).fontSize(14)
.onClick(() => {
let Malfunction: MalfunctionListRow = {
maintenanceMethod: '',
malfunctionPart: '',
malfunctionDes: '',
malfunctionConfirm: '',
remark: '',
reportId: routerQuery.reportId,
security: ''
}
this.malfunctionList.push(Malfunction)
promptAction.showToast({
message: '新增成功,下滑填写信息'
})
})
Text('删除').width(120).height(30).textAlign(TextAlign.Center).danger()
.borderWidth(1).borderRadius(4).fontSize(14)
.onClick(() => {
if(this.malfunctionList.length == 1){
promptAction.showToast({message: '至少保留一个'})
} else {
this.malfunctionList = this.malfunctionList.filter((children: MalfunctionListRow) => children.malfunctionId !== item.malfunctionId )
this.malfunctionList[0].findTime = this.findTime
this.malfunctionList[0].maintenanceComment = this.maintenanceComment
this.malfunctionList[0].applyCompanyComment = this.applyCompanyComment
}
})
}
}.width('100%').justifyContent(FlexAlign.SpaceBetween)
Row({space: 30}){
Row(){
Image($r('app.media.require')).width(20)
Text('故障发生部位')
}.width(100)
TextInput({placeholder: '请输入内容', text: item.malfunctionPart})
.backgroundColor('#fff').layoutWeight(1).fontSize(14)
.onChange((value) => {
item.malfunctionPart = value
})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row({space: 30}){
Row(){
Image($r('app.media.require')).width(20)
Text('故障情况及影响')
}.width(100)
TextArea({
text: item.malfunctionDes,
placeholder: '请输入内容'
}).layoutWeight(1).height(80).borderRadius(5).backgroundColor('#fff')
.border({width: 1, color: "#eee"}).fontSize(14)
.onChange((value) => {
item.malfunctionDes = value
})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row({space: 30}){
Row(){
Image($r('app.media.require')).width(20)
Text('采取的应急措施')
}.width(100)
TextArea({
text: item.security,
placeholder: '请输入内容'
}).layoutWeight(1).height(80).borderRadius(5).backgroundColor('#fff')
.border({width: 1, color: "#eee"}).fontSize(14)
.onChange((value) => {
item.security = value
})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row({space: 30}){
Row(){
Image($r('app.media.require')).width(20)
Text('更换设备及材料情况')
}.width(100)
TextArea({
text: item.maintenanceMethod,
placeholder: '请输入内容'
}).layoutWeight(1).height(80).borderRadius(5).backgroundColor('#fff')
.border({width: 1, color: "#eee"}).fontSize(14)
.onChange((value) => {
item.maintenanceMethod = value
})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row({space: 30}){
Row(){
Image($r('app.media.require')).width(20)
Text('处理结果')
}.width(100)
TextArea({
text: item.malfunctionConfirm,
placeholder: '请输入内容'
}).layoutWeight(1).height(80).borderRadius(5).backgroundColor('#fff')
.border({width: 1, color: "#eee"}).fontSize(14)
.onChange((value) => {
item.malfunctionConfirm = value
})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row({space: 30}){
Row(){
Text('备注')
}.width(100)
TextArea({
text: item.remark,
placeholder: '请输入内容'
}).layoutWeight(1).height(80).borderRadius(5).backgroundColor('#fff')
.border({width: 1, color: "#eee"}).fontSize(14)
.onChange((value) => {
item.remark = value
})
}.padding({top: 10, bottom: 10})
}.border({width: 1, color: '#eee'}).borderStyle(BorderStyle.Dashed).padding(4)
}.padding(10)
})
ListItem(){
Row({space: 30}){
Row(){
Image($r('app.media.require')).width(20)
Text('维护保养单位意见')
}.width(100)
TextArea({
text: this.maintenanceComment,
placeholder: '请输入内容'
}).layoutWeight(1).height(80).borderRadius(5).backgroundColor('#fff').fontSize(14)
.border({width: 1, color: "#eee"})
.onChange((value) => {
this.maintenanceComment = value
this.malfunctionList[0].maintenanceComment = value
})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
}.padding(10)
ListItem(){
Row({space: 30}){
Row(){
Image($r('app.media.require')).width(20)
Text('委托单位意见').margin({right: 10})
}.width(100)
TextArea({
text: this.applyCompanyComment,
placeholder: '请输入内容'
}).layoutWeight(1).height(80).borderRadius(5).backgroundColor('#fff').fontSize(14)
.border({width: 1, color: "#eee"}).onChange((value) => {
this.applyCompanyComment = value
this.malfunctionList[0].applyCompanyComment = value
})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
}.padding(10)
}.layoutWeight(1)
}.width('100%').height('100%').backgroundColor('#fff').borderRadius(4).padding({top: 10, bottom: 10})
}.layoutWeight(1).width('100%').padding(10)
Row({space:10}){
Text('提交').borderRadius(5).width('100%').height(30).fontColor('#fff')
.backgroundColor('#1B65FD').fontSize(14).textAlign(TextAlign.Center)
.layoutWeight(1)
.onClick(async () => {
if(this.malfunctionList[0].applyCompanyComment == '') {
return promptAction.showToast({message: '委托单位意见不能为空'})
} else if(this.malfunctionList[0].maintenanceComment == '') {
return promptAction.showToast({message: '维护保养单位意见不能为空'})
} else if(this.malfunctionList[0].findTime == '请选择日期') {
return promptAction.showToast({message: '日期不能为空'})
}
if(!testArr(this.malfunctionList)) {
return promptAction.showToast({message: '*号为必填项'})
}
await updateMalfunctionList({reportId: routerQuery?.reportId, list: this.malfunctionList})
// 获取设施故障列表
const malfunction: AxiosResponse<MalfunctionListTest> = await getMalfunctionList({ pageNum: 1, pageSize: 500, reportId: routerQuery?.reportId })
this.malfunctionList = malfunction.data.rows
promptAction.showToast({message: '更新成功'})
})
Text('导入').borderRadius(5).width('100%').height(30).fontColor('#fff')
.backgroundColor('#1B65FD').fontSize(14).textAlign(TextAlign.Center)
.layoutWeight(1)
.onClick(() => {
this.ImportController.open()
})
Text('清除').borderRadius(5).width('100%').height(30).fontColor('#fff')
.backgroundColor('#1B65FD').fontSize(14).textAlign(TextAlign.Center)
.layoutWeight(1).onClick(() => {
AlertDialog.show({
title: '',
message: '删除后无法找回,确认删除全部故障处理记录并提交?',
autoCancel: true,
alignment: DialogAlignment.Center,
gridCount: 4,
offset: { dx: 0, dy: -20 },
buttonDirection: DialogButtonDirection.HORIZONTAL,
buttons: [
{
value: '取消',
action: () => {
console.info('Callback when button1 is clicked')
}
},
{
value: '确认',
action: async () => {
await updateMalfunctionList({reportId: routerQuery?.reportId, list: []})
this.malfunctionList = [{
applyCompanyComment: "",
applyCompanyName: '',
companyName: '',
findTime: '请选择日期',
maintenanceComment: "",
maintenanceMethod: "",
malfunctionConfirm: "",
malfunctionDes: "",
malfunctionPart: "",
remark: '',
security: "",
reportId: routerQuery.reportId
}]
this.findTime = '请选择日期'
this.maintenanceComment = ''
this.applyCompanyComment = ''
promptAction.showToast({message: '更新成功'})
}
}
],
cancel: () => {
console.info('Closed callbacks')
}
})
})
}.width('100%').height(40).backgroundColor('#fff').padding({left: 10, right: 10})
}.width('100%').height('100%').backgroundColor('#f2f3f7')
}
}
\ No newline at end of file
... ...
import { router } from '@kit.ArkUI'
import { ProjectList } from '../api/recordsType'
import { webview } from '@kit.ArkWeb'
import { basePath } from '../utils/baseUrl'
import preferencesUtils from '../utils/preferences'
let routerInfo: ProjectList = router.getParams() as ProjectList
@Entry
@Component
struct FireProtectionDetail {
controller: RichEditorController = new RichEditorController();
options: RichEditorOptions = { controller: this.controller };
@State projectInfo: ProjectList = routerInfo
webviewController: webview.WebviewController = new webview.WebviewController()
build() {
Column(){
Web({
src: `${basePath}/report/handle?id=${this.projectInfo.reportId}&pid=${this.projectInfo.projectId}&token=${preferencesUtils.get('XF_TOKEN', '')}`,
controller: this.webviewController,
}).mixedMode(MixedMode.All).javaScriptAccess(true).domStorageAccess(true)
}.height('100%').width('100%')
}
}
\ No newline at end of file
... ...
import HomePage from '../components/HomePage'
import MainPage from '../components/MainPage'
import DialogTip from '../dialog/DialogTip'
import { personData, companyData, personCertificateTest, personCertificateRow } from '../api/userType'
import { getPersonalCertificate } from '../api/user'
import preferencesUtil from '../utils/preferences'
import { getNoticeDetail, noticeRow, noticeDetailTest } from '../api/notice'
import { AxiosResponse } from '@ohos/axios'
@Entry
@Component
struct Index {
// 通知公告
@State noticeInfo: noticeRow = {
noticeTitle: '',
noticeContent: '',
noticeType: '2'
}
// 证书信息
@State personCertificateInfo: personCertificateRow = {
certificateName: '',
certificateLevel: '',
certificateNo: '',
certificateId: 1,
certificateImg: '',
issueDate: ''
}
// 是否为编辑
@State isEdit: boolean = false
async aboutToAppear() {
const noticeRes: AxiosResponse<noticeDetailTest> = await getNoticeDetail(13)
this.noticeInfo = noticeRes.data.data
if (preferencesUtil.get('XF_TOKEN', '')) {
this.dialogController.open()
}
}
@State userInfo: personData = {
createBy: '',
createTime: '',
updateBy: '',
updateTime: '',
remark: '',
personId: 0,
personName: '',
email: '',
gender: '',
birthDate: '',
idNo: '',
phone: '',
personalImg: '',
idImgFront: '',
idImgBack: '',
address: '',
userId: 0,
username: '',
state: '',
companyId: 0,
}
@State companyInfo: companyData = {
createBy: null,
createTime: null,
updateBy: null,
updateTime: '',
remark: null,
companyId: 65,
companyName: '',
province: '',
city: '',
county: '',
address: '',
legalPerson: null,
lpTel: null,
linkMan: '',
lmTel: '',
companyTel: null,
fax: null,
postCode: null,
email: '',
website: null,
floorage: 0,
siteVoucher: '',
businessLicenseNo: '',
businessStartTime: null,
businessEndTime: null,
businessLicensePic: '',
businessScope: null,
peopleNum: 0,
companyIntroduce: null,
registeredCapital: null,
compangyPic: '',
memo: null,
state: '',
companyType: '',
isShow: null,
isValidVedio: null,
userId: 0,
username: '',
level: null,
regionCode: null,
levelModifyDate: null,
endTime: '',
}
roleName = preferencesUtil.get('XF_ROLE_NAME', '')
async onPageShow() {
let personId = preferencesUtil.get('XF_PERSON_ID', 0)
if(preferencesUtil.get('XF_PERSON_INFO', '') !== '') {
this.userInfo = JSON.parse(preferencesUtil.get('XF_PERSON_INFO', '') as string)
}
if(preferencesUtil.get('XF_COMPANY_INFO', '') !== '') {
this.companyInfo = JSON.parse(preferencesUtil.get('XF_COMPANY_INFO', '') as string)
}
if(this.roleName == 'person' || this.roleName == 'unapprovedPerson') {
// 获取个人证书信息
const result: AxiosResponse<personCertificateTest> = await getPersonalCertificate({pageNum: 1, pageSize: 10, personId: Number(personId)})
this.isEdit = result.data.rows.length > 0
if(result.data.rows.length > 0) {
this.personCertificateInfo = result.data.rows[0]
}
}
}
@State currentIndex: number = 0
@Builder tabBuilder(title: string, targetIndex: number, selectedImg: Resource, normalImg: Resource) {
Column({space: 5}) {
Image(this.currentIndex === targetIndex ? selectedImg : normalImg)
.size({ width: 25, height: 25 })
Text(title)
.fontColor(this.currentIndex === targetIndex ? '#6D9DFF' : '#999')
}
.width('100%')
.height(50)
.justifyContent(FlexAlign.Center)
}
dialogController: CustomDialogController = new CustomDialogController({
builder: DialogTip({
noticeDetail: this.noticeInfo
}),
autoCancel: false,
cornerRadius: 10
})
build() {
Tabs({barPosition: BarPosition.End}){
TabContent() {
HomePage()
}.layoutWeight(1)
.tabBar(this.tabBuilder('首页', 0, $r('app.media.home_active'), $r('app.media.home')))
TabContent() {
MainPage({
userInfo: this.userInfo,
companyInfo: this.companyInfo,
personCertificateInfo: this.personCertificateInfo,
isEdit: this.isEdit
})
}
.tabBar(this.tabBuilder('我的', 1, $r('app.media.my_active'), $r('app.media.my')))
}.width('100%').height('100%').onChange(async (index) => {
this.currentIndex = index
})
}
}
\ No newline at end of file
... ...
import { userForm, loginType, personTest, InfoTest, companyTest } from '../api/userType'
import { AxiosResponse } from '@ohos/axios'
import { login, getPersonInfo, getInfo, getCompanyInfo } from '../api/user'
import { router, promptAction } from '@kit.ArkUI'
import SelectRegDialog from '../dialog/SelectRegTypeDialog'
import preferencesUtil from '../utils/preferences'
let account: string = preferencesUtil.get('XF_ACCOUNT', '') as string || ''
let password: string = preferencesUtil.get('XF_PASSWORD', '') as string || ''
@Entry
@Component
struct Login {
@State loginForm: userForm = {
username: '',
password: ''
}
// 同意政策
@State agreeSelect: boolean = false
// 记住密码
@State rememberSelect: boolean = preferencesUtil.get('XF_REMEMBER', false) as boolean
aboutToAppear(): void {
if(this.rememberSelect) {
this.loginForm.username = account
this.loginForm.password = password
}
if(preferencesUtil.get('XF_TOKEN', '') !== '') {
router.replaceUrl({
url: 'pages/Index'
})
}
}
selectRegController: CustomDialogController = new CustomDialogController({
builder: SelectRegDialog(),
alignment: DialogAlignment.Bottom
})
build() {
Column(){
Column({space: 20}){
Image($r('app.media.logo')).width(100).borderRadius(22)
Text('消防维保助手').fontSize(30).fontWeight(500).fontColor('#fff')
}.margin({top: 30, bottom: 50})
Column(){
Row(){
Image($r('app.media.account')).width(20)
TextInput({text: $$this.loginForm.username, placeholder: '请填写用户名'})
.backgroundColor(Color.Transparent).fontColor('#fff').fontSize(14)
.borderRadius(0).layoutWeight(1).placeholderColor('#fff')
}.width('100%').border({width:{bottom: 1}, color: '#eee'})
Row(){
Image($r('app.media.password')).width(20)
TextInput({text: $$this.loginForm.password, placeholder: '请填写密码'}).type(InputType.Password)
.backgroundColor(Color.Transparent).fontColor('#fff').fontSize(14)
.borderRadius(0).layoutWeight(1).placeholderColor('#fff')
}.width('100%').border({width:{bottom: 1}, color: '#eee'})
}.margin({bottom: 10}).padding({left: 10, right: 10})
Column({space: 10}){
Row({space: 5}){
Checkbox({group: 'user' })
.select(this.agreeSelect)
.selectedColor('#1890ff')
.shape(CheckBoxShape.CIRCLE)
.width(16).height(16)
.mark({
size: 10,
strokeWidth: 5
})
.onChange((value) => {
this.agreeSelect = value
})
Row(){
Text('已阅读并同意').fontSize(12).fontColor('#fff')
Text('《用户协议》').fontSize(12).fontColor(Color.Red)
.onClick(() => {
router.pushUrl({
url: 'pages/UserAgreement'
})
})
Text('和').fontSize(12).fontColor('#fff')
Text('《隐私政策》').fontSize(12).fontColor(Color.Red)
.onClick(() => {
router.pushUrl({
url: 'pages/PrivacyPolicy'
})
})
}
}.width('100%').justifyContent(FlexAlign.Start)
Row({space: 5}){
Checkbox({ group: 'password' })
.select(this.rememberSelect)
.selectedColor('#1890ff')
.shape(CheckBoxShape.ROUNDED_SQUARE)
.width(16).height(16)
.mark({
size: 10,
strokeWidth: 5
})
.onChange((value: boolean) => {
this.rememberSelect = value
preferencesUtil.set('XF_REMEMBER', value)
if(value) {
preferencesUtil.set('XF_ACCOUNT', this.loginForm.username)
preferencesUtil.set('XF_PASSWORD', this.loginForm.password)
} else {
preferencesUtil.delete('XF_ACCOUNT')
preferencesUtil.delete('XF_PASSWORD')
}
})
Text('记住密码').fontSize(12).fontColor('#fff')
}.width('100%').justifyContent(FlexAlign.Start)
}.alignItems(HorizontalAlign.Start).padding({left: 10, right: 10})
Button('立即登录')
.width('80%').height(40)
.fontSize(16).fontColor('#1890ff')
.borderRadius(20).backgroundColor(Color.White)
.margin({top: 20})
.onClick(async () => {
if(!this.agreeSelect) {
return promptAction.showToast({
message: '请勾选同意用户协议与隐私政策'
})
}
if(this.rememberSelect) {
preferencesUtil.set('XF_ACCOUNT', this.loginForm.username)
preferencesUtil.set('XF_PASSWORD', this.loginForm.password)
}
const res: AxiosResponse<loginType> = await login(this.loginForm)
const token = res.data.token
await preferencesUtil.set('XF_TOKEN', token)
const accountInfo: AxiosResponse<InfoTest> = await getInfo()
let roleName: string = accountInfo.data.roles[0] || ''
await preferencesUtil.set('XF_ROLE_NAME', roleName)
if(roleName == 'person'){
let personInfo: AxiosResponse<personTest> = await getPersonInfo()
preferencesUtil.set('XF_PERSON_INFO', JSON.stringify(personInfo.data.data))
preferencesUtil.set('XF_COMPANY_ID', personInfo.data.data.companyId)
preferencesUtil.set('XF_PERSON_ID', personInfo.data.data.personId)
preferencesUtil.set('XF_USERNAME', personInfo.data.data.username)
} else if(roleName == 'company'){
let companyInfo: AxiosResponse<companyTest> = await getCompanyInfo()
preferencesUtil.set('XF_COMPANY_INFO', JSON.stringify(companyInfo.data.data))
preferencesUtil.set('XF_COMPANY_ID', companyInfo.data.data.companyId)
preferencesUtil.set('XF_USERNAME', companyInfo.data.data.username)
preferencesUtil.set('XF_USER_ID', companyInfo.data.data.userId)
} else {
let personInfo: AxiosResponse<personTest> = await getPersonInfo()
preferencesUtil.set('XF_PERSON_INFO', JSON.stringify(personInfo.data.data))
preferencesUtil.set('XF_COMPANY_ID', personInfo.data.data.companyId || 0)
preferencesUtil.set('XF_PERSON_ID', personInfo.data.data.personId)
preferencesUtil.set('XF_USERNAME', personInfo.data.data.username)
}
router.replaceUrl({
url: 'pages/Index'
})
})
Row({space: 10}){
Row({ space: 5}){
Text('忘记密码').width(15).fontSize(14).height(60).fontColor('#fff')
Image($r('app.media.right')).width(14)
}.width(50).height(100).linearGradient({
angle: GradientDirection.Bottom, colors: [['#72b8d6', 0.0], ['#70a6d8', 0.5]]
}).borderRadius({topRight: 50, bottomRight: 50}).justifyContent(FlexAlign.End).padding(10)
.onClick(() => {
router.pushUrl({
url: 'pages/UpdatePassword'
})
})
Column({space: 10}){
Text('监管工具箱').fontSize(14).fontColor('#fff')
Text('立即使用').height(30).fontSize(14).fontColor('#1890ff').width(120).textAlign(TextAlign.Center)
.borderRadius(15).backgroundColor('#fff')
}.layoutWeight(1).height(80).linearGradient({
angle: GradientDirection.Bottom, colors: [['#72b8d6', 0.0], ['#70a6d8', 0.5]]
}).borderRadius(40).justifyContent(FlexAlign.Center)
.onClick(() => {
router.pushUrl({
url: 'pages/ToolBox'
})
})
Row({space: 5}){
Image($r('app.media.left')).width(14)
Text('立即注册').width(15).fontSize(14).height(60).fontColor('#fff')
}.width(50).height(100).linearGradient({
angle: GradientDirection.Bottom, colors: [['#72b8d6', 0.0], ['#70a6d8', 0.5]]
}).borderRadius({topLeft: 50, bottomLeft: 50}).justifyContent(FlexAlign.Start).padding(10)
.onClick(() => {
this.selectRegController.open()
})
}.width('100%').height(100).justifyContent(FlexAlign.SpaceBetween)
.position({x: 0, y: '80%'})
Text('Ⓒ 广西世纪创软信息技术有限公司\n' +
'非广西消防救援总队官方出品').position({x: 0, y: '96%'}).fontSize(12).fontColor('#000').width('100%')
.textAlign(TextAlign.Center)
}.width('100%').height('100%').backgroundImage($r('app.media.login_back'))
.backgroundImageSize({width: '100%'})
.expandSafeArea([SafeAreaType.SYSTEM])
}
}
\ No newline at end of file
... ...
import { router } from '@kit.ArkUI'
import { webview } from '@kit.ArkWeb'
import preferencesUtils from '../utils/preferences'
import { basePath } from '../utils/baseUrl'
interface routerType {
reportId: number
}
let routerParams = router.getParams() as routerType
let reportId = routerParams.reportId
@Entry
@Component
struct LookRecords {
webviewController: webview.WebviewController = new webview.WebviewController()
build() {
Column(){
Web({
src: `${basePath}/report/record?id=${reportId}&token=${preferencesUtils.get('XF_TOKEN', '')}&time=${new Date().getTime()}&type=${preferencesUtils.get('XF_ROLE_NAME', '')}&username=${preferencesUtils.get('XF_USERNAME', '')}`,
controller: this.webviewController,
}).mixedMode(MixedMode.All).javaScriptAccess(true).domStorageAccess(true)
}.width('100%').height('100%').backgroundColor('#f2f3f7')
}
}
\ No newline at end of file
... ...
import { router } from '@kit.ArkUI'
import { webview } from '@kit.ArkWeb'
import preferencesUtils from '../utils/preferences'
import { basePath } from '../utils/baseUrl'
interface routerType {
reportId: number,
pid: number
}
let routerParams = router.getParams() as routerType
let reportId = routerParams.reportId
let pid = routerParams.pid
@Entry
@Component
struct LookRecords {
webviewController: webview.WebviewController = new webview.WebviewController()
build() {
Column(){
Web({
src: `${basePath}/report/record?id=${reportId}&token=${preferencesUtils.get('XF_TOKEN', '')}&time=${new Date().getTime()}&pid=${pid}&type=${preferencesUtils.get('XF_ROLE_NAME', '')}&username=${preferencesUtils.get('XF_USERNAME', '')}`,
controller: this.webviewController,
}).mixedMode(MixedMode.All).javaScriptAccess(true).domStorageAccess(true)
}.width('100%').height('100%').backgroundColor('#f2f3f7')
}
}
\ No newline at end of file
... ...
import { getRecordsList, getMaintenanceType, getMaintenanceState } from '../api/originalRecords'
import { QueryParams, RecordsList, Row } from '../api/recordsType'
import { quarterTest, quarterType } from '../api/options/optionsType'
import { AxiosResponse } from '@ohos/axios'
import FilterDialog from '../dialog/FilterDialog'
import preferencesUtil from '../utils/preferences'
import { promptAction, router } from '@kit.ArkUI'
import ThemeTest from '../components/ThemeText'
interface routerParams {
reportName: string
}
@Entry
@Component
struct MaintenanceRecords {
// 记录类型列表
@State maintenanceTypeList: quarterType[] = []
// 记录state列表
@State maintenanceStateList: quarterType[] = []
@State params: QueryParams = {
pageNum: 1,
pageSize: 10,
stateQuery: '3',
}
@State totalAll: number = 0
// 原始记录列表
@State recordsList: Row[] = []
dialogController: CustomDialogController = new CustomDialogController({
builder: FilterDialog({
typeLists: this.maintenanceTypeList,
statusLists: this.maintenanceStateList,
recordsList: this.recordsList,
params: this.params,
totalAll: this.totalAll
}),
alignment: DialogAlignment.Top,
customStyle: false,
cornerRadius: 10
})
@State refreshing: boolean = false;
@State refreshOffset: number = 0;
@State refreshState: RefreshStatus = RefreshStatus.Inactive;
@State canLoad: boolean = false;
@State isLoading: boolean = false;
@State loadingText: string = ''
// 刷新测试数据
private refreshData(){
this.recordsList = []
this.params = {
pageSize: 10,
pageNum: 1,
stateQuery: '3'
}
const companyId: number = preferencesUtil.get('XF_COMPANY_ID', 0) as number
const personId: number = preferencesUtil.get('XF_PERSON_ID', 0) as number
this.params.companyId = companyId
if(this.roleName == 'person') {
this.params.technicalDirectorId = personId
}
getRecordsList(this.params).then((res: AxiosResponse<RecordsList>) => {
this.recordsList = res.data.rows
this.totalAll = res.data.total
this.refreshing = false;
})
}
// 加载更多测试数据
private loadMoreData(){
if(this.params.pageSize >= this.totalAll) {
this.isLoading = false
this.loadingText = '已加载全部数据'
}else {
this.params.pageSize += 10
this.loadingText = '加载中'
getRecordsList(this.params).then((res: AxiosResponse<RecordsList>) => {
this.recordsList = res.data.rows
this.totalAll = res.data.total
this.isLoading = false
})
}
}
roleName = preferencesUtil.get('XF_ROLE_NAME', '')
aboutToAppear(): void {
let routerParams = router.getParams() as routerParams
let reportName: string | undefined = routerParams?.reportName
if(reportName) {
this.params.reportName = reportName
}
const companyId: number = preferencesUtil.get('XF_COMPANY_ID', 0) as number
const personId: number = preferencesUtil.get('XF_PERSON_ID', 0) as number
this.params.companyId = companyId
if(this.roleName == 'person') {
this.params.technicalDirectorId = personId
}
getMaintenanceType().then((res: AxiosResponse<quarterTest>) => {
this.maintenanceTypeList = res.data.data
})
getMaintenanceState().then((res: AxiosResponse<quarterTest>) => {
this.maintenanceStateList = res.data.data
})
}
onPageShow(): void {
getRecordsList(this.params).then((res: AxiosResponse<RecordsList>) => {
this.recordsList = res.data.rows
this.totalAll = res.data.total
})
}
// 获取类型
getType = (arr: quarterType[], value: string): string => {
const newValue = arr.filter((item: quarterType) => item.dictValue == value)
return newValue[0]?.dictLabel || '月度'
}
// 获取主题
getPrimary = (arr: quarterType[], value: string): string => {
const newValue = arr.filter((item: quarterType) => item.dictValue == value)
return newValue[0]?.listClass || 'info'
}
@Builder
refreshBuilder() {
Stack({ alignContent: Alignment.Bottom }) {
// 可以通过刷新状态控制是否存在Progress组件
// 当刷新状态处于下拉中或刷新中状态时Progress组件才存在
if (this.refreshState != RefreshStatus.Inactive && this.refreshState != RefreshStatus.Done) {
Row() {
LoadingProgress().height(32)
Text("Refreshing...").fontSize(16).margin({ left: 20 })
}
.alignItems(VerticalAlign.Center)
}
}
.clip(true)
.height("100%")
.width("100%")
}
@Builder
footer() {
Row() {
LoadingProgress().height(32).width(48)
.visibility(this.isLoading ? Visibility.Visible : Visibility.None)
Text(this.loadingText)
}.width("100%")
.height(64)
.justifyContent(FlexAlign.Center)
}
build() {
Column(){
// 顶部搜索
Row(){
Search({ value: $$this.params.reportName, placeholder: '请输入【原始记录名称】' })
.searchButton('搜索', {
fontSize: 12
})
.width('95%')
.height(30)
.backgroundColor('#fff')
.placeholderColor(Color.Grey)
.placeholderFont({ size: 12, weight: 400 })
.textFont({ size: 12, weight: 400 })
.layoutWeight(1)
.onSubmit(() => {
this.recordsList = []
this.params.pageSize = 10
getRecordsList(this.params).then((res: AxiosResponse<RecordsList>) => {
this.recordsList = res.data.rows
this.totalAll = res.data.total
})
})
Row(){
Image($r('app.media.filter')).width(20).onClick(() => {
this.dialogController.open()
})
Image($r('app.media.add')).width(20).onClick(() => {
if(this.roleName == 'unapprovedPerson') {
return promptAction.showToast({message: '请先在公司从业就职'})
}
router.pushUrl({
url: 'pages/AddRecords'
})
})
}.width(70).padding({left:5, right: 5}).justifyContent(FlexAlign.SpaceAround)
}.padding({left: 5, right: 5})
Refresh({ refreshing: $$this.refreshing, builder: this.refreshBuilder() }) {
List({space: 10}) {
ForEach(this.recordsList, (item: Row) => {
ListItem(){
Column({space: 10}){
Row(){
Image($r('app.media.project')).width(16).margin({right: 10})
Text(item.reportName).fontSize(12).fontColor('#333').maxLines(2)
.textOverflow({overflow: TextOverflow.Ellipsis})
}
Row(){
Image($r('app.media.company')).width(16).margin({right: 10})
Text(item.applyCompanyName).fontSize(12).fontColor('#999')
}
Row(){
Image($r('app.media.dateTime')).width(16).margin({right: 10})
Text(`${item.maintenanceTime}~${item.maintenanceEndTime || ''}`).fontSize(12).fontColor('#999')
}
Row({space: 10}){
ThemeTest({
theme: this.getPrimary(this.maintenanceTypeList, item.reportType),
textValue: this.getType(this.maintenanceTypeList, item.reportType)
})
ThemeTest({
theme: this.getPrimary(this.maintenanceStateList, item.state),
textValue: this.getType(this.maintenanceStateList, item.state)
})
}
}.borderRadius(10).padding(10).backgroundColor('#fff').width('100%')
.alignItems(HorizontalAlign.Start).onClick(() => {
router.pushUrl({
url: 'pages/DetailRecords',
params: {
reportId: item.reportId
}
})
})
}
})
ListItem() {
this.footer();
}
}
.onScrollIndex((start: number, end: number) => {
// 当达到列表末尾时,触发新数据加载
if (this.canLoad && end >= this.recordsList.length - 1) {
this.canLoad = false;
this.isLoading = true;
this.loadMoreData()
}
})
.onScrollFrameBegin((offset: number) => {
// 只有当向上滑动时触发新数据加载
if (offset > 5 && !this.isLoading) {
this.canLoad = true;
}
return { offsetRemain: offset };
})
.scrollBar(BarState.Off)
// 开启边缘滑动效果
.edgeEffect(EdgeEffect.Spring, { alwaysEnabled: true })
}
.width('100%')
.height('100%')
.backgroundColor('#f2f3f7')
.padding(10)
.onOffsetChange((offset: number) => {
this.refreshOffset = offset;
})
.onStateChange((state: RefreshStatus) => {
this.refreshState = state;
})
.onRefreshing(() => {
this.refreshData()
})
}.width('100%').height('100%')
}
}
... ...
import { getOrderList, getOrderSource, getOrderState, getRecordList } from '../api/originalRecords'
import { recordParams, orderParams, orderTest, orderRow, recordTest, recordRow } from '../api/recordsType'
import { quarterType, quarterTest } from '../api/options/optionsType'
import { getCompanyWallet, getPay, beanType } from '../api/user'
import { companyWalletTest, companyWalletRow } from '../api/userType'
import preferencesUtils from '../utils/preferences'
import { AxiosResponse } from '@ohos/axios'
import orderItem from '../components/orderItem'
import { router } from '@kit.ArkUI'
import FilterOrderDialog from '../dialog/FilterOrderDialog'
import FilterRecordDialog from '../dialog/FilterRecordDialog'
let companyId = preferencesUtils.get('XF_COMPANY_ID', '') as number
@Entry
@Component
struct MyWallet {
@State params: orderParams = {
pageNum: 1,
pageSize: 10,
companyId: companyId
}
@State recordParams: recordParams = {
pageNum: 1,
pageSize: 10,
companyId: companyId
}
@State searchKey: string = ''
@State sourceList: quarterType[] = []
@State stateList: quarterType[] = []
private controller: TabsController = new TabsController()
@State currentIndex: number = 0
@State searchTip: string = '请输入订单编号'
@State totalAll: number = 0
@State orderList: orderRow[] = []
@State recordList: recordRow[] = []
@State recordTotal: number = 0
@State loadingText: string = '点击加载更多'
@State loadingText2: string = '点击加载更多'
@State walletData: companyWalletRow | null = null
@State isShowPay: boolean = false
getList = async () => {
const personRes: AxiosResponse<orderTest> = await getOrderList(this.params)
this.orderList = personRes.data.rows
this.totalAll = personRes.data.total
}
getRecordData = async () => {
const personRes: AxiosResponse<recordTest> = await getRecordList(this.recordParams)
this.recordList = personRes.data.rows
this.recordTotal = personRes.data.total
}
// 获取支付来源列表
getSourceList = async () => {
const sourceRes: AxiosResponse<quarterTest> = await getOrderSource()
this.sourceList = sourceRes.data.data
}
// 获取订单状态列表
getStateList = async () => {
const stateRes: AxiosResponse<quarterTest> = await getOrderState()
this.stateList = stateRes.data.data
}
// 获取报告豆余额
getWalletInfo = async () => {
const walletInfo: AxiosResponse<companyWalletTest> = await getCompanyWallet({pageNum: 1, pageSize: 10, companyId: Number(companyId)})
this.walletData = walletInfo.data.rows[0]
}
// 获取是否显示充值
// getShowPay = async () => {
// const payInfo: AxiosResponse<beanType> = await getPay()
// this.isShowPay = payInfo.data.msg == "true"
// }
async aboutToAppear(){
Promise.all([
this.getList(),
this.getRecordData(),
this.getSourceList(),
this.getStateList(),
this.getWalletInfo()
])
}
// 订单查询筛选
dialogOrderController: CustomDialogController = new CustomDialogController({
builder: FilterOrderDialog({
params: this.params,
sourceList: this.sourceList,
stateList: this.stateList,
confirm: () => {
this.getList()
},
reset: () => {
this.getList()
this.searchKey = ''
}
}),
alignment: DialogAlignment.Center,
customStyle: false,
cornerRadius: 10
})
// 消费记录查询筛选
dialogRecordController: CustomDialogController = new CustomDialogController({
builder: FilterRecordDialog({
recordParams: this.recordParams,
confirm: () => {
this.getRecordData()
},
reset: () => {
this.getRecordData()
this.searchKey = ''
}
}),
alignment: DialogAlignment.Center,
customStyle: false,
cornerRadius: 10
})
// 加载更多订单数据
private async loadMoreData(){
if(this.params.pageSize >= this.totalAll) {
this.loadingText = '已加载全部数据'
}else {
this.params.pageSize += 10
await this.getList()
}
}
// 加载更多消耗数据
private async loadMoreRecordData(){
if(this.recordParams.pageSize >= this.recordTotal) {
this.loadingText2 = '已加载全部数据'
}else {
this.recordParams.pageSize += 10
await this.getRecordData()
}
}
build() {
Column(){
// 顶部搜索
Row(){
Search({ placeholder: this.searchTip, value: $$this.searchKey })
.searchButton('搜索', {
fontSize: 12
})
.width('95%')
.height(30)
.backgroundColor('#fff')
.borderWidth(1)
.placeholderColor(Color.Grey)
.placeholderFont({ size: 12, weight: 400 })
.textFont({ size: 12, weight: 400 })
.layoutWeight(1)
.onChange((value: string) => {
this.currentIndex == 0 ? this.params.orderNo = value : this.recordParams.reportNo = value
})
.onSubmit(() => {
this.currentIndex == 0 ? this.getList() : this.getRecordData()
})
Row(){
Image($r('app.media.filter')).width(20).onClick(() => {
this.currentIndex == 0 ? this.dialogOrderController.open() : this.dialogRecordController.open()
})
}.width(40).padding({left:5, right: 5}).justifyContent(FlexAlign.SpaceAround)
}.padding({left: 5, right: 5})
// 我的余额
Row(){
Column({space: 10}){
Text('余额(豆)').fontSize(14).fontColor('#fff')
Text(this.walletData?.bean.toString()).fontSize(24).fontColor('#fff').fontWeight(600).fontStyle(FontStyle.Italic)
Text('开票信息').padding({top: 5, bottom: 5, left: 15, right: 15})
.backgroundColor('#fff').borderRadius(30).fontSize(14).fontColor('#13ce66')
.onClick(() => {
router.pushUrl({
url: 'pages/BillingInformation'
})
})
}.height(150).justifyContent(FlexAlign.Center).padding(20)
Column(){
Text('充值').borderWidth(2).borderColor('#fff').borderRadius(30)
.padding({top: 5, bottom: 5, left: 15, right: 15}).fontSize(14).fontColor('#fff')
.onClick(() => {
router.pushUrl({
url: 'pages/Recharge'
})
})
}.height(150).alignItems(HorizontalAlign.Center).padding(20)
.visibility(this.isShowPay ? Visibility.Visible : Visibility.None)
}.height(150).borderRadius(10).backgroundColor('#13ce66')
.width('100%').justifyContent(FlexAlign.SpaceBetween)
// 订单导航
Tabs({ barPosition: BarPosition.Start, index: this.currentIndex, controller: this.controller }) {
TabContent() {
List(){
ForEach(this.orderList, (item: orderRow) => {
ListItem(){
orderItem({
orderInfo: item,
sourceList: this.sourceList,
stateList: this.stateList
})
}
})
ListItem(){
Row({space: 5}){
Text().width(20).height(1).backgroundColor('#999')
Text(this.loadingText).fontSize(12).fontColor('#999')
Text().width(20).height(1).backgroundColor('#999')
}.width('100%').padding({top: 10, bottom: 10}).justifyContent(FlexAlign.Center)
.onClick(async () => {
this.loadMoreData()
})
}.width('100%')
}.height('100%').width('100%')
}.tabBar('充值订单')
TabContent() {
List(){
ForEach(this.recordList, (item: recordRow) => {
ListItem(){
Row(){
Column({space: 10}){
Text(`原始记录编号:${item.reportNo}`).fontSize(14).fontColor('#000').fontWeight(600)
Text(`时间:${item.createTime}`).fontSize(12).fontColor('#999')
}.alignItems(HorizontalAlign.Start)
Text(`-${item.costBean}`).fontStyle(14).fontStyle(FontStyle.Italic).fontColor('#ff4949').fontWeight(600)
}.padding({top: 20, bottom: 20, left: 10, right: 10}).width('100%').justifyContent(FlexAlign.SpaceBetween)
.border({width: {bottom: 1}, color: '#eee'}).width('100%')
}
})
ListItem(){
Row({space: 5}){
Text().width(20).height(1).backgroundColor('#999')
Text(this.loadingText2).fontSize(12).fontColor('#999')
Text().width(20).height(1).backgroundColor('#999')
}.width('100%').padding({top: 10, bottom: 10}).justifyContent(FlexAlign.Center)
.onClick(async () => {
this.loadMoreRecordData()
})
}.width('100%')
}.height('100%').width('100%')
}.tabBar('消耗记录')
}
.vertical(false)
.barMode(BarMode.Fixed)
.onChange((index: number) => {
// currentIndex控制TabContent显示页签
this.currentIndex = index
this.searchTip = index == 0 ? '请输入订单编号' : '请输入【原始记录编号】'
})
.layoutWeight(1)
}.height('100%').width('100%').padding(10)
}
}
\ No newline at end of file
... ...
import { router } from '@kit.ArkUI'
import { AxiosResponse } from '@ohos/axios'
import { getNoticeDetail, noticeDetailTest, noticeRow } from '../api/notice'
import {HmParseHTML} from "@wuyan/html_parse"
interface routerParams {
id: number
}
@Entry
@Component
struct NoticeDetail {
@State message: string = 'Hello World';
@State noticeDetail: noticeRow | null = null
aboutToAppear(): void {
let params = router.getParams() as routerParams
let id = params.id
getNoticeDetail(id).then((res: AxiosResponse<noticeDetailTest>) => {
this.noticeDetail = res.data.data
})
}
build() {
Scroll(){
Column({space: 10}){
Text(this.noticeDetail?.noticeTitle).fontSize(24).fontWeight(700)
Text(this.noticeDetail?.createTime).fontSize(12).fontColor('#999')
HmParseHTML({
htmlStr: this.noticeDetail?.noticeContent, // 富文本内容-必传
})
}.width('100%').padding(10).justifyContent(FlexAlign.Start)
}.height('100%')
}
}
\ No newline at end of file
... ...
import { AxiosResponse } from '@ohos/axios'
import { getNoticeList, noticeTest, noticeParams, noticeRow } from '../api/notice'
import { router } from '@kit.ArkUI'
@Entry
@Component
struct NoticeList {
@State params: noticeParams = {
pageNum: 1,
pageSize: 10,
noticeTitle: ''
}
@State totalAll: number = 0
@State noticeList: noticeRow[] = []
@State refreshing: boolean = false;
@State refreshOffset: number = 0;
@State canLoad: boolean = false;
@State refreshState: RefreshStatus = RefreshStatus.Inactive; // 刷新状态
@State isLoading: boolean = false; // 是否在加载
@State loadingText: string = ''; // 加载是文字
getList = async () => {
const result: AxiosResponse<noticeTest> = await getNoticeList(this.params)
this.noticeList = result.data.rows
this.totalAll = result.data.total
}
async aboutToAppear(){
await this.getList()
}
// 自定义刷新布局
@Builder
refreshBuilder() {
Stack({ alignContent: Alignment.Bottom }) {
// 可以通过刷新状态控制是否存在Progress组件
// 当刷新状态处于下拉中或刷新中状态时Progress组件才存在
if (this.refreshState != RefreshStatus.Inactive && this.refreshState != RefreshStatus.Done) {
Row() {
LoadingProgress().height(32)
Text("Refreshing...").fontSize(16).margin({ left: 20 })
}
.alignItems(VerticalAlign.Center)
}
}
.clip(true)
.height("100%")
.width("100%")
}
// 自定义加载布局
@Builder
footer() {
Row() {
LoadingProgress().height(32).width(48)
.visibility(this.isLoading ? Visibility.Visible : Visibility.None)
Text(this.loadingText)
}.width("100%")
.height(64)
.justifyContent(FlexAlign.Center)
}
// 刷新测试数据
private async refreshData(){
this.noticeList = []
this.params = {
pageNum: 1,
pageSize: 10,
}
await this.getList()
this.refreshing = false;
}
// 加载更多测试数据
private async loadMoreData(){
if(this.params.pageSize >= this.totalAll) {
this.isLoading = false
this.loadingText = '已加载全部数据'
}else {
this.params.pageSize += 10
this.loadingText = '加载中'
await this.getList()
this.isLoading = false
}
}
build() {
Column(){
// 顶部搜索
// 顶部搜索
Row(){
Search({ value: $$this.params.noticeTitle, placeholder: '请输入公告标题' })
.searchButton('搜索', {
fontSize: 12
})
.width('95%')
.height(30)
.backgroundColor('#fff')
.placeholderColor(Color.Grey)
.placeholderFont({ size: 12, weight: 400 })
.textFont({ size: 12, weight: 400 })
.layoutWeight(1)
.onSubmit(async () => {
this.noticeList = []
this.params.pageSize = 10
await this.getList()
})
}.padding({left: 5, right: 5})
Refresh({ refreshing: $$this.refreshing, builder: this.refreshBuilder() }) {
List({space: 10}) {
ForEach(this.noticeList, (item: noticeRow, index: number) => {
ListItem(){
Row(){
Column(){
Text(item.noticeTitle).fontSize(14).fontWeight(600).lineHeight(19).margin({bottom: 5})
.fontColor('#3d3d3d').textOverflow({overflow: TextOverflow.Ellipsis}).maxLines(1)
Text(item.createTime).fontColor('#999').fontSize(12).lineHeight(16)
}.alignItems(HorizontalAlign.Start).layoutWeight(1)
Image($r('app.media.right_3')).width(12)
}.width('100%').justifyContent(FlexAlign.SpaceBetween)
.border({width: {bottom: this.noticeList.length == index + 1 ? 0 : 1}, color: '#eee'}).padding({top: 15, bottom: 15})
.onClick(() => {
router.pushUrl({
url: 'pages/NoticeDetail',
params: {
id: item.noticeId
}
})
})
}.padding({left: 10, right: 10}).backgroundColor(Color.White)
})
ListItem() {
this.footer();
}
}
.onScrollIndex((start: number, end: number) => {
// 当达到列表末尾时,触发新数据加载
if (this.canLoad && end >= this.noticeList.length - 1) {
this.canLoad = false;
this.isLoading = true;
this.loadMoreData()
}
})
.onScrollFrameBegin((offset: number) => {
// 只有当向上滑动时触发新数据加载
if (offset > 5 && !this.isLoading) {
this.canLoad = true;
}
return { offsetRemain: offset };
})
.scrollBar(BarState.Off)
// 开启边缘滑动效果
.edgeEffect(EdgeEffect.Spring, { alwaysEnabled: true })
}
.width('100%')
.height('100%')
.backgroundColor('#f2f3f7')
.padding(10)
.onOffsetChange((offset: number) => {
this.refreshOffset = offset;
})
.onStateChange((state: RefreshStatus) => {
this.refreshState = state;
})
.onRefreshing(() => {
this.refreshData()
})
}.height('100%')
}
}
\ No newline at end of file
... ...
import { webview } from '@kit.ArkWeb';
@Entry
@Component
struct WebComponent {
controller: webview.WebviewController = new webview.WebviewController();
build() {
Column() {
Web({ src: 'https://doc.crgx.net/xf-app/function.html', controller: this.controller })
}
}
}
\ No newline at end of file
... ...
import AreaPickerDialog from '../dialog/AreaPickerDialog'
import { personData, personTest } from '../api/userType'
import baseUrl from '../utils/baseUrl'
import { router } from '@kit.ArkUI';
import { AxiosResponse } from '@ohos/axios'
import { getPersonDetail } from '../api/user'
interface routerQuery {
personId: number
}
let getTextInfo = (state: string | null) => {
if(state == '0') {
return '离职'
} else if(state == '1') {
return '待确定'
} else if(state == '2') {
return '在职'
} else {
return ''
}
}
let routerParams = router.getParams() as routerQuery
let personId = routerParams.personId
@Entry
@Component
struct EditUser {
@Builder indicatorBuilder(icon: ResourceStr) {
Image(icon)
}
@State isShowCode: boolean = false
@State userInfo: personData = {
createBy: '',
createTime: '',
updateBy: '',
updateTime: '',
remark: '',
personId: 0,
personName: '',
email: '',
gender: '',
birthDate: '',
idNo: '',
phone: '',
personalImg: '',
idImgFront: '',
idImgBack: '',
address: '',
userId: 0,
username: '',
state: '',
companyId: 0,
}
@State pickerValue:string[] = ['广西壮族自治区','南宁市','青秀区']//省市区选中值
areaController: CustomDialogController = new CustomDialogController({
builder: AreaPickerDialog({
value:this.pickerValue,//首次默认选中值
onChange: (value:string[]) => {//选择改变回调
this.pickerValue = value
this.userInfo.address = this.pickerValue.join(' ')
}
}),
customStyle: true
})
async aboutToAppear(){
let res: AxiosResponse<personTest> = await getPersonDetail(personId)
this.userInfo = res.data.data
}
build() {
Column(){
Column(){
Column(){
Row(){
Row(){
Text().width(3).height(16).backgroundColor('#1890ff').margin({right: 10})
Text('基本信息').fontSize(12).fontColor('#999')
}
}.border({width: {bottom: 1}, color: '#eee'}).justifyContent(FlexAlign.Start).width('100%').padding({top: 10, bottom: 10})
Row(){
Row(){
Text('姓名').fontSize(14).fontColor('#999')
}.width(90)
Text(this.userInfo.personName).fontSize(12).fontColor('#999')
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10}).width('100%')
.justifyContent(FlexAlign.SpaceBetween)
Row(){
Row(){
Text('员工状态').fontSize(14).fontColor('#999')
}.width(90)
Text(getTextInfo(this.userInfo.state || '2')).fontSize(12).fontColor('#999')
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10}).width('100%')
.justifyContent(FlexAlign.SpaceBetween)
Row(){
Row(){
Text('邮箱').fontSize(14).fontColor('#999')
}.width(90)
Text(this.userInfo.email).fontSize(12).fontColor('#999')
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10}).width('100%')
.justifyContent(FlexAlign.SpaceBetween)
Row(){
Row(){
Text('性别').fontSize(14).fontColor('#999')
}.width(90)
Text(this.userInfo.gender == '0' ? '男': '女').fontSize(12).fontColor('#999')
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10}).width('100%')
.justifyContent(FlexAlign.SpaceBetween)
Row(){
Row(){
Text('出生日期').fontSize(14).fontColor('#999')
}.width(90)
Text(this.userInfo.birthDate).fontSize(12).fontColor('#999')
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10}).width('100%')
.justifyContent(FlexAlign.SpaceBetween)
Row(){
Row(){
Text('身份证号').fontSize(14).fontColor('#999')
}.width(90)
Text(this.userInfo.idNo).fontSize(12).fontColor('#999')
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10}).width('100%')
.justifyContent(FlexAlign.SpaceBetween)
Row(){
Row(){
Text('手机号').fontSize(14).fontColor('#999')
}.width(90)
Text(this.userInfo.phone).fontSize(12).fontColor('#999')
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10}).width('100%')
.justifyContent(FlexAlign.SpaceBetween)
Row(){
Row(){
Text('个人照片').fontSize(14).fontColor('#999')
}.width(90)
Row(){
Image(baseUrl + this.userInfo.personalImg || $r('app.media.userAvatar')).width(60)
}.margin({left: 20})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10}).width('100%')
.justifyContent(FlexAlign.SpaceBetween).height(80)
Row(){
Row(){
Text('证件正面').fontSize(14).fontColor('#999')
}.width(90)
Row(){
Image(baseUrl + this.userInfo.idImgFront || $r('app.media.idCard')).width(60)
}.margin({left: 20})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10}).width('100%')
.justifyContent(FlexAlign.SpaceBetween).height(80)
Row(){
Row(){
Text('证件反面').fontSize(14).fontColor('#999')
}.width(90)
Row(){
Image(baseUrl + this.userInfo.idImgBack || $r('app.media.unIdCard')).width(60)
}.margin({left: 20})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10}).width('100%')
.justifyContent(FlexAlign.SpaceBetween).height(80)
Row(){
Row(){
Text('地址').fontSize(14).fontColor('#999')
}.width(70)
Text(this.pickerValue.join(' ')).padding({top: 8, bottom: 8, left: 16, right: 16}).fontSize(12).fontColor('#999')
.backgroundColor('#fff').fontColor('#999').textOverflow({overflow: TextOverflow.Ellipsis}).maxLines(2)
}.padding({top: 10, bottom: 10}).justifyContent(FlexAlign.SpaceBetween).width('100%')
}.backgroundColor('#fff').width('100%').height('100%').padding({left: 10, right: 10}).borderRadius(10)
}.padding(10).margin({bottom: 20, top: 10})
}.width('100%').height('100%').backgroundColor('#f2f3f7')
}
}
\ No newline at end of file
... ...
import { AxiosResponse } from '@ohos/axios'
import { getCompanyPersonList } from '../api/originalRecords'
import { companyPersonTest, companyPersonRow, QueryParams } from '../api/recordsType'
import { router } from '@kit.ArkUI'
import preferencesUtils from '../utils/preferences'
import baseUrl from '../utils/baseUrl'
import AddPersonDialog from '../dialog/AddPersonDialog'
@Extend(Text) function primary () {
.fontColor('#1890ff').backgroundColor('#e8f4ff')
.borderColor('#d1e9ff')
}
@Extend(Text) function success () {
.fontColor('#13ce66').backgroundColor('#e7faf0')
.borderColor('#d0f5e0')
}
@Extend(Text) function danger () {
.fontColor('#ff4949').backgroundColor('#ffeded')
.borderColor('#ffdbdb')
}
let companyId = preferencesUtils.get('XF_COMPANY_ID', '') as number
let getTextInfo = (state: string | null) => {
if(state == '0') {
return '离职'
} else if(state == '1') {
return '待确定'
} else if(state == '2') {
return '在职'
} else {
return ''
}
}
@Entry
@Component
struct PersonList {
dialogController: CustomDialogController = new CustomDialogController({
builder: AddPersonDialog(),
cornerRadius: 10
})
@State params: QueryParams = {
pageNum: 1,
pageSize: 10,
companyId: companyId,
personName: ''
}
@State totalAll: number = 0
@State personList: companyPersonRow[] = []
@State refreshing: boolean = false;
@State refreshOffset: number = 0;
@State canLoad: boolean = false;
@State refreshState: RefreshStatus = RefreshStatus.Inactive; // 刷新状态
@State isLoading: boolean = false; // 是否在加载
@State loadingText: string = ''; // 加载是文字
getList = async () => {
const personRes: AxiosResponse<companyPersonTest> = await getCompanyPersonList(this.params)
this.personList = personRes.data.rows
this.totalAll = personRes.data.total
}
async onPageShow(){
await this.getList()
}
// 自定义刷新布局
@Builder
refreshBuilder() {
Stack({ alignContent: Alignment.Bottom }) {
// 可以通过刷新状态控制是否存在Progress组件
// 当刷新状态处于下拉中或刷新中状态时Progress组件才存在
if (this.refreshState != RefreshStatus.Inactive && this.refreshState != RefreshStatus.Done) {
Row() {
LoadingProgress().height(32)
Text("Refreshing...").fontSize(16).margin({ left: 20 })
}
.alignItems(VerticalAlign.Center)
}
}
.clip(true)
.height("100%")
.width("100%")
}
// 自定义加载布局
@Builder
footer() {
Row() {
LoadingProgress().height(32).width(48)
.visibility(this.isLoading ? Visibility.Visible : Visibility.None)
Text(this.loadingText)
}.width("100%")
.height(64)
.justifyContent(FlexAlign.Center)
}
// 刷新测试数据
private async refreshData(){
this.personList = []
this.params = {
pageNum: 1,
pageSize: 10,
companyId
}
await this.getList()
this.refreshing = false;
}
// 加载更多测试数据
private async loadMoreData(){
if(this.params.pageSize >= this.totalAll) {
this.isLoading = false
this.loadingText = '已加载全部数据'
}else {
this.params.pageSize += 10
this.loadingText = '加载中'
await this.getList()
this.isLoading = false
}
}
build() {
Column(){
// 顶部搜索
Row(){
Search({ value: $$this.params.personName, placeholder: '请输入人员姓名' })
.searchButton('搜索', {
fontSize: 12
})
.width('95%')
.height(30)
.backgroundColor('#fff')
.placeholderColor(Color.Grey)
.placeholderFont({ size: 12, weight: 400 })
.textFont({ size: 12, weight: 400 })
.layoutWeight(1)
.onSubmit(async () => {
this.personList = []
this.params.pageSize = 10
await this.getList()
})
Image($r('app.media.add')).width(20).onClick(() => {
this.dialogController.open()
})
}.padding({left: 5, right: 5})
Refresh({ refreshing: $$this.refreshing, builder: this.refreshBuilder() }) {
List({space: 10}) {
ForEach(this.personList, (item: companyPersonRow, index: number) => {
ListItem(){
Row(){
Row({space: 10}){
Image(baseUrl + item.personalImg).width(60).height(60).borderRadius(10)
Column(){
Text(item.personName).fontSize(14).fontWeight(600).lineHeight(19).margin({bottom: 5})
.fontColor('#3d3d3d').textOverflow({overflow: TextOverflow.Ellipsis}).maxLines(1)
Text(item.certificateLevel + item.certificateName).fontColor('#999').fontSize(12)
Text(item.createTime).fontColor('#999').fontSize(12).lineHeight(16)
}.alignItems(HorizontalAlign.Start)
}.layoutWeight(1)
Row(){
Text(getTextInfo(item.state)).padding({bottom: 5, top: 5, left: 15, right: 15}).success()
.visibility(item.state == '2' ? Visibility.Visible: Visibility.None).borderWidth(1).borderRadius(4).fontSize(12)
Text(getTextInfo(item.state)).padding({bottom: 5, top: 5, left: 15, right: 15}).primary()
.visibility(item.state == '1' ? Visibility.Visible: Visibility.None).borderWidth(1).borderRadius(4).fontSize(12)
Text(getTextInfo(item.state)).padding({bottom: 5, top: 5, left: 15, right: 15}).danger()
.visibility(item.state == '0' ? Visibility.Visible: Visibility.None).borderWidth(1).borderRadius(4).fontSize(12)
Image($r('app.media.right_3')).width(12)
}
}.width('100%').justifyContent(FlexAlign.SpaceBetween)
.border({width: {bottom: this.personList.length == index + 1 ? 0 : 1}, color: '#eee'}).padding({top: 15, bottom: 15})
.onClick(() => {
router.pushUrl({
url: 'pages/PersonDetail',
params: {
personId: item.personId
}
})
})
}.padding({left: 10, right: 10}).backgroundColor(Color.White)
})
ListItem() {
this.footer();
}
}
.onScrollIndex((start: number, end: number) => {
// 当达到列表末尾时,触发新数据加载
if (this.canLoad && end >= this.personList.length - 1) {
this.canLoad = false;
this.isLoading = true;
this.loadMoreData()
}
})
.onScrollFrameBegin((offset: number) => {
// 只有当向上滑动时触发新数据加载
if (offset > 5 && !this.isLoading) {
this.canLoad = true;
}
return { offsetRemain: offset };
})
.scrollBar(BarState.Off)
// 开启边缘滑动效果
.edgeEffect(EdgeEffect.Spring, { alwaysEnabled: true })
}
.width('100%')
.height('100%')
.backgroundColor('#f2f3f7')
.padding(10)
.onOffsetChange((offset: number) => {
this.refreshOffset = offset;
})
.onStateChange((state: RefreshStatus) => {
this.refreshState = state;
})
.onRefreshing(() => {
this.refreshData()
})
}.width('100%').height('100%')
}
}
\ No newline at end of file
... ...
import { webview } from '@kit.ArkWeb'
@Entry
@Component
struct FireProtectionDetail {
webviewController: webview.WebviewController = new webview.WebviewController()
build() {
Column(){
Web({
src: `https://doc.crgx.net/privacy.html`,
controller: this.webviewController,
}).mixedMode(MixedMode.All).javaScriptAccess(true).domStorageAccess(true)
}.height('100%').width('100%')
}
}
\ No newline at end of file
... ...
import { companyWalletTest, companyWalletRow, comBoTest, comBoRow } from '../api/userType'
import preferencesUtils from '../utils/preferences'
import { getCompanyWallet, getBean , getComboList, beanType } from '../api/user'
import { promptAction } from '@kit.ArkUI';
import { AxiosResponse } from '@ohos/axios'
let companyId = preferencesUtils.get('XF_COMPANY_ID', '') as number
@Entry
@Component
struct EditUser {
@State isShowCode: boolean = false
@State walletData: companyWalletRow | null = null
// 套餐列表
@State comBoList: comBoRow[] = []
@State beanProportion: string = ''
@State isSelect: boolean = false
@State selectComBo: number = 0
// 获取套餐列表
getComBoList = async () => {
const comBoRes: AxiosResponse<comBoTest> = await getComboList({pageNum: 1, pageSize: 100, state: '1'})
this.comBoList = comBoRes.data.rows
}
// 获取报告豆余额
getWalletInfo = async () => {
const walletInfo: AxiosResponse<companyWalletTest> = await getCompanyWallet({pageNum: 1, pageSize: 10, companyId: Number(companyId)})
this.walletData = walletInfo.data.rows[0]
}
// 获取报告豆比例
getBeanProportion = async () => {
const BeanInfo: AxiosResponse<beanType> = await getBean()
this.beanProportion = BeanInfo.data.msg
}
onPageShow(): void {
this.getWalletInfo()
this.getComBoList()
this.getBeanProportion()
}
build() {
Column(){
Column(){
Column(){
Row(){
Row(){
Text('报告豆比例')
}.width(90)
Text(this.beanProportion).layoutWeight(1).padding({top: 10, bottom: 10})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Text('报告豆余额')
}.width(90)
Text(this.walletData?.bean.toString()).layoutWeight(1).padding({top: 10, bottom: 10})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Column({space: 10}){
Row(){
Image($r('app.media.require')).width(20)
Text('充值金额 选择一下充值套餐')
}
Flex({wrap: FlexWrap.Wrap, justifyContent: FlexAlign.SpaceBetween, alignItems: ItemAlign.Center }){
ForEach(this.comBoList, (item: comBoRow, index: number) => {
Column({space: 10}){
Text(`充${item.comboPrice}送${item.bean}`).fontSize(14).fontWeight(600)
.fontColor(this.selectComBo == index ? '#4abe84' : '#000')
Text(`得${(item.comboPrice + item.bean) * 10}豆`).fontSize(12).fontColor('#999')
}.width('30%').height(60).borderWidth(1).borderRadius(4).justifyContent(FlexAlign.Center)
.borderColor(this.selectComBo == index ? '#4abe84' : '#000')
.onClick(() => {
this.selectComBo = index
})
})
}
Row(){
Text('支付方式').margin({right: 20})
Row({space: 5}){
Image($r('app.media.wx_pay')).width('14')
Text('微信支付')
}
}
}.alignItems(HorizontalAlign.Start).border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Column({ space: 10 }){
Row(){
Checkbox({ name: 'checkbox2', group: 'checkboxGroup' })
.select(this.isSelect)
.selectedColor(0x39a2db)
.shape(CheckBoxShape.ROUNDED_SQUARE)
.onChange((value: boolean) => {
this.isSelect = value
})
Text('我已了解且同意本次充值')
}
Text('1、充值根据当前比例兑换报告豆(比如说:选择的套餐是充100送10,当前兑换比例是1:1.5,则最终获得的报告豆为(100+10)×1.5=165);\n' +
'2、充值后不可退款,可开具增值税普通发票;\n' +
'3、本次充值非广西消防救援总队接收,由消防维保助手服务商接收;\n' +
'4、公司账户充值报告豆,公司名下所有成员共享使用报告豆;\n' +
'5、充值完成后,7个工作日内系统将以开票信息开具订单金额的增值税普通发票(电子版),可在【订单查询】页面进行下载。').fontSize(12).fontColor('#606266')
.lineHeight(20).backgroundColor('#eee').padding(10)
}.alignItems(HorizontalAlign.Start).padding({top: 10, bottom: 10})
}.backgroundColor('#fff').width('100%').padding({left: 5, right: 5}).borderRadius(10)
}.padding(10).margin({bottom: 20, top: 10}).width('100%').layoutWeight(1).backgroundColor('#fff')
Row({ space: 10}){
Text('提交').borderRadius(5).layoutWeight(1).height(30).fontColor('#fff')
.backgroundColor('#1B65FD').fontSize(14).textAlign(TextAlign.Center)
.onClick(async () => {
if(this.isSelect) {
promptAction.showToast({
message: '支付成功'
})
} else {
promptAction.showToast({
message: '请先阅读并同意本次支付'
})
}
})
}.width('100%').height(40).backgroundColor('#fff').padding({left: 10, right: 10})
}.width('100%').height('100%').backgroundColor('#f2f3f7')
}
}
\ No newline at end of file
... ...
import CompanyCommit from '../dialog/CompanyCommitDialog'
import AreaPickerDialog from '../dialog/AreaPickerDialog'
import { ValidateInputHandle } from '../utils/validateInputHandle'
import { companyData } from '../api/userType'
import baseUrl from '../utils/baseUrl'
import { companyRegister, queryUserNameType, queryUsername, queryIdNoType, queryIdNo } from '../api/user'
import { promptAction, router } from '@kit.ArkUI';
import { AxiosResponse } from '@ohos/axios'
import { uploadFile, uploadResult } from '../utils/uploadFile'
import { uploadDocFile } from '../utils/uploadDocmentFile'
import { request } from '@kit.BasicServicesKit'
@Entry
@Component
struct UserRegister {
@Builder indicatorBuilder(icon: ResourceStr) {
Image(icon)
}
@State userErrorMsg: string = ''
@State idErrorMsg: string = ''
@State emailErrorMsg: string = ''
@State phoneErrorMsg: string = ''
@State companyInfo: companyData = {
companyId: 0,
companyName: '',
province: '',
city: '',
county: '',
address: '',
linkMan: '',
lmTel: '',
companyTel: null,
postCode: null,
email: '',
floorage: 0,
siteVoucher: '',
businessLicenseNo: '',
businessStartTime: null,
businessEndTime: null,
businessLicensePic: '',
peopleNum: 0,
compangyPic: '',
companyType: '1',
userId: 0,
username: '',
level: null,
regionCode: null,
levelModifyDate: null,
endTime: '',
password: ''
}
@State confirmPassword: string = ''
dialogController: CustomDialogController = new CustomDialogController({
builder: CompanyCommit(),
autoCancel: false,
customStyle: true
})
@State pickerValue:string[] = ['广西壮族自治区','南宁市','青秀区']//省市区选中值
areaController: CustomDialogController = new CustomDialogController({
builder: AreaPickerDialog({
value:this.pickerValue,//首次默认选中值
onChange: (value:string[]) => {//选择改变回调
this.pickerValue = value
this.companyInfo.address = this.pickerValue.join(' ')
this.companyInfo.province = value[0]
this.companyInfo.city = value[1]
this.companyInfo.county = value[2]
}
}),
customStyle: true
})
async aboutToAppear() {
this.dialogController.open()
}
// 查询用户名是否被占用
queryName = async (userName: string) => {
const res: AxiosResponse<queryUserNameType> = await queryUsername(userName)
this.userErrorMsg = res.data.data == 1 ? '' : res.data.msg
}
// 查身份证是否被占用
queryId = async (id: string) => {
const res: AxiosResponse<queryIdNoType> = await queryIdNo(id)
this.idErrorMsg = res.data.total == 0 ? '' : '身份证号码已存在,请重新输入'
}
build() {
Column(){
Scroll(){
Column(){
Column(){
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('用户名')
}.width(90)
TextInput({placeholder: '4-20位,数字/字母组成', text: $$this.companyInfo.username})
.backgroundColor('#fff').layoutWeight(1).showError(this.userErrorMsg).onBlur(() => {
this.queryName(this.companyInfo.username)
}).onChange((value) => {
this.userErrorMsg = ValidateInputHandle(value, 'username') ? '' : '4-20位数字字母组成'
})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('密码')
}.width(90)
TextInput({placeholder: '请输入密码', text: $$this.companyInfo.password})
.backgroundColor('#fff').layoutWeight(1).type(InputType.Password)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('确认密码')
}.width(90)
TextInput({placeholder: '请输入密码', text: $$this.confirmPassword})
.backgroundColor('#fff').layoutWeight(1).type(InputType.Password)
.borderWidth(0)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('公司名称')
}.width(90)
TextInput({placeholder: '请输入公司名称', text: $$this.companyInfo.companyName})
.backgroundColor('#fff').layoutWeight(1)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('人数规模')
}.width(90)
TextInput({placeholder: '请输入人数', text: $$this.companyInfo.peopleNum})
.backgroundColor('#fff').layoutWeight(1).type(InputType.Number)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('建筑面积')
}.width(90)
Row(){
TextInput({placeholder: '请输入建筑面积', text: $$this.companyInfo.floorage})
.backgroundColor('#fff').layoutWeight(1).type(InputType.Number)
Text('㎡').fontSize(12).backgroundColor('#1890ff').borderRadius(5)
.padding({top: 4, bottom: 4, left: 10, right: 10}).fontColor('#fff')
}.layoutWeight(1)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('联系人')
}.width(90)
TextInput({placeholder: '请输入联系人姓名', text: $$this.companyInfo.linkMan})
.backgroundColor('#fff').layoutWeight(1)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('邮箱')
}.width(90)
TextInput({placeholder: '请输入邮箱, 以方便找回密码', text: $$this.companyInfo.email})
.backgroundColor('#fff').layoutWeight(1).type(InputType.Email)
.showError(this.emailErrorMsg).onChange(() => {
this.emailErrorMsg = ValidateInputHandle(this.companyInfo.email, 'email') ? '' : '请正确输入邮箱'
})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('联系人手机')
}
TextInput({placeholder: '请输入联系人手机号', text: $$this.companyInfo.lmTel})
.backgroundColor('#fff').layoutWeight(1).type(InputType.PhoneNumber)
.showError(this.phoneErrorMsg).onChange(() => {
this.phoneErrorMsg = ValidateInputHandle(this.companyInfo.lmTel, 'phone') ? '' : '请正确输入手机号'
})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('场地凭证')
}
Column({space: 5}){
Row({space: 10}){
Button('选择文件').controlSize(ControlSize.SMALL).type(ButtonType.Normal)
.backgroundColor('#1890ff').fontColor('#fff').borderRadius(4)
.onClick(async () => {
let that = this
let uploader = await uploadDocFile() as request.UploadTask
// 3. 监控上传错误
uploader.on('fail', (err) => {
console.log('上传错误--->', JSON.stringify(err))
})
// 4. 获取服务器返回来的数据
uploader.on('headerReceive',(res)=>{
let uploadInfo = JSON.parse(res['body']) as uploadResult
that.companyInfo.siteVoucher = uploadInfo.fileName as string
})
})
Button('查看文件').controlSize(ControlSize.SMALL).type(ButtonType.Normal)
.backgroundColor('#1890ff').fontColor('#fff').borderRadius(4)
.onClick(() => {
if(this.companyInfo.siteVoucher == '') {
return promptAction.showToast({message: '你还没有上传文件'})
}
router.pushUrl({
url: 'pages/ViewFile',
params: {
filePath: baseUrl + this.companyInfo.siteVoucher
}
})
})
}
Row(){
Text('请上传 大小不超过').fontSize(12)
Text('5MB').fontSize(12).fontColor('red')
Text('格式为').fontSize(12)
}
Row(){
Text('pdf/jpg/jpeg/png').fontSize(12).fontColor('red')
Text('的文件').fontSize(12)
}
}.layoutWeight(1).alignItems(HorizontalAlign.Start).margin({left: 10})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('营业执照扫描件')
}
Row(){
Image(this.companyInfo.businessLicensePic !== '' ? baseUrl + this.companyInfo.businessLicensePic : $r('app.media.certificateCard')).width(120)
.onClick(async () => {
let that = this
let uploader = await uploadFile() as request.UploadTask
// 3. 监控上传错误
uploader.on('fail', (err) => {
console.log('上传错误--->', JSON.stringify(err))
})
// 4. 获取服务器返回来的数据
uploader.on('headerReceive',(res)=>{
let uploadInfo = JSON.parse(res['body']) as uploadResult
that.companyInfo.businessLicensePic = uploadInfo.fileName as string
})
})
}.layoutWeight(1).margin({left: 20})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('统一社会信用代码')
}
TextInput({placeholder: '请输入统一社会信用代码', text: $$this.companyInfo.businessLicenseNo})
.backgroundColor('#fff').layoutWeight(1)
.showError(this.idErrorMsg).onChange(() => {
this.idErrorMsg = ValidateInputHandle(this.companyInfo.businessLicenseNo, 'businessLicenseNo') ? '' : '请正确输入信用代码'
})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('地址')
}.width(70)
Text(this.pickerValue.join(' ')).layoutWeight(1).padding({top: 8, bottom: 8, left: 16, right: 16})
.backgroundColor('#fff').fontColor('#999').textOverflow({overflow: TextOverflow.Ellipsis}).maxLines(2)
.onClick(() => {
this.areaController?.open()
})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
}.backgroundColor('#fff').width('100%').padding({left: 5, right: 5}).borderRadius(10)
}.padding(10).margin({bottom: 20, top: 10})
}.layoutWeight(1).scrollBar(BarState.Off)
Row({ space: 10}){
Text('提交').borderRadius(5).layoutWeight(1).height(30).fontColor('#fff')
.backgroundColor('#1B65FD').fontSize(14).textAlign(TextAlign.Center)
.onClick(async () => {
console.log(JSON.stringify(this.companyInfo))
if(this.confirmPassword !== this.companyInfo.password) {
return promptAction.showToast({message: '两次密码输入不一致'})
}
if(this.companyInfo?.businessLicenseNo == '') {
return promptAction.showToast({message: '社会统一代码不能为空'})
} else if(this.companyInfo?.email == '') {
return promptAction.showToast({message: '邮箱不能为空'})
} else if(this.companyInfo?.linkMan == '') {
return promptAction.showToast({message: '联系人不能为空'})
} else if(this.companyInfo?.lmTel == '') {
return promptAction.showToast({message: '手机号不能为空'})
} else if(this.companyInfo?.username == '') {
return promptAction.showToast({message: '用户名不能为空'})
}
await companyRegister(this.companyInfo)
promptAction.showToast({
message: '注册成功',
duration: 2000
})
router.back()
})
}.width('100%').height(40).backgroundColor('#fff').padding({left: 10, right: 10})
}.width('100%').height('100%').backgroundColor('#f2f3f7')
}
}
\ No newline at end of file
... ...
@Entry
@Component
struct SplashFullScreenAdPage {
@State message: string = 'Hello World';
build() {
RelativeContainer() {
Text(this.message)
.id('SplashFullScreenAdPageHelloWorld')
.fontSize(50)
.fontWeight(FontWeight.Bold)
.alignRules({
center: { anchor: '__container__', align: VerticalAlign.Center },
middle: { anchor: '__container__', align: HorizontalAlign.Center }
})
}
.height('100%')
.width('100%')
}
}
\ No newline at end of file
... ...
import { Prompt, router } from '@kit.ArkUI';
import { advertising, AdComponent } from '@kit.AdsKit';
import { hilog } from '@kit.PerformanceAnalysisKit';
@Entry
@Component
export struct SplashHalfScreenAdPage {
private ads: Array<advertising.Advertisement> = [];
private displayOptions?: advertising.AdDisplayOptions;
aboutToAppear() {
hilog.info(0x0000, 'testTag', '%{public}s', 'Start to splashHalfScreenAdPage aboutToAppear');
const params: Record<string, Object> = router.getParams() as Record<string, Object>;
if (params && params.ads as Array<advertising.Advertisement> &&
params.displayOptions as advertising.AdDisplayOptions) {
this.ads = params.ads as Array<advertising.Advertisement>;
this.displayOptions = params.displayOptions as advertising.AdDisplayOptions;
} else {
hilog.info(0x0000, 'testTag', '%{public}s', 'Router params are empty');
}
}
build() {
Column() {
// 运行在提供方进程里
AdComponent({
ads: this.ads, displayOptions: this.displayOptions,
interactionListener: {
onStatusChanged: (status: string, ad: advertising.Advertisement, data: string) => {
switch (status) {
case AdStatus.AD_OPEN:
hilog.info(0x0000, 'testTag', '%{public}s', 'Status is onAdOpen');
Prompt.showToast({
message: 'splash ad open',
duration: 1000
});
break;
case AdStatus.AD_CLICKED:
hilog.info(0x0000, 'testTag', '%{public}s', 'Status is onAdClick');
Prompt.showToast({
message: 'splash ad click',
duration: 1000
});
break;
case AdStatus.AD_CLOSED:
hilog.info(0x0000, 'testTag', '%{public}s', 'Status is onAdClose');
Prompt.showToast({
message: 'splash ad close',
duration: 1000
});
router.replaceUrl({
url: 'pages/Index',
})
break;
}
}
}
})
.width('100%')
.height('87%')
// 展示媒体自定义icon、应用名称、版权信息
Column({}) {
Row() {
Image($r('app.media.logo')).width(24).height(24).margin({ right: 8 })
Text($r('app.string.video')).fontColor('#1A1A1A').fontSize(16).width(32).height(21)
}.margin({ bottom: 8 })
Column() {
Text('123').fontColor('#1A1A1A').fontSize(9).height(15)
}
}.width('100%').height('100%')
}
}
}
export enum AdStatus {
AD_OPEN = 'onAdOpen',
AD_CLICKED = 'onAdClick',
AD_CLOSED = 'onAdClose'
}
\ No newline at end of file
... ...
import { router, Prompt } from '@kit.ArkUI';
import { advertising, identifier } from '@kit.AdsKit';
import { common } from '@kit.AbilityKit';
import { hilog } from '@kit.PerformanceAnalysisKit';
import { BusinessError } from '@kit.BasicServicesKit';
@Entry
@Component
export struct Index {
private context: common.UIAbilityContext = getContext(this) as common.UIAbilityContext;
private oaid: string = '';
private isTimeOut: boolean = false;
// 超时时间(单位毫秒),开发者可根据实际情况修改
private timeOutDuration: number = 1 * 1000;
// 超时index
private timeOutIndex: number = -1;
// 广告展示参数
private adDisplayOptions: advertising.AdDisplayOptions = {
// 是否静音,默认不静音
mute: false
}
// 广告配置
private adOptions: advertising.AdOptions = {
// 是否允许流量下载0:不允许,1:允许,不设置以广告主设置为准
allowMobileTraffic: 0,
// 是否希望根据 COPPA 的规定将您的内容视为面向儿童的内容: -1默认值,不确定 0不希望 1希望
tagForChildProtection: -1,
// 是否希望按适合未达到法定承诺年龄的欧洲经济区 (EEA) 用户的方式处理该广告请求: -1默认值,不确定 0不希望 1希望
tagForUnderAgeOfPromise: -1,
// 设置广告内容分级上限: W: 3+,所有受众 PI: 7+,家长指导 J:12+,青少年 A: 16+/18+,成人受众
adContentClassification: 'A'
}
// 开屏视频广告请求参数
private splashVideoAdReqParams: advertising.AdRequestParams = {
// 'testd7c5cewoj6'为测试专用的广告位ID,App正式发布时需要改为正式的广告位ID
adId: 'testd7c5cewoj6',
adType: AdType.SPLASH_AD,
adCount: 1,
oaid: this.oaid
}
// 开屏图片广告请求参数
private splashImageAdReqParams: advertising.AdRequestParams = {
// 'testq6zq98hecj'为测试专用的广告位ID,App正式发布时需要改为正式的广告位ID
adId: 'testq6zq98hecj',
adType: AdType.SPLASH_AD,
adCount: 1,
oaid: this.oaid
}
aboutToAppear() {
hilog.info(0x0000, 'testTag', '%{public}s', 'Start to aboutToAppear');
try {
// 使用Promise回调方式获取OAID
identifier.getOAID().then((data: string) => {
this.oaid = data;
hilog.info(0x0000, 'testTag', '%{public}s', 'Succeeded in getting adsIdentifierInfo by promise');
}).catch((error: BusinessError) => {
hilog.error(0x0000, 'testTag', '%{public}s',
`Failed to get adsIdentifierInfo, code: ${error.code}, message: ${error.message}`);
})
} catch (error) {
hilog.error(0x0000, 'testTag', '%{public}s', `Catch err, code: ${error.code}, message: ${error.message}`);
}
}
build() {
Column() {
Column() {
// 跳转到开屏全屏视频广告展示页面
CustomButton({
mText: 'splash full screen request', mOnClick: () => {
this.requestAd(this.splashVideoAdReqParams, this.adOptions);
}
});
// 跳转到开屏半屏图片广告展示页面
CustomButton({
mText: 'splash half screen request', mOnClick: () => {
this.requestAd(this.splashImageAdReqParams, this.adOptions);
}
});
}.width('100%').height('80%').justifyContent(FlexAlign.Center)
}
.width('100%')
.height('100%')
}
private requestAd(adReqParams: advertising.AdRequestParams, adOptions: advertising.AdOptions): void {
// 广告请求回调监听
const adLoaderListener: advertising.AdLoadListener = {
// 广告请求失败回调
onAdLoadFailure: (errorCode: number, errorMsg: string) => {
clearTimeout(this.timeOutIndex);
if (this.isTimeOut) {
return;
}
hilog.error(0x0000, 'testTag', '%{public}s',
`Failed to request ad. errorCode is: ${errorCode}, errorMsg is: ${errorMsg}`);
Prompt.showToast({
message: `Failed to request ad, code is: ${errorCode} , errorMsg is: ${errorMsg}`,
duration: 1000
});
},
// 广告请求成功回调
onAdLoadSuccess: (ads: Array<advertising.Advertisement>) => {
clearTimeout(this.timeOutIndex);
if (this.isTimeOut) {
return;
}
hilog.info(0x0000, 'testTag', '%{public}s', 'Succeeded in requesting ad!');
// 保存请求到的广告内容用于展示
hilog.info(0x0000, 'testTag', '%{public}s', `ads[0].adType is : ${ads[0].adType}`);
if (canIUse("SystemCapability.Advertising.Ads")) {
if (ads[0].adType === AdType.SPLASH_AD) {
// 调用开屏广告展示页面
if (ads[0]?.isFullScreen === true) {
routePage('pages/SplashFullScreenAdPage', ads, this.adDisplayOptions);
} else {
routePage('pages/SplashHalfScreenAdPage', ads, this.adDisplayOptions);
}
} else {
hilog.error(0x0000, 'testTag', '%{public}s', 'Error adType');
}
}
}
};
// 创建AdLoader广告对象
const load: advertising.AdLoader = new advertising.AdLoader(this.context);
// 调用广告请求接口
hilog.info(0x0000, 'testTag', '%{public}s', 'Request ad!');
adReqParams.oaid = this.oaid;
this.timeOutHandler();
load.loadAd(adReqParams, adOptions, adLoaderListener);
}
private timeOutHandler(): void {
this.isTimeOut = false;
// 超时处理
this.timeOutIndex = setTimeout(() => {
this.isTimeOut = true;
const options: router.RouterOptions = {
// 开发者可根据项目实际情况修改超时之后要跳转的目标页面
url: 'pages/AdsServicePage',
};
router.pushUrl(options);
hilog.error(0x0000, 'testTag', '%{public}s', 'load ad time out');
}, this.timeOutDuration);
}
}
async function routePage(pageUri: string, ads: Array<advertising.Advertisement | null>,
displayOptions: advertising.AdDisplayOptions) {
let options: router.RouterOptions = {
url: pageUri,
params: {
ads: ads,
displayOptions: displayOptions
}
}
try {
hilog.info(0x0000, 'testTag', '%{public}s', `RoutePage: ${pageUri}`);
router.pushUrl(options);
} catch (error) {
hilog.error(0x0000, 'testTag', '%{public}s',
`Failed to routePage callback, code: ${error.code}, msg: ${error.message}`);
}
}
export enum AdType {
// 开屏广告的类型
SPLASH_AD = 1
}
@Component
export struct CustomButton {
private mText: string | Resource = '';
private mHeight: number = 40;
private mOnClick: (event?: ClickEvent) => void = (): void => {
};
build() {
Column() {
Button(this.mText)
.backgroundColor('#d3d4d6')
.fontSize(20)
.fontColor('#000')
.fontWeight(FontWeight.Normal)
.align(Alignment.Center)
.type(ButtonType.Capsule)
.width('90%')
.height(this.mHeight)
.margin({ top: 10, bottom: 5 })
.onClick(this.mOnClick);
}
}
}
\ No newline at end of file
... ...
import { webview } from '@kit.ArkWeb'
import { basePath } from '../utils/baseUrl'
@Entry
@Component
struct FireProtectionDetail {
webviewController: webview.WebviewController = new webview.WebviewController()
build() {
Column(){
Web({
src: `${basePath}/report/select`,
controller: this.webviewController,
}).mixedMode(MixedMode.All).javaScriptAccess(true).domStorageAccess(true)
}.height('100%').width('100%')
}
}
\ No newline at end of file
... ...
import { getEmailCode, emailType, resetPassword } from '../api/user'
import { formType } from '../api/userType'
import { promptAction, router } from '@kit.ArkUI'
import { AxiosResponse } from '@ohos/axios'
import LoadingDialog from '../dialog/LoadingDialog'
import { ValidateInputHandle } from '../utils/validateInputHandle'
// xxx.ets
@Styles function itemStyle () {
.width('90%')
.height(621)
.margin({ top: 48, left: 12 })
.borderRadius(24).padding(10)
.backgroundColor(Color.White)
}
@Extend(Text) function itemTextStyle () {
.fontColor('#182431')
.fontSize(36)
.fontWeight(500)
.opacity(0.4)
.margin({ top: 82, bottom: 40 })
}
@Entry
@Component
struct UpdatePassword {
loadingController: CustomDialogController = new CustomDialogController({
builder: LoadingDialog(),
customStyle: true,
offset: { dx: 0, dy: 0 },
alignment: DialogAlignment.Center,
autoCancel: false
})
@State currentIndex: number = 0
@State firstState: ItemState = ItemState.Skip
@State secondState: ItemState = ItemState.Normal
@State updateForm: formType = {
password: '',
againPassword: '',
code: '',
email: '',
type: 0
}
@State returnCode: string = ''
build() {
Stepper({
index: this.currentIndex
}) {
// 第一个步骤页
StepperItem() {
Column() {
Text('身份验证')
.itemTextStyle()
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('邮箱')
}.width(90)
TextInput({placeholder: '请输入邮箱', text: $$this.updateForm.email})
.backgroundColor('#fff').layoutWeight(1).type(InputType.Email)
.showError(ValidateInputHandle(this.updateForm.email, 'email') ? '' : '请正确输入邮箱')
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('验证码')
}.width(90)
Row(){
TextInput({placeholder: '请输入验证码', text: $$this.updateForm.code})
.showError(this.updateForm.code == this.returnCode ? '' : '验证码不正确')
.backgroundColor('#fff').layoutWeight(1).onChange((value) => {
if(value == this.returnCode){
this.firstState = ItemState.Normal
}
})
Text('获取验证码').fontSize(12).backgroundColor('#1890ff').borderRadius(5)
.padding({top: 4, bottom: 4, left: 10, right: 10}).fontColor('#fff')
.onClick(async () => {
if(this.updateForm.email == ''){
return promptAction.showToast({message: '请输入邮箱'})
}
this.loadingController.open()
const res: AxiosResponse<emailType> = await getEmailCode(this.updateForm.email)
this.returnCode = res.data.data
this.loadingController.close()
promptAction.showToast({
message: '已发送至邮箱,请查收'
})
})
}.layoutWeight(1)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
}.itemStyle()
}
.nextLabel('下一步')
.status(this.firstState)
// 第二个步骤页
StepperItem() {
Column() {
Text('重置密码')
.itemTextStyle()
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('新密码')
}.width(90)
TextInput({placeholder: '请输入新密码', text: $$this.updateForm.password})
.backgroundColor('#fff').layoutWeight(1)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('确认密码')
}.width(90)
Row(){
TextInput({placeholder: '请确认密码', text: $$this.updateForm.againPassword})
.backgroundColor('#fff').layoutWeight(1)
}.layoutWeight(1)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
}.itemStyle()
}
.nextLabel('完成')
.prevLabel('Previous')
.status(this.secondState)
}
.backgroundColor('#F1F3F5')
.onFinish( async() => {
if(this.updateForm.againPassword !== this.updateForm.password) {
return promptAction.showToast({message: '两次密码输入不一致'})
}
// 此处可处理点击最后一页的Finish时的逻辑,例如路由跳转等
await resetPassword(this.updateForm)
promptAction.showToast({message: '重置成功'})
router.replaceUrl({
url: 'pages/Login'
})
})
}
}
\ No newline at end of file
... ...
import { webview } from '@kit.ArkWeb'
@Entry
@Component
struct FireProtectionDetail {
webviewController: webview.WebviewController = new webview.WebviewController()
build() {
Column(){
Web({
src: `https://doc.crgx.net/agreement.html`,
controller: this.webviewController,
}).mixedMode(MixedMode.All).javaScriptAccess(true).domStorageAccess(true)
}.height('100%').width('100%')
}
}
\ No newline at end of file
... ...
import UserCommit from '../dialog/UserCommit'
import AreaPickerDialog from '../dialog/AreaPickerDialog'
import { ValidateInputHandle } from '../utils/validateInputHandle'
import { personData } from '../api/userType'
import baseUrl from '../utils/baseUrl'
import { userRegister, queryUserNameType, queryUsername, queryIdNoType, queryIdNo } from '../api/user'
import { promptAction, router } from '@kit.ArkUI';
import { AxiosResponse } from '@ohos/axios'
import { uploadFile, uploadResult } from '../utils/uploadFile'
import { request } from '@kit.BasicServicesKit'
@Entry
@Component
struct UserRegister {
@Builder indicatorBuilder(icon: ResourceStr) {
Image(icon)
}
@State userErrorMsg: string = ''
@State idErrorMsg: string = ''
@State emailErrorMsg: string = ''
@State phoneErrorMsg: string = ''
@State userInfo: personData = {
username: '',
password: '',
personName: '',
email: '',
gender: '0',
birthDate: '选择日期',
code: '',
phone: '',
idNo: '',
personalImg: '',
idImgFront: '',
idImgBack: '',
address: '广西壮族自治区 南宁市 青秀区',
companyId: 0,
personId: 0,
userId: 0,
state: ''
}
private selectedDate: Date = new Date('2000-01-01')
@State confirmPassword: string = ''
dialogController: CustomDialogController = new CustomDialogController({
builder: UserCommit(),
autoCancel: false,
customStyle: true
})
@State pickerValue:string[] = ['广西壮族自治区','南宁市','青秀区']//省市区选中值
@State initEmail: string = this.userInfo.email
areaController: CustomDialogController = new CustomDialogController({
builder: AreaPickerDialog({
value:this.pickerValue,//首次默认选中值
onChange: (value:string[]) => {//选择改变回调
this.pickerValue = value
this.userInfo.address = this.pickerValue.join(' ')
}
}),
customStyle: true
})
async aboutToAppear() {
this.dialogController.open()
}
// 查询用户名是否被占用
queryName = async (userName: string) => {
const res: AxiosResponse<queryUserNameType> = await queryUsername(userName)
this.userErrorMsg = res.data.data == 1 ? '' : res.data.msg
}
// 查身份证是否被占用
queryId = async (id: string) => {
const res: AxiosResponse<queryIdNoType> = await queryIdNo(id)
this.idErrorMsg = res.data.total == 0 ? '' : '身份证号码已存在,请重新输入'
}
build() {
Column(){
Scroll(){
Column(){
Column(){
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('用户名')
}.width(90)
TextInput({placeholder: '4-20位,数字/字母组成', text: $$this.userInfo.username})
.backgroundColor('#fff').layoutWeight(1).showError(this.userErrorMsg).onBlur(() => {
this.queryName(this.userInfo.username)
}).onChange((value) => {
this.userErrorMsg = ValidateInputHandle(value, 'username') ? '' : '4-20位数字字母组成'
})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('密码')
}.width(90)
TextInput({placeholder: '请输入密码', text: $$this.userInfo.password})
.backgroundColor('#fff').layoutWeight(1).type(InputType.Password)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('确认密码')
}.width(90)
TextInput({placeholder: '请输入密码', text: $$this.confirmPassword})
.backgroundColor('#fff').layoutWeight(1).type(InputType.Password).borderWidth(0)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('姓名')
}.width(90)
TextInput({placeholder: '请输入姓名', text: $$this.userInfo.personName})
.backgroundColor('#fff').layoutWeight(1)
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('邮箱')
}.width(90)
TextInput({placeholder: '请输入邮箱', text: $$this.userInfo.email})
.backgroundColor('#fff').layoutWeight(1).type(InputType.Email)
.showError(this.emailErrorMsg).onChange(() => {
this.emailErrorMsg = ValidateInputHandle(this.userInfo.email, 'email') ? '' : '请正确输入邮箱'
})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('性别')
}.width(90)
Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) {
Row() {
Radio({ value: '0', group: 'radioGroup',
indicatorType:RadioIndicatorType.CUSTOM,
indicatorBuilder:()=>{this.indicatorBuilder($r('app.media.man'))}
}).checked(this.userInfo.gender == '0')
.height(20)
.width(20)
.onChange(() => {
this.userInfo.gender = '0'
})
Text('男')
}
Row() {
Radio({ value: '1', group: 'radioGroup',
indicatorType:RadioIndicatorType.CUSTOM,
indicatorBuilder:()=>{this.indicatorBuilder($r('app.media.pain_woman'))}
}).checked(this.userInfo.gender == '1')
.height(20)
.width(20)
.onChange(() => {
this.userInfo.gender = '1'
})
Text('女')
}
}
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('出生日期')
}.width(90)
Text(this.userInfo.birthDate).padding({top: 8, bottom: 8, left: 16, right: 16})
.backgroundColor('#fff').layoutWeight(1).fontColor('#000').onClick(() => {
CalendarPickerDialog.show({
selected: this.selectedDate,
onAccept: (value) => {
this.userInfo.birthDate = JSON.stringify(value).slice(1, 11)
}
})
})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('身份证号')
}.width(90)
TextInput({placeholder: '请输入身份证号', text: $$this.userInfo.idNo})
.backgroundColor('#fff').layoutWeight(1).type(InputType.Number)
.showError(this.idErrorMsg).onBlur(() => {
this.queryId(this.userInfo.idNo)
}).onChange(() => {
this.idErrorMsg = ValidateInputHandle(this.userInfo.idNo, 'idCard') ? '' : '请正确输入身份证'
})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('手机号')
}.width(90)
TextInput({placeholder: '请输入手机号', text: $$this.userInfo.phone})
.backgroundColor('#fff').layoutWeight(1).type(InputType.PhoneNumber)
.showError(this.phoneErrorMsg).onChange(() => {
this.phoneErrorMsg = ValidateInputHandle(this.userInfo.phone, 'phone') ? '' : '请正确输入手机号'
})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('个人照片')
}.width(90)
Row(){
Image(this.userInfo.personalImg !== '' ? baseUrl + this.userInfo.personalImg : $r('app.media.userAvatar')).width(80)
.onClick(async () => {
let that = this
let uploader = await uploadFile() as request.UploadTask
// 3. 监控上传错误
uploader.on('fail', (err) => {
console.log('上传错误--->', JSON.stringify(err))
})
// 4. 获取服务器返回来的数据
uploader.on('headerReceive',(res)=>{
let uploadInfo = JSON.parse(res['body']) as uploadResult
console.log(JSON.stringify(uploadInfo))
that.userInfo.personalImg = uploadInfo.fileName as string
})
})
}.layoutWeight(1).margin({left: 20})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('证件正面')
}.width(90)
Row(){
Image(this.userInfo.idImgFront !== '' ? baseUrl + this.userInfo.idImgFront : $r('app.media.idCard')).width(120)
.onClick(async () => {
let that = this
let uploader = await uploadFile() as request.UploadTask
// 3. 监控上传错误
uploader.on('fail', (err) => {
console.log('上传错误--->', JSON.stringify(err))
})
// 4. 获取服务器返回来的数据
uploader.on('headerReceive',(res)=>{
let uploadInfo = JSON.parse(res['body']) as uploadResult
that.userInfo.idImgFront = uploadInfo.fileName as string
})
})
}.layoutWeight(1).margin({left: 20})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('证件反面')
}.width(90)
Row(){
Image(this.userInfo.idImgBack !== '' ? baseUrl + this.userInfo.idImgBack : $r('app.media.unIdCard')).width(120)
.onClick(async () => {
let that = this
let uploader = await uploadFile() as request.UploadTask
// 3. 监控上传错误
uploader.on('fail', (err) => {
console.log('上传错误--->', JSON.stringify(err))
})
// 4. 获取服务器返回来的数据
uploader.on('headerReceive',(res)=>{
let uploadInfo = JSON.parse(res['body']) as uploadResult
that.userInfo.idImgBack = uploadInfo.fileName as string
})
})
}.layoutWeight(1).margin({left: 20})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
Row(){
Row(){
Image($r('app.media.require')).width(20)
Text('地址')
}.width(70)
Text(this.pickerValue.join(' ')).layoutWeight(1).padding({top: 8, bottom: 8, left: 16, right: 16})
.backgroundColor('#fff').fontColor('#999').textOverflow({overflow: TextOverflow.Ellipsis}).maxLines(2)
.onClick(() => {
this.areaController?.open()
})
}.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
}.backgroundColor('#fff').width('100%').padding({left: 5, right: 5}).borderRadius(10)
}.padding(10).margin({bottom: 20, top: 10})
}.layoutWeight(1).scrollBar(BarState.Off)
Row({ space: 10}){
Text('提交').borderRadius(5).layoutWeight(1).height(30).fontColor('#fff')
.backgroundColor('#1B65FD').fontSize(14).textAlign(TextAlign.Center)
.onClick(async () => {
if(this.confirmPassword !== this.userInfo.password) {
return promptAction.showToast({message: '两次密码输入不一致'})
}
if(this.userInfo?.personName == '') {
return promptAction.showToast({message: '姓名不能为空'})
} else if(this.userInfo?.email == '') {
return promptAction.showToast({message: '邮箱不能为空'})
} else if(this.userInfo?.idNo == '') {
return promptAction.showToast({message: '身份证不能为空'})
} else if(this.userInfo?.phone == '') {
return promptAction.showToast({message: '手机号不能为空'})
} else if(this.userInfo.idImgFront == '') {
return promptAction.showToast({message: '身份证件不能为空'})
} else if(this.userInfo.idImgBack == '') {
return promptAction.showToast({message: '身份证件不能为空'})
} else if(this.userInfo?.personalImg == '') {
return promptAction.showToast({message: '请上传头像'})
}
await userRegister(this.userInfo)
promptAction.showToast({
message: '注册成功',
duration: 2000
})
router.back()
})
}.width('100%').height(40).backgroundColor('#fff').padding({left: 10, right: 10})
}.width('100%').height('100%').backgroundColor('#f2f3f7')
}
}
\ No newline at end of file
... ...
import { getDownloadUrl, downloadUrl } from '../api/originalRecords'
import { AxiosResponse } from '@ohos/axios'
import { downFile } from '../utils/downFile'
import { router } from '@kit.ArkUI'
import PhotoBrowser from '../dialog/PhotoBrowserDialog'
import { uploadVideoOrImg } from '../api/cosKey'
interface routerParams {
cosKey: string
relateId: number
}
let routerQuery = router.getParams() as routerParams
@Entry
@Component
struct DownLoadImage {
@State imgList: string[] = []
@State videoList: string[] = []
@State cosKeyData: string[] = routerQuery?.cosKey.split(';')
@State viewImg: string[] = []
@State viewVideo: string[] = []
@State saveButtonOptions: SaveButtonOptions = {
icon: SaveIconStyle.FULL_FILLED,
text: SaveDescription.SAVE,
buttonType: ButtonType.Capsule
}
photoBrowserController: CustomDialogController = new CustomDialogController({
builder: PhotoBrowser({ imagesList: this.viewImg}),
customStyle: true,
offset: { dx: 0, dy: 0 },
alignment: DialogAlignment.Top,
})
aboutToAppear() {
this.cosKeyData.forEach((item: string) => {
let newArr = item.split('.')
let index = newArr.length - 1
if(newArr[index] == 'mp4') {
this.videoList.push(item)
}else {
this.imgList.push(item)
}
})
this.imgList.forEach(async (item: string) => {
const imgDta: AxiosResponse<downloadUrl> = await getDownloadUrl(item, 0)
this.viewImg.push(imgDta.data.data)
})
this.videoList.forEach(async (item: string) => {
const imgDta: AxiosResponse<downloadUrl> = await getDownloadUrl(item, 0)
this.viewVideo.push(imgDta.data.data)
})
}
build() {
List(){
ListItem(){
Column({ space: 10 }) {
Row(){
Row({space: 5}){
Text().width(2).height(20).backgroundColor('#1890ff')
Text('图片').fontSize(14).fontWeight(600)
}
Text('预览图片')
.fontSize(14).fontColor('#fff').backgroundColor('#1890ff')
.padding({left: 15, right: 15, top: 2, bottom: 2})
.borderRadius(4)
.onClick(() => {
this.photoBrowserController.open()
})
}
.justifyContent(FlexAlign.SpaceBetween)
.width('100%')
GridRow({ columns: 2, gutter: 10 }) {
ForEach(this.viewImg, (item: string) => {
GridCol() {
Column({space: 10}){
Image(item)
.width('100%')
.height(150)
.borderRadius(4)
Row(){
SaveButton(this.saveButtonOptions)
// 创建安全控件按钮
.onClick(async (event, result: SaveButtonOnClickResult) => {
if (result == SaveButtonOnClickResult.SUCCESS) {
downFile(item, 'jpg')
}
})
}
}
}
})
}
}
}.visibility(this.viewImg.length == 0 ? Visibility.None : Visibility.Visible)
ListItem(){
Column({ space: 10 }) {
Row(){
Row({space: 5}){
Text().width(2).height(20).backgroundColor('#1890ff')
Text('视频').fontSize(14).fontWeight(600)
}
}
.justifyContent(FlexAlign.Start)
.width('100%')
GridRow({ columns: 1}) {
ForEach(this.viewVideo, (item: string) => {
GridCol() {
Column({ space: 10}){
Video({ src: item }).width('100%').height(300).controls(true)
SaveButton(this.saveButtonOptions)
// 创建安全控件按钮
.onClick(async (event, result: SaveButtonOnClickResult) => {
if (result == SaveButtonOnClickResult.SUCCESS) {
downFile(item, 'mp4')
}
})
}
}
.margin({
top: 10
})
})
}
}
}.visibility(this.viewVideo.length == 0 ? Visibility.None : Visibility.Visible)
}.padding(10)
}
}
... ...
import { webview } from '@kit.ArkWeb'
import { router } from '@kit.ArkUI'
interface routerType {
filePath: string
}
let routerParams = router.getParams() as routerType
@Entry
@Component
struct ViewFile {
@State message: string = 'Hello World';
webviewController: webview.WebviewController = new webview.WebviewController()
build() {
Column(){
Web({
src: routerParams.filePath,
controller: this.webviewController,
}).javaScriptAccess(true).domStorageAccess(true).layoutWeight(1)
}.width('100%').height('100%')
}
}
\ No newline at end of file
... ...
export default class GlobalContext {
private constructor() { }
private static instance: GlobalContext;
private _objects = new Map<string, Object>();
public static getContext(): GlobalContext {
if (!GlobalContext.instance) {
GlobalContext.instance = new GlobalContext();
}
return GlobalContext.instance;
}
getObject(value: string): Object | undefined {
return this._objects.get(value);
}
setObject(key: string, objectClass: Object): void {
this._objects.set(key, objectClass);
}
}
... ...
export default 'https://xfwbzshd.crgx.net'
export const basePath = 'https://xfwbzs.crgx.net'
\ No newline at end of file
... ...
import fs from '@ohos.file.fs';
import { http } from '@kit.NetworkKit';
import { photoAccessHelper } from '@kit.MediaLibraryKit';
import { promptAction } from '@kit.ArkUI';
let context = getContext();
let phAccessHelper = photoAccessHelper.getPhotoAccessHelper(context);
export async function downFile(downPath: string, type: string) {
//获取相册管理模块的实例,用于访问和修改相册中的媒体文件 let phAccessHelper = photoAccessHelper.getPhotoAccessHelper(context);
// onClick触发后10秒内通过createAsset接口创建图片文件,10秒后createAsset权限收回
let uri: string
if(type == 'mp4') {
uri = await phAccessHelper.createAsset(photoAccessHelper.PhotoType.VIDEO, type);
} else {
uri = await phAccessHelper.createAsset(photoAccessHelper.PhotoType.IMAGE, type);
}
// 创建媒体文件
console.info('createAsset successfully, uri: ' + uri);
let file = fs.openSync(uri, fs.OpenMode.READ_WRITE || fs.OpenMode.CREATE);
let totalSize = 0;
let httpRequest = http.createHttp();
httpRequest.on("dataReceive", (data: ArrayBuffer) => {
let writeLen = fs.writeSync(file.fd, data); totalSize = totalSize + writeLen; });
httpRequest.requestInStream(downPath, { method: http.RequestMethod.GET, connectTimeout: 3000, }, httpCode => {
console.info('requestInStream HTTP CODE is', httpCode) })
httpRequest.on("dataEnd", () => {
fs.close(file);
promptAction.showToast({ message: `下载结束,并保存至相册,大小为:${totalSize}字节` }) })
}
\ No newline at end of file
... ...
此 diff 太大无法显示。
import preferencesUtil from './preferences'
export default async function loginOut(){
preferencesUtil.delete('XF_TOKEN')
preferencesUtil.delete('XF_PERSON_INFO')
preferencesUtil.delete('XF_COMPANY_ID')
preferencesUtil.delete('XF_PERSON_ID')
preferencesUtil.delete('XF_COMPANY_INFO')
preferencesUtil.delete('XF_ROLE_NAME')
}
\ No newline at end of file
... ...
import { preferences } from '@kit.ArkData'
class preferencesUtils {
get(key: string, value: preferences.ValueType) {
try {
const context = getContext(this)
const preferences_obj = preferences.getPreferencesSync(context, {name: 'userData'})
const result = preferences_obj.getSync(key, value)
if(key == 'XF_PERSON_ID') {
console.log(`获取${key}成功`)
}
return result
} catch (e){
return value
}
}
set(key: string, value: preferences.ValueType) {
try {
const context = getContext(this)
const preferences_obj = preferences.getPreferencesSync(context, {name: 'userData'})
preferences_obj.putSync(key, value)
preferences_obj.flush().then(() => {
if(key == 'XF_PERSON_ID') {
console.log(`存储${key}成功, 值为${value}`)
}
})
} catch (e){
}
}
delete(key: string) {
try {
const context = getContext(this)
const preferences_obj = preferences.getPreferencesSync(context, {name: 'userData'})
preferences_obj.deleteSync(key)
preferences_obj.flush().then(() => {
console.log('删除成功')
})
} catch (e){
console.log('删除失败')
}
}
}
export default new preferencesUtils()
\ No newline at end of file
... ...
import { common, Want } from '@kit.AbilityKit';
export function pushOutsideWeb(url: string) {
if (url) {
let context = getContext() as common.UIAbilityContext
let wantInfo: Want = {
action: 'ohos.want.action.viewData',
entities: ['entity.system.browsable'],
uri: url
}
context.startAbility(wantInfo).then(() => {
console.log('[跳转至外部浏览器] - success')
})
}
}
\ No newline at end of file
... ...
import fs from '@ohos.file.fs';
import { request, BusinessError } from '@kit.BasicServicesKit';
import { promptAction } from '@kit.ArkUI'
import { photoAccessHelper } from '@kit.MediaLibraryKit'
import { getCosKey, cosKeyTest, cosKeyData, uploadVideoOrImg } from '../api/cosKey'
import { AxiosResponse } from '@ohos/axios'
// 选择一张图片或视频
export async function selectImgOrVideo(){
// 1. 创建参数对象
const opts = new photoAccessHelper.PhotoSelectOptions() // 创建参数对象
opts.MIMEType = photoAccessHelper.PhotoViewMIMETypes.IMAGE_VIDEO_TYPE // 设置MIME类型
opts.maxSelectNumber = 1 // 设置最大选择数量
// 2. 创建选择器对象
const photoPicker = new photoAccessHelper.PhotoViewPicker() // 创建选择器对象
const photos = await photoPicker.select(opts) // 选择文件
return photos.photoUris[0] // 返回文件路径
}
/**
* 上传文件(通过uploadTask实现)
* @param context context
* @param media 媒体文件
*/
export async function uploadFileByTask(cosKeyStr: string, relateId: number, systemPhotoImagePath: string) {
let fileArr = systemPhotoImagePath.split('/')
let index = fileArr.length - 1
let filenames = fileArr[index] // 设置文件名称
// 获取直传签名等数据
let ext = filenames.split('.')[1] // 文件后缀
let filename = Date.now() + '.' + ext // 设置图片名称
let directTransferResult: AxiosResponse<cosKeyTest> = await getCosKey(filename);
let directTransferData: cosKeyData = directTransferResult.data.data
if (directTransferData == null) {
promptAction.showToast({ message: 'getStsDirectSign fail' });
return;
}
let cosKey = directTransferData.coskey
// 生成上传的url
let url = directTransferData.preSignedUrl
try {
let cacheDir = getContext().cacheDir // 获取缓存目录
let fullPath = cacheDir + '/' + filename // 设置图片路径
const file = fs.openSync(systemPhotoImagePath, fs.OpenMode.READ_ONLY) // 打开图片
// 复制uri文件到cacheDir(因为request.uploadFile只接受internal:类型的路径)
fs.copyFileSync(file.fd, fullPath) // 复制图片
// 开始上传
try {
let uploadTask = await request.uploadFile(getContext(),{ // 上传图片
url: url, // 请求地址
// 请求头
header:{
"Content-Type": "application/octet-stream"
},
method: "PUT",
files:[{ // 上传文件
filename: filename, // 文件名
type: ext, // 文件扩展名
name:'file', // 接口参数名
uri:`internal://cache/${filename}` // 缓存目录中的要上传给服务器的图片路径
}],
data:[]
})
// 成功后响应
uploadTask.on('progress', (uploadSize, totalSize) => {
console.log('上传进度--->', uploadSize, totalSize)
});
// 上传成功
uploadTask.on('complete', async (taskStates: Array<request.TaskState>) => {
for (let i = 0; i < taskStates.length; i++) {
let cosKeyArr: string[] = []
if(cosKeyStr !== '') {
cosKeyArr = cosKeyStr.split(';')
}
cosKeyArr.push(cosKey)
console.log('cosKeyArr--->', cosKeyArr.join(';'), relateId)
await uploadVideoOrImg({ cosKey: cosKeyArr.join(';'), relateId: relateId })
promptAction.showToast({ message: '上传成功' });
}
});
// 上传失败
uploadTask.on('fail', (taskStates: Array<request.TaskState>) => {
for (let i = 0; i < taskStates.length; i++) {
promptAction.showToast({ message: '上传失败' });
}
});
} catch (error) {
let err: BusinessError = error as BusinessError;
console.error(`Invoke uploadFile failed, code is ${err.code}, message is ${err.message}`);
}
} catch (err) {
console.info("uploadFile Error sending PUT request: " + JSON.stringify(err));
promptAction.showToast({ message: "uploadFile Error sending PUT request: " + JSON.stringify(err) });
}
}
\ No newline at end of file
... ...
import { picker } from '@kit.CoreFileKit';
import { common } from '@kit.AbilityKit';
import { request,BusinessError } from '@kit.BasicServicesKit';
import fs from '@ohos.file.fs';
export async function selectDocFile(){
const documentSelectOptions = new picker.DocumentSelectOptions();
// 选择文档的最大数目(可选)
documentSelectOptions.maxSelectNumber = 1;
// 选择文件的后缀类型['后缀类型描述|后缀类型'](可选) 若选择项存在多个后缀名,则每一个后缀名之间用英文逗号进行分隔(可选),后缀类型名不能超过100,选择所有文件:'所有文件(*.*)|.*';
documentSelectOptions.fileSuffixFilters = ['.png,.jpg,.jpeg', '.pdf'];
let context = getContext() as common.Context; // 请确保 getContext(this) 返回结果为 UIAbilityContext
// 创建文件选择器实例
const documentViewPicker = new picker.DocumentViewPicker(context);
try {
let documentSelectResult = await documentViewPicker.select(documentSelectOptions)
console.log('结果为:' + documentSelectResult)
return documentSelectResult
}catch (error){
let err: BusinessError = error as BusinessError;
console.error(`Invoke uploadFile failed, code is ${err.code}, message is ${err.message}`);
return error
}
}
// 拷贝图片路径到缓存
export async function copyCachePath(systemPhotoImagePath: string) {
let cacheDir = getContext().cacheDir // 获取缓存目录
// let endType = systemPhotoImagePath.split('.')
// let index = endType.length - 1
let filetype = 'pdf' // 设置图片类型
let filename = Date.now() + '.' + filetype // 设置图片名称
let fullPath = cacheDir + '/' + filename // 设置图片路径
console.log('文件路径为:' + fullPath)
const file = fs.openSync(systemPhotoImagePath, fs.OpenMode.READ_ONLY) // 打开图片
console.log('文件路径为:' + file)
fs.copyFileSync(file.fd, fullPath) // 复制图片
return [fullPath, filename, filetype]
}
export async function uploadDocFile() {
const documentViewPicker = new picker.DocumentViewPicker(getContext());
let documentSelectOptions = new picker.DocumentSelectOptions();
documentSelectOptions.maxSelectNumber = 1
documentSelectOptions.fileSuffixFilters = ['.png', '.pdf', '.jpg', '.jpeg'];
//选择是否对指定文件或目录授权,true为授权,当为true时,defaultFilePathUri为必选参数,拉起文管授权界面;false为非授权,拉起常规文管界面(可选)
documentSelectOptions.authMode = true;
let documentSelectResult: Array<string> = await documentViewPicker.select(documentSelectOptions)
// 文件上传的时候一定要先拷贝一份,然后在进行上传,要不然没权限操作文件
const context = getContext()
const endType = documentSelectResult[0].split('.')
const index = endType.length - 1
const fileType = endType[index]
// (以时间戳)生成一个新的文件名
const fileName = Date.now() + '.' + fileType
// 通过缓存路径+文件名 拼接出完整的路径
const copyFilePath = context.cacheDir + '/' + fileName
// 将文件 拷贝到 临时目录
const file = fs.openSync(documentSelectResult[0], fs.OpenMode.READ_ONLY)
fs.copyFileSync(file.fd, copyFilePath)
let uploadConfig: request.UploadConfig = {
url: 'http://xfwbzshd.crgx.net/common/upload', // 需要手动将 url 替换为真实服务器的 HTTP 协议地址
header:{
'Content-Type': 'multipart/form-data',
},
method: "POST",
files: [{ filename: fileName, name: "file", uri: `internal://cache/${fileName}`, type: "pdf" }],
data: [],
};
try {
let uploader = await request.uploadFile(getContext(), uploadConfig)
return uploader
} catch (err) {
console.error(`Failed to request the upload. err: ${JSON.stringify(err)}`);
return err
}
}
... ...
import { photoAccessHelper } from '@kit.MediaLibraryKit'
import fs from '@ohos.file.fs';
import { request, BusinessError } from '@kit.BasicServicesKit';
import preferencesUtils from '../utils/preferences'
export interface uploadResult {
code?: number
msg?: string
fileName?: string
newFileName?: string
url: string
originalFilename?: string
}
// 选择一张图片
export async function selectImg(){
// 1. 创建参数对象
const opts = new photoAccessHelper.PhotoSelectOptions() // 创建参数对象
opts.MIMEType = photoAccessHelper.PhotoViewMIMETypes.IMAGE_TYPE // 设置MIME类型
opts.maxSelectNumber = 1 // 设置最大选择数量
// 2. 创建选择器对象
const photoPicker = new photoAccessHelper.PhotoViewPicker() // 创建选择器对象
const photos = await photoPicker.select(opts) // 选择图片
return photos.photoUris[0] // 返回图片路径
}
// 拷贝图片路径到缓存
export async function copyCachePath(systemPhotoImagePath: string) {
let cacheDir = getContext().cacheDir // 获取缓存目录
let filetype = 'jpg' // 设置图片类型
let filename = Date.now() + '.' + filetype // 设置图片名称
let fullPath = cacheDir + '/' + filename // 设置图片路径
const file = fs.openSync(systemPhotoImagePath, fs.OpenMode.READ_ONLY) // 打开图片
fs.copyFileSync(file.fd, fullPath) // 复制图片
return [fullPath, filename]
}
// 上传图片至服务器
export async function uploadFile() {
// 1. 完成图片上传并获得上传对象
try {
let systemPhotoImagePath = await selectImg() // 选择图片
const fileData: string[] = await copyCachePath(systemPhotoImagePath)
let uploader = await request.uploadFile(getContext(),{ // 上传图片
url:'http://xfwbzshd.crgx.net/common/upload', // 请求地址
method:'POST', // 请求方式
// 请求头
header:{
'Content-Type': 'multipart/form-data',
'Authorization': preferencesUtils.get('XF_TOKEN', '') as string
},
files:[{ // 上传文件
filename: fileData[1], // 文件名
type: 'jpg', // 文件扩展名
name:'file', // 接口参数名
uri:`internal://cache/${fileData[1]}` // 缓存目录中的要上传给服务器的图片路径
}],
data:[]
})
return uploader
} catch (error) {
let err: BusinessError = error as BusinessError;
console.error(`Invoke uploadFile failed, code is ${err.code}, message is ${err.message}`);
return error
}
}
\ No newline at end of file
... ...
/**
* 手机号和密码的正则表达式 API
* @param input : 用户输入的手机号或者密码或者用户名
* @param type : 调用者需要明确传入的是手机号 还是 密码 校验
*/
type typeValue = "phone" | "password" | "email" | "idCard" | "businessLicenseNo" | "username"
export function ValidateInputHandle(input: string, type: typeValue): boolean {
switch(type) {
case "phone":
const phoneRegex = /^1[3456789]\d{9}$/
return phoneRegex.test(input)
case "email":
const emailRegex = /^([a-zA-Z]|[0-9])(\w|\-)+@[a-zA-Z0-9]+\.([a-zA-Z]{2,4})$/
return emailRegex.test(input)
case "businessLicenseNo":
const businessLicenseNoRegex = /^[0-9A-HJ-NPQRTUWXY]{2}\d{6}[0-9A-HJ-NPQRTUWXY]{10}$/
return businessLicenseNoRegex.test(input)
case "username":
const usernameRegex = /^[a-zA-Z0-9]{4,20}$/
return usernameRegex.test(input)
case "idCard":
if(input === '') {
return true
} else {
const idCardRegex = /^([1-6][1-9]|50)\d{4}(18|19|20)\d{2}((0[1-9])|10|11|12)(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/
return idCardRegex.test(input)
}
default :
throw new Error("传入的参数有误!")
}
}
... ...
{
"module": {
"name": "entry",
"type": "entry",
"requestPermissions": [
{
"name": "ohos.permission.INTERNET"
},
{
"name": "ohos.permission.READ_MEDIA",
"reason": "$string:EntryAbility1_desc",
"usedScene": {
"abilities": [
"EntryAbility"
],
"when": "inuse"
}
},
{
"name": "ohos.permission.WRITE_MEDIA",
"reason": "$string:EntryAbility1_desc",
"usedScene": {
"abilities": [
"EntryAbility"
],
"when": "inuse"
}
}
],
"description": "$string:module_desc",
"mainElement": "EntryAbility",
"deviceTypes": [
"phone",
"tablet",
"2in1"
],
"deliveryWithInstall": true,
"installationFree": false,
"pages": "$profile:main_pages",
"abilities": [
{
"name": "EntryAbility",
"srcEntry": "./ets/entryability/EntryAbility.ets",
"description": "$string:EntryAbility_desc",
"icon": "$media:layered_image",
"label": "$string:EntryAbility_label",
"startWindowIcon": "$media:logo",
"startWindowBackground": "$color:start_window_background",
"exported": true,
"skills": [
{
"entities": [
"entity.system.home"
],
"actions": [
"action.system.home"
]
}
]
}
],
"extensionAbilities": [
{
"name": "EntryBackupAbility",
"srcEntry": "./ets/entrybackupability/EntryBackupAbility.ets",
"type": "backup",
"exported": false,
"metadata": [
{
"name": "ohos.extension.backup",
"resource": "$profile:backup_config"
}
],
}
]
}
}
\ No newline at end of file
... ...
不能预览此文件类型
不能预览此文件类型
{
"color": [
{
"name": "start_window_background",
"value": "#FFFFFF"
}
]
}
\ No newline at end of file
... ...
{
"string": [
{
"name": "module_desc",
"value": "module description"
},
{
"name": "EntryAbility_desc",
"value": "description"
},
{
"name": "EntryAbility1_desc",
"value": "读取文件"
},
{
"name": "EntryAbility2_desc",
"value": "读取相册"
},
{
"name": "EntryAbility3_desc",
"value": "读取剪切板"
},
{
"name": "EntryAbility_label",
"value": "消防维保助手"
},
{
"name": "video",
"value": "消防维保助手广告"
}
]
}
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1734333123572" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5140" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M502.496 63.136c125.888 0 227.936 100.384 227.936 224.192 0 123.84-102.048 224.224-227.936 224.224-125.888 0-227.936-100.384-227.936-224.224C274.56 163.488 376.64 63.136 502.496 63.136L502.496 63.136zM502.496 63.136c125.888 0 227.936 100.384 227.936 224.192 0 123.84-102.048 224.224-227.936 224.224-125.888 0-227.936-100.384-227.936-224.224C274.56 163.488 376.64 63.136 502.496 63.136L502.496 63.136zM417.024 586.304l189.984 0c162.624 0 294.432 129.632 294.432 289.6l0 18.656c0 63.04-131.84 65.44-294.432 65.44l-189.984 0c-162.624 0-294.432-0.096-294.432-65.44l0-18.656C122.592 715.936 254.4 586.304 417.024 586.304L417.024 586.304zM417.024 586.304" fill="#ffffff" p-id="5141"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1731983891304" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8261" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M512 74.666667C270.464 74.666667 74.666667 270.464 74.666667 512S270.464 949.333333 512 949.333333 949.333333 753.536 949.333333 512 753.536 74.666667 512 74.666667z m0 64c206.186667 0 373.333333 167.146667 373.333333 373.333333S718.186667 885.333333 512 885.333333 138.666667 718.186667 138.666667 512 305.813333 138.666667 512 138.666667z" fill="#262626" p-id="8262"></path><path d="M320 480m32 0l320 0q32 0 32 32l0 0q0 32-32 32l-320 0q-32 0-32-32l0 0q0-32 32-32Z" fill="#262626" p-id="8263"></path><path d="M544 330.666667m0 32l0 320q0 32-32 32l0 0q-32 0-32-32l0-320q0-32 32-32l0 0q32 0 32 32Z" fill="#262626" p-id="8264"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1731982000597" class="icon" viewBox="0 0 1432 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4388" xmlns:xlink="http://www.w3.org/1999/xlink" width="358" height="256"><path d="M1323.925683 8.113661H111.353005c-56.236066 0-102.120219 45.884153-102.120218 102.120219V915.165027c0 56.236066 45.884153 102.120219 102.120218 102.120219h1212.292897c56.236066 0 102.120219-45.884153 102.120218-102.120219V110.23388c0.279781-56.236066-45.604372-102.120219-101.840437-102.120219z m79.737705 906.771585c0 43.925683-35.812022 79.737705-79.737705 79.737705H111.353005c-43.925683 0-79.737705-35.812022-79.737704-79.737705V110.23388c0-43.925683 35.812022-79.737705 79.737704-79.737705h1212.292897c43.925683 0 79.737705 35.812022 79.737705 79.737705v804.651366z" fill="#dbdbdb" p-id="4389"></path><path d="M604.048087 452.406557c0-108.555191-88.131148-196.686339-196.686338-196.686338s-196.686339 88.131148-196.686339 196.686338c0 60.153005 27.138798 114.15082 69.945355 150.242623l-47.003279 86.172678c-1.95847 3.637158-1.678689 7.83388 0.279782 11.191257 2.238251 3.357377 5.87541 5.595628 9.792349 5.315847l62.95082-2.238252 30.496175 53.438252c1.95847 3.357377 5.595628 5.595628 9.79235 5.595628h0.279781c4.196721 0 7.83388-2.238251 9.79235-5.87541l57.355191-107.156284h3.077596l60.432787 107.436066c1.95847 3.637158 5.595628 5.595628 9.792349 5.595628 3.91694 0 7.83388-2.238251 9.79235-5.595628l30.496175-53.438252 62.391257 2.238252c3.91694 0.279781 7.83388-1.95847 10.072131-5.315847 2.238251-3.357377 2.238251-7.83388 0.279781-11.471038L545.57377 592.297268c36.091803-35.812022 58.474317-85.333333 58.474317-139.890711z m-370.990164 0c0-96.244809 78.059016-174.303825 174.303826-174.303825s174.303825 78.059016 174.303825 174.303825c0 50.640437-21.543169 96.244809-56.236066 127.86011-1.119126 0.839344-2.238251 1.678689-3.077595 2.797814-30.775956 27.138798-71.064481 43.645902-114.990164 43.645902-95.965027 0-174.303825-78.059016-174.303826-174.303826zM346.64918 727.711475l-23.78142-41.687431c-1.95847-3.637158-5.87541-5.87541-10.072132-5.595629l-50.080874 1.95847 36.091803-66.028415c26.299454 17.62623 57.07541 28.817486 90.369399 32.174863L346.64918 727.711475z m224.3847-45.32459l-49.521312-1.95847c-4.196721-0.279781-8.113661 1.95847-10.072131 5.595629l-24.061202 41.967213-45.884153-81.975956c32.454645-5.595628 62.111475-19.304918 87.291803-38.889618l42.246995 75.261202z" fill="#dbdbdb" p-id="4390"></path><path d="M407.361749 546.692896c52.039344 0 94.286339-42.246995 94.286338-94.286339s-42.246995-94.286339-94.286338-94.286338-94.286339 42.246995-94.286339 94.286338 42.526776 94.286339 94.286339 94.286339z m0-166.190164c39.728962 0 71.903825 32.174863 71.903825 71.903825s-32.174863 71.903825-71.903825 71.903826-71.903825-32.174863-71.903826-71.903826c0-39.44918 32.454645-71.903825 71.903826-71.903825zM1224.603279 339.934426H819.759563c-6.155191 0-11.191257 5.036066-11.191257 11.191257s5.036066 11.191257 11.191257 11.191257h404.843716c6.155191 0 11.191257-5.036066 11.191257-11.191257s-5.036066-11.191257-11.191257-11.191257zM1224.603279 497.731148H819.759563c-6.155191 0-11.191257 5.036066-11.191257 11.191256s5.036066 11.191257 11.191257 11.191257h404.843716c6.155191 0 11.191257-5.036066 11.191257-11.191257s-5.036066-11.191257-11.191257-11.191256zM1224.603279 658.045902H819.759563c-6.155191 0-11.191257 5.036066-11.191257 11.191256s5.036066 11.191257 11.191257 11.191257h404.843716c6.155191 0 11.191257-5.036066 11.191257-11.191257s-5.036066-11.191257-11.191257-11.191256z" fill="#dbdbdb" p-id="4391"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1732075527544" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3846" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M717.154 698.893c-9.841 9.665-25.656 9.522-35.319-0.318l-157.178-160.05-157.178 160.05c-9.666 9.84-25.478 9.983-35.319 0.318-9.842-9.664-9.985-25.479-0.322-35.319L489.65 502.879 331.838 342.184c-9.663-9.841-9.52-25.658 0.322-35.319 9.841-9.666 25.653-9.523 35.319 0.317l157.178 160.05 157.178-160.05c9.663-9.84 25.478-9.983 35.319-0.317 9.841 9.661 9.985 25.478 0.321 35.319L559.663 502.879l157.812 160.695c9.664 9.84 9.52 25.655-0.321 35.319z m229.713 83.48c-7.294 11.706-22.697 15.284-34.405 7.991-11.706-7.292-15.285-22.696-7.992-34.404 45.244-72.624 69.579-156.469 69.579-243.961C974.049 256.82 767.182 49.952 512 49.952S49.952 256.82 49.952 511.999c0 255.181 206.866 462.048 462.048 462.048 106.002 0 206.471-35.768 287.646-100.434 10.789-8.592 26.503-6.814 35.096 3.975 8.593 10.792 6.816 26.507-3.973 35.099C740.825 984.33 629.411 1023.999 512 1023.999c-282.771 0-512-229.228-512-512S229.229-0.002 512-0.002c282.769 0 512 229.229 512 512.001 0 96.897-26.987 189.882-77.133 270.374z" fill="#CDCDCF" p-id="3847"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1731984706758" class="icon" viewBox="0 0 1060 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="13893" xmlns:xlink="http://www.w3.org/1999/xlink" width="265" height="256"><path d="M168.512203 670.800544h169.970609v71.992231H168.512203z" fill="#999999" p-id="13894"></path><path d="M1013.194536 952.007768V405.304331a111.170324 111.170324 0 0 0-108.651259-113.225351H676.17013V112.695022A110.971451 110.971451 0 0 0 567.121124 0h-411.005373A111.037742 111.037742 0 0 0 47.265618 112.695022v839.312746H0v71.992232h1060.659028v-71.992232z m-407.226775 0H117.003949V123.566777a50.646469 50.646469 0 0 1 49.519518-51.574545H556.84599a50.580177 50.580177 0 0 1 49.386935 51.574545z m337.422153 0H676.17013V364.071211h218.098013a50.779051 50.779051 0 0 1 49.453227 51.83971z" fill="#999999" p-id="13895"></path><path d="M168.512203 257.342397h169.970609v71.992231H168.512203zM168.512203 469.34162h169.970609v71.992231H168.512203zM384.62148 670.800544h175.273904v71.992231H384.62148zM727.280637 712.033663h169.970609v71.992232h-169.970609zM727.280637 531.78792h169.970609v71.727067h-169.970609zM384.62148 257.342397h175.273904v71.992231H384.62148zM384.62148 469.34162h175.273904v71.992231H384.62148z" fill="#999999" p-id="13896"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1731985269715" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="15179" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M128 384v512h768V192h-128v32q0 14.016-8.992 23.008T736 256t-23.008-8.992T704 224V192H320v32q0 14.016-8.992 23.008T288 256t-23.008-8.992T256 224V192H128v128h768v64H128z m192-256h384V96q0-14.016 8.992-23.008T736 64t23.008 8.992T768 96v32h160q14.016 0 23.008 8.992T960 160v768q0 14.016-8.992 23.008T928 960H96q-14.016 0-23.008-8.992T64 928V160q0-14.016 8.992-23.008T96 128h160V96q0-14.016 8.992-23.008T288 64t23.008 8.992T320 96v32zM288 512h64q14.016 0 23.008 8.992T384 544t-8.992 23.008T352 576H288q-14.016 0-23.008-8.992T256 544t8.992-23.008T288 512z m0 192h64q14.016 0 23.008 8.992T384 736t-8.992 23.008T352 768H288q-14.016 0-23.008-8.992T256 736t8.992-23.008T288 704z m192-192h64q14.016 0 23.008 8.992T576 544t-8.992 23.008T544 576h-64q-14.016 0-23.008-8.992T448 544t8.992-23.008T480 512z m0 192h64q14.016 0 23.008 8.992T576 736t-8.992 23.008T544 768h-64q-14.016 0-23.008-8.992T448 736t8.992-23.008T480 704z m192-192h64q14.016 0 23.008 8.992T768 544t-8.992 23.008T736 576h-64q-14.016 0-23.008-8.992T640 544t8.992-23.008T672 512z m0 192h64q14.016 0 23.008 8.992T768 736t-8.992 23.008T736 768h-64q-14.016 0-23.008-8.992T640 736t8.992-23.008T672 704z" p-id="15180" fill="#999999"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1732867708246" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6123" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M512 858.996364c-191.627636 0-346.996364-155.368727-346.996364-346.996364S320.395636 165.003636 512 165.003636 858.996364 320.395636 858.996364 512 703.604364 858.996364 512 858.996364zM512 884.363636c205.661091 0 372.363636-166.702545 372.363636-372.363636S717.661091 139.636364 512 139.636364 139.636364 306.338909 139.636364 512s166.702545 372.363636 372.363636 372.363636z" p-id="6124" fill="#d81e06"></path><path d="M512.442182 521.425455l-169.099637 177.24509-17.524363-18.385454 169.099636-177.221818-151.575273-158.882909 17.524364-18.362182 151.575273 158.882909L663.970909 325.818182l17.524364 18.385454-151.552 158.859637 169.076363 177.245091-17.524363 18.385454-169.076364-177.268363z" p-id="6125" fill="#d81e06"></path><path d="M512.442182 521.425455l-169.099637 177.24509-17.524363-18.385454 169.099636-177.221818-151.575273-158.882909 17.524364-18.362182 151.575273 158.882909L663.970909 325.818182l17.524364 18.385454-151.552 158.859637 169.076363 177.245091-17.524363 18.385454-169.076364-177.268363z" p-id="6126" fill="#d81e06"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1733283402982" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5567" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M672 128 640 128 256 128C217.6 128 192 153.6 192 192l0 640c0 38.4 25.6 64 64 64l512 0c38.4 0 64-25.6 64-64L832 320 832 288 672 128zM800 819.2c0 25.6-19.2 51.2-51.2 51.2L268.8 870.4c-25.6 0-51.2-19.2-51.2-51.2L217.6 204.8c0-25.6 19.2-51.2 51.2-51.2L640 153.6 640 256c0 38.4 25.6 64 64 64l96 0L800 819.2zM716.8 288c-25.6 0-51.2-19.2-51.2-51.2L665.6 160l128 128L716.8 288z" p-id="5568" fill="#1890ff"></path><path d="M691.2 416 332.8 416C326.4 416 320 409.6 320 403.2l0 0C320 390.4 326.4 384 332.8 384l352 0C697.6 384 704 390.4 704 403.2l0 0C704 409.6 697.6 416 691.2 416z" p-id="5569" fill="#1890ff"></path><path d="M691.2 563.2 332.8 563.2C326.4 563.2 320 550.4 320 544l0 0c0-6.4 6.4-12.8 12.8-12.8l352 0c6.4 0 12.8 6.4 12.8 12.8l0 0C704 550.4 697.6 563.2 691.2 563.2z" p-id="5570" fill="#1890ff"></path><path d="M499.2 704 332.8 704C326.4 704 320 697.6 320 684.8l0 0c0-6.4 6.4-12.8 12.8-12.8l160 0c6.4 0 12.8 6.4 12.8 12.8l0 0C512 697.6 505.6 704 499.2 704z" p-id="5571" fill="#1890ff"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1732087694083" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5288" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M866.56 447.296L544 770.48V96h-80v672.16L142.448 447.296 85.248 503.84 503.84 922.448 922.496 503.84z" fill="#2c2c2c" p-id="5289"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1732518240313" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4275" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M882.192537 850.752816H141.881817c-16.379257 0-29.655241 13.274027-29.655241 29.651327 0 16.379257 13.275984 29.655241 29.655241 29.655241h740.312676c16.379257 0 29.655241-13.275984 29.655241-29.655241-0.001957-16.3773-13.27794-29.651327-29.657197-29.651327zM141.801593 765.557591l0.04109-0.001957 0.04109 0.001957h129.24762c8.216044 0 15.64942-3.343943 21.022427-8.74043l458.143727-458.143728c5.879783-5.419967 9.58571-13.16054 9.58571-21.785527l-0.003913-0.060656 0.001957-0.02348c0-8.63477-3.711797-16.38317-9.601364-21.801181L624.024061 128.74867c-0.04109-0.05283-0.095877-0.09979-0.136967-0.15262a30.273547 30.273547 0 0 0-1.886226-2.085807c-0.289587-0.2935-0.606567-0.56352-0.911807-0.84528-0.4696-0.436337-0.937243-0.872673-1.434237-1.277703-0.350243-0.285673-0.72201-0.543953-1.087907-0.813974-0.453947-0.336547-0.907893-0.673093-1.37945-0.984203-0.39916-0.260237-0.81006-0.49895-1.22096-0.73962a28.539941 28.539941 0 0 0-1.434236-0.802234 31.073824 31.073824 0 0 0-4.19705-1.77274c-0.538083-0.180013-1.09182-0.332633-1.645557-0.485253-0.453947-0.12327-0.905937-0.250453-1.369667-0.3522a28.547767 28.547767 0 0 0-1.894053-0.32872c-0.4109-0.062613-0.81593-0.142837-1.234657-0.18784a29.185641 29.185641 0 0 0-3.030877-0.174143c-0.060657 0-0.121313-0.009783-0.18197-0.009784H600.953004a29.561321 29.561321 0 0 0-20.971554 8.687601L120.920046 585.485553a29.729594 29.729594 0 0 0-6.396343 9.527011 29.541754 29.541754 0 0 0-2.379307 11.642166V735.90235c0 16.379257 13.27794 29.655241 29.657197 29.655241z m459.165107-576.238347l87.400389 87.400389-49.893044 49.895001-87.400389-87.402345 49.893044-49.893045zM171.456834 618.825197l337.800898-337.796984 87.402345 87.400389-337.818508 337.816551h-87.384735v-87.419956z" fill="#1890ff" p-id="4276"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1732092661727" class="icon" viewBox="0 0 1557 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7827" xmlns:xlink="http://www.w3.org/1999/xlink" width="389.25" height="256"><path d="M156.183 690.571h20.806c5.61 0.103 10.116 4.69 10.096 10.3a10.157 10.157 0 0 1-10.096 10.302h-20.786v20.826a10.3 10.3 0 0 1-10.321 10.096 10.137 10.137 0 0 1-10.3-10.096v-20.826h-20.827a10.3 10.3 0 0 1-10.116-10.301c0-5.693 4.443-10.3 10.116-10.3h20.806v-20.848a10.3 10.3 0 0 1 10.3-10.095c5.694 0 10.322 4.423 10.322 10.095v20.827z m1360.336-82.446V587.3a10.137 10.137 0 0 0-10.3-10.096 10.3 10.3 0 0 0-10.301 10.096v20.826h-20.826a10.137 10.137 0 0 0-10.096 10.301c0 5.53 4.546 10.3 10.096 10.3h20.826v20.827c0 5.652 4.608 10.096 10.3 10.096 5.612 0 10.199-4.505 10.301-10.096v-20.826h20.827a10.157 10.157 0 0 0 10.096-10.301 10.3 10.3 0 0 0-10.096-10.3h-20.827zM767.75 948.21H248.867a20.52 20.52 0 0 1-20.56-20.622 20.683 20.683 0 0 1 20.56-20.601h93.463a81.913 81.913 0 0 1-10.956-41.12V267.917a82.384 82.384 0 0 1 82.528-82.323h61.742v-20.744a82.384 82.384 0 0 1 82.528-82.344h494.511a82.343 82.343 0 0 1 82.528 82.323v597.968c0 14.97-3.993 29.018-10.976 41.1h114.023c11.386 0 20.622 9.154 20.622 20.622 0 11.366-9.174 20.602-20.601 20.602H990.942v20.724c0 14.99-3.993 29.017-10.997 41.12h11.059c11.324 0 20.54 9.154 20.54 20.601a20.683 20.683 0 0 1-20.54 20.622H882.57c9.42 15.768 7.372 36.472-6.349 50.172a41.12 41.12 0 0 1-58.281 0l-50.172-50.172z m75.36-41.223h65.53a41.1 41.1 0 0 0 41.08-41.326V266.956c0-22.26-17.816-40.138-39.79-40.138H412.388a39.974 39.974 0 0 0-39.769 40.138V865.66c0 22.813 18.554 41.326 41.04 41.326h312.868l-10.588-10.629a41.141 41.141 0 0 1-10.71-39.83l-19.454-19.475A144.311 144.311 0 0 1 497.31 619.45a144.27 144.27 0 0 1 217.603 188.462l19.455 19.455a41.08 41.08 0 0 1 39.85 10.71l68.91 68.91z m147.833-103.068h62.009a41.243 41.243 0 0 0 41.038-41.223V164.974a41.1 41.1 0 0 0-41.038-41.223H557.886a41.243 41.243 0 0 0-41.018 41.223v20.6h391.546a82.343 82.343 0 0 1 82.528 82.344V803.92zM264.37 46.465h30.717c8.663 0 15.666 6.86 15.666 15.441a15.564 15.564 0 0 1-15.645 15.461H264.39v30.718a15.523 15.523 0 0 1-15.46 15.666 15.564 15.564 0 0 1-15.462-15.666V77.367H202.75a15.523 15.523 0 0 1-15.665-15.46 15.564 15.564 0 0 1 15.665-15.442h30.718V15.748c0-8.662 6.86-15.666 15.461-15.666a15.564 15.564 0 0 1 15.461 15.666v30.717zM22.213 927.588a20.683 20.683 0 0 1 20.56-20.601h123.792c11.345 0 20.54 9.153 20.54 20.6a20.683 20.683 0 0 1-20.56 20.643H42.753a20.52 20.52 0 0 1-20.56-20.622z m650.004-133.232A103.068 103.068 0 1 0 526.452 648.59a103.068 103.068 0 0 0 145.765 145.765zM455.044 309.244c0-11.366 9.215-20.601 20.58-20.601h226.758a20.601 20.601 0 0 1 0 41.222H475.645a20.54 20.54 0 0 1-20.601-20.621z m0 103.067c0-11.386 9.174-20.621 20.478-20.621h330.05a20.478 20.478 0 0 1 20.478 20.621c0 11.386-9.174 20.602-20.478 20.602h-330.07a20.478 20.478 0 0 1-20.479-20.602z m0 103.047c0-11.365 9.195-20.6 20.56-20.6h144.373c11.345 0 20.56 9.153 20.56 20.6 0 11.386-9.195 20.622-20.56 20.622H475.604a20.52 20.52 0 0 1-20.56-20.622zM63.416 391.69a61.845 61.845 0 1 1 0-123.67 61.845 61.845 0 0 1 0 123.69z m0-30.923a30.922 30.922 0 1 0 0.02-61.824 30.922 30.922 0 0 0 0 61.845z m1277.91-92.746a61.845 61.845 0 1 1 0-123.669 61.845 61.845 0 0 1 0 123.69z m0-30.923a30.922 30.922 0 1 0 0-61.824 30.922 30.922 0 0 0 0 61.845z" p-id="7828"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1731983865956" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7252" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M531.968 942.592c-12.032 0-24.064-3.584-34.304-10.496l-139.52-94.464c-19.2-13.056-30.72-34.56-30.72-57.856V451.584l-221.184-220.16c-21.504-21.248-27.904-53.248-16.384-81.152s38.656-46.08 68.864-46.08h606.72c30.208 0 57.344 18.176 68.864 46.08s5.12 59.904-16.64 81.152l-224.256 221.44v428.288c0 22.784-12.544 43.52-32.512 54.272-9.216 4.864-18.944 7.168-28.928 7.168zM158.976 165.632c-7.68 0-10.752 5.12-12.032 7.936-1.28 3.072-2.56 8.704 2.816 14.08l230.144 229.376c5.888 5.888 8.96 13.568 8.96 21.76v340.992c0 2.816 1.28 5.376 3.584 6.912l139.264 94.208V440.064c0-8.192 3.328-16.128 9.216-21.76l233.472-230.4c5.376-5.376 4.096-11.264 2.816-14.08s-4.352-7.936-12.032-7.936H158.976z" fill="#040000" p-id="7253"></path><path d="M908.288 544h-219.904c-16.896 0-30.72-13.824-30.72-30.72s13.824-30.72 30.72-30.72h219.904c16.896 0 30.72 13.824 30.72 30.72 0 17.152-13.824 30.72-30.72 30.72zM908.288 712.96h-219.904c-16.896 0-30.72-13.824-30.72-30.72s13.824-30.72 30.72-30.72h219.904c16.896 0 30.72 13.824 30.72 30.72s-13.824 30.72-30.72 30.72zM908.288 881.664h-219.904c-16.896 0-30.72-13.824-30.72-30.72s13.824-30.72 30.72-30.72h219.904c16.896 0 30.72 13.824 30.72 30.72s-13.824 30.72-30.72 30.72z" fill="#040000" p-id="7254"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1734438639673" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4275" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M515.08736 40.40704c-258.35008 0-468.53632 210.18624-468.53632 468.53632s210.18624 468.53632 468.53632 468.53632 468.53632-210.18624 468.53632-468.53632-210.18624-468.53632-468.53632-468.53632z m0 875.63264c-224.47616 0-407.09632-182.62016-407.09632-407.09632s182.62016-407.09632 407.09632-407.09632 407.09632 182.62016 407.09632 407.09632-182.62016 407.09632-407.09632 407.09632z" fill="#1890ff" p-id="4276"></path><path d="M678.24128 363.22816l-226.25792 226.26304-100.06016-100.05504a30.70464 30.70464 0 0 0-43.43808 0 30.70464 30.70464 0 0 0 0 43.43808l121.7792 121.7792a30.69952 30.69952 0 0 0 43.4432 0l247.98208-247.99232a30.70976 30.70976 0 0 0 0-43.4432 30.73024 30.73024 0 0 0-43.44832 0.01024z" fill="#1890ff" p-id="4277"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1731658532237" class="icon" viewBox="0 0 1507 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="19503" xmlns:xlink="http://www.w3.org/1999/xlink" width="376.75" height="256"><path d="M1404.827485 1023.962307v-19.562798h83.245546v-82.77438H1507.730061v102.337178h-102.902576zM1488.073031 19.638184H1404.827485V0.075387H1507.730061V102.337178h-19.65703V19.638184z m-73.363632 61.86719a55.829988 55.829988 0 0 1 16.597595 39.841767v768.533988c-0.012564 31.084368-25.361276 56.288589-56.640393 56.313718H123.483092c-31.272834-0.043975-56.608982-25.235632-56.640393-56.313718V121.347141c0.043975-31.071804 25.380123-56.244613 56.640393-56.282307h1251.208638c15.071018 0 29.281374 5.82989 40.017669 16.44054z m-39.986258 8.4747H123.483092v0.018846c-17.426847 0.018847-31.549252 14.053301-31.568098 31.37335v768.533988c0 17.288638 14.16638 31.398479 31.568098 31.398478h1251.183509c17.401718 0 31.593227-14.084712 31.593227-31.398478V121.347141c0-8.374184-3.285595-16.27092-9.247411-22.201325a32.026699 32.026699 0 0 0-22.289276-9.165742z m-462.326577 647.431852c1.030282-49.158282 10.133202-133.050896 59.354307-175.73222l67.766184 0.615656 63.462871 104.058503 11.961326-77.811436-8.650602-14.10984 0.647068-14.499337a280.846135 280.846135 0 0 1 37.712098 0.050257l0.703607 14.499338-8.625472 14.103558 12.011583 78.439656 49.290208-105.226994 74.965595-2.538012c38.74238 36.405399 63.588515 122.188957 57.494773 178.150871h-418.093546z m315.216099-288.680049c-5.163975 18.337767-11.201178 35.331141-19.85178 49.57919-9.881914 16.446822-22.948908 29.09919-41.418601 35.909105-8.254822 2.965202-29.337914 4.384982-49.623165 4.033178-19.556515-0.245006-39.213546-2.186209-47.034896-5.779632-16.798626-7.65173-28.609178-20.580515-37.511068-36.650405-7.670577-13.732908-13.110969-29.727411-17.904294-46.62027-7.846479-4.083436-13.73919-11.03784-17.728393-20.530258-4.334724-10.315387-6.31362-23.872393-6.062331-39.942282l0.075386-5.484368 4.586013-3.040589c1.155926-0.772712 2.330699-1.520294 3.511754-2.186209-5.163975-63.142479-3.210209-86.487166 20.385767-113.173987 46.004613-37.429399 151.464049-36.103853 198.046626-2.173644 31.744 29.802798 33.949055 63.192736 24.199067 114.719411 1.526577 0.873227 3.028025 1.796712 4.560884 2.814429l4.586012 3.065718 0.05654 5.459239c0.270135 15.743215-1.633374 29.080344-5.792196 39.370601-3.838429 9.391902-9.479853 16.396564-17.081325 20.630773z m-0.571681-54.718037a14.329718 14.329718 0 0 0-5.440393-0.822969l-9.354209 0.59681-1.727607-9.146896a119.035288 119.035288 0 0 0-9.706012-29.652024c-29.834209 5.811043-74.186601 10.89335-109.241325-8.738552-13.513031-7.551215-33.25173 7.921865-49.440982 6.326184a121.623558 121.623558 0 0 0-10.931043 32.064392l-1.809276 9.492417-9.580368-0.917202a14.612417 14.612417 0 0 0-5.584884 0.672196 26.385276 26.385276 0 0 0-2.58827 1.024c0.22616 10.510135 1.702479 19.204712 4.466651 25.738209 2.406086 5.729374 5.741939 9.44216 10.108073 10.811681l5.610013 1.746454 1.551705 5.60373c4.717939 17.269791 9.932172 33.641227 17.357743 46.915534 6.866454 12.313129 15.667828 22.151067 27.773644 27.685693 5.12 2.336982 21.416049 3.637399 38.440834 3.888687 18.099043 0.251288 36.128982-0.672196 42.09708-2.870969 13.412515-4.906405 23.093399-14.44908 30.588073-26.9067 8.02238-13.381104 13.764319-30.374479 18.802651-49.013791l1.457472-5.352442 5.314749-1.846969c4.20908-1.470037 7.494675-5.308466 9.875632-11.088098 2.607117-6.426699 4.03946-15.001914 4.315877-25.28589a16.06989 16.06989 0 0 0-2.355828-0.923485zM332.642945 457.049521h288.887362v49.309056H332.642945v-49.309056z m0-122.741791h288.887362v49.315337H332.642945v-49.315337z m0-122.735509h288.887362v49.309055H332.642945v-49.309055zM201.41389 457.049521h95.929325v49.309056h-95.929325v-49.309056z m0-122.741791h95.929325v49.315337h-95.929325v-49.315337z m0-122.735509h95.929325v49.309055h-95.929325v-49.309055z m254.712147 615.863754H201.41389v-49.334184h254.712147v49.334184z m464.248932 0H485.909988v-49.334184h434.464981v49.334184zM19.68216 102.337178H0V0.075387h102.927706v19.562797H19.68216V102.337178z m0 902.062331h83.245546v19.562798H0v-102.337178h19.68216v82.77438z" p-id="19504"></path></svg>
\ No newline at end of file
... ...
{
"layered-image":
{
"background" : "$media:background",
"foreground" : "$media:logo"
}
}
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1734334325140" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5494" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M348.8 512L742.4 118.4c12.8-12.8 12.8-32 0-44.8s-32-12.8-44.8 0l-416 416c-12.8 12.8-12.8 32 0 44.8l416 416c6.4 6.4 16 9.6 22.4 9.6s16-3.2 22.4-9.6c12.8-12.8 12.8-32 0-44.8L348.8 512z" p-id="5495" fill="#ffffff"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1733476083311" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4310" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M977.824 454.016C826.432 280.288 672.512 192 516.128 192c-156.384 0-310.304 88.288-461.696 262.016a112 112 0 0 0-1.632 145.248c138.24 165.984 293.088 250.24 463.328 250.24s325.088-84.256 463.328-250.24a112 112 0 0 0-1.632-145.248z m-47.552 104.32c-126.848 152.32-264.48 227.2-414.144 227.2s-287.296-74.88-414.144-227.2a48 48 0 0 1 0.704-62.24C243.008 335.072 380.8 256 516.128 256s273.152 79.072 413.44 240.064c15.488 17.792 15.776 44.16 0.704 62.272z" p-id="4311" fill="#1890ff"></path><path d="M512 288a224 224 0 1 0 0 448 224 224 0 0 0 0-448z m-64 224a64 64 0 1 1 0.032-128.032A64 64 0 0 1 448 512z" p-id="4312" fill="#1890ff"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1731639139933" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="15197" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M511.989255 929.237753c-0.094144 0-0.188288 0.00307-0.283456 0.00307-65.240887 0-135.478578-32.610722-183.02036-70.094428 26.514887-12.725836 57.7114-30.303166 74.841545-51.585889 15.360849-19.083637 18.349927-27.539216 22.639626-47.071062 24.092721 10.228969 59.387575 20.630876 85.821621 20.714787L511.988232 717.627241c-145.636938 0-204.494441-207.753671-204.494441-326.995449 0-145.141658 68.406996-262.854617 204.494441-263.037788L511.988232 64.021106C334.350462 64.202231 245.086439 210.330356 245.086439 390.590859c0 79.335906 34.282804 231.293807 88.782046 295.949362 0 0 13.403265 15.441691 32.145118 32.44904 0.77055 8.552793 1.889023 38.144762-15.72924 60.034305-21.982664 27.312042-62.324464 45.255717-127.724986 45.255717-84.014462 0-169.874969 40.494273-207.628828 76.165704-8.956999 5.66707-14.908548 15.654538-14.908548 27.036773 0 17.662265 14.3181 31.980365 31.980365 31.980365 0 0 15.567557 0.521886 29.708626-17.791202 19.472494-25.217335 94.633311-59.654658 160.848385-59.654658 27.064402 0 50.912553-2.635013 72.061222-7.552 57.017598 52.752458 133.280516 84.998883 217.086224 84.998883 0.094144 0 0.188288-0.00307 0.283456-0.00307L511.990279 929.237753z" p-id="15198" fill="#ffffff"></path><path d="M512.000512 929.493579c0.094144 0 0.188288 0.00307 0.283456 0.00307 65.240887 0 135.478578-32.610722 183.02036-70.094428-26.514887-12.725836-57.7114-30.303166-74.841545-51.585889-15.360849-19.083637-18.349927-27.539216-22.639626-47.071062-24.092721 10.228969-59.387575 20.630876-85.821621 20.714787l0-63.575967c145.636938 0 204.494441-207.753671 204.494441-326.995449 0-145.141658-68.406996-262.854617-204.494441-263.037788L512.001535 64.277956c177.639816 0.181125 266.902816 146.310274 266.902816 326.570777 0 79.335906-34.282804 231.293807-88.782046 295.949362 0 0-13.403265 15.441691-32.145118 32.44904-0.77055 8.552793-1.889023 38.144762 15.72924 60.034305 21.982664 27.312042 62.324464 45.255717 127.724986 45.255717 84.014462 0 169.874969 40.494273 207.628828 76.165704 8.956999 5.66707 14.908548 15.654538 14.908548 27.036773 0 17.662265-14.3181 31.980365-31.980365 31.980365 0 0-15.567557 0.521886-29.708626-17.791202-19.472494-25.217335-94.633311-59.654658-160.848385-59.654658-27.064402 0-50.912553-2.635013-72.061222-7.552-57.017598 52.752458-133.280516 84.998883-217.086224 84.998883-0.094144 0-0.188288-0.00307-0.283456-0.00307L512.000512 929.493579z" p-id="15199" fill="#ffffff"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1737427285437" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4279" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M512 1003.52a497.92 497.92 0 1 1 497.92-497.92A498.56 498.56 0 0 1 512 1003.52zM512 71.68a433.92 433.92 0 1 0 433.92 433.92A434.56 434.56 0 0 0 512 71.68z" fill="#999999" p-id="4280"></path><path d="M152.96 369.92a33.92 33.92 0 0 1 35.2-36.48 39.04 39.04 0 0 1 29.44 16l148.48 198.4V369.92a35.2 35.2 0 1 1 69.76 0V640a30.72 30.72 0 0 1-34.56 33.28 36.48 36.48 0 0 1-29.44-12.8l-147.2-198.4V640a30.72 30.72 0 0 1-34.56 33.28 31.36 31.36 0 0 1-37.12-33.28zM463.36 504.32a162.56 162.56 0 1 1 323.84 0 158.08 158.08 0 0 1-161.92 168.96 159.36 159.36 0 0 1-161.92-168.96z m252.16 0c-3.84-69.12-33.92-104.96-90.24-108.8s-84.48 39.68-88.32 108.8 33.28 104.32 88.32 108.16 86.4-36.48 90.24-108.16zM856.96 603.52A37.12 37.12 0 0 1 896 640c0 21.12-13.44 32-36.48 33.28s-35.84-12.16-37.12-33.28a37.76 37.76 0 0 1 34.56-36.48z" fill="#999999" p-id="4281"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1731639160143" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="16339" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M597.333333 576a42.666667 42.666667 0 1 1 42.666667 42.666667 42.666667 42.666667 0 0 1-42.666667-42.666667z m-213.333333 42.666667a42.666667 42.666667 0 1 0-42.666667-42.666667 42.666667 42.666667 0 0 0 42.666667 42.666667z m512-106.666667v384H128V512a384 384 0 0 1 768 0z m-668.373333-90.88a300.373333 300.373333 0 0 0 209.706666-159.146667v1.706667A298.666667 298.666667 0 0 0 704 426.666667a295.68 295.68 0 0 0 89.386667-14.08 298.666667 298.666667 0 0 0-565.76 8.533333zM213.333333 512a298.666667 298.666667 0 0 0 597.333334 0v-15.36a375.466667 375.466667 0 0 1-106.666667 15.36 382.08 382.08 0 0 1-266.88-108.373333 380.586667 380.586667 0 0 1-223.573333 106.666666L213.333333 512z" p-id="16340" fill="#ffffff"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1734333150164" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6225" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M799.999553 384.000994h-23.999963c-4.399993 0-7.999988-3.599994-7.999987-7.999988V258.001189C767.999603 116.701409 652.399782-0.498409 511.000002 0.00159 370.10022 0.501589 256.000397 114.901412 256.000397 256.001192v119.999814c0 4.399993-3.599994 7.999988-7.999987 7.999988h-23.999963c-52.999918 0-95.999851 42.999933-95.999851 95.999851v447.999304c0 52.999918 42.999933 95.999851 95.999851 95.999851h575.999106c52.999918 0 95.999851-42.999933 95.999851-95.999851V480.000845c0-52.999918-42.999933-95.999851-95.999851-95.999851zM569.69991 748.700427c-15.999975 12.099981-25.69996 30.699952-25.69996 50.799922V864.000248c0 17.499973-14.199978 31.799951-31.599951 31.999951-17.799972 0.2-32.39995-14.799977-32.399949-32.699949V800.000348c0-20.199969-9.599985-39.099939-25.79996-51.299921C431.000126 731.200455 416.000149 703.300498 416.000149 672.000547c0-52.199919 42.399934-95.299852 94.599853-95.999851 53.699917-0.799999 97.399849 42.499934 97.399849 95.999851 0 31.299951-14.999977 59.199908-38.299941 76.69988zM703.999702 376.001006c0 4.399993-3.599994 7.999988-7.999988 7.999988H328.000286c-4.399993 0-7.999988-3.599994-7.999988-7.999988V256.001192c0-51.29992 19.999969-99.499846 56.199913-135.799789C412.500154 84.00146 460.70008 64.001491 512 64.001491s99.499846 19.999969 135.799789 56.199912C683.999733 156.501347 703.999702 204.701272 703.999702 256.001192v119.999814z" p-id="6226" fill="#ffffff"></path><path d="M512 672.000547m-31.99995 0a31.99995 31.99995 0 1 0 63.9999 0 31.99995 31.99995 0 1 0-63.9999 0Z" p-id="6227" fill="#ffffff"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1732588433819" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4501" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M512 767.971556c-109.795556 0-199.111111-89.344-199.111111-199.111112S402.232889 369.777778 512 369.777778s199.111111 89.315556 199.111111 199.082666-89.315556 199.111111-199.111111 199.111112zM512 426.666667c-78.421333 0-142.222222 63.800889-142.222222 142.193777 0 78.421333 63.800889 142.222222 142.222222 142.222223 78.392889 0 142.222222-63.800889 142.222222-142.222223A142.364444 142.364444 0 0 0 512 426.666667z" fill="#1890ff" p-id="4502"></path><path d="M941.198222 218.538667h-116.423111v-28.444445c0-47.047111-38.286222-85.333333-85.333333-85.333333h-455.111111c-47.047111 0-85.333333 38.286222-85.333334 85.333333v28.444445H82.830222a82.204444 82.204444 0 0 0-82.090666 82.090666V837.12a82.204444 82.204444 0 0 0 82.090666 82.119111h858.368a82.204444 82.204444 0 0 0 82.090667-82.119111V300.600889a82.176 82.176 0 0 0-82.090667-82.062222z m25.201778 618.581333a25.230222 25.230222 0 0 1-25.201778 25.230222H82.830222a25.230222 25.230222 0 0 1-25.201778-25.230222V300.600889c0-13.880889 11.292444-25.201778 25.201778-25.201778H227.555556a28.444444 28.444444 0 0 0 28.330666-28.416v-56.888889c0-15.672889 12.771556-28.444444 28.444445-28.444444h455.111111c15.701333 0 28.444444 12.771556 28.444444 28.444444v56.888889a28.444444 28.444444 0 0 0 28.444445 28.444445L796.444444 275.399111v0.028445h144.753778c13.880889 0 25.201778 11.292444 25.201778 25.201777V837.12z" fill="#1890ff" p-id="4503"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1731984664925" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="11854" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M398.3 635.7l-36-4.5H198.2V205.9c0-22.3 18.1-40.4 40.4-40.4h159.8v470.2z m-136.2-68.5h72.1V229.5h-72.1v337.7z" p-id="11855" fill="#999999"></path><path d="M606.2 719.7H449.7c-42 0-76.2-34.2-76.2-76.2 0-4.1-1.9-7-3.6-8.7-2-1.9-4.6-3.2-7.4-3.5l-28.2-3.4v-524c0-22.3 18.1-40.4 40.4-40.4h480.2c22.3 0 40.4 18.1 40.4 40.4v527.4H694.7c-6.8 0-12.2 5.5-12.2 12.2 0 19.1-7.1 37.4-20 51.5-1 1.1-1.8 1.9-2.3 2.4l-0.1 0.1c-14.5 14.3-33.6 22.2-53.9 22.2zM398.3 576.8c6.1 3.4 11.7 7.6 16.7 12.5l0.2 0.2c14.3 14.4 22.2 33.6 22.2 53.8 0 6.8 5.5 12.2 12.2 12.2h156.6c4.2 0 7-2 8.5-3.4l0.4-0.4c1.5-1.6 3.3-4.4 3.3-8.4 0-42 34.2-76.2 76.2-76.2h136.5V127.4H398.3v449.4z" p-id="11856" fill="#999999"></path><path d="M888.5 992H167.4c-53.5 0-96.9-43.5-96.9-96.9v-231c0-53.5 43.5-96.9 96.9-96.9h193.7c3.3 0 6.2 0.2 9 0.5 16.9 2 32.8 9.7 44.8 21.7l0.2 0.2c14.3 14.4 22.2 33.6 22.2 53.8 0 6.8 5.5 12.2 12.2 12.2h156.6c4.2 0 7-2 8.5-3.4l0.4-0.4c1.5-1.6 3.3-4.4 3.3-8.4 0-42 34.2-76.2 76.2-76.2h193.7c53.5 0 96.9 43.5 96.9 96.9V895c0.3 53.5-43.2 97-96.6 97zM167.4 631.2c-18.2 0-32.9 14.8-32.9 32.9V895c0 18.2 14.8 32.9 32.9 32.9h721.1c18.2 0 32.9-14.8 32.9-32.9V664.1c0-18.2-14.8-32.9-32.9-32.9H694.7c-6.8 0-12.2 5.5-12.2 12.2 0 19.1-7.1 37.4-20 51.5-1 1.1-1.8 1.9-2.3 2.4l-0.1 0.1c-14.4 14.3-33.6 22.2-53.8 22.2H449.7c-42 0-76.2-34.2-76.2-76.2 0-4.1-1.9-7-3.6-8.7-2-1.9-4.6-3.2-7.4-3.5H167.4zM761.1 250H468.4c-17.7 0-32-14.3-32-32s14.3-32 32-32h292.7c17.7 0 32 14.3 32 32s-14.3 32-32 32z" p-id="11857" fill="#999999"></path><path d="M761.1 375.9H468.4c-17.7 0-32-14.3-32-32s14.3-32 32-32h292.7c17.7 0 32 14.3 32 32s-14.3 32-32 32z" p-id="11858" fill="#999999"></path><path d="M767.9 501.8H475.2c-17.7 0-32-14.3-32-32s14.3-32 32-32h292.7c17.7 0 32 14.3 32 32s-14.3 32-32 32z" p-id="11859" fill="#999999"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1732087742517" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8785" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M894.481158 505.727133c0 49.589418-9.711176 97.705276-28.867468 143.007041-18.501376 43.74634-44.98454 83.031065-78.712713 116.759237-33.728172 33.728172-73.012897 60.211337-116.759237 78.712713-45.311998 19.156292-93.417623 28.877701-143.007041 28.877701s-97.695043-9.721409-142.996808-28.877701c-43.756573-18.501376-83.031065-44.98454-116.76947-78.712713-33.728172-33.728172-60.211337-73.012897-78.712713-116.759237-19.156292-45.301765-28.867468-93.417623-28.867468-143.007041 0-49.579185 9.711176-97.695043 28.867468-142.996808 18.501376-43.74634 44.98454-83.031065 78.712713-116.759237 33.738405-33.728172 73.012897-60.211337 116.76947-78.712713 45.301765-19.166525 93.40739-28.877701 142.996808-28.877701 52.925397 0 104.008842 11.010775 151.827941 32.745798 46.192042 20.977777 86.909395 50.79692 121.016191 88.608084 4.389984 4.860704 8.646937 9.854439 12.781094 14.97097l0-136.263453c0-11.307533 9.168824-20.466124 20.466124-20.466124 11.307533 0 20.466124 9.15859 20.466124 20.466124l0 183.64253c0 5.433756-2.148943 10.632151-5.986341 14.46955-3.847631 3.837398-9.046027 5.996574-14.479783 5.996574l-183.64253-0.020466c-11.307533 0-20.466124-9.168824-20.466124-20.466124 0-11.307533 9.168824-20.466124 20.466124-20.466124l132.293025 0.020466c-3.960195-4.952802-8.063653-9.782807-12.289907-14.479783-30.320563-33.605376-66.514903-60.098773-107.549481-78.753645-42.467207-19.289322-87.850837-29.072129-134.902456-29.072129-87.195921 0-169.172981 33.9533-230.816946 95.597265-61.654198 61.654198-95.597265 143.621025-95.597265 230.816946s33.943067 169.172981 95.597265 230.816946c61.643965 61.654198 143.621025 95.607498 230.816946 95.607498s169.172981-33.9533 230.816946-95.607498c61.654198-61.643965 95.597265-143.621025 95.597265-230.816946 0-11.2973 9.168824-20.466124 20.466124-20.466124C885.322567 485.261009 894.481158 494.429833 894.481158 505.727133z" p-id="8786" fill="#2c2c2c"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1731570739679" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5445" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M534.869333 490.496a1403.306667 1403.306667 0 0 0 50.858667-25.813333c16.042667-8.618667 29.013333-15.061333 38.570667-19.029334 9.557333-3.925333 17.066667-6.058667 22.869333-6.058666 9.557333 0 17.749333 3.2 24.917333 10.026666 6.826667 6.826667 10.581333 15.061333 10.581334 25.088 0 5.76-1.706667 11.818667-5.12 17.92-3.413333 6.101333-7.168 10.069333-10.922667 11.861334-35.157333 14.677333-74.410667 25.429333-116.736 31.872 7.850667 7.168 17.066667 17.237333 28.330667 29.781333 11.264 12.544 17.066667 18.986667 17.749333 20.053333 4.096 6.101333 9.898667 13.653333 17.408 22.613334 7.509333 8.96 12.629333 15.786667 15.36 20.778666 2.730667 5.034667 4.437333 11.093333 4.437333 18.304a33.706667 33.706667 0 0 1-9.898666 24.021334 33.834667 33.834667 0 0 1-25.6 10.410666c-10.24 0-22.186667-8.618667-35.157334-25.472-12.970667-16.512-30.037333-46.933333-50.517333-91.050666-20.821333 39.424-34.816 65.962667-41.642667 78.506666-7.168 12.544-13.994667 22.186667-20.48 28.672a30.976 30.976 0 0 1-22.528 9.685334 32.256 32.256 0 0 1-25.258666-11.093334 35.413333 35.413333 0 0 1-9.898667-23.68c0-7.893333 1.365333-13.653333 4.096-17.578666 25.258667-35.84 51.541333-67.413333 78.848-93.568a756.650667 756.650667 0 0 1-61.44-12.544 383.061333 383.061333 0 0 1-57.685333-20.48c-3.413333-1.749333-6.485333-5.717333-9.557334-11.818667a30.208 30.208 0 0 1-5.12-16.853333 32.426667 32.426667 0 0 1 10.581334-25.088 33.152 33.152 0 0 1 24.234666-10.026667c6.485333 0 14.677333 2.133333 24.576 6.101333 9.898667 4.266667 22.186667 10.026667 37.546667 18.261334 15.36 7.893333 32.426667 16.853333 51.882667 26.538666-3.413333-18.261333-6.485333-39.082667-8.874667-62.378666-2.389333-23.296-3.413333-39.424-3.413333-48.042667 0-10.752 3.072-19.712 9.557333-27.264A30.677333 30.677333 0 0 1 512.341333 341.333333c9.898667 0 18.090667 3.925333 24.576 11.477334 6.485333 7.893333 9.557333 17.92 9.557334 30.464 0 3.584-0.682667 10.410667-1.365334 20.48-0.682667 10.368-2.389333 22.570667-4.096 36.906666-2.048 14.677333-4.096 31.146667-6.144 49.834667z" fill="#FF3838" p-id="5446"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1734438891014" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6139" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M315 232.6L293.8 213 11.6 516.5l21.2 19.6 264.8 284.7 21.2-19.6-251-269.9H897v-28.8H64.1L315 232.6z m641.5 270.5h56v27.1h-56v-27.1z" fill="#1890ff" p-id="6140"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1734334295296" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4257" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M310.11328 58.50624l439.94624 435.42016a25.25696 25.25696 0 0 1 0 35.98336l-439.94624 435.42528a25.89696 25.89696 0 0 1-36.352 0 25.2672 25.2672 0 0 1 0-35.98848l421.74976-417.42848-421.74976-417.42848a25.26208 25.26208 0 0 1 0-35.98336 25.89696 25.89696 0 0 1 36.352 0z" p-id="4258" fill="#ffffff"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1732518262372" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5297" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M648.817778 479.004444l-293.831111-284.444444a31.004444 31.004444 0 0 0-40.96 0A26.737778 26.737778 0 0 0 312.888889 233.244444l280.177778 269.653334a16.497778 16.497778 0 0 1 0 23.893333L312.888889 796.444444a26.737778 26.737778 0 0 0 0 37.546667 31.004444 31.004444 0 0 0 40.96 0l293.831111-284.444444a49.493333 49.493333 0 0 0 1.137778-70.542223z" fill="#1890ff" p-id="5298"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1733283423571" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="6631" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M872.554667 306.304c-22.613333 8.128-45.696 9.941333-69.162667 4.373333a119.722667 119.722667 0 0 1-85.504-158.144c1.749333-4.842667 0.853333-6.954667-3.605333-8.96-17.92-8.106667-35.541333-16.917333-53.674667-24.533333-11.925333-4.992-24.533333-8.384-36.501333-12.373333-23.146667 47.658667-59.456 74.88-112.064 74.88-52.821333 0-89.258667-27.306667-111.978667-74.538667a411.733333 411.733333 0 0 0-95.530667 39.573333c17.216 49.493333 10.922667 94.634667-26.538666 131.925334-37.376 37.205333-82.496 43.712-131.776 26.282666A413.290667 413.290667 0 0 0 106.666667 400.298667c46.933333 22.656 74.197333 58.666667 74.517333 110.997333 0.32 53.162667-26.986667 89.770667-74.538667 112.768a410.154667 410.154667 0 0 0 39.637334 95.530667c47.808-16.789333 91.669333-11.370667 128.64 23.253333 39.957333 37.44 47.274667 83.626667 29.653333 134.933333a404.949333 404.949333 0 0 0 95.530667 39.466667c23.04-47.36 59.349333-74.474667 111.978666-74.453333 52.885333 0.064 89.216 27.541333 111.893334 74.538666a411.584 411.584 0 0 0 95.488-39.616c-17.386667-49.493333-10.816-94.4 26.24-131.626666 37.290667-37.418667 82.432-43.776 132.053333-26.538667a407.637333 407.637333 0 0 0 39.509333-95.509333c-47.786667-23.210667-74.986667-59.946667-74.517333-113.066667 0.448-52.053333 27.562667-87.957333 74.56-110.656a420.394667 420.394667 0 0 0-38.016-92.970667c-2.048-3.712-4.309333-1.92-6.762667-1.066666z m85.952 82.794667a42.666667 42.666667 0 0 1-22.613334 49.642666c-34.602667 16.725333-50.176 39.146667-50.453333 72.618667-0.298667 34.282667 15.253333 57.194667 50.496 74.304a42.666667 42.666667 0 0 1 22.549333 49.536 450.304 450.304 0 0 1-43.669333 105.472 42.666667 42.666667 0 0 1-51.050667 19.178667c-36.650667-12.736-63.850667-7.68-87.808 16.362666-23.914667 24.021333-28.949333 51.093333-16.213333 87.381334a42.666667 42.666667 0 0 1-19.072 51.178666 454.229333 454.229333 0 0 1-105.344 43.690667 42.666667 42.666667 0 0 1-49.770667-22.592c-16.725333-34.688-39.509333-50.368-73.493333-50.389333-33.92-0.021333-56.597333 15.509333-73.578667 50.432a42.666667 42.666667 0 0 1-49.322666 22.570666 447.338667 447.338667 0 0 1-105.6-43.562666 42.666667 42.666667 0 0 1-19.328-50.986667c13.034667-37.973333 7.381333-65.728-18.474667-89.941333-23.594667-22.101333-50.090667-26.517333-85.333333-14.144a42.666667 42.666667 0 0 1-51.157334-19.050667 452.821333 452.821333 0 0 1-43.733333-105.450667 42.666667 42.666667 0 0 1 22.549333-49.706666c35.072-16.938667 50.666667-39.808 50.453334-74.069334-0.213333-33.642667-15.786667-56.149333-50.389334-72.853333A42.666667 42.666667 0 0 1 65.493333 389.12a455.808 455.808 0 0 1 43.541334-105.344 42.666667 42.666667 0 0 1 51.392-19.242667c36.096 12.778667 63.317333 7.722667 87.466666-16.298666 24-23.893333 29.034667-51.072 16.32-87.68a42.666667 42.666667 0 0 1 19.178667-51.050667 454.4 454.4 0 0 1 105.386667-43.669333 42.666667 42.666667 0 0 1 49.706666 22.656c16.725333 34.730667 39.509333 50.389333 73.536 50.368 33.898667 0 56.576-15.616 73.664-50.837334a42.666667 42.666667 0 0 1 51.882667-21.845333c2.517333 0.832 4.992 1.621333 9.28 2.965333l7.530667 2.346667c8.96 2.88 15.786667 5.290667 22.698666 8.192 10.154667 4.245333 18.090667 7.872 35.029334 15.829333 10.069333 4.736 14.4 6.741333 19.733333 9.152 25.024 11.306667 35.349333 36.821333 26.154667 62.336-16 44.352 9.344 91.221333 55.253333 102.144 14.805333 3.52 29.418667 2.538667 44.864-3.029333a33.28 33.28 0 0 1 4.48-1.621333c5.269333-1.621333 10.88-2.453333 17.322667-1.941334 16.853333 1.344 29.525333 11.093333 36.736 24.170667a462.890667 462.890667 0 0 1 41.813333 102.357333zM522.666667 320a202.666667 202.666667 0 1 0 166.4 86.954667 21.333333 21.333333 0 0 0-35.008 24.384 160 160 0 1 1-69.184-56.128 21.333333 21.333333 0 0 0 16.597333-39.317334A202.090667 202.090667 0 0 0 522.666667 320z" fill="#1890ff" p-id="6632"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1734420677408" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4286" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M768.704 703.616c-35.648 0-67.904 14.72-91.136 38.304l-309.152-171.712c9.056-17.568 14.688-37.184 14.688-58.272 0-12.576-2.368-24.48-5.76-35.936l304.608-189.152c22.688 20.416 52.384 33.184 85.216 33.184 70.592 0 128-57.408 128-128s-57.408-128-128-128-128 57.408-128 128c0 14.56 2.976 28.352 7.456 41.408l-301.824 187.392c-23.136-22.784-54.784-36.928-89.728-36.928-70.592 0-128 57.408-128 128 0 70.592 57.408 128 128 128 25.664 0 49.504-7.744 69.568-20.8l321.216 178.4c-3.04 10.944-5.184 22.208-5.184 34.08 0 70.592 57.408 128 128 128s128-57.408 128-128S839.328 703.616 768.704 703.616zM767.2 128.032c35.296 0 64 28.704 64 64s-28.704 64-64 64-64-28.704-64-64S731.904 128.032 767.2 128.032zM191.136 511.936c0-35.296 28.704-64 64-64s64 28.704 64 64c0 35.296-28.704 64-64 64S191.136 547.232 191.136 511.936zM768.704 895.616c-35.296 0-64-28.704-64-64s28.704-64 64-64 64 28.704 64 64S804 895.616 768.704 895.616z" fill="#1890ff" p-id="4287"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1732087768586" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10270" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M512 998.4C243.776 998.4 25.6 780.224 25.6 512S243.776 25.6 512 25.6s486.4 218.176 486.4 486.4-218.176 486.4-486.4 486.4zM512 76.8C272 76.8 76.8 272 76.8 512s195.2 435.2 435.2 435.2 435.2-195.2 435.2-435.2S752 76.8 512 76.8z" p-id="10271" fill="#2c2c2c"></path><path d="M463.872 816.768a25.6 25.6 0 0 1-16.384-5.888L175.616 584.192a25.6 25.6 0 0 1 32.768-39.36l251.392 209.6 351.936-460.288a25.6 25.6 0 1 1 40.64 31.104l-368.128 481.472a25.728 25.728 0 0 1-17.472 9.92l-2.88 0.128z" p-id="10272" fill="#2c2c2c"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1733283376720" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4483" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M829.952 271.36h-126.976v-51.2a76.288 76.288 0 0 0-75.776-76.288h-256a76.288 76.288 0 0 0-75.776 76.8v51.2H168.448a25.6 25.6 0 0 0 0 51.2h661.504a25.6 25.6 0 0 0 0-51.712z m-178.176 0h-307.2v-51.2a26.112 26.112 0 0 1 25.6-25.6h256a24.576 24.576 0 0 1 24.576 25.6zM448.512 677.376V398.336a25.6 25.6 0 0 0-51.2 0v279.04a25.6 25.6 0 0 0 51.2 0zM601.088 677.376V398.336a25.6 25.6 0 0 0-51.2 0v279.04a25.6 25.6 0 0 0 51.2 0z" fill="#1890ff" p-id="4484"></path><path d="M735.744 346.624a25.6 25.6 0 0 0-25.6 25.6v381.44a102.4 102.4 0 0 1-102.4 102.4H390.656a102.4 102.4 0 0 1-102.4-102.4V372.224a25.6 25.6 0 0 0-51.2 0v381.44a153.6 153.6 0 0 0 153.6 153.6h217.6a153.6 153.6 0 0 0 153.6-153.6V372.224a25.6 25.6 0 0 0-26.112-25.6z" fill="#1890ff" p-id="4485"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1732606057667" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="10463" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M519.3728 727.9104a22.016 22.016 0 0 0 0 33.2288 27.648 27.648 0 0 0 36.5568 0l255.6928-232.5504a22.016 22.016 0 0 0 0-33.1776l-255.6928-232.5504a27.648 27.648 0 0 0-36.5568 0 22.016 22.016 0 0 0 0 33.28L756.8384 512l-237.4656 215.9104z m-306.9952 0a22.016 22.016 0 0 0 0 33.2288 27.648 27.648 0 0 0 36.5056 0l255.744-232.5504a22.016 22.016 0 0 0 0-33.1776L248.832 262.8608a27.648 27.648 0 0 0-36.5056 0 22.016 22.016 0 0 0 0 33.28L449.792 512l-237.4144 215.9104z" fill="#999999" p-id="10464"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1731658559710" class="icon" viewBox="0 0 1525 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="21768" xmlns:xlink="http://www.w3.org/1999/xlink" width="381.25" height="256"><path d="M1421.07234 1024v-19.608511h84.20766v-82.791489H1525.160851V1024zM0.054468 1024v-102.4h19.891745v82.791489h84.207659V1024z m124.895319-77.769532a56.908255 56.908255 0 0 1-57.289532-56.330894V121.278638a56.897362 56.897362 0 0 1 57.289532-56.287319h1265.631319a57.572766 57.572766 0 0 1 40.502468 16.460255 55.557447 55.557447 0 0 1 16.787064 39.827064V889.899574a56.875574 56.875574 0 0 1-57.289532 56.330894z m0-856.292766a31.678638 31.678638 0 0 0-31.929191 31.384511v768.599149a31.744 31.744 0 0 0 31.929191 31.406298h1265.631319a31.744 31.744 0 0 0 31.950979-31.406298v-768.653617a30.883404 30.883404 0 0 0-9.368511-22.179405 32.539234 32.539234 0 0 0-22.528-9.183319H124.949787z m118.990979 652.16817v-45.753191h1023.694979v45.753191zM451.485957 594.802383a79.523404 79.523404 0 0 1-14.499404 0 18.82417 18.82417 0 0 1-4.836766 0.882383h-1.318127l-15.83932-1.764766h-1.29634a14.161702 14.161702 0 0 1-7.483915-0.446638h-0.882383a20.697872 20.697872 0 0 1-11.884936-3.072h-3.061106a11.427404 11.427404 0 0 1-10.120171 4.836766l-20.697872-1.764766a11.547234 11.547234 0 0 1-9.226894-6.165788v-0.446638c-1.329021-0.446638-2.625362-0.446638-3.954383-0.860596a10.141957 10.141957 0 0 1-8.366297-6.601531c-0.860596 0-1.742979-0.446638-2.625362-0.446639a9.804255 9.804255 0 0 1-7.04817-5.27251 19.281702 19.281702 0 0 1-6.154894-2.625362 10.109277 10.109277 0 0 1-4.825872-10.555915l6.154893-38.269277a160.735319 160.735319 0 0 1-47.060425-113.903659 165.484936 165.484936 0 0 1 167.118978-163.578553 165.452255 165.452255 0 0 1 167.097192 163.578553 160.724426 160.724426 0 0 1-47.049532 113.903659l7.037277 38.683234a11.209532 11.209532 0 0 1-4.825873 10.577703 24.532426 24.532426 0 0 1-6.165787 2.625361 10.893617 10.893617 0 0 1-7.037277 5.272511c-0.882383 0-1.764766 0.446638-2.625361 0.446638a11.830468 11.830468 0 0 1-8.377192 6.53617c-1.29634 0.446638-3.061106 0.446638-4.357447 0.882383-0.882383 0.882383-1.732085 2.178723-2.625361 3.093788a10.468766 10.468766 0 0 1-7.037277 3.072l-19.782808 1.764766a11.405617 11.405617 0 0 1-10.109277-4.836766h-3.072a25.284085 25.284085 0 0 1-12.320681 3.072h-2.178723a9.804255 9.804255 0 0 1-6.133107 0.446638h-0.882383l-15.828425 1.764766a6.209362 6.209362 0 0 1-1.492426 0.174298 9.804255 9.804255 0 0 1-4.335659-1.013107z m-91.506383-82.67166a7.146213 7.146213 0 0 0 1.764766 10.109277 141.769532 141.769532 0 0 0 81.789277 25.501957 142.869787 142.869787 0 0 0 81.80017-25.501957 7.712681 7.712681 0 0 0 2.625362-10.109277 7.701787 7.701787 0 0 0-10.555915-1.764766 128.544681 128.544681 0 0 1-73.422979 22.876596 128.544681 128.544681 0 0 1-73.444766-22.876596 8.202894 8.202894 0 0 0-4.357446-1.209191 7.625532 7.625532 0 0 0-6.154894 2.963064z m433.565958 13.617022v-45.753192h474.035745v45.753192z m0-216.782979v-45.753192h474.035745v45.753192z m711.690894-206.684596V19.554043h-84.20766V0H1525.160851v102.28017z m-1505.236426 0V0h104.110298v19.554043h-84.20766v82.726127z" fill="#2c2c2c" p-id="21769"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1732087588584" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4263" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M503.92 99.456L85.296 518.048l57.184 56.56L464 253.76V928h80V251.424l322.592 323.2 55.952-56.576z" fill="#2c2c2c" p-id="4264"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1732867346489" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4309" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M922.027883 866.52306h-130.884211a13.116413 13.116413 0 0 1 0-26.232827h130.884211a13.116413 13.116413 0 0 1 0 26.232827z" p-id="4310"></path><path d="M854.926231 932.265084a13.116413 13.116413 0 0 1-13.116413-13.156403V788.464404a13.156403 13.156403 0 0 1 26.272816 0v130.644277a13.156403 13.156403 0 0 1-13.156403 13.156403z" p-id="4311"></path><path d="M736.678564 961.417113H211.062288c-115.96829 0-210.182528-87.456086-210.182529-194.906706V200.905065C0.879759 93.454446 101.172336 0 217.060647 0h603.355021c115.96829 0 204.184168 93.454446 204.184168 200.905065V872.041551h-27.992346V200.905065a175.951888 175.951888 0 0 0-176.191822-174.952161H217.060647c-100.452533 0-188.188542 81.777639-188.188542 174.952161v565.605342c0 93.174523 81.73765 168.953802 182.190183 168.953802h525.616276z" p-id="4312"></path><path d="M314.274066 460.154177A109.250127 109.250127 0 1 1 423.884094 350.704104 109.490061 109.490061 0 0 1 314.274066 460.154177z m0-186.828914A77.578787 77.578787 0 1 0 391.892842 350.704104a77.738743 77.738743 0 0 0-77.618776-77.578787zM856.845706 1023.720077a166.0346 166.0346 0 1 1 143.720702-248.931933 165.994611 165.994611 0 0 1-143.720702 248.931933z m-0.479869-305.636428a139.681806 139.681806 0 1 0 121.406803 69.980865 139.361893 139.361893 0 0 0-121.406803-69.980865z" p-id="4313"></path><path d="M52.865545 888.037177l-19.154763-27.592455c3.079158-10.397157 56.50455-210.422463 189.508182-210.422462h0.39989c90.455266 1.599563 139.681806 57.984145 179.230992 103.291756 37.869645 43.388136 57.544265 63.502636 90.575233 46.387316l1.399617-0.639825c21.794041-8.677627 58.224079-90.895146 90.375288-163.4753 58.064123-131.044168 118.047721-266.527121 192.227438-269.1664 64.542352-2.039442 152.918186 111.489515 225.258406 289.040965l21.914008 54.225173-28.192291 11.356895-21.914008-54.185184c-71.660405-175.951888-153.797946-270.086148-195.226618-270.086148h-0.83977c-55.064943 1.959464-118.847503 145.960089-165.394775 251.091342s-72.30023 160.676065-106.250947 179.071035a76.659039 76.659039 0 0 1-35.190378 9.277463c-36.709962 0-64.542352-31.991252-91.654938-62.942789-37.469754-42.908267-79.978131-91.534971-156.637169-92.894599h-0.279924c-110.209864 0.079978-169.47366 205.38384-170.153473 207.663217z" p-id="4314"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1731659456245" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="23104" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M510.45 70.554c-243.163 0-442.115 198.951-442.115 442.115 0 243.16 198.952 442.11 442.116 442.11 243.159 0 442.11-198.95 442.11-442.11 0-243.165-198.951-442.115-442.11-442.115z m11.051 132.633c168.556 0 168.556 127.11 168.556 198.95 0 71.847-66.318 204.48-168.556 207.24-99.475 0-168.556-132.632-168.556-207.24 0.001-71.841 0.001-198.95 168.556-198.95z m-11.05 726.723c-127.11 0-243.164-58.03-320.534-149.211 11.051-27.635 24.868-58.03 44.212-74.607 41.446-33.162 165.79-88.425 165.79-88.425l77.37 149.215 13.816-35.923L469 686.747l44.212-44.208 44.212 44.208-19.345 46.974 11.055 35.924 80.132-146.45s124.343 55.262 165.793 88.424c19.34 13.813 33.157 38.685 41.447 60.787C761.9 869.12 643.082 929.91 510.45 929.91z m0 0" fill="" p-id="23105"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1733886082554" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4402" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M806.4 849.066667H217.6c-72.533333 0-132.266667-59.733333-132.266667-132.266667V307.2c0-72.533333 59.733333-132.266667 132.266667-132.266667h588.8c72.533333 0 132.266667 59.733333 132.266667 132.266667v409.6c0 72.533333-59.733333 132.266667-132.266667 132.266667zM217.6 243.2c-34.133333 0-64 29.866667-64 64v409.6c0 34.133333 29.866667 64 64 64h588.8c34.133333 0 64-29.866667 64-64V307.2c0-34.133333-29.866667-64-64-64H217.6z" fill="#ffffff" p-id="4403"></path><path d="M930.133333 635.733333h-268.8c-68.266667 0-123.733333-55.466667-123.733333-123.733333s55.466667-123.733333 123.733333-123.733333h268.8v247.466666z m-268.8-183.466666c-34.133333 0-59.733333 25.6-59.733333 59.733333s25.6 59.733333 59.733333 59.733333h204.8v-119.466666h-204.8z" fill="#ffffff" p-id="4404"></path><path d="M669.866667 512m-34.133334 0a34.133333 34.133333 0 1 0 68.266667 0 34.133333 34.133333 0 1 0-68.266667 0Z" fill="#ffffff" p-id="4405"></path></svg>
\ No newline at end of file
... ...
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1733994717470" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5164" xmlns:xlink="http://www.w3.org/1999/xlink" width="256" height="256"><path d="M404.511405 600.865957c-4.042059 2.043542-8.602935 3.223415-13.447267 3.223415-11.197016 0-20.934798-6.169513-26.045189-15.278985l-1.959631-4.296863-81.56569-178.973184c-0.880043-1.954515-1.430582-4.14746-1.430582-6.285147 0-8.251941 6.686283-14.944364 14.938224-14.944364 3.351328 0 6.441713 1.108241 8.94165 2.966565l96.242971 68.521606c7.037277 4.609994 15.433504 7.305383 24.464181 7.305383 5.40101 0 10.533914-1.00284 15.328104-2.75167l452.645171-201.459315C811.496653 163.274644 677.866167 100.777241 526.648117 100.777241c-247.448742 0-448.035176 167.158091-448.035176 373.361453 0 112.511493 60.353576 213.775828 154.808832 282.214547 7.582699 5.405103 12.537548 14.292518 12.537548 24.325012 0 3.312442-0.712221 6.358825-1.569752 9.515724-7.544837 28.15013-19.62599 73.202209-20.188808 75.314313-0.940418 3.529383-2.416026 7.220449-2.416026 10.917654 0 8.245801 6.692423 14.933107 14.944364 14.933107 3.251044 0 5.89015-1.202385 8.629541-2.7793l98.085946-56.621579c7.377014-4.266164 15.188934-6.89913 23.790846-6.89913 4.577249 0 9.003048 0.703011 13.174044 1.978051 45.75509 13.159718 95.123474 20.476357 146.239666 20.476357 247.438509 0 448.042339-167.162184 448.042339-373.372709 0-62.451354-18.502399-121.275087-51.033303-173.009356L407.778822 598.977957 404.511405 600.865957z" fill="#00C800" p-id="5165"></path></svg>
\ No newline at end of file
... ...
{
"allowToBackupRestore": true
}
\ No newline at end of file
... ...
{
"src": [
"pages/Index",
"pages/Login",
"pages/EditUser",
"pages/CertificateInfo",
"pages/MaintenanceRecords",
"pages/OperationManual",
"pages/AddRecords",
"pages/DetailRecords",
"pages/VideoDetail",
"pages/NoticeList",
"pages/NoticeDetail",
"pages/FireProtectionDetail",
"pages/LookRecords",
"pages/FailureMaintenance",
"pages/UserAgreement",
"pages/PrivacyPolicy",
"pages/CancellationAgreement",
"pages/PersonDetail",
"pages/EditCompanyInfo",
"pages/PersonList",
"pages/MyWallet",
"pages/BillingInformation",
"pages/Recharge",
"pages/UpdatePassword",
"pages/Register",
"pages/UserRegister",
"pages/ToolBox",
"pages/LookRecordCompany",
"pages/ViewFile",
"pages/StartPage",
"pages/SplashFullScreenAdPage",
"pages/SplashHalfScreenAdPage"
]
}
\ No newline at end of file
... ...
{
"string": [
{
"name": "module_desc",
"value": "module description"
},
{
"name": "EntryAbility_desc",
"value": "description"
},
{
"name": "EntryAbility_label",
"value": "消防维保助手"
}
]
}
\ No newline at end of file
... ...
{
"string": [
{
"name": "module_desc",
"value": "模块描述"
},
{
"name": "EntryAbility_desc",
"value": "description"
},
{
"name": "EntryAbility_label",
"value": "消防维保助手"
},
{
"name": "EntryAbility1_desc",
"value": "读取文件"
},
{
"name": "EntryAbility2_desc",
"value": "读取相册"
},
{
"name": "EntryAbility3_desc",
"value": "读取剪切板"
}
]
}
\ No newline at end of file
... ...
{
}
\ No newline at end of file
... ...
import { hilog } from '@kit.PerformanceAnalysisKit';
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
export default function abilityTest() {
describe('ActsAbilityTest', () => {
// Defines a test suite. Two parameters are supported: test suite name and test suite function.
beforeAll(() => {
// Presets an action, which is performed only once before all test cases of the test suite start.
// This API supports only one parameter: preset action function.
})
beforeEach(() => {
// Presets an action, which is performed before each unit test case starts.
// The number of execution times is the same as the number of test cases defined by **it**.
// This API supports only one parameter: preset action function.
})
afterEach(() => {
// Presets a clear action, which is performed after each unit test case ends.
// The number of execution times is the same as the number of test cases defined by **it**.
// This API supports only one parameter: clear action function.
})
afterAll(() => {
// Presets a clear action, which is performed after all test cases of the test suite end.
// This API supports only one parameter: clear action function.
})
it('assertContain', 0, () => {
// Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
hilog.info(0x0000, 'testTag', '%{public}s', 'it begin');
let a = 'abc';
let b = 'b';
// Defines a variety of assertion methods, which are used to declare expected boolean conditions.
expect(a).assertContain(b);
expect(a).assertEqual(a);
})
})
}
\ No newline at end of file
... ...
import abilityTest from './Ability.test';
export default function testsuite() {
abilityTest();
}
\ No newline at end of file
... ...
{
"module": {
"name": "entry_test",
"type": "feature",
"deviceTypes": [
"phone",
"tablet",
"2in1"
],
"deliveryWithInstall": true,
"installationFree": false
}
}
... ...
import localUnitTest from './LocalUnit.test';
export default function testsuite() {
localUnitTest();
}
\ No newline at end of file
... ...
import { describe, beforeAll, beforeEach, afterEach, afterAll, it, expect } from '@ohos/hypium';
export default function localUnitTest() {
describe('localUnitTest', () => {
// Defines a test suite. Two parameters are supported: test suite name and test suite function.
beforeAll(() => {
// Presets an action, which is performed only once before all test cases of the test suite start.
// This API supports only one parameter: preset action function.
});
beforeEach(() => {
// Presets an action, which is performed before each unit test case starts.
// The number of execution times is the same as the number of test cases defined by **it**.
// This API supports only one parameter: preset action function.
});
afterEach(() => {
// Presets a clear action, which is performed after each unit test case ends.
// The number of execution times is the same as the number of test cases defined by **it**.
// This API supports only one parameter: clear action function.
});
afterAll(() => {
// Presets a clear action, which is performed after all test cases of the test suite end.
// This API supports only one parameter: clear action function.
});
it('assertContain', 0, () => {
// Defines a test case. This API supports three parameters: test case name, filter parameter, and test case function.
let a = 'abc';
let b = 'b';
// Defines a variety of assertion methods, which are used to declare expected boolean conditions.
expect(a).assertContain(b);
expect(a).assertEqual(a);
});
});
}
\ No newline at end of file
... ...
{
"modelVersion": "5.0.0",
"dependencies": {
},
"execution": {
// "analyze": "normal", /* Define the build analyze mode. Value: [ "normal" | "advanced" | false ]. Default: "normal" */
// "daemon": true, /* Enable daemon compilation. Value: [ true | false ]. Default: true */
// "incremental": true, /* Enable incremental compilation. Value: [ true | false ]. Default: true */
// "parallel": true, /* Enable parallel compilation. Value: [ true | false ]. Default: true */
// "typeCheck": false, /* Enable typeCheck. Value: [ true | false ]. Default: false */
},
"logging": {
// "level": "info" /* Define the log level. Value: [ "debug" | "info" | "warn" | "error" ]. Default: "info" */
},
"debugging": {
// "stacktrace": false /* Disable stacktrace compilation. Value: [ true | false ]. Default: false */
},
"nodeOptions": {
// "maxOldSpaceSize": 8192 /* Enable nodeOptions maxOldSpaceSize compilation. Unit M. Used for the daemon process. Default: 8192*/
// "exposeGC": true /* Enable to trigger garbage collection explicitly. Default: true*/
}
}
... ...
import { appTasks } from '@ohos/hvigor-ohos-plugin';
export default {
system: appTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
}
... ...
{
"meta": {
"stableOrder": true
},
"lockfileVersion": 3,
"ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.",
"specifiers": {
"@ohasasugar/hp-richtext@^3.0.4": "@ohasasugar/hp-richtext@3.0.4",
"@ohos/axios@^2.2.4": "@ohos/axios@2.2.4",
"@ohos/hamock@1.0.0": "@ohos/hamock@1.0.0",
"@ohos/hypium@1.0.19": "@ohos/hypium@1.0.19",
"@wuyan/html_parse@^1.0.7": "@wuyan/html_parse@1.0.7"
},
"packages": {
"@ohasasugar/hp-richtext@3.0.4": {
"name": "@ohasasugar/hp-richtext",
"version": "3.0.4",
"integrity": "sha512-8HqeBbKOwAmsZh9ykiqlXYIyQ53LVqUmZ19JukYfWx3Djy+XjHDB8ydR1hTncI8DfAcTxyLmvBAMe6ojunQB6Q==",
"resolved": "https://ohpm.openharmony.cn/ohpm/@ohasasugar/hp-richtext/-/hp-richtext-3.0.4.har",
"registryType": "ohpm"
},
"@ohos/axios@2.2.4": {
"name": "@ohos/axios",
"version": "2.2.4",
"integrity": "sha512-5oH753kGFwfJP1kvCnI92RRaSqRbN0b24vmNNrUV+T8+5ako98rtVQOhA7ezMPox5Z3PFWndLQTF/P/hEK/yeQ==",
"resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/axios/-/axios-2.2.4.har",
"registryType": "ohpm"
},
"@ohos/hamock@1.0.0": {
"name": "@ohos/hamock",
"version": "1.0.0",
"integrity": "sha512-K6lDPYc6VkKe6ZBNQa9aoG+ZZMiwqfcR/7yAVFSUGIuOAhPvCJAo9+t1fZnpe0dBRBPxj2bxPPbKh69VuyAtDg==",
"resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hamock/-/hamock-1.0.0.har",
"registryType": "ohpm"
},
"@ohos/hypium@1.0.19": {
"name": "@ohos/hypium",
"version": "1.0.19",
"integrity": "sha512-cEjDgLFCm3cWZDeRXk7agBUkPqjWxUo6AQeiu0gEkb3J8ESqlduQLSIXeo3cCsm8U/asL7iKjF85ZyOuufAGSQ==",
"resolved": "https://ohpm.openharmony.cn/ohpm/@ohos/hypium/-/hypium-1.0.19.har",
"registryType": "ohpm"
},
"@wuyan/html_parse@1.0.7": {
"name": "@wuyan/html_parse",
"version": "1.0.7",
"integrity": "sha512-HT1vqQh2LyIbFVOS914MpNTGSobHcBYbxvhgsBEU8PEV8UML5UwHnrBqYFhYlv62s8lgBV4B6ZEoFZXngdwMWQ==",
"resolved": "https://ohpm.openharmony.cn/ohpm/@wuyan/html_parse/-/html_parse-1.0.7.har",
"registryType": "ohpm"
}
}
}
\ No newline at end of file
... ...
{
"modelVersion": "5.0.0",
"description": "Please describe the basic information.",
"dependencies": {
"@ohos/axios": "^2.2.4",
"@ohasasugar/hp-richtext": "^3.0.4",
"@wuyan/html_parse": "^1.0.7"
},
"devDependencies": {
"@ohos/hypium": "1.0.19",
"@ohos/hamock": "1.0.0"
},
"dynamicDependencies": {}
}
\ No newline at end of file
... ...