Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
jump_hm_warehouse
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
毛勇泽
jump_hm_warehouse
Commits
475994b0
Commit
475994b0
authored
Jan 29, 2024
by
huangqy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
系统配置的相关
parent
dfeccf20
显示空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
165 行增加
和
20 行删除
+165
-20
index.ets
common/index.ets
+1
-0
WzhxdmDao.ets
common/src/main/ets/db/dao/WzhxdmDao.ets
+0
-1
XtpzInfoDao.ets
common/src/main/ets/db/dao/XtpzInfoDao.ets
+25
-0
NativeSql.ets
common/src/main/ets/db/sql/NativeSql.ets
+13
-1
XtpzInfoModel.ets
entry/src/main/ets/model/XtpzInfoModel.ets
+27
-0
General.ets
entry/src/main/ets/pages/sub_systemMaintenance/General.ets
+70
-13
GeneralDialog.ets
entry/src/main/ets/view/GeneralDialog/GeneralDialog.ets
+29
-5
没有找到文件。
common/index.ets
View file @
475994b0
...
...
@@ -27,6 +27,7 @@ export {HjInfo} from './src/main/ets/entity/HjInfo';
export {WzPositionClass} from './src/main/ets/entity/WzPositionClass';
export {WzdmDao} from './src/main/ets/db/dao/WzdmDao';
export {WzhxdmDao} from './src/main/ets/db/dao/WzhxdmDao';
export {XtpzInfoDao} from './src/main/ets/db/dao/XtpzInfoDao'
export {Wzdm} from './src/main/ets/entity/Wzdm';
export {Wzhxdm} from './src/main/ets/entity/Wzhxdm';
export {DrInfo} from './src/main/ets/entity/DrInfo';
...
...
common/src/main/ets/db/dao/WzhxdmDao.ets
View file @
475994b0
import relationalStore from '@ohos.data.relationalStore';
import { Wzhxdm } from '../../entity/Wzhxdm';
import { Logger } from '../../utils/Logger';
import BaseTable, { ValueType } from '../BaseTable';
import { Table } from '../decorator/Decorators';
import { NativeSql } from '../sql/NativeSql';
...
...
common/src/main/ets/db/dao/XtpzInfoDao.ets
View file @
475994b0
...
...
@@ -52,4 +52,28 @@ export class XtpzInfoDao extends BaseTable<XtpzInfo> {
getCreateTableSql(): string {
return NativeSql.getXtpzInfoTable();
}
async updateSystemSql(params) {
try {
let val_sql = NativeSql.update_system_sql(params)
let db = await this.futureDb;
let rs = await db.executeSql(val_sql);
return rs;
} catch (e) {
throw new Error('[插入异常]|' + e)
}
}
async insertSystemSql(params) {
try {
let val_sql = NativeSql.insert_system_sql(params)
let db = await this.futureDb;
let rs = await db.executeSql(val_sql);
return rs;
} catch (e) {
throw new Error('[插入异常]|' + e)
}
}
}
\ No newline at end of file
common/src/main/ets/db/sql/NativeSql.ets
View file @
475994b0
import { Bggl } from '../../entity/Bggl';
import { dateUtils, uuid } from '../../utils/util';
import { dateUtils, uuid
, isEmpty
} from '../../utils/util';
export class NativeSql {
/**
...
...
@@ -193,6 +193,18 @@ WHERE
return `update tab_bzgl_knzy_app_wzcrk set crkrq = '${time}',ydh = '${params.ydh}' ,dec = '${params.dec}' where guid = '${params.wzcrkguid}'`
}
// 新增系统信息
static insert_system_sql(params): string {
return `insert into sysconfig_table (APPID, IMPORTBBH, XLH, INFORM, SYSTEMNAME, VERSION, GZND, HTTPURL,SCOKETURL, HTTPPORT, SCOKETPORT, THEMENAME, THEMECOLOR, RECONNECTIONMODE, PUSHMODE, TRANSMISSIONMODE,CONTINUESCANMODE, SCANREADMODE, SCANNINGMODE,BROADCASTKEY,POWER) values (${isEmpty(params.AppId)},${isEmpty(params.importbbh)},${isEmpty(params.seriesNumber)},${isEmpty(params.inform)},${isEmpty(params.systemName)},${isEmpty(params.version)},${isEmpty(params.gznd)},${isEmpty(params.httpURL)},${isEmpty(params.scoketURL)},${isEmpty(params.httpPORT)},${isEmpty(params.scoketPORT)},${isEmpty(params.themeName)},${isEmpty(params.themeColor)},${isEmpty(params.reconnection_mode)},${isEmpty(params.push_mode)},${isEmpty(params.transmission_mode)},${isEmpty(params.continue_scan_mode)},${isEmpty(params.scan_read_mode)},${isEmpty(params.scanning_mode)},${isEmpty(params.broadcastKey)}, ${isEmpty(params.power)} );`;
}
// 更新系统信息
static update_system_sql(params): string {
// XLH = ${isEmpty(params.seriesNumber)} ,
return `update sysconfig_table set IMPORTBBH = ${isEmpty(params.importbbh)} , INFORM = ${isEmpty(params.inform)} , SYSTEMNAME = ${isEmpty(params.systemName)} , VERSION = ${isEmpty(params.version)} , GZND = ${isEmpty(params.gznd)} , HTTPURL = ${isEmpty(params.httpURL)},SCOKETURL= ${isEmpty(params.scoketURL)} , HTTPPORT = ${isEmpty(params.httpPORT)} ,SCOKETPORT = ${isEmpty(params.scoketPORT)}, THEMENAME = ${isEmpty(params.themeName)} , THEMECOLOR = ${isEmpty(params.themeColor)} , RECONNECTIONMODE = ${isEmpty(params.reconnection_mode)} , PUSHMODE = ${isEmpty(params.push_mode)} , TRANSMISSIONMODE = ${isEmpty(params.transmission_mode)} , CONTINUESCANMODE = ${isEmpty(params.continue_scan_mode)} , SCANREADMODE = ${isEmpty(params.scan_read_mode)} , SCANNINGMODE = ${isEmpty(params.scanning_mode)} , BROADCASTKEY = ${isEmpty(params.broadcastKey)} ,POWER = ${isEmpty(params.power)} where APPID = ${isEmpty(params.AppId)} ;`
}
/**
* 包裹管理表
*/
...
...
entry/src/main/ets/model/XtpzInfoModel.ets
0 → 100644
View file @
475994b0
import { XtpzInfoDao, SQLiteContext } from '@ohos/common'
// 系统配置
class XtpzInfoModel {
async insertSystemSql(params) {
let res = await SQLiteContext.with(XtpzInfoDao).insertSystemSql(params)
return res;
}
async updateSystemSql(params) {
let res = await SQLiteContext.with(XtpzInfoDao).updateSystemSql(params)
return res;
}
// 清空表
async clear() {
await SQLiteContext.with(XtpzInfoDao).clearTable()
}
}
const xtpzInfoModel = new XtpzInfoModel()
export default xtpzInfoModel
\ No newline at end of file
entry/src/main/ets/pages/sub_systemMaintenance/General.ets
View file @
475994b0
...
...
@@ -2,6 +2,7 @@ import { generalInitList, scanInitList, systemList, UniListItem } from '@ohos/sy
import { TitleBar } from '../../view/title/TitleBar'
import promptAction from '@ohos.promptAction'
import { GeneralDialog } from '../../view/GeneralDialog/GeneralDialog'
import xtpzInfoModel from '../../model/XtpzInfoModel'
@Extend(Button) function CommonButtonStyle() {
.borderWidth(2)
...
...
@@ -59,6 +60,74 @@ export struct General {
power: ""
}
onPageShow() {
this.init()
}
/***
* @description: 初始化
* @param {*}
* @return {*}
* @author: 王弘钢
*/
async init() {
try {
// const sysRes = await selectInformationType("GY_M_PMV3", sqlCommon.systemSql)
// const data = this.convertionToggleCase(sysRes)
// console.log('data', data)
// this.formData = {
// sbbm: '',
// ...data
// }
// this.handleGetSbbm()
} catch (e) {
//TODO handle the exception
promptAction.showToast({
message: '初始配置失败'
})
}
}
/***
* @description: 保存
* @param {*}
* @return {*}
* @author: 王弘钢
*/
async handleSystemSubmit() {
try {
const params = this.formData
await this.updateSystemFun(params)
this.init()
promptAction.showToast({
message: '修改配置成功'
})
} catch (e) {
//TODO handle the exception
promptAction.showToast({
message: '修改配置失败'
})
}
}
/***
* @description: 更新系统配置
* @param {*}
* @return {*}
* @author: 王弘钢
*/
async updateSystemFun(params) {
try {
await xtpzInfoModel.updateSystemSql(params)
} catch (e) {
//TODO handle the exception
promptAction.showToast({
message: '更新配置失败'
})
}
}
getListInfo(index:number):UniListItem[]{
switch (index){
case 0:
...
...
@@ -75,8 +144,6 @@ export struct General {
dialogController: CustomDialogController = new CustomDialogController({
builder: GeneralDialog({
cancel: this.onCancel,
confirm: this.onSubmit,
clickItem: $clickItem,
formData: $formData,
}),
...
...
@@ -85,14 +152,6 @@ export struct General {
customStyle: true
})
onCancel() {
console.info('------取消------')
}
onSubmit() {
console.info('------确认------')
}
build() {
Column() {
...
...
@@ -164,9 +223,7 @@ export struct General {
Flex({ justifyContent: FlexAlign.SpaceAround, alignItems: ItemAlign.Center }) {
Button("保存").CommonButtonStyle().onClick(() => {
promptAction.showToast({
message: JSON.stringify(this.formData)
})
this.handleSystemSubmit()
})
Button("重置").CommonButtonStyle()
}
...
...
entry/src/main/ets/view/GeneralDialog/GeneralDialog.ets
View file @
475994b0
import { UniListItem } from '@ohos/system/src/main/ets/model/UniInitList';
import promptAction from '@ohos.promptAction';
@Extend(Button) function CommonButtonStyle() {
.borderWidth(2)
.borderColor('#0fa983')
...
...
@@ -34,8 +35,33 @@ export struct GeneralDialog {
@Link formData: FormData;
@Link clickItem: UniListItem
controller: CustomDialogController
cancel: () => void
confirm: () => void
/***
* @description: 弹框确认
* @param {*}
* @return {*}
* @author: 王弘钢
*/
handleSubmit() {
if (!this.formData[this.clickItem?.key]) {
// 请完善信息
promptAction.showToast({
message: '请完善' + this.clickItem.title + '信息',
})
return
}
this.handleClosePopup()
}
/***
* @description: 关闭弹框
* @param {*}
* @return {*}
* @author: 王弘钢
*/
handleClosePopup() {
this.controller.close()
}
build() {
Column() {
...
...
@@ -106,14 +132,12 @@ export struct GeneralDialog {
Flex({ justifyContent: FlexAlign.SpaceAround }) {
Button('确认')
.onClick(() => {
this.controller.close()
this.confirm()
this.handleSubmit()
}).CommonButtonStyle()
Button('取消')
.onClick(() => {
this.formData[this.clickItem?.key] = ''
this.controller.close()
this.cancel()
}).CommonButtonStyle()
}.margin({ top: 10, bottom: 10 })
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论