更新anji-crud组件

qianlishi 3 years ago
parent 8bea4e8a59
commit 7574eea59b

@ -147,6 +147,7 @@
</el-form> </el-form>
<!-- 查询表单结束 --> <!-- 查询表单结束 -->
<!-- 批量操作 --> <!-- 批量操作 -->
<template v-if="!option.tableButtons">
<div style="padding-bottom: 8px"> <div style="padding-bottom: 8px">
<slot name="buttonLeftOnTable" :selection="checkRecords" /> <slot name="buttonLeftOnTable" :selection="checkRecords" />
<el-button <el-button
@ -179,6 +180,24 @@
> >
<slot name="buttonRightOnTable" :selection="checkRecords" /> <slot name="buttonRightOnTable" :selection="checkRecords" />
</div> </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,14 +301,11 @@
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">
<template v-if="!option.rowButtons">
<slot name="rowButton" :msg="scope.row" /> <slot name="rowButton" :msg="scope.row" />
<el-button <el-button
v-if=" v-if="
@ -336,6 +352,58 @@
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</template> </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-column>
</el-table> </el-table>
<div class="page_bottom"> <div class="page_bottom">
@ -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) {
// //

@ -272,6 +272,7 @@ export default {
return { top: top, left: left } return { top: top, left: left }
}, },
objToOne (obj) { objToOne (obj) {
console.log(obj)
let tmpData = {} let tmpData = {}
for (let index in obj) { for (let index in obj) {
if (typeof obj[index] == 'object' && !this.isArrayFn(obj[index])) { if (typeof obj[index] == 'object' && !this.isArrayFn(obj[index])) {

@ -4,7 +4,7 @@
* @Author: qianlishi * @Author: qianlishi
* @Date: 2021-12-11 14:48:27 * @Date: 2021-12-11 14:48:27
* @LastEditors: qianlishi * @LastEditors: qianlishi
* @LastEditTime: 2021-12-13 12:20:56 * @LastEditTime: 2022-03-09 09:22:40
--> -->
<template> <template>
<anji-crud ref="listPage" :option="crudOption" /> <anji-crud ref="listPage" :option="crudOption" />
@ -67,6 +67,46 @@ export default {
field: "actionName" field: "actionName"
} }
], ],
//
tableButtons: [
{
label: "新增",
type: "", // primarysuccessinfowarningdanger
permission: "authorityManage:insert", //
icon: "el-icon-plus",
plain: true,
click: () => {
return this.$refs.listPage.handleOpenEditView("add");
}
},
{
label: "删除",
type: "danger",
permission: "authorityManage:delete",
icon: "el-icon-delete",
plain: false,
click: () => {
return this.$refs.listPage.handleDeleteBatch();
}
}
],
//
rowButtons: [
{
label: "编辑",
permission: "authorityManage:update",
click: row => {
return this.$refs.listPage.handleOpenEditView("edit", row);
}
},
{
label: "删除",
permission: "authorityManage:delete",
click: row => {
return this.$refs.listPage.handleDeleteBatch(row);
}
}
],
// //
buttons: { buttons: {
query: { query: {
@ -89,9 +129,7 @@ export default {
api: accessAuthorityUpdate, api: accessAuthorityUpdate,
permission: "authorityManage:update" permission: "authorityManage:update"
}, },
customButton: { rowButtonsWidth: 150 // row
operationWidth: "150px"
}
}, },
// //
columns: [ columns: [

@ -4,19 +4,10 @@
* @Author: qianlishi * @Author: qianlishi
* @Date: 2021-12-11 14:48:27 * @Date: 2021-12-11 14:48:27
* @LastEditors: qianlishi * @LastEditors: qianlishi
* @LastEditTime: 2021-12-13 12:20:46 * @LastEditTime: 2022-03-09 09:40:01
--> -->
<template> <template>
<anji-crud ref="listPage" :option="crudOption"> <anji-crud ref="listPage" :option="crudOption">
<template slot="rowButtonInMore" slot-scope="props">
<el-button
type="text"
@click="handleOpenDialogSetAuthorityForRole(props)"
v-permission="'roleManage:grantAuthority'"
>分配权限</el-button
>
</template>
<!--自定义的卡片插槽将在编辑详情页面出现在底部新卡片-->
<template v-slot:pageSection> <template v-slot:pageSection>
<RoleAuthority <RoleAuthority
:role-code="roleCode" :role-code="roleCode"
@ -52,6 +43,51 @@ export default {
title: "角色管理", title: "角色管理",
// //
labelWidth: "160px", labelWidth: "160px",
//
tableButtons: [
{
label: "新增",
type: "", // primarysuccessinfowarningdanger
permission: "roleManage:insert", //
icon: "el-icon-plus",
plain: true,
click: () => {
return this.$refs.listPage.handleOpenEditView("add");
}
},
{
label: "删除",
type: "danger",
permission: "roleManage:delete",
icon: "el-icon-delete",
plain: false,
click: () => {
return this.$refs.listPage.handleDeleteBatch();
}
}
],
//
rowButtons: [
{
label: "编辑",
permission: "roleManage:update",
click: row => {
return this.$refs.listPage.handleOpenEditView("edit", row);
}
},
{
label: "分配权限",
permission: "roleManage:grantAuthority",
click: this.handleOpenDialogSetAuthorityForRole
},
{
label: "删除",
permission: "roleManage:delete",
click: row => {
return this.$refs.listPage.handleDeleteBatch(row);
}
}
],
// //
queryFormFields: [ queryFormFields: [
{ {
@ -95,9 +131,7 @@ export default {
api: accessRoleUpdate, api: accessRoleUpdate,
permission: "roleManage:update" permission: "roleManage:update"
}, },
customButton: { rowButtonsWidth: 140 // row
operationWidth: "160px"
}
}, },
// //
columns: [ columns: [
@ -200,7 +234,7 @@ export default {
}, },
methods: { methods: {
handleOpenDialogSetAuthorityForRole(props) { handleOpenDialogSetAuthorityForRole(props) {
this.roleCode = props.msg.roleCode; this.roleCode = props.roleCode;
this.dialogVisibleSetAuthorityForRole = true; this.dialogVisibleSetAuthorityForRole = true;
} }
} }

@ -4,18 +4,10 @@
* @Author: qianlishi * @Author: qianlishi
* @Date: 2021-12-11 14:48:27 * @Date: 2021-12-11 14:48:27
* @LastEditors: qianlishi * @LastEditors: qianlishi
* @LastEditTime: 2021-12-13 12:20:35 * @LastEditTime: 2022-03-09 09:40:56
--> -->
<template> <template>
<anji-crud ref="listPage" :option="crudOption"> <anji-crud ref="listPage" :option="crudOption">
<template slot="rowButtonInMore" slot-scope="props">
<el-button
type="text"
@click="handleOpenDialogSetRoleForUser(props)"
v-permission="'userManage:grantRole'"
>分配角色</el-button
>
</template>
<template v-slot:pageSection> <template v-slot:pageSection>
<UserRole <UserRole
:login-name="loginName" :login-name="loginName"
@ -77,6 +69,51 @@ export default {
field: "phone" field: "phone"
} }
], ],
//
tableButtons: [
{
label: "新增",
type: "roleManage:insert", // primarysuccessinfowarningdanger
permission: "userManage:insert", //
icon: "el-icon-plus",
plain: true,
click: () => {
return this.$refs.listPage.handleOpenEditView("add");
}
},
{
label: "删除",
type: "danger",
permission: "userManage:delete",
icon: "el-icon-delete",
plain: false,
click: () => {
return this.$refs.listPage.handleDeleteBatch();
}
}
],
//
rowButtons: [
{
label: "编辑",
permission: "userManage:update",
click: row => {
return this.$refs.listPage.handleOpenEditView("edit", row);
}
},
{
label: "分配权限",
permission: "userManage:grantRole",
click: this.handleOpenDialogSetRoleForUser
},
{
label: "删除",
permission: "userManage:delete",
click: row => {
return this.$refs.listPage.handleDeleteBatch(row);
}
}
],
// //
buttons: { buttons: {
query: { query: {
@ -99,9 +136,7 @@ export default {
api: accessUserUpdate, api: accessUserUpdate,
permission: "userManage:update" permission: "userManage:update"
}, },
customButton: { rowButtonsWidth: 150 // row
operationWidth: "150px"
}
}, },
// //
columns: [ columns: [
@ -261,7 +296,7 @@ export default {
}, },
methods: { methods: {
handleOpenDialogSetRoleForUser(props) { handleOpenDialogSetRoleForUser(props) {
this.loginName = props.msg.loginName; this.loginName = props.loginName;
this.dialogVisibleSetRoleForUser = true; this.dialogVisibleSetRoleForUser = true;
} }
} }

@ -17,7 +17,7 @@
@focus="handleFocus" @focus="handleFocus"
@blur="handleBlur" @blur="handleBlur"
> >
<component :is="type" :value="value"/> <component :is="type" :value="value" />
</avue-draggable> </avue-draggable>
</template> </template>
@ -95,8 +95,7 @@ export default {
bigscreen: Object, bigscreen: Object,
value: { value: {
type: [Object], type: [Object],
default: () => { default: () => {}
}
}, },
step: Number step: Number
}, },
@ -126,13 +125,11 @@ export default {
return this.value.position.zIndex || 1; return this.value.position.zIndex || 1;
} }
}, },
mounted() { mounted() {},
},
methods: { methods: {
handleFocus({index, left, top, width, height}) { handleFocus({ index, left, top, width, height }) {},
}, handleBlur({ index, left, top, width, height }) {
handleBlur({index, left, top, width, height}) { this.$emit("onActivated", { index, left, top, width, height });
this.$emit("onActivated", {index, left, top, width, height});
this.$refs.draggable.setActive(true); this.$refs.draggable.setActive(true);
} }
} }

@ -4,28 +4,10 @@
* @Author: qianlishi * @Author: qianlishi
* @Date: 2021-12-11 14:48:27 * @Date: 2021-12-11 14:48:27
* @LastEditors: qianlishi * @LastEditors: qianlishi
* @LastEditTime: 2021-12-24 14:00:47 * @LastEditTime: 2022-03-09 09:43:31
--> -->
<template> <template>
<anji-crud ref="listPage" :option="crudOption"> <anji-crud ref="listPage" :option="crudOption">
<template v-slot:buttonLeftOnTable>
<el-button
type="primary"
icon="el-icon-plus"
@click="operateDatasource('add')"
v-permission="'datasourceManage:insert'"
>新增</el-button
>
</template>
<template slot="rowButton" slot-scope="props">
<el-button
type="text"
@click="operateDatasource('edit', props)"
v-permission="'datasourceManage:update'"
>编辑</el-button
>
</template>
<template v-slot:pageSection> <template v-slot:pageSection>
<EditDataSource <EditDataSource
ref="EditDataSource" ref="EditDataSource"
@ -60,6 +42,46 @@ export default {
title: "数据源", title: "数据源",
// //
labelWidth: "120px", labelWidth: "120px",
//
tableButtons: [
{
label: "新增",
type: "", // primarysuccessinfowarningdanger
permission: "datasourceManage:insert", //
icon: "el-icon-plus",
plain: true,
click: () => {
return this.operateDatasource("add");
}
},
{
label: "删除",
type: "danger",
permission: "datasourceManage:delete",
icon: "el-icon-delete",
plain: false,
click: () => {
return this.$refs.listPage.handleDeleteBatch();
}
}
],
//
rowButtons: [
{
label: "编辑",
permission: "datasourceManage:update",
click: row => {
return this.operateDatasource("edit", row);
}
},
{
label: "删除",
permission: "datasourceManage:delete",
click: row => {
return this.$refs.listPage.handleDeleteBatch(row);
}
}
],
// //
queryFormFields: [ queryFormFields: [
{ {
@ -83,9 +105,7 @@ export default {
], ],
// //
buttons: { buttons: {
customButton: { rowButtonsWidth: 150, // row
operationWidth: 150
},
query: { query: {
api: reportDataSourceList, api: reportDataSourceList,
permission: "datasourceManage:query", permission: "datasourceManage:query",
@ -218,7 +238,7 @@ export default {
operateDatasource(type, prop) { operateDatasource(type, prop) {
this.dialogVisibleSetDataSource = true; this.dialogVisibleSetDataSource = true;
if (prop) { if (prop) {
this.dataSource = prop.msg; this.dataSource = prop;
} else { } else {
this.dataSource = {}; this.dataSource = {};
} }

@ -64,6 +64,46 @@ export default {
field: "locale" field: "locale"
} }
], ],
//
tableButtons: [
{
label: "新增",
type: "", // primarysuccessinfowarningdanger
permission: "dictItemManage:insert", //
icon: "el-icon-plus",
plain: true,
click: () => {
return this.$refs.listPage.handleOpenEditView("add");
}
},
{
label: "删除",
type: "danger",
permission: "dictItemManage:delete",
icon: "el-icon-delete",
plain: false,
click: () => {
return this.$refs.listPage.handleDeleteBatch();
}
}
],
//
rowButtons: [
{
label: "编辑",
permission: "dictItemManage:update",
click: row => {
return this.$refs.listPage.handleOpenEditView("edit", row);
}
},
{
label: "删除",
permission: "dictItemManage:delete",
click: row => {
return this.$refs.listPage.handleDeleteBatch(row);
}
}
],
// //
buttons: { buttons: {
query: { query: {
@ -86,9 +126,7 @@ export default {
api: dictItemEdit, api: dictItemEdit,
permission: "dictItemManage:update" permission: "dictItemManage:update"
}, },
customButton: { rowButtonsWidth: 150 // row
operationWidth: "150px"
}
}, },
// //
columns: [ columns: [

@ -4,7 +4,7 @@
* @Author: qianlishi * @Author: qianlishi
* @Date: 2021-12-11 14:48:27 * @Date: 2021-12-11 14:48:27
* @LastEditors: qianlishi * @LastEditors: qianlishi
* @LastEditTime: 2021-12-13 13:46:33 * @LastEditTime: 2022-03-09 10:02:26
--> -->
<template> <template>
<anji-crud ref="listPage" :option="crudOption"> <anji-crud ref="listPage" :option="crudOption">
@ -75,6 +75,64 @@ export default {
that.$store.commit("user/SET_PROJECT", queryForm["project"]); that.$store.commit("user/SET_PROJECT", queryForm["project"]);
} }
}, },
//
tableButtons: [
{
label: "刷新字典项",
type: "primary", // primarysuccessinfowarningdanger
permission: "dictManage:fresh", //
icon: "el-icon-edit",
plain: true,
click: this.dictRefresh
},
{
label: "新增",
type: "", // primarysuccessinfowarningdanger
permission: "dictManage:insert", //
icon: "el-icon-plus",
plain: true,
click: () => {
return this.$refs.listPage.handleOpenEditView("add");
}
},
{
label: "删除",
type: "danger",
permission: "dictManage:delete",
icon: "el-icon-delete",
plain: false,
click: () => {
return this.$refs.listPage.handleDeleteBatch();
}
}
],
//
rowButtons: [
{
label: "编辑",
permission: "dictManage:update",
click: row => {
return this.$refs.listPage.handleOpenEditView("edit", row);
}
},
{
label: "编辑字典项",
permission: "dictItemManage:query",
click: this.editItem
},
{
label: "刷新字典项",
permission: "dictManage:fresh",
click: this.itemRefresh
},
{
label: "删除",
permission: "dictManage:delete",
click: row => {
return this.$refs.listPage.handleDeleteBatch(row);
}
}
],
// //
buttons: { buttons: {
query: { query: {
@ -97,10 +155,7 @@ export default {
api: dictEdit, api: dictEdit,
permission: "dictManage:update" permission: "dictManage:update"
}, },
// rowButtonsWidth: 150 // row
customButton: {
operationWidth: 160 // row
}
}, },
// //
columns: [ columns: [
@ -200,7 +255,7 @@ export default {
}, },
// //
async itemRefresh(val) { async itemRefresh(val) {
const selectedList = val.msg; const selectedList = val;
let dictCodes = []; let dictCodes = [];
if (selectedList.length > 0) { if (selectedList.length > 0) {
dictCodes = selectedList.map(item => item.dictCode); dictCodes = selectedList.map(item => item.dictCode);
@ -214,7 +269,7 @@ export default {
this.$router.push({ this.$router.push({
path: "/system/dictItem", path: "/system/dictItem",
query: { query: {
dictCode: val.msg.dictCode, dictCode: val.dictCode,
project: this.$store.state.user.project project: this.$store.state.user.project
} }
}); });

@ -4,11 +4,11 @@
* @Author: qianlishi * @Author: qianlishi
* @Date: 2021-12-11 14:48:27 * @Date: 2021-12-11 14:48:27
* @LastEditors: qianlishi * @LastEditors: qianlishi
* @LastEditTime: 2021-12-13 13:47:02 * @LastEditTime: 2022-03-09 09:57:17
--> -->
<template> <template>
<anji-crud ref="listPage" :option="crudOption"> <anji-crud ref="listPage" :option="crudOption">
<template v-slot:buttonLeftOnTable> <template v-slot:tableButtons>
<el-upload <el-upload
class="el-upload" class="el-upload"
ref="upload" ref="upload"
@ -61,6 +61,37 @@ export default {
field: "filePath" field: "filePath"
} }
], ],
//
tableButtons: [
{
label: "删除",
type: "danger",
permission: "fileManage:delete",
icon: "el-icon-delete",
plain: false,
click: () => {
return this.$refs.listPage.handleDeleteBatch();
}
}
],
//
rowButtons: [
{
label: "复制url",
click: this.copyUrlPath
},
{
label: "下载",
click: this.customButtom
},
{
label: "删除",
permission: "fileManage:delete",
click: row => {
return this.$refs.listPage.handleDeleteBatch(row);
}
}
],
// //
buttons: { buttons: {
query: { query: {
@ -87,10 +118,7 @@ export default {
permission: "fileManage:update", permission: "fileManage:update",
isShow: false isShow: false
}, },
// rowButtonsWidth: 150 // row
customButton: {
operationWidth: 160 // row
}
}, },
// //
columns: [ columns: [
@ -233,10 +261,10 @@ export default {
window.open(row.urlPath); window.open(row.urlPath);
}, },
customButtom(val) { customButtom(val) {
this.downloadFile(val.msg); this.downloadFile(val);
}, },
copyUrlPath(val) { copyUrlPath(val) {
this.copyToClip(val.msg.urlPath); this.copyToClip(val.urlPath);
this.$message({ this.$message({
message: "已将url路径复制至剪切板", message: "已将url路径复制至剪切板",
type: "success" type: "success"

@ -4,31 +4,10 @@
* @Author: qianlishi * @Author: qianlishi
* @Date: 2021-12-11 14:48:27 * @Date: 2021-12-11 14:48:27
* @LastEditors: qianlishi * @LastEditors: qianlishi
* @LastEditTime: 2021-12-13 12:20:46 * @LastEditTime: 2022-03-09 09:54:15
--> -->
<template> <template>
<anji-crud ref="listPage" :option="crudOption"> <anji-crud ref="listPage" :option="crudOption">
<template slot="rowButtonInMore" slot-scope="props">
<el-button
type="text"
@click="preview(props.msg)"
v-permission="'bigScreenManage:view'"
>预览</el-button
>
<el-button
type="text"
@click="design(props.msg)"
v-permission="'bigScreenManage:design'"
>设计</el-button
>
<el-button
type="text"
@click="shareReport(props.msg)"
v-permission="'bigScreenManage:share'"
>分享</el-button
>
</template>
<template v-slot:pageSection> <template v-slot:pageSection>
<Share <Share
:visib="visibleForShareDialog" :visib="visibleForShareDialog"
@ -92,6 +71,61 @@ export default {
field: "reportAuthor" field: "reportAuthor"
} }
], ],
//
tableButtons: [
{
label: "新增",
type: "", // primarysuccessinfowarningdanger
permission: "reportManage:insert", //
icon: "el-icon-plus",
plain: true,
click: () => {
return this.$refs.listPage.handleOpenEditView("add");
}
},
{
label: "删除",
type: "danger",
permission: "reportManage:delete",
icon: "el-icon-delete",
plain: false,
click: () => {
return this.$refs.listPage.handleDeleteBatch();
}
}
],
//
rowButtons: [
{
label: "编辑",
permission: "reportManage:update",
click: row => {
return this.$refs.listPage.handleOpenEditView("edit", row);
}
},
{
label: "预览",
permission: "bigScreenManage:view",
click: this.preview
},
{
label: "设计",
permission: "bigScreenManage:design",
click: this.design
},
{
label: "分享",
permission: "bigScreenManage:share",
click: this.shareReport
},
{
label: "删除",
permission: "reportManage:delete",
click: row => {
return this.$refs.listPage.handleDeleteBatch(row);
}
}
],
// //
buttons: { buttons: {
query: { query: {
@ -116,9 +150,7 @@ export default {
api: reportUpdate, api: reportUpdate,
permission: "reportManage:update" permission: "reportManage:update"
}, },
customButton: { rowButtonsWidth: 150 // row
operationWidth: "150px"
}
}, },
// //
columns: [ columns: [

@ -4,11 +4,11 @@
* @Author: qianlishi * @Author: qianlishi
* @Date: 2021-12-11 14:48:27 * @Date: 2021-12-11 14:48:27
* @LastEditors: qianlishi * @LastEditors: qianlishi
* @LastEditTime: 2021-12-24 14:01:19 * @LastEditTime: 2022-03-09 09:49:23
--> -->
<template> <template>
<anji-crud ref="listPage" :option="crudOption"> <anji-crud ref="listPage" :option="crudOption">
<template v-slot:buttonLeftOnTable> <template v-slot:tableButtons>
<el-dropdown placement="bottom" @command="operateDataset"> <el-dropdown placement="bottom" @command="operateDataset">
<el-button type="primary" icon="el-icon-plus"> <el-button type="primary" icon="el-icon-plus">
新增 新增
@ -21,23 +21,6 @@
</el-dropdown> </el-dropdown>
</template> </template>
<template slot="rowButton" slot-scope="props">
<el-button
type="text"
@click="operateDataset('edit', props)"
v-permission="'resultsetManage:update'"
>编辑
</el-button>
</template>
<template slot="rowButtonInMore" slot-scope="props">
<el-button
type="text"
@click="dataView(props)"
v-permission="'resultsetManage:query'"
>数据预览
</el-button>
</template>
<template v-slot:pageSection> <template v-slot:pageSection>
<EditDataSet <EditDataSet
ref="EditDataSet" ref="EditDataSet"
@ -113,11 +96,44 @@ export default {
field: "setType" field: "setType"
} }
], ],
//
tableButtons: [
{
label: "删除",
type: "danger",
permission: "resultsetManage:delete",
icon: "el-icon-delete",
plain: false,
click: () => {
return this.$refs.listPage.handleDeleteBatch();
}
}
],
//
rowButtons: [
{
label: "编辑",
permission: "resultsetManage:update",
click: row => {
return this.operateDataset("edit", row);
}
},
{
label: "数据预览",
permission: "resultsetManage:query",
click: this.dataView
},
{
label: "删除",
permission: "resultsetManage:delete",
click: row => {
return this.$refs.listPage.handleDeleteBatch(row);
}
}
],
// //
buttons: { buttons: {
customButton: { rowButtonsWidth: 180, // row
operationWidth: 180
},
query: { query: {
api: reportDataSetList, api: reportDataSetList,
permission: "resultsetManage:query", permission: "resultsetManage:query",
@ -275,9 +291,9 @@ export default {
methods: { methods: {
operateDataset(type, prop) { operateDataset(type, prop) {
this.dialogVisibleSetDataSet = true; this.dialogVisibleSetDataSet = true;
if (prop && prop.msg) { if (prop && prop) {
this.dataSet = prop.msg; this.dataSet = prop;
type = prop.msg.setType; type = prop.setType;
} else { } else {
this.dataSet = {}; this.dataSet = {};
} }
@ -289,8 +305,8 @@ export default {
dataView(prop) { dataView(prop) {
this.dialogCaseResult = true; this.dialogCaseResult = true;
this.$refs.DataView.dataViewPreview( this.$refs.DataView.dataViewPreview(
prop.msg.setName, prop.setName,
JSON.parse(prop.msg.caseResult) JSON.parse(prop.caseResult)
); );
} }
} }

Loading…
Cancel
Save