<template>
	<view>
		<view class="overlay" v-if="showfx" @click="showwx">
			<image style="height: 100%;width: 100%;" src="/static/img/zz.png"></image>
		</view>
				
		<view :class="['custom-header', { 'is-back': isBack }, bgColor]">
			<view class="back-container" @click="handleBack">
			  <view class="back-text">返回</view>
			</view>
			<view class="content-container">
			  <view class="content-text">{{title}}</view>
			</view>
		</view>
					
		<form class="cu-list menu">
			
			<view class="titlebg2">
				<view class="titlet1" ></view>
				<view class="titlet2" >厂房信息</view>								
			</view>
			
			<view class="show1">
				
				<view class="textbg">
					<view class="text1">
						 厂房编号
					</view>	
					<input class="text44" v-model="inputForm.des6" placeholder="输入厂房编号" :disabled="ischeck"></input>
				</view>
				
				<view class="textbg">
					<view class="text1">
						 厂房名称
					</view>	
					<input class="text44" v-model="inputForm.name" placeholder="输入厂房名称" :disabled="ischeck"></input>
				</view>
				
				<view class="textbg">
					<view class="text1">
						 所属园区
					</view>
					<view v-if="ischeck" class="text2" :class="inputForm.des8 === '需' ? 'text33' : 'text44'" >
						 {{inputForm.des8}}
					</view>	
								
					<picker v-else class="title2" @change="bindPickerChange" rangeKey="label" rangeValue="value" :range="parkList">
						<view class="text44" :class="{ placeholder: selectedPark === '请选择' }">{{ selectedPark }}</view>
					</picker>	
																				
				</view>
				
				<view class="textbg">
					<view class="text1">
						 详细位置
					</view>
					<input class="text44" v-model="inputForm.address" placeholder="输入详细位置" :disabled="ischeck"></input>			
				</view>
				
				<view class="textbg">
					<view class="text1">
						 联系人
					</view>
										
					<button v-if="showloginbt" @click="tologin" class="cu-btn block bg-blue ">{{dengtxt}}</button>
					<input v-else class="text44" v-model="inputForm.lxr" placeholder="输入联系人" :disabled="ischeck"></input>			
				</view>
				
				<view class="textbg">
					<view class="text1">
						 联系电话
					</view>
					<button v-if="showloginbt" @click="tologin" class="cu-btn block bg-blue ">{{dengtxt}}</button>
					<input v-else class="text44" v-model="inputForm.phone" placeholder="输入联系电话" :disabled="ischeck"></input>			
				</view>
			</view>

			<view class="titlebg2">
				<view class="titlet1" ></view>
				<view class="titlet2" >基本信息</view>								
			</view>
			
			
			<view class="textbg">
				<view class="text12">
					 {{t1}}
				</view>
				<view v-if="ischeck" class="text44" >
					 {{ inputForm.ownership===1 ? '国有' :
					        inputForm.ownership===2 ? '集体' : '民营' }}
				</view>	
					
				<picker v-else class="title2" @change="bindPickerChange2" rangeKey="label" rangeValue="value" :range="parkList2">
					<view class="text44" :class="{ placeholder: selectedownership === '请选择' }">{{ selectedownership }}</view>
				</picker>
				
			</view>
						
			<view class="textbg">
				<view class="text12">
					 产权
				</view>
				<view v-if="ischeck" class="text44" >
					 {{selecteddes7}}
				</view>	
							
				<picker v-else class="title2" @change="bindPickerChange4" rangeKey="label" rangeValue="value" :range="parkList4">
					<view class="text44" :class="{ placeholder: selecteddes7 === '请选择' }">{{ selecteddes7 }}</view>
				</picker>	
																			
			</view>
			
			
			<view class="textbg">
				<view class="text12">
					 {{t2}}(亩)
				</view>
				<view class="text22">
					 <input class="text44" v-model="inputForm.area" placeholder="输入占地面积" :disabled="ischeck"></input>
				</view>				
			</view>
			
			<view class="textbg">
				<view class="text12">
					 {{t3}}
				</view>
				<view v-if="ischeck" class="text44">
					 {{inputForm.singleLayer===1 ? '单层' : '多层'}}
				</view>	
				<picker v-else class="title2" @change="bindPickerChange3" rangeKey="label" rangeValue="value" :range="parkList3">
					<view class="text44" :class="{ placeholder: selectedsingleLayer === '请选择' }">{{ selectedsingleLayer }}</view>
				</picker>			
			</view>
			
			<view class="textbg">
				<view class="text12">
					 {{t4}}(㎡)
				</view>
				<view class="text221">
					 <input class="text44" v-model="inputForm.idleArea" placeholder="输入占地面积" :disabled="ischeck"></input>
				</view>		
						
			</view>
			
			<view class="textbg">
				<view class="text12">
					 {{t5}}
				</view>
				<view class="text221">
					 <input class="text44" v-model="inputForm.numberLayers" placeholder="输入层数" :disabled="ischeck"></input>
				</view>	
			</view>
			
			<view class="textbg">
				<view class="text12">
					 {{t6}}
				</view>	
				<view class="text221">
					 <input class="text44" v-model="inputForm.floorHeight" placeholder="输入层高" :disabled="ischeck"></input>
				</view>			
			</view>
			
			<view class="textbg">
				<view class="text12">
					 适用产业
				</view>
									
				<!-- 回显（查看模式） -->
				<view v-if="ischeck" class="text44">
				  {{ inputForm.des2 || '暂无' }}
				</view>
				
				<!-- 编辑（选择模式） -->
				<zqs-select
				  v-else
				  class="input2"
				  :multiple="true"
				  :list="industryList"
				  label-key="label"
				  value-key="value"
				  placeholder=" 请选择"
				  title="请选择适用产业"
				  clearable
				  v-model="selectedIndustry"
				  @search="searchEvent"
				  @change="selectChange2"
				></zqs-select>
										
			</view>	
			
			
			<view class="textbg">
				<view class="text12">
					 厂房装修
				</view>
				<view v-if="ischeck" class="text44">
					 {{ inputForm.des3==='1' ? '毛坯' :
					        inputForm.des3==='2' ? '精装' : '' }}
				</view>	
				<picker v-else class="title2" @change="bindPickerChange6" rangeKey="label" rangeValue="value" :range="parkList6">
					<view class="text44" :class="{ placeholder: selecteddes3 === '请选择' }">{{ selecteddes3 }}</view>
				</picker>			
			</view>
			
			<view class="textbg">
				<view class="text12">
					 长宽
				</view>	
				<view class="text221">
					 <input class="text44" v-model="inputForm.des4" placeholder="输入长宽" :disabled="ischeck"></input>
				</view>			
			</view>
			
			<view class="textbg">
				<view class="text12">
					 承载负荷(kg/m²)
				</view>	
				<view class="text221">
					 <input class="text44" v-model="inputForm.des5" placeholder="输入承载负荷" :disabled="ischeck"></input>
				</view>			
			</view>
			
			<view class="textbg">
				<view class="text12">
					 行车数量
				</view>	
				<view class="text221">
					 <input class="text44" v-model="inputForm.drivingCount" placeholder="输入行车数量" :disabled="ischeck"></input>
				</view>			
			</view>
			
			<view class="textbg">
				<view class="text12">
					 行车承载负荷(吨)
				</view>	
				<view class="text221">
					 <input class="text44" v-model="inputForm.drivingLoad" placeholder="输入行车承载负荷" :disabled="ischeck"></input>
				</view>			
			</view>
			
			<view class="textbg">
				<view class="text12">
					 洁净车间
				</view>
				<view v-if="ischeck" class="text44">
					 {{ selectedcleanRoom }}
				</view>	
				<picker v-else class="title2" @change="bindPickerChange5" rangeKey="label" rangeValue="value" :range="parkList5">
					<view class="text44" :class="{ placeholder: selectedcleanRoom === '请选择' }">{{ selectedcleanRoom }}</view>
				</picker>			
			</view>
			
			<view class="textbg">
				<view class="text12">
					 水电气情况
				</view>	
				<view class="text221">
					 <input class="text44" v-model="inputForm.situation" placeholder="输入水电气情况" :disabled="ischeck"></input>
				</view>			
			</view>
			
			<view v-if="!ischeck" class="textbg">
				<view class="text12">
					 纳入板块统计
				</view>				
				<picker class="title2" @change="bindPickerChange7" rangeKey="label" rangeValue="value" :range="parkList7">
					<view class="text44" :class="{ placeholder: selectedispark === '请选择' }">{{ selectedispark }}</view>
				</picker>			
			</view>
			
			<view class="textbg" >
				<view class="text12">
					 备注
				</view>	
				<view class="text221">
					 <input class="text44" v-model="inputForm.remark" placeholder="输入备注" :disabled="ischeck"></input>
				</view>			
			</view>
			
			<view v-if="!showloginbt&&!ischeck" class="cu-form-group margin-top" style="0.5px solid #eee;margin-top: 10rpx;">
				<uni-file-picker style="margin-bottom: 10px;margin-top: 10rpx;" limit="1" ref="picFile" v-model="picLists"
					fileMediatype="image" mode="grid" title="平面图" :auto-upload="autoUpload" @select="select"
					@progress="progress" @success="success" @fail="fail" @delete="deleteFile"
					:imageStyles="imageStyles" :disabled="ischeck">
				</uni-file-picker>
			</view>
			
			<view  v-if="!showloginbt&&!ischeck" class="cu-form-group margin-top" style="0.5px solid #eee;margin-top: 10rpx;">
				<uni-file-picker style="margin-bottom: 10px;margin-top: 10rpx;" limit="4" ref="picFile2" v-model="picLists2"
					fileMediatype="image" mode="grid" title="厂房图" :auto-upload="autoUpload" @select="select2"
					@progress="progress" @success="success" @fail="fail" @delete="deleteFile2"
					:imageStyles="imageStyles" :disabled="ischeck">
				</uni-file-picker>
			</view>
			
			<view style="height: 30rpx;background-color: white;"></view>
			
			<view class="padding-xl" v-if="showloginbt">
				<button @click="tologin" class="cu-btn block bg-blue margin-tb-sm lg">登录查看厂房照片</button>
			</view>
			
			<view class="titlebg2" v-if="swiperList2.length>0" >
				<view class="titlet1" ></view>
				<view class="titlet2" >平面图</view>								
			</view>
			
			<view v-for="(item, index) in swiperList2" :key="'pic1-'+index" style="width: 100%;">
				<image :src="item.url"  mode="widthFix" style="width: 100%;" >					
				</image>
			</view>				
			
			<view style="height: 40rpx;"></view>
			
			<view class="titlebg2" v-if="swiperList.length>0" >
				<view class="titlet1" ></view>
				<view class="titlet2" >厂房图</view>								
			</view>
			
			<view v-for="(item, index) in swiperList" :key="'pic2-'+index" style="width: 100%;">
				<image :src="item.url"  mode="widthFix" style="width: 100%;" >					
				</image>
			</view>				
			
			<view style="height: 40rpx;"></view>

			<view class="padding-xl" v-if="!ischeck">
				<button @click="save" class="cu-btn block bg-blue margin-tb-sm lg">提交</button>
			</view>
			
			

		</form>
	</view>
