Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
computedRoomPad
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
邓文彬
computedRoomPad
Commits
99d39d48
提交
99d39d48
authored
9月 14, 2024
作者:
邓文彬
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(pad): 核心功能完成,开始走查功能
上级
d1b86b97
显示空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
404 行增加
和
65 行删除
+404
-65
editPd.vue
pages/index/editPd.vue
+28
-11
operLog.vue
pages/index/operLog.vue
+3
-3
inspectionContent.vue
pages/inspectionContent/inspectionContent.vue
+55
-21
batteryRoom.vue
pages/inspectionContent/model/batteryRoom.vue
+15
-2
computerRoomDuty.vue
pages/inspectionContent/model/computerRoomDuty.vue
+10
-6
dutyHandover.vue
pages/inspectionContent/model/dutyHandover.vue
+11
-3
gatherDataCenter.vue
pages/inspectionContent/model/gatherDataCenter.vue
+15
-4
shieldedComputerRoom.vue
pages/inspectionContent/model/shieldedComputerRoom.vue
+13
-2
dialog.vue
pages/synchronousManagement/dialog.vue
+67
-3
index.vue
pages/synchronousManagement/index.vue
+6
-1
IoReadingAndWriting.js
utils/IoReadingAndWriting.js
+180
-9
systemCofig.js
utils/systemCofig.js
+1
-0
没有找到文件。
pages/index/editPd.vue
浏览文件 @
99d39d48
...
@@ -60,6 +60,11 @@
...
@@ -60,6 +60,11 @@
<
script
>
<
script
>
import
getDateTime
from
"@/common/getdateTime.js"
;
import
getDateTime
from
"@/common/getdateTime.js"
;
import
{
Base64
}
from
"js-base64"
;
import
{
Base64
}
from
"js-base64"
;
import
{
addLog
,
getLogContent
,
LOG_TYPE_ENUM
,
}
from
"@/utils/IoReadingAndWriting.js"
;
import
{
import
{
SYNCHRONIZE_DATA_PAD
,
SYNCHRONIZE_DATA_PAD
,
...
@@ -159,17 +164,19 @@ export default {
...
@@ -159,17 +164,19 @@ export default {
return
item
;
return
item
;
});
});
let
timeStr
=
getDateTime
.
dateTimeStr
(
"y-m-d h:i"
);
// let timeStr = getDateTime.dateTimeStr("y-m-d h:i");
let
operData
=
{
// let operData = {
name
:
this
.
$store
.
state
.
now_user
.
name
,
// name: this.$store.state.now_user.name,
level
:
"秘密"
,
// level: "秘密",
user
:
this
.
$store
.
state
.
now_user
.
user
,
// user: this.$store.state.now_user.user,
module
:
"其他"
,
// module: "其他",
detail
:
"无"
,
// detail: "无",
type
:
"修改密码"
,
// type: "修改密码",
time
:
timeStr
,
// time: timeStr,
};
// };
this
.
$store
.
state
.
oper_record
.
unshift
(
operData
);
// this.$store.state.oper_record.unshift(operData);
// 重新存储本地用户信息
// 重新存储本地用户信息
// let _this = this;
// let _this = this;
...
@@ -235,6 +242,16 @@ export default {
...
@@ -235,6 +242,16 @@ export default {
duration
:
2000
,
duration
:
2000
,
});
});
// 生成日志
const
logContent
=
getLogContent
(
LOG_TYPE_ENUM
.
updatePassword
);
const
log_list
=
this
.
$store
.
state
.
log_list
;
log_list
.
push
(
logContent
);
this
.
$store
.
commit
(
"SET_LOG_LIST"
,
log_list
);
addLog
(
log_list
).
then
((
res
)
=>
{
console
.
log
(
"日志文件写入成功"
);
});
this
.
logOut
();
this
.
logOut
();
});
});
}
else
{
}
else
{
...
...
pages/index/operLog.vue
浏览文件 @
99d39d48
...
@@ -70,11 +70,11 @@
...
@@ -70,11 +70,11 @@
<view
class=
"desc"
>
<view
class=
"desc"
>
<text
class=
"xuxian"
>
......
</text>
<text
class=
"xuxian"
>
......
</text>
<text
class=
"bold"
>
{{
item
.
name
}}
{{
item
.
user
}}
</text>
<text
class=
"bold"
>
{{
item
.
name
||
item
.
user
}}
</text>
<text
class=
"text"
>
操作
</text>
<text
class=
"text"
>
操作
</text>
<text
class=
"bold"
>
{{
item
.
module
}}
(
{{
item
.
type
}}
)
</text>
<text
class=
"bold"
>
{{
item
.
module
}}
(
{{
item
.
type
}}
)
</text>
<text
class=
"text"
>
内容
</text>
<text
v-if=
"item.detail"
class=
"text"
>
内容
</text>
<text
class=
"bold"
>
{{
item
.
detail
}}
</text>
<text
v-if=
"item.detail"
class=
"bold"
>
{{
item
.
detail
}}
</text>
</view>
</view>
</view>
</view>
</view>
</view>
...
...
pages/inspectionContent/inspectionContent.vue
浏览文件 @
99d39d48
...
@@ -48,28 +48,35 @@
...
@@ -48,28 +48,35 @@
<!-- tabls -->
<!-- tabls -->
<Tabs
class=
"tabs"
ref=
"tabs"
:options=
"tabList"
@
change=
"changeTab"
/>
<Tabs
class=
"tabs"
ref=
"tabs"
:options=
"tabList"
@
change=
"changeTab"
/>
<GatherDataCenter
v-show=
"activeTabIndex == 0"
ref=
"GatherDataCenter"
/>
<GatherDataCenter
v-show=
"activeTabIndex == 0"
:isDisable=
"isDisable"
ref=
"GatherDataCenter"
/>
<ShieldedComputerRoom
<ShieldedComputerRoom
ref=
"ShieldedComputerRoom"
ref=
"ShieldedComputerRoom"
v-show=
"activeTabIndex == 1"
v-show=
"activeTabIndex == 1"
/>
/>
<BatteryRoom
ref=
"BatteryRoom"
v-show=
"activeTabIndex == 2"
/>
<BatteryRoom
ref=
"BatteryRoom"
:isDisable=
"isDisable"
v-show=
"activeTabIndex == 2"
/>
<ComputerRoomDuty
<ComputerRoomDuty
ref=
"ComputerRoomDuty"
ref=
"ComputerRoomDuty"
:isDisable=
"isDisable"
v-show=
"activeTabIndex == 3"
v-show=
"activeTabIndex == 3"
></ComputerRoomDuty>
></ComputerRoomDuty>
<DutyHandover
<DutyHandover
ref=
"DutyHandover"
ref=
"DutyHandover"
:isDisable=
"isDisable"
v-show=
"activeTabIndex == 4"
v-show=
"activeTabIndex == 4"
></DutyHandover>
></DutyHandover>
</view>
</view>
<view
class=
"fixed-btns"
>
<view
v-if=
"!isDisable"
class=
"fixed-btns"
>
<view
class=
"button-group"
>
<view
class=
"button-group"
>
<view
<view
v-if=
"!detailsInfo.uid"
class=
"btn-draft btn-class"
class=
"btn-draft btn-class"
@
tap=
"draft(activeTabIndex)"
@
tap=
"draft(activeTabIndex)"
>
>
...
@@ -165,6 +172,7 @@ export default {
...
@@ -165,6 +172,7 @@ export default {
// 对应每个tab下的数据 [示例 0: 数据]
// 对应每个tab下的数据 [示例 0: 数据]
},
},
detailsInfo
:
{},
// 详情
detailsInfo
:
{},
// 详情
isDisable
:
false
,
// 禁用
};
};
},
},
onLoad
(
options
)
{
onLoad
(
options
)
{
...
@@ -179,19 +187,25 @@ export default {
...
@@ -179,19 +187,25 @@ export default {
this
.
tempForm
=
darf_data
.
originData
.
tempForm
;
this
.
tempForm
=
darf_data
.
originData
.
tempForm
;
console
.
log
(
"获取草稿数据---"
,
darf_data
);
console
.
log
(
"获取草稿数据---"
,
darf_data
);
this
.
detailsInfo
=
darf_data
;
this
.
detailsInfo
=
darf_data
;
}
}
},
},
mounted
()
{
mounted
()
{
if
(
this
.
detailsInfo
.
inspectionType
)
{
if
(
this
.
detailsInfo
.
inspectionType
)
{
const
fillCheck
=
this
.
detailsInfo
.
fillCheck
.
split
(
","
)
const
fillCheck
=
this
.
detailsInfo
.
fillCheck
.
split
(
","
)
;
this
.
tabList
.
forEach
((
item
,
index
)
=>
{
this
.
tabList
.
forEach
((
item
,
index
)
=>
{
item
.
isVaild
=
fillCheck
.
includes
(
item
.
value
)
item
.
isVaild
=
fillCheck
.
includes
(
item
.
value
)
;
this
.
tempForm
[
index
]
&&
this
.
setComponentData
(
index
,
this
.
tempForm
[
index
]);
this
.
tempForm
[
index
]
&&
this
.
setComponentData
(
index
,
this
.
tempForm
[
index
]);
});
});
}
else
{
}
else
{
this
.
baseInfo
=
this
.
$store
.
state
.
temp_data
;
this
.
baseInfo
=
this
.
$store
.
state
.
temp_data
;
}
}
},
},
methods
:
{
methods
:
{
...
@@ -208,6 +222,8 @@ export default {
...
@@ -208,6 +222,8 @@ export default {
this
.
baseInfo
=
detailsInfo
.
originData
.
baseInfo
;
this
.
baseInfo
=
detailsInfo
.
originData
.
baseInfo
;
this
.
tempForm
=
detailsInfo
.
originData
.
tempForm
;
this
.
tempForm
=
detailsInfo
.
originData
.
tempForm
;
this
.
detailsInfo
=
detailsInfo
;
this
.
detailsInfo
=
detailsInfo
;
this
.
isDisable
=
(
detailsInfo
.
synchronization
==
1
)
},
},
// 回显组件数据
// 回显组件数据
setComponentData
(
activeTabIndex
,
componentData
)
{
setComponentData
(
activeTabIndex
,
componentData
)
{
...
@@ -249,7 +265,11 @@ export default {
...
@@ -249,7 +265,11 @@ export default {
// 更新日志
// 更新日志
const
log_list
=
this
.
$store
.
state
.
log_list
;
const
log_list
=
this
.
$store
.
state
.
log_list
;
const
logContent
=
getLogContent
(
LOG_TYPE_ENUM
.
delete
);
const
logContent
=
getLogContent
(
LOG_TYPE_ENUM
.
delete
,
`
${
detailsInfo
.
recordName
}
(
${
detailsInfo
.
inspectionCode
}
)`
,
"巡检模块"
);
log_list
.
push
(
logContent
);
log_list
.
push
(
logContent
);
this
.
$store
.
commit
(
"SET_LOG_LIST"
,
log_list
);
this
.
$store
.
commit
(
"SET_LOG_LIST"
,
log_list
);
...
@@ -296,7 +316,10 @@ export default {
...
@@ -296,7 +316,10 @@ export default {
const
tempForm
=
this
.
tempForm
;
const
tempForm
=
this
.
tempForm
;
const
baseInfo
=
this
.
baseInfo
;
const
baseInfo
=
this
.
baseInfo
;
const
fillCheck
=
tabList
.
filter
(
item
=>
item
.
isVaild
).
map
((
item
)
=>
item
.
value
).
join
(
","
);
const
fillCheck
=
tabList
.
filter
((
item
)
=>
item
.
isVaild
)
.
map
((
item
)
=>
item
.
value
)
.
join
(
","
);
let
temp
=
{
let
temp
=
{
...
baseInfo
,
...
baseInfo
,
isSubmit
:
1
,
isSubmit
:
1
,
...
@@ -373,11 +396,19 @@ export default {
...
@@ -373,11 +396,19 @@ export default {
(
element
)
=>
element
.
uid
==
params
.
uid
(
element
)
=>
element
.
uid
==
params
.
uid
);
);
all_data
[
index
]
=
params
;
all_data
[
index
]
=
params
;
logContent
=
getLogContent
(
LOG_TYPE_ENUM
.
edit
);
logContent
=
getLogContent
(
LOG_TYPE_ENUM
.
edit
,
`
${
params
.
recordName
}
(
${
params
.
inspectionCode
}
)`
,
"巡检模块"
);
}
else
{
}
else
{
params
.
uid
=
new
Date
().
getTime
();
// 唯一标识 pad 端使用
params
.
uid
=
new
Date
().
getTime
();
// 唯一标识 pad 端使用
all_data
.
push
(
params
);
all_data
.
push
(
params
);
logContent
=
getLogContent
(
LOG_TYPE_ENUM
.
add
);
logContent
=
getLogContent
(
LOG_TYPE_ENUM
.
add
,
`
${
params
.
recordName
}
(
${
params
.
inspectionCode
}
)`
,
"巡检模块"
);
}
}
// console.log("--params--",all_data, params)
// console.log("--params--",all_data, params)
...
@@ -455,20 +486,10 @@ export default {
...
@@ -455,20 +486,10 @@ export default {
.
setTabVaild
(
activeTabIndex
,
vaild
,
iSwtich
)
.
setTabVaild
(
activeTabIndex
,
vaild
,
iSwtich
)
.
then
(()
=>
{
.
then
(()
=>
{
this
.
tempForm
[
activeTabIndex
]
=
formData
;
this
.
tempForm
[
activeTabIndex
]
=
formData
;
// console.log("--this.tempForm--", formData);
if
(
isSave
)
{
if
(
isSave
)
{
console
.
log
(
"--保存草稿--"
);
console
.
log
(
"--保存草稿--"
);
// 新增日志信息
const
logContent
=
getLogContent
(
LOG_TYPE_ENUM
.
darf
);
const
log_list
=
this
.
$store
.
state
.
log_list
;
log_list
.
push
(
logContent
);
this
.
$store
.
commit
(
"SET_LOG_LIST"
,
log_list
);
addLog
(
log_list
).
then
((
res
)
=>
{
console
.
log
(
"日志文件写入成功"
);
});
// 写入草稿文件 更新 store 草稿内容
// 写入草稿文件 更新 store 草稿内容
const
params
=
this
.
getParams
();
const
params
=
this
.
getParams
();
this
.
$store
.
commit
(
"SET_DARF_DATA"
,
params
);
this
.
$store
.
commit
(
"SET_DARF_DATA"
,
params
);
...
@@ -481,6 +502,19 @@ export default {
...
@@ -481,6 +502,19 @@ export default {
title
:
"保存草稿成功"
,
title
:
"保存草稿成功"
,
});
});
});
});
// 新增日志信息
const
logContent
=
getLogContent
(
LOG_TYPE_ENUM
.
darf
,
`
${
params
.
recordName
}
(
${
params
.
inspectionCode
}
)`
,
"巡检模块"
);
const
log_list
=
this
.
$store
.
state
.
log_list
;
log_list
.
push
(
logContent
);
this
.
$store
.
commit
(
"SET_LOG_LIST"
,
log_list
);
addLog
(
log_list
).
then
((
res
)
=>
{
console
.
log
(
"日志文件写入成功"
);
});
}
}
resolve
();
resolve
();
});
});
...
...
pages/inspectionContent/model/batteryRoom.vue
浏览文件 @
99d39d48
...
@@ -53,7 +53,12 @@
...
@@ -53,7 +53,12 @@
label=
"情况摘要"
label=
"情况摘要"
name=
"notes"
name=
"notes"
>
>
<input
type=
"text"
v-model=
"item.notes"
placeholder=
"请输入内容"
/>
<input
type=
"text"
:disabled=
"isDisable"
v-model=
"item.notes"
placeholder=
"请输入内容"
/>
</uni-forms-item>
</uni-forms-item>
</uni-forms>
</uni-forms>
</view>
</view>
...
@@ -69,6 +74,11 @@ import {
...
@@ -69,6 +74,11 @@ import {
* 电池间
* 电池间
*/
*/
export
default
{
export
default
{
props
:
{
isDisable
:
{
type
:
Boolean
,
},
},
data
()
{
data
()
{
return
{
return
{
list
:
[],
list
:
[],
...
@@ -101,7 +111,7 @@ export default {
...
@@ -101,7 +111,7 @@ export default {
methods
:
{
methods
:
{
// tag 点击事件
// tag 点击事件
tagClick
(
parentIndex
,
eleIndex
,
isActive
)
{
tagClick
(
parentIndex
,
eleIndex
,
isActive
)
{
if
(
isActive
)
{
if
(
isActive
||
this
.
isDisable
)
{
return
;
return
;
}
}
this
.
list
[
parentIndex
].
resultArr
.
forEach
((
element
)
=>
{
this
.
list
[
parentIndex
].
resultArr
.
forEach
((
element
)
=>
{
...
@@ -122,6 +132,9 @@ export default {
...
@@ -122,6 +132,9 @@ export default {
},
},
// tag 点击事件
// tag 点击事件
postionChange
(
parentIndex
,
eleIndex
,
isActive
)
{
postionChange
(
parentIndex
,
eleIndex
,
isActive
)
{
if
(
this
.
isDisable
)
{
return
;
}
const
postionList
=
this
.
list
[
parentIndex
].
postionList
;
const
postionList
=
this
.
list
[
parentIndex
].
postionList
;
const
item
=
postionList
[
eleIndex
];
const
item
=
postionList
[
eleIndex
];
item
.
isActive
=
!
isActive
;
item
.
isActive
=
!
isActive
;
...
...
pages/inspectionContent/model/computerRoomDuty.vue
浏览文件 @
99d39d48
...
@@ -19,11 +19,13 @@
...
@@ -19,11 +19,13 @@
v-model=
"form.roomWatch"
v-model=
"form.roomWatch"
placeholder-style=
"color:#C7C7C7"
placeholder-style=
"color:#C7C7C7"
placeholder=
"请输入需求文字"
placeholder=
"请输入需求文字"
:disabled=
"isDisable"
/>
/>
<view
class=
"quick-input"
>
快捷输入
</view>
<view
v-if=
"!isDisable"
class=
"quick-input"
>
快捷输入
</view>
<view>
<view
v-if=
"!isDisable"
>
<text
<text
class=
"qucik-text"
class=
"qucik-text"
v-for=
"item in quickTextList"
v-for=
"item in quickTextList"
...
@@ -37,15 +39,17 @@
...
@@ -37,15 +39,17 @@
</view>
</view>
</
template
>
</
template
>
<
script
>
<
script
>
import
{
import
{
pad_room_type
}
from
"@/utils/dict.js"
;
pad_room_type
,
}
from
"@/utils/dict.js"
;
/**
/**
* 机房值班
* 机房值班
*/
*/
export
default
{
export
default
{
props
:
{},
props
:
{
isDisable
:
{
type
:
Boolean
,
},
},
data
()
{
data
()
{
return
{
return
{
list
:
[],
list
:
[],
...
...
pages/inspectionContent/model/dutyHandover.vue
浏览文件 @
99d39d48
...
@@ -19,11 +19,13 @@
...
@@ -19,11 +19,13 @@
v-model=
"form.dutyHandover"
v-model=
"form.dutyHandover"
placeholder-style=
"color:#C7C7C7"
placeholder-style=
"color:#C7C7C7"
placeholder=
"请输入"
placeholder=
"请输入"
:disabled=
"isDisable"
/>
/>
<view
class=
"quick-input"
>
快捷输入
</view>
<view
v-if=
"!isDisable"
class=
"quick-input"
>
快捷输入
</view>
<view>
<view
v-if=
"!isDisable"
>
<text
<text
class=
"qucik-text"
class=
"qucik-text"
v-for=
"item in quickTextList"
v-for=
"item in quickTextList"
...
@@ -46,6 +48,8 @@
...
@@ -46,6 +48,8 @@
name=
"successor"
name=
"successor"
>
>
<uni-easyinput
<uni-easyinput
:disabled=
"isDisable"
type=
"text"
type=
"text"
v-model=
"form.successor"
v-model=
"form.successor"
placeholder=
"请输入"
placeholder=
"请输入"
...
@@ -62,7 +66,11 @@ import { pad_room_type } from "@/utils/dict.js";
...
@@ -62,7 +66,11 @@ import { pad_room_type } from "@/utils/dict.js";
* 值班交接
* 值班交接
*/
*/
export
default
{
export
default
{
props
:
{},
props
:
{
isDisable
:
{
type
:
Boolean
,
},
},
data
()
{
data
()
{
return
{
return
{
rules
:
{
rules
:
{
...
...
pages/inspectionContent/model/gatherDataCenter.vue
浏览文件 @
99d39d48
...
@@ -48,13 +48,17 @@
...
@@ -48,13 +48,17 @@
<!-- 异常状态时显示 -->
<!-- 异常状态时显示 -->
<uni-forms-item
<uni-forms-item
v-if=
"item.inspectionResult == 1"
v-if=
"item.inspectionResult == 1"
required
required
class=
"row-item"
class=
"row-item"
label=
"情况摘要"
label=
"情况摘要"
name=
"notes"
name=
"notes"
>
>
<input
type=
"text"
v-model=
"item.notes"
placeholder=
"请输入内容"
/>
<input
type=
"text"
:disabled=
"isDisable"
v-model=
"item.notes"
placeholder=
"请输入内容"
/>
</uni-forms-item>
</uni-forms-item>
</uni-forms>
</uni-forms>
</view>
</view>
...
@@ -70,7 +74,11 @@ import {
...
@@ -70,7 +74,11 @@ import {
* 汇集机房
* 汇集机房
*/
*/
export
default
{
export
default
{
props
:
{},
props
:
{
isDisable
:
{
type
:
Boolean
,
},
},
data
()
{
data
()
{
return
{
return
{
list
:
[],
list
:
[],
...
@@ -103,7 +111,7 @@ export default {
...
@@ -103,7 +111,7 @@ export default {
methods
:
{
methods
:
{
// tag 点击事件
// tag 点击事件
tagClick
(
parentIndex
,
eleIndex
,
isActive
)
{
tagClick
(
parentIndex
,
eleIndex
,
isActive
)
{
if
(
isActive
)
{
if
(
isActive
||
this
.
isDisable
)
{
return
;
return
;
}
}
this
.
list
[
parentIndex
].
resultArr
.
forEach
((
element
)
=>
{
this
.
list
[
parentIndex
].
resultArr
.
forEach
((
element
)
=>
{
...
@@ -124,6 +132,9 @@ export default {
...
@@ -124,6 +132,9 @@ export default {
},
},
// tag 点击事件
// tag 点击事件
postionChange
(
parentIndex
,
eleIndex
,
isActive
)
{
postionChange
(
parentIndex
,
eleIndex
,
isActive
)
{
if
(
this
.
isDisable
)
{
return
;
}
const
postionList
=
this
.
list
[
parentIndex
].
postionList
;
const
postionList
=
this
.
list
[
parentIndex
].
postionList
;
const
item
=
postionList
[
eleIndex
];
const
item
=
postionList
[
eleIndex
];
item
.
isActive
=
!
isActive
;
item
.
isActive
=
!
isActive
;
...
...
pages/inspectionContent/model/shieldedComputerRoom.vue
浏览文件 @
99d39d48
...
@@ -53,7 +53,10 @@
...
@@ -53,7 +53,10 @@
name=
"notes"
name=
"notes"
v-if=
"item.inspectionResult == 1"
v-if=
"item.inspectionResult == 1"
>
>
<input
type=
"text"
v-model=
"item.notes"
placeholder=
"请输入内容"
/>
<input
type=
"text"
:disabled=
"isDisable"
v-model=
"item.notes"
placeholder=
"请输入内容"
/>
</uni-forms-item>
</uni-forms-item>
</uni-forms>
</uni-forms>
</view>
</view>
...
@@ -69,6 +72,11 @@ import {
...
@@ -69,6 +72,11 @@ import {
* 屏蔽机房巡检
* 屏蔽机房巡检
*/
*/
export
default
{
export
default
{
props
:
{
isDisable
:
{
type
:
Boolean
,
},
},
data
()
{
data
()
{
return
{
return
{
list
:
[],
list
:
[],
...
@@ -101,7 +109,7 @@ export default {
...
@@ -101,7 +109,7 @@ export default {
methods
:
{
methods
:
{
// tag 点击事件
// tag 点击事件
tagClick
(
parentIndex
,
eleIndex
,
isActive
)
{
tagClick
(
parentIndex
,
eleIndex
,
isActive
)
{
if
(
isActive
)
{
if
(
isActive
||
this
.
isDisable
)
{
return
;
return
;
}
}
this
.
list
[
parentIndex
].
resultArr
.
forEach
((
element
)
=>
{
this
.
list
[
parentIndex
].
resultArr
.
forEach
((
element
)
=>
{
...
@@ -122,6 +130,9 @@ export default {
...
@@ -122,6 +130,9 @@ export default {
},
},
// tag 点击事件
// tag 点击事件
postionChange
(
parentIndex
,
eleIndex
,
isActive
)
{
postionChange
(
parentIndex
,
eleIndex
,
isActive
)
{
if
(
this
.
isDisable
)
{
return
;
}
const
postionList
=
this
.
list
[
parentIndex
].
postionList
;
const
postionList
=
this
.
list
[
parentIndex
].
postionList
;
const
item
=
postionList
[
eleIndex
];
const
item
=
postionList
[
eleIndex
];
item
.
isActive
=
!
isActive
;
item
.
isActive
=
!
isActive
;
...
...
pages/synchronousManagement/dialog.vue
浏览文件 @
99d39d48
...
@@ -46,7 +46,15 @@ import {
...
@@ -46,7 +46,15 @@ import {
}
from
"@/utils/systemCofig"
;
}
from
"@/utils/systemCofig"
;
import
getDateTime
from
"@/common/getdateTime.js"
;
import
getDateTime
from
"@/common/getdateTime.js"
;
import
{
Base64
}
from
"js-base64"
;
import
{
Base64
}
from
"js-base64"
;
import
{
writeInspectionData
}
from
"@/utils/IoReadingAndWriting.js"
;
import
{
writeInspectionData
,
copyDirectory
,
deleteAllFilesInDirectory
,
addLog
,
getLogContent
,
LOG_TYPE_ENUM
,
}
from
"@/utils/IoReadingAndWriting.js"
;
import
moment
from
"moment"
;
export
default
{
export
default
{
components
:
{},
components
:
{},
...
@@ -66,13 +74,46 @@ export default {
...
@@ -66,13 +74,46 @@ export default {
close
()
{
close
()
{
this
.
$emit
(
"close"
);
this
.
$emit
(
"close"
);
},
},
/**
* 1.生成两个文件. 机房文件 和 井道文件
* 2. 更新巡检数据状态 synchronization 置为 1
* 3. 写入数据
* 读取上一次打包的文件, 复制到 [ history ] 文件夹中
*/
clickHandle
()
{
clickHandle
()
{
const
directoryPath
=
`
${
SYNCHRONIZE_DATA_PAD
}
/发送数据`
;
const
targetDirectoryPath
=
`
${
SYNCHRONIZE_DATA_PAD
}
/history`
;
checkAndCreateDirectory
(
directoryPath
).
then
(()
=>
{
console
.
log
(
"---sss"
);
copyDirectory
(
directoryPath
,
targetDirectoryPath
)
.
then
(()
=>
{
console
.
log
(
"---文件复制完成"
);
return
deleteAllFilesInDirectory
(
directoryPath
);
})
.
then
(()
=>
{
console
.
log
(
"---文件删除成功----"
);
this
.
coverData
();
})
.
catch
((
error
)
=>
{
console
.
log
(
"---error"
,
error
);
uni
.
showToast
({
title
:
error
,
icon
:
"none"
,
duration
:
1000
,
});
});
});
},
// 处理数据
coverData
()
{
const
userName
=
this
.
$store
.
state
.
now_user
.
name
;
const
userName
=
this
.
$store
.
state
.
now_user
.
name
;
const
all_data
=
this
.
all_data
;
const
all_data
=
this
.
all_data
;
console
.
log
(
"-同步数据--"
,
all_data
);
console
.
log
(
"-同步数据--"
,
all_data
);
let
timeStr
=
getDateTime
.
dateTimeStr
(
"y-m-d h-i-
s"
);
let
timeStr
=
moment
().
format
(
"yyyy-MM-DD_hh:mm:s
s"
);
let
JFXJ_DATA_FILE_NAME
=
`
${
userName
}
_JFXJ_
${
timeStr
}
.txt`
;
let
JFXJ_DATA_FILE_NAME
=
`
${
userName
}
_JFXJ_
${
timeStr
}
.txt`
;
let
JDXJ_DATA_FILE_NAME
=
`
${
userName
}
_JDXJ_
${
timeStr
}
.txt`
;
let
JDXJ_DATA_FILE_NAME
=
`
${
userName
}
_JDXJ_
${
timeStr
}
.txt`
;
...
@@ -92,13 +133,16 @@ export default {
...
@@ -92,13 +133,16 @@ export default {
this
.
packedData
(
JDXJ_DATA
,
JDXJ_DATA_FILE_NAME
),
this
.
packedData
(
JDXJ_DATA
,
JDXJ_DATA_FILE_NAME
),
])
])
.
then
(()
=>
{
.
then
(()
=>
{
// 更新巡检数据状态
const
newAllData
=
all_data
.
map
((
item
)
=>
{
const
newAllData
=
all_data
.
map
((
item
)
=>
{
item
.
synchronization
=
1
;
item
.
synchronization
=
1
;
return
item
;
return
item
;
});
});
writeInspectionData
(
all_data
)
.
then
(()
=>
{
this
.
$store
.
commit
(
"SET_ALL_DATA"
,
newAllData
);
this
.
$store
.
commit
(
"SET_ALL_DATA"
,
newAllData
);
writeInspectionData
(
all_data
);
setTimeout
(()
=>
{
setTimeout
(()
=>
{
uni
.
showToast
({
uni
.
showToast
({
title
:
"打包成功"
,
title
:
"打包成功"
,
...
@@ -107,8 +151,27 @@ export default {
...
@@ -107,8 +151,27 @@ export default {
});
});
this
.
close
();
this
.
close
();
this
.
loading
=
false
;
this
.
loading
=
false
;
// 生成日志
const
logContent
=
getLogContent
(
LOG_TYPE_ENUM
.
sys
,
""
,
"同步模块"
);
const
log_list
=
this
.
$store
.
state
.
log_list
;
log_list
.
push
(
logContent
);
this
.
$store
.
commit
(
"SET_LOG_LIST"
,
log_list
);
addLog
(
log_list
).
then
((
res
)
=>
{
console
.
log
(
"日志文件写入成功"
);
});
},
2
*
1000
);
},
2
*
1000
);
})
})
.
catch
((
error
)
=>
{
this
.
loading
=
false
;
uni
.
showToast
({
title
:
error
,
icon
:
"none"
,
duration
:
2000
,
});
});
})
.
catch
(()
=>
{
.
catch
(()
=>
{
setTimeout
(()
=>
{
setTimeout
(()
=>
{
uni
.
showToast
({
uni
.
showToast
({
...
@@ -121,6 +184,7 @@ export default {
...
@@ -121,6 +184,7 @@ export default {
});
});
},
},
// 打包文件
packedData
(
content
,
fileName
)
{
packedData
(
content
,
fileName
)
{
const
fileContent
=
setSm2
(
content
);
const
fileContent
=
setSm2
(
content
);
return
createFileWithPlusIO
(
return
createFileWithPlusIO
(
...
...
pages/synchronousManagement/index.vue
浏览文件 @
99d39d48
...
@@ -31,7 +31,7 @@
...
@@ -31,7 +31,7 @@
</view>
</view>
<!-- 数据打包 -->
<!-- 数据打包 -->
<view
class=
"synchronous-button"
@
click=
"openDialog(true)"
>
数据打包
</view>
<view
v-show=
"isPackedDataBtn"
class=
"synchronous-button"
@
click=
"openDialog(true)"
>
数据打包
</view>
<!-- 打包弹窗 -->
<!-- 打包弹窗 -->
<Dialog
v-show=
"isDialog"
@
close=
"openDialog(false)"
></Dialog>
<Dialog
v-show=
"isDialog"
@
close=
"openDialog(false)"
></Dialog>
...
@@ -59,6 +59,7 @@ export default {
...
@@ -59,6 +59,7 @@ export default {
// 搜索条件
// 搜索条件
},
},
countNum
:
0
,
// 统计查询总数
countNum
:
0
,
// 统计查询总数
isPackedDataBtn
:
false
// 控制打包按钮显示
};
};
},
},
mounted
()
{
mounted
()
{
...
@@ -68,6 +69,10 @@ export default {
...
@@ -68,6 +69,10 @@ export default {
init
()
{
init
()
{
const
all_data
=
this
.
$store
.
state
.
all_data
||
[];
const
all_data
=
this
.
$store
.
state
.
all_data
||
[];
console
.
log
(
"---all_data-"
,
all_data
)
console
.
log
(
"---all_data-"
,
all_data
)
this
.
isPackedDataBtn
=
all_data
.
filter
(
item
=>
item
.
synchronization
==
0
).
length
>
0
;
const
tempAllData
=
{};
const
tempAllData
=
{};
all_data
.
forEach
((
item
)
=>
{
all_data
.
forEach
((
item
)
=>
{
const
val
=
tempAllData
[
item
.
submitTime
]
||
[];
const
val
=
tempAllData
[
item
.
submitTime
]
||
[];
...
...
utils/IoReadingAndWriting.js
浏览文件 @
99d39d48
...
@@ -25,19 +25,19 @@ export const LOG_TYPE_ENUM = {
...
@@ -25,19 +25,19 @@ export const LOG_TYPE_ENUM = {
edit
:
"编辑成功"
,
edit
:
"编辑成功"
,
darf
:
"草稿"
,
darf
:
"草稿"
,
delete
:
"删除"
,
delete
:
"删除"
,
sys
:
"同步"
,
sys
:
"同步
数据
"
,
updatePassword
:
"修改密码"
,
updatePassword
:
"修改密码"
,
};
};
// 生成日志
// 生成日志
export
const
getLogContent
=
(
type
,
detail
=
"
无
"
)
=>
{
export
const
getLogContent
=
(
type
,
detail
=
"
"
,
module
=
"其他模块
"
)
=>
{
const
now_user
=
store
.
state
.
now_user
;
const
now_user
=
store
.
state
.
now_user
;
let
timeStr
=
moment
().
format
(
"yyyy-MM-DD HH:mm:ss"
);
let
timeStr
=
moment
().
format
(
"yyyy-MM-DD HH:mm:ss"
);
return
{
return
{
name
:
now_user
.
user
,
name
:
now_user
.
user
,
level
:
"秘密"
,
level
:
"秘密"
,
user
:
now_user
.
user
,
user
:
now_user
.
user
,
module
:
"其他"
,
module
,
detail
,
detail
,
type
,
type
,
time
:
timeStr
,
time
:
timeStr
,
...
@@ -151,7 +151,7 @@ export const writeInspectionData = (content, isEncryption = false) => {
...
@@ -151,7 +151,7 @@ export const writeInspectionData = (content, isEncryption = false) => {
let
fileName
=
`
${
timeStr
}
.txt`
;
let
fileName
=
`
${
timeStr
}
.txt`
;
console
.
log
(
"写入-巡检数据--"
,
content
);
console
.
log
(
"写入-巡检数据--"
,
content
);
isEncryption
;
//
isEncryption;
const
temp
=
Base64
.
encode
(
JSON
.
stringify
(
content
));
const
temp
=
Base64
.
encode
(
JSON
.
stringify
(
content
));
const
fileContent
=
isEncryption
?
setSm2
(
temp
)
:
temp
;
const
fileContent
=
isEncryption
?
setSm2
(
temp
)
:
temp
;
...
@@ -187,14 +187,186 @@ export const readInspectionData = () => {
...
@@ -187,14 +187,186 @@ export const readInspectionData = () => {
});
});
};
};
// 复制文件夹中的所有数据到另一个文件夹
/**
*
* @param {*} sourceDirectoryPath 复制内容文件夹路径 -- 源路径
* @param {*} targetDirectoryPath 复制到新的文件夹路径 -- 目标路径
*/
export
function
copyDirectory
(
sourceDirectoryPath
,
targetDirectoryPath
)
{
return
new
Promise
((
resolve
,
reject
)
=>
{
// 请求文件系统
plus
.
io
.
requestFileSystem
(
plus
.
io
.
PUBLIC_DOCUMENTS
,
function
(
fs
)
{
// 获取源文件夹路径的目录条目
fs
.
root
.
getDirectory
(
sourceDirectoryPath
,
{
create
:
false
},
function
(
sourceDirEntry
)
{
// 获取目标文件夹路径的目录条目
fs
.
root
.
getDirectory
(
targetDirectoryPath
,
{
create
:
true
,
exclusive
:
false
},
function
(
targetDirEntry
)
{
// 创建一个空的目录读取器
let
directoryReader
=
sourceDirEntry
.
createReader
();
// 读取源目录中的所有文件和子目录
directoryReader
.
readEntries
(
function
(
entries
)
{
console
.
log
(
"------entries.length-----"
,
entries
.
length
);
// 目标文件夹没有内容,直接返回
if
(
!
entries
.
length
)
{
return
resolve
();
}
let
copyNum
=
0
;
// 遍历文件和子目录
for
(
let
i
=
0
;
i
<
entries
.
length
;
i
++
)
{
let
entry
=
entries
[
i
];
if
(
entry
.
isFile
)
{
// 确保是文件
// 复制文件
entry
.
copyTo
(
targetDirEntry
,
entry
.
name
,
function
()
{
++
copyNum
;
console
.
log
(
"文件复制成功:"
,
entry
.
name
);
if
(
copyNum
==
entries
.
length
)
{
console
.
log
(
"-copyNum--"
,
copyNum
);
resolve
();
}
},
function
(
error
)
{
console
.
error
(
"文件复制失败:"
,
error
.
message
);
reject
(
"文件复制失败"
);
}
);
}
else
if
(
entry
.
isDirectory
)
{
// 确保是目录
// 创建目标目录
targetDirEntry
.
getDirectory
(
entry
.
name
,
{
create
:
true
,
exclusive
:
false
},
function
(
targetDirEntry
)
{
// 递归复制目录
copyDirectory
(
entry
.
fullPath
,
targetDirEntry
.
fullPath
);
},
function
(
error
)
{
console
.
error
(
"创建目标目录失败:"
,
error
.
message
);
reject
(
"创建目标目录失败"
);
}
);
}
}
},
function
(
error
)
{
console
.
error
(
"读取目录条目失败:"
,
error
.
message
);
reject
(
"读取目录条目失败"
);
}
);
},
function
(
error
)
{
console
.
error
(
"获取目标目录失败:"
,
error
.
message
);
reject
(
"获取目标目录失败"
);
}
);
},
function
(
error
)
{
console
.
error
(
"获取源目录失败:"
,
error
.
message
);
reject
(
"获取源目录失败"
);
}
);
},
function
(
error
)
{
console
.
error
(
"请求文件系统失败:"
,
error
.
message
);
reject
(
"请求文件系统失败"
);
}
);
});
}
// 删除文件夹中所有文件
export
function
deleteAllFilesInDirectory
(
directoryPath
)
{
// 请求文件系统
return
new
Promise
((
resolve
,
reject
)
=>
{
plus
.
io
.
requestFileSystem
(
plus
.
io
.
PUBLIC_DOCUMENTS
,
function
(
fs
)
{
// 获取指定文件夹路径的目录条目
fs
.
root
.
getDirectory
(
directoryPath
,
{
create
:
false
},
function
(
dirEntry
)
{
// 创建一个空的目录读取器
var
directoryReader
=
dirEntry
.
createReader
();
// 读取目录中的所有文件和子目录
directoryReader
.
readEntries
(
function
(
entries
)
{
// 目标文件夹没有内容,直接返回
if
(
!
entries
.
length
)
{
return
resolve
();
}
let
copyNum
=
0
;
// 读取数据文件
// 遍历文件和子目录
export
const
readDirectoryData
=
()
=>
{
for
(
var
i
=
0
;
i
<
entries
.
length
;
i
++
)
{
var
entry
=
entries
[
i
];
if
(
entry
.
isFile
)
{
// 确保是文件
// 删除文件
entry
.
remove
(
function
()
{
++
copyNum
;
console
.
log
(
"文件删除成功:"
,
entry
.
name
);
if
(
copyNum
==
entries
.
length
)
{
resolve
();
}
},
function
(
error
)
{
reject
(
"文件删除失败"
);
console
.
error
(
"文件删除失败:"
,
error
.
message
);
}
);
}
}
},
function
(
error
)
{
reject
(
"读取目录条目失败"
);
console
.
error
(
"读取目录条目失败:"
,
error
.
message
);
}
);
},
function
(
error
)
{
reject
(
"获取目录失败"
);
console
.
error
(
"获取目录失败:"
,
error
.
message
);
}
);
},
function
(
error
)
{
console
.
error
(
"请求文件系统失败:"
,
error
.
message
);
reject
(
"请求文件系统失败"
);
}
);
});
}
// // 使用示例
// const directoryPath = '_doc/exampleDirectory';
// deleteAllFilesInDirectory(directoryPath);
// 初始化 -- 读取数据文件
export
const
readDirectoryData
=
()
=>
{
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
return
new
Promise
(
async
(
resolve
,
reject
)
=>
{
readLogData
()
readLogData
()
.
then
((
res
)
=>
{
.
then
((
res
)
=>
{
console
.
log
(
"----读出来的日志文件"
,
res
)
console
.
log
(
"----读出来的日志文件"
,
res
);
store
.
commit
(
"SET_LOG_LIST"
,
res
);
store
.
commit
(
"SET_LOG_LIST"
,
res
);
return
readInspectionData
();
return
readInspectionData
();
})
})
...
@@ -211,4 +383,4 @@ export const readDirectoryData = () =>{
...
@@ -211,4 +383,4 @@ export const readDirectoryData = () =>{
resolve
();
resolve
();
});
});
});
});
}
};
\ No newline at end of file
utils/systemCofig.js
浏览文件 @
99d39d48
...
@@ -5,6 +5,7 @@ export const SYNCHRONIZE_DATA_PATH = "_documents/data/asmzx"; // 同步数据
...
@@ -5,6 +5,7 @@ export const SYNCHRONIZE_DATA_PATH = "_documents/data/asmzx"; // 同步数据
export
const
SYNCHRONIZE_DATA_PAD
=
"_documents/data/asmzx/pad"
;
// 存储pad端的生产数据
export
const
SYNCHRONIZE_DATA_PAD
=
"_documents/data/asmzx/pad"
;
// 存储pad端的生产数据
export
const
USER_FILE_NAME
=
"userList.txt"
;
// 存储内置用户的文件名
export
const
USER_FILE_NAME
=
"userList.txt"
;
// 存储内置用户的文件名
// 内置的用户信息
// 内置的用户信息
export
const
USER_LiST
=
[
export
const
USER_LiST
=
[
{
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论