田源
2024-09-27 a5f2dad996fcdb22a670743102b9fd08370738cd
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/components/action.vue
@@ -1,55 +1,68 @@
<template>
  <el-container>
    <el-aside>
      <basic-container>
        <!-- 左侧树 -->
        <div style="height:580px">
          <avue-tree
            ref="tree"
            v-model="treeForm"
            :data="treeData"
            :option="treeOption"
            @node-click="nodeClick">
  <el-dialog
    v-dialogDrag
    :visible.sync="btnActionVisible"
    append-to-body="true"
    class="avue-dialog"
    title="选择Action"
    width="70%"
    @close="dialogClose">
    <el-container>
      <el-aside>
        <basic-container>
          <!-- 左侧树 -->
          <div>
            <avue-tree
              ref="tree"
              v-model="treeForm"
              :data="treeData"
              :option="treeOption"
              node-key="value"
              @node-click="nodeClick">
          <span slot-scope="{ node, data }" class="el-tree-node__label">
           <span style="font-size: 15px">
              <i class="el-icon-s-promotion"></i>
                {{ (node || {}).label }}
            </span>
          </span>
          </avue-tree>
        </div>
      </basic-container>
    </el-aside>
            </avue-tree>
          </div>
        </basic-container>
      </el-aside>
    <el-main>
      <basic-container>
        <div>
          <avue-crud
            ref="crud"
            v-model="form"
            :data="data"
            :option="option"
            :page.sync="page"
            :table-loading="tableLoading"
            @search-change="handleSearch"
            @search-reset="handleReset"
            @refresh-change="handleRefresh"
            @selection-change="selectChangeHandler"
            @row-click="rowClickHandler">
            <template slot="plTypeType" slot-scope="{row}">
              <el-tag :type="row.plTypeType === 'business' ? '' : 'success'">
                {{ row.plTypeType === 'business' ? '业务类型' : '链接类型' }}
              </el-tag>
            </template>
      <el-main>
        <basic-container>
          <div>
            <avue-crud
              ref="crud"
              v-model="form"
              :data="data"
              :option="option"
              :page.sync="page"
              :table-loading="tableLoading"
              @search-change="handleSearch"
              @search-reset="handleReset"
              @refresh-change="handleRefresh"
              @selection-change="selectChangeHandler"
              @row-click="rowClickHandler">
              <template slot="plTypeType" slot-scope="{row}">
                <el-tag :type="row.plTypeType === 'business' ? '' : 'success'">
                  {{ row.plTypeType === 'business' ? '业务类型' : '链接类型' }}
                </el-tag>
              </template>
          </avue-crud>
        </div>
      </basic-container>
    </el-main>
            </avue-crud>
          </div>
        </basic-container>
      </el-main>
  </el-container>
    </el-container>
    <span slot="footer" class="dialog-footer">
        <el-button @click="btnActionVisible = false">取 消</el-button>
        <el-button type="primary" @click="actionSaveHandler">确 定</el-button>
      </span>
  </el-dialog>
</template>
<script>
@@ -75,6 +88,7 @@
  name: "index",
  data() {
    return {
      btnActionVisible: false,
      currenRow: {}, // action当前行信息
      topMethodsObj: {
        select: true,
@@ -126,7 +140,7 @@
      option: {
        ...basicOption,
        addBtn: false,
        height: 'auto',
        height: 500,
        highlightCurrentRow: true,
        column: [
          {
@@ -334,9 +348,6 @@
          this.selectList = [];
        }
      );
      // 请求action下方参数列表数据
      this.getBottomList(row);
    },
    // 搜索
@@ -368,6 +379,22 @@
      this.getRightTableList(this.treeNodeRow);
    },
    // 保存action
    actionSaveHandler() {
      if (this.selectList.length != 1) {
        this.$message.error('只能选择一条数据');
        return;
      }
      this.$emit('updataAction', this.selectList[0]);
      this.dialogClose();
    },
    dialogClose(){
      this.btnActionVisible = false;
      this.data = [];
      this.$refs.tree.setCurrentKey(null);
    }
  }
}
</script>