first commit

This commit is contained in:
2026-09-08 19:49:21 +08:00
commit ebffbab428
7320 changed files with 1477614 additions and 0 deletions
@@ -0,0 +1,144 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<el-card shadow="never">
<div class="search">
<div class="search-item" v-if="pageForm.searchType==='按分工会分析'">
<div class="search-item-label">分工会:</div>
<div class="search-item-option">
<el-select placeholder="分工会" v-model="pageForm.unionId" style="width: 100%;"
@change="unionChange"
clearable
filterable>
<el-option v-for="item in unions" :label="item.unionname" :value="item.id"></el-option>
</el-select>
</div>
</div>
<div class="search-item" v-if="pageForm.searchType==='按单位分析'">
<div class="search-item-label">单位:</div>
<div class="search-item-option">
<el-select placeholder="单位" v-model="pageForm.unitId" style="width: 100%;"
@change="unitChange"
clearable
filterable>
<el-option v-for="item in units" :label="item.name" :value="item.id"></el-option>
</el-select>
</div>
</div>
<div class="offscreen-right pull-right">
<el-radio-group v-model="pageForm.searchType" @change="searchTypeChange">
<el-radio-button label="按分工会分析"></el-radio-button>
<el-radio-button label="按单位分析"></el-radio-button>
</el-radio-group>
</div>
</div>
</el-card>
<el-card shadow="never" class="mt10">
<table-tool label="统计" :app="this"></table-tool>
<el-table :data="tableData" :size="tableSize" style="width: 100%">
<el-table-column type="index" label="序号" width="80px"></el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
show-overflow-tooltip
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
<template v-if="column.prop==='unionName'" scope="{row}">
{{isDisPlayCode?''+row.unionCode+'':null}}{{row.unionName}}
</template>
</el-table-column>
</el-table>
</el-card>
</guava>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
tableColumns: [
{prop: 'unionName', label: '分工会名称'},
{prop: 'unionCode', label: '分工会编码', sortable: true},
{prop: 'unionSum', label: '总人数', sortable: true},
{prop: 'studyNum', label: '学习人数', sortable: true},
],
unions: [],
units: [],
tableData: [],
fullTableData: [],
pageForm: {
searchType: '按分工会分析'
}
}
},
methods: {
unionChange(val) {
if (val == null || val == '') {
this.tableData = this.fullTableData
} else {
this.tableData = this.fullTableData.filter(v => v.id === val)
}
},
unitChange(val) {
if (val == null || val == '') {
this.tableData = this.fullTableData
} else {
this.tableData = this.fullTableData.filter(v => v.id === val)
}
},
searchTypeChange() {
const searchType = this.pageForm.searchType
if (searchType === '按分工会分析') {
this.tableColumns = [
{prop: 'unionName', label: '分工会名称'},
{prop: 'unionCode', label: '分工会编码', sortable: true},
{prop: 'unionSum', label: '总人数', sortable: true},
{prop: 'studyNum', label: '学习人数', sortable: true},
]
} else {
this.tableColumns = [
{prop: 'unitName', label: '单位名称'},
{prop: 'unitCode', label: '单位编码', sortable: true},
{prop: 'unionSum', label: '总人数', sortable: true},
{prop: 'studyNum', label: '学习人数', sortable: true},
]
}
this.pageData()
},
async pageData() {
sublime.showLoadingbar()
this.tableLoading = true
const resp = await $.post(loc() + '/pageData', this.pageForm)
sublime.closeLoadingbar()
this.tableLoading = false
if (resp.code === 0) {
this.tableData = resp.data.list
this.fullTableData = resp.data.list
}
}
},
async created() {
this.pageData()
this.unions = await getUnions(null)
this.units = await getUnits(null)
}
})
</script>
<!--#
}
#-->
@@ -0,0 +1,122 @@
<!--#
layout("/layouts/platform.html"){
#-->
<div id="app" v-cloak>
<guava ref="guava">
<el-card shadow="never" class="mt10">
<table-tool label="统计" :app="this"></table-tool>
<el-table :data="tableData" :size="tableSize" style="width: 100%">
<el-table-column type="index" label="序号" width="80px"></el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in tableColumns"
show-overflow-tooltip
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
<template v-if="column.prop==='sumDuration'" scope="{row}">
{{(row.sumDuration / 60 / 60).toFixed(2) + 'h'}}
</template>
</el-table-column>
<el-table-column align="center" header-align="center" label="操作" width="200">
<template scope="{row}">
<el-button size="small" type="primary" @click="openView(row)">查看具体学习情况</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
<template #view>
<el-table :data="viewTableData" stripe border style="width: 100%">
<el-table-column type="index" label="序号" width="80px">
<template scope="scope">
<span>{{ scope.$index + (viewPageForm.pageNumber - 1) * viewPageForm.pageSize + 1 }} </span>
</template>
</el-table-column>
<el-table-column
align="center"
header-align="center"
v-for="column in viewTableColumns"
show-overflow-tooltip
:label="column.label"
:prop="column.prop"
:sortable="column.sortable"
>
<template v-if="column.prop==='studyDuration'" scope="{row}">
{{(row.studyDuration / 60 / 60).toFixed(2) + 'h'}}
</template>
</el-table-column>
</el-table>
<el-row class="el-pagination-container" style="margin-bottom: 0px">
<el-pagination
@current-change="(val)=>{viewPageForm.pageNumber=val;viewPageData()}"
:current-page="viewPageForm.pageNumber"
:page-size="viewPageForm.pageSize"
layout="total, sizes, prev, pager, next"
:total="viewPageForm.totalCount">
</el-pagination>
</el-row>
</template>
</guava>
</div>
<script>
var vue = new Vue({
el: '#app',
mixins: [initTableMixins],
data() {
return {
tableColumns: [
{prop: 'title', label: '专辑名称'},
{prop: 'typeName', label: '类型'},
{prop: 'studyNum', label: '已看人数', sortable: true},
{prop: 'sumDuration', label: '课程总时长', sortable: true},
],
viewTableColumns: [
{prop: 'username', label: '姓名'},
{prop: 'loginname', label: '工号'},
{prop: 'unitname', label: '单位'},
{prop: 'unionname', label: '分工会'},
{prop: 'studyDuration', label: '观看总时长'},
],
viewPageForm: {
pageNumber: 1,
pageSize: 10,
totalCount: 0,
albumId: null
},
viewTableData: []
}
},
methods: {
async openView(row) {
this.viewPageForm.albumId = row.id
this.$refs['guava'].view()
await this.viewPageData()
},
async viewPageData() {
const resp = await $.post(loc() + '/getWatchDuration', this.viewPageForm)
if (resp.code === 0) {
this.viewTableData = resp.data.list
this.viewPageForm.totalCount = resp.data.totalCount
}
},
viewPageNumberChange(val) {
}
},
created() {
this.pageData()
}
})
</script>
<!--#
}
#-->