Commit 480eeec8 authored by ym's avatar ym

'newww'

parent 7b712439
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
"qs": "^6.9.1", "qs": "^6.9.1",
"screenfull": "4.2.0", "screenfull": "4.2.0",
"sortablejs": "1.8.4", "sortablejs": "1.8.4",
"vee-validate": "^2.0.0-rc.25",
"vue": "2.6.10", "vue": "2.6.10",
"vue-count-to": "1.0.13", "vue-count-to": "1.0.13",
"vue-cropper": "0.4.9", "vue-cropper": "0.4.9",
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -37,9 +37,10 @@ var reqApis = function(){ ...@@ -37,9 +37,10 @@ var reqApis = function(){
var item = baseInfo[key]; var item = baseInfo[key];
if(item.must){ if(item.must){
var typeStr = item.type ? '请选择' : '请输入'; var typeStr = item.type ? '请选择' : '请输入';
var rule = {required: true, message:item.ruleTip || typeStr+item.name, trigger:'blur'}; var rule = {required: true, message:item.ruleTip || typeStr+item.name, trigger:'blur',};
item.ruleType && (rule.type = item.ruleType) item.ruleType && (rule.type = item.ruleType)
rules[key] = [rule]; rules[key] = [rule];
}; };
};return Object.keys(rules)[0] ? rules : void 0; };return Object.keys(rules)[0] ? rules : void 0;
}, },
...@@ -235,6 +236,7 @@ var reqApis = function(){ ...@@ -235,6 +236,7 @@ var reqApis = function(){
this.form.visible = true; this.form.visible = true;
this.form.reqType = 'add'; this.form.reqType = 'add';
var item = {}, Dict = this.Dict; var item = {}, Dict = this.Dict;
for(var key in Dict.baseInfo){ for(var key in Dict.baseInfo){
var obj = Dict.baseInfo[key]; var obj = Dict.baseInfo[key];
item[key] = obj.default || obj.dataType || ''; item[key] = obj.default || obj.dataType || '';
...@@ -978,9 +980,9 @@ var reqApis = function(){ ...@@ -978,9 +980,9 @@ var reqApis = function(){
html:'<div style="width:13rem;"></div>', html:'<div style="width:13rem;"></div>',
onload: function(el){ onload: function(el){
var box = el.firstElementChild; var box = el.firstElementChild;
var btngroub = '<div style="margin:0 2px 0 25px;color:#E6A23C;">当前:</div><div class="el-button-group"><button data-id="1" class="el-button el-button--primary el-button--small cu-btn cu-btn-null">1小时</button><button data-id="6" class="el-button el-button--primary el-button--small cu-btn cu-btn-null">6小时</button><button data-id="12" class="el-button el-button--primary el-button--small cu-btn cu-btn-null">12小时</button></div>'; var btngroub = '<div style="margin:0 2px 0 25px;color:#E6A23C;">当前:</div><div class="el-button-group"><button data-id="1" class="el-button el-button--primary el-button--small cu-btn cu-btn-null">1小时</button><button data-id="6" class="el-button el-button--primary el-button--small cu-btn cu-btn-null">6小时</button><button data-id="12" class="el-button el-button--primary el-button--small cu-btn cu-btn-null">12小时</button><button data-id="24" class="el-button el-button--primary el-button--small cu-btn cu-btn-null">24小时</button></div>';
var boxdiv ='<div id="contentbox" style="width:400px;height:30px;display:flex;margin-left:30px;line-height:2.2em;font-weight: bolder;letter-spacing: 3px;"></div>';
box.innerHTML = '<div class="p-head" style="padding-top:5px;display:flex;align-items:center;"><div class="select" style="margin:0 15px 0 5px;"><select style="height:25px;min-width:100px;"></select></div><div class="date"></div><button style="margin-left:20px;"class="el-button el-button--small el-button--primary query">查询</button>'+btngroub+'</div><div class="p-body" style="height:7rem;"><div class="chart26" style="height:100%;width:100%;border:1px solid #ccc;margin-top:10px;"></div></div><div style="margin-top:5px;"><button data-type="line" class="switch" style="margin-right:4px;">折线图</button><button data-type="column" class="switch">柱状图</button></div>'; box.innerHTML = '<div class="p-head" style="padding-top:5px;display:flex;align-items:center;"><div class="select" style="margin:0 15px 0 5px;"><select style="height:25px;min-width:100px;"></select></div><div class="date"></div><button style="margin-left:20px;"class="el-button el-button--small el-button--primary query">查询</button>'+btngroub+boxdiv+'</div><div class="p-body" style="height:7rem;"><div class="chart26" style="height:100%;width:100%;border:1px solid #ccc;margin-top:10px;"></div></div><div style="margin-top:5px;"><button data-type="line" class="switch" style="margin-right:4px;">折线图</button><button data-type="column" class="switch">柱状图</button></div>';
var headEl = box.firstElementChild; var headEl = box.firstElementChild;
var selectEl = headEl.firstElementChild; var selectEl = headEl.firstElementChild;
...@@ -1023,6 +1025,7 @@ var reqApis = function(){ ...@@ -1023,6 +1025,7 @@ var reqApis = function(){
var chartOpts = {}; var chartOpts = {};
box.onclick = function(e){ box.onclick = function(e){
var tag = e.target || e.srcElement; var tag = e.target || e.srcElement;
var divID= document.getElementById("contentbox");
if(tag.classList.contains('query')){ if(tag.classList.contains('query')){
if(box.tagBtn){ if(box.tagBtn){
box.tagBtn.classList.add('cu-btn-null'); box.tagBtn.classList.add('cu-btn-null');
...@@ -1037,8 +1040,23 @@ var reqApis = function(){ ...@@ -1037,8 +1040,23 @@ var reqApis = function(){
tag.classList.remove('cu-btn-null'); tag.classList.remove('cu-btn-null');
box.tagBtn = tag; box.tagBtn = tag;
query.hours = ~~tag.dataset.id; query.hours = ~~tag.dataset.id;
console.log(query.hours,'hhhhh')
that.pageApi.reqchart(query).then((res) => { that.pageApi.reqchart(query).then((res) => {
var body = res.body || []; var body = res.body || [];
if(query.hours==1){
let rainData = body.lists
let valList=rainData.map(item=>{
return Number(item.values.rainfall)
})
let num = valList.reduce(function (total, value) {
return total + value;
}, 0);
num = num.toFixed(2)
console.log(num)
divID.innerHTML= "降雨总量:"+num+body.danwei
}else{
divID.innerHTML= ''
}
chartOpts.cache = Highchart.template.rich.call(that, chartEl, body, chartOpts); chartOpts.cache = Highchart.template.rich.call(that, chartEl, body, chartOpts);
}) })
}else if(tag.classList.contains('switch')){ }else if(tag.classList.contains('switch')){
...@@ -1719,7 +1737,7 @@ var reqApis = function(){ ...@@ -1719,7 +1737,7 @@ var reqApis = function(){
"content":{name:"说明", type:'text', style:'display:flex;width:100%;',}, "content":{name:"说明", type:'text', style:'display:flex;width:100%;',},
"implement":{name:"仪器", type:'text', style:'display:flex;width:100%;',}, "implement":{name:"仪器", type:'text', style:'display:flex;width:100%;',},
"precision":{name:"精度", type:'text', style:'display:flex;width:100%;',}, "precision":{name:"精度", type:'text', style:'display:flex;width:100%;',},
"value":{name:"人工监测值", must:true}, "value":{name:"人工监测值", must:true, ruleTip:'监测值必须为数字类型!', ruleType:'number'},
"time":{name:"添加时间", must:true, type:'datetime', format:'yyyy-MM-dd HH:mm:ss'}, "time":{name:"添加时间", must:true, type:'datetime', format:'yyyy-MM-dd HH:mm:ss'},
"sjvalue":{name:"系统监测值", type:'text', style:'display:flex;width:100%;',}, "sjvalue":{name:"系统监测值", type:'text', style:'display:flex;width:100%;',},
"sjtime":{name:"系统监测时间", type:'text', style:'display:flex;width:100%;',}, "sjtime":{name:"系统监测时间", type:'text', style:'display:flex;width:100%;',},
......
<template>
<useYm></useYm>
</template>
<script>
import useYm from '@/components/ym';
export default {
data() {
return {
name:"ym",
iphone:'110'
}
},
components: {useYm},
props:{
},
methods: {
},
}
</script>
<style>
</style>
...@@ -71,7 +71,9 @@ export default { ...@@ -71,7 +71,9 @@ export default {
loading: false, loading: false,
dataList:[], dataList:[],
}, },
rules: {}, rules:{
// value:[{required: true, message: '监测值必须为数字类型!', trigger: 'blur'}]
},
form: { form: {
title:'', visible:false, reqType:'add', historyDialog:false, title:'', visible:false, reqType:'add', historyDialog:false,
status:{cu:0}, status:{cu:0},
...@@ -89,7 +91,10 @@ export default { ...@@ -89,7 +91,10 @@ export default {
this.pageApi = Config.getModuleInfo(this); this.pageApi = Config.getModuleInfo(this);
this.Dict = this.pageApi.Dict; this.Dict = this.pageApi.Dict;
this.form.config = this.pageApi.config; this.form.config = this.pageApi.config;
this.rules = reqApi.getRules(this.Dict.baseInfo) || (this.Dict.rules || {}); this.rules = reqApi.getRules(this.Dict.baseInfo) || (this.Dict.rules || {});
console.log(this,"base")
console.log(this.rules,"con")
this.$nextTick(() => { this.$nextTick(() => {
this.loadData(); this.loadData();
}); });
......
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