From 7574eea59bf15762ef569863ef7ce6540bf8b06a Mon Sep 17 00:00:00 2001
From: qianlishi <1432731663@qq.com>
Date: Wed, 9 Mar 2022 10:05:15 +0800
Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0anji-crud=E7=BB=84=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../AnjiPlus/anji-crud/anji-crud.vue | 249 ++++++++++++------
report-ui/src/mixins/common.js | 1 +
report-ui/src/views/accessAuthority/index.vue | 46 +++-
report-ui/src/views/accessRole/index.vue | 62 ++++-
report-ui/src/views/accessUser/index.vue | 61 ++++-
.../bigscreenDesigner/designer/designer.js | 0
.../designer/widget/widget.vue | 15 +-
report-ui/src/views/datasource/index.vue | 66 +++--
report-ui/src/views/dict/dict-item.vue | 44 +++-
report-ui/src/views/dict/index.vue | 69 ++++-
report-ui/src/views/fileManagement/index.vue | 44 +++-
report-ui/src/views/reportManage/index.vue | 82 ++++--
report-ui/src/views/resultset/index.vue | 70 +++--
13 files changed, 593 insertions(+), 216 deletions(-)
create mode 100644 report-ui/src/views/bigscreenDesigner/designer/designer.js
diff --git a/report-ui/src/components/AnjiPlus/anji-crud/anji-crud.vue b/report-ui/src/components/AnjiPlus/anji-crud/anji-crud.vue
index 74cdc33c..60bfe835 100644
--- a/report-ui/src/components/AnjiPlus/anji-crud/anji-crud.vue
+++ b/report-ui/src/components/AnjiPlus/anji-crud/anji-crud.vue
@@ -147,38 +147,57 @@
-
-
- 新增
- 删除
-
-
+
+
+
+ 新增
+ 删除
+
+
+
+
+
+
+ {{ handlegetLable(checkRecords, item.label) }}
+
+
@@ -282,59 +301,108 @@
align="center"
fixed="right"
label="操作"
- :width="
- option.buttons.customButton &&
- option.buttons.customButton.operationWidth
- ? option.buttons.customButton.operationWidth
- : 100
- "
+ :width="option.buttons.rowButtonsWidth || 100"
>
+
-
- 编辑
- 删除
-
- 更多
-
-
-
-
- 删除
-
-
-
+
+
+ 编辑
+ 删除
+
+ 更多
+
+
+
+
+ 删除
+
+
+
+
+
+
+ {{ handlegetLable(scope.row, item.label) }}
+
+
+ {{
+ handlegetLable(scope.row, option.rowButtons[0].label)
+ }}
+
+
+ 更多
+
+
+
+
+ {{
+ handlegetLable(scope.row, item.label)
+ }}
+
+
+
+
+
@@ -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) {
// 把列表页中弹框打开标记改成已关闭
diff --git a/report-ui/src/mixins/common.js b/report-ui/src/mixins/common.js
index 8ea3bf87..da60b501 100644
--- a/report-ui/src/mixins/common.js
+++ b/report-ui/src/mixins/common.js
@@ -272,6 +272,7 @@ export default {
return { top: top, left: left }
},
objToOne (obj) {
+ console.log(obj)
let tmpData = {}
for (let index in obj) {
if (typeof obj[index] == 'object' && !this.isArrayFn(obj[index])) {
diff --git a/report-ui/src/views/accessAuthority/index.vue b/report-ui/src/views/accessAuthority/index.vue
index 153aaa66..09aec50c 100755
--- a/report-ui/src/views/accessAuthority/index.vue
+++ b/report-ui/src/views/accessAuthority/index.vue
@@ -4,7 +4,7 @@
* @Author: qianlishi
* @Date: 2021-12-11 14:48:27
* @LastEditors: qianlishi
- * @LastEditTime: 2021-12-13 12:20:56
+ * @LastEditTime: 2022-03-09 09:22:40
-->
@@ -67,6 +67,46 @@ export default {
field: "actionName"
}
],
+ // 表头按钮
+ tableButtons: [
+ {
+ label: "新增",
+ type: "", // primary、success、info、warning、danger
+ 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: {
query: {
@@ -89,9 +129,7 @@ export default {
api: accessAuthorityUpdate,
permission: "authorityManage:update"
},
- customButton: {
- operationWidth: "150px"
- }
+ rowButtonsWidth: 150 // row自定义按钮表格宽度
},
// 表格列
columns: [
diff --git a/report-ui/src/views/accessRole/index.vue b/report-ui/src/views/accessRole/index.vue
index 3e762e23..930142a8 100755
--- a/report-ui/src/views/accessRole/index.vue
+++ b/report-ui/src/views/accessRole/index.vue
@@ -4,19 +4,10 @@
* @Author: qianlishi
* @Date: 2021-12-11 14:48:27
* @LastEditors: qianlishi
- * @LastEditTime: 2021-12-13 12:20:46
+ * @LastEditTime: 2022-03-09 09:40:01
-->
-
- 分配权限
-
-
{
+ 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: [
{
@@ -95,9 +131,7 @@ export default {
api: accessRoleUpdate,
permission: "roleManage:update"
},
- customButton: {
- operationWidth: "160px"
- }
+ rowButtonsWidth: 140 // row自定义按钮表格宽度
},
// 表格列
columns: [
@@ -200,7 +234,7 @@ export default {
},
methods: {
handleOpenDialogSetAuthorityForRole(props) {
- this.roleCode = props.msg.roleCode;
+ this.roleCode = props.roleCode;
this.dialogVisibleSetAuthorityForRole = true;
}
}
diff --git a/report-ui/src/views/accessUser/index.vue b/report-ui/src/views/accessUser/index.vue
index 9b75ab00..feae39f3 100755
--- a/report-ui/src/views/accessUser/index.vue
+++ b/report-ui/src/views/accessUser/index.vue
@@ -4,18 +4,10 @@
* @Author: qianlishi
* @Date: 2021-12-11 14:48:27
* @LastEditors: qianlishi
- * @LastEditTime: 2021-12-13 12:20:35
+ * @LastEditTime: 2022-03-09 09:40:56
-->
-
- 分配角色
-
{
+ 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: {
query: {
@@ -99,9 +136,7 @@ export default {
api: accessUserUpdate,
permission: "userManage:update"
},
- customButton: {
- operationWidth: "150px"
- }
+ rowButtonsWidth: 150 // row自定义按钮表格宽度
},
// 表格列
columns: [
@@ -261,7 +296,7 @@ export default {
},
methods: {
handleOpenDialogSetRoleForUser(props) {
- this.loginName = props.msg.loginName;
+ this.loginName = props.loginName;
this.dialogVisibleSetRoleForUser = true;
}
}
diff --git a/report-ui/src/views/bigscreenDesigner/designer/designer.js b/report-ui/src/views/bigscreenDesigner/designer/designer.js
new file mode 100644
index 00000000..e69de29b
diff --git a/report-ui/src/views/bigscreenDesigner/designer/widget/widget.vue b/report-ui/src/views/bigscreenDesigner/designer/widget/widget.vue
index a3515311..d048ea2d 100644
--- a/report-ui/src/views/bigscreenDesigner/designer/widget/widget.vue
+++ b/report-ui/src/views/bigscreenDesigner/designer/widget/widget.vue
@@ -17,7 +17,7 @@
@focus="handleFocus"
@blur="handleBlur"
>
-
+
@@ -95,8 +95,7 @@ export default {
bigscreen: Object,
value: {
type: [Object],
- default: () => {
- }
+ default: () => {}
},
step: Number
},
@@ -126,13 +125,11 @@ export default {
return this.value.position.zIndex || 1;
}
},
- mounted() {
- },
+ mounted() {},
methods: {
- handleFocus({index, left, top, width, height}) {
- },
- handleBlur({index, left, top, width, height}) {
- this.$emit("onActivated", {index, left, top, width, height});
+ handleFocus({ index, left, top, width, height }) {},
+ handleBlur({ index, left, top, width, height }) {
+ this.$emit("onActivated", { index, left, top, width, height });
this.$refs.draggable.setActive(true);
}
}
diff --git a/report-ui/src/views/datasource/index.vue b/report-ui/src/views/datasource/index.vue
index 2cab7f9a..85cdb12b 100644
--- a/report-ui/src/views/datasource/index.vue
+++ b/report-ui/src/views/datasource/index.vue
@@ -4,28 +4,10 @@
* @Author: qianlishi
* @Date: 2021-12-11 14:48:27
* @LastEditors: qianlishi
- * @LastEditTime: 2021-12-24 14:00:47
+ * @LastEditTime: 2022-03-09 09:43:31
-->
-
- 新增
-
-
-
- 编辑
-
{
+ 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: [
{
@@ -83,9 +105,7 @@ export default {
],
// 操作按钮
buttons: {
- customButton: {
- operationWidth: 150
- },
+ rowButtonsWidth: 150, // row自定义按钮表格宽度
query: {
api: reportDataSourceList,
permission: "datasourceManage:query",
@@ -218,7 +238,7 @@ export default {
operateDatasource(type, prop) {
this.dialogVisibleSetDataSource = true;
if (prop) {
- this.dataSource = prop.msg;
+ this.dataSource = prop;
} else {
this.dataSource = {};
}
diff --git a/report-ui/src/views/dict/dict-item.vue b/report-ui/src/views/dict/dict-item.vue
index 4a691f61..2c0a3093 100644
--- a/report-ui/src/views/dict/dict-item.vue
+++ b/report-ui/src/views/dict/dict-item.vue
@@ -64,6 +64,46 @@ export default {
field: "locale"
}
],
+ // 表头按钮
+ tableButtons: [
+ {
+ label: "新增",
+ type: "", // primary、success、info、warning、danger
+ 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: {
query: {
@@ -86,9 +126,7 @@ export default {
api: dictItemEdit,
permission: "dictItemManage:update"
},
- customButton: {
- operationWidth: "150px"
- }
+ rowButtonsWidth: 150 // row自定义按钮表格宽度
},
// 表格列
columns: [
diff --git a/report-ui/src/views/dict/index.vue b/report-ui/src/views/dict/index.vue
index 6639518d..918d60f8 100644
--- a/report-ui/src/views/dict/index.vue
+++ b/report-ui/src/views/dict/index.vue
@@ -4,7 +4,7 @@
* @Author: qianlishi
* @Date: 2021-12-11 14:48:27
* @LastEditors: qianlishi
- * @LastEditTime: 2021-12-13 13:46:33
+ * @LastEditTime: 2022-03-09 10:02:26
-->
@@ -75,6 +75,64 @@ export default {
that.$store.commit("user/SET_PROJECT", queryForm["project"]);
}
},
+ // 表头按钮
+ tableButtons: [
+ {
+ label: "刷新字典项",
+ type: "primary", // primary、success、info、warning、danger
+ permission: "dictManage:fresh", // 按钮权限码
+ icon: "el-icon-edit",
+ plain: true,
+ click: this.dictRefresh
+ },
+ {
+ label: "新增",
+ type: "", // primary、success、info、warning、danger
+ 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: {
query: {
@@ -97,10 +155,7 @@ export default {
api: dictEdit,
permission: "dictManage:update"
},
- // 自定义按钮
- customButton: {
- operationWidth: 160 // row自定义按钮表格宽度
- }
+ rowButtonsWidth: 150 // row自定义按钮表格宽度
},
// 表格列
columns: [
@@ -200,7 +255,7 @@ export default {
},
// 刷新某个字典
async itemRefresh(val) {
- const selectedList = val.msg;
+ const selectedList = val;
let dictCodes = [];
if (selectedList.length > 0) {
dictCodes = selectedList.map(item => item.dictCode);
@@ -214,7 +269,7 @@ export default {
this.$router.push({
path: "/system/dictItem",
query: {
- dictCode: val.msg.dictCode,
+ dictCode: val.dictCode,
project: this.$store.state.user.project
}
});
diff --git a/report-ui/src/views/fileManagement/index.vue b/report-ui/src/views/fileManagement/index.vue
index 52233476..07d7ad42 100644
--- a/report-ui/src/views/fileManagement/index.vue
+++ b/report-ui/src/views/fileManagement/index.vue
@@ -4,11 +4,11 @@
* @Author: qianlishi
* @Date: 2021-12-11 14:48:27
* @LastEditors: qianlishi
- * @LastEditTime: 2021-12-13 13:47:02
+ * @LastEditTime: 2022-03-09 09:57:17
-->
-
+
{
+ 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: {
query: {
@@ -87,10 +118,7 @@ export default {
permission: "fileManage:update",
isShow: false
},
- // 自定义按钮
- customButton: {
- operationWidth: 160 // row自定义按钮表格宽度
- }
+ rowButtonsWidth: 150 // row自定义按钮表格宽度
},
// 表格列
columns: [
@@ -233,10 +261,10 @@ export default {
window.open(row.urlPath);
},
customButtom(val) {
- this.downloadFile(val.msg);
+ this.downloadFile(val);
},
copyUrlPath(val) {
- this.copyToClip(val.msg.urlPath);
+ this.copyToClip(val.urlPath);
this.$message({
message: "已将url路径复制至剪切板!",
type: "success"
diff --git a/report-ui/src/views/reportManage/index.vue b/report-ui/src/views/reportManage/index.vue
index e94f74ad..f49d290a 100644
--- a/report-ui/src/views/reportManage/index.vue
+++ b/report-ui/src/views/reportManage/index.vue
@@ -4,31 +4,10 @@
* @Author: qianlishi
* @Date: 2021-12-11 14:48:27
* @LastEditors: qianlishi
- * @LastEditTime: 2021-12-13 12:20:46
+ * @LastEditTime: 2022-03-09 09:54:15
-->
-
- 预览
- 设计
- 分享
-
-
{
+ 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: {
query: {
@@ -116,9 +150,7 @@ export default {
api: reportUpdate,
permission: "reportManage:update"
},
- customButton: {
- operationWidth: "150px"
- }
+ rowButtonsWidth: 150 // row自定义按钮表格宽度
},
// 表格列
columns: [
diff --git a/report-ui/src/views/resultset/index.vue b/report-ui/src/views/resultset/index.vue
index a8d36aff..a4d14c11 100644
--- a/report-ui/src/views/resultset/index.vue
+++ b/report-ui/src/views/resultset/index.vue
@@ -4,11 +4,11 @@
* @Author: qianlishi
* @Date: 2021-12-11 14:48:27
* @LastEditors: qianlishi
- * @LastEditTime: 2021-12-24 14:01:19
+ * @LastEditTime: 2022-03-09 09:49:23
-->
-
+
新增
@@ -21,23 +21,6 @@
-
- 编辑
-
-
-
-
- 数据预览
-
-
{
+ 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: {
- customButton: {
- operationWidth: 180
- },
+ rowButtonsWidth: 180, // row自定义按钮表格宽度
query: {
api: reportDataSetList,
permission: "resultsetManage:query",
@@ -275,9 +291,9 @@ export default {
methods: {
operateDataset(type, prop) {
this.dialogVisibleSetDataSet = true;
- if (prop && prop.msg) {
- this.dataSet = prop.msg;
- type = prop.msg.setType;
+ if (prop && prop) {
+ this.dataSet = prop;
+ type = prop.setType;
} else {
this.dataSet = {};
}
@@ -289,8 +305,8 @@ export default {
dataView(prop) {
this.dialogCaseResult = true;
this.$refs.DataView.dataViewPreview(
- prop.msg.setName,
- JSON.parse(prop.msg.caseResult)
+ prop.setName,
+ JSON.parse(prop.caseResult)
);
}
}