优化代码

This commit is contained in:
java110 2022-09-13 12:04:00 +08:00
parent 6e6f21fa29
commit 9669e1a409
4 changed files with 164 additions and 102 deletions

View File

@ -0,0 +1,29 @@
<div class="modal fade" id="deleteVisitModel" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">
<span><vc:i18n name="请确认您的操作" namespace="deleteVisit"></vc:i18n></span>!
</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<tr align="center">
<th>
<span><vc:i18n name="确认是否删除" namespace="deleteVisit"></vc:i18n></span>!
</th>
</tr>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">
<span><vc:i18n name="点错了" namespace="deleteVisit"></vc:i18n></span>
</button>
<button type="button" class="btn btn-primary" v-on:click="deleteVisit()">
<span><vc:i18n name="确认删除" namespace="deleteVisit"></vc:i18n></span>
</button>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,45 @@
(function(vc) {
vc.extends({
data: {
deleteVisitInfo: {}
},
_initEvent: function() {
vc.on('deleteVisit', 'openVisitModel', function(_visitInfo) {
vc.component.deleteVisitInfo = _visitInfo;
$('#deleteVisitModel').modal('show');
});
},
methods: {
closeDeleteVisitModel: function() {
$('#deleteVisitModel').modal('hide');
},
deleteVisit: function() {
vc.component.deleteVisitInfo.communityId = vc.getCurrentCommunity().communityId;
vc.http.apiPost(
'/visit.deleteVisit',
JSON.stringify(vc.component.deleteVisitInfo), {
emulateJSON: true
},
function(json, res) {
let _json = JSON.parse(json);
if (_json.code == 0) {
//关闭model
$('#deleteVisitModel').modal('hide');
vc.emit('appManage', 'listApp', {});
vc.toast("删除成功");
return;
} else {
vc.toast(_json.msg);
}
},
function(errInfo, error) {
console.log('请求失败处理');
vc.toast(errInfo);
}
);
}
}
});
})(window.vc);

View File

@ -24,7 +24,7 @@
<thead>
<tr>
<th class="text-center"><span><vc:i18n name="抓拍图" namespace="parkingAreaControlCarInouts"></vc:i18n></span></th>
<th class="text-center"><span><vc:i18n name="开闸时间" namespace="parkingAreaControlManualOpenDoorLog"></vc:i18n></span>ID</th>
<th class="text-center"><span><vc:i18n name="开闸时间" namespace="parkingAreaControlManualOpenDoorLog"></vc:i18n></span></th>
<th class="text-center"><span><vc:i18n name="员工" namespace="parkingAreaControlManualOpenDoorLog"></vc:i18n></span></th>
<th class="text-center"><span><vc:i18n name="摄像头名称" namespace="parkingAreaControlManualOpenDoorLog"></vc:i18n></span></th>
</tr>
@ -32,7 +32,7 @@
<tbody>
<tr v-for="log in parkingAreaControlManualOpenDoorLog.logs">
<td class="text-center" style="white-space: nowrap;">
<img style="width: 60px; height: 60px;" class="border-radius" v-if="carIn.photoJpg" v-bind:src="log.photoJpg" v-on:click="_openDoorLogOpenFile(log.photoJpg)" />
<img style="width: 60px; height: 60px;" class="border-radius" v-if="log.photoJpg" v-bind:src="log.photoJpg" v-on:click="_openDoorLogOpenFile(log.photoJpg)" />
<img style="width: 60px; height: 60px;" class="border-radius" v-else src="/img/noPhoto.jpg" />
</td>
<td class="text-center">{{log.createTime}}</td>

View File

@ -16,36 +16,28 @@
<div class="row">
<div class="col-sm-3">
<div class="form-group">
<input type="text" :placeholder="vc.i18n('请填写来访人姓名','visitManage')" class="form-control"
v-model="appManageInfo.conditions.vName">
<input type="text" :placeholder="vc.i18n('请填写来访人姓名','visitManage')" class="form-control" v-model="appManageInfo.conditions.vName">
</div>
</div>
<div class="col-sm-4">
<div class="form-group input-group">
<input type="text" :placeholder="vc.i18n('请选择来访开始时间','visitManage')"
v-model="appManageInfo.conditions.visitStartTime"
class=" form-control visitStartTime">
<input type="text" :placeholder="vc.i18n('请选择来访开始时间','visitManage')" v-model="appManageInfo.conditions.visitStartTime" class=" form-control visitStartTime">
</div>
</div>
<div class="col-sm-3">
<div class="form-group input-group">
<input type="text" :placeholder="vc.i18n('请选择来访结束时间','visitManage')"
v-model="appManageInfo.conditions.visitEndTime"
class=" form-control visitEndTime">
<input type="text" :placeholder="vc.i18n('请选择来访结束时间','visitManage')" v-model="appManageInfo.conditions.visitEndTime" class=" form-control visitEndTime">
</div>
</div>
<div class="col-sm-2">
<button type="button" class="btn btn-primary btn-sm"
v-on:click="_queryAppManageInfoMethod()">
<button type="button" class="btn btn-primary btn-sm" v-on:click="_queryAppManageInfoMethod()">
<i class="fa fa-search"></i> <span><vc:i18n name="查询" namespace="visitManage"></vc:i18n></span>
</button>
<button type="button" class="btn btn-primary btn-sm"
v-on:click="_resetAppManageInfoMethod()">
<button type="button" class="btn btn-primary btn-sm" v-on:click="_resetAppManageInfoMethod()">
<i class="fa fa-repeat"></i> <span><vc:i18n name="重置" namespace="visitManage"></vc:i18n></span>
</button>
<div class="ibox-tools" style="top:0px;">
<button type="button" class="btn btn-link btn-sm" style="margin-right:10px;"
v-on:click="_moreCondition()">
<button type="button" class="btn btn-link btn-sm" style="margin-right:10px;" v-on:click="_moreCondition()">
{{appManageInfo.moreCondition == true?'隐藏':'更多'}}
</button>
</div>
@ -54,8 +46,7 @@
<div class="row" v-show="appManageInfo.moreCondition == true">
<div class="col-sm-3">
<div class="form-group">
<input type="text" :placeholder="vc.i18n('请填写访客联系方式','visitManage')"
class="form-control" v-model="appManageInfo.conditions.phoneNumber">
<input type="text" :placeholder="vc.i18n('请填写访客联系方式','visitManage')" class="form-control" v-model="appManageInfo.conditions.phoneNumber">
</div>
</div>
</div>
@ -63,98 +54,95 @@
<div class="ibox-content">
<table class="footable table table-stripped toggle-arrow-tiny" data-page-size="15">
<thead>
<tr>
<th class="text-center">
<span><vc:i18n name="访客ID" namespace="visitManage"></vc:i18n></span>
</th>
<th class="text-center">
<span><vc:i18n name="照片" namespace="visitManage"></vc:i18n></span>
</th>
<th class="text-center">
<span><vc:i18n name="访客姓名/性别" namespace="visitManage"></vc:i18n></span>
</th>
<th class="text-center">
<span><vc:i18n name="访客联系方式" namespace="visitManage"></vc:i18n></span>
</th>
<th class="text-center">
<span><vc:i18n name="业主姓名" namespace="visitManage"></vc:i18n></span>
</th>
<th class="text-center">
<span><vc:i18n name="来访事由/类型" namespace="visitManage"></vc:i18n></span>
</th>
<th class="text-center">
<span><vc:i18n name="车牌号" namespace="visitManage"></vc:i18n></span>
</th>
<th class="text-center">
<span><vc:i18n name="随行人数" namespace="visitManage"></vc:i18n></span>
</th>
<th class="text-center">
<span><vc:i18n name="创建时间" namespace="visitManage"></vc:i18n></span>
</th>
<th class="text-center">
<span><vc:i18n name="来访/离开时间" namespace="visitManage"></vc:i18n></span>
</th>
<th class="text-center">
<span><vc:i18n name="车辆状态" namespace="visitManage"></vc:i18n></span>
</th>
<th class="text-center">
<span><vc:i18n name="状态" namespace="visitManage"></vc:i18n></span>
</th>
<th class="text-center">
<span><vc:i18n name="操作" namespace="visitManage"></vc:i18n></span>
</th>
</tr>
<tr>
<th class="text-center">
<span><vc:i18n name="访客ID" namespace="visitManage"></vc:i18n></span>
</th>
<th class="text-center">
<span><vc:i18n name="照片" namespace="visitManage"></vc:i18n></span>
</th>
<th class="text-center">
<span><vc:i18n name="访客姓名/性别" namespace="visitManage"></vc:i18n></span>
</th>
<th class="text-center">
<span><vc:i18n name="访客联系方式" namespace="visitManage"></vc:i18n></span>
</th>
<th class="text-center">
<span><vc:i18n name="业主姓名" namespace="visitManage"></vc:i18n></span>
</th>
<th class="text-center">
<span><vc:i18n name="来访事由/类型" namespace="visitManage"></vc:i18n></span>
</th>
<th class="text-center">
<span><vc:i18n name="车牌号" namespace="visitManage"></vc:i18n></span>
</th>
<th class="text-center">
<span><vc:i18n name="随行人数" namespace="visitManage"></vc:i18n></span>
</th>
<th class="text-center">
<span><vc:i18n name="创建时间" namespace="visitManage"></vc:i18n></span>
</th>
<th class="text-center">
<span><vc:i18n name="来访/离开时间" namespace="visitManage"></vc:i18n></span>
</th>
<th class="text-center">
<span><vc:i18n name="车辆状态" namespace="visitManage"></vc:i18n></span>
</th>
<th class="text-center">
<span><vc:i18n name="状态" namespace="visitManage"></vc:i18n></span>
</th>
<th class="text-center">
<span><vc:i18n name="操作" namespace="visitManage"></vc:i18n></span>
</th>
</tr>
</thead>
<tbody>
<tr v-for="visit in appManageInfo.visits">
<td class="text-center">{{visit.vId}}</td>
<td class="text-center">
<div style="position: relative; display: inline-block;" v-on:click="showImg(visit.url)">
<img width="50" height="50" v-bind:src="visit.url?visit.url:'/img/noPhoto.jpg'"
onerror="this.src='/img/noPhoto.jpg';">
<img src="/img/icon-bigimg.png" style="position: absolute;right: 0;bottom: 0;"
width="50" height="50" alt="">
</div>
</td>
<td class="text-center">{{visit.vName}}/{{visit.visitGender=='0'?'男':'女'}}</td>
<td class="text-center">{{visit.phoneNumber}}</td>
<td class="text-center">{{visit.ownerName}}</td>
<td class="text-center">{{visit.visitCase}}({{visit.reasonType == 0 ? '喜事' :
(visit.reasonType == 1 ? '白事' : '-')}})
</td>
<td class="text-center">{{visit.carNum}}</td>
<td class="text-center">{{visit.entourage}}</td>
<td class="text-center">{{visit.createTime}}</td>
<td class="text-center">{{visit.visitTime}}<br/>{{visit.departureTime}}</td>
<td class="text-center">{{visit.stateName}}</td>
<td class="text-center">
{{visit.recordState == 1 ? '已失效' : (visit.recordState == 0 ? '已生效' : '-')}}
</td>
<td class="text-center">
<div class="btn-group" v-if="visit.state == '0' && visit.recordState == '0'">
<button class="btn-white btn btn-xs" v-on:click="_openExamineVisitModel(visit)">
<tr v-for="visit in appManageInfo.visits">
<td class="text-center">{{visit.vId}}</td>
<td class="text-center">
<div style="position: relative; display: inline-block;" v-on:click="showImg(visit.url)">
<img width="50" height="50" v-bind:src="visit.url?visit.url:'/img/noPhoto.jpg'" onerror="this.src='/img/noPhoto.jpg';">
<img src="/img/icon-bigimg.png" style="position: absolute;right: 0;bottom: 0;" width="50" height="50" alt="">
</div>
</td>
<td class="text-center">{{visit.vName}}/{{visit.visitGender=='0'?'男':'女'}}</td>
<td class="text-center">{{visit.phoneNumber}}</td>
<td class="text-center">{{visit.ownerName}}</td>
<td class="text-center">{{visit.visitCase}}({{visit.reasonType == 0 ? '喜事' : (visit.reasonType == 1 ? '白事' : '-')}})
</td>
<td class="text-center">{{visit.carNum}}</td>
<td class="text-center">{{visit.entourage}}</td>
<td class="text-center">{{visit.createTime}}</td>
<td class="text-center">{{visit.visitTime}}<br/>{{visit.departureTime}}</td>
<td class="text-center">{{visit.stateName}}</td>
<td class="text-center">
{{visit.recordState == 1 ? '已失效' : (visit.recordState == 0 ? '已生效' : '-')}}
</td>
<td class="text-center">
<div class="btn-group" v-if="visit.state == '0' && visit.recordState == '0'">
<button class="btn-white btn btn-xs" v-on:click="_openExamineVisitModel(visit)">
<span><vc:i18n name="车辆审核" namespace="visitManage"></vc:i18n></span>
</button>
</div>
<div class="btn-group">
<button class="btn-white btn btn-xs" v-on:click="_openEditVisitModel(visit)">
</div>
<div class="btn-group">
<button class="btn-white btn btn-xs" v-on:click="_openEditVisitModel(visit)">
<span><vc:i18n name="修改" namespace="visitManage"></vc:i18n></span>
</button>
</div>
<div class="btn-group">
<button class="btn-white btn btn-xs" v-on:click="_openDeleteAppModel(visit)">
</div>
<div class="btn-group">
<button class="btn-white btn btn-xs" v-on:click="_openDeleteAppModel(visit)">
<span><vc:i18n name="删除" namespace="visitManage"></vc:i18n></span>
</button>
</div>
</td>
</tr>
</div>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="11">
<ul class="pagination float-right"></ul>
</td>
</tr>
<tr>
<td colspan="11">
<ul class="pagination float-right"></ul>
</td>
</tr>
</tfoot>
</table>
<!-- 分页 -->
@ -165,6 +153,6 @@
</div>
<vc:create path="property/editVisit"></vc:create>
<vc:create path="property/examineVisit"></vc:create>
<vc:create path="dev/deleteApp"></vc:create>
<vc:create path="property/deleteVisit"></vc:create>
<vc:create path="common/viewImage"></vc:create>
</div>
</div>