作者 xiaoqiu

首次提交

正在显示 54 个修改的文件 包含 4665 行增加0 行删除

要显示太多修改。

为保证性能只显示 54 of 54+ 个文件。

不能预览此文件类型
  1 +/node_modules
  2 +/oh_modules
  3 +/local.properties
  4 +/.idea
  5 +**/build
  6 +/.hvigor
  7 +.cxx
  8 +/.clangd
  9 +/.clang-format
  10 +/.clang-tidy
  11 +**/.test
  12 +/.appanalyzer
  1 +{
  2 + "app": {
  3 + "bundleName": "com.example.fireMaintenanceAssistant",
  4 + "vendor": "example",
  5 + "versionCode": 1000000,
  6 + "versionName": "1.0.0",
  7 + "icon": "$media:app_icon",
  8 + "label": "$string:app_name"
  9 + }
  10 +}
  1 +{
  2 + "string": [
  3 + {
  4 + "name": "app_name",
  5 + "value": "消防维保助手"
  6 + }
  7 + ]
  8 +}
  1 +{
  2 + "app": {
  3 + "products": [
  4 + {
  5 + "name": "default",
  6 + "signingConfig": "default",
  7 + "compatibleSdkVersion": "5.0.0(12)",
  8 + "runtimeOS": "HarmonyOS",
  9 + "buildOption": {
  10 + "strictMode": {
  11 + "caseSensitiveCheck": true,
  12 + "useNormalizedOHMUrl": true
  13 + }
  14 + }
  15 + }
  16 + ],
  17 + "buildModeSet": [
  18 + {
  19 + "name": "debug"
  20 + },
  21 + {
  22 + "name": "release"
  23 + }
  24 + ],
  25 + "signingConfigs": [
  26 + {
  27 + "name": "default",
  28 + "type": "HarmonyOS",
  29 + "material": {
  30 + "storePassword": "0000001ABFA3098F4A58FE591F6AE225CCEC2D4131BF649B5FC7FE780DD745742DE3ABAB9759886B99E2",
  31 + "certpath": "/Users/king/Desktop/harmonyos/keyStoreFile/fireMaintenance/fireMaintenance.cer",
  32 + "keyAlias": "fireMaintenance",
  33 + "keyPassword": "0000001A018F4E9B269FEF764B4C7E6047DE40E22254B5479AFE815F863B88716EB4C6D67B6CF97C10C4",
  34 + "profile": "/Users/king/Desktop/harmonyos/keyStoreFile/fireMaintenance/fireMaintananceRelease.p7b",
  35 + "signAlg": "SHA256withECDSA",
  36 + "storeFile": "/Users/king/Desktop/harmonyos/keyStoreFile/fireMaintenance/fireMaintenance.p12"
  37 + }
  38 + }
  39 + ]
  40 + },
  41 + "modules": [
  42 + {
  43 + "name": "entry",
  44 + "srcPath": "./entry",
  45 + "targets": [
  46 + {
  47 + "name": "default",
  48 + "applyToProducts": [
  49 + "default"
  50 + ]
  51 + }
  52 + ]
  53 + }
  54 + ]
  55 +}
  1 +{
  2 + "files": [
  3 + "**/*.ets"
  4 + ],
  5 + "ignore": [
  6 + "**/src/ohosTest/**/*",
  7 + "**/src/test/**/*",
  8 + "**/src/mock/**/*",
  9 + "**/node_modules/**/*",
  10 + "**/oh_modules/**/*",
  11 + "**/build/**/*",
  12 + "**/.preview/**/*"
  13 + ],
  14 + "ruleSet": [
  15 + "plugin:@performance/recommended",
  16 + "plugin:@typescript-eslint/recommended"
  17 + ],
  18 + "rules": {
  19 + }
  20 +}
不能预览此文件类型
  1 +/node_modules
  2 +/oh_modules
  3 +/.preview
  4 +/build
  5 +/.cxx
  6 +/.test
  1 +{
  2 + "apiType": "stageMode",
  3 + "buildOption": {
  4 + },
  5 + "buildOptionSet": [
  6 + {
  7 + "name": "release",
  8 + "arkOptions": {
  9 + "obfuscation": {
  10 + "ruleOptions": {
  11 + "enable": false,
  12 + "files": [
  13 + "./obfuscation-rules.txt"
  14 + ]
  15 + }
  16 + }
  17 + }
  18 + },
  19 + ],
  20 + "targets": [
  21 + {
  22 + "name": "default"
  23 + },
  24 + {
  25 + "name": "ohosTest",
  26 + }
  27 + ]
  28 +}
  1 +import { hapTasks } from '@ohos/hvigor-ohos-plugin';
  2 +
  3 +export default {
  4 + system: hapTasks, /* Built-in plugin of Hvigor. It cannot be modified. */
  5 + plugins:[] /* Custom plugin to extend the functionality of Hvigor. */
  6 +}
  1 +# Define project specific obfuscation rules here.
  2 +# You can include the obfuscation configuration files in the current module's build-profile.json5.
  3 +#
  4 +# For more details, see
  5 +# https://developer.huawei.com/consumer/cn/doc/harmonyos-guides-V5/source-obfuscation-V5
  6 +
  7 +# Obfuscation options:
  8 +# -disable-obfuscation: disable all obfuscations
  9 +# -enable-property-obfuscation: obfuscate the property names
  10 +# -enable-toplevel-obfuscation: obfuscate the names in the global scope
  11 +# -compact: remove unnecessary blank spaces and all line feeds
  12 +# -remove-log: remove all console.* statements
  13 +# -print-namecache: print the name cache that contains the mapping from the old names to new names
  14 +# -apply-namecache: reuse the given cache file
  15 +
  16 +# Keep options:
  17 +# -keep-property-name: specifies property names that you want to keep
  18 +# -keep-global-name: specifies names that you want to keep in the global scope
  19 +
  20 +-enable-property-obfuscation
  21 +-enable-toplevel-obfuscation
  22 +-enable-filename-obfuscation
  23 +-enable-export-obfuscation
  1 +{
  2 + "name": "entry",
  3 + "version": "1.0.0",
  4 + "description": "Please describe the basic information.",
  5 + "main": "",
  6 + "author": "",
  7 + "license": "",
  8 + "dependencies": {}
  9 +}
  10 +
不能预览此文件类型
不能预览此文件类型
  1 +import https from './request'
  2 +// 获取上传秘钥参数
  3 +export interface cosKeyTest {
  4 + msg: string;
  5 + code: number;
  6 + data: cosKeyData;
  7 +}
  8 +
  9 +export interface cosKeyData {
  10 + credentials: cosKeyCredentials;
  11 + requestId: string;
  12 + expiration: string;
  13 + startTime: number;
  14 + expiredTime: number;
  15 + coskey: string;
  16 + preSignedUrl: string;
  17 +}
  18 +
  19 +export interface cosKeyCredentials {
  20 + tmpSecretId: string;
  21 + tmpSecretKey: string;
  22 + sessionToken: string;
  23 +}
  24 +
  25 +
  26 +
  27 +// 获取上传秘钥
  28 +export const getCosKey = (filename: string) => {
  29 + return https<cosKeyTest>({
  30 + url: '/system/COS/getTempKey',
  31 + method: 'get',
  32 + params: {
  33 + filename
  34 + }
  35 + })
  36 +}
  37 +
  38 +interface cosParams {
  39 + cosKey: string,
  40 + relateId: number
  41 +}
  42 +// 上传视频
  43 +export const uploadVideoOrImg = (data: cosParams) => {
  44 + return https({
  45 + url: '/maintenance/report/uploadVedio',
  46 + method: 'post',
  47 + headers: {
  48 + "Content-Type": 'application/json'
  49 + },
  50 + data
  51 + })
  52 +}
  1 +import https from './request'
  2 +
  3 +export interface noticeTest {
  4 + total: number;
  5 + rows: noticeRow[];
  6 + code: number;
  7 + msg: string;
  8 +}
  9 +
  10 +export interface noticeDetailTest {
  11 + data: noticeRow;
  12 + code: number;
  13 + msg: string;
  14 +}
  15 +export interface noticeRow {
  16 + createBy?: string;
  17 + createTime?: string;
  18 + updateBy?: string;
  19 + updateTime?: null | string;
  20 + remark?: null;
  21 + noticeId?: number;
  22 + noticeTitle: string;
  23 + noticeType: string;
  24 + noticeContent: string;
  25 + status?: string;
  26 +}
  27 +
  28 +export interface noticeParams {
  29 + pageNum: number
  30 + pageSize: number
  31 + noticeTitle?: string
  32 + createBy?: string
  33 + status?: string
  34 + noticeType?: string
  35 +}
  36 +
  37 +// 获取公告列表
  38 +export const getNoticeList = (data: noticeParams) => {
  39 + return https<noticeTest>({
  40 + url: '/system/notice/list',
  41 + method: 'get',
  42 + params: data
  43 + })
  44 +}
  45 +
  46 +// 获取公告详情
  47 +export const getNoticeDetail = (id: number) => {
  48 + return https<noticeDetailTest>({
  49 + url: `/system/notice/${id}`,
  50 + method: 'get',
  51 + })
  52 +}
  1 +export interface quarterTest {
  2 + msg: string;
  3 + code: number;
  4 + data: quarterType[];
  5 +}
  6 +
  7 +export interface quarterType {
  8 + createBy: string;
  9 + createTime: string;
  10 + updateBy: null;
  11 + updateTime: null;
  12 + remark: null;
  13 + dictCode: number;
  14 + dictSort: number;
  15 + dictLabel: string;
  16 + dictValue: string;
  17 + dictType: string;
  18 + cssClass: null;
  19 + listClass: string;
  20 + isDefault: string;
  21 + status: string;
  22 + default: boolean;
  23 +}
  24 +
  1 +import https from './request'
  2 +import { RecordsList, QueryParams, addParamsType, equipmentTest, LatestProjectTest,
  3 + companyPersonTest, reportDetailTest, MalfunctionListTest, MalfunctionListRow,
  4 + InitTest, realNameTest, orderTest,configTest,
  5 + recordTest, orderParams, recordParams, editType
  6 +} from './recordsType'
  7 +import { quarterTest } from './options/optionsType'
  8 +// 获取维保记录列表
  9 +export const getRecordsList = (data: QueryParams) => {
  10 + return https<RecordsList>({
  11 + url: '/maintenance/report/list',
  12 + method: 'get',
  13 + params: data
  14 + })
  15 +}
  16 +
  17 +// 新增维保记录
  18 +export const addRecords = (data: addParamsType) => {
  19 + return https({
  20 + url: '/maintenance/report',
  21 + method: 'post',
  22 + data
  23 + })
  24 +}
  25 +
  26 +// 修改维保记录
  27 +export const updateRecords = (data: addParamsType) => {
  28 + return https({
  29 + url: '/maintenance/report',
  30 + method: 'put',
  31 + data
  32 + })
  33 +}
  34 +interface deleteType{
  35 + reportId: number,
  36 + state: string
  37 +}
  38 +
  39 +// 操作维保记录信息
  40 +export const deleteRecords = (data: deleteType) => {
  41 + return https({
  42 + url: '/maintenance/report/updateInfo',
  43 + method: 'post',
  44 + data
  45 + })
  46 +}
  47 +
  48 +
  49 +// 获取仪器设备列表
  50 +export const getEquipmentList = (data: QueryParams) => {
  51 + return https<equipmentTest>({
  52 + url: '/system/equipment/list',
  53 + method: 'get',
  54 + params: data
  55 + })
  56 +}
  57 +
  58 +// 获取主要消防措施列表
  59 +export const getLatestProjectList = (type: string) => {
  60 + return https<LatestProjectTest>({
  61 + url: '/maintenance/project/latestProject',
  62 + method: 'get',
  63 + params: {
  64 + type
  65 + }
  66 + })
  67 +}
  68 +
  69 +// 获取记录类型列表
  70 +export const getMaintenanceType = () => {
  71 + return https<quarterTest>({
  72 + url: '/system/dict/data/type/maintenance_system_type',
  73 + method: 'get'
  74 + })
  75 +}
  76 +
  77 +// 获取记录状态列表
  78 +export const getMaintenanceState = () => {
  79 + return https<quarterTest>({
  80 + url: '/system/dict/data/type/report_state',
  81 + method: 'get'
  82 + })
  83 +}
  84 +
  85 +// 获取公司维保人员人员列表
  86 +export const getCompanyPersonList = (data: QueryParams) => {
  87 + return https<companyPersonTest>({
  88 + url: '/system/companyPerson/list',
  89 + method: 'get',
  90 + params: data
  91 + })
  92 +}
  93 +
  94 +// 获取维保详情
  95 +export const getReportDetail = (reportId: number) => {
  96 + return https<reportDetailTest>({
  97 + url: `/maintenance/report/view/${reportId}`,
  98 + method: 'get'
  99 + })
  100 +}
  101 +export interface downloadUrl {
  102 + code: number
  103 + data: string
  104 + msg: string
  105 +}
  106 +
  107 +// 获取图片视频地址链接
  108 +export const getDownloadUrl = (cosKey: string, type: number) => {
  109 + return https<downloadUrl>({
  110 + url: `/system/COS/getDownloadUrl`,
  111 + method: 'get',
  112 + params: {
  113 + cosKey,
  114 + type
  115 + }
  116 + })
  117 +}
  118 +
  119 +interface MalfunctionListType{
  120 + pageNum: number,
  121 + pageSize: number,
  122 + reportId: number
  123 +}
  124 +// 获取消防设施故障处理单
  125 +export const getMalfunctionList = (data: MalfunctionListType) => {
  126 + return https<MalfunctionListTest>({
  127 + url: `/maintenance/malfunction/list`,
  128 + method: 'get',
  129 + params: data
  130 + })
  131 +}
  132 +
  133 +// 修改消防设施故障处理单
  134 +export const updateMalfunctionList = (data:editType) => {
  135 + return https({
  136 + url: `/maintenance/malfunction/updateList`,
  137 + method: 'post',
  138 + data
  139 + })
  140 +}
  141 +
  142 +// 获取原始记录详情及签名
  143 +export const getInitDetail = (reportId: number) => {
  144 + return https<InitTest>({
  145 + url: `/maintenance/report/view/${reportId}`,
  146 + method: 'get'
  147 + })
  148 +}
  149 +
  150 +// 根据报告编号获取实名信息
  151 +export const getSelectByReportNo = (reportNo: string) => {
  152 + return https<realNameTest>({
  153 + url: `/maintenance/verification/selectByReportNo`,
  154 + method: 'get',
  155 + params: {
  156 + reportNo
  157 + }
  158 + })
  159 +}
  160 +
  161 +// 查询订单记录
  162 +export const getOrderList = (data: orderParams) => {
  163 + return https<orderTest>({
  164 + url: `/system/order/list`,
  165 + method: 'get',
  166 + params: data
  167 + })
  168 +}
  169 +
  170 +// 查询消耗记录
  171 +export const getRecordList = (data: recordParams) => {
  172 + return https<recordTest>({
  173 + url: `/system/record/list`,
  174 + method: 'get',
  175 + params: data
  176 + })
  177 +}
  178 +
  179 +// 查询支付来源
  180 +export const getOrderSource = () => {
  181 + return https<quarterTest>({
  182 + url: `/system/dict/data/type/pay_source`,
  183 + method: 'get'
  184 + })
  185 +}
  186 +
  187 +// 查询订单状态
  188 +export const getOrderState = () => {
  189 + return https<quarterTest>({
  190 + url: `/system/dict/data/type/orders_state`,
  191 + method: 'get'
  192 + })
  193 +}
  194 +
  195 +// 获取参数详情
  196 +export const getConfigDetail = (configId: number) => {
  197 + return https<configTest>({
  198 + url: `/system/config/${configId}`,
  199 + method: 'get'
  200 + })
  201 +}
  202 +
  203 +// 完成签名
  204 +export const successReport = (reportId: number) => {
  205 + return https<configTest>({
  206 + url: `/maintenance/report/validReport`,
  207 + method: 'post',
  208 + data: {
  209 + reportId
  210 + }
  211 + })
  212 +}
  213 +
  214 +// 退回签名
  215 +export const returnSing = (reportId: number) => {
  216 + return https<configTest>({
  217 + url: `/maintenance/report/backToEdit`,
  218 + method: 'post',
  219 + data: {
  220 + reportId
  221 + }
  222 + })
  223 +}
  224 +
  225 +// 导入月度记录
  226 +export const importRecord = (fromReportId: number, toReportId:number) => {
  227 + return https({
  228 + url: `/maintenance/malfunction/importMalfunction`,
  229 + method: 'get',
  230 + params: {
  231 + fromReportId,
  232 + toReportId
  233 + }
  234 + })
  235 +}
  1 +// 查询支付订单列表
  2 +export interface orderParams {
  3 + pageNum: number
  4 + pageSize: number
  5 + orderNo?: string
  6 + amount?: number
  7 + comboName?: string
  8 + companyId: number
  9 + companyName?: string
  10 + state?: string
  11 + source?: string
  12 +}
  13 +
  14 +// 查询消费记录订单列表
  15 +export interface recordParams {
  16 + pageNum: number
  17 + pageSize: number
  18 + reportName?: string
  19 + companyId: number
  20 + companyName?: string
  21 + createUserId?: number
  22 + reportNo?: string
  23 +}
  24 +
  25 +// 查询维保列表参数类型
  26 +export interface QueryParams {
  27 + pageNum: number
  28 + pageSize: number
  29 + reportName?: string
  30 + reportNo?: string
  31 + applyCompanyName?: string
  32 + companyName?: string
  33 + stateQuery?: string
  34 + reportType?: string
  35 + beginMaintenanceTime?: string
  36 + endMaintenanceTime?: string
  37 + companyId?: number
  38 + technicalDirectorId?: number
  39 + state?: string
  40 + personId?: number
  41 + personName?: string
  42 +}
  43 +// 原始记录列表类型
  44 +export interface RecordsList {
  45 + total: number;
  46 + rows: Row[];
  47 + code: number;
  48 + msg: string;
  49 +}
  50 +// 原始记录类型
  51 +export interface Row {
  52 + createBy: null;
  53 + createTime: null;
  54 + updateBy: null;
  55 + updateTime: null;
  56 + remark: null;
  57 + reportId: number;
  58 + reportName: string;
  59 + reportNo: string;
  60 + address: null;
  61 + applyCompanyId: null;
  62 + applyCompanyName: string;
  63 + companyId: number;
  64 + companyName: string;
  65 + applyPerson: null;
  66 + applyDate: null;
  67 + buildUse: null;
  68 + buildHeight: null;
  69 + buildArea: null;
  70 + aboveGroundLayers: null;
  71 + undeGroundLayers: null;
  72 + projectSize: null;
  73 + fireFacilities: string;
  74 + basis: null;
  75 + result: null | string;
  76 + requirement: null;
  77 + equipment: null | string;
  78 + maintenancePeople: null | string;
  79 + maintenanceTime: null | string;
  80 + technicalDirectorId: string;
  81 + technicalDirector: null;
  82 + approvePersonId: null;
  83 + approvePerson: null;
  84 + allowPerson: null;
  85 + state: string;
  86 + reportType: string;
  87 + city: null;
  88 + county: null;
  89 + projectNature: null;
  90 + reportTime: null | string;
  91 + contractId: null;
  92 + contractName: null;
  93 + contractStartTime: null;
  94 + contractEndTime: null;
  95 + buildType: null;
  96 + fireDanger: null;
  97 + otherBuildType: null;
  98 + regionCode: null;
  99 + maintenanceArea: null;
  100 + maintenanceEndTime: null | string;
  101 + instanceId: null;
  102 + processKey: null;
  103 + contractImg: null;
  104 + proveImg: null;
  105 + smallestState: null;
  106 + projectArea: null;
  107 + maintenancePeopleId: null;
  108 + praticeImg: null | string;
  109 + reportPeriod: null;
  110 + stateQuery: null;
  111 + reportFinishTime: null | string;
  112 + projectList: null;
  113 + signList: null;
  114 + firstPartySign: null;
  115 + malfunctionList: null;
  116 +}
  117 +
  118 +// 添加维保记录参数类型
  119 +export interface addParamsType {
  120 + aboveGroundLayers?: string | null
  121 + address?: string | null
  122 + allowPerson?: string | null
  123 + applyCompanyId?: number | null
  124 + applyCompanyName: string | null
  125 + applyDate?: string | null
  126 + applyPerson?: string
  127 + approvePerson: string
  128 + approvePersonId: number
  129 + basis?: string | null
  130 + buildArea?: number | null
  131 + buildHeight?: number | null
  132 + buildUse?: string | null
  133 + companyId?: number | null
  134 + contractId?: number | null
  135 + equipment?: string | null
  136 + equipmentList?: string[] | null
  137 + fireFacilities?: string | null
  138 + linkMan?: string | null
  139 + linkTel?: string | null
  140 + maintenanceDate?: string[] | null
  141 + maintenanceEndTime?: string
  142 + maintenancePeople?: string
  143 + maintenancePeopleList?: string[]
  144 + maintenanceTime?: string
  145 + projectList?: projectType[]
  146 + projectSize?: string | null
  147 + reportId?: number | null
  148 + reportName?: string | null
  149 + reportNo?: string | null
  150 + reportTime?: string | null
  151 + reportType?: string | null
  152 + requirement?: string | null
  153 + result?: string | null
  154 + safeMan?: string | null
  155 + safeSignDate?: string | null
  156 + state?: string | null
  157 + technicalDirector?: string | null
  158 + technicalDirectorId?: string
  159 + undeGroundLayers?: string | null
  160 +}
  161 +
  162 +export interface projectType{
  163 + projectId: number
  164 +}
  165 +
  166 +// 维保详情类型
  167 +export interface reportDetailTest {
  168 + msg: string;
  169 + code: number;
  170 + data: reportDetailData;
  171 +}
  172 +
  173 +export interface reportDetailData {
  174 + createBy?: null;
  175 + createTime?: null;
  176 + updateBy?: null;
  177 + updateTime?: null;
  178 + remark?: null;
  179 + reportId?: number;
  180 + reportName: string;
  181 + reportNo: string;
  182 + address?: null;
  183 + applyCompanyId?: null;
  184 + applyCompanyName: string;
  185 + companyId?: number;
  186 + companyName: string;
  187 + applyPerson?: null;
  188 + applyDate?: null;
  189 + buildUse?: null;
  190 + buildHeight?: null;
  191 + buildArea?: null;
  192 + aboveGroundLayers?: null;
  193 + undeGroundLayers?: null;
  194 + projectSize?: null;
  195 + fireFacilities: string;
  196 + basis?: null;
  197 + result: string;
  198 + requirement?: null;
  199 + equipment: string;
  200 + maintenancePeople: string;
  201 + maintenanceTime: string;
  202 + technicalDirectorId?: string;
  203 + technicalDirector?: null;
  204 + approvePersonId?: null;
  205 + approvePerson?: null;
  206 + allowPerson?: null;
  207 + state: string;
  208 + reportType: string;
  209 + city?: null;
  210 + county?: null;
  211 + projectNature?: null;
  212 + reportTime: string;
  213 + contractId?: null;
  214 + contractName?: null;
  215 + contractStartTime?: null;
  216 + contractEndTime?: null;
  217 + buildType?: null;
  218 + fireDanger?: null;
  219 + otherBuildType?: null;
  220 + regionCode?: null;
  221 + maintenanceArea?: null;
  222 + maintenanceEndTime: string;
  223 + instanceId?: null;
  224 + processKey?: null;
  225 + contractImg?: null;
  226 + proveImg?: null;
  227 + smallestState?: null;
  228 + projectArea?: null;
  229 + maintenancePeopleId?: null;
  230 + praticeImg?: null;
  231 + reportPeriod?: null;
  232 + stateQuery?: null;
  233 + reportFinishTime?: null;
  234 + projectList: ProjectList[];
  235 + signList?: [];
  236 + firstPartySign?: [];
  237 + malfunctionList?: [];
  238 + equipmentList: string[];
  239 + maintenancePeopleList: string[]
  240 +}
  241 +
  242 +export interface ProjectList {
  243 + createBy: null;
  244 + createTime: null;
  245 + updateBy: null;
  246 + updateTime: string;
  247 + remark: null;
  248 + relateId: number;
  249 + reportId: number;
  250 + projectId: number;
  251 + projectName: string;
  252 + englishName: string;
  253 + state: string;
  254 + cosKey: null | string;
  255 + vedioTIme: null;
  256 + vedioState: null;
  257 + itemList: ItemList[];
  258 +}
  259 +
  260 +export interface ItemList {
  261 + relateId: number;
  262 + itemId: number;
  263 + itemName: string;
  264 + itemEnglishName: string;
  265 + maintainceContent: string;
  266 + editTemplate: string;
  267 + viewTemplate: string;
  268 + orderNum: number;
  269 + rowspan: number;
  270 + showItemName: number;
  271 + position: string;
  272 + num: string;
  273 + proportion: string;
  274 + state: string;
  275 + record: recordType;
  276 +}
  277 +
  278 +export interface recordType {
  279 + record1?: string
  280 + record2?: string
  281 + record3?: string
  282 + record4?: string
  283 + record5?: string
  284 +}
  285 +
  286 +// 获取设备仪器类型
  287 +export interface equipmentTest {
  288 + code: number
  289 + msg: string
  290 + total: number
  291 + rows: equipmentType[]
  292 +}
  293 +
  294 +export interface equipmentType {
  295 + buyDate: string
  296 + certificateNo: string
  297 + companyId: number
  298 + companyName: string
  299 + createBy: string | null
  300 + createTime: string
  301 + endDate: string
  302 + equipmentId: number
  303 + equipmentName: string
  304 + equipmentPicture: string | null
  305 + isCheckEquipment: boolean | null
  306 + manufacturer: string
  307 + remark: string | null
  308 + remarks: string
  309 + specifications: string
  310 + startDate: string
  311 + state: number
  312 + updateBy: string | null
  313 + updateTime: string | null
  314 + verificationReportPicture: string | null
  315 +}
  316 +
  317 +// 主要消防措施类型
  318 +export interface LatestProjectTest {
  319 + msg: string;
  320 + code: number;
  321 + data: LatestProjectDatum[];
  322 +}
  323 +
  324 +export interface LatestProjectDatum {
  325 + createBy: string | null;
  326 + createTime: string;
  327 + updateBy: string | null;
  328 + updateTime: string | null;
  329 + remark: string | null;
  330 + projectId: number;
  331 + projectName: string;
  332 + type: number;
  333 + version: string;
  334 + projectOrder: number;
  335 + englishName: string | null;
  336 +}
  337 +
  338 +// 获取公司在职人员列表
  339 +export interface companyPersonTest {
  340 + total: number;
  341 + rows: companyPersonRow[];
  342 + code: number;
  343 + msg: string;
  344 +}
  345 +
  346 +export interface companyPersonRow {
  347 + companyId: number;
  348 + companyName: string;
  349 + personId: number;
  350 + personName: string;
  351 + idNo: string;
  352 + certificateId: number | null;
  353 + certificateName: string;
  354 + certificateLevel: string;
  355 + memo: string | null;
  356 + state: string;
  357 + createTime: string;
  358 + relateId: number;
  359 + personalImg: string;
  360 +}
  361 +
  362 +// 消防设施故障处理列表类型
  363 +
  364 +export interface MalfunctionListTest {
  365 + total: number;
  366 + rows: MalfunctionListRow[];
  367 + code: number;
  368 + msg: string;
  369 +}
  370 +
  371 +export interface MalfunctionListRow {
  372 + malfunctionId?: number;
  373 + findTime?: null | string;
  374 + findPeople?: null;
  375 + malfunctionPart: string;
  376 + malfunctionDes: string;
  377 + isStop?: null;
  378 + isRecord?: null;
  379 + security: string;
  380 + maintenanceTime?: null;
  381 + maintenancePeople?: null;
  382 + maintenanceMethod: string;
  383 + malfunctionConfirm: string;
  384 + reportId?: number;
  385 + version?: number;
  386 + maintenanceComment?: null | string;
  387 + applyCompanyComment?: null | string;
  388 + remark: null | string;
  389 + companyName?: null | string;
  390 + applyCompanyName?: string;
  391 +}
  392 +
  393 +// 新增、修改、删除类型
  394 +export interface editType {
  395 + reportId: number;
  396 + list: MalfunctionListRow[]
  397 +}
  398 +
  399 +// 原始记录详情类型
  400 +export interface InitTest {
  401 + msg: string;
  402 + code: number;
  403 + data: InitData;
  404 +}
  405 +
  406 +export interface InitData {
  407 + createBy?: null;
  408 + createTime?: null;
  409 + updateBy?: null;
  410 + updateTime?: null;
  411 + remark?: null;
  412 + reportId?: number;
  413 + reportName: string;
  414 + reportNo: string;
  415 + address?: null;
  416 + applyCompanyId?: null;
  417 + applyCompanyName?: string;
  418 + companyId?: number;
  419 + companyName?: string;
  420 + applyPerson?: null;
  421 + applyDate?: null;
  422 + buildUse?: null;
  423 + buildHeight?: null;
  424 + buildArea?: null;
  425 + aboveGroundLayers?: null;
  426 + undeGroundLayers?: null;
  427 + projectSize?: null;
  428 + fireFacilities?: string;
  429 + basis?: null;
  430 + result?: null;
  431 + requirement?: null;
  432 + equipment?: string;
  433 + maintenancePeople?: string;
  434 + maintenanceTime?: string;
  435 + technicalDirectorId?: string;
  436 + technicalDirector?: null;
  437 + approvePersonId?: null;
  438 + approvePerson?: null;
  439 + allowPerson?: null;
  440 + state?: string;
  441 + reportType?: string;
  442 + city?: null;
  443 + county?: null;
  444 + projectNature?: null;
  445 + reportTime?: string;
  446 + contractId?: null;
  447 + contractName?: null;
  448 + contractStartTime?: null;
  449 + contractEndTime?: null;
  450 + buildType?: null;
  451 + fireDanger?: null;
  452 + otherBuildType?: null;
  453 + regionCode?: null;
  454 + maintenanceArea?: null;
  455 + maintenanceEndTime?: string;
  456 + instanceId?: null;
  457 + processKey?: null;
  458 + contractImg?: null;
  459 + proveImg?: null;
  460 + smallestState?: null;
  461 + projectArea?: null;
  462 + maintenancePeopleId?: null;
  463 + praticeImg?: null;
  464 + reportPeriod?: null;
  465 + stateQuery?: null;
  466 + reportFinishTime?: string;
  467 + projectList?: ProjectList[];
  468 + signList?: InitFirstPartySign[];
  469 + firstPartySign?: InitFirstPartySign[];
  470 + malfunctionList?: InitMalfunctionList[];
  471 +}
  472 +
  473 +export interface InitFirstPartySign {
  474 + createBy: null;
  475 + createTime: null;
  476 + updateBy: null;
  477 + updateTime: null;
  478 + remark: null;
  479 + signId: number;
  480 + type: number;
  481 + signPic: string;
  482 + signHash: string;
  483 + signEncrypt: string;
  484 + username: string;
  485 + reportId: number;
  486 + signTime: string;
  487 +}
  488 +
  489 +export interface InitMalfunctionList {
  490 + malfunctionId: number;
  491 + findTime: string;
  492 + findPeople: null;
  493 + malfunctionPart: string;
  494 + malfunctionDes: string;
  495 + isStop: null;
  496 + isRecord: null;
  497 + security: string;
  498 + maintenanceTime: null;
  499 + maintenancePeople: null;
  500 + maintenanceMethod: string;
  501 + malfunctionConfirm: string;
  502 + reportId: number;
  503 + version: number;
  504 + maintenanceComment: string;
  505 + applyCompanyComment: string;
  506 + remark: string;
  507 + companyName: null;
  508 + applyCompanyName: null;
  509 +}
  510 +
  511 +export interface InitProjectList {
  512 + createBy: null;
  513 + createTime: null;
  514 + updateBy: null;
  515 + updateTime: string;
  516 + remark: null;
  517 + relateId: number;
  518 + reportId: number;
  519 + projectId: number;
  520 + projectName: string;
  521 + englishName: string;
  522 + state: string;
  523 + cosKey: string;
  524 + vedioTIme: null;
  525 + vedioState: null;
  526 + itemList: ItemList[];
  527 +}
  528 +
  529 +export interface InitItemList {
  530 + relateId: number;
  531 + itemId: number;
  532 + itemName: string;
  533 + itemEnglishName: string;
  534 + maintainceContent: string;
  535 + editTemplate: string;
  536 + viewTemplate: string;
  537 + orderNum: number;
  538 + rowspan: number;
  539 + showItemName: number;
  540 + position: string;
  541 + num: string;
  542 + proportion: string;
  543 + state: string;
  544 + record: Record;
  545 +}
  546 +
  547 +export interface Record {
  548 + record4: string;
  549 + record3: string;
  550 + record2: string;
  551 + record1: string;
  552 +}
  553 +
  554 +// 实名信息类型
  555 +export interface realNameTest {
  556 + msg: string;
  557 + code: number;
  558 + data: realNameDatum[];
  559 +}
  560 +
  561 +export interface realNameDatum {
  562 + reportId: number;
  563 + reportName: string;
  564 + reportNo: string;
  565 + realName: string;
  566 + idNo: string;
  567 + openId: string;
  568 + signTime: string;
  569 +}
  570 +
  571 +
  572 +// 订单列表类型
  573 +export interface orderTest {
  574 + total: number;
  575 + rows: orderRow[];
  576 + code: number;
  577 + msg: string;
  578 +}
  579 +
  580 +export interface orderRow {
  581 + orderId: number;
  582 + orderNo: string;
  583 + amount: number;
  584 + comboId: number;
  585 + comboName: string;
  586 + companyId: number;
  587 + companyName: string;
  588 + bean: number;
  589 + state: number;
  590 + invoice: null | string;
  591 + source: number;
  592 + createTime: string;
  593 + expireTime: string;
  594 + payInfo: orderPayInfo;
  595 +}
  596 +
  597 +export interface orderPayInfo {
  598 + "createBy": string
  599 + "createTime": string
  600 + "updateBy": string
  601 + "updateTime": string
  602 + "remark": string
  603 + "payId": number
  604 + "orderId": number
  605 + "appId": string,
  606 + "nonceStr": string,
  607 + "paySign": string,
  608 + "signType": string,
  609 + "prepayId": string,
  610 + "timeStamp": string,
  611 + "packageValue": string,
  612 + "partnerid": number,
  613 + "codeUrl": string
  614 +}
  615 +
  616 +// 消耗记录类型
  617 +export interface recordTest {
  618 + total: number;
  619 + rows: recordRow[];
  620 + code: number;
  621 + msg: string;
  622 +}
  623 +
  624 +export interface recordRow {
  625 + createBy: null;
  626 + createTime: string;
  627 + updateBy: null;
  628 + updateTime: null;
  629 + remark: string;
  630 + recordId: number;
  631 + reportId: number;
  632 + reportNo: string;
  633 + reportName: string;
  634 + companyId: number;
  635 + companyName: string;
  636 + createUserId: number;
  637 + createUserName: string;
  638 + costBean: number;
  639 + remainBean: number;
  640 +}
  641 +
  642 +
  643 +// 参数详情类型
  644 +export interface configTest {
  645 + msg: string;
  646 + code: number;
  647 + data: configData;
  648 +}
  649 +
  650 +export interface configData {
  651 + createBy: string;
  652 + createTime: string;
  653 + updateBy: string;
  654 + updateTime: null;
  655 + remark: string;
  656 + configId: number;
  657 + configName: string;
  658 + configKey: string;
  659 + configValue: string;
  660 + configType: string;
  661 +}
  1 +import axios, { AxiosResponse, AxiosError, InternalAxiosRequestConfig } from '@ohos/axios'
  2 +import preferencesUtil from '../utils/preferences'
  3 +import loginOut from '../utils/loginOut'
  4 +import { promptAction } from '@kit.ArkUI';
  5 +import { router } from '@kit.ArkUI'
  6 +import baseUrl from '../utils/baseUrl'
  7 +let https = axios.create({
  8 + baseURL: baseUrl,
  9 + // baseURL: "https://xfappht.crgx.net",
  10 + timeout: 10000,
  11 + headers: { 'Content-Type': 'application/json' }
  12 +})
  13 +
  14 +// 请求拦截
  15 +https.interceptors.request.use(async (config: InternalAxiosRequestConfig) => {
  16 + if(!config.headers.unToken){
  17 + config.headers.Authorization = preferencesUtil.get('XF_TOKEN', '') as string
  18 + }
  19 + return config
  20 +})
  21 +
  22 +// 相应拦截
  23 +https.interceptors.response.use(async (res: AxiosResponse) => {
  24 + // 未设置状态码则默认成功状态
  25 + const code: number = res.data.code || 200;
  26 + // 获取错误信息
  27 + const msg: string = res.data.msg
  28 + // 二进制数据则直接返回
  29 + if (res.request.responseType === 'blob' || res.request.responseType === 'arraybuffer') {
  30 + return res.data
  31 + }
  32 + if (code === 401) {
  33 + promptAction.showToast({
  34 + message: '身份验证失败。请重新登录'
  35 + })
  36 + await loginOut()
  37 + router.replaceUrl({
  38 + url: 'pages/Login'
  39 + })
  40 + return Promise.reject('无效的会话,或者会话已过期,请重新登录。')
  41 + } else if (code === 500) {
  42 + promptAction.showToast({
  43 + message: msg,
  44 + })
  45 + return Promise.reject(new Error(msg))
  46 + } else if (code === 601) {
  47 + promptAction.showToast({
  48 + message: msg,
  49 + })
  50 + return Promise.reject('error')
  51 + } else if (code !== 200) {
  52 + promptAction.showToast({
  53 + message: msg,
  54 + })
  55 + return Promise.reject('error')
  56 + } else {
  57 + return res
  58 + }
  59 +}, (Error: AxiosError) => {
  60 + promptAction.showToast({
  61 + message: Error.message,
  62 + })
  63 + return Promise.reject(Error)
  64 +})
  65 +
  66 +export default https
  1 +import { QueryParams } from './recordsType'
  2 +import https from './request'
  3 +import { loginType, userForm, personTest, personCertificateTest, CertificateTest, personCertificateRow, personData, companyWalletTest, InfoTest, companyTest,
  4 + companyData, headerTest, formType, headerRow,comBoTest, addType
  5 +} from './userType'
  6 +// 用户登录
  7 +export const login = (data: userForm) => {
  8 + return https<loginType>({
  9 + url: '/login',
  10 + method: 'post',
  11 + data,
  12 + headers: {
  13 + unToken: true
  14 + }
  15 + })
  16 +}
  17 +
  18 +// 退出登录
  19 +export const loginOut = () => {
  20 + return https({
  21 + url: '/logout',
  22 + method: 'post',
  23 + headers: {
  24 + unToken: true
  25 + }
  26 + })
  27 +}
  28 +
  29 +export interface updateStateParams {
  30 + relateId: number
  31 + state: string
  32 +}
  33 +
  34 +// 离职申请
  35 +export const updateState = (data: updateStateParams) => {
  36 + return https({
  37 + url: '/system/companyPerson/updateState',
  38 + method: 'post',
  39 + data
  40 + })
  41 +}
  42 +
  43 +// 获取账号信息
  44 +export const getInfo = () => {
  45 + return https<InfoTest>({
  46 + url: '/getInfo',
  47 + method: 'get'
  48 + })
  49 +}
  50 +
  51 +// 获取个人信息
  52 +export const getPersonInfo = () => {
  53 + return https<personTest>({
  54 + url: '/system/person/currentPerson',
  55 + method: 'get'
  56 + })
  57 +}
  58 +
  59 +// 获取公司管理员信息
  60 +export const getCompanyInfo = () => {
  61 + return https<companyTest>({
  62 + url: '/system/company/currentCompany',
  63 + method: 'get'
  64 + })
  65 +}
  66 +
  67 +// 更新个人信息
  68 +export const updateCompanyInfo = (data: companyData) => {
  69 + return https({
  70 + url: '/system/company',
  71 + method: 'put',
  72 + data
  73 + })
  74 +}
  75 +
  76 +// 获取公司管理员获取员工信息
  77 +export const getPersonDetail = (personId: number) => {
  78 + return https<personTest>({
  79 + url: `/system/person/${personId}`,
  80 + method: 'get'
  81 + })
  82 +}
  83 +
  84 +// 更新个人信息
  85 +export const updatePersonInfo = (data: personData) => {
  86 + return https({
  87 + url: '/system/person',
  88 + method: 'put',
  89 + data
  90 + })
  91 +}
  92 +
  93 +export interface emailType {
  94 + code: number
  95 + msg: string
  96 + data: string
  97 +}
  98 +
  99 +// 获取邮箱验证码
  100 +export const getEmailCode = (email: string) => {
  101 + return https<emailType>({
  102 + url: '/system/forgetPwd/registValidEmail',
  103 + method: 'post',
  104 + data: email
  105 + })
  106 +}
  107 +
  108 +
  109 +export interface certificateParams {
  110 + pageNum: number
  111 + pageSize: number
  112 + personId?: number
  113 + companyId?: number
  114 +}
  115 +
  116 +// 获取个人证书信息
  117 +export const getPersonalCertificate = (data: certificateParams) => {
  118 + return https<personCertificateTest>({
  119 + url: '/system/personalCertificate/list',
  120 + method: 'get',
  121 + params: data
  122 + })
  123 +}
  124 +
  125 +// 修改个人证书信息
  126 +export const updatePersonalCertificate = (data: personCertificateRow) => {
  127 + return https({
  128 + url: '/system/personalCertificate',
  129 + method: 'put',
  130 + data
  131 + })
  132 +}
  133 +
  134 +// 添加个人证书信息
  135 +export const addPersonalCertificate = (data: personCertificateRow) => {
  136 + return https({
  137 + url: '/system/personalCertificate',
  138 + method: 'post',
  139 + data
  140 + })
  141 +}
  142 +
  143 +
  144 +// 获取证书列表
  145 +export const getCertificateList = (data: certificateParams) => {
  146 + return https<CertificateTest>({
  147 + url: '/system/certificate/list',
  148 + method: 'get',
  149 + params: data
  150 + })
  151 +}
  152 +
  153 +// 获取公司余额信息
  154 +export const getCompanyWallet = (data: certificateParams) => {
  155 + return https<companyWalletTest>({
  156 + url: '/system/wallet/list',
  157 + method: 'get',
  158 + params: data
  159 + })
  160 +}
  161 +
  162 +// 用户修改密码
  163 +export const updatePassword = (oldPassword: string, newPassword: string) => {
  164 + return https<companyWalletTest>({
  165 + url: '/system/user/profile/updatePwd',
  166 + method: 'put',
  167 + params: {
  168 + oldPassword,
  169 + newPassword
  170 + }
  171 + })
  172 +}
  173 +
  174 +// 用户重置密码
  175 +export const resetPassword = (data: formType) => {
  176 + return https({
  177 + url: '/system/forgetPwd/resetPwd',
  178 + method: 'post',
  179 + data
  180 + })
  181 +}
  182 +
  183 +// 获取公司开票信息
  184 +export const getHeaderInfo = (data: QueryParams) => {
  185 + return https<headerTest>({
  186 + url: '/system/header/list',
  187 + method: 'get',
  188 + params: data
  189 + })
  190 +}
  191 +
  192 +// 修改新增开票信息
  193 +export const addHeaderInfo = (data: headerRow) => {
  194 + return https({
  195 + url: '/system/header',
  196 + method: 'post',
  197 + data
  198 + })
  199 +}
  200 +
  201 +// 修改开票信息
  202 +export const updateHeaderInfo = (data: headerRow) => {
  203 + return https({
  204 + url: '/system/header',
  205 + method: 'put',
  206 + data
  207 + })
  208 +}
  209 +
  210 +// 获取充值套餐
  211 +export const getComboList = (data: QueryParams) => {
  212 + return https<comBoTest>({
  213 + url: '/system/combo/list',
  214 + method: 'get',
  215 + params: data
  216 + })
  217 +}
  218 +
  219 +export interface beanType {
  220 + code: number
  221 + msg: string
  222 +}
  223 +
  224 +// 获取报告豆比例
  225 +export const getBean = () => {
  226 + return https<beanType>({
  227 + url: '/system/config/configKey/bean.config.proportion',
  228 + method: 'get',
  229 + })
  230 +}
  231 +
  232 +// 获取是否可以上传云存储
  233 +export const getCloudDown = () => {
  234 + return https<beanType>({
  235 + url: '/system/config/configKey/permission.uploadVedio',
  236 + method: 'get',
  237 + })
  238 +}
  239 +
  240 +// 获取是否收费
  241 +export const getPay = () => {
  242 + return https<beanType>({
  243 + url: '/system/config/configKey/permission.charge',
  244 + method: 'get',
  245 + })
  246 +}
  247 +
  248 +export interface queryUserNameType {
  249 + code: number
  250 + msg: string
  251 + data: number
  252 +}
  253 +
  254 +// 检查用户名是否被使用
  255 +export const queryUsername = (userName: string) => {
  256 + return https<queryUserNameType>({
  257 + url: '/system/user/checkUserName',
  258 + method: 'get',
  259 + params: {
  260 + userName
  261 + }
  262 + })
  263 +}
  264 +
  265 +export interface queryIdNoType {
  266 + code: number
  267 + msg: string
  268 + row: [],
  269 + total: number
  270 +}
  271 +
  272 +// 检查身份证号是否被使用
  273 +export const queryIdNo = (idNo: string) => {
  274 + return https<queryIdNoType>({
  275 + url: '/system/person/list',
  276 + method: 'get',
  277 + params: {
  278 + pageNum: 1,
  279 + pageSize: 1,
  280 + idNo
  281 + }
  282 + })
  283 +}
  284 +
  285 +// 注册个人用户
  286 +export const userRegister = (data: personData) => {
  287 + return https({
  288 + url: '/system/person/register',
  289 + method: 'post',
  290 + data
  291 + })
  292 +}
  293 +
  294 +// 注册企业用户
  295 +export const companyRegister = (data: companyData) => {
  296 + return https({
  297 + url: '/system/company/register',
  298 + method: 'post',
  299 + data
  300 + })
  301 +}
  302 +
  303 +// 公司新增员工
  304 +export const companyAdd = (data: addType) => {
  305 + return https<beanType>({
  306 + url: '/system/companyPerson',
  307 + method: 'post',
  308 + data
  309 + })
  310 +}
  311 +
  1 +export interface requestType {
  2 + msg: string,
  3 + code: number
  4 +}
  5 +// 登录成功参数类型
  6 +export interface loginType extends requestType {
  7 + token: string
  8 +}
  9 +
  10 +export interface userForm {
  11 + username: string,
  12 + password: string,
  13 + rememberMe?: boolean
  14 +}
  15 +// 用户个人信息参数类型
  16 +export interface personTest extends requestType {
  17 + data: personData;
  18 +}
  19 +
  20 +export interface personData {
  21 + createBy?: string;
  22 + createTime?: string;
  23 + updateBy?: string;
  24 + updateTime?: string;
  25 + remark?: string;
  26 + personId: number;
  27 + personName: string;
  28 + email: string;
  29 + gender: string;
  30 + birthDate: string;
  31 + idNo: string;
  32 + phone: string;
  33 + personalImg: string;
  34 + idImgFront: string;
  35 + idImgBack: string;
  36 + address: string;
  37 + userId: number;
  38 + username: string;
  39 + state: string;
  40 + companyId: number;
  41 + code?: string
  42 + password?: string
  43 +}
  44 +
  45 +// 公司个人信息类型
  46 +
  47 +export interface companyTest {
  48 + msg: string;
  49 + code: number;
  50 + data: companyData;
  51 +}
  52 +
  53 +export interface companyData {
  54 + createBy?: null;
  55 + createTime?: null;
  56 + updateBy?: null;
  57 + updateTime?: string;
  58 + remark?: null;
  59 + companyId: number;
  60 + companyName: string;
  61 + province: string;
  62 + city: string;
  63 + county: string;
  64 + address: string;
  65 + legalPerson?: null;
  66 + lpTel?: null;
  67 + linkMan: string;
  68 + lmTel: string;
  69 + companyTel: null;
  70 + fax?: null;
  71 + postCode: null;
  72 + email: string;
  73 + website?: null;
  74 + floorage?: number;
  75 + siteVoucher?: string;
  76 + businessLicenseNo: string;
  77 + businessStartTime: null;
  78 + businessEndTime: null;
  79 + businessLicensePic: string;
  80 + businessScope?: null;
  81 + peopleNum?: number;
  82 + companyIntroduce?: null;
  83 + registeredCapital?: null;
  84 + compangyPic: string;
  85 + memo?: null;
  86 + state?: string;
  87 + companyType?: string;
  88 + isShow?: null;
  89 + isValidVedio?: null;
  90 + userId: number;
  91 + username: string;
  92 + level: null;
  93 + regionCode: null;
  94 + levelModifyDate: null;
  95 + endTime: string;
  96 + password?: string
  97 +}
  98 +
  99 +
  100 +
  101 +// 个人证书信息
  102 +
  103 +export interface personCertificateTest {
  104 + total: number;
  105 + rows: personCertificateRow[];
  106 + code: number;
  107 + msg: string;
  108 +}
  109 +
  110 +export interface personCertificateRow {
  111 + createBy?: null;
  112 + createTime?: null;
  113 + updateBy?: null;
  114 + updateTime?: null;
  115 + remark?: string | null;
  116 + relateId?: number;
  117 + certificateName: string;
  118 + certificateLevel: string;
  119 + personId?: number;
  120 + personName?: string;
  121 + certificateId?: number;
  122 + certificateNo?: string;
  123 + validStartTime?: null;
  124 + validEndTime?: null;
  125 + issueDate?: string;
  126 + certificateImg?: string;
  127 + memo?: null;
  128 + state?: string;
  129 +}
  130 +
  131 +// 证书列表
  132 +
  133 +export interface CertificateTest {
  134 + total: number;
  135 + rows: CertificateRow[];
  136 + code: number;
  137 + msg: string;
  138 +}
  139 +
  140 +export interface CertificateRow {
  141 + createBy: null;
  142 + createTime: null;
  143 + updateBy: null;
  144 + updateTime: null;
  145 + remark: null;
  146 + certificateId: number;
  147 + certificateType: string;
  148 + certificateName: string;
  149 + certificateLevel: string;
  150 +}
  151 +
  152 +// 公司余额斗列表
  153 +
  154 +export interface companyWalletTest {
  155 + total: number;
  156 + rows: companyWalletRow[];
  157 + code: number;
  158 + msg: string;
  159 +}
  160 +
  161 +export interface companyWalletRow {
  162 + createBy: null;
  163 + createTime: null;
  164 + updateBy: null;
  165 + updateTime: null;
  166 + remark: null;
  167 + walletId: number;
  168 + companyId: number;
  169 + bean: number
  170 +}
  171 +
  172 +
  173 +// 账号信息类型
  174 +export interface InfoTest {
  175 + msg: string;
  176 + code: number;
  177 + permissions: string[];
  178 + roles: string[];
  179 + user: InfoUser;
  180 +}
  181 +export interface InfoUser {
  182 + createBy: string;
  183 + createTime: string;
  184 + updateBy: null;
  185 + updateTime: null;
  186 + remark: null;
  187 + userId: number;
  188 + deptId: null;
  189 + userName: string;
  190 + nickName: string;
  191 + email: string;
  192 + phonenumber: string;
  193 + sex: string;
  194 + avatar: string;
  195 + password: string;
  196 + status: string;
  197 + delFlag: string;
  198 + loginIp: string;
  199 + loginDate: string;
  200 + dept: null;
  201 + roles: InfoRole[];
  202 + roleIds: null;
  203 + postIds: null;
  204 + roleId: null;
  205 + openId: string;
  206 + admin: boolean;
  207 +}
  208 +
  209 +export interface InfoRole {
  210 + createBy: null;
  211 + createTime: null;
  212 + updateBy: null;
  213 + updateTime: null;
  214 + remark: null;
  215 + roleId: number;
  216 + roleName: string;
  217 + roleKey: string;
  218 + roleSort: number;
  219 + dataScope: string;
  220 + menuCheckStrictly: boolean;
  221 + deptCheckStrictly: boolean;
  222 + status: string;
  223 + delFlag: null;
  224 + flag: boolean;
  225 + menuIds: null;
  226 + deptIds: null;
  227 + permissions: string[];
  228 + admin: boolean;
  229 +}
  230 +
  231 +
  232 +// 开票信息类型
  233 +
  234 +export interface headerTest {
  235 + total: number;
  236 + rows: headerRow[];
  237 + code: number;
  238 + msg: string;
  239 +}
  240 +
  241 +export interface headerRow {
  242 + headerId?: number;
  243 + account: string;
  244 + bank: string;
  245 + address: string;
  246 + phone: string;
  247 + companyId: string;
  248 + companyName: string;
  249 + businessLicenseNo: string;
  250 +}
  251 +
  252 +// 套餐类型
  253 +export interface comBoTest {
  254 + total: number;
  255 + rows: comBoRow[];
  256 + code: number;
  257 + msg: string;
  258 +}
  259 +
  260 +export interface comBoRow {
  261 + createBy: null;
  262 + createTime: null;
  263 + updateBy: null;
  264 + updateTime: null;
  265 + remark: null;
  266 + comboId: number;
  267 + comboName: string;
  268 + comboPrice: number;
  269 + bean: number;
  270 + comboOrder: number;
  271 + state: string;
  272 +}
  273 +
  274 +// 重置密码参数
  275 +export interface formType {
  276 + againPassword: string
  277 + code: string
  278 + email: string
  279 + password: string
  280 + type: number
  281 + username?: string
  282 +}
  283 +
  284 +// 新增员工参数
  285 +export interface addType {
  286 + idNo: string,
  287 + personName: string,
  288 + relateId?: null
  289 +}
  1 +import { useCascadeAreaData } from '../utils/getArea'
  2 +
  3 +@Component
  4 +export default struct AreaPicker {
  5 + @State cascade: TextCascadePickerRangeContent[] = useCascadeAreaData() //省市区列表数据
  6 + @Link value: string[] //选中值例如:['北京市','北京市','东城区']
  7 + private onChange: (value: string[], index: number[]) => void = () => {
  8 + } //选择改变回调函数
  9 +
  10 + build() {
  11 + TextPicker({ range: this.cascade, value: this.value })
  12 + .canLoop(false)
  13 + .textStyle({
  14 + font: {
  15 + size: '14fp'
  16 + }
  17 + })
  18 + .selectedTextStyle({
  19 + font: {
  20 + size: '16fp'
  21 + }
  22 + })
  23 + .onChange((value: string | string[], index: number | number[]) => {
  24 + this.onChange(value as string[], index as number[])
  25 + this.value = value as string[]
  26 + })
  27 +
  28 + }
  29 +}
  1 +import { router } from '@kit.ArkUI'
  2 +import { AxiosResponse } from '@ohos/axios'
  3 +import { getNoticeList, noticeTest, noticeParams, noticeRow } from '../api/notice'
  4 +import { getCompanyPersonList } from '../api/originalRecords'
  5 +import { companyPersonTest, companyPersonRow } from '../api/recordsType'
  6 +import preferencesUtils from '../utils/preferences'
  7 +import baseUrl from '../utils/baseUrl'
  8 +@Component
  9 +export default struct HomePage {
  10 + @State searchValue: string = ''
  11 + @State params: noticeParams = {
  12 + pageNum: 1,
  13 + pageSize: 10
  14 + }
  15 + @State noticeList: noticeRow[] = []
  16 + @State noticeTitleList: string[] = []
  17 + @State personList: companyPersonRow[] = []
  18 + roleName = preferencesUtils.get('XF_ROLE_NAME', '')
  19 + async aboutToAppear() {
  20 + getNoticeList(this.params).then((res: AxiosResponse<noticeTest>) => {
  21 + this.noticeList = res.data.rows
  22 + this.noticeTitleList = res.data.rows.map((item: noticeRow) => item.noticeTitle)
  23 + })
  24 + if(this.roleName == 'company') {
  25 + let companyId = preferencesUtils.get('XF_COMPANY_ID', '')
  26 + const personRes: AxiosResponse<companyPersonTest> = await getCompanyPersonList({pageNum: 1, pageSize: 10, companyId: Number(companyId), state: '2' })
  27 + this.personList = personRes.data.rows
  28 + }
  29 + }
  30 + build() {
  31 + Scroll(){
  32 + Column(){
  33 + Search({value: $$this.searchValue, placeholder: '请输入原始记录名称'}).backgroundColor('#fff')
  34 + .searchButton('搜索')
  35 + .onSubmit((value) => {
  36 + router.pushUrl({
  37 + url: 'pages/MaintenanceRecords',
  38 + params: {
  39 + reportName: value
  40 + }
  41 + })
  42 + })
  43 + Column(){
  44 + Text('维保原始记录').fontSize(18).lineHeight(24).fontColor('#fff').fontWeight(600)
  45 + Text('查看所有维保记录').fontSize(10).lineHeight(13).fontColor('#CACBFD').margin({bottom: 18, top: 2})
  46 + Row(){
  47 + Text('立即查看').fontSize(12).fontColor('#36278D').lineHeight(16)
  48 + Image($r('app.media.right_1')).width(16).margin({left: 5})
  49 + }.width(80).height(20).backgroundColor(Color.White).borderRadius(10).justifyContent(FlexAlign.Center)
  50 + }.width('100%').height(100).backgroundImage($r('app.media.bg_1'))
  51 + .backgroundImageSize({width: '100%', height: 100}).margin({top: 15}).alignItems(HorizontalAlign.Start)
  52 + .padding({top: 10, left: 20}).onClick(() => {
  53 + router.pushUrl({
  54 + url: 'pages/MaintenanceRecords'
  55 + })
  56 + })
  57 + Column(){
  58 + Text('操作手册').fontSize(18).lineHeight(24).fontColor('#fff').fontWeight(600)
  59 + Text('查看APP操作手册').fontSize(10).lineHeight(13).fontColor('#B5E9E6').margin({bottom: 18, top: 2})
  60 + Row(){
  61 + Text('立即查看').fontSize(12).fontColor('#1D8F90').lineHeight(16)
  62 + Image($r('app.media.right_2')).width(16).margin({left: 5})
  63 + }.width(80).height(20).backgroundColor(Color.White).borderRadius(10).justifyContent(FlexAlign.Center)
  64 + }.width('100%').height(100).backgroundImage($r('app.media.bg_2'))
  65 + .backgroundImageSize({width: '100%', height: 100}).margin({top: 15}).alignItems(HorizontalAlign.Start)
  66 + .padding({top: 10, left: 20}).onClick(() => {
  67 + router.pushUrl({
  68 + url: 'pages/OperationManual'
  69 + })
  70 + })
  71 + // 通知栏
  72 + Row(){
  73 + Row(){
  74 + Image($r('app.media.notice')).width(16).margin({right: 5})
  75 + Text('公告').fontSize(13).fontColor('3d3d3d')
  76 + }.width(75).backgroundColor('#F0FAFF').height(30).borderRadius(15).justifyContent(FlexAlign.Center)
  77 + Text(this.noticeTitleList.join(' '))
  78 + .fontColor('#3d3d3d').fontSize(12).layoutWeight(1).textOverflow({overflow: TextOverflow.MARQUEE})
  79 + }.width('100%').height(30).backgroundColor('#fff').borderRadius(15).margin({top: 15})
  80 +
  81 + // 企业人员
  82 + Column(){
  83 + Row(){
  84 + Row(){
  85 + Text().width(4).height(20).backgroundColor('#6D9DFF').margin({right: 10})
  86 + Text('企业人员').fontSize(16).lineHeight(21).fontColor('#3d3d3d').fontWeight(600)
  87 + }
  88 + Row(){
  89 + Text('更多').fontSize(12).fontColor('#999').margin({right: 3})
  90 + Image($r('app.media.two_right')).width('12')
  91 + }.onClick(() => {
  92 + router.pushUrl({
  93 + url: 'pages/PersonList'
  94 + })
  95 + })
  96 + }.justifyContent(FlexAlign.SpaceBetween).width('100%')
  97 +
  98 + Column(){
  99 + ForEach(this.personList, (item: companyPersonRow, index: number) => {
  100 + Row(){
  101 + Row({space: 10}){
  102 + Image(baseUrl + item.personalImg).width(60).height(60).borderRadius(10)
  103 + Column(){
  104 + Text(item.personName).fontSize(14).fontWeight(600).lineHeight(19).margin({bottom: 5})
  105 + .fontColor('#3d3d3d').textOverflow({overflow: TextOverflow.Ellipsis}).maxLines(1)
  106 + Text(item.createTime).fontColor('#999').fontSize(12).lineHeight(16)
  107 + }.alignItems(HorizontalAlign.Start)
  108 + }.layoutWeight(1)
  109 + Image($r('app.media.right_3')).width(12)
  110 + }.width('100%').justifyContent(FlexAlign.SpaceBetween)
  111 + .border({width: {bottom: this.personList.length == index + 1 ? 0 : 1}, color: '#eee'}).padding({top: 15, bottom: 15})
  112 + .onClick(() => {
  113 + router.pushUrl({
  114 + url: 'pages/PersonDetail',
  115 + params: {
  116 + personId: item.personId
  117 + }
  118 + })
  119 + })
  120 + })
  121 + }.margin({top: 15})
  122 +
  123 + }.width('100%').padding(15).borderRadius(10).backgroundColor('#fff').margin({top: 15})
  124 + .visibility(this.roleName == 'company' ? Visibility.Visible : Visibility.None)
  125 +
  126 + // 通知公告
  127 + Column(){
  128 + Row(){
  129 + Row(){
  130 + Text().width(4).height(20).backgroundColor('#6D9DFF').margin({right: 10})
  131 + Text('通知公告').fontSize(16).lineHeight(21).fontColor('#3d3d3d').fontWeight(600)
  132 + }
  133 + Row(){
  134 + Text('更多').fontSize(12).fontColor('#999').margin({right: 3})
  135 + Image($r('app.media.two_right')).width('12')
  136 + }.onClick(() => {
  137 + router.pushUrl({
  138 + url: 'pages/NoticeList'
  139 + })
  140 + })
  141 + }.justifyContent(FlexAlign.SpaceBetween).width('100%')
  142 +
  143 + Column(){
  144 + ForEach(this.noticeList, (item: noticeRow, index: number) => {
  145 + Row(){
  146 + Column(){
  147 + Text(item.noticeTitle).fontSize(14).fontWeight(600).lineHeight(19).margin({bottom: 5})
  148 + .fontColor('#3d3d3d').textOverflow({overflow: TextOverflow.Ellipsis}).maxLines(1)
  149 + Text(item.createTime).fontColor('#999').fontSize(12).lineHeight(16)
  150 + }.alignItems(HorizontalAlign.Start).layoutWeight(1)
  151 + Image($r('app.media.right_3')).width(12)
  152 + }.width('100%').justifyContent(FlexAlign.SpaceBetween)
  153 + .border({width: {bottom: this.noticeList.length == index + 1 ? 0 : 1}, color: '#eee'}).padding({top: 15, bottom: 15})
  154 + .onClick(() => {
  155 + router.pushUrl({
  156 + url: 'pages/NoticeDetail',
  157 + params: {
  158 + id: item.noticeId
  159 + }
  160 + })
  161 + })
  162 + })
  163 + }.margin({top: 15})
  164 +
  165 + }.width('100%').padding(15).borderRadius(10).backgroundColor('#fff').margin({top: 15})
  166 +
  167 + }.width('100%')
  168 + .padding({left: 15, right: 15, bottom: 30})
  169 + }.height('100%').scrollBar(BarState.Off).linearGradient({colors: [['#E1EEFF', 0], ['#F2F3F7', 0.3]]})
  170 + }
  171 +}
  1 +@Component
  2 +struct InputVerify{
  3 + @Link textValue: string
  4 + @Prop errorInfo: string
  5 + build() {
  6 + Row(){
  7 + Row(){
  8 + Image($r('app.media.require')).width(20)
  9 + Text('姓名')
  10 + }.width(80)
  11 + TextInput({placeholder: '请输入姓名', text: this.textValue})
  12 + .backgroundColor('#fff').layoutWeight(1)
  13 + .showError(this.errorInfo).onChange(() => {
  14 + if(this.textValue.length == 0) {
  15 + this.errorInfo = '此处不能为空'
  16 + } else {
  17 +
  18 + }
  19 + })
  20 + }.border({width: {bottom: 1}, color: '#eee'})
  21 + }
  22 +}
  1 +import { router } from '@kit.ArkUI'
  2 +import preferencesUtil from '../utils/preferences'
  3 +import loginOut from '../utils/loginOut'
  4 +import { personData, personCertificateRow, companyWalletTest, companyWalletRow, companyData } from '../api/userType'
  5 +import baseUrl from '../utils/baseUrl'
  6 +import { getCompanyPersonList } from '../api/originalRecords'
  7 +import { companyPersonTest, companyPersonRow } from '../api/recordsType'
  8 +import { getCompanyWallet, updateState } from '../api/user'
  9 +import { AxiosResponse } from '@ohos/axios'
  10 +import { promptAction } from '@kit.ArkUI'
  11 +import LoadingDialog from '../dialog/LoadingDialog'
  12 +import updatePasswordDialog from '../dialog/updatePasswordDialog'
  13 +@Extend(Text)
  14 +function textExtend() {
  15 + .fontSize(14).lineHeight(19).fontColor('#3d3d3d')
  16 +}
  17 +
  18 +@Extend(Text)
  19 +function textRight() {
  20 + .fontSize(14).lineHeight(19).fontColor('#999')
  21 +}
  22 +
  23 +let getTextInfo = (state: string | null) => {
  24 + if(state == '0') {
  25 + return '已离职'
  26 + } else if(state == '1') {
  27 + return '确认从业'
  28 + } else if(state == '2') {
  29 + return '确认离职'
  30 + } else {
  31 + return ''
  32 + }
  33 +}
  34 +
  35 +@Component
  36 +export default struct MainPage {
  37 + dialogController: CustomDialogController = new CustomDialogController({
  38 + builder: updatePasswordDialog(),
  39 + cornerRadius: 10
  40 + })
  41 + loadingController: CustomDialogController = new CustomDialogController({
  42 + builder: LoadingDialog(),
  43 + customStyle: true,
  44 + offset: { dx: 0, dy: 0 },
  45 + alignment: DialogAlignment.Center,
  46 + autoCancel: false
  47 + })
  48 + @Link userInfo: personData
  49 + @Link companyInfo: companyData
  50 + @Link personCertificateInfo: personCertificateRow
  51 + @State walletData: companyWalletRow | null = null
  52 + @State companyData: companyPersonRow | null = null
  53 + @Link isEdit: boolean
  54 + roleName = preferencesUtil.get('XF_ROLE_NAME', '')
  55 + async aboutToAppear() {
  56 + let personId = preferencesUtil.get('XF_PERSON_ID', 0)
  57 + let companyId = preferencesUtil.get('XF_COMPANY_ID', 0)
  58 + if(this.roleName == 'person' && preferencesUtil.get('XF_PERSON_INFO', '')) {
  59 + this.userInfo = JSON.parse(preferencesUtil.get('XF_PERSON_INFO', '') as string)
  60 + }
  61 + if(this.roleName == 'person' || this.roleName == 'unapprovedPerson') {
  62 + // 获取公司人员个人信息
  63 + const companyInfo: AxiosResponse<companyPersonTest> = await getCompanyPersonList({pageNum: 1, pageSize: 10, personId: Number(personId)})
  64 + this.companyData = companyInfo.data.rows[0]
  65 + }
  66 + // 获取公司钱包信息
  67 + const walletInfo: AxiosResponse<companyWalletTest> = await getCompanyWallet({pageNum: 1, pageSize: 10, companyId: Number(companyId)})
  68 + this.walletData = walletInfo.data.rows[0]
  69 +
  70 + }
  71 + build() {
  72 + Stack(){
  73 + Column(){
  74 + Row(){
  75 + Image((baseUrl + this.userInfo?.personalImg) || $r('app.media.userAvatar')).width(80).height(80).borderRadius(40).margin({right: 10})
  76 + Text(this.userInfo?.personName).fontSize(16).lineHeight(21).fontWeight(600).fontColor('#fff')
  77 + }.width('100%').padding({left: 15,right: 15}).margin({top: 44})
  78 + .visibility(this.roleName == 'person' || this.roleName == 'unapprovedPerson' ? Visibility.Visible: Visibility.None)
  79 + Row(){
  80 + Row(){
  81 + Image((baseUrl + this.companyInfo?.businessLicensePic) || $r('app.media.userAvatar')).width(60).height(60).borderRadius(30).margin({right: 10})
  82 + Text(this.companyInfo?.companyName).fontSize(14).lineHeight(21).fontWeight(600).fontColor('#fff')
  83 + }.layoutWeight(1).justifyContent(FlexAlign.Start)
  84 + Column({space: 4}){
  85 + Image($r('app.media.wallet')).width(30)
  86 + Text(this.walletData?.bean.toString() + '(豆)').fontSize(12).fontColor('#fff')
  87 + }.width(80).onClick(() => {
  88 + router.pushUrl({
  89 + url: "pages/MyWallet"
  90 + })
  91 + })
  92 + }.width('100%').padding({left: 10,right: 10}).margin({top: 44})
  93 + .visibility(this.roleName == 'company' ? Visibility.Visible: Visibility.None)
  94 + }.width('100%').height(256).padding({left: 15,right: 15})
  95 + .linearGradient({angle: 63 ,colors: [['#1B65FD', 0], ['#6D9DFF', 0.5]]})
  96 + List(){
  97 + // 公司基本信息
  98 + ListItem(){
  99 + Column(){
  100 + Row(){
  101 + Text('基本信息').fontWeight(600).textExtend()
  102 + Row(){
  103 + Text('编辑').fontSize(12).fontColor('#999')
  104 + Image($r('app.media.right_4')).width(12).margin({left: 4})
  105 + }.onClick(() => {
  106 + router.pushUrl({
  107 + url: 'pages/EditCompanyInfo'
  108 + })
  109 + })
  110 + }.padding(10).border({width: {bottom: 2}, color: '#eee'})
  111 + .justifyContent(FlexAlign.SpaceBetween).width('100%')
  112 + Column(){
  113 + Row(){
  114 + Row(){
  115 + Image($r('app.media.username')).width(16).margin({right: 5})
  116 + Text('用户名').textExtend()
  117 + }
  118 + Text(this.companyInfo?.username).textRight()
  119 + }.width('100%').justifyContent(FlexAlign.SpaceBetween)
  120 + .border({width: {bottom: 1}, color: '#eee'})
  121 + .padding({top: 15, bottom: 15})
  122 + Row(){
  123 + Row(){
  124 + Image($r('app.media.enterprise')).width(16).margin({right: 5})
  125 + Text('企业名称').textExtend()
  126 + }
  127 + Text(this.companyInfo?.companyName).textRight()
  128 + }.width('100%').justifyContent(FlexAlign.SpaceBetween)
  129 + .border({width: {bottom: 1}, color: '#eee'})
  130 + .padding({top: 15, bottom: 15})
  131 + Row(){
  132 + Row(){
  133 + Image($r('app.media.business_license')).width(16).margin({right: 5})
  134 + Text('营业执照编号').textExtend()
  135 + }
  136 + Text(this.companyInfo?.businessLicenseNo).textRight()
  137 + }.width('100%').justifyContent(FlexAlign.SpaceBetween)
  138 + .border({width: {bottom: 1}, color: '#eee'})
  139 + .padding({top: 15, bottom: 15})
  140 + Row(){
  141 + Row(){
  142 + Image($r('app.media.idcard')).width(16).margin({right: 5})
  143 + Text('联系人').textExtend()
  144 + }
  145 + Text(this.companyInfo?.linkMan).textRight()
  146 + }.width('100%').justifyContent(FlexAlign.SpaceBetween)
  147 + .border({width: {bottom: 1}, color: '#eee'})
  148 + .padding({top: 15, bottom: 15})
  149 + Row(){
  150 + Row(){
  151 + Image($r('app.media.phone')).width(16).margin({right: 5})
  152 + Text('联系人手机号').textExtend()
  153 + }
  154 + Text(this.companyInfo?.lmTel).textRight()
  155 + }.width('100%').justifyContent(FlexAlign.SpaceBetween)
  156 + .border({width: {bottom: 1}, color: '#eee'})
  157 + .padding({top: 15, bottom: 15})
  158 + Row(){
  159 + Row(){
  160 + Image($r('app.media.email')).width(16).margin({right: 5})
  161 + Text('电子邮箱').textExtend()
  162 + }
  163 + Text(this.companyInfo?.email).textRight()
  164 + }.width('100%').justifyContent(FlexAlign.SpaceBetween)
  165 + .padding({top: 15, bottom: 15})
  166 + .border({width: {bottom: 1}, color: '#eee'})
  167 + }.padding({left: 10, right: 10})
  168 + }.width('100%').backgroundColor('#fff').borderRadius(10).clip(true)
  169 + }.visibility(this.roleName == 'company' ? Visibility.Visible: Visibility.None).margin({bottom: 10})
  170 + // 个人基本信息
  171 + ListItem(){
  172 + Column(){
  173 + Row(){
  174 + Text('基本信息').fontWeight(600).textExtend()
  175 + Row(){
  176 + Text('编辑').fontSize(12).fontColor('#999')
  177 + Image($r('app.media.right_4')).width(12).margin({left: 4})
  178 + }.onClick(() => {
  179 + router.pushUrl({
  180 + url: 'pages/EditUser'
  181 + })
  182 + })
  183 + }.padding(10).border({width: {bottom: 2}, color: '#eee'})
  184 + .justifyContent(FlexAlign.SpaceBetween).width('100%')
  185 + Column(){
  186 + Row(){
  187 + Row(){
  188 + Image($r('app.media.username')).width(16).margin({right: 5})
  189 + Text('用户名').textExtend()
  190 + }
  191 + Text(this.userInfo?.username).textRight()
  192 + }.width('100%').justifyContent(FlexAlign.SpaceBetween)
  193 + .border({width: {bottom: 1}, color: '#eee'})
  194 + .padding({top: 15, bottom: 15})
  195 + Row(){
  196 + Row(){
  197 + Image($r('app.media.idcard')).width(16).margin({right: 5})
  198 + Text('身份证号').textExtend()
  199 + }
  200 + Text(this.userInfo?.idNo).textRight()
  201 + }.width('100%').justifyContent(FlexAlign.SpaceBetween)
  202 + .border({width: {bottom: 1}, color: '#eee'})
  203 + .padding({top: 15, bottom: 15})
  204 + Row(){
  205 + Row(){
  206 + Image($r('app.media.sex')).width(16).margin({right: 5})
  207 + Text('性别').textExtend()
  208 + }
  209 + Text(this.userInfo?.gender == '0' ? '男' : '女').textRight()
  210 + }.width('100%').justifyContent(FlexAlign.SpaceBetween)
  211 + .border({width: {bottom: 1}, color: '#eee'})
  212 + .padding({top: 15, bottom: 15})
  213 + Row(){
  214 + Row(){
  215 + Image($r('app.media.phone')).width(16).margin({right: 5})
  216 + Text('手机号码').textExtend()
  217 + }
  218 + Text(this.userInfo?.phone).textRight()
  219 + }.width('100%').justifyContent(FlexAlign.SpaceBetween)
  220 + .border({width: {bottom: 1}, color: '#eee'})
  221 + .padding({top: 15, bottom: 15})
  222 + Row(){
  223 + Row(){
  224 + Image($r('app.media.email')).width(16).margin({right: 5})
  225 + Text('电子邮箱').textExtend()
  226 + }
  227 + Text(this.userInfo?.email).textRight()
  228 + }.width('100%').justifyContent(FlexAlign.SpaceBetween)
  229 + .padding({top: 15, bottom: 15})
  230 + .border({width: {bottom: 1}, color: '#eee'})
  231 + Row(){
  232 + Row(){
  233 + Image($r('app.media.brithday')).width(16).margin({right: 5})
  234 + Text('出生日期').textExtend()
  235 + }
  236 + Text(this.userInfo?.birthDate).textRight()
  237 + }.width('100%').justifyContent(FlexAlign.SpaceBetween)
  238 + .padding({top: 15, bottom: 15})
  239 + }.padding({left: 10, right: 10})
  240 + }.width('100%').backgroundColor('#fff').borderRadius(10).clip(true)
  241 + }.visibility(this.roleName == 'person' || this.roleName == 'unapprovedPerson' ? Visibility.Visible: Visibility.None).margin({bottom: 10})
  242 + // 证书信息
  243 + ListItem(){
  244 + Column(){
  245 + Row(){
  246 + Row({ space: 5 }){
  247 + Text('证书信息').fontWeight(600).textExtend()
  248 + }
  249 + Row(){
  250 + Text(this.isEdit ? '编辑' : '添加').fontSize(12).fontColor('#999')
  251 + Image($r('app.media.right_4')).width(12).margin({left: 4})
  252 + }.onClick(() => {
  253 + router.pushUrl({
  254 + url: 'pages/CertificateInfo'
  255 + })
  256 + })
  257 + }.padding(10).border({width: {bottom: 2}, color: '#eee'})
  258 + .justifyContent(FlexAlign.SpaceBetween).width('100%')
  259 + Column(){
  260 + Row(){
  261 + Row(){
  262 + Image($r('app.media.certificate_type')).width(16).margin({right: 5})
  263 + Text('证书类型').textExtend()
  264 + }
  265 + Text(`${this.personCertificateInfo?.certificateLevel}${this.personCertificateInfo?.certificateName}`).textRight()
  266 + }.width('100%').justifyContent(FlexAlign.SpaceBetween)
  267 + .border({width: {bottom: 1}, color: '#eee'})
  268 + .padding({top: 15, bottom: 15})
  269 + Row(){
  270 + Row(){
  271 + Image($r('app.media.certificate_num')).width(16).margin({right: 5})
  272 + Text('证书编号').textExtend()
  273 + }
  274 + Text(this.personCertificateInfo?.certificateNo).textRight()
  275 + }.width('100%').justifyContent(FlexAlign.SpaceBetween)
  276 + .border({width: {bottom: 1}, color: '#eee'})
  277 + .padding({top: 15, bottom: 15})
  278 + Row(){
  279 + Row(){
  280 + Image($r('app.media.date')).width(16).margin({right: 5})
  281 + Text('颁发时间').textExtend()
  282 + }
  283 + Text(this.personCertificateInfo?.issueDate).textRight()
  284 + }.width('100%').justifyContent(FlexAlign.SpaceBetween)
  285 + .padding({top: 15, bottom: 15})
  286 + }.padding({left: 10, right: 10})
  287 + }.width('100%').backgroundColor('#fff').borderRadius(10).clip(true)
  288 + }.visibility(this.roleName == 'person' || this.roleName == 'unapprovedPerson' ? Visibility.Visible: Visibility.None).margin({bottom: 10})
  289 + // 从业信息
  290 + ListItem(){
  291 + Column(){
  292 + Row(){
  293 + Text('从业信息').fontWeight(600).textExtend()
  294 + Image($r('app.media.refresh')).width(12)
  295 + .onClick(async () => {
  296 + this.loadingController.open()
  297 + let personId = preferencesUtil.get('XF_PERSON_ID', 0)
  298 + const companyInfo: AxiosResponse<companyPersonTest> = await getCompanyPersonList({pageNum: 1, pageSize: 10, personId: Number(personId)})
  299 + if(companyInfo.data.rows.length > 0) {
  300 + this.companyData = companyInfo.data.rows[0]
  301 + }
  302 + this.loadingController.close()
  303 + })
  304 + }.padding(10).border({width: {bottom: 2}, color: '#eee'})
  305 + .justifyContent(FlexAlign.Start).width('100%')
  306 + Column(){
  307 + Row(){
  308 + Row(){
  309 + Image($r('app.media.enterprise')).width(16).margin({right: 5})
  310 + Text('所属公司').textExtend()
  311 + }
  312 + Text(this.companyData?.companyName).textRight()
  313 + }.width('100%').justifyContent(FlexAlign.SpaceBetween)
  314 + .border({width: {bottom: 1}, color: '#eee'})
  315 + .padding({top: 15, bottom: 15})
  316 + Row(){
  317 + Row(){
  318 + Image($r('app.media.certificate_num')).width(16).margin({right: 5})
  319 + Text('报告豆余额').textExtend()
  320 + }
  321 + Text(`${this.walletData?.bean}`).textRight()
  322 + }.width('100%').justifyContent(FlexAlign.SpaceBetween)
  323 + .border({width: {bottom: 1}, color: '#eee'})
  324 + .padding({top: 15, bottom: 15})
  325 + Row(){
  326 + Row(){
  327 + Image($r('app.media.date')).width(16).margin({right: 5})
  328 + Text('添加时间').textExtend()
  329 + }
  330 + Text(this.companyData?.createTime).textRight()
  331 + }.width('100%').justifyContent(FlexAlign.SpaceBetween)
  332 + .border({width: {bottom: 1}, color: '#eee'})
  333 + .padding({top: 15, bottom: 15})
  334 + }.padding({left: 10, right: 10})
  335 + Row(){
  336 + Row(){
  337 + Image($r('app.media.edit')).width(16).margin({right: 5})
  338 + Text('操作').textExtend()
  339 + }
  340 + Text(getTextInfo(this.companyData?.state || '0')).width(80).height(25)
  341 + .backgroundColor(this.companyData?.state == '1' ? '#1890ff' : '#C80000')
  342 + .fontSize(14).textAlign(TextAlign.Center).fontColor('#fff').borderRadius(8)
  343 + .visibility(this.companyData?.state == '0' ? Visibility.None : Visibility.Visible)
  344 + .onClick(() => {
  345 + AlertDialog.show({
  346 + title: '提示',
  347 + message: this.companyData?.state == '2' ? `是否从${this.companyData?.companyName}离职` : `是否在${this.companyData?.companyName}就职`,
  348 + alignment: DialogAlignment.Center,
  349 + primaryButton: {
  350 + value: '取消',
  351 + action: () => {
  352 + console.info('Callback when the first button is clicked')
  353 + }
  354 + },
  355 + secondaryButton: {
  356 + enabled: true,
  357 + defaultFocus: true,
  358 + style: DialogButtonStyle.HIGHLIGHT,
  359 + value: '确认',
  360 + action: async () => {
  361 + if(this.companyData?.state == '2') {
  362 + await updateState({ relateId: this.companyData?.relateId, state: '0' })
  363 + promptAction.showToast({
  364 + message: '已成功离职',
  365 + duration: 2000
  366 + })
  367 + await loginOut()
  368 + router.replaceUrl({
  369 + url: 'pages/Login'
  370 + })
  371 + }else {
  372 + await updateState({ relateId: this.companyData?.relateId, state: '2' })
  373 + promptAction.showToast({
  374 + message: '已恢复职位,请重新登录获取新数据',
  375 + duration: 2000
  376 + })
  377 + await loginOut()
  378 + router.replaceUrl({
  379 + url: 'pages/Login'
  380 + })
  381 + }
  382 + }
  383 + }
  384 + })
  385 + })
  386 + }.width('100%').justifyContent(FlexAlign.SpaceBetween)
  387 + .padding({top: 15, bottom: 15, left: 10, right: 10})
  388 + }.width('100%').backgroundColor('#fff').borderRadius(10).clip(true)
  389 + }.visibility(this.roleName == 'person' || this.roleName == 'unapprovedPerson' ? Visibility.Visible: Visibility.None).margin({bottom: 10})
  390 + // APP信息
  391 + ListItem(){
  392 + Column(){
  393 + Row(){
  394 + Text('APP信息').fontWeight(600).textExtend()
  395 + }.padding(10).border({width: {bottom: 2}, color: '#eee'})
  396 + .justifyContent(FlexAlign.SpaceBetween).width('100%')
  397 + Column(){
  398 + Row(){
  399 + Row(){
  400 + Image($r('app.media.user_agreement')).width(16).margin({right: 5})
  401 + Text('用户协议').textExtend()
  402 + }
  403 + Image($r('app.media.right_4')).width(12).margin({left: 4})
  404 + }.width('100%').justifyContent(FlexAlign.SpaceBetween)
  405 + .border({width: {bottom: 1}, color: '#eee'})
  406 + .padding({top: 15, bottom: 15}).onClick(() => {
  407 + router.pushUrl({
  408 + url: 'pages/UserAgreement'
  409 + })
  410 + })
  411 + Row(){
  412 + Row(){
  413 + Image($r('app.media.privacy')).width(16).margin({right: 5})
  414 + Text('隐私政策').textExtend()
  415 + }
  416 + Image($r('app.media.right_4')).width(12).margin({left: 4})
  417 + }.width('100%').justifyContent(FlexAlign.SpaceBetween)
  418 + .border({width: {bottom: 1}, color: '#eee'})
  419 + .padding({top: 15, bottom: 15}).onClick(() => {
  420 + router.pushUrl({
  421 + url: 'pages/PrivacyPolicy'
  422 + })
  423 + })
  424 + Row(){
  425 + Row(){
  426 + Image($r('app.media.delete')).width(16).margin({right: 5})
  427 + Text('注销协议').textExtend()
  428 + }
  429 + Image($r('app.media.right_4')).width(12).margin({left: 4})
  430 + }.width('100%').justifyContent(FlexAlign.SpaceBetween)
  431 + .padding({top: 15, bottom: 15}).onClick(() => {
  432 + router.pushUrl({
  433 + url: 'pages/CancellationAgreement'
  434 + })
  435 + })
  436 + }.padding({left: 10, right: 10})
  437 + }.width('100%').backgroundColor('#fff').borderRadius(10).clip(true)
  438 + }.margin({bottom: 10})
  439 + // 操作按钮
  440 + ListItem(){
  441 + Column({space: 10}){
  442 + Text('修改密码').width('100%').height(50).backgroundColor('#4ECDBE').borderRadius(10)
  443 + .fontSize(16).fontColor(Color.White).fontWeight(600).textAlign(TextAlign.Center)
  444 + .onClick(() => {
  445 + this.dialogController.open()
  446 + })
  447 + Text('退出登录').width('100%').height(50).backgroundColor('#6D9DFF').borderRadius(10)
  448 + .fontSize(16).fontColor(Color.White).fontWeight(600).textAlign(TextAlign.Center)
  449 + .onClick(() => {
  450 + AlertDialog.show({
  451 + title: '提示',
  452 + message: '是否退出登录?',
  453 + autoCancel: true,
  454 + alignment: DialogAlignment.Center,
  455 + gridCount: 4,
  456 + offset: { dx: 0, dy: -20 },
  457 + buttonDirection: DialogButtonDirection.HORIZONTAL,
  458 + buttons: [
  459 + {
  460 + value: '取消',
  461 + action: () => {
  462 + console.info('Callback when button1 is clicked')
  463 + }
  464 + },
  465 + {
  466 + value: '确认',
  467 + action: async () => {
  468 + await loginOut()
  469 + router.replaceUrl({
  470 + url: 'pages/Login'
  471 + })
  472 + }
  473 + }
  474 + ],
  475 + cancel: () => {
  476 + console.info('Closed callbacks')
  477 + }
  478 + })
  479 + })
  480 + Column(){
  481 + Text('http://xfapp.crgx.net').fontSize(10).fontColor('#999').lineHeight(18)
  482 + Text('非广西消防救援总队官方出品Copyright@广西世纪创软信息技术有限公司').fontSize(10).fontColor('#999').lineHeight(18)
  483 + .maxLines(2).textAlign(TextAlign.Center)
  484 + }
  485 + }
  486 + }
  487 + }.margin({left: 15, right: 15, top: 144}).borderRadius(10).scrollBar(BarState.Off).layoutWeight(1)
  488 + }.height('100%').backgroundColor('#f3f2f7').alignContent(Alignment.Top).padding({bottom: 20})
  489 + }
  490 +}
  1 +import { webview } from '@kit.ArkWeb'
  2 +import { HmParseHTML } from "@wuyan/html_parse"
  3 +import { InitProjectList, ItemList } from '../api/recordsType'
  4 +@Component
  5 +export default struct ProjectItem{
  6 + @Prop itemInfo: InitProjectList
  7 + webviewController: webview.WebviewController = new webview.WebviewController()
  8 + build() {
  9 + Column(){
  10 + // 头部详情
  11 + List({space: 10}){
  12 + ForEach(this.itemInfo.itemList, (item: ItemList) => {
  13 + ListItem(){
  14 + Column({space: 5}){
  15 + HmParseHTML({
  16 + htmlStr: item.itemName, // 富文本内容-必传
  17 + baseFontColor: '#000',
  18 + baseFontSize: 14
  19 + })
  20 + Column(){
  21 + Text('项目保养内容:').fontColor('#999').fontSize(12)
  22 + HmParseHTML({
  23 + htmlStr: item.maintainceContent, // 富文本内容-必传
  24 + baseFontColor: '#999',
  25 + baseFontSize: 12,
  26 + })
  27 + }.alignItems(HorizontalAlign.Start)
  28 + Row({space: 10}){
  29 + Text('部位').fontSize(14).fontWeight(700).fontColor('#000').width(100)
  30 + Text(item.position).layoutWeight(1).fontSize(12).fontColor('#999').textAlign(TextAlign.Start)
  31 + }.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
  32 + Row({space: 10}){
  33 + Text('抽查数量:').fontSize(14).fontWeight(700).fontColor('#000').width(100)
  34 + Text(item.num).layoutWeight(1).fontSize(12).fontColor('#999').textAlign(TextAlign.Start)
  35 + }.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
  36 + Row({space: 10}){
  37 + Text('抽查比例 (%):').fontSize(14).fontWeight(700).fontColor('#000').width(100)
  38 + Text(item.proportion).layoutWeight(1).fontSize(12).fontColor('#999').textAlign(TextAlign.Start)
  39 + }.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
  40 + Column(){
  41 + Text('实测记录').fontSize(14).fontWeight(700).fontColor('#000')
  42 + Web({
  43 + src: `data:text/html, ${item.viewTemplate.replace(new RegExp('<input', 'g'), '<input style="width: 30px;height: 30px"')}`,
  44 + controller: this.webviewController,
  45 + renderMode: RenderMode.SYNC_RENDER
  46 + }).layoutMode(WebLayoutMode.FIT_CONTENT).defaultFontSize(30)
  47 + }.alignItems(HorizontalAlign.Start)
  48 + }.alignItems(HorizontalAlign.Start)
  49 + }.backgroundColor('#fff').padding(10).borderRadius(4)
  50 + })
  51 + }.layoutWeight(1).backgroundColor('#f2f3f7')
  52 + }.height('100%').width('100%')
  53 + }
  54 +}
  1 +import { InitData } from '../api/recordsType'
  2 +import { getMaintenanceType } from '../api/originalRecords'
  3 +import { InitFirstPartySign } from '../api/recordsType'
  4 +import { quarterTest, quarterType } from '../api/options/optionsType'
  5 +import { AxiosResponse } from '@ohos/axios'
  6 +import { HmParseHTML } from "@wuyan/html_parse"
  7 +import baseUrl from '../utils/baseUrl'
  8 +@Component
  9 +export default struct RecordsHome {
  10 + @Prop info: InitData
  11 + // 记录类型列表
  12 + @State maintenanceTypeList: quarterType[] = []
  13 + // 获取类型
  14 + getType = (arr: quarterType[], value: string): string => {
  15 + const newValue = arr.filter((item: quarterType) => item.dictValue == value)
  16 + return newValue[0]?.dictLabel || '月度'
  17 + }
  18 + // 获取时间范围
  19 + getTimeFrame = (startTime: string | null | undefined, endTime: string | null | undefined) => {
  20 + if(startTime != null && endTime != null){
  21 + return `${startTime} 至 ${endTime}`
  22 + } else if(startTime != null) {
  23 + return startTime
  24 + } else {
  25 + return ''
  26 + }
  27 + }
  28 + // 获取签名
  29 + getSign = (index: number) => {
  30 + if(this.info.signList) {
  31 + let signList: InitFirstPartySign[] = this.info.signList
  32 + return baseUrl + signList[index]?.signPic
  33 + } else {
  34 + return ''
  35 + }
  36 + }
  37 + // 获取签名
  38 + getFirstSign = (index: number) => {
  39 + if(this.info.firstPartySign) {
  40 + let firstPartySignList: InitFirstPartySign[] = this.info.firstPartySign
  41 + return baseUrl + firstPartySignList[index]?.signPic
  42 + } else {
  43 + return ''
  44 + }
  45 + }
  46 + aboutToAppear(){
  47 + getMaintenanceType().then((res: AxiosResponse<quarterTest>) => {
  48 + this.maintenanceTypeList = res.data.data
  49 + })
  50 + }
  51 + build() {
  52 + Scroll(){
  53 + Column(){
  54 + Text(`项目编号:${this.info.reportNo}`).fontSize(12).fontColor('#000').fontWeight(700)
  55 + Text('建筑消防设施维护保养记录表').fontSize(16).fontColor('#000').fontWeight(700).width('100%').textAlign(TextAlign.Center).margin({bottom: 10, top: 10})
  56 + Text(`(${this.getType(this.maintenanceTypeList, this.info.reportType)})`).fontSize(12).fontColor('#666').padding({top: 10, bottom: 10})
  57 + .border({width: {bottom: 1},color: '#eee'})
  58 + .width('100%').textAlign(TextAlign.Center)
  59 + .margin({bottom: 10})
  60 + Row(){
  61 + Text('维保项目名称:').fontSize(12).fontColor('#999').width(120)
  62 + Text(this.info.reportName).fontSize(12).fontColor('#999')
  63 + }.padding({top: 10, bottom: 10}).border({width: {bottom: 1},color: '#eee'}).width('100%')
  64 + Row(){
  65 + Text('维护委托单位:').fontSize(12).fontColor('#999').width(120)
  66 + Text(this.info.applyCompanyName).fontSize(12).fontColor('#999')
  67 + }.padding({top: 10, bottom: 10}).border({width: {bottom: 1},color: '#eee'}).width('100%')
  68 + Row(){
  69 + Text('维护机构:').fontSize(12).fontColor('#999').width(120)
  70 + Text(this.info.companyName).fontSize(12).fontColor('#999')
  71 + }.padding({top: 10, bottom: 10}).border({width: {bottom: 1},color: '#eee'}).width('100%')
  72 + Row(){
  73 + Text('维保日期:').fontSize(12).fontColor('#999').width(120)
  74 + Text(this.getTimeFrame(this.info?.maintenanceTime, this.info?.maintenanceEndTime)).fontSize(12).fontColor('#999')
  75 + }.padding({top: 10, bottom: 10}).border({width: {bottom: 1},color: '#eee'}).width('100%')
  76 + Row(){
  77 + Text('维护保养人员签字:').fontSize(12).fontColor('#999').width(120)
  78 + Image(this.getSign(0)).width(80).height(40).margin({left: 20})
  79 + }.padding({top: 10, bottom: 10}).border({width: {bottom: 1},color: '#eee'}).width('100%')
  80 + Row(){
  81 + Column(){
  82 + Text('委托单位见证人签字:').fontSize(12).fontColor('#999').margin({bottom: 4})
  83 + Text('(签字人作为委托单位见证人对本消防原始记录表已仔细核对不存在弄虚作假,本电子签名经委托方、受委托方认可具有法律效应)').fontSize(10).fontColor('#999')
  84 + }.width(120)
  85 + Image(this.getFirstSign(0)).width(80).height(40).margin({left: 20})
  86 + }.padding({top: 10, bottom: 10}).border({width: {bottom: 1},color: '#eee'}).width('100%')
  87 + Column(){
  88 + Text('使用仪器设备及编号:').fontSize(12).fontColor('#999').margin({bottom: 4})
  89 + Text(this.info.equipment).fontSize(12).fontColor('#999')
  90 + }.padding({top: 10, bottom: 10}).border({width: {bottom: 1},color: '#eee'}).width('100%').alignItems(HorizontalAlign.Start)
  91 + Row(){
  92 + Text('综合评述:').fontSize(12).fontColor('#999')
  93 + HmParseHTML({
  94 + htmlStr: this.info?.result || '<p>无</p>',
  95 + baseFontSize: 12,
  96 + baseFontColor: '#999'
  97 + })
  98 + }.padding({top: 10, bottom: 10}).border({width: {bottom: 1},color: '#eee'}).width('100%')
  99 + Column(){
  100 + Text('注:').margin({bottom: 10}).width('100%').textAlign(TextAlign.Start).fontSize(12).fontColor('#000')
  101 + Column(){
  102 + Text('1.对发现的问题应及时处理,当场不能处置的要填报《消防设施故障处理单》。').fontSize(12).fontColor('#000')
  103 + Text('2.表中未包含的消防设施维护保养项目,消防设施维护保养单位可参考表格样式自行制定原始记录表。').fontSize(12).fontColor('#000')
  104 + Text('3.如消防技术规范有更新,消防设施维护保养单位可根据最新规范要求自行更新原始记录表。').fontSize(12).fontColor('#000')
  105 + }.padding({left: 20})
  106 + }.margin({top: 20})
  107 + }.width('100%').alignItems(HorizontalAlign.Start).justifyContent(FlexAlign.Start)
  108 + .padding({left: 10, right: 10, bottom: 30, top: 30})
  109 + }.width('100%').height('100%').scrollBar(BarState.Off).backgroundColor('#fff').borderRadius(10)
  110 + }
  111 +}
  1 +
  2 +let getInfoColor = (index: string | undefined) => {
  3 + let colorStr: string = ''
  4 + switch (index) {
  5 + case '1': colorStr = '#909399';break;
  6 + case '2': colorStr = '#1890ff';break;
  7 + case '4': colorStr = '#ffba00';break;
  8 + case '3': colorStr = '#13ce66';break;
  9 + default : colorStr = '#909399'
  10 + }
  11 + return colorStr
  12 +}
  13 +
  14 +let getInfoBgColor = (index: string | undefined) => {
  15 + let colorStr: string = ''
  16 + switch (index) {
  17 + case '1': colorStr = '#f4f4f5';break;
  18 + case '2': colorStr = '#e8f4ff';break;
  19 + case '4': colorStr = '#fff8e6';break;
  20 + case '3': colorStr = '#e7faf0';break;
  21 + default : colorStr = '#f4f4f5'
  22 + }
  23 + return colorStr
  24 +}
  25 +
  26 +let getInfoBorderColor = (index: string | undefined) => {
  27 + let colorStr: string = ''
  28 + switch (index) {
  29 + case '1': colorStr = '#e9e9eb';break;
  30 + case '2': colorStr = '#d1e9ff';break;
  31 + case '4': colorStr = '#fff1cc';break;
  32 + case '3': colorStr = '#d0f5e0';break;
  33 + default : colorStr = '#f4f4f5'
  34 + }
  35 + return colorStr
  36 +}
  37 +
  38 +let getStateInfoColor = (index: string | undefined) => {
  39 + let colorStr: string = ''
  40 + switch (index) {
  41 + case '4': colorStr = '#909399';break;
  42 + case '0': colorStr = '#1890ff';break;
  43 + case '5': colorStr = '#ffba00';break;
  44 + case '2': colorStr = '#ff4949';break;
  45 + case '1': colorStr = '#13ce66';break;
  46 + default : colorStr = '#909399'
  47 + }
  48 + return colorStr
  49 +}
  50 +
  51 +let getStateInfoBgColor = (index: string | undefined) => {
  52 + let colorStr: string = ''
  53 + switch (index) {
  54 + case '4': colorStr = '#f4f4f5';break;
  55 + case '0': colorStr = '#e8f4ff';break;
  56 + case '5': colorStr = '#fff8e6';break;
  57 + case '2': colorStr = '#ffeded';break;
  58 + case '1': colorStr = '#e7faf0';break;
  59 + default : colorStr = '#f4f4f5'
  60 + }
  61 + return colorStr
  62 +}
  63 +
  64 +let getStateInfoBorderColor = (index: string | undefined) => {
  65 + let colorStr: string = ''
  66 + switch (index) {
  67 + case '4': colorStr = '#e9e9eb';break;
  68 + case '0': colorStr = '#d1e9ff';break;
  69 + case '5': colorStr = '#fff1cc';break;
  70 + case '2': colorStr = '#ffdbdb';break;
  71 + case '1': colorStr = '#d0f5e0';break;
  72 + default : colorStr = '#f4f4f5'
  73 + }
  74 + return colorStr
  75 +}
  76 +
  77 +@Component
  78 +export default struct ThemeStaticTest {
  79 + @Prop textValue: string
  80 + @Prop type: string = '0'
  81 + // 获取维保记录类型
  82 + MaintenanceType = (index: string | undefined): string => {
  83 + let str: string = ''
  84 + switch (index) {
  85 + case '1': str = '月度';break;
  86 + case '2': str = '季度';break;
  87 + case '4': str = '半年度';break;
  88 + case '3': str = '年度';break;
  89 + default : str = ''
  90 + }
  91 + return str
  92 + }
  93 +
  94 + // 获取维保记录状态
  95 + MaintenanceState = (index: string | undefined): string => {
  96 + let str: string = ''
  97 + switch (index) {
  98 + case '0': str = '编辑中';break;
  99 + case '1': str = '已签发';break;
  100 + case '2': str = '已删除';break;
  101 + case '3': str = '正常(除”删除“外)';break;
  102 + case '4': str = '待维保人员签字';break;
  103 + case '5': str = '待甲方签字';break;
  104 + default : str = ''
  105 + }
  106 + return str
  107 + }
  108 + build() {
  109 + if(this.type == '0') {
  110 + Text(this.MaintenanceType(this.textValue))
  111 + .padding({left: 6, right: 6})
  112 + .borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).fontColor(getInfoColor(this.textValue))
  113 + .backgroundColor(getInfoBgColor(this.textValue)).borderColor(getInfoBorderColor(this.textValue))
  114 + } else if(this.type == '1'){
  115 + Text(this.MaintenanceState(this.textValue)).padding({left: 6, right: 6})
  116 + .borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).fontColor(getStateInfoColor(this.textValue))
  117 + .backgroundColor(getStateInfoBgColor(this.textValue)).borderColor(getStateInfoBorderColor(this.textValue))
  118 + }
  119 + }
  120 +}
  1 +
  2 +@Extend(Text) function info () {
  3 + .fontColor('#909399').backgroundColor('#f4f4f5')
  4 + .borderColor('#e9e9eb')
  5 +}
  6 +@Extend(Text) function primary () {
  7 + .fontColor('#1890ff').backgroundColor('#e8f4ff')
  8 + .borderColor('#d1e9ff')
  9 +}
  10 +@Extend(Text) function warning () {
  11 + .fontColor('#ffba00').backgroundColor('#fff8e6')
  12 + .borderColor('#fff1cc')
  13 +}
  14 +@Extend(Text) function success () {
  15 + .fontColor('#13ce66').backgroundColor('#e7faf0')
  16 + .borderColor('#d0f5e0')
  17 +}
  18 +@Extend(Text) function danger () {
  19 + .fontColor('#ff4949').backgroundColor('#ffeded')
  20 + .borderColor('#ffdbdb')
  21 +}
  22 +@Component
  23 +export default struct ThemeTest {
  24 + @Prop theme: string
  25 + @Prop textValue: string
  26 + build() {
  27 + if(this.theme == 'info') {
  28 + Text(this.textValue).padding({left: 6, right: 6})
  29 + .borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).info()
  30 + } else if(this.theme == 'primary'){
  31 + Text(this.textValue).padding({left: 6, right: 6})
  32 + .borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).primary()
  33 + } else if(this.theme == 'warning'){
  34 + Text(this.textValue).padding({left: 6, right: 6})
  35 + .borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).warning()
  36 + } else if(this.theme == 'success'){
  37 + Text(this.textValue).padding({left: 6, right: 6})
  38 + .borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).success()
  39 + } else if(this.theme == 'danger'){
  40 + Text(this.textValue).padding({left: 6, right: 6})
  41 + .borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).danger()
  42 + }
  43 + }
  44 +}
  1 +import { orderRow } from '../api/recordsType'
  2 +import { quarterType } from '../api/options/optionsType'
  3 +
  4 +@Extend(Text) function info () {
  5 + .fontColor('#909399').backgroundColor('#f4f4f5')
  6 + .borderColor('#e9e9eb')
  7 +}
  8 +@Extend(Text) function primary () {
  9 + .fontColor('#1890ff').backgroundColor('#e8f4ff')
  10 + .borderColor('#d1e9ff')
  11 +}
  12 +@Extend(Text) function warning () {
  13 + .fontColor('#ffba00').backgroundColor('#fff8e6')
  14 + .borderColor('#fff1cc')
  15 +}
  16 +@Extend(Text) function success () {
  17 + .fontColor('#13ce66').backgroundColor('#e7faf0')
  18 + .borderColor('#d0f5e0')
  19 +}
  20 +@Extend(Text) function danger () {
  21 + .fontColor('#ff4949').backgroundColor('#ffeded')
  22 + .borderColor('#ffdbdb')
  23 +}
  24 +
  25 +interface listClassType {
  26 + listClass: string,
  27 + dictLabel: string
  28 +}
  29 +
  30 +@Component
  31 +export default struct orderItem {
  32 + @Prop orderInfo: orderRow
  33 + @Prop sourceList: quarterType[]
  34 + @Prop stateList: quarterType[]
  35 +
  36 + getSource = () => {
  37 + let listClassObj: listClassType = { listClass: 'info', dictLabel: '小程序' }
  38 + let sourceValue: string = this.orderInfo?.source.toString()
  39 + let newArr = this.sourceList.filter((item: quarterType) => item.dictValue == sourceValue)
  40 + return newArr[0] || listClassObj
  41 + }
  42 + getState = () => {
  43 + let listClassObj: listClassType = { listClass: 'info', dictLabel: '未支付' }
  44 + let stateValue: string = this.orderInfo.state.toString()
  45 + let newArr = this.stateList.filter((item: quarterType) => item.dictValue == stateValue)
  46 + return newArr[0] || listClassObj
  47 + }
  48 + build() {
  49 + Row(){
  50 + Column({space: 5}){
  51 + Text(`订单编号:${this.orderInfo?.orderNo}`).fontSize(14).fontColor('#000').fontWeight(600)
  52 + Row(){
  53 + Text(`套餐:${this.orderInfo?.comboName}`).fontSize(12).fontColor('#999').margin({right: 5})
  54 + if(this.getSource().listClass == 'info') {
  55 + Text(this.getSource().dictLabel).padding({left: 10, right: 10})
  56 + .borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).info()
  57 + } else if(this.getSource().listClass == 'primary'){
  58 + Text(this.getSource().dictLabel).padding({left: 10, right: 10})
  59 + .borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).primary()
  60 + } else if(this.getSource().listClass == 'warning'){
  61 + Text(this.getSource().dictLabel).padding({left: 10, right: 10})
  62 + .borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).warning()
  63 + } else if(this.getSource().listClass == 'success'){
  64 + Text(this.getSource().dictLabel).padding({left: 10, right: 10})
  65 + .borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).success()
  66 + } else if(this.getSource().listClass == 'danger'){
  67 + Text(this.getSource().dictLabel).padding({left: 10, right: 10})
  68 + .borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).danger()
  69 + }
  70 + }
  71 + Row(){
  72 + Text(`金额:${this.orderInfo?.amount}`).fontSize(12).fontColor('#999').margin({right: 5})
  73 + if(this.getState().listClass == 'info') {
  74 + Text(this.getState().dictLabel).padding({left: 10, right: 10})
  75 + .borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).info()
  76 + } else if(this.getState().listClass == 'primary'){
  77 + Text(this.getState().dictLabel).padding({left: 10, right: 10})
  78 + .borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).primary()
  79 + } else if(this.getState().listClass == 'warning'){
  80 + Text(this.getState().dictLabel).padding({left: 10, right: 10})
  81 + .borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).warning()
  82 + } else if(this.getState().listClass == 'success'){
  83 + Text(this.getState().dictLabel).padding({left: 10, right: 10})
  84 + .borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).success()
  85 + } else if(this.getState().listClass == 'danger'){
  86 + Text(this.getState().dictLabel).padding({left: 10, right: 10})
  87 + .borderWidth(1).fontSize(12).borderRadius(4).lineHeight(16).danger()
  88 + }
  89 + }
  90 + Text(`时间:${this.orderInfo?.createTime}`).fontSize(12).fontColor('#999')
  91 + }.alignItems(HorizontalAlign.Start)
  92 + Text(`+${this.orderInfo?.bean}`).fontStyle(14).fontStyle(FontStyle.Italic).fontColor('#1890ff').fontWeight(600)
  93 + }.padding({top: 20, bottom: 20, left: 10, right: 10})
  94 + .border({width: {bottom: 1}, color: '#eee'}).width('100%')
  95 + .justifyContent(FlexAlign.SpaceBetween)
  96 + }
  97 +}
  1 +import { companyAdd, beanType } from '../api/user'
  2 +import { addType } from '../api/userType'
  3 +import { promptAction } from '@kit.ArkUI'
  4 +import { AxiosResponse } from '@ohos/axios'
  5 +
  6 +@CustomDialog
  7 +export default struct AddPersonDialog {
  8 + controller: CustomDialogController = new CustomDialogController({builder: ''})
  9 + @State addForm : addType = {
  10 + personName: '',
  11 + idNo: ''
  12 + }
  13 + build() {
  14 + Column(){
  15 + Text('添加人员').margin({top: 20})
  16 + Row(){
  17 + Row(){
  18 + Image($r('app.media.require')).width(20)
  19 + Text('姓名')
  20 + }.width(90)
  21 + TextInput({placeholder: '请输入姓名', text: $$this.addForm.personName})
  22 + .backgroundColor('#fff').layoutWeight(1)
  23 + }.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
  24 + Row(){
  25 + Row(){
  26 + Image($r('app.media.require')).width(20)
  27 + Text('身份证号')
  28 + }.width(90)
  29 + TextInput({placeholder: '请输入身份证号', text: $$this.addForm.idNo})
  30 + .backgroundColor('#fff').layoutWeight(1)
  31 + }.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
  32 + Row(){
  33 + Text('取消').layoutWeight(1).fontSize(16).height(60).fontColor('#606266')
  34 + .textAlign(TextAlign.Center)
  35 + .onClick(() => {
  36 + this.controller.close()
  37 + })
  38 + Text('确定').layoutWeight(1).fontSize(16).height(60).fontColor('#1890ff')
  39 + .textAlign(TextAlign.Center)
  40 + .onClick(async () => {
  41 + const res: AxiosResponse<beanType> = await companyAdd(this.addForm)
  42 + promptAction.showToast({message: res.data.msg})
  43 + this.controller.close()
  44 + })
  45 + }
  46 + }.width('100%').backgroundColor('#fff')
  47 + }
  48 +}
  1 +import AreaPicker from '../components/AreaPicker'
  2 +
  3 +@CustomDialog
  4 +export default struct AreaPickerDialog {
  5 + private dialogController: CustomDialogController //弹窗控制器
  6 + @State value: string[] = [] //选中值
  7 + //确认关闭选择改变回调
  8 + onChange: (value: string[]) => void = () => {
  9 + }
  10 + private defaultValue: string[] = []; //首次打开选中值
  11 +
  12 + aboutToAppear(): void {
  13 + //记录打开时候的默认值
  14 + this.defaultValue = this.value
  15 + if (Array.isArray(this.value) && this.value.length < 3) {
  16 + this.value = ['北京市', '北京市', '东城区']; //设置默认值
  17 + }
  18 + }
  19 +
  20 + build() {
  21 + Column({ space: 50 }) {
  22 + //头部确认、取消操作行
  23 + Row() {
  24 + Text('取消')
  25 + .fontColor('#909090')
  26 + .onClick(() => {
  27 + this.dialogController.close()
  28 + })
  29 + Text('请选择省市区')
  30 + Text('确定')
  31 + .fontColor('#0A7EE6')
  32 + .onClick(() => {
  33 + //和首次打开值对比
  34 + if (this.defaultValue.join('') !== this.value.join('')) {
  35 + this.onChange(this.value)
  36 + }
  37 + this.dialogController.close()
  38 + })
  39 + }
  40 + .width('100%')
  41 + .justifyContent(FlexAlign.SpaceBetween)
  42 +
  43 + //地区选择器
  44 + AreaPicker({ value: this.value })
  45 + }
  46 + .backgroundColor(Color.White)
  47 + .borderRadius(24)
  48 + .padding(20)
  49 + .width('93%')
  50 + }
  51 +}
  1 +import { personCertificateRow, CertificateRow } from '../api/userType'
  2 +@CustomDialog
  3 +export default struct CertificateDialog {
  4 + controller: CustomDialogController = new CustomDialogController({builder: ''})
  5 + @State select: number = 0
  6 + @Prop certificateList: string[] = []
  7 + @Link selectValue: string
  8 + @Link personCertificateInfo: personCertificateRow
  9 + @Link certificateData: CertificateRow[]
  10 + build() {
  11 + Column({ space: 50 }) {
  12 + //头部确认、取消操作行
  13 + Row() {
  14 + Text('取消')
  15 + .fontColor('#909090')
  16 + .onClick(() => {
  17 + this.selectValue = this.certificateList[0]
  18 + this.personCertificateInfo.certificateId = this.certificateData[0].certificateId
  19 + this.controller.close()
  20 + })
  21 + Text('请选择证书类型')
  22 + Text('确定')
  23 + .fontColor('#0A7EE6')
  24 + .onClick(() => {
  25 + this.controller.close()
  26 + })
  27 + }
  28 + .width('100%')
  29 + .justifyContent(FlexAlign.SpaceBetween)
  30 +
  31 + //证书选择器
  32 + TextPicker({ range: this.certificateList, selected: this.select })
  33 + .canLoop(false).divider(null)
  34 + .width('93%')
  35 + .onChange((value: string | string[], index: number | number[]) => {
  36 + this.selectValue = value as string
  37 + let newArr = this.certificateData.filter((item: CertificateRow) => item.certificateLevel + item.certificateName == value )
  38 + this.personCertificateInfo.certificateId = newArr[0]?.certificateId || 1
  39 + })
  40 + }
  41 + .backgroundColor(Color.White)
  42 + .borderRadius(24)
  43 + .padding(20)
  44 + .width('93%')
  45 + }
  46 +}
  1 +import { promptAction } from '@kit.ArkUI'
  2 +@CustomDialog
  3 +export default struct UserCommit{
  4 + controller: CustomDialogController = new CustomDialogController({builder: ''})
  5 + @State count: number = 3
  6 + @State rememberSelect: boolean = false
  7 + aboutToAppear(): void {
  8 + let timer = setInterval(() => {
  9 + this.count--
  10 + if(this.count <= 0){
  11 + this.count = 0
  12 + clearInterval(timer)
  13 + }
  14 + }, 1000)
  15 + }
  16 + build() {
  17 + Column({space: 10}){
  18 + Text('承诺书').fontSize(20).lineHeight(21).fontColor('#606266').fontWeight(600).margin({bottom: 20})
  19 + .margin({top: 60})
  20 + Text('为规范消防技术服务机构从业活动,保障消防技术服务质量,提高社会整体火灾防控能力,保护群众生命财产安全。本机构承诺如下:').fontSize(12).fontColor('#606266')
  21 + Column({space: 10}){
  22 + Text('一、严格遵守有关法律、法规和消防技术规范,按照消防技术服务标准开展服务活动。')
  23 + .fontSize(12).fontColor('#606266').textIndent(24)
  24 + Text('二、从业条件符合《社会消防技术服务机构管理规定》(应急部令第7号)文件要求。').fontSize(12).fontColor('#606266').textIndent(24)
  25 + Text('三、所有从业人员均取得相应的职业资格证书。').fontSize(12).fontColor('#606266').textIndent(24)
  26 + Text('四、注册消防工程师未同时在2个(含本数)以上消防技术服务机构执业,且未在其他机关、团体、企业、事业单位兼职。').fontSize(12).fontColor('#606266').textIndent(24)
  27 + Text('五、在承接业务时,明确每个项目的负责人,且由注册消防工程师担任。').fontSize(12).fontColor('#606266').textIndent(24)
  28 + Text('六、营业执照、从业人员、设备配备信息在本机构显著位置公示。').fontSize(12).fontColor('#606266').textIndent(24)
  29 + Text('七、加强消防技术服务质量管理,保证消防原始记录真实、准确、完整、规范,不出具虚假消防原始记录。').fontSize(12).fontColor('#606266').textIndent(24)
  30 + Text('八、加强从业人员职业道德教育,开展职业技能培训,自觉提升消防技术服务水平。').fontSize(12).fontColor('#606266').textIndent(24)
  31 + Text('九、上传至该系统的材料均属实。').fontSize(12).fontColor('#606266').textIndent(24)
  32 + Text('本机构自觉接受有关部门的监督管理,严格遵守本承诺,\n' +
  33 + '如有违反,愿意承担相应的法律责任。')
  34 + .textIndent(24).fontSize(12).fontColor('#606266')
  35 + }.alignItems(HorizontalAlign.Start)
  36 + Row({space: 5}){
  37 + Checkbox({ group: 'password' })
  38 + .select(this.rememberSelect)
  39 + .selectedColor('#1890ff')
  40 + .shape(CheckBoxShape.ROUNDED_SQUARE)
  41 + .width(16).height(16)
  42 + .mark({
  43 + size: 10,
  44 + strokeWidth: 5
  45 + })
  46 + .onChange((value: boolean) => {
  47 + this.rememberSelect = value
  48 + })
  49 + Text('我已阅读《承诺书》,并严格按照承诺书《承诺书》内容执行').fontSize(12).fontColor('#606266')
  50 + }.width('100%').justifyContent(FlexAlign.Start)
  51 + Text(`请仔细阅读承诺书(${this.count}s后可关闭)`)
  52 + .fontSize(14).fontColor('#fff').fontWeight(600).textAlign(TextAlign.Center)
  53 + .margin({top: 60}).width('100%').border({width: {top: 1}, color: '#fff'}).padding({top: 10, bottom: 10})
  54 + .visibility(this.count > 0 ? Visibility.Visible : Visibility.None).backgroundColor('#1890ff')
  55 + .borderRadius(10).opacity(0.5)
  56 + Text('前往注册')
  57 + .fontSize(14).fontColor('#fff').fontWeight(600).textAlign(TextAlign.Center)
  58 + .margin({top: 60}).width('100%').border({width: {top: 1}, color: '#fff'}).padding({top: 10, bottom: 10})
  59 + .visibility(this.count == 0 ? Visibility.Visible : Visibility.None).backgroundColor('#1890ff')
  60 + .borderRadius(10)
  61 + .onClick(() => {
  62 + if(!this.rememberSelect){
  63 + return promptAction.showToast({message: '请选勾选同意承诺书'})
  64 + }
  65 + this.controller.close()
  66 + })
  67 + }.backgroundColor('#fff').width('100%').padding(10).borderRadius(10).height('100%')
  68 + }
  69 +}
  1 +import { noticeRow } from '../api/notice'
  2 +import { HmParseHTML } from "@wuyan/html_parse"
  3 +@CustomDialog
  4 +export default struct DialogTip{
  5 + controller: CustomDialogController = new CustomDialogController({builder: ''})
  6 + cancel: Function = () => {}
  7 + confirm: Function = () => {}
  8 + @Prop noticeDetail: noticeRow
  9 + @State count: number = 5
  10 + aboutToAppear(): void {
  11 + let timer = setInterval(() => {
  12 + this.count--
  13 + if(this.count <= 0){
  14 + this.count = 0
  15 + clearInterval(timer)
  16 + }
  17 + }, 1000)
  18 + }
  19 + build() {
  20 + Column({space: 10}){
  21 + Text('- 温馨提示 -').fontSize(16).lineHeight(21).fontColor('#fff').fontWeight(600).margin({bottom: 20})
  22 + HmParseHTML({
  23 + htmlStr: this.noticeDetail?.noticeContent || '', // 富文本内容-必传
  24 + baseFontColor: '#fff',
  25 + baseFontSize: 14
  26 + })
  27 + Text(`我已知晓(${this.count}s后可关闭)`)
  28 + .fontSize(16).lineHeight(21).fontColor('#1890ff').fontWeight(600).textAlign(TextAlign.Center)
  29 + .margin({top: 60}).width('100%').border({width: {top: 1}, color: '#fff'}).padding({top: 20, bottom: 20})
  30 + .visibility(this.count > 0 ? Visibility.Visible : Visibility.None)
  31 + Text('我已知晓')
  32 + .fontSize(16).lineHeight(21).fontColor('#1890ff').fontWeight(600).textAlign(TextAlign.Center)
  33 + .margin({top: 60}).width('100%').border({width: {top: 1}, color: '#fff'}).padding({top: 20, bottom: 20})
  34 + .visibility(this.count == 0 ? Visibility.Visible : Visibility.None)
  35 + .onClick(() => {
  36 + this.confirm()
  37 + this.controller.close()
  38 + })
  39 + }.backgroundImage($r('app.media.login_back'))
  40 + .backgroundImageSize({width: '100%'}).width('100%')
  41 + .backgroundImagePosition(Alignment.Center)
  42 + .padding({top: 20,left: 13, right: 13})
  43 + }
  44 +}
  1 +import { getRecordsList } from '../api/originalRecords'
  2 +import { quarterType } from '../api/options/optionsType'
  3 +import { QueryParams, RecordsList, Row } from '../api/recordsType'
  4 +import { AxiosResponse } from '@ohos/axios'
  5 +import preferencesUtil from '../utils/preferences'
  6 +@CustomDialog
  7 +export default struct FilterDialog {
  8 + controller: CustomDialogController = new CustomDialogController({builder: ''})
  9 + cancel: Function = () => {}
  10 + confirm: Function = () => {}
  11 + @Prop typeLists: quarterType[]
  12 + @Prop statusLists: quarterType[]
  13 + @Link recordsList: Row[]
  14 + @Link params: QueryParams
  15 + @Link totalAll: number
  16 + build() {
  17 + Column({space: 10}){
  18 + Row(){
  19 + Row({space: 10}){
  20 + Text().width(3).height(20).backgroundColor('#6D9DFF')
  21 + Text('筛选条件').fontSize(14)
  22 + }
  23 + Image($r('app.media.close')).width(20).onClick(() => this.controller.close())
  24 + }.width('100%').justifyContent(FlexAlign.SpaceBetween).margin({bottom: 20})
  25 + Column({space: 10}){
  26 + Text('消防设施使用管理单位')
  27 + TextInput({text: $$this.params.applyCompanyName,placeholder: '请输入管理单位名称'}).backgroundColor('#fff')
  28 + .border({width: {bottom: 1}, color: '#eee'}).borderRadius(0)
  29 + }.alignItems(HorizontalAlign.Start)
  30 + Column({space: 10}){
  31 + Text('记录编号')
  32 + TextInput({text: $$this.params.reportNo, placeholder: '请输入记录编号'}).backgroundColor('#fff')
  33 + .border({width: {bottom: 1}, color: '#eee'}).borderRadius(0)
  34 + }.alignItems(HorizontalAlign.Start)
  35 + Column({space: 10}){
  36 + Text('记录类型')
  37 + Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Start, alignItems: ItemAlign.Start, wrap: FlexWrap.Wrap }) {
  38 + ForEach(this.typeLists, (item: quarterType) => {
  39 + Row() {
  40 + Radio({ value: item.dictValue, group: 'radioGroup' })
  41 + .radioStyle({ checkedBackgroundColor: '#1890ff' })
  42 + .height(15)
  43 + .width(15)
  44 + .onChange(() => {
  45 + this.params.reportType = item.dictValue
  46 + })
  47 + Text(item.dictLabel)
  48 + }.margin({right: 5,bottom: 5})
  49 + })
  50 + }
  51 + }.alignItems(HorizontalAlign.Start)
  52 + Column({space: 10}){
  53 + Text('状态')
  54 + Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Start, alignItems: ItemAlign.Start, wrap: FlexWrap.Wrap }) {
  55 + ForEach(this.statusLists, (item: quarterType) => {
  56 + Row() {
  57 + Radio({ value: item.dictValue, group: 'radioGroup2' })
  58 + .radioStyle({ checkedBackgroundColor: '#1890ff' })
  59 + .height(15)
  60 + .width(15)
  61 + .onChange(() => {
  62 + this.params.stateQuery = item.dictValue
  63 + console.log(JSON.stringify(this.params))
  64 + })
  65 + Text(item.dictLabel)
  66 + }.margin({right: 5,bottom: 5})
  67 + })
  68 + }
  69 + }.alignItems(HorizontalAlign.Start)
  70 + Row(){
  71 + Text('开始日期')
  72 + Text(this.params.beginMaintenanceTime || '选择开始日期').padding({top: 8, bottom: 8, left: 16, right: 16})
  73 + .backgroundColor('#fff').layoutWeight(1).fontColor('#999').onClick(() => {
  74 + CalendarPickerDialog.show({
  75 + onAccept: (value) => {
  76 + this.params.beginMaintenanceTime = JSON.stringify(value).slice(1, 11)
  77 + }
  78 + })
  79 + })
  80 + }
  81 + Row(){
  82 + Text('结束日期')
  83 + Text(this.params.endMaintenanceTime || '选择结束日期').padding({top: 8, bottom: 8, left: 16, right: 16})
  84 + .backgroundColor('#fff').layoutWeight(1).fontColor('#999').onClick(() => {
  85 + CalendarPickerDialog.show({
  86 + onAccept: (value) => {
  87 + this.params.endMaintenanceTime = JSON.stringify(value).slice(1, 11)
  88 + }
  89 + })
  90 + })
  91 + }
  92 + Row({space: 20}){
  93 + Button('搜索').layoutWeight(1).onClick(() => {
  94 + getRecordsList(this.params).then((res: AxiosResponse<RecordsList>) => {
  95 + this.recordsList = res.data.rows
  96 + this.totalAll = res.data.total
  97 + this.controller.close()
  98 + })
  99 + })
  100 + Button('重置').layoutWeight(1).backgroundColor('#fff').fontColor('#666')
  101 + .borderColor('#eee').borderWidth(1)
  102 + .onClick(() => {
  103 + this.params = {
  104 + pageSize: 10,
  105 + pageNum: 1,
  106 + stateQuery: '3'
  107 + }
  108 + const companyId: number = preferencesUtil.get('XF_COMPANY_ID', 0) as number
  109 + const personId: number = preferencesUtil.get('XF_PERSON_ID', 0) as number
  110 + this.params.companyId = companyId
  111 + this.params.technicalDirectorId = personId
  112 + getRecordsList(this.params).then((res: AxiosResponse<RecordsList>) => {
  113 + this.recordsList = res.data.rows
  114 + this.totalAll = res.data.total
  115 + this.controller.close()
  116 + })
  117 + })
  118 + }.margin({top: 20})
  119 + }.width('100%').alignItems(HorizontalAlign.Start).padding(20)
  120 + }
  121 +}
  1 +import { quarterType } from '../api/options/optionsType'
  2 +import { orderParams } from '../api/recordsType'
  3 +import preferencesUtils from '../utils/preferences'
  4 +let companyId = preferencesUtils.get('XF_COMPANY_ID', '') as number
  5 +@CustomDialog
  6 +export default struct FilterOrderDialog {
  7 + controller: CustomDialogController = new CustomDialogController({builder: ''})
  8 + reset: () => void = () => {}
  9 + confirm: () => void = () => {}
  10 + @Link params: orderParams
  11 + @Prop sourceList: quarterType[]
  12 + @Prop stateList: quarterType[]
  13 + build() {
  14 + Column({space: 10}){
  15 + Row(){
  16 + Row({space: 10}){
  17 + Text().width(3).height(20).backgroundColor('#6D9DFF')
  18 + Text('筛选条件').fontSize(14)
  19 + }
  20 + Image($r('app.media.close')).width(20).onClick(() => this.controller.close())
  21 + }.width('100%').justifyContent(FlexAlign.SpaceBetween).margin({bottom: 20})
  22 + Column({space: 10}){
  23 + Text('订单编号')
  24 + TextInput({text: $$this.params.orderNo ,placeholder: '请输入订单编号'}).backgroundColor('#fff')
  25 + .border({width: {bottom: 1}, color: '#eee'}).borderRadius(0)
  26 + }.alignItems(HorizontalAlign.Start)
  27 + Column({space: 10}){
  28 + Text('金额')
  29 + TextInput({text: $$this.params.amount, placeholder: '请输入金额'}).backgroundColor('#fff')
  30 + .border({width: {bottom: 1}, color: '#eee'}).borderRadius(0).type(InputType.Number)
  31 + }.alignItems(HorizontalAlign.Start)
  32 + Column({space: 10}){
  33 + Text('套餐')
  34 + TextInput({text: $$this.params.comboName,placeholder: '请输入套餐'}).backgroundColor('#fff')
  35 + .border({width: {bottom: 1}, color: '#eee'}).borderRadius(0)
  36 + }.alignItems(HorizontalAlign.Start)
  37 + Column({space: 10}){
  38 + Text('公司')
  39 + TextInput({text: $$this.params.companyName,placeholder: '请输入公司名称'}).backgroundColor('#fff')
  40 + .border({width: {bottom: 1}, color: '#eee'}).borderRadius(0)
  41 + }.alignItems(HorizontalAlign.Start)
  42 + Column({space: 10}){
  43 + Text('状态')
  44 + Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Start, alignItems: ItemAlign.Start, wrap: FlexWrap.Wrap }) {
  45 + ForEach(this.stateList, (item: quarterType) => {
  46 + Row() {
  47 + Radio({ value: item.dictValue, group: 'radioGroup' })
  48 + .radioStyle({ checkedBackgroundColor: '#1890ff' })
  49 + .height(15)
  50 + .width(15)
  51 + .onChange(() => {
  52 + this.params.state = item.dictValue
  53 + })
  54 + Text(item.dictLabel)
  55 + }.margin({right: 5,bottom: 5})
  56 + })
  57 + }
  58 + }.alignItems(HorizontalAlign.Start)
  59 + Column({space: 10}){
  60 + Text('支付来源')
  61 + Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Start, alignItems: ItemAlign.Start, wrap: FlexWrap.Wrap }) {
  62 + ForEach(this.sourceList, (item: quarterType) => {
  63 + Row() {
  64 + Radio({ value: item.dictValue, group: 'radioGroup2' })
  65 + .radioStyle({ checkedBackgroundColor: '#1890ff' })
  66 + .height(15)
  67 + .width(15)
  68 + .onChange(() => {
  69 + this.params.source = item.dictValue
  70 + })
  71 + Text(item.dictLabel)
  72 + }.margin({right: 5,bottom: 5})
  73 + })
  74 + }
  75 + }.alignItems(HorizontalAlign.Start)
  76 + Row({space: 20}){
  77 + Button('搜索').layoutWeight(1).onClick(() => {
  78 + this.confirm()
  79 + this.controller.close()
  80 + console.log(JSON.stringify(this.params))
  81 + })
  82 + Button('重置').layoutWeight(1).backgroundColor('#fff').fontColor('#666')
  83 + .borderColor('#eee').borderWidth(1)
  84 + .onClick(() => {
  85 + this.params = {
  86 + pageNum: 1,
  87 + pageSize: 10,
  88 + companyId: companyId
  89 + }
  90 + this.reset()
  91 + this.controller.close()
  92 + })
  93 + }.margin({top: 20})
  94 + }.width('100%').alignItems(HorizontalAlign.Start).padding(20).backgroundColor('#fff')
  95 + }
  96 +}
  1 +import { recordParams } from '../api/recordsType'
  2 +import preferencesUtils from '../utils/preferences'
  3 +let companyId = preferencesUtils.get('XF_COMPANY_ID', '') as number
  4 +@CustomDialog
  5 +export default struct FilterRecordDialog {
  6 + controller: CustomDialogController = new CustomDialogController({builder: ''})
  7 + reset: () => void = () => {}
  8 + confirm: () => void = () => {}
  9 + @Link recordParams: recordParams
  10 + build() {
  11 + Column({space: 10}){
  12 + Row(){
  13 + Row({space: 10}){
  14 + Text().width(3).height(20).backgroundColor('#6D9DFF')
  15 + Text('筛选条件').fontSize(14)
  16 + }
  17 + Image($r('app.media.close')).width(20).onClick(() => this.controller.close())
  18 + }.width('100%').justifyContent(FlexAlign.SpaceBetween).margin({bottom: 20})
  19 + Column({space: 10}){
  20 + Text('原始记录名称')
  21 + TextInput({text: $$this.recordParams.reportName ,placeholder: '请输入原始记录名称'}).backgroundColor('#fff')
  22 + .border({width: {bottom: 1}, color: '#eee'}).borderRadius(0)
  23 + }.alignItems(HorizontalAlign.Start)
  24 + Column({space: 10}){
  25 + Text('公司')
  26 + TextInput({text: $$this.recordParams.companyName, placeholder: '请输入公司名称'}).backgroundColor('#fff')
  27 + .border({width: {bottom: 1}, color: '#eee'}).borderRadius(0)
  28 + }.alignItems(HorizontalAlign.Start)
  29 + Column({space: 10}){
  30 + Text('创建用户')
  31 + TextInput({text: $$this.recordParams.createUserId, placeholder: '请输入创建用户'}).backgroundColor('#fff')
  32 + .border({width: {bottom: 1}, color: '#eee'}).borderRadius(0)
  33 + }.alignItems(HorizontalAlign.Start)
  34 + Row({space: 20}){
  35 + Button('搜索').layoutWeight(1).onClick(() => {
  36 + this.confirm()
  37 + this.controller.close()
  38 + })
  39 + Button('重置').layoutWeight(1).backgroundColor('#fff').fontColor('#666')
  40 + .borderColor('#eee').borderWidth(1)
  41 + .onClick(() => {
  42 + this.recordParams = {
  43 + pageNum: 1,
  44 + pageSize: 10,
  45 + companyId: companyId
  46 + }
  47 + this.reset()
  48 + this.controller.close()
  49 + })
  50 + }.margin({top: 20})
  51 + }.width('100%').alignItems(HorizontalAlign.Start).padding(20).backgroundColor('#fff')
  52 + }
  53 +}
  1 +import { Row, QueryParams, RecordsList } from '../api/recordsType'
  2 +import { getRecordsList, importRecord } from '../api/originalRecords'
  3 +import { AxiosResponse } from '@ohos/axios'
  4 +import preferencesUtil from '../utils/preferences'
  5 +import { promptAction } from '@kit.ArkUI'
  6 +
  7 +let companyId: number = preferencesUtil.get('XF_COMPANY_ID', 0) as number
  8 +@CustomDialog
  9 +export default struct ImportRecordsDialog{
  10 + controller: CustomDialogController = new CustomDialogController({builder: ''})
  11 + //回调函数
  12 + onChange: () => void = () => {}
  13 + @Prop applyCompanyName: string
  14 + @Prop reportId: number
  15 + @State recordsList: Row[] = []
  16 + @State searchValue: string = ''
  17 + async aboutToAppear() {
  18 + let params: QueryParams = {
  19 + pageNum: 1,
  20 + pageSize: 20,
  21 + applyCompanyName: this.applyCompanyName,
  22 + companyId: companyId
  23 + }
  24 + const result: AxiosResponse<RecordsList> = await getRecordsList(params)
  25 + this.recordsList = result.data.rows
  26 + }
  27 + build() {
  28 + Column(){
  29 + Row(){
  30 + Search({ value: $$this.searchValue, placeholder: '请输入【记录编号】' })
  31 + .searchButton('搜索', {
  32 + fontSize: 12
  33 + })
  34 + .width('95%')
  35 + .height(30)
  36 + .backgroundColor('#fff')
  37 + .placeholderColor(Color.Grey)
  38 + .placeholderFont({ size: 12, weight: 400 })
  39 + .textFont({ size: 12, weight: 400 })
  40 + .layoutWeight(1)
  41 + .onSubmit(async () => {
  42 + this.recordsList = []
  43 + let params: QueryParams = {
  44 + pageNum: 1,
  45 + pageSize: 10,
  46 + applyCompanyName: this.applyCompanyName,
  47 + companyId: companyId,
  48 + reportType: '1',
  49 + reportNo: this.searchValue
  50 + }
  51 + const result: AxiosResponse<RecordsList> = await getRecordsList(params)
  52 + this.recordsList = result.data.rows
  53 + })
  54 + }.padding({left: 5, right: 5}).borderRadius(10)
  55 + List({space: 10}){
  56 + ForEach(this.recordsList, (item: Row) => {
  57 + ListItem(){
  58 + Row({space: 10}){
  59 + Column({space: 10}){
  60 + Row(){
  61 + Image($r('app.media.project')).width(16).margin({right: 10})
  62 + Text(item.reportName).fontSize(12).fontColor('#333').maxLines(2)
  63 + .textOverflow({overflow: TextOverflow.Ellipsis})
  64 + }
  65 + Row(){
  66 + Image($r('app.media.company')).width(16).margin({right: 10})
  67 + Text(item.applyCompanyName).fontSize(12).fontColor('#999')
  68 + }
  69 + Row(){
  70 + Image($r('app.media.numberNo')).width(16).margin({right: 10})
  71 + Text(item.reportNo).fontSize(12).fontColor('#999')
  72 + }
  73 + Row(){
  74 + Image($r('app.media.dateTime')).width(16).margin({right: 10})
  75 + Text(`${item.maintenanceTime}~${item.maintenanceEndTime || ''}`).fontSize(12).fontColor('#999')
  76 + }
  77 + }.alignItems(HorizontalAlign.Start).layoutWeight(1)
  78 + Text('导入').fontSize(14).fontColor('#1890ff')
  79 + .onClick(() => {
  80 + AlertDialog.show({
  81 + title: '',
  82 + message: '删除后无法找回,确认删除全部故障处理记录并提交?',
  83 + autoCancel: true,
  84 + alignment: DialogAlignment.Center,
  85 + gridCount: 4,
  86 + offset: { dx: 0, dy: -20 },
  87 + buttonDirection: DialogButtonDirection.HORIZONTAL,
  88 + buttons: [
  89 + {
  90 + value: '取消',
  91 + action: () => {
  92 + console.info('Callback when button1 is clicked')
  93 + }
  94 + },
  95 + {
  96 + value: '确认',
  97 + action: async () => {
  98 + await importRecord(item.reportId,this.reportId)
  99 + this.onChange()
  100 + this.controller.close()
  101 + promptAction.showToast({message: '更新成功'})
  102 + }
  103 + }
  104 + ],
  105 + cancel: () => {
  106 + console.info('Closed callbacks')
  107 + }
  108 + })
  109 + })
  110 + }.borderRadius(10).padding(10).backgroundColor('#fff').width('100%')
  111 + }
  112 + })
  113 + }.padding({top: 10, bottom: 20, left: 10, right: 10})
  114 + }.constraintSize({maxHeight: '60%'}).backgroundColor('#f2f3f7')
  115 + }
  116 +}
  1 +@CustomDialog
  2 +export default struct LoadingDialog{
  3 + controller: CustomDialogController = new CustomDialogController({builder: ''})
  4 + build() {
  5 + Column({space: 10}){
  6 + LoadingProgress().height(32).color(Color.White)
  7 + Text("加载中...").fontSize(16).margin({ left: 20 }).fontColor('#fff')
  8 + }
  9 + }
  10 +}
  1 +@CustomDialog
  2 +export default struct PhotoBrowser {
  3 + controller: CustomDialogController = new CustomDialogController({builder: ''})
  4 + @State count: number = 0
  5 + @Prop imagesList: ResourceStr[] | string[] = []
  6 + build() {
  7 + Swiper(){
  8 + ForEach(this.imagesList, (str: string | ResourceStr, index)=>{
  9 + Image(str)
  10 + .width('100%')
  11 + .height('100%')
  12 + .objectFit(ImageFit.Auto)
  13 + })
  14 + }
  15 + .index(this.count)
  16 + .loop(false)
  17 + .backgroundColor(Color.Black)
  18 + .indicator(
  19 + new DotIndicator().color(Color.White)
  20 + )
  21 + .width('100%')
  22 + .height('100%')
  23 + .onClick(()=>{
  24 + this.controller.close()
  25 + })
  26 + }
  27 +}
  1 +import { router } from '@kit.ArkUI'
  2 +@Extend(Text) function textCommon () {
  3 + .width('100%').height(60)
  4 + .textAlign(TextAlign.Center)
  5 + .backgroundColor('#fff')
  6 +}
  7 +
  8 +@CustomDialog
  9 +export default struct SelectRegDialog{
  10 + controller: CustomDialogController = new CustomDialogController({builder: ''})
  11 + build() {
  12 + Column(){
  13 + Text('请选择注册类型').textCommon().fontSize(12).fontColor('#999')
  14 + .border({width: {bottom: 1}, color: '#eee'})
  15 + Text('个人用户').textCommon().fontSize(14).fontColor('#000')
  16 + .border({width: {bottom: 1}, color: '#eee'})
  17 + .onClick(() => {
  18 + this.controller.close()
  19 + router.pushUrl({
  20 + url: 'pages/UserRegister'
  21 + })
  22 + })
  23 + Text('维保机构').textCommon().fontSize(14).fontColor('#000')
  24 + .margin({bottom: 10})
  25 + .onClick(() => {
  26 + this.controller.close()
  27 + router.pushUrl({
  28 + url: 'pages/Register'
  29 + })
  30 + })
  31 + Text('取消').textCommon().fontSize(14).fontColor('#000')
  32 + .onClick(() => {
  33 + this.controller.close()
  34 + })
  35 + }.backgroundColor('#f2f3f7').width('100%')
  36 + }
  37 +}
  1 +import AreaPicker from '../components/AreaPicker'
  2 +
  3 +@CustomDialog
  4 +export default struct AreaPickerDialog {
  5 + private dialogController: CustomDialogController //弹窗控制器
  6 + @State value: string[] = [] //选中值
  7 + //确认关闭选择改变回调
  8 + private onChange: (value: string[]) => void = () => {
  9 + }
  10 + private defaultValue: string[] = []; //首次打开选中值
  11 +
  12 + aboutToAppear(): void {
  13 + //记录打开时候的默认值
  14 + this.defaultValue = this.value
  15 + if (Array.isArray(this.value) && this.value.length < 3) {
  16 + this.value = ['月度']; //设置默认值
  17 + }
  18 + }
  19 +
  20 + build() {
  21 + Column({ space: 50 }) {
  22 + //头部确认、取消操作行
  23 + Row() {
  24 + Text('取消')
  25 + .fontColor('#909090')
  26 + .onClick(() => {
  27 + this.dialogController.close()
  28 + })
  29 + Text('请选择记录类型')
  30 + Text('确定')
  31 + .fontColor('#0A7EE6')
  32 + .onClick(() => {
  33 + //和首次打开值对比
  34 + if (this.defaultValue.join('') !== this.value.join('')) {
  35 + this.onChange(this.value)
  36 + }
  37 + this.dialogController.close()
  38 + })
  39 + }
  40 + .width('100%')
  41 + .justifyContent(FlexAlign.SpaceBetween)
  42 +
  43 + //地区选择器
  44 + AreaPicker({ value: this.value })
  45 + }
  46 + .backgroundColor(Color.White)
  47 + .borderRadius(24)
  48 + .padding(20)
  49 + .width('93%')
  50 + }
  51 +}
  1 +
  2 +@CustomDialog
  3 +export default struct DialogTip{
  4 + controller: CustomDialogController = new CustomDialogController({builder: ''})
  5 + cancel: Function = () => {}
  6 + confirm: Function = () => {}
  7 + build() {
  8 + Column({space: 10}){
  9 + Text('上传视频/图片提示').fontSize(16).lineHeight(21).fontColor('#fff').fontWeight(600).margin({bottom: 20})
  10 + Text('已上传视频/图片会为你保留15个自然日,请及时下载并上传到正式报告系统中。').fontSize(16).fontColor('#fff')
  11 + Text('我已知晓')
  12 + .fontSize(16).lineHeight(21).fontColor('#fff').fontWeight(600).textAlign(TextAlign.Center)
  13 + .width('100%').padding({top: 20, bottom: 20})
  14 + .onClick(() => {
  15 + this.controller.close()
  16 + AppStorage.setOrCreate('isShowTip', true)
  17 + })
  18 + }.backgroundImage($r('app.media.login_back'))
  19 + .backgroundImageSize({width: '100%'}).width('100%')
  20 + .backgroundImagePosition(Alignment.Center)
  21 + .padding({top: 20,left: 13, right: 13})
  22 + }
  23 +}
  1 +import { promptAction } from '@kit.ArkUI'
  2 +@CustomDialog
  3 +export default struct UserCommit{
  4 + controller: CustomDialogController = new CustomDialogController({builder: ''})
  5 + @State count: number = 3
  6 + @State rememberSelect: boolean = false
  7 + aboutToAppear(): void {
  8 + let timer = setInterval(() => {
  9 + this.count--
  10 + if(this.count <= 0){
  11 + this.count = 0
  12 + clearInterval(timer)
  13 + }
  14 + }, 1000)
  15 + }
  16 + build() {
  17 + Column({space: 10}){
  18 + Text('承诺书').fontSize(20).lineHeight(21).fontColor('#606266').fontWeight(600).margin({bottom: 20})
  19 + .margin({top: 60})
  20 + Text('本人承诺在本系统中自主录入的所有信息真实有效,并将按照相关法律法规的要求,及时、准确录入后续变更信息。').fontSize(12).fontColor('#606266').textIndent(24)
  21 + Text('本人承诺严格遵守相关法律法规和标准规范,并按照客观独立、合法公正、诚实信用的原则,从事消防设施维护保养检测和消防安全评估等消防技术服务活动,并在本系统录入消防技术服务项目原始记录情况。')
  22 + .fontSize(12).fontColor('#606266').textIndent(24)
  23 + Text('本人承诺主动接受并配合消防救援机构和其他行政主管部门的监督管理。以上承诺如不属实,或者违反上述承诺的,本人依法依规承担相应的法律责任。')
  24 + .textIndent(24).fontSize(12).fontColor('#606266')
  25 + Row({space: 5}){
  26 + Checkbox({ group: 'password' })
  27 + .select(this.rememberSelect)
  28 + .selectedColor('#1890ff')
  29 + .shape(CheckBoxShape.ROUNDED_SQUARE)
  30 + .width(16).height(16)
  31 + .mark({
  32 + size: 10,
  33 + strokeWidth: 5
  34 + })
  35 + .onChange((value: boolean) => {
  36 + this.rememberSelect = value
  37 + })
  38 + Text('我已阅读《承诺书》,并严格按照承诺书《承诺书》内容执行').fontSize(12).fontColor('#606266')
  39 + }.width('100%').justifyContent(FlexAlign.Start)
  40 + Text(`请仔细阅读承诺书(${this.count}s后可关闭)`)
  41 + .fontSize(14).fontColor('#fff').fontWeight(600).textAlign(TextAlign.Center)
  42 + .margin({top: 60}).width('100%').border({width: {top: 1}, color: '#fff'}).padding({top: 10, bottom: 10})
  43 + .visibility(this.count > 0 ? Visibility.Visible : Visibility.None).backgroundColor('#1890ff')
  44 + .borderRadius(10).opacity(0.5)
  45 + Text('前往注册')
  46 + .fontSize(14).fontColor('#fff').fontWeight(600).textAlign(TextAlign.Center)
  47 + .margin({top: 60}).width('100%').border({width: {top: 1}, color: '#fff'}).padding({top: 10, bottom: 10})
  48 + .visibility(this.count == 0 ? Visibility.Visible : Visibility.None).backgroundColor('#1890ff')
  49 + .borderRadius(10)
  50 + .onClick(() => {
  51 + if(!this.rememberSelect){
  52 + return promptAction.showToast({message: '请选勾选同意承诺书'})
  53 + }
  54 + this.controller.close()
  55 + })
  56 + }.backgroundColor('#fff').width('100%').padding(10).borderRadius(10).height('100%')
  57 + }
  58 +}
  1 +import { promptAction } from '@kit.ArkUI'
  2 +import { updatePassword } from '../api/user'
  3 +@CustomDialog
  4 +export default struct updatePasswordDialog{
  5 + controller: CustomDialogController = new CustomDialogController({builder: ''})
  6 + @State oldPassword: string = ''
  7 + @State newPassword: string = ''
  8 + @State requirePassword: string = ''
  9 + build() {
  10 + Column(){
  11 + Row(){
  12 + Row(){
  13 + Image($r('app.media.require')).width(20)
  14 + Text('旧密码')
  15 + }.width(90)
  16 + TextInput({placeholder: '请输入旧密码', text: $$this.oldPassword})
  17 + .backgroundColor('#fff').layoutWeight(1).type(InputType.Password)
  18 + }.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
  19 + Row(){
  20 + Row(){
  21 + Image($r('app.media.require')).width(20)
  22 + Text('新密码')
  23 + }.width(90)
  24 + TextInput({placeholder: '请输入新密码', text: $$this.newPassword})
  25 + .backgroundColor('#fff').layoutWeight(1).type(InputType.Password)
  26 + }.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
  27 + Row(){
  28 + Row(){
  29 + Image($r('app.media.require')).width(20)
  30 + Text('确认密码')
  31 + }.width(90)
  32 + TextInput({placeholder: '请确认密码', text: $$this.requirePassword})
  33 + .backgroundColor('#fff').layoutWeight(1).type(InputType.Password)
  34 + }.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
  35 + Row({space: 10}){
  36 + Text('取消').layoutWeight(1).textAlign(TextAlign.Center).onClick(() => {
  37 + this.controller.close()
  38 + })
  39 + Text('确认').layoutWeight(1).fontColor('#1890ff').textAlign(TextAlign.Center)
  40 + .onClick(async () => {
  41 + if(this.oldPassword == '' && this.newPassword == '' && this.requirePassword == '') {
  42 + promptAction.showToast({
  43 + message: '请正确填写内容',
  44 + duration: 2000
  45 + })
  46 + } else if(this.newPassword == this.oldPassword) {
  47 + promptAction.showToast({
  48 + message: '新密码和旧密码不能相同',
  49 + duration: 2000
  50 + })
  51 + } else if(this.newPassword !== this.requirePassword) {
  52 + promptAction.showToast({
  53 + message: '两次密码输入不同',
  54 + duration: 2000
  55 + })
  56 + } else {
  57 + await updatePassword(this.oldPassword, this.newPassword)
  58 + promptAction.showToast({
  59 + message: '修改成功',
  60 + duration: 2000
  61 + })
  62 + this.controller.close()
  63 + }
  64 + })
  65 + }.width('100%').padding({top: 10, bottom: 10})
  66 + }.backgroundColor('#fff').width('100%')
  67 + .padding({top: 20,left: 13, right: 13})
  68 + }
  69 +}
  1 +import { AbilityConstant, UIAbility, Want } from '@kit.AbilityKit';
  2 +import { hilog } from '@kit.PerformanceAnalysisKit';
  3 +import { window } from '@kit.ArkUI';
  4 +
  5 +export default class EntryAbility extends UIAbility {
  6 + onCreate(want: Want, launchParam: AbilityConstant.LaunchParam): void {
  7 + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onCreate');
  8 + }
  9 +
  10 + onDestroy(): void {
  11 + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onDestroy');
  12 + }
  13 +
  14 + onWindowStageCreate(windowStage: window.WindowStage): void {
  15 + // Main window is created, set main page for this ability
  16 + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageCreate');
  17 +
  18 + windowStage.loadContent('pages/Login', (err) => {
  19 + if (err.code) {
  20 + hilog.error(0x0000, 'testTag', 'Failed to load the content. Cause: %{public}s', JSON.stringify(err) ?? '');
  21 + return;
  22 + }
  23 + hilog.info(0x0000, 'testTag', 'Succeeded in loading the content.');
  24 + });
  25 + }
  26 +
  27 + onWindowStageDestroy(): void {
  28 + // Main window is destroyed, release UI related resources
  29 + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onWindowStageDestroy');
  30 + }
  31 +
  32 + onForeground(): void {
  33 + // Ability has brought to foreground
  34 + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onForeground');
  35 + }
  36 +
  37 + onBackground(): void {
  38 + // Ability has back to background
  39 + hilog.info(0x0000, 'testTag', '%{public}s', 'Ability onBackground');
  40 + }
  41 +}
  1 +import { hilog } from '@kit.PerformanceAnalysisKit';
  2 +import { BackupExtensionAbility, BundleVersion } from '@kit.CoreFileKit';
  3 +
  4 +export default class EntryBackupAbility extends BackupExtensionAbility {
  5 + async onBackup() {
  6 + hilog.info(0x0000, 'testTag', 'onBackup ok');
  7 + }
  8 +
  9 + async onRestore(bundleVersion: BundleVersion) {
  10 + hilog.info(0x0000, 'testTag', 'onRestore ok %{public}s', JSON.stringify(bundleVersion));
  11 + }
  12 +}
  1 +import {
  2 + addParamsType,
  3 + LatestProjectTest,
  4 + LatestProjectDatum,
  5 + equipmentTest,
  6 + equipmentType,
  7 + companyPersonTest,
  8 + companyPersonRow,
  9 + reportDetailTest,
  10 + reportDetailData,
  11 + projectType,
  12 + RecordsList
  13 +} from '../api/recordsType'
  14 +import { quarterType, quarterTest } from '../api/options/optionsType'
  15 +import { getMaintenanceType, getLatestProjectList, getEquipmentList, addRecords, getCompanyPersonList, getReportDetail, updateRecords, getRecordsList } from '../api/originalRecords'
  16 +import { AxiosResponse } from '@ohos/axios'
  17 +import preferencesUtil from '../utils/preferences'
  18 +import { router, promptAction } from '@kit.ArkUI'
  19 +interface routerParams {
  20 + reportId: number
  21 +}
  22 +let params = router.getParams() as routerParams
  23 +let reportId: number | undefined = params?.reportId
  24 +// 查看原始记录编号是否存在
  25 +let queryReportNo = async (reportNo: string) => {
  26 + let res: AxiosResponse<RecordsList> = await getRecordsList({pageNum: 1, pageSize: 10, reportNo})
  27 + return res.data.total > 0
  28 +}
  29 +
  30 +// 模糊查询
  31 +//模糊查询1:利用字符串的indexOf方法
  32 +function searchByIndexOf(keyWord: string, list: equipmentType[]){
  33 + if(!(list instanceof Array)){
  34 + return ;
  35 + }
  36 + let len = list.length;
  37 + let arr: equipmentType[] = []
  38 + for(let i = 0;i < len;i++){
  39 + //如果字符串中不包含目标字符会返回-1
  40 + if(list[i].equipmentName.indexOf(keyWord) >= 0){
  41 + arr.push(list[i]);
  42 + }
  43 + }
  44 + return arr;
  45 +}
  46 +
  47 +@Entry
  48 +@Component
  49 +struct EditUser {
  50 + @Builder indicatorBuilder(icon: ResourceStr) {
  51 + Image(icon)
  52 + }
  53 + searchController: SearchController = new SearchController()
  54 + // 添加维保记录类型参数
  55 + @State addForm: addParamsType = {
  56 + reportName: '',
  57 + reportNo: '',
  58 + approvePerson: '',
  59 + approvePersonId: 0,
  60 + applyCompanyId: null,
  61 + applyCompanyName: '',
  62 + fireFacilities: '',
  63 + result: '',
  64 + equipment: '',
  65 + maintenancePeople: '',
  66 + maintenanceTime: '起始日期',
  67 + state: '',
  68 + reportType: '1',
  69 + reportTime: '',
  70 + maintenanceEndTime: '结束日期',
  71 + projectList: [],
  72 + equipmentList: [],
  73 + maintenancePeopleList: [],
  74 + technicalDirectorId: ''
  75 + }
  76 + personId = preferencesUtil.get('XF_PERSON_ID', 0)
  77 + // 回显数据使用
  78 + @State viewEquipmentList: string[] = []
  79 + @State fireFacilitiesList: string[] = []
  80 + @State PeopleList: string[] = []
  81 + @State isEdit: boolean = false
  82 + // 公司在职人员列表
  83 + @State companyPersonList: companyPersonRow[] = []
  84 + // 选择维保记录类型
  85 + @State recordsType: quarterType[] = []
  86 + // 主要消防措施选择列表
  87 + @State latestProjectList: LatestProjectDatum[] = []
  88 + // 仪器设备选择列表
  89 + @State equipmentList: equipmentType[] = []
  90 + // 初始设备列表
  91 + @State initEquipmentList: equipmentType[] = []
  92 + @State errorMsg: string = ''
  93 + flag: boolean = true
  94 + async aboutToAppear() {
  95 + this.isEdit = reportId !== undefined
  96 + if(reportId){
  97 + this.addForm.reportId = reportId
  98 + const res: AxiosResponse<reportDetailTest> = await getReportDetail(reportId)
  99 + let result: reportDetailData = res.data.data
  100 + this.addForm.reportName = result.reportName
  101 + this.addForm.applyCompanyName = result.applyCompanyName
  102 + this.addForm.reportNo = result.reportNo
  103 + this.addForm.reportType = result.reportType
  104 + this.addForm.maintenanceTime = result.maintenanceTime
  105 + this.addForm.maintenanceEndTime = result.maintenanceEndTime
  106 + this.addForm.equipmentList = result.equipment.split(',')
  107 + this.addForm.fireFacilities = result.fireFacilities
  108 + this.addForm.maintenancePeople = result.maintenancePeople
  109 + this.addForm.result = result.result.replace(/<.*?>/g, '')
  110 + this.addForm.state = result.state
  111 + this.addForm.technicalDirectorId = result.technicalDirectorId
  112 + this.addForm.maintenancePeopleList = result.technicalDirectorId?.split(',')
  113 + this.addForm.projectList = result.projectList.map(item => {
  114 + return { projectId: item.projectId } as projectType
  115 + })
  116 + this.fireFacilitiesList = this.addForm.fireFacilities.split('、')
  117 + this.viewEquipmentList = result.equipment.split(',')
  118 + this.PeopleList = result.technicalDirectorId?.split(',') || []
  119 + }
  120 + getMaintenanceType().then((res: AxiosResponse<quarterTest>) => {
  121 + this.recordsType = res.data.data
  122 + })
  123 + // 获取消防设施
  124 + getLatestProjectList(this.addForm.reportType as string).then((res: AxiosResponse<LatestProjectTest>) => {
  125 + this.latestProjectList = res.data.data
  126 + })
  127 + const companyId: number = preferencesUtil.get('XF_COMPANY_ID', 0) as number
  128 + this.addForm.companyId = companyId
  129 + // 获取仪器设备
  130 + getEquipmentList({pageNum: 1, pageSize: 500, companyId: companyId }).then((res: AxiosResponse<equipmentTest>) => {
  131 + this.equipmentList = res.data.rows
  132 + this.initEquipmentList = res.data.rows
  133 + })
  134 + getCompanyPersonList({pageNum: 1, pageSize: 200, companyId: companyId, state: '2' }).then((res: AxiosResponse<companyPersonTest>) => {
  135 + this.companyPersonList = res.data.rows
  136 + })
  137 + }
  138 +
  139 + @State changeValue: string = '';
  140 + @State text: string = "请选择维保记录类型"
  141 + @State index: number = 2
  142 + @State space: number = 8
  143 + @State arrowPosition: ArrowPosition = ArrowPosition.END
  144 +
  145 + build() {
  146 + Column(){
  147 + Scroll(){
  148 + Column(){
  149 + Column(){
  150 + Row(){
  151 + Row(){
  152 + Image($r('app.media.require')).width(20)
  153 + Text('项目名称')
  154 + }.width(90)
  155 + TextInput({placeholder: '请输入项目名称', text: $$this.addForm.reportName})
  156 + .backgroundColor('#fff').layoutWeight(1)
  157 + }.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
  158 + Text('原始记录编号一经创建,不可修改,请谨慎').fontSize(12).fontColor('#ffba00').width('100%').textAlign(TextAlign.Start)
  159 + .padding({top: 10, left: 10})
  160 + Row(){
  161 + Row(){
  162 + Image($r('app.media.require')).width(20)
  163 + Text('项目编号')
  164 + }.width(90)
  165 + Row({ space: 5 }){
  166 + TextInput({placeholder: '请输入项目编号', text: $$this.addForm.reportNo})
  167 + .backgroundColor('#fff').showError(this.errorMsg).onBlur(async () => {
  168 + this.errorMsg = await queryReportNo(this.addForm.reportNo as string) ? '此原始记录编号已被使用' : ''
  169 + })
  170 + }.layoutWeight(1)
  171 + }.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
  172 + .visibility(this.isEdit ? Visibility.None : Visibility.Visible)
  173 + Row(){
  174 + Row(){
  175 + Image($r('app.media.require')).width(20)
  176 + Text('项目编号')
  177 + }.width(90)
  178 + Row({ space: 5 }){
  179 + Text(this.addForm.reportNo).fontColor('#c0c4cc')
  180 + .fontSize(16).padding({top: 8, bottom: 8, left: 16, right: 16})
  181 + }.layoutWeight(1)
  182 + }.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
  183 + .visibility(this.isEdit ? Visibility.Visible : Visibility.None)
  184 + Row(){
  185 + Row(){
  186 + Image($r('app.media.require')).width(20)
  187 + Text('维保起始日期')
  188 + }.width(120)
  189 + Text(this.addForm.maintenanceTime).padding({top: 8, bottom: 8, left: 16, right: 16})
  190 + .backgroundColor('#fff').layoutWeight(1).fontColor('#000').onClick(() => {
  191 + CalendarPickerDialog.show({
  192 + onAccept: (value) => {
  193 + this.addForm.maintenanceTime = JSON.stringify(value).slice(1, 11)
  194 + }
  195 + })
  196 + })
  197 + }.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
  198 + Row(){
  199 + Row(){
  200 + Image($r('app.media.require')).width(20)
  201 + Text('维保结束日期')
  202 + }.width(120)
  203 + Text(this.addForm.maintenanceEndTime).padding({top: 8, bottom: 8, left: 16, right: 16})
  204 + .backgroundColor('#fff').layoutWeight(1).fontColor('#000').onClick(() => {
  205 + CalendarPickerDialog.show({
  206 + onAccept: (value) => {
  207 + this.addForm.maintenanceEndTime = JSON.stringify(value).slice(1, 11)
  208 + }
  209 + })
  210 + })
  211 + }.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
  212 + Column({space: 10}){
  213 + Row(){
  214 + Image($r('app.media.require')).width(20)
  215 + Text('项目负责人')
  216 + }.width('100%').justifyContent(FlexAlign.Start)
  217 + Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Start, alignItems: ItemAlign.Start, wrap: FlexWrap.Wrap }) {
  218 + ForEach(this.companyPersonList, (children: companyPersonRow) => {
  219 + Row() {
  220 + Radio({ value: children.personId.toString(), group: 'radioGroup',
  221 + indicatorType:RadioIndicatorType.TICK,
  222 + }).height(14).width(14).checked(this.addForm.approvePersonId == children.personId)
  223 + Text(children.personName).fontSize(14)
  224 + }
  225 + })
  226 + Text('公司暂无人员').visibility(this.companyPersonList.length == 0 ? Visibility.Visible : Visibility.None)
  227 + }.margin({right:15})
  228 + }.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
  229 + Column({space: 10}){
  230 + Row(){
  231 + Image($r('app.media.require')).width(20)
  232 + Text('维保人员')
  233 + }.width('100%').justifyContent(FlexAlign.Start)
  234 + Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Start, alignItems: ItemAlign.Start, wrap: FlexWrap.Wrap }) {
  235 + Row(){
  236 + CheckboxGroup({ group: 'checkboxGroup3' })
  237 + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE)
  238 + .selectedColor('#1890ff')
  239 + .onChange((itemName: CheckboxGroupResult) => {
  240 + this.addForm.maintenancePeople = itemName.name.join(',')
  241 + })
  242 + .mark({
  243 + strokeColor:Color.White,
  244 + size: 12,
  245 + strokeWidth: 2
  246 + })
  247 + .unselectedColor('#eee')
  248 + .width(15)
  249 + .height(15)
  250 + Text('选择全部').fontSize(14)
  251 + }.margin({right: 10})
  252 + ForEach(this.companyPersonList, (children: companyPersonRow) => {
  253 + Row(){
  254 + Checkbox({ name: children.personName, group: 'checkboxGroup3' })
  255 + .selectedColor('#1890ff')
  256 + .select(this.PeopleList.includes(children.personId.toString()))
  257 + .shape(CheckBoxShape.ROUNDED_SQUARE)
  258 + .onChange((value: boolean) => {
  259 + if(value){
  260 + this.addForm.maintenancePeopleList?.push(children.personId.toString())
  261 + }else {
  262 + this.addForm.maintenancePeopleList = this.addForm.maintenancePeopleList?.filter((item: string) => item !== children.personId.toString())
  263 + }
  264 + this.addForm.technicalDirectorId = this.addForm.maintenancePeopleList?.join(',')
  265 + })
  266 + .mark({
  267 + strokeColor:Color.White,
  268 + size: 12,
  269 + strokeWidth: 2
  270 + })
  271 + .unselectedColor('#eee')
  272 + .width(15)
  273 + .height(15)
  274 + Text(children.personName).fontSize(14)
  275 + }.margin({right: 10})
  276 + })
  277 + Text('公司暂无人员').visibility(this.companyPersonList.length == 0 ? Visibility.Visible : Visibility.None)
  278 + }.margin({right:15})
  279 + }.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
  280 + Column(){
  281 + Row(){
  282 + Image($r('app.media.require')).width(20)
  283 + Text('消防设施使用管理单位')
  284 + }.justifyContent(FlexAlign.Start).width('100%')
  285 + TextInput({placeholder: '请输入消防设施管理单位', text: $$this.addForm.applyCompanyName})
  286 + .backgroundColor('#fff')
  287 + }.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
  288 + Row(){
  289 + Row(){
  290 + Text('备注')
  291 + }.width(100)
  292 + TextArea({
  293 + text: $$this.addForm.result,
  294 + placeholder: '请输入内容'
  295 + }).layoutWeight(1).height(80).borderRadius(5).backgroundColor('#fff')
  296 + .border({width: 1, color: "#eee"})
  297 + }.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
  298 + Column(){
  299 + Row(){
  300 + Image($r('app.media.require')).width(20)
  301 + Text('维保记录类型')
  302 + }.width('100%').justifyContent(FlexAlign.Start).margin({bottom: 8})
  303 + Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.Start, alignItems: ItemAlign.Start, wrap: FlexWrap.Wrap }) {
  304 + ForEach(this.recordsType, (item: quarterType) => {
  305 + Stack(){
  306 + Row() {
  307 + Radio({ value: item.dictValue, group: 'radioGroup' })
  308 + .radioStyle({ checkedBackgroundColor: '#1890ff' })
  309 + .height(15)
  310 + .width(15)
  311 + .checked(item.dictValue == this.addForm.reportType)
  312 + Text(item.dictLabel)
  313 + }.margin({right: 5,bottom: 5})
  314 + Row().width(80).height(30).backgroundColor(Color.White).opacity(0.1)
  315 + .onClick(() => {
  316 + this.addForm.reportType = item.dictValue
  317 + if(this.flag) {
  318 + this.addForm.projectList = []
  319 + this.fireFacilitiesList = []
  320 + this.addForm.fireFacilities = ''
  321 + this.flag = false
  322 + getLatestProjectList(item.dictValue).then((res: AxiosResponse<LatestProjectTest>) => {
  323 + this.latestProjectList = res.data.data
  324 + this.flag = true
  325 + })
  326 + }
  327 + })
  328 + }
  329 + })
  330 + }
  331 + }.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
  332 + Column({space: 10}){
  333 + Row(){
  334 + Image($r('app.media.require')).width(20)
  335 + Text('主要消防设施')
  336 + }.width('100%').justifyContent(FlexAlign.Start)
  337 + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center, wrap: FlexWrap.Wrap }) {
  338 + Row(){
  339 + CheckboxGroup({ group: 'checkboxGroup' })
  340 + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE)
  341 + .selectedColor('#1890ff')
  342 + .onChange((itemName: CheckboxGroupResult) => {
  343 + this.addForm.fireFacilities = itemName.name.join('、')
  344 + })
  345 + .mark({
  346 + strokeColor:Color.White,
  347 + size: 12,
  348 + strokeWidth: 2
  349 + })
  350 + .unselectedColor('#eee')
  351 + .width(15)
  352 + .height(15)
  353 + Text('选择全部').fontSize(14)
  354 + }.margin({right: 10})
  355 + ForEach(this.latestProjectList, (children: LatestProjectDatum) => {
  356 + Row(){
  357 + Checkbox({ name: children.projectName, group: 'checkboxGroup' })
  358 + .selectedColor('#1890ff')
  359 + .select(this.fireFacilitiesList.includes(children.projectName))
  360 + .shape(CheckBoxShape.ROUNDED_SQUARE)
  361 + .onChange((value) => {
  362 + if(value){
  363 + this.addForm.projectList?.push({ projectId: children.projectId })
  364 + } else {
  365 + this.addForm.projectList = this.addForm.projectList?.filter((item) => item.projectId !== children.projectId)
  366 + }
  367 + })
  368 + .mark({
  369 + strokeColor:Color.White,
  370 + size: 12,
  371 + strokeWidth: 2
  372 + })
  373 + .unselectedColor('#eee')
  374 + .width(15)
  375 + .height(15)
  376 + Text(children.projectName).fontSize(14)
  377 + }.margin({right: 10})
  378 + })
  379 + }.margin({right:15})
  380 + }.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
  381 + Column({space: 10}){
  382 + Row(){
  383 + Row(){
  384 + Text('仪器设备')
  385 + }.margin({right: 10})
  386 + Search({ placeholder: '请输入关键字' })
  387 + .searchButton('搜索', {
  388 + fontSize: 12
  389 + })
  390 + .width('95%')
  391 + .height(30)
  392 + .backgroundColor('#fff')
  393 + .placeholderColor(Color.Grey)
  394 + .placeholderFont({ size: 12, weight: 400 })
  395 + .textFont({ size: 12, weight: 400 })
  396 + .layoutWeight(1)
  397 + .onSubmit((value) => {
  398 + if(value.trim() == '') {
  399 + this.equipmentList = this.initEquipmentList
  400 + } else {
  401 + this.equipmentList = searchByIndexOf(value, this.initEquipmentList) as equipmentType[]
  402 + }
  403 + })
  404 + }.width('100%').justifyContent(FlexAlign.Start)
  405 + Flex({ justifyContent: FlexAlign.Start, alignItems: ItemAlign.Center, wrap: FlexWrap.Wrap }) {
  406 + Row(){
  407 + CheckboxGroup({ group: 'checkboxGroup2' })
  408 + .checkboxShape(CheckBoxShape.ROUNDED_SQUARE)
  409 + .selectedColor('#1890ff')
  410 + .onChange((itemName: CheckboxGroupResult) => {
  411 + this.addForm.equipmentList = itemName.name
  412 + this.addForm.equipment = itemName.name.join(',')
  413 + })
  414 + .mark({
  415 + strokeColor:Color.White,
  416 + size: 12,
  417 + strokeWidth: 2
  418 + })
  419 + .unselectedColor('#eee')
  420 + .width(15)
  421 + .height(15)
  422 + Text('选择全部').fontSize(14)
  423 + }.margin({right: 10})
  424 + ForEach(this.equipmentList, (children: equipmentType) => {
  425 + Row(){
  426 + Checkbox({ name: children.equipmentName, group: 'checkboxGroup2' })
  427 + .selectedColor('#1890ff')
  428 + .select(this.viewEquipmentList.includes(children.equipmentName))
  429 + .shape(CheckBoxShape.ROUNDED_SQUARE)
  430 + .mark({
  431 + strokeColor:Color.White,
  432 + size: 12,
  433 + strokeWidth: 2
  434 + })
  435 + .unselectedColor('#eee')
  436 + .width(15)
  437 + .height(15)
  438 + Text(children.equipmentName).fontSize(14)
  439 + }.margin({right: 10})
  440 + })
  441 + }.margin({right:15})
  442 + }.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
  443 + }.backgroundColor('#fff').width('100%').padding({left: 5, right: 5}).borderRadius(10)
  444 + }.padding(10).margin({bottom: 20, top: 10})
  445 + }.layoutWeight(1).scrollBar(BarState.Off)
  446 + Row(){
  447 + Text('提交').borderRadius(5).width('100%').height(30).fontColor('#fff')
  448 + .backgroundColor('#1B65FD').fontSize(14).textAlign(TextAlign.Center)
  449 + .onClick(async () => {
  450 + if(this.addForm.reportName == '') {
  451 + return promptAction.showToast({message: '项目名称为必填项'})
  452 + } else if(this.addForm.reportNo == '') {
  453 + return promptAction.showToast({message: '项目编号为必填项'})
  454 + } else if(this.addForm.applyCompanyName == ''){
  455 + return promptAction.showToast({message: '消防设施管理单位为必填项'})
  456 + } else if(this.addForm.maintenanceTime == '请选择起始日期' || this.addForm.maintenanceEndTime == '请选择结束日期'){
  457 + return promptAction.showToast({message: '维保日期为必填项'})
  458 + } else if(this.addForm.fireFacilities == ''){
  459 + return promptAction.showToast({message: '至少选择一下消防设施'})
  460 + } else if(this.addForm.maintenancePeople == ''){
  461 + return promptAction.showToast({message: '请选择维保人员'})
  462 + }
  463 + if(this.errorMsg !== '') {
  464 + return promptAction.showToast({message: '校验失败'})
  465 + }
  466 + if(!this.addForm.maintenancePeopleList?.includes(this.personId.toString())){
  467 + return promptAction.showToast({message: '本人必须在维护人员中'})
  468 + }
  469 + if(this.isEdit){
  470 + console.log(JSON.stringify(this.addForm))
  471 + await updateRecords(this.addForm)
  472 + promptAction.showToast({
  473 + message: '更新成功'
  474 + })
  475 + } else {
  476 + this.addForm.maintenanceDate = [this.addForm.maintenanceTime as string, this.addForm.maintenanceEndTime as string]
  477 + await addRecords(this.addForm)
  478 + promptAction.showToast({
  479 + message: '添加成功'
  480 + })
  481 + }
  482 + })
  483 + }.width('100%').height(40).backgroundColor('#fff').padding({left: 10, right: 10})
  484 + }.width('100%').height('100%').backgroundColor('#f2f3f7')
  485 + }
  486 +}
  1 +import preferencesUtil from '../utils/preferences'
  2 +import { promptAction } from '@kit.ArkUI';
  3 +import { AxiosResponse } from '@ohos/axios'
  4 +import { headerTest, headerRow, companyData } from '../api/userType'
  5 +import { getHeaderInfo, updateHeaderInfo, addHeaderInfo } from '../api/user'
  6 +
  7 +let companyId = preferencesUtil.get('XF_COMPANY_ID', 65) as number
  8 +
  9 +@Entry
  10 +@Component
  11 +struct EditUser {
  12 + @Builder indicatorBuilder(icon: ResourceStr) {
  13 + Image(icon)
  14 + }
  15 + @State companyInfo: companyData = {
  16 + createBy: null,
  17 + createTime: null,
  18 + updateBy: null,
  19 + updateTime: '',
  20 + remark: null,
  21 + companyId: 65,
  22 + companyName: '',
  23 + province: '',
  24 + city: '',
  25 + county: '',
  26 + address: '',
  27 + legalPerson: null,
  28 + lpTel: null,
  29 + linkMan: '',
  30 + lmTel: '',
  31 + companyTel: null,
  32 + fax: null,
  33 + postCode: null,
  34 + email: '',
  35 + website: null,
  36 + floorage: 0,
  37 + siteVoucher: '',
  38 + businessLicenseNo: '',
  39 + businessStartTime: null,
  40 + businessEndTime: null,
  41 + businessLicensePic: '',
  42 + businessScope: null,
  43 + peopleNum: 0,
  44 + companyIntroduce: null,
  45 + registeredCapital: null,
  46 + compangyPic: '',
  47 + memo: null,
  48 + state: '',
  49 + companyType: '',
  50 + isShow: null,
  51 + isValidVedio: null,
  52 + userId: 0,
  53 + username: '',
  54 + level: null,
  55 + regionCode: null,
  56 + levelModifyDate: null,
  57 + endTime: '',
  58 + }
  59 + @State isEdit: boolean = false
  60 + @State headerInfo: headerRow = {
  61 + account: '',
  62 + bank: '',
  63 + address: '',
  64 + phone: '',
  65 + companyId: '',
  66 + companyName: '',
  67 + businessLicenseNo: ''
  68 + }
  69 + async onPageShow() {
  70 + if(preferencesUtil.get('XF_COMPANY_INFO', '') !== '') {
  71 + this.companyInfo = JSON.parse(preferencesUtil.get('XF_COMPANY_INFO', '') as string)
  72 + this.headerInfo.businessLicenseNo = this.companyInfo.businessLicenseNo
  73 + this.headerInfo.companyName = this.companyInfo.companyName
  74 + }
  75 + let res: AxiosResponse<headerTest> = await getHeaderInfo({pageSize: 1, pageNum: 1, companyId: companyId})
  76 + this.isEdit = res.data.rows.length > 0
  77 + if(res.data.rows.length > 0){
  78 + this.headerInfo = res.data.rows[0]
  79 + }
  80 + }
  81 + build() {
  82 + Column(){
  83 + Column(){
  84 + Column(){
  85 + Row(){
  86 + Row(){
  87 + Image($r('app.media.require')).width(20)
  88 + Text('公司名称')
  89 + }.margin({right: 15})
  90 + Text(this.headerInfo?.companyName).layoutWeight(1).padding({top: 10, bottom: 10})
  91 + }.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
  92 + Row(){
  93 + Row(){
  94 + Image($r('app.media.require')).width(20)
  95 + Text('统一信用代码')
  96 + }.margin({right: 15})
  97 + Text(this.headerInfo?.businessLicenseNo).layoutWeight(1).padding({top: 10, bottom: 10})
  98 + }.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
  99 + Row(){
  100 + Row(){
  101 + Image($r('app.media.require')).width(20)
  102 + Text('对公账户')
  103 + }
  104 + TextInput({placeholder: '请输入对公账户', text: $$this.headerInfo.account})
  105 + .backgroundColor('#fff').layoutWeight(1).type(InputType.Number)
  106 + }.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
  107 + Row(){
  108 + Row(){
  109 + Image($r('app.media.require')).width(20)
  110 + Text('开户行')
  111 + }
  112 + TextInput({placeholder: '请输入开户行', text: $$this.headerInfo.bank})
  113 + .backgroundColor('#fff').layoutWeight(1)
  114 + }.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
  115 + Row(){
  116 + Row(){
  117 + Image($r('app.media.require')).width(20)
  118 + Text('公司电话')
  119 + }
  120 + TextInput({placeholder: '请输入公司电话', text: $$this.headerInfo.phone})
  121 + .backgroundColor('#fff').layoutWeight(1)
  122 + }.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
  123 + Row(){
  124 + Row(){
  125 + Image($r('app.media.require')).width(20)
  126 + Text('公司地址')
  127 + }
  128 + TextInput({placeholder: '请输入公司地址', text: $$this.headerInfo.address})
  129 + .backgroundColor('#fff').layoutWeight(1)
  130 + }.border({width: {bottom: 1}, color: '#eee'}).padding({top: 10, bottom: 10})
  131 + }.backgroundColor('#fff').width('100%').padding({left: 5, right: 5}).borderRadius(10)
  132 + }.padding(10).margin({bottom: 20, top: 10}).width('100%').layoutWeight(1)
  133 + Row({ space: 10}){
  134 + Text('提交').borderRadius(5).layoutWeight(1).height(30).fontColor('#fff')
  135 + .backgroundColor('#1B65FD').fontSize(14).textAlign(TextAlign.Center)
  136 + .onClick(async () => {
  137 + if(this.isEdit) {
  138 + await updateHeaderInfo(this.headerInfo)
  139 + promptAction.showToast({
  140 + message: '修改成功',
  141 + duration: 2000
  142 + })
  143 + } else {
  144 + await addHeaderInfo(this.headerInfo)
  145 + promptAction.showToast({
  146 + message: '新增成功',
  147 + duration: 2000
  148 + })
  149 + }
  150 + })
  151 + }.width('100%').height(40).backgroundColor('#fff').padding({left: 10, right: 10})
  152 + }.width('100%').height('100%').backgroundColor('#f2f3f7')
  153 + }
  154 +}
  1 +@Entry
  2 +@Component
  3 +struct CancellationAgreement {
  4 + build() {
  5 + Scroll(){
  6 + Column({space: 10}){
  7 + Text('消防维保助手账号注销协议').textAlign(TextAlign.Center).width('100%')
  8 + Column({space: 10}){
  9 + Text('尊敬的用户,您好!在您正式开始下一步消防维保助手账号注销流程前,我们特意为您作出如下重要提示:注销消防维保助手账号是不可恢复的操作,注销消防维保助手账号后,您将无法找回您通过该账号添加或绑定的任何内容和信息,即使您选择相同的身份证号/统一社会信用代码再次注册账号并使 用消防维保助手产品及服务。').fontSize(12)
  10 + Text('为了避免给您带来不便,请您在注销消防维保助手账号之前慎重考虑,如您经过慎重考虑后仍决定注销消防维保助手账号的,请您务必先行仔细阅读并充分理解本《消防维保助手账号注销协议》(下或称“本协议”)的全部内容,特别是加粗部分。').fontSize(12)
  11 + Text('您应该具备中华人民共和国法律规定的与您签署本协议之行为相应的民事行为能力。若您不具备与您签署本协议之行为相适应的民事行为能力,请您在您的监护人陪同下阅读并进行相应操作,并确保监护人同意您的所有行为。在此情况下,您及您的监护人应依照法律相关规定承担由此导致的一切后果。').fontSize(12)
  12 + Text('本协议未尽事宜,可参照《消防维保助手隐私政策》。如本协议与前述规则存在冲突的,以本协议为准。如您对本协议有任何疑问,请发送邮件至我们的客服邮箱:【weiyi@crgx.net】。您阅读《消防维保助手账号注销协议》并点击“我已阅读并同意注销协议”的,即视为您同意与广西世纪创软信息技术有限公司达成本协议,并自愿接受本协议所有条款的约束。').fontSize(12)
  13 + Text('一、消防维保助手账号注销后您应当承担的后果').fontSize(12)
  14 + Text('您理解并同意,消防维保助手账号一旦注销,您自愿承担其所(可能)产生的后果,该等后果包括但不限于:\n' +
  15 + '1. 消防维保助手账号注销后,您将无法再以该账号登录/使用/继续使用消防维保助手产品及服务;且该账号将无法被恢复,即使您在账号注销后以相同身份证号/统一社会信用代码再次向广西世纪创软信息技术有限公司申请注册消防维保助手账号,此时该账号将默认为新的注册账号。因此,我们善意地提醒您在申请注销前对需要备份的内容和信息提前自行做好备份。\n' +
  16 + '2. 消防维保助手账号注销后,您曾通过该账号登录、使用消防维保助手产品及服务下的所有内容、信息、数据、记录将会被删除或匿名化处理(但法律法规另有规定除外),前述内容、信息、数据、记录被删除或匿名化处理后您无法再检索、访问、传输、获取、继续使用和找回,也无权要求我们找回。该等内容、信息、数据或记录包括但不限于:\n' +
  17 + '(1)该账号下您的个人信息(包括但不限于个人用户:个人照片、身份证国徽面照片、身份证人像面照片、姓名、手机号、邮箱、性别、出生日期;机构用户:公司名称、所在地区、营业执照编号、营业执照扫描件、联系人姓名、联系人手机号、联系人邮箱等);\n' +
  18 + '(2)该账号下您曾创建和编辑的内容(包括但不限于维保原始记录、确认公司从业);\n' +
  19 + '(3)该账号下的其他所有内容、信息、数据、记录。\n' +
  20 + '3. 消防维保助手账号注销后,广西世纪创软信息技术有限公司将会对该账号下的全部权益(如有)做清除处理。您理解并同意通过注销消防维保助手账号的方式放弃该账号在消防维保助手产品及服务使用期间已产生但尚未消耗完毕的权益及未来可能产生预期利益,该等权益或预期利益包括但不限于:该账号下您充值的会费未到期状态下可使用的功能等,该账号下其他已产生但尚未消耗的权益或未来可能产生的预期利益。\n' +
  21 + '4. 消防维保助手账号一旦注销,您通过该账号与我们曾签署过的相关用户协议、其他权利义务文件将相应终止,除非广西世纪创软信息技术有限公司与您已约定继续有效或法律法规另有规定。\n' +
  22 + '5. 其他因消防维保助手账号注销所(可能)产生的后果。').fontSize(12)
  23 + Text('在您向广西世纪创软信息技术有限公司申请/继续申请注销消防维保助手账号之前,为保障您的账号安全和财产权益,您应确保您申请注销的消防维保助手账号已同时具备以下条件,该等条件包括但不限于:\n' +
  24 + '1.该账号是您本人通过官方渠道进行注册的,且符合广西世纪创软信息技术有限公司所有平台规范。\n' +
  25 + '2.该账号无任何安全风险,包括但不限于1)该账号在申请注销期间无未处理完毕的(被)投诉、举报;2)该账号在申请注销期间未处于非法的被检查状态、被限制的状态;3)该账号在最近1个月内无异常登录记录、无修改密码等敏感操作;4)以及无其他安全风险。\n' +
  26 + '3.机构账号的会费权益已过期。即使该账户的会费从同意消防维保助手账号注册协议开始计算到权益终止不超过15个自然日的时间,您均同意以注销账号的方式放弃前述相关权益。\n' +
  27 + '4.不存在任何由于该账号被注销而导致的未了解的合同关系与其他基于该账号的存在而产生的或维持的权利义务,以及广西世纪创软信息技术有限公司认为注销该账号会由此产生未了结的权利义务而产生纠纷的情况。\n' +
  28 + '5.其他应满足的条件。\n' +
  29 + '您需要首先尝试自行核实并确认是否满足上述全部条件,如您无法自行处理或在处理过程中有任何疑问,可通过邮件weiyi@crgx.net联系协助处理。').fontSize(12)
  30 + Text('三、如何注销消防维保助手账号?').fontSize(12)
  31 + Text('1. 您需按照广西世纪创软信息技术有限公司官方渠道提供的操作指引进行注销操作。在消防维保助手移动端,完成注销账号的操作。\n' +
  32 + '2. 您已经仔细阅读与充分理解、且同意本《消防维保助手账号注销协议》的全部内容;同时您已自行检查并确认满足本协议的第二条项下账号注销所具备的全部条件。\n' +
  33 + '3. 在您满足本协议第三条第2款后,我们将根据您的账号安全状态以及使用情况进行初步检测,以初步判断该账号是否符合注销条件。如我们在初步判断后,发现您的账号不符和注销条件的,您的申请可能会失败,您需要在满足全部注销条件后再行申请注销。如我们对您的账号初步检测和判断后认为其初步符合注销条件的,我们将对您进行身份验证,以确保您系该账号的合法使用人,有权对该账号提交注销申请。您理解并同意,我们对您的账号是否符合注销条件可能仅做初步检测和判断,部分条件依赖于您的自行检查和确认;您确保已经自行检查并确认满足本协议第二条项下注销所需具备的全部条件,并承诺接受由此(可能)带来的所有后果。\n' +
  34 + '4. 在您通过身份验证和各项提醒并最终点击“提交注销申请”后,视为您已成功向广西世纪创软信息技术有限公司提交了消防维保助手账号注销申请,但是此并不意味着该账号必然完全符合注销条件。提交申请后,账号立即被冻结,无法正常使用,广西世纪创软信息技术有限公司会在15个工作日内,通过weiyi@crgx.net邮箱发送审核结果到您注册时填写的邮箱中。如消防维保助手账号注销申请未通过,则在收到邮件之时起,该申请注销账号恢复正常使用;如消防维保助手账号注销申请通过,则该申请注销账号将被永久注销,不得恢复。\n' +
  35 + '5. 您理解并同意,在您申请注销消防维保助手账号期间,如我们需要对相关交易、投诉或其他与您的账号相关的事项进行核实的,或者我们有其他合理的理由的,我们有权冻结您的该账号且暂时不为您提供注销服务。\n' +
  36 + '6. 您理解并同意,即使您的消防维保助手账号被注销了,也并不代表减轻或免除您理应根据相关法律法规、相关协议、规则等(可能)需要承担的法律责任。\n').fontSize(12)
  37 + Text('四、 适用法律及争议解决').fontSize(12)
  38 + Text('本协议适用中华人民共和国的法律,并且排除一切冲突法规定的适用。如出现纠纷,双方应尽量友好协商解决;协商不成时,任何乙方均有权向被告所在地人民法院提起诉讼').fontSize(12)
  39 + Text('广西世纪创软信息技术有限公司').fontSize(12)
  40 +
  41 + Text('我已阅读并同意协议').width('100%').height(30).fontSize(14).fontColor('#fff').borderWidth(1).borderColor('#ff4949')
  42 + .backgroundColor('#ff4949').textAlign(TextAlign.Center).borderRadius(4)
  43 + }.alignItems(HorizontalAlign.Start)
  44 + }.width('100%').alignItems(HorizontalAlign.Start).padding(10)
  45 + }
  46 + }
  47 +}