mirror of
https://github.com/FatttSnake/Pinnacle-OA.git
synced 2026-04-04 22:41:24 +08:00
temp 2023/5/3
This commit is contained in:
@@ -52,18 +52,23 @@ public class WorkController {
|
||||
|
||||
@PostMapping
|
||||
public ResponseResult addWork(@RequestBody Work work) {
|
||||
System.out.println(work);
|
||||
return ResponseResult.build(ResponseCode.DATABASE_SAVE_OK, "success", workService.addWork(work));
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
public ResponseResult deleteById(@PathVariable long id) {
|
||||
public ResponseResult deleteById(@PathVariable Long id) {
|
||||
System.out.println(id);
|
||||
return ResponseResult.build(ResponseCode.DATABASE_DELETE_OK, "success", workService.deleteByWorkId(id));
|
||||
}
|
||||
|
||||
@PutMapping("/setComplete")
|
||||
public ResponseResult updateWork(@RequestBody UserWork userWork) {
|
||||
return ResponseResult.build(ResponseCode.DATABASE_DELETE_OK, "success", userWorkService.updateById(userWork));
|
||||
@PutMapping("/setStatus")
|
||||
public ResponseResult updateStatus(@RequestBody UserWork userWork) {
|
||||
System.out.println(userWork);
|
||||
return ResponseResult.build(ResponseCode.DATABASE_UPDATE_OK, "success", workService.updateStatus(userWork));
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
public ResponseResult updateWork(@RequestBody Work work) {
|
||||
return ResponseResult.build(ResponseCode.DATABASE_UPDATE_OK, "success", workService.updateWork(work));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,6 +9,8 @@ import com.baomidou.mybatisplus.annotation.Version;
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
@@ -29,6 +31,7 @@ public class User implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId("id")
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.cfive.pinnacle.service;
|
||||
|
||||
import com.cfive.pinnacle.entity.UserWork;
|
||||
import com.cfive.pinnacle.entity.Work;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
@@ -23,4 +24,8 @@ public interface IWorkService extends IService<Work> {
|
||||
String getUserName(Long userId);
|
||||
boolean addWork(Work work);
|
||||
boolean deleteByWorkId(Long wid);
|
||||
|
||||
boolean updateStatus(UserWork userWork);
|
||||
|
||||
boolean updateWork(Work work);
|
||||
}
|
||||
|
||||
@@ -17,5 +17,4 @@ import org.springframework.stereotype.Service;
|
||||
@Service
|
||||
public class UserWorkServiceImpl extends ServiceImpl<UserWorkMapper, UserWork> implements IUserWorkService {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.cfive.pinnacle.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.cfive.pinnacle.entity.User;
|
||||
import com.cfive.pinnacle.entity.UserWork;
|
||||
import com.cfive.pinnacle.entity.Work;
|
||||
@@ -43,12 +44,22 @@ public class WorkServiceImpl extends ServiceImpl<WorkMapper, Work> implements IW
|
||||
|
||||
@Override
|
||||
public List<Work> getTodo(Long userId) {
|
||||
return workMapper.getTodo(userId);
|
||||
List<Work> workList = workMapper.getTodo(userId);
|
||||
for (Work work:
|
||||
workList) {
|
||||
work.setPublisherName(getUserName(work.getPublisherId()));
|
||||
}
|
||||
return workList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Work> getComplete(Long userId) {
|
||||
return workMapper.getComplete(userId);
|
||||
List<Work> workList = workMapper.getComplete(userId);
|
||||
for (Work work:
|
||||
workList) {
|
||||
work.setPublisherName(getUserName(work.getPublisherId()));
|
||||
}
|
||||
return workList;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -67,9 +78,9 @@ public class WorkServiceImpl extends ServiceImpl<WorkMapper, Work> implements IW
|
||||
|
||||
@Override
|
||||
public boolean addWork(Work work) {
|
||||
boolean flag = false;
|
||||
if (workMapper.insert(work) > 0) {
|
||||
flag = true;
|
||||
boolean flag = true;
|
||||
if (workMapper.insert(work) <= 0) {
|
||||
flag = false;
|
||||
}
|
||||
long workId = work.getId();
|
||||
for (User user :
|
||||
@@ -93,5 +104,31 @@ public class WorkServiceImpl extends ServiceImpl<WorkMapper, Work> implements IW
|
||||
return flag;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateStatus(UserWork userWork) {
|
||||
return userWorkMapper.update(userWork, new UpdateWrapper<UserWork>().eq("work_id", userWork.getWorkId()).eq("user_id", userWork.getUserId())) > 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean updateWork(Work work) {
|
||||
boolean flag = true;
|
||||
if (userWorkMapper.delete(new QueryWrapper<UserWork>().eq("work_id", work.getId())) <= 0) {
|
||||
flag = false;
|
||||
}
|
||||
if (workMapper.updateById(work)<=0) {
|
||||
flag = false;
|
||||
}
|
||||
for (User user :
|
||||
work.getWorker()) {
|
||||
UserWork userWork = new UserWork();
|
||||
userWork.setWorkId(work.getId());
|
||||
userWork.setUserId(user.getId());
|
||||
if (userWorkMapper.insert(userWork) <= 0) {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
and status = false
|
||||
and w.deleted = 0
|
||||
and tuw.deleted = 0
|
||||
order by u.id desc;
|
||||
order by w.id desc;
|
||||
</select>
|
||||
<select id="getComplete" parameterType="long" resultMap="workMap">
|
||||
select w.id,
|
||||
@@ -84,7 +84,7 @@
|
||||
and status = true
|
||||
and w.deleted = 0
|
||||
and tuw.deleted = 0
|
||||
order by u.id desc;
|
||||
order by w.id desc;
|
||||
</select>
|
||||
<delete id="deleteWorkById" parameterType="int">
|
||||
delete
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<html lang="zh">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" type="image/svg+xml" href="/pinnacle.svg" />
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
}
|
||||
.main {
|
||||
display: flex;
|
||||
height: 100vh;
|
||||
width: 100vw;
|
||||
min-width: 600px;
|
||||
min-height: 600px;
|
||||
text-align: center;
|
||||
@@ -21,7 +19,7 @@
|
||||
width: 100%;
|
||||
z-index: 999;
|
||||
bottom: 10vh;
|
||||
justify-content: center;
|
||||
text-align: center;
|
||||
}
|
||||
.main-add-box {
|
||||
display: flex;
|
||||
|
||||
1
ui/src/assets/svg/work.svg
Normal file
1
ui/src/assets/svg/work.svg
Normal file
@@ -0,0 +1 @@
|
||||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1682965946166" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3580" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16"><path d="M228.928 320h534.144v64H228.928zM228.928 512h534.144v64H228.928zM228.928 704h534.144v64H228.928z" p-id="3581"></path><path d="M124.48 950.272L124.16 118.016h169.024v34.56c0 38.656 31.296 70.144 69.76 70.144h279.488a70.016 70.016 0 0 0 69.696-70.144v-34.56l168.704-0.32 0.32 832.32-756.672 0.256z m517.824-866.816l0.128 69.44-279.424-0.32v-69.12l-0.128-0.384 279.424 0.384zM880.704 50.56h-178.368c-12.096-22.208-34.24-37.312-59.904-37.312H362.88c-25.6 0-47.808 15.104-59.904 37.312H124.16c-38.4 0-69.504 33.28-69.504 74.24v820.736c0 40.96 31.232 74.24 69.568 74.24h756.928c38.4 0 69.44-33.28 69.504-74.24V124.8c-0.128-41.152-31.488-74.368-69.952-74.24z" p-id="3582"></path></svg>
|
||||
|
After Width: | Height: | Size: 1009 B |
@@ -3,7 +3,7 @@
|
||||
title="Vertical list with border"
|
||||
direction="vertical"
|
||||
:column="4"
|
||||
:size="size"
|
||||
:size="5"
|
||||
:data="taskData"
|
||||
border
|
||||
>
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
<el-date-picker
|
||||
v-model="form.deadline"
|
||||
type="datetime"
|
||||
format="YYYY-MM-DD HH:mm"
|
||||
value-format="YYYY-MM-DDTHH:mm:ss"
|
||||
placeholder="请选择时间"
|
||||
style="width: 100%"
|
||||
/>
|
||||
@@ -31,18 +33,30 @@
|
||||
<el-input v-model="form.content" type="textarea" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit(form)">创建</el-button>
|
||||
<el-button type="primary" @click="onSubmit(form)">
|
||||
<template #default> {{ this.commitButton }}</template>
|
||||
</el-button>
|
||||
<el-button @click="reset">重置</el-button>
|
||||
<el-button @click="cancel">取消</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import axios from 'axios'
|
||||
export default {
|
||||
props: {
|
||||
editForm: {
|
||||
publisherId: '',
|
||||
createTime: '',
|
||||
deadline: '',
|
||||
content: '',
|
||||
worker: []
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
commitButton: '创建',
|
||||
form: {
|
||||
publisherId: '',
|
||||
createTime: '',
|
||||
@@ -65,7 +79,6 @@ export default {
|
||||
],
|
||||
deadline: [
|
||||
{
|
||||
type: 'date',
|
||||
required: true,
|
||||
message: '请输入终止日期'
|
||||
}
|
||||
@@ -92,26 +105,17 @@ export default {
|
||||
console.log(reportError)
|
||||
})
|
||||
},
|
||||
addWork(form) {
|
||||
console.log(form)
|
||||
axios
|
||||
.post('http://localhost:8621/work', form)
|
||||
.then((response) => {
|
||||
console.log(response.data)
|
||||
})
|
||||
.catch((reportError) => {
|
||||
console.log(reportError)
|
||||
})
|
||||
},
|
||||
onSubmit(form) {
|
||||
//表单校验
|
||||
// 表单校验
|
||||
this.$refs.ruleForm.validate((value) => {
|
||||
if (value) {
|
||||
console.log(form.deadline)
|
||||
form.createTime = new Date()
|
||||
form.publisherId = String(1)
|
||||
this.addWork(form)
|
||||
this.$emit('setDialogVisible', false)
|
||||
if (this.editForm) {
|
||||
this.$emit('updateWork', form)
|
||||
} else {
|
||||
this.$emit('addWork', form)
|
||||
}
|
||||
console.log('submit!')
|
||||
} else {
|
||||
console.log('fault!')
|
||||
@@ -125,7 +129,18 @@ export default {
|
||||
this.$emit('setDialogVisible', false)
|
||||
}
|
||||
},
|
||||
updated() {
|
||||
if (this.editForm) {
|
||||
this.form = this.editForm
|
||||
this.commitButton = '保存'
|
||||
}
|
||||
this.getFormData()
|
||||
},
|
||||
created() {
|
||||
if (this.editForm) {
|
||||
this.form = this.editForm
|
||||
this.commitButton = '保存'
|
||||
}
|
||||
this.getFormData()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,22 +2,14 @@
|
||||
<div class="main">
|
||||
<div class="main-table">
|
||||
<el-table :data="tableData" style="width: 100%">
|
||||
<el-table-column fixed prop="id" label="工作事项ID" width="150" />
|
||||
<el-table-column prop="publisherId" label="发布者ID" width="120" />
|
||||
<el-table-column fixed prop="publisherName" label="发布者" width="120" />
|
||||
<el-table-column prop="content" label="内容" width="800" />
|
||||
<el-table-column prop="worker" label="工作人员" width="200">
|
||||
<template #default="{ row }">
|
||||
<span v-for="item in row.worker" :key="item.userID">
|
||||
{{ item.userName }},
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="deadline" label="结束时间" width="200">
|
||||
<template #default="scope">
|
||||
{{ formatDate(scope.row.deadline) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column fixed="right" label="操作" width="240">
|
||||
<el-table-column fixed="right" label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" size="large">查看</el-button>
|
||||
<el-popconfirm
|
||||
@@ -26,7 +18,7 @@
|
||||
cancel-button-text="否"
|
||||
:icon="InfoFilled"
|
||||
icon-color="#00d4ff"
|
||||
title="是否确认完成?"
|
||||
title="是否修改为未完成?"
|
||||
@confirm="todoConfirmEvent(scope.row)"
|
||||
@cancel="todoCancelEvent"
|
||||
>
|
||||
@@ -57,34 +49,37 @@ export default {
|
||||
return new Date(deadline).toLocaleString()
|
||||
},
|
||||
todoConfirmEvent(row) {
|
||||
console.log(row)
|
||||
this.setTaskTodo(row)
|
||||
console.log('complete confirm!')
|
||||
location.reload()
|
||||
const userWork = {
|
||||
workId: '',
|
||||
userId: '1652714496280469506',
|
||||
status: 1
|
||||
}
|
||||
userWork.workId = row.id
|
||||
userWork.status = 0
|
||||
this.setTaskStatus(userWork)
|
||||
},
|
||||
todoCancelEvent() {
|
||||
console.log('complete cancel!')
|
||||
},
|
||||
getTableData() {
|
||||
axios
|
||||
.get('http://localhost:8080/work/complete')
|
||||
.get('http://localhost:8621/work/complete/1652714496280469506')
|
||||
.then((response) => {
|
||||
console.log(response.data)
|
||||
this.tableData = response.data
|
||||
console.log(response.data.data)
|
||||
this.tableData = response.data.data
|
||||
console.log(this.tableData)
|
||||
})
|
||||
.catch((reportError) => {
|
||||
console.log(reportError)
|
||||
})
|
||||
},
|
||||
setTaskTodo(row) {
|
||||
var workDo = new Object()
|
||||
workDo.id = row.id
|
||||
workDo.status = false
|
||||
setTaskStatus(userWork) {
|
||||
console.log(userWork)
|
||||
axios
|
||||
.put('http://localhost:8080/work', workDo)
|
||||
.put('http://localhost:8621/work/setStatus', userWork)
|
||||
.then((response) => {
|
||||
console.log(response.data)
|
||||
console.log(response.data.data)
|
||||
this.getTableData()
|
||||
})
|
||||
.catch((reportError) => {
|
||||
console.log(reportError)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="main-table">
|
||||
<el-table :data="tableData" style="width: 100%">
|
||||
<el-table-column prop="content" label="内容" width="800" />
|
||||
<el-table-column prop="publisherName" label="发布者ID" width="120" />
|
||||
<el-table-column prop="publisherName" label="发布者" width="120" />
|
||||
<el-table-column prop="worker" label="工作人员" width="200">
|
||||
<template #default="{ row }">
|
||||
<span v-for="item in row.worker" :key="item.userId">
|
||||
@@ -25,16 +25,15 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column fixed="right" label="操作" width="200">
|
||||
<el-table-column fixed="right" label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" size="large" @click="handleClick"
|
||||
<el-button link type="primary" size="large" @click="handleClick(scope.row)"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-popconfirm
|
||||
width="220"
|
||||
confirm-button-text="是"
|
||||
cancel-button-text="否"
|
||||
:icon="InfoFilled"
|
||||
icon-color="#00d4ff"
|
||||
title="是否确定删除?"
|
||||
@confirm="deleteConfirmEvent(scope.row)"
|
||||
@@ -44,36 +43,29 @@
|
||||
<el-button link type="primary" size="default">删除</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
<!-- <el-popconfirm-->
|
||||
<!-- width="220"-->
|
||||
<!-- confirm-button-text="是"-->
|
||||
<!-- cancel-button-text="否"-->
|
||||
<!-- :icon="InfoFilled"-->
|
||||
<!-- icon-color="#00d4ff"-->
|
||||
<!-- title="是否确认完成?"-->
|
||||
<!-- @confirm="completeConfirmEvent"-->
|
||||
<!-- @cancel="completeCancelEvent"-->
|
||||
<!-- >-->
|
||||
<!-- <template #reference>-->
|
||||
<!-- <el-button link type="primary" size="default">完成</el-button>-->
|
||||
<!-- </template>-->
|
||||
<!-- </el-popconfirm>-->
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="main-add-content">
|
||||
<div class="main-add-box">
|
||||
<el-button @click="dialogFormVisible = true">添加</el-button>
|
||||
<el-button size="large" @click="addVisible = true">添加</el-button>
|
||||
</div>
|
||||
<el-dialog v-model="dialogFormVisible" width="60%">
|
||||
<edit-work @setDialogVisible="setDialogVisible"></edit-work>
|
||||
<el-dialog v-model="addVisible" width="60%">
|
||||
<edit-work @setDialogVisible="setDialogVisible" @addWork="addWork"></edit-work>
|
||||
</el-dialog>
|
||||
<el-dialog v-model="editVisible" width="60%">
|
||||
<edit-work
|
||||
:editForm="rowData"
|
||||
@setDialogVisible="setDialogVisible"
|
||||
@updateWork="updateWork"
|
||||
></edit-work>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
<script lang="ts">
|
||||
import axios from 'axios'
|
||||
import EditWork from '@/components/EditWork.vue'
|
||||
|
||||
@@ -82,7 +74,9 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
tableData: [],
|
||||
dialogFormVisible: false
|
||||
rowData: [],
|
||||
addVisible: false,
|
||||
editVisible: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -90,12 +84,13 @@ export default {
|
||||
console.log(new Date(deadline).toLocaleString())
|
||||
return new Date(deadline).toLocaleString()
|
||||
},
|
||||
handleClick() {
|
||||
handleClick(row) {
|
||||
this.rowData = row
|
||||
this.editVisible = true
|
||||
console.log('click')
|
||||
},
|
||||
deleteConfirmEvent(row) {
|
||||
this.deleteTableData(row)
|
||||
location.reload()
|
||||
console.log('delete confirm!')
|
||||
},
|
||||
deleteCancelEvent() {
|
||||
@@ -123,6 +118,7 @@ export default {
|
||||
axios
|
||||
.delete('http://localhost:8621/work/' + row.id)
|
||||
.then((response) => {
|
||||
this.getTableData()
|
||||
console.log(response.data.data)
|
||||
})
|
||||
.catch((reportError) => {
|
||||
@@ -131,8 +127,33 @@ export default {
|
||||
},
|
||||
setDialogVisible(dialogVisible) {
|
||||
console.log(dialogVisible)
|
||||
this.dialogFormVisible = dialogVisible
|
||||
location.reload()
|
||||
this.addVisible = dialogVisible
|
||||
this.editVisible = dialogVisible
|
||||
this.getTableData()
|
||||
},
|
||||
updateWork(form) {
|
||||
axios
|
||||
.put('http://localhost:8621/work', form)
|
||||
.then((response) => {
|
||||
this.editVisible = false
|
||||
this.getTableData()
|
||||
})
|
||||
.catch((reportError) => {
|
||||
console.log(reportError)
|
||||
})
|
||||
},
|
||||
addWork(form) {
|
||||
console.log(form)
|
||||
axios
|
||||
.post('http://localhost:8621/work', form)
|
||||
.then((response) => {
|
||||
this.addVisible = false
|
||||
this.getTableData()
|
||||
console.log(response.data)
|
||||
})
|
||||
.catch((reportError) => {
|
||||
console.log(reportError)
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -1,15 +1,7 @@
|
||||
<template>
|
||||
<el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal">
|
||||
<el-menu-item index="1"
|
||||
><router-link to="/todo" style="text-decoration: none"
|
||||
>待办工作</router-link
|
||||
></el-menu-item
|
||||
>
|
||||
<el-menu-item index="2"
|
||||
><router-link to="complete" style="text-decoration: none"
|
||||
>已办工作</router-link
|
||||
></el-menu-item
|
||||
>
|
||||
<el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" router>
|
||||
<el-menu-item index="1" route="/work/task/todo">待办工作</el-menu-item>
|
||||
<el-menu-item index="2" route="/work/task/complete">已办工作</el-menu-item>
|
||||
</el-menu>
|
||||
<router-view></router-view>
|
||||
</template>
|
||||
@@ -21,9 +13,6 @@ export default {
|
||||
return {
|
||||
activeIndex: '1'
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.$router.push('/todo')
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -2,22 +2,14 @@
|
||||
<div class="main">
|
||||
<div class="main-table">
|
||||
<el-table :data="tableData" style="width: 100%">
|
||||
<el-table-column fixed prop="id" label="工作事项ID" width="150" />
|
||||
<el-table-column prop="publisherId" label="发布者ID" width="120" />
|
||||
<el-table-column fixed prop="publisherName" label="发布者" width="150" />
|
||||
<el-table-column prop="content" label="内容" width="800" />
|
||||
<el-table-column prop="worker" label="工作人员" width="200">
|
||||
<template #default="{ row }">
|
||||
<span v-for="item in row.worker" :key="item.userID">
|
||||
{{ item.userName }},
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="deadline" label="结束时间" width="200">
|
||||
<template #default="scope">
|
||||
{{ formatDate(scope.row.deadline) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column fixed="right" label="操作" width="240">
|
||||
<el-table-column fixed="right" label="操作" width="150">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" size="large">查看</el-button>
|
||||
<el-popconfirm
|
||||
@@ -56,34 +48,38 @@ export default {
|
||||
return new Date(deadline).toLocaleString()
|
||||
},
|
||||
completeConfirmEvent(row) {
|
||||
console.log(row)
|
||||
this.setTaskComplete(row)
|
||||
const userWork = {
|
||||
workId: '',
|
||||
userId: '1652714496280469506',
|
||||
status: 0
|
||||
}
|
||||
userWork.workId = row.id
|
||||
userWork.status = 1
|
||||
this.setTaskStatus(userWork)
|
||||
console.log('complete confirm!')
|
||||
location.reload()
|
||||
},
|
||||
completeCancelEvent() {
|
||||
console.log('complete cancel!')
|
||||
},
|
||||
getTableData() {
|
||||
axios
|
||||
.get('http://localhost:8080/work/todo')
|
||||
.get('http://localhost:8621/work/todo/1652714496280469506')
|
||||
.then((response) => {
|
||||
console.log(response.data)
|
||||
this.tableData = response.data
|
||||
console.log(response.data.data)
|
||||
this.tableData = response.data.data
|
||||
console.log(this.tableData)
|
||||
})
|
||||
.catch((reportError) => {
|
||||
console.log(reportError)
|
||||
})
|
||||
},
|
||||
setTaskComplete(row) {
|
||||
var workDo = new Object()
|
||||
workDo.id = row.id
|
||||
workDo.status = true
|
||||
setTaskStatus(userWork) {
|
||||
console.log(userWork)
|
||||
axios
|
||||
.put('http://localhost:8080/work', workDo)
|
||||
.put('http://localhost:8621/work/setStatus', userWork)
|
||||
.then((response) => {
|
||||
console.log(response.data)
|
||||
console.log(response.data.data)
|
||||
this.getTableData()
|
||||
})
|
||||
.catch((reportError) => {
|
||||
console.log(reportError)
|
||||
|
||||
Reference in New Issue
Block a user