This commit is contained in:
QJK 2024-11-09 17:56:06 +08:00
parent aa080206a3
commit b8fc167109
2 changed files with 207 additions and 167 deletions

View File

@ -1,9 +1,9 @@
// 应用全局配置 // 应用全局配置
module.exports = { module.exports = {
//baseUrl: 'https://www.nuoyunr.com/admin-api', // baseUrl: 'https://www.nuoyunr.com/admin-api',
baseUrl: 'http://127.0.0.1:48080/admin-api', baseUrl: 'http://192.168.31.130:48080/admin-api',
imagesUrl: 'http://www.nuoyunr.com/lananRsc', imagesUrl: 'http://www.nuoyunr.com/lananRsc',
baseImageUrl: 'https://www.nuoyunr.com/minio', baseImageUrl: 'https://www.nuoyunr.com/minio',
// 应用信息 // 应用信息
appInfo: { appInfo: {
// 应用名称 // 应用名称

View File

@ -1,193 +1,233 @@
<template> <template>
<view class="content"> <view class="content">
<view style="width: 100%; height: 44px;"></view> <view style="width: 100%; height: 44px;"></view>
<view class="top-heder"> <view class="top-heder">
<view class="t-left" @click="getback()"> <view class="t-left" @click="getback()">
<uni-icons type="left" size="18"></uni-icons> <uni-icons type="left" size="18"></uni-icons>
</view> </view>
<view class="t-title"> <view class="t-title">
<text>选择检测项目</text> <text>选择检测项目</text>
</view> </view>
<view class="t-you"></view> <view class="t-you"></view>
</view> </view>
<view class="cont_box"> <view class="cont_box">
<view class="title_"> <view class="title_">
可选检测项目 可选检测项目
</view> </view>
<view class="box_"> <view class="box_">
<view class="box_button " :class="{ 'box_button_x' :selectProject.indexOf(item)>-1 }" <view class="box_button " :class="{ 'box_button_x' :selectProject.indexOf(item)>-1 }"
v-for="item in inpectionProjects" @click="clickProject(item)">{{ item.projectName }} v-for="item in inpectionProjects" @click="clickProject(item)">{{ item.projectName }}
</view> </view>
</view> </view>
<view class="title_"> <view class="title_">
已选检测项目 已选检测项目
</view> </view>
<u-steps activeColor="#0D2E8D" direction="column"> <view style="margin-bottom: 15px;" v-for="(item,index) in selectProject" :key="index">
<u-steps-item :iconSize="iconSize" v-for="item in selectProject" :title="item.projectName"> <view class="steps_">
</u-steps-item> <view class="index_">{{index+1}}</view>
<view style="font-size: 20px; font-weight: bold;">{{item.projectName}}</view>
</view>
<view class="xb_" v-if="index != selectProject.length - 1 "> </view>
</view>
</u-steps> <!-- <u-steps activeColor="#0D2E8D" direction="column">
<u-steps-item :iconSize="iconSize" v-for="item in selectProject" :title="item.projectName">
</u-steps-item>
</u-steps> -->
</view> </view>
<view class="dlanniu" @click="sureChoose()"> <view class="dlanniu" @click="sureChoose()">
<text>确定选择</text> <text>确定选择</text>
</view> </view>
</view> </view>
</template> </template>
<script> <script>
import request from '../../utils/request'; import request from '../../utils/request';
export default { export default {
data() { data() {
return { return {
iconSize: 130, iconSize: 130,
inpectionProjects: [], inpectionProjects: [],
selectProject: [] selectProject: []
} }
}, },
onShow() { onShow() {
this.getProjects() this.getProjects()
}, },
methods: { methods: {
sureChoose() { sureChoose() {
if (this.selectProject.length == 0) { if (this.selectProject.length == 0) {
uni.showToast({ uni.showToast({
title: '请选择项目!', title: '请选择项目!',
icon: 'none' icon: 'none'
}) })
return return
} }
this.selectProject.map(item => { this.selectProject.map(item => {
item.projectId = item.id item.projectId = item.id
item.id = undefined item.id = undefined
}) })
uni.$emit('selectProject', this.selectProject); uni.$emit('selectProject', this.selectProject);
this.getback() this.getback()
}, },
getback() { getback() {
uni.navigateBack() uni.navigateBack()
}, },
async getProjects() { async getProjects() {
let res = await request({ let res = await request({
url: '/inspection/dl-inspection-project/page', url: '/inspection/dl-inspection-project/page',
method: 'get', method: 'get',
params: { params: {
pageNo: 1, pageNo: 1,
pageSize: 100 pageSize: 100
} }
}) })
this.inpectionProjects = res.data.records this.inpectionProjects = res.data.records
}, },
clickProject(data) { clickProject(data) {
let idx = this.selectProject.indexOf(data) let idx = this.selectProject.indexOf(data)
if (idx > -1) { if (idx > -1) {
// 使splice // 使splice
this.selectProject.splice(idx, 1); this.selectProject.splice(idx, 1);
} else { } else {
this.selectProject.push(data) this.selectProject.push(data)
} }
} }
} }
} }
</script> </script>
<style scoped> <style scoped>
.cont_box { .steps_ {
box-sizing: border-box; display: flex;
padding: 10px; align-items: center;
}
.title_ { }
font-weight: bold;
margin-bottom: 5px;
}
.box_ { .cont_box {
width: 100%; box-sizing: border-box;
display: flex; padding: 10px;
flex-wrap: wrap; }
}
.box_button_x { .title_ {
border-radius: 6px; font-weight: bold;
border: 1px solid #0D2E8D; margin-bottom: 5px;
display: flex; }
align-items: center;
justify-content: center;
font-size: 14px;
box-sizing: border-box;
padding: 5px 10px;
margin-right: 5px;
margin-bottom: 5px;
background: #0D2E8D;
color: #fff;
}
.box_button { .box_ {
border-radius: 6px; width: 100%;
border: 1px solid #999; display: flex;
display: flex; flex-wrap: wrap;
align-items: center; }
justify-content: center;
font-size: 14px;
box-sizing: border-box;
padding: 5px 10px;
margin-right: 5px;
margin-bottom: 5px;
}
.dlanniu { .box_button_x {
width: 80%; border-radius: 6px;
height: 45px; border: 1px solid #0D2E8D;
background: linear-gradient(180deg, #3F61C0 0%, #0D2E8D 100%); display: flex;
border-radius: 50px; align-items: center;
display: flex; justify-content: center;
align-items: center; font-size: 18px;
justify-content: center; box-sizing: border-box;
margin: 20px auto; padding: 10px 15px;
color: white; margin-right: 15px;
} margin-bottom: 15px;
background: #0D2E8D;
color: #fff;
}
.t-you { .box_button {
height: 100%;
width: 20%;
}
.content { border-radius: 6px;
box-sizing: border-box; border: 1px solid #999;
width: 100%; display: flex;
height: calc(100vh); align-items: center;
background: white; justify-content: center;
} font-size: 18px;
box-sizing: border-box;
padding: 10px 15px;
margin-right: 15px;
margin-bottom: 15px;
}
.top-heder { .dlanniu {
width: 100%; width: 80%;
height: 46px; height: 45px;
background: white; background: linear-gradient(180deg, #3F61C0 0%, #0D2E8D 100%);
display: flex; border-radius: 50px;
align-items: center; display: flex;
justify-content: space-between; align-items: center;
box-sizing: border-box; justify-content: center;
padding: 5px 15px; margin: 20px auto;
} color: white;
}
.t-title { .t-you {
font-size: 17px; height: 100%;
font-weight: bold; width: 20%;
color: #333333; }
}
.t-left { .content {
width: 10%; box-sizing: border-box;
} width: 100%;
</style> height: calc(100vh);
background: white;
}
.top-heder {
width: 100%;
height: 46px;
background: white;
display: flex;
align-items: center;
justify-content: space-between;
box-sizing: border-box;
padding: 5px 15px;
}
.t-title {
font-size: 17px;
font-weight: bold;
color: #333333;
}
.t-left {
width: 10%;
}
.index_ {
width: 35px;
height: 35px;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
font-weight: bold;
font-size: 18px;
background: #0D2E8D;
border-radius: 50%;
margin-right: 10px;
}
.xb_ {
width: 35px;
height: 35px;
display: flex;
align-items: center;
justify-content: center;
color: #0D2E8D;
font-size: 22px;
font-weight: bold;
}
</style>