|
|
@@ -8,10 +8,12 @@ import { resolveDailyReportDeptId } from '@/utils/dailyReportDept'
|
|
|
import download from '@/utils/download'
|
|
|
import { rangeShortcuts } from '@/utils/formatTime'
|
|
|
import { useDebounceFn } from '@vueuse/core'
|
|
|
+import { hasPermission } from '@/directives/permission/hasPermi'
|
|
|
import UnfilledReportDialog from './UnfilledReportDialog.vue'
|
|
|
import CountTo from '@/components/count-to1.vue'
|
|
|
import dayjs from 'dayjs'
|
|
|
import RhTable from './rh-table.vue'
|
|
|
+import RhForm from './rh-form.vue'
|
|
|
|
|
|
defineOptions({ name: 'IotRhDailyReport' })
|
|
|
|
|
|
@@ -266,6 +268,14 @@ const unfilledDialogRef = ref()
|
|
|
|
|
|
const alarmCollapse = ref<string[]>([])
|
|
|
|
|
|
+const rhFormVisible = ref(false)
|
|
|
+const rhFormRef = ref<InstanceType<typeof RhForm>>()
|
|
|
+const canModify = computed(() => hasPermission(['pms:iot-rh-daily-report:modify']))
|
|
|
+
|
|
|
+function handleModify(row: any) {
|
|
|
+ rhFormRef.value?.handleOpenForm(row.id, 'edit')
|
|
|
+}
|
|
|
+
|
|
|
const openUnfilledDialog = () => {
|
|
|
if (!query.value.createTime || query.value.createTime.length === 0) {
|
|
|
message.warning('请先选择创建时间范围')
|
|
|
@@ -408,10 +418,21 @@ const openUnfilledDialog = () => {
|
|
|
:loading="loading"
|
|
|
:page-no="query.pageNo"
|
|
|
:page-size="query.pageSize"
|
|
|
- :show-action="false"
|
|
|
+ :show-action="canModify"
|
|
|
is-index
|
|
|
@current-change="handleCurrentChange"
|
|
|
- @size-change="handleSizeChange" />
|
|
|
+ @size-change="handleSizeChange">
|
|
|
+ <template #action="{ row }">
|
|
|
+ <el-button
|
|
|
+ link
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ v-hasPermi="['pms:iot-rh-daily-report:modify']"
|
|
|
+ @click="handleModify(row)">
|
|
|
+ 修改
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </rh-table>
|
|
|
<div class="p-1 bg-white dark:bg-[#1d1e1f] rounded-lg shadow">
|
|
|
<el-collapse v-model="alarmCollapse" class="alarm-collapse">
|
|
|
<el-collapse-item title="告警提示" name="alarm">
|
|
|
@@ -435,6 +456,13 @@ const openUnfilledDialog = () => {
|
|
|
</div>
|
|
|
|
|
|
<UnfilledReportDialog ref="unfilledDialogRef" :query-params="query" />
|
|
|
+ <RhForm
|
|
|
+ ref="rhFormRef"
|
|
|
+ v-model:visible="rhFormVisible"
|
|
|
+ type="edit"
|
|
|
+ :load-list="loadList"
|
|
|
+ submit-api="update"
|
|
|
+ no-validate-status />
|
|
|
</template>
|
|
|
|
|
|
<style scoped>
|