Browse Source

table组件新增

asd26269546 1 năm trước cách đây
mục cha
commit
7b8b885a65

+ 41 - 1
src/components/byTable/ElementsMapping.vue

@@ -1,3 +1,26 @@
+<template>
+  <div>
+    
+    <el-button v-for="(i,index) in getCellList"  @click="i.click()" :key="index" v-bind="i.attrs" v-show="index < 2">{{ i.attrs.label }}</el-button>
+    <el-dropdown>
+      <span class="el-dropdown-link">
+        <span class="more-btn">更多</span>
+        
+      </span>
+      <template #dropdown>
+        <el-dropdown-menu>
+          <el-dropdown-item 
+            :class="index > 1 ? '' : 'dn'" 
+            @click="i.click()" v-for="(i,index) in getCellList" 
+            
+            :key="index" >
+            <span :style="i.attrs.type == 'danger' ? 'color:red' : 'color:#409eff'">{{ i.attrs.label}}</span>
+          </el-dropdown-item>
+        </el-dropdown-menu>
+      </template>
+    </el-dropdown>
+  </div>
+</template>
 <script>
 import {
   defineComponent,
@@ -58,6 +81,13 @@ export default defineComponent({
         props: attrs
       }
     }
+    if(getCellList.value.length > 3) {
+      
+      console.log(getCellList)
+      return {
+        getCellList
+      }
+    }
     return () => {
       return h(
         'div',
@@ -101,4 +131,14 @@ export default defineComponent({
     }
   }
 })
-</script>
+</script>
+<style>
+.more-btn{
+  line-height: 34px;
+  font-size: 14px;
+  color:#FF9315;
+}
+.dn{
+  display: none!important;
+}
+</style>

+ 1 - 1
src/layout/components/AppMain.vue

@@ -17,7 +17,7 @@ import iframeToggle from "./IframeToggle/index"
 import useTagsViewStore from '@/store/modules/tagsView'
 
 const tagsViewStore = useTagsViewStore()
-console.log(tagsViewStore,12312312)
+
 </script>
 
 <style lang="scss" scoped>

+ 3 - 1
src/views/system/user2/index.vue

@@ -146,7 +146,7 @@ const config = computed(() => {
     {
       attrs: {
         label: "操作",
-        width: "200",
+        width: "300",
         align: "right",
       },
       // 渲染 el-button,一般用在最后一列。
@@ -160,10 +160,12 @@ const config = computed(() => {
             },
             el: "button",
             click() {
+              console.log(row)
               userId.value = row.userId;
               roomDialogVisible.value = true;
             },
           },
+          
           {
             attrs: {
               label: "修改",