田源
2024-11-01 8c107924ebc49105fa81f13f972f1710b42c1503
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue
@@ -1,32 +1,50 @@
<template>
  <div style="padding: 0 10px">
    <div style="text-align: center;margin-bottom: 10px">
      <avue-radio v-model="radioForm" :disabled ="readOnly" :dic="radioDic" style="margin: 0 20px 0 0;display: inline-block"></avue-radio>
      <avue-radio v-model="radioForm" :dic="radioDic" :disabled="readOnly"
                  style="margin: 0 20px 0 0;display: inline-block"></avue-radio>
      <el-button  v-if="!readOnly" plain size="mini" type="primary" @click="clearValue">清空值</el-button>
      <el-button  v-if="!readOnly" plain size="mini" type="primary" @click="delAll">删除全部条件</el-button>
    </div>
    <div v-if="radioForm==0" @drop="drop" @dragover.prevent style="height: 220px;text-align: center;">
      <div v-for="(condition,index) in conditionList" :key="index" class="el-input--small" style="margin-bottom: 5px; text-align:left">
        <span style="width: 200px;display: inline-block;text-align: right" :title="condition.clause">{{condition.clause}}</span>
        <avue-select :disabled ="readOnly" v-model="condition.operator" type="tree" :dic="condition.operatorDic" :clearable="false" style="width: 80px;margin: 0 5px;"></avue-select>
        <el-date-picker :disabled ="readOnly" v-if="condition.type=='VTDate'" v-model="condition.ordinaryValue" style="width:300px;margin-right: 5px;display: inline-block;" value-format="YYYY-MM-DD"
                        type="date">
    <div v-if="radioForm==0" style="height: 220px;text-align: center;" @drop="drop" @dragover.prevent>
      <div v-for="(condition,index) in conditionList" :key="index" class="el-input--small"
           style="margin-bottom: 5px; text-align:left">
        <span :title="condition.clause"
              style="width: 200px;display: inline-block;text-align: right">{{ condition.clause }}</span>
        <avue-select v-model="condition.operator" :clearable="false" :dic="condition.operatorDic" :disabled="readOnly"
                     style="width: 80px;margin: 0 5px;" type="tree"></avue-select>
        <el-date-picker v-if="condition.type=='VTDate'" v-model="condition.ordinaryValue" :disabled="readOnly"
                        style="width:300px;margin-right: 5px;display: inline-block;" type="date"
                        value-format="YYYY-MM-DD">
        </el-date-picker>
        <el-date-picker :disabled ="readOnly" v-else-if="condition.type=='VTDateTime'" v-model="condition.ordinaryValue" style="width:300px;margin-right: 5px;display: inline-block;"
        <el-date-picker v-else-if="condition.type=='VTDateTime'" v-model="condition.ordinaryValue" :disabled="readOnly"
                        style="width:300px;margin-right: 5px;display: inline-block;"
                        type="datetime">
        </el-date-picker>
        <el-time-select :disabled ="readOnly" v-else-if="condition.type=='VTTime'" v-model="condition.ordinaryValue" value-format="HH:mm:ss" style="width:300px;margin-right: 5px;display: inline-block;">
        <el-time-select v-else-if="condition.type=='VTTime'" v-model="condition.ordinaryValue" :disabled="readOnly"
                        style="width:300px;margin-right: 5px;display: inline-block;" value-format="HH:mm:ss">
        </el-time-select>
        <avue-input-number :disabled ="readOnly" v-else-if="condition.type=='VTInteger'" precision="0" v-model="condition.ordinaryValue" style="width:300px;margin-right: 5px;display: inline-block;"></avue-input-number>
        <avue-input-number :disabled ="readOnly" v-else-if="condition.type=='VTLong' || condition.type=='VTDouble'" v-model="condition.ordinaryValue" style="width:300px;margin-right: 5px;display: inline-block;"></avue-input-number>
        <avue-input :disabled ="readOnly" v-else v-model="condition.ordinaryValue" placeholder="" style="width: 300px;margin-right: 5px;"></avue-input>
        <avue-input-number v-else-if="condition.type=='VTInteger'" v-model="condition.ordinaryValue"
                           :disabled="readOnly"
                           precision="0"
                           style="width:300px;margin-right: 5px;display: inline-block;"></avue-input-number>
        <avue-input-number v-else-if="condition.type=='VTLong' || condition.type=='VTDouble'"
                           v-model="condition.ordinaryValue"
                           :disabled="readOnly"
                           style="width:300px;margin-right: 5px;display: inline-block;"></avue-input-number>
        <avue-input v-else v-model="condition.ordinaryValue" :disabled="readOnly" placeholder=""
                    style="width: 300px;margin-right: 5px;"></avue-input>
        <el-button v-if="!readOnly"  plain size="mini" type="primary" @click="checkTemp(index)">选择查询模板</el-button>
        <el-button v-if="!readOnly"  size="mini" type="danger" icon="el-icon-delete" @click="delCondition(index)" style="padding: 7px 8px"></el-button>
        <el-button v-if="!readOnly" icon="el-icon-delete" size="mini" style="padding: 7px 8px" type="danger"
                   @click="delCondition(index)"></el-button>
      </div>
    </div>
    <div v-else @drop="drop" @dragover.prevent style="height: 220px;text-align: left">
      <avue-tree ref="tree" @node-drag-end="handleDragEnd" @node-drag-leave="handleDragLeave"  @node-drag-over="handleDragOver"
                  style="height: 220px" :data="treeData" :option="treeOption"  @node-click="nodeClick" node-key="value"></avue-tree>
    <div v-else style="height: 220px;text-align: left" @drop="drop" @dragover.prevent>
      <avue-tree ref="tree" :data="treeData" :option="treeOption"
                 node-key="value"
                 style="height: 220px" @node-drag-end="handleDragEnd" @node-drag-leave="handleDragLeave"
                 @node-drag-over="handleDragOver"
                 @node-click="nodeClick"></avue-tree>
    </div>
    <div v-if="!readOnly" style="text-align: right;margin-top: 10px;">
      <el-button v-if="radioForm==1"  plain size="mini" type="primary" @click="addHandler">增加逻辑</el-button>
@@ -38,48 +56,67 @@
    <!--修改条件-->
    <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="550px"
               :append-to-body="true"
               class="avue-dialog"
               :destroy-on-close="true"
               :close-on-click-modal="false"
               width="550px"
               @close="dialog.showDialog=false">
      <div style="height: 200px;">
        {{clickNode.showLabel}}
        <avue-select v-if="['VTInteger','VTDouble','VTLong'].includes(clickNode.type)" v-model="clickNode.operator" type="tree" :dic="operatorIntDic" :clearable="false" style="width: 80px;margin: 0 5px;"></avue-select>
        <avue-select v-else-if="['VTDateTime','VTDate','VTTime'].includes(clickNode.type)" v-model="clickNode.operator" type="tree" :dic="operatorDateDic" :clearable="false" style="width: 80px;margin: 0 5px;"></avue-select>
        <avue-select v-else v-model="clickNode.operator" type="tree" :dic="operatorDic" :clearable="false" style="width: 80px;margin: 0 5px;"></avue-select>
        <el-date-picker v-if="clickNode.type=='VTDate'" v-model="clickNode.inputValue" style="width:300px;display: inline-block;" value-format="YYYY-MM-DD"
          type="date">
        <avue-select v-if="['VTInteger','VTDouble','VTLong'].includes(clickNode.type)" v-model="clickNode.operator"
                     :clearable="false" :dic="operatorIntDic" style="width: 80px;margin: 0 5px;"
                     type="tree"></avue-select>
        <avue-select v-else-if="['VTDateTime','VTDate','VTTime'].includes(clickNode.type)" v-model="clickNode.operator"
                     :clearable="false" :dic="operatorDateDic" style="width: 80px;margin: 0 5px;"
                     type="tree"></avue-select>
        <avue-select v-else v-model="clickNode.operator" :clearable="false" :dic="operatorDic"
                     style="width: 80px;margin: 0 5px;"
                     type="tree"></avue-select>
        <el-date-picker v-if="clickNode.type=='VTDate'" v-model="clickNode.inputValue"
                        style="width:300px;display: inline-block;" type="date"
                        value-format="YYYY-MM-DD">
        </el-date-picker>
        <el-date-picker v-else-if="clickNode.type=='VTDateTime'" v-model="clickNode.inputValue" style="width:350px;display: inline-block;"
        <el-date-picker v-else-if="clickNode.type=='VTDateTime'" v-model="clickNode.inputValue"
                        style="width:350px;display: inline-block;"
          type="datetime">
        </el-date-picker>
        <el-time-select v-else-if="clickNode.type=='VTTime'" v-model="clickNode.inputValue" value-format="HH:mm:ss" style="width:300px;display: inline-block;">
        <el-time-select v-else-if="clickNode.type=='VTTime'" v-model="clickNode.inputValue"
                        style="width:300px;display: inline-block;"
                        value-format="HH:mm:ss">
        </el-time-select>
        <avue-input-number v-else-if="clickNode.type=='VTInteger'" precision="0" v-model="clickNode.inputValue" style="width:300px;display: inline-block;"></avue-input-number>
        <avue-input-number v-else-if="clickNode.type=='VTLong' || clickNode.type=='VTDouble'" v-model="clickNode.inputValue" style="width:300px;display: inline-block;"></avue-input-number>
        <avue-input v-else v-model="clickNode.inputValue" type="textarea" style="width: 300px;margin-right: 5px;vertical-align: top;"></avue-input>
        <avue-input-number v-else-if="clickNode.type=='VTInteger'" v-model="clickNode.inputValue" precision="0"
                           style="width:300px;display: inline-block;"></avue-input-number>
        <avue-input-number v-else-if="clickNode.type=='VTLong' || clickNode.type=='VTDouble'"
                           v-model="clickNode.inputValue"
                           style="width:300px;display: inline-block;"></avue-input-number>
        <avue-input v-else v-model="clickNode.inputValue" style="width: 300px;margin-right: 5px;vertical-align: top;"
                    type="textarea"></avue-input>
      </div>
      <div class="dialog-footer avue-dialog__footer">
        <el-button size="small" @click="checkTemp" v-if="!['VTInteger','VTDouble','VTLong','VTDateTime','VTDate','VTTime'].includes(clickNode.type)">选择查询模板</el-button>
        <el-button type="primary" plain size="small" @click="submitDialog" >保 存</el-button>
        <el-button v-if="!['VTInteger','VTDouble','VTLong','VTDateTime','VTDate','VTTime'].includes(clickNode.type)"
                   size="small"
                   @click="checkTemp">
          选择查询模板
        </el-button>
        <el-button plain size="small" type="primary" @click="submitDialog">保 存</el-button>
        <el-button size="small" @click="dialog.showDialog=false">取 消</el-button>
      </div>
    </el-dialog>
    <el-dialog v-dialogDrag
               :append-to-body="true"
               :close-on-click-modal="false"
               :destroy-on-close="true"
               :title="queryDialog.title"
               :visible.sync="queryDialog.showDialog"
               width="800px"
               :append-to-body="true"
               class="avue-dialog"
               :destroy-on-close="true"
               :close-on-click-modal="false"
               width="800px"
               @close="cancleQueryDialog">
      <div class="el-input--small">
        输入查询字段:<avue-input v-model="queryField" style="width: 500px;margin-bottom: 10px"></avue-input>
        输入查询字段:
        <avue-input v-model="queryField" style="width: 500px;margin-bottom: 10px"></avue-input>
        <avue-crud  ref="crud" :data="crudData" :option="crudOption"
                    :page.sync="page"
                    :table-loading="tableLoading"
@@ -90,19 +127,19 @@
        </avue-crud>
      </div>
      <div class="dialog-footer avue-dialog__footer">
        <el-button type="primary" plain size="small" @click="submitQueryDialog" >确 定</el-button>
        <el-button plain size="small" type="primary" @click="submitQueryDialog">确 定</el-button>
        <el-button size="small" @click="cancleQueryDialog">取 消</el-button>
      </div>
    </el-dialog>
    <!--查询-->
    <el-dialog v-dialogDrag
               :append-to-body="true"
               :close-on-click-modal="false"
               :destroy-on-close="true"
               :title="queryResultDialog.title"
               :visible.sync="queryResultDialog.showDialog"
               width="900px"
               :append-to-body="true"
               class="avue-dialog"
               :destroy-on-close="true"
               :close-on-click-modal="false"
               width="900px"
               @close="queryResultDialog.showDialog=false">
      <div class="el-input--small">
        <avue-crud  ref="crud" :data="resultData" :option="resultOption"
@@ -118,6 +155,7 @@
import {getAllQTs} from "@/api/queryTemplate/queryDefine";
import {getCriteria} from "@/api/queryTemplate/linkTypeQuery";
import {dateFormat} from "@/util/date"
export default {
name: "formQueryDialog",
  props: {
@@ -222,16 +260,24 @@
        header: false,
        height: window.innerHeight-220,
        menu: false,
        column: [{
        column: [
          {
          label: 'OID',
          prop: 'OID',
        }, {
          label: 'CREATOR',
          prop: 'CREATOR'
        }, {
          label: 'CREATETIME',
          prop: 'CREATETIME'
        }]
          },
          {
            label: 'REVISIONOID',
            prop: 'REVISIONOID'
          },
          {
            label: 'NAMEOID',
            prop: 'NAMEOID'
          },
          {
            label: 'BTMNAME',
            prop: 'BTMNAME'
          }
        ]
      },
      clickNode:{},
      operatorIntDic:[{
@@ -375,6 +421,7 @@
        if(val && Object.keys(val).length>0){
          let treeData = [];
          let that=this;
          function initValue(nodeChild) {
            let children=[];
            if(nodeChild){
@@ -426,6 +473,7 @@
            }
            return children;
          }
          const node={
            label:val.connector,
            value:val.connector+this.treeIndex,