Skip to content

Commit

Permalink
v1.0.1
Browse files Browse the repository at this point in the history
Foss-Sky1.0.1
  • Loading branch information
YDKD authored Apr 13, 2022
2 parents 867289b + 14d66db commit 42cd9bf
Show file tree
Hide file tree
Showing 39 changed files with 1,021 additions and 67 deletions.
48 changes: 43 additions & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,25 @@ pipeline {
}

stages {
stage('stop container') {

when {
anyOf {
branch 'dev'
}
}
agent {
docker {
image 'node:14.18.0'
reuseNode true
}
}

steps {
sh './jenkins/script/stop.sh'
}
}

stage('pre-build') { // 自定义步骤 pre-build

when {
Expand Down Expand Up @@ -112,6 +131,25 @@ pipeline {
}
}

stage('restart container') {

when {
anyOf {
branch 'dev'
}
}
agent {
docker {
image 'node:14.18.0'
reuseNode true
}
}

steps {
sh './jenkins/script/restart.sh'
}
}

stage("artifacts-manage"){
when {
expression{
Expand All @@ -130,13 +168,13 @@ pipeline {
expression{
return fileExists("${resetFlagFile}")
}
anyOf {
anyOf {
branch 'dev'
branch 'release'
branch 'master'
}
}

steps {
echo "是回滚啊啊啊啊"
//当然我们这里为了方便下载
Expand Down Expand Up @@ -174,7 +212,7 @@ pipeline {
}

//post 就是流水线的运行结果状态啦,我们慢点会在这里设置邮件通
post {
post {
changed{
echo 'I changed!'
}
Expand All @@ -187,7 +225,7 @@ pipeline {
emailext(
subject: "Job [${env.JOB_NAME}] - Status: fail",
body: """${template}""",
recipientProviders: [culprits(),requestor(),developers()],
recipientProviders: [culprits(),requestor(),developers()],
to: "[email protected]",
)
}
Expand All @@ -203,7 +241,7 @@ pipeline {
emailext(
subject: "Job [${env.JOB_NAME}] - Status: Success",
body: """${template}""",
recipientProviders: [requestor(),developers()],
recipientProviders: [requestor(),developers()],
to: "[email protected]",
)
}
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<link rel="stylesheet" href="//at.alicdn.com/t/font_3289955_rrzu1plqg1l.css" />
<link rel="stylesheet" href="//at.alicdn.com/t/font_3289955_zcjv91nt0w.css" />
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@500&display=swap" rel="stylesheet" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title></title>
Expand Down
6 changes: 0 additions & 6 deletions jenkins/script/build-dev.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
#! /bin/bash

# set -x
# stop nestjs
docker stop nestjs

npm run build-dev || exit 1

# start nestjs
docker start nestjs

# set +x
13 changes: 13 additions & 0 deletions jenkins/script/restart.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#! /bin/bash

# set -x
# restart mysql
docker start mysql

# restart nestjs
containerId=`docker ps -a | grep -w nestjs | awk '{print $1}'`

if [ "$containerId" != "" ] ; then
docker start $containerId
echo "成功运行容器 $containerId"
fi
14 changes: 14 additions & 0 deletions jenkins/script/stop.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#! /bin/bash

# set -x
# stop nestjs
containerId=`docker ps -a | grep -w nestjs | awk '{print $1}'`

if [ "$containerId" != "" ] ; then
docker stop $containerId
echo "成功停止容器 $containerId"
fi

# stop mysql
docker stop mysql

28 changes: 28 additions & 0 deletions src/api/getApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ export function getPerson(params: any) {
params
})
}
export function getWorkerSalary(params: any) {
return defaultRequest.request<ReutrnDataType>({
url: '/sys/person/salary',
method: 'GET',
params
})
}

export function getSerialNum() {
return defaultRequest.request<ReutrnDataType>({
Expand All @@ -74,3 +81,24 @@ export function getWorkerAttendance(params: any) {
params
})
}

export function getAddPerson() {
return defaultRequest.request<ReutrnDataType>({
url: '/analysis/person/add',
method: 'GET'
})
}

export function getLeavingPerson() {
return defaultRequest.request<ReutrnDataType>({
url: '/analysis/person/leaving',
method: 'GET'
})
}

export function getCountTotal() {
return defaultRequest.request<ReutrnDataType>({
url: '/analysis/count/total',
method: 'GET'
})
}
10 changes: 9 additions & 1 deletion src/api/postApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @Autor: YDKD
* @Date: 2022-03-19 18:42:32
* @LastEditors: YDKD
* @LastEditTime: 2022-04-04 20:44:17
* @LastEditTime: 2022-04-12 15:21:44
*/
import { defaultRequest } from '@/service'
import { ReutrnDataType } from './type'
Expand Down Expand Up @@ -55,3 +55,11 @@ export function addPersonInfo(data: any) {
data
})
}

export function updateWorkerSalary(data: any) {
return defaultRequest.request<ReutrnDataType>({
url: '/sys/person/salary',
method: 'POST',
data
})
}
30 changes: 13 additions & 17 deletions src/components/Echarts/src/Echarts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @Autor: YDKD
* @Date: 2022-04-06 10:32:17
* @LastEditors: YDKD
* @LastEditTime: 2022-04-07 16:12:17
* @LastEditTime: 2022-04-08 16:07:29
-->
<template>
<div ref="elRef" :class="[$attrs.class, prefixCls]" :style="styles"></div>
Expand Down Expand Up @@ -50,10 +50,8 @@ const options = computed(() => {
})
})

// eslint-disable-next-line no-undef
const elRef = ref<ElRef>()

// eslint-disable-next-line no-undef
let echartRef: Nullable<echarts.ECharts> = null

const contentEl = ref<Element>()
Expand Down Expand Up @@ -94,7 +92,7 @@ const resizeHandler = debounce(() => {
}, 100)

const contentResizeHandler = async (e: TransitionEvent) => {
if (e.propertyName === 'width') {
if (e.propertyName === 'transform') {
resizeHandler()
}
}
Expand All @@ -104,23 +102,21 @@ onMounted(() => {

window.addEventListener('resize', resizeHandler)

// contentEl.value = document.getElementsByClassName(
// `${namespace}-layout-content`
// )[0]
// unref(contentEl) &&
// (unref(contentEl) as HTMLElement).addEventListener(
// 'transitionend',
// contentResizeHandler
// )
contentEl.value = document.getElementsByClassName(`${namespace}-container`)[0]
unref(contentEl) &&
(unref(contentEl) as HTMLElement).addEventListener(
'transitionend',
contentResizeHandler
)
})

onBeforeUnmount(() => {
window.removeEventListener('resize', resizeHandler)
// unref(contentEl) &&
// (unref(contentEl) as HTMLElement).removeEventListener(
// 'transitionend',
// contentResizeHandler
// )
unref(contentEl) &&
(unref(contentEl) as HTMLElement).removeEventListener(
'transitionend',
contentResizeHandler
)
})

onActivated(() => {
Expand Down
4 changes: 1 addition & 3 deletions src/components/Icon/src/Icon.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @Autor: YDKD
* @Date: 2022-03-28 15:08:36
* @LastEditors: YDKD
* @LastEditTime: 2022-04-08 09:06:21
* @LastEditTime: 2022-04-12 15:53:27
-->
<template>
<ElIcon :class="prefixCls" :size="size" :color="color">
Expand Down Expand Up @@ -34,8 +34,6 @@ const props = defineProps({
const iconfontSize = computed(() => {
return props.size > 16 ? '2.4rem' : '20px'
})

console.log()
</script>

<style lang="less" scoped>
Expand Down
5 changes: 1 addition & 4 deletions src/components/Menu/src/Menu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @Autor: YDKD
* @Date: 2022-03-28 10:19:48
* @LastEditors: YDKD
* @LastEditTime: 2022-04-02 21:28:29
* @LastEditTime: 2022-04-12 15:53:30
-->
<script lang="tsx">
import { defineComponent, computed, unref } from 'vue'
Expand All @@ -27,7 +27,6 @@ export default defineComponent({
}
return path
})
console.log(unref(activeMenu))

const appStore = useAppStore()

Expand All @@ -37,8 +36,6 @@ export default defineComponent({

const routes = permissionStore.getRouters

console.log(unref(routes))

return () => (
<div class={[prefixCls, 'h-full overflow-hidden flex-col text-white']}>
<ElScrollbar>
Expand Down
3 changes: 1 addition & 2 deletions src/components/TabMenu/src/TabMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
* @Autor: YDKD
* @Date: 2022-03-24 11:26:09
* @LastEditors: YDKD
* @LastEditTime: 2022-03-24 11:35:02
* @LastEditTime: 2022-04-12 15:53:37
-->
<script lang="tsx">
import { useDesign } from '@/hooks'
import { defineComponent } from 'vue'

const prefixCls = useDesign('prefix', 'tab-menu')
const variables = useDesign('variables')
console.log(variables)

export default defineComponent({
name: 'TabMenu',
Expand Down
6 changes: 3 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import 'normalize.css'

import '@purge-icons/generated'

// import global css
import '@/styles/index.less'

import './assets/css/index.less'
import './assets/css/tailwind.css'

// import global css
import '@/styles/index.less'

import router from './router'
import { setupStore } from './store'

Expand Down
5 changes: 3 additions & 2 deletions src/plugins/echarts/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as echarts from 'echarts/core'

import { PieChart } from 'echarts/charts'
import { PieChart, LineChart } from 'echarts/charts'

import {
TitleComponent,
Expand All @@ -25,7 +25,8 @@ echarts.use([
ParallelComponent,
PieChart,
CanvasRenderer,
ToolboxComponent
ToolboxComponent,
LineChart
])

export default echarts
Loading

0 comments on commit 42cd9bf

Please sign in to comment.