master
xy 3 years ago
parent a8217344f6
commit 248a7bb07d

@ -0,0 +1,100 @@
<template>
<div :class="className" :style="{ height: height, width: width }" />
</template>
<script>
import echarts from "echarts";
import geoJson from "@/assets/china.json";
require("echarts/theme/macarons"); // echarts theme
export default {
props: {
className: {
type: String,
default: "chart",
},
width: {
type: String,
default: "100%",
},
height: {
type: String,
default: "500px",
},
chartData: {
type: [Object,Array],
},
},
data() {
return {}
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, "macarons");
this.setOptions(this.chartData);
},
setOptions() {
let arr = []
for(let key in this.chartData){
arr.push(this.chartData[key])
}
//
this.chart.setOption({
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'cross',
label: {
backgroundColor: '#6a7985'
}
}
},
xAxis: {
type: 'category',
boundaryGap: false,
data: arr.map(item => item.year)
},
yAxis: {
type: 'value'
},
series: [
{
name:"历年统招人数环比",
data: arr.map(item => item.total),
type: 'line',
areaStyle: {
color:"#8b9bd3"
},
lineStyle:{
color:"#8b9bd3"
}
}
]
});
},
},
computed: {},
watch: {
chartData: {
deep: true,
handler(val) {
this.setOptions(val);
},
},
},
beforeDestroy() {
if (!this.chart) {
return;
}
this.chart.dispose();
this.chart = null;
},
mounted() {
this.$nextTick(() => {
this.initChart();
});
},
}
</script>
<style scoped lang="scss">
</style>

@ -0,0 +1,106 @@
<template>
<div :class="className" :style="{ height: height, width: width }" />
</template>
<script>
import echarts from "echarts";
import geoJson from "@/assets/china.json";
require("echarts/theme/macarons"); // echarts theme
export default {
props: {
className: {
type: String,
default: "chart",
},
width: {
type: String,
default: "100%",
},
height: {
type: String,
default: "500px",
},
chartData: {
type: [Object,Array],
},
},
data() {
return {}
},
methods: {
initChart() {
this.chart = echarts.init(this.$el, "macarons");
this.setOptions(this.chartData);
},
setOptions(chartdata) {
//
this.chart.setOption({
tooltip: {
trigger: 'item'
},
legend: {
top: '3%',
left: 'center'
},
series: [
{
name: '统招生源占比',
type: 'pie',
radius: ['40%', '70%'],
avoidLabelOverlap: false,
itemStyle: {
borderRadius: 10,
borderColor: '#fff',
borderWidth: 2
},
label: {
show: false,
position: 'center'
},
emphasis: {
label: {
show: true,
fontSize: 40,
fontWeight: 'bold'
}
},
labelLine: {
show: false
},
data: this.chartData.map(item => {
return {
value:item.rate,
name:item.province_name
}
})
}
]
});
},
},
computed: {},
watch: {
chartData: {
deep: true,
handler(val) {
this.setOptions(val);
},
},
},
beforeDestroy() {
if (!this.chart) {
return;
}
this.chart.dispose();
this.chart = null;
},
mounted() {
this.$nextTick(() => {
this.initChart();
});
},
}
</script>
<style scoped lang="scss">
</style>

