排查隐患

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: {},
//
@ -95,7 +95,7 @@
uuid(len, binary) {
len = !len ? 36 : len;
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,
v = c == 'x' ? r : (r & 0x3 | 0x8);
return v.toString(binary);
@ -148,7 +148,13 @@
getData() {
this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangers', {}, 'GET').then(res => {
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) {
this.investigationSelect = index
this.investigationDetailTitle = item.name
this.showInvestigationDetail = true
this.getData2(item.nid)
// this.$emit('select', this.investigationSelect, this.investigationList[index])
// this.showInvestigationDetail = true
// this.getData2(item.nid)
this.$emit('select', this.investigationSelect, this.investigationList[index])
},
investigationDetailHandle() {
this.showInvestigationDetail = false
this.$emit('select', this.investigationList[this.investigationSelect], this.investigationDetailList)
}
},
onReady() {},
onReady() { },
//
onUnload() {
@ -207,7 +213,7 @@
}, 1500);
},
//
onReachBottom() {},
onReachBottom() { },
}
</script>
@ -252,7 +258,7 @@
/deep/ .uni-forms-item__label {
font-size: 32rpx;
height:auto;
height: auto;
margin-bottom: 20rpx;
}
}

@ -35,6 +35,19 @@
@delete="(e) => deletePic(e, item)" name="1" :maxCount="1"></u-upload>
</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 class="blank" />
</view>
@ -62,7 +75,16 @@
investigationList: [],
showInvestigationDetail: false,
investigationDetailTitle: '',
investigationDetailList: []
investigationDetailList: [],
formData: {
bigCategory: '',
smallCategory: '',
hdTerm: '',
hdPic: '',
hdDesc: '',
hdInfo: '',
},
fileList: [],
}
},
//
@ -70,6 +92,7 @@
// this.getData()
},
mounted() {
if (this.json.name) {
this.investigationDetailList = this.json.extraConfigs.map(item => {
if (!item.fileList) {
@ -110,11 +133,12 @@
}
},
//
onShow() {},
onShow() { },
//
computed: {},
//
methods: {
//
deletePic(event, item) {
item.fileList.splice(event.index, 1)
@ -123,7 +147,7 @@
uuid(len, binary) {
len = !len ? 36 : len;
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,
v = c == 'x' ? r : (r & 0x3 | 0x8);
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() {
this.$request.globalRequest('/hiddenDanger/highDanger/getImportDangerInfo', {
sid: this.$props.sid
@ -211,10 +274,10 @@
// this.$emit('select', this.investigationSelect, this.investigationList[index])
},
investigationDetailHandle() {
this.$emit('select', this.json)
// this.$emit('select', this.json)
}
},
onReady() {},
onReady() { },
//
onUnload() {
@ -227,7 +290,7 @@
}, 1500);
},
//
onReachBottom() {},
onReachBottom() { },
}
</script>
@ -298,5 +361,4 @@
color: #2663BF;
}
}
</style>

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

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

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

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

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

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

Loading…
Cancel
Save