mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-16 06:16:46 +08:00
--fix 任务bug
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<div class="header">
|
||||
<div class="headerTitle">{{ taskIndex >= 0 ? "编辑" : "添加" }}活动</div>
|
||||
<img style="width: 29px; height: 29px; cursor: pointer" src="../../assets/images/basicinfo/close.png"
|
||||
@click="closeDrawer" />
|
||||
@click="closeDrawer" />
|
||||
</div>
|
||||
<div class="contentMain">
|
||||
<div class="main_left">
|
||||
@@ -20,7 +20,7 @@
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-input v-model:value="formData.activityName" style="width: 400px; height: 40px; border-radius: 8px"
|
||||
placeholder="请输入活动名称" maxlength="20" />
|
||||
placeholder="请输入活动名称" maxlength="20" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -33,8 +33,8 @@
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<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"
|
||||
:placeholder="[' 开始时间', ' 结束时间']" />
|
||||
style="width: 400px; height: 40px; border-radius: 8px" v-model:value="dateTime" @change="timeChange"
|
||||
:placeholder="[' 开始时间', ' 结束时间']" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="main_item">
|
||||
@@ -59,7 +59,7 @@
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-input v-model:value="formData.activityAddress" style="width: 400px; height: 40px; border-radius: 8px"
|
||||
placeholder="请输入活动地点" maxlength="100" />
|
||||
placeholder="请输入活动地点" maxlength="100" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_item2">
|
||||
@@ -71,7 +71,7 @@
|
||||
</div>
|
||||
<div class="textarea">
|
||||
<a-textarea v-model:value="formData.activityNotice" placeholder="请输入活动公告" allow-clear :rows="6" show-count
|
||||
:maxlength="200" />
|
||||
:maxlength="200" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_item2">
|
||||
@@ -80,7 +80,7 @@
|
||||
</div>
|
||||
<div class="textarea">
|
||||
<a-textarea v-model:value="formData.activityExplain" placeholder="请输入活动说明" allow-clear :rows="6" show-count
|
||||
:maxlength="200" />
|
||||
:maxlength="200" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_item2">
|
||||
@@ -136,13 +136,14 @@
|
||||
import { defineEmits, defineProps, ref } from "vue";
|
||||
import { Form, message } from "ant-design-vue";
|
||||
import dayjs from "dayjs";
|
||||
import {useResetRef} from "@/utils/useCommon";
|
||||
|
||||
const props = defineProps({
|
||||
type: Number,
|
||||
taskList: []
|
||||
})
|
||||
const visible = ref(false)
|
||||
const formData = ref({
|
||||
const formData = useResetRef({
|
||||
activityName: '',
|
||||
activityNotice: '',
|
||||
activityStartTime: '',
|
||||
@@ -195,22 +196,14 @@ const rulesRef = ref({
|
||||
],
|
||||
});
|
||||
|
||||
const { resetFields, validate } = Form.useForm(formData, rulesRef);
|
||||
const { validate } = Form.useForm(formData, rulesRef);
|
||||
|
||||
const closeDrawer = () => {
|
||||
visible.value = false
|
||||
taskIndex.value = -1
|
||||
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) {
|
||||
formData.value.activityStartTime = timeStr[0]
|
||||
@@ -220,14 +213,7 @@ function timeChange(time, timeStr) {
|
||||
const disabledDate = (current) => {
|
||||
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() {
|
||||
// debugger
|
||||
await validate().catch(({ errorFields }) => {
|
||||
@@ -261,6 +247,11 @@ defineExpose({ openDrawer })
|
||||
background-color: #fafafa !important;
|
||||
}
|
||||
|
||||
.addactiveDrawer > .ant-drawer-content-wrapper {
|
||||
min-width: 800px !important;
|
||||
width: 800px !important;
|
||||
}
|
||||
|
||||
.addactiveDrawer {
|
||||
.drawerMain {
|
||||
.header {
|
||||
|
||||
@@ -71,16 +71,16 @@
|
||||
<div>
|
||||
<div>
|
||||
<span class="title"
|
||||
>已选择
|
||||
>已选择
|
||||
<span class="data" style="color: #4ea6ff">{{ 1 }}</span>
|
||||
条 </span
|
||||
>
|
||||
<span class="title"
|
||||
>案例标题:
|
||||
>案例标题:
|
||||
<span
|
||||
class="data"
|
||||
style="color: #4ea6ff; margin-right: 15px"
|
||||
>{{
|
||||
>{{
|
||||
selectedRows?.name
|
||||
? selectedRows?.name
|
||||
: selectedRows?.title
|
||||
@@ -120,6 +120,7 @@ import { computed, defineEmits, defineProps, ref, watch } from "vue";
|
||||
import { useBoeApiPage } from "@/api/request";
|
||||
import { CASE_PAGE } from "@/api/ThirdApi";
|
||||
import { message } from "ant-design-vue";
|
||||
import {useResetRef} from "@/utils/useCommon";
|
||||
|
||||
const props = defineProps({
|
||||
type: Number,
|
||||
@@ -144,14 +145,13 @@ const columns = ref([
|
||||
align: "center",
|
||||
},
|
||||
]);
|
||||
const initParams = {
|
||||
const params = useResetRef({
|
||||
keyWord: "",
|
||||
authorName: "",
|
||||
pageIndex: 1,
|
||||
pageSize: 10,
|
||||
orderAsc: true,
|
||||
};
|
||||
const params = ref(initParams);
|
||||
});
|
||||
|
||||
const rowSelectKeys = ref([]);
|
||||
const selectsData = ref([]);
|
||||
@@ -221,9 +221,7 @@ function search() {
|
||||
function reset() {
|
||||
rowSelectKeys.value = [];
|
||||
selectsData.value = [];
|
||||
params.value.pageIndex = 1;
|
||||
params.value.keyWord = "";
|
||||
params.value.authorName = "";
|
||||
params.reset()
|
||||
fetch();
|
||||
}
|
||||
|
||||
@@ -258,7 +256,6 @@ function confirm() {
|
||||
}
|
||||
let selectedRows = ref(null);
|
||||
function openDrawer(i, row) {
|
||||
console.log("iiiiiiiii", i, row);
|
||||
row && (rowSelectKeys.value = [row.info]);
|
||||
row && (selectsData.value = [{ title: row.name, id: row.courseId }]);
|
||||
i >= 0 && (taskIndex.value = i);
|
||||
@@ -272,7 +269,10 @@ defineExpose({ openDrawer });
|
||||
.ant-table-striped :deep(.table-striped) td {
|
||||
background-color: #fafafa !important;
|
||||
}
|
||||
|
||||
.addcaseDrawer > .ant-drawer-content-wrapper {
|
||||
min-width: 1300px !important;
|
||||
width: 1300px !important;
|
||||
}
|
||||
.addcaseDrawer {
|
||||
.drawerMain {
|
||||
.header {
|
||||
@@ -427,8 +427,8 @@ defineExpose({ openDrawer });
|
||||
}
|
||||
|
||||
.ant-table-tbody
|
||||
> tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected)
|
||||
> td {
|
||||
> tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected)
|
||||
> td {
|
||||
background: #f6f9fd;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,18 +3,18 @@
|
||||
<slot></slot>
|
||||
</div>
|
||||
<a-drawer
|
||||
:visible="visible"
|
||||
class="drawerStyle addrefDrawer"
|
||||
width="800"
|
||||
placement="right"
|
||||
:visible="visible"
|
||||
class="drawerStyle addrefDrawer"
|
||||
width="800"
|
||||
placement="right"
|
||||
>
|
||||
<div class="drawerMain">
|
||||
<div class="header">
|
||||
<div class="headerTitle">{{ taskIndex >= 0 ? "编辑" : "添加" }}讨论</div>
|
||||
<img
|
||||
style="width: 29px; height: 29px; cursor: pointer"
|
||||
src="../../assets/images/basicinfo/close.png"
|
||||
@click="closeDrawer"
|
||||
style="width: 29px; height: 29px; cursor: pointer"
|
||||
src="../../assets/images/basicinfo/close.png"
|
||||
@click="closeDrawer"
|
||||
/>
|
||||
</div>
|
||||
<div class="contentMain">
|
||||
@@ -23,19 +23,19 @@
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<img
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<span style="margin-right: 3px">讨论名称:</span>
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-input
|
||||
v-model:value="formData.discussName"
|
||||
style="width: 424px; height: 32px"
|
||||
placeholder="请输入讨论名称"
|
||||
show-count
|
||||
:maxlength="20"
|
||||
v-model:value="formData.discussName"
|
||||
style="width: 424px; height: 32px"
|
||||
placeholder="请输入讨论名称"
|
||||
show-count
|
||||
:maxlength="20"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -43,20 +43,20 @@
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<img
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<span style="margin-right: 3px">讨论说明:</span>
|
||||
</div>
|
||||
<div class="textarea">
|
||||
<a-textarea
|
||||
v-model:value="formData.discussExplain"
|
||||
placeholder="请输入讨论说明"
|
||||
allow-clear
|
||||
:rows="6"
|
||||
show-count
|
||||
:maxlength="200"
|
||||
v-model:value="formData.discussExplain"
|
||||
placeholder="请输入讨论说明"
|
||||
allow-clear
|
||||
:rows="6"
|
||||
show-count
|
||||
:maxlength="200"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -65,7 +65,7 @@
|
||||
<span style="margin-right: 3px">讨论设置:</span>
|
||||
</div>
|
||||
<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>
|
||||
@@ -80,13 +80,14 @@
|
||||
<script setup>
|
||||
import {defineEmits, defineProps, ref} from "vue";
|
||||
import {Form, message} from "ant-design-vue";
|
||||
import {useResetRef} from "@/utils/useCommon";
|
||||
|
||||
const props = defineProps({
|
||||
type: Number,
|
||||
taskList: []
|
||||
})
|
||||
const visible = ref(false)
|
||||
const formData = ref({discussName: '', discussExplain: '', discussSettings: ''})
|
||||
const formData = useResetRef({discussName: '', discussExplain: '', discussSettings: true})
|
||||
const emit = defineEmits({})
|
||||
const taskIndex = ref(-1);
|
||||
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 = () => {
|
||||
visible.value = false
|
||||
taskIndex.value = -1
|
||||
dateTime.value = []
|
||||
resetFields()
|
||||
formData.reset()
|
||||
};
|
||||
|
||||
async function confirm() {
|
||||
@@ -132,11 +133,17 @@ async function confirm() {
|
||||
}
|
||||
|
||||
function openDrawer(i, row) {
|
||||
console.log(i,row)
|
||||
row && (formData.value = {...row.info});
|
||||
(i >= 0) && (taskIndex.value = i);
|
||||
row && (formData.value.discussSettings = row.info.discussSettings === "false" || row.info.discussSettings === false ? false : true);
|
||||
visible.value = true
|
||||
}
|
||||
|
||||
const discussSettings = () => {
|
||||
formData.value.discussSettings = !formData.value.discussSettings;
|
||||
}
|
||||
|
||||
defineExpose({openDrawer})
|
||||
</script>
|
||||
<style lang="scss">
|
||||
|
||||
@@ -62,8 +62,8 @@
|
||||
<div v-if="formData.evaluationTypeName" style="margin-left: 20px">
|
||||
<a-tag closable @close="delTag" color="processing">
|
||||
<span style="font-size: 14px; line-height: 33px">{{
|
||||
formData.evaluationTypeName
|
||||
}}</span>
|
||||
formData.evaluationTypeName
|
||||
}}</span>
|
||||
</a-tag>
|
||||
</div>
|
||||
</div>
|
||||
@@ -112,17 +112,18 @@
|
||||
</a-drawer>
|
||||
</template>
|
||||
<script setup>
|
||||
import { defineEmits, defineProps, ref } from "vue";
|
||||
import {defineEmits, defineProps, ref} from "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 {useResetRef} from "@/utils/useCommon";
|
||||
|
||||
const props = defineProps({
|
||||
type: Number,
|
||||
taskList: [],
|
||||
});
|
||||
const visible = ref(false);
|
||||
const formData = ref({
|
||||
const formData = useResetRef({
|
||||
evaluationName: "",
|
||||
evaluationTypeId: "",
|
||||
evaluationTypeName: "",
|
||||
@@ -154,13 +155,13 @@ const rulesRef = ref({
|
||||
],
|
||||
});
|
||||
|
||||
const { resetFields, validate } = Form.useForm(formData, rulesRef);
|
||||
const { validate } = Form.useForm(formData, rulesRef);
|
||||
|
||||
const closeDrawer = () => {
|
||||
visible.value = false;
|
||||
taskIndex.value = -1;
|
||||
dateTime.value = [];
|
||||
resetFields();
|
||||
formData.reset();
|
||||
};
|
||||
|
||||
const range = (start, end) => {
|
||||
@@ -210,7 +211,7 @@ async function confirm() {
|
||||
} else {
|
||||
const data = props.taskList[taskIndex.value];
|
||||
data.name = formData.value.evaluationName;
|
||||
data.info = {...formData.value};
|
||||
data.info = { ...formData.value };
|
||||
data.duration = dayjs(formData.value.evaluationEndTime).diff(
|
||||
formData.value.evaluationStartTime,
|
||||
"minutes"
|
||||
@@ -223,10 +224,10 @@ async function confirm() {
|
||||
function openDrawer(i, row) {
|
||||
row && (formData.value = { ...row.info });
|
||||
row &&
|
||||
(dateTime.value = [
|
||||
dayjs(row.info.evaluationStartTime, "YYYY-MM-DD HH:mm"),
|
||||
dayjs(row.info.evaluationEndTime, "YYYY-MM-DD HH:mm"),
|
||||
]);
|
||||
(dateTime.value = [
|
||||
dayjs(row.info.evaluationStartTime, "YYYY-MM-DD HH:mm"),
|
||||
dayjs(row.info.evaluationEndTime, "YYYY-MM-DD HH:mm"),
|
||||
]);
|
||||
i >= 0 && (taskIndex.value = i);
|
||||
visible.value = true;
|
||||
}
|
||||
@@ -238,6 +239,11 @@ defineExpose({ openDrawer });
|
||||
background-color: #fafafa !important;
|
||||
}
|
||||
|
||||
.addevalDrawer > .ant-drawer-content-wrapper {
|
||||
min-width: 800px !important;
|
||||
width: 800px !important;
|
||||
}
|
||||
|
||||
.addevalDrawer {
|
||||
.drawerMain {
|
||||
.header {
|
||||
@@ -443,8 +449,8 @@ defineExpose({ openDrawer });
|
||||
}
|
||||
|
||||
.ant-table-tbody
|
||||
> tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected)
|
||||
> td {
|
||||
> tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected)
|
||||
> td {
|
||||
background: #f6f9fd;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,8 +15,8 @@
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<img
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<span style="margin-right: 3px">作业名称:</span>
|
||||
@@ -33,22 +33,22 @@
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<img
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<span style="margin-right: 3px">开始时间:</span>
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-range-picker
|
||||
style="width: 400px; height: 40px; border-radius: 8px"
|
||||
:show-time="{ format: 'hh:mm' }"
|
||||
:disabled-date="disabledDate"
|
||||
|
||||
v-model:value="dateTime"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
@change="timeChange"
|
||||
:placeholder="[' 开始时间', ' 结束时间']"
|
||||
style="width: 400px; height: 40px; border-radius: 8px"
|
||||
:show-time="{ format: 'hh:mm' }"
|
||||
:disabled-date="disabledDate"
|
||||
|
||||
v-model:value="dateTime"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
@change="timeChange"
|
||||
:placeholder="[' 开始时间', ' 结束时间']"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -56,8 +56,8 @@
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<img
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<span style="margin-right: 3px">作业要求:</span>
|
||||
@@ -90,75 +90,104 @@
|
||||
import {defineEmits, defineProps, ref} from "vue";
|
||||
import dayjs from "dayjs";
|
||||
import FJUpload from "@/components/common/FJUpload";
|
||||
import {useResetRef} from "@/utils/useCommon";
|
||||
import {Form, message} from "ant-design-vue";
|
||||
|
||||
const props = defineProps({
|
||||
type: Number,
|
||||
taskList: []
|
||||
})
|
||||
const visible = ref(false)
|
||||
const formData = ref({})
|
||||
const emit = defineEmits({})
|
||||
});
|
||||
const visible = ref(false);
|
||||
const formData = useResetRef({ workName: "", submitStartTime: "", submitEndTime: "", workRequirement: "" });
|
||||
const emit = defineEmits({});
|
||||
const taskIndex = ref(-1);
|
||||
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 = () => {
|
||||
visible.value = false
|
||||
taskIndex.value = -1
|
||||
formData.value = {}
|
||||
dateTime.value = []
|
||||
visible.value = false;
|
||||
taskIndex.value = -1;
|
||||
formData.reset();
|
||||
dateTime.value = [];
|
||||
};
|
||||
/**
|
||||
const range = (start, end) => {
|
||||
const result = [];
|
||||
for (let i = start; i < end; i++) {
|
||||
result.push(i);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
*/
|
||||
|
||||
function timeChange(time, timeStr) {
|
||||
formData.value.submitStartTime = timeStr[0]
|
||||
formData.value.submitEndTime = timeStr[1]
|
||||
formData.value.submitStartTime = timeStr[0];
|
||||
formData.value.submitEndTime = timeStr[1];
|
||||
}
|
||||
|
||||
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],
|
||||
});
|
||||
*/
|
||||
function confirm() {
|
||||
|
||||
async function confirm() {
|
||||
await validate().catch(({ errorFields }) => {
|
||||
message.warning(errorFields[0].errors.join());
|
||||
throw Error("数据校验不通过");
|
||||
});
|
||||
if (taskIndex.value === -1) {
|
||||
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}})
|
||||
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 }
|
||||
});
|
||||
} else {
|
||||
const data = props.taskList[taskIndex.value]
|
||||
data.name = formData.value.workName
|
||||
data.info = {...formData.value}
|
||||
data.duration = dayjs(formData.value.submitEndTime).diff(formData.value.submitStartTime,'minutes')
|
||||
const data = props.taskList[taskIndex.value];
|
||||
data.name = formData.value.workName;
|
||||
data.info = { ...formData.value };
|
||||
data.duration = dayjs(formData.value.submitEndTime).diff(formData.value.submitStartTime, "minutes");
|
||||
}
|
||||
emit('update:taskList', [...props.taskList])
|
||||
closeDrawer()
|
||||
emit("update:taskList", [...props.taskList]);
|
||||
closeDrawer();
|
||||
}
|
||||
|
||||
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")]);
|
||||
(i >= 0) && (taskIndex.value = i);
|
||||
visible.value = true
|
||||
visible.value = true;
|
||||
}
|
||||
|
||||
defineExpose({openDrawer})
|
||||
defineExpose({ openDrawer });
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.ant-table-striped :deep(.table-striped) td {
|
||||
background-color: #fafafa !important;
|
||||
}
|
||||
|
||||
.addhomeworkDrawer > .ant-drawer-content-wrapper {
|
||||
min-width: 800px !important;
|
||||
width: 800px !important;
|
||||
}
|
||||
|
||||
.addhomeworkDrawer {
|
||||
.drawerMain {
|
||||
.header {
|
||||
|
||||
@@ -28,13 +28,14 @@
|
||||
import {defineEmits, defineProps, ref} from "vue";
|
||||
import {Form, message} from "ant-design-vue";
|
||||
import AssessmentAll from "@/components/drawers/AssessmentAll.vue";
|
||||
import {useResetRef} from "@/utils/useCommon";
|
||||
|
||||
const props = defineProps({
|
||||
type: Number,
|
||||
taskList: []
|
||||
})
|
||||
const visible = ref(false)
|
||||
const formData = ref({
|
||||
const formData = useResetRef({
|
||||
assessmentId: '',
|
||||
assessmentName: '',
|
||||
})
|
||||
@@ -55,12 +56,12 @@ const rulesRef = ref({
|
||||
],
|
||||
});
|
||||
|
||||
const {resetFields, validate} = Form.useForm(formData, rulesRef);
|
||||
const {validate} = Form.useForm(formData, rulesRef);
|
||||
|
||||
const closeDrawer = () => {
|
||||
visible.value = false
|
||||
taskIndex.value = -1
|
||||
resetFields()
|
||||
formData.reset()
|
||||
};
|
||||
|
||||
async function confirm() {
|
||||
@@ -98,7 +99,10 @@ defineExpose({openDrawer})
|
||||
.ant-table-striped :deep(.table-striped) td {
|
||||
background-color: #fafafa !important;
|
||||
}
|
||||
|
||||
.addinvistDrawer > .ant-drawer-content-wrapper {
|
||||
min-width: 1300px !important;
|
||||
width: 1300px !important;
|
||||
}
|
||||
.addinvistDrawer {
|
||||
.drawerMain {
|
||||
.header {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
{{ taskIndex >= 0 ? "编辑" : "添加" }}直播
|
||||
</div>
|
||||
<img style="width: 29px; height: 29px; cursor: pointer" src="../../assets/images/basicinfo/close.png"
|
||||
@click="closeDrawer" />
|
||||
@click="closeDrawer" />
|
||||
</div>
|
||||
<div class="contentMain">
|
||||
<div class="main_left">
|
||||
@@ -23,7 +23,7 @@
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-input v-model:value="formData.liveName" style="width: 400px; height: 40px; border-radius: 8px"
|
||||
placeholder="请输入直播名称" :maxlength="20" />
|
||||
placeholder="请输入直播名称" :maxlength="20" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_item" style="margin-top: -10px">
|
||||
@@ -35,7 +35,7 @@
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-input v-model:value="formData.liveLink" style="width: 400px; height: 40px; border-radius: 8px"
|
||||
placeholder="请输入直播链接" :maxlength="100" />
|
||||
placeholder="请输入直播链接" :maxlength="100" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -48,8 +48,8 @@
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<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"
|
||||
valueFormat="YYYY-MM-DD HH:mm" @change="timeChange" :placeholder="[' 开始时间', ' 结束时间']" />
|
||||
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="[' 开始时间', ' 结束时间']" />
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="main_item">
|
||||
@@ -86,7 +86,7 @@
|
||||
</div>
|
||||
<div class="item_inp" style="background-color: #fff;">
|
||||
<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" />
|
||||
<div class="i_upload" v-else>
|
||||
<div class="addimg">
|
||||
@@ -111,7 +111,7 @@
|
||||
</div>
|
||||
<div class="textarea">
|
||||
<a-textarea v-model:value="formData.liveNotice" placeholder="请输入直播公告" allow-clear show-count
|
||||
:maxlength="200" :rows="6" />
|
||||
:maxlength="200" :rows="6" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -130,7 +130,7 @@
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-input v-model:value="formData.livePlaybackLink" style="width: 400px; height: 40px; border-radius: 8px"
|
||||
placeholder="请输入回放链接" :maxlength="100" />
|
||||
placeholder="请输入回放链接" :maxlength="100" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -141,7 +141,7 @@
|
||||
</div>
|
||||
<div class="textarea">
|
||||
<a-textarea v-model:value="formData.liveExplain" placeholder="请输入直播说明" allow-clear show-count
|
||||
:maxlength="200" :rows="6" />
|
||||
:maxlength="200" :rows="6" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -198,8 +198,8 @@
|
||||
<div v-if="formData.assessmentId">
|
||||
<a-tag closable @close="removePG" color="processing">
|
||||
<span style="font-size: 14px; line-height: 33px">{{
|
||||
formData.assessmentName
|
||||
}}</span>
|
||||
formData.assessmentName
|
||||
}}</span>
|
||||
</a-tag>
|
||||
</div>
|
||||
</div>
|
||||
@@ -226,6 +226,7 @@ import ProjectManager from "@/components/project/ProjectManagerNew";
|
||||
import AddInvistRoot from "@/components/drawers/AddInvistRoot.vue";
|
||||
import { Form, message } from "ant-design-vue";
|
||||
import { fileUp } from "../../api/indexEval";
|
||||
import {useResetRef} from "@/utils/useCommon";
|
||||
|
||||
const removePG = () => {
|
||||
formData.value.assessmentId = "";
|
||||
@@ -242,7 +243,7 @@ const props = defineProps({
|
||||
taskList: [],
|
||||
});
|
||||
const visible = ref(false);
|
||||
const formData = ref({
|
||||
const formData = useResetRef({
|
||||
liveName: "",
|
||||
liveLink: "",
|
||||
liveStartTime: "",
|
||||
@@ -325,38 +326,20 @@ const rulesRef = ref({
|
||||
const { resetFields, validate } = Form.useForm(formData, rulesRef);
|
||||
|
||||
const closeDrawer = () => {
|
||||
formData.value.liveCover = "";
|
||||
formData.value.livePlaybackLink = "";
|
||||
imageUrl.value = "";
|
||||
visible.value = false;
|
||||
taskIndex.value = -1;
|
||||
dateTime.value = [];
|
||||
formData.reset()
|
||||
resetFields();
|
||||
};
|
||||
/**
|
||||
const range = (start, end) => {
|
||||
const result = [];
|
||||
for (let i = start; i < end; i++) {
|
||||
result.push(i);
|
||||
}
|
||||
return result;
|
||||
};
|
||||
*/
|
||||
function timeChange(time, timeStr) {
|
||||
formData.value.liveStartTime = timeStr[0];
|
||||
formData.value.liveEndTime = timeStr[1];
|
||||
}
|
||||
|
||||
const disabledDate = (current) => {
|
||||
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() {
|
||||
// debugger;
|
||||
console.log("确定按钮:");
|
||||
@@ -436,6 +419,11 @@ const beforeUpload = (file) => {
|
||||
background-color: #fff !important;
|
||||
}
|
||||
|
||||
.addliveDrawer > .ant-drawer-content-wrapper {
|
||||
min-width: 800px !important;
|
||||
width: 800px !important;
|
||||
}
|
||||
|
||||
.ant-table-striped :deep(.table-striped) td {
|
||||
background-color: #fafafa !important;
|
||||
}
|
||||
|
||||
@@ -164,7 +164,10 @@ function openDrawer(i, row) {
|
||||
defineExpose({ openDrawer, selectCourse });
|
||||
</script>
|
||||
<style lang="scss">
|
||||
|
||||
.addonlineDrawer > .ant-drawer-content-wrapper {
|
||||
min-width: 1300px !important;
|
||||
width: 1300px !important;
|
||||
}
|
||||
|
||||
.ant-table-striped :deep(.table-striped) td {
|
||||
background-color: #fafafa !important;
|
||||
|
||||
@@ -86,39 +86,39 @@
|
||||
<div>
|
||||
<div>
|
||||
<span class="title"
|
||||
>已选择
|
||||
>已选择
|
||||
<span class="data" style="color: #4ea6ff">{{ 1 }}</span>
|
||||
条 </span
|
||||
>
|
||||
<span class="title"
|
||||
>名称:
|
||||
>名称:
|
||||
<span
|
||||
class="data"
|
||||
style="color: #4ea6ff; margin-right: 15px"
|
||||
>{{ selectedRows?.name }}</span
|
||||
>{{ selectedRows?.name }}</span
|
||||
>
|
||||
</span>
|
||||
<span class="title"
|
||||
>项目经理:
|
||||
>项目经理:
|
||||
<span
|
||||
class="data"
|
||||
style="color: #4ea6ff; margin-right: 15px"
|
||||
>{{ selectedRows?.manager }}</span
|
||||
>{{ selectedRows?.manager }}</span
|
||||
>
|
||||
</span>
|
||||
<span class="title"
|
||||
>创建人:
|
||||
>创建人:
|
||||
<span
|
||||
class="data"
|
||||
style="color: #4ea6ff; margin-right: 15px"
|
||||
>{{ selectedRows?.createName }}</span
|
||||
>{{ selectedRows?.createName }}</span
|
||||
>
|
||||
</span>
|
||||
<span class="title"
|
||||
>创建时间:
|
||||
>创建时间:
|
||||
<span class="data" style="color: #4ea6ff">{{
|
||||
selectedRows?.createTime
|
||||
}}</span>
|
||||
selectedRows?.createTime
|
||||
}}</span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -219,11 +219,11 @@ const columns = ref([
|
||||
? (gaName + "/" + faName).slice(0, 16) + "..."
|
||||
: gaName + "/" + faName
|
||||
: faName.length > 16
|
||||
? faName.slice(0, 16) + "..."
|
||||
: faName
|
||||
? faName.slice(0, 16) + "..."
|
||||
: faName
|
||||
: name.length > 16
|
||||
? name.slice(0, 16) + "..."
|
||||
: name}
|
||||
? name.slice(0, 16) + "..."
|
||||
: name}
|
||||
</div>
|
||||
),
|
||||
},
|
||||
@@ -397,7 +397,10 @@ defineExpose({ openDrawer });
|
||||
.ant-table-striped :deep(.table-striped) td {
|
||||
background-color: #fafafa !important;
|
||||
}
|
||||
|
||||
.addonlineDrawer > .ant-drawer-content-wrapper {
|
||||
min-width: 1300px !important;
|
||||
width: 1300px !important;
|
||||
}
|
||||
.sameModal {
|
||||
.ant-modal {
|
||||
width: 424px !important;
|
||||
@@ -429,8 +432,8 @@ defineExpose({ openDrawer });
|
||||
width: calc(100%);
|
||||
height: 68px;
|
||||
background: linear-gradient(
|
||||
rgba(78, 166, 255, 0.2) 0%,
|
||||
rgba(78, 166, 255, 0) 100%
|
||||
rgba(78, 166, 255, 0.2) 0%,
|
||||
rgba(78, 166, 255, 0) 100%
|
||||
);
|
||||
}
|
||||
|
||||
@@ -672,8 +675,8 @@ defineExpose({ openDrawer });
|
||||
}
|
||||
|
||||
.ant-table-tbody
|
||||
> tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected)
|
||||
> td {
|
||||
> tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected)
|
||||
> td {
|
||||
background: #f6f9fd;
|
||||
}
|
||||
}
|
||||
@@ -726,8 +729,8 @@ defineExpose({ openDrawer });
|
||||
}
|
||||
|
||||
.ant-table-tbody
|
||||
> tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected)
|
||||
> td {
|
||||
> tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected)
|
||||
> td {
|
||||
background: #f6f9fd;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,18 +3,18 @@
|
||||
<slot></slot>
|
||||
</div>
|
||||
<a-drawer
|
||||
:visible="visible"
|
||||
class="drawerStyle addrefDrawer"
|
||||
width="1000"
|
||||
placement="right"
|
||||
:visible="visible"
|
||||
class="drawerStyle addrefDrawer"
|
||||
width="1000"
|
||||
placement="right"
|
||||
>
|
||||
<div class="drawerMain">
|
||||
<div class="header">
|
||||
<div class="headerTitle">{{ taskIndex >= 0 ? "编辑" : "添加" }}外链</div>
|
||||
<img
|
||||
style="width: 29px; height: 29px; cursor: pointer"
|
||||
src="../../assets/images/basicinfo/close.png"
|
||||
@click="closeDrawer"
|
||||
style="width: 29px; height: 29px; cursor: pointer"
|
||||
src="../../assets/images/basicinfo/close.png"
|
||||
@click="closeDrawer"
|
||||
/>
|
||||
</div>
|
||||
<div class="contentMain">
|
||||
@@ -23,18 +23,18 @@
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<img
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<span style="margin-right: 3px">外链名称:</span>
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-input
|
||||
v-model:value="formData.linkName"
|
||||
style="width: 400px; height: 40px; border-radius: 8px;"
|
||||
placeholder="请输入外链名称"
|
||||
show-count :maxlength="20"
|
||||
v-model:value="formData.linkName"
|
||||
style="width: 400px; height: 40px; border-radius: 8px;"
|
||||
placeholder="请输入外链名称"
|
||||
show-count :maxlength="20"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -42,19 +42,19 @@
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<img
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<span style="margin-right: 3px">链接:</span>
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-input
|
||||
v-model:value="formData.linkAddress"
|
||||
style="width: 400px; height: 40px; border-radius: 8px;"
|
||||
placeholder="请输入链接"
|
||||
v-model:value="formData.linkAddress"
|
||||
style="width: 400px; height: 40px; border-radius: 8px;"
|
||||
placeholder="请输入链接"
|
||||
|
||||
show-count :maxlength="100"
|
||||
show-count :maxlength="100"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -64,11 +64,11 @@
|
||||
</div>
|
||||
<div class="textarea" style="width:400px;">
|
||||
<a-textarea
|
||||
v-model:value="formData.linkDescription"
|
||||
placeholder="请输入外链说明"
|
||||
allow-clear
|
||||
:rows="6"
|
||||
show-count :maxlength="200"
|
||||
v-model:value="formData.linkDescription"
|
||||
placeholder="请输入外链说明"
|
||||
allow-clear
|
||||
:rows="6"
|
||||
show-count :maxlength="200"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -83,72 +83,78 @@
|
||||
</template>
|
||||
<script setup>
|
||||
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({
|
||||
type: Number,
|
||||
taskList: []
|
||||
})
|
||||
const visible = ref(false)
|
||||
const formData = ref({linkName: '', linkAddress: '', linkDescription: ''})
|
||||
const emit = defineEmits({})
|
||||
});
|
||||
const visible = ref(false);
|
||||
const formData = useResetRef({ linkName: "", linkAddress: "", linkDescription: "" });
|
||||
const emit = defineEmits({});
|
||||
const taskIndex = ref(-1);
|
||||
const dateTime = ref([]);
|
||||
const rulesRef = ref({
|
||||
linkName: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入链接名称',
|
||||
message: "请输入链接名称",
|
||||
},
|
||||
],
|
||||
linkAddress: [
|
||||
{
|
||||
type: 'url',
|
||||
type: "url",
|
||||
required: true,
|
||||
message: '请输入合法的链接地址',
|
||||
message: "请输入合法的链接地址",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const {resetFields, validate} = Form.useForm(formData, rulesRef);
|
||||
const { validate } = Form.useForm(formData, rulesRef);
|
||||
|
||||
const closeDrawer = () => {
|
||||
visible.value = false
|
||||
taskIndex.value = -1
|
||||
dateTime.value = []
|
||||
resetFields()
|
||||
visible.value = false;
|
||||
taskIndex.value = -1;
|
||||
dateTime.value = [];
|
||||
formData.reset();
|
||||
};
|
||||
|
||||
async function confirm() {
|
||||
await validate().catch(({errorFields}) => {
|
||||
await validate().catch(({ errorFields }) => {
|
||||
message.warning(errorFields[0].errors.join());
|
||||
throw Error("数据校验不通过")
|
||||
throw Error("数据校验不通过");
|
||||
});
|
||||
if (taskIndex.value === -1) {
|
||||
const list = props.taskList
|
||||
list.push({name: formData.value.linkName, type: props.type, info: {...formData.value}})
|
||||
const list = props.taskList;
|
||||
list.push({ name: formData.value.linkName, type: props.type, info: { ...formData.value } });
|
||||
} else {
|
||||
const data = props.taskList[taskIndex.value]
|
||||
data.name = formData.value.linkName
|
||||
data.info = {...formData.value}
|
||||
const data = props.taskList[taskIndex.value];
|
||||
data.name = formData.value.linkName;
|
||||
data.info = { ...formData.value };
|
||||
}
|
||||
emit('update:taskList', [...props.taskList])
|
||||
closeDrawer()
|
||||
emit("update:taskList", [...props.taskList]);
|
||||
closeDrawer();
|
||||
}
|
||||
|
||||
function openDrawer(i, row) {
|
||||
row && (formData.value = {...row.info});
|
||||
row && (formData.value = { ...row.info });
|
||||
(i >= 0) && (taskIndex.value = i);
|
||||
visible.value = true
|
||||
visible.value = true;
|
||||
}
|
||||
|
||||
defineExpose({openDrawer})
|
||||
defineExpose({ openDrawer });
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.ant-table-striped :deep(.table-striped) td {
|
||||
background-color: #fafafa !important;
|
||||
}
|
||||
|
||||
.addrefDrawer > .ant-drawer-content-wrapper {
|
||||
min-width: 800px !important;
|
||||
width: 800px !important;
|
||||
}
|
||||
|
||||
.addrefDrawer {
|
||||
.drawerMain {
|
||||
.header {
|
||||
@@ -261,7 +267,7 @@ defineExpose({openDrawer})
|
||||
background: #4ea6ff;
|
||||
border-radius: 8px;
|
||||
border: 0;
|
||||
margin-right: 16px 8px 32px 0;
|
||||
margin-right: 16px;
|
||||
color: #fff;
|
||||
margin-top: 16px;
|
||||
margin-bottom: 60px;
|
||||
@@ -279,7 +285,7 @@ defineExpose({openDrawer})
|
||||
display: flex;
|
||||
align-items: 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 {
|
||||
width: 100px;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<div class="header">
|
||||
<div class="headerTitle">{{ taskIndex >= 0 ? "编辑" : "添加" }}考试</div>
|
||||
<img style="width: 29px; height: 29px; cursor: pointer" src="../../assets/images/basicinfo/close.png"
|
||||
@click="closeDrawer" />
|
||||
@click="closeDrawer" />
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: row; padding-top: 0px; margin-top: 20px; margin-left: 32px;">
|
||||
<div v-if="taskIndex >= 0">
|
||||
@@ -26,7 +26,7 @@
|
||||
系统考试
|
||||
</button>
|
||||
<button style="width: 100px; cursor: pointer;" @click="changeOuter(2)"
|
||||
:class="formData.examType === 2 ? 'outer' : 'notOuter'">
|
||||
:class="formData.examType === 2 ? 'outer' : 'notOuter'">
|
||||
外部考试
|
||||
</button>
|
||||
</div>
|
||||
@@ -43,7 +43,7 @@
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-input v-model:value="formData.examinationName" style="width: 400px; height: 40px; border-radius: 8px"
|
||||
placeholder="请输入考试名称" :maxlength="20" />
|
||||
placeholder="请输入考试名称" :maxlength="20" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -84,8 +84,8 @@
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<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"
|
||||
v-model:value="dateTime" @change="timeChange" :placeholder="[' 开始时间', ' 结束时间']" />
|
||||
:disabled-date="disabledDate" format="YYYY-MM-DD HH:mm" valueFormat="YYYY-MM-DD HH:mm"
|
||||
v-model:value="dateTime" @change="timeChange" :placeholder="[' 开始时间', ' 结束时间']" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_item">
|
||||
@@ -97,8 +97,8 @@
|
||||
</div>
|
||||
<div class="select">
|
||||
<a-input-number :disabled="taskIndex >= 0 && isEdit" :min="0" :max="999999" :precision="0"
|
||||
style="width: 400px; height: 40px; border-radius: 8px"
|
||||
v-model:value="formData.examinationDuration"></a-input-number>
|
||||
style="width: 400px; height: 40px; border-radius: 8px"
|
||||
v-model:value="formData.examinationDuration"></a-input-number>
|
||||
<span style="color: #999999; margin-left: 8px">分钟</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -111,7 +111,7 @@
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<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>
|
||||
</div>
|
||||
@@ -122,7 +122,7 @@
|
||||
</div>
|
||||
<div class="textarea">
|
||||
<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 class="main_item2">
|
||||
@@ -185,7 +185,7 @@
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<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="2">选项乱序</a-radio>
|
||||
<a-radio :value="3">全部乱序</a-radio>
|
||||
@@ -207,7 +207,7 @@
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-input v-model:value="formData.examinationName" style="width: 400px; height: 40px; border-radius: 8px"
|
||||
placeholder="请输入考试名称" :maxlength="20" />
|
||||
placeholder="请输入考试名称" :maxlength="20" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_item">
|
||||
@@ -219,8 +219,8 @@
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-input v-model:value="formData.source"
|
||||
style="width: 400px; height: 40px; border-radius: 8px"
|
||||
placeholder="请输入数据来源" show-count :maxlength="420" />
|
||||
style="width: 400px; height: 40px; border-radius: 8px"
|
||||
placeholder="请输入数据来源" show-count :maxlength="420" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_item2">
|
||||
@@ -229,7 +229,7 @@
|
||||
</div>
|
||||
<div class="textarea">
|
||||
<a-textarea v-model:value="formData.examinationExplain" placeholder="请输入考试说明" allow-clear show-count
|
||||
:maxlength="200" :rows="6" />
|
||||
:maxlength="200" :rows="6" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -246,6 +246,7 @@ import { defineEmits, defineProps, ref, watch } from "vue";
|
||||
import STest from "./SelectTest.vue";
|
||||
import dayjs from "dayjs";
|
||||
import { Form, message } from "ant-design-vue";
|
||||
import {useResetRef} from "@/utils/useCommon";
|
||||
|
||||
const props = defineProps({
|
||||
type: Number,
|
||||
@@ -269,7 +270,7 @@ const initValue = {
|
||||
externalExplain: "",
|
||||
examinationExplain: ""
|
||||
}
|
||||
const formData = ref(initValue)
|
||||
const formData = useResetRef(initValue)
|
||||
const innerRule = {
|
||||
examinationName: [
|
||||
{
|
||||
@@ -323,14 +324,12 @@ const outerRule = {
|
||||
],
|
||||
}
|
||||
const rulesRef = ref(innerRule);
|
||||
|
||||
const emit = defineEmits({})
|
||||
const taskIndex = ref(-1);
|
||||
const dateTime = ref([]);
|
||||
let isEdit = ref(true);
|
||||
|
||||
const { resetFields, validate } = Form.useForm(formData, rulesRef);
|
||||
|
||||
watch(() => formData.value.examType, () => {
|
||||
formData.value.examType === 1 ? rulesRef.value = innerRule : rulesRef.value = outerRule
|
||||
})
|
||||
@@ -338,9 +337,7 @@ watch(() => formData.value.examType, () => {
|
||||
const closeDrawer = () => {
|
||||
visible.value = false
|
||||
taskIndex.value = -1
|
||||
formData.value.examinationLimit = ''
|
||||
formData.value.examinationExplain = ''
|
||||
resetFields()
|
||||
formData.reset()
|
||||
dateTime.value = []
|
||||
};
|
||||
|
||||
@@ -399,6 +396,11 @@ defineExpose({ openDrawer })
|
||||
background-color: #fafafa !important;
|
||||
}
|
||||
|
||||
.addtestDrawer > .ant-drawer-content-wrapper {
|
||||
min-width: 800px !important;
|
||||
width: 800px !important;
|
||||
}
|
||||
|
||||
.outer {
|
||||
background-color: #4ea6ff;
|
||||
color: #fff;
|
||||
|
||||
@@ -3,20 +3,20 @@
|
||||
<slot></slot>
|
||||
</div>
|
||||
<a-drawer
|
||||
:visible="visible"
|
||||
class="drawerStyle addvoteDrawer"
|
||||
width="800"
|
||||
title="添加投票"
|
||||
placement="right"
|
||||
:visible="visible"
|
||||
class="drawerStyle addvoteDrawer"
|
||||
width="800"
|
||||
title="添加投票"
|
||||
placement="right"
|
||||
>
|
||||
<div class="drawerMain">
|
||||
<div class="header">
|
||||
<div v-if="taskIndex>=0" class="headerTitle">编辑投票任务</div>
|
||||
<div v-else class="headerTitle">添加投票</div>
|
||||
<img
|
||||
style="width: 29px; height: 29px; cursor: pointer"
|
||||
src="../../assets/images/basicinfo/close.png"
|
||||
@click="closeDrawer"
|
||||
style="width: 29px; height: 29px; cursor: pointer"
|
||||
src="../../assets/images/basicinfo/close.png"
|
||||
@click="closeDrawer"
|
||||
/>
|
||||
</div>
|
||||
<div class="contentMain">
|
||||
@@ -25,18 +25,18 @@
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<img
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<span style="margin-right: 3px">任务名称:</span>
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-input
|
||||
v-model:value="formData.voteName"
|
||||
style="width: 424px; height: 40px; border-radius: 8px;"
|
||||
placeholder="请输入投票任务名称"
|
||||
maxlength="20"
|
||||
v-model:value="formData.voteName"
|
||||
style="width: 424px; height: 40px; border-radius: 8px;"
|
||||
placeholder="请输入投票任务名称"
|
||||
maxlength="20"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -44,21 +44,21 @@
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<img
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<span style="margin-right: 3px">起止时间:</span>
|
||||
</div>
|
||||
<div class="select">
|
||||
<a-range-picker
|
||||
:show-time="{ format: 'HH:mm' }"
|
||||
:disabled-date="disabledDate"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
style="width: 424px"
|
||||
v-model:value="dateTime"
|
||||
@change="timeChange"
|
||||
:placeholder="[' 开始时间', ' 结束时间']"
|
||||
:show-time="{ format: 'HH:mm' }"
|
||||
:disabled-date="disabledDate"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
style="width: 424px"
|
||||
v-model:value="dateTime"
|
||||
@change="timeChange"
|
||||
:placeholder="[' 开始时间', ' 结束时间']"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -66,8 +66,8 @@
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<img
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<span>创建投票题干:</span>
|
||||
@@ -91,11 +91,11 @@
|
||||
</div>
|
||||
<div class="textarea">
|
||||
<a-textarea
|
||||
v-model:value="formData.voteExplain"
|
||||
placeholder="请输入投票说明"
|
||||
allow-clear
|
||||
:rows="6"
|
||||
maxlength="150"
|
||||
v-model:value="formData.voteExplain"
|
||||
placeholder="请输入投票说明"
|
||||
allow-clear
|
||||
:rows="6"
|
||||
maxlength="150"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -113,13 +113,14 @@ import {defineEmits, defineProps, ref} from "vue";
|
||||
import CreateVote from "./CreateVote.vue";
|
||||
import {Form, message} from "ant-design-vue";
|
||||
import dayjs from "dayjs";
|
||||
import {useResetRef} from "@/utils/useCommon";
|
||||
|
||||
const props = defineProps({
|
||||
type: Number,
|
||||
taskList: []
|
||||
})
|
||||
const visible = ref(false)
|
||||
const formData = ref({
|
||||
const formData = useResetRef({
|
||||
voteName: '',
|
||||
voteStartTime: '',
|
||||
voteEndTime: '',
|
||||
@@ -156,13 +157,13 @@ const rulesRef = ref({
|
||||
],
|
||||
});
|
||||
|
||||
const {resetFields, validate} = Form.useForm(formData, rulesRef);
|
||||
const {validate} = Form.useForm(formData, rulesRef);
|
||||
|
||||
const closeDrawer = () => {
|
||||
visible.value = false
|
||||
taskIndex.value = -1
|
||||
dateTime.value = []
|
||||
resetFields()
|
||||
formData.reset()
|
||||
};
|
||||
|
||||
function timeChange(time, timeStr) {
|
||||
@@ -207,6 +208,10 @@ defineExpose({openDrawer})
|
||||
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.addvoteDrawer > .ant-drawer-content-wrapper {
|
||||
min-width: 800px !important;
|
||||
width: 800px !important;
|
||||
}
|
||||
.ConfirmModal {
|
||||
.ant-modal {
|
||||
width: 424px !important;
|
||||
@@ -234,8 +239,8 @@ defineExpose({openDrawer})
|
||||
width: calc(100%);
|
||||
height: 40px;
|
||||
background: linear-gradient(
|
||||
rgba(78, 166, 255, 0.2) 0%,
|
||||
rgba(78, 166, 255, 0) 100%
|
||||
rgba(78, 166, 255, 0.2) 0%,
|
||||
rgba(78, 166, 255, 0) 100%
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,14 @@ export function useInterval(fun, time) {
|
||||
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) {
|
||||
const timer = ref();
|
||||
const maxCount = ref(0);
|
||||
|
||||
Reference in New Issue
Block a user