forked from TencentBlueKing/bk-ci
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 平台管理-代码源管理 TencentBlueKing#11379
# Reviewed, transaction id: 28960
- Loading branch information
Showing
22 changed files
with
2,587 additions
and
783 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
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,24 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
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,5 @@ | ||
# Vue 3 + Vite | ||
|
||
This template should help get you started developing with Vue 3 in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more. | ||
|
||
Learn more about IDE Support for Vue in the [Vue Docs Scaling up Guide](https://vuejs.org/guide/scaling-up/tooling.html#ide-support). |
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,12 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>平台管理</title> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
<script type="module" src="/src/main.ts"></script> | ||
</body> | ||
</html> |
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,41 @@ | ||
{ | ||
"name": "devops-paltform", | ||
"private": true, | ||
"version": "0.0.0", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "vite build", | ||
"preview": "vite preview" | ||
}, | ||
"dependencies": { | ||
"bkui-vue": "1.0.3-beta.9", | ||
"vue": "^3.5.13", | ||
"vue-i18n": "^9.10.2", | ||
"vue-router": "^4.3.0", | ||
"pinia": "^2.1.7", | ||
"dayjs": "^1.11.2", | ||
"lodash": "^4.17.21" | ||
}, | ||
"devDependencies": { | ||
"@vitejs/plugin-vue": "^5.2.1", | ||
"@vitejs/plugin-vue-jsx": "^3.1.0", | ||
"@rushstack/eslint-patch": "^1.3.3", | ||
"@tsconfig/node20": "^20.1.2", | ||
"@types/jsdom": "^21.1.6", | ||
"@types/node": "^20.11.28", | ||
"@vue/eslint-config-prettier": "^8.0.0", | ||
"@vue/eslint-config-typescript": "^12.0.0", | ||
"@vue/test-utils": "^2.4.5", | ||
"@vue/tsconfig": "^0.5.1", | ||
"lodash-es": "^4.17.21", | ||
"eslint": "^8.49.0", | ||
"eslint-plugin-vue": "^9.17.0", | ||
"eslint-plugin-cypress": "^2.15.1", | ||
"typescript": "~5.4.0", | ||
"jsdom": "^24.0.0", | ||
"vite-plugin-vue-devtools": "^7.0.18", | ||
"vite": "^6.0.5", | ||
"start-server-and-test": "^2.0.3" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,24 @@ | ||
import { ConfigProvider } from 'bkui-vue'; | ||
import { computed, defineComponent } from 'vue'; | ||
import { RouterView } from 'vue-router'; | ||
import { useI18n } from 'vue-i18n'; | ||
import { EN_LOCALE } from './i18n'; | ||
import enLang from 'bkui-vue/dist/locale/en.esm'; | ||
import zhLang from 'bkui-vue/dist/locale/zh-cn.esm'; | ||
|
||
export default defineComponent({ | ||
name: 'App', | ||
setup() { | ||
const { locale } = useI18n(); | ||
const lang = computed(() => { | ||
if (locale.value === EN_LOCALE) { | ||
return enLang; | ||
} | ||
return zhLang; | ||
}); | ||
return () => ( | ||
<div>123</div> | ||
); | ||
}, | ||
}); | ||
|
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,61 @@ | ||
import dayjs from 'dayjs'; | ||
|
||
// 获取 cookie | ||
export function getCookie(name: string): string { | ||
try { | ||
const decodedCookie = decodeURIComponent(document.cookie); | ||
const cookies = decodedCookie.split(';'); | ||
for (const cookie of cookies) { | ||
const [key, value] = cookie.trim().split('='); | ||
if (key === name) { | ||
return value; | ||
} | ||
} | ||
return ''; | ||
} catch (e) { | ||
console.error('get cookie error', e); | ||
return ''; | ||
} | ||
} | ||
|
||
/** | ||
* 检查是不是 object 类型 | ||
* @param item | ||
* @returns {boolean} | ||
*/ | ||
export function isObject(item: any) { | ||
return Object.prototype.toString.apply(item) === '[object Object]'; | ||
} | ||
|
||
|
||
/** | ||
* 深度合并多个对象 | ||
* @param objectArray 待合并列表 | ||
* @returns {object} 合并后的对象 | ||
*/ | ||
export function deepMerge(...objectArray: object[]) { | ||
return objectArray.reduce((acc, obj) => { | ||
Object.keys(obj || {}).forEach((key) => { | ||
const pVal = acc[key]; | ||
const oVal = obj[key]; | ||
|
||
if (isObject(pVal) && isObject(oVal)) { | ||
acc[key] = deepMerge(pVal, oVal); | ||
} else { | ||
acc[key] = oVal; | ||
} | ||
}); | ||
|
||
return acc; | ||
}, {}); | ||
} | ||
|
||
/** | ||
* 时间格式化 | ||
* @param val 待格式化时间 | ||
* @param format 格式 | ||
* @returns 格式化后的时间 | ||
*/ | ||
export function timeFormatter(val: string, format = 'YYYY-MM-DD HH:mm:ss') { | ||
return val ? dayjs(val).format(format) : '--'; | ||
} |
Empty file.
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,2 @@ | ||
@import url(./main.css); | ||
@import url(./reset.css); |
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,15 @@ | ||
.app { | ||
font-family: Avenir, Helvetica, Arial, sans-serif; | ||
-webkit-font-smoothing: antialiased; | ||
-moz-osx-font-smoothing: grayscale; | ||
text-align: center; | ||
background: #f5f7fb; | ||
color: #63656e; | ||
font-size: 12px; | ||
text-align: left; | ||
width: 100vw; | ||
height: 100vh; | ||
overflow: auto; | ||
display: flex; | ||
flex-direction: column; | ||
} |
Oops, something went wrong.