|
@@ -27,13 +27,12 @@
|
|
|
<div class="hc-task-table">
|
|
|
<hc-body class="hc-task-body-card" padding="10px">
|
|
|
<hc-table
|
|
|
- :column="tableColumn" :datas="tableData"
|
|
|
- :loading="tableLoading" :is-stripe="false"
|
|
|
- is-new :index-style="{ width: 60 }" is-current-row
|
|
|
+ ref="tableRef" :column="tableColumn" :datas="tableData"
|
|
|
+ :loading="tableLoading" :is-stripe="false" is-new :index-style="{ width: 60 }" is-current-row
|
|
|
@row-click="tableRowClick"
|
|
|
>
|
|
|
<template #action="{ row }">
|
|
|
- <div class="hc-task-table-action" :class="row.isRemark ? 'is-cur' : ''">
|
|
|
+ <div class="hc-task-table-action" :class="row.isRemark ? 'is-cur' : ''" @click="rowRemarkClick(row)">
|
|
|
<i class="i-iconoir-star-solid" />
|
|
|
</div>
|
|
|
</template>
|
|
@@ -50,7 +49,7 @@
|
|
|
</div>
|
|
|
<div class="hc-task-form">
|
|
|
<hc-body class="hc-task-body-card" padding="10px" scrollbar>
|
|
|
- 222
|
|
|
+ <HcTaskForm v-model="tableInfo" :is-edit="tabsKey === 1" :type="rowInfo.type" />
|
|
|
</hc-body>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -59,7 +58,9 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { ref, watch } from 'vue'
|
|
|
+import { nextTick, ref, watch } from 'vue'
|
|
|
+import { getArrValue } from 'js-fast-way'
|
|
|
+import HcTaskForm from './task-form.vue'
|
|
|
|
|
|
const props = defineProps({
|
|
|
tabs: {
|
|
@@ -82,6 +83,7 @@ const isShow = defineModel('modelValue', {
|
|
|
})
|
|
|
|
|
|
//监听
|
|
|
+const tableRef = ref(null)
|
|
|
const tabsKey = ref(props.tabs)
|
|
|
const rowInfo = ref(props.row)
|
|
|
const taskInfo = ref({})
|
|
@@ -118,6 +120,7 @@ const setTaskInfo = async () => {
|
|
|
} else {
|
|
|
tableColumn.value = []
|
|
|
}
|
|
|
+ getTableData().then()
|
|
|
}
|
|
|
|
|
|
//流程信息
|
|
@@ -170,12 +173,40 @@ const tableData = ref([
|
|
|
{ isRemark: true, key1: '你猜3', key2: '猜猜3', state: 2 },
|
|
|
{ isRemark: true, key1: '你猜4', key2: '猜猜4', state: 2 },
|
|
|
])
|
|
|
+const getTableData = async () => {
|
|
|
+ //tableData.value = []
|
|
|
+ tableLoading.value = true
|
|
|
+ /*const { data } = await mainApi.getPage({
|
|
|
+ ...searchForm.value,
|
|
|
+ projectId: projectId.value,
|
|
|
+ contractId: contractId.value,
|
|
|
+ })
|
|
|
+ tableData.value = getArrValue(data)*/
|
|
|
+ tableLoading.value = false
|
|
|
+ //默认选中第一行
|
|
|
+ let info = {}
|
|
|
+ if (tableData.value.length > 0) {
|
|
|
+ info = tableData.value[0]
|
|
|
+ }
|
|
|
+ await nextTick(() => {
|
|
|
+ tableInfo.value = info
|
|
|
+ tableRef.value?.tableRef?.setCurrentRow(info)
|
|
|
+ })
|
|
|
+ //getTableDetail(info).then()
|
|
|
+}
|
|
|
|
|
|
//表格行被点击
|
|
|
+const tableInfo = ref({})
|
|
|
const tableRowClick = ({ row }) => {
|
|
|
+ tableInfo.value = row
|
|
|
+}
|
|
|
+
|
|
|
+//批注
|
|
|
+const rowRemarkClick = (row) => {
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
//确认审批
|
|
|
const confirmLoading = ref(false)
|
|
|
const confirmClick = () => {
|