diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..23c3fc1 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,187 @@ +--- +kind: pipeline +type: docker +name: development + +# 挂载的主机卷,可以映射到docker容器中 +volumes: + # maven构建缓存(宿主机目录) + - name: ssh_key + host: + path: /root/.ssh/ + - name: cache + host: + path: /var/lib/cache + - name: data + host: + path: /var/lib/data + +steps: + # - name: restore-cache + # image: drillster/drone-volume-cache + # volumes: + # - name: cache + # path: /cache + # settings: + # restore: true + # mount: + # - ./node_modules + + - name: build + image: node:16 + pull: if-not-exists # default always + # volumes: + # - name: cache + # path: /root/.m2 + commands: + - npm config set registry http://registry.npm.taobao.org + - npm i + - npm run build:test + + # - name: rebuild-cache + # image: drillster/drone-volume-cache + # volumes: + # - name: cache + # path: /cache + # settings: + # rebuild: true + # mount: + # - ./node_modules + + - name: deploy-scp + image: appleboy/drone-scp + pull: if-not-exists + volumes: + - name: ssh_key + path: /root/.ssh/ + settings: + host: test.tall.wiki + port: 22 + username: root + key_path: /root/.ssh/id_rsa + rm: true # true则会删除目标目录重建 + target: /home/checkwork + source: dist/* + strip_components: 1 # 去除的目录层数,如果没有该选项,则拷贝过去是 target/xxx.jar,1代表去除target + + - name: notify-wechatwork + image: fifsky/drone-wechat-work + pull: if-not-exists + settings: + url: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=428e5c5d-f992-4349-939d-9c99556e50b8 + msgtype: markdown + content: | + {{if eq .Status "success" }} + #### 🎉 ${DRONE_REPO} 构建成功 + > Commit: [${DRONE_COMMIT_MESSAGE}](${DRONE_COMMIT_LINK}) + > Author: ${DRONE_COMMIT_AUTHOR} + > [点击查看](${DRONE_BUILD_LINK}) + {{else}} + #### ❌ ${DRONE_REPO} 构建失败 + > Commit: [${DRONE_COMMIT_MESSAGE}](${DRONE_COMMIT_LINK}) + > Author: ${DRONE_COMMIT_AUTHOR} + > 请立即修复!!! + > [点击查看](${DRONE_BUILD_LINK}) + {{end}} + when: + status: + - failure + - success + +trigger: + branch: + - develop + +--- +kind: pipeline +type: docker +name: production + +# 挂载的主机卷,可以映射到docker容器中 +volumes: + # maven构建缓存(宿主机目录) + - name: ssh_key + host: + path: /root/.ssh/ + - name: cache + host: + path: /var/lib/cache + - name: data + host: + path: /var/lib/data + +steps: + # - name: restore-cache + # image: drillster/drone-volume-cache + # volumes: + # - name: cache + # path: /cache + # settings: + # restore: true + # mount: + # - ./node_modules + + - name: build + image: node + pull: if-not-exists # default always + # volumes: + # - name: cache + # path: /root/.m2 + commands: + - npm config set registry http://registry.npm.taobao.org + - npm i + - npm run test + + # - name: rebuild-cache + # image: drillster/drone-volume-cache + # volumes: + # - name: cache + # path: /cache + # settings: + # rebuild: true + # mount: + # - ./node_modules + + - name: deploy-scp + image: appleboy/drone-scp + pull: if-not-exists + volumes: + - name: ssh_key + path: /root/.ssh/ + settings: + host: www.tall.wiki + port: 22 + username: root + key_path: /root/.ssh/id_rsa + rm: true # true则会删除目标目录重建 + target: /home/checkwork + source: dist/* + strip_components: 1 # 去除的目录层数,如果没有该选项,则拷贝过去是 target/xxx.jar,1代表去除target + + - name: notify-wechatwork + image: fifsky/drone-wechat-work + pull: if-not-exists + settings: + url: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=428e5c5d-f992-4349-939d-9c99556e50b8 + msgtype: markdown + content: | + {{if eq .Status "success" }} + #### 🎉 ${DRONE_REPO} 构建成功 + > Commit: [${DRONE_COMMIT_MESSAGE}](${DRONE_COMMIT_LINK}) + > Author: ${DRONE_COMMIT_AUTHOR} + > [点击查看](${DRONE_BUILD_LINK}) + {{else}} + #### ❌ ${DRONE_REPO} 构建失败 + > Commit: [${DRONE_COMMIT_MESSAGE}](${DRONE_COMMIT_LINK}) + > Author: ${DRONE_COMMIT_AUTHOR} + > 请立即修复!!! + > [点击查看](${DRONE_BUILD_LINK}) + {{end}} + when: + status: + - failure + - success + +trigger: + branch: + - master diff --git a/.env.production b/.env.production index b9b103f..fdb41e9 100644 --- a/.env.production +++ b/.env.production @@ -1,10 +1,10 @@ VUE_APP_MODE=production VUE_APP_NODE_ENV=production VUE_APP_SCENE=checkwork -VUE_APP_BASE_URL=https://test.tall.wiki/checkwork/ -VUE_APP_API_URL=https://test.tall.wiki/checkwork/gateway +VUE_APP_BASE_URL=https://www.tall.wiki/checkwork/ +VUE_APP_API_URL=https://www.tall.wiki/checkwork/gateway VUE_APP_PROXY_URL=/gateway VUE_APP_PUBLIC_PATH=/checkwork -VUE_APP_MSG_URL=wss://test.tall.wiki/websocket/message/v4.0/ws +VUE_APP_MSG_URL=wss://www.tall.wiki/websocket/message/v4.0/ws VUE_APP_TITLE=考勤管理 VUE_APP_DESCRIPTION=考勤管理 diff --git a/package.json b/package.json index 9b54bd4..612f044 100644 --- a/package.json +++ b/package.json @@ -3,8 +3,10 @@ "version": "0.1.0", "private": true, "scripts": { + "test": "echo \"Error: no test specified\" && exit 1", "serve": "vue-cli-service serve", - "build": "vue-cli-service build", + "build:test": "vue-cli-service build --mode development", + "build": "vue-cli-service build --mode production", "lint": "vue-cli-service lint" }, "dependencies": { diff --git a/src/App.vue b/src/App.vue index 268b1ed..54a70d2 100644 --- a/src/App.vue +++ b/src/App.vue @@ -17,13 +17,15 @@ export default { }, async created() { - const userId = this.$route.query.uid; - const roleId = this.$route.query.rid; - const params = { userId }; - await this.getUserId(params); - await this.setRoleId(roleId); - await this.getAllMembers({ projectId: this.$route.query.pid }); - this.setProjectId(this.$route.query.pid); + this.$router.onReady(async () => { + const userId = this.$route.query.uid; + const roleId = this.$route.query.rid; + const params = { userId }; + await this.getUserId(params); + await this.setRoleId(roleId); + await this.getAllMembers({ projectId: this.$route.query.pid }); + this.setProjectId(this.$route.query.pid); + }); }, methods: { diff --git a/src/components/BarChart/BarChart.vue b/src/components/BarChart/BarChart.vue index 54b03dd..58cd5d0 100644 --- a/src/components/BarChart/BarChart.vue +++ b/src/components/BarChart/BarChart.vue @@ -1,5 +1,5 @@ @@ -34,10 +34,9 @@ export default { { type: 'value', splitLine: { show: false }, - // boundaryGap: false, - // show: true, - // axisLine: { show: false }, - // axisTick: { show: false }, + min: 0, + max: 400, + splitNumber: 5, }, ], yAxis: [ @@ -47,20 +46,19 @@ export default { data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'], axisLine: { show: false }, axisTick: { show: false }, - // splitLine: { show: false }, - // data: ['0', '10', '20'], }, - // { - // show: false, - // type: 'value', - // }, ], series: [ { type: 'bar', - // yAxisIndex: 1, color: `${this.color[0]}`, - barWidth: '10', + barWidth: '20', + label: { + show: true, //开启数值显示 + position: 'insideRight', + color: '#fff', + fontSize: 12, + }, data: [ { value: 200, @@ -92,32 +90,6 @@ export default { }, ], }, - // { - // type: 'line', - // stack: '总量', - // smooth: true, - // lineStyle: { - // width: 2, - // color: `rgba(105,207,76,1)`, - // boxShadow: '10px 10px 10px #000', - // }, - // showSymbol: false, - // areaStyle: { - // opacity: 0.8, - // color: new this.$echarts.graphic.LinearGradient(0, 0, 0, 1, [ - // { - // offset: 0, - // color: `rgba(105,207,76,0.4)`, - // }, - // { - // offset: 1, - // color: `rgba(105,207,76,0)`, - // }, - // ]), - // }, - // emphasis: { focus: 'series' }, - // data: [140, 232, 101, 264, 90, 340, 250], - // }, ], }; }, diff --git a/src/components/LineChart/LineChart.vue b/src/components/LineChart/LineChart.vue index a0a072a..b44c90c 100644 --- a/src/components/LineChart/LineChart.vue +++ b/src/components/LineChart/LineChart.vue @@ -33,8 +33,6 @@ export default { xAxis: [ { type: 'category', - // boundaryGap: false, - // show: true, axisLine: { show: false }, axisTick: { show: false }, data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日'], @@ -42,24 +40,14 @@ export default { ], yAxis: [ { - // show: true, type: 'value', splitLine: { show: false }, - data: ['0', '10', '20'], + min: 0, + max: 400, + splitNumber: 5, }, - // { - // show: false, - // type: 'value', - // }, ], series: [ - // { - // type: 'bar', - // yAxisIndex: 1, - // color: `rgba(105,207,76,0.4)`, - // barWidth: '10', - // data: [null, 140, 232, 101, 264, 90, 340, 250, null], - // }, { type: 'line', stack: '总量', diff --git a/src/components/List/List.vue b/src/components/List/List.vue index 7bcf6ba..fb67eb4 100644 --- a/src/components/List/List.vue +++ b/src/components/List/List.vue @@ -33,12 +33,11 @@ {{ $moment(record.morning - 0).format('HH:mm') }} - 未打卡 + 未打卡 打卡 @@ -92,7 +91,7 @@ format="HH:mm" class="px-2" @change="timeChange" - @openChange="openChange($event, record, 'showMorningTime', 'morning')" + @openChange="openChange($event, record, 1, 'showMorningTime', 'morning')" /> @@ -119,12 +118,11 @@ {{ $moment(record.night - 0).format('HH:mm') }} - 未打卡 + 未打卡 打卡 @@ -178,7 +176,7 @@ format="HH:mm" class="px-2" @change="timeChange" - @openChange="openChange($event, record, 'showNightTime', 'night')" + @openChange="openChange($event, record, 1, 'showNightTime', 'night')" /> @@ -186,7 +184,7 @@