|
@@ -1,244 +1,345 @@
|
|
|
<template>
|
|
|
- <div class="art-exam-container">
|
|
|
- <Split v-model="split">
|
|
|
- <div class="demo-split-pane" slot="left">
|
|
|
- <div class="art-mgt-top light-iview-select light-iview-input">
|
|
|
- <span>{{$t('ae.ae28')}}</span>
|
|
|
- <span class="to-create-art" @click="toCreate">
|
|
|
- <Icon type="md-add" />
|
|
|
- </span>
|
|
|
- <span class="to-create-art" @click="delArt">
|
|
|
- <Icon type="md-trash" />
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- <vuescroll>
|
|
|
- <div :class="['art-item', curIndex == index ? 'art-item-active' : '']" v-for="(item,index) in artList" :key="item.id" @click="selectArt(index)">
|
|
|
- <p class="art-name">{{item.name}}</p>
|
|
|
- <p class="art-date"><Icon type="md-time" size="16"/>{{$jsFn.dateFormat(item.startTime)}}-{{$jsFn.dateFormat(item.endTime)}}</p>
|
|
|
- </div>
|
|
|
- </vuescroll>
|
|
|
- <EmptyData v-show="!artList.length" :top="100"></EmptyData>
|
|
|
- </div>
|
|
|
- <div class="art-content" slot="right">
|
|
|
- <vuescroll>
|
|
|
- <Tabs v-model="tabName">
|
|
|
- <TabPane
|
|
|
- v-for="(item, index) in tabListShow"
|
|
|
- :key="index"
|
|
|
- :label="item.label"
|
|
|
- :name="item.name"
|
|
|
- >
|
|
|
- <AcQuos :artInfo="artInfo" :treeData="treeData" :classList="classList"></AcQuos>
|
|
|
- </TabPane>
|
|
|
- </Tabs>
|
|
|
- </vuescroll>
|
|
|
- </div>
|
|
|
+ <div class="art-exam-container">
|
|
|
+ <Split v-model="split">
|
|
|
+ <div class="demo-split-pane" slot="left">
|
|
|
+ <div class="art-mgt-top light-iview-select light-iview-input">
|
|
|
+ <span>{{$t('ae.ae28')}}</span>
|
|
|
+ <span class="to-create-art" @click="toCreate">
|
|
|
+ <Icon type="md-add" />
|
|
|
+ </span>
|
|
|
+ <span class="to-create-art" @click="delArt">
|
|
|
+ <Icon type="md-trash" />
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <vuescroll>
|
|
|
+ <div :class="['art-item', curIndex == index ? 'art-item-active' : '']" v-for="(item,index) in artList" :key="item.id" @click="selectArt(index)">
|
|
|
+ <p class="art-name">{{item.name}}</p>
|
|
|
+ <p class="art-date">
|
|
|
+ <Icon type="md-time" size="16" />{{$jsFn.dateFormat(item.startTime)}}-{{$jsFn.dateFormat(item.endTime)}}
|
|
|
+ </p>
|
|
|
+ </div>
|
|
|
+ </vuescroll>
|
|
|
+ <EmptyData v-show="!artList.length" :top="100"></EmptyData>
|
|
|
+ </div>
|
|
|
+ <div class="art-content" slot="right">
|
|
|
+ <div class="art-exam-bar">
|
|
|
+ <!-- 数据概览 -->
|
|
|
+ <span :class="curBarIndex == 0 ? 'art-exam-bar-item line-bottom-active line-bottom':'art-exam-bar-item line-bottom'" @click="selectBar(0)">
|
|
|
+ 数据概览
|
|
|
+ </span>
|
|
|
+ <!-- 评价指标 -->
|
|
|
+ <span :class="curBarIndex == 1 ? 'art-exam-bar-item line-bottom-active line-bottom':'art-exam-bar-item line-bottom'" @click="selectBar(1)">
|
|
|
+ 评价指标
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ <DataView :artInfo="artInfo" :quotaFirstLevel="quotaFirstLevel" :classList="classList" v-if="curBarIndex === 0"></DataView>
|
|
|
+ <div v-else-if="curBarIndex === 1">
|
|
|
+ <vuescroll>
|
|
|
+ <Tabs v-model="tabName" style="padding: 0px 10px;margin-top:15px">
|
|
|
+ <template slot="extra">
|
|
|
+ <div class="art-filter-wrap">
|
|
|
+ <span>{{$t('ae.ae6')}}:</span>
|
|
|
+ <Select v-model="classId" style="width: 200px">
|
|
|
+ <Option v-for="item in classList" :value="item.id" :key="item.id">{{ item.name }}</Option>
|
|
|
+ </Select>
|
|
|
+ <span style="margin-left:10px">{{$t('ae.ae4')}}:</span>
|
|
|
+ <Select v-model="subjectId" style="width: 120px">
|
|
|
+ <Option v-for="item in subjectList" :value="item.id" :key="item.id">{{ item.name }}</Option>
|
|
|
+ </Select>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <TabPane v-for="(item, index) in tabListShow" :key="index" :label="item.label" :name="item.name">
|
|
|
+ <AcQuos :artInfo="artInfo" :treeData="treeData" :curClass="curClass" :subjectId="subjectId"></AcQuos>
|
|
|
+ </TabPane>
|
|
|
+ </Tabs>
|
|
|
+ </vuescroll>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</Split>
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import AcQuos from "./AcQuos.vue"
|
|
|
+import DataView from "./DataView.vue"
|
|
|
export default {
|
|
|
- components:{
|
|
|
- AcQuos
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- tabName:'',
|
|
|
- split:0.25,
|
|
|
- artList: [],
|
|
|
- artInfo:{},
|
|
|
- curIndex:0,
|
|
|
- quotas:[],
|
|
|
- tabListShow:[],
|
|
|
- tabList:[],
|
|
|
- classList:[]
|
|
|
- }
|
|
|
- },
|
|
|
- computed:{
|
|
|
- treeData(){
|
|
|
- if(this.tabName && this.quotas.length){
|
|
|
- let curQuo = this.quotas.find(q=>q.id === this.tabName)
|
|
|
- let _this = this
|
|
|
- const filterNodes = function(nodes) {
|
|
|
- nodes = nodes.filter(n=>{
|
|
|
- let isShow = _this.curSettings.find(c=> (n.children.length && c.id.includes(n.id)) || (!n.children.length && c.id == n.id))
|
|
|
- return !!isShow
|
|
|
- })
|
|
|
- nodes.forEach(node => {
|
|
|
- if(node.children){
|
|
|
- node.children = filterNodes(node.children)
|
|
|
- }
|
|
|
- })
|
|
|
- console.log('---',nodes)
|
|
|
- return nodes
|
|
|
- }
|
|
|
- let res = filterNodes(curQuo.children)
|
|
|
- return res
|
|
|
- }
|
|
|
- return []
|
|
|
- },
|
|
|
- curSettings(){
|
|
|
- if(this.tabName && this.artInfo?.settings){
|
|
|
- let data = this.artInfo.settings.filter(s=>{
|
|
|
- return s.id.includes(this.tabName)
|
|
|
+ components: {
|
|
|
+ AcQuos, DataView
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ tabName: '',
|
|
|
+ split: 0.2,
|
|
|
+ artList: [],
|
|
|
+ artInfo: {},
|
|
|
+ curIndex: 0,
|
|
|
+ quotas: [],
|
|
|
+ tabListShow: [],
|
|
|
+ tabList: [],
|
|
|
+ classList: [],
|
|
|
+ classId: '',
|
|
|
+ subjectId: '',
|
|
|
+ curBarIndex: 0
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ quotaFirstLevel(){
|
|
|
+ if(this.quotas.length && this.artInfo?.settings){
|
|
|
+ let levelMap = {}
|
|
|
+ this.artInfo.settings.forEach(setting=>{
|
|
|
+ let id = setting.path[0]
|
|
|
+ if(!levelMap[id]){
|
|
|
+ levelMap[id] = this.quotas.find(q=>q.id === id)?.name
|
|
|
+ }
|
|
|
})
|
|
|
- return data || []
|
|
|
- }
|
|
|
- return []
|
|
|
- }
|
|
|
- },
|
|
|
- methods: {
|
|
|
- /* 获取当前区级设置数据 */
|
|
|
- getAreaSetting() {
|
|
|
- this.$api.areaArt.findArtSetting({
|
|
|
- areaId: sessionStorage.getItem("areaId")
|
|
|
- }).then((res) => {
|
|
|
- if (res.setting) {
|
|
|
- this.quotas = res.setting.quotas
|
|
|
- this.tabList = this.quotas.map((q) => {
|
|
|
- return {
|
|
|
- name: q.id,
|
|
|
- label: q.name,
|
|
|
- children: q.children
|
|
|
- }
|
|
|
+ let data = []
|
|
|
+ for (const key in levelMap) {
|
|
|
+ data.push({
|
|
|
+ id:key,
|
|
|
+ name:levelMap[key]
|
|
|
})
|
|
|
- this.findArtList()
|
|
|
- } else{
|
|
|
- this.$Message.warning(this.$t('ae.ae30'))
|
|
|
}
|
|
|
- })
|
|
|
- },
|
|
|
- delArt(){
|
|
|
- this.$Modal.confirm({
|
|
|
- title:this.$t('ae.ae31'),
|
|
|
- content:`${this.$t('ae.ae32')}${this.artList[this.curIndex].name}?`,
|
|
|
- onOk:()=>{
|
|
|
- let requestData ={
|
|
|
- id:this.artList[this.curIndex].id,
|
|
|
- code: this.$store.state.userInfo.schoolCode
|
|
|
- }
|
|
|
- this.$api.areaArt.delArt(requestData).then(
|
|
|
- res=>{
|
|
|
- this.$Message.success(this.$t('ae.ae33'))
|
|
|
- let index = this.curIndex
|
|
|
- this.artList.splice(index,1)
|
|
|
- this.curIndex = 0
|
|
|
- },
|
|
|
- err=>{
|
|
|
- this.$Message.error(this.$t('ae.ae34'))
|
|
|
- }
|
|
|
- )
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- selectArt(index){
|
|
|
- this.curIndex = index
|
|
|
- this.findArtSummary()
|
|
|
- },
|
|
|
- toCreate() {
|
|
|
- this.$router.push({
|
|
|
- name: "createArtExam"
|
|
|
- })
|
|
|
- },
|
|
|
- toDetailPage(index) {},
|
|
|
- findArtList() {
|
|
|
- let params = {
|
|
|
- code: this.$store.state.userInfo.schoolCode
|
|
|
- }
|
|
|
- this.$api.areaArt.findArtList(params).then(
|
|
|
- (res) => {
|
|
|
- this.artList = res.arts
|
|
|
- if(this.artList.length) this.findArtSummary()
|
|
|
- },
|
|
|
- (err) => {}
|
|
|
- )
|
|
|
- },
|
|
|
- findArtSummary(){
|
|
|
- this.classList = []
|
|
|
- let params = {
|
|
|
- id:this.artList[this.curIndex].id,
|
|
|
- code: this.$store.state.userInfo.schoolCode
|
|
|
+ console.log('***',data)
|
|
|
+ return data
|
|
|
}
|
|
|
- this.$api.areaArt.findArtSummary(params).then(
|
|
|
- (res) => {
|
|
|
- this.artInfo = res.art
|
|
|
- this.tabListShow = this.tabList.filter(item=>{
|
|
|
- return !!this.artInfo.settings.find(s=>s.id.includes(item.name))
|
|
|
- })
|
|
|
- if(this.tabListShow.length){
|
|
|
- this.tabName = this.tabListShow[0].name
|
|
|
- }
|
|
|
- if(this.artInfo?.classes){
|
|
|
- this.getClassList()
|
|
|
- }
|
|
|
- },
|
|
|
- (err) => {}
|
|
|
- )
|
|
|
- },
|
|
|
- getClassList(){
|
|
|
- let req = {
|
|
|
+ return []
|
|
|
+ },
|
|
|
+ curClass() {
|
|
|
+ if (this.classList && this.classList.length && this.classId) {
|
|
|
+ return this.classList.find(item => item.id == this.classId)
|
|
|
+ }
|
|
|
+ return {}
|
|
|
+ },
|
|
|
+ subjectList() {
|
|
|
+ return this.artInfo?.subjects || []
|
|
|
+ },
|
|
|
+ treeData() {
|
|
|
+ if (this.tabName && this.quotas.length) {
|
|
|
+ let curQuo = this.quotas.find(q => q.id === this.tabName)
|
|
|
+ let _this = this
|
|
|
+ const filterNodes = function (nodes) {
|
|
|
+ nodes = nodes.filter(n => {
|
|
|
+ let isShow = _this.curSettings.find(c => (n.children.length && c.id.includes(n.id)) || (!n.children.length && c.id == n.id))
|
|
|
+ return !!isShow
|
|
|
+ })
|
|
|
+ nodes.forEach(node => {
|
|
|
+ if (node.children) {
|
|
|
+ node.children = filterNodes(node.children)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ console.log('---', nodes)
|
|
|
+ return nodes
|
|
|
+ }
|
|
|
+ let res = filterNodes(curQuo.children)
|
|
|
+ return res
|
|
|
+ }
|
|
|
+ return []
|
|
|
+ },
|
|
|
+ curSettings() {
|
|
|
+ if (this.tabName && this.artInfo?.settings) {
|
|
|
+ let data = this.artInfo.settings.filter(s => {
|
|
|
+ return s.id.includes(this.tabName)
|
|
|
+ })
|
|
|
+ return data || []
|
|
|
+ }
|
|
|
+ return []
|
|
|
+ }
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ selectBar(tab) {
|
|
|
+ this.curBarIndex = tab
|
|
|
+ },
|
|
|
+ /* 获取当前区级设置数据 */
|
|
|
+ getAreaSetting() {
|
|
|
+ this.$api.areaArt.findArtSetting({
|
|
|
+ areaId: sessionStorage.getItem("areaId")
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.setting) {
|
|
|
+ this.quotas = res.setting.quotas
|
|
|
+ this.tabList = this.quotas.map((q) => {
|
|
|
+ return {
|
|
|
+ name: q.id,
|
|
|
+ label: q.name,
|
|
|
+ children: q.children
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.findArtList()
|
|
|
+ } else {
|
|
|
+ this.$Message.warning(this.$t('ae.ae30'))
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ delArt() {
|
|
|
+ this.$Modal.confirm({
|
|
|
+ title: this.$t('ae.ae31'),
|
|
|
+ content: `${this.$t('ae.ae32')}${this.artList[this.curIndex].name}?`,
|
|
|
+ onOk: () => {
|
|
|
+ let requestData = {
|
|
|
+ id: this.artList[this.curIndex].id,
|
|
|
+ code: this.$store.state.userInfo.schoolCode
|
|
|
+ }
|
|
|
+ this.$api.areaArt.delArt(requestData).then(
|
|
|
+ res => {
|
|
|
+ this.$Message.success(this.$t('ae.ae33'))
|
|
|
+ let index = this.curIndex
|
|
|
+ this.artList.splice(index, 1)
|
|
|
+ this.curIndex = 0
|
|
|
+ },
|
|
|
+ err => {
|
|
|
+ this.$Message.error(this.$t('ae.ae34'))
|
|
|
+ }
|
|
|
+ )
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ selectArt(index) {
|
|
|
+ this.curIndex = index
|
|
|
+ this.findArtSummary()
|
|
|
+ },
|
|
|
+ toCreate() {
|
|
|
+ this.$router.push({
|
|
|
+ name: "createArtExam"
|
|
|
+ })
|
|
|
+ },
|
|
|
+ toDetailPage(index) { },
|
|
|
+ findArtList() {
|
|
|
+ let params = {
|
|
|
+ code: this.$store.state.userInfo.schoolCode
|
|
|
+ }
|
|
|
+ this.$api.areaArt.findArtList(params).then(
|
|
|
+ (res) => {
|
|
|
+ this.artList = res.arts
|
|
|
+ if (this.artList.length) this.findArtSummary()
|
|
|
+ },
|
|
|
+ (err) => { }
|
|
|
+ )
|
|
|
+ },
|
|
|
+ findArtSummary() {
|
|
|
+ this.classList = []
|
|
|
+ let params = {
|
|
|
+ id: this.artList[this.curIndex].id,
|
|
|
+ code: this.$store.state.userInfo.schoolCode
|
|
|
+ }
|
|
|
+ this.$api.areaArt.findArtSummary(params).then(
|
|
|
+ (res) => {
|
|
|
+ this.artInfo = res.art
|
|
|
+ this.tabListShow = this.tabList.filter(item => {
|
|
|
+ return !!this.artInfo.settings.find(s => s.id.includes(item.name))
|
|
|
+ })
|
|
|
+ if (this.tabListShow.length) {
|
|
|
+ this.tabName = this.tabListShow[0].name
|
|
|
+ }
|
|
|
+ if (this.artInfo?.classes) {
|
|
|
+ this.getClassList()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ (err) => { }
|
|
|
+ )
|
|
|
+ },
|
|
|
+ getClassList() {
|
|
|
+ let req = {
|
|
|
ids: this.artInfo.classes,
|
|
|
schoolId: this.$store.state.userInfo.schoolCode
|
|
|
}
|
|
|
this.$api.common.getGroupListByIds(req).then(
|
|
|
- res=>{
|
|
|
- this.classList = res.groups
|
|
|
- },
|
|
|
- err=>{
|
|
|
- this.$Message.error(this.$t('ae.ae35'))
|
|
|
+ res => {
|
|
|
+ this.classList = res.groups
|
|
|
+ },
|
|
|
+ err => {
|
|
|
+ this.$Message.error(this.$t('ae.ae35'))
|
|
|
+ }
|
|
|
+ )
|
|
|
+ },
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getAreaSetting()
|
|
|
+ },
|
|
|
+ watch:{
|
|
|
+ classList:{
|
|
|
+ immediate:true,
|
|
|
+ deep:true,
|
|
|
+ handler(n,o){
|
|
|
+ if(n && n.length){
|
|
|
+ this.classId = n[0].id
|
|
|
}
|
|
|
- )
|
|
|
+ }
|
|
|
},
|
|
|
- },
|
|
|
- created(){
|
|
|
- this.getAreaSetting()
|
|
|
+ subjectList:{
|
|
|
+ immediate:true,
|
|
|
+ deep:true,
|
|
|
+ handler(n,o){
|
|
|
+ if(n && n.length){
|
|
|
+ this.subjectId = n[0].id
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
</script>
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
-.art-name{
|
|
|
- font-weight: 500;
|
|
|
- font-size: 15px;
|
|
|
- color: #17233d;
|
|
|
+.art-exam-bar {
|
|
|
+ width: 100%;
|
|
|
+ height: 45px;
|
|
|
+ line-height: 45px;
|
|
|
+ box-shadow: 0 2px 5px #e9e9e9;
|
|
|
+ padding-left: 10px;
|
|
|
+ color: var(--second-text-color);
|
|
|
+ position: relative;
|
|
|
+
|
|
|
+ .art-exam-bar-item {
|
|
|
+ display: inline-block;
|
|
|
+ cursor: pointer;
|
|
|
+ user-select: none;
|
|
|
+ line-height: 38px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .art-exam-bar-active {
|
|
|
+ color: white;
|
|
|
+ border-bottom: 2px solid white;
|
|
|
+ }
|
|
|
}
|
|
|
-.art-date{
|
|
|
- margin-top: 5px;
|
|
|
- color: #808695;
|
|
|
+.art-name {
|
|
|
+ font-weight: 500;
|
|
|
+ font-size: 15px;
|
|
|
+ color: #17233d;
|
|
|
}
|
|
|
-.art-content{
|
|
|
- padding-left: 10px;
|
|
|
+.art-date {
|
|
|
+ margin-top: 5px;
|
|
|
+ color: #808695;
|
|
|
}
|
|
|
-.art-item-active{
|
|
|
- background: var(--hover-text-color);
|
|
|
+.art-content {
|
|
|
+ padding-left: 7px;
|
|
|
}
|
|
|
-.art-item{
|
|
|
- padding: 15px 15px;
|
|
|
- cursor: pointer;
|
|
|
- &:hover{
|
|
|
- background: var(--hover-text-color);
|
|
|
- }
|
|
|
+.art-item-active {
|
|
|
+ background: var(--hover-text-color);
|
|
|
+}
|
|
|
+.art-item {
|
|
|
+ padding: 15px 15px;
|
|
|
+ cursor: pointer;
|
|
|
+ &:hover {
|
|
|
+ background: var(--hover-text-color);
|
|
|
+ }
|
|
|
}
|
|
|
.art-exam-container {
|
|
|
- width: 100%;
|
|
|
- height: 100%;
|
|
|
- background: white;
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ background: white;
|
|
|
}
|
|
|
.art-mgt-top {
|
|
|
- height: 45px;
|
|
|
- box-shadow: 0px 2px 5px #e9e9e9;
|
|
|
- padding-left: 15px;
|
|
|
- padding-right: 20px;
|
|
|
- margin-bottom: 5px;
|
|
|
- line-height: 45px;
|
|
|
+ height: 45px;
|
|
|
+ box-shadow: 0px 2px 5px #e9e9e9;
|
|
|
+ padding-left: 15px;
|
|
|
+ padding-right: 20px;
|
|
|
+ margin-bottom: 5px;
|
|
|
+ line-height: 45px;
|
|
|
}
|
|
|
.to-create-art {
|
|
|
- float: right;
|
|
|
- user-select: none;
|
|
|
- cursor: pointer;
|
|
|
- color: #40a8f0;
|
|
|
- margin-left: 10px;
|
|
|
+ float: right;
|
|
|
+ user-select: none;
|
|
|
+ cursor: pointer;
|
|
|
+ color: #40a8f0;
|
|
|
+ margin-left: 10px;
|
|
|
}
|
|
|
</style>
|