lrf402788946 4 years ago
parent
commit
e6e5cca0bd

+ 1 - 0
components/data-table.md

@@ -30,6 +30,7 @@
 |confirm|Boolean|`-`|否|是否需要确认提示|
 |confirm|Boolean|`-`|否|是否需要确认提示|
 |methodZh|String/Function|label|否|确认提示的操作文字,1,Function参数为这条数据,自己随意组合;2,String为纯自定义字符串,需要自己写整个提示语;3,默认,使用label字段提示|
 |methodZh|String/Function|label|否|确认提示的操作文字,1,Function参数为这条数据,自己随意组合;2,String为纯自定义字符串,需要自己写整个提示语;3,默认,使用label字段提示|
 |display|Function|`-`|否|控制按钮是否显示(目前为简单版,只是根据此条数据中的内容判断,以后要是有需求会修改成toFormat的形式)|
 |display|Function|`-`|否|控制按钮是否显示(目前为简单版,只是根据此条数据中的内容判断,以后要是有需求会修改成toFormat的形式)|
+|type|String|`primary`|element的四大类型|
 
 
 >methods
 >methods
 >>
 >>

+ 23 - 4
components/data-table.vue

@@ -32,19 +32,38 @@
               <template v-if="display(item, row)">
               <template v-if="display(item, row)">
                 <template v-if="item.icon">
                 <template v-if="item.icon">
                   <el-tooltip :key="index" effect="dark" :content="item.label" placement="bottom">
                   <el-tooltip :key="index" effect="dark" :content="item.label" placement="bottom">
-                    <el-button
+                    <!-- <el-button
                       :key="index"
                       :key="index"
                       type="text"
                       type="text"
                       :icon="item.icon || ''"
                       :icon="item.icon || ''"
                       size="mini"
                       size="mini"
                       @click="handleOpera(row, item.method, item.confirm, item.methodZh, item.label, $index)"
                       @click="handleOpera(row, item.method, item.confirm, item.methodZh, item.label, $index)"
-                    ></el-button>
+                    ></el-button> -->
+                    <el-link
+                      :key="index"
+                      :type="item.type || 'primary'"
+                      :icon="item.icon || ''"
+                      size="mini"
+                      :underline="false"
+                      @click="handleOpera(row, item.method, item.confirm, item.methodZh, item.label, $index)"
+                    >
+                    </el-link>
                   </el-tooltip>
                   </el-tooltip>
                 </template>
                 </template>
                 <template v-else>
                 <template v-else>
-                  <el-button :key="index" type="text" size="mini" @click="handleOpera(row, item.method, item.confirm, item.methodZh, item.label, $index)">
+                  <el-link
+                    :key="index"
+                    :type="item.type || 'primary'"
+                    :icon="item.icon || ''"
+                    size="mini"
+                    :underline="false"
+                    @click="handleOpera(row, item.method, item.confirm, item.methodZh, item.label, $index)"
+                  >
+                    {{ item.label }}
+                  </el-link>
+                  <!-- <el-button :key="index" type="text" size="mini" @click="handleOpera(row, item.method, item.confirm, item.methodZh, item.label, $index)">
                     {{ item.label }}
                     {{ item.label }}
-                  </el-button>
+                  </el-button> -->
                 </template>
                 </template>
               </template>
               </template>
             </template>
             </template>

+ 1 - 0
components/filter-page-table.md

@@ -29,6 +29,7 @@
 |filterReturn|Boolean|`-`|否|针对这个选项需要在选择后就做些逻辑处理时,改成true,然后再使用filterReturn方法处理,(例如二级联动的情况)|
 |filterReturn|Boolean|`-`|否|针对这个选项需要在选择后就做些逻辑处理时,改成true,然后再使用filterReturn方法处理,(例如二级联动的情况)|
 |notable|Boolean|false/undefined|否|不需要在表格中显示|
 |notable|Boolean|false/undefined|否|不需要在表格中显示|
 |selected|Array|`-`|false|多选选项的数据|
 |selected|Array|`-`|false|多选选项的数据|
+|type|String|`primary`|element的四大类型|
 
 
 >opera
 >opera
 >>
 >>

+ 24 - 4
components/filter-page-table.vue

@@ -81,17 +81,37 @@
             <template v-for="(item, index) in opera">
             <template v-for="(item, index) in opera">
               <template v-if="display(item, row)">
               <template v-if="display(item, row)">
                 <el-tooltip v-if="item.icon" :key="index" effect="dark" :content="item.label" placement="bottom">
                 <el-tooltip v-if="item.icon" :key="index" effect="dark" :content="item.label" placement="bottom">
-                  <el-button
+                  <!-- <el-button
                     :key="index"
                     :key="index"
                     type="text"
                     type="text"
                     :icon="item.icon || ''"
                     :icon="item.icon || ''"
                     size="mini"
                     size="mini"
                     @click="handleOpera(row, item.method, item.confirm, item.methodZh, item.label, $index)"
                     @click="handleOpera(row, item.method, item.confirm, item.methodZh, item.label, $index)"
-                  ></el-button>
+                  ></el-button> -->
+                  <el-link
+                    :key="index"
+                    :type="item.type || 'primary'"
+                    :icon="item.icon || ''"
+                    size="mini"
+                    :underline="false"
+                    @click="handleOpera(row, item.method, item.confirm, item.methodZh, item.label, $index)"
+                  >
+                  </el-link>
                 </el-tooltip>
                 </el-tooltip>
-                <el-button v-else :key="index" type="text" size="mini" @click="handleOpera(row, item.method, item.confirm, item.methodZh, item.label, $index)">
+                <el-link
+                  v-else
+                  :key="index"
+                  :type="item.type || 'primary'"
+                  :icon="item.icon || ''"
+                  size="mini"
+                  :underline="false"
+                  @click="handleOpera(row, item.method, item.confirm, item.methodZh, item.label, $index)"
+                >
+                  {{ item.label }}
+                </el-link>
+                <!-- <el-button v-else :key="index" type="text" size="mini" @click="handleOpera(row, item.method, item.confirm, item.methodZh, item.label, $index)">
                   {{ item.label }}
                   {{ item.label }}
-                </el-button>
+                </el-button> -->
               </template>
               </template>
             </template>
             </template>
           </template>
           </template>