diff --git a/jero-web/src/components/tableDate/index.vue b/jero-web/src/components/tableDate/index.vue index 4a834a9fd..6f578cef5 100644 --- a/jero-web/src/components/tableDate/index.vue +++ b/jero-web/src/components/tableDate/index.vue @@ -4,11 +4,9 @@
|
- |
-
+ |
{{item[val]}} | -- 收藏 - 订阅 - 编辑 - 删除 + | + {{ol.text}} | @@ -50,26 +45,21 @@ export default { name: 'index', props: { - edit: { - type: Boolean, - default: false - }, - del: { - type: Boolean, - default: false - }, - Collection: { - type: Boolean, - default: false - }, - subscribe: { - type: Boolean, - default: false - }, + //接口 url: { type: Object, default: {} - } + }, + // 操作按钮 + OperationList: { + type: Array, + default: [] + }, + //是否显示操作;默认显示 + isOperation:{ + type: Boolean, + default:true, + }, }, data() { return { @@ -122,34 +112,39 @@ 'col7': 0.6 } ], - checkboxList: [] + checkboxList: [], + tableAll: false, + indeterminate: false } }, mounted() { eventBUs.$on('searchQuery', target => { - console.log(target); - }); + console.log(target) + }) eventBUs.$on('searchReset', target => { - console.log(target); - }); + console.log(target) + }) this.getData() }, methods: { getData() { var jsonHead = this.jsonHead for (var i = 0; i < jsonHead.length; i++) { - $('#table_thead_tr').append('' + jsonHead[i].enName + '' + jsonHead[i].name + ' | ') } - let th = '' + 'Operation ' + '' + '操作' + ' | ' - $('#table_thead_tr').append(th) + if (this.isOperation){ + let th = '' + 'Operation ' + '' + '操作' + ' | ' + $('#table_thead_tr').append(th) + } }, - checkboxChange(value) { - console.log(value) + checkboxChange(checkedList) { + this.indeterminate = !!checkedList.length && checkedList.length < this.jsonBody.length + this.tableAll = checkedList.length === this.jsonBody.length }, checkboxAll(event) { + this.tableAll = event.target.checked this.checkboxList = [] - if (event.length > 0) { + if (this.tableAll) { this.jsonBody.forEach(res => { this.checkboxList.push(res.id) }) @@ -157,6 +152,9 @@ }, onChange() { + }, + OperationClick(ol, item) { + this.$emit(ol.ClickEvent, item) } } } diff --git a/jero-web/src/views/ceshiList/index.vue b/jero-web/src/views/ceshiList/index.vue index 80b0821ee..9e012718d 100644 --- a/jero-web/src/views/ceshiList/index.vue +++ b/jero-web/src/views/ceshiList/index.vue @@ -7,7 +7,12 @@
|---|