部分修改

dev
lion 2 months ago
parent 17ba62f2ca
commit bffa224316

@ -29,37 +29,37 @@
</div>
</div>
<div class="schedule" id="print">
<el-table :data="list" border style="width: 100%;height:300px;overflow: scroll;">
<el-table-column v-for="item in table_item" :key="item.prop" :prop="item.prop" :label="item.label"
:width="item.width?item.width:''" :align="item.align">
</el-table-column>
<!-- 课件列使用自定义模板 -->
<el-table-column label="课件" width="200" align="center">
<template slot-scope="scope">
<div v-if="scope.row.files && scope.row.files.length > 0">
<div v-for="file in scope.row.files" :key="file.id" class="file-item">
<el-link type="primary" @click="downloadFile(file)" :underline="false">
<i class="el-icon-document"></i>
{{ file.original_name }}
</el-link>
<div class="schedule" id="print">
<xy-table :list="list" :showIndex="false" :table-item="table_item" :is-page="false" :height="300">
<template v-slot:files>
<el-table-column align='center' label="课件" width="240" header-align="center">
<template slot-scope="scope">
<div v-if="scope.row.files && scope.row.files.length > 0">
<div v-for="file in scope.row.files" :key="file.id" class="file-item">
<el-link type="primary" @click="downloadFile(file)" :underline="false">
<i class="el-icon-document"></i>
{{ file.original_name }}
</el-link>
</div>
</div>
</div>
<span v-else class="no-files">暂无课件</span>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" :width="250" align="center">
<template slot-scope="scope">
<el-button type="primary" size="small" style='margin-left:5px;margin-bottom:5px;'
@click="editClass('editor',scope.row.id)">编辑</el-button>
<el-button type="success" size="small" style='margin-left:5px;margin-bottom:5px;'
@click="uploadMaterial(scope.row)">上传课件</el-button>
<el-popconfirm style="margin:0 10px" @confirm="deleteList(scope.row.id)" title="确定删除吗?">
<el-button type="danger" size="small" slot="reference">删除</el-button>
</el-popconfirm>
</template>
</el-table-column>
</el-table>
<span v-else class="no-files">暂无课件</span>
</template>
</el-table-column>
</template>
<template v-slot:btns>
<el-table-column align='left' fixed="right" label="操作" width="250" header-align="center">
<template slot-scope="scope">
<el-button type="primary" size="small" style='margin-left:5px;margin-bottom:5px;'
@click="editClass('editor',scope.row.id)">编辑</el-button>
<el-button type="success" size="small" style='margin-left:5px;margin-bottom:5px;'
@click="uploadMaterial(scope.row)">上传课件</el-button>
<el-popconfirm style="margin:0 10px" @confirm="deleteList(scope.row.id)" title="确定删除吗?">
<el-button type="danger" size="small" slot="reference">删除</el-button>
</el-popconfirm>
</template>
</el-table-column>
</template>
</xy-table>
</div>
<template v-slot:footer>
<el-button plain type="primary" plain style='margin-left:5px;margin-bottom:5px;'
@ -167,7 +167,8 @@
prop: 'theme',
label: '授课主题',
align: 'center',
width: 120,
width: 120,
fixed:'left'
},{
prop: 'date',
label: '上课日期',
@ -222,7 +223,12 @@
label: '老师简介',
align: 'left',
width: 240,
}],
},{
prop: 'files',
label: '课件',
align: 'left',
width: 240,
},],
materialDialogVisible: false, //
selectedCourse: {}, //
uploadAction: `${process.env.VUE_APP_UPLOAD_API}`, // URL

@ -24,7 +24,21 @@
</el-select>
</div>
</div>
</template>
</template>
<template v-slot:is_chart>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>是否统计
</div>
<div class="xy-table-item-content">
<el-select v-model="form.is_chart" placeholder="请选择是否统计" style="width: 100%;">
<el-option v-for="item in [{id:0,value:'否'},{id:1,value:'是'}]" :key="item.id" :label="item.value" :value="item.id">
</el-option>
</el-select>
</div>
</div>
</template>
<template v-slot:wait_tip>
<div class="xy-table-item">
@ -100,6 +114,7 @@
form: {
name:'',
status:1,
is_chart:0,
wait_tip:"",
pass_tip:"",
fault_tip:'',
@ -141,7 +156,9 @@
id: this.id
}).then(res => {
this.form = this.base.deepCopy(res)
this.form.status = res.status?res.status:0
this.form.status = res.status?res.status:0
this.form.is_chart = res.is_chart?res.is_chart:0
})
},
@ -159,6 +176,7 @@
this.form = {
name:'',
status:1,
is_chart:0,
wait_tip:"",
pass_tip:"",
fault_tip:'',

@ -219,19 +219,19 @@
//
const total = res.courseTypes.reduce((sum, item) => {
// year_total
const yearTotal = Number(item.year_total ?? 0);
const yearTotal = Number(item.course_signs_total ?? 0);
return sum + yearTotal;
}, 0);
res.courseTypes.map((item,index)=>{
const yearTotal = Number(item.year_total ?? 0);
const yearTotal = Number(item.course_signs_total ?? 0);
// 00
const ratio = total === 0 ? 0 : (yearTotal / total);
this.pieData.push(
{
name: item.name,
value: item.year_total?item.year_total:0,
value: item.course_signs_total?item.course_signs_total:0,
color: this.colorList[index],
percentage: Number(ratio.toFixed(2))*100
percentage: Number(ratio * 100).toFixed(2)
}
)
})
@ -371,87 +371,66 @@
},
show: false
},
geo: {
map: 'suzhou',
roam: false,
zoom: 1.0,
center: [120.65, 31.32],
itemStyle: {
borderColor: 'transparent',
borderWidth: 5,
areaColor: 'rgba(59, 130, 246, 0.1)',
shadowBlur: 2,
shadowColor: 'rgba(0, 0, 0, 0.3)'
},
emphasis: {
itemStyle: {
areaColor: 'rgba(59, 130, 246, 0.3)',
borderColor: 'transparent',
borderWidth: 5,
shadowBlur: 10,
shadowColor: 'rgba(59, 130, 246, 0.5)'
}
}
},
series: [{
name: '校友分布',
type: 'map',
map: 'suzhou',
roam: false,
zoom: 1.0,
center: [120.65, 31.32],
data: this.mapData.map(item => ({
name: item.name,
value: item.value,
itemStyle: item.name === '工业园区' ? {
borderColor: 'red',
borderWidth: 2,
areaColor: 'rgba(255, 0, 0, 0.3)'
} : undefined
})),
itemStyle: {
borderColor: 'transparent',
borderWidth: 5,
shadowBlur: 2,
shadowColor: 'rgba(0, 0, 0, 0.3)'
},
emphasis: {
name: '校友分布',
type: 'map',
map: 'suzhou',
roam: false,
zlevel: 1,
zoom: 1.0,
center: [120.65, 31.32],
data: this.mapData.map(item => ({
name: item.name,
value: item.value,
itemStyle: item.name === '工业园区' ? {
borderColor: 'red',
borderWidth: 2,
areaColor: 'rgba(255, 0, 0, 0.3)'
} : undefined
})),
itemStyle: {
areaColor: 'rgba(59, 130, 246, 0.5)',
borderColor: 'transparent',
borderWidth: 5,
shadowBlur: 10,
shadowColor: 'rgba(59, 130, 246, 0.5)'
}
},
label: {
show: true,
position: 'outside',
color: '#333',
fontSize: 11,
fontWeight: 'bold',
padding: [6, 12],
backgroundColor: 'rgba(255, 255, 255, 0.95)',
borderRadius: 15,
borderColor: '#1ea8f9',
borderWidth: 2,
shadowBlur: 8,
shadowColor: 'rgba(0, 0, 0, 0.2)',
formatter: function(params) {
return params.name + ': ' + (params.value || 0) + '人'
}
},
labelLine: {
show: true,
length: 20,
length2: 15,
lineStyle: {
color: 'rgba(255, 255, 255, 0.8)',
width: 2,
type: 'solid'
shadowBlur: 2,
shadowColor: 'rgba(0, 0, 0, 0.3)'
},
emphasis: {
itemStyle: {
areaColor: 'rgba(59, 130, 246, 0.5)',
borderColor: 'transparent',
borderWidth: 5,
shadowBlur: 10,
shadowColor: 'rgba(59, 130, 246, 0.5)'
}
},
label: {
show: true,
position: 'outside',
color: '#333',
fontSize: 11,
fontWeight: 'bold',
padding: [6, 12],
backgroundColor: 'rgba(255, 255, 255, 0.95)',
borderRadius: 15,
borderColor: '#1ea8f9',
borderWidth: 2,
shadowBlur: 8,
shadowColor: 'rgba(0, 0, 0, 0.2)',
formatter: function(params) {
return params.name + ': ' + (params.value || 0) + '人'
}
},
labelLine: {
show: true,
length: 20,
length2: 15,
lineStyle: {
color: 'rgba(255, 255, 255, 0.8)',
width: 2,
type: 'solid'
}
}
}
}]
}]
}
this.mapChartInstance.setOption(option)

@ -26,13 +26,13 @@
</div>
</div>
</template>
<template v-slot:company_tag>
<template v-slot:tag>
<div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>行业标签
</div>
<div class="xy-table-item-content">
<el-select v-model="form.company_tag" placeholder="请选择行业类型" clearable style="width: 100%;">
<el-select v-model="form.tag" placeholder="请选择行业类型" clearable style="width: 100%;">
<el-option v-for="(item,index) in formSelect.company_tag" :key="index" :label="item.value" :value="item.value">
</el-option>
</el-select>
@ -171,7 +171,7 @@
form: {
company_name: '',
company_attribute: '',
company_tag: '',
tag: '',
company_scale: '',
company_date: '',
company_legal_representative: '',
@ -193,7 +193,7 @@
required: true,
message: '请选择行业类型'
}],
company_tag: [{
tag: [{
required: true,
message: '请选择行业标签'
}]
@ -243,7 +243,7 @@
this.form = {
company_name: '',
company_attribute: '',
company_tag: '',
tag: '',
company_scale: '',
company_date: '',
company_legal_representative: '',

@ -64,12 +64,12 @@
</template>
</el-table-column>
</template>
<template v-slot:company_tag>
<template v-slot:tag>
<el-table-column align='center' label="行业标签" width="120" header-align="center">
<template slot-scope="scope">
<div v-for="item in formSelect.company_tag">
<el-tag v-if="item.value===scope.row.company_tag"
:type="item.remark?item.remark:''">{{scope.row.company_tag}}</el-tag>
<el-tag v-if="item.value===scope.row.tag"
:type="item.remark?item.remark:''">{{scope.row.tag}}</el-tag>
</div>
</template>
</el-table-column>
@ -149,7 +149,7 @@
align: 'center',
width: 120
}, {
prop: 'company_tag',
prop: 'tag',
label: '标签',
align: 'center',
width: 160,

Loading…
Cancel
Save