-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
16 changed files
with
462 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
117 changes: 117 additions & 0 deletions
117
dbm-ui/frontend/src/views/ticket-cooperation-setting/Index.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
<template> | ||
<div class="ticket-cooperation-setting"> | ||
<DbCard | ||
mode="collapse" | ||
:title="t('单据协助')"> | ||
<BkForm | ||
ref="formRef" | ||
:model="formModel"> | ||
<BkFormItem :label="t('单据协助')"> | ||
<BkSwitcher | ||
v-model="isCooperationOpen" | ||
class="mr-8" | ||
theme="primary" /> | ||
{{ t('开启后,您指定的协作人将能够协助处理单据执行、继续任务等事项,同时也会收到单据通知') }} | ||
</BkFormItem> | ||
<BkFormItem | ||
v-if="isCooperationOpen" | ||
:label="t('默认协作人')" | ||
property="members" | ||
required> | ||
<MemberSelector v-model="formModel.members" /> | ||
</BkFormItem> | ||
</BkForm> | ||
</DbCard> | ||
<BkButton | ||
class="submit-btn" | ||
:loading="isUpdating" | ||
theme="primary" | ||
@click="handleSubmit"> | ||
{{ t('保存') }} | ||
</BkButton> | ||
</div> | ||
</template> | ||
|
||
<script setup lang="tsx"> | ||
import { useI18n } from 'vue-i18n'; | ||
import { useRequest } from 'vue-request'; | ||
import { getBizSettingList, updateBizSetting } from '@services/source/bizSetting'; | ||
import { useGlobalBizs } from '@stores'; | ||
import MemberSelector from '@components/db-member-selector/index.vue'; | ||
import { messageSuccess } from '@utils'; | ||
const { t } = useI18n(); | ||
const formRef = useTemplateRef('formRef'); | ||
const globalBizsStore = useGlobalBizs(); | ||
const isCooperationOpen = ref(false); | ||
const formModel = reactive({ | ||
members: [], | ||
}); | ||
// 是否开启单据协助 | ||
useRequest(getBizSettingList, { | ||
onSuccess: (data) => { | ||
isCooperationOpen.value = data.BIZ_ASSISTANCE_SWITCH; | ||
}, | ||
defaultParams: [ | ||
{ | ||
bk_biz_id: globalBizsStore.currentBizId, | ||
key: 'BIZ_ASSISTANCE_SWITCH', | ||
}, | ||
], | ||
}); | ||
// 获取默认协作人 | ||
useRequest(getBizSettingList, { | ||
onSuccess: (data) => { | ||
formModel.members = data.BIZ_ASSISTANCE_VARS || []; | ||
}, | ||
defaultParams: [ | ||
{ | ||
bk_biz_id: globalBizsStore.currentBizId, | ||
key: 'BIZ_ASSISTANCE_VARS', | ||
}, | ||
], | ||
}); | ||
const { runAsync: runUpdate, loading: isUpdating } = useRequest(updateBizSetting, { | ||
manual: true, | ||
onSuccess: () => { | ||
messageSuccess(t('保存成功')); | ||
}, | ||
}); | ||
const handleSubmit = async () => { | ||
if (isCooperationOpen.value) { | ||
await formRef.value!.validate(); | ||
} | ||
Promise.all([ | ||
runUpdate({ | ||
bk_biz_id: globalBizsStore.currentBizId, | ||
key: 'BIZ_ASSISTANCE_SWITCH', | ||
value: isCooperationOpen.value, | ||
}), | ||
runUpdate({ | ||
bk_biz_id: globalBizsStore.currentBizId, | ||
key: 'BIZ_ASSISTANCE_VARS', | ||
value: formModel.members, | ||
}), | ||
]); | ||
}; | ||
</script> | ||
|
||
<style scoped lang="less"> | ||
.ticket-cooperation-setting { | ||
.submit-btn { | ||
width: 88px; | ||
margin-top: 16px; | ||
} | ||
} | ||
</style> |
30 changes: 30 additions & 0 deletions
30
dbm-ui/frontend/src/views/ticket-cooperation-setting/routes.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* | ||
* TencentBlueKing is pleased to support the open source community by making 蓝鲸智云-DB管理系统(BlueKing-BK-DBM) available. | ||
* | ||
* Copyright (C) 2017-2023 THL A29 Limited, a Tencent company. All rights reserved. | ||
* | ||
* Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at https://opensource.org/licenses/MIT | ||
* | ||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed | ||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for | ||
* the specific language governing permissions and limitations under the License. | ||
*/ | ||
import { checkDbConsole } from '@utils'; | ||
|
||
import { t } from '@locales/index'; | ||
|
||
const routes = [ | ||
{ | ||
name: 'TicketCooperationSetting', | ||
path: 'ticket-cooperation-setting', | ||
meta: { | ||
navName: t('单据免审批设置'), | ||
}, | ||
component: () => import('@views/ticket-cooperation-setting/Index.vue'), | ||
}, | ||
]; | ||
|
||
export default function getRoutes() { | ||
return checkDbConsole('bizConfigManage.ticketCooperationSetting') ? routes : []; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters