|
@@ -37,7 +37,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #extra>
|
|
|
- <el-button size="large" :type="isTableKey === 'user'?'primary':'info'" :disabled="isTableKey !== 'user'" hc-btn @click="showChangeState">
|
|
|
+ <el-button size="large" :type="isTableKey === 1?'primary':'info'" :disabled="isTableKey !== 1" hc-btn @click="showChangeState">
|
|
|
<HcIcon name="edit-circle"/>
|
|
|
<span>变更状态</span>
|
|
|
</el-button>
|
|
@@ -92,17 +92,22 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import {ref, nextTick, watch} from "vue";
|
|
|
+import {ref, nextTick, watch,onMounted,onActivated} from "vue";
|
|
|
import {useRouter} from 'vue-router'
|
|
|
import {getArrValue} from "js-fast-way"
|
|
|
+import planApi from '~api/task/plan.js';
|
|
|
|
|
|
const router = useRouter()
|
|
|
+onActivated(()=>{
|
|
|
+ getTableData()
|
|
|
+
|
|
|
+})
|
|
|
|
|
|
//参数
|
|
|
const props = defineProps({
|
|
|
tableKey: {
|
|
|
- type: String,
|
|
|
- default: ''
|
|
|
+ type: Number,
|
|
|
+ default: 1
|
|
|
}
|
|
|
})
|
|
|
|
|
@@ -113,12 +118,16 @@ const isTableKey = ref(props.tableKey);
|
|
|
watch(() => [
|
|
|
props.tableKey,
|
|
|
], ([Key]) => {
|
|
|
+ console.log(Key,'key');
|
|
|
isTableKey.value = Key
|
|
|
+ searchForm.value.selectType=Key
|
|
|
+ getTableData()
|
|
|
+
|
|
|
})
|
|
|
|
|
|
//搜索表单
|
|
|
const searchForm = ref({
|
|
|
- department: null, state: null, startTime: null, endTime: null,
|
|
|
+ deptId: null, selectType:isTableKey.value, planStartTime: null, planEndTime: null,taskStatus:null,
|
|
|
current: 1, size: 20, total: 0
|
|
|
})
|
|
|
|
|
@@ -131,7 +140,7 @@ const searchClick = () => {
|
|
|
//重置
|
|
|
const resetClick = () => {
|
|
|
searchForm.value = {
|
|
|
- department: null, state: null, startTime: null, endTime: null,
|
|
|
+ deptId: null, selectType:isTableKey.value, planStartTime: null, planEndTime: null,taskStatus:null,
|
|
|
current: 1, size: 20, total: 0
|
|
|
}
|
|
|
}
|
|
@@ -146,20 +155,30 @@ const pageChange = ({current, size}) => {
|
|
|
//获取数据
|
|
|
const tableLoading = ref(false)
|
|
|
const tableColumn = ref([
|
|
|
- {key: 'name', name: '任务所属项目'},
|
|
|
- {key: 'key', name: '状态', width: '120', align: 'center'},
|
|
|
- {key: 'key1', name: '任务描述'},
|
|
|
- {key: 'key2', name: '完成指标'},
|
|
|
- {key: 'key3', name: '计划起止日期', width: '220', align: 'center'},
|
|
|
- {key: 'key4', name: '任务人', width: '120', align: 'center'},
|
|
|
+ {key: 'projectName', name: '任务所属项目'},
|
|
|
+ {key: 'statusName', name: '状态', width: '120', align: 'center'},
|
|
|
+ {key: 'taskDesc', name: '任务描述'},
|
|
|
+ {key: 'planTarget', name: '完成指标'},
|
|
|
+ {key: 'startAndEndDate', name: '计划起止日期', width: '220', align: 'center'},
|
|
|
+ {key: 'taskUserName', name: '任务人', width: '120', align: 'center'},
|
|
|
])
|
|
|
const tableData = ref([
|
|
|
{id: 1, name: 'xxxxx', key: '未完成', key1: 'xxxxxxxxxx', key2: 'xxxxxxxx', key3: '2022-02-01', key4: '张三'},
|
|
|
{id: 2, name: 'xxxxx', key: '未完成', key1: 'xxxxxxxxxx', key2: 'xxxxxxxx', key3: '2022-02-01', key4: '张三'},
|
|
|
{id: 3, name: 'xxxxx', key: '未完成', key1: 'xxxxxxxxxx', key2: 'xxxxxxxx', key3: '2022-02-01', key4: '张三'},
|
|
|
])
|
|
|
-const getTableData = () => {
|
|
|
+const getTableData = async() => {
|
|
|
//const key = isTableKey.value
|
|
|
+ tableLoading.value = true
|
|
|
+ const {error, code, data} = await planApi.getPage(searchForm.value)
|
|
|
+ tableLoading.value = false
|
|
|
+ if (!error && code === 200) {
|
|
|
+ tableData.value = getArrValue(data['records'])
|
|
|
+ searchForm.value.total = data['total'] || 0
|
|
|
+ } else {
|
|
|
+ tableData.value = []
|
|
|
+ searchForm.value.total = 0
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
//表格选择
|