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

fix:井道完成

上级 38f620e9
...@@ -15,11 +15,24 @@ uni-page-head .uni-btn-icon { ...@@ -15,11 +15,24 @@ uni-page-head .uni-btn-icon {
} }
.uni-nav-bar-right-text{ .uni-nav-bar-right-text {
font-size: 14px !important; font-size: 14px !important;
} }
.uni-navbar-btn-text>text{ .uni-nav-bar-text {
height: 28.8px;
width: 28.8px;
background: #ffffff;
border: 0.32px solid rgba(224, 224, 224, 1);
border-radius: 14.4px;
color: #333;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
}
.uni-navbar-btn-text>text {
font-size: 14px !important; font-size: 14px !important;
} }
...@@ -45,7 +58,7 @@ uni-page-head .uni-btn-icon { ...@@ -45,7 +58,7 @@ uni-page-head .uni-btn-icon {
} }
.uni-navbar__header { .uni-navbar__header {
padding: 0 32px !important; padding: 0 25.6px !important;
/* padding-right: 18px !important; */ /* padding-right: 18px !important; */
} }
......
<template>
<view>
<view class="canvas-container">
<canvas canvas-id="canvas" id="canvas" :disable-scroll="true" style="width: 100%; height: 200px;background-color: #FFFFFF;"
@touchstart="handleTouchStart($event)" @touchmove="handleTouchMove($event)" @touchend="handleTouchEnd($event)"
@touchcancel="handleEnd($event)"></canvas>
</view>
<view class="btn-container">
<button class="cu-btn lg bg-blue" @click="handleConfirm()">确定</button>
<button class="cu-btn lg line-gray" @click="reset()">重置</button>
</view>
</view>
</template>
<script>
var context = null
export default {
props: {
dialogVisiable: {
type: Boolean,
default: false
}
},
data() {
return {
canvasData: []
};
},
watch: {
dialogVisiable() {
if (this.dialogVisiable === true) {
context = uni.createCanvasContext('canvas')
context.setLineWidth(3)
context.setStrokeStyle("#000000")
this.reset()
}
},
canvasData() {
context.moveTo(this.canvasData[0].x, this.canvasData[0].y)
for (let i = 0; i < this.canvasData.length; i++) {
context.lineTo(this.canvasData[i].x, this.canvasData[i].y)
}
context.stroke()
context.draw(true)
}
},
methods: {
reset() {
context.draw()
},
hideModal() {
this.$emit('update:dialogVisiable', false)
},
handleTouchStart(e) {
this.canvasData = []
const a = e.changedTouches[0]
this.canvasData.push({
x: a.x,
y: a.y
})
},
handleTouchMove(e) {
const a = e.changedTouches[0]
this.canvasData.push({
x: a.x,
y: a.y
})
},
handleTouchEnd(e) {
const a = e.changedTouches[0]
this.canvasData.push({
x: a.x,
y: a.y
})
},
handleEnd() {
context.stroke()
context.draw(true)
},
handleConfirm() {
uni.canvasToTempFilePath({
canvasId: 'canvas',
success: res => {
this.$emit('success', res.tempFilePath)
}
})
}
}
}
</script>
<style lang="scss" scoped>
.canvas-container {
width: 400px;
}
.btn-container {
padding-bottom: 20rpx;
display: flex;
justify-content: space-around;
}
</style>
import Signature from './components/jackyq-signature.vue'
export default Signature
\ No newline at end of file
<template> <template>
<!-- 巡检管理 --> <!-- 巡检管理 -->
<view class="inspection-management"> <view class="inspection-management">
<uni-nav-bar :fixed="true" background-color="rgba(214, 240, 255, 0.0)" status-bar rightWidth="300"> <uni-nav-bar
:fixed="true"
background-color="rgba(214, 240, 255, 0.0)"
status-bar
rightWidth="300"
>
<block slot="left"> <block slot="left">
<view class="uni-nav-bar-text" @click="back"> <view class="uni-nav-bar-text" @click="back">
<text class="iconfont icon-Arrow-Left"></text> <text class="iconfont icon-Arrow-Left"></text>
...@@ -26,13 +31,21 @@ ...@@ -26,13 +31,21 @@
<view class="month-list"> <view class="month-list">
<!-- 每月记录 --> <!-- 每月记录 -->
<view class="month-record-item" v-for="(item, index) in list" :key="index"> <view
class="month-record-item"
v-for="(item, index) in list"
:key="index"
>
<view v-if="(item.list || []).length" class="seconed-title"> <view v-if="(item.list || []).length" class="seconed-title">
{{ item.submitTime || item.time}} {{ item.submitTime || item.time }}
</view> </view>
<view class="inspect-list"> <view class="inspect-list">
<InspectionItem v-for="ele in item.list" :key="ele.uid" :details="ele" /> <InspectionItem
v-for="ele in item.list"
:key="ele.uid"
:details="ele"
/>
</view> </view>
</view> </view>
...@@ -46,17 +59,13 @@ ...@@ -46,17 +59,13 @@
</template> </template>
<script> <script>
import SearchCom from "@/components/searchCom/index.vue"; import SearchCom from "@/components/searchCom/index.vue";
import InspectionItem from "@/components/inspectionItem/index.vue"; import InspectionItem from "@/components/inspectionItem/index.vue";
import { import { getDarft } from "@/request/index.js";
getDarft import { getAllInspections } from "@/request/index.js";
} from "@/request/index.js"; import Empty from "@/components/empty/index.vue";
import {
getAllInspections
} from "@/request/index.js";
import Empty from "@/components/empty/index.vue";
export default { export default {
components: { components: {
SearchCom, SearchCom,
InspectionItem, InspectionItem,
...@@ -98,7 +107,6 @@ ...@@ -98,7 +107,6 @@
userInfo() { userInfo() {
return this.$store.state.now_user || {}; return this.$store.state.now_user || {};
}, },
}, },
methods: { methods: {
// 返回 // 返回
...@@ -114,15 +122,12 @@ ...@@ -114,15 +122,12 @@
uni.navigateTo({ uni.navigateTo({
url: "/pages/shaftInspection/shaftInspectionNew", url: "/pages/shaftInspection/shaftInspectionNew",
}); });
} }
}, },
init() { init() {
const all_data = this.all_data || []; const all_data = this.all_data || [];
const { const { inspectionTime = [] } = this.searchForm;
inspectionTime = []
} = this.searchForm;
const startTime = inspectionTime[0]; const startTime = inspectionTime[0];
const endTime = inspectionTime[1]; const endTime = inspectionTime[1];
...@@ -132,13 +137,13 @@ ...@@ -132,13 +137,13 @@
return true; return true;
} else { } else {
return ( return (
new Date(startTime).getTime() <= new Date(item.submitTime).getTime() && new Date(startTime).getTime() <=
new Date(item.submitTime).getTime() &&
new Date(item.submitTime).getTime() <= new Date(endTime).getTime() new Date(item.submitTime).getTime() <= new Date(endTime).getTime()
); );
} }
}); });
// 属于同一个月的数据 聚合 // 属于同一个月的数据 聚合
const tempAllData = {}; const tempAllData = {};
timeFrame.forEach((item) => { timeFrame.forEach((item) => {
...@@ -165,23 +170,28 @@ ...@@ -165,23 +170,28 @@
}); });
this.list = list; this.list = list;
console.log("this.list",this.list) console.log("this.list", this.list);
}, },
coverData(arr = []) { coverData(arr = []) {
console.log("arr",arr)
const { const {
isException = "", isException = "",
inspectionType = "", inspectionType = "",
synchronization = "", synchronization = "",
} = this.searchForm; } = this.searchForm;
return arr.filter((item) => { return arr.filter((item) => {
return ( return (
(!isException || isException == "all" || item.isException == isException) && (!isException ||
(!inspectionType || inspectionType == "all" || item.inspectionType == inspectionType) && isException == "all" ||
(!synchronization || synchronization == "all" || item.synchronization == synchronization) item.isException == isException) &&
(!inspectionType ||
inspectionType == "all" ||
item.inspectionType == inspectionType) &&
(!synchronization ||
synchronization == "all" ||
item.synchronization == synchronization)
); );
}); });
}, },
...@@ -230,93 +240,83 @@ ...@@ -230,93 +240,83 @@
}); });
}, },
}, },
}; };
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
/* 导航栏样式 */ .uni-nav-bar-text {
.uni-nav-bar-text { height: 28.8px;
height: 36px; width: 28.8px;
width: 36px;
background: #ffffff; background: #ffffff;
border: 0.4px solid rgba(224, 224, 224, 1); border: 0.32px solid rgba(224, 224, 224, 1);
border-radius: 18px; border-radius: 14.4px;
border-radius: 50%;
color: #333; color: #333;
display: flex;
align-items: center;
justify-content: center;
text-align: center; text-align: center;
.iconfont { .iconfont {
font-size: 20px; font-size: 16px;
line-height: 36px; line-height: 28.8px;
}
}
.nav-right {
width: 240px;
} }
}
.header-buttons { .nav-right {
width: 192px;
}
.header-buttons {
display: flex; display: flex;
align-items: center; align-items: center;
margin-left: auto; // 将按钮组推到最右侧 margin-left: auto;
.button { .button {
width: 112px; width: 89.6px;
height: 36px; height: 28.8px;
background: #FFFFFF; background: #ffffff;
border-radius: 18px; border-radius: 14.4px;
margin-left: 16px; margin-left: 12.8px;
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
font-size: 16px; font-size: 12.8px;
color: #000000; color: #000000;
line-height: 36px; line-height: 28.8px;
font-weight: 400; font-weight: 400;
border: 0;
} }
} }
.inspection-management {
.inspection-management { background-image: linear-gradient(115deg, #e8f0fb 0%, #e1ebfa 100%);
background-image: linear-gradient(115deg, #E8F0FB 0%, #E1EBFA 100%); padding: 0 25.6px;
padding: 0 32px;
.inspection-management-content { .inspection-management-content {
.count-tatal { .count-tatal {
font-family: PingFangSC-Medium; font-family: PingFangSC-Medium;
margin: 16px 0px 24px; margin: 12.8px 0px 19.2px;
font-size: 14px; font-size: 11.2px;
color: #4a4a4a; color: #4a4a4a;
font-weight: 400; font-weight: 400;
height: 28px; height: 22.4px;
line-height: 28px; line-height: 22.4px;
.num { .num {
font-size: 20px; font-size: 16px;
color: #3774f6; color: #3774f6;
line-height: 28px; line-height: 22.4px;
font-weight: 500; font-weight: 500;
margin-right: 2px; margin-right: 1.6px;
} }
} }
.month-list { .month-list {
height: calc(100vh - 26px - 16px - 8px - 36px - 62px); height: calc(100vh - 20.8px - 12.8px - 6.4px - 28.8px - 49.6px - 25px);
overflow: auto; overflow: auto;
padding-bottom: 140px; // padding-bottom: 112px;
.seconed-title { .seconed-title {
font-size: 20px; font-size: 16px;
color: #000000; color: #000000;
line-height: 28px; line-height: 22.4px;
font-weight: 500; font-weight: 500;
margin-bottom: 12px; margin-bottom: 9.6px;
} }
.month-record-item { .month-record-item {
margin-bottom: 24px; margin-bottom: 19.2px;
&:last-of-type { &:last-of-type {
margin: 0; margin: 0;
} }
.inspect-list { .inspect-list {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
...@@ -325,21 +325,20 @@ ...@@ -325,21 +325,20 @@
} }
} }
} }
.inspection-button { .inspection-button {
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
position: fixed; position: fixed;
bottom: 60px; bottom: 48px;
width: 240px; width: 192px;
height: 48px; height: 38.4px;
left: 50%; left: 50%;
color: #fff; color: #fff;
transform: translateX(-50%); transform: translateX(-50%);
background-image: linear-gradient(180deg, #3773f6 0%, #2c57f6 99%); background-image: linear-gradient(180deg, #3773f6 0%, #2c57f6 99%);
box-shadow: 0px 10px 24px 0px rgba(51, 104, 246, 0.24); box-shadow: 0px 8px 19.2px 0px rgba(51, 104, 246, 0.24);
border-radius: 27px; border-radius: 21.6px;
}
} }
}
</style> </style>
...@@ -330,8 +330,10 @@ export default { ...@@ -330,8 +330,10 @@ export default {
background: #ffffff; background: #ffffff;
border: 0.32px solid rgba(224, 224, 224, 1); border: 0.32px solid rgba(224, 224, 224, 1);
border-radius: 14.4px; border-radius: 14.4px;
border-radius: 50%;
color: #333; color: #333;
display: flex;
align-items: center;
justify-content: center;
text-align: center; text-align: center;
.iconfont { .iconfont {
......
...@@ -280,21 +280,6 @@ export default { ...@@ -280,21 +280,6 @@ export default {
<style lang="less" scoped> <style lang="less" scoped>
/* 导航栏样式 */ /* 导航栏样式 */
.uni-nav-bar-text {
height: 28.8px;
width: 28.8px;
background: #ffffff;
border: 0.32px solid rgba(224, 224, 224, 1);
border-radius: 14.4px;
border-radius: 50%;
color: #333;
text-align: center;
.iconfont {
font-size: 16px;
line-height: 28.8px;
}
}
.nav-right { .nav-right {
width: 192px; width: 192px;
......
<template> <template>
<!-- 井道巡检操作 --> <!-- 井道巡检操作 -->
<view class="container"> <view class="container">
<uni-nav-bar :fixed="true" background-color="rgba(214, 240, 255, 0.0)" status-bar rightWidth="300"> <uni-nav-bar
:fixed="true"
background-color="rgba(214, 240, 255, 0.0)"
status-bar
rightWidth="300"
>
<block slot="left"> <block slot="left">
<view class="uni-nav-bar-text" @click="back"> <view class="uni-nav-bar-text" @click="back">
<text class="iconfont icon-Arrow-Left"></text> <text class="iconfont icon-Arrow-Left"></text>
...@@ -12,85 +17,98 @@ ...@@ -12,85 +17,98 @@
<view class="profile-box"> <view class="profile-box">
<view class="profile-left"> <view class="profile-left">
<view class="avatar"> <view class="avatar">
<image src="@/static/img/add-img/home1.png" mode="aspectFit"></image> <image
src="@/static/img/add-img/home1.png"
mode="aspectFit"
></image>
</view> </view>
<view class="info"> <view class="info">
<view class="username">井道巡检</view> <view class="username">井道巡检</view>
<view class="number">位置:<text class="value">{{ location }}</text></view> <view class="number"
>位置:<text class="value">{{ location }}</text></view
>
</view> </view>
</view> </view>
</view> </view>
</view> </view>
<!-- 模块1:巡检井道 -->
<!-- <view class="module">
<view class="title-bar">
<view class="blue-line"></view>
<text class="title">巡检井道</text>
<text class="location">{{ location }}{{floor}}</text>
<button class="submit-btn" :class="{ active: isSubmitEnabled }" :disabled="!isSubmitEnabled" @click="submit">
完成当前机房全部巡检
</button>
</view>
</view> -->
<!-- 模块2:巡检说明 -->
<!-- <view class="module">
<view class="title-bar">
<view class="blue-line"></view>
<text class="title">巡检说明</text>
</view>
<text class="description">{{ randomDescription }}</text>
</view> -->
<!-- 模块3:Tab 操作区域 --> <!-- 模块3:Tab 操作区域 -->
<view class="module"> <view class="module">
<view class="tab-buttons"> <view class="tab-buttons">
<view v-for="(tab, index) in tabs" :key="index" :class="['tab-item', { active: activeTab === index }]" <view
@click="switchTab(index)"> v-for="(tab, index) in tabs"
:key="index"
:class="['tab-item', { active: activeTab === index }]"
@click="switchTab(index)"
>
<image :src="tab.icon" class="tab-icon"></image> <image :src="tab.icon" class="tab-icon"></image>
<text class="tab-text">{{ tab.label }}</text> <text class="tab-text">{{ tab.label }}</text>
<view v-if="activeTab === index" class="underline"></view> <view v-if="activeTab === index" class="underline"></view>
</view> </view>
</view> </view>
<view class="tip"> <view class="tip">
<image class="tip-icon" src="@/static/img/add-img/home1.png" mode="aspectFit"></image>请点击“需巡检井道”执行巡检 <image
class="tip-icon"
src="@/static/img/add-img/home1.png"
mode="aspectFit"
></image
>请点击“需巡检井道”执行巡检
</view> </view>
<view class="tab-content"> <view class="tab-content">
<!-- 操作区域 --> <!-- 操作区域 -->
<view class="form-item"><text class="form-label">巡检项</text> <view class="form-item"
><text class="form-label">巡检项</text>
<view class="label"> <view class="label">
<text>{{ tabs[activeTab].label }}</text> <text>{{ tabs[activeTab].label }}</text>
</view> </view>
</view> </view>
<view class="form-item"> <view class="form-item">
<text class="form-label"><text class="required">*</text>巡检结论</text> <text class="form-label"
><text class="required">*</text>巡检结论</text
>
<view class="switch-container"> <view class="switch-container">
<view :class="['status-btn', { active: inspectionResult === 0 }]" @click="setInspectionResult(0)"> <view
:class="['status-btn', { active: inspectionResult === 0 }]"
@click="setInspectionResult(0)"
>
正常 正常
</view> </view>
<view :class="['status-btn', { active: inspectionResult === 1 }]" @click="setInspectionResult(1)"> <view
:class="['status-btn', { active: inspectionResult === 1 }]"
@click="setInspectionResult(1)"
>
异常 异常
</view> </view>
</view> </view>
</view> </view>
<view class="form-item"> <view class="form-item">
<text class="form-label"><text class="required">*</text>情况摘要</text> <text class="form-label"
<input class="input-box" v-model="list[activeTab] && list[activeTab].conclusion" placeholder="请输入情况摘要" /> ><text class="required">*</text>情况摘要</text
>
<input
class="input-box"
v-model="list[activeTab] && list[activeTab].conclusion"
placeholder="请输入情况摘要"
/>
</view> </view>
<view class="form-item"> <view class="form-item">
<text class="form-label">现场照片</text> <text class="form-label">现场照片</text>
<view class="photo-box"> <view class="photo-box">
<view class="photo-container"> <view class="photo-container">
<view @click="takePhoto" class="photo-btn"> + </view> <view @click="takePhoto" class="photo-btn"> + </view>
<view v-for="(photo, index) in list[activeTab] && <view
list[activeTab].photos" :key="index" class="photo-item"> v-for="(photo, index) in list[activeTab] &&
list[activeTab].photos"
:key="index"
class="photo-item"
>
<image :src="photo" class="photo"></image> <image :src="photo" class="photo"></image>
<text class="delete-photo" @click="deletePhoto(index)">×</text> <text class="delete-photo" @click="deletePhoto(index)">×</text>
</view> </view>
</view> </view>
<view class="photo-limit">请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view> <view class="photo-limit"
>请对检查项进行拍照留存(限5张)。发现“异常、告警”时,需拍照留存。</view
>
</view> </view>
</view> </view>
</view> </view>
...@@ -103,15 +121,18 @@ ...@@ -103,15 +121,18 @@
完成 完成
</button> </button>
</view> --> </view> -->
<view class="module submit-module"> <view class="submit-module">
<button class="action-btn" @click="submit(0)">暂存</button> <button class="action-btn" @click="submit(0)">暂存</button>
<button v-if="isSubmitEnabled" class="action-btn complete-btn" @click="submit"> <button
v-if="isSubmitEnabled"
class="action-btn complete-btn"
@click="submit(1)"
>
完成巡检 完成巡检
</button> </button>
<button v-else class="action-btn complete-btn" @click="closePopup"> <button v-else class="action-btn complete-btn" @click="nextTab">
下一项 下一项
</button> </button>
<button class="action-btn complete-btn" @click="submit(1)">完成</button>
</view> </view>
<!-- 使用 uni-popup 组件 完成弹窗 --> <!-- 使用 uni-popup 组件 完成弹窗 -->
<uni-popup ref="popup" type="center"> <uni-popup ref="popup" type="center">
...@@ -133,27 +154,24 @@ ...@@ -133,27 +154,24 @@
</template> </template>
<script> <script>
import { import {
pad_2_1_inspection_items, pad_2_1_inspection_items,
pad_2_1_inspection_position, pad_2_1_inspection_position,
pad_2_1_floor, pad_2_1_floor,
} from "@/utils/dict.js"; //巡检位置,A座到F座 楼层2楼4楼到26楼 } from "@/utils/dict.js"; //巡检位置,A座到F座 楼层2楼4楼到26楼
import { import {
addLog, addLog,
getLogContent, getLogContent,
LOG_TYPE_ENUM, LOG_TYPE_ENUM,
writeDarf, writeDarf,
writeInspectionData, writeInspectionData,
} from "@/utils/IoReadingAndWriting.js"; } from "@/utils/IoReadingAndWriting.js";
import { import { getInspectionDetails, getDarft } from "@/request/index.js";
getInspectionDetails, import moment from "moment";
getDarft import _ from "lodash";
} from "@/request/index.js";
import moment from "moment";
import _ from 'lodash';
export default { export default {
data() { data() {
return { return {
location: "", location: "",
...@@ -163,7 +181,8 @@ ...@@ -163,7 +181,8 @@
isSubmitEnabled: false, // 提交按钮是否可点击 isSubmitEnabled: false, // 提交按钮是否可点击
uid: "", uid: "",
randomDescription: "这是一段随机说明文字。", // 随机说明文字 randomDescription: "这是一段随机说明文字。", // 随机说明文字
tabs: [{ tabs: [
{
label: "门禁", label: "门禁",
icon: "../../static/img/add-img/home1.png", icon: "../../static/img/add-img/home1.png",
}, },
...@@ -252,12 +271,15 @@ ...@@ -252,12 +271,15 @@
.then((res) => { .then((res) => {
const detailsInfo = res; const detailsInfo = res;
console.log("getDetails", res); console.log("getDetails", res);
let list = detailsInfo.originData[this.value - 1].position[this.dictValue - 1].details; let list =
detailsInfo.originData[this.value - 1].position[this.dictValue - 1]
.details;
// 未巡检需要处理默认数据结构 // 未巡检需要处理默认数据结构
if (list && list.length) { if (list && list.length) {
this.list = list this.list = list;
} }
console.log("let list", list) this.inspectionResult = list[0].inspectionResult
console.log("let list", list);
this.detailsInfo = detailsInfo; this.detailsInfo = detailsInfo;
console.log("获取list", this.list); console.log("获取list", this.list);
...@@ -340,22 +362,22 @@ ...@@ -340,22 +362,22 @@
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
plus.io.resolveLocalFileSystemURL( plus.io.resolveLocalFileSystemURL(
filePath, filePath,
function(entry) { function (entry) {
entry.file( entry.file(
function(file) { function (file) {
const reader = new plus.io.FileReader(); const reader = new plus.io.FileReader();
reader.onloadend = function(evt) { reader.onloadend = function (evt) {
const base64 = evt.target.result; // 获取 Base64 数据 const base64 = evt.target.result; // 获取 Base64 数据
resolve(base64); // 返回 Base64 数据 resolve(base64); // 返回 Base64 数据
}; };
reader.readAsDataURL(file); // 读取文件并转换为 Base64 reader.readAsDataURL(file); // 读取文件并转换为 Base64
}, },
function(error) { function (error) {
reject("获取文件对象失败:" + error.message); reject("获取文件对象失败:" + error.message);
} }
); );
}, },
function(error) { function (error) {
reject("解析文件路径失败:" + error.message); reject("解析文件路径失败:" + error.message);
} }
); );
...@@ -369,25 +391,36 @@ ...@@ -369,25 +391,36 @@
// 处理提交数据 // 处理提交数据
getParams(isSubmit) { getParams(isSubmit) {
if (this.uid) { if (this.uid) {
let posItem =
let posItem = this.detailsInfo.originData[this.value - 1].position[this.dictValue - 1] this.detailsInfo.originData[this.value - 1].position[
posItem.details = this.list this.dictValue - 1
posItem.isSubmit = isSubmit ];
posItem.details = this.list;
posItem.isSubmit = isSubmit;
// 提交才会有巡检状态,暂存没有
if (isSubmit) {
if (!this.checkInspectionResult(this.list)) { if (!this.checkInspectionResult(this.list)) {
posItem.status = 2; //1表示已经巡检过有异常 posItem.status = 2; //1表示已经巡检过有异常
posItem.statusLable = "巡检异常" posItem.statusLable = "巡检异常";
} else { } else {
posItem.status = 1; //1表示已经巡检过没有异常 posItem.status = 1; //1表示已经巡检过没有异常
posItem.statusLable = "已巡检" posItem.statusLable = "已巡检";
} }
let { } else {
notZeroCount, posItem.status = 0; //暂存就是未巡检
equalTwoCount posItem.statusLable = "未巡检";
} = this.count(this.detailsInfo.originData) }
this.detailsInfo.inspectionNumber = notZeroCount //巡检总数 let { notZeroCount, equalTwoCount } = this.count(
this.detailsInfo.isException = equalTwoCount //异常数量 this.detailsInfo.originData
this.detailsInfo.isSubmit = this.typeSubmit(this.detailsInfo.originData) > 0 ? 0 : 1, //是否提交 );
this.detailsInfo.inspectionNumber = notZeroCount; //巡检总数
this.detailsInfo.isException = equalTwoCount; //异常数量
this.detailsInfo.isSubmit =
this.typeSubmit(this.detailsInfo.originData) > 0 ? 0 : 1; //是否提交
console.log("this.detailsInfo", this.detailsInfo); console.log("this.detailsInfo", this.detailsInfo);
this.detailsInfo.submitTime = moment().format("yyyy-MM-DD"); // 记录提交时间
this.detailsInfo.submitMonth = moment().format("yyyy-MM"); // 记录提交月份
this.detailsInfo.synchronization = 2 //编辑中
return this.detailsInfo; return this.detailsInfo;
} else { } else {
let baseInfo = this.baseInfo; let baseInfo = this.baseInfo;
...@@ -402,30 +435,27 @@ ...@@ -402,30 +435,27 @@
descript: "检查内容包括门禁、卫生、设备告警。", descript: "检查内容包括门禁、卫生、设备告警。",
}; };
}); });
let tabList = JSON.parse(JSON.stringify(dataObj)) let tabList = JSON.parse(JSON.stringify(dataObj));
let posItem = tabList[this.value - 1].position[this.dictValue - 1] let posItem = tabList[this.value - 1].position[this.dictValue - 1];
console.log("posItem", posItem);
posItem.details = this.list; posItem.details = this.list;
posItem.isSubmit = isSubmit //当前项是否提交 posItem.isSubmit = isSubmit; //当前项是否提交
console.log("this.list", this.list)
if (!this.checkInspectionResult(this.list)) { if (!this.checkInspectionResult(this.list)) {
posItem.status = 2; //1表示已经巡检过有异常 posItem.status = 2; //1表示已经巡检过有异常
posItem.statusLable = "巡检异常" posItem.statusLable = "巡检异常";
} else { } else {
posItem.status = 1; //1表示已经巡检过没有异常 posItem.status = 1; //1表示已经巡检过没有异常
posItem.statusLable = "已巡检" posItem.statusLable = "已巡检";
} }
console.log("this.tabList", tabList); // 根据获取到的每个井道的isSubmit来判断是否有暂存状态,只有有一个井道是暂存,那就是编辑中、暂存状态
// 根据获取到的每个井道的isSubmit来判断是否有暂存状态 let typeSubmit = this.typeSubmit(tabList);
let typeSubmit = this.typeSubmit(tabList)
const data = { const data = {
...baseInfo, ...baseInfo,
isSubmit: typeSubmit > 0 ? 0 : 1, //0暂存 1提交 isSubmit: typeSubmit > 0 ? 0 : 1, //0暂存(编辑中) 1提交(待同步,已同步)
inspectionNumber: 1, inspectionNumber: 1,
isException: posItem.status == 2 ? 1 : 0, isException: posItem.status == 2 ? 1 : 0,
items: [], items: [],
synchronization: 0, // 是否同步过 synchronization: typeSubmit > 0 ? 2 : 0, // 是否同步过
submitTime: moment().format("yyyy-MM-DD"), // 记录提交时间 submitTime: moment().format("yyyy-MM-DD"), // 记录提交时间
submitMonth: moment().format("yyyy-MM"), // 记录提交月份 submitMonth: moment().format("yyyy-MM"), // 记录提交月份
originData: tabList, //所有大楼和楼层的数据 originData: tabList, //所有大楼和楼层的数据
...@@ -446,89 +476,31 @@ ...@@ -446,89 +476,31 @@
} }
}); });
return acc; return acc;
}, { },
{
notZeroCount: 0, notZeroCount: 0,
equalTwoCount: 0 equalTwoCount: 0,
} // 初始化统计结果 } // 初始化统计结果
); );
}, },
typeSubmit(originData) { typeSubmit(originData) {
return originData.reduce((acc, curr) => { return originData.reduce((acc, curr) => {
return acc + curr.position.reduce((innerAcc, innerCurr) => { return (
acc +
curr.position.reduce((innerAcc, innerCurr) => {
return innerCurr.status === 0 ? innerAcc + 1 : innerAcc; return innerCurr.status === 0 ? innerAcc + 1 : innerAcc;
}, 0); }, 0)
);
}, 0); }, 0);
}, },
// 检查是否存在异常 // 检查是否存在异常
checkInspectionResult(arr) { checkInspectionResult(arr) {
return !arr.some((obj) => obj.inspectionResult === 1); return !arr.some((obj) => obj.inspectionResult === 1);
}, },
// 检查所有Tab 的必填项是否填写完整
isAllTabValid() {
const data = this.list;
// 校验函数
const validateData = (data) => {
return data.every(
(item) =>
item.inspectionResult !== null && item.conclusion.trim() !== ""
);
};
// 调用校验函数
const isValid = validateData(data);
console.log(141, isValid);
return isValid;
},
// 检查当前 Tab 的必填项是否填写完整
isCurrentTabValid() {
const currentTabData = this.list[this.activeTab];
console.log("currentTabData", currentTabData);
return (
currentTabData.inspectionResult !== null && // 巡检结论必填
currentTabData.conclusion.trim() !== "" // 情况摘要必填
// 现场照片为非必填项,不做校验
);
},
// 暂存
saveDraft(isSave = true) {
return new Promise((resolve, reject) => {
if (isSave) {
// 写入草稿文件 更新 store 草稿内容
const params = this.getParams();
console.log("params", params);
params.isSubmit = 0;
this.$store.commit("SET_DARF_DATA", params); // 缓存[巡检信息]
writeDarf(params).then((res) => {
console.log("写入草稿文件成功");
uni.showToast({
icon: "success",
title: "保存草稿成功",
});
});
// 新增日志信息
const logContent = getLogContent(
LOG_TYPE_ENUM.darf,
`${params.recordName}(${params.inspectionCode})`,
"巡检模块"
);
const log_list = this.$store.state.log_list;
logContent.inspectionType = params.inspectionType;
log_list.push(logContent);
this.$store.commit("SET_LOG_LIST", log_list);
addLog(log_list).then((res) => {
console.log("日志文件写入成功");
});
}
resolve();
});
},
// 提交 // 提交
submit(isSubmit = 1) { submit(isSubmit = 1) {
// 校验是否通过 // 校验是否通过
if (isSubmit && !this.isCurrentTabValid()) { if (isSubmit && !this.isAllTabValid()) {
uni.showToast({ uni.showToast({
title: "请填写完整必填项", title: "请填写完整必填项",
icon: "none", icon: "none",
...@@ -539,7 +511,7 @@ ...@@ -539,7 +511,7 @@
const all_data = this.$store.state.all_data; //获取全部数据 const all_data = this.$store.state.all_data; //获取全部数据
let logContent = ""; let logContent = "";
console.log("this.uid", this.uid); console.log("this.uid", this.uid);
console.log("all_data", all_data) console.log("all_data", all_data);
if (this.uid) { if (this.uid) {
const index = all_data.findIndex((element) => element.uid == this.uid); const index = all_data.findIndex((element) => element.uid == this.uid);
params.uid = this.uid; params.uid = this.uid;
...@@ -561,7 +533,7 @@ ...@@ -561,7 +533,7 @@
} }
// 更新巡检list // 更新巡检list
const userInfo = this.userInfo; const userInfo = this.userInfo;
console.log("all_data存储", all_data) console.log("all_data存储", all_data);
this.$store.commit("SET_ALL_DATA", all_data); this.$store.commit("SET_ALL_DATA", all_data);
const inspectList = all_data.filter( const inspectList = all_data.filter(
(item) => item.createByName == userInfo.user (item) => item.createByName == userInfo.user
...@@ -579,29 +551,57 @@ ...@@ -579,29 +551,57 @@
console.log("日志文件写入成功"); console.log("日志文件写入成功");
}); });
// 清空草稿数据
// this.$store.commit("SET_DARF_DATA", {}); // 缓存[巡检信息]
// writeDarf("").then((res) => {
// console.log("写入草稿文件成功");
// });
// 清空基础缓存信息 // 清空基础缓存信息
this.$store.commit("SET_TEMP_DATA", {}); // 缓存[巡检信息] this.$store.commit("SET_TEMP_DATA", {}); // 缓存[巡检信息]
// const historyData = {
// location: this.location,
// randomDescription: this.randomDescription,
// tabData: this.list,
// firstSubmitTime: this.firstSubmitTime,
// };
// uni.setStorageSync("inspectionHistory", historyData);
uni.showToast({ uni.showToast({
title: `${isSubmit}?'提交成功':'保存草稿成功'`, title: isSubmit ? "提交成功" : "保存草稿成功",
icon: "success", icon: "success",
}); });
uni.navigateTo({ uni.navigateTo({
url: "/pages/inspectionManagement/index", url: "/pages/inspectionManagement/index",
}); });
}, },
// 检查所有Tab 的必填项是否填写完整
isAllTabValid() {
const data = this.list;
// 校验函数
const validateData = (data) => {
return data.every(
(item) =>
item.inspectionResult !== null && item.conclusion.trim() !== ""
);
};
// 调用校验函数
const isValid = validateData(data);
console.log(141, isValid);
return isValid;
},
// 检查当前 Tab 的必填项是否填写完整
isCurrentTabValid() {
const currentTabData = this.list[this.activeTab];
console.log("currentTabData", currentTabData);
return (
currentTabData.inspectionResult !== null && // 巡检结论必填
currentTabData.conclusion.trim() !== "" // 情况摘要必填
// 现场照片为非必填项,不做校验
);
},
// 下一项
nextTab() {
console.log(5215415, this.isCurrentTabValid());
if (!this.isCurrentTabValid()) {
uni.showToast({
title: "请填写完整必填项",
icon: "none",
});
return false;
}
if (this.activeTab === 2) {
this.isSubmitEnabled = true;
} else {
this.switchTab(this.activeTab + 1);
}
},
// 切换 Tab // 切换 Tab
switchTab(index) { switchTab(index) {
this.activeTab = index; this.activeTab = index;
...@@ -621,37 +621,40 @@ ...@@ -621,37 +621,40 @@
this.switchTab((this.activeTab + 1) % this.tabs.length); this.switchTab((this.activeTab + 1) % this.tabs.length);
}, },
}, },
}; };
</script> </script>
<style scoped lang="less"> <style scoped lang="less">
/* 导航栏样式 */ .uni-nav-bar-text {
.uni-nav-bar-text { height: 28.8px;
height: 36px; width: 28.8px;
width: 36px;
background: #ffffff; background: #ffffff;
border: 0.4px solid rgba(224, 224, 224, 1); border: 0.32px solid rgba(224, 224, 224, 1);
border-radius: 18px; border-radius: 14.4px;
color: #333; color: #333;
display: flex;
align-items: center;
justify-content: center;
text-align: center; text-align: center;
.iconfont { .iconfont {
font-size: 20px; font-size: 16px;
line-height: 36px; line-height: 28.8px;
}
} }
}
.container { .container {
padding: 24px; padding: 19.2px;
} height: calc(100vh - 115px);
}
.profile-section { .profile-section {
width: 100%; width: 100%;
margin-bottom: 12.8px; margin-bottom: 10.24px;
.profile-box { .profile-box {
background-color: #fff; background-color: #fff;
border-radius: 9.6px; border-radius: 7.68px;
padding: 12.8px 25.6px; padding: 10.24px 20.48px;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
...@@ -662,11 +665,11 @@ ...@@ -662,11 +665,11 @@
.avatar { .avatar {
position: relative; position: relative;
width: 40.5px; width: 32.4px;
height: 40.5px; height: 32.4px;
border-radius: 50%; border-radius: 50%;
overflow: hidden; overflow: hidden;
margin-right: 9px; margin-right: 7.2px;
image { image {
width: 100%; width: 100%;
...@@ -680,28 +683,28 @@ ...@@ -680,28 +683,28 @@
right: 0; right: 0;
background-color: rgba(0, 0, 0, 0.5); background-color: rgba(0, 0, 0, 0.5);
text-align: center; text-align: center;
height: 17.6px; height: 14.08px;
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
font-size: 9.6px; font-size: 7.68px;
color: #ffffff; color: #ffffff;
line-height: 16px; line-height: 12.8px;
font-weight: 400; font-weight: 400;
} }
} }
.info { .info {
.username { .username {
font-size: 16px; font-size: 12.8px;
color: #000000; color: #000000;
line-height: 22.4px; line-height: 17.92px;
font-weight: 500; font-weight: 500;
margin-bottom: 7.2px; margin-bottom: 5.76px;
} }
.number { .number {
font-size: 12.8px; font-size: 10.24px;
color: #4a4a4a; color: #4a4a4a;
line-height: 22.4px; line-height: 17.92px;
font-weight: 400; font-weight: 400;
.value { .value {
...@@ -711,114 +714,109 @@ ...@@ -711,114 +714,109 @@
} }
} }
} }
} }
.module { .module {
background: #ffffff; background: #ffffff;
border-radius: 12px; height: 100%;
padding: 16px 25px; border-radius: 9.6px;
} padding: 12.8px 20px;
}
.title-bar { .title-bar {
display: flex; display: flex;
align-items: center; align-items: center;
margin-bottom: 10px; margin-bottom: 8px;
.blue-line { .blue-line {
width: 4px; width: 3.2px;
height: 16px; height: 12.8px;
background-color: #007aff; background-color: #007aff;
margin-right: 8px; margin-right: 6.4px;
} }
.title { .title {
font-size: 16px; font-size: 12.8px;
font-weight: bold; font-weight: bold;
} }
.location { .location {
margin-left: 8px; margin-left: 6.4px;
color: #666; color: #666;
} }
.submit-btn { .submit-btn {
position: absolute; position: absolute;
right: 24px; right: 19.2px;
width: 20%; width: 20%;
background-color: #ccc; background-color: #ccc;
color: #fff; color: #fff;
border-radius: 4px; border-radius: 3.2px;
padding: 4px 8px; padding: 3.2px 6.4px;
font-size: 12px; font-size: 9.6px;
&.active { &.active {
background-color: #007aff; background-color: #007aff;
} }
} }
} }
.description { .description {
font-size: 14px; font-size: 11.2px;
color: #666; color: #666;
} }
.tab-buttons { .tab-buttons {
display: flex; display: flex;
justify-content: flex-start; justify-content: flex-start;
/* 左对齐 */
align-items: center; align-items: center;
margin-bottom: 10px; margin-bottom: 8px;
gap: 20px; gap: 16px;
/* Tab 之间的间隔 */ }
/* 容器内边距 */
}
.tip { .tip {
width: 100%; width: 100%;
height: 34px; height: 27.2px;
background: rgba(55, 116, 246, 0.05); background: rgba(55, 116, 246, 0.05);
border: 1px solid rgba(55, 116, 246, 0.3); border: 0.8px solid rgba(55, 116, 246, 0.3);
border-radius: 10px; border-radius: 8px;
font-size: 14px; font-size: 11.2px;
color: #4a4a4a; color: #4a4a4a;
letter-spacing: 0; letter-spacing: 0;
line-height: 34px; line-height: 27.2px;
font-weight: 400; font-weight: 400;
padding: 0 12px; padding: 0 9.6px;
.tip-icon { .tip-icon {
width: 14px; width: 11.2px;
height: 14px; height: 11.2px;
margin-right: 8px; margin-right: 6.4px;
}
} }
}
.tab-item { .tab-item {
display: flex; display: flex;
align-items: flex-start; align-items: flex-start;
position: relative; position: relative;
padding: 8px 0; padding: 6.4px 0;
/* 上下内边距 */
cursor: pointer; cursor: pointer;
white-space: nowrap; white-space: nowrap;
/* 防止文字换行 */
.tab-icon { .tab-icon {
width: 10.5px; width: 8.4px;
height: 10.5px; height: 8.4px;
margin-bottom: 4px; margin-bottom: 3.2px;
margin-right: 3px; margin-right: 2.4px;
} }
.tab-text { .tab-text {
font-size: 14px; font-size: 11.2px;
color: #333; color: #333;
} }
&.active { &.active {
.tab-text { .tab-text {
color: #3774f6; color: #3774f6;
/* 选中时的文字颜色 */
} }
.underline { .underline {
...@@ -827,133 +825,133 @@ ...@@ -827,133 +825,133 @@
left: 50%; left: 50%;
transform: translateX(-50%); transform: translateX(-50%);
width: 100%; width: 100%;
/* 横线宽度与内容一致 */ height: 1.6px;
height: 2px;
background-color: #3774f6; background-color: #3774f6;
/* 选中时的横线颜色 */
}
} }
} }
}
.form-item { .form-item {
display: flex; display: flex;
align-items: center; align-items: center;
padding: 12px 0; padding: 9.6px 0;
line-height: 36px; line-height: 28.8px;
border-bottom: 1px solid #f2f3f5; border-bottom: 0.8px solid #f2f3f5;
.form-label { .form-label {
font-size: 14px; font-size: 11.2px;
font-weight: bold; font-weight: bold;
margin-right: 32px; margin-right: 25.6px;
width: 73px; width: 58.4px;
text-align: right; text-align: right;
.required { .required {
color: red; color: red;
margin-right: 4px; margin-right: 3.2px;
} }
} }
.switch-container { .switch-container {
display: flex; display: flex;
gap: 12px; gap: 9.6px;
/* 按钮之间的间隔 */
.status-btn { .status-btn {
flex: 1; flex: 1;
/* 按钮宽度平分 */ padding: 5.6px 19.2px;
padding: 7px 24px; font-size: 12.8px;
font-size: 16px;
color: #000000; color: #000000;
background: #f2f2f2; background: #f2f2f2;
text-align: center; text-align: center;
font-weight: 400; font-weight: 400;
line-height: 22px; line-height: 17.6px;
border-radius: 18px; border-radius: 14.4px;
&.active { &.active {
color: #ffffff; color: #ffffff;
background: #3774f6; background: #3774f6;
border: 0.4px solid rgba(224, 224, 224, 1); border: 0.32px solid rgba(224, 224, 224, 1);
} }
} }
} }
.input-box { .input-box {
flex: 1; flex: 1;
border-radius: 4px; border-radius: 3.2px;
font-size: 16px; font-size: 12.8px;
line-height: 24px; line-height: 19.2px;
} }
.photo-limit { .photo-limit {
font-size: 16px; font-size: 12.8px;
color: #959595; color: #959595;
line-height: 24px; line-height: 19.2px;
font-weight: 400; font-weight: 400;
} }
.photo-container { .photo-container {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
margin-bottom: 8px; margin-bottom: 6.4px;
.photo-item { .photo-item {
position: relative; position: relative;
margin-right: 8px; margin-right: 6.4px;
margin-bottom: 8px; margin-bottom: 6.4px;
.photo { .photo {
width: 72px; width: 57.6px;
height: 72px; height: 57.6px;
border-radius: 4px; border-radius: 3.2px;
margin-left: 12px; margin-left: 9.6px;
} }
.delete-photo { .delete-photo {
position: absolute; position: absolute;
top: -8px; top: -6.4px;
right: -8px; right: -6.4px;
background-color: #ff4d4f; background-color: #ff4d4f;
color: #fff; color: #fff;
width: 16px; width: 12.8px;
height: 16px; height: 12.8px;
border-radius: 50%; border-radius: 50%;
text-align: center; text-align: center;
line-height: 16px; line-height: 12.8px;
font-size: 12px; font-size: 9.6px;
} }
} }
} }
.photo-btn { .photo-btn {
background: #ffffff; background: #ffffff;
border: 0.34px solid rgba(221, 221, 221, 1); border: 0.272px solid rgba(221, 221, 221, 1);
border-radius: 2.05px; border-radius: 1.64px;
width: 72px; width: 57.6px;
height: 72px; height: 57.6px;
font-size: 72px; font-size: 57.6px;
color: #cccccc; color: #cccccc;
text-align: center; text-align: center;
line-height: 64px; line-height: 51.2px;
}
} }
}
.submit-module { .submit-module {
display: flex; display: flex;
justify-content: center; justify-content: center;
gap: 20px; position: fixed;
gap: 16px;
left: 50%;
transform: translateX(-50%);
bottom: 25.6px;
.action-btn { .action-btn {
width: 182px; width: 145.6px;
height: 48px; height: 38.4px;
line-height: 48px; line-height: 38.4px;
background: #ffffff; background: #ffffff;
border: 1px solid rgba(224, 224, 224, 1); border: 0.8px solid rgba(224, 224, 224, 1);
box-shadow: 0px 10px 24px 0px rgba(185, 185, 185, 0.24); box-shadow: 0px 8px 19.2px 0px rgba(185, 185, 185, 0.24);
border-radius: 27px 24px 24px 27px; border-radius: 21.6px 19.2px 19.2px 21.6px;
font-size: 20px; font-size: 16px;
color: #000000; color: #000000;
text-align: center; text-align: center;
font-weight: 400; font-weight: 400;
...@@ -963,52 +961,46 @@ ...@@ -963,52 +961,46 @@
color: #ffffff; color: #ffffff;
} }
} }
} }
// 弹窗内容样式 .popup-content {
.popup-content {
background-color: white; background-color: white;
padding: 40px; padding: 32px;
border-radius: 10px; border-radius: 8px;
text-align: center; text-align: center;
position: relative; position: relative;
width: 300px; width: 240px;
// 关闭按钮样式
.close-icon { .close-icon {
position: absolute; position: absolute;
top: 10px; top: 8px;
right: 10px; right: 8px;
font-size: 20px; font-size: 16px;
cursor: pointer; cursor: pointer;
} }
// 成功图标样式
.icon-success { .icon-success {
font-size: 40px; font-size: 32px;
color: green; color: green;
margin-bottom: 20px; margin-bottom: 16px;
} }
// 成功文字样式
.success-text { .success-text {
font-size: 18px; font-size: 14.4px;
margin-bottom: 20px; margin-bottom: 16px;
} }
// 下一项按钮样式
.next-button { .next-button {
background-color: blue; background-color: blue;
color: white; color: white;
padding: 10px 20px; padding: 8px 16px;
border-radius: 5px; border-radius: 4px;
cursor: pointer; cursor: pointer;
font-size: 16px; font-size: 12.8px;
// 按钮 hover 效果
&:hover { &:hover {
opacity: 0.9; opacity: 0.9;
} }
} }
} }
</style> </style>
<template> <template>
<view class="uni-navbar" :class="{'uni-dark':dark, 'uni-nvue-fixed': fixed}"> <view class="uni-navbar" :class="{'uni-dark':dark, 'uni-nvue-fixed': fixed}">
<view class="uni-navbar__content" :class="{ 'uni-navbar--fixed': fixed, 'uni-navbar--shadow': shadow, 'uni-navbar--border': border }" <view class="uni-navbar__content"
:style="{ 'background-color': themeBgColor }" > :class="{ 'uni-navbar--fixed': fixed, 'uni-navbar--shadow': shadow, 'uni-navbar--border': border }"
:style="{ 'background-color': themeBgColor }">
<status-bar v-if="statusBar" /> <status-bar v-if="statusBar" />
<view :style="{ color: themeColor,backgroundColor: themeBgColor ,height:navbarHeight}" <view :style="{ color: themeColor,backgroundColor: themeBgColor ,height:navbarHeight}" class="uni-navbar__header">
class="uni-navbar__header">
<view @tap="onClickLeft" class="uni-navbar__header-btns uni-navbar__header-btns-left" <view @tap="onClickLeft" class="uni-navbar__header-btns uni-navbar__header-btns-left"
:style="{width:leftIconWidth}"> :style="{width:leftIconWidth}">
<slot name="left"> <slot name="left">
...@@ -20,8 +20,7 @@ ...@@ -20,8 +20,7 @@
<view class="uni-navbar__header-container " @tap="onClickTitle"> <view class="uni-navbar__header-container " @tap="onClickTitle">
<slot> <slot>
<view class="uni-navbar__header-container-inner" v-if="title.length>0"> <view class="uni-navbar__header-container-inner" v-if="title.length>0">
<text class="uni-nav-bar-text uni-ellipsis-1" <text class="uni-nav-bar-text uni-ellipsis-1" :style="{color: themeColor }">{{ title }}</text>
:style="{color: themeColor }">{{ title }}</text>
</view> </view>
</slot> </slot>
</view> </view>
...@@ -205,11 +204,16 @@ ...@@ -205,11 +204,16 @@
position: sticky; position: sticky;
/* #endif */ /* #endif */
} }
.uni-navbar { .uni-navbar {
// box-sizing: border-box; // box-sizing: border-box;
} }
.uni-nav-bar-text { .uni-nav-bar-text {
display: flex;
align-items: center;
justify-content: center;
text-align: center;
/* #ifdef APP-PLUS */ /* #ifdef APP-PLUS */
font-size: 34rpx; font-size: 34rpx;
/* #endif */ /* #endif */
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论