|
@@ -0,0 +1,187 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <transition name="fade">
|
|
|
+ <div class="mb-[10px]">
|
|
|
+ <el-form ref="queryFormRef" :model="planForm" :inline="true">
|
|
|
+ <el-form-item style="width: 200px" label="预案类型" prop="planType">
|
|
|
+ <el-select v-model="planForm.planType" placeholder="全部" clearable>
|
|
|
+ <el-option v-for="item in plan_type" :key="item.value" :label="item.label" :value="item.value"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="发布日期" prop="publish_date">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="dateRange"
|
|
|
+ type="daterange"
|
|
|
+ range-separator="-"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ value-format="YYYY-MM-DD"
|
|
|
+ ></el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-input v-model="planForm.keywords" placeholder="请输入预案名称/编制单位" clearable @keyup.enter="handleQuery" />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ </transition>
|
|
|
+
|
|
|
+ <!-- 表格组件 -->
|
|
|
+ <el-table v-loading="loading" :data="demoList" @selection-change="handleView">
|
|
|
+ <el-table-column label="预案编号" align="center" prop="planId" />
|
|
|
+ <el-table-column label="预案名称" align="center" prop="planName" />
|
|
|
+ <el-table-column label="预案类型" align="center" prop="planType" />
|
|
|
+ <el-table-column label="发文字号" align="center" prop="document" />
|
|
|
+ <el-table-column label="编制单位" align="center" prop="organizingUnit" />
|
|
|
+ <el-table-column label="发布日期" align="center" prop="publish_date" />
|
|
|
+ <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-tooltip content="查看" placement="top">
|
|
|
+ <el-button link type="primary" icon="View" @click="handleView(scope.row)"></el-button>
|
|
|
+ </el-tooltip>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <!-- 添加对话框 -->
|
|
|
+
|
|
|
+ <!-- // 底部分页 -->
|
|
|
+ <pagination v-show="total > 0" v-model:page="planForm.pageNum" v-model:limit="planForm.pageSize" :total="total" @pagination="getList" />
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup lang="ts" name="PlanManageDialog">
|
|
|
+import { ref, reactive, onMounted, toRefs } from 'vue';
|
|
|
+import { PlanForm, PlanVO } from '@/api/routineCommandMap/type';
|
|
|
+import { useRouter } from 'vue-router';
|
|
|
+import { parseTime } from '@/utils/ruoyi';
|
|
|
+import { getEmergencyPlanList } from '@/api/routineCommandMap';
|
|
|
+import { getDicts } from '@/api/system/dict/data';
|
|
|
+
|
|
|
+const router = useRouter();
|
|
|
+const demoFormRef = ref(null);
|
|
|
+const demoList = ref<PlanVO[]>([]);
|
|
|
+const buttonLoading = ref(false);
|
|
|
+const loading = ref(false);
|
|
|
+const showSearch = ref(true);
|
|
|
+const ids = ref<string[]>([]);
|
|
|
+const single = ref(true);
|
|
|
+const multiple = ref(true);
|
|
|
+const total = ref(0);
|
|
|
+const selectedRow = ref<PlanVO | null>(null);
|
|
|
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
|
|
+const { plan_type } = toRefs<any>(proxy?.useDict('plan_type'));
|
|
|
+const queryFormRef = ref();
|
|
|
+const dateRange = ref<[DateModelType, DateModelType]>(['', '']);
|
|
|
+const planForm = reactive({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ planType: '',
|
|
|
+ keywords: '',
|
|
|
+ sortBy: 'publish_date',
|
|
|
+ sortOrder: 'desc'
|
|
|
+});
|
|
|
+let form = ref({
|
|
|
+ planId: '',
|
|
|
+ planName: '',
|
|
|
+ planType: '',
|
|
|
+ document: '',
|
|
|
+ organizingUnit: '',
|
|
|
+ publish_date: ''
|
|
|
+ // fileList: [] 应该是预案附件的地方吧
|
|
|
+});
|
|
|
+
|
|
|
+let showDetailDialog = ref(false);
|
|
|
+
|
|
|
+const planTypeSelection = ref([]);
|
|
|
+// 控制对话框显示
|
|
|
+const dialogVisible = ref(false);
|
|
|
+
|
|
|
+// const dialog = reactive({
|
|
|
+// visible: false,
|
|
|
+// title: ''
|
|
|
+// });
|
|
|
+
|
|
|
+// const getList = async () => {
|
|
|
+// loading.value = true;
|
|
|
+// const res = await getPlanList(addDateRange2(planForm, dateRange.value));
|
|
|
+// loading.value = false;
|
|
|
+// demoList.value = res.data;
|
|
|
+// total.value = res.total;
|
|
|
+// };
|
|
|
+// 获取预案类型字典
|
|
|
+const getList = () => {
|
|
|
+ getEmergencyPlanList(proxy?.addDateRange(planForm, dateRange.value)).then((res) => {
|
|
|
+ res.data.forEach((item) => {
|
|
|
+ item.publish_date = parseTime(item.publish_date);
|
|
|
+ item.img = 'https://img0.baidu.com/it/u=1918456140,3851309096&fm=253&fmt=auto&app=138&f=JPEG?w=750&h=500';
|
|
|
+ });
|
|
|
+ demoList.value = res.data;
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+// 搜索
|
|
|
+const handleQuery = () => {
|
|
|
+ planForm.pageNum = 1;
|
|
|
+ getList();
|
|
|
+};
|
|
|
+// 重置
|
|
|
+const resetQuery = () => {
|
|
|
+ planForm.pageNum = 1;
|
|
|
+ planForm.planType = '';
|
|
|
+ planForm.keywords = '';
|
|
|
+ dateRange.value = ['', ''];
|
|
|
+ handleQuery();
|
|
|
+};
|
|
|
+// 显示预案详情
|
|
|
+// const handleSelectionChange = (selection: PlanVO[]) => {
|
|
|
+// ids.value = selection.map((item) => item.planId);
|
|
|
+// selectedRow.value = selection.length === 1 ? selection[0] : null;
|
|
|
+// single.value = selection.length != 1;
|
|
|
+// multiple.value = !selection.length;
|
|
|
+// };
|
|
|
+
|
|
|
+// 显示预案详情
|
|
|
+const handleView = (row: PlanVO) => {
|
|
|
+ router.push({
|
|
|
+ path: '/riskPrevention/planManage/planList',
|
|
|
+ query: {
|
|
|
+ planId: row.planId
|
|
|
+ }
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+// const handleView = (row) => {
|
|
|
+// showDetailDialog.value = true;
|
|
|
+// };
|
|
|
+
|
|
|
+// 搜索
|
|
|
+// const handleForm = () => {
|
|
|
+// planForm.page = 1;
|
|
|
+// getList();
|
|
|
+// };
|
|
|
+// 重置
|
|
|
+// const resetForm = () => {
|
|
|
+// Object.assign(form.value = {
|
|
|
+// planId: '',
|
|
|
+// planName: '',
|
|
|
+// planType: '',
|
|
|
+// document: '',
|
|
|
+// organizingUnit: '',
|
|
|
+// publishDate: ''
|
|
|
+// });
|
|
|
+// demoFormRef.value?.resetFields();
|
|
|
+// handleForm();
|
|
|
+// };
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ getList();
|
|
|
+ // getDicts('mm_event_type').then((res) => {
|
|
|
+ // planTypeSelection.value = res.data;
|
|
|
+ // });
|
|
|
+});
|
|
|
+</script>
|