|
@@ -0,0 +1,935 @@
|
|
|
+<template>
|
|
|
+ <!--学校列表-->
|
|
|
+ <div class="schoolbox" v-show="models==='default'">
|
|
|
+ <div class="select-List">
|
|
|
+ <div class="province-box">
|
|
|
+ <span>{{$t(`areaManages.selector.provinceName`)}}:</span>
|
|
|
+ <el-select v-model="provinceOptions.provinceValue" :placeholder="$t(`areaManages.selector.provinceDefault`)" @change="areaSelctChange(provinceOptions.provinceValue,'province')">
|
|
|
+ <el-option v-for="item in provinceOptions.optionInfo" :key="item.code" :label="item.name" :value="item.name">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div class="city-box">
|
|
|
+ <span>{{$t(`areaManages.selector.cityName`)}}:</span>
|
|
|
+ <el-select v-model="cityOptions.cityValue" :placeholder="$t(`areaManages.selector.cityDefault`)" @change="areaSelctChange(cityOptions.cityValue,'city')">
|
|
|
+ <el-option v-for="item in cityOptions.cityInfo" :key="item.code" :label="item.name" :value="item.name">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div class="dist-box">
|
|
|
+ <span>{{$t(`areaManages.selector.areaName`)}}:</span>
|
|
|
+ <el-select v-model="distOptions.distValue" filterable allow-create default-first-option :placeholder="$t(`areaManages.selector.areaDefault`)" @change="areaSelctChange(distOptions.distValue,'dist')">
|
|
|
+ <el-option v-for="item in distOptions.distInfo" :key="item.code" :label="item.name" :value="item.name">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div class="close-box" v-show="provinceOptions.provinceValue || cityOptions.cityValue ||distOptions.distValue">
|
|
|
+ <svg class="closebtnIcon" aria-hidden="true" @click="closeSelectarea">
|
|
|
+ <use xlink:href="#icon-quxiao"></use>
|
|
|
+ </svg>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!-- <div class="boxselect" v-if="PowerShow">
|
|
|
+ <el-button size="small" @click="createdSchoolbtn">
|
|
|
+ <svg class="created-icon" aria-hidden="true">
|
|
|
+ <use xlink:href="#icon-chuangjianx"></use>
|
|
|
+ </svg>
|
|
|
+ 创建学校
|
|
|
+ </el-button>
|
|
|
+ </div> -->
|
|
|
+ <div class="school-list">
|
|
|
+ <el-table :data="tableData" style="width: 100%" height="75vh" v-loading="loading" element-loading-text="加载中...">
|
|
|
+ <el-table-column prop="index" :label="$t(`schoolManages.tables.serialnum`)" type="index" sortable align="center" />
|
|
|
+ <el-table-column :label="$t(`schoolManages.tables.badge`)" width="150" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-image style="width: 70px; height: 70px" :src="scope.row.picture" fit="fill"></el-image>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="name" :label="$t(`schoolManages.tables.name`)" sortable align="center" />
|
|
|
+ <!-- <el-table-column label="学段" width="150" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <span>{{scope.row.period[0].name}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column> -->
|
|
|
+ <el-table-column :label="$t(`schoolManages.tables.scale`)" class="school-table-edition" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-image style="width: 80px; height: 80px" :src="imgData.basics" fit="fill" v-if="scope.row.scale ===0"></el-image>
|
|
|
+ <el-image style="width: 80px; height: 80px" :src="imgData.standard" fit="fill" v-else-if="scope.row.scale ===500 && scope.row.hard.length===0 && scope.row.serial.length ===0 && scope.row.service.length ===0"></el-image>
|
|
|
+ <el-image style="width: 80px; height: 80px" :src="imgData.specialty" fit="fill" v-else-if="scope.row.scale ===500 && (scope.row.hard.length !=0 || scope.row.serial.length !=0 || scope.row.service.length !=0)"></el-image>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="id" :label="$t(`schoolManages.tables.brevityCode`)" align="center" />
|
|
|
+ <el-table-column label="数据量" sortable :sort-method="schooldataSort" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <div v-if="scope.row.lessonCount">
|
|
|
+ <svg class="created-icon" aria-hidden="true">
|
|
|
+ <use xlink:href="#icon-shuju"></use>
|
|
|
+ </svg>
|
|
|
+ {{scope.row.lessonCount}}
|
|
|
+ </div>
|
|
|
+ <div v-else>暂无</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="location" label="位置" align="center" />
|
|
|
+ <!-- <el-table-column prop="city" :label="$t(`schoolManages.tables.city`)" align="center" />
|
|
|
+ <el-table-column prop="dist" :label="$t(`schoolManages.tables.area`)" align="center" /> -->
|
|
|
+ <el-table-column prop="size" :label="$t(`schoolManages.tables.spacesize`)" align="center" />
|
|
|
+ <el-table-column :label="$t(`schoolManages.tables.assis`)" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <div v-if="scope.row.assisName">{{scope.row.assisName}}</div>
|
|
|
+ <div v-else>暂无</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="模组情况" align="center" width="200">
|
|
|
+ <template #default="scope">
|
|
|
+ <div class="have-modules">
|
|
|
+ <div v-for="item in scope.row.serviceData" :title="item.name" :key="item.id">
|
|
|
+ <svg class="school-analyse" aria-hidden="true">
|
|
|
+ <use :xlink:href="item.icon"></use>
|
|
|
+ </svg>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="数据统计" align="center">
|
|
|
+ <template #default="scope">
|
|
|
+ <div title="查看学校数据分析" @click="skipAnalyse(scope.row)">
|
|
|
+ <svg class="school-analyse" aria-hidden="true">
|
|
|
+ <use xlink:href="#icon-shujufenxi"></use>
|
|
|
+ </svg>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column prop="state" label="状态" width="110" align="center" /> -->
|
|
|
+ <el-table-column :label="$t(`schoolManages.tables.operate`)" align="center" v-if="PowerShow">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-button type="primary" size="small" @click.prevent="deleteRow(scope.$index, scope.row)">{{$t(`schoolManages.tables.operatecontent`)}}</el-button>
|
|
|
+ <!-- <el-button type="danger" size="small" @click="removeSchool(scope.row,scope.$index)">删除</el-button> -->
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <!--学校列表end-->
|
|
|
+ <!--编辑学校页面-->
|
|
|
+ <div class="schoolDeatils">
|
|
|
+ <div class="backbtn" v-if="models==='details' && PowerShow">
|
|
|
+ <el-button class="changebtn" v-if="store.state.changbtnShow && changebtns" @click="getSetschool()" size="small">
|
|
|
+ <svg class="changebtn-areaicon" aria-hidden="true">
|
|
|
+ <use xlink:href="#icon-wenjian"></use>
|
|
|
+ </svg>
|
|
|
+ <span class="changebtn-title">{{$t(`schoolManages.gradSet.save`)}}</span>
|
|
|
+ </el-button>
|
|
|
+ <el-button type="primary" size="small" @click="schoolClose">
|
|
|
+ <svg class="back-icon" aria-hidden="true">
|
|
|
+ <use xlink:href="#icon-fanhui"></use>
|
|
|
+ </svg>
|
|
|
+ 返回
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ <el-tabs v-if="models==='details' && PowerShow" @tab-click="changeTabs">
|
|
|
+ <!--基础设置-->
|
|
|
+ <el-tab-pane :label="$t(`schoolManages.redactSet`)">
|
|
|
+ <div class="redactbox" v-show="models==='details' && PowerShow">
|
|
|
+ <div class="school-formbox">
|
|
|
+ <el-form ref="form" :model="nowPitchdata" label-width="120px">
|
|
|
+ <el-form-item :label="$t(`schoolManages.basicSet.name`)+':'" class="school-form-name">
|
|
|
+ <el-input v-model="nowPitchdata.name"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t(`schoolManages.basicSet.badge`)+':'" class="school-form-badge">
|
|
|
+ <el-upload class="upload-demo-redact" :headers="uploadHeader" action="/blob/upload-public" :before-upload="changeBadge" :on-success="success" :on-error="handleUpdErr">
|
|
|
+ <el-image style="width: 100%; height:125px" :src="nowPitchdata.picture" fit="contain"></el-image>
|
|
|
+ <div class="changebadge">
|
|
|
+ <el-button>{{$t(`schoolManages.basicSet.badgeChange`)}}</el-button>
|
|
|
+ </div>
|
|
|
+ </el-upload>
|
|
|
+ </el-form-item>
|
|
|
+ <!-- <el-form-item label="学段:" class="school-form-grading">
|
|
|
+ <el-checkbox v-model="nowPitchdata.period[0].value" label="小学"></el-checkbox>
|
|
|
+ <el-checkbox v-model="nowPitchdata.period[1].value" label="初中"></el-checkbox>
|
|
|
+ <el-checkbox v-model="nowPitchdata.period[2].value" label="高中"></el-checkbox>
|
|
|
+ <el-checkbox v-model="nowPitchdata.period[3].value" label="职高"></el-checkbox>
|
|
|
+ <el-checkbox v-model="nowPitchdata.period[4].value" label="大学"></el-checkbox>
|
|
|
+ </el-form-item> -->
|
|
|
+ <el-form-item :label="$t(`schoolManages.basicSet.type`)+':'" class="school-form-grading">
|
|
|
+ <el-radio v-model="nowPitchdata.type" label="1" size="large">{{$t(`schoolManages.basicSet.ordinary`)}}</el-radio>
|
|
|
+ <el-radio v-model="nowPitchdata.type" label="2" size="large">{{$t(`schoolManages.basicSet.higherEducation`)}}</el-radio>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t(`schoolManages.basicSet.nowAssistant`)+':'" class="school-form-admin">
|
|
|
+ <el-select v-model="adminvalue" multiple @change="assistChange" :placeholder="$t(`schoolManages.basicSet.nowAssistanthint`)">
|
|
|
+ <el-option v-for="item in adminoptions" :key="item.name" :label="item.mobile+'——'+item.name" :value="item.tmdId ===null ? '':item.tmdId" :disabled="!item.tmdId">
|
|
|
+ <!-- <span style="float: left">{{ item.mobile }}-{{item.name}}</span>
|
|
|
+ <i style="float: right;color: var(--el-text-color-secondary);font-size: 13px;" v-show="item.isexist === false">
|
|
|
+ <svg class="school-admin-check" aria-hidden="true">
|
|
|
+ <use xlink:href="#icon-zhengque"></use>
|
|
|
+ </svg>
|
|
|
+ </i> -->
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t(`schoolManages.basicSet.brevityCode`)+':'" class="school-form-code">
|
|
|
+ <el-input disabled :placeholder="nowPitchdata.id" v-if="nowPitchdata.id !==null" />
|
|
|
+ <el-input disabled :placeholder="$t(`schoolManages.basicSet.notCode`)" v-else="nowPitchdata.id ==null" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="所属学区:" class="school-form-area">
|
|
|
+ <el-select v-model="areaSelect.Selectvalue" :placeholder="$t(`schoolManages.basicSet.region`)">
|
|
|
+ <el-option v-for="item in areaSelect.data" :key="item.name" :label="item.name" :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item :label="$t(`schoolManages.basicSet.scale`)+':'" class="school-form-size">
|
|
|
+ <el-input-number v-model="nowPitchdata.scale" :min="0" :step="100" />人
|
|
|
+ </el-form-item>
|
|
|
+ <!-- <el-form-item :label="$t(`schoolManages.basicSet.location`)+':'" class="school-form-site">
|
|
|
+ <el-input disabled :placeholder="nowPitchdata.address" />
|
|
|
+ </el-form-item> -->
|
|
|
+ <el-form-item :label="$t(`schoolManages.basicSet.spacesize`)+':'" class="school-form-size">
|
|
|
+ <el-input-number v-model="nowPitchdata.size" :min="1" :max="1000" />GB
|
|
|
+ </el-form-item>
|
|
|
+ <!-- <el-form-item label="学校状态:" class="school-form-state">
|
|
|
+ <el-switch v-model="value2" active-color="#13ce66" inactive-color="#ff4949" />
|
|
|
+ </el-form-item> -->
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="updateSchoolinfo">{{$t(`schoolManages.basicSet.submit`)}}</el-button>
|
|
|
+ <el-button @click="schoolClose">{{$t(`commonMsg.closes`)}}</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane :label="$t(`schoolManages.redactGrading`)">
|
|
|
+ <SetSchool :schoolData="studyPhase" ref="setSchoolData"></SetSchool>
|
|
|
+ </el-tab-pane>
|
|
|
+ <!-- <el-tab-pane :label="$t(`schoolManages.redactServe`)">
|
|
|
+ <Impower :schoolCode="studyPhase"></Impower>
|
|
|
+ </el-tab-pane>
|
|
|
+ <el-tab-pane :label="$t(`schoolManages.redactSerial`)">
|
|
|
+ <Classpower :schoolCode="studyPhase"></Classpower>
|
|
|
+ </el-tab-pane> -->
|
|
|
+ </el-tabs>
|
|
|
+ </div>
|
|
|
+ <!--编辑学校页面end-->
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import { reactive, ref, getCurrentInstance, toRef } from 'vue'
|
|
|
+import option from '@/static/region.json'
|
|
|
+import { useStore } from 'vuex'
|
|
|
+import { ElMessage, ElLoading, ElMessageBox } from 'element-plus'
|
|
|
+import { useRouter } from 'vue-router'
|
|
|
+import SetSchool from './setPhase.vue'
|
|
|
+const optionsData = option
|
|
|
+export default {
|
|
|
+ components: {
|
|
|
+ SetSchool,
|
|
|
+ },
|
|
|
+ setup() {
|
|
|
+ let { proxy } = getCurrentInstance()
|
|
|
+ let PowerShow = proxy.$access.inspectPower('batchschool-upd')
|
|
|
+ const store = useStore()
|
|
|
+ const routerInfo = useRouter()
|
|
|
+ //为了让表单呈现 暂时的数据,
|
|
|
+ let tableData = ref([])
|
|
|
+ const form = reactive({
|
|
|
+ name: '',
|
|
|
+ region: '',
|
|
|
+ date1: '',
|
|
|
+ date2: '',
|
|
|
+ delivery: false,
|
|
|
+ type: [],
|
|
|
+ resource: '',
|
|
|
+ desc: '',
|
|
|
+ })
|
|
|
+ let adminoptions = ref([])
|
|
|
+ let adminvalue = ref([])
|
|
|
+ const value2 = ref(true)
|
|
|
+ //为了让表单呈现 暂时的数据,
|
|
|
+ let loading = ref(true)
|
|
|
+ let uploadHeader = ref({})
|
|
|
+ let nowPitchdata = ref({
|
|
|
+ address: '',
|
|
|
+ areaId: '',
|
|
|
+ campuses: [],
|
|
|
+ city: '',
|
|
|
+ dist: '',
|
|
|
+ id: '',
|
|
|
+ name: '',
|
|
|
+ picture: '',
|
|
|
+ pk: '',
|
|
|
+ province: '',
|
|
|
+ region: '',
|
|
|
+ schoolCode: '',
|
|
|
+ size: 0,
|
|
|
+ standard: '',
|
|
|
+ admin: '',
|
|
|
+ type: 0,
|
|
|
+ scale: 0,
|
|
|
+ })
|
|
|
+ let originalData = ref([])
|
|
|
+ const options = option
|
|
|
+ const props = {
|
|
|
+ value: 'name',
|
|
|
+ label: 'name',
|
|
|
+ children: 'children',
|
|
|
+ checkStrictly: true,
|
|
|
+ }
|
|
|
+ let models = ref('default')
|
|
|
+ let imags = require('@/assets/img/tmd_logo.png')
|
|
|
+ //地区列表
|
|
|
+ let provinceOptions = ref({
|
|
|
+ optionInfo: [],
|
|
|
+ provinceValue: '',
|
|
|
+ })
|
|
|
+ let cityOptions = ref({
|
|
|
+ cityInfo: [],
|
|
|
+ cityValue: '',
|
|
|
+ })
|
|
|
+ let distOptions = ref({
|
|
|
+ distInfo: [],
|
|
|
+ distValue: '',
|
|
|
+ })
|
|
|
+ let areaSelect = ref({
|
|
|
+ Selectvalue: '',
|
|
|
+ data: [],
|
|
|
+ })
|
|
|
+ //学段管理(传输给子组件)
|
|
|
+ let studyPhase = ref()
|
|
|
+ //存储变更按钮显示show
|
|
|
+ let changebtns = ref(false)
|
|
|
+ let setSchoolData = ref(null)
|
|
|
+ let imgData = ref({
|
|
|
+ basics: require('@/assets/img/basicsEdition.svg'),
|
|
|
+ standard: require('@/assets/img/standardEdition.svg'),
|
|
|
+ specialty: require('@/assets/img/specialtyEdition.svg'),
|
|
|
+ })
|
|
|
+ //模组icon
|
|
|
+ let patternIcon = ref([
|
|
|
+ { id: 1, name: '学情分析', icon: '#icon-tongjifenxi', key: 'YMPCVCIM' },
|
|
|
+ { id: 2, name: '智慧学校管理服务', icon: '#icon-zhihuixiaoyuan', key: 'IPDYZYLC' },
|
|
|
+ { id: 3, name: 'A Class ONE 智慧学伴', icon: '#icon-jxuexiao2', key: '3CLYJ6NP' },
|
|
|
+ { id: 4, name: '数据存储服务空间', icon: '#icon-yuncunchu', key: 'IPALJ6NY' },
|
|
|
+ { id: 5, name: '卷卡合一阅卷系统', icon: '#icon-pingtai_kaoshi', key: 'VABAJ6NV' },
|
|
|
+ { id: 6, name: '教研中心模组', icon: '#icon-jiaoyan', key: 'VLY6J6N6' },
|
|
|
+ ])
|
|
|
+ provinceOptions.value.optionInfo = optionsData
|
|
|
+ console.log(store.state.point)
|
|
|
+ //所有学校列表
|
|
|
+ function getAllschool() {
|
|
|
+ proxy.$api.getSchooldata({}).then((res) => {
|
|
|
+ console.log(res, '获取学校列表assist')
|
|
|
+ //处理关联管家 拼内容
|
|
|
+ res.schoolAssists.splice(3)
|
|
|
+ for (let i in res.schoolAssists) {
|
|
|
+ res.schoolAssists[i].serviceData = []
|
|
|
+ if (res.schoolAssists[i].assists) {
|
|
|
+ res.schoolAssists[i].assisName = ''
|
|
|
+ res.schoolAssists[i].location = res.schoolAssists[i].province + res.schoolAssists[i].city + res.schoolAssists[i].dist
|
|
|
+ let datas = res.schoolAssists[i].assists
|
|
|
+ for (let y in datas) {
|
|
|
+ res.schoolAssists[i].assisName = res.schoolAssists[i].assisName + datas[y].tmdName + ','
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (res.schoolAssists[i].service.length > 0) {
|
|
|
+ res.schoolAssists[i].service.forEach((x) => {
|
|
|
+ for (let m in patternIcon.value) {
|
|
|
+ patternIcon.value[m].key === x ? res.schoolAssists[i].serviceData.push(patternIcon.value[m]) : ''
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ console.log(res)
|
|
|
+ res.state == 200 ? (tableData.value.push(...res.schoolAssists), (originalData.value = res.schoolAssists), (loading.value = false)) : ''
|
|
|
+ })
|
|
|
+ }
|
|
|
+ //点击学校列表,详情
|
|
|
+ function deleteRow(index, data) {
|
|
|
+ console.log(index, data, 'DATA')
|
|
|
+ //处理的基础设置
|
|
|
+ areaSelect.value.data = []
|
|
|
+ studyPhase.value = data.id
|
|
|
+ nowPitchdata.value = Object.assign(nowPitchdata.value, data)
|
|
|
+ nowPitchdata.value.address = data.address
|
|
|
+ nowPitchdata.value.name = data.name
|
|
|
+ nowPitchdata.value.type = data.type.toString()
|
|
|
+ nowPitchdata.value.scale = data.scale
|
|
|
+ nowPitchdata.value.standard = data.standard
|
|
|
+ nowPitchdata.value.areaId = data.areaId
|
|
|
+ data.assists.length
|
|
|
+ ? data.assists.forEach((element) => {
|
|
|
+ adminvalue.value.push(element.tmdId)
|
|
|
+ })
|
|
|
+ : ''
|
|
|
+ let token = JSON.parse(localStorage.getItem('id_token'))
|
|
|
+ uploadHeader.value['x-auth-authtoken'] = token
|
|
|
+ data.areaId !== null ? (areaSelect.value.Selectvalue = data.areaId) : ''
|
|
|
+ console.log(store.state.point, '目前现有的所有区')
|
|
|
+ store.state.point.length ? areaSelect.value.data.push(...store.state.point) : getoption()
|
|
|
+ models.value = 'details'
|
|
|
+ console.log(nowPitchdata.value, '查看当前学校的值')
|
|
|
+ }
|
|
|
+ //更换校徽
|
|
|
+ function changeBadge(file) {
|
|
|
+ console.log(file)
|
|
|
+ if (file.type == 'image/png' || file.type == 'image/jpeg') {
|
|
|
+ return true
|
|
|
+ } else {
|
|
|
+ ElMessage.error(proxy.$t(`commonMsg.uploadError`))
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //地区选择
|
|
|
+ function areaSelctChange(value, model) {
|
|
|
+ loading.value = true
|
|
|
+ console.log(value)
|
|
|
+ let data = option
|
|
|
+ if (model === 'province') {
|
|
|
+ //传输下一级的数据给select
|
|
|
+ let cityData = data.filter((item) => {
|
|
|
+ return item.name === value
|
|
|
+ })
|
|
|
+ cityOptions.value.cityInfo = cityData[0].children
|
|
|
+ //遍历list
|
|
|
+ let schoolData = originalData.value.filter((items) => {
|
|
|
+ return items.province === value
|
|
|
+ })
|
|
|
+ tableData.value = schoolData
|
|
|
+ console.log(schoolData, tableData.value)
|
|
|
+ } else if (model === 'city') {
|
|
|
+ let distData = cityOptions.value.cityInfo.filter((item) => {
|
|
|
+ return item.name === value
|
|
|
+ })
|
|
|
+ distOptions.value.distInfo = distData[0].children
|
|
|
+ let provinceData = provinceOptions.value.provinceValue
|
|
|
+ let schoolData = originalData.value.filter((items) => {
|
|
|
+ return items.city === value && items.province === provinceData
|
|
|
+ })
|
|
|
+ tableData.value = schoolData
|
|
|
+ } else if (model === 'dist') {
|
|
|
+ let provinceData = provinceOptions.value.provinceValue
|
|
|
+ let cityData = cityOptions.value.cityValue
|
|
|
+ let schoolData = originalData.value.filter((items) => {
|
|
|
+ return items.city === cityData && items.province === provinceData && items.dist === value
|
|
|
+ })
|
|
|
+ tableData.value = schoolData
|
|
|
+ }
|
|
|
+ loading.value = false
|
|
|
+ }
|
|
|
+ //学校详情 close
|
|
|
+ function schoolClose() {
|
|
|
+ models.value = 'default'
|
|
|
+ const basics = {
|
|
|
+ areaId: '',
|
|
|
+ campuses: [],
|
|
|
+ city: '',
|
|
|
+ dist: '',
|
|
|
+ id: '',
|
|
|
+ name: '',
|
|
|
+ picture: '',
|
|
|
+ pk: '',
|
|
|
+ province: '',
|
|
|
+ region: '',
|
|
|
+ schoolCode: '',
|
|
|
+ size: 0,
|
|
|
+ standard: '',
|
|
|
+ admin: '',
|
|
|
+ }
|
|
|
+ nowPitchdata.value = Object.assign({}, basics)
|
|
|
+ adminvalue.value = []
|
|
|
+ areaSelect.value.Selectvalue = ''
|
|
|
+ store.commit('updateSchoolpower', {})
|
|
|
+ console.log(nowPitchdata, '取消后的')
|
|
|
+ }
|
|
|
+ //管家发生变化
|
|
|
+ function assistChange(val) {
|
|
|
+ console.log(val, adminvalue.value)
|
|
|
+ }
|
|
|
+ //获取所有的顾问API访问
|
|
|
+ function getAllassists() {
|
|
|
+ // let data = { deptId: '' }
|
|
|
+ // proxy.$api.getAllassist(data).then((res) => {
|
|
|
+ // res.state === 200 ? adminoptions.value.push(...res.dDAndTmdInfos) : ''
|
|
|
+ // })
|
|
|
+ // let dataA = { deptId: '67690917' }
|
|
|
+ // proxy.$api.getAllassist(dataA).then((res) => {
|
|
|
+ // console.log(res, '研发A')
|
|
|
+ // res.state === 200 ? adminoptions.value.push(...res.dDAndTmdInfos) : ''
|
|
|
+ // })
|
|
|
+ proxy.$api.getEveryinfo({}).then((res) => {
|
|
|
+ console.log(res, '顾问返回')
|
|
|
+ res.state === 200 ? adminoptions.value.push(...res.ddUserInfos) : ''
|
|
|
+ })
|
|
|
+ console.log(adminoptions.value, '目前所有顾问')
|
|
|
+ }
|
|
|
+ function handleUpdErr() {
|
|
|
+ ElMessage.error('校徽修改失败')
|
|
|
+ }
|
|
|
+ //上传校徽成功后
|
|
|
+ function success(response, file, fileList) {
|
|
|
+ // this.schoolSetting.picture = response.url
|
|
|
+ console.log(response, file, fileList, '上传成功的返回')
|
|
|
+ nowPitchdata.value.picture = response.url
|
|
|
+ //校徽长传成功自动保存
|
|
|
+ // this.saveData()
|
|
|
+ }
|
|
|
+ // 确认修改学校信息
|
|
|
+ function updateSchoolinfo() {
|
|
|
+ let user = JSON.parse(localStorage.getItem('userData'))
|
|
|
+ //修改表单
|
|
|
+ let assistData = adminvalue.value
|
|
|
+ let periodData = []
|
|
|
+ for (let i in nowPitchdata.value.period) {
|
|
|
+ let num = Number(i) + 1
|
|
|
+ if (nowPitchdata.value.period[i].value === true) {
|
|
|
+ periodData.push(nowPitchdata.value.period[i].name)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let updateForm = {
|
|
|
+ name: nowPitchdata.value.name,
|
|
|
+ schoolId: nowPitchdata.value.id,
|
|
|
+ picture: nowPitchdata.value.picture,
|
|
|
+ size: nowPitchdata.value.size,
|
|
|
+ assistId: assistData,
|
|
|
+ scale: nowPitchdata.value.scale,
|
|
|
+ type: parseInt(nowPitchdata.value.type),
|
|
|
+ standard: nowPitchdata.value.standard,
|
|
|
+ areaId: nowPitchdata.value.areaId,
|
|
|
+ }
|
|
|
+ console.log(updateForm, '学校信息')
|
|
|
+ proxy.$api.updateSchoolinfo(updateForm).then((res) => {
|
|
|
+ console.log(res, '修改学校的返回')
|
|
|
+ res.state === 200
|
|
|
+ ? (ElMessage.success(proxy.$t(`commonMsg.schoolUpdateSuccess`), schoolJoinarea(), schoolClose()), updateSuccess())
|
|
|
+ : ElMessage.error(proxy.$t(`commonMsg.schoolUpdateError`))
|
|
|
+ })
|
|
|
+ }
|
|
|
+ //学校加入区域或者修改
|
|
|
+ async function schoolJoinarea() {
|
|
|
+ let user = JSON.parse(localStorage.getItem('userData'))
|
|
|
+ if (areaSelect.value.Selectvalue === '' || areaSelect.value.Selectvalue === null) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let standname = areaSelect.value.data.filter((item) => {
|
|
|
+ return item.id === areaSelect.value.Selectvalue
|
|
|
+ })
|
|
|
+ let dataInfo = {
|
|
|
+ tmdId: user.tmdId,
|
|
|
+ tmdName: user.tmdName,
|
|
|
+ standard: standname[0].standard,
|
|
|
+ areaId: areaSelect.value.Selectvalue,
|
|
|
+ schoolCode: [nowPitchdata.value.id],
|
|
|
+ }
|
|
|
+ await proxy.$api.areaAddSchool(dataInfo).then((res) => {
|
|
|
+ console.log(res, '学校加入区域API')
|
|
|
+ })
|
|
|
+ }
|
|
|
+ //创建学校btn 跳转
|
|
|
+ function createdSchoolbtn() {
|
|
|
+ routerInfo.push({ path: '/home/created', query: { model: 'schollC' } })
|
|
|
+ }
|
|
|
+ //获取所有区域,学校编辑内呈现
|
|
|
+ function getoption() {
|
|
|
+ proxy.$api.getCapacity({}).then((res) => {
|
|
|
+ areaSelect.value.data.push(...res.areas)
|
|
|
+ store.commit('getPoint', res.areas)
|
|
|
+ })
|
|
|
+ }
|
|
|
+ //修改成功后执行
|
|
|
+ function updateSuccess() {
|
|
|
+ loading.value = true
|
|
|
+ setTimeout(() => {
|
|
|
+ ;(models.value = 'default'), (tableData.value = []), getAllschool()
|
|
|
+ }, 2000)
|
|
|
+ }
|
|
|
+ //地区选择close btn
|
|
|
+ function closeSelectarea() {
|
|
|
+ provinceOptions.value.provinceValue = ''
|
|
|
+ provinceOptions.value.optionInfo = []
|
|
|
+ cityOptions.value.cityValue = ''
|
|
|
+ cityOptions.value.cityInfo = []
|
|
|
+ distOptions.value.distValue = ''
|
|
|
+ distOptions.value.distInfo = []
|
|
|
+ tableData.value = originalData.value
|
|
|
+ provinceOptions.value.optionInfo = optionsData
|
|
|
+ }
|
|
|
+ //关于储存变更按钮
|
|
|
+ function changeTabs(value) {
|
|
|
+ console.log(value.props.label)
|
|
|
+ value.props.label == '学段管理' || value.props.label == '學段管理' ? (changebtns.value = true) : (changebtns.value = false)
|
|
|
+ }
|
|
|
+ //获取子页面的数据
|
|
|
+ function getSetschool() {
|
|
|
+ console.log(setSchoolData.value.nowschoolData)
|
|
|
+ let newData = setSchoolData.value.nowschoolData
|
|
|
+ for (let i in newData.period) {
|
|
|
+ let datas = newData.period[i]
|
|
|
+ for (let u in datas.grades) {
|
|
|
+ if (datas.grades[u] === '') {
|
|
|
+ ElMessage.warning(proxy.$t(`schoolManages.gradSet.gradesHint`))
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ for (let e in datas.analysis.type) {
|
|
|
+ if (datas.analysis.type[e].name === '') {
|
|
|
+ ElMessage.warning(proxy.$t(`schoolManages.gradSet.typeHint`))
|
|
|
+ return
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const loadinginfo = ElLoading.service({
|
|
|
+ lock: true,
|
|
|
+ text: '正在保存,请稍后...',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)',
|
|
|
+ })
|
|
|
+ proxy.$api
|
|
|
+ .updateSchoolphase(newData)
|
|
|
+ .then((res) => {
|
|
|
+ res.state === 200 ? (ElMessage.success('保存成功'), (studyPhase.value = res.schoolInfo.id), (changebtns.value = false)) : ElMessage.error('保存失败')
|
|
|
+ loadinginfo.close()
|
|
|
+ })
|
|
|
+ .catch((res) => {
|
|
|
+ ElMessage.error(proxy.$t(`commonMsg.apiError`))
|
|
|
+ loadinginfo.close()
|
|
|
+ })
|
|
|
+ }
|
|
|
+ function skipAnalyse(value) {
|
|
|
+ console.log(value, '学校信息')
|
|
|
+ routerInfo.push({ path: '/home/analyse', query: {} })
|
|
|
+ store.commit('schoolDataInfo', value)
|
|
|
+ }
|
|
|
+ function schooldataSort(a, b) {
|
|
|
+ tableData.value.sort(function (a, b) {
|
|
|
+ return b.lessonCount - a.lessonCount
|
|
|
+ })
|
|
|
+ }
|
|
|
+ function removeSchool(value, index) {
|
|
|
+ console.log(value)
|
|
|
+ ElMessageBox.confirm(`您确定要删除 ${value.name} 学校吗? 请慎重操作!`, '删除学校', {
|
|
|
+ confirmButtonText: proxy.$t(`commonMsg.confirm`),
|
|
|
+ cancelButtonText: proxy.$t(`commonMsg.closes`),
|
|
|
+ type: 'warning',
|
|
|
+ center: true,
|
|
|
+ }).then(() => {
|
|
|
+ let dataArr = tableData.value
|
|
|
+ dataArr.splice(index, 1)
|
|
|
+ ElMessage.success('删除成功')
|
|
|
+ })
|
|
|
+ }
|
|
|
+ getAllschool()
|
|
|
+ getAllassists()
|
|
|
+ return {
|
|
|
+ store,
|
|
|
+ tableData,
|
|
|
+ options,
|
|
|
+ props,
|
|
|
+ models,
|
|
|
+ form,
|
|
|
+ imags,
|
|
|
+ adminoptions,
|
|
|
+ adminvalue,
|
|
|
+ value2,
|
|
|
+ getAllschool,
|
|
|
+ deleteRow,
|
|
|
+ changeBadge,
|
|
|
+ nowPitchdata,
|
|
|
+ schoolClose,
|
|
|
+ originalData,
|
|
|
+ getAllassists,
|
|
|
+ assistChange,
|
|
|
+ loading,
|
|
|
+ uploadHeader,
|
|
|
+ success,
|
|
|
+ provinceOptions,
|
|
|
+ cityOptions,
|
|
|
+ distOptions,
|
|
|
+ areaSelctChange,
|
|
|
+ updateSchoolinfo,
|
|
|
+ createdSchoolbtn,
|
|
|
+ getoption,
|
|
|
+ areaSelect,
|
|
|
+ updateSuccess,
|
|
|
+ PowerShow,
|
|
|
+ closeSelectarea,
|
|
|
+ studyPhase,
|
|
|
+ changeTabs,
|
|
|
+ changebtns,
|
|
|
+ setSchoolData,
|
|
|
+ getSetschool,
|
|
|
+ imgData,
|
|
|
+ patternIcon,
|
|
|
+ skipAnalyse,
|
|
|
+ schooldataSort,
|
|
|
+ removeSchool,
|
|
|
+ }
|
|
|
+ },
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style scoped>
|
|
|
+.schoolbox {
|
|
|
+ width: 100%;
|
|
|
+ margin: 0 auto;
|
|
|
+ line-height: 80px;
|
|
|
+}
|
|
|
+.select-List {
|
|
|
+ line-height: 60px;
|
|
|
+ text-align: left;
|
|
|
+ padding: 1% 2%;
|
|
|
+ width: 75%;
|
|
|
+ float: left;
|
|
|
+}
|
|
|
+.school-list {
|
|
|
+ width: 96%;
|
|
|
+ max-height: 74vh;
|
|
|
+ margin: 0 auto;
|
|
|
+ /* overflow-y: auto; */
|
|
|
+}
|
|
|
+/*编辑页面样式*/
|
|
|
+.redactbox {
|
|
|
+ width: 100%;
|
|
|
+ height: 87vh;
|
|
|
+ background-color: #fff;
|
|
|
+}
|
|
|
+.backbtn {
|
|
|
+ text-align: left;
|
|
|
+ position: absolute;
|
|
|
+ top: 0.5%;
|
|
|
+ right: 10px;
|
|
|
+ z-index: 999;
|
|
|
+ line-height: 40px;
|
|
|
+}
|
|
|
+.school-formbox {
|
|
|
+ width: 85%;
|
|
|
+ margin: 0 auto;
|
|
|
+ padding: 1%;
|
|
|
+}
|
|
|
+.upload-demo-redact {
|
|
|
+ width: 100%;
|
|
|
+ height: 125px;
|
|
|
+}
|
|
|
+.school-form-name {
|
|
|
+ width: 50%;
|
|
|
+}
|
|
|
+.school-form-area {
|
|
|
+ width: 35%;
|
|
|
+}
|
|
|
+.school-form-badge,
|
|
|
+.school-form-code {
|
|
|
+ width: 24%;
|
|
|
+}
|
|
|
+.school-form-grading {
|
|
|
+ width: 80%;
|
|
|
+}
|
|
|
+.changebadge {
|
|
|
+ width: 100%;
|
|
|
+ height: 125px;
|
|
|
+ position: absolute;
|
|
|
+ top: 0px;
|
|
|
+ left: 0px;
|
|
|
+ opacity: 0;
|
|
|
+}
|
|
|
+.school-form-site {
|
|
|
+ width: 35%;
|
|
|
+}
|
|
|
+.school-form-size {
|
|
|
+ width: 21%;
|
|
|
+ color: #bdc3c7;
|
|
|
+}
|
|
|
+.school-form-admin {
|
|
|
+ width: 35%;
|
|
|
+ text-align: left;
|
|
|
+}
|
|
|
+.school-form-state {
|
|
|
+ width: 15%;
|
|
|
+}
|
|
|
+.school-admin-check {
|
|
|
+ width: 2em;
|
|
|
+ height: 2em;
|
|
|
+ vertical-align: -0.5em;
|
|
|
+ fill: currentColor;
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+.province-box,
|
|
|
+.city-box,
|
|
|
+.dist-box,
|
|
|
+.close-box {
|
|
|
+ display: inline-block;
|
|
|
+}
|
|
|
+.city-box,
|
|
|
+.dist-box {
|
|
|
+ margin-left: 1%;
|
|
|
+}
|
|
|
+/*btn*/
|
|
|
+.boxselect {
|
|
|
+ width: 20%;
|
|
|
+ display: inline-block;
|
|
|
+ margin-top: 0.5%;
|
|
|
+ text-align: right;
|
|
|
+}
|
|
|
+.created-areaicon {
|
|
|
+ width: 1.3em;
|
|
|
+ height: 1.3em;
|
|
|
+ /* vertical-align: -0.5em; */
|
|
|
+ fill: currentColor;
|
|
|
+ overflow: hidden;
|
|
|
+ margin-top: -135px;
|
|
|
+}
|
|
|
+.closebtnIcon {
|
|
|
+ width: 1.8em;
|
|
|
+ height: 1.8em;
|
|
|
+ vertical-align: -0.6em;
|
|
|
+ fill: currentColor;
|
|
|
+ overflow: hidden;
|
|
|
+ margin-left: 8px;
|
|
|
+}
|
|
|
+.closebtnIcon:hover {
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+.schoolDeatils {
|
|
|
+ position: relative;
|
|
|
+ background: #e9eef3;
|
|
|
+}
|
|
|
+.changebtn {
|
|
|
+ display: inline-block;
|
|
|
+ /* float: right; */
|
|
|
+}
|
|
|
+.changebtn-title {
|
|
|
+ font-size: 12px;
|
|
|
+}
|
|
|
+.changebtn-areaicon {
|
|
|
+ width: 0.9em;
|
|
|
+ height: 0.9em;
|
|
|
+ vertical-align: -0.1em;
|
|
|
+ fill: currentColor;
|
|
|
+ margin-right: 3px;
|
|
|
+}
|
|
|
+.back-icon {
|
|
|
+ width: 0.9em;
|
|
|
+ height: 0.9em;
|
|
|
+ vertical-align: -0.1em;
|
|
|
+ fill: currentColor;
|
|
|
+ margin-right: 3px;
|
|
|
+}
|
|
|
+.created-icon {
|
|
|
+ width: 1.3em;
|
|
|
+ height: 1.3em;
|
|
|
+ vertical-align: -0.3em;
|
|
|
+ fill: currentColor;
|
|
|
+ overflow: hidden;
|
|
|
+ margin-right: 5px;
|
|
|
+}
|
|
|
+.school-analyse {
|
|
|
+ width: 1.8em;
|
|
|
+ height: 1.8em;
|
|
|
+ vertical-align: 0em;
|
|
|
+ fill: currentColor;
|
|
|
+ overflow: hidden;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+.have-modules {
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ overflow-x: auto;
|
|
|
+}
|
|
|
+</style>
|
|
|
+<style>
|
|
|
+.schoolbox .el-cascader {
|
|
|
+ width: 20%;
|
|
|
+}
|
|
|
+.school-form-badge .el-form-item__label {
|
|
|
+ line-height: 107px;
|
|
|
+}
|
|
|
+.school-form-badge .el-form-item__content {
|
|
|
+ border: 1px solid #ccc;
|
|
|
+ position: relative;
|
|
|
+}
|
|
|
+.changebadge .el-button {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ font-size: 18px;
|
|
|
+ color: #fff;
|
|
|
+}
|
|
|
+.changebadge .el-button span {
|
|
|
+ border: 1px solid #ccc;
|
|
|
+ background-color: #409eff;
|
|
|
+ padding: 5px;
|
|
|
+ border-radius: 10px;
|
|
|
+}
|
|
|
+.changebadge:hover {
|
|
|
+ opacity: 0.8;
|
|
|
+}
|
|
|
+.school-form-code .el-input__inner {
|
|
|
+ text-align: center;
|
|
|
+}
|
|
|
+.school-form-admin .el-select {
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
+.school-form-badge .el-image__inner {
|
|
|
+ width: 100%;
|
|
|
+ height: 85%;
|
|
|
+ margin-top: 10%;
|
|
|
+}
|
|
|
+.school-form-grading .el-form-item__content {
|
|
|
+ text-align: left;
|
|
|
+}
|
|
|
+.el-select-dropdown__item {
|
|
|
+ padding: 0 12px 0 20px;
|
|
|
+}
|
|
|
+.school-formbox .el-form-item__content {
|
|
|
+ text-align: left;
|
|
|
+}
|
|
|
+.school-form-area .el-select {
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
+.school-list .el-table__header-wrapper {
|
|
|
+ line-height: 60px;
|
|
|
+}
|
|
|
+.schoolDeatils .el-tabs__header {
|
|
|
+ height: 45px;
|
|
|
+ line-height: 45px;
|
|
|
+ line-height: 0px;
|
|
|
+ padding-left: 15px;
|
|
|
+ box-shadow: 0 2px 5px #e9e9e9;
|
|
|
+ background-color: #fff;
|
|
|
+ margin: 0px 0px 1px;
|
|
|
+}
|
|
|
+.schoolDeatils .el-tabs__content {
|
|
|
+ padding: 0px;
|
|
|
+}
|
|
|
+.backbtn .changebtn {
|
|
|
+ padding: 8px 15px;
|
|
|
+}
|
|
|
+.upload-demo-redact .el-upload {
|
|
|
+ width: 100%;
|
|
|
+ height: 125px;
|
|
|
+}
|
|
|
+.school-form-grading .el-radio__input.is-checked .el-radio__inner::after {
|
|
|
+ content: '';
|
|
|
+ width: 10px;
|
|
|
+ height: 5px;
|
|
|
+ border: 2px solid white;
|
|
|
+ border-top: transparent;
|
|
|
+ border-right: transparent;
|
|
|
+ text-align: center;
|
|
|
+ display: inline-block;
|
|
|
+ position: absolute;
|
|
|
+ top: 2px;
|
|
|
+ left: 2px;
|
|
|
+ vertical-align: middle;
|
|
|
+ transform: rotate(-45deg);
|
|
|
+ border-radius: 0px;
|
|
|
+ background: none;
|
|
|
+}
|
|
|
+.schoolDeatils .el-tabs__nav-wrap::after {
|
|
|
+ width: 0%;
|
|
|
+}
|
|
|
+.el-upload-dragger {
|
|
|
+}
|
|
|
+@media screen and (max-width: 1920px) {
|
|
|
+ .school-formbox .school-form-badge {
|
|
|
+ width: 17.5%;
|
|
|
+ }
|
|
|
+}
|
|
|
+@media screen and (max-width: 1400px) {
|
|
|
+ .school-formbox .school-form-badge {
|
|
|
+ width: 24%;
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|