--fix 任务bug

This commit is contained in:
yuping
2023-03-28 19:46:58 +08:00
parent e2ccd9b2a5
commit 2d1ca81368
13 changed files with 346 additions and 294 deletions

View File

@@ -7,7 +7,7 @@
<div class="header"> <div class="header">
<div class="headerTitle">{{ taskIndex >= 0 ? "编辑" : "添加" }}活动</div> <div class="headerTitle">{{ taskIndex >= 0 ? "编辑" : "添加" }}活动</div>
<img style="width: 29px; height: 29px; cursor: pointer" src="../../assets/images/basicinfo/close.png" <img style="width: 29px; height: 29px; cursor: pointer" src="../../assets/images/basicinfo/close.png"
@click="closeDrawer" /> @click="closeDrawer" />
</div> </div>
<div class="contentMain"> <div class="contentMain">
<div class="main_left"> <div class="main_left">
@@ -20,7 +20,7 @@
</div> </div>
<div class="btnbox"> <div class="btnbox">
<a-input v-model:value="formData.activityName" style="width: 400px; height: 40px; border-radius: 8px" <a-input v-model:value="formData.activityName" style="width: 400px; height: 40px; border-radius: 8px"
placeholder="请输入活动名称" maxlength="20" /> placeholder="请输入活动名称" maxlength="20" />
</div> </div>
</div> </div>
@@ -33,8 +33,8 @@
</div> </div>
<div class="btnbox"> <div class="btnbox">
<a-range-picker :disabled-date="disabledDate" :show-time="{ format: 'HH:mm' }" format="YYYY-MM-DD HH:mm" <a-range-picker :disabled-date="disabledDate" :show-time="{ format: 'HH:mm' }" format="YYYY-MM-DD HH:mm"
style="width: 400px; height: 40px; border-radius: 8px" v-model:value="dateTime" @change="timeChange" style="width: 400px; height: 40px; border-radius: 8px" v-model:value="dateTime" @change="timeChange"
:placeholder="[' 开始时间', ' 结束时间']" /> :placeholder="[' 开始时间', ' 结束时间']" />
</div> </div>
</div> </div>
<!-- <div class="main_item"> <!-- <div class="main_item">
@@ -59,7 +59,7 @@
</div> </div>
<div class="btnbox"> <div class="btnbox">
<a-input v-model:value="formData.activityAddress" style="width: 400px; height: 40px; border-radius: 8px" <a-input v-model:value="formData.activityAddress" style="width: 400px; height: 40px; border-radius: 8px"
placeholder="请输入活动地点" maxlength="100" /> placeholder="请输入活动地点" maxlength="100" />
</div> </div>
</div> </div>
<div class="main_item2"> <div class="main_item2">
@@ -71,7 +71,7 @@
</div> </div>
<div class="textarea"> <div class="textarea">
<a-textarea v-model:value="formData.activityNotice" placeholder="请输入活动公告" allow-clear :rows="6" show-count <a-textarea v-model:value="formData.activityNotice" placeholder="请输入活动公告" allow-clear :rows="6" show-count
:maxlength="200" /> :maxlength="200" />
</div> </div>
</div> </div>
<div class="main_item2"> <div class="main_item2">
@@ -80,7 +80,7 @@
</div> </div>
<div class="textarea"> <div class="textarea">
<a-textarea v-model:value="formData.activityExplain" placeholder="请输入活动说明" allow-clear :rows="6" show-count <a-textarea v-model:value="formData.activityExplain" placeholder="请输入活动说明" allow-clear :rows="6" show-count
:maxlength="200" /> :maxlength="200" />
</div> </div>
</div> </div>
<div class="main_item2"> <div class="main_item2">
@@ -136,13 +136,14 @@
import { defineEmits, defineProps, ref } from "vue"; import { defineEmits, defineProps, ref } from "vue";
import { Form, message } from "ant-design-vue"; import { Form, message } from "ant-design-vue";
import dayjs from "dayjs"; import dayjs from "dayjs";
import {useResetRef} from "@/utils/useCommon";
const props = defineProps({ const props = defineProps({
type: Number, type: Number,
taskList: [] taskList: []
}) })
const visible = ref(false) const visible = ref(false)
const formData = ref({ const formData = useResetRef({
activityName: '', activityName: '',
activityNotice: '', activityNotice: '',
activityStartTime: '', activityStartTime: '',
@@ -195,22 +196,14 @@ const rulesRef = ref({
], ],
}); });
const { resetFields, validate } = Form.useForm(formData, rulesRef); const { validate } = Form.useForm(formData, rulesRef);
const closeDrawer = () => { const closeDrawer = () => {
visible.value = false visible.value = false
taskIndex.value = -1 taskIndex.value = -1
dateTime.value = [] dateTime.value = []
resetFields() formData.reset()
}; };
/**
const range = (start, end) => {
const result = [];
for (let i = start; i < end; i++) {
result.push(i);
}
return result;
};*/
function timeChange(time, timeStr) { function timeChange(time, timeStr) {
formData.value.activityStartTime = timeStr[0] formData.value.activityStartTime = timeStr[0]
@@ -220,14 +213,7 @@ function timeChange(time, timeStr) {
const disabledDate = (current) => { const disabledDate = (current) => {
return current && current < dayjs().startOf('day'); return current && current < dayjs().startOf('day');
}; };
/**
const disabledRangeTime = () => ({
// disabledHours: () => range(0, 24).splice(4, 20),
disabledMinutes: () => range(30, 60),
disabledSeconds: () => [55, 56],
});
*/
async function confirm() { async function confirm() {
// debugger // debugger
await validate().catch(({ errorFields }) => { await validate().catch(({ errorFields }) => {
@@ -261,6 +247,11 @@ defineExpose({ openDrawer })
background-color: #fafafa !important; background-color: #fafafa !important;
} }
.addactiveDrawer > .ant-drawer-content-wrapper {
min-width: 800px !important;
width: 800px !important;
}
.addactiveDrawer { .addactiveDrawer {
.drawerMain { .drawerMain {
.header { .header {

View File

@@ -71,16 +71,16 @@
<div> <div>
<div> <div>
<span class="title" <span class="title"
>已选择 >已选择
<span class="data" style="color: #4ea6ff">{{ 1 }}</span> <span class="data" style="color: #4ea6ff">{{ 1 }}</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span
> >
<span class="title" <span class="title"
>案例标题 >案例标题
<span <span
class="data" class="data"
style="color: #4ea6ff; margin-right: 15px" style="color: #4ea6ff; margin-right: 15px"
>{{ >{{
selectedRows?.name selectedRows?.name
? selectedRows?.name ? selectedRows?.name
: selectedRows?.title : selectedRows?.title
@@ -120,6 +120,7 @@ import { computed, defineEmits, defineProps, ref, watch } from "vue";
import { useBoeApiPage } from "@/api/request"; import { useBoeApiPage } from "@/api/request";
import { CASE_PAGE } from "@/api/ThirdApi"; import { CASE_PAGE } from "@/api/ThirdApi";
import { message } from "ant-design-vue"; import { message } from "ant-design-vue";
import {useResetRef} from "@/utils/useCommon";
const props = defineProps({ const props = defineProps({
type: Number, type: Number,
@@ -144,14 +145,13 @@ const columns = ref([
align: "center", align: "center",
}, },
]); ]);
const initParams = { const params = useResetRef({
keyWord: "", keyWord: "",
authorName: "", authorName: "",
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
orderAsc: true, orderAsc: true,
}; });
const params = ref(initParams);
const rowSelectKeys = ref([]); const rowSelectKeys = ref([]);
const selectsData = ref([]); const selectsData = ref([]);
@@ -221,9 +221,7 @@ function search() {
function reset() { function reset() {
rowSelectKeys.value = []; rowSelectKeys.value = [];
selectsData.value = []; selectsData.value = [];
params.value.pageIndex = 1; params.reset()
params.value.keyWord = "";
params.value.authorName = "";
fetch(); fetch();
} }
@@ -258,7 +256,6 @@ function confirm() {
} }
let selectedRows = ref(null); let selectedRows = ref(null);
function openDrawer(i, row) { function openDrawer(i, row) {
console.log("iiiiiiiii", i, row);
row && (rowSelectKeys.value = [row.info]); row && (rowSelectKeys.value = [row.info]);
row && (selectsData.value = [{ title: row.name, id: row.courseId }]); row && (selectsData.value = [{ title: row.name, id: row.courseId }]);
i >= 0 && (taskIndex.value = i); i >= 0 && (taskIndex.value = i);
@@ -272,7 +269,10 @@ defineExpose({ openDrawer });
.ant-table-striped :deep(.table-striped) td { .ant-table-striped :deep(.table-striped) td {
background-color: #fafafa !important; background-color: #fafafa !important;
} }
.addcaseDrawer > .ant-drawer-content-wrapper {
min-width: 1300px !important;
width: 1300px !important;
}
.addcaseDrawer { .addcaseDrawer {
.drawerMain { .drawerMain {
.header { .header {
@@ -427,8 +427,8 @@ defineExpose({ openDrawer });
} }
.ant-table-tbody .ant-table-tbody
> tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) > tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected)
> td { > td {
background: #f6f9fd; background: #f6f9fd;
} }

View File

@@ -3,18 +3,18 @@
<slot></slot> <slot></slot>
</div> </div>
<a-drawer <a-drawer
:visible="visible" :visible="visible"
class="drawerStyle addrefDrawer" class="drawerStyle addrefDrawer"
width="800" width="800"
placement="right" placement="right"
> >
<div class="drawerMain"> <div class="drawerMain">
<div class="header"> <div class="header">
<div class="headerTitle">{{ taskIndex >= 0 ? "编辑" : "添加" }}讨论</div> <div class="headerTitle">{{ taskIndex >= 0 ? "编辑" : "添加" }}讨论</div>
<img <img
style="width: 29px; height: 29px; cursor: pointer" style="width: 29px; height: 29px; cursor: pointer"
src="../../assets/images/basicinfo/close.png" src="../../assets/images/basicinfo/close.png"
@click="closeDrawer" @click="closeDrawer"
/> />
</div> </div>
<div class="contentMain"> <div class="contentMain">
@@ -23,19 +23,19 @@
<div class="signbox"> <div class="signbox">
<div class="sign"> <div class="sign">
<img <img
src="@/assets/images/coursewareManage/asterisk.png" src="@/assets/images/coursewareManage/asterisk.png"
alt="" alt=""
/> />
</div> </div>
<span style="margin-right: 3px">讨论名称</span> <span style="margin-right: 3px">讨论名称</span>
</div> </div>
<div class="btnbox"> <div class="btnbox">
<a-input <a-input
v-model:value="formData.discussName" v-model:value="formData.discussName"
style="width: 424px; height: 32px" style="width: 424px; height: 32px"
placeholder="请输入讨论名称" placeholder="请输入讨论名称"
show-count show-count
:maxlength="20" :maxlength="20"
/> />
</div> </div>
</div> </div>
@@ -43,20 +43,20 @@
<div class="signbox"> <div class="signbox">
<div class="sign"> <div class="sign">
<img <img
src="@/assets/images/coursewareManage/asterisk.png" src="@/assets/images/coursewareManage/asterisk.png"
alt="" alt=""
/> />
</div> </div>
<span style="margin-right: 3px">讨论说明</span> <span style="margin-right: 3px">讨论说明</span>
</div> </div>
<div class="textarea"> <div class="textarea">
<a-textarea <a-textarea
v-model:value="formData.discussExplain" v-model:value="formData.discussExplain"
placeholder="请输入讨论说明" placeholder="请输入讨论说明"
allow-clear allow-clear
:rows="6" :rows="6"
show-count show-count
:maxlength="200" :maxlength="200"
/> />
</div> </div>
</div> </div>
@@ -65,7 +65,7 @@
<span style="margin-right: 3px">讨论设置</span> <span style="margin-right: 3px">讨论设置</span>
</div> </div>
<div class="btnbox"> <div class="btnbox">
<a-checkbox v-model:checked="formData.discussSettings">允许评论</a-checkbox> <a-checkbox v-model:checked="formData.discussSettings" @click="discussSettings">允许评论</a-checkbox>
</div> </div>
</div> </div>
</div> </div>
@@ -80,13 +80,14 @@
<script setup> <script setup>
import {defineEmits, defineProps, ref} from "vue"; import {defineEmits, defineProps, ref} from "vue";
import {Form, message} from "ant-design-vue"; import {Form, message} from "ant-design-vue";
import {useResetRef} from "@/utils/useCommon";
const props = defineProps({ const props = defineProps({
type: Number, type: Number,
taskList: [] taskList: []
}) })
const visible = ref(false) const visible = ref(false)
const formData = ref({discussName: '', discussExplain: '', discussSettings: ''}) const formData = useResetRef({discussName: '', discussExplain: '', discussSettings: true})
const emit = defineEmits({}) const emit = defineEmits({})
const taskIndex = ref(-1); const taskIndex = ref(-1);
const dateTime = ref([]); const dateTime = ref([]);
@@ -105,13 +106,13 @@ const rulesRef = ref({
], ],
}); });
const {resetFields, validate} = Form.useForm(formData, rulesRef); const {validate} = Form.useForm(formData, rulesRef);
const closeDrawer = () => { const closeDrawer = () => {
visible.value = false visible.value = false
taskIndex.value = -1 taskIndex.value = -1
dateTime.value = [] dateTime.value = []
resetFields() formData.reset()
}; };
async function confirm() { async function confirm() {
@@ -132,11 +133,17 @@ async function confirm() {
} }
function openDrawer(i, row) { function openDrawer(i, row) {
console.log(i,row)
row && (formData.value = {...row.info}); row && (formData.value = {...row.info});
(i >= 0) && (taskIndex.value = i); (i >= 0) && (taskIndex.value = i);
row && (formData.value.discussSettings = row.info.discussSettings === "false" || row.info.discussSettings === false ? false : true);
visible.value = true visible.value = true
} }
const discussSettings = () => {
formData.value.discussSettings = !formData.value.discussSettings;
}
defineExpose({openDrawer}) defineExpose({openDrawer})
</script> </script>
<style lang="scss"> <style lang="scss">

View File

@@ -62,8 +62,8 @@
<div v-if="formData.evaluationTypeName" style="margin-left: 20px"> <div v-if="formData.evaluationTypeName" style="margin-left: 20px">
<a-tag closable @close="delTag" color="processing"> <a-tag closable @close="delTag" color="processing">
<span style="font-size: 14px; line-height: 33px">{{ <span style="font-size: 14px; line-height: 33px">{{
formData.evaluationTypeName formData.evaluationTypeName
}}</span> }}</span>
</a-tag> </a-tag>
</div> </div>
</div> </div>
@@ -112,17 +112,18 @@
</a-drawer> </a-drawer>
</template> </template>
<script setup> <script setup>
import { defineEmits, defineProps, ref } from "vue"; import {defineEmits, defineProps, ref} from "vue";
import EvList from "./EvList.vue"; import EvList from "./EvList.vue";
import { Form, message } from "ant-design-vue"; import {Form, message} from "ant-design-vue";
import dayjs from "dayjs"; import dayjs from "dayjs";
import {useResetRef} from "@/utils/useCommon";
const props = defineProps({ const props = defineProps({
type: Number, type: Number,
taskList: [], taskList: [],
}); });
const visible = ref(false); const visible = ref(false);
const formData = ref({ const formData = useResetRef({
evaluationName: "", evaluationName: "",
evaluationTypeId: "", evaluationTypeId: "",
evaluationTypeName: "", evaluationTypeName: "",
@@ -154,13 +155,13 @@ const rulesRef = ref({
], ],
}); });
const { resetFields, validate } = Form.useForm(formData, rulesRef); const { validate } = Form.useForm(formData, rulesRef);
const closeDrawer = () => { const closeDrawer = () => {
visible.value = false; visible.value = false;
taskIndex.value = -1; taskIndex.value = -1;
dateTime.value = []; dateTime.value = [];
resetFields(); formData.reset();
}; };
const range = (start, end) => { const range = (start, end) => {
@@ -210,7 +211,7 @@ async function confirm() {
} else { } else {
const data = props.taskList[taskIndex.value]; const data = props.taskList[taskIndex.value];
data.name = formData.value.evaluationName; data.name = formData.value.evaluationName;
data.info = {...formData.value}; data.info = { ...formData.value };
data.duration = dayjs(formData.value.evaluationEndTime).diff( data.duration = dayjs(formData.value.evaluationEndTime).diff(
formData.value.evaluationStartTime, formData.value.evaluationStartTime,
"minutes" "minutes"
@@ -223,10 +224,10 @@ async function confirm() {
function openDrawer(i, row) { function openDrawer(i, row) {
row && (formData.value = { ...row.info }); row && (formData.value = { ...row.info });
row && row &&
(dateTime.value = [ (dateTime.value = [
dayjs(row.info.evaluationStartTime, "YYYY-MM-DD HH:mm"), dayjs(row.info.evaluationStartTime, "YYYY-MM-DD HH:mm"),
dayjs(row.info.evaluationEndTime, "YYYY-MM-DD HH:mm"), dayjs(row.info.evaluationEndTime, "YYYY-MM-DD HH:mm"),
]); ]);
i >= 0 && (taskIndex.value = i); i >= 0 && (taskIndex.value = i);
visible.value = true; visible.value = true;
} }
@@ -238,6 +239,11 @@ defineExpose({ openDrawer });
background-color: #fafafa !important; background-color: #fafafa !important;
} }
.addevalDrawer > .ant-drawer-content-wrapper {
min-width: 800px !important;
width: 800px !important;
}
.addevalDrawer { .addevalDrawer {
.drawerMain { .drawerMain {
.header { .header {
@@ -443,8 +449,8 @@ defineExpose({ openDrawer });
} }
.ant-table-tbody .ant-table-tbody
> tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) > tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected)
> td { > td {
background: #f6f9fd; background: #f6f9fd;
} }

View File

@@ -15,8 +15,8 @@
<div class="signbox"> <div class="signbox">
<div class="sign"> <div class="sign">
<img <img
src="@/assets/images/coursewareManage/asterisk.png" src="@/assets/images/coursewareManage/asterisk.png"
alt="" alt=""
/> />
</div> </div>
<span style="margin-right: 3px">作业名称</span> <span style="margin-right: 3px">作业名称</span>
@@ -33,22 +33,22 @@
<div class="signbox"> <div class="signbox">
<div class="sign"> <div class="sign">
<img <img
src="@/assets/images/coursewareManage/asterisk.png" src="@/assets/images/coursewareManage/asterisk.png"
alt="" alt=""
/> />
</div> </div>
<span style="margin-right: 3px">开始时间</span> <span style="margin-right: 3px">开始时间</span>
</div> </div>
<div class="btnbox"> <div class="btnbox">
<a-range-picker <a-range-picker
style="width: 400px; height: 40px; border-radius: 8px" style="width: 400px; height: 40px; border-radius: 8px"
:show-time="{ format: 'hh:mm' }" :show-time="{ format: 'hh:mm' }"
:disabled-date="disabledDate" :disabled-date="disabledDate"
v-model:value="dateTime" v-model:value="dateTime"
format="YYYY-MM-DD HH:mm" format="YYYY-MM-DD HH:mm"
@change="timeChange" @change="timeChange"
:placeholder="[' 开始时间', ' 结束时间']" :placeholder="[' 开始时间', ' 结束时间']"
/> />
</div> </div>
</div> </div>
@@ -56,8 +56,8 @@
<div class="signbox"> <div class="signbox">
<div class="sign"> <div class="sign">
<img <img
src="@/assets/images/coursewareManage/asterisk.png" src="@/assets/images/coursewareManage/asterisk.png"
alt="" alt=""
/> />
</div> </div>
<span style="margin-right: 3px">作业要求</span> <span style="margin-right: 3px">作业要求</span>
@@ -90,75 +90,104 @@
import {defineEmits, defineProps, ref} from "vue"; import {defineEmits, defineProps, ref} from "vue";
import dayjs from "dayjs"; import dayjs from "dayjs";
import FJUpload from "@/components/common/FJUpload"; import FJUpload from "@/components/common/FJUpload";
import {useResetRef} from "@/utils/useCommon";
import {Form, message} from "ant-design-vue";
const props = defineProps({ const props = defineProps({
type: Number, type: Number,
taskList: [] taskList: []
}) });
const visible = ref(false) const visible = ref(false);
const formData = ref({}) const formData = useResetRef({ workName: "", submitStartTime: "", submitEndTime: "", workRequirement: "" });
const emit = defineEmits({}) const emit = defineEmits({});
const taskIndex = ref(-1); const taskIndex = ref(-1);
const dateTime = ref([]); const dateTime = ref([]);
const rulesRef = ref({
workName: [
{
required: true,
message: "请输入作业名称",
},
],
submitStartTime: [
{
required: true,
message: "请选择开始时间",
},
],
submitEndTime: [
{
required: true,
message: "请选择结束时间",
},
],
workRequirement: [
{
required: true,
message: "请输入作业要求",
},
],
});
const { validate } = Form.useForm(formData, rulesRef);
const closeDrawer = () => { const closeDrawer = () => {
visible.value = false visible.value = false;
taskIndex.value = -1 taskIndex.value = -1;
formData.value = {} formData.reset();
dateTime.value = [] dateTime.value = [];
}; };
/**
const range = (start, end) => {
const result = [];
for (let i = start; i < end; i++) {
result.push(i);
}
return result;
};
*/
function timeChange(time, timeStr) { function timeChange(time, timeStr) {
formData.value.submitStartTime = timeStr[0] formData.value.submitStartTime = timeStr[0];
formData.value.submitEndTime = timeStr[1] formData.value.submitEndTime = timeStr[1];
} }
const disabledDate = (current) => { const disabledDate = (current) => {
return current && current < dayjs().startOf('day'); return current && current < dayjs().startOf("day");
}; };
/**
const disabledRangeTime = () => ({ async function confirm() {
disabledHours: () => range(0, 24).splice(4, 20), await validate().catch(({ errorFields }) => {
disabledMinutes: () => range(30, 60), message.warning(errorFields[0].errors.join());
disabledSeconds: () => [55, 56], throw Error("数据校验不通过");
}); });
*/
function confirm() {
if (taskIndex.value === -1) { if (taskIndex.value === -1) {
const list = props.taskList const list = props.taskList;
list.push({name: formData.value.workName,duration:dayjs(formData.value.submitEndTime).diff(formData.value.submitStartTime,'minutes'), type: props.type, info: {...formData.value}}) list.push({
name: formData.value.workName,
duration: dayjs(formData.value.submitEndTime).diff(formData.value.submitStartTime, "minutes"),
type: props.type,
info: { ...formData.value }
});
} else { } else {
const data = props.taskList[taskIndex.value] const data = props.taskList[taskIndex.value];
data.name = formData.value.workName data.name = formData.value.workName;
data.info = {...formData.value} data.info = { ...formData.value };
data.duration = dayjs(formData.value.submitEndTime).diff(formData.value.submitStartTime,'minutes') data.duration = dayjs(formData.value.submitEndTime).diff(formData.value.submitStartTime, "minutes");
} }
emit('update:taskList', [...props.taskList]) emit("update:taskList", [...props.taskList]);
closeDrawer() closeDrawer();
} }
function openDrawer(i, row) { function openDrawer(i, row) {
row && (formData.value = {...row.info}); row && (formData.value = { ...row.info });
row && (dateTime.value = [dayjs(row.info.submitStartTime, "YYYY-MM-DD HH:mm"), dayjs(row.info.submitEndTime, "YYYY-MM-DD HH:mm")]); row && (dateTime.value = [dayjs(row.info.submitStartTime, "YYYY-MM-DD HH:mm"), dayjs(row.info.submitEndTime, "YYYY-MM-DD HH:mm")]);
(i >= 0) && (taskIndex.value = i); (i >= 0) && (taskIndex.value = i);
visible.value = true visible.value = true;
} }
defineExpose({openDrawer}) defineExpose({ openDrawer });
</script> </script>
<style lang="scss"> <style lang="scss">
.ant-table-striped :deep(.table-striped) td { .ant-table-striped :deep(.table-striped) td {
background-color: #fafafa !important; background-color: #fafafa !important;
} }
.addhomeworkDrawer > .ant-drawer-content-wrapper {
min-width: 800px !important;
width: 800px !important;
}
.addhomeworkDrawer { .addhomeworkDrawer {
.drawerMain { .drawerMain {
.header { .header {

View File

@@ -28,13 +28,14 @@
import {defineEmits, defineProps, ref} from "vue"; import {defineEmits, defineProps, ref} from "vue";
import {Form, message} from "ant-design-vue"; import {Form, message} from "ant-design-vue";
import AssessmentAll from "@/components/drawers/AssessmentAll.vue"; import AssessmentAll from "@/components/drawers/AssessmentAll.vue";
import {useResetRef} from "@/utils/useCommon";
const props = defineProps({ const props = defineProps({
type: Number, type: Number,
taskList: [] taskList: []
}) })
const visible = ref(false) const visible = ref(false)
const formData = ref({ const formData = useResetRef({
assessmentId: '', assessmentId: '',
assessmentName: '', assessmentName: '',
}) })
@@ -55,12 +56,12 @@ const rulesRef = ref({
], ],
}); });
const {resetFields, validate} = Form.useForm(formData, rulesRef); const {validate} = Form.useForm(formData, rulesRef);
const closeDrawer = () => { const closeDrawer = () => {
visible.value = false visible.value = false
taskIndex.value = -1 taskIndex.value = -1
resetFields() formData.reset()
}; };
async function confirm() { async function confirm() {
@@ -98,7 +99,10 @@ defineExpose({openDrawer})
.ant-table-striped :deep(.table-striped) td { .ant-table-striped :deep(.table-striped) td {
background-color: #fafafa !important; background-color: #fafafa !important;
} }
.addinvistDrawer > .ant-drawer-content-wrapper {
min-width: 1300px !important;
width: 1300px !important;
}
.addinvistDrawer { .addinvistDrawer {
.drawerMain { .drawerMain {
.header { .header {

View File

@@ -10,7 +10,7 @@
{{ taskIndex >= 0 ? "编辑" : "添加" }}直播 {{ taskIndex >= 0 ? "编辑" : "添加" }}直播
</div> </div>
<img style="width: 29px; height: 29px; cursor: pointer" src="../../assets/images/basicinfo/close.png" <img style="width: 29px; height: 29px; cursor: pointer" src="../../assets/images/basicinfo/close.png"
@click="closeDrawer" /> @click="closeDrawer" />
</div> </div>
<div class="contentMain"> <div class="contentMain">
<div class="main_left"> <div class="main_left">
@@ -23,7 +23,7 @@
</div> </div>
<div class="btnbox"> <div class="btnbox">
<a-input v-model:value="formData.liveName" style="width: 400px; height: 40px; border-radius: 8px" <a-input v-model:value="formData.liveName" style="width: 400px; height: 40px; border-radius: 8px"
placeholder="请输入直播名称" :maxlength="20" /> placeholder="请输入直播名称" :maxlength="20" />
</div> </div>
</div> </div>
<div class="main_item" style="margin-top: -10px"> <div class="main_item" style="margin-top: -10px">
@@ -35,7 +35,7 @@
</div> </div>
<div class="btnbox"> <div class="btnbox">
<a-input v-model:value="formData.liveLink" style="width: 400px; height: 40px; border-radius: 8px" <a-input v-model:value="formData.liveLink" style="width: 400px; height: 40px; border-radius: 8px"
placeholder="请输入直播链接" :maxlength="100" /> placeholder="请输入直播链接" :maxlength="100" />
</div> </div>
</div> </div>
@@ -48,8 +48,8 @@
</div> </div>
<div class="btnbox"> <div class="btnbox">
<a-range-picker :show-time="{ format: 'HH:mm' }" :disabled-date="disabledDate" <a-range-picker :show-time="{ format: 'HH:mm' }" :disabled-date="disabledDate"
style="width: 400px; height: 40px; border-radius: 8px" v-model:value="dateTime" format="YYYY-MM-DD HH:mm" style="width: 400px; height: 40px; border-radius: 8px" v-model:value="dateTime" format="YYYY-MM-DD HH:mm"
valueFormat="YYYY-MM-DD HH:mm" @change="timeChange" :placeholder="[' 开始时间', ' 结束时间']" /> valueFormat="YYYY-MM-DD HH:mm" @change="timeChange" :placeholder="[' 开始时间', ' 结束时间']" />
</div> </div>
</div> </div>
<!-- <div class="main_item"> <!-- <div class="main_item">
@@ -86,7 +86,7 @@
</div> </div>
<div class="item_inp" style="background-color: #fff;"> <div class="item_inp" style="background-color: #fff;">
<a-upload name="avatar" list-type="picture-card" class="avatar-uploader" :show-upload-list="false" <a-upload name="avatar" list-type="picture-card" class="avatar-uploader" :show-upload-list="false"
:before-upload="beforeUpload"> :before-upload="beforeUpload">
<img class="i_upload_img" v-if="imageUrl" :src="imageUrl" alt="avatar" /> <img class="i_upload_img" v-if="imageUrl" :src="imageUrl" alt="avatar" />
<div class="i_upload" v-else> <div class="i_upload" v-else>
<div class="addimg"> <div class="addimg">
@@ -111,7 +111,7 @@
</div> </div>
<div class="textarea"> <div class="textarea">
<a-textarea v-model:value="formData.liveNotice" placeholder="请输入直播公告" allow-clear show-count <a-textarea v-model:value="formData.liveNotice" placeholder="请输入直播公告" allow-clear show-count
:maxlength="200" :rows="6" /> :maxlength="200" :rows="6" />
</div> </div>
</div> </div>
@@ -130,7 +130,7 @@
</div> </div>
<div class="btnbox"> <div class="btnbox">
<a-input v-model:value="formData.livePlaybackLink" style="width: 400px; height: 40px; border-radius: 8px" <a-input v-model:value="formData.livePlaybackLink" style="width: 400px; height: 40px; border-radius: 8px"
placeholder="请输入回放链接" :maxlength="100" /> placeholder="请输入回放链接" :maxlength="100" />
</div> </div>
</div> </div>
</div> </div>
@@ -141,7 +141,7 @@
</div> </div>
<div class="textarea"> <div class="textarea">
<a-textarea v-model:value="formData.liveExplain" placeholder="请输入直播说明" allow-clear show-count <a-textarea v-model:value="formData.liveExplain" placeholder="请输入直播说明" allow-clear show-count
:maxlength="200" :rows="6" /> :maxlength="200" :rows="6" />
</div> </div>
</div> </div>
@@ -198,8 +198,8 @@
<div v-if="formData.assessmentId"> <div v-if="formData.assessmentId">
<a-tag closable @close="removePG" color="processing"> <a-tag closable @close="removePG" color="processing">
<span style="font-size: 14px; line-height: 33px">{{ <span style="font-size: 14px; line-height: 33px">{{
formData.assessmentName formData.assessmentName
}}</span> }}</span>
</a-tag> </a-tag>
</div> </div>
</div> </div>
@@ -226,6 +226,7 @@ import ProjectManager from "@/components/project/ProjectManagerNew";
import AddInvistRoot from "@/components/drawers/AddInvistRoot.vue"; import AddInvistRoot from "@/components/drawers/AddInvistRoot.vue";
import { Form, message } from "ant-design-vue"; import { Form, message } from "ant-design-vue";
import { fileUp } from "../../api/indexEval"; import { fileUp } from "../../api/indexEval";
import {useResetRef} from "@/utils/useCommon";
const removePG = () => { const removePG = () => {
formData.value.assessmentId = ""; formData.value.assessmentId = "";
@@ -242,7 +243,7 @@ const props = defineProps({
taskList: [], taskList: [],
}); });
const visible = ref(false); const visible = ref(false);
const formData = ref({ const formData = useResetRef({
liveName: "", liveName: "",
liveLink: "", liveLink: "",
liveStartTime: "", liveStartTime: "",
@@ -325,38 +326,20 @@ const rulesRef = ref({
const { resetFields, validate } = Form.useForm(formData, rulesRef); const { resetFields, validate } = Form.useForm(formData, rulesRef);
const closeDrawer = () => { const closeDrawer = () => {
formData.value.liveCover = "";
formData.value.livePlaybackLink = "";
imageUrl.value = ""; imageUrl.value = "";
visible.value = false; visible.value = false;
taskIndex.value = -1; taskIndex.value = -1;
dateTime.value = []; dateTime.value = [];
formData.reset()
resetFields(); resetFields();
}; };
/**
const range = (start, end) => {
const result = [];
for (let i = start; i < end; i++) {
result.push(i);
}
return result;
};
*/
function timeChange(time, timeStr) { function timeChange(time, timeStr) {
formData.value.liveStartTime = timeStr[0]; formData.value.liveStartTime = timeStr[0];
formData.value.liveEndTime = timeStr[1]; formData.value.liveEndTime = timeStr[1];
} }
const disabledDate = (current) => { const disabledDate = (current) => {
return current && current < dayjs().startOf("day"); return current && current < dayjs().startOf("day");
}; };
/**
const disabledRangeTime = () => ({
// disabledHours: () => range(0, 24).splice(4, 20),
disabledMinutes: () => range(30, 60),
disabledSeconds: () => [55, 56],
});
*/
async function confirm() { async function confirm() {
// debugger; // debugger;
console.log("确定按钮:"); console.log("确定按钮:");
@@ -436,6 +419,11 @@ const beforeUpload = (file) => {
background-color: #fff !important; background-color: #fff !important;
} }
.addliveDrawer > .ant-drawer-content-wrapper {
min-width: 800px !important;
width: 800px !important;
}
.ant-table-striped :deep(.table-striped) td { .ant-table-striped :deep(.table-striped) td {
background-color: #fafafa !important; background-color: #fafafa !important;
} }

View File

@@ -164,7 +164,10 @@ function openDrawer(i, row) {
defineExpose({ openDrawer, selectCourse }); defineExpose({ openDrawer, selectCourse });
</script> </script>
<style lang="scss"> <style lang="scss">
.addonlineDrawer > .ant-drawer-content-wrapper {
min-width: 1300px !important;
width: 1300px !important;
}
.ant-table-striped :deep(.table-striped) td { .ant-table-striped :deep(.table-striped) td {
background-color: #fafafa !important; background-color: #fafafa !important;

View File

@@ -86,39 +86,39 @@
<div> <div>
<div> <div>
<span class="title" <span class="title"
>已选择 >已选择
<span class="data" style="color: #4ea6ff">{{ 1 }}</span> <span class="data" style="color: #4ea6ff">{{ 1 }}</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span
> >
<span class="title" <span class="title"
>名称 >名称
<span <span
class="data" class="data"
style="color: #4ea6ff; margin-right: 15px" style="color: #4ea6ff; margin-right: 15px"
>{{ selectedRows?.name }}</span >{{ selectedRows?.name }}</span
> >
</span> </span>
<span class="title" <span class="title"
>项目经理 >项目经理
<span <span
class="data" class="data"
style="color: #4ea6ff; margin-right: 15px" style="color: #4ea6ff; margin-right: 15px"
>{{ selectedRows?.manager }}</span >{{ selectedRows?.manager }}</span
> >
</span> </span>
<span class="title" <span class="title"
>创建人 >创建人
<span <span
class="data" class="data"
style="color: #4ea6ff; margin-right: 15px" style="color: #4ea6ff; margin-right: 15px"
>{{ selectedRows?.createName }}</span >{{ selectedRows?.createName }}</span
> >
</span> </span>
<span class="title" <span class="title"
>创建时间 >创建时间
<span class="data" style="color: #4ea6ff">{{ <span class="data" style="color: #4ea6ff">{{
selectedRows?.createTime selectedRows?.createTime
}}</span> }}</span>
</span> </span>
</div> </div>
</div> </div>
@@ -219,11 +219,11 @@ const columns = ref([
? (gaName + "/" + faName).slice(0, 16) + "..." ? (gaName + "/" + faName).slice(0, 16) + "..."
: gaName + "/" + faName : gaName + "/" + faName
: faName.length > 16 : faName.length > 16
? faName.slice(0, 16) + "..." ? faName.slice(0, 16) + "..."
: faName : faName
: name.length > 16 : name.length > 16
? name.slice(0, 16) + "..." ? name.slice(0, 16) + "..."
: name} : name}
</div> </div>
), ),
}, },
@@ -397,7 +397,10 @@ defineExpose({ openDrawer });
.ant-table-striped :deep(.table-striped) td { .ant-table-striped :deep(.table-striped) td {
background-color: #fafafa !important; background-color: #fafafa !important;
} }
.addonlineDrawer > .ant-drawer-content-wrapper {
min-width: 1300px !important;
width: 1300px !important;
}
.sameModal { .sameModal {
.ant-modal { .ant-modal {
width: 424px !important; width: 424px !important;
@@ -429,8 +432,8 @@ defineExpose({ openDrawer });
width: calc(100%); width: calc(100%);
height: 68px; height: 68px;
background: linear-gradient( background: linear-gradient(
rgba(78, 166, 255, 0.2) 0%, rgba(78, 166, 255, 0.2) 0%,
rgba(78, 166, 255, 0) 100% rgba(78, 166, 255, 0) 100%
); );
} }
@@ -672,8 +675,8 @@ defineExpose({ openDrawer });
} }
.ant-table-tbody .ant-table-tbody
> tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) > tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected)
> td { > td {
background: #f6f9fd; background: #f6f9fd;
} }
} }
@@ -726,8 +729,8 @@ defineExpose({ openDrawer });
} }
.ant-table-tbody .ant-table-tbody
> tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected) > tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected)
> td { > td {
background: #f6f9fd; background: #f6f9fd;
} }

View File

@@ -3,18 +3,18 @@
<slot></slot> <slot></slot>
</div> </div>
<a-drawer <a-drawer
:visible="visible" :visible="visible"
class="drawerStyle addrefDrawer" class="drawerStyle addrefDrawer"
width="1000" width="1000"
placement="right" placement="right"
> >
<div class="drawerMain"> <div class="drawerMain">
<div class="header"> <div class="header">
<div class="headerTitle">{{ taskIndex >= 0 ? "编辑" : "添加" }}外链</div> <div class="headerTitle">{{ taskIndex >= 0 ? "编辑" : "添加" }}外链</div>
<img <img
style="width: 29px; height: 29px; cursor: pointer" style="width: 29px; height: 29px; cursor: pointer"
src="../../assets/images/basicinfo/close.png" src="../../assets/images/basicinfo/close.png"
@click="closeDrawer" @click="closeDrawer"
/> />
</div> </div>
<div class="contentMain"> <div class="contentMain">
@@ -23,18 +23,18 @@
<div class="signbox"> <div class="signbox">
<div class="sign"> <div class="sign">
<img <img
src="@/assets/images/coursewareManage/asterisk.png" src="@/assets/images/coursewareManage/asterisk.png"
alt="" alt=""
/> />
</div> </div>
<span style="margin-right: 3px">外链名称</span> <span style="margin-right: 3px">外链名称</span>
</div> </div>
<div class="btnbox"> <div class="btnbox">
<a-input <a-input
v-model:value="formData.linkName" v-model:value="formData.linkName"
style="width: 400px; height: 40px; border-radius: 8px;" style="width: 400px; height: 40px; border-radius: 8px;"
placeholder="请输入外链名称" placeholder="请输入外链名称"
show-count :maxlength="20" show-count :maxlength="20"
/> />
</div> </div>
</div> </div>
@@ -42,19 +42,19 @@
<div class="signbox"> <div class="signbox">
<div class="sign"> <div class="sign">
<img <img
src="@/assets/images/coursewareManage/asterisk.png" src="@/assets/images/coursewareManage/asterisk.png"
alt="" alt=""
/> />
</div> </div>
<span style="margin-right: 3px">链接</span> <span style="margin-right: 3px">链接</span>
</div> </div>
<div class="btnbox"> <div class="btnbox">
<a-input <a-input
v-model:value="formData.linkAddress" v-model:value="formData.linkAddress"
style="width: 400px; height: 40px; border-radius: 8px;" style="width: 400px; height: 40px; border-radius: 8px;"
placeholder="请输入链接" placeholder="请输入链接"
show-count :maxlength="100" show-count :maxlength="100"
/> />
</div> </div>
</div> </div>
@@ -64,11 +64,11 @@
</div> </div>
<div class="textarea" style="width:400px;"> <div class="textarea" style="width:400px;">
<a-textarea <a-textarea
v-model:value="formData.linkDescription" v-model:value="formData.linkDescription"
placeholder="请输入外链说明" placeholder="请输入外链说明"
allow-clear allow-clear
:rows="6" :rows="6"
show-count :maxlength="200" show-count :maxlength="200"
/> />
</div> </div>
</div> </div>
@@ -83,72 +83,78 @@
</template> </template>
<script setup> <script setup>
import {defineEmits, defineProps, ref} from "vue"; import {defineEmits, defineProps, ref} from "vue";
import {Form, message} from 'ant-design-vue'; import {Form, message} from "ant-design-vue";
import {useResetRef} from "@/utils/useCommon";
const props = defineProps({ const props = defineProps({
type: Number, type: Number,
taskList: [] taskList: []
}) });
const visible = ref(false) const visible = ref(false);
const formData = ref({linkName: '', linkAddress: '', linkDescription: ''}) const formData = useResetRef({ linkName: "", linkAddress: "", linkDescription: "" });
const emit = defineEmits({}) const emit = defineEmits({});
const taskIndex = ref(-1); const taskIndex = ref(-1);
const dateTime = ref([]); const dateTime = ref([]);
const rulesRef = ref({ const rulesRef = ref({
linkName: [ linkName: [
{ {
required: true, required: true,
message: '请输入链接名称', message: "请输入链接名称",
}, },
], ],
linkAddress: [ linkAddress: [
{ {
type: 'url', type: "url",
required: true, required: true,
message: '请输入合法的链接地址', message: "请输入合法的链接地址",
}, },
], ],
}); });
const {resetFields, validate} = Form.useForm(formData, rulesRef); const { validate } = Form.useForm(formData, rulesRef);
const closeDrawer = () => { const closeDrawer = () => {
visible.value = false visible.value = false;
taskIndex.value = -1 taskIndex.value = -1;
dateTime.value = [] dateTime.value = [];
resetFields() formData.reset();
}; };
async function confirm() { async function confirm() {
await validate().catch(({errorFields}) => { await validate().catch(({ errorFields }) => {
message.warning(errorFields[0].errors.join()); message.warning(errorFields[0].errors.join());
throw Error("数据校验不通过") throw Error("数据校验不通过");
}); });
if (taskIndex.value === -1) { if (taskIndex.value === -1) {
const list = props.taskList const list = props.taskList;
list.push({name: formData.value.linkName, type: props.type, info: {...formData.value}}) list.push({ name: formData.value.linkName, type: props.type, info: { ...formData.value } });
} else { } else {
const data = props.taskList[taskIndex.value] const data = props.taskList[taskIndex.value];
data.name = formData.value.linkName data.name = formData.value.linkName;
data.info = {...formData.value} data.info = { ...formData.value };
} }
emit('update:taskList', [...props.taskList]) emit("update:taskList", [...props.taskList]);
closeDrawer() closeDrawer();
} }
function openDrawer(i, row) { function openDrawer(i, row) {
row && (formData.value = {...row.info}); row && (formData.value = { ...row.info });
(i >= 0) && (taskIndex.value = i); (i >= 0) && (taskIndex.value = i);
visible.value = true visible.value = true;
} }
defineExpose({openDrawer}) defineExpose({ openDrawer });
</script> </script>
<style lang="scss"> <style lang="scss">
.ant-table-striped :deep(.table-striped) td { .ant-table-striped :deep(.table-striped) td {
background-color: #fafafa !important; background-color: #fafafa !important;
} }
.addrefDrawer > .ant-drawer-content-wrapper {
min-width: 800px !important;
width: 800px !important;
}
.addrefDrawer { .addrefDrawer {
.drawerMain { .drawerMain {
.header { .header {
@@ -261,7 +267,7 @@ defineExpose({openDrawer})
background: #4ea6ff; background: #4ea6ff;
border-radius: 8px; border-radius: 8px;
border: 0; border: 0;
margin-right: 16px 8px 32px 0; margin-right: 16px;
color: #fff; color: #fff;
margin-top: 16px; margin-top: 16px;
margin-bottom: 60px; margin-bottom: 60px;
@@ -279,7 +285,7 @@ defineExpose({openDrawer})
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
box-shadow: 0px 1px 35px 0px rgba(118, 136, 166, 0.16); box-shadow: 0 1px 35px 0 rgba(118, 136, 166, 0.16);
.btn1 { .btn1 {
width: 100px; width: 100px;

View File

@@ -7,7 +7,7 @@
<div class="header"> <div class="header">
<div class="headerTitle">{{ taskIndex >= 0 ? "编辑" : "添加" }}考试</div> <div class="headerTitle">{{ taskIndex >= 0 ? "编辑" : "添加" }}考试</div>
<img style="width: 29px; height: 29px; cursor: pointer" src="../../assets/images/basicinfo/close.png" <img style="width: 29px; height: 29px; cursor: pointer" src="../../assets/images/basicinfo/close.png"
@click="closeDrawer" /> @click="closeDrawer" />
</div> </div>
<div style="display: flex; flex-direction: row; padding-top: 0px; margin-top: 20px; margin-left: 32px;"> <div style="display: flex; flex-direction: row; padding-top: 0px; margin-top: 20px; margin-left: 32px;">
<div v-if="taskIndex >= 0"> <div v-if="taskIndex >= 0">
@@ -26,7 +26,7 @@
系统考试 系统考试
</button> </button>
<button style="width: 100px; cursor: pointer;" @click="changeOuter(2)" <button style="width: 100px; cursor: pointer;" @click="changeOuter(2)"
:class="formData.examType === 2 ? 'outer' : 'notOuter'"> :class="formData.examType === 2 ? 'outer' : 'notOuter'">
外部考试 外部考试
</button> </button>
</div> </div>
@@ -43,7 +43,7 @@
</div> </div>
<div class="btnbox"> <div class="btnbox">
<a-input v-model:value="formData.examinationName" style="width: 400px; height: 40px; border-radius: 8px" <a-input v-model:value="formData.examinationName" style="width: 400px; height: 40px; border-radius: 8px"
placeholder="请输入考试名称" :maxlength="20" /> placeholder="请输入考试名称" :maxlength="20" />
</div> </div>
</div> </div>
@@ -84,8 +84,8 @@
</div> </div>
<div class="btnbox"> <div class="btnbox">
<a-range-picker style="width: 400px; height: 40px; border-radius: 8px" :show-time="{ format: 'hh:mm' }" <a-range-picker style="width: 400px; height: 40px; border-radius: 8px" :show-time="{ format: 'hh:mm' }"
:disabled-date="disabledDate" format="YYYY-MM-DD HH:mm" valueFormat="YYYY-MM-DD HH:mm" :disabled-date="disabledDate" format="YYYY-MM-DD HH:mm" valueFormat="YYYY-MM-DD HH:mm"
v-model:value="dateTime" @change="timeChange" :placeholder="[' 开始时间', ' 结束时间']" /> v-model:value="dateTime" @change="timeChange" :placeholder="[' 开始时间', ' 结束时间']" />
</div> </div>
</div> </div>
<div class="main_item"> <div class="main_item">
@@ -97,8 +97,8 @@
</div> </div>
<div class="select"> <div class="select">
<a-input-number :disabled="taskIndex >= 0 && isEdit" :min="0" :max="999999" :precision="0" <a-input-number :disabled="taskIndex >= 0 && isEdit" :min="0" :max="999999" :precision="0"
style="width: 400px; height: 40px; border-radius: 8px" style="width: 400px; height: 40px; border-radius: 8px"
v-model:value="formData.examinationDuration"></a-input-number> v-model:value="formData.examinationDuration"></a-input-number>
<span style="color: #999999; margin-left: 8px">分钟</span> <span style="color: #999999; margin-left: 8px">分钟</span>
</div> </div>
</div> </div>
@@ -111,7 +111,7 @@
</div> </div>
<div class="btnbox"> <div class="btnbox">
<a-input :disabled="taskIndex >= 0 && isEdit" v-model:value="formData.passLine" type="number" <a-input :disabled="taskIndex >= 0 && isEdit" v-model:value="formData.passLine" type="number"
style="width: 400px; height: 40px; border-radius: 8px" /> style="width: 400px; height: 40px; border-radius: 8px" />
<span style="color: #999999; margin-left: 8px"></span> <span style="color: #999999; margin-left: 8px"></span>
</div> </div>
@@ -122,7 +122,7 @@
</div> </div>
<div class="textarea"> <div class="textarea">
<a-textarea :disabled="taskIndex >= 0 && isEdit" v-model:value="formData.examinationExplain" placeholder="请输入考试说明" <a-textarea :disabled="taskIndex >= 0 && isEdit" v-model:value="formData.examinationExplain" placeholder="请输入考试说明"
allow-clear show-count :maxlength="200" :rows="6" /> allow-clear show-count :maxlength="200" :rows="6" />
</div> </div>
</div> </div>
<div class="main_item2"> <div class="main_item2">
@@ -185,7 +185,7 @@
</div> </div>
<div class="btnbox"> <div class="btnbox">
<a-radio-group :disabled="taskIndex >= 0 && isEdit" style="margin-right: 12px" <a-radio-group :disabled="taskIndex >= 0 && isEdit" style="margin-right: 12px"
v-model:value="formData.questionArrangement"> v-model:value="formData.questionArrangement">
<a-radio :value="1">试题乱序</a-radio> <a-radio :value="1">试题乱序</a-radio>
<a-radio :value="2">选项乱序</a-radio> <a-radio :value="2">选项乱序</a-radio>
<a-radio :value="3">全部乱序</a-radio> <a-radio :value="3">全部乱序</a-radio>
@@ -207,7 +207,7 @@
</div> </div>
<div class="btnbox"> <div class="btnbox">
<a-input v-model:value="formData.examinationName" style="width: 400px; height: 40px; border-radius: 8px" <a-input v-model:value="formData.examinationName" style="width: 400px; height: 40px; border-radius: 8px"
placeholder="请输入考试名称" :maxlength="20" /> placeholder="请输入考试名称" :maxlength="20" />
</div> </div>
</div> </div>
<div class="main_item"> <div class="main_item">
@@ -219,8 +219,8 @@
</div> </div>
<div class="btnbox"> <div class="btnbox">
<a-input v-model:value="formData.source" <a-input v-model:value="formData.source"
style="width: 400px; height: 40px; border-radius: 8px" style="width: 400px; height: 40px; border-radius: 8px"
placeholder="请输入数据来源" show-count :maxlength="420" /> placeholder="请输入数据来源" show-count :maxlength="420" />
</div> </div>
</div> </div>
<div class="main_item2"> <div class="main_item2">
@@ -229,7 +229,7 @@
</div> </div>
<div class="textarea"> <div class="textarea">
<a-textarea v-model:value="formData.examinationExplain" placeholder="请输入考试说明" allow-clear show-count <a-textarea v-model:value="formData.examinationExplain" placeholder="请输入考试说明" allow-clear show-count
:maxlength="200" :rows="6" /> :maxlength="200" :rows="6" />
</div> </div>
</div> </div>
</div> </div>
@@ -246,6 +246,7 @@ import { defineEmits, defineProps, ref, watch } from "vue";
import STest from "./SelectTest.vue"; import STest from "./SelectTest.vue";
import dayjs from "dayjs"; import dayjs from "dayjs";
import { Form, message } from "ant-design-vue"; import { Form, message } from "ant-design-vue";
import {useResetRef} from "@/utils/useCommon";
const props = defineProps({ const props = defineProps({
type: Number, type: Number,
@@ -269,7 +270,7 @@ const initValue = {
externalExplain: "", externalExplain: "",
examinationExplain: "" examinationExplain: ""
} }
const formData = ref(initValue) const formData = useResetRef(initValue)
const innerRule = { const innerRule = {
examinationName: [ examinationName: [
{ {
@@ -323,14 +324,12 @@ const outerRule = {
], ],
} }
const rulesRef = ref(innerRule); const rulesRef = ref(innerRule);
const emit = defineEmits({}) const emit = defineEmits({})
const taskIndex = ref(-1); const taskIndex = ref(-1);
const dateTime = ref([]); const dateTime = ref([]);
let isEdit = ref(true); let isEdit = ref(true);
const { resetFields, validate } = Form.useForm(formData, rulesRef); const { resetFields, validate } = Form.useForm(formData, rulesRef);
watch(() => formData.value.examType, () => { watch(() => formData.value.examType, () => {
formData.value.examType === 1 ? rulesRef.value = innerRule : rulesRef.value = outerRule formData.value.examType === 1 ? rulesRef.value = innerRule : rulesRef.value = outerRule
}) })
@@ -338,9 +337,7 @@ watch(() => formData.value.examType, () => {
const closeDrawer = () => { const closeDrawer = () => {
visible.value = false visible.value = false
taskIndex.value = -1 taskIndex.value = -1
formData.value.examinationLimit = '' formData.reset()
formData.value.examinationExplain = ''
resetFields()
dateTime.value = [] dateTime.value = []
}; };
@@ -399,6 +396,11 @@ defineExpose({ openDrawer })
background-color: #fafafa !important; background-color: #fafafa !important;
} }
.addtestDrawer > .ant-drawer-content-wrapper {
min-width: 800px !important;
width: 800px !important;
}
.outer { .outer {
background-color: #4ea6ff; background-color: #4ea6ff;
color: #fff; color: #fff;

View File

@@ -3,20 +3,20 @@
<slot></slot> <slot></slot>
</div> </div>
<a-drawer <a-drawer
:visible="visible" :visible="visible"
class="drawerStyle addvoteDrawer" class="drawerStyle addvoteDrawer"
width="800" width="800"
title="添加投票" title="添加投票"
placement="right" placement="right"
> >
<div class="drawerMain"> <div class="drawerMain">
<div class="header"> <div class="header">
<div v-if="taskIndex>=0" class="headerTitle">编辑投票任务</div> <div v-if="taskIndex>=0" class="headerTitle">编辑投票任务</div>
<div v-else class="headerTitle">添加投票</div> <div v-else class="headerTitle">添加投票</div>
<img <img
style="width: 29px; height: 29px; cursor: pointer" style="width: 29px; height: 29px; cursor: pointer"
src="../../assets/images/basicinfo/close.png" src="../../assets/images/basicinfo/close.png"
@click="closeDrawer" @click="closeDrawer"
/> />
</div> </div>
<div class="contentMain"> <div class="contentMain">
@@ -25,18 +25,18 @@
<div class="signbox"> <div class="signbox">
<div class="sign"> <div class="sign">
<img <img
src="@/assets/images/coursewareManage/asterisk.png" src="@/assets/images/coursewareManage/asterisk.png"
alt="" alt=""
/> />
</div> </div>
<span style="margin-right: 3px">任务名称</span> <span style="margin-right: 3px">任务名称</span>
</div> </div>
<div class="btnbox"> <div class="btnbox">
<a-input <a-input
v-model:value="formData.voteName" v-model:value="formData.voteName"
style="width: 424px; height: 40px; border-radius: 8px;" style="width: 424px; height: 40px; border-radius: 8px;"
placeholder="请输入投票任务名称" placeholder="请输入投票任务名称"
maxlength="20" maxlength="20"
/> />
</div> </div>
</div> </div>
@@ -44,21 +44,21 @@
<div class="signbox"> <div class="signbox">
<div class="sign"> <div class="sign">
<img <img
src="@/assets/images/coursewareManage/asterisk.png" src="@/assets/images/coursewareManage/asterisk.png"
alt="" alt=""
/> />
</div> </div>
<span style="margin-right: 3px">起止时间</span> <span style="margin-right: 3px">起止时间</span>
</div> </div>
<div class="select"> <div class="select">
<a-range-picker <a-range-picker
:show-time="{ format: 'HH:mm' }" :show-time="{ format: 'HH:mm' }"
:disabled-date="disabledDate" :disabled-date="disabledDate"
format="YYYY-MM-DD HH:mm" format="YYYY-MM-DD HH:mm"
style="width: 424px" style="width: 424px"
v-model:value="dateTime" v-model:value="dateTime"
@change="timeChange" @change="timeChange"
:placeholder="[' 开始时间', ' 结束时间']" :placeholder="[' 开始时间', ' 结束时间']"
/> />
</div> </div>
</div> </div>
@@ -66,8 +66,8 @@
<div class="signbox"> <div class="signbox">
<div class="sign"> <div class="sign">
<img <img
src="@/assets/images/coursewareManage/asterisk.png" src="@/assets/images/coursewareManage/asterisk.png"
alt="" alt=""
/> />
</div> </div>
<span>创建投票题干</span> <span>创建投票题干</span>
@@ -91,11 +91,11 @@
</div> </div>
<div class="textarea"> <div class="textarea">
<a-textarea <a-textarea
v-model:value="formData.voteExplain" v-model:value="formData.voteExplain"
placeholder="请输入投票说明" placeholder="请输入投票说明"
allow-clear allow-clear
:rows="6" :rows="6"
maxlength="150" maxlength="150"
/> />
</div> </div>
</div> </div>
@@ -113,13 +113,14 @@ import {defineEmits, defineProps, ref} from "vue";
import CreateVote from "./CreateVote.vue"; import CreateVote from "./CreateVote.vue";
import {Form, message} from "ant-design-vue"; import {Form, message} from "ant-design-vue";
import dayjs from "dayjs"; import dayjs from "dayjs";
import {useResetRef} from "@/utils/useCommon";
const props = defineProps({ const props = defineProps({
type: Number, type: Number,
taskList: [] taskList: []
}) })
const visible = ref(false) const visible = ref(false)
const formData = ref({ const formData = useResetRef({
voteName: '', voteName: '',
voteStartTime: '', voteStartTime: '',
voteEndTime: '', voteEndTime: '',
@@ -156,13 +157,13 @@ const rulesRef = ref({
], ],
}); });
const {resetFields, validate} = Form.useForm(formData, rulesRef); const {validate} = Form.useForm(formData, rulesRef);
const closeDrawer = () => { const closeDrawer = () => {
visible.value = false visible.value = false
taskIndex.value = -1 taskIndex.value = -1
dateTime.value = [] dateTime.value = []
resetFields() formData.reset()
}; };
function timeChange(time, timeStr) { function timeChange(time, timeStr) {
@@ -207,6 +208,10 @@ defineExpose({openDrawer})
</script> </script>
<style lang="scss"> <style lang="scss">
.addvoteDrawer > .ant-drawer-content-wrapper {
min-width: 800px !important;
width: 800px !important;
}
.ConfirmModal { .ConfirmModal {
.ant-modal { .ant-modal {
width: 424px !important; width: 424px !important;
@@ -234,8 +239,8 @@ defineExpose({openDrawer})
width: calc(100%); width: calc(100%);
height: 40px; height: 40px;
background: linear-gradient( background: linear-gradient(
rgba(78, 166, 255, 0.2) 0%, rgba(78, 166, 255, 0.2) 0%,
rgba(78, 166, 255, 0) 100% rgba(78, 166, 255, 0) 100%
); );
} }

View File

@@ -19,6 +19,14 @@ export function useInterval(fun, time) {
return { start }; return { start };
} }
export function useResetRef(initValue = {}) {
const valueRef = ref({ ...initValue });
const reset = v => valueRef.value = { ...initValue, ...v };
return Object.assign(valueRef, { reset });
}
export function useTimeout(asyncFun, time) { export function useTimeout(asyncFun, time) {
const timer = ref(); const timer = ref();
const maxCount = ref(0); const maxCount = ref(0);