From d3642faa7f79bc1e8992e528ad102587a2c44499 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期二, 16 四月 2024 15:27:42 +0800
Subject: [PATCH] 新增行的时候点击范围修改

---
 src/views/systemSetting/silkStandardSetting/components/silkTableList.vue |   60 +++++++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 45 insertions(+), 15 deletions(-)

diff --git a/src/views/systemSetting/silkStandardSetting/components/silkTableList.vue b/src/views/systemSetting/silkStandardSetting/components/silkTableList.vue
index 8875782..c25faab 100644
--- a/src/views/systemSetting/silkStandardSetting/components/silkTableList.vue
+++ b/src/views/systemSetting/silkStandardSetting/components/silkTableList.vue
@@ -3,6 +3,7 @@
     <div class="top-box">
       <div class="table-box" :style="{ width: detailEnter ? '95%' : '100%' }">
         <el-form ref="form" :model="tableList" :show-message="false" label-position="right">
+          
           <el-table
             ref="fromTable"
             :data="tableList.tableData"
@@ -49,7 +50,7 @@
                     <i class="el-icon-remove" title="鍒犻櫎"></i>
                   </div>
                 </div>
-                <span v-else>{{ item.label }}</span>
+                <span v-else @click="editColumnInput(item,i, item.prop)">{{ item.label||'--' }}</span>
               </template>
               <!-- column鏍峰紡 -->
               <template slot-scope="scope">
@@ -67,7 +68,7 @@
                       :disabled="!isOperate"
                       @change="
                         (val) => {
-                          commonInputChange(val, item.prop, scope.row, scope)
+                          commonInputChange(val, item.prop, scope)
                         }
                       "
                     ></el-input>
@@ -83,7 +84,7 @@
                           v-for="(item, index) in projectOptions"
                           :key="index"
                           :label="item.value"
-                          :value="item.value"
+                          :value="item.id"
                         >
                         </el-option>
                       </el-select>
@@ -162,6 +163,11 @@
                     "
                   ></el-input-number>
                 </el-form-item>
+                <div v-else-if="item.isCallMethod">
+                  <span :class="item.isClass ? item.getClassName(scope.row[item.prop], scope.row) : ''">{{
+                    item.getCallMethod(scope.row[item.prop], scope.row)
+                  }}</span>
+                </div>
                 <span v-else style="text-align: right">{{ scope.row[item.prop] }}</span>
               </template>
             </el-table-column>
@@ -187,8 +193,8 @@
       </div>
     </div>
     <div v-if="detailEnter" style="margin: 10px">
-      <div class="add-btn-box" @click="addRowClick">
-        <i class="el-icon-circle-plus"></i>
+      <div class="add-btn-box">
+        <i class="el-icon-circle-plus" @click="addRowClick"></i>
       </div>
       <!-- <el-button size="small" type="primary" :disabled="!isOperate" @click="add">鏂板</el-button> -->
       <!-- <el-button size="small" type="primary" disabled>瀵煎叆鏄庣粏</el-button> -->
@@ -198,6 +204,7 @@
 
 <script>
 // import { getProductList } from "@/api/common/other"
+import { getDataByType } from "@/api/data"
 export default {
   name: "CommmonFormTableView",
   components: {},
@@ -250,13 +257,7 @@
       productList: [],
       tableList: [],
       projectIndex: 0,
-      projectOptions: [
-        { id: 1, value: "绾ゅ害鍋忓樊" },
-        { id: 2, value: "浜屾鍙樺寲" },
-        { id: 3, value: "娓呮磥鍒�" },
-        { id: 4, value: "娲佸噣鍒�" },
-        { id: 5, value: "鏈�澶у亸宸�" }
-      ]
+      projectOptions: getDataByType("projectOptions")
     }
   },
   created() {
@@ -299,8 +300,8 @@
         this.$emit("addProjectClick")
       }
     },
-    commonInputChange(val, prop, row, scope) {
-      this.$emit("inputContent", val, prop, row, scope)
+    commonInputChange(val, prop, scope) {
+      this.$emit("inputContent", val, prop, scope)
     },
     // 鍒犻櫎
     deleteClick(scope) {
@@ -317,6 +318,19 @@
     // 娣诲姞鍒楀ご閮ㄦ爣棰樿緭鍏�
     addColumnInputChange(val, prop) {
       console.log(val, prop, "娣诲姞鍒楀ご閮ㄦ爣棰樿緭鍏�")
+      this.$emit("addColumnInputChange", val, prop)
+    },
+    editColumnInput(item,i,prop){
+      console.log(item,'===item')
+      console.log(i,'===i')
+      console.log(prop,'===prop')
+      if(prop.indexOf('prop')!=-1){
+        item.addColumn=true;
+        this.$set(this.tableList.tableColumn[i],'addColumn',true)
+        this.$forceUpdate()
+        this.$emit("editColumnInput", item, i,prop)
+      }
+      
     },
     // 鍒犻櫎鍒�
     clearupColumn(prop) {
@@ -366,7 +380,10 @@
     font-size: 26px;
     color: #5582f3;
     margin-left: 50px;
-    cursor: pointer;
+    .el-icon{
+      cursor: pointer;
+      padding:5px;
+    }
   }
   .add-column-box {
     display: flex;
@@ -394,6 +411,19 @@
   .el-table th.el-table__cell > .cell {
     padding: 0 5px;
   }
+  .el-table th.el-table__cell > .cell {
+    span{
+      width:100%;
+      display:inline-block;
+    }
+  }
+  .el-table__cell{
+    padding: 5px 0 !important;
+    height: 35px;
+  }
+ .el-input__suffix{
+  text-align:right;
+ }
   .el-input__inner {
     // text-align: left;
     text-align: center !important;

--
Gitblit v1.8.0