2024-06-04 10:05:43 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<view class="u-page">
|
|
|
|
|
|
<u-navbar
|
2024-06-13 13:50:03 +08:00
|
|
|
|
:title="title[key]"
|
2024-06-04 10:05:43 +08:00
|
|
|
|
@leftClick="navigateBack"
|
|
|
|
|
|
safeAreaInsetTop
|
|
|
|
|
|
fixed
|
|
|
|
|
|
placeholder
|
|
|
|
|
|
></u-navbar>
|
|
|
|
|
|
<view class="info">
|
|
|
|
|
|
<view class="u-demo-block__content">
|
|
|
|
|
|
<!-- 注意,如果需要兼容微信小程序,最好通过setRules方法设置rules规则 -->
|
|
|
|
|
|
<u--form
|
|
|
|
|
|
labelPosition="left"
|
|
|
|
|
|
:model="model1"
|
|
|
|
|
|
ref="form1"
|
2024-07-01 10:58:49 +08:00
|
|
|
|
labelWidth="120"
|
2024-06-13 13:50:03 +08:00
|
|
|
|
v-if="key == 1"
|
2024-06-04 10:05:43 +08:00
|
|
|
|
>
|
|
|
|
|
|
<u-form-item
|
|
|
|
|
|
label="工程名称"
|
2024-06-13 13:50:03 +08:00
|
|
|
|
prop="projectName"
|
2024-06-04 10:05:43 +08:00
|
|
|
|
@click="
|
|
|
|
|
|
isName = true
|
|
|
|
|
|
hideKeyboard()
|
|
|
|
|
|
"
|
|
|
|
|
|
:borderBottom="false"
|
|
|
|
|
|
ref="item1"
|
|
|
|
|
|
>
|
|
|
|
|
|
<u--input
|
|
|
|
|
|
placeholder="请选择"
|
2024-06-13 13:50:03 +08:00
|
|
|
|
v-model="model1.projectName"
|
2024-06-04 10:05:43 +08:00
|
|
|
|
suffixIcon="arrow-right"
|
|
|
|
|
|
suffixIconStyle="color: #909399"
|
|
|
|
|
|
></u--input>
|
|
|
|
|
|
</u-form-item>
|
|
|
|
|
|
<u-form-item
|
|
|
|
|
|
label="是否发电"
|
2024-06-13 13:50:03 +08:00
|
|
|
|
prop="isPowerGeneration"
|
2024-06-04 10:05:43 +08:00
|
|
|
|
:borderBottom="false"
|
|
|
|
|
|
@click="
|
|
|
|
|
|
showSex = true
|
|
|
|
|
|
hideKeyboard()
|
|
|
|
|
|
"
|
|
|
|
|
|
ref="item1"
|
|
|
|
|
|
>
|
|
|
|
|
|
<u--input
|
|
|
|
|
|
placeholder="请选择"
|
2024-06-13 13:50:03 +08:00
|
|
|
|
v-model="model1.isPowerGeneration"
|
2024-06-04 10:05:43 +08:00
|
|
|
|
suffixIcon="arrow-right"
|
|
|
|
|
|
suffixIconStyle="color: #909399"
|
|
|
|
|
|
></u--input>
|
|
|
|
|
|
</u-form-item>
|
|
|
|
|
|
<u-form-item
|
|
|
|
|
|
label="是否泄洪"
|
|
|
|
|
|
prop="isFloodRelease"
|
|
|
|
|
|
:borderBottom="false"
|
|
|
|
|
|
@click="
|
|
|
|
|
|
isRelease = true
|
|
|
|
|
|
hideKeyboard()
|
|
|
|
|
|
"
|
|
|
|
|
|
ref="item1"
|
|
|
|
|
|
>
|
|
|
|
|
|
<u--input
|
|
|
|
|
|
placeholder="请选择"
|
|
|
|
|
|
v-model="model1.isFloodRelease"
|
|
|
|
|
|
suffixIcon="arrow-right"
|
|
|
|
|
|
suffixIconStyle="color: #909399"
|
|
|
|
|
|
></u--input>
|
|
|
|
|
|
</u-form-item>
|
|
|
|
|
|
<!-- 水位(m) -->
|
|
|
|
|
|
<u-form-item
|
|
|
|
|
|
label="水位(m)"
|
|
|
|
|
|
prop="waterLevel"
|
|
|
|
|
|
:borderBottom="false"
|
|
|
|
|
|
ref="item3"
|
|
|
|
|
|
>
|
|
|
|
|
|
<u--input
|
|
|
|
|
|
v-model="model1.waterLevel"
|
|
|
|
|
|
placeholder="请输入"
|
|
|
|
|
|
border="surround"
|
|
|
|
|
|
type="number"
|
|
|
|
|
|
clearable
|
|
|
|
|
|
></u--input>
|
|
|
|
|
|
</u-form-item>
|
|
|
|
|
|
<!-- 入库流量(m³/s): -->
|
|
|
|
|
|
<u-form-item label="入库流量(m³/s)" prop="inflowVolume" ref="item3">
|
|
|
|
|
|
<u--input
|
|
|
|
|
|
v-model="model1.inflowVolume"
|
|
|
|
|
|
placeholder="请输入"
|
|
|
|
|
|
border="surround"
|
|
|
|
|
|
type="number"
|
|
|
|
|
|
clearable
|
|
|
|
|
|
></u--input>
|
|
|
|
|
|
</u-form-item>
|
|
|
|
|
|
<!-- 出库流量 (m³/s): -->
|
|
|
|
|
|
<u-form-item
|
|
|
|
|
|
label="出库流量(m³/s)"
|
|
|
|
|
|
prop="outflowVolume"
|
|
|
|
|
|
:borderBottom="false"
|
|
|
|
|
|
ref="item3"
|
|
|
|
|
|
>
|
|
|
|
|
|
<u--input
|
|
|
|
|
|
v-model="model1.outflowVolume"
|
|
|
|
|
|
placeholder="请输入"
|
|
|
|
|
|
type="number"
|
|
|
|
|
|
clearable
|
|
|
|
|
|
border="surround"
|
|
|
|
|
|
@blur="BlurText($event)"
|
|
|
|
|
|
></u--input>
|
|
|
|
|
|
</u-form-item>
|
|
|
|
|
|
<!-- 其他运行情况 -->
|
|
|
|
|
|
<u-form-item
|
|
|
|
|
|
label="其他运行情况"
|
|
|
|
|
|
prop="remark"
|
|
|
|
|
|
:borderBottom="false"
|
|
|
|
|
|
ref="item3"
|
|
|
|
|
|
>
|
|
|
|
|
|
<u--textarea
|
|
|
|
|
|
placeholder="请输入"
|
|
|
|
|
|
v-model="model1.remark"
|
|
|
|
|
|
count
|
|
|
|
|
|
></u--textarea>
|
|
|
|
|
|
</u-form-item>
|
|
|
|
|
|
<u-form-item
|
|
|
|
|
|
label="附件"
|
|
|
|
|
|
prop="fileList"
|
|
|
|
|
|
:borderBottom="false"
|
|
|
|
|
|
ref="item3"
|
|
|
|
|
|
>
|
|
|
|
|
|
<u-upload
|
|
|
|
|
|
:fileList="fileList1"
|
|
|
|
|
|
@afterRead="afterRead"
|
|
|
|
|
|
@delete="deletePic"
|
|
|
|
|
|
name="1"
|
|
|
|
|
|
multiple
|
|
|
|
|
|
:maxCount="10"
|
2024-06-13 13:50:03 +08:00
|
|
|
|
:previewFullImage="true"
|
2024-06-04 10:05:43 +08:00
|
|
|
|
></u-upload>
|
|
|
|
|
|
</u-form-item>
|
|
|
|
|
|
</u--form>
|
2024-06-13 13:50:03 +08:00
|
|
|
|
|
2024-06-04 10:05:43 +08:00
|
|
|
|
<u-button
|
|
|
|
|
|
type="primary"
|
|
|
|
|
|
text="提交"
|
|
|
|
|
|
customStyle="margin-top: 50px"
|
|
|
|
|
|
@click="submit"
|
|
|
|
|
|
></u-button>
|
2024-06-13 13:50:03 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- 下拉选择 -->
|
2024-06-04 10:05:43 +08:00
|
|
|
|
<!-- isRelease -->
|
|
|
|
|
|
<u-action-sheet
|
|
|
|
|
|
:show="isRelease"
|
|
|
|
|
|
:actions="actions"
|
|
|
|
|
|
title="请选择"
|
|
|
|
|
|
@close="isRelease = false"
|
|
|
|
|
|
@select="releaseSelect"
|
|
|
|
|
|
>
|
|
|
|
|
|
</u-action-sheet>
|
|
|
|
|
|
<!-- showSex -->
|
|
|
|
|
|
<u-action-sheet
|
|
|
|
|
|
:show="showSex"
|
|
|
|
|
|
:actions="actions"
|
|
|
|
|
|
title="请选择"
|
|
|
|
|
|
@close="showSex = false"
|
|
|
|
|
|
@select="sexSelect"
|
|
|
|
|
|
>
|
|
|
|
|
|
</u-action-sheet>
|
2024-06-13 13:50:03 +08:00
|
|
|
|
<!-- mode="top" -->
|
2024-06-04 10:05:43 +08:00
|
|
|
|
<view v-if="isName">
|
2024-06-13 13:50:03 +08:00
|
|
|
|
<u-popup
|
|
|
|
|
|
:show="isName"
|
|
|
|
|
|
@close="isName = false"
|
2024-06-19 10:24:04 +08:00
|
|
|
|
mode="bottom"
|
2024-06-13 13:50:03 +08:00
|
|
|
|
@open="open"
|
|
|
|
|
|
>
|
2024-06-04 10:05:43 +08:00
|
|
|
|
<view style="padding: 30px 20px">
|
|
|
|
|
|
<view class="tabs_h">
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="leftTab"
|
|
|
|
|
|
:class="{ activetextTypeTab: showTextTypeTab == 1 }"
|
|
|
|
|
|
@click="tabChange(1)"
|
|
|
|
|
|
>
|
|
|
|
|
|
{{ namelabel }}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="rightTab"
|
|
|
|
|
|
:class="{ activetextTypeTab: showTextTypeTab == 2 }"
|
|
|
|
|
|
@click="tabChange(2)"
|
|
|
|
|
|
>
|
|
|
|
|
|
{{ gclabel }}
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<!-- 水电站和水库 -->
|
|
|
|
|
|
<view class="" v-if="isSk">
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="ul_list"
|
|
|
|
|
|
:class="{ activeTypeClass: activeType == 1 }"
|
|
|
|
|
|
@click="todetail(1, '水库')"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="left">水库</div>
|
|
|
|
|
|
<u-icon
|
|
|
|
|
|
v-if="activeType == 1"
|
|
|
|
|
|
name="checkmark"
|
|
|
|
|
|
color="#2286f6"
|
|
|
|
|
|
size="20"
|
|
|
|
|
|
></u-icon>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="ul_list"
|
|
|
|
|
|
:class="{ activeTypeClass: activeType == 2 }"
|
|
|
|
|
|
@click="todetail(2, '水电站')"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="left">水电站</div>
|
|
|
|
|
|
<u-icon
|
|
|
|
|
|
v-if="activeType == 2"
|
|
|
|
|
|
name="checkmark"
|
|
|
|
|
|
color="#2286f6"
|
|
|
|
|
|
size="20"
|
|
|
|
|
|
></u-icon>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
<!-- 具体水库或者水电站 -->
|
|
|
|
|
|
<view v-else style="height: 300px; overflow-y: auto">
|
|
|
|
|
|
<div v-for="(item, index) in resList" :key="index">
|
|
|
|
|
|
<div
|
|
|
|
|
|
class="ul_list"
|
|
|
|
|
|
:class="{ activeTypeClass: item.isShow }"
|
|
|
|
|
|
@click="infoClick(item)"
|
|
|
|
|
|
>
|
|
|
|
|
|
<div class="left">{{ item.resName }}</div>
|
|
|
|
|
|
<u-icon
|
|
|
|
|
|
v-if="item.isShow"
|
|
|
|
|
|
name="checkmark"
|
|
|
|
|
|
color="#2286f6"
|
|
|
|
|
|
size="20"
|
|
|
|
|
|
></u-icon>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</u-popup>
|
|
|
|
|
|
</view>
|
2024-06-13 13:50:03 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- 严重程度 -->
|
|
|
|
|
|
<u-action-sheet
|
|
|
|
|
|
:show="isseverity"
|
|
|
|
|
|
:actions="severityList"
|
|
|
|
|
|
title="请选择"
|
|
|
|
|
|
@close="isseverity = false"
|
|
|
|
|
|
@select="severitySelect"
|
|
|
|
|
|
>
|
|
|
|
|
|
</u-action-sheet>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 是否已管控 -->
|
|
|
|
|
|
<u-action-sheet
|
|
|
|
|
|
:show="isControlled"
|
|
|
|
|
|
:actions="actions"
|
|
|
|
|
|
title="请选择"
|
|
|
|
|
|
@close="isControlled = false"
|
|
|
|
|
|
@select="controlledSelect"
|
|
|
|
|
|
>
|
|
|
|
|
|
</u-action-sheet>
|
2024-06-04 10:05:43 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</view>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script>
|
2024-06-19 14:15:15 +08:00
|
|
|
|
import { adnmZhen } from '../utils/tool'
|
|
|
|
|
|
import { disType } from '../utils/dicType.js'
|
|
|
|
|
|
const adcd = uni.getStorageSync('value').adcd
|
2024-06-04 10:05:43 +08:00
|
|
|
|
export default {
|
|
|
|
|
|
data () {
|
|
|
|
|
|
return {
|
|
|
|
|
|
showTextTypeTab: 1,
|
|
|
|
|
|
activeType: '',
|
|
|
|
|
|
isSk: true,
|
|
|
|
|
|
resList: [],
|
|
|
|
|
|
key: '',
|
2024-06-19 14:15:15 +08:00
|
|
|
|
adcd,
|
2024-06-04 10:05:43 +08:00
|
|
|
|
title: {
|
|
|
|
|
|
1: '运行情况上报',
|
|
|
|
|
|
2: '工程险情上报',
|
|
|
|
|
|
3: '实时灾情上报'
|
|
|
|
|
|
},
|
|
|
|
|
|
namelabel: '请选择',
|
|
|
|
|
|
gclabel: '工程',
|
|
|
|
|
|
fileList1: [],
|
|
|
|
|
|
disabled1: false,
|
|
|
|
|
|
tips: '',
|
|
|
|
|
|
value: '',
|
|
|
|
|
|
showCalendar: false,
|
|
|
|
|
|
showBirthday: false,
|
2024-06-13 13:50:03 +08:00
|
|
|
|
formList: {
|
|
|
|
|
|
projectName: '', //工程名称
|
|
|
|
|
|
projectType: '', //工程类型
|
|
|
|
|
|
severity: '', // 严重程度(1一般险情 2较大险情 3重大险情 4特别重大险情)
|
2024-06-13 16:02:00 +08:00
|
|
|
|
isControlled: '', // 是否已管控(0 否 1 是)
|
|
|
|
|
|
incidentDescription: '',
|
|
|
|
|
|
controlResponsiblePerson: '', // 管控责任人
|
|
|
|
|
|
responsiblePersonPhone: '' //责任人电话
|
2024-06-13 13:50:03 +08:00
|
|
|
|
},
|
2024-06-04 10:05:43 +08:00
|
|
|
|
model1: {
|
2024-06-13 13:50:03 +08:00
|
|
|
|
projectName: '',
|
|
|
|
|
|
isPowerGeneration: '',
|
2024-06-04 10:05:43 +08:00
|
|
|
|
isFloodRelease: '',
|
|
|
|
|
|
waterLevel: '',
|
|
|
|
|
|
inflowVolume: '',
|
|
|
|
|
|
outflowVolume: '',
|
|
|
|
|
|
remark: ''
|
|
|
|
|
|
},
|
2024-06-13 13:50:03 +08:00
|
|
|
|
fileIds: [],
|
2024-06-13 16:02:00 +08:00
|
|
|
|
isControlled: false,
|
2024-06-13 13:50:03 +08:00
|
|
|
|
isseverity: false, // 严重程度
|
2024-06-04 10:05:43 +08:00
|
|
|
|
showSex: false,
|
|
|
|
|
|
isRelease: false,
|
|
|
|
|
|
isName: false,
|
|
|
|
|
|
|
2024-06-13 13:50:03 +08:00
|
|
|
|
severityList: [
|
|
|
|
|
|
{
|
2024-06-13 16:02:00 +08:00
|
|
|
|
name: '一般险情'
|
2024-06-13 13:50:03 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2024-06-13 16:02:00 +08:00
|
|
|
|
name: '较大险情'
|
2024-06-13 13:50:03 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2024-06-13 16:02:00 +08:00
|
|
|
|
name: '重大险情'
|
2024-06-13 13:50:03 +08:00
|
|
|
|
},
|
|
|
|
|
|
{
|
2024-06-13 16:02:00 +08:00
|
|
|
|
name: '特别重大险情'
|
2024-06-13 13:50:03 +08:00
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
|
2024-06-04 10:05:43 +08:00
|
|
|
|
actions: [
|
|
|
|
|
|
{
|
|
|
|
|
|
name: '是'
|
|
|
|
|
|
},
|
|
|
|
|
|
{
|
|
|
|
|
|
name: '否'
|
|
|
|
|
|
}
|
|
|
|
|
|
],
|
|
|
|
|
|
rules: {
|
2024-06-13 13:50:03 +08:00
|
|
|
|
projectName: [
|
2024-06-04 10:05:43 +08:00
|
|
|
|
{
|
|
|
|
|
|
type: 'string',
|
|
|
|
|
|
required: true,
|
|
|
|
|
|
message: '请选择工程名称',
|
|
|
|
|
|
trigger: ['blur', 'change']
|
|
|
|
|
|
}
|
|
|
|
|
|
]
|
2024-06-13 13:50:03 +08:00
|
|
|
|
},
|
|
|
|
|
|
projectType: 1
|
2024-06-04 10:05:43 +08:00
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
onLoad (options) {
|
|
|
|
|
|
this.key = options.key
|
2024-06-13 13:50:03 +08:00
|
|
|
|
console.log('搜索框22', options.key)
|
2024-06-13 16:02:00 +08:00
|
|
|
|
|
2024-06-04 10:05:43 +08:00
|
|
|
|
this.getresList()
|
|
|
|
|
|
},
|
|
|
|
|
|
onReady () {
|
2024-06-13 16:02:00 +08:00
|
|
|
|
console.log('搜索框22key', this.key)
|
2024-06-04 10:05:43 +08:00
|
|
|
|
// 如果需要兼容微信小程序,并且校验规则中含有方法等,只能通过setRules方法设置规则
|
2024-06-13 16:02:00 +08:00
|
|
|
|
this.$refs.form1.setRules(this.rules)
|
2024-06-04 10:05:43 +08:00
|
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
|
|
|
async getresList () {
|
|
|
|
|
|
let res = null
|
|
|
|
|
|
this.resList = []
|
|
|
|
|
|
res = await uni.$http.get('/gunshiApp/xfflood/webi/resList')
|
2024-06-19 14:15:15 +08:00
|
|
|
|
// console.log('res', adcd.endsWith('000000000'))
|
|
|
|
|
|
console.log('res---', this.adcd)
|
|
|
|
|
|
let list = res.data.data.filter(item => {
|
|
|
|
|
|
if (this.adcd.endsWith('000000000')) {
|
|
|
|
|
|
return item
|
|
|
|
|
|
} else {
|
|
|
|
|
|
return item.adcd == this.adcd
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
console.log('listlist---', list)
|
|
|
|
|
|
this.resList = list.map(item => {
|
2024-06-04 10:05:43 +08:00
|
|
|
|
item.isShow = false
|
|
|
|
|
|
|
|
|
|
|
|
return item
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
async gethystList () {
|
|
|
|
|
|
this.resList = []
|
|
|
|
|
|
let res = await uni.$http.get('/gunshiApp/xfflood/webi/hystList')
|
2024-06-19 14:15:15 +08:00
|
|
|
|
let list = res.data.data.filter(item => {
|
|
|
|
|
|
if (this.adcd.endsWith('000000000')) {
|
|
|
|
|
|
return item
|
|
|
|
|
|
} else {
|
|
|
|
|
|
return item.adcd == this.adcd
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
this.resList = list.map(item => {
|
2024-06-04 10:05:43 +08:00
|
|
|
|
item.isShow = false
|
|
|
|
|
|
item.resName = item.hystName
|
|
|
|
|
|
|
|
|
|
|
|
return item
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
tabChange (val) {
|
|
|
|
|
|
this.showTextTypeTab = val
|
|
|
|
|
|
if (val == 1) {
|
|
|
|
|
|
this.isSk = true
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.isSk = false
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
todetail (val, title) {
|
|
|
|
|
|
this.activeType = val
|
|
|
|
|
|
this.showTextTypeTab = 2
|
|
|
|
|
|
this.isSk = false
|
|
|
|
|
|
this.namelabel = title
|
2024-06-13 13:50:03 +08:00
|
|
|
|
this.projectType = val
|
2024-06-04 10:05:43 +08:00
|
|
|
|
if (val == 1) {
|
|
|
|
|
|
this.getresList()
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.gethystList()
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
infoClick (obj) {
|
|
|
|
|
|
if (this.activeType == 1) {
|
|
|
|
|
|
this.resList = this.resList.map(item => {
|
|
|
|
|
|
if (item.resCode == obj.resCode) {
|
|
|
|
|
|
item.isShow = true
|
|
|
|
|
|
this.gclabel = item.resName
|
2024-06-13 13:50:03 +08:00
|
|
|
|
this.model1.projectName = item.resName
|
|
|
|
|
|
this.$refs.form1.validateField('isPowerGeneration')
|
2024-06-04 10:05:43 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
item.isShow = false
|
|
|
|
|
|
}
|
|
|
|
|
|
return item
|
|
|
|
|
|
})
|
|
|
|
|
|
} else {
|
|
|
|
|
|
this.resList = this.resList.map(item => {
|
|
|
|
|
|
if (item.hystCode == obj.hystCode) {
|
|
|
|
|
|
item.isShow = true
|
|
|
|
|
|
this.gclabel = item.resName
|
2024-06-13 13:50:03 +08:00
|
|
|
|
this.model1.projectName = item.resName
|
2024-06-04 10:05:43 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
item.isShow = false
|
|
|
|
|
|
}
|
|
|
|
|
|
return item
|
|
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
// 删除图片
|
|
|
|
|
|
deletePic (event) {
|
|
|
|
|
|
this[`fileList${event.name}`].splice(event.index, 1)
|
|
|
|
|
|
},
|
|
|
|
|
|
// 新增图片
|
|
|
|
|
|
async afterRead (event) {
|
|
|
|
|
|
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
|
|
|
|
|
|
let lists = [].concat(event.file)
|
|
|
|
|
|
let fileListLen = this[`fileList${event.name}`].length
|
|
|
|
|
|
lists.map(item => {
|
|
|
|
|
|
this[`fileList${event.name}`].push({
|
|
|
|
|
|
...item,
|
|
|
|
|
|
status: 'uploading',
|
|
|
|
|
|
message: '上传中'
|
|
|
|
|
|
})
|
|
|
|
|
|
})
|
|
|
|
|
|
for (let i = 0; i < lists.length; i++) {
|
|
|
|
|
|
const result = await this.uploadFilePromise(lists[i].url)
|
2024-06-13 16:02:00 +08:00
|
|
|
|
console.log('result', JSON.parse(result))
|
|
|
|
|
|
|
2024-06-04 10:05:43 +08:00
|
|
|
|
let item = this[`fileList${event.name}`][fileListLen]
|
|
|
|
|
|
this[`fileList${event.name}`].splice(
|
|
|
|
|
|
fileListLen,
|
|
|
|
|
|
1,
|
|
|
|
|
|
Object.assign(item, {
|
|
|
|
|
|
status: 'success',
|
|
|
|
|
|
message: '',
|
|
|
|
|
|
url: result
|
|
|
|
|
|
})
|
|
|
|
|
|
)
|
|
|
|
|
|
fileListLen++
|
|
|
|
|
|
}
|
|
|
|
|
|
},
|
|
|
|
|
|
uploadFilePromise (url) {
|
|
|
|
|
|
return new Promise((resolve, reject) => {
|
|
|
|
|
|
let a = uni.uploadFile({
|
2024-06-13 16:02:00 +08:00
|
|
|
|
url: `${uni.$http.baseUrl}/gunshiApp/xfflood/xfProjectRun/file/upload/singleSimple`,
|
2024-06-04 10:05:43 +08:00
|
|
|
|
filePath: url,
|
|
|
|
|
|
name: 'file',
|
|
|
|
|
|
success: res => {
|
2024-06-13 16:02:00 +08:00
|
|
|
|
console.log('res888', JSON.parse(res.data))
|
2024-06-04 10:05:43 +08:00
|
|
|
|
setTimeout(() => {
|
2024-06-13 16:02:00 +08:00
|
|
|
|
resolve(res.data)
|
|
|
|
|
|
this.fileId = JSON.parse(res.data).data.fileId
|
2024-06-04 10:05:43 +08:00
|
|
|
|
}, 1000)
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
|
|
|
|
|
})
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
open () {},
|
|
|
|
|
|
navigateBack () {
|
2024-06-24 09:56:50 +08:00
|
|
|
|
uni.reLaunch({
|
|
|
|
|
|
url: '/pages/xxsb/index'
|
|
|
|
|
|
})
|
2024-06-04 10:05:43 +08:00
|
|
|
|
},
|
|
|
|
|
|
// 是否发电
|
|
|
|
|
|
sexSelect (e) {
|
2024-06-13 13:50:03 +08:00
|
|
|
|
this.model1.isPowerGeneration = e.name
|
|
|
|
|
|
this.$refs.form1.validateField('isPowerGeneration')
|
2024-06-04 10:05:43 +08:00
|
|
|
|
},
|
|
|
|
|
|
// 是否泄洪
|
|
|
|
|
|
releaseSelect (e) {
|
|
|
|
|
|
this.model1.isFloodRelease = e.name
|
|
|
|
|
|
this.$refs.form1.validateField('isFloodRelease')
|
|
|
|
|
|
},
|
2024-06-13 13:50:03 +08:00
|
|
|
|
|
|
|
|
|
|
severitySelect (e) {
|
|
|
|
|
|
console.log('severitySelect0', e)
|
|
|
|
|
|
this.formList.severity = e.name
|
|
|
|
|
|
this.$refs.form2.validateField('severity')
|
2024-06-04 10:05:43 +08:00
|
|
|
|
},
|
2024-06-13 16:02:00 +08:00
|
|
|
|
controlledSelect (e) {
|
2024-06-13 13:50:03 +08:00
|
|
|
|
this.formList.isControlled = e.name
|
|
|
|
|
|
this.$refs.form2.validateField('isControlled')
|
|
|
|
|
|
},
|
|
|
|
|
|
|
2024-06-04 10:05:43 +08:00
|
|
|
|
submit () {
|
2024-06-13 16:02:00 +08:00
|
|
|
|
this.$refs.form1
|
2024-06-04 10:05:43 +08:00
|
|
|
|
.validate()
|
|
|
|
|
|
.then(res => {
|
2024-06-13 16:02:00 +08:00
|
|
|
|
console.log('文件', this.fileId)
|
2024-06-13 13:50:03 +08:00
|
|
|
|
|
2024-06-13 16:02:00 +08:00
|
|
|
|
let params = this.model1
|
|
|
|
|
|
|
|
|
|
|
|
params.projectType = this.projectType
|
2024-06-13 13:50:03 +08:00
|
|
|
|
params.isPowerGeneration = params.isPowerGeneration == '是' ? 1 : 0
|
|
|
|
|
|
params.isFloodRelease = params.isFloodRelease == '是' ? 1 : 0
|
|
|
|
|
|
|
2024-06-19 14:15:15 +08:00
|
|
|
|
if (this.fileList1.length > 0) {
|
2024-06-24 09:56:50 +08:00
|
|
|
|
params.fileIds = this.fileList1.map(item => {
|
2024-06-19 14:15:15 +08:00
|
|
|
|
return JSON.parse(item.url).data.fileId
|
|
|
|
|
|
})
|
2024-06-24 09:56:50 +08:00
|
|
|
|
} else {
|
|
|
|
|
|
params.fileIds = []
|
2024-06-13 16:02:00 +08:00
|
|
|
|
}
|
2024-06-24 09:56:50 +08:00
|
|
|
|
console.log('参数', params)
|
2024-06-13 13:50:03 +08:00
|
|
|
|
uni.$http
|
|
|
|
|
|
.post('/gunshiApp/xfflood/xfProjectRun/insert', params)
|
|
|
|
|
|
.then(res => {
|
|
|
|
|
|
console.log('this.model1---', res)
|
|
|
|
|
|
if (res.data.code == 200) {
|
|
|
|
|
|
console.log('this.model122', res.data)
|
2024-06-19 14:15:15 +08:00
|
|
|
|
uni.navigateTo({
|
|
|
|
|
|
url: `./index`
|
2024-06-13 13:50:03 +08:00
|
|
|
|
})
|
|
|
|
|
|
}
|
|
|
|
|
|
})
|
2024-06-19 14:15:15 +08:00
|
|
|
|
.catch(e => {
|
2024-06-24 09:56:50 +08:00
|
|
|
|
// this.model1.isPowerGeneration =
|
|
|
|
|
|
// params.isPowerGeneration == 1 ? '是' : '否'
|
|
|
|
|
|
// this.model1.isFloodRelease =
|
|
|
|
|
|
// params.isPowerGeneration == 1 ? '是' : '否'
|
2024-06-19 14:15:15 +08:00
|
|
|
|
})
|
2024-06-04 10:05:43 +08:00
|
|
|
|
})
|
|
|
|
|
|
.catch(errors => {
|
2024-06-13 16:02:00 +08:00
|
|
|
|
uni.$u.toast('校验失败', errors)
|
2024-06-04 10:05:43 +08:00
|
|
|
|
})
|
2024-06-13 16:02:00 +08:00
|
|
|
|
|
2024-06-13 13:50:03 +08:00
|
|
|
|
// 如果有错误,会在catch中返回报错信息数组,校验通过则在then中返回true
|
2024-06-04 10:05:43 +08:00
|
|
|
|
},
|
|
|
|
|
|
reset () {
|
2024-06-13 13:50:03 +08:00
|
|
|
|
const validateList = ['projectName', 'isPowerGeneration', 'radiovalue1']
|
2024-06-04 10:05:43 +08:00
|
|
|
|
this.$refs.form1.resetFields()
|
|
|
|
|
|
this.$refs.form1.clearValidate()
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
|
this.$refs.form1.clearValidate(validateList)
|
|
|
|
|
|
// 或者使用 this.$refs.form1.clearValidate()
|
|
|
|
|
|
}, 10)
|
|
|
|
|
|
},
|
|
|
|
|
|
hideKeyboard () {
|
|
|
|
|
|
uni.hideKeyboard()
|
|
|
|
|
|
},
|
|
|
|
|
|
// 过滤字符串
|
|
|
|
|
|
BlurText (e) {
|
|
|
|
|
|
console.log('e', e)
|
|
|
|
|
|
let reg = /^\d+$/.test(e)
|
|
|
|
|
|
if (!reg) {
|
|
|
|
|
|
// this.
|
|
|
|
|
|
console.log('22e', e)
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
|
.container {
|
|
|
|
|
|
font-size: 14px;
|
|
|
|
|
|
background-color: #f3f5f8;
|
|
|
|
|
|
}
|
|
|
|
|
|
.tabs_h {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
// justify-content: center;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
height: 56rpx;
|
|
|
|
|
|
line-height: 88rpx;
|
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
|
margin-bottom: 12rpx;
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
.leftTab {
|
|
|
|
|
|
// width: 80px;
|
|
|
|
|
|
margin-right: 20px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.rightTab {
|
|
|
|
|
|
// width: 80px;
|
|
|
|
|
|
}
|
|
|
|
|
|
.activetextTypeTab,
|
|
|
|
|
|
.activetextTypeTab:hover {
|
|
|
|
|
|
border-bottom: 3rpx solid #2286f6;
|
|
|
|
|
|
color: #026be0;
|
|
|
|
|
|
}
|
|
|
|
|
|
.activeTypeClass,
|
|
|
|
|
|
.activeTypeClass:hover {
|
|
|
|
|
|
color: #026be0;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.nav_bar {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
width: 100%;
|
|
|
|
|
|
margin-top: 30px;
|
|
|
|
|
|
padding-top: 20px;
|
|
|
|
|
|
padding-bottom: 10px;
|
|
|
|
|
|
border-bottom: 1px solid #dfdfdf;
|
|
|
|
|
|
box-shadow: 0 5px 10px -8px #dfdfdf inset;
|
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
|
margin-bottom: 12rpx;
|
|
|
|
|
|
}
|
|
|
|
|
|
.nav_bar_tit {
|
|
|
|
|
|
text-align: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
.info {
|
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
|
margin-bottom: 12rpx;
|
|
|
|
|
|
padding: 20px;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.fl {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: start;
|
|
|
|
|
|
align-items: left;
|
|
|
|
|
|
}
|
|
|
|
|
|
.flsb {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
.bottom {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.u-image {
|
|
|
|
|
|
width: 100%; /* 或者其他尺寸 */
|
|
|
|
|
|
transition: transform 0.3s; /* 平滑的放大效果 */
|
|
|
|
|
|
}
|
|
|
|
|
|
.ul_list {
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
height: 48px;
|
|
|
|
|
|
// border-bottom: 1px solid #dfdfdf;
|
|
|
|
|
|
}
|
|
|
|
|
|
</style>
|