|
@@ -59,7 +59,14 @@
|
|
|
ref="mychild"
|
|
|
/>
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
- <el-col :span="1.5">
|
|
|
+ <!-- 按钮行 start -->
|
|
|
+ <btn-menu-list
|
|
|
+ @topBtnHandler="topBtnHandler"
|
|
|
+ :topBtnArr="topBtnArr"
|
|
|
+ :selection="selection"
|
|
|
+ ></btn-menu-list>
|
|
|
+ <!-- 按钮行 end -->
|
|
|
+ <!-- <el-col :span="1.5">
|
|
|
<el-button
|
|
|
type="primary"
|
|
|
plain
|
|
@@ -109,7 +116,7 @@
|
|
|
@click="handleExport"
|
|
|
>导出
|
|
|
</el-button>
|
|
|
- </el-col>
|
|
|
+ </el-col> -->
|
|
|
<right-toolbar
|
|
|
:showCount.sync="showCount"
|
|
|
:showSearch.sync="showSearch"
|
|
@@ -334,7 +341,8 @@ import { getToken } from "@/utils/auth";
|
|
|
import Queryfrom from "@/views/tablelist/commonTable/queryfrom.vue";
|
|
|
import { camelCase, toUnderline } from "@/utils";
|
|
|
import { inputDisableComplete } from "@/utils/other";
|
|
|
-import Menu from "./BtnMenu.vue";
|
|
|
+import Menu from "@/views/tablelist/commonTable/BtnMenu.vue";
|
|
|
+import BtnMenuList from "@/views/tablelist/commonTable/BtnMenuList.vue";
|
|
|
import { checkRole } from "@/utils/permission";
|
|
|
import DialogTemplate from "@/views/dialogTemplate/components/index.vue";
|
|
|
import FormList from "@/components/FormGroup/formList.vue";
|
|
@@ -342,9 +350,12 @@ import { v4 as uuidv4 } from "uuid";
|
|
|
|
|
|
export default {
|
|
|
name: "listInfo",
|
|
|
- components: { Queryfrom, Menu, DialogTemplate, FormList },
|
|
|
+ components: { Queryfrom, Menu, DialogTemplate, FormList, BtnMenuList },
|
|
|
data() {
|
|
|
return {
|
|
|
+ // 顶部按钮数据
|
|
|
+ topBtnArr: [], //顶部按钮数据
|
|
|
+ selection: [], //选中数组
|
|
|
// 自动生成字段
|
|
|
theAutoField: [
|
|
|
"id",
|
|
@@ -537,7 +548,12 @@ export default {
|
|
|
return item;
|
|
|
});
|
|
|
// 获取操作列的按钮数据
|
|
|
- this.excuteBtnArr = res.data.resultMap.button;
|
|
|
+ this.excuteBtnArr = res.data.resultMap.button?.filter(
|
|
|
+ (item) => item.btnGroupType == "right"
|
|
|
+ );
|
|
|
+ this.topBtnArr = res.data.resultMap.button?.filter(
|
|
|
+ (item) => item.btnGroupType == "top"
|
|
|
+ );
|
|
|
this.calcuteExcuteCol();
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs.tableRef.doLayout();
|
|
@@ -676,6 +692,7 @@ export default {
|
|
|
)
|
|
|
]
|
|
|
);
|
|
|
+ this.selection = selection;
|
|
|
this.single = selection.length != 1;
|
|
|
this.multiple = !selection.length;
|
|
|
},
|
|
@@ -1940,6 +1957,56 @@ export default {
|
|
|
break;
|
|
|
}
|
|
|
},
|
|
|
+ // 顶部按钮回调
|
|
|
+ topBtnHandler(btnData) {
|
|
|
+ console.log(btnData);
|
|
|
+ let { btnType, btnParams, btnFormType } = btnData;
|
|
|
+ let row = this.selection[0] || [];
|
|
|
+ this.currentBtnData = btnData;
|
|
|
+ this.currentRow = JSON.parse(JSON.stringify(row));
|
|
|
+ // 无表单
|
|
|
+ if (
|
|
|
+ btnFormType == "noNeed" &&
|
|
|
+ btnType != "IMPORT" &&
|
|
|
+ btnType != "EXPORT" &&
|
|
|
+ btnType != "DELETE"
|
|
|
+ ) {
|
|
|
+ this.noNeedHandler(btnData, row);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ switch (btnType) {
|
|
|
+ case "INNERLINK":
|
|
|
+ this.routerHandler(btnData, btnType);
|
|
|
+ break;
|
|
|
+ case "OUTLINK":
|
|
|
+ this.routerHandler(btnData, btnType);
|
|
|
+ break;
|
|
|
+ case "UPDATE":
|
|
|
+ this.handleUpdate(row, btnData);
|
|
|
+ break;
|
|
|
+ case "EXECUTE":
|
|
|
+ this.handleUpdate(row, btnData);
|
|
|
+ break;
|
|
|
+ case "INITIATED":
|
|
|
+ this.handleUpdate(row, btnData);
|
|
|
+ break;
|
|
|
+ case "DELETE":
|
|
|
+ this.handleBatchDelete();
|
|
|
+ break;
|
|
|
+ case "INSERT":
|
|
|
+ this.handleAdd();
|
|
|
+ break;
|
|
|
+ case "IMPORT":
|
|
|
+ this.upload.open = true;
|
|
|
+ break;
|
|
|
+ case "EXPORT":
|
|
|
+ this.handleExport();
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ },
|
|
|
noNeedHandler(btnData, row) {
|
|
|
this.$modal
|
|
|
.confirm("是否确认执行该操作?")
|