mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-06-12 10:00:56 +08:00
优化 代码
This commit is contained in:
parent
d3bf92261d
commit
65a0b6e9e9
8
app.js
8
app.js
@ -34,10 +34,10 @@ let opts = {
|
||||
//app.use('/callComponent',proxy('https://app.demo.winqi.cn/',opts));
|
||||
//app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012/',opts));
|
||||
//app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012',opts));
|
||||
app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012',opts));
|
||||
app.use('/app',proxy('http://api.demo.winqi.cn:8012',opts));
|
||||
//app.use('/callComponent',proxy('http://192.168.1.16:8012',opts));
|
||||
//app.use('/app',proxy('http://192.168.1.16:8012',opts));
|
||||
//app.use('/callComponent',proxy('http://api.demo.winqi.cn:8012',opts));
|
||||
//app.use('/app',proxy('http://api.demo.winqi.cn:8012',opts));
|
||||
app.use('/callComponent',proxy('http://192.168.1.16:8012',opts));
|
||||
app.use('/app',proxy('http://192.168.1.16:8012',opts));
|
||||
|
||||
//app.listen(3000);
|
||||
app.use(express.json());
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<div id="addFloorModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
|
||||
aria-hidden="true">
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
@ -11,24 +11,29 @@
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">楼栋编号</label>
|
||||
<div class="col-sm-10"><input v-model="addFloorInfo.floorNum" type="number"
|
||||
placeholder="必填,请填写编号" class="form-control"></div>
|
||||
placeholder="必填,请填写编号" class="form-control"></div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">楼栋名称</label>
|
||||
<div class="col-sm-10"><input v-model="addFloorInfo.name" type="text"
|
||||
placeholder="必填,请填写名称" class="form-control"></div>
|
||||
placeholder="必填,请填写名称" class="form-control"></div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">建筑面积</label>
|
||||
<div class="col-sm-10"><input v-model="addFloorInfo.floorArea" type="text"
|
||||
placeholder="必填,请填写建筑面积" class="form-control"></div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">备注</label>
|
||||
<div class="col-sm-10"><textarea cols="5" v-model="addFloorInfo.remark" type="tel"
|
||||
placeholder="可填,请填写备注" class="form-control"></textarea></div>
|
||||
placeholder="可填,请填写备注" class="form-control"></textarea></div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<button class="btn btn-primary float-right" type="button" v-on:click="saveFloorInfo()">
|
||||
<i class="fa fa-check"></i> 保存
|
||||
</button>
|
||||
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
|
||||
data-dismiss="modal">取消
|
||||
data-dismiss="modal">取消
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -10,6 +10,7 @@
|
||||
floorId:'',
|
||||
name:'',
|
||||
floorName:'',
|
||||
floorArea:'',
|
||||
floorNum:'',
|
||||
remark:'',
|
||||
errorInfo:''
|
||||
@ -66,6 +67,18 @@
|
||||
errInfo:"不是有效的数字"
|
||||
},
|
||||
],
|
||||
'addFloorInfo.floorArea':[
|
||||
{
|
||||
limit:"required",
|
||||
param:"",
|
||||
errInfo:"建筑面积不能为空"
|
||||
},
|
||||
{
|
||||
limit:"money",
|
||||
param:"",
|
||||
errInfo:"建筑面积错误,如300.00"
|
||||
},
|
||||
],
|
||||
'addFloorInfo.remark':[
|
||||
|
||||
{
|
||||
@ -126,6 +139,7 @@
|
||||
vc.component.addFloorInfo = {
|
||||
name:'',
|
||||
floorNum:'',
|
||||
floorArea:'',
|
||||
remark:'',
|
||||
errorInfo:''
|
||||
};
|
||||
|
||||
@ -17,6 +17,11 @@
|
||||
<div class="col-sm-10"><input v-model="addUnitInfo.layerCount" type="number"
|
||||
placeholder="必填,请填写单元总层数" class="form-control"></div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">建筑面积</label>
|
||||
<div class="col-sm-10"><input v-model="addUnitInfo.unitArea" type="text"
|
||||
placeholder="必填,请填写建筑面积" class="form-control"></div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">电梯</label>
|
||||
<div class="col-sm-10">
|
||||
|
||||
@ -12,7 +12,8 @@
|
||||
layerCount:'',
|
||||
lift:'',
|
||||
remark:'',
|
||||
communityId:''
|
||||
communityId:'',
|
||||
unitArea:''
|
||||
}
|
||||
},
|
||||
_initMethod:function(){
|
||||
@ -79,6 +80,18 @@
|
||||
errInfo:"单元楼层高度必须为数字"
|
||||
}
|
||||
],
|
||||
'addUnitInfo.unitArea':[
|
||||
{
|
||||
limit:"required",
|
||||
param:"",
|
||||
errInfo:"建筑面积不能为空"
|
||||
},
|
||||
{
|
||||
limit:"money",
|
||||
param:"",
|
||||
errInfo:"建筑面积错误 如300.00"
|
||||
}
|
||||
],
|
||||
'addUnitInfo.lift':[
|
||||
{
|
||||
limit:"required",
|
||||
@ -143,7 +156,8 @@
|
||||
layerCount:'',
|
||||
lift:'',
|
||||
remark:'',
|
||||
communityId:''
|
||||
communityId:'',
|
||||
unitArea:''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -18,6 +18,11 @@
|
||||
<div class="col-sm-10"><input v-model="editFloorInfo.floorName" type="text"
|
||||
placeholder="必填,请填写名称" class="form-control"></div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">建筑面积</label>
|
||||
<div class="col-sm-10"><input v-model="editFloorInfo.floorArea" type="text"
|
||||
placeholder="必填,请填写建筑面积" class="form-control"></div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">备注</label>
|
||||
<div class="col-sm-10"><textarea cols="5" v-model="editFloorInfo.remark" type="tel"
|
||||
|
||||
@ -1,83 +1,96 @@
|
||||
(function(vc){
|
||||
(function (vc) {
|
||||
|
||||
vc.extends({
|
||||
data:{
|
||||
editFloorInfo:{
|
||||
floorId:'',
|
||||
floorName:'',
|
||||
floorNum:'',
|
||||
remark:'',
|
||||
errorInfo:''
|
||||
data: {
|
||||
editFloorInfo: {
|
||||
floorId: '',
|
||||
floorName: '',
|
||||
floorNum: '',
|
||||
floorArea: '',
|
||||
remark: '',
|
||||
errorInfo: ''
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
"editFloorInfo.floorNum":{//深度监听,可监听到对象、数组的变化
|
||||
handler(val, oldVal){
|
||||
if(vc.notNull(val)){
|
||||
watch: {
|
||||
"editFloorInfo.floorNum": {//深度监听,可监听到对象、数组的变化
|
||||
handler(val, oldVal) {
|
||||
if (vc.notNull(val)) {
|
||||
vc.component.editFloorInfo.floorName = vc.component.editFloorInfo.floorNum + "号楼";
|
||||
}else{
|
||||
} else {
|
||||
vc.component.editFloorInfo.floorName = "";
|
||||
}
|
||||
|
||||
},
|
||||
deep:true
|
||||
deep: true
|
||||
}
|
||||
},
|
||||
_initMethod:function(){
|
||||
},
|
||||
_initMethod: function () {
|
||||
|
||||
},
|
||||
_initEvent:function(){
|
||||
vc.on('editFloor','openEditFloorModal',function(_floor){
|
||||
vc.component.editFloorInfo.errorInfo="";
|
||||
vc.copyObject(_floor,vc.component.editFloorInfo);
|
||||
},
|
||||
_initEvent: function () {
|
||||
vc.on('editFloor', 'openEditFloorModal', function (_floor) {
|
||||
vc.component.editFloorInfo.errorInfo = "";
|
||||
vc.copyObject(_floor, vc.component.editFloorInfo);
|
||||
$('#editFloorModel').modal('show');
|
||||
});
|
||||
},
|
||||
methods:{
|
||||
editFloorValidate(){
|
||||
methods: {
|
||||
editFloorValidate() {
|
||||
return vc.validate.validate({
|
||||
editFloorInfo:vc.component.editFloorInfo
|
||||
},{
|
||||
'editFloorInfo.floorName':[
|
||||
editFloorInfo: vc.component.editFloorInfo
|
||||
}, {
|
||||
'editFloorInfo.floorName': [
|
||||
{
|
||||
limit:"required",
|
||||
param:"",
|
||||
errInfo:"楼名称不能为空"
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "楼名称不能为空"
|
||||
},
|
||||
{
|
||||
limit:"maxin",
|
||||
param:"2,10",
|
||||
errInfo:"楼名称长度必须在2位至10位"
|
||||
limit: "maxin",
|
||||
param: "2,10",
|
||||
errInfo: "楼名称长度必须在2位至10位"
|
||||
},
|
||||
],
|
||||
'editFloorInfo.floorNum':[
|
||||
'editFloorInfo.floorNum': [
|
||||
{
|
||||
limit:"required",
|
||||
param:"",
|
||||
errInfo:"楼编号不能为空"
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "楼编号不能为空"
|
||||
},
|
||||
{
|
||||
limit:"num",
|
||||
param:"",
|
||||
errInfo:"不是有效的数字"
|
||||
limit: "num",
|
||||
param: "",
|
||||
errInfo: "不是有效的数字"
|
||||
},
|
||||
],
|
||||
'editFloorInfo.remark':[
|
||||
'editFloorInfo.floorArea': [
|
||||
{
|
||||
limit: "required",
|
||||
param: "",
|
||||
errInfo: "建筑面积不能为空"
|
||||
},
|
||||
{
|
||||
limit: "money",
|
||||
param: "",
|
||||
errInfo: "建筑面积错误,如300.00"
|
||||
},
|
||||
],
|
||||
'editFloorInfo.remark': [
|
||||
|
||||
{
|
||||
limit:"maxLength",
|
||||
param:"200",
|
||||
errInfo:"备注长度不能超过200位"
|
||||
limit: "maxLength",
|
||||
param: "200",
|
||||
errInfo: "备注长度不能超过200位"
|
||||
}
|
||||
]
|
||||
|
||||
});
|
||||
},
|
||||
editFloorMethod:function(){
|
||||
editFloorMethod: function () {
|
||||
|
||||
if(!vc.component.editFloorValidate()){
|
||||
if (!vc.component.editFloorValidate()) {
|
||||
vc.component.editFloorInfo.errorInfo = vc.validate.errInfo;
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
|
||||
vc.component.editFloorInfo.errorInfo = "";
|
||||
@ -88,36 +101,37 @@
|
||||
'changeFloor',
|
||||
JSON.stringify(vc.component.editFloorInfo),
|
||||
{
|
||||
emulateJSON:true
|
||||
},
|
||||
function(json,res){
|
||||
emulateJSON: true
|
||||
},
|
||||
function (json, res) {
|
||||
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
|
||||
if(res.status == 200){
|
||||
if (res.status == 200) {
|
||||
//关闭model
|
||||
$('#editFloorModel').modal('hide');
|
||||
vc.component.clearEditFloorInfo();
|
||||
vc.emit('listFloor','listFloorData',{});
|
||||
vc.emit('listFloor', 'listFloorData', {});
|
||||
|
||||
return ;
|
||||
return;
|
||||
}
|
||||
vc.component.editFloorInfo.errorInfo = json;
|
||||
|
||||
},
|
||||
function(errInfo,error){
|
||||
},
|
||||
function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
|
||||
vc.component.editFloorInfo.errorInfo = errInfo;
|
||||
|
||||
});
|
||||
});
|
||||
},
|
||||
clearEditFloorInfo:function(){
|
||||
clearEditFloorInfo: function () {
|
||||
vc.component.editFloorInfo = {
|
||||
floorId:'',
|
||||
floorName:'',
|
||||
floorNum:'',
|
||||
remark:'',
|
||||
errorInfo:''
|
||||
};
|
||||
floorId: '',
|
||||
floorName: '',
|
||||
floorNum: '',
|
||||
floorArea: '',
|
||||
remark: '',
|
||||
errorInfo: ''
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@ -14,6 +14,11 @@
|
||||
<label class="col-sm-2 col-form-label">总层数</label>
|
||||
<div class="col-sm-10"><input v-model="editUnitInfo.layerCount" type="number" placeholder="必填,请填写单元总层数" class="form-control"></div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">建筑面积</label>
|
||||
<div class="col-sm-10"><input v-model="editUnitInfo.unitArea" type="text"
|
||||
placeholder="必填,请填写建筑面积" class="form-control"></div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">电梯</label>
|
||||
<div class="col-sm-10">
|
||||
|
||||
@ -9,7 +9,8 @@
|
||||
layerCount:'',
|
||||
lift:'',
|
||||
remark:'',
|
||||
communityId:''
|
||||
communityId:'',
|
||||
unitArea:''
|
||||
}
|
||||
},
|
||||
_initMethod:function(){
|
||||
@ -60,6 +61,18 @@
|
||||
errInfo:"单元楼层高度必须为数字"
|
||||
}
|
||||
],
|
||||
'editUnitInfo.unitArea':[
|
||||
{
|
||||
limit:"required",
|
||||
param:"",
|
||||
errInfo:"建筑面积不能为空"
|
||||
},
|
||||
{
|
||||
limit:"money",
|
||||
param:"",
|
||||
errInfo:"建筑面积错误 如300.00"
|
||||
}
|
||||
],
|
||||
'editUnitInfo.lift':[
|
||||
{
|
||||
limit:"required",
|
||||
@ -116,7 +129,8 @@
|
||||
layerCount:'',
|
||||
lift:'',
|
||||
remark:'',
|
||||
communityId:''
|
||||
communityId:'',
|
||||
unitArea:''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -67,6 +67,7 @@
|
||||
<tr>
|
||||
<th class="text-center">名称</th>
|
||||
<th class="text-center">编号</th>
|
||||
<th class="text-center">建筑面积</th>
|
||||
<th class="text-center">楼栋ID</th>
|
||||
<th class="text-center">创建员工</th>
|
||||
<th class="text-right">操作</th>
|
||||
@ -81,6 +82,9 @@
|
||||
<td class="text-center">
|
||||
{{floor.floorNum}}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{{floor.floorArea}}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{{floor.floorId}}
|
||||
</td>
|
||||
|
||||
@ -84,6 +84,7 @@
|
||||
<th>楼栋</th>
|
||||
<th data-hide="phone">单元编号</th>
|
||||
<th data-hide="phone">总层数</th>
|
||||
<th data-hide="phone">建筑面积</th>
|
||||
<th data-hide="phone">是否有电梯</th>
|
||||
<th data-hide="phone,tablet">创建人</th>
|
||||
<th class="text-right">操作</th>
|
||||
@ -104,6 +105,9 @@
|
||||
<td>
|
||||
{{unit.layerCount}}层
|
||||
</td>
|
||||
<td>
|
||||
{{unit.unitArea}}平方米
|
||||
</td>
|
||||
<td>
|
||||
{{unit.lift == '1010'?'有':'无'}}
|
||||
</td>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user