田源
2024-03-22 4754120748b4fb947a4cef0137c5f0192dc28cec
表格树
已修改3个文件
已重命名1个文件
136 ■■■■■ 文件已修改
Source/ProjectWeb/src/components/dynamic-components/dynamic-table.vue 120 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/components/dynamic-components/index.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/views/base/UIContentViewer.vue 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/views/base/uiDefineVO.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/ProjectWeb/src/components/dynamic-components/dynamic-table.vue
@@ -1,5 +1,6 @@
<template>
  <div class="UI-dynamic" :id="'UI-dynamic-'+areasName+componentVO.oid">
  <div>
    <div class="UI-dynamic" :id="'UI-dynamic-'+areasName+componentVO.oid" v-if="tableType === 'table'">
      <avue-crud v-model="form"
                 ref="dataTable"
                 :data="tableList"
@@ -18,6 +19,30 @@
        </template>
      </avue-crud>
    </div>
    <div class="UI-dynamic" :id="'UI-dynamic-'+areasName+componentVO.oid" v-if="tableType === 'TreeTable'">
      <avue-crud v-model="TreeForm"
                 :option="TreeOption"
                 :data="TreeData"
                 :page.sync="TreePage"
                 ref="treeTable"
                 @selection-change="TreeSelectChange">
        <template #icon="scope">
          <i :class="scope.row.icon"
             style="font-size:24px"></i>
        </template>
        <!--top区域按钮-->
        <template slot="menuLeft" slot-scope="scope">
          <dynamic-button LocationType="top" type="table":butttonList="componentVO.buttons" :selectList="selectList"></dynamic-button>
        </template>
        <!--menu区域按钮-->
        <template slot="menu" slot-scope="scope">
          <dynamic-button :scope="scope" LocationType="menu" type="table":butttonList="componentVO.buttons" :selectList="selectList"></dynamic-button>
        </template>
      </avue-crud>
    </div>
  </div>
</template>
<script>
@@ -55,15 +80,21 @@
      type:Array,
      default: []
    },
    tableType:{
      type:String
    }
  },
  data() {
    return {
      parentHeight:'100%',//当前组件根节点元素高度
      form: {},
      formName: '',
      loading: false,
      visible: false,
      page: {
        pageSize: 10,
        currentPage: 1,
        total: 5,
      },
      TreePage:{
        pageSize: 10,
        currentPage: 1,
        total: 5,
@@ -475,7 +506,85 @@
        menuFixed: false,
        column: [],
      },
      selectList:[]
      selectList:[],
      //表格树
      TreeForm:{},
      TreeOption:{
        height: '100%',
        addBtn:false,
        editBtn:false,
        delBtn:false,
        selection: true,
        calcHeight: 15,
        indexFixed: false,
        menuFixed: false,
        column: [
          {
            label: '事件',
            prop: 'event',
            align: 'left',
            width: 200
          },
          {
            label: '时间线',
            prop: 'timeLine'
          },
          {
            label: '备注',
            prop: 'comment'
          }
        ],
        rowKey: 'id',
        rowParentKey: 'parentId',
      },
      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: '无'
                }
              ]
            }
          ]
        }
      ],
      TreeSelectList:[]
    }
  },
  computed: {
@@ -530,6 +639,9 @@
  methods: {
    selectChange(row){
      this.selectList = row;
    },
    TreeSelectChange(row){
      this.TreeSelectList = row;
    }
  }
}
Source/ProjectWeb/src/components/dynamic-components/index.vue
@@ -1,5 +1,17 @@
<template>
  <dynamic-table v-if="componentVO.uiComponentType=='table'"
                 tableType="table"
                 :key="areasName+'table-'+componentVO.oid"
                 :inDialog="inDialog"
                 :componentVO="componentVO"
                 :sourceData="sourceData"
                 :areasName="areasName"
                 :paramVOS="paramVOS"
                 :isShow="isShow">
  </dynamic-table>
  <dynamic-table v-else-if="componentVO.uiComponentType=='TreeTable'"
                 tableType="TreeTable"
                 :key="areasName+'table-'+componentVO.oid"
                 :inDialog="inDialog"
                 :componentVO="componentVO"
Source/ProjectWeb/src/views/base/UIContentViewer.vue
Source/ProjectWeb/src/views/base/uiDefineVO.js
@@ -4827,8 +4827,8 @@
          "treeDefineVO": null,
          "treeTableDefineVO": null,
          "ts": null,
          "uiComponentType": "table",
          "uiComponentTypeText": "表格",
          "uiComponentType": "TreeTable",
          "uiComponentTypeText": "表格树",
          "uiParseClass": "",
          "versionRule": null,
          "versionSeq": 0,