|
@@ -5,6 +5,14 @@
|
|
|
<el-collapse v-model="activeNames" accordion>
|
|
|
<el-collapse-item :title="$t(`product.filterType`)" name="1">
|
|
|
<div class="filtratebox">
|
|
|
+ <!--取得對象-->
|
|
|
+ <div class="filtratebox-phase">
|
|
|
+ <span class="filtratebox-phase-title">{{$t(`product.dataTarget`)}}:</span>
|
|
|
+ <div class="filtratebox-phase-content">
|
|
|
+ <div class="phase-item" :class="[clickNum.target==='school' ? 'filter-click':'' ]" @click="clickNum.target='school'">school</div>
|
|
|
+ <div class="phase-item" :class="[clickNum.target==='tmid' ? 'filter-click':'' ]" @click="clickNum.target='tmid'">tmid</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
<!--产品类型-->
|
|
|
<div class="filtratebox-phase">
|
|
|
<span class="filtratebox-phase-title">{{productData.typeName}}:</span>
|
|
@@ -650,7 +658,8 @@ let clickNum = ref({
|
|
|
filter: 0,
|
|
|
district: 0,
|
|
|
time: 0,
|
|
|
- resultType: 0
|
|
|
+ resultType: 0,
|
|
|
+ target: 'school'
|
|
|
})
|
|
|
let timeScope = ref('daterange')
|
|
|
let cellWidth = ref((100 / columns.value.length).toFixed(2))
|
|
@@ -708,7 +717,8 @@ let dataForm = ref({
|
|
|
]
|
|
|
})
|
|
|
let checkList = ref([])
|
|
|
-let exportList = ref([
|
|
|
+let exportList =
|
|
|
+ref([
|
|
|
{ label: proxy.$t(`product.school`) + proxy.$t(`product.name`), key: 'name' },
|
|
|
{ label: proxy.$t(`product.school`) + proxy.$t(`product.simpleCode`), key: 'schoolId' },
|
|
|
{ label: proxy.$t(`product.classroomNumber`), key: 'deviceCnt' },
|
|
@@ -721,7 +731,20 @@ let exportList = ref([
|
|
|
{ label: proxy.$t(`product.lessonHours`), key: 'lessonLengMin' },
|
|
|
{ label: proxy.$t(`product.time`), key: 'date' },
|
|
|
])
|
|
|
-let fieldList = ref([proxy.$t(`product.school`) + proxy.$t(`product.name`), proxy.$t(`product.school`) + proxy.$t(`product.simpleCode`), proxy.$t(`product.classroomNumber`), proxy.$t(`product.teacherNumber`), proxy.$t(`product.studentNumberUnique`), proxy.$t(`product.studentJoinHours`), proxy.$t(`product.tGreen`), proxy.$t(`product.tLesson`), proxy.$t(`product.lessonNumber`), proxy.$t(`product.lessonHours`), proxy.$t(`product.time`)])
|
|
|
+let fieldList =
|
|
|
+ref([
|
|
|
+ proxy.$t(`product.school`) + proxy.$t(`product.name`),
|
|
|
+ proxy.$t(`product.school`) + proxy.$t(`product.simpleCode`),
|
|
|
+ proxy.$t(`product.classroomNumber`),
|
|
|
+ proxy.$t(`product.teacherNumber`),
|
|
|
+ proxy.$t(`product.studentNumberUnique`),
|
|
|
+ proxy.$t(`product.studentJoinHours`),
|
|
|
+ proxy.$t(`product.tGreen`),
|
|
|
+ proxy.$t(`product.tLesson`),
|
|
|
+ proxy.$t(`product.lessonNumber`),
|
|
|
+ proxy.$t(`product.lessonHours`),
|
|
|
+ proxy.$t(`product.time`)
|
|
|
+])
|
|
|
let exportStandard = ref([
|
|
|
{ title: proxy.$t(`product.joinNumberUnique`), value: 0, key: 'personnum', option: [{ name: proxy.$t(`product.smaller`) + '50', value: '50' }, { name: proxy.$t(`product.bigger`) + '50,' + proxy.$t(`product.smaller`) + '100', value: '50-100' }, { name: proxy.$t(`product.bigger`) + '100', value: '101' }, { name: proxy.$t(`product.bigger`) + '300', value: '301' }] },
|
|
|
{ title: proxy.$t(`product.lessonTime`), value: 0, key: 'classtime', option: [{ name: proxy.$t(`product.smaller`) + proxy.$t(`product.equal`) + '45' + proxy.$t(`product.minute`), value: '45' }, { name: proxy.$t(`product.bigger`) + '45' + proxy.$t(`product.minute`) + ',' + proxy.$t(`product.smaller`) + '90' + proxy.$t(`product.minute`), value: '45-90' }, { name: proxy.$t(`product.smaller`) + '90' + proxy.$t(`product.minute`), value: '91' }] },
|
|
@@ -847,14 +870,14 @@ function dataInit () {
|
|
|
ElMessage.error(proxy.$t(`product.apiErrpr`) + ',' + proxy.$t(`product.basicDataError`))
|
|
|
})
|
|
|
}
|
|
|
-function serachToresult(startTime, endTime, product, schools, unit) {
|
|
|
+function serachToresult(startTime, endTime, product, schools, unit, target) {
|
|
|
// let data = { "dateFrom": "2023-04-12", "dateTo": "2023-04-19", "prod": "HiTeach", "schoolIds": ["tbslgb", "habook"], "dateUnit": "Day" }
|
|
|
if (!startTime || !endTime) {
|
|
|
ElMessage.info(proxy.$t(`product.timeRangeSelectError`))
|
|
|
return
|
|
|
}
|
|
|
searchLoading.value = true;
|
|
|
- let data = { "dateFrom": startTime, "dateTo": endTime, "prod": product, "schoolIds": schools, "dateUnit": unit }
|
|
|
+ let data = { "dateFrom": startTime, "dateTo": endTime, "prod": product, "schoolIds": schools, "dateUnit": unit, "target": target }
|
|
|
console.log(data, '内容')
|
|
|
console.log(clickNum.value.time, '数字')
|
|
|
proxy.$api.getUseproduct(data).then(async (res) => {
|
|
@@ -1017,9 +1040,13 @@ function serachToresult(startTime, endTime, product, schools, unit) {
|
|
|
//filterdata.value=res.data
|
|
|
}
|
|
|
filterdata.value.forEach((item) => {
|
|
|
- if ((item.name === null || item.name === "" || item.name === undefined) && item.geoInfo !== null && item.geoInfo !== "" && item.geoInfo !== undefined) {
|
|
|
- item.name = item.geoInfo;
|
|
|
- }
|
|
|
+ if ((item.name === null || item.name === "" || item.name === undefined) && item.geoInfo !== null && item.geoInfo !== "" && item.geoInfo !== undefined) {
|
|
|
+ item.name = item.geoInfo;
|
|
|
+ }
|
|
|
+ else if (clickNum.value.target === "tmid" && item.tmid !== null) {
|
|
|
+ item.name = item.tmidInfo.name;
|
|
|
+ item.schoolId = item.tmid;
|
|
|
+ }
|
|
|
})
|
|
|
authDetailsData.value = res.auth;
|
|
|
searchLoading.value = false;
|
|
@@ -1035,13 +1062,15 @@ async function searchData () {
|
|
|
console.log(optionsValue.value)
|
|
|
console.log(productData.value.timevalue)
|
|
|
console.log(clickNum.value.filter, 'NUM')
|
|
|
-
|
|
|
+ console.log(clickNum.value.target, 'target')
|
|
|
+
|
|
|
// if (!productData.value.timevalue) { return }
|
|
|
let searchValue = optionsValue.value
|
|
|
let schoolArr = []
|
|
|
let dateUnits = ''
|
|
|
let times = { start: productData.value.timevalue[0], end: productData.value.timevalue[1] }
|
|
|
let yearValues=''
|
|
|
+ let target = clickNum.value.target
|
|
|
clickNum.value.time === 2 ? (yearValues=productData.value.timevalue.slice(0,4),times.start=productData.value.timevalue,times.end=yearValues+'-12-31'):''
|
|
|
if (clickNum.value.filter === 0 && searchValue) { // 篩選類型 => 來源類型
|
|
|
if (clickNum.value.subject === 0) {// 目标范围 => 學校
|
|
@@ -1088,7 +1117,7 @@ async function searchData () {
|
|
|
console.log(schoolArr, dateUnits, times, '结果')
|
|
|
!searchValue ? schoolArr = [] : ''
|
|
|
schoolArr = [...new Set(schoolArr)]
|
|
|
- serachToresult(times.start, times.end, "HiTeach", schoolArr, dateUnits)
|
|
|
+ serachToresult(times.start, times.end, "HiTeach", schoolArr, dateUnits, target)
|
|
|
}
|
|
|
function serarchInit (value) {
|
|
|
let filterKey = value
|
|
@@ -1259,11 +1288,14 @@ function selectChange (value) {
|
|
|
//确认数据导出
|
|
|
function exportExcel () {
|
|
|
//普通
|
|
|
- let headerArr = []; let keyArr = []
|
|
|
+ let headerArr = [];
|
|
|
+ let keyArr = []
|
|
|
//装置数据
|
|
|
- let deviceArr = [proxy.$t(`product.school`) + proxy.$t(`product.name`), proxy.$t(`product.school`) + proxy.$t(`product.simpleCode`), proxy.$t(`product.device`), proxy.$t(`product.noDeviceAuth`), proxy.$t(`product.hasDeviceAuth`)]; let deviceKey = ['name', 'schoolId', 'disposeDevice', 'deviceNoAuth', 'deviceAuth'];
|
|
|
+ let deviceArr = (clickNum.value.target === 'tmid') ? [proxy.$t(`product.teacher`) + proxy.$t(`product.name`), proxy.$t(`product.teacher`) + 'ID', proxy.$t(`product.device`), proxy.$t(`product.noDeviceAuth`), proxy.$t(`product.hasDeviceAuth`)] : [proxy.$t(`product.school`) + proxy.$t(`product.name`), proxy.$t(`product.school`) + proxy.$t(`product.simpleCode`), proxy.$t(`product.device`), proxy.$t(`product.noDeviceAuth`), proxy.$t(`product.hasDeviceAuth`)];
|
|
|
+ let deviceKey = ['name', 'schoolId', 'disposeDevice', 'deviceNoAuth', 'deviceAuth'];
|
|
|
//ID数据
|
|
|
- let IDArr = [proxy.$t(`product.school`) + proxy.$t(`product.name`), proxy.$t(`product.school`) + proxy.$t(`product.simpleCode`), proxy.$t(`product.teacher`)+'ID']; let IDKey = ['name', 'schoolId', 'disposeId']
|
|
|
+ let IDArr = (clickNum.value.target === 'tmid') ? [proxy.$t(`product.teacher`) + proxy.$t(`product.name`), proxy.$t(`product.teacher`) + 'ID', proxy.$t(`product.teacher`) + 'ID'] : [proxy.$t(`product.school`) + proxy.$t(`product.name`), proxy.$t(`product.school`) + proxy.$t(`product.simpleCode`), proxy.$t(`product.teacher`) + 'ID'];
|
|
|
+ let IDKey = ['name', 'schoolId', 'disposeId']
|
|
|
//处理普通
|
|
|
let superaddition = [
|
|
|
{ label: proxy.$t(`product.missionNumber`), key: 'mission' },
|
|
@@ -1293,7 +1325,25 @@ function exportExcel () {
|
|
|
]
|
|
|
fieldList.value.forEach((item) => {
|
|
|
exportList.value.forEach((items) => {
|
|
|
- item === items.label ? (headerArr.push(items.label), keyArr.push(items.key)) : ''
|
|
|
+ if (clickNum.value.target === 'tmid') {
|
|
|
+ if (item === items.label) {
|
|
|
+ if (item === proxy.$t(`product.school`) + proxy.$t(`product.name`)) {
|
|
|
+ headerArr.push(proxy.$t(`product.teacher`) + proxy.$t(`product.name`))
|
|
|
+ keyArr.push(items.key)
|
|
|
+ }
|
|
|
+ else if (item === proxy.$t(`product.school`) + proxy.$t(`product.simpleCode`)) {
|
|
|
+ headerArr.push(proxy.$t(`product.teacher`) + 'ID')
|
|
|
+ keyArr.push(items.key)
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ headerArr.push(items.label)
|
|
|
+ keyArr.push(items.key)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ item === items.label ? (headerArr.push(items.label), keyArr.push(items.key)) : ''
|
|
|
+ }
|
|
|
})
|
|
|
})
|
|
|
|