@leevan/jtui 2.0.2 → 2.0.6
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/examples/assets/icon/iconfont.css +532 -7
- package/examples/assets/icon/iconfont.eot +0 -0
- package/examples/assets/icon/iconfont.svg +1083 -1230
- package/examples/assets/icon/iconfont.ttf +0 -0
- package/examples/assets/icon/iconfont.woff +0 -0
- package/examples/assets/icon/iconfont.woff2 +0 -0
- package/examples/data2.js +6 -0
- package/examples/tableTest/table-ptbg.vue +13 -1
- package/examples/tableTest/table-tree.vue +6 -0
- package/examples/tableTest/tree-table.vue +13 -5
- package/lib/jtui.common.js +597 -174
- package/lib/jtui.css +1 -1
- package/lib/jtui.umd.js +597 -174
- package/lib/jtui.umd.min.js +1 -1
- package/package.json +4 -4
- package/packages/jt-table/comp.js +12 -0
- package/packages/jt-table/components/tabsBtn.vue +59 -44
- package/packages/jt-table/components/tabsCheckbox.vue +70 -0
- package/packages/jt-table/index.vue +1609 -1374
- package/packages/jt-table-pc/components/tabsBtn.vue +59 -44
- package/packages/jt-table-pc/data2.js +11 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leevan/jtui",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.6",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"serve": "vue-cli-service serve",
|
|
6
6
|
"build": "vue-cli-service build",
|
|
@@ -8,14 +8,14 @@
|
|
|
8
8
|
"lib": "vue-cli-service build --target lib --name jtui --dest lib packages/index.js"
|
|
9
9
|
},
|
|
10
10
|
"description": "jt Components",
|
|
11
|
-
"homepage": "http://
|
|
11
|
+
"homepage": "http://jtgitlab.scsqzx.com/jtxa/jtui-pc",
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"bugs": {
|
|
14
|
-
"url": "http://
|
|
14
|
+
"url": "http://jtgitlab.scsqzx.com/jtxa/jtui-pc/issues"
|
|
15
15
|
},
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
18
|
-
"url": "git+http://
|
|
18
|
+
"url": "git+http://jtgitlab.scsqzx.com/jtxa/jtui-pc.git"
|
|
19
19
|
},
|
|
20
20
|
"contributors": [
|
|
21
21
|
"leevan",
|
|
@@ -3,8 +3,10 @@ import VXETable from 'vxe-table';
|
|
|
3
3
|
import XEUtils from 'xe-utils'
|
|
4
4
|
|
|
5
5
|
import TabsBtn from './components/tabsBtn.vue';
|
|
6
|
+
import TabsCheckbox from './components/tabsCheckbox.vue';
|
|
6
7
|
|
|
7
8
|
Vue.component(TabsBtn.name, TabsBtn)
|
|
9
|
+
Vue.component(TabsCheckbox.name,TabsCheckbox)
|
|
8
10
|
|
|
9
11
|
VXETable.renderer.add('TabsBtn',{
|
|
10
12
|
renderDefault (h, renderOpts, params) {
|
|
@@ -14,4 +16,14 @@ VXETable.renderer.add('TabsBtn',{
|
|
|
14
16
|
></tabs-btn>
|
|
15
17
|
]
|
|
16
18
|
}
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
VXETable.renderer.add('TabsCheckbox',{
|
|
22
|
+
renderDefault (h, renderOpts, params) {
|
|
23
|
+
const { events , parentRow } = renderOpts;
|
|
24
|
+
return [
|
|
25
|
+
<tabs-checkbox params={ params } events={ events } parentRow={ parentRow }
|
|
26
|
+
></tabs-checkbox>
|
|
27
|
+
]
|
|
28
|
+
}
|
|
17
29
|
})
|
|
@@ -1,53 +1,68 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
</el-radio-
|
|
2
|
+
<div>
|
|
3
|
+
<el-radio-group v-model="radio_value" size="mini" @change="btnsClick" v-if="dataType !== 'string'">
|
|
4
|
+
<el-radio-button
|
|
5
|
+
v-for="(item, index) in fullData"
|
|
6
|
+
:key="index"
|
|
7
|
+
:label="item.value"
|
|
8
|
+
>{{ item.label }}</el-radio-button
|
|
9
|
+
>
|
|
10
|
+
</el-radio-group>
|
|
11
|
+
<div v-else>
|
|
12
|
+
{{rowData}}
|
|
9
13
|
</div>
|
|
14
|
+
</div>
|
|
10
15
|
</template>
|
|
11
16
|
|
|
12
17
|
<script>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
18
|
+
export default {
|
|
19
|
+
name: "TabsBtn",
|
|
20
|
+
data() {
|
|
21
|
+
return {
|
|
22
|
+
radio_value: "",
|
|
23
|
+
fullData: [],
|
|
24
|
+
oldValue: "",
|
|
25
|
+
dataType: '',
|
|
26
|
+
rowData: ''
|
|
27
|
+
};
|
|
28
|
+
},
|
|
29
|
+
props: {
|
|
30
|
+
params: Object,
|
|
31
|
+
},
|
|
32
|
+
created() {
|
|
33
|
+
this.load();
|
|
34
|
+
},
|
|
35
|
+
methods: {
|
|
36
|
+
load() {
|
|
37
|
+
const { row, column } = this.params;
|
|
38
|
+
if (row) {
|
|
39
|
+
this.rowData = row[column.property];
|
|
40
|
+
this.dataType = typeof this.rowData;
|
|
41
|
+
}
|
|
42
|
+
if (this.rowData && this.rowData.enum) {
|
|
43
|
+
this.fullData = this.rowData.enum;
|
|
44
|
+
this.radio_value = this.rowData.selected;
|
|
45
|
+
this.oldValue = this.rowData.selected;
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
async btnsClick(val) {
|
|
49
|
+
const { row, column } = this.params;
|
|
50
|
+
const { events, parentRow } = this.$attrs;
|
|
51
|
+
const result = await events.radioChange({
|
|
52
|
+
row,
|
|
53
|
+
property: column.property,
|
|
54
|
+
val,
|
|
55
|
+
params: parentRow,
|
|
56
|
+
});
|
|
57
|
+
if (result) {
|
|
58
|
+
this.oldValue = val;
|
|
59
|
+
} else {
|
|
60
|
+
this.radio_value = this.oldValue;
|
|
61
|
+
}
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
};
|
|
49
65
|
</script>
|
|
50
66
|
|
|
51
67
|
<style lang="scss" scoped>
|
|
52
|
-
|
|
53
68
|
</style>
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div>
|
|
3
|
+
<el-checkbox-group v-model="radio_value" size="mini" @change="btnsClick"
|
|
4
|
+
v-if="dataType !== 'string'">
|
|
5
|
+
<el-checkbox-button
|
|
6
|
+
v-for="(item, index) in fullData"
|
|
7
|
+
:key="index"
|
|
8
|
+
:label="item.value"
|
|
9
|
+
>{{ item.label }}</el-checkbox-button
|
|
10
|
+
>
|
|
11
|
+
</el-checkbox-group>
|
|
12
|
+
<div v-else>
|
|
13
|
+
{{rowData}}
|
|
14
|
+
</div>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<script>
|
|
19
|
+
export default {
|
|
20
|
+
name: "TabsCheckbox",
|
|
21
|
+
data() {
|
|
22
|
+
return {
|
|
23
|
+
radio_value: [],
|
|
24
|
+
fullData: [],
|
|
25
|
+
oldValue: "",
|
|
26
|
+
dataType: '',
|
|
27
|
+
rowData: ''
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
props: {
|
|
31
|
+
params: Object,
|
|
32
|
+
},
|
|
33
|
+
created() {
|
|
34
|
+
this.load();
|
|
35
|
+
},
|
|
36
|
+
methods: {
|
|
37
|
+
load() {
|
|
38
|
+
const { row, column } = this.params;
|
|
39
|
+
if (row) {
|
|
40
|
+
this.rowData = row[column.property];
|
|
41
|
+
this.dataType = typeof this.rowData;
|
|
42
|
+
}
|
|
43
|
+
if (this.rowData && this.rowData.enum) {
|
|
44
|
+
this.fullData = this.rowData.enum;
|
|
45
|
+
this.radio_value = this.rowData.selected;
|
|
46
|
+
this.oldValue = this.rowData.selected;
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
async btnsClick(val) {
|
|
50
|
+
const { row, column } = this.params;
|
|
51
|
+
const { events, parentRow } = this.$attrs;
|
|
52
|
+
const result = await events.checkboxChange({
|
|
53
|
+
row,
|
|
54
|
+
property: column.property,
|
|
55
|
+
val,
|
|
56
|
+
params: parentRow,
|
|
57
|
+
});
|
|
58
|
+
if (result) {
|
|
59
|
+
this.oldValue = val;
|
|
60
|
+
} else {
|
|
61
|
+
this.radio_value = this.oldValue;
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
</script>
|
|
67
|
+
|
|
68
|
+
<style lang="scss" scoped>
|
|
69
|
+
|
|
70
|
+
</style>
|