@ -1,78 +1,73 @@
<template> <template>
<div :class="className" :style="{height:height,width:width}" /> <div :class="className" :style="{ height: height, width: width }" />
</template> </template>
<script> <script>
import echarts from 'echarts' import echarts from "echarts";
require('echarts/theme/macarons') // echarts theme require("echarts/theme/macarons"); // echarts theme
import resize from './mixins/resize' import resize from "./mixins/resize";
import geoJson from '@/assets/china.json' import geoJson from "@/assets/china.json";
const animationDuration = 6000 const animationDuration = 6000;
export default { export default {
mixins: [resize], //mixins: [resize],
props: { props: {
className: { className: {
type: String, type: String,
default: 'chart' default: "chart",
}, },
width: { width: {
type: String, type: String,
default: '100%' default: "100%",
}, },
height: { height: {
type: String, type: String,
default: '500px' default: "500px",
}, },
chartData: { chartData: {
type: Object type: [Object,Array],
} },
}, },
data() { data() {
return { return {
chart: null, chart: null,
statusArr: { statusArr:new Map([
"1": "待投档", [1,"待投档"],
"2": "录取中", [2,"录取中"],
"3": "录取结束", [3,"录取结束"],
"4": "已邮寄通知书" [4,"已邮寄通知书"]
} ])
};
}
}, },
mounted() { mounted() {
//console.log(geoJson);
console.log(geoJson)
this.$nextTick(() => { this.$nextTick(() => {
this.initChart() this.initChart();
}) });
}, },
watch: { watch: {
chartData: { chartData: {
deep: true, deep: true,
handler(val) { handler(val) {
this.setOptions(val) this.setOptions(val);
} },
} },
}, },
beforeDestroy() { beforeDestroy() {
if (!this.chart) { if (!this.chart) {
return return;
} }
this.chart.dispose() this.chart.dispose();
this.chart = null this.chart = null;
}, },
methods: { methods: {
initChart() { initChart() {
this.chart = echarts.init(this.$el, 'macarons'); this.chart = echarts.init(this.$el, "macarons");
this.setOptions(this.chartData); this.setOptions(this.chartData);
}, },
setOptions(chartdata) { setOptions(chartdata) {
echarts.registerMap('CHINA', geoJson); echarts.registerMap("CHINA", geoJson);
let statusArr=this.statusArr;
// //
this.chart.setOption({ this.chart.setOption({
backgroundColor: "#c3e2ee", backgroundColor: "#c3e2ee",
@ -80,8 +75,10 @@
tooltip: { tooltip: {
trigger: "item", trigger: "item",
formatter: function(val) { formatter: (val) => {
return "省份:"+val.name+"<br>当前进度: " + statusArr[val.data.itemStyle.status]; // return (
`省份:${val.name} <br>当前进度:${ this.statusArr.get(val.data?.itemStyle?.status) || "无" }`
); //
}, },
}, },
toolbox: { toolbox: {
@ -91,13 +88,14 @@
top: "center", top: "center",
feature: { feature: {
dataView: { dataView: {
readOnly: false readOnly: false,
}, },
restore: {}, restore: {},
saveAsImage: {}, saveAsImage: {},
}, },
}, },
series: [{ series: [
{
type: "map", type: "map",
map: "CHINA", //, map: "CHINA", //,
// //
@ -123,15 +121,16 @@
label: { label: {
show: true, // show: true, //
}, },
data: chartdata data: chartdata,
}], },
],
}); });
this.chart.on("click", function(params) { //params.name... this.chart.on("click", function (params) {
//params.name...
alert(params.data.code); alert(params.data.code);
console.log(JSON.stringify(params)); console.log(JSON.stringify(params));
}); });
},
} },
} };
}
</script> </script>

@ -1,51 +1,46 @@
<template> <template>
<div> <div>
<div class="statistics">
</div>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<Map :chartData="chartData" /> <Map :chartData="chartData" />
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<div class="grid-content bg-purple"></div> <DoughnutChart :chart-data="homeData.rate_list"></DoughnutChart>
</el-col> </el-col>
</el-row> </el-row>
<div class="chart"> <el-row>
<el-col :span="24">
</div> <AreaChat :chart-data="homeData.year_list"></AreaChat>
</el-col>
</el-row>
</div> </div>
</template> </template>
<script> <script>
import echarts from "echarts"
import PanelGroup from './components/PanelGroup'
import Map from './components/Map' import Map from './components/Map'
import DoughnutChart from "./components/DoughnutChart.vue";
import AreaChat from "./components/AreaChat.vue";
import { import {
getChartsHome getChartsHome
} from "../../api/dashboard.js" } from "@/api/dashboard.js"
import { import {
index as indexprogress index as indexprogress
} from "../../api/unifiedRecruitment/progress" } from "@/api/unifiedRecruitment/progress"
export default { export default {
components: { components: {
PanelGroup, DoughnutChart,
Map Map,
AreaChat
}, },
data() { data() {
return { return {
col: '', homeData:{
line: '', rate_list:[],
business_data: [], year_list:[]
collect_data: [], },
list: {},
customerArr: [],
orderArr: [],
chartData: {}, chartData: {},
colorArr: { colorArr: {
"1": "#dbebf8", "1": "#dbebf8",
@ -61,6 +56,10 @@
methods: { methods: {
async loadData() { async loadData() {
this.loadPress() this.loadPress()
this.loadHomeData()
},
loadHomeData(){
getChartsHome().then(res => this.homeData = res)
}, },
loadPress() { loadPress() {
indexprogress({ indexprogress({

@ -1,4 +1,5 @@
<script> <script>
import { index as filedIndex} from "@/api/unifiedRecruitment/templateFiled"
import { show as templateShow } from "@/api/unifiedRecruitment/template"; import { show as templateShow } from "@/api/unifiedRecruitment/template";
import { show, save } from "@/api/unifiedRecruitment/recruit"; import { show, save } from "@/api/unifiedRecruitment/recruit";
@ -6,7 +7,7 @@ export default {
render(h) { render(h) {
return ( return (
<Modal <Modal
title={this.type === "add" ? "新增统招生" : "编辑统招生"} title={this.type === "add" ? "新增信息" : "编辑信息"}
width="54" width="54"
value={this.isShow} value={this.isShow}
on={{ on={{
@ -85,7 +86,7 @@ export default {
v-model={this.originalForm.province_id} v-model={this.originalForm.province_id}
placeholder="请选择省份" placeholder="请选择省份"
> >
{this.province_ids.map((item) => { {this.provincesFormat.map((item) => {
return ( return (
<el-option <el-option
value={item.id} value={item.id}
@ -248,14 +249,17 @@ export default {
}, },
methods: { methods: {
async getTemplate() { async getTemplate() {
const res = await templateShow( const res = await filedIndex(
{ {
year: this.originalForm.year, template_item_id: this.originalForm.template_item_id,
template_id:this.originalForm.template_id,
page:1,
page_size:999
}, },
true true
); );
if (res?.fileds) { if (res?.data) {
res?.fileds.forEach((item) => { res?.data.forEach((item) => {
Object.defineProperty(this.form, item.en, { Object.defineProperty(this.form, item.en, {
value: "", value: "",
writable: true, writable: true,
@ -277,10 +281,16 @@ export default {
}); });
} }
this.formInfo = res?.fileds ?? []; this.formInfo = res?.data ?? [];
this.$forceUpdate(); this.$forceUpdate();
}, },
}, },
computed:{
provincesFormat(){
return this.$route.meta.params.type == 2 ? this.province_ids.filter(item => item.name == '江苏') : this.province_ids
}
},
watch: { watch: {
async isShow(newVal) { async isShow(newVal) {
if (newVal) { if (newVal) {

@ -42,7 +42,7 @@
:transfer="true" :transfer="true"
confirm confirm
title="确认要删除吗" title="确认要删除吗"
@on-ok="destroy"> @on-ok="destroy"
<Button type="error" ghost>删除</Button> <Button type="error" ghost>删除</Button>
</Poptip> </Poptip>
</template> </template>

@ -21,11 +21,17 @@
</el-select> </el-select>
</div> </div>
<div class="select__item"> <div class="select__item" v-if="$route.meta.params.type == 1">
<span></span> <span></span>
<span>更新统招进度为录取结束</span> <span>更新统招进度为录取结束</span>
<el-checkbox v-model="select.isEnd" :true-label="1" :false-label="0"></el-checkbox> <el-checkbox v-model="select.isEnd" :true-label="1" :false-label="0"></el-checkbox>
</div> </div>
<div class="select__item">
<span></span>
<span>更新邮寄信息</span>
<el-checkbox v-model="select.isEnd" :true-label="1" :false-label="0"></el-checkbox>
</div>
</div> </div>
<div class="upload"> <div class="upload">
@ -66,6 +72,7 @@ import {
} from '@/utils/auth' } from '@/utils/auth'
import {show as templateShow} from "@/api/unifiedRecruitment/template"; import {show as templateShow} from "@/api/unifiedRecruitment/template";
import { imports } from '@/api/unifiedRecruitment/recruit' import { imports } from '@/api/unifiedRecruitment/recruit'
import {index as filedIndex} from "@/api/unifiedRecruitment/templateFiled";
export default { export default {
props: { props: {
isShow: { isShow: {
@ -130,23 +137,21 @@ export default {
}, },
async getTemplate() { async getTemplate() {
const res = await templateShow( const res = await filedIndex({
{ template_item_id:this.select.template_item_id,
year: this.select.year, template_id:this.select.template_id,
type: this.$route.meta.params?.type, page:1,
}, page_size:999
true });
); let temp =
this.select.template_id = res.id; res?.data?.map((item) => {
this.newTable =
res?.fileds?.map((item) => {
return { return {
prop: item.en, prop: item.en,
label: item.name, label: item.name,
width: 140, width: 140,
}; };
}) ?? []; }) ?? [];
this.table = [...this.originalTable, ...this.newTable]; this.table = [...this.originalTable, ...temp];
}, },
submit(){ submit(){

@ -24,6 +24,7 @@
></el-date-picker> ></el-date-picker>
<el-select <el-select
ref="templateSelect"
v-model="select.template_item_id" v-model="select.template_item_id"
size="small" size="small"
placeholder="模板类型" placeholder="模板类型"
@ -57,8 +58,8 @@
<Button <Button
type="primary" type="primary"
@click=" @click="
($refs['addRecruit'].form.template_id = select.template_id), ($refs['addRecruit'].originalForm.template_id = select.template_id),
($refs['addRecruit'].form.template_item_id = ($refs['addRecruit'].originalForm.template_item_id =
select.template_item_id), select.template_item_id),
($refs['addRecruit'].type = 'add'), ($refs['addRecruit'].type = 'add'),
(isShowAdd = true) (isShowAdd = true)
@ -90,11 +91,12 @@
<Button <Button
type="primary" type="primary"
@click=" @click="
isShowTip = true,
($refs['importRecruitInfo'].select.template_item_id = select.template_item_id), ($refs['importRecruitInfo'].select.template_item_id = select.template_item_id),
($refs['importRecruitInfo'].select.year = select.year), ($refs['importRecruitInfo'].select.year = select.year),
(isShowImportRecruitInfo = true) (isShowImportRecruitInfo = true)
" "
>导入录取信息</Button >导入信息</Button
> >
</template> </template>
</header-content> </header-content>
@ -134,6 +136,17 @@
:is-show.sync="isShowImportRecruitInfo" :is-show.sync="isShowImportRecruitInfo"
@refresh="getList" @refresh="getList"
></importRecruitInfo> ></importRecruitInfo>
<el-dialog
title="提示"
:visible.sync="isShowTip"
width="30%"
center>
<span>当前选择导入的模板为{{ getTemplateItemName() }}</span>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="isShowTip = false"> </el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
@ -141,6 +154,7 @@
import { index, destroy, exports } from "@/api/unifiedRecruitment/recruit"; import { index, destroy, exports } from "@/api/unifiedRecruitment/recruit";
import { authMixin } from "@/mixin/authMixin"; import { authMixin } from "@/mixin/authMixin";
import { index as provinceIndex } from "@/api/manage/province"; import { index as provinceIndex } from "@/api/manage/province";
import { index as filedIndex } from "@/api/unifiedRecruitment/templateFiled"
import { import {
show as templateShow, show as templateShow,
index as templateIndex, index as templateIndex,
@ -161,6 +175,8 @@ export default {
}, },
data() { data() {
return { return {
isShowTip:false,
tipTemplate:"",
isShowImportRecruitInfo: false, isShowImportRecruitInfo: false,
isShowAdd: false, isShowAdd: false,
provinces: [], provinces: [],
@ -219,6 +235,9 @@ export default {
index, index,
destroy, destroy,
getTemplateItemName(){
return this.$refs['templateSelect']?.selected?.label
},
async getTemplateItemDetail() { async getTemplateItemDetail() {
if (!this.select.template_item_id) { if (!this.select.template_item_id) {
this.$message({ this.$message({
@ -227,20 +246,14 @@ export default {
}); });
return; return;
} }
// const res = await templateItemShow({ const res = await filedIndex({
// id: this.select.template_item_id, template_item_id:this.select.template_item_id,
// }); template_id:this.select.template_id,
page:1,
const res = await templateShow( page_size:999
{ });
year: this.select.year,
type: this.$route.meta.params?.type,
},
false
);
this.select.template_id = res.id;
let temp = let temp =
res?.fileds?.map((item) => { res?.data?.map((item) => {
return { return {
prop: item.en, prop: item.en,
label: item.name, label: item.name,
@ -248,6 +261,24 @@ export default {
}; };
}) ?? []; }) ?? [];
this.table = [...this.originalTable, ...temp]; this.table = [...this.originalTable, ...temp];
// const res = await templateShow(
// {
// year: this.select.year,
// type: this.$route.meta.params?.type,
// },
// false
// );
// this.select.template_id = res.id;
// let temp =
// res?.fileds?.map((item) => {
// return {
// prop: item.en,
// label: item.name,
// width: 140,
// };
// }) ?? [];
// this.table = [...this.originalTable, ...temp];
}, },
async getList() { async getList() {
this.$refs["xyTable"].loading = true; this.$refs["xyTable"].loading = true;
@ -308,7 +339,7 @@ export default {
async search() { async search() {
//await this.getTemplate(); //await this.getTemplate();
//await this.getTemplateItemDetail(); await this.getTemplateItemDetail();
await this.getList(); await this.getList();
}, },
@ -330,7 +361,7 @@ export default {
await this.getTemplateItemDetail(); await this.getTemplateItemDetail();
await this.getProvinces(); await this.getProvinces();
await this.getList(); await this.getList();
}, }
}; };
</script> </script>

Loading…
Cancel
Save