排查隐患

main
limingtao 11 months ago
parent d55374b504
commit 4f55cff1a7
  1. 24
      pages/investigation/components/investigation-item.vue
  2. 76
      pages/investigation/components/investigation-item2.vue
  3. 1
      pages/investigation/components/problem-box.vue
  4. 7
      pages/investigation/task-zancun.vue
  5. 390
      pages/investigation/task.vue
  6. 5
      uni_modules/uview-ui/components/u-checkbox-group/props.js
  7. 141
      uni_modules/uview-ui/components/u-checkbox/props.js
  8. 10
      uni_modules/uview-ui/components/u-checkbox/u-checkbox.vue
  9. 1
      uni_modules/uview-ui/libs/config/props/checkboxGroup.js

@ -82,7 +82,7 @@
} }
}, },
// //
onShow() {}, onShow() { },
// //
computed: {}, computed: {},
// //
@ -95,7 +95,7 @@
uuid(len, binary) { uuid(len, binary) {
len = !len ? 36 : len; len = !len ? 36 : len;
binary = !binary ? 16 : binary; binary = !binary ? 16 : binary;
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = Math.random() * binary | 0, var r = Math.random() * binary | 0,
v = c == 'x' ? r : (r & 0x3 | 0x8); v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(binary); return v.toString(binary);
@ -148,7 +148,13 @@
getData() { getData() {
this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangers', {}, 'GET').then(res => { this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangers', {}, 'GET').then(res => {
if (res.code == 200) { if (res.code == 200) {
this.investigationList = res.result for (let i = 0; i < res.result.length; i++) {
for (let j = 0; j < res.result[i].dangerItems.length; j++) {
res.result[i].dangerItems[j].nid = res.result[i].nid
}
// this.getInvestigationListDangerInfo(res.result[i].nid)
}
this.investigationList = res.result;
} }
}) })
}, },
@ -185,16 +191,16 @@
handleSelect(item, index) { handleSelect(item, index) {
this.investigationSelect = index this.investigationSelect = index
this.investigationDetailTitle = item.name this.investigationDetailTitle = item.name
this.showInvestigationDetail = true // this.showInvestigationDetail = true
this.getData2(item.nid) // this.getData2(item.nid)
// this.$emit('select', this.investigationSelect, this.investigationList[index]) this.$emit('select', this.investigationSelect, this.investigationList[index])
}, },
investigationDetailHandle() { investigationDetailHandle() {
this.showInvestigationDetail = false this.showInvestigationDetail = false
this.$emit('select', this.investigationList[this.investigationSelect], this.investigationDetailList) this.$emit('select', this.investigationList[this.investigationSelect], this.investigationDetailList)
} }
}, },
onReady() {}, onReady() { },
// //
onUnload() { onUnload() {
@ -207,7 +213,7 @@
}, 1500); }, 1500);
}, },
// //
onReachBottom() {}, onReachBottom() { },
} }
</script> </script>
@ -252,7 +258,7 @@
/deep/ .uni-forms-item__label { /deep/ .uni-forms-item__label {
font-size: 32rpx; font-size: 32rpx;
height:auto; height: auto;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
} }

@ -35,6 +35,19 @@
@delete="(e) => deletePic(e, item)" name="1" :maxCount="1"></u-upload> @delete="(e) => deletePic(e, item)" name="1" :maxCount="1"></u-upload>
</view> </view>
</view> </view>
<view class="detail-item">
<uni-forms-item label="隐患描述" label-position="top" label-width="200px" />
<u-textarea placeholder="请输入" border="none" v-model="formData.hdDesc" />
</view>
<view class="detail-item">
<uni-forms-item label="隐患图片" label-position="top" label-width="200px" />
<u-upload :fileList="fileList" @afterRead="(e) => afterRead2(e, 'fileList')"
@delete="(e) => deletePic2(e, 'fileList')" name="1" :maxCount="1"></u-upload>
</view>
<view class="detail-item">
<uni-forms-item label="需采集补充信息" label-position="top" label-width="200px" />
<u-textarea placeholder="请输入" border="none" v-model="formData.hdInfo" />
</view>
</view> </view>
<view class="blank" /> <view class="blank" />
</view> </view>
@ -62,7 +75,16 @@
investigationList: [], investigationList: [],
showInvestigationDetail: false, showInvestigationDetail: false,
investigationDetailTitle: '', investigationDetailTitle: '',
investigationDetailList: [] investigationDetailList: [],
formData: {
bigCategory: '',
smallCategory: '',
hdTerm: '',
hdPic: '',
hdDesc: '',
hdInfo: '',
},
fileList: [],
} }
}, },
// //
@ -70,6 +92,7 @@
// this.getData() // this.getData()
}, },
mounted() { mounted() {
if (this.json.name) { if (this.json.name) {
this.investigationDetailList = this.json.extraConfigs.map(item => { this.investigationDetailList = this.json.extraConfigs.map(item => {
if (!item.fileList) { if (!item.fileList) {
@ -110,11 +133,12 @@
} }
}, },
// //
onShow() {}, onShow() { },
// //
computed: {}, computed: {},
// //
methods: { methods: {
// //
deletePic(event, item) { deletePic(event, item) {
item.fileList.splice(event.index, 1) item.fileList.splice(event.index, 1)
@ -123,7 +147,7 @@
uuid(len, binary) { uuid(len, binary) {
len = !len ? 36 : len; len = !len ? 36 : len;
binary = !binary ? 16 : binary; binary = !binary ? 16 : binary;
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
var r = Math.random() * binary | 0, var r = Math.random() * binary | 0,
v = c == 'x' ? r : (r & 0x3 | 0x8); v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(binary); return v.toString(binary);
@ -170,6 +194,45 @@
}); });
}) })
}, },
//
deletePic2(event, key) {
this[key].splice(event.index, 1)
this.formData.hdPic = this[key].filter(item => item.status === 'success').map(item => item.url).toString()
this.changeEmit()
},
//
async afterRead2(event, key) {
// multiple true , file
const id = this.uuid()
this[key].push({
id,
...event.file,
status: 'uploading',
message: '上传中'
})
const result = await this.uploadFilePromise(this[key][0].url)
const resultInfo = JSON.parse(result)
const index = this[key].findIndex(v => v.id === id)
if (resultInfo.code == 200) {
this[key].splice(index, 1, Object.assign(this[key][index], {
status: 'success',
message: '',
result: resultInfo,
url: resultInfo.result
}))
} else {
this.$.toast('上传失败')
this[key].splice(index, 1, Object.assign(this[key][index], {
status: 'error',
message: '失败',
}))
}
this.formData.hdPic = this[key].filter(item => item.status === 'success').map(item => item.url).toString()
this.changeEmit()
},
changeEmit() {
this.$emit('change', this.formData)
},
getData() { getData() {
this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangerInfo', { this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangerInfo', {
sid: this.$props.sid sid: this.$props.sid
@ -211,10 +274,10 @@
// this.$emit('select', this.investigationSelect, this.investigationList[index]) // this.$emit('select', this.investigationSelect, this.investigationList[index])
}, },
investigationDetailHandle() { investigationDetailHandle() {
this.$emit('select', this.json) // this.$emit('select', this.json)
} }
}, },
onReady() {}, onReady() { },
// //
onUnload() { onUnload() {
@ -227,7 +290,7 @@
}, 1500); }, 1500);
}, },
// //
onReachBottom() {}, onReachBottom() { },
} }
</script> </script>
@ -298,5 +361,4 @@
color: #2663BF; color: #2663BF;
} }
} }
</style> </style>

@ -84,7 +84,6 @@ export default {
}, },
// //
onLoad(e) { onLoad(e) {
console.log(12312312312)
// this.getData() // this.getData()
}, },
mounted(){ mounted(){

@ -273,10 +273,7 @@ export default {
showInvestigation: false, showInvestigation: false,
investigationSelectList: [], investigationSelectList: [],
investigationSelectIDList: [], investigationSelectIDList: [],
investigationList: [ investigationList: [],
{ name: '基本信息基本信息基本信息基本信息基本信息基本信息基本信息基本信息基本信息基本信息基本信息基本信息', value: 1 },
{ name: 'xxxxx', value: 2 },
],
investigationSelect: 1, investigationSelect: 1,
showInvestigationDetail: false, showInvestigationDetail: false,
investigationDetailList: [ investigationDetailList: [
@ -398,7 +395,7 @@ export default {
}, },
investigationHandle() { investigationHandle() {
console.log(this.investigationSelect) // console.log(this.investigationSelect)
if(!this.investigationSelectIDList.includes(this.investigationList[this.investigationSelect].nid)){ if(!this.investigationSelectIDList.includes(this.investigationList[this.investigationSelect].nid)){
this.investigationSelectList.push(this.investigationList[this.investigationSelect].name) this.investigationSelectList.push(this.investigationList[this.investigationSelect].name)
this.investigationSelectIDList.push(this.investigationList[this.investigationSelect].nid) this.investigationSelectIDList.push(this.investigationList[this.investigationSelect].nid)

@ -37,8 +37,8 @@
<input v-if="isEdit" type="text" class="BorderNone Height100" v-model="formData.roadType" <input v-if="isEdit" type="text" class="BorderNone Height100" v-model="formData.roadType"
placeholder="请输入道路类型" /> placeholder="请输入道路类型" />
<text class="Height100 Flex Flex_end Flex_C_S-Center" v-else>{{ <text class="Height100 Flex Flex_end Flex_C_S-Center" v-else>{{
formData.roadType formData.roadType
}}</text> }}</text>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="道路宽度"> <uni-forms-item label="道路宽度">
<input v-if="isEdit" type="number" class="BorderNone Height100" v-model="formData.roadWidth" <input v-if="isEdit" type="number" class="BorderNone Height100" v-model="formData.roadWidth"
@ -54,34 +54,34 @@
<input v-if="isEdit" type="text" class="BorderNone Height100" v-model="formData.roadStructure" <input v-if="isEdit" type="text" class="BorderNone Height100" v-model="formData.roadStructure"
placeholder="请输入路面结构" /> placeholder="请输入路面结构" />
<text class="Height100 Flex Flex_end Flex_C_S-Center" v-else>{{ <text class="Height100 Flex Flex_end Flex_C_S-Center" v-else>{{
formData.roadStructure formData.roadStructure
}}</text> }}</text>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="路侧防护"> <uni-forms-item label="路侧防护">
<input v-if="isEdit" type="text" class="BorderNone Height100" v-model="formData.sideProtec" <input v-if="isEdit" type="text" class="BorderNone Height100" v-model="formData.sideProtec"
placeholder="请输入路侧防护" /> placeholder="请输入路侧防护" />
<text class="Height100 Flex Flex_end Flex_C_S-Center" v-else>{{ <text class="Height100 Flex Flex_end Flex_C_S-Center" v-else>{{
formData.sideProtec formData.sideProtec
}}</text> }}</text>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="中央隔离"> <uni-forms-item label="中央隔离">
<input v-if="isEdit" type="text" class="BorderNone Height100" v-model="formData.centerSeparate" <input v-if="isEdit" type="text" class="BorderNone Height100" v-model="formData.centerSeparate"
placeholder="请输入中央隔离" /> placeholder="请输入中央隔离" />
<text class="Height100 Flex Flex_end Flex_C_S-Center" v-else>{{ <text class="Height100 Flex Flex_end Flex_C_S-Center" v-else>{{
formData.centerSeparate formData.centerSeparate
}}</text> }}</text>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="设计时速"> <uni-forms-item label="设计时速">
<input v-if="isEdit" type="number" class="BorderNone Height100" v-model="formData.designSpeed" <input v-if="isEdit" type="number" class="BorderNone Height100" v-model="formData.designSpeed"
placeholder="请输入设计时速" /> placeholder="请输入设计时速" />
<text class="Height100 Flex Flex_end Flex_C_S-Center" <text class="Height100 Flex Flex_end Flex_C_S-Center" v-else>{{ formData.designSpeed
v-else>{{ formData.designSpeed }}Km/h</text> }}Km/h</text>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="限速"> <uni-forms-item label="限速">
<input v-if="isEdit" type="number" class="BorderNone Height100" v-model="formData.limitSpeed" <input v-if="isEdit" type="number" class="BorderNone Height100" v-model="formData.limitSpeed"
placeholder="请输入限速" /> placeholder="请输入限速" />
<text class="Height100 Flex Flex_C_S-Center Flex_end" <text class="Height100 Flex Flex_C_S-Center Flex_end" v-else>{{ formData.limitSpeed
v-else>{{ formData.limitSpeed }}Km/h</text> }}Km/h</text>
</uni-forms-item> </uni-forms-item>
</uni-forms> </uni-forms>
<view class="photo"> <view class="photo">
@ -107,26 +107,26 @@
<input v-if="isEditStep2" type="number" class="BorderNone Height100" <input v-if="isEditStep2" type="number" class="BorderNone Height100"
v-model="formData.peakHours" placeholder="请输入高峰时段" /> v-model="formData.peakHours" placeholder="请输入高峰时段" />
<text class="Height100 Flex Flex_end Flex_C_S-Center" v-else>{{ <text class="Height100 Flex Flex_end Flex_C_S-Center" v-else>{{
formData.peakHours formData.peakHours
}}</text> }}</text>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="平峰流量"> <uni-forms-item label="平峰流量">
<input v-if="isEditStep2" type="number" class="BorderNone Height100" <input v-if="isEditStep2" type="number" class="BorderNone Height100"
v-model="formData.normalTraffic" placeholder="请输入平峰流量" /> v-model="formData.normalTraffic" placeholder="请输入平峰流量" />
<text class="Height100 Flex Flex_end Flex_C_S-Center" <text class="Height100 Flex Flex_end Flex_C_S-Center" v-else>{{ formData.normalTraffic
v-else>{{ formData.normalTraffic }}</text> }}</text>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="大车占比"> <uni-forms-item label="大车占比">
<input v-if="isEditStep2" type="number" class="BorderNone Height100" <input v-if="isEditStep2" type="number" class="BorderNone Height100"
v-model="formData.largeVehicleRate" placeholder="请输入大车占比" /> v-model="formData.largeVehicleRate" placeholder="请输入大车占比" />
<text class="Height100 Flex Flex_end Flex_C_S-Center" <text class="Height100 Flex Flex_end Flex_C_S-Center" v-else>{{ formData.largeVehicleRate
v-else>{{ formData.largeVehicleRate }}%</text> }}%</text>
</uni-forms-item> </uni-forms-item>
<uni-forms-item label="非机动车流量"> <uni-forms-item label="非机动车流量">
<input v-if="isEditStep2" type="number" class="BorderNone Height100" <input v-if="isEditStep2" type="number" class="BorderNone Height100"
v-model="formData.nonvehicleTraffic" placeholder="请输入非机动车流量" /> v-model="formData.nonvehicleTraffic" placeholder="请输入非机动车流量" />
<text class="Height100 Flex Flex_end Flex_C_S-Center" <text class="Height100 Flex Flex_end Flex_C_S-Center" v-else>{{ formData.nonvehicleTraffic
v-else>{{ formData.nonvehicleTraffic }}</text> }}</text>
</uni-forms-item> </uni-forms-item>
</uni-forms> </uni-forms>
</view> </view>
@ -146,6 +146,10 @@
</view> </view>
</view> </view>
</view> </view>
<u-checkbox-group v-model="checked" iconPlacement="right" placement="row">
<u-checkbox v-for="(item,index) in troubleshootingData" :label="item.itemname" activeColor="#2663BF"
:name="item.id"></u-checkbox>
</u-checkbox-group>
<u-popup :show="showInvestigation" @close="showInvestigation = false"> <u-popup :show="showInvestigation" @close="showInvestigation = false">
<InvestigationItem @select="select2"></InvestigationItem> <InvestigationItem @select="select2"></InvestigationItem>
</u-popup> </u-popup>
@ -258,8 +262,8 @@
<uni-forms-item label="隐患问题" label-position="top" label-width="100px" <uni-forms-item label="隐患问题" label-position="top" label-width="100px"
style="display: flex; align-items: center" /> style="display: flex; align-items: center" />
<view v-if="hiddenDangerList2.length > 0">{{ hiddenDangerList2[0].itemname }}/{{ <view v-if="hiddenDangerList2.length > 0">{{ hiddenDangerList2[0].itemname }}/{{
hiddenDangerList2[1].itemname hiddenDangerList2[1].itemname
}}/{{ hiddenDangerList2[2].itemname }}</view> }}/{{ hiddenDangerList2[2].itemname }}</view>
<!-- <u-input <!-- <u-input
placeholder="请选择" placeholder="请选择"
@ -268,8 +272,8 @@
v-else v-else
/> --> /> -->
<view v-else-if="dangerProblem">{{ <view v-else-if="dangerProblem">{{
dangerProblem dangerProblem
}}</view> }}</view>
<view v-else>请选择</view> <view v-else>请选择</view>
<!-- --> <!-- -->
</view> </view>
@ -359,60 +363,60 @@
investigationSelectList: [], investigationSelectList: [],
investigationSelectIDList: [], investigationSelectIDList: [],
investigationList: [{ investigationList: [{
name: "基本信息基本信息基本信息基本信息基本信息基本信息基本信息基本信息基本信息基本信息基本信息基本信息", name: "基本信息基本信息基本信息基本信息基本信息基本信息基本信息基本信息基本信息基本信息基本信息基本信息",
value: 1, value: 1,
}, },
{ {
name: "xxxxx", name: "xxxxx",
value: 2 value: 2
}, },
], ],
investigationSelect: 1, investigationSelect: 1,
showInvestigationDetail: false, showInvestigationDetail: false,
investigationDetailList: [{ investigationDetailList: [{
type: "check", type: "check",
value: "" value: ""
}, },
{ {
type: "text", type: "text",
value: "" value: ""
}, },
{ {
type: "number", type: "number",
value: "" value: ""
}, },
{ {
type: "upload", type: "upload",
value: "" value: ""
}, },
], ],
investigationDetailTitle: "title", investigationDetailTitle: "title",
isEdit: false, isEdit: false,
isEditStep2: false, isEditStep2: false,
active: 1, active: 1,
tablist: [{ tablist: [{
title: "基本信息", title: "基本信息",
type: "item", type: "item",
i: 1 i: 1
}, },
{ {
title: "基本信息", title: "基本信息",
type: "point" type: "point"
}, },
{ {
title: "统计信息", title: "统计信息",
type: "item", type: "item",
i: 2 i: 2
}, },
{ {
title: "统计信息", title: "统计信息",
type: "point" type: "point"
}, },
{ {
title: "隐患排查", title: "隐患排查",
type: "item", type: "item",
i: 3 i: 3
}, },
], ],
formData: { formData: {
roadType: "", roadType: "",
@ -476,29 +480,29 @@
showProblemTreeSelect: false, showProblemTreeSelect: false,
problemTreeSelect: 0, problemTreeSelect: 0,
problemTreeSelectList: [{ problemTreeSelectList: [{
name: "ashfjshfjsd1" name: "ashfjshfjsd1"
}, },
{ {
name: "ashfjshfjsd2" name: "ashfjshfjsd2"
}, },
{ {
name: "ashfjshfjs3d" name: "ashfjshfjs3d"
}, },
{ {
name: "ashfjshfjsd4" name: "ashfjshfjsd4"
}, },
{ {
name: "ashfjshfjsd5" name: "ashfjshfjsd5"
}, },
{ {
name: "ashfjshfjsd6" name: "ashfjshfjsd6"
}, },
{ {
name: "ashfjshfjsd8" name: "ashfjshfjsd8"
}, },
{ {
name: "ashfjshfjsd7" name: "ashfjshfjsd7"
}, },
], ],
problemTreeSelectConfirmList: [], problemTreeSelectConfirmList: [],
hiddenDangerList: [], hiddenDangerList: [],
@ -509,7 +513,10 @@
addInvestigationInfo: { addInvestigationInfo: {
type: '', type: '',
index: 0 index: 0
} },
//
troubleshootingData: [],
checked: [],
}; };
}, },
methods: { methods: {
@ -519,19 +526,43 @@
this.showInvestigation2Item = v; this.showInvestigation2Item = v;
}, },
select2(v, list) { select2(v, list) {
this.showInvestigation = false; // this.showInvestigation = false;
let id = 0; // let id = 0;
this.investigationSelectList.map((r) => { // this.investigationSelectList.map((r) => {
if (r.nid == v.nid) { // if (r.nid == v.nid) {
id = r.nid; // id = r.nid;
// }
// });
// if (!id) {
// v.extraConfigs = list;
// this.investigationSelectList.push(v);
// this.showInvestigation = false;
// } else {
// this.$.toast("");
// }
list.dangerItems.forEach(item => {
// this.troubleshootingDataitem.idid
let found = false;
// this.troubleshootingDataid
this.troubleshootingData.forEach(item2 => {
if (item.id === item2.id) {
// foundtrue退
found = true;
return;
}
});
// this.troubleshootingDataidresult
if (!found) {
this.troubleshootingData.push(item);
} }
}); });
if (!id) { // this.troubleshootingData = result
v.extraConfigs = list; this.showInvestigation = false
this.investigationSelectList.push(v); let isId = this.investigationSelectList.some(item => item.nid === list.nid);
this.showInvestigation = false; if (!isId) {
} else { this.investigationSelectList.push(list)
this.$.toast("已添加");
} }
}, },
select3(v) { select3(v) {
@ -566,25 +597,25 @@
newArr = ['', '', ''] newArr = ['', '', '']
} }
this.hiddenDangerList2 = [{ this.hiddenDangerList2 = [{
id: v.bigCategory, id: v.bigCategory,
itemname: newArr[0] itemname: newArr[0]
}, },
{ {
id: v.smallCategory, id: v.smallCategory,
itemname: newArr[1] itemname: newArr[1]
}, },
{ {
id: v.hdTerm, id: v.hdTerm,
itemname: newArr[2] itemname: newArr[2]
} }
] ]
// console.log(this.hiddenDangerList2) // console.log(this.hiddenDangerList2)
if(v.hdPic){ if (v.hdPic) {
this.fileList = [{ this.fileList = [{
url: v.hdPic url: v.hdPic
}]; }];
}else{ } else {
this.fileList = []; this.fileList = [];
} }
@ -622,9 +653,9 @@
this.$request this.$request
.globalRequest( .globalRequest(
"/hiddenDanger/highDanger/getSectionInfo", { "/hiddenDanger/highDanger/getSectionInfo", {
nuserid: this.$.getData("token"), nuserid: this.$.getData("token"),
businessId businessId
}, },
"GET" "GET"
) )
.then((res) => { .then((res) => {
@ -638,9 +669,9 @@
this.$request this.$request
.globalRequest( .globalRequest(
"/hiddenDanger/highDanger/getSectionTraffic", { "/hiddenDanger/highDanger/getSectionTraffic", {
nuserid: this.$.getData("token"), nuserid: this.$.getData("token"),
businessId businessId
}, },
"GET" "GET"
) )
.then((res) => { .then((res) => {
@ -655,9 +686,9 @@
this.$request this.$request
.globalRequest( .globalRequest(
"/hiddenDanger/highDanger/getImportDangerDisplay", { "/hiddenDanger/highDanger/getImportDangerDisplay", {
sid: "02", sid: "02",
businessId businessId
}, },
"GET" "GET"
) )
.then((res) => { .then((res) => {
@ -667,9 +698,10 @@
this.$request this.$request
.globalRequest( .globalRequest(
"/hiddenDanger/highDanger/getImportDangerDisplayDetail", { "/hiddenDanger/highDanger/getImportDangerDisplayDetail", {
nuserid: this.$.getData("token"), nuserid: this.$.getData("token"),
businessId businessId,
}, dangerId: '26'
},
"GET" "GET"
) )
.then((res) => { .then((res) => {
@ -689,9 +721,9 @@
this.$request this.$request
.globalRequest( .globalRequest(
"/hiddenDanger/highDanger/getImportDangers", { "/hiddenDanger/highDanger/getImportDangers", {
nuserid: this.$.getData("token"), nuserid: this.$.getData("token"),
businessId businessId
}, },
"GET" "GET"
) )
.then((res) => { .then((res) => {
@ -702,9 +734,9 @@
this.$request this.$request
.globalRequest( .globalRequest(
"/hiddenDanger/highDanger/getUserHiddenDangerList", { "/hiddenDanger/highDanger/getUserHiddenDangerList", {
nuserid: this.$.getData("token"), nuserid: this.$.getData("token"),
businessId businessId
}, },
"GET" "GET"
) )
.then((res) => { .then((res) => {
@ -716,9 +748,9 @@
this.$request this.$request
.globalRequest( .globalRequest(
"/hiddenDanger/highDanger/getDangerItems", { "/hiddenDanger/highDanger/getDangerItems", {
nuserid: this.$.getData("token"), nuserid: this.$.getData("token"),
businessId businessId
}, },
"GET" "GET"
) )
.then((res) => { .then((res) => {
@ -814,20 +846,20 @@
let res = { let res = {
categories: ["2018", "2019", "2020", "2021", "2022", "2023"], categories: ["2018", "2019", "2020", "2021", "2022", "2023"],
series: [{ series: [{
name: "总量", name: "总量",
legendShape: "line", legendShape: "line",
data: [35, 8, 25, 37, 4, 20], data: [35, 8, 25, 37, 4, 20],
}, },
{ {
name: "大车", name: "大车",
legendShape: "line", legendShape: "line",
data: [70, 40, 65, 100, 44, 68], data: [70, 40, 65, 100, 44, 68],
}, },
{ {
name: "小车", name: "小车",
legendShape: "line", legendShape: "line",
data: [100, 80, 95, 150, 112, 132], data: [100, 80, 95, 150, 112, 132],
}, },
], ],
}; };
this.chartData = JSON.parse(JSON.stringify(res)); this.chartData = JSON.parse(JSON.stringify(res));
@ -841,7 +873,7 @@
len = !len ? 36 : len; len = !len ? 36 : len;
binary = !binary ? 16 : binary; binary = !binary ? 16 : binary;
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx" return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx"
.replace(/[xy]/g, function(c) { .replace(/[xy]/g, function (c) {
var r = (Math.random() * binary) | 0, var r = (Math.random() * binary) | 0,
v = c == "x" ? r : (r & 0x3) | 0x8; v = c == "x" ? r : (r & 0x3) | 0x8;
return v.toString(binary); return v.toString(binary);
@ -929,7 +961,7 @@
if (item.businessId) { if (item.businessId) {
delete item.businessId delete item.businessId
} }
if (item.pcCount||item.pcCount==null) { if (item.pcCount || item.pcCount == null) {
delete item.pcCount delete item.pcCount
} }
if (item.dangerProblem) { if (item.dangerProblem) {
@ -943,34 +975,34 @@
this.$request this.$request
.globalRequest( .globalRequest(
"/hiddenDanger/highDanger/saveManualInvestigation", { "/hiddenDanger/highDanger/saveManualInvestigation", {
...this.formData, ...this.formData,
businessId: this.businessId, businessId: this.businessId,
extraConfigs: extraConfigs, extraConfigs: extraConfigs,
describe:describe, describe: describe,
// describe: [{ // describe: [{
// "bigCategory": "1", // "bigCategory": "1",
// "bigCategoryName": "线", // "bigCategoryName": "线",
// "smallCategory": "2", // "smallCategory": "2",
// "smallCategoryName": "线", // "smallCategoryName": "线",
// "hdTerm": "4", // "hdTerm": "4",
// "hdTermName": "", // "hdTermName": "",
// "hdDesc": "", // "hdDesc": "",
// "hdPic": "", // "hdPic": "",
// "hdInfo": "" // "hdInfo": ""
// }], // }],
temporary, temporary,
}, },
"POST" "POST"
) )
.then((res) => { .then((res) => {
console.log(res); console.log(res);
if (res.code === 200) { if (res.code === 200) {
this.$.toast("保存成功"); this.$.toast("保存成功");
setTimeout(() => { // setTimeout(() => {
uni.navigateBack({ // uni.navigateBack({
delta: 2, // 1 // delta: 2, // 1
}); // });
}, 1000); // }, 1000);
// this.data = res.result; // this.data = res.result;
// this.rname = this.data[0].name; // this.rname = this.data[0].name;
@ -1275,4 +1307,12 @@
padding: 0 20rpx; padding: 0 20rpx;
overflow-x: auto; overflow-x: auto;
} }
.u-checkbox-group--row {
flex-direction: column;
padding: 0 20rpx;
.u-checkbox {
margin-bottom: 30rpx;
}
}
</style> </style>

@ -5,6 +5,11 @@ export default {
type: String, type: String,
default: uni.$u.props.checkboxGroup.name default: uni.$u.props.checkboxGroup.name
}, },
// 标识符
obj: {
type: [Object],
default: uni.$u.props.checkboxGroup.item
},
// 绑定的值 // 绑定的值
value: { value: {
type: Array, type: Array,

@ -1,69 +1,74 @@
export default { export default {
props: { props: {
// checkbox的名称 // checkbox的名称
name: { name: {
type: [String, Number, Boolean], type: [String, Number, Boolean],
default: uni.$u.props.checkbox.name default: uni.$u.props.checkbox.name,
}, },
// 形状,square为方形,circle为圆型 // item
shape: { obj: {
type: String, type: [ Object],
default: uni.$u.props.checkbox.shape default: uni.$u.props.checkbox.obj,
}, },
// 整体的大小 // 形状,square为方形,circle为圆型
size: { shape: {
type: [String, Number], type: String,
default: uni.$u.props.checkbox.size default: uni.$u.props.checkbox.shape,
}, },
// 是否默认选中 // 整体的大小
checked: { size: {
type: Boolean, type: [String, Number],
default: uni.$u.props.checkbox.checked default: uni.$u.props.checkbox.size,
}, },
// 是否禁用 // 是否默认选中
disabled: { checked: {
type: [String, Boolean], type: Boolean,
default: uni.$u.props.checkbox.disabled default: uni.$u.props.checkbox.checked,
}, },
// 选中状态下的颜色,如设置此值,将会覆盖parent的activeColor值 // 是否禁用
activeColor: { disabled: {
type: String, type: [String, Boolean],
default: uni.$u.props.checkbox.activeColor default: uni.$u.props.checkbox.disabled,
}, },
// 未选中的颜色 // 选中状态下的颜色,如设置此值,将会覆盖parent的activeColor值
inactiveColor: { activeColor: {
type: String, type: String,
default: uni.$u.props.checkbox.inactiveColor default: uni.$u.props.checkbox.activeColor,
}, },
// 图标的大小,单位px // 未选中的颜色
iconSize: { inactiveColor: {
type: [String, Number], type: String,
default: uni.$u.props.checkbox.iconSize default: uni.$u.props.checkbox.inactiveColor,
}, },
// 图标颜色 // 图标的大小,单位px
iconColor: { iconSize: {
type: String, type: [String, Number],
default: uni.$u.props.checkbox.iconColor default: uni.$u.props.checkbox.iconSize,
}, },
// label提示文字,因为nvue下,直接slot进来的文字,由于特殊的结构,无法修改样式 // 图标颜色
label: { iconColor: {
type: [String, Number], type: String,
default: uni.$u.props.checkbox.label default: uni.$u.props.checkbox.iconColor,
}, },
// label的字体大小,px单位 // label提示文字,因为nvue下,直接slot进来的文字,由于特殊的结构,无法修改样式
labelSize: { label: {
type: [String, Number], type: [String, Number],
default: uni.$u.props.checkbox.labelSize default: uni.$u.props.checkbox.label,
}, },
// label的颜色 // label的字体大小,px单位
labelColor: { labelSize: {
type: String, type: [String, Number],
default: uni.$u.props.checkbox.labelColor default: uni.$u.props.checkbox.labelSize,
}, },
// 是否禁止点击提示语选中复选框 // label的颜色
labelDisabled: { labelColor: {
type: [String, Boolean], type: String,
default: uni.$u.props.checkbox.labelDisabled default: uni.$u.props.checkbox.labelColor,
} },
} // 是否禁止点击提示语选中复选框
} labelDisabled: {
type: [String, Boolean],
default: uni.$u.props.checkbox.labelDisabled,
},
},
};

@ -2,12 +2,12 @@
<view <view
class="u-checkbox" class="u-checkbox"
:style="[checkboxStyle]" :style="[checkboxStyle]"
@tap.stop="wrapperClickHandler" @tap.stop="wrapperClickHandler($event)"
:class="[`u-checkbox-label--${parentData.iconPlacement}`, parentData.borderBottom && parentData.placement === 'column' && 'u-border-bottom']" :class="[`u-checkbox-label--${parentData.iconPlacement}`, parentData.borderBottom && parentData.placement === 'column' && 'u-border-bottom']"
> >
<view <view
class="u-checkbox__icon-wrap" class="u-checkbox__icon-wrap"
@tap.stop="iconClickHandler" @tap.stop="iconClickHandler($event)"
:class="iconClasses" :class="iconClasses"
:style="[iconWrapStyle]" :style="[iconWrapStyle]"
> >
@ -21,7 +21,7 @@
</slot> </slot>
</view> </view>
<text <text
@tap.stop="labelClickHandler" @tap.stop="labelClickHandler($event)"
:style="{ :style="{
color: elDisabled ? elInactiveColor : elLabelColor, color: elDisabled ? elInactiveColor : elLabelColor,
fontSize: elLabelSize, fontSize: elLabelSize,
@ -197,13 +197,16 @@
// //
wrapperClickHandler(e) { wrapperClickHandler(e) {
this.parentData.iconPlacement === 'right' && this.iconClickHandler(e) this.parentData.iconPlacement === 'right' && this.iconClickHandler(e)
}, },
// //
iconClickHandler(e) { iconClickHandler(e) {
// console.log(this.obj)
this.preventEvent(e) this.preventEvent(e)
// //
if (!this.elDisabled) { if (!this.elDisabled) {
this.setRadioCheckedStatus() this.setRadioCheckedStatus()
this.$emit('click', this.obj)
} }
}, },
// label // label
@ -212,6 +215,7 @@
// label // label
if (!this.elLabelDisabled && !this.elDisabled) { if (!this.elLabelDisabled && !this.elDisabled) {
this.setRadioCheckedStatus() this.setRadioCheckedStatus()
this.$emit('click', this.obj)
} }
}, },
emitEvent() { emitEvent() {

@ -11,6 +11,7 @@ export default {
// checkbox-group组件 // checkbox-group组件
checkboxGroup: { checkboxGroup: {
name: '', name: '',
obj: () => {},
value: () => [], value: () => [],
shape: 'square', shape: 'square',
disabled: false, disabled: false,

Loading…
Cancel
Save