mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-06 09:26:44 +08:00
修改环境变量
This commit is contained in:
@@ -7,6 +7,8 @@ VUE_APP_PIC_FOLDERID=1148997110156759040
|
||||
VUE_APP_COURSE_FOLDERID=1298970611096760320
|
||||
# 教师节上传zip文件夹id
|
||||
VUE_APP_TOOL_FOLDERID=1148996610925531136
|
||||
# 专业力必修API前缀
|
||||
VUE_APP_BASE_API_GROWTH=/growth
|
||||
|
||||
VUE_APP_PROXY_URL=//u.boe.com/
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div @click="openDrawer">
|
||||
<div @click="openDrawer()">
|
||||
<slot></slot>
|
||||
</div>
|
||||
<a-drawer
|
||||
@@ -11,9 +11,7 @@
|
||||
>
|
||||
<div class="drawerMain">
|
||||
<div class="header">
|
||||
<div class="headerTitle">
|
||||
{{ taskIndex >= 0 ? "编辑" : "添加" }}活动
|
||||
</div>
|
||||
<div class="headerTitle">{{ formData.id ? "编辑" : "添加" }}活动</div>
|
||||
<img
|
||||
style="width: 29px; height: 29px; cursor: pointer"
|
||||
src="../../assets/images/basicinfo/close.png"
|
||||
@@ -34,7 +32,7 @@
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-input
|
||||
v-model:value="formData.activityName"
|
||||
v-model:value="formData.info.activityName"
|
||||
style="width: 400px; height: 40px; border-radius: 8px"
|
||||
placeholder="请输入活动名称"
|
||||
maxlength="20"
|
||||
@@ -77,7 +75,7 @@
|
||||
:precision="0"
|
||||
style="width: 400px; height: 40px; border-radius: 8px"
|
||||
:placeholder="durationText"
|
||||
v-model:value="formData.activityDuration"
|
||||
v-model:value="formData.info.activityDuration"
|
||||
/>
|
||||
<span style="color: #999999; margin-left: 8px">分钟</span>
|
||||
</div>
|
||||
@@ -94,7 +92,7 @@
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-input
|
||||
v-model:value="formData.activityAddress"
|
||||
v-model:value="formData.info.activityAddress"
|
||||
style="width: 400px; height: 40px; border-radius: 8px"
|
||||
placeholder="请输入活动地点"
|
||||
maxlength="100"
|
||||
@@ -113,7 +111,7 @@
|
||||
</div>
|
||||
<div class="textarea">
|
||||
<a-textarea
|
||||
v-model:value="formData.activityNotice"
|
||||
v-model:value="formData.info.activityNotice"
|
||||
placeholder="请输入活动公告"
|
||||
allow-clear
|
||||
:rows="6"
|
||||
@@ -128,7 +126,7 @@
|
||||
</div>
|
||||
<div class="textarea">
|
||||
<a-textarea
|
||||
v-model:value="formData.activityExplain"
|
||||
v-model:value="formData.info.activityExplain"
|
||||
placeholder="请输入活动说明"
|
||||
allow-clear
|
||||
:rows="6"
|
||||
@@ -160,7 +158,7 @@
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
"
|
||||
v-model:value="formData.beforeSignIn"
|
||||
v-model:value="formData.info.beforeSignIn"
|
||||
/>
|
||||
<span style="color: #999999; margin-left: 8px"
|
||||
>分钟允许签到</span
|
||||
@@ -178,7 +176,7 @@
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
"
|
||||
v-model:value="formData.afterSignIn"
|
||||
v-model:value="formData.info.afterSignIn"
|
||||
/>
|
||||
<span style="color: #999999; margin-left: 8px"
|
||||
>分钟允许签到</span
|
||||
@@ -207,25 +205,29 @@ import { computed, defineEmits, defineProps, ref } from "vue";
|
||||
import { Form, message } from "ant-design-vue";
|
||||
import dayjs from "dayjs";
|
||||
import { useResetRef } from "@/utils/useCommon";
|
||||
import { saveTask } from "@/api/growthpath";
|
||||
|
||||
const props = defineProps({
|
||||
type: Number,
|
||||
taskList: [],
|
||||
// 选秀2 必修1
|
||||
activeKey: String,
|
||||
growId: String,
|
||||
});
|
||||
const visible = ref(false);
|
||||
const formData = useResetRef({
|
||||
activityName: "",
|
||||
activityNotice: "",
|
||||
activityStartTime: "",
|
||||
activityEndTime: "",
|
||||
activityDuration: "",
|
||||
activityAddress: "",
|
||||
activityExplain: "",
|
||||
beforeSignIn: "",
|
||||
afterSignIn: "",
|
||||
info: {
|
||||
activityName: "",
|
||||
activityNotice: "",
|
||||
activityStartTime: "",
|
||||
activityEndTime: "",
|
||||
activityDuration: "",
|
||||
activityAddress: "",
|
||||
activityExplain: "",
|
||||
beforeSignIn: "",
|
||||
afterSignIn: "",
|
||||
},
|
||||
});
|
||||
const emit = defineEmits({});
|
||||
const taskIndex = ref(-1);
|
||||
const emit = defineEmits(["refresh"]);
|
||||
const dateTime = ref([]);
|
||||
const rulesRef = ref({
|
||||
activityName: [
|
||||
@@ -266,7 +268,7 @@ const rulesRef = ref({
|
||||
],
|
||||
});
|
||||
|
||||
const { validate } = Form.useForm(formData, rulesRef);
|
||||
const { validate } = Form.useForm(formData.info, rulesRef);
|
||||
const durationText = computed(() =>
|
||||
dateTime.value?.length
|
||||
? dayjs(dateTime.value[1]).diff(dayjs(dateTime.value[0]), "minute")
|
||||
@@ -275,14 +277,14 @@ const durationText = computed(() =>
|
||||
|
||||
const closeDrawer = () => {
|
||||
visible.value = false;
|
||||
taskIndex.value = -1;
|
||||
dateTime.value = [];
|
||||
formData.reset();
|
||||
formData.value.info = {};
|
||||
};
|
||||
|
||||
function timeChange(time, timeStr) {
|
||||
formData.value.activityStartTime = timeStr[0];
|
||||
formData.value.activityEndTime = timeStr[1];
|
||||
formData.value.info.activityStartTime = timeStr[0];
|
||||
formData.value.info.activityEndTime = timeStr[1];
|
||||
// formData.value.activityDuration || (formData.value.activityDuration = dayjs(timeStr[1]).diff(dayjs(timeStr[0]),'minute'))
|
||||
}
|
||||
|
||||
@@ -296,38 +298,40 @@ async function confirm() {
|
||||
message.warning(errorFields[0].errors.join());
|
||||
throw Error("数据校验不通过");
|
||||
});
|
||||
if (taskIndex.value === -1) {
|
||||
const list = props.taskList;
|
||||
list.push({
|
||||
name: formData.value.activityName,
|
||||
type: props.type,
|
||||
duration: dayjs(formData.value.activityEndTime).diff(
|
||||
formData.value.activityStartTime,
|
||||
"minutes"
|
||||
),
|
||||
info: { ...formData.value },
|
||||
});
|
||||
} else {
|
||||
const data = props.taskList[taskIndex.value];
|
||||
data.name = formData.value.activityName;
|
||||
data.info = { ...formData.value };
|
||||
data.duration = dayjs(formData.value.activityEndTime).diff(
|
||||
formData.value.activityStartTime,
|
||||
"minutes"
|
||||
);
|
||||
}
|
||||
emit("update:taskList", [...props.taskList]);
|
||||
closeDrawer();
|
||||
// 专业力ID
|
||||
formData.value.growthId = props.growId;
|
||||
// 任务类型
|
||||
formData.value.taskType = props.type;
|
||||
// 必修/选修
|
||||
formData.value.type = props.activeKey;
|
||||
// 任务名称
|
||||
formData.value.taskName = formData.value.info.activityName;
|
||||
// 任务时长
|
||||
formData.value.duration = durationText.value;
|
||||
formData.value.info.activityDuration = durationText.value;
|
||||
saveTask(formData.value).then((res) => {
|
||||
if (res.data.code == 200) {
|
||||
if (formData.value.id) {
|
||||
message.success("编辑成功");
|
||||
} else {
|
||||
message.success("添加成功");
|
||||
}
|
||||
emit("refresh");
|
||||
} else {
|
||||
message.error(res.msg);
|
||||
}
|
||||
closeDrawer();
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
function openDrawer(i, row) {
|
||||
row && (formData.value = { ...row.info });
|
||||
function openDrawer(row) {
|
||||
row && (formData.value = row);
|
||||
row &&
|
||||
(dateTime.value = [
|
||||
dayjs(row.info.activityStartTime, "YYYY-MM-DD HH:mm"),
|
||||
dayjs(row.info.activityEndTime, "YYYY-MM-DD HH:mm"),
|
||||
]);
|
||||
i >= 0 && (taskIndex.value = i);
|
||||
visible.value = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,297 +1,321 @@
|
||||
<template>
|
||||
<div @click="openDrawer">
|
||||
<slot></slot>
|
||||
</div>
|
||||
<a-drawer
|
||||
:visible="visible"
|
||||
class="drawerStyle growth-discuss"
|
||||
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"
|
||||
/>
|
||||
</div>
|
||||
<div class="contentMain">
|
||||
<div class="main_left">
|
||||
<div class="main_item">
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<img
|
||||
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"
|
||||
<div @click="openDrawer()">
|
||||
<slot></slot>
|
||||
</div>
|
||||
<a-drawer
|
||||
:visible="visible"
|
||||
class="drawerStyle growth-discuss"
|
||||
width="800"
|
||||
placement="right"
|
||||
>
|
||||
<div class="drawerMain">
|
||||
<div class="header">
|
||||
<div class="headerTitle">{{ formData.id ? "编辑" : "添加" }}讨论</div>
|
||||
<img
|
||||
style="width: 29px; height: 29px; cursor: pointer"
|
||||
src="../../assets/images/basicinfo/close.png"
|
||||
@click="closeDrawer"
|
||||
/>
|
||||
</div>
|
||||
<div class="contentMain">
|
||||
<div class="main_left">
|
||||
<div class="main_item">
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<img
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<span style="margin-right: 3px">讨论名称:</span>
|
||||
</div>
|
||||
<div class="main_item2">
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<img
|
||||
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"
|
||||
<div class="btnbox">
|
||||
<a-input
|
||||
v-model:value="formData.info.discussName"
|
||||
style="width: 424px; height: 32px"
|
||||
placeholder="请输入讨论名称"
|
||||
show-count
|
||||
:maxlength="20"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_item2">
|
||||
<div class="signbox">
|
||||
<div class="sign">
|
||||
<img
|
||||
src="@/assets/images/coursewareManage/asterisk.png"
|
||||
alt=""
|
||||
/>
|
||||
</div>
|
||||
<span style="margin-right: 3px">讨论说明:</span>
|
||||
</div>
|
||||
<div class="main_item">
|
||||
<div class="signbox">
|
||||
<span style="margin-right: 3px">讨论设置:</span>
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-checkbox v-model:checked="formData.discussSettings" @click="discussSettings">允许评论</a-checkbox>
|
||||
</div>
|
||||
<div class="textarea">
|
||||
<a-textarea
|
||||
v-model:value="formData.info.discussExplain"
|
||||
placeholder="请输入讨论说明"
|
||||
allow-clear
|
||||
:rows="6"
|
||||
show-count
|
||||
:maxlength="200"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_item">
|
||||
<div class="signbox">
|
||||
<span style="margin-right: 3px">讨论设置:</span>
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-checkbox
|
||||
v-model:checked="formData.info.discussSettings"
|
||||
@click="discussSettings"
|
||||
>允许评论</a-checkbox
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_btns">
|
||||
<button class="btn2" @click="closeDrawer">取消</button>
|
||||
<button class="btn2" @click="confirm">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</a-drawer>
|
||||
</template>
|
||||
<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 = useResetRef({discussName: '', discussExplain: '', discussSettings: true})
|
||||
const emit = defineEmits({})
|
||||
const taskIndex = ref(-1);
|
||||
const dateTime = ref([]);
|
||||
const rulesRef = ref({
|
||||
discussName: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入讨论名称',
|
||||
},
|
||||
],
|
||||
discussExplain: [
|
||||
{
|
||||
required: true,
|
||||
message: '请输入讨论说明',
|
||||
},
|
||||
],
|
||||
<div class="main_btns">
|
||||
<button class="btn2" @click="closeDrawer">取消</button>
|
||||
<button class="btn2" @click="confirm">确定</button>
|
||||
</div>
|
||||
</div>
|
||||
</a-drawer>
|
||||
</template>
|
||||
<script setup>
|
||||
import { defineEmits, defineProps, ref } from "vue";
|
||||
import { Form, message } from "ant-design-vue";
|
||||
import { useResetRef } from "@/utils/useCommon";
|
||||
import { saveTask } from "@/api/growthpath";
|
||||
|
||||
const props = defineProps({
|
||||
type: Number,
|
||||
// 选秀2 必修1
|
||||
activeKey: String,
|
||||
growId: String,
|
||||
});
|
||||
const visible = ref(false);
|
||||
const formData = useResetRef({
|
||||
info: {
|
||||
discussName: "",
|
||||
discussExplain: "",
|
||||
discussSettings: true,
|
||||
},
|
||||
});
|
||||
const emit = defineEmits(['refresh']);
|
||||
const dateTime = ref([]);
|
||||
const rulesRef = ref({
|
||||
discussName: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入讨论名称",
|
||||
},
|
||||
],
|
||||
discussExplain: [
|
||||
{
|
||||
required: true,
|
||||
message: "请输入讨论说明",
|
||||
},
|
||||
],
|
||||
});
|
||||
|
||||
const { validate } = Form.useForm(formData.info, rulesRef);
|
||||
|
||||
const closeDrawer = () => {
|
||||
visible.value = false;
|
||||
dateTime.value = [];
|
||||
formData.reset();
|
||||
formData.value.info = {};
|
||||
};
|
||||
|
||||
async function confirm() {
|
||||
await validate().catch(({ errorFields }) => {
|
||||
message.warning(errorFields[0].errors.join());
|
||||
throw Error("数据校验不通过");
|
||||
});
|
||||
|
||||
const {validate} = Form.useForm(formData, rulesRef);
|
||||
|
||||
const closeDrawer = () => {
|
||||
visible.value = false
|
||||
taskIndex.value = -1
|
||||
dateTime.value = []
|
||||
formData.reset()
|
||||
};
|
||||
|
||||
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.discussName, type: props.type, info: {...formData.value}})
|
||||
// 专业力ID
|
||||
formData.value.growthId = props.growId;
|
||||
// 任务类型
|
||||
formData.value.taskType = props.type;
|
||||
// 必修/选修
|
||||
formData.value.type = props.activeKey;
|
||||
// 任务名称
|
||||
formData.value.taskName = formData.value.info.discussName;
|
||||
saveTask(formData.value).then((res) => {
|
||||
if (res.data.code == 200) {
|
||||
if (formData.value.id) {
|
||||
message.success("编辑成功");
|
||||
} else {
|
||||
message.success("添加成功");
|
||||
}
|
||||
emit("refresh");
|
||||
} else {
|
||||
const data = props.taskList[taskIndex.value]
|
||||
data.name = formData.value.discussName
|
||||
data.info = {...formData.value}
|
||||
message.error(res.msg);
|
||||
}
|
||||
emit('update:taskList', [...props.taskList])
|
||||
closeDrawer()
|
||||
}
|
||||
|
||||
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">
|
||||
.ant-table-striped :deep(.table-striped) td {
|
||||
background-color: #fafafa !important;
|
||||
}
|
||||
|
||||
.growth-discuss {
|
||||
.drawerMain {
|
||||
.header {
|
||||
height: 73px;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
|
||||
.headerTitle {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: #333333;
|
||||
line-height: 25px;
|
||||
margin-left: 24px;
|
||||
}
|
||||
closeDrawer();
|
||||
});
|
||||
}
|
||||
|
||||
function openDrawer(row) {
|
||||
row && (formData.value = row);
|
||||
row &&
|
||||
(formData.value.info.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">
|
||||
.ant-table-striped :deep(.table-striped) td {
|
||||
background-color: #fafafa !important;
|
||||
}
|
||||
|
||||
.growth-discuss {
|
||||
.drawerMain {
|
||||
.header {
|
||||
height: 73px;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
|
||||
.headerTitle {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: #333333;
|
||||
line-height: 25px;
|
||||
margin-left: 24px;
|
||||
}
|
||||
|
||||
.contentMain {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.main_left {
|
||||
margin-top: 0px;
|
||||
padding-right: 30px;
|
||||
flex: 1;
|
||||
border-right: 1px solid #e8e8e8;
|
||||
|
||||
.main_item {
|
||||
}
|
||||
|
||||
.contentMain {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.main_left {
|
||||
margin-top: 0px;
|
||||
padding-right: 30px;
|
||||
flex: 1;
|
||||
border-right: 1px solid #e8e8e8;
|
||||
|
||||
.main_item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-top: 32px;
|
||||
margin-bottom: 32px;
|
||||
|
||||
.signbox {
|
||||
width: 120px;
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
align-items: center;
|
||||
margin-top: 32px;
|
||||
margin-bottom: 32px;
|
||||
|
||||
.signbox {
|
||||
width: 120px;
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
align-items: center;
|
||||
|
||||
.sign {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.btnbox {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
align-items: center;
|
||||
|
||||
.ant-input {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.xkbtn {
|
||||
cursor: pointer;
|
||||
width: 130px;
|
||||
height: 40px;
|
||||
background: #4ea6ff;
|
||||
border-radius: 8px;
|
||||
border: 0;
|
||||
margin-right: 8px;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.sign {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.main_item2 {
|
||||
|
||||
.btnbox {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 32px;
|
||||
|
||||
.signbox {
|
||||
width: 120px;
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
align-items: center;
|
||||
|
||||
.sign {
|
||||
margin-right: 5px;
|
||||
}
|
||||
flex: 1;
|
||||
align-items: center;
|
||||
|
||||
.ant-input {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.textarea {
|
||||
width: 423px;
|
||||
|
||||
.ant-input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.ant-input-textarea-show-count {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.ant-input-textarea-show-count::after {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
bottom: 0px;
|
||||
}
|
||||
|
||||
.ant-input {
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.xkbtn {
|
||||
cursor: pointer;
|
||||
width: 130px;
|
||||
height: 40px;
|
||||
background: #4ea6ff;
|
||||
border-radius: 8px;
|
||||
border: 0;
|
||||
margin-right: 8px;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.main_btns {
|
||||
height: 72px;
|
||||
width: 100%;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0px 1px 35px 0px rgba(118, 136, 166, 0.16);
|
||||
|
||||
.btn1 {
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
border: 1px solid #4ea6ff;
|
||||
border-radius: 8px;
|
||||
color: #4ea6ff;
|
||||
background-color: #fff;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.btn2 {
|
||||
cursor: pointer;
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
background: #4ea6ff;
|
||||
border-radius: 8px;
|
||||
border: 0;
|
||||
margin-left: 15px;
|
||||
color: #fff;
|
||||
|
||||
.main_item2 {
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
margin-bottom: 32px;
|
||||
|
||||
.signbox {
|
||||
width: 120px;
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
align-items: center;
|
||||
|
||||
.sign {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.textarea {
|
||||
width: 423px;
|
||||
|
||||
.ant-input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.ant-input-textarea-show-count {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.ant-input-textarea-show-count::after {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
bottom: 0px;
|
||||
}
|
||||
|
||||
.ant-input {
|
||||
border-radius: 8px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.main_btns {
|
||||
height: 72px;
|
||||
width: 100%;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0px 1px 35px 0px rgba(118, 136, 166, 0.16);
|
||||
|
||||
.btn1 {
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
border: 1px solid #4ea6ff;
|
||||
border-radius: 8px;
|
||||
color: #4ea6ff;
|
||||
background-color: #fff;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.btn2 {
|
||||
cursor: pointer;
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
background: #4ea6ff;
|
||||
border-radius: 8px;
|
||||
border: 0;
|
||||
margin-left: 15px;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div @click="openDrawer">
|
||||
<div @click="openDrawer()">
|
||||
<slot></slot>
|
||||
</div>
|
||||
<a-drawer
|
||||
@@ -35,7 +35,7 @@
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-input
|
||||
v-model:value="formData.evaluationName"
|
||||
v-model:value="formData.info.evaluationName"
|
||||
style="width: 400px; height: 40px; border-radius: 8px"
|
||||
placeholder="请输入测评名称"
|
||||
show-count
|
||||
@@ -55,16 +55,16 @@
|
||||
</div>
|
||||
<div class="btnbox" @click="selectEval">
|
||||
<button class="checkEval">
|
||||
{{ formData.evaluationTypeName ? "修改" : "选择" }}测评
|
||||
{{ formData.info.evaluationTypeName ? "修改" : "选择" }}测评
|
||||
</button>
|
||||
|
||||
<div
|
||||
v-if="formData.evaluationTypeName"
|
||||
v-if="formData.info.evaluationTypeName"
|
||||
style="margin-left: 20px"
|
||||
>
|
||||
<a-tag closable @close="delTag" color="processing">
|
||||
<span style="font-size: 14px; line-height: 33px">{{
|
||||
formData.evaluationTypeName
|
||||
formData.info.evaluationTypeName
|
||||
}}</span>
|
||||
</a-tag>
|
||||
</div>
|
||||
@@ -94,7 +94,7 @@
|
||||
<a-textarea
|
||||
show-count
|
||||
:maxlength="200"
|
||||
v-model:value="formData.evaluationExplain"
|
||||
v-model:value="formData.info.evaluationExplain"
|
||||
placeholder="请输入测评说明"
|
||||
style="width: 400px"
|
||||
allowClear
|
||||
@@ -112,7 +112,7 @@
|
||||
|
||||
<div v-show="step == 2">
|
||||
<EvList
|
||||
:selectId="formData.evaluationTypeId"
|
||||
:selectId="formData.info.evaluationTypeId"
|
||||
ref="EvListRef"
|
||||
@confirm="selectEvalConfirm"
|
||||
>
|
||||
@@ -127,17 +127,20 @@ import EvList from "./EvList.vue";
|
||||
import { Form, message } from "ant-design-vue";
|
||||
import dayjs from "dayjs";
|
||||
import { useResetRef } from "@/utils/useCommon";
|
||||
import { saveTask } from "@/api/growthpath";
|
||||
|
||||
const props = defineProps({
|
||||
type: Number,
|
||||
taskList: [],
|
||||
// 选秀2 必修1
|
||||
activeKey: String,
|
||||
growId: String,
|
||||
});
|
||||
// 步骤数
|
||||
const step = ref(1);
|
||||
// 弹框标题
|
||||
const title = computed(() => {
|
||||
if (step.value == 1) {
|
||||
return taskIndex >= 0 ? "编辑测评" : "添加测评";
|
||||
return formData.value.id ? "编辑测评" : "添加测评";
|
||||
} else if (step.value == 2) {
|
||||
return "选择测评";
|
||||
}
|
||||
@@ -149,21 +152,22 @@ const selectEval = () => {
|
||||
// 选择测评完毕
|
||||
const selectEvalConfirm = (data) => {
|
||||
step.value = step.value - 1;
|
||||
formData.value.evaluationTypeId = data.id;
|
||||
formData.value.evaluationTypeName = data.title;
|
||||
formData.value.info.evaluationTypeId = data.id;
|
||||
formData.value.info.evaluationTypeName = data.title;
|
||||
};
|
||||
|
||||
const visible = ref(false);
|
||||
const formData = useResetRef({
|
||||
evaluationName: "",
|
||||
evaluationTypeId: "",
|
||||
evaluationTypeName: "",
|
||||
evaluationExplain: "",
|
||||
evaluationStartTime: "",
|
||||
evaluationEndTime: "",
|
||||
info: {
|
||||
evaluationName: "",
|
||||
evaluationTypeId: "",
|
||||
evaluationTypeName: "",
|
||||
evaluationExplain: "",
|
||||
evaluationStartTime: "",
|
||||
evaluationEndTime: "",
|
||||
},
|
||||
});
|
||||
const emit = defineEmits({});
|
||||
const taskIndex = ref(-1);
|
||||
const emit = defineEmits(["refresh"]);
|
||||
const dateTime = ref([]);
|
||||
const rulesRef = ref({
|
||||
evaluationName: [
|
||||
@@ -186,16 +190,16 @@ const rulesRef = ref({
|
||||
],
|
||||
});
|
||||
|
||||
const { validate } = Form.useForm(formData, rulesRef);
|
||||
const { validate } = Form.useForm(formData.info, rulesRef);
|
||||
|
||||
const closeDrawer = () => {
|
||||
if (step.value > 1) {
|
||||
step.value = step.value - 1;
|
||||
} else {
|
||||
visible.value = false;
|
||||
taskIndex.value = -1;
|
||||
dateTime.value = [];
|
||||
formData.reset();
|
||||
formData.value.info = {};
|
||||
}
|
||||
};
|
||||
|
||||
@@ -208,8 +212,8 @@ const range = (start, end) => {
|
||||
};
|
||||
|
||||
function timeChange(time, timeStr) {
|
||||
formData.value.evaluationStartTime = timeStr[0];
|
||||
formData.value.evaluationEndTime = timeStr[1];
|
||||
formData.value.info.evaluationStartTime = timeStr[0];
|
||||
formData.value.info.evaluationEndTime = timeStr[1];
|
||||
}
|
||||
|
||||
const disabledDate = (current) => {
|
||||
@@ -223,8 +227,8 @@ const disabledRangeTime = () => ({
|
||||
});
|
||||
|
||||
function delTag() {
|
||||
formData.value.evaluationTypeId = "";
|
||||
formData.value.evaluationTypeName = "";
|
||||
formData.value.info.evaluationTypeId = "";
|
||||
formData.value.info.evaluationTypeName = "";
|
||||
}
|
||||
|
||||
async function confirm() {
|
||||
@@ -232,38 +236,37 @@ async function confirm() {
|
||||
message.warning(errorFields[0].errors.join());
|
||||
throw Error("数据校验不通过");
|
||||
});
|
||||
if (taskIndex.value === -1) {
|
||||
const list = props.taskList;
|
||||
list.push({
|
||||
name: formData.value.evaluationName,
|
||||
duration: dayjs(formData.value.evaluationEndTime).diff(
|
||||
formData.value.evaluationStartTime,
|
||||
"minutes"
|
||||
),
|
||||
type: props.type,
|
||||
info: { ...formData.value },
|
||||
});
|
||||
} else {
|
||||
const data = props.taskList[taskIndex.value];
|
||||
data.name = formData.value.evaluationName;
|
||||
data.info = { ...formData.value };
|
||||
data.duration = dayjs(formData.value.evaluationEndTime).diff(
|
||||
formData.value.evaluationStartTime,
|
||||
"minutes"
|
||||
);
|
||||
}
|
||||
emit("update:taskList", [...props.taskList]);
|
||||
closeDrawer();
|
||||
|
||||
// 专业力ID
|
||||
formData.value.growthId = props.growId;
|
||||
// 任务类型
|
||||
formData.value.taskType = props.type;
|
||||
// 必修/选修
|
||||
formData.value.type = props.activeKey;
|
||||
// 任务名称
|
||||
formData.value.taskName = formData.value.info.evaluationName;
|
||||
saveTask(formData.value).then((res) => {
|
||||
if (res.data.code == 200) {
|
||||
if (formData.value.id) {
|
||||
message.success("编辑成功");
|
||||
} else {
|
||||
message.success("添加成功");
|
||||
}
|
||||
emit("refresh");
|
||||
} else {
|
||||
message.error(res.msg);
|
||||
}
|
||||
closeDrawer();
|
||||
});
|
||||
}
|
||||
|
||||
function openDrawer(i, row) {
|
||||
row && (formData.value = { ...row.info });
|
||||
function openDrawer(row) {
|
||||
row && (formData.value = row);
|
||||
row &&
|
||||
(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;
|
||||
}
|
||||
|
||||
|
||||
@@ -564,8 +564,9 @@ async function confirm() {
|
||||
} else {
|
||||
message.error(res.msg);
|
||||
}
|
||||
closeDrawer();
|
||||
});
|
||||
closeDrawer();
|
||||
|
||||
}
|
||||
|
||||
function openDrawer(row) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div class="growth-invist-root">
|
||||
<div class="contentMain drawerMain">
|
||||
<div class="contentMain">
|
||||
<div class="main_item">
|
||||
<div class="fi_input">
|
||||
<a-input
|
||||
@@ -66,7 +66,7 @@ import { saveTask } from "@/api/growthpath";
|
||||
// import { useRouter } from "vue-router";
|
||||
import { useRowsPage } from "@/api/request";
|
||||
import { ASSESSMENT_PAGE } from "@/api/apis";
|
||||
const emit = defineEmits(["confirm"]);
|
||||
const emit = defineEmits(["confirm",'update:id','update:name']);
|
||||
const props = defineProps({
|
||||
id: String,
|
||||
name: String,
|
||||
@@ -168,6 +168,8 @@ const columns = ref([
|
||||
]);
|
||||
|
||||
async function confirm(record) {
|
||||
emit('update:id',record.id)
|
||||
emit('update:name',record.assessmentName)
|
||||
emit("confirm", record);
|
||||
}
|
||||
</script>
|
||||
@@ -180,121 +182,103 @@ async function confirm(record) {
|
||||
width: 1300px !important;
|
||||
}
|
||||
.growth-invist-root {
|
||||
.drawerMain {
|
||||
.contentMain {
|
||||
margin: 16px 0;
|
||||
.header {
|
||||
height: 73px;
|
||||
border-bottom: 1px solid #e8e8e8;
|
||||
.main_item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.headerTitle {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: #333333;
|
||||
line-height: 25px;
|
||||
margin-left: 24px;
|
||||
margin-bottom: 20px;
|
||||
margin-top: 20px;
|
||||
.fi_input {
|
||||
margin-right: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.contentMain {
|
||||
.main_item {
|
||||
.btns {
|
||||
margin-right: 20px;
|
||||
padding: 0px 26px 0px 26px;
|
||||
height: 38px;
|
||||
background: #4ea6ff;
|
||||
border-radius: 8px;
|
||||
//border: 1px solid rgba(64, 158, 255, 1);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 20px;
|
||||
margin-top: 20px;
|
||||
.fi_input {
|
||||
margin-right: 20px;
|
||||
justify-content: center;
|
||||
margin-right: 14px;
|
||||
flex-shrink: 0;
|
||||
cursor: pointer;
|
||||
|
||||
.search {
|
||||
width: 15px;
|
||||
height: 17px;
|
||||
background-image: url("../../assets/images/courseManage/search0.png");
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.btns {
|
||||
margin-right: 20px;
|
||||
padding: 0px 26px 0px 26px;
|
||||
height: 38px;
|
||||
background: #4ea6ff;
|
||||
border-radius: 8px;
|
||||
//border: 1px solid rgba(64, 158, 255, 1);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 14px;
|
||||
flex-shrink: 0;
|
||||
cursor: pointer;
|
||||
.btnText {
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: #ffffff;
|
||||
line-height: 36px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.search {
|
||||
width: 15px;
|
||||
height: 17px;
|
||||
background-image: url("../../assets/images/courseManage/search0.png");
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
.btnsn {
|
||||
padding: 0px 26px 0px 26px;
|
||||
height: 38px;
|
||||
background: #ffffff;
|
||||
border-radius: 8px;
|
||||
border: 1px solid rgba(64, 158, 255, 1);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 14px;
|
||||
flex-shrink: 0;
|
||||
cursor: pointer;
|
||||
|
||||
.btnText {
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: #ffffff;
|
||||
line-height: 36px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
.search {
|
||||
width: 16px;
|
||||
height: 18px;
|
||||
background-image: url("../../assets/images/courseManage/reset1.png");
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.btnsn {
|
||||
padding: 0px 26px 0px 26px;
|
||||
height: 38px;
|
||||
background: #ffffff;
|
||||
border-radius: 8px;
|
||||
border: 1px solid rgba(64, 158, 255, 1);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 14px;
|
||||
flex-shrink: 0;
|
||||
cursor: pointer;
|
||||
|
||||
.search {
|
||||
width: 16px;
|
||||
height: 18px;
|
||||
background-image: url("../../assets/images/courseManage/reset1.png");
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.btnText {
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: #4ea6ff;
|
||||
line-height: 36px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
.btnText {
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: #4ea6ff;
|
||||
line-height: 36px;
|
||||
margin-left: 5px;
|
||||
}
|
||||
}
|
||||
}
|
||||
.main_table {
|
||||
position: relative;
|
||||
padding-bottom: 80px;
|
||||
}
|
||||
.main_table {
|
||||
position: relative;
|
||||
padding-bottom: 80px;
|
||||
|
||||
.ant-checkbox-wrapper {
|
||||
align-items: center;
|
||||
margin-top: -2px;
|
||||
}
|
||||
.ant-checkbox-wrapper {
|
||||
align-items: center;
|
||||
margin-top: -2px;
|
||||
}
|
||||
|
||||
.ant-table-selection-column {
|
||||
padding: 0px !important;
|
||||
padding-left: 5px !important;
|
||||
}
|
||||
.ant-table-selection-column {
|
||||
padding: 0px !important;
|
||||
padding-left: 5px !important;
|
||||
}
|
||||
|
||||
.ant-table-thead > tr > th {
|
||||
background-color: rgba(239, 244, 252, 1);
|
||||
}
|
||||
.ant-table-thead > tr > th {
|
||||
background-color: rgba(239, 244, 252, 1);
|
||||
}
|
||||
|
||||
th.h {
|
||||
background-color: #eff4fc !important;
|
||||
}
|
||||
th.h {
|
||||
background-color: #eff4fc !important;
|
||||
}
|
||||
|
||||
.ant-table-tbody
|
||||
> tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected)
|
||||
> td {
|
||||
background: #f6f9fd;
|
||||
}
|
||||
.ant-table-tbody
|
||||
> tr:hover:not(.ant-table-expanded-row):not(.ant-table-row-selected)
|
||||
> td {
|
||||
background: #f6f9fd;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -334,6 +334,7 @@ import { Form, message } from "ant-design-vue";
|
||||
import { fileUp } from "../../api/indexEval";
|
||||
import { useResetRef } from "@/utils/useCommon";
|
||||
import { getCookieForName } from "@/api/method";
|
||||
import { saveTask } from "@/api/growthpath";
|
||||
|
||||
const step = ref(1);
|
||||
|
||||
@@ -349,7 +350,9 @@ const getchanges = (mess) => {
|
||||
};
|
||||
const props = defineProps({
|
||||
type: Number,
|
||||
taskList: [],
|
||||
// 选秀2 必修1
|
||||
activeKey: String,
|
||||
growId: String,
|
||||
});
|
||||
const visible = ref(false);
|
||||
const headers = { token: getCookieForName("token") };
|
||||
@@ -373,7 +376,7 @@ const formData = useResetRef({
|
||||
liveExplain: "",
|
||||
},
|
||||
});
|
||||
const emit = defineEmits({});
|
||||
const emit = defineEmits(['refresh']);
|
||||
const dateTime = ref([]);
|
||||
|
||||
const rulesRef = ref({
|
||||
@@ -442,12 +445,16 @@ const durationText = computed(() =>
|
||||
);
|
||||
|
||||
const closeDrawer = () => {
|
||||
imageUrl.value = "";
|
||||
visible.value = false;
|
||||
dateTime.value = [];
|
||||
formData.reset();
|
||||
formData.value.info = {};
|
||||
resetFields();
|
||||
if (step.value > 1) {
|
||||
step.value = 1;
|
||||
} else {
|
||||
imageUrl.value = "";
|
||||
visible.value = false;
|
||||
dateTime.value = [];
|
||||
formData.reset();
|
||||
formData.value.info = {};
|
||||
resetFields();
|
||||
}
|
||||
};
|
||||
function timeChange(time, timeStr) {
|
||||
formData.value.info.liveStartTime = timeStr[0];
|
||||
@@ -464,35 +471,34 @@ async function confirm() {
|
||||
message.warning(errorFields[0].errors.join());
|
||||
throw Error("数据校验不通过");
|
||||
});
|
||||
console.log(formData.value);
|
||||
return;
|
||||
if (taskIndex.value === -1) {
|
||||
let list = props.taskList;
|
||||
list.push({
|
||||
name: formData.value.liveName,
|
||||
type: props.type,
|
||||
info: { ...formData.value },
|
||||
duration: dayjs(formData.value.liveEndTime).diff(
|
||||
formData.value.liveStartTime,
|
||||
"minutes"
|
||||
),
|
||||
});
|
||||
} else {
|
||||
const data = props.taskList[taskIndex.value];
|
||||
data.name = formData.value.liveName;
|
||||
data.info = { ...formData.value };
|
||||
data.duration = dayjs(formData.value.liveEndTime).diff(
|
||||
formData.value.liveStartTime,
|
||||
"minutes"
|
||||
);
|
||||
console.log(data);
|
||||
}
|
||||
emit("update:taskList", [...props.taskList]);
|
||||
closeDrawer();
|
||||
|
||||
// 专业力ID
|
||||
formData.value.growthId = props.growId;
|
||||
// 任务类型
|
||||
formData.value.taskType = props.type;
|
||||
// 必修/选修
|
||||
formData.value.type = props.activeKey;
|
||||
// 任务名称
|
||||
formData.value.taskName = formData.value.info.liveName;
|
||||
// 任务时长
|
||||
formData.value.duration = durationText.value;
|
||||
formData.value.info.liveDuration = durationText.value;
|
||||
saveTask(formData.value).then((res) => {
|
||||
if (res.data.code == 200) {
|
||||
if (formData.value.id) {
|
||||
message.success("编辑成功");
|
||||
} else {
|
||||
message.success("添加成功");
|
||||
}
|
||||
emit("refresh");
|
||||
} else {
|
||||
message.error(res.msg);
|
||||
}
|
||||
closeDrawer()
|
||||
});
|
||||
}
|
||||
|
||||
function openDrawer(row) {
|
||||
console.log(row);
|
||||
row && (formData.value = row);
|
||||
row && (dateTime.value = [row.info.liveStartTime, row.info.liveEndTime]);
|
||||
row && (imageUrl.value = row.info.liveCover);
|
||||
@@ -606,7 +612,7 @@ const beforeUpload = (file) => {
|
||||
background: #4ea6ff;
|
||||
border-radius: 8px;
|
||||
border: 0;
|
||||
margin-right: 8px;
|
||||
margin: 0 8px 0 0;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -558,7 +558,9 @@ export default {
|
||||
// 创建a标签并为其添加属性
|
||||
const link = document.createElement("a");
|
||||
link.href = url;
|
||||
link.download = "专业力必修-录入学员模版.xlsx";
|
||||
link.download = `【${
|
||||
state.TASK_TYPE[props.datasource.taskType].name
|
||||
}】${props.datasource.taskName}.xlsx`;
|
||||
// 触发点击事件执行下载
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div @click="openDrawer">
|
||||
<div @click="openDrawer()">
|
||||
<slot></slot>
|
||||
</div>
|
||||
<a-drawer
|
||||
@@ -10,9 +10,7 @@
|
||||
>
|
||||
<div class="drawerMain">
|
||||
<div class="header">
|
||||
<div class="headerTitle">
|
||||
{{ taskIndex >= 0 ? "编辑" : "添加" }}外链
|
||||
</div>
|
||||
<div class="headerTitle">{{ formData.id ? "编辑" : "添加" }}外链</div>
|
||||
<img
|
||||
style="width: 29px; height: 29px; cursor: pointer"
|
||||
src="../../assets/images/basicinfo/close.png"
|
||||
@@ -33,7 +31,7 @@
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-input
|
||||
v-model:value="formData.linkName"
|
||||
v-model:value="formData.info.linkName"
|
||||
style="width: 400px; height: 40px; border-radius: 8px"
|
||||
placeholder="请输入外链名称"
|
||||
show-count
|
||||
@@ -53,7 +51,7 @@
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-input
|
||||
v-model:value="formData.linkAddress"
|
||||
v-model:value="formData.info.linkAddress"
|
||||
style="width: 400px; height: 40px; border-radius: 8px"
|
||||
placeholder="请输入链接"
|
||||
show-count
|
||||
@@ -67,7 +65,7 @@
|
||||
</div>
|
||||
<div class="textarea" style="width: 400px">
|
||||
<a-textarea
|
||||
v-model:value="formData.linkDescription"
|
||||
v-model:value="formData.info.linkDescription"
|
||||
placeholder="请输入外链说明"
|
||||
allow-clear
|
||||
:rows="6"
|
||||
@@ -89,19 +87,23 @@
|
||||
import { defineEmits, defineProps, ref } from "vue";
|
||||
import { Form, message } from "ant-design-vue";
|
||||
import { useResetRef } from "@/utils/useCommon";
|
||||
import { saveTask } from "@/api/growthpath";
|
||||
|
||||
const props = defineProps({
|
||||
type: Number,
|
||||
taskList: [],
|
||||
// 选秀2 必修1
|
||||
activeKey: String,
|
||||
growId: String,
|
||||
});
|
||||
const visible = ref(false);
|
||||
const formData = useResetRef({
|
||||
linkName: "",
|
||||
linkAddress: "",
|
||||
linkDescription: "",
|
||||
info: {
|
||||
linkName: "",
|
||||
linkAddress: "",
|
||||
linkDescription: "",
|
||||
},
|
||||
});
|
||||
const emit = defineEmits({});
|
||||
const taskIndex = ref(-1);
|
||||
const emit = defineEmits(['refresh']);
|
||||
const dateTime = ref([]);
|
||||
const rulesRef = ref({
|
||||
linkName: [
|
||||
@@ -119,13 +121,13 @@ const rulesRef = ref({
|
||||
],
|
||||
});
|
||||
|
||||
const { validate } = Form.useForm(formData, rulesRef);
|
||||
const { validate } = Form.useForm(formData.info, rulesRef);
|
||||
|
||||
const closeDrawer = () => {
|
||||
visible.value = false;
|
||||
taskIndex.value = -1;
|
||||
dateTime.value = [];
|
||||
formData.reset();
|
||||
formData.info = {};
|
||||
};
|
||||
|
||||
async function confirm() {
|
||||
@@ -133,25 +135,31 @@ async function confirm() {
|
||||
message.warning(errorFields[0].errors.join());
|
||||
throw Error("数据校验不通过");
|
||||
});
|
||||
if (taskIndex.value === -1) {
|
||||
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 };
|
||||
}
|
||||
emit("update:taskList", [...props.taskList]);
|
||||
closeDrawer();
|
||||
// 专业力ID
|
||||
formData.value.growthId = props.growId;
|
||||
// 任务类型
|
||||
formData.value.taskType = props.type;
|
||||
// 必修/选修
|
||||
formData.value.type = props.activeKey;
|
||||
// 任务名称
|
||||
formData.value.taskName = formData.value.info.linkName;
|
||||
saveTask(formData.value).then((res) => {
|
||||
if (res.data.code == 200) {
|
||||
if (formData.value.id) {
|
||||
message.success("编辑成功");
|
||||
} else {
|
||||
message.success("添加成功");
|
||||
}
|
||||
emit("refresh");
|
||||
} else {
|
||||
message.error(res.msg);
|
||||
}
|
||||
closeDrawer();
|
||||
});
|
||||
}
|
||||
|
||||
function openDrawer(i, row) {
|
||||
row && (formData.value = { ...row.info });
|
||||
i >= 0 && (taskIndex.value = i);
|
||||
function openDrawer(row) {
|
||||
row && (formData.value = row);
|
||||
visible.value = true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div @click="openDrawer">
|
||||
<div @click="openDrawer()">
|
||||
<slot></slot>
|
||||
</div>
|
||||
<a-drawer
|
||||
@@ -34,7 +34,7 @@
|
||||
</div>
|
||||
<div class="btnbox">
|
||||
<a-input
|
||||
v-model:value="formData.voteName"
|
||||
v-model:value="formData.info.voteName"
|
||||
style="width: 424px; height: 40px; border-radius: 8px"
|
||||
placeholder="请输入投票任务名称"
|
||||
maxlength="20"
|
||||
@@ -75,11 +75,11 @@
|
||||
<div class="btnbox">
|
||||
<button class="xkbtn" @click="step = 2">
|
||||
{{
|
||||
formData.voteStemDtoList.length ? "编辑" : "创建"
|
||||
formData.info.voteStemDtoList.length ? "编辑" : "创建"
|
||||
}}投票题干
|
||||
</button>
|
||||
|
||||
<div v-if="formData.voteStemDtoList.length">
|
||||
<div v-if="formData.info.voteStemDtoList.length">
|
||||
<a-tag closable color="processing" @close="handleDel">
|
||||
<span style="font-size: 14px; line-height: 33px"
|
||||
>删除投票题干</span
|
||||
@@ -94,7 +94,7 @@
|
||||
</div>
|
||||
<div class="textarea">
|
||||
<a-textarea
|
||||
v-model:value="formData.voteExplain"
|
||||
v-model:value="formData.info.voteExplain"
|
||||
placeholder="请输入投票说明"
|
||||
allow-clear
|
||||
:rows="6"
|
||||
@@ -111,7 +111,7 @@
|
||||
</template>
|
||||
<template v-if="step == 2">
|
||||
<CreateVote
|
||||
v-model:options="formData.voteStemDtoList"
|
||||
v-model:options="formData.info.voteStemDtoList"
|
||||
@close="step = 1"
|
||||
@confirm="step = 1"
|
||||
>
|
||||
@@ -126,15 +126,17 @@ import CreateVote from "./CreateVote.vue";
|
||||
import { Form, message } from "ant-design-vue";
|
||||
import dayjs from "dayjs";
|
||||
import { useResetRef } from "@/utils/useCommon";
|
||||
|
||||
import { saveTask } from "@/api/growthpath";
|
||||
const props = defineProps({
|
||||
type: Number,
|
||||
taskList: [],
|
||||
// 选秀2 必修1
|
||||
activeKey: String,
|
||||
growId: String,
|
||||
});
|
||||
// 弹框标题
|
||||
const title = computed(() => {
|
||||
if (step.value == 1) {
|
||||
return taskIndex >= 0 ? "编辑投票任务" : "添加投票";
|
||||
return formData.value.info ? "编辑投票任务" : "添加投票";
|
||||
} else if (step.value == 2) {
|
||||
return "创建投票题干";
|
||||
}
|
||||
@@ -143,14 +145,15 @@ const title = computed(() => {
|
||||
const step = ref(1);
|
||||
const visible = ref(false);
|
||||
const formData = useResetRef({
|
||||
voteName: "",
|
||||
voteStartTime: "",
|
||||
voteEndTime: "",
|
||||
voteStemDtoList: [],
|
||||
voteExplain: "",
|
||||
info: {
|
||||
voteName: "",
|
||||
voteStartTime: "",
|
||||
voteEndTime: "",
|
||||
voteStemDtoList: [],
|
||||
voteExplain: "",
|
||||
},
|
||||
});
|
||||
const emit = defineEmits({});
|
||||
const taskIndex = ref(-1);
|
||||
const emit = defineEmits(["refresh"]);
|
||||
const dateTime = ref([]);
|
||||
const rulesRef = ref({
|
||||
voteName: [
|
||||
@@ -179,22 +182,24 @@ const rulesRef = ref({
|
||||
],
|
||||
});
|
||||
|
||||
const { validate } = Form.useForm(formData, rulesRef);
|
||||
const { validate } = Form.useForm(formData.info, rulesRef);
|
||||
// 关闭弹窗
|
||||
const closeDrawer = () => {
|
||||
if (step.value > 1) {
|
||||
step.value = step.value - 1;
|
||||
} else {
|
||||
visible.value = false;
|
||||
taskIndex.value = -1;
|
||||
dateTime.value = [];
|
||||
formData.reset();
|
||||
formData.value.info = {
|
||||
voteStemDtoList:[]
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
function timeChange(time, timeStr) {
|
||||
formData.value.voteStartTime = timeStr[0];
|
||||
formData.value.voteEndTime = timeStr[1];
|
||||
formData.value.info.voteStartTime = timeStr[0];
|
||||
formData.value.info.voteEndTime = timeStr[1];
|
||||
}
|
||||
|
||||
const disabledDate = (current) => {
|
||||
@@ -206,43 +211,42 @@ async function confirm() {
|
||||
message.warning(errorFields[0].errors.join());
|
||||
throw Error("数据校验不通过");
|
||||
});
|
||||
if (taskIndex.value === -1) {
|
||||
const list = props.taskList;
|
||||
list.push({
|
||||
name: formData.value.voteName,
|
||||
type: props.type,
|
||||
duration: dayjs(formData.value.voteEndTime).diff(
|
||||
formData.value.voteStartTime,
|
||||
"minutes"
|
||||
),
|
||||
info: { ...formData.value },
|
||||
});
|
||||
} else {
|
||||
const data = props.taskList[taskIndex.value];
|
||||
data.name = formData.value.voteName;
|
||||
data.info = { ...formData.value };
|
||||
data.duration = dayjs(formData.value.voteEndTime).diff(
|
||||
formData.value.voteStartTime,
|
||||
"minutes"
|
||||
);
|
||||
}
|
||||
emit("update:taskList", [...props.taskList]);
|
||||
closeDrawer();
|
||||
|
||||
// 专业力ID
|
||||
formData.value.growthId = props.growId;
|
||||
// 任务类型
|
||||
formData.value.taskType = props.type;
|
||||
// 必修/选修
|
||||
formData.value.type = props.activeKey;
|
||||
// 任务名称
|
||||
formData.value.taskName = formData.value.info.voteName;
|
||||
saveTask(formData.value).then((res) => {
|
||||
if (res.data.code == 200) {
|
||||
if (formData.value.id) {
|
||||
message.success("编辑成功");
|
||||
} else {
|
||||
message.success("添加成功");
|
||||
}
|
||||
emit("refresh");
|
||||
} else {
|
||||
message.error(res.msg);
|
||||
}
|
||||
closeDrawer();
|
||||
});
|
||||
}
|
||||
|
||||
function openDrawer(i, row) {
|
||||
row && (formData.value = { ...row.info });
|
||||
function openDrawer(row) {
|
||||
row && (formData.value = row);
|
||||
row &&
|
||||
(dateTime.value = [
|
||||
dayjs(row.info.voteStartTime, "YYYY-MM-DD HH:mm"),
|
||||
dayjs(row.info.voteEndTime, "YYYY-MM-DD HH:mm"),
|
||||
]);
|
||||
i >= 0 && (taskIndex.value = i);
|
||||
visible.value = true;
|
||||
}
|
||||
|
||||
function handleDel() {
|
||||
formData.value.voteStemDtoList = [];
|
||||
formData.value.info.voteStemDtoList = [];
|
||||
}
|
||||
|
||||
defineExpose({ openDrawer });
|
||||
|
||||
Reference in New Issue
Block a user