소스 검색

feat: 对定多频多台详情序号编辑符号隐现处理

332777428@qq.com 1 개월 전
부모
커밋
25d76737ad
3개의 변경된 파일32개의 추가작업 그리고 10개의 파일을 삭제
  1. 19 2
      src/views/operation/channel/detail.vue
  2. 7 7
      src/views/operation/channel/index.vue
  3. 6 1
      src/views/operation/channels/detail.vue

+ 19 - 2
src/views/operation/channel/detail.vue

@@ -117,6 +117,7 @@
                   <!-- {{ scope.row.sort || "" }} -->
                 </span>
                 <svg-icon
+                  v-if="!disabled && !isRead"
                   icon-class="edit"
                   @click.native="handleEditClick(scope.row, scope.$index)"
                 />
@@ -132,6 +133,8 @@
                 @keyup.enter.native="onNumberBlurEnter(scope.row, scope.$index)"
               /> -->
 
+              <!-- ref="numberInput" -->
+              <!-- :ref="(el) => (inputRefs[scope.$index] = el)" -->
               <el-input
                 v-else
                 v-model="scope.row.indexNum"
@@ -199,6 +202,7 @@ export default {
   },
   data() {
     return {
+      inputRefs: [], // 存储 ref 的数组
       editData: {
         currentEditIndex: -1,
         currentEditSort: 1,
@@ -230,11 +234,25 @@ export default {
   methods: {
     // 点击编辑图标显示输入框
     handleEditClick(row, index) {
+      if (this.disabled || this.isRead) {
+        return;
+      }
+
       this.editData.currentEditIndex = index;
       this.editData.currentEditSort = row.indexNum;
+      console.log("safqwerqwr==000==" + row.indexNum + "===" + index);
       this.$nextTick(() => {
-        this.$refs.numberInput.focus();
+        console.log("safqwerqwr==111==" + row.indexNum + "===" + index);
+        setTimeout(() => {
+          console.log("safqwerqwr==333==" + row.indexNum + "===" + index);
+          this.$refs.numberInput.focus();
+          // this.$refs.numberInput.select();
+        }, 50);
       });
+
+      // this.$nextTick(() => {
+      //   this.$refs.numberInput.focus();
+      // });
     },
 
     onNumberBlurEnter(row, index) {
@@ -301,7 +319,6 @@ export default {
       // });
     },
 
-    
     // 频道详情
     getDetail() {
       channelDetail({

+ 7 - 7
src/views/operation/channel/index.vue

@@ -193,13 +193,13 @@
 
 <script>
 import {
-  change,
-  channelPage,
-  create,
-  devList,
-  editPage,
-  getRemove,
-  page,
+change,
+channelPage,
+create,
+devList,
+editPage,
+getRemove,
+page,
 } from "@/api/operation/channel";
 import { dialogCallBack } from "@/utils/DialogUtil";
 export default {

+ 6 - 1
src/views/operation/channels/detail.vue

@@ -115,11 +115,12 @@
                   <!-- {{ scope.row.sort || "" }} -->
                 </span>
                 <svg-icon
+                  v-if="!isRead"
                   icon-class="edit"
                   @click.native="handleEditClick(scope.row, scope.$index)"
                 />
               </div>
-<!-- 
+              <!-- 
               <el-input
                 v-else
                 v-model="scope.row.indexNum"
@@ -225,6 +226,10 @@ export default {
   methods: {
     // 点击编辑图标显示输入框
     handleEditClick(row, index) {
+      if (this.isRead) {
+        return;
+      }
+
       this.editData.currentEditIndex = index;
       this.editData.currentEditSort = row.indexNum;
       this.$nextTick(() => {