mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-manage.git
synced 2025-12-12 04:16:47 +08:00
-- 任务
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
<template>
|
||||
<a-drawer
|
||||
:visible="addprojvisible"
|
||||
class="drawerStyle addonlineDrawer"
|
||||
width="80%"
|
||||
title="添加在线"
|
||||
placement="right"
|
||||
@after-visible-change="afterVisibleChange"
|
||||
:visible="addprojvisible"
|
||||
class="drawerStyle addonlineDrawer"
|
||||
width="80%"
|
||||
title="添加在线"
|
||||
placement="right"
|
||||
@after-visible-change="afterVisibleChange"
|
||||
>
|
||||
<div class="drawerMain">
|
||||
<div class="header">
|
||||
<div v-if="edit" 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">
|
||||
@@ -24,9 +24,9 @@
|
||||
<div class="ipt_name">项目名称:</div>
|
||||
<div class="fi_input">
|
||||
<a-input
|
||||
v-model:value="inputV1"
|
||||
style="width: 240px; height: 40px; border-radius: 8px"
|
||||
placeholder="请输入项目名称"
|
||||
v-model:value="inputV1"
|
||||
style="width: 240px; height: 40px; border-radius: 8px"
|
||||
placeholder="请输入项目名称"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -34,9 +34,9 @@
|
||||
<div class="ipt_name">项目经理:</div>
|
||||
<div class="fi_input">
|
||||
<a-input
|
||||
v-model:value="inputV2"
|
||||
style="width: 240px; height: 40px; border-radius: 8px"
|
||||
placeholder="请输入项目经理"
|
||||
v-model:value="inputV2"
|
||||
style="width: 240px; height: 40px; border-radius: 8px"
|
||||
placeholder="请输入项目经理"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -44,9 +44,9 @@
|
||||
<div class="ipt_name">创建人:</div>
|
||||
<div class="fi_input">
|
||||
<a-input
|
||||
v-model:value="inputV3"
|
||||
style="width: 240px; height: 40px; border-radius: 8px"
|
||||
placeholder="请输入创建人"
|
||||
v-model:value="inputV3"
|
||||
style="width: 240px; height: 40px; border-radius: 8px"
|
||||
placeholder="请输入创建人"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -67,7 +67,7 @@
|
||||
<div class="notice_icon"></div>
|
||||
<div v-if="selectedRows.length == 0">
|
||||
<span class="title"
|
||||
>已选择
|
||||
>已选择
|
||||
<span class="data" style="color: #4ea6ff">{{ 0 }}</span>
|
||||
条</span
|
||||
>
|
||||
@@ -75,41 +75,41 @@
|
||||
<div v-else>
|
||||
<div>
|
||||
<span class="title"
|
||||
>已选择
|
||||
>已选择
|
||||
<span class="data" style="color: #4ea6ff">{{
|
||||
selectedRows.length
|
||||
}}</span>
|
||||
selectedRows.length
|
||||
}}</span>
|
||||
条 </span
|
||||
>
|
||||
<span class="title"
|
||||
>名称:
|
||||
>名称:
|
||||
<span
|
||||
class="data"
|
||||
style="color: #4ea6ff; margin-right: 15px"
|
||||
>{{ selectedRows[0].name }}</span
|
||||
class="data"
|
||||
style="color: #4ea6ff; margin-right: 15px"
|
||||
>{{ selectedRows[0].name }}</span
|
||||
>
|
||||
</span>
|
||||
<span class="title"
|
||||
>项目经理:
|
||||
>项目经理:
|
||||
<span
|
||||
class="data"
|
||||
style="color: #4ea6ff; margin-right: 15px"
|
||||
>{{ selectedRows[0].manager }}</span
|
||||
class="data"
|
||||
style="color: #4ea6ff; margin-right: 15px"
|
||||
>{{ selectedRows[0].manager }}</span
|
||||
>
|
||||
</span>
|
||||
<span class="title"
|
||||
>创建人:
|
||||
>创建人:
|
||||
<span
|
||||
class="data"
|
||||
style="color: #4ea6ff; margin-right: 15px"
|
||||
>{{ selectedRows[0].creater }}</span
|
||||
class="data"
|
||||
style="color: #4ea6ff; margin-right: 15px"
|
||||
>{{ selectedRows[0].creater }}</span
|
||||
>
|
||||
</span>
|
||||
<span class="title"
|
||||
>创建时间:
|
||||
>创建时间:
|
||||
<span class="data" style="color: #4ea6ff">{{
|
||||
selectedRows[0].time
|
||||
}}</span>
|
||||
selectedRows[0].time
|
||||
}}</span>
|
||||
</span>
|
||||
</div>
|
||||
<!-- <div v-else>
|
||||
@@ -142,33 +142,33 @@
|
||||
<div class="drawerbox">
|
||||
<!-- 添加的时候显示多选的表 -->
|
||||
<a-table
|
||||
v-if="!edit"
|
||||
:columns="tableDataFunc()"
|
||||
:data-source="drawertableData"
|
||||
:row-selection="{
|
||||
v-if="!edit"
|
||||
:columns="tableDataFunc()"
|
||||
:data-source="drawertableData"
|
||||
:row-selection="{
|
||||
selectedRowKeys: selectedRowKeys,
|
||||
onChange: onSelectChange,
|
||||
}"
|
||||
:loading="tableDataTotal === -1 ? true : false"
|
||||
:scroll="{ x: 700 }"
|
||||
@expand="expandTable"
|
||||
:pagination="false"
|
||||
:loading="tableDataTotal === -1 ? true : false"
|
||||
:scroll="{ x: 700 }"
|
||||
@expand="expandTable"
|
||||
:pagination="false"
|
||||
>
|
||||
</a-table>
|
||||
<!-- 编辑的时候显示单选的表 -->
|
||||
<a-table
|
||||
v-else
|
||||
:columns="tableDataFunc()"
|
||||
:data-source="drawertableData"
|
||||
:row-selection="{
|
||||
v-else
|
||||
:columns="tableDataFunc()"
|
||||
:data-source="drawertableData"
|
||||
:row-selection="{
|
||||
selectedRowKeys: selectedRowKeys,
|
||||
onChange: onSelectChange,
|
||||
type: 'radio',
|
||||
}"
|
||||
:loading="tableDataTotal === -1 ? true : false"
|
||||
:scroll="{ x: 700 }"
|
||||
@expand="expandTable"
|
||||
:pagination="false"
|
||||
:loading="tableDataTotal === -1 ? true : false"
|
||||
:scroll="{ x: 700 }"
|
||||
@expand="expandTable"
|
||||
:pagination="false"
|
||||
>
|
||||
</a-table>
|
||||
</div>
|
||||
@@ -181,11 +181,11 @@
|
||||
</div>
|
||||
<!-- 有重复添加的项目时的弹窗 -->
|
||||
<a-modal
|
||||
v-model:visible="sameModal"
|
||||
:footer="null"
|
||||
:closable="sameCopy"
|
||||
wrapClassName="sameModal"
|
||||
centered="true"
|
||||
v-model:visible="sameModal"
|
||||
:footer="null"
|
||||
:closable="sameCopy"
|
||||
wrapClassName="sameModal"
|
||||
centered="true"
|
||||
>
|
||||
<div class="delete">
|
||||
<div class="del_header"></div>
|
||||
@@ -212,11 +212,12 @@
|
||||
</a-drawer>
|
||||
</template>
|
||||
<script>
|
||||
import { reactive, toRefs } from "vue";
|
||||
import { RouterEditTask } from "@/api/indexTask";
|
||||
import { message } from "ant-design-vue";
|
||||
import {reactive, toRefs} from "vue";
|
||||
import {RouterEditTask} from "@/api/indexTask";
|
||||
import {message} from "ant-design-vue";
|
||||
import * as apiProj from "../../api/index.js";
|
||||
import dayjs from "dayjs";
|
||||
|
||||
export default {
|
||||
name: "AddProject",
|
||||
props: {
|
||||
@@ -328,7 +329,7 @@ export default {
|
||||
const closeDrawer = () => {
|
||||
ctx.emit("update:addprojvisible", false);
|
||||
ctx.emit("update:edit", false);
|
||||
|
||||
|
||||
state.selectedRows = [];
|
||||
state.selectedRowKeys = [];
|
||||
};
|
||||
@@ -370,27 +371,27 @@ export default {
|
||||
//获取全部项目信息接口
|
||||
const getAllProjText = () => {
|
||||
apiProj
|
||||
.getProjectList({
|
||||
createName: state.inputV1,
|
||||
manager: state.inputV2,
|
||||
name: state.inputV3,
|
||||
pageNo: state.currentPage,
|
||||
pageSize: state.pageSize,
|
||||
status: state.status,
|
||||
})
|
||||
.then((res) => {
|
||||
let arr = res.data.data.rows;
|
||||
if (res.status === 200) {
|
||||
state.drawertableData = getTableDate(arr);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
message.destroy();
|
||||
//message.error("获取全部项目信息接口失败");
|
||||
});
|
||||
.getProjectList({
|
||||
createName: state.inputV1,
|
||||
manager: state.inputV2,
|
||||
name: state.inputV3,
|
||||
pageNo: state.currentPage,
|
||||
pageSize: state.pageSize,
|
||||
status: state.status,
|
||||
})
|
||||
.then((res) => {
|
||||
let arr = res.data.data.rows;
|
||||
if (res.status === 200) {
|
||||
state.drawertableData = getTableDate(arr);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
message.destroy();
|
||||
//message.error("获取全部项目信息接口失败");
|
||||
});
|
||||
};
|
||||
const afterVisibleChange = (bool) => {
|
||||
|
||||
|
||||
if (bool) {
|
||||
getAllProjText();
|
||||
}
|
||||
@@ -435,12 +436,12 @@ export default {
|
||||
state.selectedRows.forEach((item) => {
|
||||
let origin = JSON.parse(props.chooseProjectList);
|
||||
console.log("ccxx", origin);
|
||||
if(origin==null){
|
||||
closeSameModal();
|
||||
closeDrawer();
|
||||
message.destroy();
|
||||
message.info("添加成功");
|
||||
return;
|
||||
if (origin == null) {
|
||||
closeSameModal();
|
||||
closeDrawer();
|
||||
message.destroy();
|
||||
message.info("添加成功");
|
||||
return;
|
||||
}
|
||||
if (origin.length == 0) {
|
||||
//可以直接添加到任务列表里
|
||||
@@ -464,9 +465,9 @@ export default {
|
||||
});
|
||||
};
|
||||
|
||||
const updateTask = (res) => {
|
||||
const updateTask = async (res) => {
|
||||
if (props.isLevel == 1) {
|
||||
RouterEditTask({
|
||||
await RouterEditTask({
|
||||
chapterId: props.isactive,
|
||||
courseId: res.key,
|
||||
name: res.name,
|
||||
@@ -474,13 +475,13 @@ export default {
|
||||
routerTaskId: props.routerTaskId || 0,
|
||||
type: 13,
|
||||
})
|
||||
.then(() => {
|
||||
message.success(`${props.edit ? "编辑" : "新增"}关卡任务成功`);
|
||||
closeDrawer();
|
||||
})
|
||||
.catch(() => {
|
||||
message.error(`${props.edit ? "编辑" : "新增"}关卡任务失败`);
|
||||
});
|
||||
.then(() => {
|
||||
message.success(`${props.edit ? "编辑" : "新增"}关卡任务成功`);
|
||||
closeDrawer();
|
||||
})
|
||||
.catch(() => {
|
||||
message.error(`${props.edit ? "编辑" : "新增"}关卡任务失败`);
|
||||
});
|
||||
}
|
||||
};
|
||||
const onSelectChange = (selectedRowKeys, selectRow) => {
|
||||
@@ -496,11 +497,13 @@ export default {
|
||||
state.sameProj = null;
|
||||
state.sameModal = false;
|
||||
};
|
||||
const sureSameModal = () => {
|
||||
const sureSameModal = async () => {
|
||||
// updateTask(state.sameProj);
|
||||
state.selectedRows.forEach((item) => {
|
||||
updateTask(item);
|
||||
});
|
||||
if (state.selectedRows && state.selectedRows.length) {
|
||||
for (const item in state.selectedRows) {
|
||||
await updateTask(item);
|
||||
}
|
||||
}
|
||||
state.sameProj = null;
|
||||
state.sameModal = false;
|
||||
closeDrawer();
|
||||
@@ -530,17 +533,21 @@ export default {
|
||||
.ant-table-striped :deep(.table-striped) td {
|
||||
background-color: #fafafa !important;
|
||||
}
|
||||
|
||||
.sameModal {
|
||||
.ant-modal {
|
||||
width: 424px !important;
|
||||
height: 258px !important;
|
||||
|
||||
.ant-modal-content {
|
||||
width: 424px !important;
|
||||
height: 258px !important;
|
||||
|
||||
.ant-modal-body {
|
||||
width: 424px !important;
|
||||
height: 258px !important;
|
||||
padding: 0 !important;
|
||||
|
||||
.delete {
|
||||
z-index: 999;
|
||||
width: 424px;
|
||||
@@ -557,19 +564,22 @@ export default {
|
||||
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%
|
||||
);
|
||||
}
|
||||
|
||||
.del_main {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-top: 20px;
|
||||
padding-left: 26px;
|
||||
font-size: 16px;
|
||||
|
||||
.icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
@@ -577,6 +587,7 @@ export default {
|
||||
background-image: url(@/assets/images/taskpage/gan.png);
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
|
||||
.close_exit {
|
||||
position: absolute;
|
||||
right: 42px;
|
||||
@@ -587,6 +598,7 @@ export default {
|
||||
background-size: 100% 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.body {
|
||||
width: 100%;
|
||||
margin: 34px auto 56px auto;
|
||||
@@ -596,6 +608,7 @@ export default {
|
||||
flex-direction: column;
|
||||
// background-color: red;
|
||||
position: relative;
|
||||
|
||||
.back {
|
||||
position: absolute;
|
||||
top: 30px;
|
||||
@@ -604,10 +617,12 @@ export default {
|
||||
color: #666666;
|
||||
}
|
||||
}
|
||||
|
||||
.del_btnbox {
|
||||
display: flex;
|
||||
margin: 30px auto;
|
||||
justify-content: center;
|
||||
|
||||
.del_btn {
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
@@ -619,17 +634,20 @@ export default {
|
||||
|
||||
flex-shrink: 0;
|
||||
cursor: pointer;
|
||||
|
||||
.btnText {
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
line-height: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
.btn1 {
|
||||
border: 1px solid rgba(64, 158, 255, 1);
|
||||
color: #4ea6ff;
|
||||
margin-right: 14px;
|
||||
}
|
||||
|
||||
.btn2 {
|
||||
background-color: #4ea6ff;
|
||||
color: #ffffff;
|
||||
@@ -641,6 +659,7 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.addrefDrawer {
|
||||
.drawerMain {
|
||||
// .main_notice {
|
||||
@@ -680,6 +699,7 @@ export default {
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-shrink: 0;
|
||||
|
||||
.headerTitle {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
@@ -688,35 +708,43 @@ export default {
|
||||
margin-left: 24px;
|
||||
}
|
||||
}
|
||||
|
||||
.contentMain {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
.main_left {
|
||||
margin-top: 32px;
|
||||
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;
|
||||
|
||||
.sign {
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.btnbox {
|
||||
display: flex;
|
||||
flex: 1;
|
||||
align-items: center;
|
||||
|
||||
.ant-input {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.xkbtn {
|
||||
cursor: pointer;
|
||||
width: 130px;
|
||||
@@ -729,32 +757,40 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.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;
|
||||
}
|
||||
@@ -762,6 +798,7 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.main_btns {
|
||||
height: 72px;
|
||||
width: 100%;
|
||||
@@ -771,6 +808,7 @@ export default {
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
box-shadow: 0px 1px 35px 0px rgba(118, 136, 166, 0.16);
|
||||
|
||||
.btn1 {
|
||||
width: 100px;
|
||||
height: 40px;
|
||||
@@ -780,6 +818,7 @@ export default {
|
||||
background-color: #fff;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.btn2 {
|
||||
cursor: pointer;
|
||||
width: 100px;
|
||||
|
||||
Reference in New Issue
Block a user