Merge branch 'pingcode-20240615' into zcwy-zsx0223

This commit is contained in:
zhangsir
2024-07-05 17:24:29 +08:00
6 changed files with 42 additions and 22 deletions

View File

@@ -17,7 +17,7 @@
</div> </div>
<div> <div>
<div class="contentMain" style="padding:20px"> <div class="contentMain" style="padding:20px">
<CreateOnline ref="onlineRef" :id="props.courseSyncFlag?'':props.id" :type="props.courseSyncFlag?'':props.infoType"> <CreateOnline ref="onlineRef" :id="props.courseSyncFlag?'':props.id" :type="props.courseSyncFlag?'':props.infoType" :courseIds="props.taskList" :projectId="props.id">
<a-button type="primary" style="border-radius: 4px">{{ <a-button type="primary" style="border-radius: 4px">{{
taskIndex === -1 ? "选择/新建课程" : "重新选择" taskIndex === -1 ? "选择/新建课程" : "重新选择"
}} }}
@@ -53,6 +53,7 @@ const props = defineProps({
taskList: [], taskList: [],
chapterList: [] chapterList: []
}); });
const visible = ref(false); const visible = ref(false);
const onlineRef = ref(false); const onlineRef = ref(false);
const taskIndex = ref(-1); const taskIndex = ref(-1);
@@ -137,7 +138,6 @@ function confirm() {
} }
function selectCourse(row) { function selectCourse(row) {
console.log(row);
if (!props.courseSyncFlag && row.refId != props.id) { if (!props.courseSyncFlag && row.refId != props.id) {
message.warning("请新建本项目在线课!"); message.warning("请新建本项目在线课!");
return; return;

View File

@@ -14,7 +14,7 @@
<iframe <iframe
id="iframe" id="iframe"
style="width: 100%; height: 600px" style="width: 100%; height: 600px"
:src="`${iframeUrl}/course/manages?f=choose&refId=${props.id}&refType=${props.type}`" :src="`${iframeUrl}/course/manages?f=choose&refId=${props.id}&refType=${props.type}&courseIds=${couresIdArray}&projectId=${props.projectId}`"
name="myframe" name="myframe"
security="restricted" security="restricted"
sandbox="allow-forms allow-downloads allow-scripts allow-same-origin allow-popups" sandbox="allow-forms allow-downloads allow-scripts allow-same-origin allow-popups"
@@ -26,12 +26,23 @@ import {defineProps, ref} from "vue";
import {iframeUrl} from "@/api/method"; import {iframeUrl} from "@/api/method";
const visible = ref(false); const visible = ref(false);
const couresIdArray = ref();
const props = defineProps({ const props = defineProps({
type: Number, type: Number,
id: Number, id: Number,
courseIds: Array,
projectId: String
}); });
// 把任务列表里类型为在线课的课程ID放到数组里
if(props.courseIds && props.courseIds.length){
var arr = []
for(var i = 0;i<props.courseIds.length;i++){
if(props.courseIds[i].type === 1){
arr.push(props.courseIds[i].courseId)
}
}
couresIdArray.value = arr
}
function openModal() { function openModal() {
visible.value = true; visible.value = true;
} }

View File

@@ -62,9 +62,9 @@ const {data: userList, loading} = useThrottlePage(USER_LIST, memberParam.value,
const options = computed(() => userList.value.filter(e => !(props.value + '').includes(e.id)).map(e => ({ const options = computed(() => userList.value.filter(e => !(props.value + '').includes(e.id)).map(e => ({
label: e.realName + e.userNo, label: e.realName + e.userNo,
value: e.id, value: e.id //,
...e, // ...e,
audienceList: null // audienceList: null
}))) })))
watch(props, init) watch(props, init)

View File

@@ -62,9 +62,9 @@ const {data: userList, loading} = useThrottlePage(USER_LIST, memberParam.value,
const options = computed(() => userList.value.filter(e => !(props.value + '').includes(e.id)).map(e => ({ const options = computed(() => userList.value.filter(e => !(props.value + '').includes(e.id)).map(e => ({
label: e.realName + e.userNo, label: e.realName + e.userNo,
value: e.id, value: e.id // ,
...e, // ...e,
audienceList: null // audienceList: null
}))) })))
watch(props, init) watch(props, init)

View File

@@ -19,7 +19,7 @@ export function downLoadZip(str, filename) {
}) })
} }
const baseUrlManage = process.env.VUE_APP_BASE_API const baseUrlManage = process.env.VUE_APP_BASE_API
export function downLoadZipManage(str, filename) { export function downLoadZipManage(str, filename,fun) {
var url = baseUrlManage + str var url = baseUrlManage + str
axios({ axios({
method: 'get', method: 'get',
@@ -28,6 +28,7 @@ export function downLoadZipManage(str, filename) {
headers: { 'Authorization': 'Bearer ' + getCookieForName("token") } headers: { 'Authorization': 'Bearer ' + getCookieForName("token") }
}).then(res => { }).then(res => {
resolveBlob(res, mimeMap.xlsx,filename) resolveBlob(res, mimeMap.xlsx,filename)
if(fun) fun()
}) })
} }
/** /**

View File

@@ -1,11 +1,13 @@
<template> <template>
<div class="train_newman"> <a-spin :spinning="spinning" tip="报表生成中...">
<div class="title">新任管理者线下学习项目定制报表</div> <div class="train_newman">
<div class="btn" @click="downReport" v-if="uploadAdmin('training-admin')||adminType?.length>0"> <div class="title">新任管理者线下学习项目定制报表</div>
<div class="img"></div> <div class="btn" @click="downReport" v-if="uploadAdmin('training-admin')||adminType?.length>0">
<div class="text">报表下载</div> <div class="img"></div>
</div> <div class="text">报表下载</div>
</div> </div>
</div>
</a-spin>
</template> </template>
<script setup> <script setup>
@@ -14,14 +16,18 @@ import { useStore } from "vuex";
import { reportOrgs } from "@/api/indexProject"; import { reportOrgs } from "@/api/indexProject";
import {downLoadZipManage} from "@/utils/zipdownload"; import {downLoadZipManage} from "@/utils/zipdownload";
const downReport = () => { const downReport = () => {
console.log('下载报表') spinning.value = true
if(uploadAdmin('training-admin')){ if(uploadAdmin('training-admin')){
downLoadZipManage(`/admin/project/report/data`,'新任管理者培训数据') downLoadZipManage(`/admin/project/report/data`,'新任管理者培训数据',function(){
spinning.value = false
})
return return
} }
if(adminType?.value.length>0){ if(adminType?.value.length>0){
let orgs = adminType.value.join(',') let orgs = adminType.value.join(',')
downLoadZipManage(`/admin/project/report/data?orgs=${orgs}`,'新任管理者培训数据') downLoadZipManage(`/admin/project/report/data?orgs=${orgs}`,'新任管理者培训数据',function(){
spinning.value = false
})
} }
} }
const userInfo = computed(() => store.state.userInfo); const userInfo = computed(() => store.state.userInfo);
@@ -30,6 +36,7 @@ import {downLoadZipManage} from "@/utils/zipdownload";
}) })
const store = useStore(); const store = useStore();
const adminType = ref() const adminType = ref()
const spinning = ref(false)
const getReportOrgs = () => { const getReportOrgs = () => {
reportOrgs({workNum: userInfo.value.userNo}).then((res) => { reportOrgs({workNum: userInfo.value.userNo}).then((res) => {
console.log(res,'res') console.log(res,'res')
@@ -46,6 +53,7 @@ import {downLoadZipManage} from "@/utils/zipdownload";
<style lang="scss" scoped> <style lang="scss" scoped>
.train_newman{ .train_newman{
width: calc(100vw - 300px);
margin: 40px 0 0 50px; margin: 40px 0 0 50px;
.title{ .title{
color: #000000; color: #000000;