Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
I
inspection-pad-web
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
专网
inspection-pad-web
Commits
d8641917
提交
d8641917
authored
4月 14, 2025
作者:
JaxBBLL
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix
上级
6909d900
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
45 行增加
和
56 行删除
+45
-56
dialog.vue
pages/inspectionManagement/dialog.vue
+32
-38
dialog.vue
pages/synchronousManagement/dialog.vue
+13
-18
没有找到文件。
pages/inspectionManagement/dialog.vue
浏览文件 @
d8641917
...
@@ -38,40 +38,32 @@
...
@@ -38,40 +38,32 @@
</
template
>
</
template
>
<
script
>
<
script
>
import
{
import
{
SYNCHRONIZE_DATA_PAD
,
SYNCHRONIZE_DATA_PAD
,
checkAndCreateDirectory
,
checkAndCreateDirectory
,
createFileWithPlusIO
,
createFileWithPlusIO
,
setSm2
,
setSm2
,
USER_FILE_NAME
,
USER_FILE_NAME
,
getUserList
,
getUserList
,
zipCompress
zipCompress
,
}
from
"@/utils/systemCofig"
;
}
from
"@/utils/systemCofig"
;
import
{
import
{
findPhotosUrls
}
from
"@/utils/index.js"
;
findPhotosUrls
import
{
copySelectedFiles
}
from
"@/utils/plus.js"
;
}
from
"@/utils/index.js"
;
import
{
import
{
copySelectedFiles
}
from
"@/utils/plus.js"
;
import
{
writeInspectionData
,
writeInspectionData
,
copyDirectory
,
copyDirectory
,
deleteAllFilesInDirectory
,
deleteAllFilesInDirectory
,
addLog
,
addLog
,
getLogContent
,
getLogContent
,
LOG_TYPE_ENUM
,
LOG_TYPE_ENUM
,
}
from
"@/utils/IoReadingAndWriting.js"
;
}
from
"@/utils/IoReadingAndWriting.js"
;
import
moment
from
"moment"
;
import
moment
from
"moment"
;
import
{
import
{
getAllInspections
}
from
"@/request/index.js"
;
getAllInspections
import
{
Base64
}
from
"js-base64"
;
}
from
"@/request/index.js"
;
import
inspectApi
from
"@/api/inspect"
;
import
{
import
inspect
from
"@/api/inspect"
;
Base64
export
default
{
}
from
"js-base64"
;
import
inspectApi
from
"@/api/inspect"
;
import
inspect
from
"@/api/inspect"
;
export
default
{
props
:
{
props
:
{
list
:
{
list
:
{
type
:
Array
,
type
:
Array
,
...
@@ -155,9 +147,11 @@
...
@@ -155,9 +147,11 @@
// });
// });
},
},
copyPhotos
()
{
copyPhotos
()
{
this
.
list
.
forEach
(
e
=>
{
this
.
list
.
forEach
((
e
)
=>
{
e
.
inspectionData
=
JSON
.
parse
(
e
.
inspectionData
)
||
'{}'
if
(
typeof
e
.
inspectionData
===
"string"
)
{
})
e
.
inspectionData
=
JSON
.
parse
(
e
.
inspectionData
)
||
"{}"
;
}
});
const
urls
=
findPhotosUrls
(
this
.
list
).
map
((
url
)
=>
url
.
split
(
"/"
).
pop
());
const
urls
=
findPhotosUrls
(
this
.
list
).
map
((
url
)
=>
url
.
split
(
"/"
).
pop
());
console
.
log
(
"urls"
,
urls
);
console
.
log
(
"urls"
,
urls
);
return
copySelectedFiles
(
return
copySelectedFiles
(
...
@@ -200,10 +194,10 @@
...
@@ -200,10 +194,10 @@
tmepList
.
push
(
this
.
packedData
(
JFXJ_DATA
,
JFXJ_DATA_FILE_NAME
));
tmepList
.
push
(
this
.
packedData
(
JFXJ_DATA
,
JFXJ_DATA_FILE_NAME
));
}
}
JDXJ_DATA
.
forEach
((
item
,
index
)
=>
{
if
(
JDXJ_DATA
.
length
)
{
let
JDXJ_DATA_FILE_NAME
=
`
${
userName
}
_JDXJ_
${
timeStr
}
_
${
index
}
.txt`
;
let
JDXJ_DATA_FILE_NAME
=
`
${
userName
}
_JDXJ_
${
timeStr
}
.txt`
;
tmepList
.
push
(
this
.
packedData
(
item
,
JDXJ_DATA_FILE_NAME
));
tmepList
.
push
(
this
.
packedData
(
JDXJ_DATA
,
JDXJ_DATA_FILE_NAME
));
});
}
console
.
log
(
"同步窗口"
);
console
.
log
(
"同步窗口"
);
console
.
log
(
"同步窗口"
,
tmepList
);
console
.
log
(
"同步窗口"
,
tmepList
);
...
@@ -246,7 +240,8 @@
...
@@ -246,7 +240,8 @@
let
ids
=
this
.
list
.
map
((
e
)
=>
e
.
id
);
let
ids
=
this
.
list
.
map
((
e
)
=>
e
.
id
);
// 复制照片
// 复制照片
await
this
.
copyPhotos
();
await
this
.
copyPhotos
();
zipCompress
(
`
${
SYNCHRONIZE_DATA_PAD
}
/发送数据`
,
zipCompress
(
`
${
SYNCHRONIZE_DATA_PAD
}
/发送数据`
,
`
${
SYNCHRONIZE_DATA_PAD
}
/fssj/
${
userName
}
_JFXJ_
${
timeStr
}
.zip`
`
${
SYNCHRONIZE_DATA_PAD
}
/fssj/
${
userName
}
_JFXJ_
${
timeStr
}
.zip`
);
);
// zip
// zip
...
@@ -267,8 +262,6 @@
...
@@ -267,8 +262,6 @@
// 更新同步时间
// 更新同步时间
this
.
updateSysTime
();
this
.
updateSysTime
();
},
2
*
1000
);
},
2
*
1000
);
})
})
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
...
@@ -293,7 +286,6 @@
...
@@ -293,7 +286,6 @@
});
});
},
},
// 使用示例
// 使用示例
// 打包文件
// 打包文件
packedData
(
content
,
fileName
)
{
packedData
(
content
,
fileName
)
{
...
@@ -345,10 +337,10 @@
...
@@ -345,10 +337,10 @@
});
});
},
},
},
},
};
};
</
script
>
</
script
>
<
style
scoped
lang=
"less"
>
<
style
scoped
lang=
"less"
>
.synchronous-dialog {
.synchronous-dialog {
position: fixed;
position: fixed;
z-index: 999;
z-index: 999;
top: 0;
top: 0;
...
@@ -365,11 +357,13 @@
...
@@ -365,11 +357,13 @@
width: 400px;
width: 400px;
height: 60%;
height: 60%;
box-sizing: border-box;
box-sizing: border-box;
background-image: linear-gradient(-6deg,
background-image: linear-gradient(
-6deg,
#f9ffe7 0%,
#f9ffe7 0%,
#ffffff 12%,
#ffffff 12%,
#fcfeff 73%,
#fcfeff 73%,
#ccf1ff 100%);
#ccf1ff 100%
);
border: 0.4px solid rgba(224, 224, 224, 1);
border: 0.4px solid rgba(224, 224, 224, 1);
border-radius: 12px;
border-radius: 12px;
position: relative;
position: relative;
...
@@ -454,5 +448,5 @@
...
@@ -454,5 +448,5 @@
}
}
}
}
}
}
}
}
</
style
>
</
style
>
pages/synchronousManagement/dialog.vue
浏览文件 @
d8641917
...
@@ -113,18 +113,16 @@ export default {
...
@@ -113,18 +113,16 @@ export default {
* 读取上一次打包的文件, 复制到 [ history ] 文件夹中
* 读取上一次打包的文件, 复制到 [ history ] 文件夹中
*/
*/
clickHandle
()
{
clickHandle
()
{
if
(
this
.
loading
)
return
;
if
(
this
.
loading
)
return
;
const
directoryPath
=
`
${
SYNCHRONIZE_DATA_PAD
}
/发送数据`
;
const
directoryPath
=
`
${
SYNCHRONIZE_DATA_PAD
}
/发送数据`
;
const
targetDirectoryPath
=
`
${
SYNCHRONIZE_DATA_PAD
}
/history`
;
const
targetDirectoryPath
=
`
${
SYNCHRONIZE_DATA_PAD
}
/history`
;
checkAndCreateDirectory
(
directoryPath
).
then
(()
=>
{
checkAndCreateDirectory
(
directoryPath
).
then
(()
=>
{
copyDirectory
(
directoryPath
,
targetDirectoryPath
)
copyDirectory
(
directoryPath
,
targetDirectoryPath
)
.
then
(()
=>
{
.
then
(()
=>
{
return
deleteAllFilesInDirectory
(
directoryPath
);
return
deleteAllFilesInDirectory
(
directoryPath
);
})
})
.
then
(()
=>
{
.
then
(()
=>
{
this
.
coverData
();
this
.
coverData
();
})
})
.
catch
((
error
)
=>
{
.
catch
((
error
)
=>
{
...
@@ -142,7 +140,6 @@ export default {
...
@@ -142,7 +140,6 @@ export default {
const
notSynchronizationList
=
this
.
notSynchronizationList
;
const
notSynchronizationList
=
this
.
notSynchronizationList
;
const
allList
=
this
.
allList
;
const
allList
=
this
.
allList
;
let
timeStr
=
moment
().
format
(
"yyyy_MM_DD_hh_mm_ss"
);
let
timeStr
=
moment
().
format
(
"yyyy_MM_DD_hh_mm_ss"
);
const
JFXJ_DATA
=
notSynchronizationList
const
JFXJ_DATA
=
notSynchronizationList
...
@@ -160,19 +157,17 @@ export default {
...
@@ -160,19 +157,17 @@ export default {
return
item
[
item
.
inspectionCode
];
return
item
[
item
.
inspectionCode
];
});
// 井道数据类型是 2
});
// 井道数据类型是 2
this
.
loading
=
true
;
this
.
loading
=
true
;
const
tmepList
=
[];
const
tmepList
=
[];
if
(
JFXJ_DATA
.
length
)
{
if
(
JFXJ_DATA
.
length
)
{
let
JFXJ_DATA_FILE_NAME
=
`
${
userName
}
_JFXJ_
${
timeStr
}
.txt`
;
let
JFXJ_DATA_FILE_NAME
=
`
${
userName
}
_JFXJ_
${
timeStr
}
.txt`
;
tmepList
.
push
(
this
.
packedData
(
JFXJ_DATA
,
JFXJ_DATA_FILE_NAME
));
tmepList
.
push
(
this
.
packedData
(
JDXJ_DATA
,
JFXJ_DATA_FILE_NAME
));
}
if
(
JDXJ_DATA
.
length
)
{
let
JDXJ_DATA_FILE_NAME
=
`
${
userName
}
_JDXJ_
${
timeStr
}
.txt`
;
tmepList
.
push
(
this
.
packedData
(
JDXJ_DATA
,
JDXJ_DATA_FILE_NAME
));
}
}
JDXJ_DATA
.
forEach
((
item
,
index
)
=>
{
let
JDXJ_DATA_FILE_NAME
=
`
${
userName
}
_JDXJ_
${
timeStr
}
_
${
index
}
.txt`
;
tmepList
.
push
(
this
.
packedData
(
item
,
JDXJ_DATA_FILE_NAME
));
});
Promise
.
all
(
tmepList
)
Promise
.
all
(
tmepList
)
.
then
(()
=>
{
.
then
(()
=>
{
...
@@ -223,8 +218,7 @@ export default {
...
@@ -223,8 +218,7 @@ export default {
const
log_list
=
this
.
$store
.
state
.
log_list
;
const
log_list
=
this
.
$store
.
state
.
log_list
;
log_list
.
push
(
logContent
);
log_list
.
push
(
logContent
);
this
.
$store
.
commit
(
"SET_LOG_LIST"
,
log_list
);
this
.
$store
.
commit
(
"SET_LOG_LIST"
,
log_list
);
addLog
(
log_list
).
then
((
res
)
=>
{
addLog
(
log_list
).
then
((
res
)
=>
{});
});
// 更新同步时间
// 更新同步时间
this
.
updateSysTime
();
this
.
updateSysTime
();
...
@@ -290,12 +284,13 @@ export default {
...
@@ -290,12 +284,13 @@ export default {
console
.
log
(
"APP.vue 存储数据失败"
,
error
);
console
.
log
(
"APP.vue 存储数据失败"
,
error
);
},
},
});
});
createFileWithPlusIO
(
SYNCHRONIZE_DATA_PAD
,
USER_FILE_NAME
,
fileContent
).
then
(()
=>
{
createFileWithPlusIO
(
SYNCHRONIZE_DATA_PAD
,
USER_FILE_NAME
,
fileContent
)
console
.
log
(
"---用户数据更新成功"
)
.
then
(()
=>
{
}).
catch
(
error
=>
{
console
.
log
(
"---用户数据更新成功"
);
console
.
log
(
"---用户数据更新失败"
,
error
)
})
})
.
catch
((
error
)
=>
{
console
.
log
(
"---用户数据更新失败"
,
error
);
});
});
});
},
},
},
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论