@leevan/jtui 1.2.7 → 2.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.
Files changed (34) hide show
  1. package/examples/App.vue +640 -24
  2. package/examples/scss/cover.scss +139 -0
  3. package/examples/scss/global.scss +457 -0
  4. package/examples/scss/main-style/_handle.scss +217 -0
  5. package/examples/scss/main-style/_themes.scss +95 -0
  6. package/examples/scss/main-style/style1.scss +0 -0
  7. package/examples/scss/main-style/style2.scss +12 -0
  8. package/examples/scss/main-style/style3.scss +16 -0
  9. package/examples/scss/pub.scss +142 -0
  10. package/examples/tableTest/table-dsj.vue +209 -0
  11. package/examples/tableTest/table-fzbg.vue +163 -0
  12. package/examples/tableTest/table-ptbg.vue +222 -0
  13. package/examples/tableTest/table-tree.vue +45 -0
  14. package/examples/tableTest/tree-table.vue +45 -0
  15. package/lib/jtui.common.js +114134 -84420
  16. package/lib/jtui.css +1 -1
  17. package/lib/jtui.umd.js +114134 -84420
  18. package/lib/jtui.umd.min.js +176 -133
  19. package/package.json +6 -5
  20. package/packages/index.js +6 -3
  21. package/packages/jt-echarts-pc/JtEchartsPc.vue +6 -2
  22. package/packages/jt-form-pc/JtFormPc.vue +1 -1
  23. package/packages/jt-table/comp.js +17 -0
  24. package/packages/jt-table/components/tabsBtn.vue +53 -0
  25. package/packages/jt-table/examples/FilterComplex.vue +78 -0
  26. package/packages/jt-table/examples/FilterContent.vue +159 -0
  27. package/packages/jt-table/examples/FilterExcel.vue +161 -0
  28. package/packages/jt-table/examples/FilterInput.vue +92 -0
  29. package/packages/jt-table/filter.js +162 -0
  30. package/packages/jt-table/index.js +10 -0
  31. package/packages/jt-table/index.vue +1441 -0
  32. package/packages/jt-table-pc/data2.js +33 -14
  33. package/packages/jtaxios.js +31 -0
  34. package/vue.config.js +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leevan/jtui",
3
- "version": "1.2.7",
3
+ "version": "2.0.1",
4
4
  "scripts": {
5
5
  "serve": "vue-cli-service serve",
6
6
  "build": "vue-cli-service build",
@@ -36,16 +36,17 @@
36
36
  "core-js": "^3.6.4",
37
37
  "echarts": "^4.2.1",
38
38
  "element-ui": "2.13.2",
39
+ "exceljs": "^4.3.0",
39
40
  "moment": "^2.26.0",
40
41
  "node-sass": "^5.0.0",
41
42
  "sass-loader": "^10.1.0",
42
43
  "vue": "^2.6.11",
43
44
  "vue-furcate-tree": "^1.0.0",
44
45
  "vue-simple-uploader": "^0.7.4",
45
- "vxe-table": "2.9.15",
46
- "vxe-table-plugin-export-xlsx": "1.6.0",
47
- "xe-utils": "2.4.5",
48
- "xlsx": "^0.16.5"
46
+ "vxe-table": "^3.3.12",
47
+ "vxe-table-plugin-export-xlsx": "^2.2.1",
48
+ "xe-utils": "^3.3.2",
49
+ "xlsx": "^0.17.1"
49
50
  },
50
51
  "devDependencies": {
51
52
  "@vue/cli-plugin-babel": "~4.3.0",
package/packages/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import Vue from 'vue';
2
- import JtTablePc from './jt-table-pc';
2
+ import JtTablePc from './jt-table';
3
3
  import JtFormPc from './jt-form-pc';
4
4
  import JtUploadPc from './jt-upload-pc';
5
5
  import JtEchartsPc from './jt-echarts-pc';
@@ -8,8 +8,8 @@ import JtOrgtreePc from './jt-orgtree-pc'
8
8
  //vex-table样式
9
9
  import 'vxe-table/lib/index.css';
10
10
  import VXETable from 'vxe-table';
11
- import './jt-table-pc/filter.js';
12
- import './jt-table-pc/comp.js';
11
+ import './jt-table/filter.js';
12
+ import './jt-table/comp.js';
13
13
  import 'xe-utils';
14
14
  Vue.use(VXETable);
15
15
 
@@ -17,6 +17,9 @@ Vue.use(VXETable);
17
17
  import moment from 'moment'//导入文件
18
18
  Vue.prototype.$moment = moment;//赋值使用
19
19
 
20
+ import axios from './jtaxios.js';
21
+ Vue.prototype.$axios = axios;
22
+
20
23
  //echarts 依赖
21
24
  import Echarts from 'echarts';
22
25
  Vue.use(Echarts);
@@ -319,6 +319,10 @@
319
319
  chartObj() {
320
320
  return this.myChart;
321
321
  },
322
+ disposeChart () {
323
+ this.myChart.dispose();
324
+ this.myChart = this.echarts.init(document.getElementById(this.ID));
325
+ },
322
326
  setEchartsOption() {
323
327
 
324
328
  console.log(this.echartsData.option, "this.echartsData.option");
@@ -699,8 +703,8 @@
699
703
  ymaxValue = ymaxValue - 0;
700
704
  yminValue = yminValue - 0;
701
705
 
702
- ymaxValue = Math.round((ymaxValue + sub * this.maxAndMinLevel) * Math.pow(10, this.yMaxAndMinkeepDecimal)) / Math.pow(10, this.yMaxAndMinkeepDecimal);
703
- yminValue = Math.round((yminValue - sub * this.maxAndMinLevel) * Math.pow(10, this.yMaxAndMinkeepDecimal)) / Math.pow(10, this.yMaxAndMinkeepDecimal);
706
+ ymaxValue = Math.ceil((ymaxValue + sub * this.maxAndMinLevel) * Math.pow(10, this.yMaxAndMinkeepDecimal)) / Math.pow(10, this.yMaxAndMinkeepDecimal);
707
+ yminValue = Math.floor((yminValue - sub * this.maxAndMinLevel) * Math.pow(10, this.yMaxAndMinkeepDecimal)) / Math.pow(10, this.yMaxAndMinkeepDecimal);
704
708
 
705
709
  this.echartsData.option.yAxis.min = yminValue;//(yminValue-sub)*this.maxAndMinLevel;
706
710
  this.echartsData.option.yAxis.max = ymaxValue;//(ymaxValue+sub)*this.maxAndMinLevel;
@@ -180,7 +180,7 @@
180
180
  <!-- 输入框带输入建议 -->
181
181
  <el-autocomplete
182
182
  v-if="item.type === 'autocomplete'"
183
- :width="item.width ? item.width + 'px' : '100px'"
183
+ :style="{width:item.width ? item.width + 'px' : '100px'}"
184
184
  class="inline-input"
185
185
  v-model="model[item.modelKey]"
186
186
  :fetch-suggestions="item.querySearch"
@@ -0,0 +1,17 @@
1
+ import Vue from 'vue';
2
+ import VXETable from 'vxe-table';
3
+ import XEUtils from 'xe-utils'
4
+
5
+ import TabsBtn from './components/tabsBtn.vue';
6
+
7
+ Vue.component(TabsBtn.name, TabsBtn)
8
+
9
+ VXETable.renderer.add('TabsBtn',{
10
+ renderDefault (h, renderOpts, params) {
11
+ const { events , parentRow } = renderOpts;
12
+ return [
13
+ <tabs-btn params={ params } events={ events } parentRow={ parentRow }
14
+ ></tabs-btn>
15
+ ]
16
+ }
17
+ })
@@ -0,0 +1,53 @@
1
+ <template>
2
+ <div>
3
+ <el-radio-group v-model="radio_value" size="mini" @change="btnsClick">
4
+ <el-radio-button
5
+ v-for="(item,index) in fullData"
6
+ :key="index"
7
+ :label="item.value">{{item.label}}</el-radio-button>
8
+ </el-radio-group>
9
+ </div>
10
+ </template>
11
+
12
+ <script>
13
+ export default {
14
+ name:'TabsBtn',
15
+ data(){
16
+ return {
17
+ radio_value:"",
18
+ fullData:[],
19
+ oldValue:""
20
+ }
21
+ },
22
+ props: {
23
+ params: Object
24
+ },
25
+ created(){
26
+ this.load();
27
+ },
28
+ methods:{
29
+ load(){
30
+ const { row , column } = this.params;
31
+ if(row && row[column.property] && row[column.property].enum){
32
+ this.fullData = row[column.property].enum
33
+ this.radio_value = row[column.property].selected
34
+ this.oldValue = row[column.property].selected;
35
+ }
36
+ },
37
+ async btnsClick(val){
38
+ const { row , column } = this.params;
39
+ const { events , parentRow } = this.$attrs;
40
+ const result = await events.radioChange({row,property:column.property,val,params:parentRow});
41
+ if(result){
42
+ this.oldValue = val;
43
+ }else{
44
+ this.radio_value = this.oldValue;
45
+ }
46
+ }
47
+ }
48
+ }
49
+ </script>
50
+
51
+ <style lang="scss" scoped>
52
+
53
+ </style>
@@ -0,0 +1,78 @@
1
+ <template>
2
+ <div class="jt-table-filter-complex">
3
+ <div class="jt-table-fc-type">
4
+ <vxe-radio v-model="option.data.type" name="fType" label="eq">=</vxe-radio>
5
+ <vxe-radio v-model="option.data.type" name="fType" label="gt">></vxe-radio>
6
+ <vxe-radio v-model="option.data.type" name="fType" label="lt">&lt</vxe-radio>
7
+ <vxe-radio v-model="option.data.type" name="fType" label="gteq">≥</vxe-radio>
8
+ <vxe-radio v-model="option.data.type" name="fType" label="lteq">≤</vxe-radio>
9
+ </div>
10
+ <div class="jt-table-fc-name">
11
+ <vxe-input v-model="option.data.value" type="text" placeholder="请输入筛选值" @input="changeOptionEvent()"></vxe-input>
12
+ </div>
13
+ <div class="jt-table-fc-footer">
14
+ <vxe-button status="primary" @click="confirmEvent">确认</vxe-button>
15
+ <vxe-button @click="resetEvent">重置</vxe-button>
16
+ </div>
17
+ </div>
18
+ </template>
19
+
20
+ <script>
21
+ export default {
22
+ name: 'FilterComplex',
23
+ props: {
24
+ params: Object
25
+ },
26
+ data () {
27
+ return {
28
+ size: 'mini', // 被所有子组件继承 size
29
+ column: null,
30
+ option: null
31
+ }
32
+ },
33
+ watch: {
34
+ params () {
35
+ this.load()
36
+ }
37
+ },
38
+ created () {
39
+ this.load()
40
+ },
41
+ methods: {
42
+ load () {
43
+ const { column } = this.params
44
+ const option = column.filters[0]
45
+ this.column = column
46
+ this.option = option
47
+ },
48
+ changeOptionEvent () {
49
+ const { params, option } = this
50
+ const { $panel } = params
51
+ const checked = !!option.data.value
52
+ $panel.changeOption(null, checked, option)
53
+ },
54
+ confirmEvent () {
55
+ const { $panel } = this.params
56
+ $panel.confirmFilter()
57
+ },
58
+ resetEvent () {
59
+ const { $panel } = this.params
60
+ $panel.resetFilter()
61
+ }
62
+ }
63
+ }
64
+ </script>
65
+
66
+ <style scoped>
67
+ .jt-table-filter-complex {
68
+ width: 260px;
69
+ padding: 5px 15px 10px 15px;
70
+ }
71
+ .jt-table-filter-complex .jt-table-fc-type {
72
+ padding: 8px 0;
73
+ }
74
+ .jt-table-filter-complex .jt-table-fc-footer {
75
+ padding-top:12px;
76
+ text-align: center;
77
+ }
78
+ </style>
@@ -0,0 +1,159 @@
1
+ <template>
2
+ <div class="jt-table-filter-content">
3
+ <div class="jt-table-fc-search">
4
+ <div class="jt-table-fc-search-top">
5
+ <vxe-input v-model="option.data.sVal" placeholder="搜索" suffix-icon="fa fa-search" @keyup="searchEvent"></vxe-input>
6
+ </div>
7
+ <div class="jt-table-fc-search-content">
8
+ <template v-if="valList.length">
9
+ <ul class="jt-table-fc-search-list jt-table-fc-search-list-head">
10
+ <li class="jt-table-fc-search-item">
11
+ <vxe-checkbox v-model="isAll" :indeterminate="isIndeterminate" @change="changeAllEvent">全选</vxe-checkbox>
12
+ </li>
13
+ </ul>
14
+ <ul class="jt-table-fc-search-list jt-table-fc-search-list-body">
15
+ <li class="jt-table-fc-search-item" v-for="(item, sIndex) in valList" :key="sIndex">
16
+ <vxe-checkbox v-model="item.checked" @change="changeItemEvent">{{ item.value }}</vxe-checkbox>
17
+ </li>
18
+ </ul>
19
+ </template>
20
+ <template v-else>
21
+ <div class="jt-table-fc-search-empty">无匹配项</div>
22
+ </template>
23
+ </div>
24
+ </div>
25
+ <div class="jt-table-fc-footer">
26
+ <vxe-button status="primary" @click="confirmFilterEvent">确认</vxe-button>
27
+ <vxe-button @click="resetFilterEvent">重置</vxe-button>
28
+ </div>
29
+ </div>
30
+ </template>
31
+
32
+ <script>
33
+ import XEUtils from 'xe-utils'
34
+ export default {
35
+ name: 'FilterContent',
36
+ props: {
37
+ params: Object
38
+ },
39
+ data () {
40
+ return {
41
+ size: 'mini',
42
+ isAll: false,
43
+ isIndeterminate: false,
44
+ option: null,
45
+ colValList: [],
46
+ valList: []
47
+ }
48
+ },
49
+ watch: {
50
+ params () {
51
+ this.load()
52
+ },
53
+ colValList () {
54
+ this.searchEvent()
55
+ }
56
+ },
57
+ created () {
58
+ this.load()
59
+ this.searchEvent()
60
+ },
61
+ methods: {
62
+ load () {
63
+ // filters 可以配置多个,实际只用一个就可以满足需求了
64
+ const { $table, column } = this.params
65
+ const { fullData } = $table.getTableData()
66
+ const option = column.filters[0]
67
+ const { vals } = option.data
68
+ const colValList = Object.keys(XEUtils.groupBy(fullData, column.property)).map(val => {
69
+ return {
70
+ checked: vals.includes(val),
71
+ value: val
72
+ }
73
+ })
74
+ this.option = option
75
+ this.colValList = colValList
76
+ this.valList = colValList
77
+ },
78
+ searchEvent () {
79
+ const { option, colValList } = this
80
+ this.valList = option.data.sVal ? colValList.filter(item => item.value.indexOf(option.data.sVal) > -1) : colValList
81
+ this.updateCheckStatus()
82
+ },
83
+ changeAllEvent () {
84
+ const { isAll } = this
85
+ this.valList.forEach(item => {
86
+ item.checked = isAll
87
+ })
88
+ this.isIndeterminate = false
89
+ },
90
+ updateCheckStatus () {
91
+ const { valList } = this
92
+ const isAll = valList.every(item => item.checked)
93
+ this.isAll = isAll
94
+ this.isIndeterminate = !isAll && valList.some(item => item.checked)
95
+ },
96
+ changeItemEvent () {
97
+ this.updateCheckStatus()
98
+ },
99
+ confirmFilterEvent () {
100
+ const { params, option, valList } = this
101
+ const { data } = option
102
+ const { $panel } = params
103
+ data.vals = valList.filter(item => item.checked).map(item => item.value)
104
+ option.checked = true
105
+ $panel.confirmFilter()
106
+ },
107
+ resetFilterEvent () {
108
+ const { $panel } = this.params
109
+ $panel.resetFilter()
110
+ }
111
+ }
112
+ }
113
+ </script>
114
+
115
+ <style>
116
+ .jt-table-filter-content {
117
+ padding: 10px;
118
+ user-select: none;
119
+ }
120
+ .jt-table-filter-content .jt-table-fc-search .jt-table-fc-search-top {
121
+ position: relative;
122
+ padding: 5px 0;
123
+ }
124
+ .jt-table-filter-content .jt-table-fc-search .jt-table-fc-search-top > input {
125
+ border: 1px solid #ABABAB;
126
+ padding: 0 20px 0 2px;
127
+ width: 200px;
128
+ height: 22px;
129
+ line-height: 22px;
130
+ }
131
+ .jt-table-filter-content .jt-table-fc-search .jt-table-fc-search-content {
132
+ border: 1px solid #E2E4E7;
133
+ padding: 2px 10px;
134
+ }
135
+ .jt-table-filter-content .jt-table-fc-search-empty {
136
+ text-align: center;
137
+ padding: 20px 0;
138
+ }
139
+ .jt-table-filter-content .jt-table-fc-search-list {
140
+ margin: 0;
141
+ padding:0;
142
+ }
143
+ .jt-table-filter-content .jt-table-fc-search-list-body {
144
+ overflow: auto;
145
+ height: 120px;
146
+ }
147
+ .jt-table-filter-content .jt-table-fc-search-list .jt-table-fc-search-item {
148
+ padding: 2px 0;
149
+ display: block;
150
+ }
151
+ .jt-table-filter-content .jt-table-fc-footer {
152
+ text-align: center;
153
+ padding-top: 10px;
154
+ }
155
+ .jt-table-filter-content .jt-table-fc-footer button {
156
+ padding: 0 15px;
157
+ margin-left: 15px;
158
+ }
159
+ </style>
@@ -0,0 +1,161 @@
1
+ <template>
2
+ <div class="jt-table-filter-excel">
3
+ <div class="jt-table-fe-top">
4
+ <div class="jt-table-fe-popup">
5
+ <div class="jt-table-fe-popup-filter jt-table-fe-popup-f1">
6
+ <vxe-select class="jt-table-fe-popup-filter-select"
7
+ v-model="option.data.f1Type"
8
+ transfer
9
+ >
10
+ <vxe-option
11
+ v-for="(fItem,index) in allCaseList"
12
+ :key="index"
13
+ :value="fItem.value"
14
+ :label="fItem.label"></vxe-option>
15
+ </vxe-select>
16
+ <vxe-input
17
+ class="jt-table-fe-popup-filter-input"
18
+ v-model="option.data.f1Val"
19
+ ></vxe-input>
20
+ </div>
21
+ <div class="jt-table-fe-popup-concat">
22
+ <vxe-radio-group v-model="option.data.fMode">
23
+ <vxe-radio label="and">与</vxe-radio>
24
+ <vxe-radio label="or">或</vxe-radio>
25
+ </vxe-radio-group>
26
+ </div>
27
+ <div class="jt-table-fe-popup-filter jt-table-fe-popup-f2">
28
+ <vxe-select
29
+ class="jt-table-fe-popup-filter-select"
30
+ v-model="option.data.f2Type" transfer>
31
+ <vxe-option
32
+ v-for="(fItem,index) in allCaseList"
33
+ :key="index"
34
+ :value="fItem.value"
35
+ :label="fItem.label"></vxe-option>
36
+ </vxe-select>
37
+ <vxe-input
38
+ class="jt-table-fe-popup-filter-input"
39
+ v-model="option.data.f2Val"
40
+ clearable></vxe-input>
41
+ </div>
42
+ </div>
43
+ </div>
44
+ <div class="jt-table-fe-footer">
45
+ <vxe-button status="primary" @click="confirmFilterEvent">确认</vxe-button>
46
+ <vxe-button @click="resetFilterEvent">重置</vxe-button>
47
+ </div>
48
+ </div>
49
+ </template>
50
+
51
+ <script>
52
+ import XEUtils from 'xe-utils'
53
+ import { ModalController } from 'vxe-table'
54
+ export default {
55
+ name: 'FilterExcel',
56
+ props: {
57
+ params: Object
58
+ },
59
+ data () {
60
+ return {
61
+ data:null,
62
+ size:'mini',
63
+ column: null,
64
+ option: null,
65
+ colValList: [],
66
+ caseGroups: [
67
+ [
68
+ { value: 'equal', label: '等于' },
69
+ { value: 'ne', label: '不等于' }
70
+ ],
71
+ [
72
+ { value: 'greater', label: '大于' },
73
+ { value: 'ge', label: '大于或等于' },
74
+ { value: 'less', label: '小于' },
75
+ { value: 'le', label: '小于或等于' },
76
+ { value: 'between', label: '介于' }
77
+ ],
78
+ [
79
+ { value: 'custom', label: '自定义筛选' }
80
+ ]
81
+ ],
82
+ allCaseList: [
83
+ { value: '1', label: '等于' },
84
+ { value: '2', label: '不等于' },
85
+ { value: '3', label: '大于' },
86
+ { value: '4', label: '大于或等于' },
87
+ { value: '5', label: '小于' },
88
+ { value: '6', label: '小于或等于' },
89
+ { value: '7', label: '开头是' },
90
+ { value: '8', label: '开头不是' },
91
+ { value: '9', label: '结尾是' },
92
+ { value: '10', label: '结尾不是' },
93
+ { value: '11', label: '包含' },
94
+ { value: '12', label: '不包含' }
95
+ ]
96
+ }
97
+ },
98
+ watch: {
99
+ params () {
100
+ this.load()
101
+ }
102
+ },
103
+ created () {
104
+ this.load()
105
+ },
106
+ methods: {
107
+ load () {
108
+ const { $table, column } = this.params
109
+ const { fullData } = $table.getTableData()
110
+ const option = column.filters[0]
111
+ const colValList = Object.keys(XEUtils.groupBy(fullData, column.property))
112
+ this.column = column
113
+ this.option = option
114
+ this.colValList = colValList
115
+ },
116
+ confirmFilterEvent () {
117
+ const { params, option } = this
118
+ const { data } = option
119
+ const { $panel } = params
120
+ data.f1 = ''
121
+ data.f2 = ''
122
+ option.checked = true
123
+ $panel.confirmFilter()
124
+ },
125
+ resetFilterEvent () {
126
+ const { $panel } = this.params
127
+ $panel.resetFilter()
128
+ }
129
+ }
130
+ }
131
+ </script>
132
+ <style>
133
+ .jt-table-filter-excel {
134
+ user-select: none;
135
+ padding: 10px;
136
+ text-align: center;
137
+ width:180px;
138
+
139
+ }
140
+ .jt-table-filter-excel .jt-table-fe-top{
141
+ border: 1px solid #E2E4E7;
142
+ padding: 6px 6px 18px 6px;
143
+ }
144
+ .jt-table-filter-excel .jt-table-fe-popup-concat{
145
+ margin-top:10px;
146
+ }
147
+ .jt-table-filter-excel .jt-table-fe-popup-filter-select{
148
+ width:60px;
149
+ display: inline-block;
150
+ margin-top:10px;
151
+ }
152
+ .jt-table-filter-excel .jt-table-fe-popup-filter-input{
153
+ width:100px;
154
+ display: inline-block;
155
+ position: relative;
156
+ right: 1px;
157
+ }
158
+ .jt-table-filter-excel .jt-table-fe-footer{
159
+ margin-top:10px;
160
+ }
161
+ </style>