|
|
@ -147,38 +147,57 @@
|
|
|
|
</el-form>
|
|
|
|
</el-form>
|
|
|
|
<!-- 查询表单结束 -->
|
|
|
|
<!-- 查询表单结束 -->
|
|
|
|
<!-- 批量操作 -->
|
|
|
|
<!-- 批量操作 -->
|
|
|
|
<div style="padding-bottom: 8px">
|
|
|
|
<template v-if="!option.tableButtons">
|
|
|
|
<slot name="buttonLeftOnTable" :selection="checkRecords" />
|
|
|
|
<div style="padding-bottom: 8px">
|
|
|
|
<el-button
|
|
|
|
<slot name="buttonLeftOnTable" :selection="checkRecords" />
|
|
|
|
v-if="
|
|
|
|
<el-button
|
|
|
|
option.buttons.add.isShow == undefined
|
|
|
|
v-if="
|
|
|
|
? true
|
|
|
|
option.buttons.add.isShow == undefined
|
|
|
|
: option.buttons.add.isShow
|
|
|
|
? true
|
|
|
|
"
|
|
|
|
: option.buttons.add.isShow
|
|
|
|
v-permission="option.buttons.add.permission"
|
|
|
|
"
|
|
|
|
class="button"
|
|
|
|
v-permission="option.buttons.add.permission"
|
|
|
|
plain
|
|
|
|
class="button"
|
|
|
|
icon="el-icon-plus"
|
|
|
|
plain
|
|
|
|
@click="handleOpenEditView('add')"
|
|
|
|
icon="el-icon-plus"
|
|
|
|
>新增</el-button
|
|
|
|
@click="handleOpenEditView('add')"
|
|
|
|
>
|
|
|
|
>新增</el-button
|
|
|
|
<el-button
|
|
|
|
>
|
|
|
|
v-if="
|
|
|
|
<el-button
|
|
|
|
option.buttons.delete.isShow == undefined
|
|
|
|
v-if="
|
|
|
|
? true
|
|
|
|
option.buttons.delete.isShow == undefined
|
|
|
|
: option.buttons.delete.isShow
|
|
|
|
? true
|
|
|
|
"
|
|
|
|
: option.buttons.delete.isShow
|
|
|
|
v-permission="option.buttons.delete.permission"
|
|
|
|
"
|
|
|
|
class="button"
|
|
|
|
v-permission="option.buttons.delete.permission"
|
|
|
|
plain
|
|
|
|
class="button"
|
|
|
|
:disabled="disableBatchDelete"
|
|
|
|
plain
|
|
|
|
type="danger"
|
|
|
|
:disabled="disableBatchDelete"
|
|
|
|
icon="el-icon-delete"
|
|
|
|
type="danger"
|
|
|
|
@click="handleDeleteBatch()"
|
|
|
|
icon="el-icon-delete"
|
|
|
|
>删除</el-button
|
|
|
|
@click="handleDeleteBatch()"
|
|
|
|
>
|
|
|
|
>删除</el-button
|
|
|
|
<slot name="buttonRightOnTable" :selection="checkRecords" />
|
|
|
|
>
|
|
|
|
</div>
|
|
|
|
<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>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- 表格开始 -->
|
|
|
|
<!-- 表格开始 -->
|
|
|
@ -282,59 +301,108 @@
|
|
|
|
align="center"
|
|
|
|
align="center"
|
|
|
|
fixed="right"
|
|
|
|
fixed="right"
|
|
|
|
label="操作"
|
|
|
|
label="操作"
|
|
|
|
:width="
|
|
|
|
:width="option.buttons.rowButtonsWidth || 100"
|
|
|
|
option.buttons.customButton &&
|
|
|
|
|
|
|
|
option.buttons.customButton.operationWidth
|
|
|
|
|
|
|
|
? option.buttons.customButton.operationWidth
|
|
|
|
|
|
|
|
: 100
|
|
|
|
|
|
|
|
"
|
|
|
|
|
|
|
|
>
|
|
|
|
>
|
|
|
|
|
|
|
|
<!-- 插槽 -->
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<template slot-scope="scope">
|
|
|
|
<slot name="rowButton" :msg="scope.row" />
|
|
|
|
<template v-if="!option.rowButtons">
|
|
|
|
<el-button
|
|
|
|
<slot name="rowButton" :msg="scope.row" />
|
|
|
|
v-if="
|
|
|
|
<el-button
|
|
|
|
option.buttons.edit.isShow == undefined
|
|
|
|
v-if="
|
|
|
|
? true
|
|
|
|
option.buttons.edit.isShow == undefined
|
|
|
|
: option.buttons.edit.isShow
|
|
|
|
? true
|
|
|
|
"
|
|
|
|
: option.buttons.edit.isShow
|
|
|
|
type="text"
|
|
|
|
"
|
|
|
|
size="small"
|
|
|
|
type="text"
|
|
|
|
@click="handleOpenEditView('edit', scope.row)"
|
|
|
|
size="small"
|
|
|
|
>编辑</el-button
|
|
|
|
@click="handleOpenEditView('edit', scope.row)"
|
|
|
|
>
|
|
|
|
>编辑</el-button
|
|
|
|
<el-button
|
|
|
|
>
|
|
|
|
v-if="
|
|
|
|
<el-button
|
|
|
|
hasCustomButtonInRowMore == false &&
|
|
|
|
v-if="
|
|
|
|
option.buttons.delete.isShow == undefined
|
|
|
|
hasCustomButtonInRowMore == false &&
|
|
|
|
? true
|
|
|
|
option.buttons.delete.isShow == undefined
|
|
|
|
: option.buttons.edit.isShow
|
|
|
|
? true
|
|
|
|
"
|
|
|
|
: option.buttons.edit.isShow
|
|
|
|
type="text"
|
|
|
|
"
|
|
|
|
size="small"
|
|
|
|
type="text"
|
|
|
|
@click="handleDeleteBatch(scope.row)"
|
|
|
|
size="small"
|
|
|
|
>删除</el-button
|
|
|
|
@click="handleDeleteBatch(scope.row)"
|
|
|
|
>
|
|
|
|
>删除</el-button
|
|
|
|
<el-dropdown v-if="hasCustomButtonInRowMore" trigger="click">
|
|
|
|
>
|
|
|
|
<span class="el-dropdown-link"
|
|
|
|
<el-dropdown v-if="hasCustomButtonInRowMore" trigger="click">
|
|
|
|
>更多<i class="el-icon-caret-bottom el-icon--right" />
|
|
|
|
<span class="el-dropdown-link"
|
|
|
|
</span>
|
|
|
|
>更多<i class="el-icon-caret-bottom el-icon--right" />
|
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
|
</span>
|
|
|
|
<el-dropdown-item class="clearfix">
|
|
|
|
<el-dropdown-menu slot="dropdown">
|
|
|
|
<slot name="rowButtonInMore" :msg="scope.row" />
|
|
|
|
<el-dropdown-item class="clearfix">
|
|
|
|
<el-button
|
|
|
|
<slot name="rowButtonInMore" :msg="scope.row" />
|
|
|
|
v-if="
|
|
|
|
<el-button
|
|
|
|
option.buttons.delete.isShow == undefined
|
|
|
|
v-if="
|
|
|
|
? true
|
|
|
|
option.buttons.delete.isShow == undefined
|
|
|
|
: option.buttons.edit.isShow
|
|
|
|
? true
|
|
|
|
"
|
|
|
|
: option.buttons.edit.isShow
|
|
|
|
type="text"
|
|
|
|
"
|
|
|
|
size="small"
|
|
|
|
type="text"
|
|
|
|
@click="handleDeleteBatch(scope.row)"
|
|
|
|
size="small"
|
|
|
|
>删除</el-button
|
|
|
|
@click="handleDeleteBatch(scope.row)"
|
|
|
|
>
|
|
|
|
>删除</el-button
|
|
|
|
</el-dropdown-item>
|
|
|
|
>
|
|
|
|
</el-dropdown-menu>
|
|
|
|
</el-dropdown-item>
|
|
|
|
</el-dropdown>
|
|
|
|
</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>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table>
|
|
|
|
</el-table>
|
|
|
@ -668,6 +736,21 @@ export default {
|
|
|
|
};
|
|
|
|
};
|
|
|
|
this.$emit("handleCustomValue", obj);
|
|
|
|
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) {
|
|
|
|
editDialogClosedEvent(value) {
|
|
|
|
// 把列表页中弹框打开标记改成已关闭
|
|
|
|
// 把列表页中弹框打开标记改成已关闭
|
|
|
|