This commit is contained in:
sk1551
2020-05-07 18:33:11 +08:00
16 changed files with 719 additions and 67 deletions

View File

@ -18,6 +18,15 @@ export function listTeacher2(query) {
})
}
// 查询教师基本信息列表
export function listTeacherGroupXw() {
return request({
url: '/system/teacher/listgroupxw',
method: 'get',
params: ''
})
}
// 查询教师基本信息详细
export function getTeacher(id) {
return request({

View File

@ -95,7 +95,7 @@
:data="schoolcalendarList"
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" />
<el-table-column type="selection" width="55" align="center" :selectable="checkSelectable" />
<el-table-column label="编号" align="center" prop="id" />
<el-table-column label="名称" align="center" prop="name" />
<el-table-column
@ -120,6 +120,7 @@
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['benyi:schoolcalendar:edit']"
:disabled="!checkSelectable(scope.row)"
>修改</el-button>
<el-button
size="mini"
@ -127,6 +128,7 @@
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['benyi:schoolcalendar:remove']"
:disabled="!checkSelectable(scope.row)"
>删除</el-button>
</template>
</el-table-column>
@ -224,6 +226,8 @@ export default {
scopeOptions: [],
//学年学期
xnxqOptions: [],
//声明方法
selectable: Function,
// 查询参数
queryParams: {
pageNum: 1,
@ -271,6 +275,16 @@ export default {
schoolcalendartypeFormat(row, column) {
return this.selectDictLabel(this.schoolcalendartypeOptions, row.type);
},
//控制按钮可用
checkSelectable(row) {
var date = new Date();
//console.log(date.toLocaleDateString());
return this.CompareDate(row.activitytime, date.toLocaleDateString());
},
//比较日期大小
CompareDate(d1, d2) {
return new Date(d1.replace(/-/g, "/")) > new Date(d2.replace(/-/g, "/"));
},
// 适用范围类型--字典状态字典翻译
scopeFormat(row, column) {
//alert(row.scope.split(';').length);

View File

@ -62,7 +62,7 @@ export default {
},
xAxis: [{
type: 'category',
data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
data: ['班级A', '班级B', '班级C', '班级D', '班级E', '班级F', '班级G'],
axisTick: {
alignWithLabel: true
}
@ -74,25 +74,18 @@ export default {
}
}],
series: [{
name: 'pageA',
name: '幼儿出勤率',
type: 'bar',
stack: 'vistors',
barWidth: '60%',
data: [79, 52, 200, 334, 390, 330, 220],
data: [30, 29, 28, 31, 33, 18, 20],
animationDuration
}, {
name: 'pageB',
name: '教师出勤率',
type: 'bar',
stack: 'vistors',
barWidth: '60%',
data: [80, 52, 200, 334, 390, 330, 220],
animationDuration
}, {
name: 'pageC',
type: 'bar',
stack: 'vistors',
barWidth: '60%',
data: [30, 52, 200, 334, 390, 330, 220],
data: [3, 3, 3, 3, 2, 3, 3],
animationDuration
}]
})

View File

@ -3,77 +3,91 @@
</template>
<script>
import echarts from 'echarts'
require('echarts/theme/macarons') // echarts theme
import resize from './mixins/resize'
import echarts from "echarts";
require("echarts/theme/macarons"); // echarts theme
import resize from "./mixins/resize";
import { listTeacherGroupXw } from "@/api/system/teacher";
export default {
names: [],
values: [],
mixins: [resize],
props: {
className: {
type: String,
default: 'chart'
default: "chart"
},
width: {
type: String,
default: '100%'
default: "100%"
},
height: {
type: String,
default: '300px'
default: "300px"
}
},
data() {
return {
chart: null
}
};
},
mounted() {
this.$nextTick(() => {
this.initChart()
})
this.initChart();
});
},
beforeDestroy() {
if (!this.chart) {
return
return;
}
this.chart.dispose()
this.chart = null
this.chart.dispose();
this.chart = null;
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, 'macarons')
async getData() {
await listTeacherGroupXw().then(response => {
console.log(response);
let name = [];
let value = [];
let len = response.rows;
for (var j = 0; j < len.length; j++) {
name.push(len[j].xl);
value.push({'name':len[j].xl,'value':len[j].byyx});
}
this.names = name;
this.values = value;
//console.log(this.names);
//console.log(this.values);
});
},
async initChart() {
await this.getData();
this.chart = echarts.init(this.$el, "macarons");
this.chart.setOption({
tooltip: {
trigger: 'item',
formatter: '{a} <br/>{b} : {c} ({d}%)'
trigger: "item",
formatter: "{a} <br/>{b} : {c} ({d}%)"
},
legend: {
left: 'center',
bottom: '10',
data: ['Industries', 'Technology', 'Forex', 'Gold', 'Forecasts']
left: "center",
bottom: "10",
data: this.names
},
series: [
{
name: 'WEEKLY WRITE ARTICLES',
type: 'pie',
roseType: 'radius',
name: "幼儿园教职工学历统计",
type: "pie",
roseType: "radius",
radius: [15, 95],
center: ['50%', '38%'],
data: [
{ value: 320, name: 'Industries' },
{ value: 240, name: 'Technology' },
{ value: 149, name: 'Forex' },
{ value: 100, name: 'Gold' },
{ value: 59, name: 'Forecasts' }
],
animationEasing: 'cubicInOut',
center: ["50%", "38%"],
data: this.values,
animationEasing: "cubicInOut",
animationDuration: 2600
}
]
})
});
}
}
}
};
</script>