|
@@ -1,220 +1,318 @@
|
|
|
<template>
|
|
|
- <div class="dialog-info">
|
|
|
- <div class="dialog-contents">
|
|
|
- <div class="dialog-left">
|
|
|
- <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="101px" class="demo-ruleForm">
|
|
|
- <el-form-item label="所属社区" prop="popCommunityId">
|
|
|
- <el-select
|
|
|
- placeholder="请选择所属社区"
|
|
|
- v-model="ruleForm.popCommunityId"
|
|
|
- clearable
|
|
|
- class="dialog-select"
|
|
|
- @change="changeCommunity"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="(item, index) in communityList"
|
|
|
- :key="index"
|
|
|
- :label="item.communityName"
|
|
|
- :value="item.id"
|
|
|
- ></el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="发布对象" prop="issueRoom">
|
|
|
- <div class="issueRoom">
|
|
|
- <div class="radio-room">
|
|
|
- <el-checkbox
|
|
|
- label="社区住户"
|
|
|
- name="type"
|
|
|
- v-model="ruleForm.issueRoom.checkAll"
|
|
|
- @change="changeCheckboxRoom"
|
|
|
- ></el-checkbox>
|
|
|
- <el-radio-group
|
|
|
- v-model="ruleForm.issueRoom.radioRoom"
|
|
|
- :disabled="!ruleForm.issueRoom.checkAll"
|
|
|
- @change="changeRadioRoom"
|
|
|
- >
|
|
|
- <el-radio label="全部房间"></el-radio>
|
|
|
- <el-radio label="指定房间"></el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </div>
|
|
|
- <div class="selet-room" v-show="ruleForm.issueRoom.checkAll">
|
|
|
- <tree-house
|
|
|
- :buildingType="1"
|
|
|
- :showCheckboxTree="true"
|
|
|
- :defaultExpandAllTree="false"
|
|
|
- :accordion="true"
|
|
|
- :selectAll="true"
|
|
|
- @selectData="selectDataHouseTree"
|
|
|
- :disabledHouse="disabledHouse"
|
|
|
- ref="selectTreeHouse"
|
|
|
- ></tree-house>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="issueRoom">
|
|
|
- <div class="radio-room">
|
|
|
- <el-checkbox
|
|
|
- label="物业员工"
|
|
|
- name="type"
|
|
|
- v-model="ruleForm.issueRoom.staff"
|
|
|
- @change="changeCheckboxStaffRoom"
|
|
|
- ></el-checkbox>
|
|
|
- <el-radio-group
|
|
|
- v-model="ruleForm.issueRoom.radioStaff"
|
|
|
- :disabled="!ruleForm.issueRoom.staff"
|
|
|
- @change="changeRadioStaffRoom"
|
|
|
- >
|
|
|
- <el-radio label="全部员工"></el-radio>
|
|
|
- <el-radio label="指定员工"></el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </div>
|
|
|
- <div class="selet-room" v-show="ruleForm.issueRoom.staff">
|
|
|
- <!-- <GeminiScrollbar class="my-scroll-bar" :autoshow="true"> -->
|
|
|
- <tree-house
|
|
|
- ref="selectTreePeoples"
|
|
|
- :buildingType="1"
|
|
|
- :showCheckboxTree="true"
|
|
|
- :defaultExpandAllTree="false"
|
|
|
- :showHouseTree="false"
|
|
|
- :accordionPeople="true"
|
|
|
- :selectAll="true"
|
|
|
- @dataPeople="dataPeople"
|
|
|
- @selectPeople="selectPeople"
|
|
|
- :disabled="disabledPeople"
|
|
|
- ></tree-house>
|
|
|
- <!-- </GeminiScrollbar> -->
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="通知类型" prop="informType">
|
|
|
- <el-select
|
|
|
- v-model="ruleForm.informType"
|
|
|
- @change="changeInformType"
|
|
|
- clearable
|
|
|
- class="dialog-select"
|
|
|
- placeholder="请选择通知类型"
|
|
|
- >
|
|
|
- <el-option v-for="(item, index) in informTypes" :key="index" :label="item.label" :value="item.status">{{
|
|
|
+ <div class="dialog-info">
|
|
|
+ <div class="dialog-contents">
|
|
|
+ <div class="dialog-left">
|
|
|
+ <el-form
|
|
|
+ :model="ruleForm"
|
|
|
+ :rules="rules"
|
|
|
+ ref="ruleForm"
|
|
|
+ label-width="101px"
|
|
|
+ class="demo-ruleForm"
|
|
|
+ >
|
|
|
+ <el-form-item
|
|
|
+ label="所属社区"
|
|
|
+ prop="popCommunityId"
|
|
|
+ >
|
|
|
+ <el-select
|
|
|
+ placeholder="请选择所属社区"
|
|
|
+ v-model="ruleForm.popCommunityId"
|
|
|
+ clearable
|
|
|
+ class="dialog-select"
|
|
|
+ @change="changeCommunity"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in communityList"
|
|
|
+ :key="index"
|
|
|
+ :label="item.communityName"
|
|
|
+ :value="item.id"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ label="发布对象"
|
|
|
+ prop="issueRoom"
|
|
|
+ >
|
|
|
+ <div class="issueRoom">
|
|
|
+ <div class="radio-room">
|
|
|
+ <el-checkbox
|
|
|
+ label="社区住户"
|
|
|
+ name="type"
|
|
|
+ v-model="ruleForm.issueRoom.checkAll"
|
|
|
+ @change="changeCheckboxRoom"
|
|
|
+ ></el-checkbox>
|
|
|
+ <el-radio-group
|
|
|
+ v-model="ruleForm.issueRoom.radioRoom"
|
|
|
+ :disabled="!ruleForm.issueRoom.checkAll"
|
|
|
+ @change="changeRadioRoom"
|
|
|
+ >
|
|
|
+ <el-radio label="全部房间"></el-radio>
|
|
|
+ <el-radio label="指定房间"></el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ class="selet-room"
|
|
|
+ v-show="ruleForm.issueRoom.checkAll"
|
|
|
+ >
|
|
|
+ <tree-house
|
|
|
+ :buildingType="1"
|
|
|
+ :showCheckboxTree="true"
|
|
|
+ :defaultExpandAllTree="false"
|
|
|
+ :accordion="true"
|
|
|
+ :selectAll="true"
|
|
|
+ @selectData="selectDataHouseTree"
|
|
|
+ :disabledHouse="disabledHouse"
|
|
|
+ ref="selectTreeHouse"
|
|
|
+ ></tree-house>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="issueRoom">
|
|
|
+ <div class="radio-room">
|
|
|
+ <el-checkbox
|
|
|
+ label="物业员工"
|
|
|
+ name="type"
|
|
|
+ v-model="ruleForm.issueRoom.staff"
|
|
|
+ @change="changeCheckboxStaffRoom"
|
|
|
+ ></el-checkbox>
|
|
|
+ <el-radio-group
|
|
|
+ v-model="ruleForm.issueRoom.radioStaff"
|
|
|
+ :disabled="!ruleForm.issueRoom.staff"
|
|
|
+ @change="changeRadioStaffRoom"
|
|
|
+ >
|
|
|
+ <el-radio label="全部员工"></el-radio>
|
|
|
+ <el-radio label="指定员工"></el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ class="selet-room"
|
|
|
+ v-show="ruleForm.issueRoom.staff"
|
|
|
+ >
|
|
|
+ <!-- <GeminiScrollbar class="my-scroll-bar" :autoshow="true"> -->
|
|
|
+ <tree-house
|
|
|
+ ref="selectTreePeoples"
|
|
|
+ :buildingType="1"
|
|
|
+ :showCheckboxTree="true"
|
|
|
+ :defaultExpandAllTree="false"
|
|
|
+ :showHouseTree="false"
|
|
|
+ :accordionPeople="true"
|
|
|
+ :selectAll="true"
|
|
|
+ @dataPeople="dataPeople"
|
|
|
+ @selectPeople="selectPeople"
|
|
|
+ :disabled="disabledPeople"
|
|
|
+ ></tree-house>
|
|
|
+ <!-- </GeminiScrollbar> -->
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ label="通知类型"
|
|
|
+ prop="informType"
|
|
|
+ >
|
|
|
+ <el-select
|
|
|
+ v-model="ruleForm.informType"
|
|
|
+ @change="changeInformType"
|
|
|
+ clearable
|
|
|
+ class="dialog-select"
|
|
|
+ placeholder="请选择通知类型"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="(item, index) in informTypes"
|
|
|
+ :key="index"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.status"
|
|
|
+ >{{
|
|
|
item.label
|
|
|
}}</el-option>
|
|
|
- </el-select>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="标题" prop="title">
|
|
|
- <el-input v-model="ruleForm.title" placeholder="不能超过20字" maxlength="20"></el-input>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="是否紧急" prop="exigencyOr">
|
|
|
- <el-radio-group v-model="ruleForm.exigencyOr" @change="changeRadioExigencyOr">
|
|
|
- <el-radio label="是"></el-radio>
|
|
|
- <el-radio label="否"></el-radio>
|
|
|
- </el-radio-group>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="选择时间" prop="activeTime" v-if="showUploadImage">
|
|
|
- <el-date-picker
|
|
|
- v-model="ruleForm.activeTime"
|
|
|
- type="datetimerange"
|
|
|
- range-separator="至"
|
|
|
- start-placeholder="开始日期"
|
|
|
- end-placeholder="结束日期"
|
|
|
- :picker-options="pickerOptions"
|
|
|
- :editable="false"
|
|
|
- ></el-date-picker>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="主题图片" prop="image" v-if="showUploadImage">
|
|
|
- <div class="up-image">
|
|
|
- <up-image
|
|
|
- color="#1890ff"
|
|
|
- class="editor-upload-btn"
|
|
|
- @successCBK="imageSuccessCBK"
|
|
|
- @deleteImage="deleteImage"
|
|
|
- @successImageList="successImageList"
|
|
|
- ref="upImages"
|
|
|
- ></up-image>
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="通知内容" prop="editorContents">
|
|
|
- <!-- tinymce-editor 富文本编辑器 -->
|
|
|
- <div class="editor-container">
|
|
|
- <tinymce v-model="ruleForm.editorContents" ref="endit" :height="150" />
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="文件上传" prop="fill">
|
|
|
- <div>
|
|
|
- <el-upload
|
|
|
- class="upload-fill"
|
|
|
- action="/sc-community/upload/uploadFile"
|
|
|
- :on-preview="handlePreview"
|
|
|
- :on-remove="handleRemove"
|
|
|
- :before-remove="beforeRemove"
|
|
|
- multiple
|
|
|
- :limit="3"
|
|
|
- :on-exceed="handleExceed"
|
|
|
- :file-list="fileList"
|
|
|
- :on-success="successFile"
|
|
|
- >
|
|
|
- <el-button size="small" icon="el-icon-paperclip">选择附件</el-button>
|
|
|
- <div slot="tip" class="el-upload-text">支持格式:.rar .zip .doc .docx .pdf ,单个文件不能超过20MB</div>
|
|
|
- </el-upload>
|
|
|
- </div>
|
|
|
- </el-form-item>
|
|
|
- </el-form>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ label="标题"
|
|
|
+ prop="title"
|
|
|
+ >
|
|
|
+ <el-input
|
|
|
+ v-model="ruleForm.title"
|
|
|
+ placeholder="不能超过20字"
|
|
|
+ maxlength="20"
|
|
|
+ ></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ label="是否紧急"
|
|
|
+ prop="exigencyOr"
|
|
|
+ >
|
|
|
+ <el-radio-group
|
|
|
+ v-model="ruleForm.exigencyOr"
|
|
|
+ @change="changeRadioExigencyOr"
|
|
|
+ >
|
|
|
+ <el-radio label="是"></el-radio>
|
|
|
+ <el-radio label="否"></el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ label="选择时间"
|
|
|
+ prop="activeTime"
|
|
|
+ v-if="showUploadImage"
|
|
|
+ >
|
|
|
+ <el-date-picker
|
|
|
+ v-model="ruleForm.activeTime"
|
|
|
+ type="datetimerange"
|
|
|
+ range-separator="至"
|
|
|
+ start-placeholder="开始日期"
|
|
|
+ end-placeholder="结束日期"
|
|
|
+ :picker-options="pickerOptions"
|
|
|
+ :editable="false"
|
|
|
+ ></el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ label="主题图片"
|
|
|
+ prop="image"
|
|
|
+ v-if="showUploadImage"
|
|
|
+ >
|
|
|
+ <div class="up-image">
|
|
|
+ <up-image
|
|
|
+ color="#1890ff"
|
|
|
+ class="editor-upload-btn"
|
|
|
+ @successCBK="imageSuccessCBK"
|
|
|
+ @deleteImage="deleteImage"
|
|
|
+ @successImageList="successImageList"
|
|
|
+ ref="upImages"
|
|
|
+ ></up-image>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ label="通知内容"
|
|
|
+ prop="editorContents"
|
|
|
+ >
|
|
|
+ <!-- tinymce-editor 富文本编辑器 -->
|
|
|
+ <div class="editor-container">
|
|
|
+ <tinymce
|
|
|
+ v-model="ruleForm.editorContents"
|
|
|
+ ref="endit"
|
|
|
+ :height="150"
|
|
|
+ />
|
|
|
</div>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item
|
|
|
+ label="文件上传"
|
|
|
+ prop="fill"
|
|
|
+ >
|
|
|
+ <div>
|
|
|
+ <el-upload
|
|
|
+ class="upload-fill"
|
|
|
+ action="/sc-community/upload/uploadFile"
|
|
|
+ :on-preview="handlePreview"
|
|
|
+ :on-remove="handleRemove"
|
|
|
+ :before-remove="beforeRemove"
|
|
|
+ multiple
|
|
|
+ :limit="3"
|
|
|
+ :on-exceed="handleExceed"
|
|
|
+ :file-list="fileList"
|
|
|
+ :on-success="successFile"
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ size="small"
|
|
|
+ icon="el-icon-paperclip"
|
|
|
+ >选择附件</el-button>
|
|
|
+ <div
|
|
|
+ slot="tip"
|
|
|
+ class="el-upload-text"
|
|
|
+ >支持格式:.rar .zip .doc .docx .pdf ,单个文件不能超过20MB</div>
|
|
|
+ </el-upload>
|
|
|
+ </div>
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
|
|
|
- <div class="dialog-right">
|
|
|
- <div class="dialog-right-top">
|
|
|
- <img src="@assets/img/phoneHeader.png" alt="" />
|
|
|
+ <div class="dialog-right">
|
|
|
+ <div class="dialog-right-top">
|
|
|
+ <img
|
|
|
+ src="@assets/img/phoneHeader.png"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div class="dialog-right-header">
|
|
|
+ <i class="el-icon-arrow-left"></i>
|
|
|
+ <div v-if="showDetail">{{ this.showUploadImage ? '社区活动' : '物业通知' }}</div>
|
|
|
+ <div v-else>{{ rowDetail.type == 0 ? '物业通知' : '社区活动' }}</div>
|
|
|
+ </div>
|
|
|
+ <div class="center-padding"></div>
|
|
|
+ <GeminiScrollbar
|
|
|
+ class="my-scroll-bar"
|
|
|
+ :autoshow="true"
|
|
|
+ >
|
|
|
+ <div class="dialog-right-content">
|
|
|
+ <div class="dialog-title">
|
|
|
+ <div
|
|
|
+ class="dialog-titles"
|
|
|
+ v-if="showDetail"
|
|
|
+ >
|
|
|
+ {{ ruleForm.title ? ruleForm.title : '标题' }}
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ class="dialog-titles"
|
|
|
+ v-else
|
|
|
+ >
|
|
|
+ {{ rowDetail.title ? rowDetail.title : '标题' }}
|
|
|
+ </div>
|
|
|
+ <div v-if="showDetail">
|
|
|
+ <div
|
|
|
+ class="dialog-urgency"
|
|
|
+ v-if="ruleForm.exigencyOr == '是'"
|
|
|
+ >紧急</div>
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ <div
|
|
|
+ class="dialog-urgency"
|
|
|
+ v-if="rowDetail.urgentFlag"
|
|
|
+ >紧急</div>
|
|
|
+ </div>
|
|
|
+ <!-- ruleForm.exigencyOr -->
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ class="dialog-right-time"
|
|
|
+ v-if="!showDetail"
|
|
|
+ >{{ rowDetail.pubDate }}</div>
|
|
|
+ <div
|
|
|
+ class="dialog-right-time"
|
|
|
+ v-else
|
|
|
+ >{{ new Date() | filterTime }}</div>
|
|
|
+ <div></div>
|
|
|
+ <div class="content">
|
|
|
+ <div class="content-text">
|
|
|
+ <div
|
|
|
+ v-html="ruleForm.editorContents"
|
|
|
+ id="content"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div v-if="showDetail">
|
|
|
+ <div
|
|
|
+ class="file-name"
|
|
|
+ v-for="(item, index) of uploadFileUrl"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
+ <span class="file-name-left"><i class="el-icon-paperclip"></i> </span>
|
|
|
+ <span class="file-name-right">
|
|
|
+ {{ item.name }}
|
|
|
+ </span>
|
|
|
</div>
|
|
|
- <div class="dialog-right-header">
|
|
|
- <i class="el-icon-arrow-left"></i>
|
|
|
- <div v-if="showDetail">{{ this.showUploadImage ? '社区活动' : '物业通知' }}</div>
|
|
|
- <div v-else>{{ rowDetail.type == 0 ? '物业通知' : '社区活动' }}</div>
|
|
|
+ </div>
|
|
|
+ <div v-else>
|
|
|
+ <div
|
|
|
+ class="file-name"
|
|
|
+ v-for="(item, index) of filePath"
|
|
|
+ :key="index"
|
|
|
+ >
|
|
|
+ <span class="file-name-left"><i class="el-icon-paperclip"></i> </span>
|
|
|
+ <span class="file-name-right">
|
|
|
+ {{ item.name }}
|
|
|
+ </span>
|
|
|
</div>
|
|
|
- <div class="center-padding"></div>
|
|
|
- <GeminiScrollbar class="my-scroll-bar" :autoshow="true">
|
|
|
- <div class="dialog-right-content">
|
|
|
- <div class="dialog-title">
|
|
|
- <div class="dialog-titles" v-if="showDetail">
|
|
|
- {{ ruleForm.title ? ruleForm.title : '标题' }}
|
|
|
- </div>
|
|
|
- <div class="dialog-titles" v-else>
|
|
|
- {{ rowDetail.title ? rowDetail.title : '标题' }}
|
|
|
- </div>
|
|
|
- <div v-if="showDetail">
|
|
|
- <div class="dialog-urgency" v-if="ruleForm.exigencyOr == '是'">紧急</div>
|
|
|
- </div>
|
|
|
- <div v-else>
|
|
|
- <div class="dialog-urgency" v-if="rowDetail.urgentFlag">紧急</div>
|
|
|
- </div>
|
|
|
- <!-- ruleForm.exigencyOr -->
|
|
|
- </div>
|
|
|
- <div class="dialog-right-time" v-if="!showDetail">{{ rowDetail.pubDate }}</div>
|
|
|
- <div class="dialog-right-time" v-else>{{ new Date() | filterTime }}</div>
|
|
|
- <div></div>
|
|
|
- <div class="content">
|
|
|
- <div class="content-text">
|
|
|
- <div v-html="ruleForm.editorContents" id="content" />
|
|
|
- </div>
|
|
|
- <div v-if="showDetail">
|
|
|
- <div class="file-name" v-for="(item, index) of uploadFileUrl" :key="index">
|
|
|
- <span class="file-name-left"><i class="el-icon-paperclip"></i> </span>
|
|
|
- <span class="file-name-right">
|
|
|
- {{ item.name }}
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div v-else>
|
|
|
- <div class="file-name" v-for="(item, index) of filePath" :key="index">
|
|
|
- <span class="file-name-left"><i class="el-icon-paperclip"></i> </span>
|
|
|
- <span class="file-name-right">
|
|
|
- {{ item.name }}
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div></div>
|
|
|
- </div>
|
|
|
- </GeminiScrollbar>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ <div></div>
|
|
|
+ </div>
|
|
|
+ </GeminiScrollbar>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
<script>
|
|
|
import previeInform from '../common/previeInform';
|
|
@@ -222,388 +320,388 @@ import upImage from '../common/upImage';
|
|
|
// Tinymce 富文本编辑器
|
|
|
import Tinymce from '@/components/Tinymce';
|
|
|
export default {
|
|
|
- components: { previeInform, Tinymce, upImage },
|
|
|
- props: ['params'],
|
|
|
- data() {
|
|
|
- return {
|
|
|
- communityList: [],
|
|
|
- // 上传的图片
|
|
|
- upLoadImageList: [],
|
|
|
- disabledHouse: true,
|
|
|
- disabledPeople: true,
|
|
|
- popCommunityName: '',
|
|
|
- fileList: [],
|
|
|
- // 显示图片上传
|
|
|
- showUploadImage: false,
|
|
|
- dialogImageUrl: '',
|
|
|
- // 显示详情
|
|
|
- showDetail: true,
|
|
|
- rowDetail: '',
|
|
|
- contentHtml: '',
|
|
|
- // 查询的时间
|
|
|
- searchTime: [],
|
|
|
- // 添加弹框信息
|
|
|
- ruleForm: {
|
|
|
- popCommunityId: '', //所属社区
|
|
|
- //发布对象
|
|
|
- issueRoom: {
|
|
|
- checkAll: false,
|
|
|
- radioRoom: '',
|
|
|
- staff: false,
|
|
|
- radioStaff: ''
|
|
|
- },
|
|
|
- disabledRoom: false, //单选框是否禁用
|
|
|
- disabledStaffRoom: false,
|
|
|
- informType: '', //通知类型
|
|
|
- title: '', //标题
|
|
|
- exigencyOr: '是', //是否紧急
|
|
|
- exigencyText: true,
|
|
|
- activeTime: [],
|
|
|
- editorContents: '',
|
|
|
- // informContent: content, //通知内容
|
|
|
- informContent: '', //通知内容
|
|
|
- upload: '' // 文件上传
|
|
|
- },
|
|
|
- rules: {
|
|
|
- popCommunityId: [{ required: true, message: '请选择社区', trigger: 'change' }],
|
|
|
- radioRoom: [{ required: true, message: '请选择房间', trigger: 'change' }],
|
|
|
- informType: [{ required: true, message: '请选择通知类型', trigger: 'change' }],
|
|
|
- title: [{ required: true, message: '请输入标题', trigger: 'blur' }],
|
|
|
- exigencyOr: [{ required: true, message: '请选择是否紧急', trigger: 'change' }],
|
|
|
- activeTime: [{ required: true, message: '请选择时间', trigger: 'change' }],
|
|
|
- issueRoom: [{ required: true, message: '请选择发布对象', trigger: 'change' }],
|
|
|
- editorContents: [{ required: true, message: '请发布内容', trigger: 'blur' }] //通知内容
|
|
|
- },
|
|
|
- informTypes: [
|
|
|
- {
|
|
|
- status: 0,
|
|
|
- label: '物业通知'
|
|
|
- },
|
|
|
- {
|
|
|
- status: 1,
|
|
|
- label: '社区活动'
|
|
|
- }
|
|
|
- ],
|
|
|
- // 显隐弹框
|
|
|
- centerDialogVisible: false,
|
|
|
- // 获取的房间信息
|
|
|
- houseData: [],
|
|
|
- houseDataNames: '',
|
|
|
- houseDataNamesPeople: '',
|
|
|
- peopleData: [],
|
|
|
- userType: '',
|
|
|
- // 选中的房间
|
|
|
- selectDataHouseTreeData: {
|
|
|
- checkData: [],
|
|
|
- userID: [],
|
|
|
- userList: []
|
|
|
- },
|
|
|
- houseNames: [],
|
|
|
- PeopleNames: [],
|
|
|
- // 选中的人员
|
|
|
- selectDataPeopleTreeData: {
|
|
|
- checkData: [],
|
|
|
- userList: []
|
|
|
- },
|
|
|
- // 文件上传地址
|
|
|
- uploadFileUrl: []
|
|
|
- };
|
|
|
- },
|
|
|
- computed: {
|
|
|
- // 过滤富文本
|
|
|
- ruleFormEditorContents() {
|
|
|
- if (this.ruleForm.editorContents) {
|
|
|
- console.log('this.ruleForm.editorContents', this.ruleForm.editorContents);
|
|
|
- let formResult = null;
|
|
|
- let container = null;
|
|
|
- let imageUrl = this.ruleForm.editorContents.match(/<div id=".*" class="wscnph">\[图片\].*<\/div>.*/g);
|
|
|
- let text = this.ruleForm.editorContents.match(/\[图片\].*/g);
|
|
|
- if (Array.isArray(text) && text.length > 0) {
|
|
|
- container = text[0].substr(4, text[0].length - 10);
|
|
|
- }
|
|
|
+ components: { previeInform, Tinymce, upImage },
|
|
|
+ props: ['params'],
|
|
|
+ data () {
|
|
|
+ return {
|
|
|
+ communityList: [],
|
|
|
+ // 上传的图片
|
|
|
+ upLoadImageList: [],
|
|
|
+ disabledHouse: true,
|
|
|
+ disabledPeople: true,
|
|
|
+ popCommunityName: '',
|
|
|
+ fileList: [],
|
|
|
+ // 显示图片上传
|
|
|
+ showUploadImage: false,
|
|
|
+ dialogImageUrl: '',
|
|
|
+ // 显示详情
|
|
|
+ showDetail: true,
|
|
|
+ rowDetail: '',
|
|
|
+ contentHtml: '',
|
|
|
+ // 查询的时间
|
|
|
+ searchTime: [],
|
|
|
+ // 添加弹框信息
|
|
|
+ ruleForm: {
|
|
|
+ popCommunityId: '', //所属社区
|
|
|
+ //发布对象
|
|
|
+ issueRoom: {
|
|
|
+ checkAll: false,
|
|
|
+ radioRoom: '',
|
|
|
+ staff: false,
|
|
|
+ radioStaff: ''
|
|
|
+ },
|
|
|
+ disabledRoom: false, //单选框是否禁用
|
|
|
+ disabledStaffRoom: false,
|
|
|
+ informType: '', //通知类型
|
|
|
+ title: '', //标题
|
|
|
+ exigencyOr: '是', //是否紧急
|
|
|
+ exigencyText: true,
|
|
|
+ activeTime: [],
|
|
|
+ editorContents: '',
|
|
|
+ // informContent: content, //通知内容
|
|
|
+ informContent: '', //通知内容
|
|
|
+ upload: '' // 文件上传
|
|
|
+ },
|
|
|
+ rules: {
|
|
|
+ popCommunityId: [{ required: true, message: '请选择社区', trigger: 'change' }],
|
|
|
+ radioRoom: [{ required: true, message: '请选择房间', trigger: 'change' }],
|
|
|
+ informType: [{ required: true, message: '请选择通知类型', trigger: 'change' }],
|
|
|
+ title: [{ required: true, message: '请输入标题', trigger: 'blur' }],
|
|
|
+ exigencyOr: [{ required: true, message: '请选择是否紧急', trigger: 'change' }],
|
|
|
+ activeTime: [{ required: true, message: '请选择时间', trigger: 'change' }],
|
|
|
+ issueRoom: [{ required: true, message: '请选择发布对象', trigger: 'change' }],
|
|
|
+ editorContents: [{ required: true, message: '请发布内容', trigger: 'blur' }] //通知内容
|
|
|
+ },
|
|
|
+ informTypes: [
|
|
|
+ {
|
|
|
+ status: 0,
|
|
|
+ label: '物业通知'
|
|
|
+ },
|
|
|
+ {
|
|
|
+ status: 1,
|
|
|
+ label: '社区活动'
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ // 显隐弹框
|
|
|
+ centerDialogVisible: false,
|
|
|
+ // 获取的房间信息
|
|
|
+ houseData: [],
|
|
|
+ houseDataNames: '',
|
|
|
+ houseDataNamesPeople: '',
|
|
|
+ peopleData: [],
|
|
|
+ userType: '',
|
|
|
+ // 选中的房间
|
|
|
+ selectDataHouseTreeData: {
|
|
|
+ checkData: [],
|
|
|
+ userID: [],
|
|
|
+ userList: []
|
|
|
+ },
|
|
|
+ houseNames: [],
|
|
|
+ PeopleNames: [],
|
|
|
+ // 选中的人员
|
|
|
+ selectDataPeopleTreeData: {
|
|
|
+ checkData: [],
|
|
|
+ userList: []
|
|
|
+ },
|
|
|
+ // 文件上传地址
|
|
|
+ uploadFileUrl: []
|
|
|
+ };
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ // 过滤富文本
|
|
|
+ ruleFormEditorContents () {
|
|
|
+ if (this.ruleForm.editorContents) {
|
|
|
+ console.log('this.ruleForm.editorContents', this.ruleForm.editorContents);
|
|
|
+ let formResult = null;
|
|
|
+ let container = null;
|
|
|
+ let imageUrl = this.ruleForm.editorContents.match(/<div id=".*" class="wscnph">\[图片\].*<\/div>.*/g);
|
|
|
+ let text = this.ruleForm.editorContents.match(/\[图片\].*/g);
|
|
|
+ if (Array.isArray(text) && text.length > 0) {
|
|
|
+ container = text[0].substr(4, text[0].length - 10);
|
|
|
+ }
|
|
|
|
|
|
- console.log('imageUrl', imageUrl);
|
|
|
- if (Array.isArray(imageUrl) && imageUrl.length > 0) {
|
|
|
- let url = imageUrl[0].substr(9, imageUrl[0].length - 36 + container.length);
|
|
|
- formResult = this.ruleForm.editorContents.replace(
|
|
|
- /<div id=".*" class="wscnph">\[图片\].*<\/div>/g,
|
|
|
- `<img class="wscnph" src="${url}" />`
|
|
|
- );
|
|
|
- }
|
|
|
- console.log('formResult', formResult);
|
|
|
- console.log('container', container);
|
|
|
- return `${formResult ? formResult : ''} <div>${container}</div>`;
|
|
|
- }
|
|
|
+ console.log('imageUrl', imageUrl);
|
|
|
+ if (Array.isArray(imageUrl) && imageUrl.length > 0) {
|
|
|
+ let url = imageUrl[0].substr(9, imageUrl[0].length - 36 + container.length);
|
|
|
+ formResult = this.ruleForm.editorContents.replace(
|
|
|
+ /<div id=".*" class="wscnph">\[图片\].*<\/div>/g,
|
|
|
+ `<img class="wscnph" src="${url}" />`
|
|
|
+ );
|
|
|
}
|
|
|
+ console.log('formResult', formResult);
|
|
|
+ console.log('container', container);
|
|
|
+ return `${formResult ? formResult : ''} <div>${container}</div>`;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created () {
|
|
|
+ this.getCommunityList();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 弹框关闭事件
|
|
|
+ handleDialogClose (e) {
|
|
|
+ this.showDetail = false;
|
|
|
+ // console.log('handleDialogClose=========', e);
|
|
|
+ if (!!this.$refs.previeInform) {
|
|
|
+ this.$refs.previeInform.closeDialog();
|
|
|
+ }
|
|
|
},
|
|
|
- created() {
|
|
|
- this.getCommunityList();
|
|
|
+ // 上传文件
|
|
|
+ handleRemove (file, fileList) {
|
|
|
+ // console.log('上传文件', file, fileList);
|
|
|
},
|
|
|
- methods: {
|
|
|
- // 弹框关闭事件
|
|
|
- handleDialogClose(e) {
|
|
|
- this.showDetail = false;
|
|
|
- // console.log('handleDialogClose=========', e);
|
|
|
- if (!!this.$refs.previeInform) {
|
|
|
- this.$refs.previeInform.closeDialog();
|
|
|
- }
|
|
|
- },
|
|
|
- // 上传文件
|
|
|
- handleRemove(file, fileList) {
|
|
|
- // console.log('上传文件', file, fileList);
|
|
|
- },
|
|
|
- handlePreview(file) {
|
|
|
- // console.log('点击文件', file);
|
|
|
- },
|
|
|
- successFile(file, fileLists) {
|
|
|
+ handlePreview (file) {
|
|
|
+ // console.log('点击文件', file);
|
|
|
+ },
|
|
|
+ successFile (file, fileLists) {
|
|
|
|
|
|
- let obj = {};
|
|
|
- // this.fileList.push(fileLists.name);
|
|
|
- let resName = fileLists.response.data;
|
|
|
- obj.oldName = resName;
|
|
|
- obj.name = fileLists.name;
|
|
|
- // this.uploadFileUrl= this.uploadFileUrl.concat(newName + ',');
|
|
|
- this.uploadFileUrl.push(obj);
|
|
|
- },
|
|
|
- handleExceed(files, fileList) {
|
|
|
- this.$message.error(
|
|
|
- `当前最多可选 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`
|
|
|
- );
|
|
|
- },
|
|
|
- beforeRemove(file, fileList) {
|
|
|
- let removeName = this.fileList.filter((item) => {
|
|
|
- return item.name != file.name;
|
|
|
- });
|
|
|
- this.fileList = removeName;
|
|
|
- this.uploadFileUrl = removeName;
|
|
|
- },
|
|
|
+ let obj = {};
|
|
|
+ // this.fileList.push(fileLists.name);
|
|
|
+ let resName = fileLists.response.data;
|
|
|
+ obj.oldName = resName;
|
|
|
+ obj.name = fileLists.name;
|
|
|
+ // this.uploadFileUrl= this.uploadFileUrl.concat(newName + ',');
|
|
|
+ this.uploadFileUrl.push(obj);
|
|
|
+ },
|
|
|
+ handleExceed (files, fileList) {
|
|
|
+ this.$message.error(
|
|
|
+ `当前最多可选 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`
|
|
|
+ );
|
|
|
+ },
|
|
|
+ beforeRemove (file, fileList) {
|
|
|
+ let removeName = this.fileList.filter((item) => {
|
|
|
+ return item.name != file.name;
|
|
|
+ });
|
|
|
+ this.fileList = removeName;
|
|
|
+ this.uploadFileUrl = removeName;
|
|
|
+ },
|
|
|
|
|
|
- /**上传图片*/
|
|
|
- successImageList(arr) {
|
|
|
- this.upLoadImageList = [];
|
|
|
- this.upLoadImageList = arr;
|
|
|
- console.log('上传图片inform', this.upLoadImageList);
|
|
|
- },
|
|
|
- // 插入富文本
|
|
|
- imageSuccessCBK(arr) {
|
|
|
- this.$refs.endit.imageSuccessCBK(arr);
|
|
|
- },
|
|
|
- deleteImage(val) {
|
|
|
- this.$refs.endit.deleteImage(val);
|
|
|
- },
|
|
|
+ /**上传图片*/
|
|
|
+ successImageList (arr) {
|
|
|
+ this.upLoadImageList = [];
|
|
|
+ this.upLoadImageList = arr;
|
|
|
+ console.log('上传图片inform', this.upLoadImageList);
|
|
|
+ },
|
|
|
+ // 插入富文本
|
|
|
+ imageSuccessCBK (arr) {
|
|
|
+ this.$refs.endit.imageSuccessCBK(arr);
|
|
|
+ },
|
|
|
+ deleteImage (val) {
|
|
|
+ this.$refs.endit.deleteImage(val);
|
|
|
+ },
|
|
|
|
|
|
- handleRemove(file) {},
|
|
|
+ handleRemove (file) { },
|
|
|
|
|
|
- handleDownload(file) {},
|
|
|
- // 添加弹框下拉框变化
|
|
|
- changeCommunity(val) {
|
|
|
- this.$http
|
|
|
- .get('/sc-community/assets/tree/community/find', { buildingType: this.buildingType })
|
|
|
- .then(({ status, data, msg }) => {
|
|
|
- if (status === 0 && data) {
|
|
|
- this.$refs.selectTreeHouse.filterhouse(val, data);
|
|
|
- // this.ruleForm.issueRoom.checkAll = true;
|
|
|
- // this.ruleForm.issueRoom.radioRoom = '全部房间';
|
|
|
- // this.ruleForm.issueRoom.radioStaff = '';
|
|
|
- // this.ruleForm.issueRoom.staff = false;
|
|
|
- } else {
|
|
|
- this.$message.error('获取房间失败');
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
+ handleDownload (file) { },
|
|
|
+ // 添加弹框下拉框变化
|
|
|
+ changeCommunity (val) {
|
|
|
+ this.$http
|
|
|
+ .get('/sc-community/assets/tree/community/find', { buildingType: this.buildingType })
|
|
|
+ .then(({ status, data, msg }) => {
|
|
|
+ if (status === 0 && data) {
|
|
|
+ this.$refs.selectTreeHouse.filterhouse(val, data);
|
|
|
+ // this.ruleForm.issueRoom.checkAll = true;
|
|
|
+ // this.ruleForm.issueRoom.radioRoom = '全部房间';
|
|
|
+ // this.ruleForm.issueRoom.radioStaff = '';
|
|
|
+ // this.ruleForm.issueRoom.staff = false;
|
|
|
+ } else {
|
|
|
+ this.$message.error('获取房间失败');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
|
|
|
- // 选中的房间
|
|
|
- selectDataHouseTree(val) {
|
|
|
- this.selectDataHouseTreeData.userID = [];
|
|
|
- this.selectDataHouseTreeData.userID = val.userList;
|
|
|
- // this.selectDataHouseTreeData = val;
|
|
|
- // 获取房间下的usid
|
|
|
- this.$http.post('/sc-community/notice/queryHouseUser', val.userList).then((res) => {
|
|
|
- if (res.status === 0) {
|
|
|
- this.selectDataHouseTreeData.userList = res.data;
|
|
|
- } else {
|
|
|
- // this.$message('获取房间失败');
|
|
|
- }
|
|
|
+ // 选中的房间
|
|
|
+ selectDataHouseTree (val) {
|
|
|
+ this.selectDataHouseTreeData.userID = [];
|
|
|
+ this.selectDataHouseTreeData.userID = val.userList;
|
|
|
+ // this.selectDataHouseTreeData = val;
|
|
|
+ // 获取房间下的usid
|
|
|
+ this.$http.post('/sc-community/notice/queryHouseUser', val.userList).then((res) => {
|
|
|
+ if (res.status === 0) {
|
|
|
+ this.selectDataHouseTreeData.userList = res.data;
|
|
|
+ } else {
|
|
|
+ // this.$message('获取房间失败');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 选择的人员
|
|
|
+ selectPeople (val) {
|
|
|
+ // if (val.userList.length < 1) {
|
|
|
+ // this.ruleForm.issueRoom.radioStaff = '指定员工';
|
|
|
+ // }
|
|
|
+ this.selectDataPeopleTreeData.userList = [];
|
|
|
+ this.selectDataPeopleTreeData = val;
|
|
|
+ },
|
|
|
+ /**监听指定房间单选框变化*/
|
|
|
+ changeRadioRoom (val) {
|
|
|
+ if (!this.ruleForm.popCommunityId) {
|
|
|
+ ruleForm.issueRoom.checkAll = false;
|
|
|
+ return this.$message.warning('请先选择所属社区');
|
|
|
+ }
|
|
|
+ if (val == '指定房间') {
|
|
|
+ this.ruleForm.disabledRoom = true;
|
|
|
+ this.$refs.selectTreeHouse.selectHouseOr();
|
|
|
+ } else {
|
|
|
+ this.ruleForm.disabledRoom = false;
|
|
|
+ this.$refs.selectTreeHouse.selectAllHouse();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ //选择员工复选框变化
|
|
|
+ changeCheckboxStaffRoom (val) {
|
|
|
+ if (!this.ruleForm.popCommunityId) {
|
|
|
+ this.ruleForm.issueRoom.staff = false;
|
|
|
+ return this.$message.warning('请先选择社区');
|
|
|
+ }
|
|
|
+ if (val) {
|
|
|
+ this.ruleForm.issueRoom.radioStaff = '全部员工';
|
|
|
+
|
|
|
+ // this.ruleForm.issueRoom.checkAll = false;
|
|
|
+ // this.ruleForm.issueRoom.radioRoom = '';
|
|
|
+ this.$refs.selectTreePeoples.selectAllPeople();
|
|
|
+ // this.$refs.selectTreeHouse.selectHouseOr();
|
|
|
+ } else {
|
|
|
+ this.ruleForm.issueRoom.radioStaff = '';
|
|
|
+ // this.ruleForm.issueRoom.checkAll = true;
|
|
|
+ // this.ruleForm.issueRoom.radioRoom = '全部房间';
|
|
|
+ this.$refs.selectTreePeoples.selectPeopleOr();
|
|
|
+ // this.$refs.selectTreeHouse.selectAllHouse();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 选择房间复选框变化
|
|
|
+ changeCheckboxRoom (val) {
|
|
|
+ if (!this.ruleForm.popCommunityId) {
|
|
|
+ this.ruleForm.issueRoom.checkAll = false;
|
|
|
+ return this.$message.warning('请先选择社区');
|
|
|
+ }
|
|
|
+ if (val) {
|
|
|
+ // this.ruleForm.issueRoom.staff = false;
|
|
|
+ // this.ruleForm.issueRoom.checkAll = true;
|
|
|
+ this.ruleForm.issueRoom.radioRoom = '全部房间';
|
|
|
+ // this.ruleForm.issueRoom.radioStaff = '';
|
|
|
+ this.$refs.selectTreeHouse.selectAllHouse();
|
|
|
+ } else {
|
|
|
+ this.ruleForm.issueRoom.radioRoom = '';
|
|
|
+ this.$refs.selectTreeHouse.selectHouseOr();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 指定员工
|
|
|
+ changeRadioStaffRoom (val) {
|
|
|
+ if (val == '指定员工') {
|
|
|
+ this.ruleForm.disabledStaffRoom = true;
|
|
|
+ this.$refs.selectTreePeoples.selectPeopleOr();
|
|
|
+ } else {
|
|
|
+ this.ruleForm.disabledStaffRoom = false;
|
|
|
+ this.$refs.selectTreePeoples.selectAllPeople();
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 是否紧急
|
|
|
+ changeRadioExigencyOr (val) {
|
|
|
+ if (val == '否') {
|
|
|
+ this.ruleForm.exigencyText = false;
|
|
|
+ } else {
|
|
|
+ this.ruleForm.exigencyText = true;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 选择发布活动类型
|
|
|
+ changeInformType (val) {
|
|
|
+ this.successImageLists = '';
|
|
|
+ this.upLoadImageList = [];
|
|
|
+ if (val) {
|
|
|
+ this.showUploadImage = true;
|
|
|
+ } else {
|
|
|
+ this.showUploadImage = false;
|
|
|
+ }
|
|
|
+ this.rowDetail = '';
|
|
|
+ this.showDetail = true;
|
|
|
+ if (!!this.$refs.endit) {
|
|
|
+ this.$refs.endit.setContent('');
|
|
|
+ }
|
|
|
+ },
|
|
|
+ submit () {
|
|
|
+ this.$refs['ruleForm'].validate((valid) => {
|
|
|
+ if (valid) {
|
|
|
+ let content = this.ruleForm.editorContents;
|
|
|
+ let img = [];
|
|
|
+ content.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/g, function (match, capture) {
|
|
|
+ img.push(capture);
|
|
|
+ });
|
|
|
+ if (
|
|
|
+ this.selectDataHouseTreeData.userList.length === 0 &&
|
|
|
+ this.selectDataPeopleTreeData &&
|
|
|
+ this.selectDataPeopleTreeData.userList.length === 0
|
|
|
+ ) {
|
|
|
+ return this.$message.warning('所选暂无人员,不可发布');
|
|
|
+ }
|
|
|
+ let startTime = this.$moment(this.ruleForm.activeTime[0]).format(`YYYY-MM-DDTHH:mm:ss`);
|
|
|
+ let endTime = this.$moment(this.ruleForm.activeTime[1]).format(`YYYY-MM-DDTHH:mm:ss`);
|
|
|
+ var userVos = [];
|
|
|
+ let arr1 = this.selectDataHouseTreeData.userList;
|
|
|
+ let arr2 = this.selectDataPeopleTreeData.userList;
|
|
|
+ let treeData = [];
|
|
|
+ const dedupe = (array) => {
|
|
|
+ return Array.from(new Set(array));
|
|
|
+ };
|
|
|
+ treeData[0] = JSON.stringify(this.selectDataHouseTreeData.userID);
|
|
|
+ treeData[1] = JSON.stringify(arr2);
|
|
|
+ if (arr1.length > 0) {
|
|
|
+ dedupe(arr1).map((item, index) => {
|
|
|
+ let obj = {
|
|
|
+ noticeId: '',
|
|
|
+ userId: item,
|
|
|
+ userType: 0
|
|
|
+ };
|
|
|
+ userVos.push(obj);
|
|
|
});
|
|
|
- },
|
|
|
- // 选择的人员
|
|
|
- selectPeople(val) {
|
|
|
- // if (val.userList.length < 1) {
|
|
|
- // this.ruleForm.issueRoom.radioStaff = '指定员工';
|
|
|
- // }
|
|
|
- this.selectDataPeopleTreeData.userList = [];
|
|
|
- this.selectDataPeopleTreeData = val;
|
|
|
- },
|
|
|
- /**监听指定房间单选框变化*/
|
|
|
- changeRadioRoom(val) {
|
|
|
- if (!this.ruleForm.popCommunityId) {
|
|
|
- ruleForm.issueRoom.checkAll = false;
|
|
|
- return this.$message.warning('请先选择所属社区');
|
|
|
- }
|
|
|
- if (val == '指定房间') {
|
|
|
- this.ruleForm.disabledRoom = true;
|
|
|
- this.$refs.selectTreeHouse.selectHouseOr();
|
|
|
- } else {
|
|
|
- this.ruleForm.disabledRoom = false;
|
|
|
- this.$refs.selectTreeHouse.selectAllHouse();
|
|
|
- }
|
|
|
- },
|
|
|
- //选择员工复选框变化
|
|
|
- changeCheckboxStaffRoom(val) {
|
|
|
- if (!this.ruleForm.popCommunityId) {
|
|
|
- this.ruleForm.issueRoom.staff = false;
|
|
|
- return this.$message.warning('请先选择社区');
|
|
|
- }
|
|
|
- if (val) {
|
|
|
- this.ruleForm.issueRoom.radioStaff = '全部员工';
|
|
|
+ }
|
|
|
+ if (arr2.length > 0) {
|
|
|
+ dedupe(arr2).map((item, index) => {
|
|
|
+ let obj = {
|
|
|
+ noticeId: '',
|
|
|
+ userId: item,
|
|
|
+ userType: 1
|
|
|
+ };
|
|
|
+ userVos.push(obj);
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
- // this.ruleForm.issueRoom.checkAll = false;
|
|
|
- // this.ruleForm.issueRoom.radioRoom = '';
|
|
|
- this.$refs.selectTreePeoples.selectAllPeople();
|
|
|
- // this.$refs.selectTreeHouse.selectHouseOr();
|
|
|
- } else {
|
|
|
- this.ruleForm.issueRoom.radioStaff = '';
|
|
|
- // this.ruleForm.issueRoom.checkAll = true;
|
|
|
- // this.ruleForm.issueRoom.radioRoom = '全部房间';
|
|
|
- this.$refs.selectTreePeoples.selectPeopleOr();
|
|
|
- // this.$refs.selectTreeHouse.selectAllHouse();
|
|
|
- }
|
|
|
- },
|
|
|
- // 选择房间复选框变化
|
|
|
- changeCheckboxRoom(val) {
|
|
|
- if (!this.ruleForm.popCommunityId) {
|
|
|
- this.ruleForm.issueRoom.checkAll = false;
|
|
|
- return this.$message.warning('请先选择社区');
|
|
|
- }
|
|
|
- if (val) {
|
|
|
- // this.ruleForm.issueRoom.staff = false;
|
|
|
- // this.ruleForm.issueRoom.checkAll = true;
|
|
|
- this.ruleForm.issueRoom.radioRoom = '全部房间';
|
|
|
- // this.ruleForm.issueRoom.radioStaff = '';
|
|
|
- this.$refs.selectTreeHouse.selectAllHouse();
|
|
|
- } else {
|
|
|
- this.ruleForm.issueRoom.radioRoom = '';
|
|
|
- this.$refs.selectTreeHouse.selectHouseOr();
|
|
|
- }
|
|
|
- },
|
|
|
- // 指定员工
|
|
|
- changeRadioStaffRoom(val) {
|
|
|
- if (val == '指定员工') {
|
|
|
- this.ruleForm.disabledStaffRoom = true;
|
|
|
- this.$refs.selectTreePeoples.selectPeopleOr();
|
|
|
+ let query = {
|
|
|
+ communityId: this.ruleForm.popCommunityId,
|
|
|
+ content: this.ruleForm.editorContents,
|
|
|
+ startTime: this.showUploadImage ? startTime : '',
|
|
|
+ endTime: this.showUploadImage ? endTime : '',
|
|
|
+ filePath: JSON.stringify(this.uploadFileUrl),
|
|
|
+ id: 1,
|
|
|
+ pubDate: this.$moment(new Date()).format(`YYYY-MM-DDTHH:mm:ss`),
|
|
|
+ themePictrue: JSON.stringify(this.upLoadImageList),
|
|
|
+ treeData: JSON.stringify(treeData),
|
|
|
+ title: this.ruleForm.title,
|
|
|
+ type: this.ruleForm.informType,
|
|
|
+ urgentFlag: this.ruleForm.exigencyOr == '是' ? 1 : 0,
|
|
|
+ userVos: userVos
|
|
|
+ };
|
|
|
+ this.$http.post('/sc-community/notice/add', query).then((res) => {
|
|
|
+ if (res.status === 0) {
|
|
|
+ this.$message.success(res.msg);
|
|
|
+ this.$refs.endit.setContent('');
|
|
|
+ this.params.callback();
|
|
|
+ this.$emit('close');
|
|
|
} else {
|
|
|
- this.ruleForm.disabledStaffRoom = false;
|
|
|
- this.$refs.selectTreePeoples.selectAllPeople();
|
|
|
+ this.$message.error(res.msg);
|
|
|
}
|
|
|
- },
|
|
|
- // 是否紧急
|
|
|
- changeRadioExigencyOr(val) {
|
|
|
- if (val == '否') {
|
|
|
- this.ruleForm.exigencyText = false;
|
|
|
- } else {
|
|
|
- this.ruleForm.exigencyText = true;
|
|
|
- }
|
|
|
- },
|
|
|
- // 选择发布活动类型
|
|
|
- changeInformType(val) {
|
|
|
- this.successImageLists = '';
|
|
|
- this.upLoadImageList = [];
|
|
|
- if (val) {
|
|
|
- this.showUploadImage = true;
|
|
|
- } else {
|
|
|
- this.showUploadImage = false;
|
|
|
- }
|
|
|
- this.rowDetail = '';
|
|
|
- this.showDetail = true;
|
|
|
- if (!!this.$refs.endit) {
|
|
|
- this.$refs.endit.setContent('');
|
|
|
- }
|
|
|
- },
|
|
|
- submit() {
|
|
|
- this.$refs['ruleForm'].validate((valid) => {
|
|
|
- if (valid) {
|
|
|
- let content = this.ruleForm.editorContents;
|
|
|
- let img = [];
|
|
|
- content.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/g, function (match, capture) {
|
|
|
- img.push(capture);
|
|
|
- });
|
|
|
- if (
|
|
|
- this.selectDataHouseTreeData.userList.length === 0 &&
|
|
|
- this.selectDataPeopleTreeData &&
|
|
|
- this.selectDataPeopleTreeData.userList.length === 0
|
|
|
- ) {
|
|
|
- return this.$message.warning('所选暂无人员,不可发布');
|
|
|
- }
|
|
|
- let startTime = this.$moment(this.ruleForm.activeTime[0]).format(`YYYY-MM-DDTHH:mm:ss`);
|
|
|
- let endTime = this.$moment(this.ruleForm.activeTime[1]).format(`YYYY-MM-DDTHH:mm:ss`);
|
|
|
- var userVos = [];
|
|
|
- let arr1 = this.selectDataHouseTreeData.userList;
|
|
|
- let arr2 = this.selectDataPeopleTreeData.userList;
|
|
|
- let treeData = [];
|
|
|
- const dedupe = (array) => {
|
|
|
- return Array.from(new Set(array));
|
|
|
- };
|
|
|
- treeData[0] = JSON.stringify(this.selectDataHouseTreeData.userID);
|
|
|
- treeData[1] = JSON.stringify(arr2);
|
|
|
- if (arr1.length > 0) {
|
|
|
- dedupe(arr1).map((item, index) => {
|
|
|
- let obj = {
|
|
|
- noticeId: '',
|
|
|
- userId: item,
|
|
|
- userType: 0
|
|
|
- };
|
|
|
- userVos.push(obj);
|
|
|
- });
|
|
|
- }
|
|
|
- if (arr2.length > 0) {
|
|
|
- dedupe(arr2).map((item, index) => {
|
|
|
- let obj = {
|
|
|
- noticeId: '',
|
|
|
- userId: item,
|
|
|
- userType: 1
|
|
|
- };
|
|
|
- userVos.push(obj);
|
|
|
- });
|
|
|
- }
|
|
|
-
|
|
|
- let query = {
|
|
|
- communityId: this.ruleForm.popCommunityId,
|
|
|
- content: this.ruleForm.editorContents,
|
|
|
- startTime: this.showUploadImage ? startTime : '',
|
|
|
- endTime: this.showUploadImage ? endTime : '',
|
|
|
- filePath: JSON.stringify(this.uploadFileUrl),
|
|
|
- id: 1,
|
|
|
- pubDate: this.$moment(new Date()).format(`YYYY-MM-DDTHH:mm:ss`),
|
|
|
- themePictrue: JSON.stringify(this.upLoadImageList),
|
|
|
- treeData: JSON.stringify(treeData),
|
|
|
- title: this.ruleForm.title,
|
|
|
- type: this.ruleForm.informType,
|
|
|
- urgentFlag: this.ruleForm.exigencyOr == '是' ? 1 : 0,
|
|
|
- userVos: userVos
|
|
|
- };
|
|
|
- this.$http.post('/sc-community/notice/add', query).then((res) => {
|
|
|
- if (res.status === 0) {
|
|
|
- this.$message.success(res.msg);
|
|
|
- this.$refs.endit.setContent('');
|
|
|
- this.params.callback();
|
|
|
- this.$emit('close');
|
|
|
- } else {
|
|
|
- this.$message.error(res.msg);
|
|
|
- }
|
|
|
- this.showUploadImage = false;
|
|
|
- });
|
|
|
- } else {
|
|
|
- return false;
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- /** 获取社区列表*/
|
|
|
- getCommunityList() {
|
|
|
- this.$http.get('/sc-community/assets/community/list', {}).then(({ data }) => {
|
|
|
- this.communityList = data;
|
|
|
- });
|
|
|
- },
|
|
|
- }
|
|
|
+ this.showUploadImage = false;
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 获取社区列表*/
|
|
|
+ getCommunityList () {
|
|
|
+ this.$http.get('/sc-community/assets/community/list', {}).then(({ data }) => {
|
|
|
+ this.communityList = data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|