mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-25 14:17:54 +08:00
优化代码
This commit is contained in:
parent
c2840f5a96
commit
822afc9a73
@ -1,26 +1,24 @@
|
||||
(function (vc, vm) {
|
||||
(function(vc, vm) {
|
||||
vc.extends({
|
||||
data: {
|
||||
deleteParkingBoxInfo: {}
|
||||
},
|
||||
_initMethod: function () {
|
||||
},
|
||||
_initEvent: function () {
|
||||
vc.on('deleteParkingBox', 'openDeleteParkingBoxModal', function (_params) {
|
||||
_initMethod: function() {},
|
||||
_initEvent: function() {
|
||||
vc.on('deleteParkingBox', 'openDeleteParkingBoxModal', function(_params) {
|
||||
vc.component.deleteParkingBoxInfo = _params;
|
||||
$('#deleteParkingBoxModel').modal('show');
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
deleteParkingBox: function () {
|
||||
deleteParkingBox: function() {
|
||||
vc.component.deleteParkingBoxInfo.communityId = vc.getCurrentCommunity().communityId;
|
||||
vc.http.apiPost(
|
||||
'parkingBox.deleteParkingBox',
|
||||
JSON.stringify(vc.component.deleteParkingBoxInfo),
|
||||
{
|
||||
'/parkingBox.deleteParkingBox',
|
||||
JSON.stringify(vc.component.deleteParkingBoxInfo), {
|
||||
emulateJSON: true
|
||||
},
|
||||
function (json, res) {
|
||||
function(json, res) {
|
||||
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
|
||||
let _json = JSON.parse(json);
|
||||
if (_json.code == 0) {
|
||||
@ -33,14 +31,14 @@
|
||||
vc.toast(_json.msg);
|
||||
}
|
||||
},
|
||||
function (errInfo, error) {
|
||||
function(errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
vc.message(json);
|
||||
});
|
||||
},
|
||||
closeDeleteParkingBoxModel: function () {
|
||||
closeDeleteParkingBoxModel: function() {
|
||||
$('#deleteParkingBoxModel').modal('hide');
|
||||
}
|
||||
}
|
||||
});
|
||||
})(window.vc, window.vc.component);
|
||||
})(window.vc, window.vc.component);
|
||||
@ -1,4 +1,4 @@
|
||||
(function (vc, vm) {
|
||||
(function(vc, vm) {
|
||||
vc.extends({
|
||||
data: {
|
||||
editParkingBoxInfo: {
|
||||
@ -13,11 +13,11 @@
|
||||
parkingAreas: []
|
||||
}
|
||||
},
|
||||
_initMethod: function () {
|
||||
_initMethod: function() {
|
||||
$that._loadEditParkingBoxs();
|
||||
},
|
||||
_initEvent: function () {
|
||||
vc.on('editParkingBox', 'openEditParkingBoxModal', function (_params) {
|
||||
_initEvent: function() {
|
||||
vc.on('editParkingBox', 'openEditParkingBoxModal', function(_params) {
|
||||
vc.component.refreshEditParkingBoxInfo();
|
||||
$('#editParkingBoxModel').modal('show');
|
||||
vc.copyObject(_params, vc.component.editParkingBoxInfo);
|
||||
@ -25,12 +25,11 @@
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
editParkingBoxValidate: function () {
|
||||
editParkingBoxValidate: function() {
|
||||
return vc.validate.validate({
|
||||
editParkingBoxInfo: vc.component.editParkingBoxInfo
|
||||
}, {
|
||||
'editParkingBoxInfo.boxName': [
|
||||
{
|
||||
'editParkingBoxInfo.boxName': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "岗亭名称不能为空"
|
||||
@ -41,54 +40,44 @@
|
||||
errInfo: "岗亭名称不能超过64"
|
||||
}
|
||||
],
|
||||
'editParkingBoxInfo.paId': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "停车场不能为空"
|
||||
}
|
||||
],
|
||||
'editParkingBoxInfo.tempCarIn': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "临时车是否进场不能为空"
|
||||
}
|
||||
],
|
||||
'editParkingBoxInfo.fee': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "是否收费不能为空"
|
||||
}
|
||||
],
|
||||
'editParkingBoxInfo.blueCarIn': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "蓝牌车进场不能为空"
|
||||
}
|
||||
],
|
||||
'editParkingBoxInfo.yelowCarIn': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "黄牌车进场不能为空"
|
||||
}
|
||||
]
|
||||
'editParkingBoxInfo.paId': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "停车场不能为空"
|
||||
}],
|
||||
'editParkingBoxInfo.tempCarIn': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "临时车是否进场不能为空"
|
||||
}],
|
||||
'editParkingBoxInfo.fee': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "是否收费不能为空"
|
||||
}],
|
||||
'editParkingBoxInfo.blueCarIn': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "蓝牌车进场不能为空"
|
||||
}],
|
||||
'editParkingBoxInfo.yelowCarIn': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "黄牌车进场不能为空"
|
||||
}]
|
||||
});
|
||||
},
|
||||
editParkingBox: function () {
|
||||
editParkingBox: function() {
|
||||
if (!vc.component.editParkingBoxValidate()) {
|
||||
vc.toast(vc.validate.errInfo);
|
||||
return;
|
||||
}
|
||||
vc.http.apiPost(
|
||||
'parkingBox.updateParkingBox',
|
||||
'/parkingBox.updateParkingBox',
|
||||
JSON.stringify(vc.component.editParkingBoxInfo), {
|
||||
emulateJSON: true
|
||||
},
|
||||
function (json, res) {
|
||||
function(json, res) {
|
||||
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
|
||||
let _json = JSON.parse(json);
|
||||
if (_json.code == 0) {
|
||||
@ -101,12 +90,12 @@
|
||||
vc.toast(_json.msg);
|
||||
}
|
||||
},
|
||||
function (errInfo, error) {
|
||||
function(errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
vc.message(errInfo);
|
||||
});
|
||||
},
|
||||
_loadEditParkingBoxs: function () {
|
||||
_loadEditParkingBoxs: function() {
|
||||
let param = {
|
||||
params: {
|
||||
page: 1,
|
||||
@ -116,15 +105,15 @@
|
||||
};
|
||||
//发送get请求
|
||||
vc.http.apiGet('/parkingArea.listParkingAreas', param,
|
||||
function (json, res) {
|
||||
function(json, res) {
|
||||
let _parkingAreaManageInfo = JSON.parse(json);
|
||||
$that.editParkingBoxInfo.parkingAreas = _parkingAreaManageInfo.parkingAreas;
|
||||
},
|
||||
function (errInfo, error) {
|
||||
function(errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
});
|
||||
},
|
||||
refreshEditParkingBoxInfo: function () {
|
||||
refreshEditParkingBoxInfo: function() {
|
||||
let _parkingAreas = $that.editParkingBoxInfo.parkingAreas;
|
||||
vc.component.editParkingBoxInfo = {
|
||||
boxId: '',
|
||||
|
||||
@ -12,14 +12,12 @@
|
||||
<div class="row">
|
||||
<div class="col-sm-3">
|
||||
<div class="form-group">
|
||||
<input type="text" :placeholder="vc.i18n('请输入岗亭编号','parkingBoxManage')"
|
||||
v-model="parkingBoxManageInfo.conditions.boxId" class=" form-control">
|
||||
<input type="text" :placeholder="vc.i18n('请输入岗亭编号','parkingBoxManage')" v-model="parkingBoxManageInfo.conditions.boxId" class=" form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-4">
|
||||
<div class="form-group">
|
||||
<input type="text" :placeholder="vc.i18n('请输入岗亭名称','parkingBoxManage')"
|
||||
v-model="parkingBoxManageInfo.conditions.boxName" class=" form-control">
|
||||
<input type="text" :placeholder="vc.i18n('请输入岗亭名称','parkingBoxManage')" v-model="parkingBoxManageInfo.conditions.boxName" class=" form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-3">
|
||||
@ -58,79 +56,76 @@
|
||||
<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="岗亭编号" namespace="parkingBoxManage"></vc:i18n></span>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="岗亭名称" namespace="parkingBoxManage"></vc:i18n></span>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="停车场" namespace="parkingBoxManage"></vc:i18n></span>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="临时车进场" namespace="parkingBoxManage"></vc:i18n></span>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="是否收费" namespace="parkingBoxManage"></vc:i18n></span>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="蓝牌车进场" namespace="parkingBoxManage"></vc:i18n></span>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="黄牌车进场" namespace="parkingBoxManage"></vc:i18n></span>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="备注" namespace="parkingBoxManage"></vc:i18n></span>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="操作" namespace="parkingBoxManage"></vc:i18n></span>
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="岗亭编号" namespace="parkingBoxManage"></vc:i18n></span>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="岗亭名称" namespace="parkingBoxManage"></vc:i18n></span>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="停车场" namespace="parkingBoxManage"></vc:i18n></span>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="临时车进场" namespace="parkingBoxManage"></vc:i18n></span>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="是否收费" namespace="parkingBoxManage"></vc:i18n></span>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="蓝牌车进场" namespace="parkingBoxManage"></vc:i18n></span>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="黄牌车进场" namespace="parkingBoxManage"></vc:i18n></span>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="备注" namespace="parkingBoxManage"></vc:i18n></span>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="操作" namespace="parkingBoxManage"></vc:i18n></span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="parkingBox in parkingBoxManageInfo.parkingBoxs">
|
||||
<td class="text-center">{{parkingBox.boxId}}</td>
|
||||
<td class="text-center">{{parkingBox.boxName}}</td>
|
||||
<td class="text-center">{{parkingBox.paNum}}</td>
|
||||
<td class="text-center">{{parkingBox.tempCarIn== 'Y'?'是':'否'}}</td>
|
||||
<td class="text-center">{{parkingBox.fee == 'Y'?'是':'否'}}</td>
|
||||
<td class="text-center">{{parkingBox.blueCarIn== 'Y'?'是':'否'}}</td>
|
||||
<td class="text-center">{{parkingBox.yelowCarIn== 'Y'?'是':'否'}}</td>
|
||||
<td class="text-center">{{parkingBox.remark}}</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
<button class="btn-white btn btn-xs" v-on:click="_parkingBoxArea(parkingBox)">
|
||||
<tr v-for="parkingBox in parkingBoxManageInfo.parkingBoxs">
|
||||
<td class="text-center">{{parkingBox.boxId}}</td>
|
||||
<td class="text-center">{{parkingBox.boxName}}</td>
|
||||
<td class="text-center">{{parkingBox.paNum}}</td>
|
||||
<td class="text-center">{{parkingBox.tempCarIn== 'Y'?'是':'否'}}</td>
|
||||
<td class="text-center">{{parkingBox.fee == 'Y'?'是':'否'}}</td>
|
||||
<td class="text-center">{{parkingBox.blueCarIn== 'Y'?'是':'否'}}</td>
|
||||
<td class="text-center">{{parkingBox.yelowCarIn== 'Y'?'是':'否'}}</td>
|
||||
<td class="text-center">{{parkingBox.remark}}</td>
|
||||
<td class="text-center">
|
||||
<div class="btn-group" v-if="vc.hasPrivilege('502022090982540017')">
|
||||
<button class="btn-white btn btn-xs" v-on:click="_parkingBoxArea(parkingBox)">
|
||||
<span><vc:i18n name="共享岗亭" namespace="parkingBoxManage"></vc:i18n></span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button class="btn-white btn btn-xs"
|
||||
v-on:click="_openParkingAreaControl(parkingBox)">
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button class="btn-white btn btn-xs" v-on:click="_openParkingAreaControl(parkingBox)">
|
||||
<span><vc:i18n name="控制台" namespace="parkingBoxManage"></vc:i18n></span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button class="btn-white btn btn-xs"
|
||||
v-on:click="_openEditParkingBoxModel(parkingBox)">
|
||||
</div>
|
||||
<div class="btn-group" v-if="vc.hasPrivilege('502022090964370018')">
|
||||
<button class="btn-white btn btn-xs" v-on:click="_openEditParkingBoxModel(parkingBox)">
|
||||
<span><vc:i18n name="修改" namespace="parkingBoxManage"></vc:i18n></span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button class="btn-white btn btn-xs"
|
||||
v-on:click="_openDeleteParkingBoxModel(parkingBox)">
|
||||
</div>
|
||||
<div class="btn-group" v-if="vc.hasPrivilege('502022090909800019')">
|
||||
<button class="btn-white btn btn-xs" v-on:click="_openDeleteParkingBoxModel(parkingBox)">
|
||||
<span><vc:i18n name="删除" namespace="parkingBoxManage"></vc:i18n></span>
|
||||
</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
<ul class="pagination float-right"></ul>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="7">
|
||||
<ul class="pagination float-right"></ul>
|
||||
</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
<!-- 分页 -->
|
||||
@ -142,4 +137,4 @@
|
||||
<vc:create path="property/addParkingBox" callBackListener="" callBackFunction=""></vc:create>
|
||||
<vc:create path="property/editParkingBox"></vc:create>
|
||||
<vc:create path="property/deleteParkingBox"></vc:create>
|
||||
</div>
|
||||
</div>
|
||||
Loading…
Reference in New Issue
Block a user