田源
2024-11-01 8c107924ebc49105fa81f13f972f1710b42c1503
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formDialog.vue
@@ -1,23 +1,23 @@
<template>
  <el-dialog v-dialogDrag
             :append-to-body="true"
             :close-on-click-modal="false"
             :destroy-on-close="true"
             :title="dialog.title"
             :visible.sync="dialog.showDialog"
             width="1620px"
             :append-to-body="true"
             class="avue-dialog"
             :destroy-on-close="true"
             :close-on-click-modal="false"
             width="1620px"
             @close="cancelDialog">
    <div style="min-height: 665px;max-height: 85vh;padding-bottom: 50px;">
      <basic-form key="linkQueryForm" style="margin-bottom: 0"
                  ref="form"
                  :span="4"
                  :formItems="formItems"
      <basic-form key="linkQueryForm" ref="form"
                  :formData="form"
                  :formItems="formItems"
                  :span="4"
                  style="margin-bottom: 0"
                  @getFormData="getFormData">
      </basic-form>
      <avue-crud  ref="crud" title="设置排序"
                  :data="orderInfoList" :option="crudOption">
      <avue-crud ref="crud" :data="orderInfoList"
                 :option="crudOption" title="设置排序">
        <template slot="menuLeft" slot-scope="scope">
          <el-button icon="el-icon-plus" size="small" type="primary" @click="addRow">创建</el-button>
        </template>
@@ -27,17 +27,17 @@
        </template>
      </avue-crud>
      <el-dialog v-dialogDrag
                 title="创建"
                 :visible.sync="crudDialog.showDialog"
                 width="500px"
                 :append-to-body="true"
                 class="avue-dialog"
                 :destroy-on-close="true"
                 :close-on-click-modal="false"
                 :destroy-on-close="true"
                 :visible.sync="crudDialog.showDialog"
                 class="avue-dialog"
                 title="创建"
                 width="500px"
                 @close="crudDialog.showDialog=false">
        <avue-form ref="tableForm" :option="tableFormOption" v-model="tableForm"></avue-form>
        <avue-form ref="tableForm" v-model="tableForm" :option="tableFormOption"></avue-form>
        <div class="dialog-footer avue-dialog__footer">
          <el-button type="primary" plain size="small" @click="rowSave" >保 存</el-button>
          <el-button plain size="small" type="primary" @click="rowSave">保 存</el-button>
        </div>
      </el-dialog>
      <el-container style="margin-top: 10px;">
@@ -46,8 +46,11 @@
            <legend>&nbsp;候选条件&nbsp;</legend>
            <div>
              查询模板定义
              <avue-select @change="businessQueryDefineChange" class="el-input--small" v-model="businessQueryDefineForm" placeholder="请选择内容" type="tree" :dic="businessQueryDefineDic" style="width: 240px;"></avue-select>
              <avue-tree style="height: 265px" :data="businessTreeData" :option="treeOption"  @node-drag-start="handleDragStart" @node-drag-end="handleDragEnd">
              <avue-select v-model="businessQueryDefineForm" :dic="businessQueryDefineDic" class="el-input--small"
                           placeholder="请选择内容" style="width: 240px;" type="tree"
                           @change="businessQueryDefineChange"></avue-select>
              <avue-tree :data="businessTreeData" :option="treeOption" style="height: 265px"
                         @node-drag-start="handleDragStart" @node-drag-end="handleDragEnd">
              </avue-tree>
            </div>
          </fieldset>
@@ -56,10 +59,10 @@
          <fieldset style="margin: 0 10px">
            <legend>&nbsp;查询条件&nbsp;</legend>
            <form-query-dialog ref="formQuery"
                               style="height: 300px;"
                               :levelFlag.sync="form.levelFlag"
                               :queryCondition="queryCondition"
                               :queryTree="queryTree"
                               :levelFlag.sync="form.levelFlag"
                               style="height: 300px;"
                               @queryHandler="queryHandler"
            ></form-query-dialog>
          </fieldset>
@@ -67,7 +70,7 @@
      </el-container>
    </div>
    <div class="dialog-footer avue-dialog__footer">
      <el-button type="primary" plain size="small" @click="submitDialog" >保 存</el-button>
      <el-button plain size="small" type="primary" @click="submitDialog">保 存</el-button>
      <el-button size="small" @click="cancelDialog">取 消</el-button>
    </div>
  </el-dialog>
@@ -78,6 +81,7 @@
import basicOption from "@/util/basic-option";
import {queryTemplateListByAttr} from "@/api/queryTemplate/queryDefine";
import formQueryDialog from "@/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue";
export default {
  name: "formDialog",
  components:{formQueryDialog},
@@ -225,8 +229,7 @@
      queryCondition:[],
    };
  },
  watch: {
  },
  watch: {},
  methods: {
    openDialog(btmName, title, mode, data) {
      this.dialog.title = title;
@@ -304,6 +307,7 @@
      if (formData.levelFlag == 1) {
        //高级
        let that = this;
        function initValue(nodeChild) {
          let children = [];
          if (nodeChild) {
@@ -430,7 +434,21 @@
          const formData=this.initFormData();
          getCriteriaBtm(formData).then(res => {
            if (res.data.success) {
              this.resultData=res.data.data;
              const data = res.data.data;
              const result = data.map(item => {
                const filteredAttrs = item.hisAttrValList.filter(attr =>
                  attr.attrName === "OID" || attr.attrName === "REVISIONOID" || attr.attrName === "BTMNAME" || attr.attrName === "NAMEOID"
                );
                const newObj = filteredAttrs.reduce((acc, attr) => {
                  acc[attr.attrName] = attr.attrVal;
                  return acc;
                }, {});
                return newObj;
              });
              this.$refs.formQuery.resultData = result;
              this.$refs.formQuery.queryResultDialog.showDialog=true;
              this.$refs.formQuery.queryResultDialog.loading=false;
            }