From eda66cab417e2fa3fd736a7fd00b6ce05eac0caf Mon Sep 17 00:00:00 2001 From: feng626 <1304903146@qq.com> Date: Tue, 14 Dec 2021 22:45:13 +0800 Subject: [PATCH 1/9] =?UTF-8?q?perf:=20=E7=BF=BB=E8=AF=91=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/i18n/langs/cn.json | 3 +++ src/i18n/langs/en.json | 11 ++++++++--- src/views/tickets/TicketFlow/FlowCreateUpdate.vue | 2 +- src/views/tickets/TicketFlow/FlowRuleField.vue | 2 +- src/views/tickets/TicketList.vue | 2 +- 5 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index 5fd857906..c4406a959 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -1046,6 +1046,9 @@ "PermissionName": "授权规则名称", "Accept": "同意", "AssignedMe": "待我审批", + "FlowSetUp": "流程设置", + "ApprovalProcess": "审批流程", + "LevelApproval": "级审批", "Assignee": "处理人", "Assignees": "待处理人", "Close": "关闭", diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index 43336dce6..1dcf4072e 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -18,9 +18,9 @@ "username_group":"Username group", "hostname_group":"Hostname group", "asset_ip_group": "Asset ip group", - "system_users_name_group": "Systemusers name group", - "system_users_protocol_group": "Systemusers protocol group", - "system_users_username_group": "systemusers username group", + "system_users_name_group": "Systemuser name", + "system_users_protocol_group": "Systemuser protocol", + "system_users_username_group": "systemuser username", "apply_login_asset": "Apply login asset", "apply_login_system_user": "Apply login system user", "apply_login_user": "Apply login user", @@ -1008,6 +1008,9 @@ "PermissionName": "Permission name", "Accept": "Accept", "AssignedMe": "Assigned me", + "FlowSetUp": "Flow set up", + "ApprovalProcess": "Approval process", + "LevelApproval": "Level approval", "Assignee": "Assignee", "RequestPerm":"Request Perm", "AssignedInfo":"Assigned Info", @@ -1252,6 +1255,7 @@ "NodeAmount": "Node", "PasswordLength": "Password length", "PasswordStrategy": "Password strategy", + "SecretKeyStrategy": "Secret key strategy", "RegularlyPerform": "Regularly perform", "Result": "Result", "Retry": "Retry", @@ -1259,6 +1263,7 @@ "TaskList": "Task list", "TimeDelta": "Time delta", "Timer": "Timer", + "TimerPeriod": "Timer period", "Username": "Username" }, "Cloud": { diff --git a/src/views/tickets/TicketFlow/FlowCreateUpdate.vue b/src/views/tickets/TicketFlow/FlowCreateUpdate.vue index 6889d8347..bf1242fd0 100644 --- a/src/views/tickets/TicketFlow/FlowCreateUpdate.vue +++ b/src/views/tickets/TicketFlow/FlowCreateUpdate.vue @@ -22,7 +22,7 @@ export default { disabled: true }, rules: { - label: '审批流程', + label: this.$t('tickets.ApprovalProcess'), component: FlowRuleField, el: { level: 1 diff --git a/src/views/tickets/TicketFlow/FlowRuleField.vue b/src/views/tickets/TicketFlow/FlowRuleField.vue index 7572ed941..25f5261f0 100644 --- a/src/views/tickets/TicketFlow/FlowRuleField.vue +++ b/src/views/tickets/TicketFlow/FlowRuleField.vue @@ -4,7 +4,7 @@
- {{ i + 1 + '级审批' }} + {{ i + 1 + ' ' + vm.$t('tickets.LevelApproval') }}
{{ vm.$t('tickets.SuperAdmin') }} diff --git a/src/views/tickets/TicketList.vue b/src/views/tickets/TicketList.vue index db82bb1d4..83aa9e86e 100644 --- a/src/views/tickets/TicketList.vue +++ b/src/views/tickets/TicketList.vue @@ -46,7 +46,7 @@ export default { name: 'AssignedTicketList' }, { - title: '流程设置', + title: this.$t('tickets.FlowSetUp'), icon: 'fa-gear', name: 'TicketFlow', hidden: () => { From d36802e7bb0ac1ea0ffe78a0dbbe53a90706adee Mon Sep 17 00:00:00 2001 From: feng626 <1304903146@qq.com> Date: Wed, 15 Dec 2021 14:24:08 +0800 Subject: [PATCH 2/9] perf: ticket filter perf --- src/views/tickets/TicketListTable.vue | 31 +++++++++++++++++++++------ 1 file changed, 25 insertions(+), 6 deletions(-) diff --git a/src/views/tickets/TicketListTable.vue b/src/views/tickets/TicketListTable.vue index 0a3ee447e..65e98dfdf 100644 --- a/src/views/tickets/TicketListTable.vue +++ b/src/views/tickets/TicketListTable.vue @@ -5,6 +5,7 @@ import ListTable from '@/components/ListTable' import { DetailFormatter } from '@/components/TableFormatters' import { toSafeLocalDateStr } from '@/utils/common' +import { APPROVE, REJECT, CLOSED } from './const' export default { name: 'TicketListTable', components: { @@ -105,14 +106,32 @@ export default { hasCreate: false, hasBulkDelete: false, searchConfig: { - default: { - status: { - key: 'status', + exclude: ['state'], + options: [ + { + value: 'state', label: this.$t('tickets.action'), - value: 'open', - valueLabel: this.$t('tickets.Pending') + children: [ + { + default: true, + value: 'open', + label: this.$t('tickets.Pending') + }, + { + value: APPROVE, + label: this.$t('tickets.Approved') + }, + { + value: REJECT, + label: this.$t('tickets.Rejected') + }, + { + value: CLOSED, + label: this.$t('tickets.Closed') + } + ] } - } + ] }, createTitle: this.$t('common.RequestTickets'), hasMoreActions: false, From f416cfa435b4e6eefa41685f7ec9f19259e4e11b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9C=E6=80=80=E7=A3=8A=E2=80=9D?= <2280131253@qq.com> Date: Tue, 14 Dec 2021 11:30:42 +0800 Subject: [PATCH 3/9] =?UTF-8?q?feat:=20=E5=B0=81=E8=A3=85json=20editor?= =?UTF-8?q?=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 1 + src/components/FormFields/JsonEditor.vue | 73 ++++++++++++++++++++++++ src/components/FormFields/index.js | 7 ++- src/i18n/langs/cn.json | 1 + src/i18n/langs/en.json | 1 + src/views/settings/Auth/CAS.vue | 7 +-- src/views/settings/Auth/SAML2.vue | 13 ++--- src/views/settings/Ldap/index.vue | 7 +-- 8 files changed, 90 insertions(+), 20 deletions(-) create mode 100644 src/components/FormFields/JsonEditor.vue diff --git a/package.json b/package.json index 617ce96ed..bb5f32208 100644 --- a/package.json +++ b/package.json @@ -58,6 +58,7 @@ "vue-cookie": "^1.1.4", "vue-echarts": "^5.0.0-beta.0", "vue-i18n": "^8.15.5", + "vue-json-editor": "^1.4.3", "vue-moment": "^4.1.0", "vue-password-strength-meter": "^1.7.2", "vue-router": "3.0.6", diff --git a/src/components/FormFields/JsonEditor.vue b/src/components/FormFields/JsonEditor.vue new file mode 100644 index 000000000..c6fa8d167 --- /dev/null +++ b/src/components/FormFields/JsonEditor.vue @@ -0,0 +1,73 @@ + + + + + diff --git a/src/components/FormFields/index.js b/src/components/FormFields/index.js index d7b0744be..fa49bde31 100644 --- a/src/components/FormFields/index.js +++ b/src/components/FormFields/index.js @@ -8,6 +8,7 @@ import UploadKey from './UploadKey' import UserPassword from './UserPassword' import WeekCronSelect from './WeekCronSelect' import UpdateToken from './UpdateToken' +import JsonEditor from './JsonEditor' export default { DatetimeRangePicker, @@ -19,7 +20,8 @@ export default { UploadField, UserPassword, WeekCronSelect, - UpdateToken + UpdateToken, + JsonEditor } export { @@ -32,5 +34,6 @@ export { UploadField, UserPassword, WeekCronSelect, - UpdateToken + UpdateToken, + JsonEditor } diff --git a/src/i18n/langs/cn.json b/src/i18n/langs/cn.json index c4406a959..c4e174f46 100644 --- a/src/i18n/langs/cn.json +++ b/src/i18n/langs/cn.json @@ -445,6 +445,7 @@ "lastCannotBeDeleteMsg": "最后一项,不能被删除", "InvalidJson": "不是合法 JSON", "time_period": "时段", + "FormatError": "格式错误", "WeekCronSelect": { "Monday": "星期一", "Tuesday": "星期二", diff --git a/src/i18n/langs/en.json b/src/i18n/langs/en.json index 1dcf4072e..b50a2c49c 100644 --- a/src/i18n/langs/en.json +++ b/src/i18n/langs/en.json @@ -468,6 +468,7 @@ "failedConditions": "cron expression error" }, "Cycle": "Cycle", + "FormatError": "Format error", "WeekCronSelect": { "Monday": "Monday", "Tuesday": "Tuesday", diff --git a/src/views/settings/Auth/CAS.vue b/src/views/settings/Auth/CAS.vue index 07c4cd260..3d99d0501 100644 --- a/src/views/settings/Auth/CAS.vue +++ b/src/views/settings/Auth/CAS.vue @@ -11,6 +11,8 @@