</template>

<script>
	import loginService from '@/api/auth/loginService.js'
	import { wxShare } from "@/common/wxutils.js";
	export default {
		
		data() {
			return {
				title: '厂房资源详情',
				isBack: true, // 是否显示返回按钮
			    backText: '返回', // 返回按钮的文本
			    bgColor: 'bg-blue', // 背景颜色
				ischeck: true,
				isAdd: true,
				autoUpload: false,
				swiperList: [],
				swiperList2: [],
				inputForm: {
					id: '',
					name: '',
					park: '',
					address: '',
					ownership: '',
					area: '',
					singleLayer: '',
					cleanRoom: '',
					numberLayers: '',
					floorHeight: '',
					idleArea: '',
					remark: '',
					state: '',
					des1: '',
					des2: '',
					des3: '',
					des4: '',
					des5: '',					
					des6: '',
					des7: '',
					des8: '',
					des9: '',	
					lxr: '',	
					phone: '',
					drivingCount: '',
					drivingLoad: '',
					situation: '',
					pic1: '',
					pic2: '',
					ispark: '',

				},
				t1: '厂房权属',
				t2: '占地面积',
				t3: '单层/多层',
				t4: '面积',
				t5: '层数',
				t6: '层高',
				text1:'',
				text2:'',
				parkList: [],
				parkList2: [],
				parkList3: [],
				parkList4: [],
				parkList5: [],
				parkList6: [],
				parkList7: [{label: '是',value: '1'},{label: '否',value: '0'}],
				selectedPark:'请选择',
				selectedownership:'请选择',
				selectedsingleLayer:'请选择',				
				selecteddes7:'请选择',
				selecteddes3:'请选择',
				selectedcleanRoom:'请选择',
				selectedispark:'请选择',
				// 适用产业
				industryList: [],        // 字典数组
				selectedIndustry: [],    // 当前选中的 value 数组
				showIndustryPicker: false,
				showIndustryPop: false ,
				
				dengtxt: '登录查看',
				
				picLists: [],
				picUrl: [],
				picLists2: [],
				picUrl2: [],
				imageStyles: {
					width: 90,
					height: 90
				},
				
				index:0,
				isLogin:"",
				showloginbt:true,
				username:"",
				isadmin:false,
				lyIndex: '',
				showLYList: [],
				showfx:false,
				rules: {
				  name: { label: '厂房名称', required: true },
				  park: { label: '所属园区', required: true },
				  address: { label: '详细位置', required: true },
				  ownership: { label: '厂房权属', required: true },
				  area: { label: '占地面积', required: true, pattern: /^\d+(\.\d{1,2})?$/ },
				  singleLayer: { label: '单层/多层', required: true },
				  idleArea: { label: '面积', required: true, pattern: /^\d+(\.\d{1,2})?$/ },
				  numberLayers: { label: '层数', required: true, pattern: /^\d+$/ },
				  floorHeight: { label: '层高', required: true, pattern: /^\d+(\.\d{1,2})?$/ }
				}
			}
		},
		created() {
		},
		mounted() {
			
		},
		computed: {

		},
		onShow() {
			this.isLogin=this.$auth.checkisLogin();
			//判断是否能新增
			if(this.isLogin!=null){
				this.getRole();
				
				this.showloginbt=false;
			}
		},
		onLoad(query) {
			this.isLogin=this.$auth.checkisLogin();
			this.username=this.$auth.getUserInfo();
			if(this.username!=undefined&&this.username!=''&&this.username!=null&&this.isLogin!=null){
				if(this.username.loginName=='admin'){
					this.isadmin=true;
				}
			}
						
			Promise.all([
			    loginService.getDictListBytype("sys_park"),
			    loginService.getDictListBytype("sys_ownership"),
			    loginService.getDictListBytype("sys_single_layer"),
			    loginService.getDictListBytype("sys_property_right"),
			    loginService.getDictListBytype("sys_clean_room"),
			    loginService.getDictListBytype("sys_renovation"),
			    loginService.getDictListBytype("sys_industry")
			  ]).then(([park, own, layer, propertyright, cleanroom,renovation,industry]) => {
			    this.parkList = park.data;
			    this.parkList2 = own.data;
			    this.parkList3 = layer.data;
				this.parkList4 = propertyright.data;
				this.parkList5 = cleanroom.data;
				this.parkList6 = renovation.data;
				this.industryList  = industry.data;
			    // 字典到位后再回显详情
			    if (query.id) {                 // 有 id → 编辑/查看
				  this.isAdd = false
				  this.title = '厂房资源详情'
				  return loginService.factoryqueryById(query.id)
				} else {                        // 无 id → 新增
				  this.isAdd = true
				  this.title = '新增厂房资源'
				  return Promise.resolve({ data: {} })   // 空对象，走 setData 不会报错
				}
			  }).then(({ data }) => {
			    this.setData(data);
			  });
						
		},
		methods: {
			
			handleBack() {
				this.$router.go(-1);
			},
				
			getRole() {
				let userInfo = uni.getStorageSync('WMS-userinfo')
				var officeId = userInfo.officeDTO.id;
				var roleIds = userInfo.roleIds;
				//区“企业大走访”办公室、政府管理员、厂房板块维护人员
				if (roleIds.indexOf("1910175386924417025") != -1||roleIds.indexOf("ade960e8f02544998b07397304c059c1") != -1||roleIds.indexOf("1996038972899717121") != -1) {
					this.ischeck = false;
				} 
				
			},
									
			bindPickerChange(e) {
			  const idx = e.detail.value
			  const item = this.parkList[idx]
			  this.selectedPark = item.label
			  this.inputForm.park = item.value      
			},
			bindPickerChange2(e) {
			  const idx = e.detail.value
			  const item = this.parkList2[idx]
			  this.selectedownership = item.label
			  this.inputForm.ownership = item.value
			},
			bindPickerChange3(e) {
			  const idx = e.detail.value
			  const item = this.parkList3[idx]
			  this.selectedsingleLayer = item.label
			  this.inputForm.singleLayer = item.value
			},
			
			bindPickerChange4(e) {
			  const idx = e.detail.value
			  const item = this.parkList4[idx]
			  this.selecteddes7 = item.label
			  this.inputForm.des7 = item.value
			},
			
			bindPickerChange5(e) {
			  const idx = e.detail.value
			  const item = this.parkList5[idx]
			  this.selectedcleanRoom = item.label
			  this.inputForm.cleanRoom = item.value
			},
			
			bindPickerChange6(e) {
			  const idx = e.detail.value
			  const item = this.parkList6[idx]
			  this.selecteddes3 = item.label
			  this.inputForm.des3 = item.value
			},
			
			bindPickerChange7(e) {
			  const idx = e.detail.value
			  const item = this.parkList7[idx]
			  this.selectedispark = item.label
			  this.inputForm.ispark = item.value
			},
			
			selectChange2() {
			  // 此处为点击的事件
			  //this.pickerData=this.pickerDataOld;
			  console.log(this.selectedIndustry);
			},
			searchEvent(val) {
			  //this.pickerData=this.filteredItems(val);
			},
			
			// industryChange(e){
			//   this.selectedIndustry = e.detail.value
			//   // 同时拼好 label 字符串
			//   const labels = this.selectedIndustry.map(v =>
			//     this.industryList.find(d => d.value === v)?.label
			//   ).filter(Boolean)
			//   this.inputForm.des1 = this.selectedIndustry.join(',')
			//   this.inputForm.des2 = labels.join(',')
			// },
			
			// 弹窗点确定
			// confirmIndustry () {
			//   // 把 value 数组 -> 字符串
			//   this.inputForm.des1 = this.selectedIndustry.join(',')
			//   // 把对应 label 拼成字符串
			//   const dict = this.industryList
			//   const labels = this.selectedIndustry.map(v => {
			//     const item = dict.find(d => d.value === v)
			//     return item ? item.label : ''
			//   })
			//   this.inputForm.des2 = labels.join(',')
			//   this.showIndustryPicker = false
			// },
			
			// 回显（setData 里调用）
			fillIndustry () {
			  // 后端是字符串，先拆成数组
			  if (this.inputForm.des1) {
			    this.selectedIndustry = this.inputForm.des1.split(',')
			  } else {
			    this.selectedIndustry = []
			  }
			},
			
			validate() {
			    for (const key in this.rules) {
			      const rule = this.rules[key]
			      const val  = this.inputForm[key]
			
			      if (rule.required && (!val || val === '请选择')) {
			        uni.showToast({ title: `请填写${rule.label}`, icon: 'none' })
			        return false
			      }
			      if (rule.pattern && !rule.pattern.test(val)) {
			        uni.showToast({ title: `${rule.label}格式有误`, icon: 'none' })
			        return false
			      }
			    }
			    return true
			  },
			  
			  
			  // 获取上传进度
			  progress(e) {
			  	console.log('上传进度：', e)
			  },
			  // 上传成功
			  success(e) {
			  	console.log('上传成功')
			  },
			  // 上传失败
			  fail(e) {
			  	console.log('上传失败：', e)
			  },
			  deleteFile(e) {
			  	this.picUrl.splice(e.index, 1)
			  },
			  deleteFile2(e) {
			  	this.picUrl2.splice(e.index, 1)
			  },
			  // 获取上传状态
			  select(e) {
			  	console.log('选择文件：', e)
								
			  	var _this = this
			  	var i = 0
			  	upload()
			  
			  	function upload() {
			  		if (i >= e.tempFiles.length) {
			  			return;
			  		}
			  		var item = e.tempFiles[i]
			  		uni.showLoading({
			  			title: "上传中",
			  			mask: true
			  		});
			  		uni.uploadFile({
			  			url: '/yd_qycpfb/file/upload?uploadPath=userdir', // 仅为示例，非真实的接口地址
			  			filePath: item.url,
			  			name: 'file',
			  			formData: {
			  				'fileName': item.name
			  			},
			  			header: {
			  				'token': _this.$auth.getUserToken()
			  			},
			  			success: (res) => {
			  				var data = res.data
			  				if (typeof data['error'] != "undefined") {
			  					uni.showToast({
			  						icon: 'none',
			  						title: '上传失败，请联系开发！'
			  					});
			  					_this.$refs.picFile.clearFiles(_this.picLists.length)
			  				} else {
			  					_this.picUrl.push({
			  						url: data,
			  						uuid: item.uuid
			  					})
			  					i++;
			  					upload()
			  				}
			  			},
			  			fail: () => {
			  				uni.hideLoading();
			  				uni.showToast({
			  					icon: 'none',
			  					title: '上传失败，请联系开发！'
			  				});
			  				_this.$refs.picFile.clearFiles(_this.picLists.length)
			  			},
			  			complete: function() {
			  				uni.hideLoading();
			  			}
			  		});
			  	}
			  },
			  
			  select2(e) {
			  	console.log('选择文件：', e)
								
			  	var _this = this
			  	var i = 0
			  	upload()
			  
			  	function upload() {
			  		if (i >= e.tempFiles.length) {
			  			return;
			  		}
			  		var item = e.tempFiles[i]
			  		uni.showLoading({
			  			title: "上传中",
			  			mask: true
			  		});
			  		uni.uploadFile({
			  			url: '/yd_qycpfb/file/upload?uploadPath=userdir', // 仅为示例，非真实的接口地址
			  			filePath: item.url,
			  			name: 'file',
			  			formData: {
			  				'fileName': item.name
			  			},
			  			header: {
			  				'token': _this.$auth.getUserToken()
			  			},
			  			success: (res) => {
			  				var data = res.data
			  				if (typeof data['error'] != "undefined") {
			  					uni.showToast({
			  						icon: 'none',
			  						title: '上传失败，请联系开发！'
			  					});
			  					_this.$refs.picFile2.clearFiles(_this.picLists2.length)
			  				} else {
			  					_this.picUrl2.push({
			  						url: data,
			  						uuid: item.uuid
			  					})
			  					i++;
			  					upload()
			  				}
			  			},
			  			fail: () => {
			  				uni.hideLoading();
			  				uni.showToast({
			  					icon: 'none',
			  					title: '上传失败，请联系开发！'
			  				});
			  				_this.$refs.picFile2.clearFiles(_this.picLists2.length)
			  			},
			  			complete: function() {
			  				uni.hideLoading();
			  			}
			  		});
			  	}
			  },
			
			save(){
				
				if (!this.validate()) return
				
				this.inputForm.state=1;
				
				//产业
			
				const labels = this.selectedIndustry.map(v =>
				    this.industryList.find(d => d.value === v)?.label
				).filter(Boolean)
				this.inputForm.des1 = this.selectedIndustry.join(',')
				this.inputForm.des2 = labels.join(',')				
				
				this.inputForm.pic1 = [];
				this.inputForm.pic2 = [];				
				this.picUrl.forEach(item => {
					this.inputForm.pic1.push(item.url.replace('https://ydwqfw.com.cn/yd_qycpfbWeb/', ''))
				})
				this.picUrl2.forEach(item => {
					this.inputForm.pic2.push(item.url.replace('https://ydwqfw.com.cn/yd_qycpfbWeb/', ''))
				})
				this.inputForm.pic1 = this.inputForm.pic1.toString();
				this.inputForm.pic2 = this.inputForm.pic2.toString();
				
				
				uni.showLoading()
				loginService.savefactoryBuildings(this.inputForm).then(({
					data
				}) => {
					uni.hideLoading();
					uni.showToast({
						title: "厂房资源提交成功！",
						icon: "success"
					});
					uni.navigateTo({
						url: '/pages/factoryBuildings/factoryBuildingsList'
					})
				}).catch((e) => {
					uni.hideLoading();
				})
			},
			
			tologin(){
				uni.showLoading()
				uni.reLaunch({
					url: '/pages/login/factorylogin'
				})	
			},
			
			setData(data){
				this.inputForm = this.recover(this.inputForm, data)				
									
				const parkItem = this.parkList.find(p => p.value == data.park);
				//    把中文名赋给用来显示的变量
				this.selectedPark = parkItem ? parkItem.label : '请选择';
				
				/* 同理，如果权属、单层多层也需要回显，照抄两行即可 */
				const ownItem = this.parkList2.find(p => p.value == data.ownership);
				this.selectedownership = ownItem ? ownItem.label : '请选择';
				
				const layerItem = this.parkList3.find(p => p.value == data.singleLayer);
				this.selectedsingleLayer = layerItem ? layerItem.label : '请选择';	
					  
				const des7Item = this.parkList4.find(p => p.value == data.des7);
								
				this.selecteddes7 = des7Item ? des7Item.label : '请选择';				  
				console.log("产权："+this.selecteddes7)
				
				const des3Item = this.parkList6.find(p => p.value == data.des3);
				this.selecteddes3 = des3Item ? des3Item.label : '请选择';	
				
				
				 /* ===== 洁净车间回显 ===== */
			    const cleanItem = this.parkList5.find(p => p.value == data.cleanRoom)				
			    this.selectedcleanRoom = cleanItem ? cleanItem.label : '请选择'
				
				const isparkItem = this.parkList7.find(p => p.value == data.ispark)
				this.selectedispark = isparkItem ? isparkItem.label : '请选择'

				this.fillIndustry()
				
				if(this.isLogin!=null){
					// 回显图片
					if(this.inputForm.pic2!=undefined&&this.inputForm.pic2!=''){
						let pics=this.inputForm.pic2.split(",");
						pics.forEach(item => {
							if(item!=''){
								this.swiperList.push({
									'url': "https://ydwqfw.com.cn/yd_qycpfbWeb/"+item,
								})
								
								this.picUrl2.push({
									'url': "https://ydwqfw.com.cn/yd_qycpfbWeb/"+item,
									'uuid': item
								})
								this.picLists2.push({
									'url': "https://ydwqfw.com.cn/yd_qycpfbWeb/"+item,
									'uuid': item
								})
								
							}
							
						})
					}
					
					
					let pics2=this.inputForm.pic1;
					
					if(pics2!=undefined&&pics2!=''){
						this.swiperList2.push({
							'url': "https://ydwqfw.com.cn/yd_qycpfbWeb/"+pics2,
						})
						
						this.picUrl.push({
							'url': "https://ydwqfw.com.cn/yd_qycpfbWeb/"+pics2,
							'uuid': pics2
						})
						this.picLists.push({
							'url': "https://ydwqfw.com.cn/yd_qycpfbWeb/"+pics2,
							'uuid': pics2
						})
						
					}
					
				
					
					
					
					
				}
				
				
					
				
				
			},			

		}
	}
