Browse Source

高级设置

xiaoqiao 1 year ago
parent
commit
e4ddb95247

+ 6 - 2
src/main/java/com/bowintek/practice/controller/TempController.java

@@ -90,8 +90,7 @@ public class TempController {
             rtnObject.put("genStatuStr", data.getGenStatuStr());
             rtnObject.put("errMessage", data.getErrMessage());
             rtnObject.put("fileName", temp.getTempName());
-        }
-        catch (Exception ex){
+        } catch (Exception ex) {
             rtnObject.put("code", -1);
         }
         return RespGenerstor.success(rtnObject);
@@ -155,4 +154,9 @@ public class TempController {
     public BaseResponse getDictionaryList(@RequestBody List<String> codeList) {
         return RespGenerstor.success(tempService.getDictionaryToHashMap(codeList));
     }
+
+    @GetMapping("/getSubjectFieldList")
+    public BaseResponse<List<HashMap<String, Object>>> getSubjectFieldList(String subId) {
+        return RespGenerstor.success(tempService.getSubjectFieldList(subId));
+    }
 }

+ 25 - 21
src/main/java/com/bowintek/practice/services/impl/TempServiceImpl.java

@@ -52,7 +52,7 @@ public class TempServiceImpl implements TempService {
 
     @Override
     public PageInfo<SaerchtempVo> getList(Integer page, Integer rows,
-                                          String tempNo, String tempName, String beiginDate,String endDate,List<String> idList) {
+                                          String tempNo, String tempName, String beiginDate, String endDate, List<String> idList) {
         PageHelper.startPage(page, rows);
 
         List<SaerchtempVo> dataList = tempCQuery.getList(tempNo, tempName, beiginDate, endDate,
@@ -79,12 +79,12 @@ public class TempServiceImpl implements TempService {
         tempCQuery.deletesDimensionByTempId(idList);
         tempCQuery.deletesFieldByTempId(idList);
         tempCQuery.deletesMeasureByTempId(idList);
-        SrSaerchtempExample example=new SrSaerchtempExample();
+        SrSaerchtempExample example = new SrSaerchtempExample();
         example.or().andTempIdIn(idList);
         return srSaerchtempMapper.deleteByExample(example);
     }
 
-    public SrTempData startTempDataToExcel(String tempId, String userId){
+    public SrTempData startTempDataToExcel(String tempId, String userId) {
         TempObjectModel models = getTemp(tempId);
         models.pagination = new PaginationModel();
         models.pagination.page = 1;
@@ -115,23 +115,23 @@ public class TempServiceImpl implements TempService {
         return tempData;
     }
 
-    public void genTempDataToExcel(TempObjectModel models, GenSqlStringResult sqlStringResult, SrTempData tempData){
-        try{
+    public void genTempDataToExcel(TempObjectModel models, GenSqlStringResult sqlStringResult, SrTempData tempData) {
+        try {
             HSSFWorkbook excel = new HSSFWorkbook(); //创建xls文件
             HSSFSheet sheet = excel.createSheet(models.temp.getTempName()); //创建一个新表
             //写入表头
             HSSFRow header = sheet.createRow(0); //创建表头行(第0行)
             List<ExceNameModel> names = sqlStringResult.getExcelNameList();
-            for(int i=0;i<names.size();i++){
+            for (int i = 0; i < names.size(); i++) {
                 header.createCell(i).setCellValue(names.get(i).getTitle());
             }
 
             //分页写入数据
             int limit = 300;
-            int pageCount = (int) Math.ceil((double)tempData.getDataCount()/(double)limit);
-            System.out.println("分页数量:"+ pageCount + " 每页:"+limit);
+            int pageCount = (int) Math.ceil((double) tempData.getDataCount() / (double) limit);
+            System.out.println("分页数量:" + pageCount + " 每页:" + limit);
             int rowIndex = 1;
-            for(int page=1;page<=pageCount;page++) {
+            for (int page = 1; page <= pageCount; page++) {
                 //重新取得数据分页语句
                 models.pagination = new PaginationModel();
                 models.pagination.page = page;
@@ -140,28 +140,28 @@ public class TempServiceImpl implements TempService {
                 //查询数据
                 List<Map<String, Object>> rows = genSqlStringService.getListBySqlString(sqlStringResult.getMainSqlString());
                 //写入数据到excel
-                for(int n=0;n<rows.size();n++) {
+                for (int n = 0; n < rows.size(); n++) {
                     HSSFRow data = sheet.createRow(rowIndex);
                     Map<String, Object> map = rows.get(n);
 
-                    for(int idx=0;idx<names.size();idx++){
+                    for (int idx = 0; idx < names.size(); idx++) {
                         String key = names.get(idx).getReFieldName();
-                        Object val = map.containsKey(key)? map.get(key) : null;
+                        Object val = map.containsKey(key) ? map.get(key) : null;
                         //写入数据,需要处理数据类型
-                        data.createCell(idx).setCellValue(val==null?"":val.toString());
+                        data.createCell(idx).setCellValue(val == null ? "" : val.toString());
                     }
                     //excel 下一行
                     rowIndex++;
                 }
 
                 //保存状态,汇报生成进度
-                tempData.setGenCount(rowIndex-1);
+                tempData.setGenCount(rowIndex - 1);
                 srTempDataMapper.updateByPrimaryKey(tempData);
-                System.out.println("已生成数据:"+tempData.getGenCount()+"/"+tempData.getDataCount());
+                System.out.println("已生成数据:" + tempData.getGenCount() + "/" + tempData.getDataCount());
             }
 
             //输出数据到文件
-            String fileName = tempData.getTempDataId()+".xlsx";
+            String fileName = tempData.getTempDataId() + ".xlsx";
             String filePath = "excel/";
             String fileDir = appConfig.staticLocations.replace("file:", "") + filePath;
             Path dictPath = Paths.get(fileDir);
@@ -179,10 +179,9 @@ public class TempServiceImpl implements TempService {
             tempData.setGenStatus(2);
             tempData.setGenStatuStr("生成成功");
             tempData.setErrMessage("");
-            tempData.setFilePath(filePath+fileName);
+            tempData.setFilePath(filePath + fileName);
             srTempDataMapper.updateByPrimaryKey(tempData);
-        }
-        catch (Exception ex){
+        } catch (Exception ex) {
             ex.printStackTrace();
             tempData.setGenStatus(-1);
             tempData.setGenStatuStr("生成失败");
@@ -291,10 +290,10 @@ public class TempServiceImpl implements TempService {
         return fields;
     }
 
-    public HashMap<String, Object> getDictionaryToHashMap(List<String> codeList){
+    public HashMap<String, Object> getDictionaryToHashMap(List<String> codeList) {
         List<HashMap<String, Object>> resultList = tempCQuery.getDictionaryToHashMap(codeList);
         HashMap<String, Object> rtnMaps = new HashMap<>();
-        codeList.forEach(str->{
+        codeList.forEach(str -> {
             List<HashMap<String, Object>> dics = resultList.stream()
                     .filter(e -> str.equals(e.get("dictionaryCode")))
                     .collect(Collectors.toList());
@@ -302,4 +301,9 @@ public class TempServiceImpl implements TempService {
         });
         return rtnMaps;
     }
+
+    @Override
+    public List<HashMap<String, Object>> getSubjectFieldList(String subId) {
+        return subjectCQuery.getSubjectFieldToHashMapList(Arrays.asList(subId));
+    }
 }

+ 1 - 0
src/main/java/com/bowintek/practice/services/service/TempService.java

@@ -20,4 +20,5 @@ public interface TempService {
     int deleteTemp(List<String> idList);
     HashMap<String, Object> getDictionaryToHashMap(List<String> codeList);
     SrTempData startTempDataToExcel(String tempId, String userId);
+    List<HashMap<String, Object>> getSubjectFieldList(String subId);
 }

+ 0 - 2
target/classes/application.yml

@@ -21,14 +21,12 @@ spring:
       username: root
       password: bowin123
       url: jdbc:mysql://office.bowintek.com:3306/smartSearchDB?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone=Asia/Shanghai
-      # driver-class需要注意mysql驱动的版本(com.mysql.cj.jdbc.Driver 或 com.mysql.jdbc.Driver)
       driver-class-name: com.mysql.jdbc.Driver
     postgre:
       # 数据源基本配置
       username: postgres
       password: bowin123
       url: jdbc:postgresql://office.bowintek.com:5432/postgres
-      # driver-class需要注意mysql驱动的版本(com.mysql.cj.jdbc.Driver 或 com.mysql.jdbc.Driver)
       driver-class-name: org.postgresql.Driver
     druid:
       #监控统计拦截的filters

BIN
vue/src/assets/images/logo-login.png


BIN
vue/src/assets/images/logo1.png


+ 239 - 210
vue/src/components/basic/query/drag-where.vue

@@ -13,8 +13,12 @@
            @dragenter.prevent="childDragEnter($event, index)"
            @dragleave="childDragleave($event, index)">
         <div class="query-area-header">
-          <div class="query-area-item-title" @click="handleDisplay(index)">{{it.displayName?it.displayName : it.fieldName}}</div>
-          <div class="query-area-item-close" @click="childDelete(index)"><CloseOutlined style="color: white;"/></div>
+          <div class="query-area-item-title" @click="handleDisplay(index)">
+            {{ it.displayName ? it.displayName : it.fieldName }}
+          </div>
+          <div class="query-area-item-close" @click="childDelete(index)">
+            <CloseOutlined style="color: white;"/>
+          </div>
         </div>
         <template v-for="(op, idx) in tagList[index].values">
           <div v-if="convertDataType(tagList[index])==0" class="query-area-body">
@@ -22,11 +26,11 @@
               <a-select v-model:value="tagList[index].values[idx].operation" :options="operTexts"></a-select>
             </div>
             <div class="query-area-body-input">
-              <a-input v-model:value="tagList[index].values[idx].val" placeholder="值..." />
+              <a-input v-model:value="tagList[index].values[idx].val" placeholder="值..."/>
             </div>
             <div v-if="false" class="query-area-body-edit">
               <PlusSquareOutlined v-if="(idx==0)" @click="operationInsert(index, idx)"/>
-              <MinusSquareOutlined  v-if="(idx>0)" @click="operationDelete(index, idx)"/>
+              <MinusSquareOutlined v-if="(idx>0)" @click="operationDelete(index, idx)"/>
             </div>
           </div>
 
@@ -35,22 +39,23 @@
               <a-select v-model:value="tagList[index].values[idx].operation" :options="operNumbers"></a-select>
             </div>
             <div class="query-area-body-input">
-              <a-input v-model:value="tagList[index].values[idx].val" placeholder="值..." />
+              <a-input v-model:value="tagList[index].values[idx].val" placeholder="值..."/>
             </div>
             <div v-if="tagList[index].values[idx].operation=='limit'" class="query-area-body-text">
             </div>
             <div v-if="tagList[index].values[idx].operation=='limit'" class="query-area-body-input">
-              <a-input v-model:value="tagList[index].values[idx].val2" placeholder="值..." />
+              <a-input v-model:value="tagList[index].values[idx].val2" placeholder="值..."/>
             </div>
             <div v-if="false" class="query-area-body-edit">
               <PlusSquareOutlined v-if="(idx==0)" @click="operationInsert(index, idx)"/>
-              <MinusSquareOutlined  v-if="(idx>0)" @click="operationDelete(index, idx)"/>
+              <MinusSquareOutlined v-if="(idx>0)" @click="operationDelete(index, idx)"/>
             </div>
           </div>
 
           <div v-if="convertDataType(tagList[index])==2" class="query-area-body">
-            <div :class="(getIsTimeLimit(tagList[index].values[idx].operation)?'query-area-body-oper':'query-area-body-time')">
+            <div
+              :class="(getIsTimeLimit(tagList[index].values[idx].operation)?'query-area-body-oper':'query-area-body-time')">
               <a-select v-model:value="tagList[index].values[idx].operation" :options="operTimes"></a-select>
             </div>
             <div class="query-area-body-input">
@@ -75,11 +80,11 @@
               <a-date-picker
                 v-else-if="(getTimeType(tagList[index].values[idx].operation)=='date')"
                 v-model:value="tagList[index].values[idx].val2"
-                placeholder="日期..." />
+                placeholder="日期..."/>
             </div>
             <div v-if="false" class="query-area-body-edit">
               <PlusSquareOutlined v-if="(idx==0)" @click="operationInsert(index, idx)"/>
-              <MinusSquareOutlined  v-if="(idx>0)" @click="operationDelete(index, idx)"/>
+              <MinusSquareOutlined v-if="(idx>0)" @click="operationDelete(index, idx)"/>
             </div>
           </div>
 
@@ -88,11 +93,12 @@
               <a-select v-model:value="tagList[index].values[idx].operation" :options="operDics"></a-select>
             </div>
             <div class="query-area-body-input">
-              <a-select v-model:value="tagList[index].values[idx].val" :options="(dics[tagList[index].dictionaryCode])"></a-select>
+              <a-select v-model:value="tagList[index].values[idx].val"
+                        :options="(dics[tagList[index].dictionaryCode])"></a-select>
             </div>
             <div v-if="false" class="query-area-body-edit">
               <PlusSquareOutlined v-if="(idx==0)" @click="operationInsert(index, idx)"/>
-              <MinusSquareOutlined  v-if="(idx>0)" @click="operationDelete(index, idx)"/>
+              <MinusSquareOutlined v-if="(idx>0)" @click="operationDelete(index, idx)"/>
             </div>
           </div>
         </template>
@@ -101,226 +107,249 @@
   </div>
 
   <a-modal v-model:visible="modelName.open" title="修改显示名称" @ok="handleDisplayOk">
-    <div style="line-height: 30px;">属性名称:{{modelName.fieldName}}</div>
+    <div style="line-height: 30px;">属性名称:{{ modelName.fieldName }}</div>
     <div>
       <a-input v-model:value="modelName.displayName"
-               :placeholder="(modelName.fieldName+'...')" />
+               :placeholder="(modelName.fieldName+'...')"/>
     </div>
   </a-modal>
 </template>
 <script lang="ts">
-  import {defineComponent, computed} from "vue";
-  import DragBase from './drag-base.vue'
-  import type {SelectProps} from 'ant-design-vue';
-  import dayjs, { Dayjs } from 'dayjs';
-  import { postData} from '@/api/common';
+import {defineComponent, computed} from "vue";
+import DragBase from './drag-base.vue'
+import type {SelectProps} from 'ant-design-vue';
+import dayjs, {Dayjs} from 'dayjs';
+import {postData} from '@/api/common';
 
-  export default defineComponent({
-    name : 'DragWhere',
-    extends : DragBase,
-    data(){
-      return{
-        operTexts : [
-          { value: '=', label: '等于'},
-          { value: 'like', label: '包含'},
-          { value: 'null', label: '为空'},
-          { value: 'not null', label: '不为空'}
-        ] as SelectProps['options'],
-        operDics : [
-          { value: '=', label: '等于'}
-        ] as SelectProps['options'],
-        operTimes : [
-          { label: '日期', options:[
-              { value: 'date', label: '日期区间'},
-              { value: 'date,>', label: '日期大于'},
-              { value: 'date,<', label: '日期小于'},
-              { value: 'date,=', label: '日期等于'},
-              { value: 'date,>=', label: '日期大于等于'},
-              { value: 'date,<=', label: '日期小于等于'}]},
-          { label: '日期时间', options:[
-              { value: 'datetime', label: '时间区间'},
-              { value: 'datetime,>', label: '时间大于'},
-              { value: 'datetime,<', label: '时间小于'},
-              { value: 'datetime,=', label: '时间等于'},
-              { value: 'datetime,>=', label: '时间大于等于'},
-              { value: 'datetime,<=', label: '时间小于等于'}]}
-        ] as SelectProps['options'],
-        operNumbers : [
-          { value: '>', label: '大于'},
-          { value: '>=', label: '大于等于'},
-          { value: '=', label: '等于'},
-          { value: '<', label: '小于'},
-          { value: '<=', label: '小于等于'},
-          { value: 'limit', label: '区间'}
-        ] as SelectProps['options'],
-        dics:{},
-        dicTest :[]
-      }
-    },
-    setup(props, context){
-      console.log("measure setup" , props);
+export default defineComponent({
+  name: 'DragWhere',
+  extends: DragBase,
+  data() {
+    return {
+      operTexts: [
+        {value: '=', label: '等于'},
+        {value: 'like', label: '包含'},
+        {value: 'null', label: '为空'},
+        {value: 'not null', label: '不为空'}
+      ] as SelectProps['options'],
+      operDics: [
+        {value: '=', label: '等于'}
+      ] as SelectProps['options'],
+      operTimes: [
+        {
+          label: '日期', options: [
+            {value: 'date', label: '日期区间'},
+            {value: 'date,>', label: '日期大于'},
+            {value: 'date,<', label: '日期小于'},
+            {value: 'date,=', label: '日期等于'},
+            {value: 'date,>=', label: '日期大于等于'},
+            {value: 'date,<=', label: '日期小于等于'}]
+        },
+        {
+          label: '日期时间', options: [
+            {value: 'datetime', label: '时间区间'},
+            {value: 'datetime,>', label: '时间大于'},
+            {value: 'datetime,<', label: '时间小于'},
+            {value: 'datetime,=', label: '时间等于'},
+            {value: 'datetime,>=', label: '时间大于等于'},
+            {value: 'datetime,<=', label: '时间小于等于'}]
+        }
+      ] as SelectProps['options'],
+      operNumbers: [
+        {value: '>', label: '大于'},
+        {value: '>=', label: '大于等于'},
+        {value: '=', label: '等于'},
+        {value: '<', label: '小于'},
+        {value: '<=', label: '小于等于'},
+        {value: 'limit', label: '区间'}
+      ] as SelectProps['options'],
+      dics: {},
+      dicTest: []
+    }
+  },
+  setup(props, context) {
+    console.log("measure setup", props);
 
-      const dataChange = (list, obj) => {
-        context.emit('change', list, obj)
-      }
-      const subjectId = computed(() => {
-        return props.subjectId? props.subjectId : null
-      });
+    const dataChange = (list, obj) => {
+      context.emit('change', list, obj)
+    }
+    const subjectId = computed(() => {
+      return props.subjectId ? props.subjectId : null
+    });
 
-      return{
-        queryType: props.queryType ? props.queryType : 'dimen',
-        keyName : props.keyName == null || props.keyName == undefined ? 'tempFeildId' : props.keyName,
-        dataChange,
-        subjectId
-      }
-    },
-    methods:{
-      getObject:function (data){
-        console.log("getObject", data);
-        if(data.dictionaryCode) this.getDictionary(data.dictionaryCode);
-        return {
-          tempFeildId : data.tempFeildId,
-          tempId: data.tempId ? data.tempId : null,
-          fieldId: data.fieldId ? data.fieldId : null,
-          fieldCode: data.fieldCode ? data.fieldCode : null,
-          dataType : data.dataType ? data.dataType : 'int',
+    return {
+      queryType: props.queryType ? props.queryType : 'dimen',
+      keyName: props.keyName == null || props.keyName == undefined ? 'tempFeildId' : props.keyName,
+      dataChange,
+      subjectId
+    }
+  },
+  methods: {
+    getObject: function (data) {
+      console.log("getObject", data);
+      if (data.dictionaryCode) this.getDictionary(data.dictionaryCode);
+      return {
+        tempFeildId: data.tempFeildId,
+        tempId: data.tempId ? data.tempId : null,
+        fieldId: data.fieldId ? data.fieldId : null,
+        fieldCode: data.fieldCode ? data.fieldCode : null,
+        dataType: data.dataType ? data.dataType : 'int',
 
-          fieldAlias : data.fieldAlias,
-          fieldName: data.fieldName,
-          isDrag : 1,
-          displayName: data.displayName ? data.displayName : null,
-          values : data.values ? data.values :
-            [{ operation : (this.convertDataType(data)==2?'date':'='), val :'', val2 : '' }],
+        fieldAlias: data.fieldAlias,
+        fieldName: data.fieldName,
+        isDrag: 1,
+        displayName: data.displayName ? data.displayName : null,
+        values: data.values ? data.values :
+          [{operation: (this.convertDataType(data) == 2 ? 'date' : '='), val: '', val2: ''}],
 
-          subId : data.subId? data.subId : null,
-          subjectName : data.subjectName? data.subjectName : null,
-          queryType : data.queryType? data.queryType : null,
-          dictionaryCode : data.dictionaryCode? data.dictionaryCode : null
-        };
-      },
-      operationInsert(index){
-        this.tagList[index].values.push({ operation : '=', val :'' });
-      },
-      operationDelete(index, idx){
-        this.tagList[index].values.splice(idx, 1);
-      },
-      convertDataType(row : any){
-        if(row.queryType && row.queryType<=4) return row.queryType-1;
-        else return 0;
-      },
-      onRangeChange(value: [Dayjs, Dayjs], dateString: [string, string]) {
-        console.log('Selected Time: ', value);
-        console.log('Formatted Selected Time: ', dateString);
-      },
-      getTagList(){
-        this.tagList.forEach((row, index)=>{
-          row.disOrder = index;
-          row.operation = row.values[0].operation;
-          if(this.convertDataType(row)==2) {
-            row.value1 = row.value2 = null;
+        subId: data.subId ? data.subId : null,
+        subjectName: data.subjectName ? data.subjectName : null,
+        queryType: data.queryType ? data.queryType : null,
+        dictionaryCode: data.dictionaryCode ? data.dictionaryCode : null
+      };
+    },
+    operationInsert(index) {
+      this.tagList[index].values.push({operation: '=', val: ''});
+    },
+    operationDelete(index, idx) {
+      this.tagList[index].values.splice(idx, 1);
+    },
+    convertDataType(row: any) {
+      if (row.queryType && row.queryType <= 4) return row.queryType - 1;
+      else return 0;
+    },
+    onRangeChange(value: [Dayjs, Dayjs], dateString: [string, string]) {
+      console.log('Selected Time: ', value);
+      console.log('Formatted Selected Time: ', dateString);
+    },
+    getTagList() {
+      this.tagList.forEach((row, index) => {
+        row.disOrder = index;
+        row.operation = row.values[0].operation;
+        if (this.convertDataType(row) == 2) {
+          row.value1 = row.value2 = null;
 
-            let formatString = "YYYY-MM-DD";
-            if (this.getTimeType(row.values[0].operation) == "datetime") formatString = "YYYY-MM-DD HH:mm:ss";
+          let formatString = "YYYY-MM-DD";
+          if (this.getTimeType(row.values[0].operation) == "datetime") formatString = "YYYY-MM-DD HH:mm:ss";
 
-            if (this.getIsTimeLimit(row.operation) && row.values[0].val && row.values[0].val.length > 0 && row.values[0].val[0]) {
-              row.value1 = row.values[0].val[0].format(formatString);
-            }
-            if (this.getIsTimeLimit(row.operation) && row.values[0].val && row.values[0].val.length > 1 && row.values[0].val[1]) {
-              row.value2 = row.values[0].val[1].format(formatString);
-            }
-            if (!this.getIsTimeLimit(row.operation) && row.values[0].val2) {
-              row.value1 = row.values[0].val2.format(formatString);
-            }
+          if (this.getIsTimeLimit(row.operation) && row.values[0].val && row.values[0].val.length > 0 && row.values[0].val[0]) {
+            row.value1 = row.values[0].val[0].format(formatString);
+          }
+          if (this.getIsTimeLimit(row.operation) && row.values[0].val && row.values[0].val.length > 1 && row.values[0].val[1]) {
+            row.value2 = row.values[0].val[1].format(formatString);
           }
-          else {
-            row.value1 = row.values[0].val;
-            row.value2 = row.values[0].val2;
+          if (!this.getIsTimeLimit(row.operation) && row.values[0].val2) {
+            row.value1 = row.values[0].val2.format(formatString);
           }
-        });
-        return this.tagList;
-      },
-      setTagList(list){
-        list.forEach((row)=>{
-          row.values = [{ operation : row.operation, val :row.value1, val2 : row.value2 }];
+        } else {
+          row.value1 = row.values[0].val;
+          row.value2 = row.values[0].val2;
+        }
+      });
+      return this.tagList;
+    },
+    setTagList(list) {
+      list.forEach((row) => {
+        row.values = [{operation: row.operation, val: row.value1, val2: row.value2}];
 
-          if(this.convertDataType(row)==2){
-            let formatString = "YYYY-MM-DD";
-            if(this.getTimeType(row.values[0].operation)=="datetime") formatString="YYYY-MM-DD HH:mm:ss";
+        if (this.convertDataType(row) == 2) {
+          let formatString = "YYYY-MM-DD";
+          if (this.getTimeType(row.values[0].operation) == "datetime") formatString = "YYYY-MM-DD HH:mm:ss";
 
-            row.values[0].val = [];
-            row.values[0].val2 = null;
-            if(row.value1 && row.value1.length>0){
-              row.values[0].val.push(dayjs(row.value1,formatString));
-              row.values[0].val2 = dayjs(row.value1,formatString);
-            }
-            if(row.value2 && row.value2.length>0){
-              row.values[0].val.push(dayjs(row.value2,formatString));
-            }
+          row.values[0].val = [];
+          row.values[0].val2 = null;
+          if (row.value1 && row.value1.length > 0) {
+            row.values[0].val.push(dayjs(row.value1, formatString));
+            row.values[0].val2 = dayjs(row.value1, formatString);
+          }
+          if (row.value2 && row.value2.length > 0) {
+            row.values[0].val.push(dayjs(row.value2, formatString));
           }
-          if(row.dictionaryCode) this.getDictionary(row.dictionaryCode);
-        });
+        }
+        if (row.dictionaryCode) this.getDictionary(row.dictionaryCode);
+      });
 
-        this.tagList = list;
-      },
-      getIsTimeLimit:function (operStr:String){
-        if(operStr==undefined || operStr==null) return true;
-        return operStr.split(',').length == 1;
-      },
-      getTimeType : function (operStr:String){
-        if(operStr==undefined || operStr==null) return 'date';
-        return operStr.split(',')[0];
-      },
-      getDictionary:async function (dicCode){
-        if(!this.dics[dicCode]) {
-          const result: any = await postData('temp/getDictionaryList', [dicCode]);
-          this.dics[dicCode] = result[dicCode];
-          this.dics[dicCode].splice(0, 0, {value:'', label:'空'});
+      this.tagList = list;
+    },
+    changeList(list: any[]) {
+      this.tagList = this.tagList.filter(tag => list.filter(it => tag.field == it.field).length > 0);
+      list.forEach(it => {
+        let size = this.tagList.filter(tag => tag.field == it.field);
+        if (size == 0) {
+          this.tagList.push(it);
         }
-        console.log("dicCode", dicCode, this.dics);
-        return this.dics[dicCode];
+      })
+      this.setTagList(this.tagList);
+    },
+    getIsTimeLimit: function (operStr: String) {
+      if (operStr == undefined || operStr == null) return true;
+      return operStr.split(',').length == 1;
+    },
+    getTimeType: function (operStr: String) {
+      if (operStr == undefined || operStr == null) return 'date';
+      return operStr.split(',')[0];
+    },
+    getDictionary: async function (dicCode) {
+      if (!this.dics[dicCode]) {
+        const result: any = await postData('temp/getDictionaryList', [dicCode]);
+        this.dics[dicCode] = result[dicCode];
+        this.dics[dicCode].splice(0, 0, {value: '', label: '空'});
       }
+      console.log("dicCode", dicCode, this.dics);
+      return this.dics[dicCode];
     }
-  })
+  }
+})
 </script>
 <style lang="less" scoped>
-  @import 'drag-base.less';
-  .query-area-header{
-    display: flex;
-    flex-direction: row;
-  }
-  .query-area-header .query-area-item-title{
-    flex-grow: 1;
-  }
-  .query-area-body{
-    display: flex;
-    flex-direction: row;
-    margin-bottom: 5px;
-  }
-  .query-area-body-oper{
-    width: 100px;
-  }
-  .query-area-body-time{
-    width: 150px;
-  }
-  .query-area-body-input{
-    flex-grow: 1;
-  }
-  .query-area-item{
-    width: 280px !important;
-  }
-  .query-area-item-time{
-    width: 380px !important;
-  }
-  .query-area-body-edit{
-    font-size: 18px;
-    padding-left: 5px;
-    cursor: pointer;
-  }
-  .query-area-body-text{
-    height: 30px;
-    line-height: 30px;
-    padding-left: 5px;
-    padding-right: 5px;
-    margin-top: 1px;
-  }
+@import 'drag-base.less';
+
+.query-area-header {
+  display: flex;
+  flex-direction: row;
+}
+
+.query-area-header .query-area-item-title {
+  flex-grow: 1;
+}
+
+.query-area-body {
+  display: flex;
+  flex-direction: row;
+  margin-bottom: 5px;
+}
+
+.query-area-body-oper {
+  width: 100px;
+}
+
+.query-area-body-time {
+  width: 150px;
+}
+
+.query-area-body-input {
+  flex-grow: 1;
+}
+
+.query-area-item {
+  width: 280px !important;
+}
+
+.query-area-item-time {
+  width: 380px !important;
+}
+
+.query-area-body-edit {
+  font-size: 18px;
+  padding-left: 5px;
+  cursor: pointer;
+}
+
+.query-area-body-text {
+  height: 30px;
+  line-height: 30px;
+  padding-left: 5px;
+  padding-right: 5px;
+  margin-top: 1px;
+}
 </style>

+ 112 - 0
vue/src/components/basic/query/select-field.vue

@@ -0,0 +1,112 @@
+<template>
+  <a-modal
+    title="高级设置"
+    :width="700"
+    :visible="options.visible"
+    :ok-text="'确认'"
+    :cancel-text="'取消'"
+    @cancel="close()"
+    @ok="ok"
+    :closable="true">
+    <a-input-search
+      v-model:value="searchKey"
+      placeholder="关键字..."
+      @search="search"
+    />
+    <a-divider orientation="left">筛选条件</a-divider>
+    <div class="field-content">
+      <div class="field-item" v-for="it in search()" :key="it.field"
+           @click="it.checked=!it.checked"
+           :style="{ borderColor: it.checked?'#50a14f':'#eef0f4'}">
+        <CheckCircleOutlined :style="{fontSize: '16px',color:it.checked?'#50a14f':'#eef0f4'}"/>
+        <FileSearchOutlined v-show="it.settingTypeId==1"/>
+        <CalculatorOutlined v-show="it.settingTypeId==2"/>
+        {{ it.fieldName }}
+      </div>
+    </div>
+  </a-modal>
+</template>
+
+<script lang="ts">
+import {defineComponent, ref, watch} from "vue";
+import {get} from '@/api/common';
+
+export default defineComponent({
+  name: 'SelectField',
+  props: {
+    options: {type: Object, default: {}}
+  },
+  emits: [
+    "close", "ok"
+  ],
+  setup(props, {emit}) {
+    console.log(props, emit);
+    const searchKey = ref('');
+    const fieldList = ref<any[]>([]);
+
+    const getUserList = async function () {
+      const result = await get('/temp/getSubjectFieldList', {subId: props.options.subId})
+
+      fieldList.value = result;
+    }
+    watch(
+      () => props.options.subId,
+      () => {
+        getUserList();
+      }
+    );
+    watch(
+      () => props.options.tagList,
+      () => {
+        fieldList.value.map(it => {
+          it.checked = props.options.tagList.filter(tag => tag.fieldId == it.fieldId).length > 0;
+        })
+      }, {deep: true}
+    );
+    const search = () => {
+      if (searchKey.value == undefined) {
+        return fieldList.value;
+      }
+      return fieldList.value.filter(it => it.fieldName.includes(searchKey.value));
+    }
+    const ok = () => {
+      closing();
+      let selectList =  Object.assign(fieldList.value.filter(x => x.checked));
+      emit('ok', selectList);
+    };
+    const closing = () => {
+      props.options.visible = false;
+    };
+    const close = () => {
+      closing();
+      emit('close');
+    };
+
+    return {
+      close, ok,
+      searchKey, search, getUserList, fieldList
+    };
+  },
+  created() {
+    this.getUserList();
+  }
+})
+</script>
+<style lang="less" scoped>
+.field-content {
+  display: flex;
+  width: 100%;
+  grid-gap: 10px 10px;
+  flex-wrap: wrap;
+  margin-top: 10px;
+
+  .field-item {
+    width: 22%;
+    border: 2px solid #eef0f4;
+    height: 50px;
+    display: flex;
+    align-items: baseline;
+    padding-left: 5px;
+  }
+}
+</style>

+ 21 - 3
vue/src/views/query/index.vue

@@ -77,7 +77,10 @@
               </a-form-item>
             </a-col>
             <a-col :span="6" style="text-align: left">
-              <a-button type="primary" html-type="submit" @click="getExcel">导出测试</a-button>
+              <a-space>
+                <a-button type="primary" html-type="submit" @click="onSelectField">高级设置</a-button>
+                <a-button type="primary" html-type="submit" @click="getExcel">导出测试</a-button>
+              </a-space>
             </a-col>
             <a-col :span="24">
               <a-form-item>
@@ -135,6 +138,7 @@
       </div>
     </div>
     <ExportData ref="exportData"></ExportData>
+    <SelectField @ok="selectOk" v-model:options="selectOptions"></SelectField>
 
     <a-modal v-model:visible="modal.open" title="生成Sql语句成功,调试窗口" width="60%">
       <a-textarea v-model:value="modal.sqlString" placeholder="Basic usage" :rows="20"/>
@@ -155,6 +159,8 @@ import DisplayChartBar from '@/components/basic/query/display-chart-bar.vue'
 import DisplayChartYbar from '@/components/basic/query/display-chart-ybar.vue'
 import DisplayChartLine from '@/components/basic/query/display-chart-line.vue'
 import ExportData from '@/components/basic/query/export-data.vue'
+import SelectField from '@/components/basic/query/select-field.vue'
+
 import {save, get, postData} from "@/api/common";
 import type {TreeProps} from 'ant-design-vue';
 
@@ -162,7 +168,7 @@ export default defineComponent({
   name: 'queryindex',
   components: {
     DragWhere, DragBase, DragMeasure, DisplayTable,
-    DisplayChartBar, DisplayChartLine, DisplayChartYbar, ExportData
+    DisplayChartBar, DisplayChartLine, DisplayChartYbar, ExportData, SelectField
   },
   setup() {
     const route = useRoute();
@@ -180,6 +186,17 @@ export default defineComponent({
     const activeTab = ref('1');
     const showTree = ref(true);
 
+    const selectOptions = ref({visible: false, subId: null, tagList: []});
+    const onSelectField = () => {
+      selectOptions.value.visible = true;
+      selectOptions.value.subId = formState.value.temp.subId;
+      selectOptions.value.tagList = Object.assign((where.value as any).getTagList());
+    }
+    const selectOk = (fieldList) => {
+      console.log(fieldList);
+      (where.value as any).setTagList(fieldList);
+    }
+
     const subjectTrees = ref({
       data: [] as TreeProps['treeData'],
       expandedKeys: [''],
@@ -399,7 +416,8 @@ export default defineComponent({
       getSubjectTree,
       modal,
       displayReader,
-      onDisplayChange
+      onDisplayChange,
+      selectOptions, onSelectField, selectOk
     };
   },
   created() {