wangting
2024-09-06 5042cc0622d36e3df27d0d086219ba17bc40e2f5
查询模板
已修改4个文件
已删除1个文件
910 ■■■■ 文件已修改
Source/plt-web/plt-web-ui/src/api/queryTemplate/businessTypeQuery.js 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formDialog.vue 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formQueryDialog.vue 728 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/api/queryTemplate/businessTypeQuery.js
@@ -1,9 +1,9 @@
import request from '@/router/axios';
//业务类型查询模板
// åˆ›å»º
export function linkSave(params) {
export function btmSave(params) {
  return request({
    url: "/api/templateController/linkSave",
    url: "/api/templateController/btmSave",
    method: "post",
    data:params
  });
@@ -17,9 +17,9 @@
  });
}
// æŸ¥è¯¢æ¡ä»¶çš„æŸ¥è¯¢æŽ¥å£ï¼ŒæŽ¥å£æ–¹å¼POST,参数与保存接口传参一致
export function getCriteria(params) {
export function getCriteriaBtm(params) {
  return request({
    url: "/api/templateController/getCriteria",
    url: "/api/templateController/getCriteriaBtm",
    method: "post",
    data:params
  });
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formDialog.vue
@@ -60,6 +60,7 @@
                               :queryCondition="queryCondition"
                               :queryTree="queryTree"
                               :levelFlag.sync="form.levelFlag"
                               @queryHandler="queryHandler"
            ></form-query-dialog>
          </fieldset>
        </el-main>
@@ -73,10 +74,10 @@
</template>
<script>
import {linkSave,getBizTypeQTDs} from "@/api/queryTemplate/businessTypeQuery";
import {btmSave,getBizTypeQTDs,getCriteriaBtm} from "@/api/queryTemplate/businessTypeQuery";
import basicOption from "@/util/basic-option";
import {queryTemplateListByAttr} from "@/api/queryTemplate/queryDefine";
import formQueryDialog from "./formQueryDialog.vue";
import formQueryDialog from "@/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue";
export default {
  name: "formDialog",
  components:{formQueryDialog},
@@ -201,9 +202,18 @@
        allowDrop: () => {
          return false;
        },
        allowDrag: () => {
          return true;
        allowDrag: (dropNode) => {
          if (dropNode.data.attrs && dropNode.data.attrs.length>0) {
            return false;
          } else {
            return true;
          }
        },
        props:{
          label:'name',
          value:'name',
          children:'attrs'
        }
      },
      businessQueryDefineForm:'',//业务类型查询模板定义选中值
      businessQueryDefineDic:[],//业务类型查询模板定义下拉数据
@@ -227,7 +237,6 @@
      if (data.selectData) {
        this.selectData = data.selectData;
        this.form.qtName = this.selectData.qtName;
        this.form.level = this.selectData.queryTemplate.level;
        if (data.selectData.queryTemplate.orderInfoList && data.selectData.queryTemplate.orderInfoList.length > 0) {
          this.orderInfoList = JSON.parse(JSON.stringify(data.selectData.queryTemplate.orderInfoList));//已有排序
        }
@@ -244,6 +253,7 @@
        };
      }
      this.dialog.showDialog = true;
      this.treeOption.defaultExpandedKeys=[data.treeData.label]
      this.getTemp(data.treeData.label)
      this.getAllAttr();
    },
@@ -268,7 +278,7 @@
        if (valid) {
          const formData=this.initFormData();
          console.log(formData)
          linkSave(formData).then(res => {
          btmSave(formData).then(res => {
            if (res.data.success) {
              this.$message.success("保存成功");
              this.cancelDialog();
@@ -288,16 +298,7 @@
        qtName: this.form.qtName,
        levelFlag: this.form.levelFlag,
        queryTemplate: {
          clauseList: ['*'],
          direction: this.form.direction,
          id: this.form.qtName,
          linkType: this.form.btmName,
          orderInfoList: this.orderInfoList,
          recReturnMode: 1,//递归返回数据模式:1:RECRETURNMODE_FLAT, 2:RECRETURNMODE_FILTER
          rightFlag: true,
          secretFlag: true,
          type: 'link',
          version: this.form.version
        }
      }
      if (formData.levelFlag == 1) {
@@ -341,7 +342,6 @@
    },
    // è¡Œåˆ é™¤
    rowDeleteHandler(data) {
      debugger;
      this.orderInfoList.splice(data.index,1);
      this.orderFieldList.unshift({
        id: data.row.orderField
@@ -390,31 +390,22 @@
    //获取查询模板定义下拉
    getTemp(btmName) {
      if (btmName) {
        queryTemplateListByAttr({btmName: btmName}).then(res => {
        queryTemplateListByAttr({btmName: btmName,linkFlag:false}).then(res => {
          const data = res.data.data.map(item => {
            item.label = item.name + '-' + (item.linkTypeName || item.btmName);
            item.label = item.name + '-' + item.btmName;
            item.value = item.name;
            return item;
          });
            this.businessQueryDefineDic=data;
            data.length>0 && (this.businessQueryDefineForm= data[0].value);
        })
      }
    },
    businessQueryDefineChange(data) {
      if (data.value) {
        const childData = data.item.attrs.map(item => {
          return {
            label: item.name,
            value: item.name,
            atttributes:item
          };
        });
        this.businessTreeData = [{
          label: data.value,
          value: data.value,
          children: childData
          name: data.value,
          attrs: data.item.attrs
        }]
      }
    },
@@ -430,7 +421,25 @@
      if(this.form.levelFlag==1) {
        this.$refs.formQuery.$refs.tree.$emit('tree-node-drag-end', ev);
      }
    }
    },
    //查询
    queryHandler(){
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.$refs.formQuery.queryResultDialog.loading=true;
          const formData=this.initFormData();
          getCriteriaBtm(formData).then(res => {
            if (res.data.success) {
              this.resultData=res.data.data;
              this.$refs.formQuery.queryResultDialog.showDialog=true;
              this.$refs.formQuery.queryResultDialog.loading=false;
            }
          });
        } else {
          return false;
        }
      });
    },
  },
}
</script>
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/businessTypeQuery/formQueryDialog.vue
ÎļþÒÑɾ³ý
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue
@@ -60,6 +60,7 @@
                               :queryCondition="queryCondition"
                               :queryTree="queryTree"
                               :levelFlag.sync="form.levelFlag"
                               @queryHandler="queryHandler"
            ></form-query-dialog>
          </fieldset>
        </el-main>
@@ -85,7 +86,7 @@
<script>
import {getAllOrderbyAttributeByLink} from "@/api/modeling/linkType/api";
import {linkSave} from "@/api/queryTemplate/linkTypeQuery";
import {linkSave,getCriteria} from "@/api/queryTemplate/linkTypeQuery";
import basicOption from "@/util/basic-option";
import {queryTemplateListByAttr} from "@/api/queryTemplate/queryDefine";
import formQueryDialog from "./formQueryDialog.vue";
@@ -268,12 +269,21 @@
        addBtn: false,
        filter:false,
        draggable: true,
        allowDrop: () => {
        allowDrop: (node) => {
          return false;
        },
        allowDrag: () => {
          return true;
        allowDrag: (dropNode) => {
          if (dropNode.data.attrs && dropNode.data.attrs.length>0) {
            return false;
          } else {
            return true;
          }
        },
        props:{
          label:'name',
          value:'name',
          children:'attrs'
        }
      },
      linkQueryDefineForm:'',//链接类型查询模板定义选中值
      linkQueryDefineDic:[],//链接类型查询模板定义下拉数据
@@ -369,7 +379,9 @@
        };
      }
      this.dialog.showDialog = true;
      this.treeOption.defaultExpandedKeys=[data.treeData.label]
      this.getTemp(data.treeData.label, true)
    },
    cancelDialog() {
      this.dialog.loading = false;
@@ -534,33 +546,17 @@
    },
    linkQueryDefineChange(data) {
      if (data.value) {
        const childData = data.item.attrs.map(item => {
          return {
            label: item.name,
            value: item.name,
            atttributes:item
          };
        });
        this.linkTreeData = [{
          label: data.value,
          value: data.value,
          children: childData
          name: data.value,
          attrs: data.item.attrs
        }]
      }
    },
    businessQueryDefineChange(data) {
      if (data.value) {
        const childData = data.item.attrs.map(item => {
          return {
            label: item.name,
            value: item.name,
            atttributes:item
          };
        });
        this.businessTreeData = [{
          label: data.value,
          value: data.value,
          children: childData
          name: data.value,
          attrs: data.item.attrs
        }]
      }
    },
@@ -576,7 +572,25 @@
      if(this.form.levelFlag==1) {
        this.$refs.formQuery.$refs.tree.$emit('tree-node-drag-end', ev);
      }
    }
    },
    //查询
    queryHandler(){
      this.$refs.form.validate((valid) => {
        if (valid) {
          this.$refs.formQuery.queryResultDialog.loading=true;
          const formData=this.initFormData();
          getCriteria(formData).then(res => {
            if (res.data.success) {
              this.resultData=res.data.data;
              this.$refs.formQuery.queryResultDialog.showDialog=true;
              this.$refs.formQuery.queryResultDialog.loading=false;
            }
          });
        } else {
          return false;
        }
      });
    },
  },
}
</script>
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue
@@ -94,6 +94,7 @@
        <el-button size="small" @click="cancleQueryDialog">取 æ¶ˆ</el-button>
      </div>
    </el-dialog>
    <!--查询-->
    <el-dialog v-dialogDrag
               :title="queryResultDialog.title"
               :visible.sync="queryResultDialog.showDialog"
@@ -102,7 +103,7 @@
               class="avue-dialog"
               :destroy-on-close="true"
               :close-on-click-modal="false"
               @close="queryResultDialog.showDialog='false'">
               @close="queryResultDialog.showDialog=false">
      <div class="el-input--small">
        <avue-crud  ref="crud" :data="resultData" :option="resultOption"
                    :table-loading="queryResultDialog.loading">
@@ -453,18 +454,18 @@
      const data = JSON.parse(event.dataTransfer.getData('item'));
      if (this.radioForm == 0) {
        const params = {
          clause: data.value,
          clause: data.name,
          operator: '=',
          ordinaryValue: ''
        }
        if (data.atttributes.vtDataType == 'VTInteger' || data.atttributes.vtDataType == 'VTDouble' || data.atttributes.vtDataType == 'VTLong') {
        if (data.vtDataType == 'VTInteger' || data.vtDataType == 'VTDouble' || data.vtDataType == 'VTLong') {
          params.operatorDic =JSON.parse(JSON.stringify(this.operatorIntDic)) ;
        } else if (data.atttributes.vtDataType == 'VTDateTime' || data.atttributes.vtDataType == 'VTDate' || data.atttributes.vtDataType == 'VTTime') {
        } else if (data.vtDataType == 'VTDateTime' || data.vtDataType == 'VTDate' || data.vtDataType == 'VTTime') {
          params.operatorDic = JSON.parse(JSON.stringify(this.operatorDateDic))
        } else {
          params.operatorDic = JSON.parse(JSON.stringify(this.operatorDic))
        }
        params.type=data.atttributes.vtDataType;
        params.type=data.vtDataType;
        this.conditionList.push(params)
      }else {
        if (this.clickNode.label != '并且' && this.clickNode.label != '或者') {
@@ -477,21 +478,21 @@
    initItem(data){
      this.treeIndex++;
      let item={
        label: data.value,
        value: data.value + this.treeIndex,
        label: data.name,
        value: data.name + this.treeIndex,
        valueIndex: 'v' + this.treeIndex,
        type:data.vtDataType,
        children: [],
        inputValue:data.value,
        inputValue:'',
        operator:'=',
        showLabel:data.value
        showLabel:data.name
      };
      let showLabel='';
      if(data.value.indexOf('.')!=-1){
        const labels=data.value.split('.')
      if(data.name.indexOf('.')!=-1){
        const labels=data.name.split('.')
        showLabel=labels[labels.length-1];
      }else {
        showLabel=data.value;
        showLabel=data.name;
      }
      item.showLabel=showLabel;
      return item
@@ -615,21 +616,7 @@
    },
    //查询
    queryHandler(){
      this.$parent.$parent.$parent.$parent.$refs.form.validate((valid) => {
        if (valid) {
          this.queryResultDialog.loading=true;
          const formData=this.$parent.$parent.$parent.$parent.initFormData();
          getCriteria(formData).then(res => {
            if (res.data.success) {
              this.resultData=res.data.data;
              this.queryResultDialog.showDialog=true;
              this.queryResultDialog.loading=false;
            }
          });
        } else {
          return false;
        }
      });
      this.$emit('queryHandler');
    },
    //选择查询模板
    checkTemp(index) {