Commit 269631f3 authored by 王文琼's avatar 王文琼

代码优化,规范

parent 3a082d23
*{
* {
list-style: none;
padding: 0;
margin: 0;
border: 0;
}
html,body{
html,
body {
width: 100%;
height: 100%;
overflow: hidden;
}
[v-cloak] {
display: none !important;
display: none !important;
}
.redColor{
.redColor {
color: red;
display: inline-block;
}
.blueColor{
.blueColor {
color: royalblue;
display: inline-block;
}
.altrowstable {
border-width: 1px;
/*padding: 2px;*/
......@@ -40,114 +45,161 @@ html,body{
z-index: 998;
background-color: rgba(0, 0, 0, .3);
}
#app{
#app {
width: 100%;
height: 100%;
}
.mui-content{
.mui-content {
height: 100%;
width: 100%;
}
.left{
.left {
float: left;
width: 30%;
height: 100%;
display: block;
}
.left-1{
.left-1 {
position: fixed;
top: 2px;
width: 30%;
}
.left-1 a{
.left-1 a {
width: 30px;
}
.left-1 label{
.left-1 label {
text-align: center;
display: block;
line-height: 30px;
}
.left-2{
.left-2 {
padding-top: 35px;
}
.mui-search input[type=search]{
border-radius:0 ;
.mui-search input[type=search] {
border-radius: 0;
}
.Text{
.Text {
border: 1px solid rgb(218, 230, 239);
height: 460px;
background: #fff;
height: 460px;
background: #fff;
position: relative;
/* display: none; */
margin-top: -18px;
overflow-y: scroll;
}
.Text1{
.Text1 {
border: 1px solid rgb(218, 230, 239);
height: 460px;
background: #fff;
height: 460px;
background: #fff;
position: relative;
margin-top: -18px;
}
.maeginTop{
.maeginTop {
margin-top: 10px;
height: 481px;
}
.mui-scroll{
.mui-scroll {
overflow-y: scroll;
}
.complet-detail{
.complet-detail {
padding: 5px 0;
height: 93px;
border-bottom: 1px solid #dadada;
box-sizing: border-box;
overflow: hidden;
}
.complet-detail li{
float: left;
width: 50%;
.complet-detail li {
width: 100%;
font-size: 12px;
line-height:20px;
line-height: 20px;
height: 20px;
text-align: left;
}
.complet-detail li p {
width: 50%;
float: left;
color: #000000;
margin: 0;
}
.complet-detail li span{
.complet-detail li span {
padding-left: 3px;
box-sizing: border-box;
display: block;
font-size: 12px;
float: left;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.complet-detail li span:nth-of-type(2){
.complet-detail li span:nth-of-type(2) {
padding-left: 1px !important;
}
.complet-detail li:nth-of-type(1) span:nth-of-type(2){
width:90px;
white-space:nowrap;
.complet-detail li:nth-of-type(1) span:nth-of-type(2) {
width: 70px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.complet-detail li:nth-of-type(2) span:nth-of-type(2) {
width: 90px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.complet-detail li:nth-of-type(3) span:nth-of-type(2){
width:100px;
white-space:nowrap;
}
.complet-detail li:nth-of-type(3) p {
width: 100%;
}
.complet-detail li:nth-of-type(3) span:nth-of-type(2) {
width: 100px;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.active{
}
.active {
background: #efeff4;
}
.left-submit {
display: inline-block;
width: 17%;
position: relative;
top: -25px;
}
/**左侧底部按钮**/
.btn_bottom{
.btn_bottom {
position: fixed;
bottom: 1px;
width: 30%;
......@@ -155,60 +207,128 @@ html,body{
z-index: 10;
left: 1px;
height: 40px;
line-height: 40px;
}
.btn_bottom #n1,.btn_bottom #n2{
.btn_bottom #n1,
.btn_bottom #n2 {
display: block;
float: left;
text-align: center;
width: 50%;
}
/**右侧***/
.right{
.right {
float: right;
width: 70%;
height: 100%;
box-sizing: border-box;
display: block;
}
#right-2 .right-2-top {
border: solid #DAE6EF 1px;
display: inline-block;
width: 80%;
}
#right-2 .right-2-top p {
float: left;
color: #060606;
}
#right-2 .right-2-top p:nth-of-type(1) {
width: 16%;
}
#right-2 .right-2-top p:nth-of-type(2) {
width: 40%;
}
#right-2 .right-2-top p:nth-of-type(3) {
width: 12%;
}
#right-2 .right-2-top p:nth-of-type(4) {
width: 32%;
}
.detail-header{
float: left;
width: 60%;
.detail-header {
float: left;
width: 60%;
position: relative;
}
.mui-table tr th{
.mui-table tr th {
height: 50px;
}
.item_table{
border: #DAE6EF solid 1px;
display: inline-block;
.item_table {
border: #DAE6EF solid 1px;
display: inline-block;
height: 376px;
background: white;
top:60px;
background: white;
top: 60px;
box-sizing: border-box;
margin-top:-9px ;
}
.sDetail td{
margin-top: -9px;
}
.sDetail td {
height: 62px;
}
.Rbtn button {
width: 120px;
height: 70px;
display: inline-block;
}
.Rcomputed {
width: 255px;
}
.Rcomputed input {
border: 1px solid #DDDDDD;
width: 170px;
height: 70px;
margin-right: -6px;
margin-bottom: -1px;
text-align: center;
color: red;
background: #C8C7CC;
font-size: 25px
}
.Rcomputed button {
width: 85px;
height: 70px;
margin-bottom: -1px;
font-size: 25px;
margin-right: -5px;
}
.Rcomputed .mui-btn-blue {
width: 170px;
}
.Rbtn button{
width: 120px; height: 70px; display: inline-block;
#right-4 {
margin-top: -20px;
}
.Rcomputed button{
width: 85px;height: 70px;margin-bottom: -1px;font-size: 25px
#right-4 thead.mui-table-view th {
font-size: 16px;
font-weight: normal;
background-color: #E2E2E9;
}
/*********/
#pullrefresh{
#pullrefresh {
width: 100%;
}
}
......@@ -13,6 +13,14 @@ html,body,#app{
[v-cloak] {
display: none !important;
}
.redColor{
color: red !important;
display: inline-block;
}
.blueColor{
color: royalblue !important;
display: inline-block;
}
.need-left{
width: 40%;
float: left;
......@@ -55,11 +63,81 @@ html,body,#app{
#item1 div{
/* padding-bottom: 10px; */
}
.needLeftList{
padding: 5px 10px;
height: 93px;
border-bottom: 1px solid #dadada;
box-sizing: border-box;
overflow: hidden;
}
.needLeftList li{
width: 100%;
font-size: 12px;
line-height:20px;
height: 20px;
}
.needLeftList li p{
width: 50%;
float: left;
color: #000000;
margin: 0;
}
.needLeftList li span{
padding-left: 3px;
box-sizing: border-box;
display: block;
font-size: 12px;
float: left;
white-space:nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.needLeftList li span:nth-of-type(2){
padding-left: 1px !important;
}
.needLeftList li:nth-of-type(1) span:nth-of-type(2){
width:100px;
white-space:nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.needLeftList li:nth-of-type(2) span:nth-of-type(2){
width:100px;
white-space:nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.needLeftList li:nth-of-type(3) p{
width: 100%;
}
.needLeftList li:nth-of-type(3) span:nth-of-type(2){
width:100px;
white-space:nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
#item2{
/* top: 32px; */
}
#item2 ul{
height: 93px;
border-bottom: 1px solid #dadada;
box-sizing: border-box;
}
#item2 ul li{
margin: 0
}
#item2 ul li p{
text-align: left;
}
.leftState{
position: fixed;bottom: 1px;left: 1px;z-index: 10;width: 40%;background: #fff;
......@@ -83,7 +161,22 @@ width: 100%;
#right-2 button{
width: 200px; height: 70px;"
}
#right-1 ul li p{
float: left;color: #060606;
white-space:nowrap;text-overflow: ellipsis;overflow: hidden;
}
#right-1 .mui-table-view-cell p:nth-of-type(1){
width: 16%;
}
#right-1 .mui-table-view-cell p:nth-of-type(2){
width: 40%;
}
#right-1 .mui-table-view-cell p:nth-of-type(3){
width: 12%;
}
#right-1 .mui-table-view-cell p:nth-of-type(4){
width: 32%;
}
......
This diff is collapsed.
This diff is collapsed.
function playVoice(filename) {
if (plus.audio == undefined) {
} else {
// 播放操作
var p = plus.audio.createPlayer("_www/dest/voice/" + filename);
p.play(function() {
//alert( "Audio play success!" );
}, function(e) {
//alert( "Audio play failed: " + e.message );
});
}
}
\ No newline at end of file
var Context={__context:null,getContext:function(){if(this.__context!=null){return this.__context}var state=JSON.parse(localStorage.getItem("$state"))||{};var token=state.token||'';var URL=state.host||'';this.__context={token:token,host:URL,image_url:state.image_url||''};return this.__context},getImageUrl:function(md5,width,height,rate){var url=Context.getContext().image_url+'?md5='+md5;if(width&&width>0){url+='&width='+width}if(height&&height>0){url+='&height='+height}if(rate&&rate>0){url+='&rate='+rate}return url},isLogin:function(){var context=Context.getContext();return context.token!=''}};var Dom={getById:function(id){return document.getElementById(id)},clickAOpen:function(el,url,extras){mui(el).on('tap','a',function(){mui.openWindow({url:url,id:url,extras:extras})})},open(url,extras){mui.openWindow({url:url,id:url,extras:extras})}};var Api={post:function(url,data,success,error){var context=Context.getContext();var host=context.host;data=data||{};data.token=context.token;error=error||this.__defaultErrorHandlder;Log.log("web request:"+host+url+' data:'+JSON.stringify(data));mui.ajax(host+url,{type:'POST',data:data,dataType:'json',timeout:5000,headers:{'Content-Type':'application/json'},crossDomain:true,success:function(res,type,xhr){if(res.success){success(res)}else{error(xhr,type,res)}},error:error})},postAndWaiting:function(url,data,success,error){var waitingObj=null;function showWaiting(){if(waitingObj){waitingObj.close();waitingObj=null}waitingObj=plus.nativeUI.showWaiting("加载数据中...")}function closeWaiting(){if(waitingObj){waitingObj.close();waitingObj=null}}showWaiting();var context=Context.getContext();var host=context.host;data=data||{};data.token=context.token;error=error||this.__defaultErrorHandlder;Log.log("web request:"+host+url+' data:'+JSON.stringify(data));mui.ajax(host+url,{type:'POST',data:data,dataType:'json',timeout:10000,headers:{'Content-Type':'application/json'},success:function(res,type,xhr){closeWaiting();if(res.success){success(res)}else{error(xhr,type,res)}},error:function(xhr,type,e){closeWaiting();error(xhr,type,e)}})},__defaultErrorHandlder:function(xhr,status,e){console.log(xhr.responseText);console.log(xhr.responseXML);console.log('status'+xhr.status);console.log(xhr.statusText);var msg='';if(e&&e.hasOwnProperty('code')){var code=e.code;switch(code){case 2:msg="用户名或者密码错误";break;case 3:msg="登录已过期";break;case 4:msg="未知的服务器错误";break;case 5:msg="公司不可用";break;case 6:msg="未知错误";break;case 7:msg="公司不存在";break;case 8:msg="请求参数有问题";break;default:case 0:msg="未指定的错误";break}mui.toast(msg);console.log(msg)}else{var error_msg='';if(status=='abort'){error_msg='网络错误,请检查设备的网络连接.'}else{error_msg='发生了一个错误'}mui.toast(error_msg);console.log(error_msg);console.log(e)}}};var ArrayUtil={addField:function(items,fieldName,defaultValue){for(var i=0;i<items.length;i+=1){items[i][fieldName]=defaultValue}},setField:function(items,fieldName,value){for(var i=0;i<items.length;i+=1){items[i][fieldName]=value}}};var __PRINT_LOG=true;var Log={printStack:function(){if(__PRINT_LOG){try{throw new Error("print Statck")}catch(ex){console.log(ex.stack)}}},log:function(val){if(__PRINT_LOG){console.log(val)}}};var Sys={isIos:function(){var osname=plus.os.name.toLowerCase();return osname=='ios'},isAndroid:function(){var osname=plus.os.name.toLowerCase();return osname=='android'}};
\ No newline at end of file
var Context = {
__context: null,
getContext: function() {
if (this.__context != null) {
return this.__context
}
var state = JSON.parse(localStorage.getItem("$state")) || {};
var token = state.token || '';
var URL = state.host || '';
this.__context = {
token: token,
host: URL,
image_url: state.image_url || ''
};
return this.__context
},
getImageUrl: function(md5, width, height, rate) {
var url = Context.getContext().image_url + '?md5=' + md5;
if (width && width > 0) {
url += '&width=' + width
}
if (height && height > 0) {
url += '&height=' + height
}
if (rate && rate > 0) {
url += '&rate=' + rate
}
return url
},
isLogin: function() {
var context = Context.getContext();
return context.token != ''
}
};
var Dom = {
getById: function(id) {
return document.getElementById(id)
},
clickAOpen: function(el, url, extras) {
mui(el).on('tap', 'a', function() {
mui.openWindow({
url: url,
id: url,
extras: extras
})
})
},
open(url, extras) {
mui.openWindow({
url: url,
id: url,
extras: extras
})
}
};
var Api = {
post: function(url, data, success, error) {
var context = Context.getContext();
var host = context.host;
data = data || {};
data.token = context.token;
error = error || this.__defaultErrorHandlder;
Log.log("web request:" + host + url + ' data:' + JSON.stringify(data));
mui.ajax(host + url, {
type: 'POST',
data: data,
dataType: 'json',
timeout: 5000,
headers: {
'Content-Type': 'application/json'
},
crossDomain: true,
success: function(res, type, xhr) {
if (res.success) {
success(res)
} else {
error(xhr, type, res)
}
},
error: error
})
},
postAndWaiting: function(url, data, success, error) {
var waitingObj = null;
function showWaiting() {
if (waitingObj) {
waitingObj.close();
waitingObj = null
}
waitingObj = plus.nativeUI.showWaiting("加载数据中...")
}
function closeWaiting() {
if (waitingObj) {
waitingObj.close();
waitingObj = null
}
}
showWaiting();
var context = Context.getContext();
var host = context.host;
data = data || {};
data.token = context.token;
error = error || this.__defaultErrorHandlder;
Log.log("web request:" + host + url + ' data:' + JSON.stringify(data));
mui.ajax(host + url, {
type: 'POST',
data: data,
dataType: 'json',
timeout: 10000,
headers: {
'Content-Type': 'application/json'
},
success: function(res, type, xhr) {
closeWaiting();
if (res.success) {
success(res)
} else {
error(xhr, type, res)
}
},
error: function(xhr, type, e) {
closeWaiting();
error(xhr, type, e)
}
})
},
__defaultErrorHandlder: function(xhr, status, e) {
console.log(xhr.responseText);
console.log(xhr.responseXML);
console.log('status' + xhr.status);
console.log(xhr.statusText);
var msg = '';
if (e && e.hasOwnProperty('code')) {
var code = e.code;
switch (code) {
case 2:
msg = "用户名或者密码错误";
break;
case 3:
msg = "登录已过期";
break;
case 4:
msg = "未知的服务器错误";
break;
case 5:
msg = "公司不可用";
break;
case 6:
msg = "未知错误";
break;
case 7:
msg = "公司不存在";
break;
case 8:
msg = "请求参数有问题";
break;
default:
case 0:
msg = "未指定的错误";
break
}
mui.toast(msg);
console.log(msg)
} else {
var error_msg = '';
if (status == 'abort') {
error_msg = '网络错误,请检查设备的网络连接.'
} else {
error_msg = '发生了一个错误'
}
mui.toast(error_msg);
console.log(error_msg);
console.log(e)
}
}
};
var ArrayUtil = {
addField: function(items, fieldName, defaultValue) {
for (var i = 0; i < items.length; i += 1) {
items[i][fieldName] = defaultValue
}
},
setField: function(items, fieldName, value) {
for (var i = 0; i < items.length; i += 1) {
items[i][fieldName] = value
}
}
};
var __PRINT_LOG = true;
var Log = {
printStack: function() {
if (__PRINT_LOG) {
try {
throw new Error("print Statck")
} catch (ex) {
console.log(ex.stack)
}
}
},
log: function(val) {
if (__PRINT_LOG) {
console.log(val)
}
}
};
var Sys = {
isIos: function() {
var osname = plus.os.name.toLowerCase();
return osname == 'ios'
},
isAndroid: function() {
var osname = plus.os.name.toLowerCase();
return osname == 'android'
}
};
This diff is collapsed.
This diff is collapsed.
......@@ -152,12 +152,12 @@
function onGetDataSuccess(e){
console.log("GetModuleList::" + JSON.stringify(e))
//console.log("GetModuleList::" + JSON.stringify(e))
var isSuccess = e.success;
if(isSuccess) {
var items = e.items;
console.log(JSON.stringify(items) )
//console.log(JSON.stringify(items) )
//手动在结尾添加了一个设置项目
items.push({
Code: "设置"
......@@ -204,7 +204,7 @@
}
console.log("GetModuleList::begin" )
//console.log("GetModuleList::begin" )
Api.post('/api/User/GetModuleList',{},onGetDataSuccess,onGetDataFailure);
......
......@@ -3,7 +3,7 @@
"id" : "H544710A8", /*应用的标识,创建应用时自动生成,勿手动修改*/
"name" : "飞天兔MES", /*应用名称,程序桌面图标名称*/
"version" : {
"name" : "1.0.0.31", /*应用版本名称*/
"name" : "1.0.0.39", /*应用版本名称*/
"code" : "338"
},
"description" : "飞天兔MES平板版", /*应用描述信息*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment