ソースを参照

Merge remote-tracking branch 'origin/master'

yuhan 9 ヶ月 前
コミット
5c59e3b37f
共有1 個のファイルを変更した46 個の追加1 個の削除を含む
  1. 46 1
      src/views/module_interLock/InterlockSummary/InterlockSummaryList.vue

+ 46 - 1
src/views/module_interLock/InterlockSummary/InterlockSummaryList.vue

@@ -230,7 +230,52 @@
             align:"center",
             fixed:"right",
             width:147,
-            scopedSlots: { customRender: 'action' }
+            // scopedSlots: { customRender: 'action' },
+            customRender:function (t,r,index) {
+              var childrenVal
+              var childrenVal2
+              var childrenVal3
+              var childrenVal4
+              var childrenVal5
+              childrenVal = (<a id='edit'>编辑</a>)
+              childrenVal2 = (<a-divider type="vertical" />)
+              childrenVal3 = (<a id='detail'>详情</a>)
+              childrenVal4 = (<a-divider type="vertical" />)
+              childrenVal5 = (
+              <a-popconfirm title="确定删除吗?">
+                <a id='delete'>删除</a>
+              </a-popconfirm>)
+              return {
+                children: [childrenVal,childrenVal2,childrenVal3,childrenVal4,childrenVal5],
+                attrs: {
+                  rowSpan: r.rowSpan
+                }
+              }
+            },
+            customCell: (row, index) => {
+              return {
+                on: {
+                  click: (e) => {
+                    let that = this
+                    document.addEventListener('click', function(event) {
+                      var clickedElement = event.target;
+                      var elementId = clickedElement.id;
+                      console.log('点击',elementId,clickedElement);
+                      if (elementId == 'edit') {
+                        console.log('这一行的信息',row, index)
+                        that.handleEdit(row);
+                      }
+                      if (elementId == 'detail') {
+                        that.handleDetail(row);
+                      }
+                      if (elementId == 'delete') {
+                        // that.handleDelete(row, index);
+                      }
+                    });
+                  },
+                },
+              };
+            },
           }
         ],
         url: {