| | |
| | | :data="TreeData" |
| | | :option="option" |
| | | :page.sync="pageType" |
| | | @row-click="rowClickChange" |
| | | @selection-change="TreeSelectChange"> |
| | | <template #icon="scope"> |
| | | <i :class="scope.row.icon" |
| | |
| | | </template> |
| | | <!--top区域按钮--> |
| | | <template slot="menuLeft" slot-scope="scope"> |
| | | <dynamic-button :butttonList="componentVO.buttons" :selectList="TreeSelectList" LocationType="top" |
| | | <dynamic-button :componentVO="componentVO" :butttonList="componentVO.buttons" :dataStore="TreeSelectList" :sourceData="sourceData" LocationType="top" |
| | | type="TreeTable"></dynamic-button> |
| | | </template> |
| | | |
| | | <!--menu区域按钮--> |
| | | <template slot="menu" slot-scope="scope"> |
| | | <dynamic-button :butttonList="componentVO.buttons" :scope="scope" :selectList="TreeSelectList" LocationType="menu" default="default" |
| | | <dynamic-button :componentVO="componentVO" :butttonList="componentVO.buttons" :scope="scope" :dataStore="TreeSelectList" :sourceData="sourceData" LocationType="menu" default="default" |
| | | type="TreeTable"></dynamic-button> |
| | | </template> |
| | | </avue-crud> |
| | |
| | | export default { |
| | | name: "dynamic-TreeTable", |
| | | props: { |
| | | //ui上下文的业务类型(或链接类型) |
| | | uiBtmType: { |
| | | type: String |
| | | }, |
| | | //ui上下文 |
| | | uiContext:{ |
| | | type: String |
| | | }, |
| | | componentVO: { |
| | | type: Object, |
| | | default: {} |
| | |
| | | prop: 'comment' |
| | | } |
| | | ], |
| | | rowKey: 'id', |
| | | rowParentKey: 'parentId', |
| | | |
| | | rowKey: this.componentVO.treeTableDefineVO.treeCurrentField || 'oid', |
| | | rowParentKey: this.componentVO.treeTableDefineVO.treeParentField || 'parentOid', |
| | | }, |
| | | TreeData: [ |
| | | { |
| | | id: 10, |
| | | event: '事件1', |
| | | timeLine: 50, |
| | | comment: '无' |
| | | }, |
| | | { |
| | | id: 1, |
| | | event: '事件1', |
| | | timeLine: 100, |
| | | comment: '无', |
| | | children: [ |
| | | { |
| | | parentId: 1, |
| | | id: 2, |
| | | event: '事件2', |
| | | timeLine: 10, |
| | | comment: '无' |
| | | }, |
| | | { |
| | | parentId: 1, |
| | | id: 3, |
| | | event: '事件3', |
| | | timeLine: 90, |
| | | comment: '无', |
| | | children: [ |
| | | { |
| | | parentId: 3, |
| | | id: 4, |
| | | event: '事件4', |
| | | timeLine: 5, |
| | | comment: '无' |
| | | }, |
| | | { |
| | | parentId: 3, |
| | | id: 5, |
| | | event: '事件5', |
| | | timeLine: 10, |
| | | comment: '无' |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | id: 10, |
| | | event: '事件3', |
| | | timeLine: 50, |
| | | comment: '无' |
| | | }, |
| | | { |
| | | id: 10, |
| | | event: '事件4', |
| | | timeLine: 50, |
| | | comment: '无' |
| | | }, |
| | | { |
| | | id: 10, |
| | | event: '事件5', |
| | | timeLine: 50, |
| | | comment: '无' |
| | | }, |
| | | { |
| | | id: 10, |
| | | event: '事件6', |
| | | timeLine: 50, |
| | | comment: '无' |
| | | }, |
| | | ], |
| | | TreeData: [], |
| | | TreeSelectList: [], |
| | | // 表单数据 |
| | | formList: [ |
| | |
| | | }, |
| | | sourceData:{ |
| | | handler(newval) { |
| | | //源数据有变化时变更当前区域数据 |
| | | console.log(this.areasName); |
| | | console.log(newval); |
| | | } |
| | |
| | | } |
| | | }, |
| | | methods: { |
| | | rowClickChange(row){ |
| | | this.$refs.treeTable.toggleRowSelection(row); |
| | | }, |
| | | TreeSelectChange(row) { |
| | | this.TreeSelectList = row; |
| | | this.$emit("setDataStore", { |
| | | area: this.areasName, |
| | | type:this.componentVO.uiComponentType, |
| | | dataStore:row |
| | | }); |
| | | }, |
| | | handleRefresh(){ |
| | | this.$refs.treeTable.refreshTable(); |
| | | } |
| | | } |
| | | } |
| | | </script> |