Merge branch 'master' of http://47.115.223.229:8888/yangjun/dbsd_kczx
This commit is contained in:
commit
12119203ae
Binary file not shown.
Before Width: | Height: | Size: 243 KiB After Width: | Height: | Size: 621 KiB |
Binary file not shown.
After Width: | Height: | Size: 243 KiB |
Binary file not shown.
After Width: | Height: | Size: 962 B |
Binary file not shown.
After Width: | Height: | Size: 904 B |
|
@ -18,7 +18,7 @@
|
||||||
<span style="position: absolute;top: 4rem;border-radius: 0 10px 10px 0;background: #1ab394;color: #FFF;padding: 3px 10px 3px 5px;z-index: 2;" v-if="item.dqztpx == 1">{{item.dqzt}}</span>
|
<span style="position: absolute;top: 4rem;border-radius: 0 10px 10px 0;background: #1ab394;color: #FFF;padding: 3px 10px 3px 5px;z-index: 2;" v-if="item.dqztpx == 1">{{item.dqzt}}</span>
|
||||||
<span style="position: absolute;top: 4rem;border-radius: 0 10px 10px 0;background: #1c84c6;color: #FFF;padding: 3px 10px 3px 5px;z-index: 2;" v-if="item.dqztpx == 2">{{item.dqzt}}</span>
|
<span style="position: absolute;top: 4rem;border-radius: 0 10px 10px 0;background: #1c84c6;color: #FFF;padding: 3px 10px 3px 5px;z-index: 2;" v-if="item.dqztpx == 2">{{item.dqzt}}</span>
|
||||||
<span style="position: absolute;top: 4rem;border-radius: 0 10px 10px 0;background-color: rgba(0,0,0,0.46);color: #FFF;padding: 3px 10px 3px 5px;z-index: 2;" v-if="item.dqztpx == 3">{{item.dqzt}}</span>
|
<span style="position: absolute;top: 4rem;border-radius: 0 10px 10px 0;background-color: rgba(0,0,0,0.46);color: #FFF;padding: 3px 10px 3px 5px;z-index: 2;" v-if="item.dqztpx == 3">{{item.dqzt}}</span>
|
||||||
<div>
|
<div style="height: 250px;overflow: hidden;">
|
||||||
<img style="border-radius: 10px 10px 0 0;margin-bottom: 8px;" :class="classFun(index)" @error="imgOnError($event)" :src="getFileAccessHttpUrl(item.tpmc)" height="170px"/>
|
<img style="border-radius: 10px 10px 0 0;margin-bottom: 8px;" :class="classFun(index)" @error="imgOnError($event)" :src="getFileAccessHttpUrl(item.tpmc)" height="170px"/>
|
||||||
<!-- <img style="border-radius: 10px 10px 0 0;margin-bottom: 8px;" :class="classFun(index)" v-if="!item.tpmc" src="/resource/img/kc/moren.png" height="170px"/> -->
|
<!-- <img style="border-radius: 10px 10px 0 0;margin-bottom: 8px;" :class="classFun(index)" v-if="!item.tpmc" src="/resource/img/kc/moren.png" height="170px"/> -->
|
||||||
<!-- <AImage style="border-radius: 10px 10px 0 0;" :class="classFun(index)" :onerror="'/resource/img/kc/moren.png'" :src="getFileAccessHttpUrl(item.tpmc)" :preview="false" :width="'100%'" height="170px"/> -->
|
<!-- <AImage style="border-radius: 10px 10px 0 0;" :class="classFun(index)" :onerror="'/resource/img/kc/moren.png'" :src="getFileAccessHttpUrl(item.tpmc)" :preview="false" :width="'100%'" height="170px"/> -->
|
||||||
|
|
|
@ -10,19 +10,30 @@
|
||||||
<div
|
<div
|
||||||
style="width:100%;background: #fff;font-size: 18px;font-weight: bold;margin-top:10px;padding: 10px;">
|
style="width:100%;background: #fff;font-size: 18px;font-weight: bold;margin-top:10px;padding: 10px;">
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :xs="0" :lg="24">
|
<a-col :xs="0" :lg="24" >
|
||||||
<a-button type="primary" @click="toggleCollapsed">
|
<a-button type="primary" @click="toggleCollapsed">
|
||||||
<MenuUnfoldOutlined v-if="collapsed" />
|
<MenuUnfoldOutlined v-if="collapsed" />
|
||||||
<MenuUnfoldOutlined v-else />
|
<MenuUnfoldOutlined v-else />
|
||||||
</a-button>
|
</a-button>
|
||||||
<span class="ellipsis">
|
<span class="ellipsis course-name">
|
||||||
课程名称:{{ kcxxInfo.kcmc }}
|
课程名称:{{ kcxxInfo.kcmc + '(' + toWeek(kcxxInfo.week) + '第' + kcxxInfo.hh + '节)'}}
|
||||||
|
</span>
|
||||||
|
<span class="ellipsis course-location">
|
||||||
|
<!-- 地点: -->
|
||||||
|
{{ kcxxInfo.skdd }}
|
||||||
</span>
|
</span>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :xs="24" :lg="0">
|
<a-col :xs="24" :lg="0">
|
||||||
<span class="ellipsis">
|
<span>
|
||||||
课程名称:{{ kcxxInfo.kcmc }}
|
课程名称:{{ kcxxInfo.kcmc }}
|
||||||
</span>
|
</span>
|
||||||
|
<!-- <span>
|
||||||
|
课程名称:{{ kcxxInfo.kcmc +'(' + toWeek(kcxxInfo.week) + '第' + kcxxInfo.hh + '节)'}}
|
||||||
|
</span>
|
||||||
|
-
|
||||||
|
<span>
|
||||||
|
地点:{{ kcxxInfo.skdd }}
|
||||||
|
</span> -->
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
|
|
||||||
|
@ -77,7 +88,18 @@ const kcxxInfo = ref<string>('');
|
||||||
const spanlg = ref<number>(5);
|
const spanlg = ref<number>(5);
|
||||||
const spanlt = ref<number>(19);
|
const spanlt = ref<number>(19);
|
||||||
const collapsed = ref<any>(false);
|
const collapsed = ref<any>(false);
|
||||||
|
const weebMap = {
|
||||||
|
'1': '星期一',
|
||||||
|
'2': '星期二',
|
||||||
|
'3': '星期三',
|
||||||
|
'4': '星期四',
|
||||||
|
'5': '星期五',
|
||||||
|
'6': '星期六',
|
||||||
|
'7': '星期日',
|
||||||
|
};
|
||||||
|
function toWeek(week) {
|
||||||
|
return weebMap[week];
|
||||||
|
}
|
||||||
|
|
||||||
function toggleCollapsed() {
|
function toggleCollapsed() {
|
||||||
collapsed.value = !collapsed.value;
|
collapsed.value = !collapsed.value;
|
||||||
|
@ -94,7 +116,7 @@ function toggleCollapsed() {
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// console.log('rwbh:',rwbh);
|
// console.log('rwbh:',rwbh);
|
||||||
defHttp.get({ url: '/ktgl/kcKechengbiao/getKcxxByRwbhXqxn', params: { rwbh: rwbh, xqxn: xqxn } }).then((res) => {
|
defHttp.get({ url: '/ktgl/kcKechengbiao/getKcxxByRwbhXqxn', params: { rwbh: rwbh, xqxn: xqxn } }).then((res) => {
|
||||||
// console.log(`🚀 ~ 1111 defHttp.get ~ res:`, res)
|
console.log(`🚀 ~ 1111 defHttp.get ~ res:`, res)
|
||||||
kcxxInfo.value = res;
|
kcxxInfo.value = res;
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@ -151,4 +173,20 @@ onMounted(() => {
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
/* 使用省略号表示溢出的文本 */
|
/* 使用省略号表示溢出的文本 */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.course-info-container {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center; /* 如果需要垂直居中对齐 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.course-name {
|
||||||
|
flex-grow: 1; /* 让第一个span可以自动扩展 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.course-location {
|
||||||
|
float: right;
|
||||||
|
margin-right: 20px; /* 右边距 */
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -2,28 +2,48 @@
|
||||||
<div id="siteMain">
|
<div id="siteMain">
|
||||||
<div id="maxSite">
|
<div id="maxSite">
|
||||||
<a-layout style="height: calc(100vh - 30px)">
|
<a-layout style="height: calc(100vh - 30px)">
|
||||||
<headerPage/>
|
<headerPage />
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :lg="24" :xs="18">
|
<a-col :lg="24" :xs="0">
|
||||||
<div style="width:100%;background: #fff;font-size: 18px;font-weight: bold;margin-top:10px;padding: 10px;">
|
<div
|
||||||
<a-button v-if="!isSmallScreen" type="primary" @click="toggleCollapsed">
|
style="width:100%;background: #fff;font-size: 18px;font-weight: bold;margin-top:10px;padding: 10px;">
|
||||||
<MenuUnfoldOutlined v-if="collapsed" />
|
<a-button v-if="!isSmallScreen" type="primary" @click="toggleCollapsed">
|
||||||
<MenuUnfoldOutlined v-else />
|
<MenuUnfoldOutlined v-if="collapsed" />
|
||||||
</a-button>
|
<MenuUnfoldOutlined v-else />
|
||||||
课程名称:{{kcxxInfo.kcmc}}</div>
|
</a-button>
|
||||||
|
<span class="ellipsis course-name">
|
||||||
|
课程名称:{{ kcxxInfo.kcmc + '(' + toWeek(kcxxInfo.week) + '第' + kcxxInfo.hh + '节)' }}
|
||||||
|
</span>
|
||||||
|
<span class="ellipsis course-location">
|
||||||
|
<!-- 地点: -->
|
||||||
|
{{ kcxxInfo.skdd }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</a-col>
|
||||||
|
<a-col :lg="0" :xs="18">
|
||||||
|
<div
|
||||||
|
style="width:100%;background: #fff;font-size: 18px;font-weight: bold;margin-top:10px;padding: 10px;">
|
||||||
|
<a-button v-if="!isSmallScreen" type="primary" @click="toggleCollapsed">
|
||||||
|
<MenuUnfoldOutlined v-if="collapsed" />
|
||||||
|
<MenuUnfoldOutlined v-else />
|
||||||
|
</a-button>
|
||||||
|
<span class="ellipsis course-name">
|
||||||
|
课程名称:{{ kcxxInfo.kcmc }}
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :lg="0" :xs="6">
|
<a-col :lg="0" :xs="6">
|
||||||
<studentMenu/>
|
<studentMenu />
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :lg="spanlg" :xs="0">
|
<a-col :lg="spanlg" :xs="0">
|
||||||
<studentMenu ref="dqxqkcMenuTag"/>
|
<studentMenu ref="dqxqkcMenuTag" />
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :lg="spanlt" :xs="24">
|
<a-col :lg="spanlt" :xs="24">
|
||||||
<RouterView/>
|
<RouterView />
|
||||||
</a-col>
|
</a-col>
|
||||||
|
|
||||||
<!-- <a-col :lg="5" :xs="{ span: 24 }">
|
<!-- <a-col :lg="5" :xs="{ span: 24 }">
|
||||||
|
@ -33,72 +53,86 @@
|
||||||
<RouterView style="padding:10px;"/>
|
<RouterView style="padding:10px;"/>
|
||||||
</a-col> -->
|
</a-col> -->
|
||||||
</a-row>
|
</a-row>
|
||||||
<footerPage/>
|
<footerPage />
|
||||||
</a-layout>
|
</a-layout>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, onMounted, unref } from 'vue';
|
import { ref, onMounted, unref } from 'vue';
|
||||||
|
|
||||||
import { getUserSf,getSysConfig } from '/@/views/site/utils/index';
|
import { getUserSf, getSysConfig } from '/@/views/site/utils/index';
|
||||||
import { defHttp } from '/@/utils/http/axios';
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { MenuUnfoldOutlined } from '@ant-design/icons-vue';
|
import { MenuUnfoldOutlined } from '@ant-design/icons-vue';
|
||||||
|
|
||||||
|
|
||||||
import headerPage from '/@/views/site/common/header.vue';
|
import headerPage from '/@/views/site/common/header.vue';
|
||||||
import footerPage from '/@/views/site/common/footer.vue';
|
import footerPage from '/@/views/site/common/footer.vue';
|
||||||
import studentMenu from '/@/views/site/studentWdkc/studentMenu.vue';
|
import studentMenu from '/@/views/site/studentWdkc/studentMenu.vue';
|
||||||
import { useScreenSize } from '/src/utils/screenSize/useScreenSize'
|
import { useScreenSize } from '/src/utils/screenSize/useScreenSize'
|
||||||
|
|
||||||
const { isSmallScreen } = useScreenSize();
|
const { isSmallScreen } = useScreenSize();
|
||||||
const maxClassName = ref<any>({});
|
const maxClassName = ref<any>({});
|
||||||
const selectedKeys = ref<string[]>([]);
|
const selectedKeys = ref<string[]>([]);
|
||||||
const kcxxInfo = ref<string>('');
|
const kcxxInfo = ref<string>('');
|
||||||
const dqxqkcMenuTag = ref();
|
const dqxqkcMenuTag = ref();
|
||||||
//当前路由信息
|
//当前路由信息
|
||||||
const { currentRoute } = useRouter();
|
const { currentRoute } = useRouter();
|
||||||
const { query } = unref(currentRoute);
|
const { query } = unref(currentRoute);
|
||||||
const { rwbh,xqxn } = query;//获取传递参数
|
const { rwbh, xqxn } = query;//获取传递参数
|
||||||
let router = useRouter();
|
let router = useRouter();
|
||||||
const spanlg = ref<number>(5);
|
const spanlg = ref<number>(5);
|
||||||
const spanlt = ref<number>(19);
|
const spanlt = ref<number>(19);
|
||||||
const collapsed = ref<any>(false);
|
const collapsed = ref<any>(false);
|
||||||
|
const weebMap = {
|
||||||
|
'1': '星期一',
|
||||||
|
'2': '星期二',
|
||||||
|
'3': '星期三',
|
||||||
|
'4': '星期四',
|
||||||
|
'5': '星期五',
|
||||||
|
'6': '星期六',
|
||||||
|
'7': '星期日',
|
||||||
|
};
|
||||||
|
|
||||||
function toggleCollapsed() {
|
function toWeek(week) {
|
||||||
|
return weebMap[week];
|
||||||
|
}
|
||||||
|
|
||||||
|
function toggleCollapsed() {
|
||||||
collapsed.value = !collapsed.value;
|
collapsed.value = !collapsed.value;
|
||||||
dqxqkcMenuTag.value.toggleCollapsed();
|
dqxqkcMenuTag.value.toggleCollapsed();
|
||||||
if(collapsed.value){
|
if (collapsed.value) {
|
||||||
spanlg.value = 1;
|
spanlg.value = 1;
|
||||||
spanlt.value = 23;
|
spanlt.value = 23;
|
||||||
}else{
|
} else {
|
||||||
spanlg.value = 5;
|
spanlg.value = 5;
|
||||||
spanlt.value = 19;
|
spanlt.value = 19;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//进入就加载
|
//进入就加载
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
defHttp.get({ url: '/ktgl/kcKechengbiao/getKcxxByRwbhXqxn', params: { rwbh: rwbh,xqxn:xqxn } }).then((res) => {
|
defHttp.get({ url: '/ktgl/kcKechengbiao/getKcxxByRwbhXqxn', params: { rwbh: rwbh, xqxn: xqxn } }).then((res) => {
|
||||||
kcxxInfo.value = res;
|
kcxxInfo.value = res;
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
#siteMain {
|
#siteMain {
|
||||||
// font-size: ;
|
// font-size: ;
|
||||||
// height: 100%;
|
// height: 100%;
|
||||||
background: #f3f3f4;
|
background: #f3f3f4;
|
||||||
|
|
||||||
#maxSite {
|
#maxSite {
|
||||||
//最大宽度
|
//最大宽度
|
||||||
max-width: 1070px;
|
max-width: 1070px;
|
||||||
min-height: calc(100vh);
|
min-height: calc(100vh);
|
||||||
//居中
|
//居中
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
.rowGutter{
|
|
||||||
|
.rowGutter {
|
||||||
margin-top: 1rem;
|
margin-top: 1rem;
|
||||||
margin-bottom: 1rem;
|
margin-bottom: 1rem;
|
||||||
}
|
}
|
||||||
|
@ -107,15 +141,18 @@
|
||||||
color: #fff;
|
color: #fff;
|
||||||
background: #1ab394;
|
background: #1ab394;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-layout-footer {
|
.ant-layout-footer {
|
||||||
line-height: 1.5;
|
line-height: 1.5;
|
||||||
background: #FFF;
|
background: #FFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-layout-sider {
|
.ant-layout-sider {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
line-height: 120px;
|
line-height: 120px;
|
||||||
background: #3ba0e9;
|
background: #3ba0e9;
|
||||||
}
|
}
|
||||||
|
|
||||||
.ant-layout-content {
|
.ant-layout-content {
|
||||||
min-height: 120px;
|
min-height: 120px;
|
||||||
color: #000;
|
color: #000;
|
||||||
|
@ -124,4 +161,15 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.course-name {
|
||||||
|
flex-grow: 1;
|
||||||
|
/* 让第一个span可以自动扩展 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.course-location {
|
||||||
|
float: right;
|
||||||
|
margin-right: 20px;
|
||||||
|
/* 右边距 */
|
||||||
|
}
|
||||||
</style>
|
</style>
|
|
@ -1766,7 +1766,7 @@ function handleZySuccess(zyid) {
|
||||||
var url = '/zyInfo/zyInfo/editStudent';
|
var url = '/zyInfo/zyInfo/editStudent';
|
||||||
defHttp.get({ url: url, params: { id: zyid } }).then((res) => {});
|
defHttp.get({ url: url, params: { id: zyid } }).then((res) => {});
|
||||||
|
|
||||||
defHttp.get({ url: '/zyInfo/zyInfo/sendZyWechat', params: { id: zyid } }).then((res) => {});
|
// defHttp.get({ url: '/zyInfo/zyInfo/sendZyWechat', params: { id: zyid } }).then((res) => {});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
<div>老师您好,</div>
|
<div>老师您好,</div>
|
||||||
<div>请根据课程教学大纲的要求,</div>
|
<div>请根据课程教学大纲的要求,</div>
|
||||||
<div>设置学生修完本课程需要完成的作业次数及每次作业在总成绩中所占的比例。</div>
|
<div>设置学生修完本课程需要完成的作业次数及每次作业在总成绩中所占的比例。</div>
|
||||||
<div style="margin-top: 30px" class="ant-btn buttonClass"><a @click="handleSzzycs(1)">设置作业次数</a></div>
|
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
</div>
|
</div>
|
||||||
<a-col :span="24" v-if="formData.wwtgl" class="wrapper-back">
|
<a-col :span="24" v-if="formData.wwtgl" class="wrapper-back">
|
||||||
<div class="wrapper-title">查重设置</div>
|
<div class="wrapper-title">查重设置</div>
|
||||||
<a-form-item layout="inline" class="ccsz-main">
|
<a-form-item layout="inline" style="margin-left: 100px">
|
||||||
<a-form-item label="检测通过率" :labelCol="labelCol3" :wrapperCol="wrapperCol3">
|
<a-form-item label="检测通过率" :labelCol="labelCol3" :wrapperCol="wrapperCol3">
|
||||||
<span style="padding: 7px 10px"></span>
|
<span style="padding: 7px 10px"></span>
|
||||||
<a-input-number v-model:value="formData.wwtgl" placeholder="检测通过率" style="width: 60%" :max="100" :min="0" disabled>
|
<a-input-number v-model:value="formData.wwtgl" placeholder="检测通过率" style="width: 60%" :max="100" :min="0" disabled>
|
||||||
|
@ -81,7 +81,7 @@
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
|
||||||
<a-col v-if="formData.pyContent || formData.pyFilePath">
|
<a-col v-show="formData.pyContent || formData.pyFilePath|| formData.score">
|
||||||
<div class="wrapper-back">
|
<div class="wrapper-back">
|
||||||
<div class="wrapper-title">批阅信息</div>
|
<div class="wrapper-title">批阅信息</div>
|
||||||
<a-row>
|
<a-row>
|
||||||
|
@ -96,6 +96,9 @@
|
||||||
<a-button type="primary" style="margin-left: 10px" @click="downLoad(formData.pyFilePath)">下载</a-button>
|
<a-button type="primary" style="margin-left: 10px" @click="downLoad(formData.pyFilePath)">下载</a-button>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
<a-col :span="24" v-show="showType == '1'">
|
||||||
|
<div class="wps-iframe" id="wpsiframeid" style="width:100%;height: 500px;"></div>
|
||||||
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</div>
|
</div>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
@ -155,8 +158,12 @@ import { useRouter } from 'vue-router';
|
||||||
import dayjs, { Dayjs } from 'dayjs';
|
import dayjs, { Dayjs } from 'dayjs';
|
||||||
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
|
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
|
||||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||||
|
import WebOfficeSDK from '/@/views/zy/zyInfoStudent/components/wpsApi/web-office-sdk-solution-v2.0.7.es'
|
||||||
|
|
||||||
import { downloadFile } from '/@/utils/common/renderUtils';
|
import { downloadFile } from '/@/utils/common/renderUtils';
|
||||||
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
|
|
||||||
|
const userStore = useUserStore();
|
||||||
//当前路由信息
|
//当前路由信息
|
||||||
const { currentRoute } = useRouter();
|
const { currentRoute } = useRouter();
|
||||||
const { query } = unref(currentRoute);
|
const { query } = unref(currentRoute);
|
||||||
|
@ -166,6 +173,7 @@ const props = defineProps({
|
||||||
formData: { type: Object, default: () => {} },
|
formData: { type: Object, default: () => {} },
|
||||||
formBpm: { type: Boolean, default: true },
|
formBpm: { type: Boolean, default: true },
|
||||||
});
|
});
|
||||||
|
const showType = ref<string>('0');
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const useForm = Form.useForm;
|
const useForm = Form.useForm;
|
||||||
const emit = defineEmits(['register', 'ok']);
|
const emit = defineEmits(['register', 'ok']);
|
||||||
|
@ -283,11 +291,61 @@ function add() {
|
||||||
* 编辑
|
* 编辑
|
||||||
*/
|
*/
|
||||||
function edit(record) {
|
function edit(record) {
|
||||||
|
console.log("🚀 ~ edit ~ record:", record)
|
||||||
nextTick(() => {
|
nextTick(() => {
|
||||||
resetFields();
|
resetFields();
|
||||||
//赋值
|
//赋值
|
||||||
Object.assign(formData, record);
|
Object.assign(formData, record);
|
||||||
handleKcnr(formData.kcnr);
|
handleKcnr(formData.kcnr);
|
||||||
|
|
||||||
|
|
||||||
|
const parts = record.stuFilePath.split('.');
|
||||||
|
const filetype = parts[parts.length - 1];
|
||||||
|
console.log(`🚀 ~ nextTick ~ filetype:`, filetype)
|
||||||
|
let wpsType = "w";
|
||||||
|
if(filetype=='doc' || filetype=='docx'){
|
||||||
|
showType.value = '1';
|
||||||
|
wpsType = "w";
|
||||||
|
}else if(filetype=='pdf'){
|
||||||
|
showType.value = '1';
|
||||||
|
wpsType = "f";
|
||||||
|
}else if(filetype=='ppt' || filetype=='pptx' ){
|
||||||
|
showType.value = '1';
|
||||||
|
wpsType = "p";
|
||||||
|
}else if(filetype=='xls' || filetype=='xlsx' ){
|
||||||
|
showType.value = '1';
|
||||||
|
wpsType = "s";
|
||||||
|
}
|
||||||
|
|
||||||
|
if(showType.value == '1'){
|
||||||
|
const element = document.getElementById('wpsiframeid');
|
||||||
|
console.log('userStore.getUserInfo',userStore.getUserInfo)
|
||||||
|
formData.id = '1863389832580046849';
|
||||||
|
// 清空内容
|
||||||
|
element.innerHTML = '';
|
||||||
|
const jssdk = WebOfficeSDK.init({
|
||||||
|
officeType: wpsType,
|
||||||
|
appId: 'SX20241118WSUGQN',
|
||||||
|
// fileId: formData.stuId,
|
||||||
|
fileId: formData.id,
|
||||||
|
mount:document.querySelector('.wps-iframe'),
|
||||||
|
commonOptions: {
|
||||||
|
isShowDocMap: false, //是否开启目录功能,默认开启
|
||||||
|
isShowTopArea: false, // 隐藏顶部区域(头部和工具栏)
|
||||||
|
isShowHeader: false, // 隐藏头部区域
|
||||||
|
isBrowserViewFullscreen: true, // 是否在浏览器区域全屏
|
||||||
|
isIframeViewFullscreen: true, // 是否在 iframe 区域内全屏
|
||||||
|
acceptVisualViewportResizeEvent: true // 控制 WebOffice 是否接受外部的 VisualViewport
|
||||||
|
},
|
||||||
|
wordOptions: {
|
||||||
|
isShowDocMap: false, // 是否开启目录功能,默认开启
|
||||||
|
isBestScale: true, // 打开文档时,默认以最佳比例显示
|
||||||
|
isShowBottomStatusBar: false, // 是否展示底部状态栏
|
||||||
|
},
|
||||||
|
token: userStore.getUserInfo.username
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -385,30 +443,11 @@ defineExpose({
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
// 小屏
|
.antd-modal-form {
|
||||||
@media (max-width: 768px) {
|
min-height: 300px !important;
|
||||||
.ccsz-main{}
|
overflow-y: auto;
|
||||||
|
padding: 24px 24px 24px 24px;
|
||||||
.antd-modal-form {
|
|
||||||
min-height: 300px !important;
|
|
||||||
overflow-y: auto;
|
|
||||||
padding: 5px 5px 5px 5px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 大屏
|
|
||||||
@media (min-width: 769px) {
|
|
||||||
.ccsz-main{
|
|
||||||
margin-left: 100px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.antd-modal-form {
|
|
||||||
min-height: 300px !important;
|
|
||||||
overflow-y: auto;
|
|
||||||
padding: 24px 24px 24px 24px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.spanSm {
|
.spanSm {
|
||||||
top: -22px;
|
top: -22px;
|
||||||
position: inherit;
|
position: inherit;
|
||||||
|
@ -426,23 +465,12 @@ defineExpose({
|
||||||
.spanb-word {
|
.spanb-word {
|
||||||
color: #999999;
|
color: #999999;
|
||||||
}
|
}
|
||||||
@media (max-width: 768px) {
|
.wrapper-back {
|
||||||
.wrapper-back {
|
background: #fff;
|
||||||
background: #fff;
|
border-radius: 10px;
|
||||||
border-radius: 10px;
|
margin-top: 10px;
|
||||||
margin-top: 10px;
|
padding-top: 15px;
|
||||||
padding: 15px;
|
width: 100%;
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@media (min-width: 769px) {
|
|
||||||
.wrapper-back {
|
|
||||||
background: #fff;
|
|
||||||
border-radius: 10px;
|
|
||||||
margin-top: 10px;
|
|
||||||
padding-top: 15px;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
.wrapper-title {
|
.wrapper-title {
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
|
|
|
@ -0,0 +1,442 @@
|
||||||
|
<template>
|
||||||
|
<a-spin :spinning="confirmLoading">
|
||||||
|
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="12">
|
||||||
|
<div v-show="showType=='1'">
|
||||||
|
<div class="wps-iframe" id="wpsiframeid" style="width:100%;height: 500px;"></div>
|
||||||
|
</div>
|
||||||
|
<div v-if="showType=='2'">
|
||||||
|
<div style="padding: 10px 20px;">
|
||||||
|
<a-button type="primary" @click="rotateImage">顺时针旋转</a-button>
|
||||||
|
<a-button type="primary" @click="rotateImage2" style="margin-left: 20px;">逆时针旋转</a-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="image-container">
|
||||||
|
<img :src="ylurl" :style="{ transform: 'rotate(' + rotationAngle + 'deg)' }" class="rotated-image"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-if="showType=='3'">
|
||||||
|
<div class="video-container">
|
||||||
|
<video
|
||||||
|
ref="videoPlayer"
|
||||||
|
:controls="controls"
|
||||||
|
:autoplay="autoplay"
|
||||||
|
:loop="loop"
|
||||||
|
:src="videoUrl"
|
||||||
|
@loadedmetadata="playVideoInFullscreen"
|
||||||
|
>
|
||||||
|
</video>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- <div v-else>
|
||||||
|
<a-button type="primary">下载文件</a-button>
|
||||||
|
</div> -->
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="12">
|
||||||
|
<a-row>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="作业名称">
|
||||||
|
{{zyInfo.title}}
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="学生姓名">
|
||||||
|
{{formData.studentName}}
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="评分" v-bind="validateInfos.score">
|
||||||
|
<a-input-number v-model:value="formData.score" style="width: 100%" placeholder="请填写评分" ></a-input-number>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="批阅内容" v-bind="validateInfos.pyContent">
|
||||||
|
<JEditor v-model:value="formData.pyContent" />
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="批阅附件" v-bind="validateInfos.pyFilePath">
|
||||||
|
<j-upload v-model:value="formData.pyFilePath" maxCount="1" :text="`上传批阅附件`" style="background: #ededed; " :forceAcceptVerify="true" ></j-upload>
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24" style="text-align: center;" v-if="disabled">
|
||||||
|
<div >
|
||||||
|
<a-button type="primary" @click="submitForm">保存</a-button>
|
||||||
|
<a-button type="primary" @click="submitNextForm" style="margin-left: 10px;">保存并下一个</a-button>
|
||||||
|
</div>
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
</a-col>
|
||||||
|
|
||||||
|
</a-row>
|
||||||
|
</a-form>
|
||||||
|
</a-spin>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script lang="ts" setup>
|
||||||
|
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted,onUnmounted } from 'vue';
|
||||||
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
|
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
|
||||||
|
import { getValueType } from '/@/utils';
|
||||||
|
import { saveOrUpdate } from '../ZyInfoStudent.api';
|
||||||
|
import { Form } from 'ant-design-vue';
|
||||||
|
import JEditor from '/@/components/Form/src/jeecg/components/JEditor.vue';
|
||||||
|
import { useGlobSetting } from '/@/hooks/setting';
|
||||||
|
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||||
|
import { getToken } from '/@/utils/auth';
|
||||||
|
import WebOfficeSDK from './wpsApi/web-office-sdk-solution-v2.0.7.es'
|
||||||
|
|
||||||
|
const props = defineProps({
|
||||||
|
formDisabled: { type: Boolean, default: false },
|
||||||
|
formData: { type: Object, default: ()=>{} },
|
||||||
|
formBpm: { type: Boolean, default: true }
|
||||||
|
});
|
||||||
|
const formRef = ref();
|
||||||
|
const useForm = Form.useForm;
|
||||||
|
const emit = defineEmits(['register', 'ok', 'ok2']);
|
||||||
|
const formData = reactive<Record<string, any>>({
|
||||||
|
id: '',
|
||||||
|
score: '',
|
||||||
|
pyContent: '',
|
||||||
|
pyFilePath: '',
|
||||||
|
});
|
||||||
|
const { createMessage } = useMessage();
|
||||||
|
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
|
||||||
|
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
|
||||||
|
const confirmLoading = ref<boolean>(false);
|
||||||
|
const showType = ref<string>('1');
|
||||||
|
const ylurl = ref<string>('');
|
||||||
|
const rotationAngle = ref(0);
|
||||||
|
const zyInfo = ref<any>({});
|
||||||
|
const globSetting = useGlobSetting();
|
||||||
|
const baseApiUrl = globSetting.domainUrl;
|
||||||
|
|
||||||
|
const videoPlayer = ref(null);
|
||||||
|
const videoOpen = ref<boolean>(false);
|
||||||
|
const controls = ref(true);
|
||||||
|
const autoplay = ref(false)
|
||||||
|
const loop = ref(false);
|
||||||
|
const videoUrl = ref<String>('');
|
||||||
|
const jssdkInfo = ref<any>({});
|
||||||
|
|
||||||
|
|
||||||
|
//表单验证
|
||||||
|
const validatorRules = {
|
||||||
|
score: [{ required: true, message: '请输入分数!' }],
|
||||||
|
};
|
||||||
|
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
|
||||||
|
|
||||||
|
// 表单禁用
|
||||||
|
const disabled = computed(()=>{
|
||||||
|
if(props.formBpm === true){
|
||||||
|
if(props.formData.disabled === false){
|
||||||
|
return false;
|
||||||
|
}else{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return props.formDisabled;
|
||||||
|
});
|
||||||
|
|
||||||
|
function handleJyfz(record){
|
||||||
|
console.log(`🚀 ~ handleJyfz ~ record:`, record)
|
||||||
|
// if(zyInfo.score){
|
||||||
|
// if(parseInt(record) > parseInt(zyInfo.score)){
|
||||||
|
// createMessage.warning('评分不能超过预设作业分值!');
|
||||||
|
// formData.score = zyInfo.score;
|
||||||
|
// }
|
||||||
|
// }else{
|
||||||
|
// if(parseInt(record) > 100){
|
||||||
|
// createMessage.warning('评分不能超过100分!');
|
||||||
|
// formData.score = zyInfo.score;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
if(parseInt(record) > 100){
|
||||||
|
createMessage.warning('评分不能超过100分!');
|
||||||
|
formData.score = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if(parseInt(record) < 0){
|
||||||
|
createMessage.warning('评分不能低于0分!');
|
||||||
|
formData.score = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function rotateImage() {
|
||||||
|
rotationAngle.value += 90; // 每次点击旋转90度
|
||||||
|
}
|
||||||
|
|
||||||
|
function rotateImage2() {
|
||||||
|
rotationAngle.value -= 90; // 每次点击旋转90度
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 新增
|
||||||
|
*/
|
||||||
|
function add() {
|
||||||
|
edit({});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
*/
|
||||||
|
function edit(record) {
|
||||||
|
showType.value = '1';
|
||||||
|
formData.pyContent = ''
|
||||||
|
nextTick(() => {
|
||||||
|
resetFields();
|
||||||
|
|
||||||
|
defHttp.get({url:'/zyInfo/zyInfo/queryById',params:{id:record.mainId}}).then(res=>{
|
||||||
|
console.log(`🚀 ~ defHttp.get ~ res:`, res)
|
||||||
|
zyInfo.value = res;
|
||||||
|
})
|
||||||
|
const parts = record.filePath.split('.');
|
||||||
|
const filetype = parts[parts.length - 1];
|
||||||
|
console.log(`🚀 ~ nextTick ~ filetype:`, filetype)
|
||||||
|
// var file = getFileAccessHttpUrl(record.filePath);
|
||||||
|
// ylurl.value = file;
|
||||||
|
let wpsType = "w";
|
||||||
|
if(filetype=='jpg' || filetype=='png' || filetype=='jpeg' || filetype=='xls' || filetype=='xlsx' || filetype=='text' ){
|
||||||
|
showType.value = '2';
|
||||||
|
var file = getFileAccessHttpUrl(record.filePath);
|
||||||
|
ylurl.value = file;
|
||||||
|
}else if(filetype=='doc' || filetype=='docx'){
|
||||||
|
showType.value = '1';
|
||||||
|
wpsType = "w";
|
||||||
|
}else if(filetype=='pdf'){
|
||||||
|
showType.value = '1';
|
||||||
|
wpsType = "f";
|
||||||
|
}else if(filetype=='ppt' || filetype=='pptx' ){
|
||||||
|
showType.value = '1';
|
||||||
|
wpsType = "p";
|
||||||
|
}else if(filetype=='xls' || filetype=='xlsx' ){
|
||||||
|
showType.value = '1';
|
||||||
|
wpsType = "s";
|
||||||
|
}else if(filetype=='mp4'|| filetype=='avi'|| filetype=='mp3'|| filetype=='wav'){
|
||||||
|
showType.value = '3';
|
||||||
|
let url = getFileAccessHttpUrl(record.filePath);
|
||||||
|
console.log('视频预览-----》',url);
|
||||||
|
// videoOpen.value = true;
|
||||||
|
videoUrl.value = url;
|
||||||
|
}else{
|
||||||
|
showType.value = '0';
|
||||||
|
}
|
||||||
|
//赋值
|
||||||
|
Object.assign(formData, record);
|
||||||
|
|
||||||
|
// formData.id = '1858776554910433282';
|
||||||
|
|
||||||
|
console.log("🚀 ~ nextTick ~ formData.id:", formData.id)
|
||||||
|
if(showType.value == '1'){// 获取元素
|
||||||
|
const element = document.getElementById('wpsiframeid');
|
||||||
|
// 清空内容
|
||||||
|
element.innerHTML = '';
|
||||||
|
const jssdk = WebOfficeSDK.init({
|
||||||
|
officeType: wpsType,
|
||||||
|
appId: 'SX20241118WSUGQN',
|
||||||
|
fileId: formData.id,
|
||||||
|
mount:document.querySelector('.wps-iframe'),
|
||||||
|
commonOptions: {
|
||||||
|
isShowDocMap: false, //是否开启目录功能,默认开启
|
||||||
|
// isShowTopArea: false, // 隐藏顶部区域(头部和工具栏)
|
||||||
|
// isShowHeader: false, // 隐藏头部区域
|
||||||
|
isBrowserViewFullscreen: true, // 是否在浏览器区域全屏
|
||||||
|
isIframeViewFullscreen: true, // 是否在 iframe 区域内全屏
|
||||||
|
acceptVisualViewportResizeEvent: true // 控制 WebOffice 是否接受外部的 VisualViewport
|
||||||
|
},
|
||||||
|
wordOptions: {
|
||||||
|
isShowDocMap: false, // 是否开启目录功能,默认开启
|
||||||
|
isBestScale: true, // 打开文档时,默认以最佳比例显示
|
||||||
|
isShowBottomStatusBar: false, // 是否展示底部状态栏
|
||||||
|
}
|
||||||
|
//token: getToken()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// --------------------------视频------------------------------
|
||||||
|
const playVideo = () => {
|
||||||
|
videoPlayer.value.play();
|
||||||
|
};
|
||||||
|
|
||||||
|
const pauseVideo = () => {
|
||||||
|
videoPlayer.value.pause();
|
||||||
|
};
|
||||||
|
const handleFullScreenChange = () => {
|
||||||
|
if (!document.fullscreenElement) {
|
||||||
|
console.log('Video exited fullscreen');
|
||||||
|
// 这里可以执行取消全屏后的逻辑
|
||||||
|
videoOpen.value = false;
|
||||||
|
videoPlayer.value.pause();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
function videoHandleCancel(){
|
||||||
|
pauseVideo();
|
||||||
|
videoOpen.value = false;
|
||||||
|
}
|
||||||
|
onMounted(() => {
|
||||||
|
document.addEventListener('fullscreenchange', handleFullScreenChange);
|
||||||
|
});
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
document.removeEventListener('fullscreenchange', handleFullScreenChange);
|
||||||
|
});
|
||||||
|
|
||||||
|
//视频预览
|
||||||
|
function handleVideo(three){
|
||||||
|
let url = getFileAccessHttpUrl(three.filePath);
|
||||||
|
console.log('视频预览-----》',url);
|
||||||
|
videoOpen.value = true;
|
||||||
|
videoUrl.value = url;
|
||||||
|
playVideoInFullscreen();
|
||||||
|
// setTimeout(() => {
|
||||||
|
// playVideo();
|
||||||
|
// }, 1000);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// --------------------------视频------------------------------
|
||||||
|
const playVideoInFullscreen = async () => {
|
||||||
|
if (videoPlayer.value) {
|
||||||
|
try {
|
||||||
|
// 使用原生DOM方法请求全屏
|
||||||
|
// await videoPlayer.value.requestFullscreen();
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交数据
|
||||||
|
*/
|
||||||
|
async function submitForm() {
|
||||||
|
// 触发表单验证
|
||||||
|
await validate();
|
||||||
|
confirmLoading.value = true;
|
||||||
|
const isUpdate = ref<boolean>(false);
|
||||||
|
//时间格式化
|
||||||
|
let model = formData;
|
||||||
|
if (model.id) {
|
||||||
|
isUpdate.value = true;
|
||||||
|
}
|
||||||
|
//循环数据
|
||||||
|
for (let data in model) {
|
||||||
|
//如果该数据是数组并且是字符串类型
|
||||||
|
if (model[data] instanceof Array) {
|
||||||
|
let valueType = getValueType(formRef.value.getProps, data);
|
||||||
|
//如果是字符串类型的需要变成以逗号分割的字符串
|
||||||
|
if (valueType === 'string') {
|
||||||
|
model[data] = model[data].join(',');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
defHttp.post({url:'/zyInfoStudent/zyInfoStudent/editPiyue',params:model}).then(res =>{
|
||||||
|
emit('ok');
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
confirmLoading.value = false;
|
||||||
|
});
|
||||||
|
// await saveOrUpdate(model, isUpdate.value)
|
||||||
|
// .then((res) => {
|
||||||
|
// if (res.success) {
|
||||||
|
// createMessage.success(res.message);
|
||||||
|
// emit('ok');
|
||||||
|
// } else {
|
||||||
|
// createMessage.warning(res.message);
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// .finally(() => {
|
||||||
|
// confirmLoading.value = false;
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 提交数据并下一个
|
||||||
|
*/
|
||||||
|
async function submitNextForm() {
|
||||||
|
// 触发表单验证
|
||||||
|
await validate();
|
||||||
|
confirmLoading.value = true;
|
||||||
|
const isUpdate = ref<boolean>(false);
|
||||||
|
//时间格式化
|
||||||
|
let model = formData;
|
||||||
|
if (model.id) {
|
||||||
|
isUpdate.value = true;
|
||||||
|
}
|
||||||
|
//循环数据
|
||||||
|
for (let data in model) {
|
||||||
|
//如果该数据是数组并且是字符串类型
|
||||||
|
if (model[data] instanceof Array) {
|
||||||
|
let valueType = getValueType(formRef.value.getProps, data);
|
||||||
|
//如果是字符串类型的需要变成以逗号分割的字符串
|
||||||
|
if (valueType === 'string') {
|
||||||
|
model[data] = model[data].join(',');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
await defHttp.post({url:'/zyInfoStudent/zyInfoStudent/editPiyue',params:model}).then(res =>{
|
||||||
|
emit('ok2');
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
await defHttp.get({url:'/zyInfoStudent/zyInfoStudent/getList2',params:{column:'createTime',order:'asc',pageNo:1,pageSize:10,ywid:zyInfo.value.id,rwbh:zyInfo.value.rwbh,queryType:5}}).then(res =>{
|
||||||
|
console.log(`🚀 ~ awaitdefHttp.post ~ res:`, res)
|
||||||
|
var list = res.records;
|
||||||
|
if(list.length>0){
|
||||||
|
edit(list[0])
|
||||||
|
}else{
|
||||||
|
createMessage.warning('已批阅完毕,暂无下一条批阅数据!');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
confirmLoading.value = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
add,
|
||||||
|
edit,
|
||||||
|
submitForm,
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="less" scoped>
|
||||||
|
.antd-modal-form {
|
||||||
|
min-height: 150px !important;
|
||||||
|
overflow-y: auto;
|
||||||
|
padding: 24px 24px 24px 24px;
|
||||||
|
}
|
||||||
|
.video-container {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
video {
|
||||||
|
display: block;
|
||||||
|
max-width: 100%; /* 确保视频宽度不超过其容器宽度 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.image-container {
|
||||||
|
padding: 10px;
|
||||||
|
width:100%; /* 设置容器宽度 */
|
||||||
|
height: auto; /* 设置容器高度 */
|
||||||
|
overflow: hidden; /* 隐藏溢出的部分 */
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.rotated-image {
|
||||||
|
max-width: 100%; /* 最大宽度为容器宽度 */
|
||||||
|
max-height: 100%; /* 最大高度为容器高度 */
|
||||||
|
object-fit: contain; /* 保持图片内容不失真 */
|
||||||
|
transform: rotate(90deg); /* 假设图片已经旋转90度 */
|
||||||
|
}
|
||||||
|
</style>
|
|
@ -1,53 +1,61 @@
|
||||||
<template>
|
<template>
|
||||||
<a-spin :spinning="confirmLoading">
|
<a-spin :spinning="confirmLoading">
|
||||||
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
<a-form ref="formRef" class="antd-modal-form" :labelCol="labelCol" :wrapperCol="wrapperCol">
|
||||||
<a-row :gutter="[16, 16]">
|
<a-row>
|
||||||
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
<a-col :push="leftSpan - 1" :span="0" :lg="{ span: 1 }">
|
||||||
<div v-if="showType=='1'">
|
<!-- <a-button style="margin-left: 28px;" type="primary" @click="changeSpan" size="small">{{ leftSpan == 12? '放大' : '缩小' }}</a-button> -->
|
||||||
<iframe id="pdfPreviewIframe" :src="ylurl" frameborder="0" width="100%" height="550px" scrolling="auto"></iframe>
|
<img v-show="leftSpan == 12" @click="changeSpan" style="width: 25px;margin-left: 50px;cursor: pointer;"
|
||||||
|
src="/resource/img/toright.png" />
|
||||||
|
<img v-show="leftSpan != 12" @click="changeSpan" style="width: 25px;margin-left: 50px;cursor: pointer;"
|
||||||
|
src="/resource/img/toleft.png" />
|
||||||
|
</a-col>
|
||||||
|
</a-row>
|
||||||
|
<a-row>
|
||||||
|
<a-col :xs="24" :lg="leftSpan">
|
||||||
|
<div v-show="showType == '1'">
|
||||||
|
<div class="wps-iframe" id="wpsiframeid" style="width:100%;height: 500px;"></div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="showType=='2'">
|
<div v-if="showType == '2'">
|
||||||
<div style="padding: 10px 20px;">
|
<div style="padding: 10px 20px;">
|
||||||
<a-button type="primary" @click="rotateImage">顺时针旋转</a-button>
|
<a-button type="primary" @click="rotateImage">顺时针旋转</a-button>
|
||||||
<a-button type="primary" @click="rotateImage2" style="margin-left: 20px;">逆时针旋转</a-button>
|
<a-button type="primary" @click="rotateImage2" style="margin-left: 20px;">逆时针旋转</a-button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="image-container">
|
<div class="image-container">
|
||||||
<img :src="ylurl" :style="{ transform: 'rotate(' + rotationAngle + 'deg)' }" class="rotated-image"/>
|
<img :src="ylurl" :style="{ transform: 'rotate(' + rotationAngle + 'deg)' }" class="rotated-image" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="showType=='3'">
|
<div v-if="showType == '3'">
|
||||||
<div class="video-container">
|
<div class="video-container">
|
||||||
<video
|
<video ref="videoPlayer" :controls="controls" :autoplay="autoplay" :loop="loop" :src="videoUrl"
|
||||||
ref="videoPlayer"
|
@loadedmetadata="playVideoInFullscreen">
|
||||||
:controls="controls"
|
|
||||||
:autoplay="autoplay"
|
|
||||||
:loop="loop"
|
|
||||||
:src="videoUrl"
|
|
||||||
@loadedmetadata="playVideoInFullscreen"
|
|
||||||
>
|
|
||||||
</video>
|
</video>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<!-- <div v-else>
|
||||||
<a-button type="primary">下载文件</a-button>
|
<a-button type="primary">下载文件</a-button>
|
||||||
</div>
|
</div> -->
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :xs="24" :sm="24" :md="12" :lg="12" :xl="12">
|
<a-col :xs="24" :lg="rightSpan">
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item label="作业名称">
|
<a-form-item label="作业名称">
|
||||||
{{zyInfo.title}}
|
{{ zyInfo.title }}
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item label="学生姓名">
|
<a-form-item label="学生姓名">
|
||||||
{{formData.studentName}}
|
{{ formData.studentName }}
|
||||||
|
</a-form-item>
|
||||||
|
</a-col>
|
||||||
|
<a-col :span="24">
|
||||||
|
<a-form-item label="学生学号">
|
||||||
|
{{ formData.createBy }}
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item label="评分" v-bind="validateInfos.score">
|
<a-form-item label="评分" v-bind="validateInfos.score">
|
||||||
<a-input-number v-model:value="formData.score" style="width: 100%" placeholder="请填写评分" ></a-input-number>
|
<a-input-number v-model:value="formData.score" style="width: 100%" placeholder="请填写评分"></a-input-number>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
|
@ -57,113 +65,135 @@
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24">
|
<a-col :span="24">
|
||||||
<a-form-item label="批阅附件" v-bind="validateInfos.pyFilePath">
|
<a-form-item label="批阅附件" v-bind="validateInfos.pyFilePath">
|
||||||
<j-upload v-model:value="formData.pyFilePath" maxCount="1" :text="`上传批阅附件`" style="background: #ededed; " :forceAcceptVerify="true" ></j-upload>
|
<j-upload v-model:value="formData.pyFilePath" maxCount="1" :text="`上传批阅附件`"
|
||||||
|
style="background: #ededed; " :forceAcceptVerify="true"></j-upload>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</a-col>
|
||||||
<a-col :span="24" style="text-align: center;" v-if="disabled">
|
<a-col :span="24" style="text-align: center;" v-if="disabled">
|
||||||
<div >
|
<div>
|
||||||
<a-button type="primary" @click="submitForm">保存</a-button>
|
<a-button type="primary" @click="submitForm">保存</a-button>
|
||||||
<a-button type="primary" @click="submitNextForm" style="margin-left: 10px;">保存并下一个</a-button>
|
<a-button type="primary" @click="submitNextForm" style="margin-left: 10px;">保存并下一个</a-button>
|
||||||
</div>
|
</div>
|
||||||
</a-col>
|
</a-col>
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-col>
|
</a-col>
|
||||||
|
|
||||||
</a-row>
|
</a-row>
|
||||||
</a-form>
|
</a-form>
|
||||||
</a-spin>
|
</a-spin>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted,onUnmounted } from 'vue';
|
import { ref, reactive, defineExpose, nextTick, defineProps, computed, onMounted, onUnmounted } from 'vue';
|
||||||
import { defHttp } from '/@/utils/http/axios';
|
import { defHttp } from '/@/utils/http/axios';
|
||||||
import { useMessage } from '/@/hooks/web/useMessage';
|
import { useMessage } from '/@/hooks/web/useMessage';
|
||||||
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
|
import JUpload from '/@/components/Form/src/jeecg/components/JUpload/JUpload.vue';
|
||||||
import { getValueType } from '/@/utils';
|
import { getValueType } from '/@/utils';
|
||||||
import { saveOrUpdate } from '../ZyInfoStudent.api';
|
import { saveOrUpdate } from '../ZyInfoStudent.api';
|
||||||
import { Form } from 'ant-design-vue';
|
import { Form } from 'ant-design-vue';
|
||||||
import JEditor from '/@/components/Form/src/jeecg/components/JEditor.vue';
|
import JEditor from '/@/components/Form/src/jeecg/components/JEditor.vue';
|
||||||
import { useGlobSetting } from '/@/hooks/setting';
|
import { useGlobSetting } from '/@/hooks/setting';
|
||||||
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
import { getFileAccessHttpUrl } from '/@/utils/common/compUtils';
|
||||||
import { getToken } from '/@/utils/auth';
|
import { getToken } from '/@/utils/auth';
|
||||||
|
import WebOfficeSDK from './wpsApi/web-office-sdk-solution-v2.0.7.es'
|
||||||
const props = defineProps({
|
import { useUserStore } from '/@/store/modules/user';
|
||||||
formDisabled: { type: Boolean, default: false },
|
|
||||||
formData: { type: Object, default: ()=>{} },
|
const leftSpan = ref(12)
|
||||||
formBpm: { type: Boolean, default: true }
|
const rightSpan = ref(12)
|
||||||
});
|
const userStore = useUserStore();
|
||||||
const formRef = ref();
|
const props = defineProps({
|
||||||
const useForm = Form.useForm;
|
formDisabled: { type: Boolean, default: false },
|
||||||
const emit = defineEmits(['register', 'ok', 'ok2']);
|
formData: { type: Object, default: () => { } },
|
||||||
const formData = reactive<Record<string, any>>({
|
formBpm: { type: Boolean, default: true }
|
||||||
id: '',
|
});
|
||||||
score: '',
|
const formRef = ref();
|
||||||
pyContent: '',
|
const useForm = Form.useForm;
|
||||||
pyFilePath: '',
|
const emit = defineEmits(['register', 'ok', 'ok2']);
|
||||||
});
|
const formData = reactive<Record<string, any>>({
|
||||||
const { createMessage } = useMessage();
|
id: '',
|
||||||
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
|
score: '',
|
||||||
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
|
pyContent: '',
|
||||||
const confirmLoading = ref<boolean>(false);
|
pyFilePath: '',
|
||||||
const showType = ref<string>('0');
|
});
|
||||||
const ylurl = ref<string>('');
|
const { createMessage } = useMessage();
|
||||||
|
const labelCol = ref<any>({ xs: { span: 24 }, sm: { span: 5 } });
|
||||||
|
const wrapperCol = ref<any>({ xs: { span: 24 }, sm: { span: 16 } });
|
||||||
|
const confirmLoading = ref<boolean>(false);
|
||||||
|
const showType = ref<string>('1');
|
||||||
|
const ylurl = ref<string>('');
|
||||||
const rotationAngle = ref(0);
|
const rotationAngle = ref(0);
|
||||||
const zyInfo = ref<any>({});
|
const zyInfo = ref<any>({});
|
||||||
const globSetting = useGlobSetting();
|
const globSetting = useGlobSetting();
|
||||||
const baseApiUrl = globSetting.domainUrl;
|
const baseApiUrl = globSetting.domainUrl;
|
||||||
|
|
||||||
const videoPlayer = ref(null);
|
const videoPlayer = ref(null);
|
||||||
const videoOpen = ref<boolean>(false);
|
const videoOpen = ref<boolean>(false);
|
||||||
const controls = ref(true);
|
const controls = ref(true);
|
||||||
const autoplay = ref(false)
|
const autoplay = ref(false)
|
||||||
const loop = ref(false);
|
const loop = ref(false);
|
||||||
const videoUrl = ref<String>('');
|
const videoUrl = ref<String>('');
|
||||||
|
const jssdkInfo = ref<any>({});
|
||||||
|
const record_ = ref(null)
|
||||||
|
|
||||||
|
function changeSpan() {
|
||||||
//表单验证
|
console.log('leftSpan', leftSpan.value)
|
||||||
const validatorRules = {
|
console.log('rightSpan', rightSpan.value)
|
||||||
score: [{ required: true, message: '请输入分数!' }],
|
if (leftSpan.value == 12) {
|
||||||
};
|
leftSpan.value = 18
|
||||||
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
|
rightSpan.value = 6
|
||||||
|
} else {
|
||||||
// 表单禁用
|
leftSpan.value = 12
|
||||||
const disabled = computed(()=>{
|
rightSpan.value = 12
|
||||||
if(props.formBpm === true){
|
|
||||||
if(props.formData.disabled === false){
|
|
||||||
return false;
|
|
||||||
}else{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return props.formDisabled;
|
|
||||||
});
|
|
||||||
|
|
||||||
function handleJyfz(record){
|
|
||||||
console.log(`🚀 ~ handleJyfz ~ record:`, record)
|
|
||||||
// if(zyInfo.score){
|
|
||||||
// if(parseInt(record) > parseInt(zyInfo.score)){
|
|
||||||
// createMessage.warning('评分不能超过预设作业分值!');
|
|
||||||
// formData.score = zyInfo.score;
|
|
||||||
// }
|
|
||||||
// }else{
|
|
||||||
// if(parseInt(record) > 100){
|
|
||||||
// createMessage.warning('评分不能超过100分!');
|
|
||||||
// formData.score = zyInfo.score;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
if(parseInt(record) > 100){
|
|
||||||
createMessage.warning('评分不能超过100分!');
|
|
||||||
formData.score = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
if(parseInt(record) < 0){
|
|
||||||
createMessage.warning('评分不能低于0分!');
|
|
||||||
formData.score = '';
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
console.log('leftSpan--》', leftSpan.value)
|
||||||
|
console.log('rightSpan--》', rightSpan.value)
|
||||||
|
edit(record_.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
//表单验证
|
||||||
|
const validatorRules = {
|
||||||
|
score: [{ required: true, message: '请输入分数!' }],
|
||||||
|
};
|
||||||
|
const { resetFields, validate, validateInfos } = useForm(formData, validatorRules, { immediate: true });
|
||||||
|
|
||||||
|
// 表单禁用
|
||||||
|
const disabled = computed(() => {
|
||||||
|
if (props.formBpm === true) {
|
||||||
|
if (props.formData.disabled === false) {
|
||||||
|
return false;
|
||||||
|
} else {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return props.formDisabled;
|
||||||
|
});
|
||||||
|
|
||||||
|
function handleJyfz(record) {
|
||||||
|
console.log(`🚀 ~ handleJyfz ~ record:`, record)
|
||||||
|
// if(zyInfo.score){
|
||||||
|
// if(parseInt(record) > parseInt(zyInfo.score)){
|
||||||
|
// createMessage.warning('评分不能超过预设作业分值!');
|
||||||
|
// formData.score = zyInfo.score;
|
||||||
|
// }
|
||||||
|
// }else{
|
||||||
|
// if(parseInt(record) > 100){
|
||||||
|
// createMessage.warning('评分不能超过100分!');
|
||||||
|
// formData.score = zyInfo.score;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
if (parseInt(record) > 100) {
|
||||||
|
createMessage.warning('评分不能超过100分!');
|
||||||
|
formData.score = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if (parseInt(record) < 0) {
|
||||||
|
createMessage.warning('评分不能低于0分!');
|
||||||
|
formData.score = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function rotateImage() {
|
function rotateImage() {
|
||||||
rotationAngle.value += 90; // 每次点击旋转90度
|
rotationAngle.value += 90; // 每次点击旋转90度
|
||||||
}
|
}
|
||||||
|
@ -171,56 +201,97 @@ function rotateImage() {
|
||||||
function rotateImage2() {
|
function rotateImage2() {
|
||||||
rotationAngle.value -= 90; // 每次点击旋转90度
|
rotationAngle.value -= 90; // 每次点击旋转90度
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 新增
|
* 新增
|
||||||
*/
|
*/
|
||||||
function add() {
|
function add() {
|
||||||
edit({});
|
edit({});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 编辑
|
* 编辑
|
||||||
*/
|
*/
|
||||||
function edit(record) {
|
function edit(record) {
|
||||||
formData.pyContent = ''
|
record_.value = record
|
||||||
nextTick(() => {
|
showType.value = '1';
|
||||||
resetFields();
|
formData.pyContent = ''
|
||||||
|
nextTick(() => {
|
||||||
|
resetFields();
|
||||||
|
|
||||||
defHttp.get({url:'/zyInfo/zyInfo/queryById',params:{id:record.mainId}}).then(res=>{
|
defHttp.get({ url: '/zyInfo/zyInfo/queryById', params: { id: record.mainId } }).then(res => {
|
||||||
console.log(`🚀 ~ defHttp.get ~ res:`, res)
|
console.log(`🚀 ~ defHttp.get ~ res:`, res)
|
||||||
zyInfo.value = res;
|
zyInfo.value = res;
|
||||||
})
|
})
|
||||||
const parts = record.filePath.split('.');
|
const parts = record.filePath.split('.');
|
||||||
const filetype = parts[parts.length - 1];
|
const filetype = parts[parts.length - 1];
|
||||||
console.log(`🚀 ~ nextTick ~ filetype:`, filetype)
|
console.log(`🚀 ~ nextTick ~ filetype:`, filetype)
|
||||||
|
// var file = getFileAccessHttpUrl(record.filePath);
|
||||||
|
// ylurl.value = file;
|
||||||
|
let wpsType = "w";
|
||||||
|
if (filetype == 'jpg' || filetype == 'png' || filetype == 'jpeg' || filetype == 'xls' || filetype == 'xlsx' || filetype == 'text') {
|
||||||
|
showType.value = '2';
|
||||||
var file = getFileAccessHttpUrl(record.filePath);
|
var file = getFileAccessHttpUrl(record.filePath);
|
||||||
ylurl.value = file;
|
ylurl.value = file;
|
||||||
if(filetype=='jpg' || filetype=='png' || filetype=='jpeg' || filetype=='xls' || filetype=='xlsx' || filetype=='text' ){
|
} else if (filetype == 'doc' || filetype == 'docx') {
|
||||||
showType.value = '2';
|
showType.value = '1';
|
||||||
}else if(filetype=='doc' || filetype=='docx' || filetype=='pdf'){
|
wpsType = "w";
|
||||||
showType.value = '1';
|
} else if (filetype == 'pdf') {
|
||||||
var file2 = getFileAccessHttpUrl(record.pdfPath);
|
showType.value = '1';
|
||||||
let url2 = baseApiUrl + '/generic/web/viewer.html?file=' + encodeURIComponent(file2);
|
wpsType = "f";
|
||||||
ylurl.value = url2;
|
} else if (filetype == 'ppt' || filetype == 'pptx') {
|
||||||
}else if(filetype=='mp4'|| filetype=='avi'|| filetype=='mp3'|| filetype=='wav'){
|
showType.value = '1';
|
||||||
showType.value = '3';
|
wpsType = "p";
|
||||||
|
} else if (filetype == 'xls' || filetype == 'xlsx') {
|
||||||
|
showType.value = '1';
|
||||||
|
wpsType = "s";
|
||||||
|
} else if (filetype == 'mp4' || filetype == 'avi' || filetype == 'mp3' || filetype == 'wav') {
|
||||||
|
showType.value = '3';
|
||||||
|
let url = getFileAccessHttpUrl(record.filePath);
|
||||||
|
console.log('视频预览-----》', url);
|
||||||
|
// videoOpen.value = true;
|
||||||
|
videoUrl.value = url;
|
||||||
|
} else {
|
||||||
|
showType.value = '0';
|
||||||
|
}
|
||||||
|
//赋值
|
||||||
|
Object.assign(formData, record);
|
||||||
|
|
||||||
let url = getFileAccessHttpUrl(record.filePath);
|
formData.id = '1863389832580046849';
|
||||||
console.log('视频预览-----》',url);
|
|
||||||
// videoOpen.value = true;
|
|
||||||
videoUrl.value = url;
|
|
||||||
|
|
||||||
|
console.log("🚀 ~ nextTick ~ formData.id:", formData.id)
|
||||||
}else{
|
if (showType.value == '1') {// 获取元素
|
||||||
showType.value = '0';
|
const element = document.getElementById('wpsiframeid');
|
||||||
}
|
// 清空内容
|
||||||
//赋值
|
element.innerHTML = '';
|
||||||
Object.assign(formData, record);
|
const jssdk = WebOfficeSDK.init({
|
||||||
});
|
officeType: wpsType,
|
||||||
}
|
appId: 'SX20241118WSUGQN',
|
||||||
|
fileId: formData.id,
|
||||||
|
mount: document.querySelector('.wps-iframe'),
|
||||||
|
commonOptions: {
|
||||||
|
isShowDocMap: false, //是否开启目录功能,默认开启
|
||||||
|
// isShowTopArea: false, // 隐藏顶部区域(头部和工具栏)
|
||||||
|
// isShowHeader: false, // 隐藏头部区域
|
||||||
|
isBrowserViewFullscreen: true, // 是否在浏览器区域全屏
|
||||||
|
isIframeViewFullscreen: true, // 是否在 iframe 区域内全屏
|
||||||
|
acceptVisualViewportResizeEvent: true // 控制 WebOffice 是否接受外部的 VisualViewport
|
||||||
|
},
|
||||||
|
wordOptions: {
|
||||||
|
isShowDocMap: false, // 是否开启目录功能,默认开启
|
||||||
|
isBestScale: true, // 打开文档时,默认以最佳比例显示
|
||||||
|
isShowBottomStatusBar: false, // 是否展示底部状态栏
|
||||||
|
},
|
||||||
|
token: userStore.getUserInfo.username
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
console.log("🚀 ~ nextTick ~ userStore.getUserInfo.id:", userStore.getUserInfo.id)
|
||||||
|
console.log("🚀 ~ nextTick ~ userStore.getUserInfo.id:", userStore.getUserInfo.id)
|
||||||
|
console.log("🚀 ~ nextTick ~ userStore.getUserInfo.id:", userStore.getUserInfo.id)
|
||||||
|
}
|
||||||
|
|
||||||
// --------------------------视频------------------------------
|
// --------------------------视频------------------------------
|
||||||
const playVideo = () => {
|
const playVideo = () => {
|
||||||
videoPlayer.value.play();
|
videoPlayer.value.play();
|
||||||
};
|
};
|
||||||
|
@ -237,33 +308,33 @@ const handleFullScreenChange = () => {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
function videoHandleCancel(){
|
function videoHandleCancel() {
|
||||||
pauseVideo();
|
pauseVideo();
|
||||||
videoOpen.value = false;
|
videoOpen.value = false;
|
||||||
}
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
document.addEventListener('fullscreenchange', handleFullScreenChange);
|
document.addEventListener('fullscreenchange', handleFullScreenChange);
|
||||||
});
|
});
|
||||||
|
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
document.removeEventListener('fullscreenchange', handleFullScreenChange);
|
document.removeEventListener('fullscreenchange', handleFullScreenChange);
|
||||||
});
|
});
|
||||||
|
|
||||||
//视频预览
|
//视频预览
|
||||||
function handleVideo(three){
|
function handleVideo(three) {
|
||||||
let url = getFileAccessHttpUrl(three.filePath);
|
let url = getFileAccessHttpUrl(three.filePath);
|
||||||
console.log('视频预览-----》',url);
|
console.log('视频预览-----》', url);
|
||||||
videoOpen.value = true;
|
videoOpen.value = true;
|
||||||
videoUrl.value = url;
|
videoUrl.value = url;
|
||||||
playVideoInFullscreen();
|
playVideoInFullscreen();
|
||||||
// setTimeout(() => {
|
// setTimeout(() => {
|
||||||
// playVideo();
|
// playVideo();
|
||||||
// }, 1000);
|
// }, 1000);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// --------------------------视频------------------------------
|
// --------------------------视频------------------------------
|
||||||
const playVideoInFullscreen = async () => {
|
const playVideoInFullscreen = async () => {
|
||||||
if (videoPlayer.value) {
|
if (videoPlayer.value) {
|
||||||
try {
|
try {
|
||||||
// 使用原生DOM方法请求全屏
|
// 使用原生DOM方法请求全屏
|
||||||
|
@ -274,130 +345,140 @@ function handleVideo(three){
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 提交数据
|
* 提交数据
|
||||||
*/
|
*/
|
||||||
async function submitForm() {
|
async function submitForm() {
|
||||||
// 触发表单验证
|
// 触发表单验证
|
||||||
await validate();
|
await validate();
|
||||||
confirmLoading.value = true;
|
confirmLoading.value = true;
|
||||||
const isUpdate = ref<boolean>(false);
|
const isUpdate = ref<boolean>(false);
|
||||||
//时间格式化
|
//时间格式化
|
||||||
let model = formData;
|
let model = formData;
|
||||||
if (model.id) {
|
if (model.id) {
|
||||||
isUpdate.value = true;
|
isUpdate.value = true;
|
||||||
}
|
}
|
||||||
//循环数据
|
//循环数据
|
||||||
for (let data in model) {
|
for (let data in model) {
|
||||||
//如果该数据是数组并且是字符串类型
|
//如果该数据是数组并且是字符串类型
|
||||||
if (model[data] instanceof Array) {
|
if (model[data] instanceof Array) {
|
||||||
let valueType = getValueType(formRef.value.getProps, data);
|
let valueType = getValueType(formRef.value.getProps, data);
|
||||||
//如果是字符串类型的需要变成以逗号分割的字符串
|
//如果是字符串类型的需要变成以逗号分割的字符串
|
||||||
if (valueType === 'string') {
|
if (valueType === 'string') {
|
||||||
model[data] = model[data].join(',');
|
model[data] = model[data].join(',');
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
defHttp.post({url:'/zyInfoStudent/zyInfoStudent/editPiyue',params:model}).then(res =>{
|
|
||||||
emit('ok');
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
confirmLoading.value = false;
|
|
||||||
});
|
|
||||||
// await saveOrUpdate(model, isUpdate.value)
|
|
||||||
// .then((res) => {
|
|
||||||
// if (res.success) {
|
|
||||||
// createMessage.success(res.message);
|
|
||||||
// emit('ok');
|
|
||||||
// } else {
|
|
||||||
// createMessage.warning(res.message);
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// .finally(() => {
|
|
||||||
// confirmLoading.value = false;
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
defHttp.post({ url: '/zyInfoStudent/zyInfoStudent/editPiyue', params: model }).then(res => {
|
||||||
* 提交数据并下一个
|
emit('ok');
|
||||||
*/
|
})
|
||||||
async function submitNextForm() {
|
.finally(() => {
|
||||||
// 触发表单验证
|
confirmLoading.value = false;
|
||||||
await validate();
|
});
|
||||||
confirmLoading.value = true;
|
// await saveOrUpdate(model, isUpdate.value)
|
||||||
const isUpdate = ref<boolean>(false);
|
// .then((res) => {
|
||||||
//时间格式化
|
// if (res.success) {
|
||||||
let model = formData;
|
// createMessage.success(res.message);
|
||||||
if (model.id) {
|
// emit('ok');
|
||||||
isUpdate.value = true;
|
// } else {
|
||||||
}
|
// createMessage.warning(res.message);
|
||||||
//循环数据
|
// }
|
||||||
for (let data in model) {
|
// })
|
||||||
//如果该数据是数组并且是字符串类型
|
// .finally(() => {
|
||||||
if (model[data] instanceof Array) {
|
// confirmLoading.value = false;
|
||||||
let valueType = getValueType(formRef.value.getProps, data);
|
// });
|
||||||
//如果是字符串类型的需要变成以逗号分割的字符串
|
}
|
||||||
if (valueType === 'string') {
|
|
||||||
model[data] = model[data].join(',');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
await defHttp.post({url:'/zyInfoStudent/zyInfoStudent/editPiyue',params:model}).then(res =>{
|
|
||||||
emit('ok2');
|
|
||||||
})
|
|
||||||
|
|
||||||
|
/**
|
||||||
await defHttp.get({url:'/zyInfoStudent/zyInfoStudent/getList2',params:{column:'createTime',order:'asc',pageNo:1,pageSize:10,ywid:zyInfo.value.id,rwbh:zyInfo.value.rwbh,queryType:5}}).then(res =>{
|
* 提交数据并下一个
|
||||||
console.log(`🚀 ~ awaitdefHttp.post ~ res:`, res)
|
*/
|
||||||
var list = res.records;
|
async function submitNextForm() {
|
||||||
if(list.length>0){
|
// 触发表单验证
|
||||||
edit(list[0])
|
await validate();
|
||||||
}else{
|
confirmLoading.value = true;
|
||||||
createMessage.warning('已批阅完毕,暂无下一条批阅数据!');
|
const isUpdate = ref<boolean>(false);
|
||||||
|
//时间格式化
|
||||||
|
let model = formData;
|
||||||
|
if (model.id) {
|
||||||
|
isUpdate.value = true;
|
||||||
|
}
|
||||||
|
//循环数据
|
||||||
|
for (let data in model) {
|
||||||
|
//如果该数据是数组并且是字符串类型
|
||||||
|
if (model[data] instanceof Array) {
|
||||||
|
let valueType = getValueType(formRef.value.getProps, data);
|
||||||
|
//如果是字符串类型的需要变成以逗号分割的字符串
|
||||||
|
if (valueType === 'string') {
|
||||||
|
model[data] = model[data].join(',');
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
.finally(() => {
|
|
||||||
confirmLoading.value = false;
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({
|
await defHttp.post({ url: '/zyInfoStudent/zyInfoStudent/editPiyue', params: model }).then(res => {
|
||||||
add,
|
emit('ok2');
|
||||||
edit,
|
})
|
||||||
submitForm,
|
|
||||||
});
|
|
||||||
|
await defHttp.get({ url: '/zyInfoStudent/zyInfoStudent/getList2', params: { column: 'createTime', order: 'asc', pageNo: 1, pageSize: 10, ywid: zyInfo.value.id, rwbh: zyInfo.value.rwbh, queryType: 5 } }).then(res => {
|
||||||
|
console.log(`🚀 ~ awaitdefHttp.post ~ res:`, res)
|
||||||
|
var list = res.records;
|
||||||
|
if (list.length > 0) {
|
||||||
|
edit(list[0])
|
||||||
|
} else {
|
||||||
|
createMessage.warning('已批阅完毕,暂无下一条批阅数据!');
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
confirmLoading.value = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
add,
|
||||||
|
edit,
|
||||||
|
submitForm,
|
||||||
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="less" scoped>
|
<style lang="less" scoped>
|
||||||
.antd-modal-form {
|
.antd-modal-form {
|
||||||
min-height: 150px !important;
|
min-height: 150px !important;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
padding: 24px 24px 24px 24px;
|
padding: 24px 24px 24px 24px;
|
||||||
}
|
}
|
||||||
.video-container {
|
|
||||||
|
.video-container {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
video {
|
video {
|
||||||
display: block;
|
display: block;
|
||||||
max-width: 100%; /* 确保视频宽度不超过其容器宽度 */
|
max-width: 100%;
|
||||||
|
/* 确保视频宽度不超过其容器宽度 */
|
||||||
}
|
}
|
||||||
|
|
||||||
.image-container {
|
.image-container {
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
width:100%; /* 设置容器宽度 */
|
width: 100%;
|
||||||
height: auto; /* 设置容器高度 */
|
/* 设置容器宽度 */
|
||||||
overflow: hidden; /* 隐藏溢出的部分 */
|
height: auto;
|
||||||
|
/* 设置容器高度 */
|
||||||
|
overflow: hidden;
|
||||||
|
/* 隐藏溢出的部分 */
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.rotated-image {
|
.rotated-image {
|
||||||
max-width: 100%; /* 最大宽度为容器宽度 */
|
max-width: 100%;
|
||||||
max-height: 100%; /* 最大高度为容器高度 */
|
/* 最大宽度为容器宽度 */
|
||||||
object-fit: contain; /* 保持图片内容不失真 */
|
max-height: 100%;
|
||||||
transform: rotate(90deg); /* 假设图片已经旋转90度 */
|
/* 最大高度为容器高度 */
|
||||||
|
object-fit: contain;
|
||||||
|
/* 保持图片内容不失真 */
|
||||||
|
transform: rotate(90deg);
|
||||||
|
/* 假设图片已经旋转90度 */
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Reference in New Issue