Bläddra i källkod

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	src/types/components.d.ts
Hwf 7 månader sedan
förälder
incheckning
3b45ef6073

+ 1 - 1
.env.development

@@ -18,7 +18,7 @@ VITE_APP_MONITOR_ADMIN = 'http://localhost:9090/admin/applications'
 # SnailJob 控制台地址
 VITE_APP_SNAILJOB_ADMIN = 'http://localhost:8800/snail-job'
 
-VITE_APP_PORT = 80
+VITE_APP_PORT = 8086
 
 # 接口加密功能开关(如需关闭 后端也必须对应关闭)
 VITE_APP_ENCRYPT = false

+ 29 - 15
src/api/informationissue/informationissue.ts

@@ -22,24 +22,38 @@ export function getInformationView(params) {
     params: params
   });
 }
+
+export function getTemplateList(data) {
+  return request({
+    url: '/api/info_publish/back/template_list',
+    method: 'post',
+    data: data
+  });
+}
+
 // 新增信息申请
-export function getInformationAdd(data) {
+export function addInformation(data) {
   return request({
     url: '/api/info_publish/back/create',
     method: 'post',
-    data: {
-      title: data.title,
-      publish_group: data.publish_group,
-      template_id: data.template_id,
-      content: data.content,
-      response_type: data.response_type,
-      publish_time: data.publish_time,
-      examine_by: data.examine_by,
-      publish_channel: data.publish_channel,
-      user_count: data.user_count,
-      users: data.users,
-      attachs: data.attachs,
-      examine_attachs: data.examine_attachs
-    }
+    data: data
   });
 }
+
+// 列出发送明细
+export function getSentList(params) {
+  return request({
+    url: '/api/info_publish/back/sent_list',
+    method: 'get',
+    params: params
+  });
+}
+
+// 提交审批
+export function submitExamine(data) {
+  return request({
+    url: '/api/info_publish/back/submit_examine',
+    method: 'post',
+    data: data
+  });
+}

+ 1 - 10
src/types/components.d.ts

@@ -38,7 +38,6 @@ declare module 'vue' {
     ElForm: typeof import('element-plus/es')['ElForm']
     ElFormItem: typeof import('element-plus/es')['ElFormItem']
     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']
@@ -51,10 +50,8 @@ declare module 'vue' {
     ElRadioGroup: typeof import('element-plus/es')['ElRadioGroup']
     ElRow: typeof import('element-plus/es')['ElRow']
     ElScrollbar: typeof import('element-plus/es')['ElScrollbar']
+    ElSegmented: typeof import('element-plus/es')['ElSegmented']
     ElSelect: typeof import('element-plus/es')['ElSelect']
-    ElSkeleton: typeof import('element-plus/es')['ElSkeleton']
-    ElSkeletonItem: typeof import('element-plus/es')['ElSkeletonItem']
-    ElSlider: typeof import('element-plus/es')['ElSlider']
     ElSubMenu: typeof import('element-plus/es')['ElSubMenu']
     ElSwitch: typeof import('element-plus/es')['ElSwitch']
     ElTable: typeof import('element-plus/es')['ElTable']
@@ -76,20 +73,16 @@ declare module 'vue' {
     HikvisionPlayer: typeof import('./../components/HKVideo/hikvision-player.vue')['default']
     HKVideo: typeof import('./../components/HKVideo/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']
     Index2: typeof import('./../components/Dialog/index2.vue')['default']
     LangSelect: typeof import('./../components/LangSelect/index.vue')['default']
-    Map: typeof import('./../components/Map/index.vue')['default']
     ModalVideo: typeof import('./../components/HKVideo/modal-video.vue')['default']
     MultiInstanceUser: typeof import('./../components/Process/multiInstanceUser.vue')['default']
     Pagination: typeof import('./../components/Pagination/index.vue')['default']
     ParentView: typeof import('./../components/ParentView/index.vue')['default']
-    QuickZoom: typeof import('./../components/Map/quickZoom.vue')['default']
     Render: typeof import('./../components/BuildCode/render.vue')['default']
     RightToolbar: typeof import('./../components/RightToolbar/index.vue')['default']
     RoleSelect: typeof import('./../components/RoleSelect/index.vue')['default']
@@ -100,13 +93,11 @@ declare module 'vue' {
     Step: typeof import('./../components/Step/index.vue')['default']
     SubmitVerify: typeof import('./../components/Process/submitVerify.vue')['default']
     SvgIcon: typeof import('./../components/SvgIcon/index.vue')['default']
-    TimeAxis: typeof import('./../components/TimeAxis/index.vue')['default']
     TopNav: typeof import('./../components/TopNav/index.vue')['default']
     TreeSelect: typeof import('./../components/TreeSelect/index.vue')['default']
     UserSelect: typeof import('./../components/UserSelect/index.vue')['default']
     VideoContainer: typeof import('./../components/HKVideo/video-container.vue')['default']
     VideoContainer2: typeof import('./../components/HKVideo/video-container2.vue')['default']
-    YztMap: typeof import('./../components/Map/YztMap/index.vue')['default']
   }
   export interface ComponentCustomProperties {
     vLoading: typeof import('element-plus/es')['ElLoadingDirective']

+ 175 - 159
src/views/informationissue/informationApplication.vue

@@ -5,142 +5,113 @@
         <h3 class="common-dialog-title">信息发布申请</h3>
       </div>
       <div class="common-dialog-box">
-        <el-form ref="form" :model="formData" :rules="rules" label-width="120px">
+        <el-form ref="formRef" :model="formData" :rules="rules" label-width="120px">
           <h4 class="common-dialog-title">信息内容</h4>
           <div class="box1">
             <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-radio label="预设模板">预设模板</el-radio>
-                <el-radio label="自定义模板">自定义模板</el-radio>
+              <el-radio-group v-model="formData.template_type">
+                <el-radio value="0">预设模板</el-radio>
+                <el-radio value="1">自定义模板</el-radio>
               </el-radio-group>
             </el-form-item>
-            <el-form-item v-if="formData.templateType === '预设模板'" label="预设模板:" prop="presetTemplate">
-              <el-select v-model="selectedPresetTemplate" placeholder="请选择预设模板" style="width: 300px !important">
+            <el-form-item v-if="formData.template_type === '0'" label="预设模板:" prop="template_type">
+              <el-select v-model="formData.template_id" placeholder="请选择预设模板" style="width: 300px !important" @change="handleTemplateIdChanged">
                 <el-option v-for="option in presetTemplates" :key="option.value" :label="option.label" :value="option.value"></el-option>
               </el-select>
-              <el-text class="common-btn-text-primary" @click="showExample">样例</el-text>
+              <el-text class="common-btn-text-primary" @click="showTemplateExample">样例</el-text>
             </el-form-item>
-            <el-form-item v-if="formData.templateType === '自定义模板'" prop="customPageUrl">
-              <el-input v-model="formData.customPageUrl" placeholder="请输入自定义详情页面链接地址" style="width: 468px !important" />
+            <el-form-item v-if="formData.template_type === '1'" prop="template_url">
+              <el-input v-model="formData.template_url" 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" :rows="4" type="textarea" placeholder="请输入信息内容" style="width: 468px !important"></el-input>
             </el-form-item>
-            <el-form-item label="上传附件:" prop="files">
-              <el-upload
-                ref="upload"
-                :on-preview="handlePreview"
-                :on-remove="handleRemove"
-                :before-upload="beforeUpload"
-                :on-success="handleSuccess"
-                :file-list="files"
-                list-type="text"
-                multiple
-                :limit="3"
-                :on-exceed="handleExceed"
-                action="https://jsonplaceholder.typicode.com/posts/"
-              >
-                <el-button size="small" type="primary">点击上传</el-button>
-                <template #tip>
-                  <div class="el-upload__tip">支持扩展名: .doc, .docx, .pdf, .jpg</div>
-                </template>
-              </el-upload>
+            <el-form-item label="上传附件:" prop="attachs">
+              <file-upload v-model="formData.attachs" :limit="4" :file-type="['pdf', 'doc', 'docx', 'jpg', 'png']" />
             </el-form-item>
           </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-text class="common-btn-text-primary" @click="showReleaseList">查看详情</el-text>
+              ><span class="highlight-text">已选择{{ formData.user_count }}人</span>
+              <el-text class="common-btn-text-primary" @click="toggleReleaseList">查看详情</el-text>
             </el-form-item>
             <el-row :gutter="18">
-              <el-col :span="12">
-                <el-form-item label="发布时间:" prop="releaseTime">
-                  <el-radio-group v-model="formData.releaseType">
-                    <el-radio :label="'now'" @change="publishNow">立即发布</el-radio>
-                    <el-radio :label="'schedule'">定时发布</el-radio>
+              <el-col :span="14">
+                <el-form-item label="发布时间:" prop="publish_time">
+                  <el-radio-group v-model="formData.publish_type">
+                    <el-radio :value="'0'" @change="publishNow">立即发布</el-radio>
+                    <el-radio :value="'1'">定时发布</el-radio>
                   </el-radio-group>
-                  <div v-if="formData.releaseType === 'now'">发布时间:{{ formattedCurrentTime }}</div>
-                  <el-date-picker v-else v-model="formData.releaseTime" type="datetime" placeholder="选择发布时间" />
+                  <div v-if="formData.publish_type === '0'" style="min-width:240px;">发布时间:{{ formattedCurrentTime }}</div>
+                  <el-date-picker v-else v-model="formData.publish_time" type="datetime" placeholder="选择发布时间" style="width: 250px !important" />
                 </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: 300px !important">
+              <el-select v-model="formData.response_type" placeholder="请选择消息反馈方式">
                 <el-option v-for="option in feedbackOptions" :key="option.value" :label="option.label" :value="option.value"></el-option>
               </el-select>
             </el-form-item>
           </div>
           <h4 class="common-dialog-title">审核配置</h4>
           <div class="box1">
-            <el-form-item label="审核材料:" prop="auditMaterials">
-              <el-upload
-                ref="auditUpload"
-                :on-preview="handlePreview"
-                :on-remove="handleRemove"
-                :before-upload="beforeUpload"
-                :on-success="handleSuccess"
-                :file-list="auditMaterials"
-                list-type="text"
-                multiple
-                :limit="3"
-                :on-exceed="handleExceed"
-                action="https://jsonplaceholder.typicode.com/posts/"
-              >
-                <el-button size="small" type="primary">点击上传</el-button>
-                <template #tip>
-                  <div class="el-upload__tip">允许上传的文件格式:doc、docx、pdf、jpg、png</div>
-                </template>
-              </el-upload>
+            <el-form-item label="审核材料:" prop="examine_attachs">
+              <file-upload v-model="formData.examine_attachs" :limit="4" :file-type="['pdf', 'doc', 'docx', 'jpg', 'png']" />
             </el-form-item>
             <el-form-item label="审核人:" prop="auditor">
-              <el-input v-model="formData.auditor" placeholder="请输入审核人姓名" style="width: 368px !important" />
+              <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 type="primary" @click="submitForm">提交</el-button>
+          -->
+          <el-button :loading="buttonLoading" type="primary" @click="submitForm">提交</el-button>
         </div>
       </div>
     </div>
   </div>
+  <ContactSelect v-model="contactSelectState.show" :tree-data="treeContactSelectData" :default-check-data="selectContactSelectData" @confirm="handleContactSelectData" />
 </template>
 
 <script setup lang="ts">
-import { ref } from 'vue';
+import { ref, onMounted } from 'vue';
 import { ElMessage } from 'element-plus';
-import { getInformationAdd } from '@/api/informationissue/informationissue';
+import { addInformation, getTemplateList } from '@/api/informationissue/informationissue';
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+
+const formRef = ref(null);
+const buttonLoading = ref(false);
 
 const formData = ref({
   title: '',
-  publishUnit: '',
-  templateType: '',
+  publish_group: '',
+  template_type: '0',
+  template_id: '',
+  template_url: '',
   content: '',
-  presetTemplate: '',
-  customPageUrl: '',
-  releaseList: 0,
-  releaseType: 'now', // 默认选择立即发布
-  releaseTime: '', // 存储定时发布的时间
-  feedbackWay: '',
-  examineBy: '',
-  timing: '',
-  materials: '',
+  publish_type: '0', // 默认选择立即发布
+  publish_time: '', // 存储定时发布的时间
+  response_type: '',
+  examine_by: '',
   attachs: [],
-  examineAttachs: []
+  examine_attachs: [],
+  user_count: 0,
+  users: [],
+  publish_channel: "粤政易" // 默认
 });
 
-const files = ref([]);
-const auditMaterials = ref([]);
-const formattedCurrentTime = ref(formatTime(new Date().toISOString()));
 const formatTime = (isoString) => {
   const date = new Date(isoString);
   const year = date.getFullYear();
@@ -152,102 +123,147 @@ const formatTime = (isoString) => {
   return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
 };
 const publishNow = () => {
-  formData.value.releaseTime = new Date().toISOString(); // 设置当前时间为发布时间
+  formattedCurrentTime.value = formatTime(new Date().toISOString()); // 设置当前时间为发布时间
 };
+const formattedCurrentTime = ref(formatTime(new Date().toISOString()));
 
 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' }],
-  examineBy: [{ required: true, message: '请填写审核人', trigger: 'blur' }]
+  content: [{ required: true, message: '请填写信息内容', trigger: 'blur' }],
+  publish_group: [{ required: true, message: '请填写发布单位', trigger: 'blur' }],
+  publish_time: [{ required: true, message: '请选择发布时间', trigger: 'change' }],
+  response_type: [{ required: true, message: '请选择消息反馈方式', trigger: 'change' }],
+  examine_by: [{ required: true, message: '请填写审核人', trigger: 'blur' }],
+  attachs: [{
+    validator: (rule, value, callback) => {
+      if (value.length == 0) {
+        return callback(new Error('请上传附件'))
+      } else {
+        callback();
+      }     
+    },
+    trigger: 'change'
+  }],
+  examine_attachs: [{
+    validator: (rule, value, callback) => {
+      if (value.length == 0) {
+        return callback(new Error('请上传审批附件'))
+      } else {
+        callback();
+      }     
+    },
+    trigger: 'change'
+  }]
 };
 
 const feedbackOptions = [
-  { value: '仅需阅读', label: '仅需阅读' },
-  { value: '点击确认', label: '点击确认' },
-  { value: '签字确认', label: '签字确认' }
+  { value: '0', label: '仅需阅读' },
+  { value: '1', label: '点击确认' },
+  { value: '2', label: '签字确认' }
 ];
 
-const presetTemplates = [
-  { value: 'template1', label: '模板一' },
-  { value: 'template2', label: '模板二' }
-];
-const selectedPresetTemplate = ref('');
-const selectedPresetTemplateExample = ref('');
-watch(selectedPresetTemplate, (newVal) => {
-  selectedPresetTemplateExample.value = presetTemplateExamples[newVal] || '';
-});
-
-const handlePreview = (file) => {
-  console.log(file);
-};
-
-const handleRemove = (file, fileList) => {
-  console.log(file, fileList);
-};
+const presetTemplates = ref([]);
 
-const beforeUpload = (file) => {
-  // 处理文件上传前的逻辑
-  const isValidType = ['doc', 'docx', 'pdf', 'jpg', 'png'].includes(file.name.split('.').pop().toLowerCase());
-  if (!isValidType) {
-    ElMessage.error('不支持的文件类型');
-    return false;
-  }
-  return true;
-};
-
-const handleSuccess = (response, file, fileList) => {
-  console.log(response, file, fileList);
+const submitForm = () => {
+  formRef.value?.validate(async (valid) => {
+    if (valid) {
+      if(formData.value.user_count <= 0) {
+        proxy?.$modal.msgError('请选择发布名单');
+        return;
+      }
+      formData.value.users = selectContactSelectData.value.map((u) => ({ user_id: u.userId, nick_name: u.label }));
+      try {
+        buttonLoading.value = true;
+        await addInformation(formData.value);
+        proxy?.$modal.msgSuccess('信息发布申请已提交');
+      } finally {
+        buttonLoading.value = false;
+      }
+    }
+  });
 };
 
-const showReleaseList = () => {
-  ElMessage.info('点击了查看发布名单');
+const showTemplateExample = () => {
+  ElMessage.info('点击了查看模板样例');
 };
-const submitForm = () => {
-  if (validateFormData()) {
-    // 构建要提交的数据对象
-    const submitData = {
-      title: formData.value.title,
-      publish_group: formData.value.publishUnit,
-      template_id: formData.value.templateType === '0' ? parseInt(selectedPresetTemplate.value) : null,
-      content: formData.value.messageContent,
-      response_type: formData.value.feedbackWay,
-      publish_time: formData.value.releaseType === 'now' ? new Date().toISOString() : formData.value.releaseTime,
-      examine_by: formData.value.auditor, // 假设审核人姓名字段是 'auditor'
-      publish_channel: '', // 确保这个字段有适当的值
-      user_count: formData.value.releaseList,
-      users: [], // 确保这个字段有适当的值
-      attachs: files.value.map((file) => ({ file_name: file.name })),
-      examine_attachs: auditMaterials.value.map((file) => ({ file_name: file.name }))
-    };
 
-    // 调用 API 提交数据
-    getInformationAdd(submitData)
-      .then(() => {
-        ElMessage.success('信息发布申请已提交');
-        // 处理响应,可能需要清空表单或进行其他操作
-      })
-      .catch((error) => {
-        ElMessage.error('提交失败: ' + error.message);
-      });
-  }
-};
+const handleTemplateIdChanged = async(value: any) => {
+  const n = presetTemplates.value.find(i => i.value === value );
+  formData.value.content = n.content;
+}
 
-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;
+// 通讯录(用玉波做的接口改成动态获取)
+const treeContactSelectData = 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: '张力'
+      }
+    ]
   }
-  return isValid;
+]);
+let contactSelectState = reactive({
+  show: false
+});
+const selectContactSelectData = ref([]);
+const handleContactSelectData = (data) => {
+  selectContactSelectData.value = data;
+  formData.value.user_count = data.length;
 };
+const toggleReleaseList = () => {
+  contactSelectState.show = !contactSelectState.show;
+};
+
+onMounted(() => {
+  formData.value.publish_time = formattedCurrentTime.value;
+  getTemplateList({}).then((res)=>{
+    res.data.forEach((item, index) => {
+      presetTemplates.value.push({value:item.name, label: item.name, content: item.content});
+    });
+  })
+});
 </script>
 
 <style scoped>

+ 85 - 90
src/views/informationissue/informationApproval.vue

@@ -20,23 +20,24 @@
                       <el-input v-model="formData.publish_group" disabled placeholder="请输入发布单位" style="width: 468px !important" />
                     </el-form-item>
 
-                    <el-form-item label="信息模板:" prop="template_id">
-                      <el-radio-group v-model="formData.template_id" disabled>
-                        <el-radio label="预设模板">预设模板</el-radio>
-                        <el-radio label="自定义模板">自定义模板</el-radio>
+                    <el-form-item label="信息模板:" prop="template_type">
+                      <el-radio-group v-model="formData.template_type" disabled>
+                        <el-radio value="0">预设模板</el-radio>
+                        <el-radio value="1">自定义模板</el-radio>
                       </el-radio-group>
                     </el-form-item>
-                    <el-form-item v-if="formData.template_id === '预设模板'" label="预设模板:" prop="presetTemplate">
-                      <el-select v-model="selectedPresetTemplate" placeholder="请选择预设模板" style="width: 300px !important">
+                    <el-form-item v-if="formData.template_type === '0'" label="预设模板:" prop="presetTemplate">
+                      <el-select v-model="formData.template_id" 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>
-                      <el-text class="common-btn-text-primary" @click="showExample">样例</el-text>
+                      <el-text class="common-btn-text-primary" @click="showTemplateExample">样例</el-text>
                     </el-form-item>
-                    <el-form-item v-if="formData.template_id === '自定义模板'" prop="customPageUrl">
-                      <el-input v-model="formData.customPageUrl" placeholder="请输入自定义详情页面链接地址" style="width: 468px !important" />
+                    <el-form-item v-if="formData.template_id === '1'" prop="template_url">
+                      <el-input v-model="formData.template_url" placeholder="请输入自定义详情页面链接地址" style="width: 468px !important" />
                     </el-form-item>
                     <el-form-item label="信息内容:" prop="content">
                       <el-input
+                        :rows="4"
                         v-model="formData.content"
                         type="textarea"
                         disabled
@@ -46,7 +47,7 @@
                     </el-form-item>
                     <el-form-item label="查看附件:">
                       <ul>
-                        <li v-for="(file, index) in files" :key="index" @click="viewFile(file)">
+                        <li v-for="(file, index) in formData.attachs" :key="index" @click="viewFile(file)">
                           {{ file.name }}
                         </li>
                       </ul>
@@ -76,10 +77,10 @@
                   </div>
                   <h4 class="common-dialog-title">审核配置</h4>
                   <div class="box1">
-                    <el-form-item label="审核材料:" prop="materials">
+                    <el-form-item label="审核材料:" prop="examine_attachs">
                       <ul>
-                        <li v-for="(material, index) in auditMaterials" :key="index">
-                          {{ material }}
+                        <li v-for="(file, index) in formData.examine_attachs" :key="index" @click="viewFile(file)">
+                          {{ file.name }}
                         </li>
                       </ul>
                     </el-form-item>
@@ -99,17 +100,17 @@
               <div class="common-dialog-box">
                 <div class="approval-process">
                   <div class="box1">
-                    <el-form ref="form" :model="formData" :rules="rules" label-width="120px">
+                    <el-form ref="form2Ref" :model="form2" :rules="form2rules" label-width="120px">
                       <h4>审批意见</h4>
-                      <el-form-item label="审批状态:" prop="approvalStatus">
-                        <el-select v-model="formData.approvalStatus" placeholder="请选择审批状态" style="width: 500px !important">
+                      <el-form-item label="审批状态:" prop="examine_type">
+                        <el-select v-model="form2.examine_type" placeholder="请选择审批状态" style="width: 500px !important">
                           <el-option label="审批通过" value="approved"></el-option>
                           <el-option label="审批不通过" value="rejected"></el-option>
                         </el-select>
                       </el-form-item>
                       <!-- 添加具体意见的输入框 -->
-                      <el-form-item label="具体意见:" prop="approvalComment">
-                        <el-input v-model="formData.approvalComment" type="textarea" placeholder="请输入具体意见" style="width: 500px"></el-input>
+                      <el-form-item label="具体意见:" prop="content">
+                        <el-input v-model="form2.content" type="textarea" :rows="4" placeholder="请输入具体意见" style="width: 500px"></el-input>
                       </el-form-item>
                     </el-form>
                   </div>
@@ -119,16 +120,16 @@
                       <p v-if="processingTime">已用时:{{ processingTime }}</p>
                     </div>
                     <el-timeline style="width: 700px">
-                      <template v-for="(item, index) in approvalSteps" :key="index">
+                      <template v-for="(item, index) in formData.examines" :key="index">
                         <el-timeline-item placement="top">
                           <el-card>
-                            <h4>{{ item.status }}</h4>
-                            <p v-if="item.handler">
-                              处理人:<span>{{ item.handler }}</span
-                              >&nbsp;&nbsp;&nbsp;&nbsp;时间:{{ item.time }}
+                            <h4>{{ item.examine_type }}</h4>
+                            <p v-if="item.nick_name">
+                              处理人:<span>{{ item.nick_name }}</span
+                              >&nbsp;&nbsp;&nbsp;&nbsp;时间:{{ item.examine_time }}
                             </p>
-                            <p v-if="item.result">处理结果:{{ item.result }}</p>
-                            <p v-if="item.comment">具体意见:{{ item.comment }}</p>
+                            <p v-if="item.examine_sub_type">处理结果:{{ item.examine_sub_type }}</p>
+                            <p v-if="item.content">具体意见:{{ item.content }}</p>
                           </el-card>
                         </el-timeline-item>
                       </template>
@@ -141,22 +142,24 @@
         </el-row>
         <div class="common-dialog-footer">
           <el-button @click="$emit('close')">返回</el-button>
+          <!--
           <el-button :disabled="true">编辑</el-button>
-          <el-button :disabled="true">提交</el-button>
+          -->
+          <el-button :loading="buttonLoading" :disabled="buttonDisabled" type="primary" @click="submitForm">提交</el-button>
         </div>
       </div>
     </div>
   </div>
-  <SendDetail v-if="sendDetailState.show" :event-id="sendDetailState.eventId" @close="handleCancel" />
-  <ShowReleaseDetail v-if="showReleaseDetailState.show" :event-id="showReleaseDetailState.eventId" @close="handleCancel" />
+  <ShowReleaseDetail v-if="showReleaseDetailState.show" :info_id="showReleaseDetailState.eventId" @close="handleCancel" />
 </template>
 
 <script setup lang="ts">
 import { reactive, ref } from 'vue';
 import { ElMessage } from 'element-plus';
-import SendDetail from './sendDetail.vue';
 import ShowReleaseDetail from './showReleaseDetail.vue';
-import { getInformationView } from '@/api/informationissue/informationissue';
+import { getInformationView, getTemplateList, submitExamine } from '@/api/informationissue/informationissue';
+const { proxy } = getCurrentInstance() as ComponentInternalInstance;
+
 const processingTime = '1小时 6分22秒';
 const props = defineProps({
   eventId: {
@@ -167,7 +170,9 @@ const props = defineProps({
 const formData = ref({
   title: '',
   publish_group: '',
+  template_type: '',
   template_id: '',
+  template_url: '',
   content: '',
   user_count: '',
   releaseTime: '',
@@ -176,64 +181,14 @@ const formData = ref({
   publish_time: '',
   materials: '',
   processingTime: '',
-  examines: []
+  examines: [],
+  attachs: [],
+  examine_attachs: []
 });
 
-const auditMaterials = ['2023年4月29日广东省发布突发事件预警信息.pdf', '审核材料2'];
-const rules = {
-  approvalStatus: [{ required: true, message: '请选择审批状态', trigger: 'change' }]
-};
-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 presetTemplates = [
-  { value: 'template1', label: '模板一' },
-  { value: 'template2', label: '模板二' }
-];
-const selectedPresetTemplate = ref('');
-const approvalSteps = ref([
-  {
-    status: '提交',
-    handler: '李四',
-    result: '提交',
-    time: '2023-05-17 10:00',
-    comment: '无'
-  },
-  {
-    status: '领导审批',
-    handler: '王五',
-    result: '审批通过',
-    time: '2023-05-17 13:00',
-    comment: '无'
-  },
-  {
-    status: '重新提交',
-    handler: '李四',
-    result: '重新提交',
-    time: '2023-05-17 12:00',
-    comment: '无'
-  },
-  {
-    status: '领导审批',
-    handler: '王五',
-    result: '审批通过',
-    time: '2023-05-17 13:00',
-    comment: '无'
-  },
-  {
-    status: '结束',
-    handler: '',
-    result: '',
-    time: '2023-05-17 14:00',
-    comment: ''
-  }
-]);
+
+const presetTemplates = ref([]);
+
 const feedbackTextMap = {
   0: '仅需阅读',
   1: '点击确认',
@@ -247,20 +202,22 @@ const displayFeedbackText = computed({
     formData.value.response_type = Object.keys(feedbackTextMap).find((key) => feedbackTextMap[key] === value);
   }
 });
-let sendDetailState = reactive({
-  show: false,
-  eventId: ''
-});
 let showReleaseDetailState = reactive({
   show: false,
   eventId: ''
 });
 const showReleaseDetail = () => {
+  showReleaseDetailState.eventId = props.eventId;
   showReleaseDetailState.show = true;
 };
 const handleCancel = () => {
   showReleaseDetailState.show = false;
 };
+
+const showTemplateExample = () => {
+  ElMessage.info('点击了查看模板样例');
+};
+
 const viewFile = (file) => {
   window.open(file.url, '_blank'); // 打开新标签页
 };
@@ -272,14 +229,52 @@ const fetchInformation = async () => {
     const response = await getInformationView({ info_id: props.eventId });
     if (response && response.data) {
       formData.value = response.data;
+      form2.value.info_id = props.eventId;
     }
   } catch (error) {
     console.error('Failed to fetch information:', error);
   }
 };
+
+// 审批form
+const form2Ref = ref(null);
+const buttonLoading = ref(false);
+const buttonDisabled = ref(false);
+
+const form2 = ref({
+  info_id: '',
+  examine_type: '',
+  content: ''
+});
+
+const form2rules = {
+  examine_type: [{ required: true, message: '请选择审批意见', trigger: 'blur' }],
+  content: [{ required: true, message: '请填写具体意见', trigger: 'blur' }],
+};
+
+const submitForm = () => {
+  form2Ref.value?.validate(async (valid) => {
+    if (valid) {
+      try {
+        buttonLoading.value = true;
+        await submitExamine(form2.value);
+        proxy?.$modal.msgSuccess('审批意见已提交');
+        buttonDisabled.value = true;
+      } finally {
+        buttonLoading.value = false;
+      }
+    }
+  });
+};
+
 // 在组件挂载时调用 fetchInformation
 onMounted(() => {
   fetchInformation();
+  getTemplateList({}).then((res)=>{
+    res.data.forEach((item, index) => {
+      presetTemplates.value.push({value:item.name, label: item.name, content: item.content});
+    });
+  })
 });
 </script>
 

+ 7 - 2
src/views/informationissue/informationDetail.vue

@@ -24,7 +24,7 @@
               <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>
-              <el-text class="common-btn-text-primary" @click="showExample">样例</el-text>
+              <el-text class="common-btn-text-primary" @click="showTemplateExample">样例</el-text>
             </el-form-item>
             <el-form-item v-if="formData.template_id === '自定义模板'" prop="customPageUrl">
               <el-input v-model="formData.customPageUrl" placeholder="请输入自定义详情页面链接地址" style="width: 468px !important" />
@@ -102,7 +102,7 @@
 
 <script setup lang="ts">
 import { reactive, ref, watch } from 'vue';
-import { getInformationView, getInformationUpdate } from '@/api/informationissue/informationissue';
+import { getInformationView, getInformationUpdate, getTemplateList } from '@/api/informationissue/informationissue';
 import { ElMessage } from 'element-plus';
 import ContactSelect from '@/components/ContactSelect/index.vue';
 const props = defineProps<{
@@ -211,6 +211,11 @@ const feedbackTextMap = {
   2: '签字确认'
 };
 
+
+const showTemplateExample = () => {
+  ElMessage.info('点击了查看模板样例');
+};
+
 // 创建一个计算属性,根据 formData 中的 response_type 返回对应的文本
 const displayFeedbackText = computed({
   get() {

+ 83 - 69
src/views/informationissue/informationList.vue

@@ -5,28 +5,26 @@
         <div v-show="showSearch">
           <el-form ref="queryFormRef" :model="queryParams" label-width="100px">
             <el-row :gutter="20">
-              <el-col :span="5">
-                <el-form-item label="处理状态:">
-                  <el-select v-model="queryParams.disposeStatus" placeholder="全部" clearable>
-                    <el-option v-for="item in disposeStatusOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
-                  </el-select>
-                </el-form-item>
+              <el-col :span="7">
+                <el-segmented v-model="queryParams.dispose_status" :options="disposeStatusOptions" size="large" block @change="handleDisposeStatus" />
               </el-col>
+            </el-row>
+            <el-row :gutter="20">
               <el-col :span="5">
                 <el-form-item label="发布单位:">
-                  <el-input v-model="queryParams.publishUnit" placeholder="请输入内容" clearable></el-input>
+                  <el-input v-model="queryParams.publish_group" placeholder="请输入内容" clearable></el-input>
                 </el-form-item>
               </el-col>
               <el-col :span="5">
                 <el-form-item label="发布状态:">
-                  <el-select v-model="queryParams.publishStatus" placeholder="请选择">
+                  <el-select v-model="queryParams.publish_status" placeholder="请选择">
                     <el-option v-for="item in publishStatusOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
                   </el-select>
                 </el-form-item>
               </el-col>
               <el-col :span="5">
                 <el-form-item label="审批状态:">
-                  <el-select v-model="queryParams.approvalStatus" placeholder="请选择">
+                  <el-select v-model="queryParams.examine_status" placeholder="请选择">
                     <el-option v-for="item in approvalStatusOptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
                   </el-select>
                 </el-form-item>
@@ -44,43 +42,43 @@
       <!-- 表格组件 -->
       <el-table ref="multipleTable" v-loading="loading" :data="tableData" @selection-change="handleSelectionChange">
         <el-table-column label="序号" align="center" prop="id" />
-        <el-table-column label="发布单位" align="center" prop="publishUnit" />
-        <el-table-column label="信息内容" align="center" prop="informationContent" />
-        <el-table-column label="发布时间" align="center" prop="publishTime" />
-        <el-table-column label="发布渠道" align="center" prop="publishChannel" />
-        <el-table-column label="发布申请人" align="center" prop="applyPerson" />
-        <el-table-column label="待处理人" align="center" prop="pendingPerson" />
-        <el-table-column label="发布状态" align="center" prop="publishStatus">
+        <el-table-column label="发布单位" align="center" prop="publish_group" />
+        <el-table-column label="信息内容" align="center" prop="content" />
+        <el-table-column label="发布时间" align="center" prop="publish_time" />
+        <el-table-column label="发布渠道" align="center" prop="publish_channel" />
+        <el-table-column label="发布申请人" align="center" prop="nick_name" />
+        <el-table-column label="待处理人" align="center" prop="examine_user" />
+        <el-table-column label="发布状态" align="center" prop="publish_status">
           <template #default="scope">
             <div class="common-flex">
-              <i :class="getStatusClass(scope.row.publishStatus)"></i>
-              <dict-tag :options="publishStatusOptions" :value="scope.row.publishStatus" />
+              <i :class="getStatusClass(scope.row.publish_status)"></i>
+              <dict-tag :options="publishStatusOptions" :value="scope.row.publish_status" />
             </div>
           </template>
         </el-table-column>
-        <el-table-column label="审批状态" align="center" prop="approvalStatus">
+        <el-table-column label="审批状态" align="center" prop="examine_status">
           <template #default="scope">
             <div class="common-flex">
-              <i :class="getStatusClass2(scope.row.approvalStatus)"></i>
-              <dict-tag :options="approvalStatusOptions" :value="scope.row.approvalStatus" />
+              <i :class="getStatusClass2(scope.row.examine_status)"></i>
+              <dict-tag :options="approvalStatusOptions" :value="scope.row.examine_status" />
             </div>
           </template>
         </el-table-column>
         <el-table-column label="发布统计" align="center" prop="statistics">
           <template #default="scope">
             <div class="statistics-container">
-              <p>选择人数: {{ scope.row.userCount }}</p>
-              <p>成功: {{ scope.row.successCount }}</p>
-              <p>失败: {{ scope.row.errorCount }}</p>
-              <p>发送中: {{ scope.row.sendingCount }}</p>
+              <p>选择人数: {{ scope.row.user_count }}</p>
+              <p>成功: {{ scope.row.user_ok_count }}</p>
+              <p>失败: {{ scope.row.user_err_count }}</p>
+              <p>发送中: {{ scope.row.user_sending_count }}</p>
             </div>
           </template>
         </el-table-column>
         <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
           <template #default="scope">
             <el-text class="common-btn-text-primary" @click="handleView(scope.row)">查看</el-text>
-            <el-text class="common-btn-text-primary" @click="handleUpdate(scope.row)">编辑</el-text>
-            <el-text class="common-btn-text-primary" @click="handleApproval(scope.row)">审批</el-text>
+            <el-text class="common-btn-text-primary" v-if="(scope.row && scope.row.is_my_edit)" @click="handleUpdate(scope.row)">编辑</el-text>
+            <el-text class="common-btn-text-primary" v-if="(scope.row && scope.row.is_my_examine)" @click="handleApproval(scope.row)">审批</el-text>
           </template>
         </el-table-column>
       </el-table>
@@ -104,19 +102,19 @@ const loading = ref(true);
 const ids = ref([]);
 const selectedRow = ref(null);
 const initFormData = reactive({
-  publishUnit: '',
-  publishStatus: '',
-  approvalStatus: '',
-  disposeStatus: '',
-  informationContent: '',
-  publishTime: '',
-  publishChannel: '',
-  applyPerson: '',
-  pendingPerson: '',
-  userCount: '',
-  successCount: '',
-  errorCount: '',
-  sendingCount: '',
+  publish_group: '',
+  publish_status: '',
+  examine_status: '',
+  dispose_status: '',
+  content: '',
+  publish_time: '',
+  publish_channel: '',
+  nick_name: '',
+  examine_user: '',
+  user_count: '',
+  user_ok_count: '',
+  user_err_count: '',
+  user_sending_count: '',
   id: ''
 });
 // 表单数据
@@ -125,31 +123,35 @@ const data = reactive({
   queryParams: {
     page: 1,
     page_size: 10,
-    publishUnit: '',
-    publishStatus: '',
-    approvalStatus: '',
-    disposeStatus: ''
+    publish_group: '',
+    publish_status: '',
+    examine_status: '',
+    dispose_status: '0'
   }
 });
 const { queryParams, form } = toRefs(data);
 const total = ref(0);
 
 const publishStatusOptions = reactive([
-  { value: '发布中', label: '发布中' },
-  { value: '已发布', label: '已发布' },
-  { value: '未提交', label: '未提交' }
+  { value: '0', label: '全部' },
+  { value: '1', label: '草稿' },
+  { value: '2', label: '审批中' },
+  { value: '3', label: '发布中' },
+  { value: '4', label: '已发布' }
 ]);
 
 const approvalStatusOptions = reactive([
-  { value: '审批通过', label: '审批通过' },
-  { value: '待审批', label: '待审批' },
-  { value: '审批中', label: '审批中' },
-  { value: '未提交', label: '未提交' }
+  { value: '0', label: '全部' },
+  { value: '1', label: '待审批' },
+  { value: '2', label: '审批中' },
+  { value: '3', label: '审批通过' },
+  { value: '9', label: '审批不通过' }
 ]);
+
 const disposeStatusOptions = reactive([
-  { value: '全部', label: '全部' },
-  { value: '待处理', label: '待处理' },
-  { value: '已处理', label: '已处理' }
+  { value: '0', label: '全部' },
+  { value: '1', label: '待处理' },
+  { value: '2', label: '已处理' }
 ]);
 
 const getStatusClass = (value) => {
@@ -173,31 +175,40 @@ const getStatusClass2 = (value) => {
     return 'dot-grey';
   }
 };
+
+const handleDisposeStatus = (val: any) => {
+  queryParams.value.dispose_status = val;
+  handleSearch();
+}
+
 const handleSearch = () => {
   queryParams.value.page = 1;
   getList();
 };
 
 const resetSearch = () => {
-  queryParams.value = { page: 1, page_size: 10, publishUnit: '', publishStatus: '', approvalStatus: '' };
+  queryParams.value = { page: 1, page_size: 10, publish_group: '', publish_status: '', examine_status: '', dispose_status: '0' };
   handleSearch();
 };
 
 const handleSelectionChange = (selection) => {
   ids.value = selection.map((item) => item.eventId);
   selectedRow.value = selection.length === 1 ? selection[0] : null;
-  single.value = selection.length != 1;
-  multiple.value = !selection.length;
 };
 
+// 查看详情对话框
 let informationDetailState = reactive({
   show: false,
   eventId: ''
 });
+
+// 编辑对话框
 let informationViewState = reactive({
   show: false,
   eventId: ''
 });
+
+// 审批对话框
 let informationApprovalState = reactive({
   show: false,
   eventId: ''
@@ -222,6 +233,7 @@ const handleApproval = (row) => {
     informationApprovalState.show = true;
   }
 };
+
 const handleCancel = () => {
   informationDetailState.show = false;
   informationViewState.show = false;
@@ -236,18 +248,20 @@ const getList = () => {
         // 映射返回的数据到 tableData
         tableData.value = res.data.map((item) => ({
           id: item.id,
-          publishUnit: item.publish_group || '未知',
-          informationContent: item.content || '未知',
-          publishTime: item.publish_time || '未知',
-          publishChannel: item.publish_channel || '未知',
-          applyPerson: item.nick_name || '未知',
-          pendingPerson: item.dept_name || '未知',
-          publishStatus: item.publish_status,
-          approvalStatus: item.examine_status,
-          userCount: item.user_count || 0,
-          successCount: item.user_ok_count || 0,
-          errorCount: item.user_err_count || 0,
-          sendingCount: item.user_sending_count || 0
+          publish_group: item.publish_group || '未知',
+          content: item.content || '未知',
+          publish_time: item.publish_time || '未知',
+          publish_channel: item.publish_channel || '未知',
+          nick_name: item.nick_name || '未知',
+          examine_user: item.examine_user || '未知',
+          publish_status: item.publish_status,
+          examine_status: item.examine_status,
+          user_count: item.user_count || 0,
+          user_ok_count: item.user_ok_count || 0,
+          user_err_count: item.user_err_count || 0,
+          user_sending_count: item.user_sending_count || 0,
+          is_my_examine: item.is_my_examine || false,
+          is_my_edit: item.is_my_edit || false
         }));
         total.value = res.total;
       } else {

+ 58 - 32
src/views/informationissue/informationView.vue

@@ -27,7 +27,7 @@
                       <p>成功 {{ formData.user_ok_count }} | 失败 {{ formData.user_err_count }} | 发送中 {{ formData.user_sending_count }}</p>
                     </el-col>
                     <el-col :span="8">
-                      <p>反馈 {{ feedbackCount }} | 未反馈 {{ unresponsiveCount }}</p>
+                      <p>反馈 {{ formData.feedback_count }} | 未反馈 {{ formData.unresponsive_count }}</p>
                     </el-col>
                   </el-row>
                 </div>
@@ -53,27 +53,27 @@
                       <el-input v-model="formData.publish_group" disabled placeholder="请输入发布单位" style="width: 468px !important" />
                     </el-form-item>
 
-                    <el-form-item label="信息模板:" prop="template_id">
-                      <el-radio-group v-model="formData.template_id" disabled>
-                        <el-radio label="预设模板">预设模板</el-radio>
-                        <el-radio label="自定义模板">自定义模板</el-radio>
+                    <el-form-item label="信息模板:" prop="template_type">
+                      <el-radio-group v-model="formData.template_type" disabled>
+                        <el-radio value="0">预设模板</el-radio>
+                        <el-radio value="1">自定义模板</el-radio>
                       </el-radio-group>
                     </el-form-item>
-                    <el-form-item v-if="formData.template_id === '预设模板'" label="预设模板:" prop="presetTemplate">
-                      <el-select v-model="selectedPresetTemplate" placeholder="请选择预设模板" style="width: 300px !important">
+                    <el-form-item v-if="formData.template_type === '0'" label="预设模板:" prop="template_type">
+                      <el-select v-model="formData.template_id" 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>
-                      <el-text class="common-btn-text-primary" @click="showExample">样例</el-text>
+                      <el-text class="common-btn-text-primary" @click="showTemplateExample">样例</el-text>
                     </el-form-item>
-                    <el-form-item v-if="formData.template_id === '自定义模板'" prop="customPageUrl">
-                      <el-input v-model="formData.customPageUrl" placeholder="请输入自定义详情页面链接地址" style="width: 468px !important" />
+                    <el-form-item v-if="formData.template_id === '1'" prop="template_url">
+                      <el-input v-model="formData.template_url" placeholder="请输入自定义详情页面链接地址" style="width: 468px !important" />
                     </el-form-item>
                     <el-form-item label="信息内容:" prop="content">
-                      <el-input v-model="formData.content" type="textarea" disabled placeholder="请输入信息内容" style="width: 468px !important"></el-input>
+                      <el-input v-model="formData.content" :rows="4" type="textarea" disabled placeholder="请输入信息内容" style="width: 468px !important"></el-input>
                     </el-form-item>
                     <el-form-item label="查看附件:">
                       <ul>
-                        <li v-for="(file, index) in files" :key="index" @click="viewFile(file)">
+                        <li v-for="(file, index) in formData.attachs" :key="index" @click="viewFile(file)">
                           {{ file.name }}
                         </li>
                       </ul>
@@ -103,10 +103,10 @@
                   </div>
                   <h4 class="common-dialog-title">审核配置</h4>
                   <div class="box1">
-                    <el-form-item label="审核材料:" prop="materials">
+                    <el-form-item label="审核材料:" prop="examine_attachs">
                       <ul>
-                        <li v-for="(material, index) in auditMaterials" :key="index">
-                          {{ material }}
+                        <li v-for="(file, index) in formData.examine_attachs" :key="index" @click="viewFile(file)">
+                          {{ file.name }}
                         </li>
                       </ul>
                     </el-form-item>
@@ -131,6 +131,20 @@
                       <p v-if="processingTime">已用时:{{ processingTime }}</p>
                     </div>
                     <el-timeline style="width: 700px">
+                      <template v-for="(item, index) in formData.examines" :key="index">
+                        <el-timeline-item placement="top">
+                          <el-card>
+                            <h4>{{ item.examine_type }}</h4>
+                            <p v-if="item.nick_name">
+                              处理人:<span>{{ item.nick_name }}</span
+                              >&nbsp;&nbsp;&nbsp;&nbsp;时间:{{ item.examine_time }}
+                            </p>
+                            <p v-if="item.examine_sub_type">处理结果:{{ item.examine_sub_type }}</p>
+                            <p v-if="item.content">具体意见:{{ item.content }}</p>
+                          </el-card>
+                        </el-timeline-item>
+                      </template>
+                      <!--
                       <template v-for="(item, index) in approvalSteps" :key="index">
                         <el-timeline-item placement="top">
                           <el-card>
@@ -144,6 +158,7 @@
                           </el-card>
                         </el-timeline-item>
                       </template>
+                      -->
                     </el-timeline>
                   </div>
                 </div>
@@ -159,16 +174,14 @@
       </div>
     </div>
   </div>
-  <SendDetail v-if="sendDetailState.show" :event-id="sendDetailState.eventId" @close="handleCancel" />
+  <SendDetail v-if="sendDetailState.show" :info_id="sendDetailState.info_id" @close="handleCancel" />
 </template>
 
 <script setup lang="ts">
 import { reactive, ref } from 'vue';
-import { getInformationView } from '@/api/informationissue/informationissue';
+import { getInformationView, getTemplateList } from '@/api/informationissue/informationissue';
 import { ElMessage } from 'element-plus';
 import SendDetail from './sendDetail.vue';
-const feedbackCount = 3000;
-const unresponsiveCount = 2;
 const processingTime = '1小时 6分22秒';
 const props = defineProps({
   eventId: {
@@ -180,29 +193,34 @@ const formData = ref({
   title: '',
   publish_group: '',
   template_id: '',
+  template_url: '',
+  template_type: '',
   content: '',
   user_count: '',
   user_ok_count: '',
   user_err_count: '',
   user_sending_count: '',
-  releaseTime: '',
+  publish_type: '',
   response_type: '',
   examine_by: '',
   publish_time: '',
   materials: '',
-  processingTime: '',
-  examines: []
+  add_time: '',
+  examines: [],
+  feedback_count: 0,
+  unresponsive_count: 0,
+  attachs: [],
+  examine_attachs: []
 });
 
+const rules = ref({});
+
 const auditMaterials = ['2023年4月29日广东省发布突发事件预警信息.pdf', '审核材料2'];
 const files = ref([
   { name: '2023年4月29日广东省发布突发事件预警信息.pdf', url: '/path/to/file1.pdf' },
   { name: '2023年5月15日广东省发布突发事件预警信息.docx', url: '/path/to/file2.docx' }
 ]);
-const presetTemplates = [
-  { value: 'template1', label: '模板一' },
-  { value: 'template2', label: '模板二' }
-];
+const presetTemplates = ref([]);
 const selectedPresetTemplate = ref('');
 const approvalSteps = ref([
   {
@@ -257,7 +275,7 @@ const displayFeedbackText = computed({
 });
 let sendDetailState = reactive({
   show: false,
-  eventId: ''
+  info_id: ''
 });
 const handleCancel = () => {
   sendDetailState.show = false;
@@ -265,12 +283,15 @@ const handleCancel = () => {
 const viewFile = (file) => {
   window.open(file.url, '_blank'); // 打开新标签页
 };
-const showSendDetails = (row) => {
-  if (row) {
-    sendDetailState.eventId = row.id; // 假设eventId是id字段
-    sendDetailState.show = true;
-  }
+const showSendDetails = () => {
+  sendDetailState.info_id = props.eventId; // 假设eventId是id字段
+  sendDetailState.show = true;
 };
+
+const showTemplateExample = () => {
+  ElMessage.info('点击了查看模板样例');
+};
+
 const publishNow = () => {
   ElMessage.info('点击了立即发布');
 };
@@ -286,6 +307,11 @@ const fetchInformation = async () => {
 };
 // 在组件挂载时调用 fetchInformation
 onMounted(() => {
+  getTemplateList({}).then((res)=>{
+    res.data.forEach((item, index) => {
+      presetTemplates.value.push({value:item.name, label: item.name, content: item.content});
+    });
+  })
   fetchInformation();
 });
 </script>

+ 32 - 14
src/views/informationissue/sendDetail.vue

@@ -49,10 +49,10 @@
         <!-- 表格组件 -->
         <el-table ref="multipleTable" v-loading="loading" :data="tableData" @selection-change="handleSelectionChange">
           <el-table-column prop="no" label="序号" width="180"></el-table-column>
-          <el-table-column prop="name" label="姓名"></el-table-column>
-          <el-table-column prop="phone" label="手机号码"></el-table-column>
-          <el-table-column prop="organization" label="组织"></el-table-column>
-          <el-table-column prop="feedbackMethod" label="反馈方式"></el-table-column>
+          <el-table-column prop="nick_name" label="姓名"></el-table-column>
+          <el-table-column prop="yzy_account" label="手机号码"></el-table-column>
+          <el-table-column prop="dept_name" label="组织"></el-table-column>
+          <el-table-column prop="publish_channel" label="反馈方式"></el-table-column>
           <el-table-column prop="yuezhengyiStatus" label="粤政易" width="180">
             <template #default="{ row }">
               <el-tag
@@ -89,6 +89,11 @@
 <script setup lang="ts">
 import { reactive, ref, toRefs } from 'vue';
 import { ElMessage } from 'element-plus';
+import { getSentList } from '@/api/informationissue/informationissue';
+
+const props = defineProps<{
+  info_id: string;
+}>();
 
 // 初始化查询条件
 const initFormData = reactive({
@@ -105,6 +110,7 @@ const data = reactive({
   queryParams: {
     page: 1,
     page_size: 10,
+    info_id: '',
     channel: '',
     publishStatus: '',
     feedbackStatus: '',
@@ -119,16 +125,19 @@ const data = reactive({
   feedbackStatusOptions: [] // 反馈状态选项
 });
 
-const { queryParams, form, tableData, loading, total, showSearch } = toRefs(data);
+const { queryParams, form, tableData, loading, total, showSearch, channelOptions, publishStatusOptions, feedbackStatusOptions } = toRefs(data);
 
 // 获取表格数据
 const fetchTableData = () => {
   // 模拟数据获取逻辑
-  const mockData = [
-    // 示例数据...
-  ];
-  tableData.value = mockData;
-  total.value = mockData.length;
+  //const mockData = [
+  //  {name: '张三', phone: '13800138000', organization: '市应急局', feedbackMethod: '粤政易'}
+  //];
+  getSentList(queryParams.value).then((res)=> {
+    console.log(res.data)
+    tableData.value = res.data;
+    total.value = res.total;
+  })
 };
 
 // 处理搜索
@@ -164,8 +173,8 @@ const handleTagClose = (row) => {
 // 初始化选项数据
 const initOptions = () => {
   data.channelOptions = [
-    { value: 'channel1', label: '渠道一' },
-    { value: 'channel2', label: '渠道二' }
+    { value: '粤政易', label: '粤政易' },
+    { value: '好心网格', label: '好心网格' }
   ];
   data.publishStatusOptions = [
     { value: 'published', label: '已发布' },
@@ -178,6 +187,15 @@ const initOptions = () => {
 };
 initOptions(); // 初始化选项数据
 
-// 请求数据模拟
-fetchTableData();
+watch(
+  () => props.info_id,
+  (newVal) => {
+    if (newVal) {
+      console.log('-----------');
+      queryParams.value.info_id = props.info_id
+      fetchTableData();
+    }
+  },
+  { immediate: true }
+);
 </script>

+ 36 - 33
src/views/informationissue/showReleaseDetail.vue

@@ -1,19 +1,19 @@
 <template>
-  <el-dialog v-model="showSearch" title="发送明细" width="80%" @close="$emit('close')">
+  <el-dialog v-model="showSearch" title="发送明细" width="800px" @close="$emit('close')">
     <div class="app-container">
       <div>
         <transition name="fade">
           <div v-show="showSearch">
-            <el-form ref="queryFormRef" :model="queryParams" label-width="100px">
+            <el-form ref="queryFormRef" :model="queryParams" label-width="50px">
               <el-row :gutter="20">
-                <el-col :span="5">
+                <el-col :span="8">
                   <el-form-item label="渠道:">
                     <el-select v-model="queryParams.channel" placeholder="全部">
                       <el-option v-for="(option, index) in channelOptions" :key="index" :label="option.label" :value="option.value"></el-option>
                     </el-select>
                   </el-form-item>
                 </el-col>
-                <el-col :span="5">
+                <el-col :span="8">
                   <el-form-item>
                     <el-input v-model="queryParams.searchInput" placeholder="输入关键字搜索"></el-input>
                   </el-form-item>
@@ -30,8 +30,8 @@
         <!-- 表格组件 -->
         <el-table ref="multipleTable" v-loading="loading" :data="tableData" @selection-change="handleSelectionChange">
           <el-table-column prop="no" label="序号" width="180"></el-table-column>
-          <el-table-column prop="name" label="姓名"></el-table-column>
-          <el-table-column prop="organization" label="组织"></el-table-column>
+          <el-table-column prop="nick_name" label="姓名"></el-table-column>
+          <el-table-column prop="dept_name" label="组织"></el-table-column>
         </el-table>
         <pagination v-show="total > 0" v-model:page="queryParams.page" v-model:limit="queryParams.page_size" :total="total" @pagination="fetchTableData" />
       </div>
@@ -42,13 +42,17 @@
 <script setup lang="ts">
 import { reactive, ref, toRefs } from 'vue';
 import { ElMessage } from 'element-plus'; // 引入提示信息模块
+import { getSentList } from '@/api/informationissue/informationissue';
+
+const props = defineProps<{
+  info_id: string;
+}>();
+
+const queryFormRef = ref(null);
 
 // 初始化查询条件
 const initFormData = reactive({
   channel: '',
-  publishStatus: '',
-  approvalStatus: '',
-  disposeStatus: '',
   searchInput: '' // 添加搜索输入字段
 });
 
@@ -57,10 +61,9 @@ const data = reactive({
   form: { ...initFormData },
   queryParams: {
     page: 1,
-    page_size: 10,
+    page_size: 5,
+    info_id: '',
     channel: '',
-    publishStatus: '',
-    feedbackStatus: '',
     searchInput: '' // 同步搜索输入字段
   },
   tableData: [],
@@ -68,20 +71,20 @@ const data = reactive({
   total: 0,
   showSearch: true,
   channelOptions: [], // 渠道选项
-  publishStatusOptions: [], // 发布状态选项
-  feedbackStatusOptions: [] // 反馈状态选项
 });
 
-const { queryParams, form, tableData, loading, total, showSearch } = toRefs(data);
+const { queryParams, form, tableData, loading, total, showSearch, channelOptions } = toRefs(data);
 
 // 获取表格数据
 const fetchTableData = () => {
-  // 模拟数据获取逻辑
-  const mockData = [
-    // 示例数据...
-  ];
-  tableData.value = mockData;
-  total.value = mockData.length;
+  loading.value == true;
+  getSentList(queryParams.value).then((res)=> {
+    console.log(res.data)
+    tableData.value = res.data;
+    total.value = res.total;
+  }).finally(()=>{
+    loading.value = false;
+  })
 };
 
 // 处理搜索
@@ -117,20 +120,20 @@ const handleTagClose = (row) => {
 // 初始化选项数据
 const initOptions = () => {
   data.channelOptions = [
-    { value: 'channel1', label: '渠道一' },
-    { value: 'channel2', label: '渠道二' }
-  ];
-  data.publishStatusOptions = [
-    { value: 'published', label: '已发布' },
-    { value: 'pending', label: '待发布' }
-  ];
-  data.feedbackStatusOptions = [
-    { value: 'approved', label: '已审批' },
-    { value: 'rejected', label: '未通过' }
+    { value: '粤政易', label: '粤政易' },
+    { value: '好心网格', label: '好心网格' }
   ];
 };
 initOptions(); // 初始化选项数据
 
-// 请求数据模拟
-fetchTableData();
+watch(
+  () => props.info_id,
+  (newVal) => {
+    if (newVal) {
+      queryParams.value.info_id = props.info_id
+      fetchTableData();
+    }
+  },
+  { immediate: true }
+);
 </script>