wangting
2024-08-30 da4310936f073b70e64b87b842af43790d7d04e4
链接类型查询模板
已修改4个文件
已添加1个文件
251 ■■■■ 文件已修改
Source/plt-web/plt-web-ui/src/App.vue 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue 82 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/index.vue 39 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Source/plt-web/plt-web-ui/src/App.vue
@@ -48,6 +48,9 @@
.avue-dialog .el-dialog__body .avue-form{
  margin: 0px auto 40px; // å•独给对话框里的avue表单加上下边距
}
.dialog-footer{
  background-color: #ffffff;
}
.avue-crud .avue-form {
  margin: 0px auto !important; // è¡¨æ ¼å†…的表单(比如:搜索栏) å–消下边距
}
Source/plt-web/plt-web-ui/src/components/PLT-basic-component/basicForm.vue
@@ -191,7 +191,7 @@
        showProp:item.showField,
        type: type,
        labelWidth: this.labelWidth || (item.text.length >= 6 ? 115 : 90),
        disabled: !this.isEdit || item.readOnly || this.disabled,
        disabled: item.readOnly || this.disabled,
        span: item.span
          ? item.span
          : item.type === "textarea"
@@ -226,6 +226,7 @@
      };
      if(!this.isEdit){
        col.placeholder=col.label;
        col.disabled=true;
      }
      if(col.type === 'richText'){
        this.subitemName = col.field;
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formDialog.vue
@@ -55,9 +55,7 @@
        <el-main>
          <fieldset style="margin: 0 10px">
            <legend>&nbsp;查询条件&nbsp;</legend>
            <div style="height: 300px;">
            </div>
            <form-query-dialog style="height: 300px;"></form-query-dialog>
          </fieldset>
        </el-main>
        <el-aside style="width:350px">
@@ -85,9 +83,10 @@
import {linkSave} from "@/api/queryTemplate/linkTypeQuery";
import basicOption from "@/util/basic-option";
import {gridTemplate} from "@/api/queryTemplate/queryDefine";
import {deleteAttributes} from "@/api/modeling/attributePool/api";
import formQueryDialog from "./formQueryDialog.vue";
export default {
  name: "formDialog",
  components:{formQueryDialog},
  data(){
    return {
      dialog: {
@@ -175,16 +174,7 @@
      form:{
        btmName:'',
        qtName: '',
        queryTemplate:{
        }
      },
      formTemplate:{
        btmName:'',
        qtName: '',
        queryTemplate:{
        }
        queryTemplate:{}
      },
      //已有排序列表配置
      crudOption: {
@@ -322,31 +312,55 @@
      },
      immediate: true,
    },
    'dialog.type': {
      handler(val) {
        if(val=='edit'){
        }
      },
      immediate: true,
    },
  },
  methods: {
    openDialog(btmName, title, mode, data) {
      this.dialog.title = title;
      this.dialog.showDialog = true;
      this.dialog.type = mode;
      this.form.btmName = btmName;
      this.treeData = data.treeData;
      if (data.selectData) {
        this.selectData = data.selectData;
        this.orderInfoList = JSON.parse(JSON.stringify(data.selectData.queryTemplate.orderInfoList));//已有排序
        this.formItems[0].disabled = true
        this.form.qtName = this.selectData.qtName;
        this.form.direction = this.selectData.queryTemplate.direction;
        this.form.btmType = this.selectData.queryTemplate.btmType;
        this.form.version = this.selectData.queryTemplate.version;
        this.form.queryISLeaf = this.selectData.queryTemplate.queryISLeaf;
        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));//已有排序
        }
      } else {
        this.selectData = {};
        this.orderInfoList =[];
        this.orderInfoList = [];
        this.formItems[0].disabled = false;
      }
      this.getTemp(data.treeData.label,true)
      this.getTemp(data.treeData.label, true)
      this.$nextTick(()=>{
        this.dialog.showDialog = true;
      });
    },
    cancelDialog() {
      this.dialog.loading = false;
      this.dialog.showDialog = false;
      this.$nextTick(() => {
        this.form = this.formTemplate;
        this.form = {
          btmName: '',
          qtName: '',
          queryTemplate: {}
        };
        this.orderInfoList =[];
        this.dialog.loading = false;
        this.dialog.showDialog = false;
        this.$refs.form.resetFields();
        this.$refs.form.clearValidate();
        this.businessQueryDefineForm='';
        this.linkQueryDefineForm='';
      });
@@ -354,8 +368,28 @@
    submitDialog() {
      this.$refs.form.validate((valid) => {
        if (valid) {
          linkSave(this.form).then(res => {
            if (res.success) {
          let formData={
            btmName:this.form.btmName,
            qtName:this.form.qtName,
            queryTemplate:{
              btmType:this.form.btmType,
              clauseList:['*'],
              direction:this.form.direction,
              id:this.form.qtName,
              level:this.form.level,
              linkType:this.form.btmName,
              orderInfoList:this.orderInfoList,
              queryISLeaf:this.form.queryISLeaf,
              recReturnMode:1,//递归返回数据模式:1:RECRETURNMODE_FLAT, 2:RECRETURNMODE_FILTER
              rightFlag:true,
              secretFlag:true,
              type:'link',
              version:this.form.version
            }
          }
          formData.condition=[]
          linkSave(formData).then(res => {
            if (res.data.success) {
              this.$message.success("保存成功");
              this.cancelDialog();
              this.$emit("refresh");
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/formQueryDialog.vue
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,124 @@
<template>
  <div style="padding: 0 10px">
    <div style="text-align: center;margin-bottom: 10px">
      <avue-radio v-model="radioForm"  :dic="radioDic" style="margin: 0 20px 0 0;display: inline-block"></avue-radio>
      <el-button  plain size="mini" type="primary" @click="clearValue">清空值</el-button>
      <el-button  plain size="mini" type="primary" @click="delAll">删除全部条件</el-button>
    </div>
    <div v-if="radioForm==0" style="height: 220px;text-align: center;">
      <div v-for="condition in conditionList" class="el-input--small">
        <span>condition.clause</span>
        <avue-select v-model="condition.operator"  type="tree" :dic="operatorDic" style="width: 80px;margin: 0 5px"></avue-select>
        <avue-input v-model="condition.ordinaryValue" placeholder="" style="width: 400px"></avue-input>
      </div>
    </div>
    <div v-else style="height: 220px;text-align: left">
      <avue-tree style="height: 220px" :data="treeData" :option="treeOption"></avue-tree>
    </div>
    <div style="text-align: right;margin-top: 10px;">
      <el-button v-if="radioForm==1"  plain size="mini" type="primary" @click="addHandler">增加逻辑</el-button>
      <el-button v-if="radioForm==1"  plain size="mini" type="primary" @click="del">修改条件</el-button>
      <el-button v-if="radioForm==1"  plain size="mini" type="primary" @click="del">删除</el-button>
      <el-button  plain size="mini" type="primary" @click="del">查询</el-button>
      <el-button  plain size="mini" type="primary" @click="del">取消</el-button>
    </div>
  </div>
</template>
<script>
export default {
name: "formQueryDialog",
  data() {
    return {
      radioForm: 0,
      radioDic: [{
        label: '普通',
        value: 0
      }, {
        label: '高级',
        value: 1
      }],
      conditionList:[{
        clause:'OID'
      }],
      treeOption:{
        defaultExpandAll:true,
        menu: false,
        addBtn: false,
        filter:false,
      },
      treeData:{},
      //VTInteger、VTDouble、VTLong
      operatorIntDic:[{
        label:'=',
        value:'='
      },{
        label:'!=',
        value:'!='
      },{
        label:'包含',
        value:'包含'
      },{
        label:'in',
        value:'in'
      },{
        label:'not in',
        value:'not in'
      },{
        label:'>=',
        value:'>='
      },{
        label:'>',
        value:'>'
      },{
        label:'<=',
        value:'<='
      },{
        label:'<',
        value:'<'
      }],
      //VTDateTime、VTDate、VTTime
      operatorTimeDic:[{
        label:'=',
        value:'='
      },{
        label:'!=',
        value:'!='
      },{
        label:'in',
        value:'in'
      },{
        label:'not in',
        value:'not in'
      },{
        label:'>=',
        value:'>='
      },{
        label:'<=',
        value:'<='
      }],
      //其它
      operatorDic:[{
        label:'=',
        value:'='
      },{
        label:'!=',
        value:'!='
      },{
        label:'包含',
        value:'包含'
      },{
        label:'in',
        value:'in'
      },{
        label:'not in',
        value:'not in'
      }]
    }
  }
}
</script>
<style scoped>
</style>
Source/plt-web/plt-web-ui/src/views/modelingMenu/queryTemplate/linkTypeQuery/index.vue
@@ -2,9 +2,9 @@
  <el-container>
    <el-aside>
      <basic-container>
        <div ref="TreeBox" style="height: calc(100vh - 154px);!important;">
        <div ref="TreeBox" style="height: calc(100vh - 164px);!important;">
          <!-- å·¦ä¾§æ ‘         -->
          <div style="height:  calc(100vh - 190px);">
          <div style="height:  calc(100vh - 200px);">
            <avue-tree :data="treeData" :option="treeOption" @node-click="nodeClick">
          <span slot-scope="{ node, data }" class="el-tree-node__label">
           <span style="font-size: 15px">
@@ -35,16 +35,12 @@
        <form-dialog ref="formRef" @refresh="getTemp"></form-dialog>
      </basic-container>
    </el-main>
    <div style="width: 300px;">111</div>
  </el-container>
</template>
<script>
import {gridLink} from "@/api/modeling/linkType/api";
import { gridTemplate, saveTemplate, updateTemplate} from "@/api/queryTemplate/queryDefine";
import {getObjTypeQTs,deleteLinkTemplate} from "@/api/queryTemplate/linkTypeQuery";
import func from "@/util/func";
import {dateFormat} from "@/util/date";
import basicOption from "@/util/basic-option";
import FormDialog from "./formDialog.vue"
@@ -120,6 +116,34 @@
          formatter:function (row, value) {
            return row.queryTemplate.btmType;
          }
        }, {
          label: '版本版次',
          prop: 'version',
          formatter:function (row, value) {
            if(row.queryTemplate.version==1){
              return '当前版本当前版次'
            }else  if(row.queryTemplate.version==2){
              return '当前版本最新版次'
            }else if(row.queryTemplate.version==3){
              return '最新版本最新版次'
            }else if(row.queryTemplate.version==7){
              return '已发布的最新版本'
            }else {
              return ''
            }
          }
        }, {
          label: '查询是否有下级',
          prop: 'queryISLeaf',
          formatter:function (row, value) {
            return row.queryTemplate.queryISLeaf
          }
        }, {
          label: '子节点层次数',
          prop: 'level',
          formatter:function (row, value) {
            return row.queryTemplate.level;
          }
        }]
      },
      selectionRow: [],
@@ -194,9 +218,10 @@
        let names=this.selectionRow.map(item=>{
          return item.qtName
        })
        deleteLinkTemplate(names).then(res => {
        deleteLinkTemplate({names:names.join(',')}).then(res => {
          if (res.data.code === 200) {
            this.$message.success(res.data.obj);
            this.getTemp();
          }
        })
      }).catch(() => {