Skip to content

Commit

Permalink
同步本地
Browse files Browse the repository at this point in the history
  • Loading branch information
BoBoooooo committed Jan 29, 2018
1 parent 3f122cd commit 9fe8f2f
Show file tree
Hide file tree
Showing 5 changed files with 135 additions and 166 deletions.
Binary file added src/assets/google.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
218 changes: 96 additions & 122 deletions src/views/KaoQin/count.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@
<i class="el-icon-date"></i> 月报</span>
<el-tabs :tab-position="tabPosition" style="height: 700px;">
<el-tab-pane label="个人月报">
<el-date-picker v-model="params.month" type="month" placeholder="选择月份" style="width:200px">
</el-date-picker>
<el-input placeholder="请输入工号/姓名" v-model="criteria" style="display:inline-block;width:200px;padding-bottom:10px;">
</el-input>
<el-button type="primary" icon="el-icon-search" @click="search">搜索</el-button>

<div class="charts">

<div id="myChart" style="width: 600px;height: 400px;"></div>
</div>
</el-tab-pane>
Expand All @@ -30,27 +37,34 @@
</div>
</template>
<script>
// 引入基本模板
// 引入 ECharts 主模块
var echarts = require('echarts/lib/echarts');
// 引入柱状图
require('echarts/lib/chart/heatmap');
require('echarts/lib/chart/bar');
require('echarts/lib/chart/pie');
// // 引入基本模板
// // 引入 ECharts 主模块
// var echarts = require('echarts/lib/echarts');
// // 引入柱状图
// require('echarts/lib/chart/heatmap');
// require('echarts/lib/chart/bar');
// require('echarts/lib/chart/pie');
// 引入提示框和标题组件
require('echarts/lib/component/tooltip');
require('echarts/lib/component/title');
require('echarts/lib/chart/scatter');
// // 引入提示框和标题组件
// require('echarts/lib/component/tooltip');
// require('echarts/lib/component/title');
// require('echarts/lib/chart/scatter');
import echarts from 'echarts'
import {SearchPersonByMonth} from '@/api/KaoQin/Attendance'
export default {
name: '',
data() {
return {
data: [],
tabPosition: 'left',
params: {
month: "",
name: ""
}
}
},
methods: {
Expand All @@ -70,138 +84,98 @@
return data;
},
drawLine() {
// 基于准备好的dom,初始化echarts实例
let myChart = echarts.init(document.getElementById('myChart'))
// 绘制图表
myChart.setOption({
title: { text: '个人月报' },
tooltip: {},
xAxis: {
data: ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"]
},
yAxis: {},
series: [{
name: '销量',
type: 'bar',
data: [5, 20, 36, 10, 10, 20]
}]
});
},
// drawPie(id) {
// this.charts = echarts.init(document.getElementById(id))
// this.charts.setOption({
// tooltip: {
// position: 'top'
// },
// calendar: [{
// orient: 'vertical',
// yearLabel: {
// margin: 40
// },
// dayLabel: {
// firstDay: 1,
// nameMap: ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
// },
// monthLabel: {
// nameMap: 'cn',
// margin: 20
// },
// cellSize: 40,
// top: 100,
// left: 50,
// range: '2017-04'
// }],
// series: [{
// type: 'scatter',
// coordinateSystem: 'calendar',
// calendarIndex: 0,
// symbolSize: function (val) {
// return val[1] / 60;
// },
// data: []
// }]
// })
// },
drawPie_Year() {
let myChart = echarts.init(document.getElementById('main'))
let data = this.getVirtulData(2018);
drawPersonMonth() {
// 基于准备好的dom,初始化echarts实例
let myChart = echarts.init(document.getElementById('myChart'))
// 绘制图表
myChart.setOption({
title: {
top: 30,
text: '个人年度报表',
left: 'center',
textStyle: {
color: '#000'
}
},
tooltip: {
trigger: 'item'
position: 'top'
},
legend: {
top: '30',
left: '100',
data: ['步数', 'Top 12'],
textStyle: {
color: '#000'
calendar: [{
orient: 'vertical',
range: '2018-01',
cellSize: ['auto', 50],
yearLabel: {
margin: 40
},
monthLabel: {
nameMap: 'cn',
margin: 15
},
dayLabel: {
firstDay: 1,
margin: 15,
nameMap: 'cn'
}
}],
series: [{
type: 'scatter',
coordinateSystem: 'calendar',
calendarIndex: 0,
data: this.data
}]
})
},
drawPersonYear() {
let myChart = echarts.init(document.getElementById('main'))
myChart.setOption({
tooltip: {
position: 'top'
},
calendar: [{
top: 100,
left: 'center',
range: ['2018-01-01', '2018-12-31'],
splitLine: {
show: true,
lineStyle: {
color: '#000',
width: 4,
type: 'solid'
}
},
cellSize: ['auto', 20],
yearLabel: {
formatter: '{start} 1st',
textStyle: {
color: '#fff'
}
margin: 40
},
itemStyle: {
normal: {
color: '#323c48',
borderWidth: 1,
borderColor: '#111'
}
monthLabel: {
nameMap: 'cn',
margin: 20
},
dayLabel: {
nameMap: 'cn'
}
}],
series: [{
name: '步数',
type: 'scatter',
coordinateSystem: 'calendar',
data: data,
symbolSize: function (val) {
return val[1] / 500;
},
itemStyle: {
normal: {
color: '#ddb926'
}
}
}
type: 'scatter',
coordinateSystem: 'calendar',
calendarIndex: 0,
data: this.data
}]
]
})
},
SearchPersonByMonth(){
SearchPersonByMonth(this.params).then(response => {
console.log(response.data)
})
}
},
//调用
created() {
this.data = this.getVirtulData(2018)
},
mounted() {
this.$nextTick(function () {
// this.drawPie('main1')
this.drawPie_Year()
this.drawLine()
this.drawPersonYear()
this.drawPersonMonth()
})
}
}
Expand Down
64 changes: 27 additions & 37 deletions src/views/KaoQin/import.vue
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,12 @@
</el-time-select>
</el-form-item>
<el-form-item label="是否请假">
<multiselect v-model="selected" :value="temp.Vacation" :options="options" :searchable="false" :close-on-select="true" :allow-empty="false"
placeholder="请选择" :showLabels="false" style="z-index:3;height:20px" label="text">
<multiselect v-model="selected" :value="selected" track-by="value" label="text" :options="options" :searchable="false" :close-on-select="true"
:allow-empty="false" placeholder="请选择" :showLabels="false" style="z-index:3;height:20px">
</multiselect>
</el-form-item>



<el-form-item label="请假事由" v-if="this.selected.value">

<el-form-item label="请假事由" v-if="this.selected.value===1">
<el-input class="filter-item" type="textarea" v-model="temp.Vacation_Reason">

</el-input>
</el-form-item>
</el-form>
Expand Down Expand Up @@ -136,28 +131,25 @@
},
created() {
this.fetchData(this.listQuery);
this.fetchData(this.listQuery)
},
methods: {
handleSizeChange(val) {
this.listQuery.pageSize = val;
this.fetchData(this.listQuery);
this.listQuery.pageSize = val
this.fetchData(this.listQuery)
},
handleCurrentChange(val) {
this.listQuery.pageNumber = val;
this.fetchData(this.listQuery);
this.listQuery.pageNumber = val
this.fetchData(this.listQuery)
},
fetchData(params) {
this.listLoading = true;
GetUsers(params).then(response => {
this.list = response.data.rows;
this.listQuery.totalCount = response.data.total;
this.listLoading = false;
});
this.list = response.data.rows
this.listQuery.totalCount = response.data.total
this.listLoading = false
})
},
Delete(ID) {
Expand All @@ -167,44 +159,42 @@
type: "warning"
}).then(() => {
DeleteUser(ID).then(response => {
this.fetchData(this.listQuery);
});
});
this.fetchData(this.listQuery);
})
})
},
Edit(ID, Name) {
this.dialogStatus = "update";
this.dialogFormVisible = true;
this.Title = Name;
this.temp.Date = parseTime(new Date());
AttenDetailByPerson(ID).then(response => {
this.temp = response.data;
if(this.temp.PersonId!=null){
this.selected.value = this.temp.Vacation;
}
this.temp.PersonId = ID;
this.temp = response.data
if(this.temp.Vacation === 1){
this.selected = this.options[0]
}
});
else{
this.selected = this.options[1]
}
this.temp.PersonId = ID
})
},
update() {
this.temp.Vacation = this.selected.value;
this.temp.Date = parseTime(new Date());
UpdateAtten(this.temp).then(response => {
this.dialogFormVisible = false;
this.fetchData(this.listQuery);
});
this.fetchData(this.listQuery);
})
}
}
};
}
</script>


<style rel="stylesheet/scss" lang="scss" scoped>
Expand Down
2 changes: 1 addition & 1 deletion src/views/layout/TagsView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ export default {
background: #fff;
height: 34px;
border-bottom: 1px solid #d8dce5;
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .12), 0 0 3px 0 rgba(0, 0, 0, .04);
box-shadow: 0 1px 3px 0 rgba(0, 0, 0, .12), 0 0 3px 0 rgba(0, 0, 0, .04);
.tags-view-item {
display: inline-block;
position: relative;
Expand Down
Loading

0 comments on commit 9fe8f2f

Please sign in to comment.