|
@ -11,7 +11,6 @@ |
|
|
</el-breadcrumb-item> |
|
|
</el-breadcrumb-item> |
|
|
</el-breadcrumb> |
|
|
</el-breadcrumb> |
|
|
<div class="mainCon"> |
|
|
<div class="mainCon"> |
|
|
|
|
|
|
|
|
<div class="list"> |
|
|
<div class="list"> |
|
|
<el-form |
|
|
<el-form |
|
|
:model="queryParams" |
|
|
:model="queryParams" |
|
@ -105,7 +104,7 @@ |
|
|
>搜索</el-button |
|
|
>搜索</el-button |
|
|
> --> |
|
|
> --> |
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery" |
|
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery" |
|
|
>重置</el-button |
|
|
>重置</el-button |
|
|
> |
|
|
> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
@ -118,7 +117,7 @@ |
|
|
size="mini" |
|
|
size="mini" |
|
|
@click="handleAdd" |
|
|
@click="handleAdd" |
|
|
v-hasPermi="['yg:dikeMark:add']" |
|
|
v-hasPermi="['yg:dikeMark:add']" |
|
|
>新增</el-button |
|
|
>新增</el-button |
|
|
> |
|
|
> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="1.5"> |
|
|
<el-col :span="1.5"> |
|
@ -129,7 +128,7 @@ |
|
|
:disabled="single" |
|
|
:disabled="single" |
|
|
@click="handleUpdate" |
|
|
@click="handleUpdate" |
|
|
v-hasPermi="['yg:dikeMark:edit']" |
|
|
v-hasPermi="['yg:dikeMark:edit']" |
|
|
>修改</el-button |
|
|
>修改</el-button |
|
|
> |
|
|
> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="1.5"> |
|
|
<el-col :span="1.5"> |
|
@ -140,7 +139,7 @@ |
|
|
:disabled="multiple" |
|
|
:disabled="multiple" |
|
|
@click="handleDelete" |
|
|
@click="handleDelete" |
|
|
v-hasPermi="['yg:dikeMark:remove']" |
|
|
v-hasPermi="['yg:dikeMark:remove']" |
|
|
>删除</el-button |
|
|
>删除</el-button |
|
|
> |
|
|
> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<right-toolbar |
|
|
<right-toolbar |
|
@ -235,7 +234,7 @@ |
|
|
icon="el-icon-edit" |
|
|
icon="el-icon-edit" |
|
|
@click="handleUpdate(scope.row)" |
|
|
@click="handleUpdate(scope.row)" |
|
|
v-hasPermi="['yg:dikeMark:edit']" |
|
|
v-hasPermi="['yg:dikeMark:edit']" |
|
|
>修改</el-button |
|
|
>修改</el-button |
|
|
> |
|
|
> |
|
|
<el-button |
|
|
<el-button |
|
|
size="mini" |
|
|
size="mini" |
|
@ -243,7 +242,7 @@ |
|
|
icon="el-icon-delete" |
|
|
icon="el-icon-delete" |
|
|
@click="handleDelete(scope.row)" |
|
|
@click="handleDelete(scope.row)" |
|
|
v-hasPermi="['yg:dikeMark:remove']" |
|
|
v-hasPermi="['yg:dikeMark:remove']" |
|
|
>删除</el-button |
|
|
>删除</el-button |
|
|
> |
|
|
> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
@ -297,249 +296,115 @@ |
|
|
</el-col> |
|
|
</el-col> |
|
|
</el-form> |
|
|
</el-form> |
|
|
</el-row> |
|
|
</el-row> |
|
|
<!-- ========================水闸公告类======================== --> |
|
|
|
|
|
<div class="listTitle" style="margin-top: 0"> |
|
|
|
|
|
<span>堤防公告类</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="noticePart" ref="noticePart"> |
|
|
|
|
|
<template v-for="(item, index) in counter0"> |
|
|
|
|
|
<markForm |
|
|
|
|
|
:ref="'noticeForm' + index" |
|
|
|
|
|
:key="item + index" |
|
|
|
|
|
:editItem="item" |
|
|
|
|
|
:status="isEdit" |
|
|
|
|
|
:formName="'noticeForm'" |
|
|
|
|
|
:rules="rules" |
|
|
|
|
|
:markTypeOptions="markTypeOptions1" |
|
|
|
|
|
:isFirst="index == 0 ? isFirst : false" |
|
|
|
|
|
:addForm="addForm" |
|
|
|
|
|
:index="index" |
|
|
|
|
|
:type="0" |
|
|
|
|
|
:comForm="comForm" |
|
|
|
|
|
@delForm="delForm" |
|
|
|
|
|
/> |
|
|
|
|
|
</template> |
|
|
|
|
|
</div> |
|
|
|
|
|
<!-- ========================水闸警告类======================== --> |
|
|
|
|
|
<div class="listTitle" style="margin-top: 0"> |
|
|
|
|
|
<span>堤防警告类</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="warnPart" ref="warnPart"> |
|
|
|
|
|
<template v-for="(item, index) in counter1"> |
|
|
|
|
|
<markForm |
|
|
|
|
|
:ref="'warnForm' + index" |
|
|
|
|
|
:key="item + index" |
|
|
|
|
|
:editItem="item" |
|
|
|
|
|
:status="isEdit" |
|
|
|
|
|
:formName="'warnForm'" |
|
|
|
|
|
:rules="rules" |
|
|
|
|
|
:markTypeOptions="markTypeOptions2" |
|
|
|
|
|
:isFirst="index == 0 ? isFirst : false" |
|
|
|
|
|
:addForm="addForm" |
|
|
|
|
|
:index="index" |
|
|
|
|
|
:type="1" |
|
|
|
|
|
:comForm="comForm" |
|
|
|
|
|
@delForm="delForm" |
|
|
|
|
|
/> |
|
|
|
|
|
</template> |
|
|
|
|
|
<!-- <el-row :gutter="15"> |
|
|
|
|
|
<el-form |
|
|
|
|
|
ref="warnForm" |
|
|
|
|
|
:model="warnForm" |
|
|
|
|
|
:rules="rules" |
|
|
|
|
|
label-width="80px" |
|
|
|
|
|
> |
|
|
|
|
|
<el-col :span="12"> |
|
|
|
|
|
<el-form-item label="标志名称" prop="markName"> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="warnForm.markName" |
|
|
|
|
|
placeholder="请输入标志名称" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="12"> |
|
|
|
|
|
<el-form-item label="标识位置" prop="markLocation"> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="warnForm.markLocation" |
|
|
|
|
|
placeholder="请输入标识位置" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="12"> |
|
|
|
|
|
<el-form-item label="标识类型" prop="markType"> |
|
|
|
|
|
<el-select |
|
|
|
|
|
v-model="warnForm.markType" |
|
|
|
|
|
placeholder="请选择标识类型" |
|
|
|
|
|
style="width: 100%" |
|
|
|
|
|
> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="dict in markTypeOptions2" |
|
|
|
|
|
:key="dict.dictValue" |
|
|
|
|
|
:label="dict.dictLabel" |
|
|
|
|
|
:value="dict.dictValue" |
|
|
|
|
|
></el-option> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="12"> |
|
|
|
|
|
<el-form-item label="上传图片" prop="photo"> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="warnForm.photo" |
|
|
|
|
|
placeholder="请输入上传图片" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
</el-form> |
|
|
|
|
|
</el-row> --> |
|
|
|
|
|
</div> |
|
|
|
|
|
<!-- ========================水闸指引类======================== --> |
|
|
|
|
|
<div class="listTitle" style="margin-top: 0"> |
|
|
|
|
|
<span>堤防指引类</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="guidePart"> |
|
|
|
|
|
<template v-for="(item, index) in counter2"> |
|
|
|
|
|
<markForm |
|
|
|
|
|
:ref="'guideForm' + index" |
|
|
|
|
|
:key="item + index" |
|
|
|
|
|
:editItem="item" |
|
|
|
|
|
:status="isEdit" |
|
|
|
|
|
:formName="'guideForm'" |
|
|
|
|
|
:rules="rules" |
|
|
|
|
|
:markTypeOptions="markTypeOptions3" |
|
|
|
|
|
:isFirst="index == 0 ? isFirst : false" |
|
|
|
|
|
:addForm="addForm" |
|
|
|
|
|
:index="index" |
|
|
|
|
|
:type="2" |
|
|
|
|
|
:comForm="comForm" |
|
|
|
|
|
@delForm="delForm" |
|
|
|
|
|
/> |
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<!-- <el-row :gutter="15"> |
|
|
<div class="biaopai-wrap"> |
|
|
<el-form |
|
|
<div class="tabs"> |
|
|
ref="guideForm" |
|
|
<el-tabs v-model="activeName" @tab-click="handleClick"> |
|
|
:model="guideForm" |
|
|
<el-tab-pane |
|
|
:rules="rules" |
|
|
v-for="item in tabsOpt" |
|
|
label-width="80px" |
|
|
:key="item.type" |
|
|
> |
|
|
:label="`${item.label}(${getCounterLen(item.type)})`" |
|
|
<el-col :span="12"> |
|
|
:name="item.name" |
|
|
<el-form-item label="标志名称" prop="markName"> |
|
|
></el-tab-pane> |
|
|
<el-input |
|
|
</el-tabs> |
|
|
v-model="guideForm.markName" |
|
|
</div> |
|
|
placeholder="请输入标志名称" |
|
|
<div class="form-wrap"> |
|
|
/> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="12"> |
|
|
|
|
|
<el-form-item label="标识位置" prop="markLocation"> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="guideForm.markLocation" |
|
|
|
|
|
placeholder="请输入标识位置" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="12"> |
|
|
|
|
|
<el-form-item label="标识类型" prop="markType"> |
|
|
|
|
|
<el-select |
|
|
|
|
|
v-model="guideForm.markType" |
|
|
|
|
|
placeholder="请选择标识类型" |
|
|
|
|
|
style="width: 100%" |
|
|
|
|
|
> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="dict in markTypeOptions3" |
|
|
|
|
|
:key="dict.dictValue" |
|
|
|
|
|
:label="dict.dictLabel" |
|
|
|
|
|
:value="dict.dictValue" |
|
|
|
|
|
></el-option> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
<el-col :span="12"> |
|
|
|
|
|
<el-form-item label="上传图片" prop="photo"> |
|
|
|
|
|
<el-input |
|
|
|
|
|
v-model="guideForm.photo" |
|
|
|
|
|
placeholder="请输入上传图片" |
|
|
|
|
|
/> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-col> |
|
|
|
|
|
</el-form> |
|
|
|
|
|
</el-row> --> |
|
|
|
|
|
</div> |
|
|
|
|
|
<!-- ========================水闸名称类======================== --> |
|
|
|
|
|
<div class="listTitle" style="margin-top: 0"> |
|
|
|
|
|
<span>堤防名称类</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="namePart"> |
|
|
|
|
|
<template v-for="(item, index) in counter3"> |
|
|
|
|
|
<markForm |
|
|
<markForm |
|
|
:ref="'nameForm' + index" |
|
|
ref="markForm" |
|
|
:key="item + index" |
|
|
|
|
|
:editItem="item" |
|
|
|
|
|
:status="isEdit" |
|
|
:status="isEdit" |
|
|
:formName="'nameForm'" |
|
|
:formName="getTabsOpt.name" |
|
|
:rules="rules" |
|
|
:rules="rules" |
|
|
:markTypeOptions="markTypeOptions4" |
|
|
:markTypeOptions="getTabsOpt.markTypeOptions" |
|
|
:isFirst="index == 0 ? isFirst : false" |
|
|
:isFirst="true" |
|
|
:addForm="addForm" |
|
|
:addForm="addForm1" |
|
|
:index="index" |
|
|
:type="getTabsOpt.type" |
|
|
:type="3" |
|
|
:editItem="editItem" |
|
|
|
|
|
:rowIsEdit="rowIsEdit" |
|
|
:comForm="comForm" |
|
|
:comForm="comForm" |
|
|
@delForm="delForm" |
|
|
@delForm="delForm" |
|
|
/> |
|
|
/> |
|
|
</template> |
|
|
</div> |
|
|
|
|
|
<div class="table-wrap"> |
|
|
<!-- <el-row :gutter="15"> |
|
|
<el-table |
|
|
<el-form |
|
|
:data=" |
|
|
ref="nameForm" |
|
|
getDialogTabelData.filter( |
|
|
:model="nameForm" |
|
|
(data) => |
|
|
:rules="rules" |
|
|
!search || |
|
|
label-width="80px" |
|
|
data.markName.toLowerCase().includes(search.toLowerCase()) |
|
|
> |
|
|
) |
|
|
<el-col :span="12"> |
|
|
" |
|
|
<el-form-item label="标志名称" prop="markName"> |
|
|
border |
|
|
<el-input |
|
|
style="width: 100%" |
|
|
v-model="nameForm.markName" |
|
|
height="290" |
|
|
placeholder="请输入标志名称" |
|
|
> |
|
|
/> |
|
|
<el-table-column prop="markName" label="标志名称" width="250"> |
|
|
</el-form-item> |
|
|
</el-table-column> |
|
|
</el-col> |
|
|
<el-table-column |
|
|
<el-col :span="12"> |
|
|
prop="markLocation" |
|
|
<el-form-item label="标识位置" prop="markLocation"> |
|
|
label="标识位置" |
|
|
<el-input |
|
|
width="200" |
|
|
v-model="nameForm.markLocation" |
|
|
> |
|
|
placeholder="请输入标识位置" |
|
|
</el-table-column> |
|
|
/> |
|
|
<el-table-column prop="markType" label="标识类型"> |
|
|
</el-form-item> |
|
|
<template slot-scope="scope"> |
|
|
</el-col> |
|
|
{{ formatType(scope.row) }} |
|
|
<el-col :span="12"> |
|
|
</template> |
|
|
<el-form-item label="标识类型" prop="markType"> |
|
|
</el-table-column> |
|
|
<el-select |
|
|
<el-table-column prop="photo" label="图片文件"> |
|
|
v-model="nameForm.markType" |
|
|
<template slot-scope="scope"> |
|
|
placeholder="请选择标识类型" |
|
|
{{ JSON.parse(scope.row.photo).length ? "已上传" : "" }} |
|
|
style="width: 100%" |
|
|
</template> |
|
|
> |
|
|
</el-table-column> |
|
|
<el-option |
|
|
<el-table-column |
|
|
v-for="dict in markTypeOptions4" |
|
|
label="操作" |
|
|
:key="dict.dictValue" |
|
|
align="center" |
|
|
:label="dict.dictLabel" |
|
|
class-name="small-padding fixed-width" |
|
|
:value="dict.dictValue" |
|
|
width="220" |
|
|
></el-option> |
|
|
fixed="right" |
|
|
</el-select> |
|
|
> |
|
|
</el-form-item> |
|
|
<template slot="header" slot-scope="scope"> |
|
|
</el-col> |
|
|
<el-input |
|
|
<el-col :span="12"> |
|
|
v-model="search" |
|
|
<el-form-item label="上传图片" prop="photo"> |
|
|
size="mini" |
|
|
<el-input |
|
|
placeholder="输入标志名称搜索" |
|
|
v-model="nameForm.photo" |
|
|
clearable |
|
|
placeholder="请输入上传图片" |
|
|
/> |
|
|
/> |
|
|
</template> |
|
|
</el-form-item> |
|
|
<template slot-scope="scope"> |
|
|
</el-col> |
|
|
<el-button |
|
|
</el-form> |
|
|
size="mini" |
|
|
</el-row> --> |
|
|
type="text" |
|
|
|
|
|
icon="el-icon-edit" |
|
|
|
|
|
@click=" |
|
|
|
|
|
handleDialogUpdate( |
|
|
|
|
|
scope.row, |
|
|
|
|
|
scope.column, |
|
|
|
|
|
scope.$index |
|
|
|
|
|
) |
|
|
|
|
|
" |
|
|
|
|
|
>修改</el-button |
|
|
|
|
|
> |
|
|
|
|
|
<el-button |
|
|
|
|
|
size="mini" |
|
|
|
|
|
type="text" |
|
|
|
|
|
icon="el-icon-delete" |
|
|
|
|
|
@click=" |
|
|
|
|
|
handleDialogDelete( |
|
|
|
|
|
scope.row, |
|
|
|
|
|
scope.column, |
|
|
|
|
|
scope.$index |
|
|
|
|
|
) |
|
|
|
|
|
" |
|
|
|
|
|
>删除</el-button |
|
|
|
|
|
> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
</el-table> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
<div slot="footer" class="dialog-footer"> |
|
|
<el-button type="primary" @click="submitForm">确 定</el-button> |
|
|
<el-button type="primary" @click="submitForm1">确 定</el-button> |
|
|
<el-button @click="cancel">取 消</el-button> |
|
|
<el-button @click="cancel">取 消</el-button> |
|
|
</div> |
|
|
</div> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
@ -606,7 +471,7 @@ export default { |
|
|
// 弹出层标题 |
|
|
// 弹出层标题 |
|
|
title: "", |
|
|
title: "", |
|
|
// 是否显示弹出层 |
|
|
// 是否显示弹出层 |
|
|
open: false, |
|
|
open: true, |
|
|
// 标牌类型字典 |
|
|
// 标牌类型字典 |
|
|
typeOptions: [], |
|
|
typeOptions: [], |
|
|
// 标识类型字典 |
|
|
// 标识类型字典 |
|
@ -658,13 +523,66 @@ export default { |
|
|
}, |
|
|
}, |
|
|
dikeNameOptions: [], |
|
|
dikeNameOptions: [], |
|
|
isEdit: false, |
|
|
isEdit: false, |
|
|
counter0: [{}], |
|
|
counter0: [], |
|
|
counter1: [{}], |
|
|
counter1: [], |
|
|
counter2: [{}], |
|
|
counter2: [], |
|
|
counter3: [{}], |
|
|
counter3: [], |
|
|
delIdList: [], |
|
|
delIdList: [], |
|
|
|
|
|
activeName: "noticeForm", |
|
|
|
|
|
editItem: {}, |
|
|
|
|
|
editIndex: null, |
|
|
|
|
|
rowIsEdit: false, |
|
|
|
|
|
search: "", |
|
|
}; |
|
|
}; |
|
|
}, |
|
|
}, |
|
|
|
|
|
computed: { |
|
|
|
|
|
tabsOpt() { |
|
|
|
|
|
return [ |
|
|
|
|
|
{ |
|
|
|
|
|
label: "堤防公告类", |
|
|
|
|
|
name: "noticeForm", |
|
|
|
|
|
type: 0, |
|
|
|
|
|
markTypeOptions: this.markTypeOptions1, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
label: "堤防警告类", |
|
|
|
|
|
name: "warnForm", |
|
|
|
|
|
type: 1, |
|
|
|
|
|
markTypeOptions: this.markTypeOptions2, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
label: "堤防指引类", |
|
|
|
|
|
name: "guideForm", |
|
|
|
|
|
type: 2, |
|
|
|
|
|
markTypeOptions: this.markTypeOptions3, |
|
|
|
|
|
}, |
|
|
|
|
|
{ |
|
|
|
|
|
label: "堤防名称类", |
|
|
|
|
|
name: "nameForm", |
|
|
|
|
|
type: 3, |
|
|
|
|
|
markTypeOptions: this.markTypeOptions4, |
|
|
|
|
|
}, |
|
|
|
|
|
]; |
|
|
|
|
|
}, |
|
|
|
|
|
getTabsOpt() { |
|
|
|
|
|
return this.tabsOpt.filter((item) => { |
|
|
|
|
|
return item.name === this.activeName; |
|
|
|
|
|
})[0]; |
|
|
|
|
|
}, |
|
|
|
|
|
getDialogTabelData() { |
|
|
|
|
|
return this[`counter${this.getTabsOpt.type}`]; |
|
|
|
|
|
// switch (this.activeName) { |
|
|
|
|
|
// case "noticeForm": |
|
|
|
|
|
// return this.counter0; |
|
|
|
|
|
// case "noticeForm": |
|
|
|
|
|
// return this.counter0; |
|
|
|
|
|
// case "noticeForm": |
|
|
|
|
|
// return this.counter0; |
|
|
|
|
|
// case "noticeForm": |
|
|
|
|
|
// return this.counter0; |
|
|
|
|
|
// } |
|
|
|
|
|
}, |
|
|
|
|
|
}, |
|
|
created() { |
|
|
created() { |
|
|
this.getList(); |
|
|
this.getList(); |
|
|
this.getDicts("breastplate_type").then((response) => { |
|
|
this.getDicts("breastplate_type").then((response) => { |
|
@ -691,6 +609,47 @@ export default { |
|
|
// this.counter1[0] = this.noticeForm; |
|
|
// this.counter1[0] = this.noticeForm; |
|
|
// }, |
|
|
// }, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
formatType(row) { |
|
|
|
|
|
console.log("row", row); |
|
|
|
|
|
|
|
|
|
|
|
let { type, markType } = row; |
|
|
|
|
|
if (markType) { |
|
|
|
|
|
const markTypeOptions = "markTypeOptions" + (parseInt(type) + 1); |
|
|
|
|
|
return this[markTypeOptions].filter((item) => { |
|
|
|
|
|
return item.dictValue == markType; |
|
|
|
|
|
})[0].dictLabel; |
|
|
|
|
|
} else { |
|
|
|
|
|
return "--"; |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
handleDialogUpdate(row, col, index) { |
|
|
|
|
|
console.log("row", row, col, index); |
|
|
|
|
|
this.rowIsEdit = true; |
|
|
|
|
|
this.editIndex = index; |
|
|
|
|
|
this.editItem = JSON.parse(JSON.stringify(row)); |
|
|
|
|
|
}, |
|
|
|
|
|
handleDialogDelete(row, col, index) { |
|
|
|
|
|
let { type } = row; |
|
|
|
|
|
const counterType = "counter" + type; |
|
|
|
|
|
this.$confirm("是否删除选中的数据?", "警告", { |
|
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
|
cancelButtonText: "取消", |
|
|
|
|
|
type: "warning", |
|
|
|
|
|
}) |
|
|
|
|
|
.then(() => { |
|
|
|
|
|
console.log("删除", row, index); |
|
|
|
|
|
this[counterType].splice(index, 1); |
|
|
|
|
|
}) |
|
|
|
|
|
.catch(function () {}); |
|
|
|
|
|
}, |
|
|
|
|
|
getCounterLen(type) { |
|
|
|
|
|
const counterType = "counter" + type; |
|
|
|
|
|
return this[counterType].length; |
|
|
|
|
|
}, |
|
|
|
|
|
handleClick() { |
|
|
|
|
|
this.search = ""; |
|
|
|
|
|
this.$refs.markForm.resetForm(); |
|
|
|
|
|
}, |
|
|
formatAdcd(row) { |
|
|
formatAdcd(row) { |
|
|
if (row.adcd) { |
|
|
if (row.adcd) { |
|
|
let provinceCode = row.adcd.slice(0, 2); |
|
|
let provinceCode = row.adcd.slice(0, 2); |
|
@ -713,6 +672,19 @@ export default { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
addForm1(rowData) { |
|
|
|
|
|
console.log("rowData", rowData); |
|
|
|
|
|
let { type, formData } = rowData; |
|
|
|
|
|
const counterType = "counter" + type; |
|
|
|
|
|
console.log(formData); |
|
|
|
|
|
|
|
|
|
|
|
if (this.rowIsEdit) { |
|
|
|
|
|
this[counterType].splice(this.editIndex, 1, formData); |
|
|
|
|
|
this.rowIsEdit = false; |
|
|
|
|
|
} else { |
|
|
|
|
|
this[counterType].push(formData); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
addForm(index, type, formName) { |
|
|
addForm(index, type, formName) { |
|
|
console.log("index和type", index, type); |
|
|
console.log("index和type", index, type); |
|
|
const counterType = "counter" + type; |
|
|
const counterType = "counter" + type; |
|
@ -837,10 +809,10 @@ export default { |
|
|
// 表单重置 |
|
|
// 表单重置 |
|
|
reset() { |
|
|
reset() { |
|
|
this.delIdList = []; |
|
|
this.delIdList = []; |
|
|
this.counter0 = [{}]; |
|
|
this.counter0 = []; |
|
|
this.counter1 = [{}]; |
|
|
this.counter1 = []; |
|
|
this.counter2 = [{}]; |
|
|
this.counter2 = []; |
|
|
this.counter3 = [{}]; |
|
|
this.counter3 = []; |
|
|
this.comForm = { |
|
|
this.comForm = { |
|
|
dikeName: null, |
|
|
dikeName: null, |
|
|
dikeCode: null, |
|
|
dikeCode: null, |
|
@ -1001,13 +973,13 @@ export default { |
|
|
this.comForm.adcd = response.data[0].adcd; |
|
|
this.comForm.adcd = response.data[0].adcd; |
|
|
console.log("this.comForm", this.comForm); |
|
|
console.log("this.comForm", this.comForm); |
|
|
this.counter0 = response.data.filter((item) => item.type == 0); |
|
|
this.counter0 = response.data.filter((item) => item.type == 0); |
|
|
if (this.counter0.length == 0) this.counter0 = [{}]; |
|
|
if (this.counter0.length == 0) this.counter0 = []; |
|
|
this.counter1 = response.data.filter((item) => item.type == 1); |
|
|
this.counter1 = response.data.filter((item) => item.type == 1); |
|
|
if (this.counter1.length == 0) this.counter1 = [{}]; |
|
|
if (this.counter1.length == 0) this.counter1 = []; |
|
|
this.counter2 = response.data.filter((item) => item.type == 2); |
|
|
this.counter2 = response.data.filter((item) => item.type == 2); |
|
|
if (this.counter2.length == 0) this.counter2 = [{}]; |
|
|
if (this.counter2.length == 0) this.counter2 = []; |
|
|
this.counter3 = response.data.filter((item) => item.type == 3); |
|
|
this.counter3 = response.data.filter((item) => item.type == 3); |
|
|
if (this.counter3.length == 0) this.counter3 = [{}]; |
|
|
if (this.counter3.length == 0) this.counter3 = []; |
|
|
console.log("回显的数据时的counter0", this.counter0); |
|
|
console.log("回显的数据时的counter0", this.counter0); |
|
|
console.log("回显的数据时的counter1", this.counter1); |
|
|
console.log("回显的数据时的counter1", this.counter1); |
|
|
console.log("回显的数据时的counter2", this.counter2); |
|
|
console.log("回显的数据时的counter2", this.counter2); |
|
@ -1017,6 +989,73 @@ export default { |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
/** 提交按钮 */ |
|
|
/** 提交按钮 */ |
|
|
|
|
|
submitForm1() { |
|
|
|
|
|
let isAllTrue = |
|
|
|
|
|
this.counter0.length || |
|
|
|
|
|
this.counter1.length || |
|
|
|
|
|
this.counter2.length || |
|
|
|
|
|
this.counter3.length |
|
|
|
|
|
? true |
|
|
|
|
|
: false; |
|
|
|
|
|
|
|
|
|
|
|
this.$refs["comForm"].validate((valid0) => { |
|
|
|
|
|
if (valid0) { |
|
|
|
|
|
if (!isAllTrue) { |
|
|
|
|
|
this.msgError("堤防标识标牌列表数据为空"); |
|
|
|
|
|
return; |
|
|
|
|
|
} |
|
|
|
|
|
this.counter0.forEach((item) => { |
|
|
|
|
|
if (item) { |
|
|
|
|
|
item = { ...item, ...this.comForm }; |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
this.counter1.forEach((item) => { |
|
|
|
|
|
if (item) { |
|
|
|
|
|
item = { ...item, ...this.comForm }; |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
this.counter2.forEach((item) => { |
|
|
|
|
|
if (item) { |
|
|
|
|
|
item = { ...item, ...this.comForm }; |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
this.counter3.forEach((item) => { |
|
|
|
|
|
if (item) { |
|
|
|
|
|
item = { ...item, ...this.comForm }; |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
if (this.isEdit) { |
|
|
|
|
|
updateDikeMark([ |
|
|
|
|
|
...this.counter0, |
|
|
|
|
|
...this.counter1, |
|
|
|
|
|
...this.counter2, |
|
|
|
|
|
...this.counter3, |
|
|
|
|
|
]).then((response) => { |
|
|
|
|
|
if (response.code === 200) { |
|
|
|
|
|
this.msgSuccess("修改成功"); |
|
|
|
|
|
this.open = false; |
|
|
|
|
|
this.getList(); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
if (this.delIdList.length > 0) delDikeMark(this.delIdList); |
|
|
|
|
|
} else { |
|
|
|
|
|
addDikeMark([ |
|
|
|
|
|
...this.counter0, |
|
|
|
|
|
...this.counter1, |
|
|
|
|
|
...this.counter2, |
|
|
|
|
|
...this.counter3, |
|
|
|
|
|
]).then((response) => { |
|
|
|
|
|
if (response.code === 200) { |
|
|
|
|
|
this.msgSuccess("新增成功"); |
|
|
|
|
|
this.open = false; |
|
|
|
|
|
this.getList(); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
submitForm() { |
|
|
submitForm() { |
|
|
// console.log(1111111111, this.$refs.noticeForm0[0].$refs.form); |
|
|
// console.log(1111111111, this.$refs.noticeForm0[0].$refs.form); |
|
|
// 表单校验 |
|
|
// 表单校验 |
|
@ -1065,26 +1104,26 @@ export default { |
|
|
this.counter0.length > 1 |
|
|
this.counter0.length > 1 |
|
|
? this.counter0 |
|
|
? this.counter0 |
|
|
: this.$refs["noticeForm0"][0].form.markName |
|
|
: this.$refs["noticeForm0"][0].form.markName |
|
|
? [this.$refs["noticeForm0"][0].form] |
|
|
? [this.$refs["noticeForm0"][0].form] |
|
|
: []; |
|
|
: []; |
|
|
const C1 = |
|
|
const C1 = |
|
|
this.counter1.length > 1 |
|
|
this.counter1.length > 1 |
|
|
? this.counter1 |
|
|
? this.counter1 |
|
|
: this.$refs["warnForm0"][0].form.markName |
|
|
: this.$refs["warnForm0"][0].form.markName |
|
|
? [this.$refs["warnForm0"][0].form] |
|
|
? [this.$refs["warnForm0"][0].form] |
|
|
: []; |
|
|
: []; |
|
|
const C2 = |
|
|
const C2 = |
|
|
this.counter2.length > 1 |
|
|
this.counter2.length > 1 |
|
|
? this.counter2 |
|
|
? this.counter2 |
|
|
: this.$refs["guideForm0"][0].form.markName |
|
|
: this.$refs["guideForm0"][0].form.markName |
|
|
? [this.$refs["guideForm0"][0].form] |
|
|
? [this.$refs["guideForm0"][0].form] |
|
|
: []; |
|
|
: []; |
|
|
const C3 = |
|
|
const C3 = |
|
|
this.counter3.length > 1 |
|
|
this.counter3.length > 1 |
|
|
? this.counter3 |
|
|
? this.counter3 |
|
|
: this.$refs["nameForm0"][0].form.markName |
|
|
: this.$refs["nameForm0"][0].form.markName |
|
|
? [this.$refs["nameForm0"][0].form] |
|
|
? [this.$refs["nameForm0"][0].form] |
|
|
: []; |
|
|
: []; |
|
|
|
|
|
|
|
|
// console.log("C0C0", C0, C1); |
|
|
// console.log("C0C0", C0, C1); |
|
|
if (this.isEdit) { |
|
|
if (this.isEdit) { |
|
|