qymljy 1 سال پیش
والد
کامیت
838a12aa5a
1فایلهای تغییر یافته به همراه35 افزوده شده و 0 حذف شده
  1. 35 0
      src/Form/projectChange/add.vue

+ 35 - 0
src/Form/projectChange/add.vue

@@ -456,6 +456,9 @@
                 : "--"
                 : "--"
             }}</span>
             }}</span>
           </div>
           </div>
+<!--          <div v-else-if="scope.column.columnname == 'projectname'">-->
+<!--            <span>{{getFontHighlight(scope.column.data.projectname,scope.column.data.chars[0].projectname)}}</span>-->
+<!--          </div>-->
           <div v-else-if="scope.column.columnname == 'address'">
           <div v-else-if="scope.column.columnname == 'address'">
             <span>{{scope.column.data.address || scope.column.data.province?scope.column.data.province+scope.column.data.city+scope.column.data.county+scope.column.data.address:'--'}}</span>
             <span>{{scope.column.data.address || scope.column.data.province?scope.column.data.province+scope.column.data.city+scope.column.data.county+scope.column.data.address:'--'}}</span>
           </div>
           </div>
@@ -959,6 +962,7 @@ export default {
           this.repeats = res.data;
           this.repeats = res.data;
           this.total = res.total;
           this.total = res.total;
           this.$refs.form.validateField("projectname");
           this.$refs.form.validateField("projectname");
+          // this.getFontHighlight(res.data)
           if (this.repeats.length > 0) {
           if (this.repeats.length > 0) {
             this.siteid == "HY"
             this.siteid == "HY"
                 ? (this.dialogTableVisible = true)
                 ? (this.dialogTableVisible = true)
@@ -987,6 +991,37 @@ export default {
       let res2 = await this.$store.dispatch("optiontypeselect", "projectgrade");
       let res2 = await this.$store.dispatch("optiontypeselect", "projectgrade");
       this.projectLead = res2.data;
       this.projectLead = res2.data;
     },
     },
+    getFontHighlight(data){
+      data.map(item =>{
+        console.log(item.chars[0].projectname,'item3333')
+        let newName = item.projectname.split('').map(newText => {
+          console.log(text,'text2222')
+          let projectnamenew = item.chars[0].projectname.join("") || ''
+          return projectnamenew.includes(newText) ? {
+            text,
+            color: "red"
+          }:{
+            text,
+            color:'#666'
+          }
+        })
+        console.log(newName,'newName')
+        return newName
+      })
+      console.log(data,'重组数组')
+      return data
+      // let newName = data[0].charts.projectname.split('').map(text => {
+      //   let projectname = set.join("") || ''
+      //   return projectname.includes(text) ? {
+      //     text,
+      //     color: "red"
+      //   }:{
+      //     text,
+      //     color:'#666'
+      //   }
+      // })
+      // return newName
+    }
   },
   },
   mounted() {},
   mounted() {},
   created() {
   created() {