@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.
@@ -1,53 +1,68 @@
1
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>
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
- 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
- }
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>
@@ -227,17 +227,19 @@ export function data23(){
227
227
  "inBottons": [
228
228
  {
229
229
  "funcode": "wxq_xg",
230
- "color": "#d81e06",
230
+ "color": "",
231
231
  "size": 15,
232
232
  "name": "修改",
233
- "icon": "iconedit-1-copy"
233
+ "icon": ""
234
234
  },
235
235
  {
236
236
  "funcode": "wxq_delete",
237
- "color": "#d81e06",
237
+ "color": "#ffffff",
238
238
  "size": 15,
239
239
  "name": "删除",
240
- "icon": "iconshanchu1"
240
+ "icon": "iconshanchu1",
241
+ "bgColor":'#409EFF',
242
+ "textColor":'#ffffff'
241
243
  }
242
244
  ],
243
245
  "isHaveHead": true,
@@ -275,6 +277,7 @@ export function data23(){
275
277
  "label": "村级名称",
276
278
  "type": "String",
277
279
  "align": "center",
280
+ "cellRender":"TabsCheckbox",
278
281
  "enum": []
279
282
  },
280
283
  {
@@ -405,7 +408,10 @@ html:[{
405
408
  "xzrzw": "镇长",
406
409
  "jcrdh": "13408181100",
407
410
  "id": "2",
408
- "village": "高石社区三组",
411
+ "village": {
412
+ enum:[{label:'多选1',value:1},{label:'多选2',value:2},{label:'多选3',value:3}],
413
+ selected:[1,2]
414
+ },
409
415
  "yjrdh": "15984498223",
410
416
  "_XID": "row_4"
411
417
  },