wangting
2024-09-27 7e45169698349fa0b0b37b151edce5bb28eab74f
Source/plt-web/plt-web-ui/src/views/modelingMenu/ui/uiDefine/rightRegion/bottomTable/index.vue
@@ -1,5 +1,5 @@
<template>
  <basic-container>
  <div>
    <avue-crud
      ref="crud"
      v-model="form"
@@ -190,71 +190,27 @@
        </el-container>
      </el-container>
    </el-dialog>
  </basic-container>
  </div>
</template>
<script>
import basicOption from "@/util/basic-option";
import func from "@/util/func";
import {
  getPLPageDefinations,
  getBtmDatasByPage,
  getPortalVIDatasByPage,
  getQTInfoDatasByPage,
  getTabButtons,
  addTapButton,
  updateTapButton
} from "@/api/UI/uiDefine/api";
  updateTapButton, getTabByContextIdAndType
} from "@/api/UI/uiDefine";
export default {
  props: {
    sourceData: {
      type: Array,
      default: () => [
        {
          "controlPath": "",
          "description": "",
          "eventKey": "",
          "eventMap": null,
          "eventValue": "",
          "expandCols": "",
          "expandMode": "",
          "extAttr": "",
          "id": "ABAE25CE-867E-9C73-AC1A-B316FD91C65B",
          "isShowImage": "",
          "linkType": "parttodocument",
          "name": "技术文件",
          "navigatorType": "",
          "orderField": "",
          "orderMode": "",
          "orientation": "",
          "qryType": null,
          "queryTemplateName": "QueryPartEngineeringTechnology",
          "refTreeSet": "",
          "returnRows": "",
          "rootContent": "",
          "searchTarger": "2",
          "separator": "",
          "seq": "1",
          "showAbs": "",
          "showContent": "",
          "showContentRelation": "",
          "showContentTable": "",
          "showContentType": "",
          "showExpression": "",
          "showExpressionRoot": "",
          "showLinkAbs": "",
          "showType": "document",
          "subUILayout": "",
          "subUIObjType": "",
          "tabPageOId": "98F9082F-BAF4-FB81-3230-32590B34A329",
          "templateId": "PartEngineeringTechnology_list",
          "templateType": "1",
          "type": 3,
          "uiLayout": null,
          "uiParser": "",
          "validity": ""
        }
      ]
      type: Object,
      default: () => {}
    },
    height: {
      type: String,
@@ -299,13 +255,7 @@
      basicForm: {
        seq: 1
      },
      treeData: [
        {
          label: this.sourceData[0].name,
          oId: 'parentNode',
          children: []
        }
      ],
      treeData: [],
      treeOption: {
        menu: false,
        addBtn: false,
@@ -320,7 +270,7 @@
      btnDesignVisible: false,
      FormData: [],
      form: {},
      data: this.sourceData,
      data: [],
      option: {
        ...basicOption,
        height: this.height,
@@ -816,8 +766,31 @@
      formDataRow: {},
    }
  },
  watch: {
    sourceData:{
      handler(val) {
        if(val && val.plOId) {
          this.getTableList()
        }
      },
      immediate: true,
      deep:true
    }
  },
  computed: {},
  methods: {
    //获取列表数据
    getTableList(){
      const params = {
        pageContextOId:this.sourceData.plOId
      }
      getPLPageDefinations( params).then(res => {
        this.data = res.data.data;
        this.selectList=[];
        this.$refs.crud.clearSelection();
        this.tableLoading = false;
      })
    },
    // 根据不同值区分类型
    templateTypeValueHandler(val) {
      const componentMap = {
@@ -983,12 +956,8 @@
    // 按钮设计
    btnDesignClickHandler() {
      if (this.selectList.length <= 0) {
        this.$message.error('请至少选择一条数据');
        return;
      }
      if (this.selectList.length > 1) {
        this.$message.error('最多选择一条数据');
      if (this.selectList.length !=1) {
        this.$message.error('请选择一条数据');
        return;
      }
      this.btnDesignVisible = true;
@@ -1004,7 +973,11 @@
      getTabButtons(params).then(res => {
        if (res.data.code === 200) {
          const data = res.data.data;
          this.treeData[0].children = data;
          this.treeData=[{
              label: this.selectList[0].name,
              oId: 'parentNode',
              children:data
            }];
          this.treeLoading = false;
        } else {
          this.$message.error('请检查控制台错误');