Merge remote-tracking branch 'origin/main'

main
hshansha 5 months ago
commit d1d1802989

@ -0,0 +1,25 @@
<template>
<el-table-column v-if="!isLeaf" :label="column.label" header-align="center">
<template v-for="child in column.children">
<table-column :key="child.label" :column="child" />
</template>
</el-table-column>
<el-table-column v-else :label="column.label" :prop="column.prop" header-align="center"/>
</template>
<script>
export default {
name: 'TableColumn',
props: {
column: Object
},
created() {
// console.log(this.column,9999);
},
computed: {
isLeaf() {
return !this.column.children || this.column.children.length === 0;
}
}
}
</script>

@ -356,7 +356,7 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="评分选项" align="center" prop="options" min-width="220" :show-overflow-tooltip="true"> <!-- <el-table-column label="评分选项" align="center" prop="options" min-width="220" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.$index=== pcSetUp.xzhIndex && scope.row.typeId===1"> <div v-if="scope.$index=== pcSetUp.xzhIndex && scope.row.typeId===1">
<el-select :disabled="scope.row.vote.id && !(new Date(scope.row.vote.sTime) > (new Date()))" <el-select :disabled="scope.row.vote.id && !(new Date(scope.row.vote.sTime) > (new Date()))"
@ -375,7 +375,7 @@
</div> </div>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>-->
<el-table-column label="最大值" align="center" prop="vote" min-width="220" :show-overflow-tooltip="true"> <el-table-column label="最大值" align="center" prop="vote" min-width="220" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.$index=== pcSetUp.xzhIndex && scope.row.typeId!==1"> <div v-if="scope.$index=== pcSetUp.xzhIndex && scope.row.typeId!==1">
@ -398,11 +398,6 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="状态" align="center" prop="vote" min-width="220" :show-overflow-tooltip="true">
<template slot-scope="scope">
<dict-tag :options="dict.type.kh_state" :value="scope.row.vote.state"/>
</template>
</el-table-column>
<el-table-column label="开始时间" align="center" prop="vote" min-width="220" :show-overflow-tooltip="true"> <el-table-column label="开始时间" align="center" prop="vote" min-width="220" :show-overflow-tooltip="true">
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.$index=== pcSetUp.xzhIndex"> <div v-if="scope.$index=== pcSetUp.xzhIndex">
@ -452,6 +447,11 @@
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="状态" align="center" prop="vote" min-width="100" :show-overflow-tooltip="true">
<template slot-scope="scope">
<dict-tag :options="dict.type.kh_state" :value="scope.row.vote.state"/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="180"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
@ -1123,7 +1123,7 @@ export default {
item.vote.pingceId = this.pcSetUp.pingceId; item.vote.pingceId = this.pcSetUp.pingceId;
item.vote.pingceName = this.pcSetUp.pingceName; item.vote.pingceName = this.pcSetUp.pingceName;
} }
if(item.vote.voteItems){ /*if(item.vote.voteItems){
item.vote.voteItems = item.vote.voteItems.split(','); item.vote.voteItems = item.vote.voteItems.split(',');
let VoteItemsName = [] let VoteItemsName = []
item.vote.voteItems.forEach(e => { item.vote.voteItems.forEach(e => {
@ -1134,7 +1134,7 @@ export default {
}) })
}) })
item.vote['voteItemsName'] = VoteItemsName.join(','); item.vote['voteItemsName'] = VoteItemsName.join(',');
} }*/
pcSetUpList.push(item); pcSetUpList.push(item);
}) })
this.pcSetUp.list = pcSetUpList; this.pcSetUp.list = pcSetUpList;
@ -1184,12 +1184,12 @@ export default {
type: 'Danger' type: 'Danger'
}) })
} }
if(row.typeId===1 && (!Vote.voteItems)){ /*if(row.typeId===1 && (!Vote.voteItems)){
flag = false; flag = false;
this.$alert(`评分选项不能为空!`, `提示`, { this.$alert(`评分选项不能为空!`, `提示`, {
type: 'Danger' type: 'Danger'
}) })
} }*/
if(row.typeId!==1 && (!Vote.maxNum)){ if(row.typeId!==1 && (!Vote.maxNum)){
flag = false; flag = false;
this.$alert(`最大值不能为空!`, `提示`, { this.$alert(`最大值不能为空!`, `提示`, {
@ -1208,24 +1208,29 @@ export default {
type: 'Danger' type: 'Danger'
}) })
} }
if(!Vote.vDescription){ /*if(!Vote.vDescription){
flag = false; flag = false;
this.$alert(`评分详情描述不能为空!`, `提示`, { this.$alert(`评分详情描述不能为空!`, `提示`, {
type: 'Danger' type: 'Danger'
}) })
}*/
if(row.typeId===1){
Vote.voteItems = '1,2,3,4'
} }
if (Vote.id != null && flag ) { if (Vote.id != null && flag ) {
if(Vote.voteItems){ /*if(Vote.voteItems){
Vote.voteItems = Vote.voteItems.join(',') Vote.voteItems = Vote.voteItems.join(',')
} }*/
updateVote(Vote).then(response => { updateVote(Vote).then(response => {
this.$modal.msgSuccess("修改成功") this.$modal.msgSuccess("修改成功")
this.cancelVote() this.cancelVote()
}) })
} else if(Vote.id === null && flag){ } else if(Vote.id === null && flag){
if(Vote.voteItems){ /*if(Vote.voteItems){
Vote.voteItems = Vote.voteItems.join(',') Vote.voteItems = Vote.voteItems.join(',')
} }*/
Vote.state = '0' Vote.state = '0'
addVote(Vote).then(response => { addVote(Vote).then(response => {
this.$modal.msgSuccess("新增成功") this.$modal.msgSuccess("新增成功")

@ -1,6 +1,6 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<div> <!-- <div>
<div style="display: flex;align-items: center;"> <div style="display: flex;align-items: center;">
<div class="btsz">标题</div><el-input v-model="setData.title" placeholder="请输入标题名称" style="width: 300px;" disabled/> <div class="btsz">标题</div><el-input v-model="setData.title" placeholder="请输入标题名称" style="width: 300px;" disabled/>
</div> </div>
@ -147,7 +147,7 @@
<el-button size="small" disabled>添加下级标题</el-button> <el-button size="small" disabled>添加下级标题</el-button>
<el-button size="small" disabled>添加考核任务</el-button> <el-button size="small" disabled>添加考核任务</el-button>
</div> </div>
</div> </div>-->
<div style="padding: 50px 0;"> <div style="padding: 50px 0;">
<el-button type="primary" @click="khdf.open=true"></el-button> <el-button type="primary" @click="khdf.open=true"></el-button>
@ -269,14 +269,611 @@
</div> </div>
</el-dialog> </el-dialog>
<el-table border :data="list1">
<template v-for="column in btTabel">
<table-column :key="column.label" :column="column" />
</template>
</el-table>
</div> </div>
</template> </template>
<script> <script>
import TableColumn from '@/components/TableColumn'
export default { export default {
name: "index", name: "index",
components: { TableColumn },
data() { data() {
return { return {
btTabel:[{
"name": null,
"label": "民主测评",
"children": [{
"name": "khdxName",
"label": "单位"
},
{
"name": "mzcp",
"label": "民主测评",
"children": [{
"name": "syldbz",
"label": "师院领导班子",
"children": [{
"name": "optionA",
"label": "优秀"
},
{
"name": "optionB",
"label": "合格"
},
{
"name": "optionC",
"label": "基本合格"
},
{
"name": "optionD",
"label": "不合格"
},
{
"name": "avgScore",
"label": "得分"
},
{
"name": "percentage",
"label": "占比"
}
]
},
{
"name": "sycjldgb",
"label": "师院处级领导干部",
"children": [{
"name": "optionA",
"label": "优秀"
},
{
"name": "optionB",
"label": "合格"
},
{
"name": "optionC",
"label": "基本合格"
},
{
"name": "optionD",
"label": "不合格"
},
{
"name": "avgScore",
"label": "得分"
},
{
"name": "percentage",
"label": "占比"
}
]
},
{
"name": "fwdxdb",
"label": "服务对象代表",
"children": [{
"name": "optionA",
"label": "优秀"
},
{
"name": "optionB",
"label": "合格"
},
{
"name": "optionC",
"label": "基本合格"
},
{
"name": "optionD",
"label": "不合格"
},
{
"name": "avgScore",
"label": "得分"
},
{
"name": "percentage",
"label": "占比"
}
]
}
]
},
{
"name": "df",
"label": "得分"
}
]
}],
list1:[
{
"khdxName": "生命科学系",
"mzcp": {
"syldbz": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.3
},
"sycjldgb": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.3
},
"fwdxdb": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.4
}
},
"df": 0
},
{
"khdxName": "海洋学院",
"mzcp": {
"syldbz": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.3
},
"sycjldgb": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.3
},
"fwdxdb": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.4
}
},
"df": 0
},
{
"khdxName": "历史文化与法学系",
"mzcp": {
"syldbz": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.3
},
"sycjldgb": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.3
},
"fwdxdb": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.4
}
},
"df": 0
},
{
"khdxName": "物理科学与技术学院",
"mzcp": {
"syldbz": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.3
},
"sycjldgb": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.3
},
"fwdxdb": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.4
}
},
"df": 0
},
{
"khdxName": "教育学院",
"mzcp": {
"syldbz": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.3
},
"sycjldgb": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.3
},
"fwdxdb": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.4
}
},
"df": 0
},
{
"khdxName": "资源管理系",
"mzcp": {
"syldbz": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.3
},
"sycjldgb": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.3
},
"fwdxdb": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.4
}
},
"df": 0
},
{
"khdxName": "马克思主义学院",
"mzcp": {
"syldbz": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.3
},
"sycjldgb": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.3
},
"fwdxdb": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.4
}
},
"df": 0
},
{
"khdxName": "美术学院",
"mzcp": {
"syldbz": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.3
},
"sycjldgb": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.3
},
"fwdxdb": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.4
}
},
"df": 0
},
{
"khdxName": "计算机科学技术系",
"mzcp": {
"syldbz": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.3
},
"sycjldgb": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.3
},
"fwdxdb": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.4
}
},
"df": 0
},
{
"khdxName": "化学系",
"mzcp": {
"syldbz": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.3
},
"sycjldgb": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.3
},
"fwdxdb": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.4
}
},
"df": 0
},
{
"khdxName": "数学与计算科学学院",
"mzcp": {
"syldbz": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.3
},
"sycjldgb": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.3
},
"fwdxdb": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.4
}
},
"df": 0
},
{
"khdxName": "继续教育学院",
"mzcp": {
"syldbz": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.3
},
"sycjldgb": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.3
},
"fwdxdb": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.4
}
},
"df": 0
},
{
"khdxName": "外国语学院",
"mzcp": {
"syldbz": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.3
},
"sycjldgb": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.3
},
"fwdxdb": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.4
}
},
"df": 0
},
{
"khdxName": "体育系",
"mzcp": {
"syldbz": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.3
},
"sycjldgb": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.3
},
"fwdxdb": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.4
}
},
"df": 0
},
{
"khdxName": "文学院",
"mzcp": {
"syldbz": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.3
},
"sycjldgb": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.3
},
"fwdxdb": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.4
}
},
"df": 0
},
{
"khdxName": "音乐系",
"mzcp": {
"syldbz": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.3
},
"sycjldgb": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.3
},
"fwdxdb": {
"optionA": 0,
"optionB": 0,
"optionC": 0,
"optionD": 0,
"avgScore": 0,
"percentage": 0.4
}
},
"df": 0
}
],
"data": [ "data": [
{ {
"name": null, "name": null,
@ -718,6 +1315,39 @@ export default {
label: '综合评价' label: '综合评价'
}], }],
} }
},
created() {
this.setTreeData();
},
methods:{
setTreeData(){
let btTabelTree = this.btTabel;
btTabelTree.forEach(item => {
if(item.prop){
item.prop = item.name;
}
if(item.children && item.children.length>0){
this.setProp(item.children, item.prop)
}
})
this.btTabel = btTabelTree;
console.log(btTabelTree,999999999999);
},
setProp(list, prop){
console.log(list,88888);
list.forEach(item=>{
if(prop){
item.prop = prop+'.'+item.name;
}else {
item.prop = item.name;
}
if(item.children && item.children.length>0){
this.setProp(item.children, item.prop)
}
})
}
} }
} }
</script> </script>

Loading…
Cancel
Save