Commit 08cb82fb authored by 黄奎's avatar 黄奎

页面修改

parent 818610e6
......@@ -97,7 +97,6 @@
this.loading = true;
queryAssessmentTypeList(this.msg).then(res => {
this.loading = false;
console.log("res", res);
if (res.Code == 1) {
this.dataList = res.Data;
}
......
<style scoped>
.jobTable {
width: 100%;
text-align: center;
}
.jobTable tr td {
height: 40px;
color: #000;
border: 1px solid #d1d1d1;
}
.jobTable tr th {
height: 40px;
background-color: rgb(238, 238, 239);
}
</style>
<template>
......@@ -22,9 +7,8 @@
</div>
<div class="page-content">
<!-- <q-table :pagination="msg" :loading="loading" no-data-label="暂无相关数据" flat
class="sticky-column-table sticky-right-column-table" separator="none" :data="dataList" :columns="columns"
row-key="name">
<q-table :pagination="msg" :loading="loading" no-data-label="暂无相关数据" flat separator="Cell" :data="dataList"
:columns="columns" row-key="name">
<template v-slot:top>
<div class="col-2 q-table__title">类型配置</div>
<q-space />
......@@ -32,56 +16,62 @@
<q-btn color="accent" size="sm" class="q-mr-md" icon="add" label="新增" @click="AddMsg(null)" />
</div>
</template>
<template v-slot:body="props">
<template v-slot:header="props">
<q-tr :props="props">
<template v-for="(col,cIndex) in props.cols">
<q-td v-if="col.name == 'TypeName'" :key="cIndex">{{ col.value }}</q-td>
<q-td v-else-if="col.name == 'SubtypeList'" :key="cIndex">
<div v-for="(item,sIndex) in col.value" :key="sIndex">
<div class="border-bottom">
{{item.SubTypeName}}
</div>
</div>
</q-td>
<q-td style="width:100px;" v-else-if="col.name == 'Id'" :key="cIndex">
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="编辑"
@click="AddMsg(props.row)" />
<q-btn flat size="xs" icon="delete" color="negative" class="q-mr-xs" label="删除"
@click="delConsult(props.row.Id)" />
</q-td>
<template v-for="col in props.cols" :props="props">
<q-th :key="col.name">
{{ col.label }}
</q-th>
</template>
</q-tr>
</template>
<template v-slot:body="props">
<template :props="props" v-for="(col,cIndex) in props.row.SubtypeList">
<template v-if="cIndex==0">
<q-tr :key="cIndex" style="border-top:1px solid red">
<q-td key="TypeName" :props="props" :rowspan="props.row.SubtypeList.length"
style="border-top:1px solid rgba(0,0,0,0.12)">
{{ props.row.TypeName }}
</q-td>
<q-td style="border-top:1px solid rgba(0,0,0,0.12)">
{{ props.row.SubtypeList[cIndex].SubTypeName}}
</q-td>
<template v-for="(subItem,subIndex) in props.row.SubtypeList[cIndex].OptionList">
<q-td :key="subIndex" style="border-top:1px solid rgba(0,0,0,0.12)">
<div style="width:180px;white-space:normal; "> {{subItem.LevelDesc}} <q-badge color="green">
{{subItem.LevelScore}}
</q-badge>
</div>
</q-td>
</template>
<q-td key="Id" :props="props" :rowspan="props.row.SubtypeList.length"
style="border-top:1px solid rgba(0,0,0,0.12)">
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="编辑"
@click="AddMsg(props.row)" />
<q-btn flat size="xs" icon="delete" color="negative" class="q-mr-xs" label="删除"
@click="delConsult(props.row.Id)" />
</q-td>
</q-tr>
</template>
<template v-else>
<q-tr :key="cIndex">
<q-td>
{{ props.row.SubtypeList[cIndex].SubTypeName}}
</q-td>
<template v-for="(subItem,subIndex) in props.row.SubtypeList[cIndex].OptionList">
<q-td :key="subIndex">
<div style="width:180px;white-space:normal; "> {{subItem.LevelDesc}} <q-badge color="green">
{{subItem.LevelScore}}
</q-badge>
</div>
</q-td>
</template>
</q-tr>
</template>
</template>
</template>
<template v-slot:bottom></template>
</q-table> -->
<table class="jobTable" style="border-collapse:collapse;">
<tbody v-for="(item,index) in dataList" :key="index">
<tr>
<th width="150">类别</th>
<th width="150">内容</th>
<th v-for="(T,tindex) in item.SubtypeList[0].OptionList">
<div>{{T.LevelTitle}}</div>
<div>{{T.LevelScore}}</div>
</th>
<th width="200">操作</th>
</tr>
<tr>
<td :rowspan="item.SubtypeList.length+1">{{item.TypeName}}</td>
</tr>
<tr v-for="(sItem,sIndex) in item.SubtypeList">
<td>{{sItem.SubTypeName}}</td>
<td v-for="(cItem,cIndex) in sItem.OptionList" style="text-align:left;padding:10px;">
{{cItem.LevelDesc}}
</td>
<td v-if="sIndex==0" :rowspan="item.SubtypeList.length">
<q-btn flat size="xs" icon="edit" color="accent" style="font-weight:400" label="编辑"
@click="AddMsg(item)" />
<q-btn flat size="xs" icon="delete" color="negative" class="q-mr-xs" label="删除"
@click="delConsult(item.Id)" />
</td>
</tr>
</tbody>
</table>
</q-table>
</div>
<assess-form v-if="isShowAssess" :save-obj="objOption" @close="getClose()" @success="getRefresh"></assess-form>
</div>
......@@ -105,24 +95,7 @@
msg: {
rowsPerPage: 1000,
},
columns: [{
name: "TypeName",
label: "类别",
field: "TypeName",
align: "left"
},
{
name: "SubtypeList",
label: "内容",
field: "SubtypeList",
align: "left"
},
{
name: 'Id',
label: '操作',
field: row => row.Id
}
],
columns: [],
dataList: [],
objOption: null,
isShowAssess: false
......@@ -139,9 +112,36 @@
this.loading = true;
queryAssessmentTypeList(this.msg).then(res => {
this.loading = false;
console.log("res", res);
if (res.Code == 1) {
this.dataList = res.Data;
this.columns.push({
name: "TypeName",
label: "类别",
field: "TypeName",
align: "left"
});
this.columns.push({
name: "SubtypeList",
label: "内容",
field: "SubtypeList",
align: "left"
});
if (this.dataList && this.dataList.length > 0) {
this.dataList[0].SubtypeList[0].OptionList.forEach(item => {
this.columns.push({
name: item.LevelTitle,
label: item.LevelTitle,
field: item.LevelTitle,
align: "left"
})
})
}
this.columns.push({
name: 'Id',
label: '操作',
field: row => row.Id
})
}
})
},
......@@ -195,9 +195,7 @@
}
}
}
</script>
<style lang="sass">
@import url('~assets/css/table.sass')
</style>
</style>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment