From f456dff55113ce740124bb1cde7639529d9d6891 Mon Sep 17 00:00:00 2001 From: ibuler Date: Fri, 29 May 2020 20:37:23 +0800 Subject: [PATCH] =?UTF-8?q?[Update]=20=E4=BF=AE=E6=94=B9asset=20select2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- src/components/AssetSelect/index.vue | 121 ++++++++++++------ src/components/AutoDataTable/index.vue | 8 +- .../el-data-table/utils/select-strategy.js | 10 +- src/components/DataTable/index.vue | 20 ++- src/components/Dialog/index.vue | 6 +- src/components/ListTable/index.vue | 21 +-- src/i18n/langs/cn.json | 6 +- src/i18n/langs/en.json | 2 +- src/layout/components/NavHeader/ApiKey.vue | 11 +- src/styles/index.scss | 15 +++ src/utils/request.js | 26 ++-- .../TopAndLatestSummary/TopAssets.vue | 2 +- .../dashboard/TopAndLatestSummary/TopUser.vue | 2 +- .../AssetPermissionCreateUpdate.vue | 5 +- 15 files changed, 153 insertions(+), 104 deletions(-) diff --git a/.env.development b/.env.development index 9950598be..f2d3a2f75 100644 --- a/.env.development +++ b/.env.development @@ -3,7 +3,7 @@ ENV = 'development' # base api VUE_APP_BASE_API = '/rpc' -PUBLIC_PATH = '/ui' +VUE_APP_PUBLIC_PATH = '/ui/' # vue-cli uses the VUE_CLI_BABEL_TRANSPILE_MODULES environment variable, # to control whether the babel-plugin-dynamic-import-node plugin is enabled. diff --git a/src/components/AssetSelect/index.vue b/src/components/AssetSelect/index.vue index 1ef0125d1..8bddc94d3 100644 --- a/src/components/AssetSelect/index.vue +++ b/src/components/AssetSelect/index.vue @@ -1,11 +1,15 @@ - diff --git a/src/components/ListTable/index.vue b/src/components/ListTable/index.vue index fb3efb5dc..615a1b981 100644 --- a/src/components/ListTable/index.vue +++ b/src/components/ListTable/index.vue @@ -2,7 +2,7 @@
- +
@@ -46,10 +46,6 @@ export default { methods: { handleSelectionChange(val) { this.selectedRows = val - const obj = {} - val.forEach((item, index) => { obj[index] = item }) - // 已知Bug,必须避免数组扁平化 - this.dispatch('AssetSelect', 'SelectionChange', obj) }, reloadTable() { this.dataTable.getList() @@ -59,21 +55,6 @@ export default { }, toggleRowSelection(row, isSelected) { return this.dataTable.toggleRowSelection(row, isSelected) - }, - handleDataChange(val, res) { - if (!this.init && this.tableConfig.defaultSelect !== undefined) { - const obj = {} - const arr = [] - for (let i = 0, len = val.length; i < len; i++) { - if (this.tableConfig.defaultSelect.indexOf(val[i].id) > -1) { - this.toggleRowSelection(val[i], true) - arr.push(val[i]) - } - } - arr.forEach((item, index) => { obj[index] = item }) - this.dispatch('AssetSelect', 'SelectionChange', obj) - this.init = false - } } } } diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index e82173b16..5a411fe67 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -88,7 +88,7 @@ "commandFilterDetail": "命令过滤器详情", "command_filter_list": "命令过滤器列表", "CommandFilterDetail": "命令过滤器详情", - "CommandFilterRules":"命令过滤器规则", + "CommandFilterRules": "命令过滤器规则", "date_expired": "失效日期", "date_joined": "创建日期", "date_password_last_updated": "最后更新密码", @@ -167,7 +167,6 @@ "dateExpired": "失效日期", "deleteErrorMsg": "删除失败", "deleteSelected": "删除所选", - "deleteSuccessMsg": "删除成功", "deleteWarningMsg": "你确定要删除", "disableSelected": "禁用所选", "fieldRequiredError": "这个字段是必填项", @@ -234,7 +233,7 @@ "UserRatio": "用户占比统计", "UsersTotal": "用户总数", "Weekly": "按周", - "timesWeekUnit": "次/周" + "TimesWeekUnit": "次/周" }, "ops": { "ID": "ID", @@ -278,6 +277,7 @@ }, "perms": { "Actions": "动作", + "actions": "动作", "Asset": "资产", "Basic": "基本", "IP": "IP", diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index 83156b995..a2d4f6dde 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -229,7 +229,7 @@ "UserRatio": "User Ratio", "UsersTotal": "Users total", "Weekly": "Weekly", - "timesWeekUnit": "times/week" + "TimesWeekUnit": "times/week" }, "ops": { "ID": "ID", diff --git a/src/layout/components/NavHeader/ApiKey.vue b/src/layout/components/NavHeader/ApiKey.vue index b3e8df46d..5592c01bd 100644 --- a/src/layout/components/NavHeader/ApiKey.vue +++ b/src/layout/components/NavHeader/ApiKey.vue @@ -1,6 +1,6 @@