ocpview-plus 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +0 -0
- package/README.md +0 -0
- package/dist/efviewplus.min.esm.js +99954 -0
- package/dist/efviewplus.min.js +142 -0
- package/dist/locale/lang.js +1 -0
- package/dist/locale/zh-CN.js +1 -0
- package/dist/locale/zh-TW.js +1 -0
- package/dist/locale/zh-UG.js +1 -0
- package/dist/style.css +9 -0
- package/dist/styles/efviewplus.css +1 -0
- package/package.json +144 -0
- package/src/components/base/controlbase.vue +191 -0
- package/src/components/base/controlbox.vue +102 -0
- package/src/components/base/index.js +3 -0
- package/src/components/base/load.js +20 -0
- package/src/components/base/probase.js +220 -0
- package/src/components/base/size.js +78 -0
- package/src/components/billbox/billbox.vue +68 -0
- package/src/components/billbox/index.js +2 -0
- package/src/components/cascaderbox/cascaderbox.vue +184 -0
- package/src/components/cascaderbox/index.js +2 -0
- package/src/components/checkbox/checkbox.vue +76 -0
- package/src/components/checkbox/checkgroupbox.vue +104 -0
- package/src/components/checkbox/index.js +3 -0
- package/src/components/colorbox/colorbox.vue +44 -0
- package/src/components/colorbox/index.js +2 -0
- package/src/components/combobox/combobox.vue +220 -0
- package/src/components/combobox/index.js +2 -0
- package/src/components/conditionbox/conditionbase.vue +195 -0
- package/src/components/conditionbox/conditionbox.vue +63 -0
- package/src/components/conditionbox/conditionfilterbox.vue +477 -0
- package/src/components/conditionbox/conditionselectorbox.vue +237 -0
- package/src/components/conditionbox/index.js +5 -0
- package/src/components/conditionbox/queryconditionbox.vue +26 -0
- package/src/components/conditionbox/queryconditionboxbase.vue +124 -0
- package/src/components/conditionbox/searchconditionbox.vue +114 -0
- package/src/components/conditionbox/searchgrid.vue +391 -0
- package/src/components/datebox/datebox.vue +129 -0
- package/src/components/datebox/daterangebox.vue +155 -0
- package/src/components/datebox/index.js +3 -0
- package/src/components/form/baseform.vue +677 -0
- package/src/components/form/detailsbox.vue +487 -0
- package/src/components/form/formbox.vue +29 -0
- package/src/components/form/formcardbox.vue +268 -0
- package/src/components/form/formcardgroupbox.vue +252 -0
- package/src/components/form/formcompro.js +19 -0
- package/src/components/form/formdetail.vue +129 -0
- package/src/components/form/formdetailtwo.vue +302 -0
- package/src/components/form/index.js +8 -0
- package/src/components/form/toolanchor.js +46 -0
- package/src/components/form/workform.vue +168 -0
- package/src/components/grid/basegrid.vue +1061 -0
- package/src/components/grid/editgrid.vue +51 -0
- package/src/components/grid/editgridbase.vue +947 -0
- package/src/components/grid/editgridcard.vue +193 -0
- package/src/components/grid/expandrow.vue +137 -0
- package/src/components/grid/index.js +6 -0
- package/src/components/grid/viewgrid.vue +122 -0
- package/src/components/grid/viewgridbase.vue +1284 -0
- package/src/components/icon/common-icon.vue +53 -0
- package/src/components/icon/eicon.vue +29 -0
- package/src/components/icon/icons.vue +42 -0
- package/src/components/icon/index.js +2 -0
- package/src/components/label/index.js +3 -0
- package/src/components/label/showtext.vue +95 -0
- package/src/components/load/loadcartoon.vue +228 -0
- package/src/components/map/index.js +2 -0
- package/src/components/map/mapbox.vue +348 -0
- package/src/components/masterplate/appendix.vue +586 -0
- package/src/components/masterplate/approval.vue +803 -0
- package/src/components/masterplate/base.vue +985 -0
- package/src/components/masterplate/billasyncimport.vue +614 -0
- package/src/components/masterplate/billconditionbox.vue +224 -0
- package/src/components/masterplate/billconditionsbox.vue +427 -0
- package/src/components/masterplate/billdetailform.vue +990 -0
- package/src/components/masterplate/billimport.vue +263 -0
- package/src/components/masterplate/billquerygrid.vue +316 -0
- package/src/components/masterplate/billsinglegrid.vue +234 -0
- package/src/components/masterplate/birtreport.vue +185 -0
- package/src/components/masterplate/detailbtntoolbar.vue +311 -0
- package/src/components/masterplate/detailsbox.vue +386 -0
- package/src/components/masterplate/editgridcard.vue +222 -0
- package/src/components/masterplate/editgridcard2.vue +109 -0
- package/src/components/masterplate/formcard.vue +106 -0
- package/src/components/masterplate/formcardgroupbox.vue +168 -0
- package/src/components/masterplate/formdetailtwo.vue +356 -0
- package/src/components/masterplate/gridcolset.vue +227 -0
- package/src/components/masterplate/index.js +23 -0
- package/src/components/masterplate/layouttemplate.vue +33 -0
- package/src/components/masterplate/leftlistrightdetails.vue +474 -0
- package/src/components/masterplate/leftlistrightlist.vue +465 -0
- package/src/components/masterplate/lefttreerightdetails.vue +619 -0
- package/src/components/masterplate/levelreport.vue +510 -0
- package/src/components/masterplate/listbtntoolbar.vue +257 -0
- package/src/components/masterplate/listdetails.vue +769 -0
- package/src/components/masterplate/operlog.vue +272 -0
- package/src/components/masterplate/options.vue +110 -0
- package/src/components/masterplate/page.vue +102 -0
- package/src/components/masterplate/promptmessage.vue +74 -0
- package/src/components/masterplate/querybar.vue +490 -0
- package/src/components/masterplate/report.vue +357 -0
- package/src/components/masterplate/rowbtntoolbar.vue +126 -0
- package/src/components/masterplate/simpletree.vue +129 -0
- package/src/components/masterplate/simpleviewgrid.vue +144 -0
- package/src/components/mychart/bar/bar.vue +202 -0
- package/src/components/mychart/basechart.vue +190 -0
- package/src/components/mychart/complexmychart/barline.vue +154 -0
- package/src/components/mychart/gauge/gauge.vue +83 -0
- package/src/components/mychart/index.js +9 -0
- package/src/components/mychart/line/line.vue +202 -0
- package/src/components/mychart/liquidfill/liquidfill.vue +109 -0
- package/src/components/mychart/pie/pie.vue +96 -0
- package/src/components/mychart/radar/radar.vue +122 -0
- package/src/components/mychart/scatter/scatter.vue +76 -0
- package/src/components/numberbox/append.js +11 -0
- package/src/components/numberbox/index.js +3 -0
- package/src/components/numberbox/numberbox.vue +303 -0
- package/src/components/numberbox/numberrangebox.vue +423 -0
- package/src/components/picturebox/filebox.vue +365 -0
- package/src/components/picturebox/index.js +3 -0
- package/src/components/picturebox/picturebox.vue +541 -0
- package/src/components/picturebox/uploadbox.vue +164 -0
- package/src/components/poptagbox/index.js +2 -0
- package/src/components/poptagbox/poptagbox.vue +389 -0
- package/src/components/poptextbox/index.js +2 -0
- package/src/components/poptextbox/poptextbox.vue +601 -0
- package/src/components/radiobox/index.js +2 -0
- package/src/components/radiobox/radiogroupbox.vue +76 -0
- package/src/components/richtextbox/editor.vue +150 -0
- package/src/components/richtextbox/index.js +2 -0
- package/src/components/richtextbox/richtextbox.vue +448 -0
- package/src/components/textbox/index.js +2 -0
- package/src/components/textbox/textbox.vue +98 -0
- package/src/components/timebox/index.js +2 -0
- package/src/components/timebox/timebox.vue +76 -0
- package/src/components/toolbar/ebutton.vue +169 -0
- package/src/components/toolbar/index.js +3 -0
- package/src/components/toolbar/toolbar.vue +446 -0
- package/src/components/tree/basetree.vue +725 -0
- package/src/components/tree/index.js +3 -0
- package/src/components/tree/treedata.vue +51 -0
- package/src/components/tree/treedatabase.vue +189 -0
- package/src/components/upload/billimport.vue +233 -0
- package/src/components/upload/index.js +2 -0
- package/src/components/videobox/index.js +2 -0
- package/src/components/videobox/uploadbox.vue +148 -0
- package/src/components/videobox/videobox.vue +503 -0
- package/src/components/wrichtextbox/editor.vue +219 -0
- package/src/components/wrichtextbox/index.js +2 -0
- package/src/components/wrichtextbox/wrichtextbox.vue +63 -0
- package/src/index.js +215 -0
- package/src/locale/format.js +51 -0
- package/src/locale/index.js +63 -0
- package/src/locale/lang/zh-CN.js +123 -0
- package/src/locale/lang/zh-TW.js +114 -0
- package/src/locale/lang/zh-UG.js +115 -0
- package/src/locale/lang.js +15 -0
- package/src/method/case/case.js +1180 -0
- package/src/method/config/queryconfig.js +24 -0
- package/src/method/const/const.js +815 -0
- package/src/method/index.js +8 -0
- package/src/static/excel/exportexcel.js +627 -0
- package/src/static/iview/coustom.js +463 -0
- package/src/store/index.js +19 -0
- package/src/store/modules/app.js +53 -0
- package/src/styles/README.md +3 -0
- package/src/styles/common.less +75 -0
- package/src/styles/components/anchor.less +74 -0
- package/src/styles/components/approval.less +136 -0
- package/src/styles/components/button.less +208 -0
- package/src/styles/components/card.less +51 -0
- package/src/styles/components/content.less +38 -0
- package/src/styles/components/font.less +314 -0
- package/src/styles/components/form.less +72 -0
- package/src/styles/components/iconfont/fonts/iconfont.less +1376 -0
- package/src/styles/components/iconfont/fonts/iconfont.svg +699 -0
- package/src/styles/components/iconfont/fonts/iconfont.ttf +0 -0
- package/src/styles/components/iconfont/fonts/iconfont.woff +0 -0
- package/src/styles/components/iconfont/fonts/iconfont.woff2 +0 -0
- package/src/styles/components/index.less +16 -0
- package/src/styles/components/input.less +290 -0
- package/src/styles/components/modal.less +203 -0
- package/src/styles/components/page.less +340 -0
- package/src/styles/components/select.less +361 -0
- package/src/styles/components/steps.less +367 -0
- package/src/styles/components/table.less +544 -0
- package/src/styles/components/tabs.less +249 -0
- package/src/styles/components/upload.less +83 -0
- package/src/styles/custom.less +67 -0
- package/src/styles/index.less +6 -0
- package/src/styles/pack.less +6 -0
- package/src/utils/EfuMessenger.js +155 -0
- package/src/utils/assist.js +353 -0
- package/src/utils/index.js +1 -0
- package/src/utils/random_str.js +10 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<div ref="head">
|
|
4
|
+
<Row v-if="showCondition">
|
|
5
|
+
<Col span='24'>
|
|
6
|
+
<ConditionBox ref="condition" :config="myConfig" @conditionAction="conditionAction" :dictData="dictData" :isPop="isPop"></ConditionBox>
|
|
7
|
+
</Col>
|
|
8
|
+
</Row>
|
|
9
|
+
</div>
|
|
10
|
+
<template v-if="!myConfig.multiSelectGrid">
|
|
11
|
+
<Card :padding="0" :bordered="false" dis-hover>
|
|
12
|
+
<Table ref="table" :class="isFlag" :row-class-name="myConfig.rowClassName" :loading="loading" :show-summary="myConfig.showSummary" :summary-method="handleSummary" :size="myConfig.tableSize" :stripe="myConfig.showStripe" :border="myConfig.showBorder" :height="tableHeight" :max-height="tableMaxHeight" :show-header="myConfig.showHeader" :columns="tableColumns" :data="tempData" @on-sort-change="sortChagne" @on-current-change="onCurrentChange" :highlight-row="myConfig.highLightRow" @on-row-dblclick="dbclick" @on-select="onSelect" @on-select-cancel="onSelectCancel" @on-selection-change="OnSelectionChange" @on-row-click="click" @on-column-width-resize="onColumnWidthResize">
|
|
13
|
+
<template v-for="config in soltTableColumns" v-slot:[config.key]="{ row, index }" :key="'show_' + config.key">
|
|
14
|
+
<ShowText :label="formatValue(index,config,row)" :contentAlign="config.contentAlign" :class="config.cellClassName" :config="config" :rowIndex="index"></ShowText>
|
|
15
|
+
</template>
|
|
16
|
+
</Table>
|
|
17
|
+
</Card>
|
|
18
|
+
<div ref="page" name="page">
|
|
19
|
+
<div v-if="myConfig.showPage" style="padding-top:10px;" >
|
|
20
|
+
<Card :bordered="false" :padding="0" :dis-hover="true" style="border-radius:0px">
|
|
21
|
+
<Row type="flex" justify="end" style="padding-right:10px">
|
|
22
|
+
<PageCustom v-model="culPage" :total="myConfig.pageConfig.total_results" :size="myConfig.pageSize" :current="myConfig.pageConfig.page_no" :page-size="myConfig.pageConfig.page_size" :page-size-opts="myConfig.pageConfig.pageSizeList" @on-page-size-change="changePageSize" @on-change="changePage" :show-total="myConfig.pageShowTotal" :show-elevator="myConfig.pageShowElevator" :show-sizer="myConfig.pageShowSizer"></PageCustom>
|
|
23
|
+
</Row>
|
|
24
|
+
</Card>
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</template>
|
|
28
|
+
<template v-else>
|
|
29
|
+
<Row type="flex" justify="center" align="middle" >
|
|
30
|
+
<Col :span="gridCol">
|
|
31
|
+
<Card :padding="0" bordered dis-hover>
|
|
32
|
+
<template #title>
|
|
33
|
+
<span v-text="myConfig.gridTitle"></span>
|
|
34
|
+
</template>
|
|
35
|
+
<Table ref="table" :row-class-name="myConfig.rowClassName" :show-summary="myConfig.showSummary" :summary-method="handleSummary" :loading="loading" :size="myConfig.tableSize" :stripe="myConfig.showStripe" :border="myConfig.showBorder" :height="tableHeight" :max-height="tableMaxHeight" :show-header="myConfig.showHeader" :columns="tableColumns" :data="tempData" @on-sort-change="sortChagne" @on-current-change="onCurrentChange" :highlight-row="myConfig.highLightRow" @on-row-dblclick="dbclick" @on-select="onSelect" @on-select-cancel="onSelectCancel" @on-selection-change="OnSelectionChange" @on-row-click="click" @on-column-width-resize="onColumnWidthResize">
|
|
36
|
+
<template v-for="config in soltTableColumns" v-slot:[config.key]="{ row, index }" :key="'show_' + config.key">
|
|
37
|
+
<ShowText :label="formatValue(index,config,row)" :contentAlign="config.contentAlign" :class="config.cellClassName" :config="config" :rowIndex="index"></ShowText>
|
|
38
|
+
</template>
|
|
39
|
+
</Table>
|
|
40
|
+
</Card>
|
|
41
|
+
<div ref="page" name="page">
|
|
42
|
+
<div v-if="myConfig.showPage" ref="page" style="padding-top:10px;">
|
|
43
|
+
<Card :bordered="false" :padding="0" :dis-hover="true" style="border-radius:0px">
|
|
44
|
+
<Row type="flex" justify="end" style="padding-right:10px" :gutter="0">
|
|
45
|
+
<PageCustom v-model="culPage" :total="myConfig.pageConfig.total_results" :size="myConfig.pageSize" :current="myConfig.pageConfig.page_no" :page-size="myConfig.pageConfig.page_size" :page-size-opts="myConfig.pageConfig.pageSizeList" @on-page-size-change="changePageSize" @on-change="changePage" :show-total="myConfig.pageShowTotal" :show-elevator="myConfig.pageShowElevator" :show-sizer="myConfig.pageShowSizer"></PageCustom>
|
|
46
|
+
</Row>
|
|
47
|
+
</Card>
|
|
48
|
+
</div>
|
|
49
|
+
</div>
|
|
50
|
+
</Col>
|
|
51
|
+
<Col span= '2'>
|
|
52
|
+
<Row type="flex" justify="center" align="middle" style="padding:5px;" >
|
|
53
|
+
<Tooltip content="删除" placement="left">
|
|
54
|
+
<Button type="primary" size="small" icon="ios-arrow-back" :disabled="!rightActive" @click="moveToLeft"></Button>
|
|
55
|
+
</Tooltip>
|
|
56
|
+
</Row>
|
|
57
|
+
<Row type="flex" justify="center" align="middle" style="padding:5px;" >
|
|
58
|
+
<Tooltip content="添加" placement="right">
|
|
59
|
+
<Button type="primary" size="small" icon="ios-arrow-forward" :disabled="!leftActive" @click="moveToRight"></Button>
|
|
60
|
+
</Tooltip>
|
|
61
|
+
</Row>
|
|
62
|
+
</Col>
|
|
63
|
+
<Col :span="multiGridCol" style="padding-bottom: 40px;">
|
|
64
|
+
<Card :padding="0" bordered dis-hover>
|
|
65
|
+
<template #title>
|
|
66
|
+
<span v-text="myConfig.multiGridTitle"></span>
|
|
67
|
+
</template>
|
|
68
|
+
<Table ref="multiSelectTable" :row-class-name="myConfig.rowClassName" :size="myConfig.tableSize" :stripe="myConfig.showStripe" :border="myConfig.showBorder" :height="tableHeight" :max-height="tableMaxHeight" :show-header="myConfig.showHeader" :columns="multiTableColumns" :data="tempMultiSelectData" :highlight-row="myConfig.highLightRow" @on-selection-change="OnMultiSelectionChange">
|
|
69
|
+
<template v-for="config in multiSoltTableColumns" v-slot:[config.key]="{ row, index }" :key="'mshow_' + config.key">
|
|
70
|
+
<ShowText :label="formatMulValue(index,config,row)" :contentAlign="config.contentAlign" ></ShowText>
|
|
71
|
+
</template>
|
|
72
|
+
</Table>
|
|
73
|
+
</Card>
|
|
74
|
+
</Col>
|
|
75
|
+
</Row>
|
|
76
|
+
</template>
|
|
77
|
+
</div>
|
|
78
|
+
</template>
|
|
79
|
+
<script>
|
|
80
|
+
import Base from '@/components/grid/viewgridbase.vue';
|
|
81
|
+
export default {
|
|
82
|
+
name: 'mimpleviewgrid',
|
|
83
|
+
extends: Base,
|
|
84
|
+
methods: {
|
|
85
|
+
initCheckColumn(columns) {
|
|
86
|
+
if (this.myConfig.showCheckBox) {
|
|
87
|
+
let check = {};
|
|
88
|
+
check.type = 'selection';
|
|
89
|
+
check.align = 'center';
|
|
90
|
+
check.key ='selection';
|
|
91
|
+
check.width = 40;
|
|
92
|
+
check.multiSelect = this.myConfig.multiSelect;
|
|
93
|
+
columns.push(check);
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
initIndexColumn(columns) {
|
|
97
|
+
if (this.myConfig.showIndex) {
|
|
98
|
+
if (this.myConfig.showSumGroup) {
|
|
99
|
+
let indexConfig = {
|
|
100
|
+
label: '行号',
|
|
101
|
+
name: 'sumindex',
|
|
102
|
+
type: 'TextBox',
|
|
103
|
+
align: 'center',
|
|
104
|
+
width: 45
|
|
105
|
+
};
|
|
106
|
+
if (this.myConfig.items[0].name !== 'sumindex') {
|
|
107
|
+
this.myConfig.items.splice(0, 0, indexConfig);
|
|
108
|
+
}
|
|
109
|
+
} else {
|
|
110
|
+
let index = {};
|
|
111
|
+
index.type = 'index';
|
|
112
|
+
index.key = 'index';
|
|
113
|
+
index.width = 45;
|
|
114
|
+
index.title = '行号';
|
|
115
|
+
index.align = 'center';
|
|
116
|
+
if (this.myConfig.fixedIndex){
|
|
117
|
+
index.fixed = 'left';
|
|
118
|
+
}
|
|
119
|
+
if (this.myConfig.headClassName !== undefined) {
|
|
120
|
+
index.className = this.myConfig.headClassName;
|
|
121
|
+
}
|
|
122
|
+
index.indexMethod = this.indexRender;
|
|
123
|
+
if (this.myConfig.indexConfig !== undefined) {
|
|
124
|
+
Object.assign(index, this.myConfig.indexConfig);
|
|
125
|
+
}
|
|
126
|
+
columns.push(index);
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
computed:{
|
|
132
|
+
isFlag () {
|
|
133
|
+
if (this.$refs.table) {
|
|
134
|
+
if (this.$refs.table.el.height > this.tableHeight) {
|
|
135
|
+
return 'efuture-viewgrid'
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return '';
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
mounted () {
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
</script>
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div :style="currentStyle" ref="mychart">
|
|
3
|
+
</div>
|
|
4
|
+
</template>
|
|
5
|
+
|
|
6
|
+
<script>
|
|
7
|
+
import Base from '@/components/mychart/basechart.vue';
|
|
8
|
+
// 引入柱状图组件
|
|
9
|
+
require('echarts/lib/chart/bar');
|
|
10
|
+
export default {
|
|
11
|
+
name: 'bar',
|
|
12
|
+
extends: Base,
|
|
13
|
+
data () {
|
|
14
|
+
return {
|
|
15
|
+
mychartconfig: {
|
|
16
|
+
tooltip: {
|
|
17
|
+
trigger: 'axis'
|
|
18
|
+
},
|
|
19
|
+
legend: {
|
|
20
|
+
data: []
|
|
21
|
+
},
|
|
22
|
+
grid: {
|
|
23
|
+
left: '2%',
|
|
24
|
+
right: '2%',
|
|
25
|
+
bottom: '2%',
|
|
26
|
+
containLabel: true
|
|
27
|
+
},
|
|
28
|
+
xAxis: [
|
|
29
|
+
{
|
|
30
|
+
type: 'category',
|
|
31
|
+
data: []
|
|
32
|
+
}
|
|
33
|
+
],
|
|
34
|
+
yAxis: [
|
|
35
|
+
{
|
|
36
|
+
type: 'value'
|
|
37
|
+
}
|
|
38
|
+
],
|
|
39
|
+
series: []
|
|
40
|
+
},
|
|
41
|
+
myConfig:{
|
|
42
|
+
xfieldname:'', // x轴字段名
|
|
43
|
+
xdata:'', // x轴数据
|
|
44
|
+
cfieldname:'', // 分类字段名
|
|
45
|
+
cdata:'', // 分类数据
|
|
46
|
+
yfieldname:'', //值字段名
|
|
47
|
+
ydata:'',
|
|
48
|
+
mychartconfig:{},
|
|
49
|
+
valueAxis:'y'
|
|
50
|
+
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
},
|
|
54
|
+
methods: {
|
|
55
|
+
customInitMychartConfig () {
|
|
56
|
+
let curlConfig = Object.assign({},this.mychartconfig,this.myConfig.mychartconfig);
|
|
57
|
+
let tempData = {};
|
|
58
|
+
let xObj = {};
|
|
59
|
+
let xData = [];
|
|
60
|
+
let legendData = [];
|
|
61
|
+
let self = this;
|
|
62
|
+
let series = [];
|
|
63
|
+
if (this.currentData && this.currentData.length > 0) {
|
|
64
|
+
this.currentData.forEach(el => {
|
|
65
|
+
if (self.myConfig.cfieldname) {
|
|
66
|
+
let name = el[self.myConfig.cfieldname];
|
|
67
|
+
if (!tempData[name]) {
|
|
68
|
+
tempData[name] = [];
|
|
69
|
+
legendData.push(name);
|
|
70
|
+
}
|
|
71
|
+
tempData[name].push(el);
|
|
72
|
+
}
|
|
73
|
+
let xname = null;
|
|
74
|
+
if (self.myConfig.valueAxis === 'y') {
|
|
75
|
+
xname = el[self.myConfig.xfieldname];
|
|
76
|
+
}
|
|
77
|
+
if (self.myConfig.valueAxis === 'x') {
|
|
78
|
+
xname = el[self.myConfig.yfieldname];
|
|
79
|
+
}
|
|
80
|
+
if (xname !== null) {
|
|
81
|
+
if (!xObj[xname]) {
|
|
82
|
+
xObj[xname] = true;
|
|
83
|
+
xData.push(xname);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
// 处理分类
|
|
88
|
+
if (this.myConfig.cdata && this.myConfig.cdata.length > 0) {
|
|
89
|
+
legendData = this.$Method.copy(this.myConfig.cdata);
|
|
90
|
+
}
|
|
91
|
+
// 当y轴为值时处理x轴数据
|
|
92
|
+
if (this.myConfig.valueAxis === 'y') {
|
|
93
|
+
if (this.myConfig.xdata && this.myConfig.xdata.length > 0) {
|
|
94
|
+
xData = this.$Method.copy(this.myConfig.xdata);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
// 当x轴为值时处理y轴数据
|
|
98
|
+
if (this.myConfig.valueAxis === 'x') {
|
|
99
|
+
if (this.myConfig.ydata && this.myConfig.ydata.length > 0) {
|
|
100
|
+
xData = this.$Method.copy(this.myConfig.ydata);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// 处理值
|
|
105
|
+
if (this.myConfig.cfieldname && legendData.length > 0) {
|
|
106
|
+
legendData.forEach(c => {
|
|
107
|
+
let temp = {
|
|
108
|
+
name:c,
|
|
109
|
+
type: 'bar'
|
|
110
|
+
};
|
|
111
|
+
temp.data = [];
|
|
112
|
+
let xflag = false;
|
|
113
|
+
xData.forEach(x => {
|
|
114
|
+
let valueName = '';
|
|
115
|
+
let categoryName = '';
|
|
116
|
+
if (this.myConfig.valueAxis === 'y') {
|
|
117
|
+
valueName = this.myConfig.yfieldname;
|
|
118
|
+
categoryName = this.myConfig.xfieldname;
|
|
119
|
+
}
|
|
120
|
+
if (this.myConfig.valueAxis === 'x') {
|
|
121
|
+
valueName = this.myConfig.xfieldname;
|
|
122
|
+
categoryName = this.myConfig.yfieldname;
|
|
123
|
+
}
|
|
124
|
+
tempData[c].some(el =>{
|
|
125
|
+
if (el[categoryName] === x) {
|
|
126
|
+
temp.data.push(el[valueName]);
|
|
127
|
+
xflag = true;
|
|
128
|
+
return true;
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
if (!xflag) {
|
|
132
|
+
temp.data.push('0');
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
if (this.myConfig.OnUpdataSeries) {
|
|
136
|
+
let that = this;
|
|
137
|
+
this.myConfig.OnUpdataSeries(temp,that);
|
|
138
|
+
}
|
|
139
|
+
series.push(temp);
|
|
140
|
+
});
|
|
141
|
+
} else {
|
|
142
|
+
let temp = {
|
|
143
|
+
type: 'bar'
|
|
144
|
+
};
|
|
145
|
+
temp.data = [];
|
|
146
|
+
let xflag = false;
|
|
147
|
+
xData.forEach(x => {
|
|
148
|
+
xflag = false;
|
|
149
|
+
let valueName = '';
|
|
150
|
+
let categoryName = '';
|
|
151
|
+
if (this.myConfig.valueAxis === 'y') {
|
|
152
|
+
valueName = this.myConfig.yfieldname;
|
|
153
|
+
categoryName = this.myConfig.xfieldname;
|
|
154
|
+
}
|
|
155
|
+
if (this.myConfig.valueAxis === 'x') {
|
|
156
|
+
valueName = this.myConfig.xfieldname;
|
|
157
|
+
categoryName = this.myConfig.yfieldname;
|
|
158
|
+
}
|
|
159
|
+
this.currentData.some(el => {
|
|
160
|
+
if (el[categoryName] === x) {
|
|
161
|
+
temp.data.push(el[valueName]);
|
|
162
|
+
xflag = true;
|
|
163
|
+
return true;
|
|
164
|
+
}
|
|
165
|
+
})
|
|
166
|
+
if (!xflag) {
|
|
167
|
+
temp.data.push('0');
|
|
168
|
+
}
|
|
169
|
+
})
|
|
170
|
+
if (this.myConfig.OnUpdataSeries) {
|
|
171
|
+
let that = this;
|
|
172
|
+
this.myConfig.OnUpdataSeries(temp,that);
|
|
173
|
+
}
|
|
174
|
+
series.push(temp);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
// 处理分类
|
|
178
|
+
curlConfig.legend.data = legendData;
|
|
179
|
+
// 当y轴为值时处理x轴数据
|
|
180
|
+
if (this.myConfig.valueAxis === 'y') {
|
|
181
|
+
curlConfig.xAxis[0].data = xData;
|
|
182
|
+
}
|
|
183
|
+
// 当x轴为值时处理y轴数据
|
|
184
|
+
if (this.myConfig.valueAxis === 'x') {
|
|
185
|
+
curlConfig.yAxis[0].data = xData;
|
|
186
|
+
}
|
|
187
|
+
// 处理数据
|
|
188
|
+
curlConfig.series = series;
|
|
189
|
+
// 处理颜色
|
|
190
|
+
if (!this.mychartconfig.color) {
|
|
191
|
+
if (legendData.length > 0) {
|
|
192
|
+
curlConfig.color = this._getGlobalColor('bar', legendData.length);
|
|
193
|
+
} else {
|
|
194
|
+
curlConfig.color = this._getGlobalColor('bar', 1);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
return curlConfig;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
</script>
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
|
|
2
|
+
<script>
|
|
3
|
+
require('echarts/lib/component/tooltip');
|
|
4
|
+
require('echarts/lib/component/title');
|
|
5
|
+
require('echarts/lib/component/legend');
|
|
6
|
+
require('echarts/lib/component/toolbox');
|
|
7
|
+
import size from '@/components/base/size';
|
|
8
|
+
export default {
|
|
9
|
+
mixins: [size],
|
|
10
|
+
name: 'mychart',
|
|
11
|
+
data () {
|
|
12
|
+
return {
|
|
13
|
+
globalConfig: {
|
|
14
|
+
},
|
|
15
|
+
myConfig:{
|
|
16
|
+
adjustHeight:0,
|
|
17
|
+
adjustWidth:0,
|
|
18
|
+
width:0.5,
|
|
19
|
+
height:0.4,
|
|
20
|
+
onChartClick:null,
|
|
21
|
+
OnUpdataSeries:null,
|
|
22
|
+
myChartStyle:{},
|
|
23
|
+
globalColorFlag:true
|
|
24
|
+
},
|
|
25
|
+
currentData:[],
|
|
26
|
+
mychartconfig:{},
|
|
27
|
+
echarts: require('echarts')
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
created () {
|
|
31
|
+
this.init();
|
|
32
|
+
},
|
|
33
|
+
props:{
|
|
34
|
+
config: {
|
|
35
|
+
type:Object,
|
|
36
|
+
default:() => {}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
computed: {
|
|
40
|
+
currentStyle () {
|
|
41
|
+
let style = Object.assign({},this.myConfig.myChartStyle,{});
|
|
42
|
+
style.height = this.currentHeight+'px';
|
|
43
|
+
style.width = this.currentWidth+'px';
|
|
44
|
+
return style;
|
|
45
|
+
},
|
|
46
|
+
currentMychartConfig () {
|
|
47
|
+
let curlConfig = this._initMychartConfig();
|
|
48
|
+
if(this.myConfig.overrideConfig) {
|
|
49
|
+
curlConfig = this.myConfig.overrideConfig(curlConfig);
|
|
50
|
+
}
|
|
51
|
+
return curlConfig;
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
methods: {
|
|
55
|
+
init () {
|
|
56
|
+
this.myConfig =Object.assign({},this.globalConfig,this.myConfig);
|
|
57
|
+
this.myConfig =Object.assign({},this.myConfig,this.config);
|
|
58
|
+
if (this.config.eventObject) {
|
|
59
|
+
Object.assign(this,this.config.eventObject);
|
|
60
|
+
delete this.myConfig.eventObject;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
this.mychartconfig = Object.assign({},this.mychartconfig,this.myConfig.mychartconfig);
|
|
64
|
+
this.setSizeConfig(this.myConfig);
|
|
65
|
+
if (this.customInit) {
|
|
66
|
+
this.customInit();
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
newMychart(mychartconfig) {
|
|
70
|
+
if (!this.mychart) {
|
|
71
|
+
let dom = this.$refs.mychart;
|
|
72
|
+
if (dom) {
|
|
73
|
+
this.mychart = this.echarts.init(dom);
|
|
74
|
+
let self = this;
|
|
75
|
+
this.mychart.on('click', function (params) {
|
|
76
|
+
if (params.componentType === 'markPoint') {
|
|
77
|
+
// 点击到了 markPoint 上
|
|
78
|
+
if (params.seriesIndex === 5) {
|
|
79
|
+
// 点击到了 index 为 5 的 series 的 markPoint 上。
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
else if (params.componentType === 'series') {
|
|
83
|
+
if (params.seriesType === 'graph') {
|
|
84
|
+
if (params.dataType === 'edge') {
|
|
85
|
+
// 点击到了 graph 的 edge(边)上。
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
// 点击到了 graph 的 node(节点)上。
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
if (params.seriesType === 'bar' || params.seriesType === 'line' || params.seriesType === 'pie' || params.seriesType === 'scatter') {
|
|
92
|
+
if (self.myConfig.onChartClick) {
|
|
93
|
+
self.myConfig.onChartClick(params.name, params);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
this.mychart.on('dblclick', function (params) {
|
|
99
|
+
if (params.componentType === 'markPoint') {
|
|
100
|
+
// 点击到了 markPoint 上
|
|
101
|
+
if (params.seriesIndex === 5) {
|
|
102
|
+
// 点击到了 index 为 5 的 series 的 markPoint 上。
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
else if (params.componentType === 'series') {
|
|
106
|
+
if (params.seriesType === 'graph') {
|
|
107
|
+
if (params.dataType === 'edge') {
|
|
108
|
+
// 点击到了 graph 的 edge(边)上。
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
// 点击到了 graph 的 node(节点)上。
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
if (params.seriesType === 'bar' || params.seriesType === 'line' || params.seriesType === 'pie' || params.seriesType === 'scatter') {
|
|
115
|
+
if (self.myConfig.onDblChartClick) {
|
|
116
|
+
self.myConfig.onDblChartClick(params.name, params);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
if (mychartconfig.legend && mychartconfig.legend.type === 'scroll') {
|
|
122
|
+
this.mychart.on('legendScroll',function (params) {
|
|
123
|
+
if (self.myConfig.onLegendScroll) {
|
|
124
|
+
self.myConfig.onLegendScroll(params, self);
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
if (self.myConfig.customBinding) {
|
|
129
|
+
self.myConfig.customBinding(self);
|
|
130
|
+
}
|
|
131
|
+
window.addEventListener('resize', function () {
|
|
132
|
+
self.mychart.resize();
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
if (this.mychart) {
|
|
137
|
+
this.mychart.clear();
|
|
138
|
+
if (mychartconfig) {
|
|
139
|
+
this.mychart.setOption(mychartconfig);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
_initMychartConfig() {
|
|
145
|
+
if (this.customInitMychartConfig) {
|
|
146
|
+
return this.customInitMychartConfig();
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
setData(data) {
|
|
150
|
+
this.currentData = this.$Method.copy(data);
|
|
151
|
+
},
|
|
152
|
+
clear() {
|
|
153
|
+
this.currentData = [];
|
|
154
|
+
},
|
|
155
|
+
_getGlobalColor (pro,num) {
|
|
156
|
+
if (this.getGlobalColor) {
|
|
157
|
+
return this.getGlobalColor(pro,num);
|
|
158
|
+
} else {
|
|
159
|
+
let globalColorFlag = true;
|
|
160
|
+
if (this.myConfig.globalColorFlag) {
|
|
161
|
+
globalColorFlag = this.myConfig.globalColorFlag;
|
|
162
|
+
}
|
|
163
|
+
if (this.config && this.config.globalColorFlag !== undefined) {
|
|
164
|
+
globalColorFlag = this.config.globalColorFlag;
|
|
165
|
+
}
|
|
166
|
+
if (globalColorFlag) {
|
|
167
|
+
return this.$Method.getGlobalColor(num, false, pro, this);
|
|
168
|
+
} else {
|
|
169
|
+
return this.$Method.getGlobalColor(num, true, pro, this);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
setMyConfig(obj) {
|
|
174
|
+
this.myConfig = Object.assign({},this.myConfig,obj);
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
mounted () {
|
|
178
|
+
},
|
|
179
|
+
watch:{
|
|
180
|
+
currentMychartConfig: {
|
|
181
|
+
handler(newValue) {
|
|
182
|
+
this.newMychart(newValue);
|
|
183
|
+
}//,
|
|
184
|
+
//immediate: true
|
|
185
|
+
},
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
</script>
|
|
189
|
+
|
|
190
|
+
|