Pārlūkot izejas kodu

Merge branch 'test-dev'

# Conflicts:
#	public/version.json
#	src/api/system/user.js
#	src/api/tentative/testcollect.js
#	src/views/formula/edit.vue
#	src/views/formula/formulaStringToArray.js
#	src/views/manager/projectinfo/tree.vue
#	src/views/manager/wbsinfo.vue
#	src/views/tentative/components/dataMap.vue
zhuwei 2 dienas atpakaļ
vecāks
revīzija
b8e7a7aef1

+ 2 - 2
public/version.json

@@ -1,3 +1,3 @@
 {
-  "value": "20251020142404"
-}
+  "value": "20251022164630"
+}

+ 6 - 4
src/api/formula/formula.js

@@ -10,7 +10,7 @@ export const getTypeMap = (params) => {
   })
 }
 
-export const saveFormula = ({formula,remark,nodeId,elementId,scale,number,map,scope,projectId,dev,ver,formulas}) => {
+export const saveFormula = ({formula,remark,nodeId,elementId,scale,number,map,scope,projectId,dev,ver,formulas,method}) => {
   return request({
     url: '/api/blade-manager/formula/save',
     method: 'post',
@@ -26,12 +26,13 @@ export const saveFormula = ({formula,remark,nodeId,elementId,scale,number,map,sc
       projectId,
       dev,
       ver,
-      formulas
+      formulas,
+      method
     }
   })
 }
 
-export const updateFormula = ({id,formula,remark,nodeId,elementId,scale,number,map,scope,dev,formulas}) => {
+export const updateFormula = ({id,formula,remark,nodeId,elementId,scale,number,map,scope,dev,formulas,method}) => {
   return request({
     url: '/api/blade-manager/formula/update',
     method: 'post',
@@ -46,7 +47,8 @@ export const updateFormula = ({id,formula,remark,nodeId,elementId,scale,number,m
       map,
       scope,
       dev,
-      formulas
+      formulas,
+      method
     }
   })
 }

+ 1 - 3
src/api/system/user.js

@@ -1,6 +1,5 @@
 import request from '@/router/axios';
 
-
 export const getList = (current, size, params, deptId) => {
     return request({
         url: '/api/blade-user/page',
@@ -13,7 +12,6 @@ export const getList = (current, size, params, deptId) => {
         }
     })
 }
-
 export const remove = (ids) => {
     return request({
         url: '/api/blade-user/remove',
@@ -166,4 +164,4 @@ export const getListBySearch = (params) => {
         method: 'get',
         params
     })
-}
+}

+ 1 - 1
src/api/tentative/testcollect.js

@@ -196,4 +196,4 @@ export const removeLinkData = (params) => {
     method: 'post',
     params
   })
-}
+}

+ 35 - 0
src/styles/common.scss

@@ -165,3 +165,38 @@ a{
   margin-right: 4px;
 }
 
+// 表单搜索框高亮显示
+.hc-search-highlight {
+   position: relative;
+}
+.hc-search-highlight::before {
+    content: '';
+    position: absolute;
+    background-color: rgba(157, 206, 255, 0.4) !important;
+    border-radius: 5px;
+    top: -2px;
+    left: -2px;
+    right: -2px;
+    bottom: -2px;
+    z-index: 1;
+    pointer-events: none;
+}
+
+// 文案关键词高亮显示
+.hc-keyword-highlight {
+   position: relative;
+   display: inline;
+}
+.hc-keyword-highlight::before {
+    content: '';
+    position: absolute;
+    background-color: rgba(157, 206, 255, 0.4) !important;
+    // border-radius: 3px;
+    top: -1px;
+    left: 0;
+    right: 0;
+    bottom: -1px;
+    // z-index: 1;
+    pointer-events: none;
+}
+

+ 16 - 0
src/util/util.js

@@ -391,4 +391,20 @@ export const downloadXls = (fileArrayBuffer, filename) => {
 }
 export const isObjectEmpty=(obj)=> {
   return JSON.stringify(obj) === '{}';
+}
+
+/**
+ * 关键词高亮
+ * @param {String} text   原始文本
+ * @param {String} key    关键词
+ * @returns {String}      返回带标签的字符串
+ */
+export function highlight(text = '', key = '') {
+  if (!key) return text
+  const reg = new RegExp(
+    // 把用户输入的特殊符号转义,防止正则报错
+    key.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'),
+    'g', // g 全局  i 忽略大小写
+  )
+  return text.replace(reg, str => [...str].map( el => `<span class="hc-keyword-highlight">${el}</span>`).join(''))
 }

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 452 - 353
src/views/exctab/exceltab.vue


+ 20 - 2
src/views/formula/component/deviationRange/deviationRange.vue

@@ -21,12 +21,12 @@
       <span style="width:60px"></span>
       <template v-if="!(symbol == '<' || symbol== '≤')">
         <span class="textblod mg-r-10"></span>
-        <vue-tags-input v-model="tag1" :tags="tags1" @focus="curFocusIndex = 1" @blur="inputBlur(1)" placeholder="输入/参数" @before-adding-tag="beforeAddingTag"/>
+        <vue-tags-input v-model="tag1" :tags="tags1" @focus="curFocusIndex = 1" @blur="inputBlur(1)" placeholder="输入/参数" @before-adding-tag="beforeAddingTag"  @tag-clicked="handleTagClick($event,1)" ref="tagsInput1"/>
         <span style="width:20px"></span>
       </template>
       <template v-if="!(symbol == '>' || symbol== '≥')">
         <span class="textblod mg-r-10"></span>
-        <vue-tags-input v-model="tag2" :tags="tags2" @focus="curFocusIndex = 2" @blur="inputBlur(2)" placeholder="输入/参数" @before-adding-tag="beforeAddingTag"/>
+        <vue-tags-input v-model="tag2" :tags="tags2" @focus="curFocusIndex = 2" @blur="inputBlur(2)" placeholder="输入/参数" @before-adding-tag="beforeAddingTag"  @tag-clicked="handleTagClick($event,2)" ref="tagsInput2"/>
       </template>
     </div>
 
@@ -478,6 +478,24 @@ export default {
       })
       this.inputVisible = false;
     },
+    handleTagClick(info,index) {
+     
+       const {tag}=info;
+
+       
+      this.curFocusIndex = index
+     
+      
+      // 调用对应输入框的 focus() 方法
+        if (this.curFocusIndex === 1) {
+          this.$refs.tagsInput1.focus(); // 注意:确保组件已挂载,使用可选链避免报错
+        } else {
+          this.$refs.tagsInput2.focus();
+        }
+
+  
+       this.$emit('clickTag',tag)
+    },
 
   }
 }

+ 111 - 37
src/views/formula/component/formulaItem.vue

@@ -1,9 +1,28 @@
 <template>
-  <span :class="getItemClass(item)" @click="itemClick(item)">
-    {{item.name}}
+  <div class="inline-container">
+    <!-- 元素标签 -->
+    <el-tag 
+      v-if="item.type === 'Element'"
+      type="info"   
+      :effect="item.selected ? 'dark' : 'plain'"
+      @click="itemClick(item)"
+      class="ellipse-tag"
+      :class="{'selected-tag': item.selected}"
+    > 
+      {{ item.name }}
+    </el-tag>
+    <span 
+      :class="getItemClass(item)" 
+      @click="itemClick(item)" 
+      v-else
+      class="element-span"
+    >
+      {{ item.name }}
+    </span>
     
-  </span>
-  
+    <!-- 光标指示器 - 选中时或强制显示时显示 -->
+    <span v-if="isShowCursor&&(item.selected || showCursor)" class="cursor-blink"></span>
+  </div>
 </template>
 
 <script>
@@ -12,48 +31,103 @@ export default {
   props: {
     item: {
       type: Object,
-      default: function () {
-        return {};
-      }
+      default: () => ({})
     },
-   
-  },
-  data(){
-    return{
-
-    }
+    // 新增属性:用于强制显示光标
+    showCursor: {
+      type: Boolean,
+      default: false
+    },
+    isShowCursor: {
+      type: Boolean,
+      default: true
+    }//是否显示光标
   },
-  methods:{
-    itemClick(item){
+  methods: {
+    itemClick(item) {
+      // 切换选中状态
       item.selected = !item.selected;
-      this.$emit('click',{
-        selected:item.selected,
+      this.$emit('click', {
+        selected: item.selected,
         item
-      })
+      });
     },
-    getItemClass(item){
-      let obj = {};
-      // obj[item.type.toLocaleLowerCase()+'-class']=true;
-      obj['element-class']=true;
-      if(item.selected){
-        obj.selected = true;
-      }
-      return obj;
+    getItemClass(item) {
+      return {
+        'element-class': true,
+        'selected': item.selected
+      };
     }
   }
 }
 </script>
+
 <style scoped lang="scss">
-  .element-class{
-    cursor: pointer;
-    padding: 0 3px;
-    &.selected{
-      color: rgba(64,149,229,1);
-    }
+// 共用样式
+.element-class, .ellipse-tag {
+  display: inline-flex;
+  align-items: center; // 纵向居中对齐
+  justify-content: center;
+  vertical-align: middle; // 确保与其他元素对齐
+  box-sizing: border-box;
+}
+
+.element-class {
+  cursor: pointer;
+  padding: 0 3px;
+  height: 32px; // 与tag保持一致高度
+  
+  &.selected {
+    color: #f0720a;
   }
-  .text-blue{
-    font-size: 20px;
-    color: rgba(64,149,229,1);
-    font-weight:bold;
+}
+
+// 标签样式
+.ellipse-tag {
+  border-radius: 50px !important; // 椭圆样式
+  padding: 0 12px !important;
+  height: 32px; // 固定高度确保对齐
+  transition: all 0.2s ease; // 平滑过渡效果
+  background-color: #E7E7E7 !important; // 默认背景色
+  border-color: #E7E7E7 !important;    // 默认边框色
+  color: #333 !important;              // 默认文字色
+  
+  &.selected-tag {
+    background-color: #909399 !important; // 选中状态背景色
+    border-color: #909399 !important;    // 选中状态边框色
+    color: #fff !important;              // 选中状态文字色
+    transform: scale(1.05);
+    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
+    margin-left: 8px;
+    margin-right: 5px;
   }
-</style>
+}
+
+// 确保span和tag在同一行时对齐
+.element-span {
+  display: inline-flex;
+  align-items: center;
+  height: 32px;
+}
+
+// 新增样式
+.inline-container {
+  display: inline-flex;
+  align-items: center;
+}
+
+// 光标样式 - 模拟输入框闪烁效果
+.cursor-blink {
+  width: 2px;
+  height: 1.2em;
+  background-color: #333;
+  margin: 0 1px;
+  animation: blink 1s step-end infinite;
+}
+
+@keyframes blink {
+  from, to { background-color: transparent }
+  50% { background-color: #333 }
+}
+
+</style>

+ 446 - 7
src/views/formula/component/table-form-write.vue

@@ -1,19 +1,458 @@
 <template>
-  <div>66666</div>
+  <div class="excelHtnl">
+    <div
+      class="excelBox hc-excel-table-form"
+      style="margin-top:40px;height: 100%;"
+      @click="parentClick($event)"
+    >
+      <div style="width:100%;height: 100%;overflow: scroll;" class='parent' :id="containerId"></div>
+    </div>
+  </div>
 </template>
 
 <script>
+import Vue from 'vue'
+import { getExcelHtml } from '@/api/exctab/excelmodel'
+
 export default {
-  name: "table-form-write",
-  props: {
-  
+  props: [
+    'pkeyId', 
+    'initTableName',
+    'selectedTableKey',
+    'containerId',
+    'multipleSelect'  // 是否允许多选,默认为false
+  ],
+  data() {
+    return {
+      selectedElements: [],
+      exHtml: '',
+      currentComponent: null
+    }
+  },
+  created() {
+    if (!this.containerId) {
+      this.containerId = `excel-container-${Date.now()}-${Math.random().toString(36).substr(2, 9)}`;
+    }
+  },
+  watch: {
+    pkeyId: {
+      immediate: true,
+      deep: true,
+      handler(newVal) {
+        if (newVal) {
+          this.exHtml = ''
+          this.getExcelHtml(newVal)
+        } else {
+          this.exHtml = ''
+          this.clearForm()
+        }
+      }
+    },
+    selectedTableKey: {
+      handler(newKey) {
+        this.clearAllSelected();
+        if (newKey && newKey.startsWith('key_')) {
+          this.highlightElementsByKey(newKey);
+        }
+      },
+      immediate: true
+    },
+    containerId: {
+      handler(newVal) {
+        this.clearForm()
+        this.selectedElements = [];
+      },
+      immediate: true
+    },
+    multipleSelect: {
+      handler(newVal) {
+        // 当多选模式改变时,清空当前选择
+        if (!newVal && this.selectedElements.length > 1) {
+          // 如果关闭多选且当前有多个选中,只保留最后一个
+          const lastElement = this.selectedElements[this.selectedElements.length - 1];
+          this.clearAllSelected();
+          this.selectElements([lastElement]);
+        }
+      },
+      immediate: true
+    }
   },
   methods: {
+    // 获取当前组件容器元素,封装为工具方法
+    getContainer() {
+      return document.getElementById(this.containerId);
+    },
+    
+    // 获取当前所有有橙色背景且去重的元素列表
+    getCurrentSelectedElements() {
+      const container = this.getContainer();
+      if (!container) return [];
+      
+      // 获取所有有橙色背景的元素
+      const orangeElements = container.querySelectorAll('[style*="background-color: rgb(255, 165, 0)"], [style*="background-color:#ffa500"]');
+      
+      // 根据 tableElementKey 去重
+      const uniqueElements = [];
+      const seenKeys = new Set();
+      
+      orangeElements.forEach(el => {
+        if (el.id) {
+          const tableElementKey = this.initTableName + ':' + this.extractKeyPrefix(el.id);
+          if (!seenKeys.has(tableElementKey)) {
+            seenKeys.add(tableElementKey);
+            const keyName = el.placeholder || '';
+            uniqueElements.push({
+              tableElementKey: tableElementKey,
+              eName: keyName,
+              id: el.id
+            });
+          }
+        }
+      });
+      
+      return uniqueElements;
+    },
+    
+    highlightElementsByKey(key) {
+      if (!key) return;
+      
+      const container = this.getContainer();
+      if (!container) return;
+      
+      const keyPrefix = key.split('__')[0];
+      // 只在当前容器内查找元素
+      const samePrefixElements = container.querySelectorAll(`[id^="${keyPrefix}__"]`);
+      
+      if (samePrefixElements.length === 0) {
+        const element = container.querySelector(`#${key}`);
+        if (element) {
+          this.selectElements([element]);
+          return;
+        }
+      }
+      
+      this.selectElements(samePrefixElements);
+    },
+    
+    async getExcelHtml(pkeyId) {
+      this.clearForm();
+      try {
+        const { data: res } = await getExcelHtml({ pkeyId })
+        if (res.code === 200) {
+          this.exHtml = res.data
+          this.cop();
+        }
+      } catch (error) {
+        console.error('获取HTML失败:', error)
+      }
+    },
+    
+    clearForm() {
+      const container = this.getContainer();
+      if (container) {
+        container.innerHTML = '';
+      }
+      this.clearAllSelected();
+    },
+    
+    async cop() {
+      const container = this.getContainer();
+      if (!container) {
+        console.error('父容器不存在:', this.containerId);
+        return;
+      }
+      
+      try {
+        const MyComponent = Vue.extend({
+          template: this.exHtml,
+          data() {
+            return {
+              formData: {},
+              getTokenHeader: {},
+              dap_site_data: {}
+            }
+          },
+          methods: {
+            contextmenuClick() {},
+            getInformation() {},
+            formUploadSuccess() {},
+            formUploadExceed() {},
+            formUploadLoading() {},
+            delTableFormFile() {},
+            formUploadError() {},
+            uploadprogress() {},
+            formRemoteMethod() {},
+            getRegularExpression() {},
+            checkboxGroupChange() {},
+            formRemoteChange() {},
+            dateKeydown() {},
+            keyupShiftUp() {},
+            keyupShiftDown() {},
+            keyupShiftLeft() {},
+            keyupShiftRight() {},
+            inputLeftClick() {},
+          }
+        });
+        
+        // 销毁旧组件
+        if (this.currentComponent) {
+          this.currentComponent.$destroy();
+        }
+        
+        // 创建新组件
+        this.currentComponent = new MyComponent().$mount();
+        
+        // 添加到当前容器
+        container.innerHTML = '';
+        container.appendChild(this.currentComponent.$el);
+        
+        this.$nextTick(() => {
+          if (this.selectedTableKey) {
+            this.highlightElementsByKey(this.selectedTableKey);
+          }
+        });
+      } catch (error) {
+        console.error('组件渲染失败:', error);
+      }
+    },
+    
+    async parentClick(e) {
+      e.stopPropagation(); // 阻止事件冒泡到其他组件
+      
+      const container = this.getContainer();
+      if (!container || !container.contains(e.target)) {
+        return; // 不是当前组件内的点击,不处理
+      }
+      
+      // 检测Control键是否按下 (e.ctrlKey 对Windows/Linux有效,e.metaKey对Mac的Command键有效)
+      const isCtrlPressed = e.ctrlKey || e.metaKey;
+      // 只有在multipleSelect为true时才允许通过Control键进行多选
+      const isMultiSelectMode = this.multipleSelect && isCtrlPressed;
+      
+      // 只在当前容器内查找目标元素
+      let target = e.target;
+      while (target && target !== container && !target.id) {
+        target = target.parentNode;
+      }
+      
+      if (!target || !target.id || !container.contains(target)) {
+        return;
+      }
+      
+      // 检查警告样式
+      let hasWarnStyle = false;
+      if (target.classList.contains('warnstyle') || 
+          (target.parentNode && target.parentNode.classList.contains('warnstyle'))) {
+        hasWarnStyle = true;
+      }
 
+      if (hasWarnStyle) {
+        this.$message({
+          type: "warning",
+          message: "当前位置未配置元素,请重新选择或配置元素后再试"
+        });
+        return;
+      }
+      
+      const id = target.id;
+      const elementId = this.initTableName + ':' + this.extractKeyPrefix(id);
+      
+      // 检查是否已经有相同 tableElementKey 的元素被选中
+      const isSameKeySelected = this.selectedElements.some(item => 
+        item.tableElementKey === elementId
+      );
+      
+      // 根据是否按下Control键决定是否清空已选元素
+      if (!isMultiSelectMode) {
+        this.clearAllSelected();
+      }
+      
+      if (!isSameKeySelected) {
+        if (id.startsWith('key_')) {
+          const keyPrefix = this.extractKeyPrefix(id);
+          // 只在当前容器内查找同前缀元素
+          const samePrefixElements = container.querySelectorAll(`[id^="${keyPrefix}__"]`);
+          this.selectElements(samePrefixElements);
+        } else {
+          this.handleNormalElement(target, id);
+        }
+      } else {
+        // 如果已经有相同 tableElementKey 的元素被选中,在多选模式下点击会取消选择所有相同key的元素
+        if (isMultiSelectMode) {
+          this.deselectElementsByKey(elementId);
+        }
+      }
+    },
+    
+    extractKeyPrefix(id) {
+      const parts = id.split('__');
+      return parts.length > 0 ? parts[0] : id;
+    },
+    
+    selectElements(elements) {
+      const container = this.getContainer();
+      if (!container) return;
+      
+      // 先取消选择所有相同 tableElementKey 的元素(避免重复)
+      if (elements.length > 0) {
+        const firstElementId = this.initTableName + ':' + this.extractKeyPrefix(elements[0].id);
+        this.deselectElementsByKey(firstElementId);
+      }
+      
+      elements.forEach(el => {
+        // 确保元素属于当前容器
+        if (!container.contains(el)) return;
+        
+        const index = this.selectedElements.findIndex(item => item.id === el.id);
+        
+        if (index === -1) {
+          el.style.backgroundColor = '#ffa500';
+          const elementId = this.initTableName + ':' + this.extractKeyPrefix(el.id);
+          const keyName = el.placeholder || '';
+          const newElement = { tableElementKey: elementId, eName: keyName, id: el.id };
+          this.selectedElements.push(newElement);
+          
+          // 传递当前所有有橙色背景且去重的元素
+          const currentSelected = this.getCurrentSelectedElements();
+          this.$emit('element-selected', newElement, true, currentSelected);
+        }
+      });
+    },
+    
+    // 取消选择所有具有相同 tableElementKey 的元素
+    deselectElementsByKey(tableElementKey) {
+      const container = this.getContainer();
+      if (!container) return;
+      
+      // 找出所有相同 tableElementKey 的元素
+      const elementsToDeselect = this.selectedElements.filter(item => 
+        item.tableElementKey === tableElementKey
+      );
+      
+      if (elementsToDeselect.length === 0) return;
+      
+      // 清除样式并从选中列表中移除
+      elementsToDeselect.forEach(item => {
+        const element = container.querySelector(`#${item.id}`);
+        if (element) {
+          element.style.backgroundColor = '';
+        }
+        // 传递当前所有有橙色背景且去重的元素
+        const currentSelected = this.getCurrentSelectedElements();
+        this.$emit('element-selected', item, false, currentSelected);
+      });
+      
+      // 从选中列表中移除这些元素
+      this.selectedElements = this.selectedElements.filter(item => 
+        item.tableElementKey !== tableElementKey
+      );
+    },
+    
+    handleNormalElement(target, id) {
+      const container = this.getContainer();
+      if (!container || !container.contains(target)) return;
+      
+      const elementId = this.initTableName + ':' + target.id.split('__')[0];
+      const keyName = target.placeholder || '';
+      
+      if(!keyName){
+        this.$message({
+          type: "warning",
+          message: "当前位置未配置元素,请重新选择或配置元素后再试"
+        });
+        return;
+      }
+      
+      // 先取消选择相同 tableElementKey 的元素
+      this.deselectElementsByKey(elementId);
+      
+      target.style.backgroundColor = '#ffa500';
+      const newElement = { tableElementKey: elementId, eName: keyName, id };
+      this.selectedElements.push(newElement);
+      
+      // 传递当前所有有橙色背景且去重的元素
+      const currentSelected = this.getCurrentSelectedElements();
+      this.$emit('element-selected', newElement, true, currentSelected);
+    },
+    
+    clearAllSelected() {
+      const container = this.getContainer();
+      if (!container) return;
+      
+      this.selectedElements.forEach(item => {
+        // 只清除当前容器内的元素样式
+        const element = container.querySelector(`#${item.id}`);
+        if (element) {
+          element.style.backgroundColor = '';
+          // 传递当前所有有橙色背景且去重的元素
+          const currentSelected = this.getCurrentSelectedElements();
+          this.$emit('element-selected', { 
+            tableElementKey: item.tableElementKey, 
+            eName: item.eName, 
+            id: item.id 
+          }, false, currentSelected);
+        }
+      });
+      this.selectedElements = [];
+    }
   }
 }
 </script>
 
-<style scoped lang="scss">
-</style>
-    
+<style lang="scss" scoped>
+/* 样式保持不变 */
+.excelHtnl {
+  margin: 0 0 0 10px;
+  background-color: #fff;
+  box-sizing: border-box;
+  padding: 0 20px 100px 20px;
+  height: 100%;
+}
+
+.hc-upload-table-form {
+  position: relative;
+  height: 100%;
+  display: flex;
+  justify-content: center;
+  align-items: center;
+}
+.hc-upload-table-form .el-upload {
+  position: relative;
+  flex: 1;
+  height: 100%;
+  color: #ccc;
+}
+.hc-upload-table-form .el-upload .hc-table-form-icon {
+  font-size: 24px;
+  font-weight: 100;
+}
+.hc-upload-table-form .el-upload .hc-table-form-img {
+  width: 100%;
+  height: 100%;
+}
+
+.excelBox {
+  ::v-deep .oldlace-bg {
+    background-color: oldlace;
+  }
+  ::v-deep .select-td {
+    border-width: 4px;
+    border-color: #E6A23C;
+    border-style: solid;
+  }
+}
+
+::v-deep .warnstyle .el-input__inner {
+  background-image: url('/img/login/warn.png') !important;
+  background-repeat: no-repeat;
+  background-size: cover;
+  background-position: center
+}
+
+::v-deep .warnstyle .el-textarea__inner {
+  background-image: url('/img/login/warn.png') !important;
+  background-repeat: no-repeat;
+  background-position-x: 45%;
+  background-position-y: 46%;
+}
+</style>

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 478 - 289
src/views/formula/edit.vue


+ 5 - 0
src/views/formula/edit1.vue

@@ -731,6 +731,11 @@ export default {
         // 开启 “加载中” 动画
         if(node.level == 0) this.loading = true
         if(!this.elementType) {
+          if (node.level != 0 && !node.data.hasChildren) {
+            this.loading = false
+            resolve(null)
+            return
+          }
          tabTypeLazyTreeAll({parentId,current:1,size:1000,hasPartFormula:this.fromcurNode.hasPartFormula}).then(res => {
             // 请求接口,返回数据
             let data = res.data.data.records;

+ 13 - 10
src/views/formula/formulaStringToArray.js

@@ -79,7 +79,7 @@ function parseArguments(ele,funObj){
               //是前面的计算结果
               fun.arguments.push(ele)
             }
-  
+
           }else{
             let arg = argSpliceArr[index][0];
             if(!arg){
@@ -97,7 +97,7 @@ function parseArguments(ele,funObj){
             }
           }
         }
-      })  
+      })
   }
 
   ele.children.push(fun);
@@ -129,7 +129,7 @@ function parseProcessFormula(funObj,ele){
       ele.k = endEle.k;
       ele.type = "ParamData";
     }
-    
+
   }
 
 }
@@ -186,8 +186,11 @@ export const formulaStringToArray = (text,elemap,formulaMap) => {
   const operatorReg = /^ (\+|-|\*|%|\/) /;//加减乘除
   // const wordReg = /^[\u4e00-\u9fa5\w0-9'"-]+/;//文本
   // const wordReg = /^[\u4e00-\u9fa5\{\}\w\\.0-9'"-]+/;//文本
- const sxReg = /^[|]/; // 匹配字符串开头竖线
+  // const wordReg = /^[\u4e00-\u9fa5\{\}\w\\.0-9'"-]+/;//文本
   const wordReg = /^[±\u4e00-\u9fa5\{\}\w\\.0-9'"-]+/; // 新增±符号到文本匹配正则
+
+ const sxReg = /^[|]/; // 匹配字符串开头竖线
+
   // const logicalReg = /^(>=|<=|>|<|=|&&)/;//逻辑符号
   const logicalReg = /^(>=|<=|>|<|=|&&|\|)/;
 
@@ -207,7 +210,7 @@ export const formulaStringToArray = (text,elemap,formulaMap) => {
       //匹配FC开始部分FC.xxx(
       let regRes = nuText.match(startFCRegExp);
       let startText = regRes[0];//匹配到的文本
-      
+
       let obj = {};
       if(formulaMap[startText]){
         Object.assign(obj,formulaMap[startText]);
@@ -234,7 +237,7 @@ export const formulaStringToArray = (text,elemap,formulaMap) => {
 
       let popObj = contentStack.pop();
       let arrType = [];
-      
+
       if(contentStack.length > 0){
         let content =contentStack[contentStack.length - 1];
         content.children.push(popObj);
@@ -267,7 +270,7 @@ export const formulaStringToArray = (text,elemap,formulaMap) => {
       //console.log('匹配左括号')
       //匹配左括号
       let startBrackets = nuText.match(startBracketsReg)[0];
-      
+
       contentStack.push({
         type:'Brackets',
         children:[],
@@ -299,7 +302,7 @@ export const formulaStringToArray = (text,elemap,formulaMap) => {
           tag:eleArr[0]
         }
       }
-      
+
       let content =contentStack[contentStack.length - 1];
       if(content){
         content.children.push(obj);
@@ -332,7 +335,7 @@ export const formulaStringToArray = (text,elemap,formulaMap) => {
           tag:"paramData"
         }
       }
-      
+
       let content =contentStack[contentStack.length - 1];
       if(content){
         content.children.push(obj);
@@ -414,7 +417,7 @@ export const formulaStringToArray = (text,elemap,formulaMap) => {
 
       strIndex += word.length?word.length:2;//索引移动
     }
-   
+
     else{
       console.log('匹配不到:',nuText)
       //匹配不到

+ 1 - 1
src/views/manager/projectinfo/detail.vue

@@ -809,7 +809,7 @@ export default {
     })
   },
   methods: {
-    getCreateUserItems(){
+ getCreateUserItems(){
       getList(
         1,
         1000,

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 621 - 563
src/views/manager/projectinfo/tree.vue


+ 377 - 318
src/views/manager/wbsinfo.vue

@@ -1,65 +1,122 @@
 <template>
   <basic-container>
-        <div class="search-box">
-        <div class="search-box-left">
-            <el-input v-model="query.wbsName" placeholder="请输入名称" style="width: 200px;" class="filter-item"   size="small"/>
-            <el-select v-model="query.projectId" placeholder="项目名称" clearable style="width: 200px" class="filter-item"   size="small">
-              <el-option v-for="item in projectList" :key="item.id" :label="item.projectAlias" :value="item.id" />
-            </el-select>
-            <el-select v-model="query.wbsType" placeholder="划分类型" clearable style="width: 200px" class="filter-item"   size="small">
-              <el-option v-for="item in tabTypeList"  :key="item.dictKey" :label="item.dictValue" :value="item.dictKey" />
-            </el-select>
-           
-            <el-button type="primary" @click="searchClick" class="custom-primary-btn"   size="small">搜索</el-button>
-            <el-button type="info" @click="clearSearch"   size="small">清空</el-button>
+    <div class="search-box">
+      <div class="flex">
+        <div
+          class="filter-item"
+          style="width: 200px"
+          :class="[query.wbsName ? 'hc-search-highlight' : '']"
+        >
+          <el-input
+            v-model="query.wbsName"
+            placeholder="请输入名称"
+            clearable
+            size="small"
+          />
         </div>
-        <div class="header-box-right">
-           <el-button
-            type="primary"
+        <div
+          class="filter-item"
+          style="width: 200px"
+          :class="[query.projectId ? 'hc-search-highlight' : '']"
+        >
+          <el-select
+            v-model="query.projectId"
+            placeholder="项目名称"
+            clearable
             size="small"
-            icon="el-icon-plus"
-        
-        
-            @click="handleAdd"
-          >新增
-          </el-button>
-                <el-button
-            type="warning"
+          >
+            <el-option
+              v-for="item in projectList"
+              :key="item.id"
+              :label="item.projectAlias"
+              :value="item.id"
+            />
+          </el-select>
+        </div>
+        <div
+          class="filter-item"
+          style="width: 200px"
+          :class="[query.wbsType ? 'hc-search-highlight' : '']"
+        >
+          <el-select
+            v-model="query.wbsType"
+            placeholder="划分类型"
+            clearable
+            style="width: 200px"
+            class="filter-item"
             size="small"
-            icon="el-icon-sort"
-    
-      
-            @click="handleSort"
+          >
+            <el-option
+              v-for="item in tabTypeList"
+              :key="item.dictKey"
+              :label="item.dictValue"
+              :value="item.dictKey"
+            />
+          </el-select>
+        </div>
+
+        <el-button
+          type="primary"
+          @click="searchClick"
+          class="custom-primary-btn"
+          size="small"
+          >搜索</el-button
+        >
+        <el-button type="info" @click="clearSearch" size="small"
+          >清空</el-button
+        >
+      </div>
+      <div class="header-box-right">
+        <el-button
+          type="primary"
+          size="small"
+          icon="el-icon-plus"
+          @click="handleAdd"
+          >新增
+        </el-button>
+        <el-button
+          type="warning"
+          size="small"
+          icon="el-icon-sort"
+          @click="handleSort"
           >排序
-          </el-button>
-              <el-button
-            type="danger"
-            size="small"
-            icon="el-icon-delete"
-          
-            v-if="permission.wbsinfo_delete"
-            @click="handleDelete"
+        </el-button>
+        <el-button
+          type="danger"
+          size="small"
+          icon="el-icon-delete"
+          v-if="permission.wbsinfo_delete"
+          @click="handleDelete"
           >删 除
-          </el-button>
-          <!-- 新增元素按钮 -->
-          <el-button
-            size="small"
-            style="background-color:#FFA042;color:white;font-weight:bold;border-color: #FFA042;"
-            plain
-            v-if="permission.wbsinfo_delete"
-            @click="handleElement"
+        </el-button>
+        <!-- 新增元素按钮 -->
+        <el-button
+          size="small"
+          style="
+            background-color: #ffa042;
+            color: white;
+            font-weight: bold;
+            border-color: #ffa042;
+          "
+          plain
+          v-if="permission.wbsinfo_delete"
+          @click="handleElement"
           >元素库
-          </el-button>
-          <el-button
-            size="small"
-            style="background-color:#2550A2;color:white;font-weight:bold;border-color: #2550A2;"
-            plain
-            v-if="permission.wbsinfo_delete"
-            @click="handleParameter"
+        </el-button>
+        <el-button
+          size="small"
+          style="
+            background-color: #2550a2;
+            color: white;
+            font-weight: bold;
+            border-color: #2550a2;
+          "
+          plain
+          v-if="permission.wbsinfo_delete"
+          @click="handleParameter"
           >参数库
-          </el-button>
-        </div>
-      
+        </el-button>
+      </div>
     </div>
     <avue-crud
       :option="option"
@@ -80,329 +137,336 @@
       @size-change="sizeChange"
       @refresh-change="refreshChange"
       @on-load="onLoad"
-       :search.sync="search"
+      :search.sync="search"
     >
-
-<template slot-scope="{disabled,size}" slot="projectInfoListSearch">
-      <el-select v-model="search.projectId" placeholder="项目名称" filterable  clearable>
+      <template slot-scope="{ row }" slot="wbsName">
+        <span v-html="highlight(row.wbsName || '', query.wbsName)"></span>
+      </template>
+      <template slot-scope="{ disabled, size }" slot="projectInfoListSearch">
+        <el-select
+          v-model="search.projectId"
+          placeholder="项目名称"
+          filterable
+          clearable
+        >
           <el-option
             v-for="item in projectList"
             :key="item.id"
             :label="item.projectAlias"
-            :value="item.id">
+            :value="item.id"
+          >
           </el-option>
         </el-select>
-  </template>
-      <template slot="menuRight">
-         
       </template>
-      <template
-        slot-scope="{row,index}"
-        slot="menu"
-      >
+      <template slot="menuRight"> </template>
+      <template slot-scope="{ row, index }" slot="menu">
         <el-button
           type="text"
           icon="el-icon-edit"
           size="mini"
           v-if="permission.wbsinfo_tree_edit"
-          @click="toEdit(row,index)"
-        >编辑wbs库</el-button>
+          @click="toEdit(row, index)"
+          >编辑wbs库</el-button
+        >
       </template>
-       <template
-            slot-scope="{row}"
-            slot="wbsType"
+      <template slot-scope="{ row }" slot="wbsType">
+        <!-- <el-tag>{{ row.wbsType }}</el-tag> -->
+        <el-tag
+          size="small"
+          v-for="item in generateTagItems(row.wbsType)"
+          :key="item.label"
+          :type="item.type"
+          effect="dark"
+          class="mr-3 custom-ellipse-tag"
+          :class="`custom-tag-type-${item.type}`"
+        >
+          {{ item.label }}
+        </el-tag>
+      </template>
+      <template slot-scope="{ row }" slot="projectInfoList">
+        <el-tooltip
+          v-for="item in row.projectInfoList"
+          :key="item.id"
+          :content="item.projectName"
+          placement="top"
+          :disabled="true"
+        >
+          <el-tag
+            size="small"
+            type="info"
+            class="custom-ellipse-tag1 ellipsis-tag"
           >
-            <!-- <el-tag>{{ row.wbsType }}</el-tag> -->
-                <el-tag
-                  size="small"
-                  v-for="item in generateTagItems(row.wbsType)"
-                  :key="item.label"
-                  :type="item.type"
-                  effect="dark"
-                  class="mr-3 custom-ellipse-tag"
-                  :class="`custom-tag-type-${item.type}`"
-                  >
-                 
-                  {{ item.label }}
-                </el-tag>
-        
-          </template>
-          <template slot-scope="{row}" slot="projectInfoList">
-          
-                    <el-tooltip 
-                    v-for="item in row.projectInfoList" 
-                    :key="item.id"
-                    :content="item.projectName"
-                    placement="top"
-                    :disabled="true"
-                  >
-                    <el-tag  
-                      size="small" 
-                      type="info"   
-                      class="custom-ellipse-tag1 ellipsis-tag"
-                      
-                    >
-                      {{item.projectName}}
-                    </el-tag>
-                  </el-tooltip>
-          </template>
+            {{ item.projectName }}
+          </el-tag>
+        </el-tooltip>
+      </template>
     </avue-crud>
-           <!-- wbs排序弹窗 -->
-        <ContractSort 
-         ref="contractSortRef"
-         title="wbs排序弹窗"
-         :sortProLoad="sortProLoad"
-        @confirm="handleSortConfirm"
-      />
+    <!-- wbs排序弹窗 -->
+    <ContractSort
+      ref="contractSortRef"
+      title="wbs排序弹窗"
+      :sortProLoad="sortProLoad"
+      @confirm="handleSortConfirm"
+    />
   </basic-container>
 </template>
 
 <script>
-import { getList, getDetail, add, update, remove,sortWbs } from "@/api/manager/wbsinfo";
+import {
+  getList,
+  getDetail,
+  add,
+  update,
+  remove,
+  sortWbs,
+} from "@/api/manager/wbsinfo";
 import { mapGetters } from "vuex";
-  import { getDictionary } from "@/api/system/dict";
-  import ContractSort from './ContractSort.vue'
+import { getDictionary } from "@/api/system/dict";
+import ContractSort from "./ContractSort.vue";
 import { getProjectListPage } from "@/api/manager/projectinfo";
+import { highlight } from "@/util/util";
 
 export default {
   components: {
-    ContractSort
+    ContractSort,
   },
-  data () {
+  data() {
     return {
+      highlight,
       form: {},
-      query: {},
+      query: {
+        wbsName: "",
+        wbsType: "",
+        projectId: "",
+      },
       loading: true,
       page: {
         pageSize: 20,
         currentPage: 1,
-        total: 0
+        total: 0,
       },
       selectionList: [],
       option: {
         menuWidth: 300,
-        height: 'auto',
+        height: "auto",
         calcHeight: 30,
         tip: false,
         searchMenuSpan: 6,
- 
+
         border: true,
         index: true,
         viewBtn: true,
-          addBtn: false,
+        addBtn: false,
         selection: true,
-         refreshBtn:false,
+        refreshBtn: false,
         searchShowBtn: false,
         columnBtn: false,
         dialogClickModal: false,
-          searchShow: false,
+        searchShow: false,
         column: [
           {
             label: "创建时间",
             prop: "createTime",
             editDetail: true,
             addDisabled: true,
-               hide: true,
-      
+            hide: true,
           },
           {
             label: "wbs名称",
             prop: "wbsName",
+            slot: true,
             search: true,
             width: 180,
-        
-       
-       
-            rules: [{
-              required: true,
-              message: "请输入wbs名称",
-              trigger: "blur"
-            }]
+            rules: [
+              {
+                required: true,
+                message: "请输入wbs名称",
+                trigger: "blur",
+              },
+            ],
           },
           {
             label: "划分类型",
             slot: true,
-              search: true,
-              width: 120,
-        
-          
-           
-           
-           
+            search: true,
+            width: 120,
+
             type: "select",
             dicUrl: "/api/blade-system/dict/dictionary?code=wbs_type",
             props: {
               label: "dictValue",
-              value: "dictKey"
+              value: "dictKey",
             },
             dataType: "number",
             prop: "wbsType",
-            rules: [{
-              required: true,
-              message: "请选择划分类型",
-              trigger: "blur"
-            }],
-           
+            rules: [
+              {
+                required: true,
+                message: "请选择划分类型",
+                trigger: "blur",
+              },
+            ],
           },
           {
             label: "是否启用",
             prop: "status",
             hide: true,
-      
-            rules: [{
-              required: true,
-              message: "是否启用",
-              trigger: "blur"
-            }],
+
+            rules: [
+              {
+                required: true,
+                message: "是否启用",
+                trigger: "blur",
+              },
+            ],
             type: "radio",
             dicData: [
               {
                 label: "否",
-                value: 0
+                value: 0,
               },
               {
                 label: "是",
-                value: 1
-              }
+                value: 1,
+              },
             ],
           },
-           {
+          {
             label: "引用项目",
             prop: "projectInfoList",
             display: false,
             search: true,
-            slot:true,
-            
+            slot: true,
           },
-   
-        ]
+        ],
       },
       data: [],
-      search:{
-        wbsName: '',
-        wbsType: '',
-        projectId:''
+      search: {
+        wbsName: "",
+        wbsType: "",
+        projectId: "",
       },
-       wbsTypeList:[],
-
-       sortProLoad:false,
-       wbsList:[],
-       sortWbsList:[],
-       projectList:[],
-       tabTypeList:[],
+      wbsTypeList: [],
 
+      sortProLoad: false,
+      wbsList: [],
+      sortWbsList: [],
+      projectList: [],
+      tabTypeList: [],
     };
   },
-  created () {
-    this.getTabTypeList()
-    this.getWbsList()
-    this.getProjectList()
+  created() {
+    this.getTabTypeList();
+    this.getWbsList();
+    this.getProjectList();
   },
   computed: {
     ...mapGetters(["permission"]),
-    permissionList () {
+    permissionList() {
       return {
         addBtn: this.vaildData(this.permission.wbsinfo_add, false),
         viewBtn: this.vaildData(this.permission.wbsinfo_view, false),
         delBtn: this.vaildData(this.permission.wbsinfo_delete, false),
-        editBtn: this.vaildData(this.permission.wbsinfo_edit, false)
+        editBtn: this.vaildData(this.permission.wbsinfo_edit, false),
       };
     },
-    ids () {
+    ids() {
       let ids = [];
-      this.selectionList.forEach(ele => {
+      this.selectionList.forEach((ele) => {
         ids.push(ele.id);
       });
       return ids.join(",");
-    }
+    },
   },
   methods: {
-  getProjectList () {
+    getProjectList() {
       getProjectListPage({
-        current:1,
-        size:999,
-        isCollect:0,
-    
-
+        current: 1,
+        size: 999,
+        isCollect: 0,
       }).then((res) => {
         this.projectList = res.data.data.records;
-      })
+      });
     },
-  generateTagItems(wbsTypes){
-       const typeToLabelMap = {
-        1: '质检',
-        2: '试验',
-        3: '日志',
-        4: '计量',
-        5: '征拆',
-        6: '底层节点',
-       
-    };
+    generateTagItems(wbsTypes) {
+      const typeToLabelMap = {
+        1: "质检",
+        2: "试验",
+        3: "日志",
+        4: "计量",
+        5: "征拆",
+        6: "底层节点",
+      };
       let tagItems = [];
-         // 如果 wbsTypes 不是数组,则将其转换为数组
-    if (!Array.isArray(wbsTypes)) {
+      // 如果 wbsTypes 不是数组,则将其转换为数组
+      if (!Array.isArray(wbsTypes)) {
         wbsTypes = [wbsTypes];
-    }
-      wbsTypes.forEach(type => {
+      }
+      wbsTypes.forEach((type) => {
         // 检查type是否在映射关系中存在
         if (typeToLabelMap.hasOwnProperty(type)) {
-            // 如果存在,则创建一个新的对象并添加到tagItems数组中
-            tagItems.push({
-                type: type,
-                label: typeToLabelMap[type]
-            });
+          // 如果存在,则创建一个新的对象并添加到tagItems数组中
+          tagItems.push({
+            type: type,
+            label: typeToLabelMap[type],
+          });
         }
-    });
-     return tagItems;
-  },
-     getTabTypeList(){
-           let code = "wbs_type";
-            getDictionary({
-                code,
-            }).then((res) => {
-                    this.tabTypeList = res.data.data;
-            });
-
-    },
-      //点击元素库
-    handleElement(){
-      console.log('元素库');
-      this.$router.push({
-        path: '/wbs/element',
-      })
+      });
+      return tagItems;
     },
-    rowSave (row, done, loading) {
-      row.projectInfoList=null
-      add(row).then(() => {
-        this.onLoad(this.page);
-        this.$message({
-          type: "success",
-          message: "操作成功!"
-        });
-        done();
-      }, error => {
-        loading();
-        window.console.log(error);
+    getTabTypeList() {
+      let code = "wbs_type";
+      getDictionary({
+        code,
+      }).then((res) => {
+        this.tabTypeList = res.data.data;
       });
     },
-    rowUpdate (row, index, done, loading) {
-      update(row).then(() => {
-        this.onLoad(this.page);
-        this.$message({
-          type: "success",
-          message: "操作成功!"
-        });
-        done();
-      }, error => {
-        loading();
-        console.log(error);
+    //点击元素库
+    handleElement() {
+      console.log("元素库");
+      this.$router.push({
+        path: "/wbs/element",
       });
     },
-    rowDel (row) {
+    rowSave(row, done, loading) {
+      row.projectInfoList = null;
+      add(row).then(
+        () => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          done();
+        },
+        (error) => {
+          loading();
+          window.console.log(error);
+        }
+      );
+    },
+    rowUpdate(row, index, done, loading) {
+      update(row).then(
+        () => {
+          this.onLoad(this.page);
+          this.$message({
+            type: "success",
+            message: "操作成功!",
+          });
+          done();
+        },
+        (error) => {
+          loading();
+          console.log(error);
+        }
+      );
+    },
+    rowDel(row) {
       this.$confirm("确定将选择数据删除?", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       })
         .then(() => {
           return remove(row.id);
@@ -411,15 +475,14 @@ export default {
           this.onLoad(this.page);
           this.$message({
             type: "success",
-            message: "操作成功!"
+            message: "操作成功!",
           });
         });
     },
     handleAdd(row) {
-      
-        this.$refs.crud.rowAdd();
-      },
-    handleDelete () {
+      this.$refs.crud.rowAdd();
+    },
+    handleDelete() {
       if (this.selectionList.length === 0) {
         this.$message.warning("请选择至少一条数据");
         return;
@@ -427,7 +490,7 @@ export default {
       this.$confirm("确定将选择数据删除?", {
         confirmButtonText: "确定",
         cancelButtonText: "取消",
-        type: "warning"
+        type: "warning",
       })
         .then(() => {
           return remove(this.ids);
@@ -436,48 +499,52 @@ export default {
           this.onLoad(this.page);
           this.$message({
             type: "success",
-            message: "操作成功!"
+            message: "操作成功!",
           });
           this.$refs.crud.toggleSelection();
         });
     },
-    beforeOpen (done, type) {
+    beforeOpen(done, type) {
       if (["edit", "view"].includes(type)) {
-        getDetail(this.form.id).then(res => {
+        getDetail(this.form.id).then((res) => {
           this.form = res.data.data;
         });
       }
       done();
     },
-    searchReset () {
+    searchReset() {
       this.query = {};
       this.onLoad(this.page);
     },
-    searchChange (params, done) {
+    searchChange(params, done) {
       this.query = params;
       this.page.currentPage = 1;
       this.onLoad(this.page, params);
       done();
     },
-    selectionChange (list) {
+    selectionChange(list) {
       this.selectionList = list;
     },
-    selectionClear () {
+    selectionClear() {
       this.selectionList = [];
       this.$refs.crud.toggleSelection();
     },
-    currentChange (currentPage) {
+    currentChange(currentPage) {
       this.page.currentPage = currentPage;
     },
-    sizeChange (pageSize) {
+    sizeChange(pageSize) {
       this.page.pageSize = pageSize;
     },
-    refreshChange () {
+    refreshChange() {
       this.onLoad(this.page, this.query);
     },
-    onLoad (page, params = {}) {
+    onLoad(page, params = {}) {
       this.loading = true;
-      getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
+      getList(
+        page.currentPage,
+        page.pageSize,
+        Object.assign(params, this.query)
+      ).then((res) => {
         const data = res.data.data;
         this.page.total = data.total;
         this.data = data.records;
@@ -486,85 +553,77 @@ export default {
       });
     },
 
-    toEdit (row) {
+    toEdit(row) {
       console.log(row);
       this.$router.push({
-        path: '/wbs/edit',
+        path: "/wbs/edit",
         query: {
           id: row.id,
-          type: row.wbsType
-        }
-      })
+          type: row.wbsType,
+        },
+      });
       //this.$router.push('/wbs/edit/' + row.id);
     },
     //点击参数库
-    handleParameter(){
-       this.$router.push('/wbs/parameter');
+    handleParameter() {
+      this.$router.push("/wbs/parameter");
     },
-    getWbsList(){
-      getList(1, 1000).then(res => {
+    getWbsList() {
+      getList(1, 1000).then((res) => {
         const data = res.data.data;
-        
-        this.wbsList=data['records']
+
+        this.wbsList = data["records"];
       });
     },
     //排序
-    handleSort(){
-         this.sortWbsList = JSON.parse(JSON.stringify(this.wbsList));
-        this.sortTitle = '合同段排序';
+    handleSort() {
+      this.sortWbsList = JSON.parse(JSON.stringify(this.wbsList));
+      this.sortTitle = "合同段排序";
 
-          this.$nextTick(() => {
-            this.$refs.contractSortRef.show(this.sortWbsList);
-          });
+      this.$nextTick(() => {
+        this.$refs.contractSortRef.show(this.sortWbsList);
+      });
     },
-     handleSortConfirm(sortedList) {
+    handleSortConfirm(sortedList) {
       // 这里处理排序后的数据
-      console.log('排序后的列表:', sortedList);
+      console.log("排序后的列表:", sortedList);
       // TODO: 调用接口保存排序结果
       this.wbsList = [...sortedList];
-        const ids = this.wbsList.map(item => item.id);
-     this. saveSort(ids);
-
+      const ids = this.wbsList.map((item) => item.id);
+      this.saveSort(ids);
     },
-    saveSort(ids){
-        sortWbs(ids).then((res) => {
-                    this.sortProLoad= false;
-                    if(res.data.code==200){
-                        this.$message.success(res.data.msg)
-                      
-                                 this.onLoad(this.page);
-                    }else{
-                        this.$message.error(res.data.msg)
-                    }
-                })
-      
-
+    saveSort(ids) {
+      sortWbs(ids).then((res) => {
+        this.sortProLoad = false;
+        if (res.data.code == 200) {
+          this.$message.success(res.data.msg);
 
+          this.onLoad(this.page);
+        } else {
+          this.$message.error(res.data.msg);
+        }
+      });
     },
-    searchClick(){ 
-       this.page.currentPage = 1;
-      this.onLoad(this.page,this.query);
+    searchClick() {
+      this.page.currentPage = 1;
+      this.onLoad(this.page, this.query);
     },
-    clearSearch(){
-       this.page.currentPage = 1;
+    clearSearch() {
+      this.page.currentPage = 1;
       this.query = {};
-      this.onLoad(this.page,this.query);
-    }
-  }
+      this.onLoad(this.page, this.query);
+    },
+  },
 };
 </script>
 
 <style scoped lang="scss">
-.search-box{
+.search-box {
   display: flex;
   justify-content: space-between;
-  .search-item{
-    margin-right: 10px;
-    margin-left: 10px;
-  }
- 
 }
-.filter-item{
+
+.filter-item {
   margin-right: 10px;
 }
 </style>

+ 26 - 26
src/views/tentative/components/dataMap.vue

@@ -17,7 +17,7 @@
       </div>
       <template v-if="listArr.length>0">
          <div class="right_box" v-for="(eleItem,index) in listArr" :key="index">
-     
+
              <div>
                 <span>选择表单</span>
                 <el-select
@@ -66,15 +66,15 @@
                     <el-button type="primary" size="small" @click="addList(index)">新增元素</el-button>
                     <el-button type="danger"  size="small" v-if="index>0" @click="delList(index,eleItem)">删除元素</el-button>
                   </div>
-                
+
                 </div>
               </div>
-       
+
       </div>
       </template>
       <el-empty description="暂无数据" v-else ></el-empty>
 
-     
+
     </div>
   </div>
 </template>
@@ -86,7 +86,7 @@ import {
   getLinkDetail,
   removeLinkData,
   getLinkData,
-  saveLinkDetail 
+  saveLinkDetail
 } from "@/api/tentative/testcollect";
 import Vue from "vue";
 import Split from "split.js";
@@ -124,10 +124,10 @@ export default {
     };
   },
   watch: {
- 
+
   },
   methods: {
-  
+
     async getExcelHtmlCol(classId, form) {
       //获取excel模板
       const { data: res } = await getLinkHtml({ classId });
@@ -152,7 +152,7 @@ export default {
           },
           template: res.data,
           methods: {
-     
+
             contextmenuClick() {},
             getInformation() {},
             formUploadSuccess() {},
@@ -235,11 +235,11 @@ export default {
           this.$set(this.curItem, "htmlKeyName", this.clickKeyname);
           this.listArr.forEach((ele)=>{
             ele.htmlKeyName= this.clickKeyname
-        
+
           })
-        await this.getInfoDEtail();   
+        await this.getInfoDEtail();
+
 
-     
       }
     },
     getParentTD(ele) {
@@ -290,8 +290,8 @@ export default {
       this.getEleList(val);
       this.formoptions.forEach((ele) => {
         if (ele.initTabId === val) {
-       
-   
+
+
           this.listArr[index].trialTabId= ele.pkeyId
           this.listArr[index].trialTabName= ele.initTableName
           this.listArr[index].tabName= ele.tabName
@@ -301,8 +301,8 @@ export default {
     changeEle(val,index) {
       this.eleOptions.forEach((ele) => {
         if (ele.id === val) {
-       
-       
+
+
           this.listArr[index].elementName= ele.eName
           this.listArr[index].elementId= ele.id
         }
@@ -330,7 +330,7 @@ export default {
         this.listArr = res.data.length>0?res.data:[{}]
           this.listArr.forEach((ele)=>{
             ele.htmlKeyName= this.clickKeyname
-        
+
           })
         this.formoptions.forEach((ele)=>{
          this.listArr.forEach(async(eleItem,eleIndex)=>{
@@ -339,16 +339,16 @@ export default {
             await this.getEleList(ele.initTabId)
            this.changeEle(eleItem.elementId,eleIndex)
 
-            
+
           }
 
          })
         })
-      
-       
-        
 
-    
+
+
+
+
       } else {
           this.listArr = [{}]
 
@@ -357,16 +357,16 @@ export default {
 
     //映射数据保存
     async saveInfo() {
-  
-      
+
+
       if (this.listArr.length === 0) {
         this.$message.warning("请进行数据映射配置");
         return;
       }
-    const isValid = this.listArr.every(item => 
+    const isValid = this.listArr.every(item =>
     item.elementId && item.initTabId
   );
-  
+
   if (!isValid) {
     this.$message.warning("请确保选择了所有表单和元素字段!");
     return;
@@ -398,7 +398,7 @@ export default {
           });
           return; // 不满足条件则不添加
         }
-       this.listArr.splice(index + 1, 0, { 
+       this.listArr.splice(index + 1, 0, {
           htmlKeyName: this.clickKeyname
         ,
 

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 179 - 297
yarn.lock


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels