|
|
|
@ -147,6 +147,7 @@
|
|
|
|
|
</el-form>
|
|
|
|
|
<!-- 查询表单结束 -->
|
|
|
|
|
<!-- 批量操作 -->
|
|
|
|
|
<template v-if="!option.tableButtons">
|
|
|
|
|
<div style="padding-bottom: 8px">
|
|
|
|
|
<slot name="buttonLeftOnTable" :selection="checkRecords" />
|
|
|
|
|
<el-button
|
|
|
|
@ -179,6 +180,24 @@
|
|
|
|
|
>
|
|
|
|
|
<slot name="buttonRightOnTable" :selection="checkRecords" />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else>
|
|
|
|
|
<div style="padding-bottom: 8px">
|
|
|
|
|
<slot name="tableButtons" :selection="checkRecords" />
|
|
|
|
|
<el-button
|
|
|
|
|
v-for="(item, index) in option.tableButtons"
|
|
|
|
|
:key="index"
|
|
|
|
|
v-permission="item.permission"
|
|
|
|
|
class="tableButton"
|
|
|
|
|
:plain="item.plain"
|
|
|
|
|
:icon="item.icon"
|
|
|
|
|
:type="item.type"
|
|
|
|
|
:disabled="isDisabledButton(item, checkRecords)"
|
|
|
|
|
@click="item.click(checkRecords)"
|
|
|
|
|
>{{ handlegetLable(checkRecords, item.label) }}</el-button
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- 表格开始 -->
|
|
|
|
@ -282,14 +301,11 @@
|
|
|
|
|
align="center"
|
|
|
|
|
fixed="right"
|
|
|
|
|
label="操作"
|
|
|
|
|
:width="
|
|
|
|
|
option.buttons.customButton &&
|
|
|
|
|
option.buttons.customButton.operationWidth
|
|
|
|
|
? option.buttons.customButton.operationWidth
|
|
|
|
|
: 100
|
|
|
|
|
"
|
|
|
|
|
:width="option.buttons.rowButtonsWidth || 100"
|
|
|
|
|
>
|
|
|
|
|
<!-- 插槽 -->
|
|
|
|
|
<template slot-scope="scope">
|
|
|
|
|
<template v-if="!option.rowButtons">
|
|
|
|
|
<slot name="rowButton" :msg="scope.row" />
|
|
|
|
|
<el-button
|
|
|
|
|
v-if="
|
|
|
|
@ -336,6 +352,58 @@
|
|
|
|
|
</el-dropdown-menu>
|
|
|
|
|
</el-dropdown>
|
|
|
|
|
</template>
|
|
|
|
|
<template v-else>
|
|
|
|
|
<div v-if="option.rowButtons.length <= 2">
|
|
|
|
|
<el-button
|
|
|
|
|
v-for="(item, index) in option.rowButtons"
|
|
|
|
|
:key="index"
|
|
|
|
|
v-permission="item.permission"
|
|
|
|
|
:disabled="isDisabledButton(item, scope.row)"
|
|
|
|
|
:type="item.type || 'text'"
|
|
|
|
|
size="small"
|
|
|
|
|
@click="item.click(scope.row)"
|
|
|
|
|
>{{ handlegetLable(scope.row, item.label) }}</el-button
|
|
|
|
|
>
|
|
|
|
|
</div>
|
|
|
|
|
<div v-else>
|
|
|
|
|
<el-button
|
|
|
|
|
v-permission="option.rowButtons[0].permission"
|
|
|
|
|
:type="option.rowButtons[0].type || 'text'"
|
|
|
|
|
:disabled="
|
|
|
|
|
isDisabledButton(option.rowButtons[0], scope.row)
|
|
|
|
|
"
|
|
|
|
|
@click="option.rowButtons[0].click(scope.row)"
|
|
|
|
|
>{{
|
|
|
|
|
handlegetLable(scope.row, option.rowButtons[0].label)
|
|
|
|
|
}}</el-button
|
|
|
|
|
>
|
|
|
|
|
<el-dropdown trigger="click">
|
|
|
|
|
<span class="el-dropdown-link">
|
|
|
|
|
更多
|
|
|
|
|
<i class="el-icon-caret-bottom el-icon--right" />
|
|
|
|
|
</span>
|
|
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
|
|
<el-dropdown-item class="clearfix">
|
|
|
|
|
<el-button
|
|
|
|
|
v-for="(item, index) in option.rowButtons.filter(
|
|
|
|
|
(el, index) => index > 0
|
|
|
|
|
)"
|
|
|
|
|
:key="index"
|
|
|
|
|
v-permission="item.permission"
|
|
|
|
|
:type="item.type || 'text'"
|
|
|
|
|
:disabled="isDisabledButton(item, scope.row)"
|
|
|
|
|
size="small"
|
|
|
|
|
@click="item.click(scope.row)"
|
|
|
|
|
>{{
|
|
|
|
|
handlegetLable(scope.row, item.label)
|
|
|
|
|
}}</el-button
|
|
|
|
|
>
|
|
|
|
|
</el-dropdown-item>
|
|
|
|
|
</el-dropdown-menu>
|
|
|
|
|
</el-dropdown>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
<div class="page_bottom">
|
|
|
|
@ -668,6 +736,21 @@ export default {
|
|
|
|
|
};
|
|
|
|
|
this.$emit("handleCustomValue", obj);
|
|
|
|
|
},
|
|
|
|
|
handlegetLable(item, label) {
|
|
|
|
|
if (typeof label == "function") {
|
|
|
|
|
return label(item);
|
|
|
|
|
} else {
|
|
|
|
|
return label;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 是否disabled
|
|
|
|
|
isDisabledButton(item, row) {
|
|
|
|
|
if (typeof item.isDisable === "function") {
|
|
|
|
|
return item.isDisable(row);
|
|
|
|
|
} else {
|
|
|
|
|
return !!item.disabled;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
// 弹框被关闭时的回调事件
|
|
|
|
|
editDialogClosedEvent(value) {
|
|
|
|
|
// 把列表页中弹框打开标记改成已关闭
|
|
|
|
|