提交 11748db1 authored 作者: zs's avatar zs

edit

<script> <script>
import { import {
BASE_PATH, BASE_PATH,
SYNCHRONIZE_DATA_PATH, SYNCHRONIZE_DATA_PATH,
SYNCHRONIZE_DATA_PAD, SYNCHRONIZE_DATA_PAD,
...@@ -9,20 +9,14 @@ ...@@ -9,20 +9,14 @@
readFileContent, readFileContent,
USER_LiST, USER_LiST,
USER_FILE_NAME, USER_FILE_NAME,
} from "./utils/systemCofig"; } from "./utils/systemCofig";
import { import { Base64 } from "js-base64";
Base64 import { differenceBy } from "lodash";
} from "js-base64";
import { import { readDirectoryData } from "@/utils/IoReadingAndWriting.js";
differenceBy import initService from "@/api/sqllite/init.js";
} from "lodash"; export default {
onLaunch: function () {
import {
readDirectoryData
} from "@/utils/IoReadingAndWriting.js";
import initService from '@/api/sqllite/init.js'
export default {
onLaunch: function() {
// #ifdef APP-PLUS // #ifdef APP-PLUS
plus.screen.lockOrientation("landscape-primary"); //锁定横屏 plus.screen.lockOrientation("landscape-primary"); //锁定横屏
// #endif // #endif
...@@ -32,15 +26,17 @@ ...@@ -32,15 +26,17 @@
// #ifdef APP-PLUS // #ifdef APP-PLUS
plus.android.requestPermissions( plus.android.requestPermissions(
["android.permission.WRITE_EXTERNAL_STORAGE"], ["android.permission.WRITE_EXTERNAL_STORAGE"],
function(e) { function (e) {
if (e.deniedAlways.length > 0) { if (e.deniedAlways.length > 0) {
//权限被永久拒绝 //权限被永久拒绝
// 弹出提示框解释为何需要读写手机储存权限,引导用户打开设置页面开启 // 弹出提示框解释为何需要读写手机储存权限,引导用户打开设置页面开启
uni.showModal({ uni.showModal({
title: "存储权限", title: "存储权限",
content: "您拒绝了存储权限,请去设置-应用开启存储权限。", content: "您拒绝了存储权限,请去设置-应用开启存储权限。",
success: function(res) { success: function (res) {
if (res.confirm) {} else if (res.cancel) {} if (res.confirm) {
} else if (res.cancel) {
}
}, },
}); });
} }
...@@ -56,24 +52,27 @@ ...@@ -56,24 +52,27 @@
init(); init();
} }
}, },
function(e) {} function (e) {}
); );
// #endif // #endif
}, },
onShow: function() { onShow: function () {
const now_user = uni.getStorageSync("now_user") || {}; const now_user = uni.getStorageSync("now_user") || {};
if (now_user.user) { if (now_user.user) {
this.$store.commit("SET_USER", now_user); this.$store.commit("SET_USER", now_user);
} }
this.init(); this.init();
}, },
onLoad: function(query) { onLoad: function (query) {
console.log('即将开始初始化app') console.log("即将开始初始化app");
}, },
onHide: function() { onHide: function () {
// app关闭时将数据存储到本地缓存 // app关闭时将数据存储到本地缓存
uni.setStorageSync("now_user", this.$store.state.now_user); uni.setStorageSync("now_user", this.$store.state.now_user);
uni.setStorageSync("last_time", this.$store.state.now_user.LastSynchronizationTime); uni.setStorageSync(
"last_time",
this.$store.state.now_user.LastSynchronizationTime
);
// 清除store 数据 // 清除store 数据
this.$store.commit("SET_DARF_DATA", {}); this.$store.commit("SET_DARF_DATA", {});
...@@ -88,8 +87,8 @@ ...@@ -88,8 +87,8 @@
* 第三步:存储读取到的数据 * 第三步:存储读取到的数据
*/ */
async init() { async init() {
initService.init() initService.init();
return return;
checkAndCreateDirectory(SYNCHRONIZE_DATA_PAD) checkAndCreateDirectory(SYNCHRONIZE_DATA_PAD)
.then(() => { .then(() => {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
...@@ -124,15 +123,14 @@ ...@@ -124,15 +123,14 @@
}); });
}) })
.then(async (res) => { .then(async (res) => {
// 获取文件数据 // 获取文件数据
let userData = Base64.decode(res); let userData = Base64.decode(res);
const diffUserList = await this.diffUserList(userData) const diffUserList = await this.diffUserList(userData);
if (diffUserList.length) { if (diffUserList.length) {
this.updateIpadUsetList([...USER_LiST, ...diffUserList]) this.updateIpadUsetList([...USER_LiST, ...diffUserList]);
userData = JSON.stringify([...USER_LiST, ...diffUserList]) userData = JSON.stringify([...USER_LiST, ...diffUserList]);
} }
uni.setStorage({ uni.setStorage({
...@@ -154,77 +152,74 @@ ...@@ -154,77 +152,74 @@
// 比较代码中的用户列表 和 ipad中存储用户的 差异 // 比较代码中的用户列表 和 ipad中存储用户的 差异
async diffUserList(ipadUserList = []) { async diffUserList(ipadUserList = []) {
const temp = eval(ipadUserList) const temp = eval(ipadUserList);
const diffResult = differenceBy(USER_LiST, temp, "userId") const diffResult = differenceBy(USER_LiST, temp, "userId");
return diffResult return diffResult;
}, },
// 更新 ipad 用户信息 // 更新 ipad 用户信息
updateIpadUsetList(tempPersonList) { updateIpadUsetList(tempPersonList) {
const temp = JSON.stringify(tempPersonList); const temp = JSON.stringify(tempPersonList);
const fileContent = JSON.stringify(Base64.encode(temp)); const fileContent = JSON.stringify(Base64.encode(temp));
createFileWithPlusIO( createFileWithPlusIO(SYNCHRONIZE_DATA_PAD, USER_FILE_NAME, fileContent);
SYNCHRONIZE_DATA_PAD, },
USER_FILE_NAME,
fileContent
)
}
}, },
}; };
</script> </script>
<style lang="less"> <style lang="less">
@import "./common/global.css"; @import "./common/atom.less";
@import "~@/static/iconFont/iconfont.css"; @import "./common/base.less";
@import "./common/global.css";
@import "~@/static/iconFont/iconfont.css";
@font-face { @font-face {
font-family: AlibabaPuHuiTi-Medium; font-family: AlibabaPuHuiTi-Medium;
src: url("~@/static/font/Alibaba-PuHuiTi-Medium.ttf"); src: url("~@/static/font/Alibaba-PuHuiTi-Medium.ttf");
} }
@font-face { @font-face {
font-family: "iconfont"; font-family: "iconfont";
/* Project id 4374193 */ /* Project id 4374193 */
src: url("~@/static/iconFont/iconfont.woff2?t=1725876968366") format("woff2"), src: url("~@/static/iconFont/iconfont.woff2?t=1725876968366") format("woff2"),
url("~@/static/iconFont/iconfont.woff?t=1725876968366") format("woff"), url("~@/static/iconFont/iconfont.woff?t=1725876968366") format("woff"),
url("~@/static/iconFont/iconfont.ttf?t=1725876968366") format("truetype"); url("~@/static/iconFont/iconfont.ttf?t=1725876968366") format("truetype");
} }
// @font-face { // @font-face {
// font-family: "iconfont"; /* Project id 4374193 */ // font-family: "iconfont"; /* Project id 4374193 */
// src: url('iconfont.woff2?t=1725876968365') format('woff2'), // src: url('iconfont.woff2?t=1725876968365') format('woff2'),
// url('iconfont.woff?t=1725876968365') format('woff'), // url('iconfont.woff?t=1725876968365') format('woff'),
// url('iconfont.ttf?t=1725876968365') format('truetype'); // url('iconfont.ttf?t=1725876968365') format('truetype');
// } // }
@font-face { @font-face {
font-family: AlibabaPuHuiTi; font-family: AlibabaPuHuiTi;
src: url("~@/static/font/Alibaba-PuHuiTi-Regular.ttf"); src: url("~@/static/font/Alibaba-PuHuiTi-Regular.ttf");
} }
@font-face { @font-face {
font-family: YouSheBiaoTiHei; font-family: YouSheBiaoTiHei;
src: url("~@/static/font/YouSheBiaoTiHei.ttf"); src: url("~@/static/font/YouSheBiaoTiHei.ttf");
} }
body { body {
width: 100vw; width: 100vw;
// height: calc(100vh - 44px); // height: calc(100vh - 44px);
height: 100vh; height: 100vh;
background-color: #f3f6fa; background-color: #f3f6fa;
/* background-color: red; */ /* background-color: red; */
} }
* { * {
box-sizing: border-box; box-sizing: border-box;
font-family: AlibabaPuHuiTi; font-family: AlibabaPuHuiTi;
/* font-size: 9.41rpx; */ /* font-size: 9.41rpx; */
} }
image { image {
will-change: transform; will-change: transform;
/* 解决加载时瞬间拉伸问题 */ /* 解决加载时瞬间拉伸问题 */
width: auto; width: auto;
...@@ -236,21 +231,21 @@ ...@@ -236,21 +231,21 @@
image-rendering: -webkit-optimize-contrast; image-rendering: -webkit-optimize-contrast;
image-rendering: crisp-edges; image-rendering: crisp-edges;
-ms-interpolation-mode: nearest-neighbor; -ms-interpolation-mode: nearest-neighbor;
} }
.uni-nav-bar-text { .uni-nav-bar-text {
/* 导航栏文字大小 */ /* 导航栏文字大小 */
font-size: 24px !important; font-size: 24px !important;
letter-spacing: 1px; letter-spacing: 1px;
} }
.uni-navbar--shadow { .uni-navbar--shadow {
box-shadow: none !important; box-shadow: none !important;
} }
.uni-data-checklist .checklist-group { .uni-data-checklist .checklist-group {
flex-wrap: nowrap !important; flex-wrap: nowrap !important;
} }
/*每个页面公共css */ /*每个页面公共css */
</style> </style>
// 定义基础变量
@base-spacing: 1px;
@font-sizes: "12" 12px, "14" 14px, "16" 16px, "18" 18px, "20" 20px,
"22" 22px, "24" 24px, "26" 26px, "28" 28px, "30" 30px;
@colors: "primary" #3774f6, "black" #000000, "white" #ffffff, "gray" #808080,
"blue" #007bff, "green" #28a745, "red" #dc3545;
// 生成边距类(递归mixin实现)
.margin-loop(@i) when (@i >=0) {
.m-@{i} {
margin: @base-spacing * @i;
}
.mt-@{i} {
margin-top: @base-spacing * @i;
}
.mr-@{i} {
margin-right: @base-spacing * @i;
}
.mb-@{i} {
margin-bottom: @base-spacing * @i;
}
.ml-@{i} {
margin-left: @base-spacing * @i;
}
.my-@{i} {
margin-top: @base-spacing * @i;
margin-bottom: @base-spacing * @i;
}
.mx-@{i} {
margin-left: @base-spacing * @i;
margin-right: @base-spacing * @i;
}
.margin-loop(@i - 1);
}
.margin-loop(36);
// 生成padding类
.padding-loop(@i) when (@i >=0) {
.p-@{i} {
padding: @base-spacing * @i;
}
.pt-@{i} {
padding-top: @base-spacing * @i;
}
.pr-@{i} {
padding-right: @base-spacing * @i;
}
.pb-@{i} {
padding-bottom: @base-spacing * @i;
}
.pl-@{i} {
padding-left: @base-spacing * @i;
}
.py-@{i} {
padding-top: @base-spacing * @i;
padding-bottom: @base-spacing * @i;
}
.px-@{i} {
padding-left: @base-spacing * @i;
padding-right: @base-spacing * @i;
}
.padding-loop(@i - 1);
}
.padding-loop(36);
// 生成字体尺寸类
each(@font-sizes, {
.text-@{value} {
font-size: extract(@value, 2);
}
});
// 生成颜色类
each(@colors, {
@name: extract(@value, 1);
@color: extract(@value, 2);
.text-@{name} {
color: @color;
}
.bg-@{name} {
background-color: @color;
}
});
// Flex布局类
.flex {
display: flex;
}
// 主轴对齐
.justify {
&-start {
justify-content: flex-start;
}
&-end {
justify-content: flex-end;
}
&-center {
justify-content: center;
}
&-between {
justify-content: space-between;
}
&-around {
justify-content: space-around;
}
}
// 交叉轴对齐
.items {
&-start {
align-items: flex-start;
}
&-end {
align-items: flex-end;
}
&-center {
align-items: center;
}
&-stretch {
align-items: stretch;
}
}
// 排列方向
.flex-row {
flex-direction: row;
}
.flex-col {
flex-direction: column;
}
// 定位类
.relative {
position: relative;
}
.absolute {
position: absolute;
}
// 宽度类
.w-full {
width: 100%;
}
\ No newline at end of file
.v-btn {
display: inline-block;
height: 36px;
line-height: 36px;
box-shadow: 0px 1px 4px 0px rgba(84, 116, 232, 0.16) !important;
/* 核心样式 */
border-radius: 2px !important;
background-color: #3774f6 !important;
color: #fff !important;
/* 伪元素处理(H5生效) */
&::after {
border: none !important;
}
/* 禁用态样式 */
&[disabled] {
background-color: #CCCCCC !important;
}
&.v-btn-default {
background-color: #fff !important;
color: #3774f6 !important;
}
&.v-btn-round {
border-radius: 20px !important;
}
&.v-btn-block {
display: block;
}
&.v-btn-large {
height: 48px;
line-height: 48px;
}
}
\ No newline at end of file
<template>
<view v-if="value" class="common-dialog">
<view class="common-dialog__content">
<slot name="header">
<view class="common-dialog__header">{{ title }}</view>
</slot>
<view class="common-dialog__body">
<slot></slot>
</view>
<view class="common-dialog__footer common-dialog__footer--with-shadow">
<slot name="footer"> </slot>
</view>
<view class="common-dialog__close">
<text
class="common-dialog__close-icon iconfont icon-shibai1"
@click="handleClose"
></text>
</view>
</view>
</view>
</template>
<script>
export default {
name: "CommonDialog",
model: {
prop: "value",
event: "input",
},
props: {
value: {
type: Boolean,
default: false,
},
title: {
type: String,
default: "",
},
},
methods: {
handleClose() {
this.$emit("input", false);
this.$emit("close");
},
},
};
</script>
<style scoped lang="less">
/* 块级命名规范 */
.common-dialog {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
display: flex;
align-items: center;
justify-content: center;
text-align: center;
z-index: 99999;
/* 元素命名规范(双下划线连接) */
&__content {
padding: 25.6px 19.2px;
width: 420px;
box-sizing: border-box;
background-image: linear-gradient(
-6deg,
#f9ffe7 0%,
#ffffff 12%,
#fcfeff 73%,
#ccf1ff 100%
);
border: 0.4px solid rgba(224, 224, 224, 1);
border-radius: 12px;
position: relative;
}
&__header {
font-size: 18px;
color: #000000;
line-height: 26px;
font-weight: 500;
margin-bottom: 12px;
}
&__body {
font-size: 16px;
color: #000000;
text-align: center;
line-height: 24px;
font-weight: 400;
margin-bottom: 24px;
}
&__close {
position: absolute;
bottom: -40px;
left: 50%;
transform: translateX(-50%);
&-icon {
color: #fff;
font-size: 24px;
}
}
}
</style>
<template>
<radio-group class="radio-container" @change="handleChange">
<label
class="radio-item"
v-for="(item, index) in options"
:key="index"
:class="{ selected: value === item.value }"
>
<view class="radio-icon">
<view class="radio-inner"></view>
</view>
<text class="radio-label">{{ item.label }}</text>
<radio :value="item.value" :checked="value === item.value" hidden />
</label>
</radio-group>
</template>
<script>
export default {
name: "CommonRadio",
props: {
value: {
type: [String, Number],
default: "",
},
options: {
type: Array,
default: () => [
{ label: "正常", value: "normal" },
{ label: "异常", value: "abnormal" },
],
},
},
methods: {
handleChange(e) {
this.$emit("input", e.detail.value);
this.$emit("change", e.detail.value);
},
},
};
</script>
<style lang="less" scoped>
.radio-container {
display: flex;
gap: 16px;
padding: 16px;
}
.radio-item {
display: inline-block;
height: 36px;
line-height: 36px;
text-align: center;
min-width: 80px;
padding: 0 10px;
border-radius: 18px;
transition: all 0.3s ease;
background: #f2f2f2;
.radio-label {
font-size: 16px;
color: #000000;
font-weight: 400;
}
&.selected {
background: #3774f6;
.radio-label {
color: #ffffff;
}
}
/* 按压效果 */
&:active {
opacity: 0.9;
transform: scale(0.98);
}
}
</style>
<template>
<view class="upload-container">
<!-- 图片展示区域 -->
<view class="image-list">
<!-- 添加按钮 -->
<view
v-if="images.length < maxCount"
class="add-btn"
@click="chooseImage"
>
+
</view>
<view
v-for="(item, index) in images"
:key="index"
class="image-item"
@click="previewImage(index)"
>
<image :src="item" class="image" mode="aspectFill"></image>
<text class="delete-icon" @click.stop="deleteImage(index)">×</text>
</view>
</view>
<!-- 提示文字 -->
<view class="tip">
<slot name="tip">
请对检查项进行拍照留存(限{{
maxCount
}}张)。发现“异常、告警”时,需拍照留存。
</slot>
</view>
</view>
</template>
<script>
export default {
name: "CommonUpload",
props: {
value: {
type: Array,
default: () => [],
},
maxCount: {
type: Number,
default: 5, // 默认最多上传 5 张图片
},
sourceType: {
type: Array,
default: () => ["camera"], // 默认从相机拍摄
},
},
data() {
return {
images: this.value, // 绑定的图片数组
};
},
watch: {
value(newVal) {
this.images = newVal;
},
images(newVal) {
this.$emit("input", newVal); // 同步更新父组件绑定的数据
},
},
methods: {
// 选择图片
chooseImage() {
const count = this.maxCount - this.images.length; // 剩余可选图片数量
uni.chooseImage({
count: count,
sourceType: this.sourceType, // 使用传递的 sourceType
success: async (res) => {
const tempFilePaths = res.tempFilePaths;
for (const filePath of tempFilePaths) {
const base64 = await this.convertFileToBase64(filePath);
this.images.push(base64);
}
},
});
},
// 预览图片
previewImage(index) {
uni.previewImage({
current: index,
urls: this.images,
});
},
// 删除图片
deleteImage(index) {
this.images.splice(index, 1);
},
// 转换文件为 Base64
convertFileToBase64(filePath) {
return new Promise((resolve, reject) => {
plus.io.resolveLocalFileSystemURL(
filePath,
(entry) => {
entry.file(
(file) => {
const reader = new plus.io.FileReader();
reader.onloadend = (evt) => {
resolve(evt.target.result); // 返回 Base64 数据
};
reader.readAsDataURL(file); // 读取文件并转换为 Base64
},
(error) => {
reject("获取文件对象失败:" + error.message);
}
);
},
(error) => {
reject("解析文件路径失败:" + error.message);
}
);
});
},
},
};
</script>
<style scoped>
.upload-container {
padding: 10px;
}
.image-list {
display: flex;
flex-wrap: wrap;
}
.image-item {
position: relative;
width: 80px;
height: 80px;
margin-right: 10px;
margin-bottom: 10px;
}
.image {
width: 100%;
height: 100%;
border-radius: 5px;
}
.delete-icon {
position: absolute;
top: -10px;
right: -10px;
font-size: 20px;
color: red;
background-color: white;
border-radius: 50%;
width: 24px;
height: 24px;
text-align: center;
line-height: 24px;
}
.add-btn {
width: 80px;
height: 80px;
border: 1px dashed #ccc;
border-radius: 5px;
display: flex;
justify-content: center;
align-items: center;
font-size: 30px;
color: #ccc;
cursor: pointer;
margin-right: 10px;
}
.tip {
font-size: 12px;
color: #999;
margin-top: 5px;
}
</style>
<template>
<input v-bind="$attrs" v-model="inputValue" @input="handleInput" />
</template>
<script>
export default {
name: "NumberInput",
data() {
return {
inputValue: "",
};
},
props: {
decimalPlaces: {
type: Number,
default: 2,
},
min: {
type: Number,
default: -Infinity,
},
max: {
type: Number,
default: Infinity,
},
allowNegative: {
type: Boolean,
default: false,
},
},
methods: {
handleInput(e) {
let value = e.target.value;
if (!this.allowNegative) {
value = value.replace(/-/g, "");
}
// 去除非数字和小数点以外的字符
value = value.replace(/[^\d.]/g, "");
// 保证只有一个小数点
const dotCount = (value.match(/\./g) || []).length;
if (dotCount > 1) {
value = value.slice(0, value.lastIndexOf("."));
}
// 处理小数点后的位数
if (value.includes(".")) {
const parts = value.split(".");
parts[1] = parts[1].slice(0, this.decimalPlaces);
value = parts.join(".");
}
if (value) {
const numValue = parseFloat(value);
if (numValue < this.min) {
value = this.min.toString();
} else if (numValue > this.max) {
value = this.max.toString();
}
}
this.inputValue = value;
this.$emit("input", value);
},
},
};
</script>
...@@ -87,6 +87,12 @@ ...@@ -87,6 +87,12 @@
"style": { "style": {
"navigationBarTitleText": "" "navigationBarTitleText": ""
} }
},
{
"path": "pages/test/index",
"style": {
"navigationBarTitleText": ""
}
} }
// { // {
// "path" : "api/api", // "path" : "api/api",
......
<template> <template>
<!-- 首页 --> <!-- 首页 -->
<view class="container"> <view class="container">
<navigator url="/pages/test/index" hover-class="navigator-hover">
<button type="default">跳转到新页面</button>
</navigator>
<!-- 第一个模块 --> <!-- 第一个模块 -->
<view class="header"> <view class="header">
<view class="title">杭州内网监管在线-运维在线</view> <view class="title">杭州内网监管在线-运维在线</view>
......
...@@ -25,13 +25,13 @@ ...@@ -25,13 +25,13 @@
{{ item.lableArr[1] }} {{ item.lableArr[1] }}
</view> </view </view> </view
><input ><input
v-if="'value' in item && item.inspectionResult === 1" v-if="'value' in item"
class="input" class="input"
v-model="item.value" v-model="item.value"
type="text" type="text"
placeholder="请输入" placeholder="请输入"
maxlength="3" maxlength="3"
/>{{ item.inspectionResult === 1 ? item.unit : "" }} />{{ item.unit }}
</view> </view>
<template v-if="item.inspectionResult === 1"> <template v-if="item.inspectionResult === 1">
<view v-if="'conclusion' in item" class="form-item"> <view v-if="'conclusion' in item" class="form-item">
......
...@@ -25,13 +25,12 @@ ...@@ -25,13 +25,12 @@
{{ item.lableArr[1] }} {{ item.lableArr[1] }}
</view> </view </view> </view
><input ><input
v-if="'value' in item && item.inspectionResult === 1" v-if="'value' in item"
class="input" class="input"
v-model="item.value" v-model="item.value"
type="text" type="text"
placeholder="请输入" placeholder="请输入"
maxlength="3" />{{ item.unit }}
/>{{ item.inspectionResult === 1 ? item.unit : "" }}
</view> </view>
<template v-if="item.inspectionResult === 1"> <template v-if="item.inspectionResult === 1">
<view v-if="'conclusion' in item" class="form-item"> <view v-if="'conclusion' in item" class="form-item">
...@@ -133,7 +132,7 @@ export default { ...@@ -133,7 +132,7 @@ export default {
lableArr: ["正常", "异常"], lableArr: ["正常", "异常"],
conclusion: "", conclusion: "",
settingLabel: "设定湿度", settingLabel: "设定湿度",
setting: "25", //设定湿度值 setting: "20%~70", //设定湿度值
value: "", //输入湿度 value: "", //输入湿度
unit: "%", //单位 unit: "%", //单位
photos: [], photos: [],
......
...@@ -28,32 +28,63 @@ ...@@ -28,32 +28,63 @@
<view class="form-item"> <view class="form-item">
<text class="form-label" <text class="form-label"
><text class="required">*</text>{{ item.deviceLabel }}</text ><text class="required">*</text>{{ item.deviceLabel }}</text
><input >
<view>
<view
class="flex items-center"
v-for="(cabinet, idx) in item.cabinets"
:key="idx"
>
<view class="form-item">
<!-- <text class="form-label"></text> -->
<input
class="conclusion" class="conclusion"
v-model="item.deviceId" v-model="cabinet.deviceId"
type="text" type="text"
placeholder="请输入编号" placeholder="请输入编号"
/> />
</view> </view>
<view class="form-item"> <view class="form-item">
<text class="form-label" <text class="form-label"
><text class="required">*</text>{{ item.UpositonLabel }}</text ><text class="required">*</text
><input >{{ cabinet.UpositonLabel }}</text
>
<NumberInput
class="input" class="input"
v-model="item.UpositonS" v-model="cabinet.UpositonS"
type="number" type="number"
placeholder="请输入" placeholder="请输入"
maxlength="2"
/> />
<text class="fg"></text <!-- <input
><input
class="input" class="input"
v-model="item.UpositonE" v-model="cabinet.UpositonS"
type="number" type="number"
placeholder="请输入" placeholder="请输入"
maxlength="2" maxlength="2"
/> -->
<text class="fg"></text>
<NumberInput
class="input"
v-model="cabinet.UpositonE"
type="number"
placeholder="请输入"
/> />
<!-- <input
class="input"
v-model="cabinet.UpositonE"
type="number"
placeholder="请输入"
maxlength="2"
/> -->
</view> </view>
<view>
<button class="v-btn">+</button>
<button class="v-btn v-btn-default ml-10">-</button>
</view>
</view>
</view>
</view>
<view v-if="'conclusion' in item" class="form-item"> <view v-if="'conclusion' in item" class="form-item">
<text class="form-label" <text class="form-label"
><text class="required">*</text>情况摘要</text ><text class="required">*</text>情况摘要</text
...@@ -98,12 +129,14 @@ ...@@ -98,12 +129,14 @@
</template> </template>
<script> <script>
import NumberInput from "@/components/NumberInput/index.vue";
import customPopup from "./customPopup.vue"; import customPopup from "./customPopup.vue";
import _ from "lodash"; import _ from "lodash";
import mixin from "./mixin"; import mixin from "./mixin";
export default { export default {
mixins: [mixin], mixins: [mixin],
components: { components: {
NumberInput,
customPopup, customPopup,
}, },
props: { props: {
...@@ -144,6 +177,15 @@ export default { ...@@ -144,6 +177,15 @@ export default {
UpositonLabel: "U位", UpositonLabel: "U位",
UpositonS: "", UpositonS: "",
UpositonE: "", UpositonE: "",
cabinets: [
{
deviceId: "",
deviceLabel: "故障设备机柜",
UpositonLabel: "U位",
UpositonS: "",
UpositonE: "",
},
],
photos: [], photos: [],
}, },
], ],
......
...@@ -76,7 +76,11 @@ ...@@ -76,7 +76,11 @@
> >
<view <view
class="card" class="card"
:class="{ status1: card.status == 1, status2: card.status == 2 }" :class="{
status1: card.status == 1,
status2: card.status == 2,
active: value === card.value,
}"
> >
<view class="card-content"> <view class="card-content">
<view class="first-row"> <view class="first-row">
...@@ -149,7 +153,12 @@ ...@@ -149,7 +153,12 @@
:key="cardIndex" :key="cardIndex"
@click="getDetailsItem(card.name, card.jfType, card.value)" @click="getDetailsItem(card.name, card.jfType, card.value)"
> >
<view class="card" :class="{ active: card.name == activeName }"> <view
class="card"
:class="{
active: value === card.value,
}"
>
<view class="card-content"> <view class="card-content">
<view class="first-row"> <view class="first-row">
<image <image
...@@ -237,6 +246,7 @@ export default { ...@@ -237,6 +246,7 @@ export default {
this.isDisable = options.isDisable == 1 ? true : false; this.isDisable = options.isDisable == 1 ? true : false;
console.log("options.uid", this.options.uid); console.log("options.uid", this.options.uid);
this.uid = this.options.uid || ""; this.uid = this.options.uid || "";
this.value = this.options.value || "1";
}, },
onShow() { onShow() {
if (this.uid) { if (this.uid) {
...@@ -367,6 +377,7 @@ export default { ...@@ -367,6 +377,7 @@ export default {
// 获取机房详情 // 获取机房详情
getDetailsItem(location, jfType, value) { getDetailsItem(location, jfType, value) {
this.activeName = location; this.activeName = location;
this.value = value;
this.detailsItem = this.detailsInfo.originData[value - 1].details; this.detailsItem = this.detailsInfo.originData[value - 1].details;
this.jfType = this.detailsInfo.originData[value - 1].jfType; this.jfType = this.detailsInfo.originData[value - 1].jfType;
if (this.detailsItem.afxt.detail[2].inspectionResult === 1) { if (this.detailsItem.afxt.detail[2].inspectionResult === 1) {
...@@ -464,6 +475,7 @@ export default { ...@@ -464,6 +475,7 @@ export default {
handlePopupConfirm(summary) { handlePopupConfirm(summary) {
this.detailsInfo.isSign = this.isSign = true; // 回显到文字显示区域 this.detailsInfo.isSign = this.isSign = true; // 回显到文字显示区域
this.detailsInfo.signImg = summary; // 回显到文字显示区域 this.detailsInfo.signImg = summary; // 回显到文字显示区域
this.detailsInfo.isSubmit = 1; // 提交状态
console.log("summary", summary); console.log("summary", summary);
this.submit("sign", this.detailsInfo.signImg); this.submit("sign", this.detailsInfo.signImg);
}, },
......
...@@ -715,7 +715,7 @@ export default { ...@@ -715,7 +715,7 @@ export default {
// 返回 // 返回
back() { back() {
uni.navigateTo({ uni.navigateTo({
url: `/pages/inspectionContent/inspectionContentList?uid=${this.uid}&backValue=${this.backValue}`, url: `/pages/inspectionContent/inspectionContentList?uid=${this.uid}&backValue=${this.backValue}&value=${this.value}`,
}); });
}, },
// 关闭弹窗 // 关闭弹窗
......
<template>
<view>
<navigator url="/pages/home/home" hover-class="navigator-hover">
<button type="default">返回首页</button>
</navigator>
<view class="title">button样式</view>
<view>
<button class="v-btn v-btn-default">default</button>
<button class="v-btn">primary</button>
<button class="v-btn v-btn-round">round</button>
<button class="v-btn v-btn-round v-btn-block">block</button>
</view>
<view class="title">radio组件</view>
<CommonRadio
v-model="selectedValue"
:options="[
{ label: '正常', value: 'normal' },
{ label: '异常', value: 'abnormal' },
]"
@change="onRadioChange"
></CommonRadio>
<view class="title">公共弹窗</view>
<button class="v-btn" @click="dialogVisible = true">打开弹窗</button>
<CommonDialog v-model="dialogVisible" title="弹窗标题">
<div>这是公共弹窗的内容</div>
<template #footer>
<button class="v-btn v-btn-default" @click="dialogVisible = false">
返回
</button>
<button class="v-btn ml-10">确认</button>
</template>
</CommonDialog>
<view class="title">上传组件</view>
<CommonUpload v-model="imageList" :max-count="5"> </CommonUpload>
</view>
</template>
<script>
import CommonRadio from "@/components/CommonRadio/index.vue";
import CommonDialog from "@/components/CommonDialog/index.vue";
import CommonUpload from "@/components/CommonUpload/index.vue";
export default {
components: {
CommonRadio,
CommonDialog,
CommonUpload,
},
data() {
return {
selectedValue: "normal",
dialogVisible: false,
imageList: [], // 存储 base64 图片的数组
};
},
methods: {
onRadioChange(value) {
console.log("当前选中值:", value);
},
onOpenDialog() {
this.dialogVisible = true;
},
},
};
</script>
<style lang="less" scoped>
.title {
padding: 10px;
font-size: 18px;
&::before {
display: inline-block;
content: "";
width: 6px;
height: 14px;
background-color: #007bff;
margin-right: 6px;
}
}
</style>
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论