|
@@ -55,13 +55,30 @@
|
|
|
} from 'vue'
|
|
|
import { getList, Download, TaskProcess, getRecordCalculate, RecordCalculate, statusDict } from '@/api/work';
|
|
|
|
|
|
+ //自定义返回行为,覆盖系统默认返回按钮
|
|
|
+ const backPressOptions = reactive({
|
|
|
+ from: 'backbutton'
|
|
|
+ } as OnBackPressOptions)
|
|
|
+
|
|
|
+ onBackPress((options : OnBackPressOptions) : boolean | null => {
|
|
|
+ console.log('onBackPress', options)
|
|
|
+ uni.navigateTo({
|
|
|
+ url: `/pages/work/record/InfoList`,
|
|
|
+ // 修改动画方向为从左到右退回
|
|
|
+ animationType: 'slide-in-left', // 使用从左到右滑出的动画效果
|
|
|
+ animationDuration: 300 // 动画持续时间,单位ms
|
|
|
+ })
|
|
|
+ // 返回true表示拦截默认返回行为
|
|
|
+ return true
|
|
|
+ })
|
|
|
+
|
|
|
const titleList = [{
|
|
|
title1: "部位", title2: "进度", title3: "状态"
|
|
|
}];
|
|
|
-
|
|
|
+
|
|
|
var taskProcessList = ref<RecordCalculate[]>([]);
|
|
|
var initTasks = [] as RecordCalculate[]
|
|
|
-
|
|
|
+
|
|
|
const download = ref<Download>({
|
|
|
pdid: 0,
|
|
|
workorder: "",
|
|
@@ -76,7 +93,7 @@
|
|
|
status: 1
|
|
|
})
|
|
|
|
|
|
-// #ifdef H5
|
|
|
+ // #ifdef H5
|
|
|
download = {
|
|
|
pdid: 1,
|
|
|
workorder: "632-P-01",
|
|
@@ -99,58 +116,62 @@
|
|
|
{ id: 6, name: "简段-内侧", num: 3, step: 0, state: "waiting" },
|
|
|
{ id: 7, name: "隧道管", num: 5, step: 0, state: "waiting" },
|
|
|
];
|
|
|
- // #endif
|
|
|
-
|
|
|
+ // #endif
|
|
|
+
|
|
|
onLoad((options) => {
|
|
|
const downloadId = options?.id ?? ""
|
|
|
// 模拟数据加载,建议替换为后端接口请求
|
|
|
- // #ifdef APP-ANDROID
|
|
|
- //获取下载产品数据
|
|
|
- getList('app_media_info', 'pdid', downloadId, null,null, null).then((res:UTSJSONObject) => {
|
|
|
- console.log(res)
|
|
|
- let dataList = res?.['data'] as UTSJSONObject[] ?? Array<UTSJSONObject>()
|
|
|
- if(dataList!=null && dataList.length>0){
|
|
|
- dataList.forEach(item =>{
|
|
|
- if(item!=null){
|
|
|
- let data = JSON.parse<Download>(item.toJSONString());
|
|
|
- if(data!=null){
|
|
|
- download.value = data
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- })
|
|
|
-
|
|
|
- //获取下载产品任务数据
|
|
|
- getRecordCalculate('app_media_record', downloadId, null).then((res:UTSJSONObject) => {
|
|
|
- console.log(res)
|
|
|
- let dataList = res?.['data'] as UTSJSONObject[] ?? Array<UTSJSONObject>()
|
|
|
- if(dataList!=null && dataList.length>0){
|
|
|
- dataList.forEach(item =>{
|
|
|
- if(item!=null){
|
|
|
- let task = JSON.parse<RecordCalculate>(item.toJSONString());
|
|
|
- if(task!=null){
|
|
|
- initTasks.push(task)
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
- }
|
|
|
- console.log(initTasks)
|
|
|
- taskProcessList.value = initTasks
|
|
|
- })
|
|
|
- // #endif
|
|
|
+ // #ifdef APP-ANDROID
|
|
|
+ //获取下载产品数据
|
|
|
+ getList('app_media_info', 'pdid', downloadId, null, null, null).then((res : UTSJSONObject) => {
|
|
|
+ console.log(res)
|
|
|
+ let dataList = res?.['data'] as UTSJSONObject[] ?? Array<UTSJSONObject>()
|
|
|
+ if (dataList != null && dataList.length > 0) {
|
|
|
+ dataList.forEach(item => {
|
|
|
+ if (item != null) {
|
|
|
+ let data = JSON.parse<Download>(item.toJSONString());
|
|
|
+ if (data != null) {
|
|
|
+ download.value = data
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+
|
|
|
+ //获取下载产品任务数据
|
|
|
+ getRecordCalculate('app_media_record', downloadId, null).then((res : UTSJSONObject) => {
|
|
|
+ console.log(res)
|
|
|
+ let dataList = res?.['data'] as UTSJSONObject[] ?? Array<UTSJSONObject>()
|
|
|
+ if (dataList != null && dataList.length > 0) {
|
|
|
+ dataList.forEach(item => {
|
|
|
+ if (item != null) {
|
|
|
+ let task = JSON.parse<RecordCalculate>(item.toJSONString());
|
|
|
+ if (task != null) {
|
|
|
+ initTasks.push(task)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ console.log(initTasks)
|
|
|
+ taskProcessList.value = initTasks
|
|
|
+ })
|
|
|
+ // #endif
|
|
|
})
|
|
|
|
|
|
const goBack = () => {
|
|
|
uni.navigateBack()
|
|
|
}
|
|
|
|
|
|
- const enterProcess = (photoitem : string, num: number, pid: number) => {
|
|
|
+ const enterProcess = (photoitem : string, num : number, pid : number) => {
|
|
|
console.log(photoitem);
|
|
|
uni.navigateTo({
|
|
|
url: `/pages/work/record/RecordList?photoitem=${photoitem}&num=${num}&pid=${pid}`
|
|
|
});
|
|
|
}
|
|
|
+
|
|
|
+ defineExpose({
|
|
|
+ backPressOptions
|
|
|
+ })
|
|
|
</script>
|
|
|
|
|
|
<style scoped>
|