</script>
<style>
	input,textarea{
		color: #8799a3;
	}
	
	.swiper {
		width: 750rpx;
		height: 310rpx;
	}
	
	.swiper-item {
		width: 750rpx;
		height: 310rpx;
		background-color: aliceblue;
	}
	.show1{
		background-color: #2752eb;
		padding-left: 8rpx;
	}
	.textbg{
		display: flex;
		background-color: white;
		padding-top: 29rpx;
	}
	.text1{
		width: 200rpx;
		margin-left: 30rpx;
		color: #333333;
		font-size: 30rpx;
	}
	.text12{
		width: 260rpx;
		margin-left: 30rpx;
		color: #000000;
		font-size: 29rpx;
	}
		
	.text2{
		flex: 1;
		color: #000000;
		font-size: 30rpx;
		padding-bottom: 2rpx;
	}
	
	.text33{
		flex: 1;
		color: #FF4500;
		font-size: 30rpx;
		padding-bottom: 2rpx;
	}
	
	.text44{
		flex: 1;
		color: #1E8AD7;
		font-size: 30rpx;
		padding-bottom: 2rpx;
		
	}
	.text44.placeholder {
	  color: #999; /* 灰色，用于未选择时 */
	}
	
	.text22{
		flex: 1;
		color: #666666;
		font-size: 29rpx;
		padding-bottom: 2rpx;
	}
	
	.text221{
		flex: 1;
		color: #666666;
		font-size: 29rpx;
		padding-right:15rpx ;
		padding-bottom: 2rpx;
	}
	.text3{
		display: flex;
		color: #000000;
	}
	.phone{
		display: flex;
		color: #1E8AD7;
		padding-left: 5rpx;
		padding-right: 5rpx;
		font-size: 30rpx;
		align-items: center
	}
	.phoneimg{
		margin-left: 10rpx;
		width: 35rpx;
		height: 35rpx;
	}
	.titlebg2{
		display: flex;
		background-color: white;
		padding-left: 22rpx;
		padding-top: 35rpx;
		padding-bottom: 25rpx;
		margin-bottom: 2rpx;
	}
	.titlet1{
		width: 7rpx;
		margin-top: 7rpx;
		margin-bottom: 7rpx;
		background-color: #2752eb;
		margin-right: 8rpx;
	}
	.titlet2{
		font-weight: 800;
		color: #2752eb;
	}
	.overlay{
	  position: fixed; /* 固定定位，覆盖整个页面 */
	  top: 0;
	  left: 0;
	  width: 100%;
	  height: 100%;
	  background-color: rgba(255, 255, 255, 0.5); /* 半透明白色背景 */
	  z-index: 1000; /* 确保遮罩在页面内容之上 */
	}
	
	
	.custom-header {
	  display: flex;
	  align-items: center;
	  justify-content: center;
	  padding: 10px;
	  width: 100%;
	}
	
	.is-back {
	  position: relative;
	}
	
	.back-container {
	  position: absolute;
	  left: 10px;
	  cursor: pointer;
	}
	
	.back-text {
	  color: white; /* 返回按钮文本颜色 */
	}
	
	.content-container {
	  flex: 1;
	  text-align: center;
	}
	
	.content-text {
	  color: white; /* 标题文本颜色 */
	  font-weight: bold;
	}
	
	/* 背景颜色 */
	.bg-blue {
	  background-color: #4285f4; /* 假设这是一个蓝色背景 */
	}
	
	.input2 {
	  flex: 1;
	  font-size: 30rpx;
	  color: #1E8AD7;          /* 想保持的蓝色 */
	  padding-right: 20rpx;
	  width: 100%;
	}
	
	/* 关键：把颜色强制透传到组件内部 input/占位节点 */
	.input2 .input,          /* 有的版本用 .input */
	.input2 .uni-input,      /* 有的版本用 .uni-input */
	.input2 input::placeholder,
	.input2 .placeholder {
	  color: #1E8AD7 !important;   /* 强制覆盖黑色 */
	}
	.input2 * {
	  color: #1E8AD7 !important;
	}
	
	
	/* 强制让 zqs-select 内部所有文字都变成蓝色 */
	.input2,
	.input2 *,
	.input2 .input,
	.input2 .uni-input,
	.input2 .select-input,
	.input2 .select-tag,
	.input2 .placeholder,
	.input2 input,
	.input2 .input-placeholder,
	.input2 .uni-input-placeholder {
	  color: #1E8AD7 !important;
	}
	
	/deep/ .input2 input {
	  color: #1E8AD7 !important;
	  font-size: 30rpx !important;
	}
</style>