全部任务(第二版)

dev_4newlayout
xia 1 year ago
parent ca7bd2cf58
commit 6e2aa27643
  1. BIN
      ant-design-vue-jeecg/public/filepic.png
  2. 265
      ant-design-vue-jeecg/src/views/newLayout/task_admin/task_content/TaskContent.vue
  3. 116
      ant-design-vue-jeecg/src/views/newLayout/task_admin/task_content/content_card/ContentCard.vue
  4. 9
      ant-design-vue-jeecg/src/views/newLayout/task_admin/task_content/content_card/HeaderCard.vue

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

@ -21,62 +21,57 @@
</div>
<!-- 选择框 -->
<div class="header_right">
<div class="right_box">
<el-button @click="Reset">重置</el-button>
</div>
<div class="right_box">
<template>
<el-select
v-model="valueproject"
placeholder="请选择项目名称"
clearable
>
<el-option
v-for="item in pnameOptions"
:key="item.id"
:label="item.name"
:value="item.id"
@change="searchBypn"
>
</el-option>
</el-select>
</template>
</div>
<div class="right_box">
<template>
<el-select
v-model="valuepeople"
placeholder="请选择任务负责人名称"
clearable
@change="searchByhn"
>
<el-option
v-for="item in hnameOptions"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</template>
</div>
<div class="right_box">
<template>
<el-select
v-model="valuetype"
placeholder="请选择任务类型"
clearable
@change="searchBytype"
>
<el-option
v-for="item in typeOptions"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
</template>
<div class="table-page-search-wrapper">
<a-form layout="inline" @keyup.enter.native="searchQuery">
<a-row :gutter="24">
<a-col :md="6" :sm="12">
<a-form-item class="searcha">
<j-dict-select-tag
v-model="queryParam.typeId"
placeholder="请选择任务类型"
dict-code="task_type,type_name,id"
></j-dict-select-tag>
</a-form-item>
</a-col>
<a-col :md="6" :sm="12">
<a-form-item class="searcha">
<j-dict-select-tag
v-model="queryParam.managerUsers"
placeholder="请选责任人"
dict-code="sys_user,realname,id"
style="width: 100%"
></j-dict-select-tag>
</a-form-item>
</a-col>
<a-col :md="6" :sm="12">
<a-form-item class="searcha">
<j-dict-select-tag
v-model="queryParam.projectId"
placeholder="请选择项目"
dict-code="projectx,project_name,id"
style="width: 100%"
></j-dict-select-tag>
</a-form-item>
</a-col>
<a-col :md="6" :sm="8">
<span
style="float: left; overflow: hidden"
class="table-page-search-submitButtons searcha"
>
<a-button type="primary" @click="allUpadate" icon="search">
查询
</a-button>
<a-button
type="primary"
@click="Reset"
icon="reload"
style="margin-left: 8px"
>重置</a-button
>
</span>
</a-col>
</a-row>
</a-form>
</div>
</div>
</div>
@ -87,6 +82,7 @@
:title="item.status"
:color="item.color"
:total="item.total"
@add="Add"
></HeaderCard>
</div>
<div
@ -104,12 +100,18 @@
:projectData="item.data"
:statusNum="item.statusNum"
:timeid="timeid"
:typeId="queryParam.typeId"
:managerUsers="queryParam.managerUsers"
:projectId="queryParam.projectIda"
@getAllData="getAllData"
@delete="Delete"
@edit="Edit"
@fenjie="Decompose"
></ContenCard>
</div>
</div>
</div>
<task-modal ref="modalForm" @ok="allUpadate"></task-modal>
</div>
</template>
@ -117,13 +119,15 @@
import ContenCard from './content_card/ContentCard.vue'
import HeaderCard from './content_card/HeaderCard.vue'
import { getAction, getFileAccessHttpUrl } from '@/api/manage.js'
import TaskModal from '@/views/task/modules/TaskModal'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
export default {
mixins: [JeecgListMixin, mixinDevice],
components: {
ContenCard,
HeaderCard
HeaderCard,
TaskModal
},
data() {
return {
@ -176,27 +180,15 @@ export default {
],
time: [
{ id: 1, name: '当天', select: false },
{ id: 2, name: '本周', select: false },
{ id: 2, name: '本周', select: true },
{ id: 3, name: '本月', select: false },
{ id: 4, name: '全部', select: false }
],
timeid: '', // id
loading: true, //
valueproject: '', //
valuepeople: '', //
valuetype: '', //
pnameOptions: [
{ id: 1, name: 'xxxx项目' },
{ id: 2, name: 'yyy项目' }
], //
hnameOptions: [
{ id: 1, name: '小明' },
{ id: 2, name: '小红' }
], //
typeOptions: [
{ id: 1, name: '编码' },
{ id: 2, name: '前端开发' }
] //
timeid: 2, // id
loading: true //
// valueproject: '', //
// valuepeople: '', //
// valuetype: '' //
}
},
watch: {
@ -212,18 +204,21 @@ export default {
},
methods: {
//
async getAllData(index, time) {
async getAllData(index, time, typeId, managerUsers, projectId) {
const res = await getAction(this.url.list, {
workStatus: this.TotalData[index].statusNum,
time
time,
typeId,
managerUsers,
projectId
})
if (res.success) {
console.log(this.TotalData[index].statusNum, time)
this.TotalData[index].data = res.result.records
this.TotalData[index].total = res.result.total
this.TotalData[index].data.forEach((element) => {
element.headpic = getFileAccessHttpUrl(element.headpic)
element.taskPic = getFileAccessHttpUrl(element.taskPic)
element.taskFile = getFileAccessHttpUrl(element.taskFile)
})
this.loading = false
} else {
@ -232,23 +227,31 @@ export default {
},
//
async getDataByPage(index, current, lastPage, time) {
async getDataByPage(
index,
current,
lastPage,
time,
typeId,
managerUsers,
projectId
) {
this.loading = true
if (!lastPage) {
const res = await getAction(this.url.list, {
workStatus: this.TotalData[index].statusNum,
pageNo: current,
time
time,
typeId,
managerUsers,
projectId
})
if (res.success) {
console.log('底部数据', current, lastPage)
console.log('请求回来的数据', res.result, '第几页', current)
this.TotalData[index].data = [
...this.TotalData[index].data,
...res.result.records
]
}
this.TotalData[index].data = [
...this.TotalData[index].data,
...res.result.records
]
if (res.result.records.length < 10) {
this.TotalData[index].lastPage = true
}
@ -268,7 +271,10 @@ export default {
index,
this.TotalData[index].currentPage,
this.TotalData[index].lastPage,
time
time,
this.queryParam.typeId,
this.queryParam.managerUsers,
this.queryParam.projectId
)
}
},
@ -280,54 +286,69 @@ export default {
//
async selectTime(time) {
this.timeid = time
this.allUpadate()
//
for (let i = 0; i < 4; i++) {
this.getAllData(i, time)
this.timeid = time
//
this.time[i].select = false
if (this.time[i].id === time) {
this.time[i].select = true
}
}
},
//
searchBypn() {
console.log(this.valueproject)
},
//
searchByhn() {
console.log(this.valuepeople)
},
//
searchBytype() {
console.log(this.valuetype)
},
//
//
Reset() {
this.valueproject = ''
this.valuepeople = ''
this.valuetype = ''
this.searchReset()
for (let i = 0; i < 4; i++) {
this.getAllData(i, this.timeid)
}
},
//
Add() {
this.handleAdd()
},
//
Delete(id) {
Delete(id, tid) {
this.handleDelete(id)
this.getAllData(0, 3)
this.getAllData(0, 3)
this.getAllData(0, tid, this.queryParam.typeId)
this.getAllData(0, tid, this.queryParam.typeId)
},
//
async Edit(record, tid) {
await this.handleEdit(record)
// this.getAllData(0, tid, this.queryParam.typeId)
// this.getAllData(0, tid, this.queryParam.typeId)
},
//
Decompose(record, tid) {
this.fengjieRenwu(record)
},
// ()
allUpadate() {
for (let i = 0; i < 4; i++) {
this.TotalData[i].currentPage = 1
this.TotalData[i].lastPage = false
this.getAllData(
i,
this.timeid,
this.queryParam.typeId,
this.queryParam.managerUsers,
this.queryParam.projectId
)
}
}
},
mounted() {},
created() {
this.getAllData(0)
this.getAllData(1)
this.getAllData(2)
this.getAllData(3)
this.allUpadate()
}
}
</script>
<style lang="less" scoped>
.a {
width: 15rem;
}
.bigcontent {
width: 100%;
height: 100%;
@ -373,14 +394,10 @@ export default {
}
}
.header_right {
display: flex;
flex-direction: row-reverse;
width: 60%;
height: 100%;
.right_box {
margin-top: auto;
margin-bottom: auto;
margin-left: 0.5rem;
.searcha {
margin-top: 16%;
}
}
}
@ -389,7 +406,7 @@ export default {
justify-content: space-between;
width: 100%;
height: 100%;
margin-top: 2%;
margin-top: 1%;
//background-color: rgb(48, 214, 159);
.content_box {
width: 24%;

@ -129,19 +129,22 @@
class="sub_document"
>
<div class="document">
<iframe
:src="item.taskFile"
frameborder="0"
style="
width: 100%;
height: 100%;
border-radius: 10px 10px 10px 10px;
"
></iframe>
<img
src="../../../../../../public/filepic.png"
alt=""
style="width: 100%; height: 100%"
/>
</div>
<div class="s_operate">
<div>点击查看</div>
<div>上传文档</div>
<el-link
class="s_c_operate"
@click="lookFile(item.taskFile)"
>
点击查看
</el-link>
<el-link class="s_c_operate" :href="item.taskFile">
下载文档
</el-link>
</div>
</div>
<div></div>
@ -359,7 +362,15 @@ export default {
TaskModal
},
props: ['color', 'projectData', 'statusNum', 'timeid'],
props: [
'color',
'projectData',
'statusNum',
'timeid',
'typeId',
'managerUsers',
'projectId'
],
data() {
return {
url: {
@ -422,41 +433,13 @@ export default {
//
handleCommand(command) {
let { id, content } = command
// //
if (id === 5) {
// this.handleDelete(content.id)
this.$emit('delete', content.id)
if (id === 1) {
this.$emit('fenjie', content, this.timeid)
} else if (id === 5) {
this.$emit('delete', content.id, this.timeid)
} else if (id === 4) {
this.$emit('edit', content, this.timeid)
}
// console.log(content)
// this.$emit('changeData', content.workStatus, this.proData)
// if (command === 5) {
// this.handleAdd()
// } else if (command === 4) {
// this.handleEdit()
// console.log('lllllll', this.$refs)
// }
// console.log('aaaa', command)
},
//
delectTask() {
this.$confirm('此操作将删除该任务, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
this.$message({
type: 'success',
message: '删除成功!'
})
})
.catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
})
})
},
//
@ -469,10 +452,16 @@ export default {
this.proData = this.applyDrag(this.proData, dropResult)
}
//
this.$emit('getAllData', 0)
this.$emit('getAllData', 1)
this.$emit('getAllData', 2)
this.$emit('getAllData', 3)
for (let i = 0; i < 4; i++) {
this.$emit(
'getAllData',
i,
this.timeid,
this.typeId,
this.managerUsers,
this.projectId
)
}
},
getCardPayload(columnId) {
return (index) => this.proData[index]
@ -496,6 +485,14 @@ export default {
const res = await putAction(this.url.updateWorkStatus, { id, workStatus })
if (res.success) {
}
},
//
lookFile(fileurl) {
let Base64 = require('js-base64').Base64
this.dialogurl =
'http://127.0.0.1:8012/onlinePreview?url=' +
encodeURIComponent(Base64.encode(fileurl))
window.open(this.dialogurl)
}
},
mounted() {
@ -552,9 +549,9 @@ export default {
.sub_document {
display: flex;
width: 100%;
height: 20vh;
height: 15vh;
.document {
width: 55%;
width: 60%;
height: 100%;
background-color: #52c93f;
border-radius: 10px 10px 10px 10px;
@ -562,13 +559,22 @@ export default {
.s_operate {
position: relative;
top: 2.7rem;
left: 1.5rem;
left: 1rem;
display: flex;
flex-direction: column;
justify-content: space-between;
width: 25%;
// width: 40%;
height: 40%;
color: #3e75e6;
.s_c_operate {
border-bottom: 1px solid #9f9f9f;
cursor: pointer;
color: #9f9f9f;
}
.s_c_operate:hover {
border-bottom: 1px solid #3e75e6;
color: #3e75e6;
}
}
}
}

@ -16,7 +16,7 @@
>{{ title }}<span class="number">{{ total }}</span></span
>
<span class="icon">
<i class="el-icon-plus"></i>
<i class="el-icon-plus" @click="AddTask"></i>
<i class="el-icon-more" style="margin-left: 0.5rem"></i>
</span>
</div>
@ -25,7 +25,12 @@
<script>
export default {
props: ['title', 'color', 'total']
props: ['title', 'color', 'total'],
methods: {
AddTask() {
this.$emit('add')
}
}
}
</script>

Loading…
Cancel
Save