mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-14 05:16:45 +08:00
提交
This commit is contained in:
@@ -185,7 +185,7 @@ function confirm() {
|
||||
name: selectsData.value[0].title,
|
||||
type: props.type,
|
||||
courseId: selectsData.value[0].id,
|
||||
info: selectsData.value[0]
|
||||
info: {...selectsData.value[0]}
|
||||
})
|
||||
} else {
|
||||
const data = props.taskList[taskIndex.value]
|
||||
|
||||
@@ -168,7 +168,7 @@ async function confirm() {
|
||||
});
|
||||
if (taskIndex.value === -1) {
|
||||
const list = props.taskList
|
||||
list.push({name: formData.value.evaluationName, type: props.type, info: formData.value})
|
||||
list.push({name: formData.value.evaluationName, type: props.type, info: {...formData.value}})
|
||||
} else {
|
||||
const data = props.taskList[taskIndex.value]
|
||||
data.name = formData.value.evaluationName
|
||||
|
||||
@@ -134,7 +134,7 @@ const disabledRangeTime = () => ({
|
||||
function confirm() {
|
||||
if (taskIndex.value === -1) {
|
||||
const list = props.taskList
|
||||
list.push({name: formData.value.workName, type: props.type, info: formData.value})
|
||||
list.push({name: formData.value.workName, type: props.type, info: {...formData.value}})
|
||||
} else {
|
||||
const data = props.taskList[taskIndex.value]
|
||||
data.name = formData.value.workName
|
||||
|
||||
@@ -77,8 +77,9 @@
|
||||
:disabled-time="disabledRangeTime"
|
||||
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"
|
||||
format="YYYY/MM/DD HH:mm"
|
||||
:placeholder="[' 开始时间', ' 结束时间']"
|
||||
/>
|
||||
</div>
|
||||
@@ -433,8 +434,6 @@ const range = (start, end) => {
|
||||
|
||||
function timeChange(time, timeStr) {
|
||||
formData.value.liveStartTime = timeStr[0]
|
||||
formData.value.submitStartTime = timeStr[0]
|
||||
formData.value.submitEndTime = timeStr[1]
|
||||
formData.value.liveEndTime = timeStr[1]
|
||||
}
|
||||
|
||||
@@ -456,6 +455,7 @@ async function confirm() {
|
||||
throw Error("数据校验不通过")
|
||||
});
|
||||
if (taskIndex.value === -1) {
|
||||
<<<<<<< HEAD
|
||||
let list = props.taskList
|
||||
list.push(
|
||||
{name: formData.value.liveName,
|
||||
@@ -463,6 +463,10 @@ async function confirm() {
|
||||
info: {...formData.value}
|
||||
})
|
||||
console.log("list:" + list)
|
||||
=======
|
||||
const list = props.taskList
|
||||
list.push({name: formData.value.liveName, type: props.type, info: {...formData.value}})
|
||||
>>>>>>> aa76caecde0cba165ddb01f060970317f34071b3
|
||||
} else {
|
||||
const data = props.taskList[taskIndex.value]
|
||||
data.name = formData.value.liveName
|
||||
@@ -474,7 +478,7 @@ async function confirm() {
|
||||
|
||||
function openDrawer(i, row) {
|
||||
row && (formData.value = {...row.info});
|
||||
row && (dateTime.value = [dayjs(row.info.submitStartTime, "YYYY-MM-DD HH:mm"), dayjs(row.info.submitEndTime, "YYYY-MM-DD HH:mm")]);
|
||||
row && (dateTime.value = [row.info.liveStartTime, row.info.liveEndTime]);
|
||||
(i >= 0) && (taskIndex.value = i)
|
||||
visible.value = true
|
||||
}
|
||||
|
||||
@@ -118,7 +118,7 @@ function confirm() {
|
||||
name: selectsData.value[0].name,
|
||||
type: props.type,
|
||||
courseId: selectsData.value[0].id,
|
||||
info: selectsData.value[0]
|
||||
info: {...selectsData.value[0]}
|
||||
})
|
||||
} else {
|
||||
const data = props.taskList[taskIndex.value]
|
||||
|
||||
@@ -311,7 +311,7 @@ function confirm() {
|
||||
name: selectsData.value[0].name,
|
||||
type: props.type,
|
||||
courseId: selectsData.value[0].id,
|
||||
info: selectsData.value[0]
|
||||
info: {...selectsData.value[0]}
|
||||
})
|
||||
} else {
|
||||
const data = props.taskList[taskIndex.value]
|
||||
|
||||
@@ -450,7 +450,7 @@ function confirm() {
|
||||
}
|
||||
if (taskIndex.value === -1) {
|
||||
const list = props.taskList
|
||||
list.push({name: formData.value.examinationName, type: props.type, info: formData.value})
|
||||
list.push({name: formData.value.examinationName, type: props.type, info: {...formData.value}})
|
||||
} else {
|
||||
const data = props.taskList[taskIndex.value]
|
||||
data.name = formData.value.examinationName
|
||||
@@ -474,7 +474,7 @@ function confirmouter() {
|
||||
|
||||
if (taskIndex.value === -1) {
|
||||
const list = props.taskList
|
||||
list.push({name: formDataOuter.value.examinationName, type: props.type, info: formDataOuter.value})
|
||||
list.push({name: formDataOuter.value.examinationName, type: props.type, info: {...formDataOuter.value}})
|
||||
} else {
|
||||
const data = props.taskList[taskIndex.value]
|
||||
data.name = formDataOuter.value.examinationName
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
<div class="main_item">
|
||||
<div class="fi_input">
|
||||
<a-input
|
||||
v-model:value="params.assessmentName"
|
||||
style="width: 424px; height: 40px; border-radius: 8px"
|
||||
placeholder="请输入评估名称"
|
||||
maxlength="20"
|
||||
v-model:value="params.assessmentName"
|
||||
style="width: 424px; height: 40px; border-radius: 8px"
|
||||
placeholder="请输入评估名称"
|
||||
maxlength="20"
|
||||
/>
|
||||
</div>
|
||||
<div class="btns" @click="search">
|
||||
@@ -20,41 +20,39 @@
|
||||
</div>
|
||||
|
||||
<div class="main_item">
|
||||
<button class="xkbtn" @click="goResearchmanage">
|
||||
新建评估
|
||||
</button>
|
||||
<button class="xkbtn" @click="goResearchmanage">新建评估</button>
|
||||
</div>
|
||||
|
||||
<div class="main_notice" style="display:none;">
|
||||
<div class="main_notice" style="display: none">
|
||||
<div class="mntc_left">
|
||||
<div class="notice_icon"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="main_table">
|
||||
<a-table
|
||||
:customRow="customRow"
|
||||
class="ant-table-striped"
|
||||
:row-class-name="(_, index) => (index % 2 === 1 ? 'table-striped' : null)"
|
||||
row-key="id"
|
||||
:columns="columns"
|
||||
:data-source="data"
|
||||
:loading="loading"
|
||||
:pagination="pagination"
|
||||
:row-selection="rowSelection"
|
||||
:customRow="customRow"
|
||||
class="ant-table-striped"
|
||||
:row-class-name="(_, index) => (index % 2 === 1 ? 'table-striped' : null)"
|
||||
row-key="id"
|
||||
:columns="columns"
|
||||
:data-source="data"
|
||||
:loading="loading"
|
||||
:pagination="pagination"
|
||||
:row-selection="rowSelection"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
<script setup>
|
||||
import {computed, defineEmits, defineProps, ref, watch} from "vue";
|
||||
import {useRouter} from "vue-router";
|
||||
import {useRowsPage} from "@/api/request";
|
||||
import {ASSESSMENT_PAGE} from "@/api/apis";
|
||||
import { computed, defineEmits, defineProps, ref, watch } from "vue";
|
||||
import { useRouter } from "vue-router";
|
||||
import { useRowsPage } from "@/api/request";
|
||||
import { ASSESSMENT_PAGE } from "@/api/apis";
|
||||
|
||||
const props = defineProps({
|
||||
id: String,
|
||||
name: String
|
||||
})
|
||||
const emit = defineEmits([])
|
||||
name: String,
|
||||
});
|
||||
const emit = defineEmits([]);
|
||||
const columns = ref([
|
||||
{
|
||||
title: "名称",
|
||||
@@ -71,11 +69,17 @@ const columns = ref([
|
||||
align: "center",
|
||||
ellipsis: true,
|
||||
customRender: (text) => {
|
||||
return (
|
||||
<div class="racona">
|
||||
<span> {text.record.essayQuestionVoList.length + text.record.multipleStemVoList.length + text.record.scoringQuestionVoList.length + text.record.singleStemVoList.length}</span>
|
||||
</div>
|
||||
);
|
||||
return (
|
||||
<div class="racona">
|
||||
<span>
|
||||
{" "}
|
||||
{text.record.essayQuestionVoList.length +
|
||||
text.record.multipleStemVoList.length +
|
||||
text.record.scoringQuestionVoList.length +
|
||||
text.record.singleStemVoList.length}
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -94,38 +98,45 @@ const columns = ref([
|
||||
align: "center",
|
||||
ellipsis: true,
|
||||
},
|
||||
])
|
||||
]);
|
||||
const initParams = {
|
||||
assessmentName: '',
|
||||
assessmentName: "",
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
}
|
||||
const router = useRouter()
|
||||
const params = ref(initParams)
|
||||
releaseStatus: 2,
|
||||
};
|
||||
const router = useRouter();
|
||||
const params = ref(initParams);
|
||||
|
||||
const rowSelectKeys = ref([]);
|
||||
const selectsData = ref([]);
|
||||
|
||||
const {data, loading, total, fetch} = useRowsPage(ASSESSMENT_PAGE, params.value)
|
||||
console.log(data)
|
||||
watch(()=>props.id, () => {
|
||||
if (props.id) {
|
||||
rowSelectKeys.value = [props.id]
|
||||
selectsData.value = [{id: props.id, assessmentName: props.name}]
|
||||
} else {
|
||||
rowSelectKeys.value = []
|
||||
selectsData.value = []
|
||||
const { data, loading, total, fetch } = useRowsPage(
|
||||
ASSESSMENT_PAGE,
|
||||
params.value
|
||||
);
|
||||
console.log(data);
|
||||
watch(
|
||||
() => props.id,
|
||||
() => {
|
||||
if (props.id) {
|
||||
rowSelectKeys.value = [props.id];
|
||||
selectsData.value = [{ id: props.id, assessmentName: props.name }];
|
||||
} else {
|
||||
rowSelectKeys.value = [];
|
||||
selectsData.value = [];
|
||||
}
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
const customRow = (record) => ({
|
||||
onClick: () => {
|
||||
rowSelectKeys.value = [record.id]
|
||||
selectsData.value = [record]
|
||||
emit('update:id', selectsData.value[0].id)
|
||||
emit('update:name', selectsData.value[0].assessmentName)
|
||||
}
|
||||
})
|
||||
rowSelectKeys.value = [record.id];
|
||||
selectsData.value = [record];
|
||||
emit("update:id", selectsData.value[0].id);
|
||||
emit("update:name", selectsData.value[0].assessmentName);
|
||||
},
|
||||
});
|
||||
|
||||
const pagination = computed(() => ({
|
||||
total: total.value,
|
||||
@@ -137,10 +148,10 @@ const pagination = computed(() => ({
|
||||
|
||||
const changePagination = (e) => {
|
||||
params.value.pageIndex = e;
|
||||
fetch()
|
||||
fetch();
|
||||
};
|
||||
const rowSelection = computed(() => ({
|
||||
type: 'radio',
|
||||
type: "radio",
|
||||
columnWidth: 20,
|
||||
selectedRowKeys: rowSelectKeys.value,
|
||||
onChange: onSelectChange,
|
||||
@@ -150,27 +161,26 @@ const rowSelection = computed(() => ({
|
||||
function onSelectChange(e, l) {
|
||||
rowSelectKeys.value = e;
|
||||
selectsData.value = l;
|
||||
emit('update:id', selectsData.value[0].id)
|
||||
emit('update:name', selectsData.value[0].assessmentName)
|
||||
emit("update:id", selectsData.value[0].id);
|
||||
emit("update:name", selectsData.value[0].assessmentName);
|
||||
}
|
||||
|
||||
function search() {
|
||||
params.value.pageIndex = 1
|
||||
fetch()
|
||||
params.value.pageIndex = 1;
|
||||
fetch();
|
||||
}
|
||||
|
||||
function reset() {
|
||||
rowSelectKeys.value = [];
|
||||
selectsData.value = [];
|
||||
params.value.pageIndex = 1
|
||||
params.value.keyWord = ''
|
||||
fetch()
|
||||
params.value.pageIndex = 1;
|
||||
params.value.keyWord = "";
|
||||
fetch();
|
||||
}
|
||||
|
||||
const goResearchmanage = () => {
|
||||
router.push({path: "/researchmanage"});
|
||||
}
|
||||
|
||||
router.push({ path: "/researchmanage" });
|
||||
};
|
||||
</script>
|
||||
<style lang="scss">
|
||||
.xkbtn {
|
||||
@@ -315,8 +325,8 @@ const goResearchmanage = () => {
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
|
||||
|
||||
@@ -200,7 +200,7 @@ function confirm() {
|
||||
name: selectsData.value[0].title,
|
||||
type: 3,
|
||||
courseId: selectsData.value[0].id,
|
||||
info: selectsData.value[0]
|
||||
info: {...selectsData.value[0]}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import activityImg from '@/assets/images/leveladd/huo.png'
|
||||
import testImg from '@/assets/images/leveladd/ce.png'
|
||||
import evaImg from '@/assets/images/leveladd/diao.png'
|
||||
import voteImg from '@/assets/images/leveladd/tou.png'
|
||||
import projectImg from '@/assets/images/leveladd/xiang.png'
|
||||
// import projectImg from '@/assets/images/leveladd/xiang.png'
|
||||
|
||||
import AddOnline from "@/components/drawers/AddOnline.vue";
|
||||
import AddCase from "@/components/drawers/AddCase.vue";
|
||||
@@ -23,7 +23,7 @@ import AddInvist from "@/components/drawers/AddInvist.vue";
|
||||
import AddVote from "@/components/vote/AddVote.vue";
|
||||
import AddLive from "@/components/drawers/AddLive.vue";
|
||||
import AddRef from "@/components/drawers/AddRef.vue";
|
||||
import AddProject from "@/components/drawers/AddProject.vue";
|
||||
// import AddProject from "@/components/drawers/AddProject.vue";
|
||||
// import AddFaceteach from "@/components/drawers/AddFaceteach.vue";
|
||||
|
||||
export const TASK_TYPE = {
|
||||
@@ -87,9 +87,9 @@ export const TASK_TYPE = {
|
||||
img: voteImg,
|
||||
component: AddVote
|
||||
},
|
||||
13: {
|
||||
name: '项目',
|
||||
img: projectImg,
|
||||
component: AddProject
|
||||
},
|
||||
// 13: {
|
||||
// name: '项目',
|
||||
// img: projectImg,
|
||||
// component: AddProject
|
||||
// },
|
||||
}
|
||||
@@ -329,8 +329,11 @@
|
||||
<div
|
||||
@click="showFaceStuSignUp"
|
||||
class="editright"
|
||||
style="margin-right:130px;cursor: pointer;">
|
||||
<span class="editextb" style="margin-left:0px;">批量面授报名</span>
|
||||
style="margin-right: 130px; cursor: pointer"
|
||||
>
|
||||
<span class="editextb" style="margin-left: 0px"
|
||||
>批量面授报名</span
|
||||
>
|
||||
</div>
|
||||
<router-link
|
||||
:to="{ path: '/leveladddetail', query: { routerId: routerId } }"
|
||||
@@ -410,7 +413,8 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
">
|
||||
"
|
||||
>
|
||||
<img
|
||||
:src="
|
||||
item.type == 1
|
||||
@@ -542,7 +546,11 @@
|
||||
: item.type === 4
|
||||
? homeworkModel(item)
|
||||
: item.type === 5
|
||||
? examinationModel(item, value.name, value.chapterId)
|
||||
? examinationModel(
|
||||
item,
|
||||
value.name,
|
||||
value.chapterId
|
||||
)
|
||||
: item.type === 10
|
||||
? evaluationModel(item, value.name)
|
||||
: item.type === 12
|
||||
@@ -1424,7 +1432,9 @@ export default {
|
||||
hasTask: false,
|
||||
stage: [],
|
||||
statess: [],
|
||||
routerId: route.query.routerId?route.query.routerId:localStorage.getItem('routerId'), //学习路径页面传的学习路径id
|
||||
routerId: route.query.routerId
|
||||
? route.query.routerId
|
||||
: localStorage.getItem("routerId"), //学习路径页面传的学习路径id
|
||||
gatename: null, //关卡名称
|
||||
gatenamee: null, //学员管理关卡名称
|
||||
action: null,
|
||||
@@ -1595,7 +1605,7 @@ export default {
|
||||
projectModelVisible: false,
|
||||
faceTeachModelVisibleTitle: "",
|
||||
examinationModelVisibleTitle: "",
|
||||
outchapter:"",
|
||||
outchapter: "",
|
||||
evaluationModelVisibleTitle: "",
|
||||
homeworkModelVisibleTitle: "",
|
||||
commonModelVisibleTitle: "",
|
||||
@@ -1625,7 +1635,7 @@ export default {
|
||||
? "http://43.143.139.204:12016/"
|
||||
: location.href.slice(0, location.href.indexOf("/m")) + "/upload/",
|
||||
isreload: true,
|
||||
TaskFaceImpStuvisible: false
|
||||
TaskFaceImpStuvisible: false,
|
||||
});
|
||||
|
||||
const levelList = reactive({
|
||||
@@ -2290,7 +2300,10 @@ export default {
|
||||
state.nodata = false;
|
||||
}
|
||||
let data = res.data.data.chapterList;
|
||||
console.log('----------------111111111111111-----------------2222222222', res.data.data.chapterList)
|
||||
console.log(
|
||||
"----------------111111111111111-----------------2222222222",
|
||||
res.data.data.chapterList
|
||||
);
|
||||
state.stage = res.data.data.chapterList.map((e) => ({
|
||||
id: e.id,
|
||||
name: e.name,
|
||||
@@ -2588,7 +2601,8 @@ export default {
|
||||
return message.error("该任务无法学习,请联系管理员进行替换。");
|
||||
window.open(
|
||||
window.location.protocol +
|
||||
import.meta.env.VITE_BOE_ONLINE_CLASS_URL +
|
||||
import.meta.env.VUE_APP_BOE_API_URL +
|
||||
"/mobile/pages/study/courseStudy?id=" +
|
||||
item.targetId,
|
||||
"_top"
|
||||
);
|
||||
@@ -2831,9 +2845,9 @@ export default {
|
||||
|
||||
// 面授课学员报名弹框
|
||||
const showFaceStuSignUp = () => {
|
||||
console.log('我点击了- 批量面授报名')
|
||||
console.log("我点击了- 批量面授报名");
|
||||
state.TaskFaceImpStuvisible = true;
|
||||
}
|
||||
};
|
||||
|
||||
return {
|
||||
...toRefs(state),
|
||||
@@ -2909,7 +2923,7 @@ export default {
|
||||
selectProjectName4,
|
||||
changeLevel,
|
||||
checkPer,
|
||||
showFaceStuSignUp
|
||||
showFaceStuSignUp,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<div class="header">
|
||||
<span class="title"
|
||||
>{{
|
||||
projectInfo.projectId ? "编辑" : "创建"
|
||||
projectInfo.id ? "编辑" : "创建"
|
||||
}}{{ ptojectType == "3" ? "班级" : "项目" }}</span
|
||||
>
|
||||
<div
|
||||
@@ -49,7 +49,7 @@
|
||||
v-model:validate="projectInfo.validate"
|
||||
:maxlength="30"
|
||||
show-count
|
||||
:id="projectInfo.projectId"
|
||||
:id="projectInfo.id"
|
||||
></NameInput>
|
||||
</div>
|
||||
</div>
|
||||
@@ -98,33 +98,20 @@
|
||||
<div class="inname">项目时间</div>
|
||||
</div>
|
||||
|
||||
<div v-if="projectInfo.projectId" class="in">
|
||||
<div class="in">
|
||||
<a-range-picker
|
||||
separator="至"
|
||||
:show-time="{ format: 'HH:mm' }"
|
||||
:placeholder="[' 开始时间', ' 结束时间']"
|
||||
:disabled-date="disabledDate1"
|
||||
v-model:value="projectInfo.rangeTime"
|
||||
:placeholder="[' 开始时间2', ' 结束时间2']"
|
||||
:disabledDate="disabledDate"
|
||||
v-model:value="timeRange"
|
||||
@calendarChange="calendarChange"
|
||||
style="width: 100%; height: 40px; border-radius: 5px"
|
||||
:allowClear="false"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
valueFormat="YYYY-MM-DD HH:mm"
|
||||
@change="timeChange"
|
||||
@ok="clickOk"
|
||||
@openChange="panelOpen"
|
||||
:disabled="viewDetail ? true : false"
|
||||
/>
|
||||
</div>
|
||||
<div v-else class="in">
|
||||
<a-range-picker
|
||||
separator="至"
|
||||
:show-time="{ format: 'HH:mm' }"
|
||||
:placeholder="[' 开始时间', ' 结束时间']"
|
||||
|
||||
v-model:value="projectInfo.rangeTime"
|
||||
style="width: 100%; height: 40px; border-radius: 5px"
|
||||
valueFormat="YYYY-MM-DD HH:mm"
|
||||
@change="timeChange"
|
||||
:disabled="viewDetail ? true : false"
|
||||
:disabled="!!viewDetail"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -304,7 +291,6 @@ import {message} from "ant-design-vue";
|
||||
import {useRoute, useRouter} from "vue-router";
|
||||
import * as api from "../../api/index";
|
||||
import {useStore} from "vuex";
|
||||
import * as moment from "moment";
|
||||
import TrainClass from "@/components/project/TrainClass";
|
||||
import OrgClass from "@/components/project/OrgClass";
|
||||
import ProjectManager from "@/components/project/ProjectManagerNew";
|
||||
@@ -330,13 +316,14 @@ export default {
|
||||
const routers = useRoute();
|
||||
const router = useRouter();
|
||||
const state = reactive({
|
||||
datePartial: 'start',
|
||||
loading: false,
|
||||
currentPage: 1, //当前页
|
||||
tableDataTotal: -1, //模版列表总数
|
||||
pageSize: 10, //每页10条数据
|
||||
totalPages: 0, //总页数
|
||||
viewDetail: null,
|
||||
projectInfo: {},
|
||||
projectInfo: {id: ''},
|
||||
projectPic: [],
|
||||
memberParam: {
|
||||
pageNo: 1,
|
||||
@@ -349,8 +336,10 @@ export default {
|
||||
ptojectType: "",
|
||||
changeCondition: false,
|
||||
clickNum: 0,
|
||||
timeRange: []
|
||||
});
|
||||
|
||||
|
||||
// 封面图选择
|
||||
const handleChangeSelect = (value) => {
|
||||
console.log(value);
|
||||
@@ -369,7 +358,7 @@ export default {
|
||||
});
|
||||
|
||||
watch(routers.query, () => {
|
||||
state.projectInfo.projectId = routers.query.projectId;
|
||||
state.projectInfo.id = routers.query.id;
|
||||
state.projectInfo.parentName = routers.query.parentName;
|
||||
state.projectInfo.parentId = routers.query.parentId;
|
||||
});
|
||||
@@ -377,12 +366,12 @@ export default {
|
||||
function getProjectInfo() {
|
||||
state.projectInfo.parentName = routers.query.parentName;
|
||||
state.projectInfo.parentId = routers.query.parentId;
|
||||
state.projectInfo.projectId = routers.query.projectId;
|
||||
(state.projectInfo.projectId || state.projectInfo.parentId) &&
|
||||
state.projectInfo.id = routers.query.projectId;
|
||||
(state.projectInfo.id || state.projectInfo.parentId) &&
|
||||
api
|
||||
.getProjectDetail({
|
||||
projectId:
|
||||
state.projectInfo.projectId || state.projectInfo.parentId,
|
||||
state.projectInfo.id || state.projectInfo.parentId,
|
||||
})
|
||||
.then((res) => {
|
||||
state.projectInfo = {
|
||||
@@ -392,22 +381,11 @@ export default {
|
||||
!routers.query.projectId &&
|
||||
!!routers.query.parentId &&
|
||||
(state.projectInfo.name = "");
|
||||
state.projectInfo.rangeTime = [
|
||||
state.projectInfo.beginTime,
|
||||
state.projectInfo.endTime,
|
||||
];
|
||||
|
||||
state.projectInfo.rangeTime1 = [
|
||||
state.projectInfo.beginTime,
|
||||
state.projectInfo.endTime,
|
||||
];
|
||||
|
||||
state.projectInfo.edits = true;
|
||||
|
||||
state.timeRange = [state.projectInfo.beginTime, state.projectInfo.endTime];
|
||||
state.courseSyncFlag = !!state.projectInfo.courseSyncFlag;
|
||||
if (Number(state.projectInfo.status) === -5) {
|
||||
let obj = {
|
||||
project_id: state.projectInfo.projectId,
|
||||
project_id: state.projectInfo.id,
|
||||
type: 1,
|
||||
pageNo: 1,
|
||||
pageSize: 1,
|
||||
@@ -441,7 +419,7 @@ export default {
|
||||
state.projectInfo.projectTemplateId = option.id
|
||||
state.projectInfo.id = ''
|
||||
state.projectInfo.type = 3;
|
||||
state.projectInfo.rangeTime = [dayjs(option.beginTime, "YYYY-MM-DD HH:mm"), dayjs(option.endTime, "YYYY-MM-DD HH:mm")];
|
||||
state.timeRange = [option.beginTime, option.endTime];
|
||||
state.projectInfo.parentName = routers.query.parentName;
|
||||
state.projectInfo.parentId = routers.query.parentId;
|
||||
};
|
||||
@@ -517,7 +495,7 @@ export default {
|
||||
const offName = await validateName({
|
||||
name: state.projectInfo.name,
|
||||
type: 1,
|
||||
id: state.projectInfo.projectId,
|
||||
id: state.projectInfo.id,
|
||||
}).then((res) => {
|
||||
return res.data.data == 1;
|
||||
});
|
||||
@@ -531,7 +509,7 @@ export default {
|
||||
api.createProject(state.projectInfo).then((res) => {
|
||||
state.loading = false;
|
||||
message.destroy();
|
||||
message.success(state.projectInfo.projectId ? "编辑成功" : "创建成功");
|
||||
message.success(state.projectInfo.id ? "编辑成功" : "创建成功");
|
||||
router.push({
|
||||
path: "/taskpage",
|
||||
query: {projectId: res.data.data},
|
||||
@@ -546,44 +524,24 @@ export default {
|
||||
state.projectInfo.sourceBelongFullName = orgName;
|
||||
}
|
||||
|
||||
const clickOk = (e) => {
|
||||
state.clickNum = state.clickNum + 1
|
||||
if (state.clickNum == 2) {
|
||||
state.clickNum = 0
|
||||
state.changeCondition = false;
|
||||
} else {
|
||||
state.changeCondition = true;
|
||||
}
|
||||
console.log(e)
|
||||
}
|
||||
|
||||
const panelOpen = (e) => {
|
||||
console.log(e)
|
||||
if (!e) {
|
||||
state.clickNum = 0
|
||||
state.changeCondition = false;
|
||||
}
|
||||
}
|
||||
|
||||
const disabledDate1 = (current) => {
|
||||
if (state.changeCondition) {
|
||||
return current && current < moment(state.projectInfo.rangeTime[0]).endOf("YYYY-MM-DD HH:mm:ss");
|
||||
} else {
|
||||
return current && current > moment(state.projectInfo.rangeTime1[0]).endOf("YYYY-MM-DD HH:mm:ss")
|
||||
}
|
||||
};
|
||||
|
||||
const disabledDate = (current) => {
|
||||
return current && current < dayjs().startOf("day");
|
||||
//编辑的时候 开始实际只能选当前时间之前的时间
|
||||
if (state.projectInfo.id && state.datePartial === 'start') {
|
||||
return current && current > dayjs(state.timeRange[0]).endOf("YYYY-MM-DD HH:mm");
|
||||
}
|
||||
return current && current < dayjs().endOf('day');
|
||||
};
|
||||
|
||||
function calendarChange(date, dateStr, partial) {
|
||||
state.datePartial = partial
|
||||
}
|
||||
|
||||
return {
|
||||
...toRefs(state),
|
||||
disabledDate,
|
||||
disabledDate1,
|
||||
clickOk,
|
||||
panelOpen,
|
||||
managerChange,
|
||||
calendarChange,
|
||||
timeChange,
|
||||
classificationChange,
|
||||
classificationChange5,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user