diff --git a/packages/mobile/src/views/Rebuild/RebuildAdd.vue b/packages/mobile/src/views/Rebuild/RebuildAdd.vue
index 25ac8c1..9c20a9c 100644
--- a/packages/mobile/src/views/Rebuild/RebuildAdd.vue
+++ b/packages/mobile/src/views/Rebuild/RebuildAdd.vue
@@ -121,8 +121,8 @@ const getDetail = async (id) => {
onMounted(() => {
if (route.params.data) {
const data = JSON.parse(decodeURIComponent(route.params.data));
- console.log('@@@@data', data);
- // todo 在有传参的时候 调用接口去获取数据 并且初始化表单
+ // console.log('@@@@data', data);
+ // 在有传参的时候 调用接口去获取数据 并且初始化表单
getDetail(data);
} else {
// console.log('无传入数据');
diff --git a/packages/screen/src/router/index.js b/packages/screen/src/router/index.js
index bb0541e..a0d10b3 100644
--- a/packages/screen/src/router/index.js
+++ b/packages/screen/src/router/index.js
@@ -180,6 +180,16 @@ const routes = [
parentRoute: 'warningManagement3'
}
},
+ {
+ path: '/dutyManagement',
+ name: 'dutyManagement',
+ component: () => import('../views/WarningManagement/law/dutyManagement/index.vue'),
+ meta: {
+ title: '值班管理',
+ breadcrumb: true,
+ parentRoute: 'warningManagement3'
+ }
+ },
// 项目管理 - 区县
{
diff --git a/packages/screen/src/views/WarningManagement/law/dutyManagement/addDialog.vue b/packages/screen/src/views/WarningManagement/law/dutyManagement/addDialog.vue
new file mode 100644
index 0000000..4319242
--- /dev/null
+++ b/packages/screen/src/views/WarningManagement/law/dutyManagement/addDialog.vue
@@ -0,0 +1,151 @@
+
+
+
+
+
+ 气象信息
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ -
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/screen/src/views/WarningManagement/law/dutyManagement/index.js b/packages/screen/src/views/WarningManagement/law/dutyManagement/index.js
new file mode 100644
index 0000000..e486415
--- /dev/null
+++ b/packages/screen/src/views/WarningManagement/law/dutyManagement/index.js
@@ -0,0 +1,157 @@
+import { h, ref, onMounted, reactive, watch, toRaw, nextTick } from "vue";
+import { request } from "@/utils/request";
+import { useRoute, useRouter } from 'vue-router'
+import AddDialog from "./addDialog.vue";
+
+const tableData = ref([]); // 表格数据
+const modelVisible = ref(false); // 弹窗状态
+const drawerVisible = ref(false); // 抽屉状态
+// 弹窗内容
+const model = reactive({
+
+});
+const form = reactive({
+
+});
+const INIT_FORM = {
+
+};
+// 抽屉内容
+const drawer = reactive({
+ title: '',
+ content: null,
+ props: {},
+ onCancel: null,
+ onConfirm: null,
+ direction: 'rtl',
+ size: '50%'
+});
+const dialogRef = ref(null); // 弹窗实例
+const drawerRef = ref(null); // 抽屉实例
+
+const columns = [
+ {
+ prop: "userCount",
+ label: "值班人数",
+ },
+ {
+ prop: "startTime",
+ label: "开始时间",
+ },
+ {
+ prop: "endTime",
+ label: "结束时间",
+ },
+ {
+ prop: "createTime",
+ label: "排班时间",
+ },
+ {
+ prop: "createBy",
+ label: "排班人",
+ },
+]
+
+// 过滤条件
+const filterData = reactive({})
+// 分页
+const pagination = reactive({
+ current: 1,
+ pageSize: 10,
+ total: 0,
+ pageSizes: [10, 20, 50],
+ layout: "prev, pager, next, jumper",
+ onChange: (page, pageSize) => {
+ pagination.current = page;
+ pagination.pageSize = pageSize;
+ getTableData(filterData);
+ },
+});
+
+// 获取预警列表
+const getTableData = async (filterData = {}) => {
+ try {
+ // 过滤空字符串属性
+ const filteredParams = {};
+ Object.keys(filterData).forEach(key => {
+ if (filterData[key] !== '' && filterData[key] != null) {
+ filteredParams[key] = filterData[key];
+ }
+ });
+ const res = await request({
+ url: '/snow-ops-platform/law-duty/page',
+ method: "GET",
+ params: {
+ dutyStartTime: filteredParams.timeRange?.[0],
+ dutyEndTime: filteredParams.timeRange?.[1],
+ pageNum: pagination.current,
+ pageSize: pagination.pageSize,
+ }
+ })
+ if (res.code === '00000') {
+ tableData.value = res.data.records
+ pagination.total = res.data.total
+ } else {
+ throw new Error(res.message)
+ }
+ } catch (error) {
+ ElMessage.error('获取排班列表失败');
+ console.error('获取排班列表失败:', error);
+ }
+}
+
+// 打开发布预警弹窗
+const openAddDialog = () => {
+ model.title = '发布预警';
+ Object.assign(form, INIT_FORM);
+ model.props = {
+ form: form,
+ };
+ model.content = AddDialog;
+ model.onCancel = () => {
+ modelVisible.value = false;
+ };
+ model.onConfirm = async () => {
+ await dialogRef?.value?.dynamicComponentRef?.formRef.validate().then(async () => {
+ console.log('@@@@@发布预警', form);
+ // await publishWarning(form)
+ })
+ .catch((err) => {
+ ElMessage.error('请处理表单中的错误项');
+ });
+ };
+ model.width = "50%"
+ modelVisible.value = true;
+}
+
+export default () => {
+
+ const router = useRouter();
+
+ onMounted(() => {
+ getTableData();
+ })
+
+
+ watch(filterData, (val) => {
+ getTableData(filterData);
+ }, { deep: true })
+
+
+
+ return {
+ tableData,
+ filterData,
+
+ pagination,
+ columns,
+
+ modelVisible,
+ model,
+ drawerVisible,
+ drawer,
+ dialogRef,
+ drawerRef,
+ openAddDialog,
+ }
+}
\ No newline at end of file
diff --git a/packages/screen/src/views/WarningManagement/law/dutyManagement/index.vue b/packages/screen/src/views/WarningManagement/law/dutyManagement/index.vue
new file mode 100644
index 0000000..404248a
--- /dev/null
+++ b/packages/screen/src/views/WarningManagement/law/dutyManagement/index.vue
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+ 立即排班
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/packages/screen/src/views/WarningManagement/law/index.js b/packages/screen/src/views/WarningManagement/law/index.js
index 2186224..02ed2e6 100644
--- a/packages/screen/src/views/WarningManagement/law/index.js
+++ b/packages/screen/src/views/WarningManagement/law/index.js
@@ -17,9 +17,22 @@ const model = reactive({
width: '',
});
const form = reactive({
+ headline: '',
+ onset: '',
+ expires: '',
+ eventType: '',
+ weatherSource: '',
+ urgency: '',
+ areaCodes: [],
});
const INIT_FORM = {
-
+ headline: '',
+ onset: '',
+ expires: '',
+ eventType: '',
+ weatherSource: '',
+ urgency: '',
+ areaCodes: [],
};
// 抽屉内容
const drawer = reactive({
@@ -200,8 +213,9 @@ const openAddDialog = () => {
modelVisible.value = false;
};
model.onConfirm = async () => {
- await dialogRef?.value?.dynamicComponentRef?.formRef.validate().then(() => {
- console.log('@@@@@发布预警', form);
+ await dialogRef?.value?.dynamicComponentRef?.formRef.validate().then(async () => {
+ // console.log('@@@@@发布预警', form);
+ await publishWarning(form)
})
.catch((err) => {
ElMessage.error('请处理表单中的错误项');
@@ -211,6 +225,34 @@ const openAddDialog = () => {
modelVisible.value = true;
}
+// 发布预警
+const publishWarning = async (data) => {
+ try {
+ const loading = ElLoading.service({
+ lock: true,
+ text: '操作中',
+ background: 'rgba(0, 0, 0, 0.7)',
+ })
+ const res = await request({
+ url: '/snow-ops-platform/lawWeatherWarning/publish',
+ method: 'POST',
+ data
+ })
+ loading.close();
+ if (res.code === '00000') {
+ ElMessage.success('操作成功');
+ modelVisible.value = false;
+ getTableData(filterData);
+
+ } else {
+ throw new Error(res.message)
+ }
+ } catch (error) {
+ ElMessage.error('操作失败');
+ console.error('操作失败:', error);
+ }
+}
+
// 打开详情弹窗
const openDetailDrawer = (row) => {
drawer.title = '预警详情';
@@ -221,16 +263,67 @@ const openDetailDrawer = (row) => {
drawerVisible.value = true;
}
+// 上传线下帮扶
+const uploadFile = async (file) => {
+ if (!file) {
+ ElMessage.warning('请选择要上传的文件');
+ return;
+ }
+
+ try {
+ // 创建FormData对象
+ const formData = new FormData();
+ formData.append('file', file);
+
+ const loading = ElLoading.service({
+ lock: true,
+ text: '操作中',
+ background: 'rgba(0, 0, 0, 0.7)',
+ })
+
+ // 发送POST请求
+ const res = await request({
+ url: '/snow-ops-platform/fgc-xxbf/upload',
+ method: 'POST',
+ data: formData,
+ headers: {
+ 'Content-Type': 'multipart/form-data'
+ }
+ });
+
+ // 关闭加载提示
+ loading.close();
+
+ if (res.code === '00000') {
+ ElMessage.success('文件上传成功');
+ } else {
+ throw new Error(res.message || '上传失败');
+ }
+ } catch (error) {
+ ElMessage.error(error.message || '文件上传失败');
+ console.error('文件上传失败:', error);
+ }
+}
+
+
+
export default () => {
const router = useRouter();
+ // 跳转到台账页面
const gotoLedgerPage = () => {
router.push({
path: '/ledgerManagement3'
});
};
+ // 跳转到值班管理
+ const gotoDutyPage = () => {
+ router.push({
+ path: '/dutyManagement'
+ });
+ };
onMounted(() => {
getTableData();
@@ -254,6 +347,7 @@ export default () => {
pagination,
columns,
gotoLedgerPage,
+ gotoDutyPage,
modelVisible,
model,
@@ -262,5 +356,7 @@ export default () => {
dialogRef,
drawerRef,
openAddDialog,
+
+ uploadFile,
}
}
\ No newline at end of file
diff --git a/packages/screen/src/views/WarningManagement/law/index.vue b/packages/screen/src/views/WarningManagement/law/index.vue
index f526f85..d3c5acd 100644
--- a/packages/screen/src/views/WarningManagement/law/index.vue
+++ b/packages/screen/src/views/WarningManagement/law/index.vue
@@ -13,9 +13,12 @@
生成报告
发布预警
-
+ 上传线下帮扶
线下帮扶台账
+ 立即排班
+ 值班管理
导出
+
@@ -39,6 +42,7 @@