提交 029fd5f6 authored 作者: caodi\cd's avatar caodi\cd

fix:修改

上级 3227a5c1
......@@ -39,7 +39,6 @@
>
<view class="photo-box">
<view class="photo-container">
<view @click="takePhoto(index)" class="photo-btn"> + </view>
<view
v-for="(photo, itemIndex) in item && item.photos"
:key="itemIndex"
......@@ -52,6 +51,7 @@
>×</text
>
</view>
<view @click="takePhoto(index)" class="photo-btn"> + </view>
</view>
<view class="photo-limit"
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view
......
......@@ -48,7 +48,6 @@
>
<view class="photo-box">
<view class="photo-container">
<view @click="takePhoto(index)" class="photo-btn"> + </view>
<view
v-for="(photo, itemIndex) in item && item.photos"
:key="itemIndex"
......@@ -61,6 +60,7 @@
>×</text
>
</view>
<view @click="takePhoto(index)" class="photo-btn"> + </view>
</view>
<view class="photo-limit"
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view
......
......@@ -37,7 +37,6 @@
>
<view class="photo-box">
<view class="photo-container">
<view @click="takePhoto(index)" class="photo-btn"> + </view>
<view
v-for="(photo, itemIndex) in item && item.photos"
:key="itemIndex"
......@@ -50,6 +49,7 @@
>×</text
>
</view>
<view @click="takePhoto(index)" class="photo-btn"> + </view>
</view>
<view class="photo-limit"
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view
......
......@@ -48,7 +48,6 @@
>
<view class="photo-box">
<view class="photo-container">
<view @click="takePhoto(index)" class="photo-btn"> + </view>
<view
v-for="(photo, itemIndex) in item && item.photos"
:key="itemIndex"
......@@ -61,6 +60,7 @@
>×</text
>
</view>
<view @click="takePhoto(index)" class="photo-btn"> + </view>
</view>
<view class="photo-limit"
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view
......
......@@ -14,7 +14,6 @@
<text class="form-label"><text class="required"></text>现场照片</text>
<view class="photo-box">
<view class="photo-container">
<view @click="takePhoto(index)" class="photo-btn"> + </view>
<view
v-for="(photo, itemIndex) in item && item.photos"
:key="itemIndex"
......@@ -25,6 +24,7 @@
>×</text
>
</view>
<view @click="takePhoto(index)" class="photo-btn"> + </view>
</view>
<view class="photo-limit"
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view
......
......@@ -68,7 +68,6 @@
>
<view class="photo-box">
<view class="photo-container">
<view @click="takePhoto(index)" class="photo-btn"> + </view>
<view
v-for="(photo, itemIndex) in item && item.photos"
:key="itemIndex"
......@@ -81,6 +80,7 @@
>×</text
>
</view>
<view @click="takePhoto(index)" class="photo-btn"> + </view>
</view>
<view class="photo-limit"
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view
......
......@@ -36,7 +36,6 @@
>
<view class="photo-box">
<view class="photo-container">
<view @click="takePhoto(index)" class="photo-btn"> + </view>
<view
v-for="(photo, itemIndex) in item && item.photos"
:key="itemIndex"
......@@ -49,6 +48,7 @@
>×</text
>
</view>
<view @click="takePhoto(index)" class="photo-btn"> + </view>
</view>
<view class="photo-limit"
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view
......
......@@ -44,7 +44,6 @@
<text class="form-label"><text class="required">*</text>现场照片</text>
<view class="photo-box">
<view class="photo-container">
<view @click="takePhoto(index)" class="photo-btn"> + </view>
<view
v-for="(photo, itemIndex) in item && item.photos"
:key="itemIndex"
......@@ -55,6 +54,7 @@
>×</text
>
</view>
<view @click="takePhoto(index)" class="photo-btn"> + </view>
</view>
<view class="photo-limit"
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view
......
......@@ -37,7 +37,6 @@
>
<view class="photo-box">
<view class="photo-container">
<view @click="takePhoto(index)" class="photo-btn"> + </view>
<view
v-for="(photo, itemIndex) in item && item.photos"
:key="itemIndex"
......@@ -50,6 +49,7 @@
>×</text
>
</view>
<view @click="takePhoto(index)" class="photo-btn"> + </view>
</view>
<view class="photo-limit"
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view
......
......@@ -217,6 +217,7 @@ export default {
jfType: "0",
value: "1",
paramsObjFirst: {},
all_data: [],
};
},
computed: {
......@@ -246,6 +247,7 @@ export default {
? this.deepClone(tabsInfo2)
: this.deepClone(tabsInfo1);
console.log("机房查看options", options);
this.all_data = this.$store.state.all_data || [];
if (options.uid) {
this.getDetails(options.uid);
} else {
......@@ -482,14 +484,14 @@ export default {
}
const params = this.getParams(isSubmit); //数据获取
console.log("提交时获取一次", params);
const all_data = this.$store.state.all_data; //获取全部数据
// const all_data = this.$store.state.all_data; //获取全部数据
let logContent = "";
console.log("all_data", all_data);
console.log("all_data", this.all_data);
if (this.uid) {
const index = all_data.findIndex((element) => element.uid == this.uid);
const index = this.all_data.findIndex((element) => element.uid == this.uid);
params.uid = this.uid;
all_data[index] = params;
this.all_data[index] = params;
logContent = getLogContent(
LOG_TYPE_ENUM.edit,
`${params.recordName}(${params.inspectionCode})`,
......@@ -497,7 +499,7 @@ export default {
);
} else {
this.uid = params.uid = new Date().getTime(); // 唯一标识 pad 端使用
all_data.push(params);
this.all_data.push(params);
logContent = getLogContent(
LOG_TYPE_ENUM.add,
`${params.recordName}(${params.inspectionCode})`,
......@@ -506,9 +508,9 @@ export default {
}
// 更新巡检list
const userInfo = this.userInfo;
console.log("all_data存储", all_data);
this.$store.commit("SET_ALL_DATA", all_data);
const inspectList = all_data.filter(
console.log("all_data存储", this.all_data);
this.$store.commit("SET_ALL_DATA", this.all_data);
const inspectList = this.all_data.filter(
(item) => item.createByName == userInfo.user
);
......
......@@ -92,7 +92,10 @@ export default {
},
methods: {
close() {
console.log("this.loading", this.loading);
if (!this.loading) {
this.$emit("close");
}
},
getDetails() {
this.$emit("getDetails");
......@@ -116,9 +119,18 @@ export default {
deleteAllFilesInDirectory(targetPath).then(() => {
// 复制
copyImagesToFolder(imagePaths, targetPath).then((res) => {
uni.showToast({
title: "打包成功",
icon: "none",
duration: 1000,
});
setTimeout(() => {
this.loading = false;
this.close();
uni.navigateTo({
url: "/pages/listingManagement/index?backValue=home",
});
}, 1000);
});
});
},
......@@ -128,8 +140,6 @@ export default {
let syncedData = this.list;
let imagePaths = this.list.map((user) => user.imgPath);
// 保存照片
this.copyImages(imagePaths, userName);
console.log("syncedData打包", syncedData);
let timeStr = moment().format("yyyy_MM_DD_hh_mm_ss");
syncedData.forEach((item) => {
item.synchronization = true;
......@@ -150,18 +160,9 @@ export default {
// writeDeviceData(tmepList, userName)
// .then((res) => {
// console.log("tmepList", tmepList);
this.$store.commit("SET_DEVICEDATA", this.list);
console.log("arr", arr);
this.$store.commit("SET_DEVICEDATA", arr);
setTimeout(
() => {
uni.showToast({
title: "打包成功",
icon: "none",
duration: 2000,
});
this.close();
this.loading = false;
let length = tmepList.length;
// 生成日志
const logContent = getLogContent(
......@@ -176,6 +177,7 @@ export default {
// 更新同步时间
this.updateSysTime();
this.copyImages(imagePaths, userName);
// this.getDetails();
},
2 * 1000
......
......@@ -59,8 +59,8 @@
@click.stop="toggleSelectDate(date)"
>
<text
class="inner-circle"
v-if="isDateAllSelected(group, date)"
class="iconfont icon-wancheng"
></text>
</view>
<text class="date">{{ date }}</text>
......@@ -78,7 +78,10 @@
:class="{ active: photo.selected }"
@click.stop="toggleSelect(photo)"
>
<text v-if="photo.selected"></text>
<text
v-if="photo.selected"
class="iconfont icon-wancheng"
></text>
</view>
<!-- <text
class="delete-icon iconfont icon-shanchu"
......@@ -422,12 +425,36 @@ export default {
align-items: center;
margin-bottom: 6.4px;
padding: 0 25.6px;
position: relative;
.circle-button {
width: 14.4px;
height: 14.4px;
line-height: 14.4px;
border-radius: 50%;
border: 1px solid rgba(199, 199, 199, 1);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.3s ease;
margin-bottom: 2px;
text-align: center;
position: absolute;
bottom: 4px;
.icon-wancheng {
color: #3774f6;
font-size: 16px;
border: 1px solid #fff;
background-color: #fff;
border-radius: 50%;
}
}
.date {
font-size: 20.8px;
color: #000000;
line-height: 14.4px;
font-weight: 500;
margin-left: 6.4px;
margin-left: 18px;
margin-bottom: 6.4px;
}
}
......@@ -453,18 +480,19 @@ export default {
top: 6.4px;
left: 6.4px;
border-radius: 50%;
width: 19.2px;
height: 19.2px;
border: 1px solid rgba(255, 255, 255, 0.2);
width: 20px;
height: 20px;
border: 1px solid #fff;
display: flex;
justify-content: center;
align-items: center;
line-height: 19.2px;
font-size: 9.6px;
&.active {
background: #3774f6;
color: #fff;
border: 1px solid #fff;
line-height: 20px;
.icon-wancheng {
color: #3774f6;
font-size: 20px;
// border: 1px solid #fff;
background-color: #fff;
border-radius: 50%;
}
}
......@@ -534,31 +562,4 @@ export default {
text-align: center;
font-weight: 400;
}
.circle-button {
width: 14.4px;
height: 14.4px;
border-radius: 50%;
border: 0.912px solid rgba(199, 199, 199, 1);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.3s ease;
margin-bottom: 2px;
font-size: 8px;
text-align: center;
&.active {
background: #3774f6;
color: #fff;
border: 1px solid #fff;
}
.inner-circle {
width: 14.4px;
height: 14.4px;
border-radius: 50%;
margin-right: 6.4px;
}
}
</style>
......@@ -90,7 +90,6 @@
<text class="form-label">现场照片</text>
<view class="photo-box">
<view class="photo-container">
<view @click="takePhoto" class="photo-btn"> + </view>
<view
v-for="(photo, index) in list[activeTab] &&
list[activeTab].photos"
......@@ -100,6 +99,7 @@
<image :src="photo" class="photo"></image>
<text class="delete-photo" @click="deletePhoto(index)">×</text>
</view>
<view @click="takePhoto" class="photo-btn"> + </view>
</view>
<view class="photo-limit"
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view
......@@ -195,6 +195,7 @@ export default {
baseInfo: {}, // 基础信息
list: [], //巡检信息
backValue: "", //路由来源
all_data: [],
};
},
computed: {
......@@ -219,6 +220,7 @@ export default {
this.dictValue = options.dictValue;
this.inspectionCode = options.inspectionCode;
this.backValue = options.backValue || "";
this.all_data = this.$store.state.all_data || [];
console.log("options", options);
if (options.uid) {
......@@ -502,15 +504,15 @@ export default {
return false;
}
const params = this.getParams(isSubmit); //数据获取
const all_data = this.$store.state.all_data; //获取全部数据
// const all_data = this.$store.state.all_data; //获取全部数据
let logContent = "";
console.log("this.uid", this.uid);
console.log("all_data", all_data);
console.log("all_data", this.all_data);
if (this.uid) {
const index = all_data.findIndex((element) => element.uid == this.uid);
const index = this.all_data.findIndex((element) => element.uid == this.uid);
params.uid = this.uid;
all_data[index] = params;
this.all_data[index] = params;
logContent = getLogContent(
LOG_TYPE_ENUM.edit,
`${params.recordName}(${params.inspectionCode})`,
......@@ -518,7 +520,7 @@ export default {
);
} else {
params.uid = new Date().getTime(); // 唯一标识 pad 端使用
all_data.push(params);
this.all_data.push(params);
logContent = getLogContent(
LOG_TYPE_ENUM.add,
`${params.recordName}(${params.inspectionCode})`,
......@@ -527,9 +529,9 @@ export default {
}
// 更新巡检list
const userInfo = this.userInfo;
console.log("all_data存储", all_data);
this.$store.commit("SET_ALL_DATA", all_data);
const inspectList = all_data.filter(
console.log("all_data存储", this.all_data);
this.$store.commit("SET_ALL_DATA", this.all_data);
const inspectList = this.all_data.filter(
(item) => item.createByName == userInfo.user
);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论