From 4b3b1a723f84b27e44828f071fd22cb5848dcbc6 Mon Sep 17 00:00:00 2001 From: Orange Date: Fri, 31 Jul 2020 10:51:17 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=B7=A5=E5=8D=95=E5=8A=9F=E8=83=BD=20(#185)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [Feature] 添加申请资产工单 * feat: 添加资产申请工单功能 * update * feat: 添加申请资源工单功能 * feat: 添加申请资源工单功能 * feat: 添加申请资源工单功能 * feat: 添加申请资源工单功能 * fix(终端列表): 还原终端列表的代码 * fix: 修改申请资源工单功能 * fix: 修改申请资源工单功能 * fix: 修改申请资源工单功能 * feat: 添加请求资产权限工单 * Update cn.json * Update en.json Co-authored-by: xinwen --- src/components/DetailCard/index.vue | 12 +- src/components/RelationCard/index.vue | 1 - src/components/Select2/index.vue | 3 + src/i18n/langs/cn.json | 7 + src/i18n/langs/en.json | 7 +- src/router/tickets.js | 16 +- src/router/userPage.js | 39 +++ src/utils/common.js | 7 + src/views/sessions/TerminalList.vue | 2 - src/views/tickets/MyTicketList.vue | 2 +- .../Detail/GroupSelectFormatter.vue | 48 +++ .../RequestAssetPerm/Detail/ItemValue.vue | 29 ++ .../RequestAssetPerm/Detail/TicketDetail.vue | 306 ++++++++++++++++++ .../tickets/RequestAssetPerm/Detail/index.vue | 46 +++ .../RequestAssetPermTicketCreateUpdate.vue | 81 +++++ .../tickets/TicketDetail/TicketDetail.vue | 55 ++-- src/views/tickets/TicketDetail/index.vue | 2 +- src/views/tickets/TicketListTable.vue | 40 ++- 18 files changed, 661 insertions(+), 42 deletions(-) create mode 100644 src/views/tickets/RequestAssetPerm/Detail/GroupSelectFormatter.vue create mode 100644 src/views/tickets/RequestAssetPerm/Detail/ItemValue.vue create mode 100644 src/views/tickets/RequestAssetPerm/Detail/TicketDetail.vue create mode 100644 src/views/tickets/RequestAssetPerm/Detail/index.vue create mode 100644 src/views/tickets/RequestAssetPerm/RequestAssetPermTicketCreateUpdate.vue diff --git a/src/components/DetailCard/index.vue b/src/components/DetailCard/index.vue index 3c74c6515..ed58b7050 100644 --- a/src/components/DetailCard/index.vue +++ b/src/components/DetailCard/index.vue @@ -6,10 +6,14 @@
{{ this.$route.params.id }}
-
-
- -
+ +
+
+ +
+ +
+
diff --git a/src/components/RelationCard/index.vue b/src/components/RelationCard/index.vue index 530a57d95..8faf5fdac 100644 --- a/src/components/RelationCard/index.vue +++ b/src/components/RelationCard/index.vue @@ -37,7 +37,6 @@ import Select2 from '../Select2' import IBox from '../IBox' import { createSourceIdCache } from '@/api/common' - export default { name: 'RelationCard', components: { diff --git a/src/components/Select2/index.vue b/src/components/Select2/index.vue index 46c7adf42..c442d949e 100644 --- a/src/components/Select2/index.vue +++ b/src/components/Select2/index.vue @@ -177,6 +177,9 @@ export default { }, methods: { async loadMore(load) { + if (!this.iAjax.url) { + return + } if (!this.params.hasMore) { return } diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index 5847084d4..cfd10869f 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -148,6 +148,7 @@ }, "common": { "Action": "动作", + "RequestTickets": "请求工单", "Actions": "操作", "Activate": "激活", "Active": "激活中", @@ -218,6 +219,7 @@ "bulkDeleteErrorMsg": "批量删除失败: ", "bulkDeleteSuccessMsg": "批量删除成功", "bulkRemoveErrorMsg": "批量移除失败: ", + "NeedAssetsAndSystemUserErrMsg": "请先选择授权的系统用户和资产", "bulkRemoveSuccessMsg": "批量移除成功", "createBy": "创建者", "createErrorMsg": "创建失败", @@ -711,6 +713,11 @@ "user": "用户", "Status": "状态", "Open": "打开", + "IP": "IP", + "Hostname": "主机名", + "Asset": "资产", + "SystemUser": "系统用户", + "RequestAssetPerm": "申请资产授权", "Applicant": "申请人", "Pending": "未处理", "Approved": "已同意", diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index c1b7e4625..b6cacb439 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -148,6 +148,7 @@ "common": { "Nothing": "Nothing", "Action": "Action", + "RequestTickets": "Request tickets", "Actions": "Actions", "Activate": "Activate", "actionsTips":"Clipboard's copy and paste control only support RDP/VNC protocol.", @@ -219,6 +220,7 @@ "bulkDeleteSuccessMsg": "Bulk delete success", "bulkRemoveErrorMsg": "Bulk remove failed: ", "bulkRemoveSuccessMsg": "Bulk remove success", + "NeedAssetsAndSystemUserErrMsg": "Need assets and systemuser", "createBy": "Create by", "createErrorMsg": "Create error", "createSuccessMsg": "Create success", @@ -710,12 +712,15 @@ "user": "User", "Status": "Status", "Open": "Open", + "IP": "IP", + "Hostname": "Hostname", + "Asset": "Asset", + "SystemUser": "System user", "Applicant": "Applicant", "Pending": "Pending", "Approved": "Approved", "Rejected": "Rejected", "Closed": "Closed" - }, "tree": { "AddAssetToNode": "Add asset to node", diff --git a/src/router/tickets.js b/src/router/tickets.js index 9ce5a253c..80a14c2bf 100644 --- a/src/router/tickets.js +++ b/src/router/tickets.js @@ -4,7 +4,7 @@ export default [ path: 'tickets', name: 'TicketList', component: () => import('@/views/tickets/TicketList'), - meta: { title: i18n.t('route.Tickets'), icon: 'check-square-o' } + meta: { title: i18n.t('route.Tickets'), icon: 'check-square-o', activeMenu: '/tickets/tickets' } }, { path: 'tickets/:id', @@ -12,5 +12,19 @@ export default [ component: () => import('@/views/tickets/TicketDetail/index'), meta: { title: i18n.t('route.TicketDetail'), activeMenu: '/tickets/tickets' }, hidden: true + }, + { + path: 'tickets/request-asset-perm/create', + name: 'RequestAssetPermTicketCreateUpdate', + component: () => import('@/views/tickets/RequestAssetPerm/RequestAssetPermTicketCreateUpdate'), + meta: { title: i18n.t('route.TicketDetail'), activeMenu: '/tickets/tickets' }, + hidden: true + }, + { + path: 'tickets/request-asset-perm/:id', + name: 'AssetsTicketDetail', + component: () => import('@/views/tickets/RequestAssetPerm/Detail/index'), + meta: { title: i18n.t('route.TicketDetail'), activeMenu: '/tickets/tickets' }, + hidden: true } ] diff --git a/src/router/userPage.js b/src/router/userPage.js index 9364c32ff..e8dcaf609 100644 --- a/src/router/userPage.js +++ b/src/router/userPage.js @@ -66,6 +66,45 @@ export default [ } ] }, + { + path: '/tickets', + component: Layout, + children: [ + { + path: '', + name: 'TicketList', + component: () => import('@/views/tickets/TicketList'), + meta: { title: i18n.t('route.Tickets'), icon: 'check-square-o', activeMenu: '/tickets', permissions: [rolec.PERM_USE] } + }, + { + path: 'tickets/request-asset-perm/create', + name: 'RequestAssetPermTicketCreateUpdate', + component: () => import('@/views/tickets/RequestAssetPerm/RequestAssetPermTicketCreateUpdate'), + meta: { title: i18n.t('route.TicketDetail'), activeMenu: '/tickets', permissions: [rolec.PERM_USE] }, + hidden: true + }, + { + path: 'tickets/request-asset-perm/:id', + name: 'AssetsTicketDetail', + component: () => import('@/views/tickets/RequestAssetPerm/Detail/index'), + meta: { title: i18n.t('route.TicketDetail'), activeMenu: '/tickets', permissions: [rolec.PERM_USE] }, + hidden: true + }, + { + path: 'tickets/:id', + name: 'TicketDetail', + component: () => import('@/views/tickets/TicketDetail/index'), + meta: { title: i18n.t('route.TicketDetail'), activeMenu: '/tickets', permissions: [rolec.PERM_USE] }, + hidden: true + } + ], + meta: { + title: i18n.t('route.Tickets'), + icon: 'history', + permissions: [rolec.PERM_USE], + licenseRequired: true + } + }, { path: `external-luna`, component: Layout, diff --git a/src/utils/common.js b/src/utils/common.js index 9e3d2389b..6bfb3a2b5 100644 --- a/src/utils/common.js +++ b/src/utils/common.js @@ -136,6 +136,13 @@ export function getDaysAgo(days, now) { return new Date(now.getTime() - 3600 * 1000 * 24 * days) } +export function getDaysFuture(days, now) { + if (!now) { + now = new Date() + } + return new Date(now.getTime() + 3600 * 1000 * 24 * days) +} + export function setUrlParam(url, name, value) { const urlArray = url.split('?') if (urlArray.length === 1) { diff --git a/src/views/sessions/TerminalList.vue b/src/views/sessions/TerminalList.vue index 8c3d3fa4c..d34c6fd16 100644 --- a/src/views/sessions/TerminalList.vue +++ b/src/views/sessions/TerminalList.vue @@ -18,7 +18,6 @@ import { GenericListPage, GenericCreateUpdateForm } from '@/layout/components' import Dialog from '@/components/Dialog' import Select2 from '@/components/Select2' import { BooleanFormatter } from '@/components/ListTable/formatters' - export default { components: { GenericListPage, @@ -155,5 +154,4 @@ export default { diff --git a/src/views/tickets/MyTicketList.vue b/src/views/tickets/MyTicketList.vue index 2a092dbc8..bbfe9fbb3 100644 --- a/src/views/tickets/MyTicketList.vue +++ b/src/views/tickets/MyTicketList.vue @@ -1,5 +1,5 @@ + + diff --git a/src/views/tickets/RequestAssetPerm/Detail/ItemValue.vue b/src/views/tickets/RequestAssetPerm/Detail/ItemValue.vue new file mode 100644 index 000000000..7fafb6fb8 --- /dev/null +++ b/src/views/tickets/RequestAssetPerm/Detail/ItemValue.vue @@ -0,0 +1,29 @@ + + + diff --git a/src/views/tickets/RequestAssetPerm/Detail/TicketDetail.vue b/src/views/tickets/RequestAssetPerm/Detail/TicketDetail.vue new file mode 100644 index 000000000..a90a25b0d --- /dev/null +++ b/src/views/tickets/RequestAssetPerm/Detail/TicketDetail.vue @@ -0,0 +1,306 @@ + + + + + diff --git a/src/views/tickets/RequestAssetPerm/Detail/index.vue b/src/views/tickets/RequestAssetPerm/Detail/index.vue new file mode 100644 index 000000000..0e4191f67 --- /dev/null +++ b/src/views/tickets/RequestAssetPerm/Detail/index.vue @@ -0,0 +1,46 @@ + + + + + diff --git a/src/views/tickets/RequestAssetPerm/RequestAssetPermTicketCreateUpdate.vue b/src/views/tickets/RequestAssetPerm/RequestAssetPermTicketCreateUpdate.vue new file mode 100644 index 000000000..bf098dd54 --- /dev/null +++ b/src/views/tickets/RequestAssetPerm/RequestAssetPermTicketCreateUpdate.vue @@ -0,0 +1,81 @@ + + + + + diff --git a/src/views/tickets/TicketDetail/TicketDetail.vue b/src/views/tickets/TicketDetail/TicketDetail.vue index 6338c7a83..f60ba3847 100644 --- a/src/views/tickets/TicketDetail/TicketDetail.vue +++ b/src/views/tickets/TicketDetail/TicketDetail.vue @@ -1,32 +1,34 @@