mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-24 05:46:03 +08:00
优化 代码
This commit is contained in:
parent
198649e568
commit
c2840f5a96
@ -1,4 +1,4 @@
|
||||
(function (vc) {
|
||||
(function(vc) {
|
||||
vc.extends({
|
||||
propTypes: {
|
||||
callBackListener: vc.propTypes.string, //父组件名称
|
||||
@ -14,10 +14,9 @@
|
||||
remark: ''
|
||||
}
|
||||
},
|
||||
_initMethod: function () {
|
||||
},
|
||||
_initEvent: function () {
|
||||
vc.on('addApp', 'openAddAppModal', function () {
|
||||
_initMethod: function() {},
|
||||
_initEvent: function() {
|
||||
vc.on('addApp', 'openAddAppModal', function() {
|
||||
$('#addAppModel').modal('show');
|
||||
});
|
||||
},
|
||||
@ -26,8 +25,7 @@
|
||||
return vc.validate.validate({
|
||||
addAppInfo: vc.component.addAppInfo
|
||||
}, {
|
||||
'addAppInfo.name': [
|
||||
{
|
||||
'addAppInfo.name': [{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "应用名称不能为空"
|
||||
@ -38,37 +36,29 @@
|
||||
errInfo: "应用名称必须在2至50字符之间"
|
||||
},
|
||||
],
|
||||
'addAppInfo.securityCode': [
|
||||
{
|
||||
limit: "maxLength",
|
||||
param: "64",
|
||||
errInfo: "秘钥太长超过64位"
|
||||
},
|
||||
],
|
||||
'addAppInfo.whileListIp': [
|
||||
{
|
||||
limit: "maxLength",
|
||||
param: "200",
|
||||
errInfo: "白名单内容不能超过200"
|
||||
},
|
||||
],
|
||||
'addAppInfo.blackListIp': [
|
||||
{
|
||||
limit: "maxLength",
|
||||
param: "200",
|
||||
errInfo: "黑名单内容不能超过200"
|
||||
},
|
||||
],
|
||||
'addAppInfo.remark': [
|
||||
{
|
||||
limit: "maxLength",
|
||||
param: "200",
|
||||
errInfo: "备注内容不能超过200"
|
||||
},
|
||||
]
|
||||
'addAppInfo.securityCode': [{
|
||||
limit: "maxLength",
|
||||
param: "64",
|
||||
errInfo: "秘钥太长超过64位"
|
||||
}, ],
|
||||
'addAppInfo.whileListIp': [{
|
||||
limit: "maxLength",
|
||||
param: "200",
|
||||
errInfo: "白名单内容不能超过200"
|
||||
}, ],
|
||||
'addAppInfo.blackListIp': [{
|
||||
limit: "maxLength",
|
||||
param: "200",
|
||||
errInfo: "黑名单内容不能超过200"
|
||||
}, ],
|
||||
'addAppInfo.remark': [{
|
||||
limit: "maxLength",
|
||||
param: "200",
|
||||
errInfo: "备注内容不能超过200"
|
||||
}, ]
|
||||
});
|
||||
},
|
||||
saveAppInfo: function () {
|
||||
saveAppInfo: function() {
|
||||
if (!vc.component.addAppValidate()) {
|
||||
vc.toast(vc.validate.errInfo);
|
||||
return;
|
||||
@ -82,11 +72,10 @@
|
||||
}
|
||||
vc.http.apiPost(
|
||||
'/app.saveApp',
|
||||
JSON.stringify(vc.component.addAppInfo),
|
||||
{
|
||||
JSON.stringify(vc.component.addAppInfo), {
|
||||
emulateJSON: true
|
||||
},
|
||||
function (json, res) {
|
||||
function(json, res) {
|
||||
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
|
||||
if (res.status == 200) {
|
||||
//关闭model
|
||||
@ -97,12 +86,12 @@
|
||||
return;
|
||||
}
|
||||
},
|
||||
function (errInfo, error) {
|
||||
function(errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
vc.toast(errInfo);
|
||||
});
|
||||
},
|
||||
clearAddAppInfo: function () {
|
||||
clearAddAppInfo: function() {
|
||||
vc.component.addAppInfo = {
|
||||
name: '',
|
||||
securityCode: '',
|
||||
@ -113,4 +102,4 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
})(window.vc);
|
||||
})(window.vc);
|
||||
@ -39,9 +39,10 @@
|
||||
$that.parkingAreaControlFeeInfo.feeCarNum = _data.carNum;
|
||||
$that.parkingAreaControlFeeInfo.costMin = _data.hours + "小时" + _data.min + "分钟"
|
||||
$that.parkingAreaControlFeeInfo.pay = _data.payCharge;
|
||||
$that.parkingAreaControlFeeInfo.payCharge = _data.payCharge;
|
||||
$that.parkingAreaControlFeeInfo.remark = '';
|
||||
} else {
|
||||
$that.parkingAreaControlFeeInfo.pay = _oldPayCharge;
|
||||
$that.parkingAreaControlFeeInfo.payCharge = _oldPayCharge;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -15,58 +15,58 @@
|
||||
<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="appManage"></vc:i18n></span>Id
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="应用名称" namespace="appManage"></vc:i18n></span>
|
||||
</th>
|
||||
<!--<th class="text-center">
|
||||
<tr>
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="应用" namespace="appManage"></vc:i18n></span>Id
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="应用名称" namespace="appManage"></vc:i18n></span>
|
||||
</th>
|
||||
<!--<th class="text-center">
|
||||
<span><vc:i18n name="秘钥" namespace="appManage"></vc:i18n></span>
|
||||
</th>-->
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="白名单" namespace="appManage"></vc:i18n></span>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="黑名单" namespace="appManage"></vc:i18n></span>
|
||||
</th>
|
||||
<!--<th class="text-center">
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="白名单" namespace="appManage"></vc:i18n></span>
|
||||
</th>
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="黑名单" namespace="appManage"></vc:i18n></span>
|
||||
</th>
|
||||
<!--<th class="text-center">
|
||||
<span><vc:i18n name="备注" namespace="appManage"></vc:i18n></span>
|
||||
</th>-->
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="操作" namespace="appManage"></vc:i18n></span>
|
||||
</th>
|
||||
</tr>
|
||||
<th class="text-center">
|
||||
<span><vc:i18n name="操作" namespace="appManage"></vc:i18n></span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr v-for="app in appManageInfo.apps">
|
||||
<td class="text-center">{{app.appId}}</td>
|
||||
<td class="text-center">{{app.name}}</td>
|
||||
<!--<td class="text-center">{{app.securityCode}}</td>-->
|
||||
<td class="text-center">{{app.whileListIp}}</td>
|
||||
<td class="text-center">{{app.blackListIp}}</td>
|
||||
<!--<td class="text-center">{{app.remark}}</td>-->
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
<button class="btn-white btn btn-xs" v-on:click="_openEditAppModel(app)">
|
||||
<tr v-for="app in appManageInfo.apps">
|
||||
<td class="text-center">{{app.appId}}</td>
|
||||
<td class="text-center">{{app.name}}</td>
|
||||
<!--<td class="text-center">{{app.securityCode}}</td>-->
|
||||
<td class="text-center">{{app.whileListIp}}</td>
|
||||
<td class="text-center">{{app.blackListIp}}</td>
|
||||
<!--<td class="text-center">{{app.remark}}</td>-->
|
||||
<td class="text-center">
|
||||
<div class="btn-group">
|
||||
<button class="btn-white btn btn-xs" v-on:click="_openEditAppModel(app)">
|
||||
<span><vc:i18n name="修改" namespace="appManage"></vc:i18n></span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button class="btn-white btn btn-xs" v-on:click="_openDeleteAppModel(app)">
|
||||
</div>
|
||||
<div class="btn-group">
|
||||
<button class="btn-white btn btn-xs" v-on:click="_openDeleteAppModel(app)">
|
||||
<span><vc:i18n name="删除" namespace="appManage"></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>
|
||||
<!-- 分页 -->
|
||||
@ -78,4 +78,4 @@
|
||||
<vc:create path="dev/addApp" callBackListener="" callBackFunction=""></vc:create>
|
||||
<vc:create path="dev/editApp"></vc:create>
|
||||
<vc:create path="dev/deleteApp"></vc:create>
|
||||
</div>
|
||||
</div>
|
||||
Loading…
Reference in New Issue
Block a user