Skip to content

Commit

Permalink
Merge pull request #1313 from TencentBlueKing/develop
Browse files Browse the repository at this point in the history
merge develop to master
  • Loading branch information
ielgnaw authored Jul 8, 2024
2 parents c70e847 + a74551a commit 73bdf14
Show file tree
Hide file tree
Showing 744 changed files with 13,976 additions and 6,057 deletions.
2 changes: 1 addition & 1 deletion lib/client/preview.html
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>运维开发平台 | 腾讯蓝鲸智云</title>
<style>
html, body, #app {
html, body, #preview-app, #app {
height: 100%;
}
html::-webkit-scrollbar {
Expand Down
3 changes: 0 additions & 3 deletions lib/client/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,6 @@
if (platform.indexOf('win') === 0) {
this.systemCls = 'win'
}
bus.$on('redirect-login', data => {
window.location.replace(data.loginUrl)
})
},
methods: {
permissionHold (authResult) {
Expand Down
14 changes: 11 additions & 3 deletions lib/client/src/api/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ import RequestQueue from './request-queue'
import { bus } from '../common/bus'
import { bkMessage } from 'bk-magic-vue'

import { showLoginModal } from '@blueking/login-modal'

// 解析错误
axios.interceptors.response.use(
// 后端 API 响应成功(http status 200)
Expand Down Expand Up @@ -68,13 +70,19 @@ axios.interceptors.response.use(undefined, error => {
switch (code) {
// 用户登录状态失效
case 401:
bus.$emit('redirect-login', response.data.data || {})
const successUrl = `${window.location.origin}/static/login_success.html`

const loginBaseUrl = new URL(process.env.BK_LOGIN_URL + '/')

const loginUrl = `${loginBaseUrl}plain/?c_url=${encodeURIComponent(successUrl)}`

showLoginModal({ loginUrl })
}
// 全局捕获错误给出提示
if (response) {
const { config } = response
if (config.globalError) {
bkMessage({ theme: 'error', message, ellipsisLine: 3 })
bkMessage({ theme: 'error', message, ellipsisLine: 3, limit: 1 })
}
}
return Promise.reject(error)
Expand Down Expand Up @@ -133,7 +141,7 @@ allMethods.forEach(method => {
Object.defineProperty(http, method, {
get () {
return (url, payload, config = {}) => {
const execResult = /\/project\/([^\/]+)/.exec(location.href) || []
const execResult = /\/project\/([^(\/|\?)]+)/.exec(location.href) || []
const axiosConfig = {
baseURL: `${process.env.BK_AJAX_URL_PREFIX}`,
url,
Expand Down
2 changes: 1 addition & 1 deletion lib/client/src/api/pureAxios.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ function handleReject (error, config) {
* @return {Promise} 本次 http 请求的 Promise
*/
function initConfig (method, url, userConfig) {
const execResult = /\/project\/([^\/]+)/.exec(location.href) || []
const execResult = /\/project\/([^(\/|\?)]+)/.exec(location.href) || []
const defaultConfig = {
...getCancelToken(),
// http 请求默认 id
Expand Down
4,233 changes: 4,233 additions & 0 deletions lib/client/src/bk-icon/demo.html

Large diffs are not rendered by default.

Binary file modified lib/client/src/bk-icon/fonts/iconcool.eot
Binary file not shown.
36 changes: 36 additions & 0 deletions lib/client/src/bk-icon/fonts/iconcool.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lib/client/src/bk-icon/fonts/iconcool.ttf
Binary file not shown.
Binary file modified lib/client/src/bk-icon/fonts/iconcool.woff
Binary file not shown.
2 changes: 1 addition & 1 deletion lib/client/src/bk-icon/iconcool.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion lib/client/src/bk-icon/iconcool.json

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions lib/client/src/bk-icon/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -467,12 +467,21 @@ url("fonts/iconcool.eot?#iefix") format("embedded-opentype");
.bk-drag-router:before {
content: "\e187";
}
.bk-drag-sync-failed:before {
content: "\e29c";
}
.bk-drag-sync-pending:before {
content: "\e297";
}
.bk-drag-sync-success:before {
content: "\e29d";
}
.bk-drag-paste:before {
content: "\e248";
}
.bk-drag-sync-default:before {
content: "\e29e";
}
.bk-drag-un-full-screen-2:before {
content: "\e21c";
}
Expand Down Expand Up @@ -527,6 +536,15 @@ url("fonts/iconcool.eot?#iefix") format("embedded-opentype");
.bk-drag-freedrag:before {
content: "\e199";
}
.bk-drag-abnormal:before {
content: "\e299";
}
.bk-drag-normal:before {
content: "\e29a";
}
.bk-drag-unknown:before {
content: "\e29b";
}
.bk-drag-copy-line:before {
content: "\e1a9";
}
Expand Down Expand Up @@ -605,6 +623,9 @@ url("fonts/iconcool.eot?#iefix") format("embedded-opentype");
.bk-drag-dianzan:before {
content: "\e28d";
}
.bk-drag-sync-waiting-01:before {
content: "\e2a0";
}
.bk-drag-select-value:before {
content: "\e1b2";
}
Expand Down Expand Up @@ -1004,6 +1025,12 @@ url("fonts/iconcool.eot?#iefix") format("embedded-opentype");
.bk-drag-refill:before {
content: "\e241";
}
.bk-drag-warning-2:before {
content: "\e29f";
}
.bk-drag-delete:before {
content: "\e2a1";
}
.bk-drag-xlsx:before {
content: "\e247";
}
Expand Down Expand Up @@ -1202,3 +1229,12 @@ url("fonts/iconcool.eot?#iefix") format("embedded-opentype");
.bk-drag-builder:before {
content: "\e298";
}
.bk-drag-tuopu:before {
content: "\e2a2";
}
.bk-drag-jiedian:before {
content: "\e2a3";
}
.bk-drag-rongqi:before {
content: "\e2a4";
}
2 changes: 0 additions & 2 deletions lib/client/src/common/fully-import.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import 'animate.css'

// import style
import 'bk-magic-vue/dist/bk-magic-vue.min.css'
import bkCharts from '@/components/patch/bkCharts'

window.SwiperAnimation = SwiperAnimation
window.swiperRegister = register
Expand All @@ -33,6 +32,5 @@ Vue.use(bkText)
Vue.use(bkImage)
Vue.use(chart)
Vue.use(bkMagicVue)
Vue.use(bkCharts)
Vue.use(widgetBkVision)
Vue.use(widgetElTable)
5 changes: 5 additions & 0 deletions lib/client/src/components/api/common/scheme.css
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@
&.close {
transform: rotate(-90deg);
}
&.disabled {
transform: rotate(-90deg);
cursor: not-allowed;
color: #DCDEE5;
}
&.icon-down-shape {
margin-right: 4px;
}
Expand Down
46 changes: 30 additions & 16 deletions lib/client/src/components/api/common/single-scheme.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import {
getDefaultApiUseScheme,
getDefaultApiEditScheme,
API_PARAM_TYPES
API_PARAM_TYPES,
API_PARAM_VALUE_TYPES
} from 'shared/api'
import './scheme.css'
import {
Expand Down Expand Up @@ -74,14 +75,16 @@ export default defineComponent({
}
const customValidateRule = {
validator (val) {
const value = copyScheme.value.valueType === 'variable' ? copyScheme.value.code : val
const value = copyScheme.value.valueType === API_PARAM_VALUE_TYPES.VARIABLE ? copyScheme.value.code : val
return customValidate(value, copyScheme.value.validate, props.variableList, props.functionList, props.apiList)
},
message: window.i18n.t('参数值不符合自定义校验'),
trigger: 'blur'
}
// 切换是否展示子节点
const toggleShowProperty = () => {
if (copyScheme.value.valueType === API_PARAM_VALUE_TYPES.VARIABLE) return

copyScheme.value.showChildren = !copyScheme.value.showChildren
triggerChange()
}
Expand Down Expand Up @@ -178,7 +181,8 @@ export default defineComponent({
API_PARAM_TYPES.BOOLEAN.VAL,
API_PARAM_TYPES.NUMBER.VAL,
API_PARAM_TYPES.STRING.VAL
].includes(this.copyScheme.type)
].includes(this.copyScheme.type),
disabled: this.copyScheme.valueType === API_PARAM_VALUE_TYPES.VARIABLE
}
]
}
Expand Down Expand Up @@ -288,16 +292,15 @@ export default defineComponent({
</bk-form-item>
</bk-form>
{
this.showRule ?
[API_PARAM_TYPES.ARRAY.VAL, API_PARAM_TYPES.OBJECT.VAL].includes(this.copyScheme.type)
? <span class="layout-middle">--</span>
: <render-validate
class="layout-middle"
scheme={this.copyScheme}
onChange={(validate) => this.update({ validate })}
/>
:
''
this.showRule
? [API_PARAM_TYPES.ARRAY.VAL, API_PARAM_TYPES.OBJECT.VAL].includes(this.copyScheme.type)
? <span class="layout-middle">--</span>
: <render-validate
class="layout-middle"
scheme={this.copyScheme}
onChange={(validate) => this.update({ validate })}
/>
: ''
}
<bk-input
class="layout-middle"
Expand All @@ -317,7 +320,7 @@ export default defineComponent({
[
API_PARAM_TYPES.OBJECT.VAL,
API_PARAM_TYPES.ARRAY.VAL
].includes(this.copyScheme.type) && this.disablePlusBrother
].includes(this.copyScheme.type) && this.disablePlusBrother && this.copyScheme.valueType !== API_PARAM_VALUE_TYPES.VARIABLE
? <i
class="bk-drag-icon bk-drag-add-fill layout-icon"
onClick={this.plusChildProperty}
Expand All @@ -340,7 +343,18 @@ export default defineComponent({
[
API_PARAM_TYPES.OBJECT.VAL,
API_PARAM_TYPES.ARRAY.VAL
].includes(this.copyScheme.type) && !this.disablePlusBrother
].includes(this.copyScheme.type) && !this.disablePlusBrother && this.copyScheme.valueType === API_PARAM_VALUE_TYPES.VARIABLE
? <i
class="bk-drag-icon bk-drag-add-fill layout-icon"
onClick={this.handlePlusBrotherProperty}
></i>
: ''
}
{
[
API_PARAM_TYPES.OBJECT.VAL,
API_PARAM_TYPES.ARRAY.VAL
].includes(this.copyScheme.type) && !this.disablePlusBrother && this.copyScheme.valueType !== API_PARAM_VALUE_TYPES.VARIABLE
? <i
class="bk-drag-icon bk-drag-add-fill layout-icon"
></i>
Expand All @@ -362,7 +376,7 @@ export default defineComponent({
[
API_PARAM_TYPES.OBJECT.VAL,
API_PARAM_TYPES.ARRAY.VAL
].includes(this.copyScheme.type)
].includes(this.copyScheme.type) && this.copyScheme.valueType !== API_PARAM_VALUE_TYPES.VARIABLE
? <bk-button
class="property-icon"
text
Expand Down
7 changes: 7 additions & 0 deletions lib/client/src/components/api/common/validate.vue
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,13 @@
line-height: 16px;
padding: 0 8px;
}
/deep/ .bk-checkbox {
line-height: 16px;
&:after {
top: 2px;
left: 5px;
}
}
}
.plus-rule {
cursor: pointer;
Expand Down
Loading

0 comments on commit 73bdf14

Please sign in to comment.