12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232 |
- <template>
- <div class="app-container">
- <!-- <el-dialog
- v-dialogDrag
- ref="dialog__wrapper">
- <div class="dialog-body">
-
- <div
- class="line"
- v-dialogDrag Width="$refs.dialog__wrapper">1111111111111111111</div>
- </div>
- </el-dialog> -->
-
- <el-row :gutter="20">
- <el-col :span="18">
- <!-- <draggable v-model="arr1" group="itxst" animation="300" :group="{name: 'dashboard',pull: true}">
- <transition-group>
- <div style = "width:300px;height:20px;border:1px soild #333" :class="item.id==1?'item forbid':'item'" v-for="item in arr1" key="1">{{item.name}}</div>
- </transition-group>
- </draggable> -->
- <div class="search">
-
- <el-select v-model="tableObj.getDataParameters.parammaps.dateType" placeholder="查询日期" @change="change_date_type">
- <el-option v-for="item in dateTypeList" :key="item.id" :label="item.name" :value="item.id" ></el-option>
- </el-select>
-
- <el-select v-model="tableObj.getDataParameters.parammaps.type" filterable placeholder="数据类型" class="filter-item" style="width: 120px;" clearable>
- <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- <el-select v-model="tableObj.getDataParameters.parammaps.dimension" @change="change_dimension" filterable placeholder="维度" class="filter-item" style="width: 120px;" >
- <el-option v-for="item in dimensionList" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- <!-- <el-select v-model="tableObj.getDataParameters.parammaps.mixture" multiple placeholder="混料数据">
- <el-option v-for="item in mixtureList" :key="item.id" :label="item.name" :value="item.id" ></el-option>
- </el-select>
- <el-select v-model="tableObj.getDataParameters.parammaps.spread" multiple placeholder="撒料数据">
- <el-option v-for="item in spreadList" :key="item.id" :label="item.name" :value="item.id" ></el-option>
- </el-select> -->
-
- <el-cascader style = "width:400px;" ref = "cascader1" v-model="tableObj.getDataParameters.parammaps.mixture" :options="mixtureList" :props = "{ multiple: true, emitPath: false,}" :show-all-levels="false" @change="change_cascader1"></el-cascader>
- <el-cascader style = "width:400px;" ref = "cascader2" v-model="tableObj.getDataParameters.parammaps.spread" :options="spreadList" :props = "{ multiple: true, emitPath: false,}" :show-all-levels="false" @change="change_cascader2"></el-cascader>
-
-
- <el-button class="successBorder" @click="form_search">查询</el-button>
- <el-button class="successBorder" @click="form_clear">重置</el-button>
- </div>
- <div class="operation">
- <el-button class="success" icon="el-icon-plus" @click="form_add_screening">添加筛选条件</el-button>
- <el-button class="danger" icon="el-icon-delete" @click="form_clear_screening">清空筛选条件</el-button>
- </div>
- <div v-if="screeningVisible">
- <div class="search">
-
-
- <el-select v-model="screeningObj.screeningCondition" filterable placeholder="筛选条件" class="filter-item" style="width: 120px;" clearable @change="change_screening">
- <el-option v-for="item in screeningList" :key="item.id" :label="item.name" :value="item.id" />
- </el-select>
- <el-input v-model="screeningObj.screeningField" placeholder="筛选字段" style="width: 180px;" class="filter-item" clearable />
-
- <el-select v-model="screeningObj.screeningField" placeholder="筛选字段">
- <el-option v-for="item in screeningFieldList1" :key="item.id" :label="item.name" :value="item.id" ></el-option>
- </el-select>
- <el-select v-model="screeningObj.screeningField" placeholder="筛选字段">
- <el-option v-for="item in screeningFieldList2" :key="item.id" :label="item.name" :value="item.id" ></el-option>
- </el-select>
- <el-date-picker v-model="screeningObj.inputDatetime" class="inputDatetime filter-item" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" style="width: 250px;" />
-
- <el-button class="successBorder" @click="form_search_screening">查询</el-button>
- <el-button class="successBorder" @click="form_cancel_screening">重置</el-button>
- </div>
- <div>
- <el-row :gutter="20">
- <el-col :span="6" v-for = "(item,index) in screeningArr">
- <span style="font-size:14px;color:#555">{{index+1}}、条件:{{item.txt}}</span>
-
- </el-col>
- </el-row>
-
- </div>
-
- </div>
-
- <ChartTable/>
- <div>
- <!-- <div style = "">
- <el-select v-model="tableObj.getDataParameters.parammaps.dateType" multiple placeholder="维度">
- <el-option v-for="item in fieldTypeList" :key="item.id" :label="item.name" :value="item.id" ></el-option>
- </el-select>
- </div> -->
-
- <BarChart v-if = "chartData.chartType == 'bar'" :chart-data="chartData" />
- <LineChart v-if = "chartData.chartType == 'line'" :chart-data="chartData" />
- <HorizontalBarChart v-if = "chartData.chartType == 'line'" :chart-data="chartData" />
-
- <!-- <div id="chartLine" style="width:100%;height:385px;" >
- </div> -->
- </div>
-
- </el-col>
- <el-col :span="6">
-
- <div class="chart-style-panel">
- <el-form label-position="top" size="mini">
- <el-form-item label="图表类型">
- <div class="chart-type-list">
-
- <span @click="switch_chart_type(item)" v-for="item in chartTypeList" style = "display:inline-block;height:30px;width:30px;margin-right:10px;margin-bottom:10px">
- <el-tooltip :content="item.desc" placement="top">
- <svg-icon class="icon" style="height:20px;width:20px" :icon-class="item.isUse? item.icon : (item.icon + '_disabled')" />
- </el-tooltip>
- </span>
-
- </div>
- </el-form-item>
- </el-form>
- </div>
- </el-col>
- </el-row>
-
- </div>
- </template>
- <script>
- import echarts from 'echarts'
- import draggable from 'vuedraggable'
- import ChartTable from '@/componentChart/ChartTable.vue'
- import LineChart from '@/componentChart/LineChart.vue'
- import BarChart from '@/componentChart/BarChart.vue'
- // import HorizontalBarChart from '@/componentChart/BarChart.vue'
- require('echarts/theme/macarons')
- import { GetDataByName, PostDataByName, failproccess, ExecDataByConfig, checkButtons } from '@/api/common'
- import Cookies from 'js-cookie'
- import Pagination from '@/components/Pagination'
- import { MessageBox } from 'element-ui'
- export default {
- name: 'ChartPanel2',
- components: { Pagination, draggable , ChartTable ,LineChart,BarChart },
- data() {
- return {
-
- chartType:'line',
- chartTypeList:[
- // {type:'table', desc:"表格:任意维度数据" ,icon:'chart_table',isUse:true,id:0},
- {type:'line', desc:"折线图:任意维度数据" ,icon:'chart_line',isUse:false,id:0},
- {type:'bar', desc:"柱状图:任意维度数据" ,icon:'chart_bar',isUse:false,id:1},
- {type:'horizontal_bar', desc:"条形图:任意维度数据" ,icon:'horizontal_bar',isUse:false,id:2},
- {type:'pie', desc:"饼图:任意维度数据" ,icon:'chart_pie',isUse:false,id:3},
- {type:'line_bar', desc:"线柱图:任意维度数据" ,icon:'linebar_chart',isUse:false,id:4},
- ],
-
-
-
- isRoleEdit: [],
- dateTypeList: [
- { id: '汇总', name: '汇总' },
- { id: '分日', name: '分日' }
- ],
- typeList: [
- { id: '车次', name: '车次' },
- { id: '栏舍', name: '栏舍' }
- ],
- dimensionList: [
- { id: '栏舍', name: '栏舍' },
- { id: '配方', name: '配方' },
- { id: '班次', name: '班次' },
- { id: '车次', name: '车次' },
- { id: 'TMR', name: 'TMR' },
- { id: '牲畜大类', name: '牲畜大类' },
- { id: '牲畜小类', name: '牲畜小类' }
- ],
- //混料数据
- mixtureList: [],
- //撒料数据
- spreadList: [],
- //车次 - 数据1 - 栏舍 - 理论重量、实际重量、误差值、允许误差数、准确率(平均)、是否超出误差
- mixtureSpreadArr1: [
- {
- value: '理论重量',label: '理论重量',
- children: [
- { value: '理论重量-合计', label: '理论重量-合计'},
- { value: '理论重量-平均', label: '理论重量-平均'},
- { value: '理论重量-最大值', label: '理论重量-最大值'},
- { value: '理论重量-最小值', label: '理论重量-最小值'},
- { value: '理论重量-标准差', label: '理论重量-标准差'},
- { value: '理论重量-变异系数', label: '理论重量-变异系数'},
- ]
- },
- {
- value: '实际重量',label: '实际重量',
- children: [
- { value: '实际重量-合计', label: '实际重量-合计'},
- { value: '实际重量-平均', label: '实际重量-平均'},
- { value: '实际重量-最大值', label: '实际重量-最大值'},
- { value: '实际重量-最小值', label: '实际重量-最小值'},
- { value: '实际重量-标准差', label: '实际重量-标准差'},
- { value: '实际重量-变异系数', label: '实际重量-变异系数'},
- ]
- },
- {
- value: '误差值',label: '误差值',
- children: [
- { value: '误差值-合计', label: '误差值-合计'},
- { value: '误差值-平均', label: '误差值-平均'},
- { value: '误差值-最大值', label: '误差值-最大值'},
- { value: '误差值-最小值', label: '误差值-最小值'},
- { value: '误差值-标准差', label: '误差值-标准差'},
- { value: '误差值-变异系数', label: '误差值-变异系数'},
- ]
- },
- {
- value: '允许误差数',label: '允许误差数',
- children: [
- { value: '允许误差数-合计', label: '允许误差数-合计'},
- { value: '允许误差数-平均', label: '允许误差数-平均'},
- { value: '允许误差数-最大值', label: '允许误差数-最大值'},
- { value: '允许误差数-最小值', label: '允许误差数-最小值'},
- { value: '允许误差数-标准差', label: '允许误差数-标准差'},
- { value: '允许误差数-变异系数', label: '允许误差数-变异系数'},
- ]
- },
- { value: '准确率-平均',label: '准确率-平均'},
- { value: '是否超出误差',label: '是否超出误差'}
- ],
- //车次 - 数据2 - 配方 - 理论重量、实际重量、误差值、准确率(平均)
- mixtureSpreadArr2: [
- {
- value: '理论重量',label: '理论重量',
- children: [
- { value: '理论重量-合计', label: '理论重量-合计'},
- { value: '理论重量-平均', label: '理论重量-平均'},
- { value: '理论重量-最大值', label: '理论重量-最大值'},
- { value: '理论重量-最小值', label: '理论重量-最小值'},
- { value: '理论重量-标准差', label: '理论重量-标准差'},
- { value: '理论重量-变异系数', label: '理论重量-变异系数'},
- ]
- },
- {
- value: '实际重量',label: '实际重量',
- children: [
- { value: '实际重量-合计', label: '实际重量-合计'},
- { value: '实际重量-平均', label: '实际重量-平均'},
- { value: '实际重量-最大值', label: '实际重量-最大值'},
- { value: '实际重量-最小值', label: '实际重量-最小值'},
- { value: '实际重量-标准差', label: '实际重量-标准差'},
- { value: '实际重量-变异系数', label: '实际重量-变异系数'},
- ]
- },
- {
- value: '误差值',label: '误差值',
- children: [
- { value: '误差值-合计', label: '误差值-合计'},
- { value: '误差值-平均', label: '误差值-平均'},
- { value: '误差值-最大值', label: '误差值-最大值'},
- { value: '误差值-最小值', label: '误差值-最小值'},
- { value: '误差值-标准差', label: '误差值-标准差'},
- { value: '误差值-变异系数', label: '误差值-变异系数'},
- ]
- },
- { value: '准确率-平均',label: '准确率-平均'}
- ],
- //车次 - 数据3 - 班次 - 理论重量、实际重量、误差值、准确率(平均)、开始重量、结束重量
- mixtureSpreadArr3: [
- {
- value: '理论重量',label: '理论重量',
- children: [
- { value: '理论重量-合计', label: '理论重量-合计'},
- { value: '理论重量-平均', label: '理论重量-平均'},
- { value: '理论重量-最大值', label: '理论重量-最大值'},
- { value: '理论重量-最小值', label: '理论重量-最小值'},
- { value: '理论重量-标准差', label: '理论重量-标准差'},
- { value: '理论重量-变异系数', label: '理论重量-变异系数'},
- ]
- },
- {
- value: '实际重量',label: '实际重量',
- children: [
- { value: '实际重量-合计', label: '实际重量-合计'},
- { value: '实际重量-平均', label: '实际重量-平均'},
- { value: '实际重量-最大值', label: '实际重量-最大值'},
- { value: '实际重量-最小值', label: '实际重量-最小值'},
- { value: '实际重量-标准差', label: '实际重量-标准差'},
- { value: '实际重量-变异系数', label: '实际重量-变异系数'},
- ]
- },
- {
- value: '误差值',label: '误差值',
- children: [
- { value: '误差值-合计', label: '误差值-合计'},
- { value: '误差值-平均', label: '误差值-平均'},
- { value: '误差值-最大值', label: '误差值-最大值'},
- { value: '误差值-最小值', label: '误差值-最小值'},
- { value: '误差值-标准差', label: '误差值-标准差'},
- { value: '误差值-变异系数', label: '误差值-变异系数'},
- ]
- },
- { value: '准确率-平均',label: '准确率-平均'},
- {
- value: '开始重量',label: '开始重量',
- children: [
- { value: '开始重量-合计', label: '开始重量-合计'},
- { value: '开始重量-平均', label: '开始重量-平均'},
- { value: '开始重量-最大值', label: '开始重量-最大值'},
- { value: '开始重量-最小值', label: '开始重量-最小值'},
- { value: '开始重量-标准差', label: '开始重量-标准差'},
- { value: '开始重量-变异系数', label: '开始重量-变异系数'},
- ]
- },
- {
- value: '结束重量',label: '结束重量',
- children: [
- { value: '结束重量-合计', label: '结束重量-合计'},
- { value: '结束重量-平均', label: '结束重量-平均'},
- { value: '结束重量-最大值', label: '结束重量-最大值'},
- { value: '结束重量-最小值', label: '结束重量-最小值'},
- { value: '结束重量-标准差', label: '结束重量-标准差'},
- { value: '结束重量-变异系数', label: '结束重量-变异系数'},
- ]
- }
- ],
- //车次 - 数据4 - 车次 - 理论重量、实际重量、误差值、准确率(平均)、跳转方式、开始重量、结束重量、计划时间、开始时间、结束时间、过程时间
- mixtureSpreadArr4: [
- {
- value: '理论重量',label: '理论重量',
- children: [
- { value: '理论重量-合计', label: '理论重量-合计'},
- { value: '理论重量-平均', label: '理论重量-平均'},
- { value: '理论重量-最大值', label: '理论重量-最大值'},
- { value: '理论重量-最小值', label: '理论重量-最小值'},
- { value: '理论重量-标准差', label: '理论重量-标准差'},
- { value: '理论重量-变异系数', label: '理论重量-变异系数'},
- ]
- },
- {
- value: '实际重量',label: '实际重量',
- children: [
- { value: '实际重量-合计', label: '实际重量-合计'},
- { value: '实际重量-平均', label: '实际重量-平均'},
- { value: '实际重量-最大值', label: '实际重量-最大值'},
- { value: '实际重量-最小值', label: '实际重量-最小值'},
- { value: '实际重量-标准差', label: '实际重量-标准差'},
- { value: '实际重量-变异系数', label: '实际重量-变异系数'},
- ]
- },
- {
- value: '误差值',label: '误差值',
- children: [
- { value: '误差值-合计', label: '误差值-合计'},
- { value: '误差值-平均', label: '误差值-平均'},
- { value: '误差值-最大值', label: '误差值-最大值'},
- { value: '误差值-最小值', label: '误差值-最小值'},
- { value: '误差值-标准差', label: '误差值-标准差'},
- { value: '误差值-变异系数', label: '误差值-变异系数'},
- ]
- },
- { value: '准确率-平均',label: '准确率-平均'},
- { value: '跳转方式',label: '跳转方式'},
- {
- value: '开始重量',label: '开始重量',
- children: [
- { value: '开始重量-合计', label: '开始重量-合计'},
- { value: '开始重量-平均', label: '开始重量-平均'},
- { value: '开始重量-最大值', label: '开始重量-最大值'},
- { value: '开始重量-最小值', label: '开始重量-最小值'},
- { value: '开始重量-标准差', label: '开始重量-标准差'},
- { value: '开始重量-变异系数', label: '开始重量-变异系数'},
- ]
- },
- {
- value: '结束重量',label: '结束重量',
- children: [
- { value: '结束重量-合计', label: '结束重量-合计'},
- { value: '结束重量-平均', label: '结束重量-平均'},
- { value: '结束重量-最大值', label: '结束重量-最大值'},
- { value: '结束重量-最小值', label: '结束重量-最小值'},
- { value: '结束重量-标准差', label: '结束重量-标准差'},
- { value: '结束重量-变异系数', label: '结束重量-变异系数'},
- ]
- },
- { value: '计划时间',label: '计划时间'},
- { value: '开始时间',label: '开始时间'},
- { value: '结束时间',label: '结束时间'},
- { value: '过程时间',label: '过程时间'},
- ],
- //车次 - 数据5 - 牲畜大类 - 理论重量、实际重量、误差值、准确率(平均)
- //车次 - 数据5 - 牲畜小类 - 理论重量、实际重量、误差值、准确率(平均)
- //车次 - 数据5 - TMR - 理论重量、实际重量、误差值、准确率(平均)
- mixtureSpreadArr5: [
- {
- value: '理论重量',label: '理论重量',
- children: [
- { value: '理论重量-合计', label: '理论重量-合计'},
- { value: '理论重量-平均', label: '理论重量-平均'},
- { value: '理论重量-最大值', label: '理论重量-最大值'},
- { value: '理论重量-最小值', label: '理论重量-最小值'},
- { value: '理论重量-标准差', label: '理论重量-标准差'},
- { value: '理论重量-变异系数', label: '理论重量-变异系数'},
- ]
- },
- {
- value: '实际重量',label: '实际重量',
- children: [
- { value: '实际重量-合计', label: '实际重量-合计'},
- { value: '实际重量-平均', label: '实际重量-平均'},
- { value: '实际重量-最大值', label: '实际重量-最大值'},
- { value: '实际重量-最小值', label: '实际重量-最小值'},
- { value: '实际重量-标准差', label: '实际重量-标准差'},
- { value: '实际重量-变异系数', label: '实际重量-变异系数'},
- ]
- },
- {
- value: '误差值',label: '误差值',
- children: [
- { value: '误差值-合计', label: '误差值-合计'},
- { value: '误差值-平均', label: '误差值-平均'},
- { value: '误差值-最大值', label: '误差值-最大值'},
- { value: '误差值-最小值', label: '误差值-最小值'},
- { value: '误差值-标准差', label: '误差值-标准差'},
- { value: '误差值-变异系数', label: '误差值-变异系数'},
- ]
- },
- { value: '准确率-平均',label: '准确率-平均'}
- ],
- mixScreenArr:[],
- spreadScreenArr:[],
-
- screeningVisible:true,
- // 筛选条件
- screeningList: [
- // { id: '配方名称', name: '配方名称' },
- // { id: 'TMR名称', name: 'TMR名称' },
- // { id: '班次', name: '班次' },
- // { id: '车次计划', name: '车次计划' },
- ],
- // 筛选条件 - 参数
- screeningObj:{
- screeningCondition: '',
- screeningField: '',
- inputDatetime: '',
- startTime: '',
- stopTime: '',
- },
- // 筛选条件 - 参数
- screeningArr:[
-
-
-
- ],
-
- screeningFieldList1:[
- { id: '是', name: '是' },
- { id: '否', name: '否' }
- ],
- screeningFieldList2:[
- { id: '自动', name: '自动' },
- { id: '手动', name: '手动' }
- ],
- // 筛选条件 - 结果
-
- fieldTypeList: [
- { id: '配方A', name: '配方A' },
- { id: '配方B', name: '配方B' }
- ],
- tableObj: {
- getDataParameters: {
- name: 'getDriverList',
- page: 1,
- offset: 1,
- pagecount: parseInt(Cookies.get('pageCount')),
- returntype: 'Map',
- parammaps: {
- pastureid: Cookies.get('pastureid'),
- dateType:'',
- type: '',
- dimension: '',
- mixture: [],
- spread: [],
- }
- },
- tableKey: 0,
- list: [],
- total: 0,
- listLoading: false,
- temp: {}
- },
- chartData:{
- chartType:null,
- // xAxisArr: ['2019-01', '2019-02', '2019-03', '2019-04', '2019-05', '2019-06', '2019-07', '2019-08', '2019-09', '2019-10', '2019-11', '2019-12'],
- // legendArr: ['数据1', '数据2', '数据3', '数据4', '线条1'],
- // dataArr:[
- // [1, 10, 7, 0, 1, 7, 7, 6, 4, 4, 1, 6],
- // [1, 10, 7, 0, 1, 7, 7, 6, 4, 4, 1, 6],
- // [1, 10, 7, 0, 1, 7, 7, 6, 4, 4, 1, 6],
- // [2, 10, 3, 2, 10, 4, 4, 9, 3, 9, 3, 8],
- // [2, 10, 3, 2, 10, 4, 4, 9, 3, 9, 3, 8]
- // ]
- },
-
- chartLine_data2:{
- chartType:'pie',
- xAxisArr: ['2019-01', '2019-02', '2019-03', '2019-04', '2019-05', '2019-06', '2019-07', '2019-08', '2019-09', '2019-10', '2019-11', '2019-12'],
- legendArr: ['数据1', '数据2', '数据3', '数据4', '线条1'],
- dataArr:[1, 10, 7, 0, 1, 7, 7, 6, 4, 4, 1, 6],
-
- },
- chartLine_data3:{
- chartType:'line_bar',
- xAxisArr: ['2019-01', '2019-02', '2019-03', '2019-04', '2019-05', '2019-06', '2019-07', '2019-08', '2019-09', '2019-10', '2019-11', '2019-12'],
- legendArr1: ['数据1', '数据2', '数据3', '数据4' ],
- dataArr1:[
- [1, 10, 7, 0, 1, 7, 7, 6, 4, 4, 1, 6],
- [1, 10, 7, 0, 1, 7, 7, 6, 4, 4, 1, 6],
- [1, 10, 7, 0, 1, 7, 7, 6, 4, 4, 1, 6],
- [2, 10, 3, 2, 10, 4, 4, 9, 3, 9, 3, 8],
- ],
- legendArr2: ['数据5', '线条1'],
- dataArr2:[
- [1, 10, 7, 0, 1, 7, 7, 6, 4, 4, 1, 6],
- [1, 10, 7, 0, 1, 7, 7, 6, 4, 4, 1, 6],
- ]
- },
- requestParam: {},
- isokDisable: false,
- selectList: [],
- rowStyle: { maxHeight: 30 + 'px', height: 30 + 'px' },
- cellStyle: { padding: 0 + 'px' }
- }
- },
- created() {
- // console.log(VUE_APP_BASE_pageCount)
- // console.log(this.VUE_APP_BASE_pageCount, 'this.VUE_APP_BASE_pageCount')
- // this.getList()
- // this.getButtons()
-
- },
- methods: {
-
- getButtons() {
- const Edit = 'Driver'
- const isRoleEdit = checkButtons(JSON.parse(sessionStorage.getItem('buttons')), Edit)
- this.isRoleEdit = isRoleEdit
- },
- getList() {
- this.tableObj.listLoading = true
- GetDataByName(this.tableObj.getDataParameters).then(response => {
- console.log('table数据', response.data.list)
- if (response.data.list !== null) {
- for (let i = 0; i < response.data.list.length; i++) {
- this.$set(response.data.list[i], 'Edit', false) // 编辑
- this.$set(response.data.list[i], 'NoEdit', true) // 不可编辑/输入
- this.$set(response.data.list[i], 'isCreate', false) // 新增操作
- this.$set(response.data.list[i], 'isUpdate', true) // 编辑操作
- this.$set(response.data.list[i], 'isUpdateSave', false) // 编辑保存
- }
- this.tableObj.list = response.data.list
- this.tableObj.pageNum = response.data.pageNum
- this.tableObj.pageSize = response.data.pageSize
- this.tableObj.total = response.data.total
- } else {
- this.tableObj.list = []
- }
- setTimeout(() => {
- this.tableObj.listLoading = false
- }, 100)
- })
- },
-
- form_search() {
- console.log('点击了查询 - 表单 tableObj', this.tableObj.getDataParameters.parammaps)
- // this.tableObj.getDataParameters.offset = 1
- // this.getList()
- console.log('点击了查询 - this.chartLine_data', this.chartLine_data)
-
- this.roadChartLine(this.chartLine_data)
- },
- form_clear() {
- console.log('点击了重置')
- // this.tableObj.getDataParameters.parammaps.drivername = ''
- // this.tableObj.getDataParameters.parammaps.enable = ''
- // this.tableObj.getDataParameters.parammaps.drivercode = ''
- // this.tableObj.getDataParameters.offset = 1
- //this.getList()
- },
- //查询 - 汇总/分日
- change_date_type(value) {
- console.log('查询日期', value)
-
-
- },
- //维度
- change_dimension(value) {
- console.log('维度', value)
- this.tableObj.getDataParameters.parammaps.mixture = []
- this.tableObj.getDataParameters.parammaps.spread = []
- if(value == "栏舍"){
- this.mixtureList = this.mixtureSpreadArr1
- this.spreadList = this.mixtureSpreadArr1
- } else if(value == "配方"){
- this.mixtureList = this.mixtureSpreadArr2
- this.spreadList = this.mixtureSpreadArr2
- } else if(value == "班次"){
- this.mixtureList = this.mixtureSpreadArr3
- this.spreadList = this.mixtureSpreadArr3
- } else if(value == "车次"){
- this.mixtureList = this.mixtureSpreadArr4
- this.spreadList = this.mixtureSpreadArr4
- } else if(value == "牲畜大类" || value == "牲畜小类" || value == "TMR"){
- this.mixtureList = this.mixtureSpreadArr5
- this.spreadList = this.mixtureSpreadArr5
- }
-
- },
- //级联选择 - 混料数据
- change_cascader1(value) {
- console.log('级联选择 - 混料数据', value)
- var allNode = this.$refs['cascader1'].getCheckedNodes()
- console.log("级联选择 - 混料数据的Node", allNode)
- var mixScreenArr = []
-
- value.forEach(function(i){
- allNode.forEach(function(j){
- if(i == j.value){
- mixScreenArr.push({name: "混料-"+j.label, id:j.value})
- }
- })
- })
-
- // allNode.forEach(function(item){
- // if(item.children.length == 0){
- // mixScreenArr.push({name: "混料-"+item.label, id:item.value})
- // }
- // })
-
- var spreadScreenArr = this.spreadScreenArr
- this.mixScreenArr = mixScreenArr
- this.screeningList = mixScreenArr.concat(spreadScreenArr)
- },
- //级联选择 - 撒料数据
- change_cascader2(value) {
- console.log('级联选择 - 撒料数据', value)
- var allNode2 = this.$refs['cascader2'].getCheckedNodes()
-
- console.log("级联选择 - 撒料数据的Node", allNode2)
- var spreadScreenArr = []
- value.forEach(function(i){
- allNode2.forEach(function(j){
- if(i == j.value){
- spreadScreenArr.push({name: "撒料-"+j.label, id:j.value})
- }
- })
- })
- // allNode2.forEach(function(item){
- // if(item.children.length == 0){
- // spreadScreenArr.push({name: "撒料-"+item.label, id:item.value})
- // }
- // })
-
- var mixScreenArr = this.mixScreenArr
- this.spreadScreenArr = spreadScreenArr
- this.screeningList = mixScreenArr.concat(spreadScreenArr)
- },
-
- change_screening(value) {
- console.log('筛选', value)
- console.log('筛选数组', this.screeningList)
- },
- handleCreate() {
- // this.resetRequestParam()
- // this.dialogStatus = 'create'
- // this.parent = this.parentmenu
- // this.screeningVisible = true
- // this.$nextTick(() => {
- // this.$refs['dataForm'].clearValidate()
- // this.$refs.name.focus()
- // })
- },
-
-
- form_search_screening() {
- console.log('点击了筛选条件 - 确认 - screeningObj',this.screeningObj)
- var screeningCondition = this.screeningObj.screeningCondition
- var screeningField = this.screeningObj.screeningField
- var txt = { txt: screeningCondition + screeningField}
- console.log(txt)
- this.screeningArr.push(txt)
-
-
-
- },
- form_add_screening() {
- console.log('点击了查询')
- this.tableObj.getDataParameters.offset = 1
- this.getList()
- },
- form_clear_screening() {
- console.log('点击了查询')
- this.tableObj.getDataParameters.offset = 1
- this.getList()
- },
- form_cancel_screening() {
- console.log('点击了查询')
- this.tableObj.getDataParameters.offset = 1
- this.getList()
- },
- roadChartLine(chartLine_data) {
- console.log(1111111111)
- if (this.chartLine != null) {
- this.chartLine.dispose()
- }
- this.chartLine = echarts.init(document.getElementById('chartLine'))
- var option_line = {
- title: { text: 'Stacked Line' },
- tooltip: { trigger: 'axis' },
- legend: { data:chartLine_data.legendArr, right: 10, show: true, type: 'scroll' },
- grid: { top: '15%', left: '8%', right: '8%', containLabel: true },
- xAxis: [{ type: 'category',data:chartLine_data.xAxisArr }],
- yAxis: [
- {type: 'value', name: 'kg'},
-
- ],
- series: function (e) {
- var serie = [];
- for (var i = 0; i < chartLine_data.xAxisArr.length; i++) {
- console.log(i)
-
- var item = {
- name: chartLine_data.legendArr[i],
- data: chartLine_data.dataArr[i],
- type: 'line',
- emphasis: { label: { show: true, position: 'inside' } },
- }
-
- serie.push(item);
- }
- console.log(serie)
- return serie;
- }()
- // series: [
- // {
- // name: 'Email',
- // type: 'line',
- // stack: 'Total',
- // data: [120, 132, 101, 134, 90, 230, 210]
- // },
- // {
- // name: 'Union Ads',
- // type: 'line',
- // stack: 'Total',
- // data: [220, 182, 191, 234, 290, 330, 310]
- // },
- // {
- // name: 'Video Ads',
- // type: 'line',
- // stack: 'Total',
- // data: [150, 232, 201, 154, 190, 330, 410]
- // },
- // {
- // name: 'Direct',
- // type: 'line',
- // stack: 'Total',
- // data: [320, 332, 301, 334, 390, 330, 320]
- // },
- // {
- // name: 'Search Engine',
- // type: 'line',
- // stack: 'Total',
- // data: [820, 932, 901, 934, 1290, 1330, 1320]
- // }
- // ]
- }
- var option_bar = {
- title: { text: 'Stacked Line' },
- tooltip: { trigger: 'axis' },
- legend: { data:chartLine_data.legendArr, right: 10, show: true, type: 'scroll' },
- grid: { top: '15%', left: '8%', right: '8%', containLabel: true },
- xAxis: [{ type: 'category',data:chartLine_data.xAxisArr }],
- yAxis: [
- {type: 'value', name: 'kg'},
-
- ],
- series: function (e) {
- var serie = [];
- for (var i = 0; i < chartLine_data.xAxisArr.length; i++) {
- console.log(i)
-
- var item = {
- name: chartLine_data.legendArr[i],
- data: chartLine_data.dataArr[i],
- type: 'bar',
- emphasis: { label: { show: true, position: 'inside' } },
- }
-
- serie.push(item);
- }
- console.log(serie)
- return serie;
- }()
-
- }
-
- var option_horizontal_bar = {
- title: { text: 'Stacked Line' },
- tooltip: { trigger: 'axis' },
- legend: { data:chartLine_data.legendArr, right: 10, show: true, type: 'scroll' },
- grid: { top: '15%', left: '8%', right: '8%', containLabel: true },
- xAxis: {type: 'value', name: 'kg'},
- yAxis: [
- { type: 'category',data:chartLine_data.xAxisArr }
-
- ],
- series: function (e) {
- var serie = [];
- for (var i = 0; i < chartLine_data.xAxisArr.length; i++) {
- console.log(i)
-
- var item = {
- name: chartLine_data.legendArr[i],
- data: chartLine_data.dataArr[i],
- type: 'bar',
- emphasis: { label: { show: true, position: 'inside' } },
- }
-
- serie.push(item);
- }
- console.log(serie)
- return serie;
- }()
-
- }
- var option_pie = {
- title: { text: 'Stacked Line' },
- tooltip: { trigger: 'axis' },
- legend: { data:chartLine_data.legendArr, right: 10, show: true, },
- grid: { top: '15%', left: '8%', right: '8%', containLabel: true },
- xAxis: [{ type: 'category',data:chartLine_data.xAxisArr }],
- yAxis: [
- {type: 'value', name: 'kg'},
-
- ],
- series: function (e) {
- var serie = [
- {
- name: 'Access From',
- type: 'pie',
- radius: '50%',
- data: [
- // { value: 1048, name: 'Search Engine' },
- // { value: 735, name: 'Direct' },
- // { value: 580, name: 'Email' },
- // { value: 484, name: 'Union Ads' },
- // { value: 300, name: 'Video Ads' }
- ],
- emphasis: {
- itemStyle: {
- shadowBlur: 10,
- shadowOffsetX: 0,
- shadowColor: 'rgba(0, 0, 0, 0.5)'
- }
- }
- }
- ];
- for (var i = 0; i < chartLine_data.xAxisArr.length; i++) {
- console.log(i)
-
- var item = {
- name: chartLine_data.legendArr[i],
- value: chartLine_data.dataArr[i],
-
- }
-
- serie[0].data.push(item);
- }
- console.log(serie)
- return serie;
- }()
-
- }
-
- // var option_line_bar = {
-
- // title: { text: 'Stacked Line' },
- // tooltip: { trigger: 'axis' },
- // legend: { data: chartLine_data.legendArr1.concat( chartLine_data.legendArr2) , right: 10, show: true, type: 'scroll' },
- // grid: { top: '15%', left: '8%', right: '8%', containLabel: true },
- // xAxis: [{ type: 'category',data:chartLine_data.xAxisArr }],
- // yAxis: [
- // {type: 'value', name: 'kg'},
-
- // ],
- // series: function (e) {
- // var serie = [];
- // for (var i = 0; i < chartLine_data.xAxisArr.length; i++) {
-
- // var item = {
- // name: chartLine_data.legendArr1[i],
- // data: chartLine_data.dataArr1[i],
- // type: 'line',
- // emphasis: { label: { show: true, position: 'inside' } },
- // }
-
-
- // serie.push(item);
- // }
- // for (var i = 0; i < chartLine_data.xAxisArr.length; i++) {
-
- // var item = {
- // name: chartLine_data.legendArr2[i],
- // data: chartLine_data.dataArr2[i],
- // type: 'bar',
- // emphasis: { label: { show: true, position: 'inside' } },
- // }
-
- // serie.push(item);
- // }
- // console.log(serie)
- // return serie;
- // }()
-
- // }
- var option_line_bar = {
- tooltip: {
- trigger: 'axis',
- axisPointer: {
- type: 'cross',
- crossStyle: {
- color: '#999'
- }
- }
- },
- toolbox: {
- feature: {
- dataView: { show: true, readOnly: false },
- magicType: { show: true, type: ['line', 'bar'] },
- restore: { show: true },
- saveAsImage: { show: true }
- }
- },
- legend: {
- data: ['Evaporation', 'Precipitation', 'Temperature']
- },
- xAxis: [
- {
- type: 'category',
- data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
- axisPointer: {
- type: 'shadow'
- }
- }
- ],
- yAxis: [
- {
- type: 'value',
- name: 'Precipitation',
- min: 0,
- max: 250,
- interval: 50,
- axisLabel: {
- formatter: '{value} ml'
- }
- },
- {
- type: 'value',
- name: 'Temperature',
- min: 0,
- max: 25,
- interval: 5,
- axisLabel: {
- formatter: '{value} °C'
- }
- }
- ],
- series: [
- {
- name: 'Evaporation',
- type: 'bar',
- data: [
- 2.0, 4.9, 7.0, 23.2, 25.6, 76.7, 135.6, 162.2, 32.6, 20.0, 6.4, 3.3
- ]
- },
- {
- name: 'Precipitation',
- type: 'bar',
- data: [
- 2.6, 5.9, 9.0, 26.4, 28.7, 70.7, 175.6, 182.2, 48.7, 18.8, 6.0, 2.3
- ]
- },
- {
- name: 'Temperature',
- type: 'line',
- yAxisIndex: 1,
- data: [2.0, 2.2, 3.3, 4.5, 6.3, 10.2, 20.3, 23.4, 23.0, 16.5, 12.0, 6.2]
- }
- ]
- };
-
- if(chartLine_data.chartType == 'line'){
- this.chartLine.setOption(option_line)
- } else if(chartLine_data.chartType == 'bar'){
- this.chartLine.setOption(option_bar)
- } else if(chartLine_data.chartType == 'horizontal_bar'){
- this.chartLine.setOption(option_horizontal_bar)
- } else if(chartLine_data.chartType == 'pie'){
- this.chartLine.setOption(option_pie)
- } else if(chartLine_data.chartType == 'line_bar'){
- this.chartLine.setOption(option_line_bar)
- }
-
-
- window.onresize = function() {
- this.chartLine.resize()
- }
- },
- //切换图表类型
- switch_chart_type(item){
- console.log(item)
- console.log(this.chartTypeList)
- var chartTypeList = this.chartTypeList
- chartTypeList.forEach(function(i){
- i.isUse = false
- })
- chartTypeList[item.id].isUse = true
- this.chartType = item.type
- this.chartTypeList = chartTypeList
- if(item.type == 'line'){
- this.chartData = {
- chartType:'line',
- xAxisArr: ['2019-01', '2019-02', '2019-03', '2019-04', '2019-05', '2019-06', '2019-07', '2019-08', '2019-09', '2019-10', '2019-11', '2019-12'],
- legendArr: ['数据1', '数据2', '数据3'],
- dataArr:[
- [1, 10, 7, 0, 1, 7, 7, 6, 4, 4, 1, 6],
- [1, 10, 7, 0, 1, 7, 7, 6, 4, 4, 1, 6],
- [1, 10, 7, 0, 1, 7, 7, 6, 4, 4, 1, 6],
- ]
- }
- } else if(item.type == 'bar'){
- this.chartData = {
- chartType:'bar',
- xAxisArr: ['2019-01', '2019-02', '2019-03', '2019-04', '2019-05', '2019-06', '2019-07', '2019-08', '2019-09', '2019-10', '2019-11', '2019-12'],
- legendArr: ['数据1', '数据2', '数据3'],
- dataArr:[
- [1, 10, 7, 0, 1, 7, 7, 6, 4, 4, 1, 6],
- [1, 10, 7, 0, 1, 7, 7, 6, 4, 4, 1, 6],
- [1, 10, 7, 0, 1, 7, 7, 6, 4, 4, 1, 6],
-
- ]
- }
-
- } else if(item.type == 'horizontal_bar'){
- this.chartData = {
- chartType:'horizontal_bar',
- xAxisArr: ['2019-01', '2019-02', '2019-03', '2019-04', '2019-05', '2019-06', '2019-07', '2019-08', '2019-09', '2019-10', '2019-11', '2019-12'],
- legendArr: ['数据1', '数据2', '数据3'],
- dataArr:[
- [1, 10, 7, 0, 1, 7, 7, 6, 4, 4, 1, 6],
- [1, 10, 7, 0, 1, 7, 7, 6, 4, 4, 1, 6],
- [1, 10, 7, 0, 1, 7, 7, 6, 4, 4, 1, 6],
-
- ]
- }
- }
- // if(item.type == 'line'){
- // this.chartLine_data.chartType = 'line'
- // this.roadChartLine(this.chartLine_data)
- // } else if(item.type == 'bar'){
- // this.chartLine_data.chartType = 'bar'
- // this.roadChartLine(this.chartLine_data)
- // } else if(item.type == 'horizontal_bar'){
- // this.chartLine_data.chartType = 'horizontal_bar'
- // this.roadChartLine(this.chartLine_data)
- // } else if(item.type == 'pie'){
- // this.chartLine_data2.chartType = 'pie'
- // this.roadChartLine(this.chartLine_data2)
- // } else if(item.type == 'line_bar'){
- // console.log(1111)
- // this.chartLine_data3.chartType = 'line_bar'
- // console.log(this.chartLine_data3)
- // this.roadChartLine(this.chartLine_data3)
-
- // }
-
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .search{margin-top:10px;}
- .table{margin-top:10px;}
- </style>
|