|
@@ -1,22 +1,8 @@
|
|
|
<template>
|
|
<template>
|
|
|
<el-row :gutter="20">
|
|
<el-row :gutter="20">
|
|
|
- <el-col :class="{'leftcontent': true, 'collapsed': isLeftContentCollapsed}" :span="isLeftContentCollapsed ? 0 : 4" :xs="24">
|
|
|
|
|
- <ContentWrap class="h-1/1">
|
|
|
|
|
- <DeptTree @node-click="handleDeptNodeClick" />
|
|
|
|
|
- </ContentWrap>
|
|
|
|
|
- </el-col>
|
|
|
|
|
|
|
+ <DeptTree @node-click="handleDeptNodeClick" v-model:collapsed="isLeftContentCollapsed" />
|
|
|
|
|
|
|
|
- <el-col class="rightcontent" :span="isLeftContentCollapsed ? 24 : 20" :xs="24" style="position: relative;height: 100vh;">
|
|
|
|
|
- <div
|
|
|
|
|
- class="toggle-button"
|
|
|
|
|
- :style="{ left: isLeftContentCollapsed ? '0px' : '-13px' }"
|
|
|
|
|
- @click="toggleLeftContent"
|
|
|
|
|
- @mouseover="handleMouseOver"
|
|
|
|
|
- @mouseout="handleMouseOut"
|
|
|
|
|
- :title="hoverText"
|
|
|
|
|
- >
|
|
|
|
|
- <span style="font-size: 5px;" :class="{'triangle': true, 'rotated': isLeftContentCollapsed}"></span>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <el-col :xs="24" :span="isLeftContentCollapsed ? 24 : 20">
|
|
|
<ContentWrap>
|
|
<ContentWrap>
|
|
|
<!-- 搜索工作栏 -->
|
|
<!-- 搜索工作栏 -->
|
|
|
<el-form
|
|
<el-form
|
|
@@ -56,8 +42,12 @@
|
|
|
/>
|
|
/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
<el-form-item>
|
|
|
- <el-button @click="handleQuery"><Icon icon="ep:search" class="mr-5px" /> {{ t('operationFill.search') }}</el-button>
|
|
|
|
|
- <el-button @click="resetQuery"><Icon icon="ep:refresh" class="mr-5px" /> {{ t('operationFill.reset') }}</el-button>
|
|
|
|
|
|
|
+ <el-button @click="handleQuery"
|
|
|
|
|
+ ><Icon icon="ep:search" class="mr-5px" /> {{ t('operationFill.search') }}</el-button
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-button @click="resetQuery"
|
|
|
|
|
+ ><Icon icon="ep:refresh" class="mr-5px" /> {{ t('operationFill.reset') }}</el-button
|
|
|
|
|
+ >
|
|
|
<el-button
|
|
<el-button
|
|
|
type="primary"
|
|
type="primary"
|
|
|
plain
|
|
plain
|
|
@@ -81,16 +71,37 @@
|
|
|
|
|
|
|
|
<!-- 列表 -->
|
|
<!-- 列表 -->
|
|
|
<ContentWrap>
|
|
<ContentWrap>
|
|
|
- <el-table v-loading="loading" :data="list" :stripe="true" :show-overflow-tooltip="true">
|
|
|
|
|
|
|
+ <el-table
|
|
|
|
|
+ v-loading="loading"
|
|
|
|
|
+ :data="list"
|
|
|
|
|
+ :stripe="true"
|
|
|
|
|
+ :show-overflow-tooltip="true"
|
|
|
|
|
+ height="calc(85vh - 175px)"
|
|
|
|
|
+ >
|
|
|
<el-table-column :label="t('iotDevice.serial')" width="70" align="center">
|
|
<el-table-column :label="t('iotDevice.serial')" width="70" align="center">
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
{{ scope.$index + 1 }}
|
|
{{ scope.$index + 1 }}
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
- <el-table-column :label="t('route.planTitle')" align="center" prop="planTitle" min-width="240" />
|
|
|
|
|
-<!-- <el-table-column :label="t('route.planNumber')" align="center" prop="planCode" min-width="200" />-->
|
|
|
|
|
- <el-table-column :label="t('route.cycle')" align="center" prop="planCycle" min-width="80"/>
|
|
|
|
|
- <el-table-column :label="t('workOrderMaterial.unit')" align="center" prop="planUnit" min-width="80">
|
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ :label="t('route.planTitle')"
|
|
|
|
|
+ align="center"
|
|
|
|
|
+ prop="planTitle"
|
|
|
|
|
+ min-width="240"
|
|
|
|
|
+ />
|
|
|
|
|
+ <!-- <el-table-column :label="t('route.planNumber')" align="center" prop="planCode" min-width="200" />-->
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ :label="t('route.cycle')"
|
|
|
|
|
+ align="center"
|
|
|
|
|
+ prop="planCycle"
|
|
|
|
|
+ min-width="80"
|
|
|
|
|
+ />
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ :label="t('workOrderMaterial.unit')"
|
|
|
|
|
+ align="center"
|
|
|
|
|
+ prop="planUnit"
|
|
|
|
|
+ min-width="80"
|
|
|
|
|
+ >
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
<dict-tag :type="DICT_TYPE.PMS_INSPECT_UNIT" :value="scope.row.planUnit" />
|
|
<dict-tag :type="DICT_TYPE.PMS_INSPECT_UNIT" :value="scope.row.planUnit" />
|
|
|
</template>
|
|
</template>
|
|
@@ -119,9 +130,24 @@
|
|
|
:formatter="dateFormatter"
|
|
:formatter="dateFormatter"
|
|
|
min-width="180px"
|
|
min-width="180px"
|
|
|
/>
|
|
/>
|
|
|
- <el-table-column :label="t('iotDevice.dept')" align="center" prop="deptName" min-width="130"/>
|
|
|
|
|
- <el-table-column :label="t('inspect.createName')" align="center" prop="createName" min-width="130"/>
|
|
|
|
|
- <el-table-column :label="t('operationFill.operation')" align="center" min-width="180" fixed="right">
|
|
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ :label="t('iotDevice.dept')"
|
|
|
|
|
+ align="center"
|
|
|
|
|
+ prop="deptName"
|
|
|
|
|
+ min-width="130"
|
|
|
|
|
+ />
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ :label="t('inspect.createName')"
|
|
|
|
|
+ align="center"
|
|
|
|
|
+ prop="createName"
|
|
|
|
|
+ min-width="130"
|
|
|
|
|
+ />
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ :label="t('operationFill.operation')"
|
|
|
|
|
+ align="center"
|
|
|
|
|
+ min-width="180"
|
|
|
|
|
+ fixed="right"
|
|
|
|
|
+ >
|
|
|
<template #default="scope">
|
|
<template #default="scope">
|
|
|
<el-button
|
|
<el-button
|
|
|
link
|
|
link
|
|
@@ -157,26 +183,26 @@
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
|
-import { ref, reactive, onMounted } from 'vue';
|
|
|
|
|
-import { dateFormatter } from '@/utils/formatTime';
|
|
|
|
|
-import download from '@/utils/download';
|
|
|
|
|
-import { IotOperationPlanApi, IotOperationPlanVO } from '@/api/pms/iotopeationfill/plan';
|
|
|
|
|
-import IotOperationPlanForm from './IotOperationPlanForm.vue';
|
|
|
|
|
-import { CommonStatusEnum } from '@/utils/constants';
|
|
|
|
|
-import { DICT_TYPE } from "@/utils/dict";
|
|
|
|
|
-import DeptTree from "@/views/system/user/DeptTree.vue";
|
|
|
|
|
-import { useRouter } from 'vue-router';
|
|
|
|
|
-import { useI18n } from 'vue-i18n';
|
|
|
|
|
|
|
+import { ref, reactive, onMounted } from 'vue'
|
|
|
|
|
+import { dateFormatter } from '@/utils/formatTime'
|
|
|
|
|
+import download from '@/utils/download'
|
|
|
|
|
+import { IotOperationPlanApi, IotOperationPlanVO } from '@/api/pms/iotopeationfill/plan'
|
|
|
|
|
+import IotOperationPlanForm from './IotOperationPlanForm.vue'
|
|
|
|
|
+import { CommonStatusEnum } from '@/utils/constants'
|
|
|
|
|
+import { DICT_TYPE } from '@/utils/dict'
|
|
|
|
|
+import DeptTree from '@/views/system/user/DeptTree2.vue'
|
|
|
|
|
+import { useRouter } from 'vue-router'
|
|
|
|
|
+import { useI18n } from 'vue-i18n'
|
|
|
|
|
|
|
|
defineOptions({ name: 'iotOperationPlan' })
|
|
defineOptions({ name: 'iotOperationPlan' })
|
|
|
const message = useMessage() // 消息弹窗
|
|
const message = useMessage() // 消息弹窗
|
|
|
|
|
|
|
|
-const { push } = useRouter();
|
|
|
|
|
-const { t } = useI18n();
|
|
|
|
|
|
|
+const { push } = useRouter()
|
|
|
|
|
+const { t } = useI18n()
|
|
|
|
|
|
|
|
-const loading = ref(true);
|
|
|
|
|
-const list = ref<IotOperationPlanVO[]>([]);
|
|
|
|
|
-const total = ref(0);
|
|
|
|
|
|
|
+const loading = ref(true)
|
|
|
|
|
+const list = ref<IotOperationPlanVO[]>([])
|
|
|
|
|
+const total = ref(0)
|
|
|
const queryParams = reactive({
|
|
const queryParams = reactive({
|
|
|
pageNo: 1,
|
|
pageNo: 1,
|
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
@@ -189,57 +215,58 @@ const queryParams = reactive({
|
|
|
remark: undefined,
|
|
remark: undefined,
|
|
|
createTime: [],
|
|
createTime: [],
|
|
|
deptId: undefined
|
|
deptId: undefined
|
|
|
-});
|
|
|
|
|
-const queryFormRef = ref();
|
|
|
|
|
-const exportLoading = ref(false);
|
|
|
|
|
|
|
+})
|
|
|
|
|
+const queryFormRef = ref()
|
|
|
|
|
+const exportLoading = ref(false)
|
|
|
|
|
|
|
|
-const isLeftContentCollapsed = ref(false);
|
|
|
|
|
-const hoverText = ref('');
|
|
|
|
|
|
|
+const isLeftContentCollapsed = ref(false)
|
|
|
|
|
+const hoverText = ref('')
|
|
|
const selectedDept = ref<{ id: number; name: string }>()
|
|
const selectedDept = ref<{ id: number; name: string }>()
|
|
|
|
|
|
|
|
const handleDeptNodeClick = async (row) => {
|
|
const handleDeptNodeClick = async (row) => {
|
|
|
selectedDept.value = { id: row.id, name: row.name }
|
|
selectedDept.value = { id: row.id, name: row.name }
|
|
|
- queryParams.deptId = row.id;
|
|
|
|
|
- await getList();
|
|
|
|
|
-};
|
|
|
|
|
|
|
+ queryParams.deptId = row.id
|
|
|
|
|
+ await getList()
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
const handleStatusChange = async (row: IotOperationPlanVO) => {
|
|
const handleStatusChange = async (row: IotOperationPlanVO) => {
|
|
|
try {
|
|
try {
|
|
|
- const text = row.status === CommonStatusEnum.ENABLE ? '启用' : '停用';
|
|
|
|
|
- await message.confirm('确认要"' + text + '""' + row.planTitle + '"巡检计划吗?');
|
|
|
|
|
- await IotOperationPlanApi.updateIotOperationStatus(row.id, row.status);
|
|
|
|
|
- await getList();
|
|
|
|
|
|
|
+ const text = row.status === CommonStatusEnum.ENABLE ? '启用' : '停用'
|
|
|
|
|
+ await message.confirm('确认要"' + text + '""' + row.planTitle + '"巡检计划吗?')
|
|
|
|
|
+ await IotOperationPlanApi.updateIotOperationStatus(row.id, row.status)
|
|
|
|
|
+ await getList()
|
|
|
} catch {
|
|
} catch {
|
|
|
- row.status = row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE : CommonStatusEnum.ENABLE;
|
|
|
|
|
|
|
+ row.status =
|
|
|
|
|
+ row.status === CommonStatusEnum.ENABLE ? CommonStatusEnum.DISABLE : CommonStatusEnum.ENABLE
|
|
|
}
|
|
}
|
|
|
-};
|
|
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
const getList = async () => {
|
|
const getList = async () => {
|
|
|
- loading.value = true;
|
|
|
|
|
|
|
+ loading.value = true
|
|
|
try {
|
|
try {
|
|
|
- const data = await IotOperationPlanApi.getIotOperationPlanPage(queryParams);
|
|
|
|
|
- list.value = data.list;
|
|
|
|
|
- total.value = data.total;
|
|
|
|
|
|
|
+ const data = await IotOperationPlanApi.getIotOperationPlanPage(queryParams)
|
|
|
|
|
+ list.value = data.list
|
|
|
|
|
+ total.value = data.total
|
|
|
} finally {
|
|
} finally {
|
|
|
- loading.value = false;
|
|
|
|
|
|
|
+ loading.value = false
|
|
|
}
|
|
}
|
|
|
-};
|
|
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
const handleQuery = () => {
|
|
const handleQuery = () => {
|
|
|
- queryParams.pageNo = 1;
|
|
|
|
|
- getList();
|
|
|
|
|
-};
|
|
|
|
|
|
|
+ queryParams.pageNo = 1
|
|
|
|
|
+ getList()
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
const resetQuery = () => {
|
|
const resetQuery = () => {
|
|
|
- queryFormRef.value.resetFields();
|
|
|
|
|
|
|
+ queryFormRef.value.resetFields()
|
|
|
selectedDept.value = undefined
|
|
selectedDept.value = undefined
|
|
|
- handleQuery();
|
|
|
|
|
-};
|
|
|
|
|
|
|
+ handleQuery()
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
const openForm = (type: string, id?: number) => {
|
|
const openForm = (type: string, id?: number) => {
|
|
|
if (typeof id === 'number') {
|
|
if (typeof id === 'number') {
|
|
|
- push({ name: 'OperationPlanEdit', params: { id } });
|
|
|
|
|
- return;
|
|
|
|
|
|
|
+ push({ name: 'OperationPlanEdit', params: { id } })
|
|
|
|
|
+ return
|
|
|
}
|
|
}
|
|
|
push({
|
|
push({
|
|
|
name: 'OperationPlanAdd',
|
|
name: 'OperationPlanAdd',
|
|
@@ -248,44 +275,44 @@ const openForm = (type: string, id?: number) => {
|
|
|
deptName: selectedDept.value?.name
|
|
deptName: selectedDept.value?.name
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
-};
|
|
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
const handleDelete = async (id: number) => {
|
|
const handleDelete = async (id: number) => {
|
|
|
try {
|
|
try {
|
|
|
- await message.delConfirm();
|
|
|
|
|
- await IotOperationPlanApi.deleteIotOperationPlan(id);
|
|
|
|
|
- message.success(t('common.delSuccess'));
|
|
|
|
|
- await getList();
|
|
|
|
|
|
|
+ await message.delConfirm()
|
|
|
|
|
+ await IotOperationPlanApi.deleteIotOperationPlan(id)
|
|
|
|
|
+ message.success(t('common.delSuccess'))
|
|
|
|
|
+ await getList()
|
|
|
} catch {}
|
|
} catch {}
|
|
|
-};
|
|
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
const handleExport = async () => {
|
|
const handleExport = async () => {
|
|
|
try {
|
|
try {
|
|
|
- await message.exportConfirm();
|
|
|
|
|
- exportLoading.value = true;
|
|
|
|
|
- const data = await IotOperationPlanApi.exportIotOperationPlan(queryParams);
|
|
|
|
|
- download.excel(data, '巡检计划.xls');
|
|
|
|
|
|
|
+ await message.exportConfirm()
|
|
|
|
|
+ exportLoading.value = true
|
|
|
|
|
+ const data = await IotOperationPlanApi.exportIotOperationPlan(queryParams)
|
|
|
|
|
+ download.excel(data, '巡检计划.xls')
|
|
|
} catch {
|
|
} catch {
|
|
|
} finally {
|
|
} finally {
|
|
|
- exportLoading.value = false;
|
|
|
|
|
|
|
+ exportLoading.value = false
|
|
|
}
|
|
}
|
|
|
-};
|
|
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
const toggleLeftContent = () => {
|
|
const toggleLeftContent = () => {
|
|
|
- isLeftContentCollapsed.value = !isLeftContentCollapsed.value;
|
|
|
|
|
-};
|
|
|
|
|
|
|
+ isLeftContentCollapsed.value = !isLeftContentCollapsed.value
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
const handleMouseOver = () => {
|
|
const handleMouseOver = () => {
|
|
|
- hoverText.value = isLeftContentCollapsed.value ? '展开' : '收起';
|
|
|
|
|
-};
|
|
|
|
|
|
|
+ hoverText.value = isLeftContentCollapsed.value ? '展开' : '收起'
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
const handleMouseOut = () => {
|
|
const handleMouseOut = () => {
|
|
|
- hoverText.value = '';
|
|
|
|
|
-};
|
|
|
|
|
|
|
+ hoverText.value = ''
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
|
- getList();
|
|
|
|
|
-});
|
|
|
|
|
|
|
+ getList()
|
|
|
|
|
+})
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<style scoped>
|
|
<style scoped>
|
|
@@ -306,7 +333,7 @@ onMounted(() => {
|
|
|
.toggle-button {
|
|
.toggle-button {
|
|
|
position: absolute;
|
|
position: absolute;
|
|
|
top: 44%;
|
|
top: 44%;
|
|
|
- transform: translate(-65%,-50%);
|
|
|
|
|
|
|
+ transform: translate(-65%, -50%);
|
|
|
width: 12px;
|
|
width: 12px;
|
|
|
height: 40px;
|
|
height: 40px;
|
|
|
background-color: #f0f0f0;
|
|
background-color: #f0f0f0;
|
|
@@ -324,7 +351,6 @@ onMounted(() => {
|
|
|
background-color: #afafaf;
|
|
background-color: #afafaf;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-
|
|
|
|
|
.triangle {
|
|
.triangle {
|
|
|
width: 0;
|
|
width: 0;
|
|
|
height: 0;
|
|
height: 0;
|