Commit b52cf1a6 authored by 王鑫's avatar 王鑫

fix: 任务进度优化

parent 77e3ad9d
...@@ -13,6 +13,19 @@ ...@@ -13,6 +13,19 @@
<!-- <div class="q-mt-md" />--> <!-- <div class="q-mt-md" />-->
<!-- <q-btn @click="addTask" icon="mdi-plus" label="Add tas k" />--> <!-- <q-btn @click="addTask" icon="mdi-plus" label="Add tas k" />-->
<!-- </q-page>--> <!-- </q-page>-->
<div style="margin-top: 20px">
<a-pagination
@change="pageChange"
:defaultPageSize="defaultPageSize"
@showSizeChange="sizeChange"
class="cust-pagination"
size="small"
:total="total"
showSizeChanger
showQuickJumper
:showTotal="$showTotal"/>
</div>
</a-card> </a-card>
</template> </template>
<script> <script>
...@@ -148,7 +161,9 @@ export default { ...@@ -148,7 +161,9 @@ export default {
tasks, tasks,
options, options,
dynamicStyle: {}, dynamicStyle: {},
lastId: 16 lastId: 16,
defaultPageSize: 10,
total: 20
} }
}, },
methods: { methods: {
...@@ -166,43 +181,43 @@ export default { ...@@ -166,43 +181,43 @@ export default {
if (response && response.code == SYS_CONST.REQUEST.SUCCEED) { if (response && response.code == SYS_CONST.REQUEST.SUCCEED) {
let respData = response.data; let respData = response.data;
let taskList = []; let taskList = [];
console.log(respData) for (const respDataKey in respData) {
// for (const respDataKey in respData) { let day = this.GetNumberOfDays(new Date(),respData[respDataKey].begin);
// let day = this.GetNumberOfDays(new Date(),respDataKey.begin); let duration = this.GetNumberOfDays(respData[respDataKey].begin,respData[respDataKey].end);
// let duration = this.GetNumberOfDays(respDataKey.begin,respDataKey.end); // 父元素
// // 父元素 if(respData[respDataKey].parentId === null){
// if(respDataKey.parentId == null){ taskList.push({
// taskList.push({ id: respData[respDataKey].id,
// id: respDataKey.id, name: respData[respDataKey].name,
// name: respDataKey.name, user: '',
// user: '', start: getDate(24 * day),
// start: getDate(24 * day), duration: duration * 24 * 60 * 60 * 1000,
// duration: duration * 24 * 60 * 60 * 1000, percent: 85,
// percent: 85, type: "project"
// type: "project" })
// }) // 子元素
// // 子元素 }else {
// }else { taskList.push({
// taskList.push({ id: respData[respDataKey].id,
// id: respDataKey.id, name: "",
// name: "", user:'<span style=\'color:#1eb0bc\'>'+respData[respDataKey].name+'</span>',
// user:'<span style=\'color:#1eb0bc\'>'+respDataKey.name+'</span>', parentId: respData[respDataKey].parentId,
// parentId: respDataKey.parentId, start: getDate(24 * day),
// start: getDate(24 * day), duration: duration * 24 * 60 * 60 * 1000,
// duration: duration * 24 * 60 * 60 * 1000, percent: 50,
// percent: 50, type: "milestone",
// type: "milestone", collapsed: true,
// collapsed: true, style: {
// style: { base: {
// base: { fill: "#1EBC61",
// fill: "#1EBC61", stroke: "#0EAC51"
// stroke: "#0EAC51" }
// } }
// } })
// }) }
// }
// }
// } this.tasks = taskList
} }
}); });
}, },
...@@ -212,6 +227,12 @@ export default { ...@@ -212,6 +227,12 @@ export default {
let a2 = Date.parse(new Date(date2)); let a2 = Date.parse(new Date(date2));
let day = parseInt((a2-a1)/ (1000 * 60 * 60 * 24));//核心:时间戳相减,然后除以天数 let day = parseInt((a2-a1)/ (1000 * 60 * 60 * 24));//核心:时间戳相减,然后除以天数
return day return day
},
pageChange(){
},
sizeChange(){
} }
}, },
mounted() { mounted() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment