فهرست منبع

Merge branch 'dev' of https://gogs.tjp.com.cn/maoming/yjhtgl-web into dev

lizhouming 9 ماه پیش
والد
کامیت
d8a628d59a

+ 0 - 8
src/api/duty/eventing.ts

@@ -79,11 +79,3 @@ export function uploadEventCasualties(data) {
     data: data
   });
 }
-// 获取信息发布列表
-export function getInformation(params) {
-  return request({
-    url: '/api/info_publish/back/list',
-    method: 'get',
-    params: params
-  });
-}

+ 24 - 0
src/api/informationissue/informationissue.ts

@@ -0,0 +1,24 @@
+import request from '@/utils/request';
+// 获取信息发布列表
+export function getInformation(params) {
+  return request({
+    url: '/api/info_publish/back/list',
+    method: 'get',
+    params: params
+  });
+}
+// 查看信息详情
+export function getInformationUpdate(data) {
+  return request({
+    url: '/api/info_publish/back/edit',
+    method: 'post',
+    data: data
+  });
+}
+export function getInformationView(params) {
+  return request({
+    url: '/api/info_publish/back/edit',
+    method: 'get',
+    params: params
+  });
+}

+ 0 - 20
src/types/components.d.ts

@@ -23,14 +23,9 @@ declare module 'vue' {
     ElBadge: typeof import('element-plus/es')['ElBadge']
     ElButton: typeof import('element-plus/es')['ElButton']
     ElCard: typeof import('element-plus/es')['ElCard']
-    ElCheckbox: typeof import('element-plus/es')['ElCheckbox']
-    ElCheckboxGroup: typeof import('element-plus/es')['ElCheckboxGroup']
     ElCol: typeof import('element-plus/es')['ElCol']
-    ElCollapse: typeof import('element-plus/es')['ElCollapse']
-    ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem']
     ElColorPicker: typeof import('element-plus/es')['ElColorPicker']
     ElConfigProvider: typeof import('element-plus/es')['ElConfigProvider']
-    ElContainer: typeof import('element-plus/es')['ElContainer']
     ElDatePicker: typeof import('element-plus/es')['ElDatePicker']
     ElDescriptions: typeof import('element-plus/es')['ElDescriptions']
     ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem']
@@ -43,25 +38,17 @@ declare module 'vue' {
     ElEmpty: typeof import('element-plus/es')['ElEmpty']
     ElForm: typeof import('element-plus/es')['ElForm']
     ElFormItem: typeof import('element-plus/es')['ElFormItem']
-    ElHeader: typeof import('element-plus/es')['ElHeader']
     ElIcon: typeof import('element-plus/es')['ElIcon']
     ElImage: typeof import('element-plus/es')['ElImage']
     ElInput: typeof import('element-plus/es')['ElInput']
-    ElInputNumber: typeof import('element-plus/es')['ElInputNumber']
-    ElLink: typeof import('element-plus/es')['ElLink']
-    ElMain: typeof import('element-plus/es')['ElMain']
     ElMenu: typeof import('element-plus/es')['ElMenu']
     ElMenuItem: typeof import('element-plus/es')['ElMenuItem']
     ElOption: typeof import('element-plus/es')['ElOption']
     ElPagination: typeof import('element-plus/es')['ElPagination']
     ElPopover: typeof import('element-plus/es')['ElPopover']
-    ElRadio: typeof import('element-plus/es')['ElRadio']
-    ElRadioButton: typeof import('element-plus/es')['ElRadioButton']
-    ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
     ElRow: typeof import('element-plus/es')['ElRow']
     ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
     ElSelect: typeof import('element-plus/es')['ElSelect']
-    ElSpace: typeof import('element-plus/es')['ElSpace']
     ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
     ElSwitch: typeof import('element-plus/es')['ElSwitch']
     ElTable: typeof import('element-plus/es')['ElTable']
@@ -70,19 +57,12 @@ declare module 'vue' {
     ElTabs: typeof import('element-plus/es')['ElTabs']
     ElTag: typeof import('element-plus/es')['ElTag']
     ElText: typeof import('element-plus/es')['ElText']
-    ElTimeline: typeof import('element-plus/es')['ElTimeline']
-    ElTimelineItem: typeof import('element-plus/es')['ElTimelineItem']
     ElTooltip: typeof import('element-plus/es')['ElTooltip']
-    ElTree: typeof import('element-plus/es')['ElTree']
-    ElTreeSelect: typeof import('element-plus/es')['ElTreeSelect']
     ElUpload: typeof import('element-plus/es')['ElUpload']
     FileUpload: typeof import('./../components/FileUpload/index.vue')['default']
     Hamburger: typeof import('./../components/Hamburger/index.vue')['default']
     HeaderSearch: typeof import('./../components/HeaderSearch/index.vue')['default']
     IconSelect: typeof import('./../components/IconSelect/index.vue')['default']
-    IEpCaretBottom: typeof import('~icons/ep/caret-bottom')['default']
-    IEpCaretTop: typeof import('~icons/ep/caret-top')['default']
-    IEpUploadFilled: typeof import('~icons/ep/upload-filled')['default']
     IFrame: typeof import('./../components/iFrame/index.vue')['default']
     ImagePreview: typeof import('./../components/ImagePreview/index.vue')['default']
     ImageUpload: typeof import('./../components/ImageUpload/index.vue')['default']

+ 116 - 66
src/views/informationissue/informationDetail.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="common-dialog">
+  <div v-if="eventId" class="common-dialog">
     <div class="common-dialog-content">
       <div class="common-dialog-title-box">
         <h3 class="common-dialog-title">信息详情</h3>
@@ -11,18 +11,16 @@
             <el-form-item label="标题:" prop="title">
               <el-input v-model="formData.title" placeholder="请输入标题" style="width: 468px !important" />
             </el-form-item>
-
-            <el-form-item label="发布单位:" prop="publishUnit">
-              <el-input v-model="formData.publishUnit" placeholder="请输入发布单位" style="width: 468px !important" />
+            <el-form-item label="发布单位:" prop="publish_group">
+              <el-input v-model="formData.publish_group" placeholder="请输入发布单位" style="width: 468px !important" />
             </el-form-item>
-
-            <el-form-item label="信息模板:" prop="templateType">
-              <el-radio-group v-model="formData.templateType">
+            <el-form-item label="信息模板:" prop="template_id">
+              <el-radio-group v-model="formData.template_id">
                 <el-radio label="预设模板">预设模板</el-radio>
                 <el-radio label="自定义模板">自定义模板</el-radio>
               </el-radio-group>
             </el-form-item>
-            <el-form-item v-if="formData.templateType === '预设模板'" label="预设模板:" prop="presetTemplate">
+            <el-form-item v-if="formData.template_id === '预设模板'" label="预设模板:" prop="presetTemplate">
               <el-select v-model="selectedPresetTemplate" placeholder="请选择预设模板" style="width: 300px !important">
                 <el-option v-for="option in presetTemplates" :key="option.value" :label="option.label" :value="option.value"></el-option>
               </el-select>
@@ -31,8 +29,8 @@
             <el-form-item v-if="formData.templateType === '自定义模板'" prop="customPageUrl">
               <el-input v-model="formData.customPageUrl" placeholder="请输入自定义详情页面链接地址" style="width: 468px !important" />
             </el-form-item>
-            <el-form-item label="信息内容:" prop="messageContent">
-              <el-input v-model="formData.messageContent" type="textarea" placeholder="请输入信息内容" style="width: 468px !important"></el-input>
+            <el-form-item label="信息内容:" prop="content">
+              <el-input v-model="formData.content" type="textarea" placeholder="请输入信息内容" style="width: 468px !important"></el-input>
             </el-form-item>
             <el-form-item label="查看附件:">
               <ul>
@@ -44,8 +42,8 @@
           </div>
           <h4 class="common-dialog-title">推送配置</h4>
           <div class="box1">
-            <el-form-item label="发布名单:" prop="releaseList" style="width: 468px !important"
-              ><span class="highlight-text">已选择{{ formData.releaseList }}人</span>
+            <el-form-item label="发布名单:" prop="user_count" style="width: 468px !important">
+              <span class="highlight-text">已选择{{ formData.user_count }}人</span>
               <el-text class="common-btn-text-primary" @click="showReleaseList">查看详情</el-text>
             </el-form-item>
             <el-row :gutter="18">
@@ -54,14 +52,14 @@
                   <el-button type="text" @click="publishNow">立即发布</el-button>
                 </el-form-item>
               </el-col>
-              <el-col :span="12">
-                <el-form-item label="定时发布:" prop="timing">
-                  <el-date-picker v-model="formData.timing" type="datetime" placeholder="选择发布时间"></el-date-picker>
+              <el-col :span="13">
+                <el-form-item label="定时发布:" prop="publish_time">
+                  <el-date-picker v-model="formData.publish_time" type="datetime" placeholder="选择发布时间"></el-date-picker>
                 </el-form-item>
               </el-col>
             </el-row>
-            <el-form-item label="消息反馈方式:" prop="feedbackWay" style="width: 468px !important">
-              <el-select v-model="formData.feedbackWay" placeholder="请选择消息反馈方式">
+            <el-form-item label="消息反馈方式:" prop="response_type" style="width: 468px !important">
+              <el-select v-model="displayFeedbackText" placeholder="请选择消息反馈方式">
                 <el-option v-for="option in feedbackOptions" :key="option.value" :label="option.label" :value="option.value"></el-option>
               </el-select>
             </el-form-item>
@@ -75,13 +73,13 @@
                 </li>
               </ul>
             </el-form-item>
-            <el-form-item label="审核人:" prop="auditor">
-              <el-input v-model="formData.auditor" placeholder="请输入审核人姓名" style="width: 368px !important" />
+            <el-form-item label="审核人:" prop="examine_by">
+              <el-input v-model="formData.examine_by" placeholder="请输入审核人姓名" style="width: 368px !important" />
             </el-form-item>
           </div>
         </el-form>
         <div class="common-dialog-footer">
-          <el-button @click="$emit('close')">返回</el-button>
+          <el-button @click="closeDialog">返回</el-button>
           <el-button @click="submitForm">编辑</el-button>
           <el-button type="primary" @click="submitForm">提交</el-button>
         </div>
@@ -91,83 +89,132 @@
 </template>
 
 <script setup lang="ts">
-import { ref } from 'vue';
+import { ref, watch } from 'vue';
+import { getInformationView, getInformationUpdate } from '@/api/informationissue/informationissue';
 import { ElMessage } from 'element-plus';
+
+const props = defineProps<{
+  eventId: string | number;
+}>();
+const emit = defineEmits<{
+  (e: 'close'): void;
+}>();
+
 const formData = ref({
   title: '',
-  publishUnit: '',
-  templateType: '',
-  messageContent: '',
-  releaseList: 0,
+  publish_group: '',
+  template_id: '',
+  content: '',
+  user_count: 0,
   releaseTime: '',
-  feedbackWay: '',
-  auditor: '',
-  timing: '',
+  response_type: '',
+  examine_by: '',
+  publish_time: '',
   materials: ''
 });
 
-const auditMaterials = ['2023年4月29日广东省发布突发事件预警信息.pdf', '审核材料2'];
+const presetTemplates = [
+  { value: 'template1', label: '模板一' },
+  { value: 'template2', label: '模板二' }
+];
 
-const rules = {
-  title: [{ required: true, message: '请填写标题', trigger: 'blur' }],
-  publishUnit: [{ required: true, message: '请填写发布单位', trigger: 'blur' }],
-  releaseList: [{ required: true, message: '请选择发布名单', trigger: 'change' }],
-  timing: [{ required: true, message: '请选择发布时间', trigger: 'change' }],
-  feedbackWay: [{ required: true, message: '请选择消息反馈方式', trigger: 'change' }],
-  auditor: [{ required: true, message: '请填写审核人', trigger: 'blur' }]
-};
-// 假定这里有多个文件
-const files = ref([
-  { name: '2023年4月29日广东省发布突发事件预警信息.pdf', url: '/path/to/file1.pdf' },
-  { name: '2023年5月15日上海市发布突发事件预警信息.docx', url: '/path/to/file2.docx' }
-]);
 const feedbackOptions = [
   { value: '仅需阅读', label: '仅需阅读' },
   { value: '点击确认', label: '点击确认' },
   { value: '签字确认', label: '签字确认' }
 ];
-// 查看文件的方法
-const viewFile = (file) => {
-  window.open(file.url, '_blank'); // 打开新标签页
-};
-const presetTemplates = [
-  { value: 'template1', label: '模板一' },
-  { value: 'template2', label: '模板二' }
-];
+
 const selectedPresetTemplate = ref('');
 const selectedPresetTemplateExample = ref('');
-watch(selectedPresetTemplate, (newVal) => {
-  selectedPresetTemplateExample.value = presetTemplateExamples[newVal] || '';
+
+const files = ref([
+  { name: '2023年4月29日广东省发布突发事件预警信息.pdf', url: '/path/to/file1.pdf' },
+  { name: '2023年5月15日上海市发布突发事件预警信息.docx', url: '/path/to/file2.docx' }
+]);
+// 在原有的反馈选项数组的基础上,创建一个映射对象(map object)
+const feedbackTextMap = {
+  0: '仅需阅读',
+  1: '点击确认',
+  2: '签字确认'
+};
+
+// 创建一个计算属性,根据 formData 中的 response_type 返回对应的文本
+const displayFeedbackText = computed({
+  get() {
+    return feedbackTextMap[formData.value.response_type];
+  },
+  set(value) {
+    // 当选择器的值改变时,将对应的 key 值设置到 formData 中
+    formData.value.response_type = Object.keys(feedbackTextMap).find((key) => feedbackTextMap[key] === value);
+  }
 });
+const auditMaterials = ['2023年4月29日广东省发布突发事件预警信息.pdf', '审核材料2'];
+
+const fetchDetail = async () => {
+  try {
+    const response = await getInformationView({ info_id: props.eventId });
+    if (response.code === 200) {
+      formData.value = response.data;
+    } else {
+      ElMessage.error(response.msg);
+    }
+  } catch (error) {
+    ElMessage.error('获取信息详情失败,请稍后再试');
+  }
+};
+
+watch(
+  () => props.eventId,
+  (newVal) => {
+    if (newVal) {
+      fetchDetail();
+    }
+  },
+  { immediate: true }
+);
+
+const viewFile = (file) => {
+  window.open(file.url, '_blank'); // 打开新标签页
+};
 
 const showReleaseList = () => {
   ElMessage.info('点击了查看发布名单');
 };
+
 const publishNow = () => {
   ElMessage.info('点击了立即发布');
 };
-const submitForm = () => {
+
+const submitForm = async () => {
   if (validateFormData()) {
-    ElMessage.success('表单提交成功');
+    try {
+      // 将 formData 与 eventId 一同发送到后端
+      const requestData = { ...formData.value, info_id: props.eventId };
+      const response = await getInformationUpdate(requestData);
+      if (response.code === 200) {
+        ElMessage.success('信息更新成功');
+      } else {
+        ElMessage.error(response.msg);
+      }
+    } catch (error) {
+      ElMessage.error('更新信息失败,请稍后再试');
+    }
   }
 };
 
 const validateFormData = (): boolean => {
-  let isValid = true;
-  for (const rule of Object.values(rules)) {
-    for (const r of rule) {
-      const value = formData.value[r.field];
-      if (r.required && (!value || value.length === 0)) {
-        ElMessage.error(r.message);
-        isValid = false;
-      }
-    }
+  // 这里添加你的验证逻辑,例如检查是否所有的必填项都有值
+  if (!formData.value.title.trim()) {
+    ElMessage.error('标题不能为空');
+    return false;
   }
-  return isValid;
+  // 添加其他验证规则
+  return true;
 };
 
-// const cancel = () => {
-// };
+const closeDialog = () => {
+  emit('close');
+};
 </script>
 
 <style scoped>
@@ -180,4 +227,7 @@ const validateFormData = (): boolean => {
   font-weight: bold; /* 加粗 */
   font-size: 1.2em; /* 放大字体大小 */
 }
+.common-btn-text-primary {
+  cursor: pointer;
+}
 </style>

+ 3 - 2
src/views/informationissue/informationList.vue

@@ -93,7 +93,7 @@
 </template>
 <script setup lang="ts">
 import { ref, reactive, toRefs, onMounted } from 'vue';
-import { getInformation } from '@/api/duty/eventing'; // 假设 getInformation 已经定义好
+import { getInformation } from '@/api/informationissue/informationissue';
 import InformationDetail from './informationDetail.vue';
 import InformationView from './informationView.vue';
 import InformationApproval from './informationApproval.vue';
@@ -116,7 +116,8 @@ const initFormData = reactive({
   userCount: '',
   successCount: '',
   errorCount: '',
-  sendingCount: ''
+  sendingCount: '',
+  id: ''
 });
 // 表单数据
 const data = reactive({

+ 135 - 0
src/views/informationissue/phoneList.vue

@@ -0,0 +1,135 @@
+<template>
+  <el-dialog v-model="showSearch" title="发送明细" width="80%" @close="$emit('close')">
+    <div class="app-container home">
+      <h2 @click="show = true">智慧应急工作台</h2>
+      <ContactSelect v-model="show" :tree-data="treeData" :default-check-data="selectData" @confirm="handleData" />
+    </div>
+  </el-dialog>
+</template>
+
+<script setup name="Index" lang="ts">
+import ContactSelect from '@/components/ContactSelect/index.vue';
+const goTarget = (url: string) => {
+  window.open(url, '__blank');
+};
+let show = ref(true);
+const treeData = reactive([
+  {
+    id: 1,
+    label: '茂南区',
+    deptType: true,
+    children: [
+      {
+        id: 2,
+        userId: 1,
+        label: '李里丽'
+      },
+      {
+        id: 3,
+        userId: 2,
+        label: '何里'
+      },
+      {
+        id: 4,
+        userId: 3,
+        label: '张力'
+      }
+    ]
+  },
+  {
+    id: 5,
+    label: '电白区',
+    deptType: true,
+    children: [
+      {
+        id: 6,
+        userId: 4,
+        label: '王五'
+      },
+      {
+        id: 7,
+        userId: 5,
+        label: '冯可'
+      },
+      {
+        id: 8,
+        userId: 6,
+        label: '刘森'
+      },
+      {
+        id: 9,
+        userId: 3,
+        label: '张力'
+      }
+    ]
+  }
+]);
+const selectData = ref([]);
+const handleData = (data) => {
+  selectData.value = data;
+};
+</script>
+
+<style scoped lang="scss">
+.home {
+  blockquote {
+    padding: 10px 20px;
+    margin: 0 0 20px;
+    font-size: 17.5px;
+    border-left: 5px solid #eee;
+  }
+  hr {
+    margin-top: 20px;
+    margin-bottom: 20px;
+    border: 0;
+    border-top: 1px solid #eee;
+  }
+  .col-item {
+    margin-bottom: 20px;
+  }
+
+  ul {
+    padding: 0;
+    margin: 0;
+  }
+
+  font-family: 'open sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
+  font-size: 13px;
+  color: #676a6c;
+  overflow-x: hidden;
+
+  ul {
+    list-style-type: none;
+  }
+
+  h4 {
+    margin-top: 0px;
+  }
+
+  h2 {
+    margin-top: 10px;
+    font-size: 26px;
+    font-weight: 100;
+  }
+
+  p {
+    margin-top: 10px;
+
+    b {
+      font-weight: 700;
+    }
+  }
+
+  .update-log {
+    ol {
+      display: block;
+      list-style-type: decimal;
+      margin-block-start: 1em;
+      margin-block-end: 1em;
+      margin-inline-start: 0;
+      margin-inline-end: 0;
+      padding-inline-start: 40px;
+    }
+  }
+}
+</style>

+ 10 - 2
src/views/riskPrevention/planManage/index.vue

@@ -90,6 +90,11 @@
             <el-form-item label="发文字号:" prop="document">
               <el-input v-model="form.document" placeholder="请输入发文字号" />
             </el-form-item>
+            <el-form-item label="事件类型:" prop="event_type">
+              <el-select v-model="form.event_type" placeholder="请输入对应事件类型" clearable>
+                <el-option v-for="item in mm_event_type" :key="item.value" :label="item.label" :value="item.value"></el-option>
+              </el-select>
+            </el-form-item>
             <el-form-item label="预案附件:" prop="fileList">
               <file-upload v-model="form.fileList" />
             </el-form-item>
@@ -125,7 +130,7 @@ 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 { mm_event_type, plan_type } = toRefs<any>(proxy?.useDict('plan_type', 'mm_event_type'));
 
 const dateRange = ref<[DateModelType, DateModelType]>(['', '']);
 const planForm = reactive<PlanForm>({
@@ -142,6 +147,7 @@ let form = ref({
   document: '',
   organizingUnit: '',
   publishDate: '',
+  event_type: '',
   fileList: []
 });
 
@@ -149,6 +155,7 @@ const rules = reactive({
   planName: [{ required: true, message: '预案名称不能为空', trigger: 'blur' }],
   planType: [{ required: true, message: '预案类型不能为空', trigger: 'blur' }],
   document: [{ required: true, message: '发文字号不能为空', trigger: 'blur' }],
+  event_type: [{ required: true, message: '对应事件类型不能为空', trigger: 'blur' }],
   organizingUnit: [{ required: true, message: '编制单位不能为空', trigger: 'blur' }],
   publishDate: [{ required: true, message: '发布日期不能为空', trigger: 'blur' }]
 });
@@ -243,7 +250,8 @@ const resetForm = () => {
     planType: '',
     document: '',
     organizingUnit: '',
-    publishDate: ''
+    publishDate: '',
+    event_type: ''
   };
   demoFormRef.value?.resetFields();
 };