informAdd.vue 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352
  1. <template>
  2. <div class="dialog-info">
  3. <div class="dialog-contents">
  4. <div class="dialog-left">
  5. <el-form
  6. :model="ruleForm"
  7. :rules="rules"
  8. ref="ruleForm"
  9. label-width="101px"
  10. class="demo-ruleForm"
  11. >
  12. <el-form-item
  13. label="所属社区"
  14. prop="popCommunityId"
  15. >
  16. <el-select
  17. placeholder="请选择所属社区"
  18. v-model="ruleForm.popCommunityId"
  19. clearable
  20. class="dialog-select"
  21. @change="changeCommunity"
  22. >
  23. <el-option
  24. v-for="(item, index) in communityList"
  25. :key="index"
  26. :label="item.communityName"
  27. :value="item.id"
  28. ></el-option>
  29. </el-select>
  30. </el-form-item>
  31. <el-form-item
  32. label="发布对象"
  33. prop="issueRoom"
  34. >
  35. <div class="issueRoom">
  36. <div class="radio-room">
  37. <el-checkbox
  38. label="社区住户"
  39. name="type"
  40. v-model="ruleForm.issueRoom.checkAll"
  41. @change="changeCheckboxRoom"
  42. ></el-checkbox>
  43. <el-radio-group
  44. v-model="ruleForm.issueRoom.radioRoom"
  45. :disabled="!ruleForm.issueRoom.checkAll"
  46. @change="changeRadioRoom"
  47. >
  48. <el-radio label="全部房间"></el-radio>
  49. <el-radio label="指定房间"></el-radio>
  50. </el-radio-group>
  51. </div>
  52. <div
  53. class="selet-room"
  54. v-show="ruleForm.issueRoom.checkAll"
  55. >
  56. <tree-house
  57. :buildingType="1"
  58. :showCheckboxTree="true"
  59. :defaultExpandAllTree="false"
  60. :accordion="true"
  61. :selectAll="true"
  62. @selectData="selectDataHouseTree"
  63. :disabledHouse="disabledHouse"
  64. ref="selectTreeHouse"
  65. ></tree-house>
  66. </div>
  67. </div>
  68. <div class="issueRoom">
  69. <div class="radio-room">
  70. <el-checkbox
  71. label="物业员工"
  72. name="type"
  73. v-model="ruleForm.issueRoom.staff"
  74. @change="changeCheckboxStaffRoom"
  75. ></el-checkbox>
  76. <el-radio-group
  77. v-model="ruleForm.issueRoom.radioStaff"
  78. :disabled="!ruleForm.issueRoom.staff"
  79. @change="changeRadioStaffRoom"
  80. >
  81. <el-radio label="全部员工"></el-radio>
  82. <el-radio label="指定员工"></el-radio>
  83. </el-radio-group>
  84. </div>
  85. <div
  86. class="selet-room"
  87. v-show="ruleForm.issueRoom.staff"
  88. >
  89. <!-- <GeminiScrollbar class="my-scroll-bar" :autoshow="true"> -->
  90. <tree-house
  91. ref="selectTreePeoples"
  92. :buildingType="1"
  93. :showCheckboxTree="true"
  94. :defaultExpandAllTree="false"
  95. :showHouseTree="false"
  96. :accordionPeople="true"
  97. :selectAll="true"
  98. @dataPeople="dataPeople"
  99. @selectPeople="selectPeople"
  100. :disabled="disabledPeople"
  101. ></tree-house>
  102. <!-- </GeminiScrollbar> -->
  103. </div>
  104. </div>
  105. </el-form-item>
  106. <el-form-item
  107. label="通知类型"
  108. prop="informType"
  109. >
  110. <el-select
  111. v-model="ruleForm.informType"
  112. @change="changeInformType"
  113. clearable
  114. class="dialog-select"
  115. placeholder="请选择通知类型"
  116. >
  117. <el-option
  118. v-for="(item, index) in informTypes"
  119. :key="index"
  120. :label="item.label"
  121. :value="item.status"
  122. >{{
  123. item.label
  124. }}</el-option>
  125. </el-select>
  126. </el-form-item>
  127. <el-form-item
  128. label="标题"
  129. prop="title"
  130. >
  131. <el-input
  132. v-model="ruleForm.title"
  133. placeholder="不能超过20字"
  134. maxlength="20"
  135. ></el-input>
  136. </el-form-item>
  137. <el-form-item
  138. label="是否紧急"
  139. prop="exigencyOr"
  140. >
  141. <el-radio-group
  142. v-model="ruleForm.exigencyOr"
  143. @change="changeRadioExigencyOr"
  144. >
  145. <el-radio label="是"></el-radio>
  146. <el-radio label="否"></el-radio>
  147. </el-radio-group>
  148. </el-form-item>
  149. <el-form-item
  150. label="选择时间"
  151. prop="activeTime"
  152. v-if="showUploadImage"
  153. >
  154. <el-date-picker
  155. v-model="ruleForm.activeTime"
  156. type="datetimerange"
  157. range-separator="至"
  158. start-placeholder="开始日期"
  159. end-placeholder="结束日期"
  160. :picker-options="pickerOptions"
  161. :editable="false"
  162. ></el-date-picker>
  163. </el-form-item>
  164. <el-form-item
  165. label="主题图片"
  166. prop="image"
  167. v-if="showUploadImage"
  168. >
  169. <div class="up-image">
  170. <up-image
  171. color="#1890ff"
  172. class="editor-upload-btn"
  173. @successCBK="imageSuccessCBK"
  174. @deleteImage="deleteImage"
  175. @successImageList="successImageList"
  176. ref="upImages"
  177. ></up-image>
  178. </div>
  179. </el-form-item>
  180. <el-form-item
  181. label="通知内容"
  182. prop="editorContents"
  183. >
  184. <!-- tinymce-editor 富文本编辑器 -->
  185. <div class="editor-container">
  186. <tinymce
  187. v-model="ruleForm.editorContents"
  188. ref="endit"
  189. :height="150"
  190. />
  191. </div>
  192. </el-form-item>
  193. <el-form-item
  194. label="文件上传"
  195. prop="fill"
  196. >
  197. <div>
  198. <el-upload
  199. class="upload-fill"
  200. action="/sc-community/upload/uploadFile"
  201. :on-preview="handlePreview"
  202. :on-remove="handleRemove"
  203. :before-remove="beforeRemove"
  204. multiple
  205. :limit="3"
  206. :on-exceed="handleExceed"
  207. :file-list="fileList"
  208. :on-success="successFile"
  209. >
  210. <el-button
  211. size="small"
  212. icon="el-icon-paperclip"
  213. >选择附件</el-button>
  214. <div
  215. slot="tip"
  216. class="el-upload-text"
  217. >支持格式:.rar .zip .doc .docx .pdf ,单个文件不能超过20MB</div>
  218. </el-upload>
  219. </div>
  220. </el-form-item>
  221. </el-form>
  222. </div>
  223. <div class="dialog-right">
  224. <div class="dialog-right-top">
  225. <img
  226. src="@assets/img/phoneHeader.png"
  227. alt=""
  228. />
  229. </div>
  230. <div class="dialog-right-header">
  231. <i class="el-icon-arrow-left"></i>
  232. <div v-if="showDetail">{{ this.showUploadImage ? '社区活动' : '物业通知' }}</div>
  233. <div v-else>{{ rowDetail.type == 0 ? '物业通知' : '社区活动' }}</div>
  234. </div>
  235. <div class="center-padding"></div>
  236. <GeminiScrollbar
  237. class="my-scroll-bar"
  238. :autoshow="true"
  239. >
  240. <div class="dialog-right-content">
  241. <div class="dialog-title">
  242. <div
  243. class="dialog-titles"
  244. v-if="showDetail"
  245. >
  246. {{ ruleForm.title ? ruleForm.title : '标题' }}
  247. </div>
  248. <div
  249. class="dialog-titles"
  250. v-else
  251. >
  252. {{ rowDetail.title ? rowDetail.title : '标题' }}
  253. </div>
  254. <div v-if="showDetail">
  255. <div
  256. class="dialog-urgency"
  257. v-if="ruleForm.exigencyOr == '是'"
  258. >紧急</div>
  259. </div>
  260. <div v-else>
  261. <div
  262. class="dialog-urgency"
  263. v-if="rowDetail.urgentFlag"
  264. >紧急</div>
  265. </div>
  266. <!-- ruleForm.exigencyOr -->
  267. </div>
  268. <div
  269. class="dialog-right-time"
  270. v-if="!showDetail"
  271. >{{ rowDetail.pubDate }}</div>
  272. <div
  273. class="dialog-right-time"
  274. v-else
  275. >{{ new Date() | filterTime }}</div>
  276. <div></div>
  277. <div class="content">
  278. <div class="content-text">
  279. <div
  280. v-html="ruleForm.editorContents"
  281. id="content"
  282. />
  283. </div>
  284. <div v-if="showDetail">
  285. <div
  286. class="file-name"
  287. v-for="(item, index) of uploadFileUrl"
  288. :key="index"
  289. >
  290. <span class="file-name-left"><i class="el-icon-paperclip"></i> </span>
  291. <span class="file-name-right">
  292. {{ item.name }}
  293. </span>
  294. </div>
  295. </div>
  296. <div v-else>
  297. <div
  298. class="file-name"
  299. v-for="(item, index) of filePath"
  300. :key="index"
  301. >
  302. <span class="file-name-left"><i class="el-icon-paperclip"></i> </span>
  303. <span class="file-name-right">
  304. {{ item.name }}
  305. </span>
  306. </div>
  307. </div>
  308. </div>
  309. <div></div>
  310. </div>
  311. </GeminiScrollbar>
  312. </div>
  313. </div>
  314. </div>
  315. </template>
  316. <script>
  317. import previeInform from '../common/previeInform';
  318. import upImage from '../common/upImage';
  319. // Tinymce 富文本编辑器
  320. import Tinymce from '@/components/Tinymce';
  321. export default {
  322. components: { previeInform, Tinymce, upImage },
  323. props: ['params'],
  324. data () {
  325. return {
  326. communityList: [],
  327. // 上传的图片
  328. upLoadImageList: [],
  329. disabledHouse: true,
  330. disabledPeople: true,
  331. popCommunityName: '',
  332. fileList: [],
  333. // 显示图片上传
  334. showUploadImage: false,
  335. dialogImageUrl: '',
  336. // 显示详情
  337. showDetail: true,
  338. rowDetail: '',
  339. contentHtml: '',
  340. // 查询的时间
  341. searchTime: [],
  342. // 添加弹框信息
  343. ruleForm: {
  344. popCommunityId: '', //所属社区
  345. //发布对象
  346. issueRoom: {
  347. checkAll: false,
  348. radioRoom: '',
  349. staff: false,
  350. radioStaff: ''
  351. },
  352. disabledRoom: false, //单选框是否禁用
  353. disabledStaffRoom: false,
  354. informType: '', //通知类型
  355. title: '', //标题
  356. exigencyOr: '是', //是否紧急
  357. exigencyText: true,
  358. activeTime: [],
  359. editorContents: '',
  360. // informContent: content, //通知内容
  361. informContent: '', //通知内容
  362. upload: '' // 文件上传
  363. },
  364. rules: {
  365. popCommunityId: [{ required: true, message: '请选择社区', trigger: 'change' }],
  366. radioRoom: [{ required: true, message: '请选择房间', trigger: 'change' }],
  367. informType: [{ required: true, message: '请选择通知类型', trigger: 'change' }],
  368. title: [{ required: true, message: '请输入标题', trigger: 'blur' }],
  369. exigencyOr: [{ required: true, message: '请选择是否紧急', trigger: 'change' }],
  370. activeTime: [{ required: true, message: '请选择时间', trigger: 'change' }],
  371. issueRoom: [{ required: true, message: '请选择发布对象', trigger: 'change' }],
  372. editorContents: [{ required: true, message: '请发布内容', trigger: 'blur' }] //通知内容
  373. },
  374. informTypes: [
  375. {
  376. status: 0,
  377. label: '物业通知'
  378. },
  379. {
  380. status: 1,
  381. label: '社区活动'
  382. }
  383. ],
  384. // 显隐弹框
  385. centerDialogVisible: false,
  386. // 获取的房间信息
  387. houseData: [],
  388. houseDataNames: '',
  389. houseDataNamesPeople: '',
  390. peopleData: [],
  391. userType: '',
  392. // 选中的房间
  393. selectDataHouseTreeData: {
  394. checkData: [],
  395. userID: [],
  396. userList: []
  397. },
  398. houseNames: [],
  399. PeopleNames: [],
  400. // 选中的人员
  401. selectDataPeopleTreeData: {
  402. checkData: [],
  403. userList: []
  404. },
  405. // 文件上传地址
  406. uploadFileUrl: []
  407. };
  408. },
  409. computed: {
  410. // 过滤富文本
  411. ruleFormEditorContents () {
  412. if (this.ruleForm.editorContents) {
  413. console.log('this.ruleForm.editorContents', this.ruleForm.editorContents);
  414. let formResult = null;
  415. let container = null;
  416. let imageUrl = this.ruleForm.editorContents.match(/<div id=".*" class="wscnph">\[图片\].*<\/div>.*/g);
  417. let text = this.ruleForm.editorContents.match(/\[图片\].*/g);
  418. if (Array.isArray(text) && text.length > 0) {
  419. container = text[0].substr(4, text[0].length - 10);
  420. }
  421. console.log('imageUrl', imageUrl);
  422. if (Array.isArray(imageUrl) && imageUrl.length > 0) {
  423. let url = imageUrl[0].substr(9, imageUrl[0].length - 36 + container.length);
  424. formResult = this.ruleForm.editorContents.replace(
  425. /<div id=".*" class="wscnph">\[图片\].*<\/div>/g,
  426. `<img class="wscnph" src="${url}" />`
  427. );
  428. }
  429. console.log('formResult', formResult);
  430. console.log('container', container);
  431. return `${formResult ? formResult : ''} <div>${container}</div>`;
  432. }
  433. }
  434. },
  435. created () {
  436. this.getCommunityList();
  437. },
  438. methods: {
  439. // 弹框关闭事件
  440. handleDialogClose (e) {
  441. this.showDetail = false;
  442. // console.log('handleDialogClose=========', e);
  443. if (!!this.$refs.previeInform) {
  444. this.$refs.previeInform.closeDialog();
  445. }
  446. },
  447. // 上传文件
  448. handleRemove (file, fileList) {
  449. // console.log('上传文件', file, fileList);
  450. },
  451. handlePreview (file) {
  452. // console.log('点击文件', file);
  453. },
  454. successFile (file, fileLists) {
  455. let obj = {};
  456. // this.fileList.push(fileLists.name);
  457. let resName = fileLists.response.data;
  458. obj.oldName = resName;
  459. obj.name = fileLists.name;
  460. // this.uploadFileUrl= this.uploadFileUrl.concat(newName + ',');
  461. this.uploadFileUrl.push(obj);
  462. },
  463. handleExceed (files, fileList) {
  464. this.$message.error(
  465. `当前最多可选 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`
  466. );
  467. },
  468. beforeRemove (file, fileList) {
  469. let removeName = this.fileList.filter((item) => {
  470. return item.name != file.name;
  471. });
  472. this.fileList = removeName;
  473. this.uploadFileUrl = removeName;
  474. },
  475. /**上传图片*/
  476. successImageList (arr) {
  477. this.upLoadImageList = [];
  478. this.upLoadImageList = arr;
  479. console.log('上传图片inform', this.upLoadImageList);
  480. },
  481. // 插入富文本
  482. imageSuccessCBK (arr) {
  483. this.$refs.endit.imageSuccessCBK(arr);
  484. },
  485. deleteImage (val) {
  486. this.$refs.endit.deleteImage(val);
  487. },
  488. handleRemove (file) { },
  489. handleDownload (file) { },
  490. // 添加弹框下拉框变化
  491. changeCommunity (val) {
  492. this.$http
  493. .get('/sc-community/assets/tree/community/find', { buildingType: this.buildingType })
  494. .then(({ status, data, msg }) => {
  495. if (status === 0 && data) {
  496. this.$refs.selectTreeHouse.filterhouse(val, data);
  497. // this.ruleForm.issueRoom.checkAll = true;
  498. // this.ruleForm.issueRoom.radioRoom = '全部房间';
  499. // this.ruleForm.issueRoom.radioStaff = '';
  500. // this.ruleForm.issueRoom.staff = false;
  501. } else {
  502. this.$message.error('获取房间失败');
  503. }
  504. });
  505. },
  506. // 选中的房间
  507. selectDataHouseTree (val) {
  508. this.selectDataHouseTreeData.userID = [];
  509. this.selectDataHouseTreeData.userID = val.userList;
  510. // this.selectDataHouseTreeData = val;
  511. // 获取房间下的usid
  512. this.$http.post('/sc-community/notice/queryHouseUser', val.userList).then((res) => {
  513. if (res.status === 0) {
  514. this.selectDataHouseTreeData.userList = res.data;
  515. } else {
  516. // this.$message('获取房间失败');
  517. }
  518. });
  519. },
  520. // 选择的人员
  521. selectPeople (val) {
  522. // if (val.userList.length < 1) {
  523. // this.ruleForm.issueRoom.radioStaff = '指定员工';
  524. // }
  525. this.selectDataPeopleTreeData.userList = [];
  526. this.selectDataPeopleTreeData = val;
  527. },
  528. /**监听指定房间单选框变化*/
  529. changeRadioRoom (val) {
  530. if (!this.ruleForm.popCommunityId) {
  531. ruleForm.issueRoom.checkAll = false;
  532. return this.$message.warning('请先选择所属社区');
  533. }
  534. if (val == '指定房间') {
  535. this.ruleForm.disabledRoom = true;
  536. this.$refs.selectTreeHouse.selectHouseOr();
  537. } else {
  538. this.ruleForm.disabledRoom = false;
  539. this.$refs.selectTreeHouse.selectAllHouse();
  540. }
  541. },
  542. //选择员工复选框变化
  543. changeCheckboxStaffRoom (val) {
  544. if (!this.ruleForm.popCommunityId) {
  545. this.ruleForm.issueRoom.staff = false;
  546. return this.$message.warning('请先选择社区');
  547. }
  548. if (val) {
  549. this.ruleForm.issueRoom.radioStaff = '全部员工';
  550. // this.ruleForm.issueRoom.checkAll = false;
  551. // this.ruleForm.issueRoom.radioRoom = '';
  552. this.$refs.selectTreePeoples.selectAllPeople();
  553. // this.$refs.selectTreeHouse.selectHouseOr();
  554. } else {
  555. this.ruleForm.issueRoom.radioStaff = '';
  556. // this.ruleForm.issueRoom.checkAll = true;
  557. // this.ruleForm.issueRoom.radioRoom = '全部房间';
  558. this.$refs.selectTreePeoples.selectPeopleOr();
  559. // this.$refs.selectTreeHouse.selectAllHouse();
  560. }
  561. },
  562. // 选择房间复选框变化
  563. changeCheckboxRoom (val) {
  564. if (!this.ruleForm.popCommunityId) {
  565. this.ruleForm.issueRoom.checkAll = false;
  566. return this.$message.warning('请先选择社区');
  567. }
  568. if (val) {
  569. // this.ruleForm.issueRoom.staff = false;
  570. // this.ruleForm.issueRoom.checkAll = true;
  571. this.ruleForm.issueRoom.radioRoom = '全部房间';
  572. // this.ruleForm.issueRoom.radioStaff = '';
  573. this.$refs.selectTreeHouse.selectAllHouse();
  574. } else {
  575. this.ruleForm.issueRoom.radioRoom = '';
  576. this.$refs.selectTreeHouse.selectHouseOr();
  577. }
  578. },
  579. // 指定员工
  580. changeRadioStaffRoom (val) {
  581. if (val == '指定员工') {
  582. this.ruleForm.disabledStaffRoom = true;
  583. this.$refs.selectTreePeoples.selectPeopleOr();
  584. } else {
  585. this.ruleForm.disabledStaffRoom = false;
  586. this.$refs.selectTreePeoples.selectAllPeople();
  587. }
  588. },
  589. // 是否紧急
  590. changeRadioExigencyOr (val) {
  591. if (val == '否') {
  592. this.ruleForm.exigencyText = false;
  593. } else {
  594. this.ruleForm.exigencyText = true;
  595. }
  596. },
  597. // 选择发布活动类型
  598. changeInformType (val) {
  599. this.successImageLists = '';
  600. this.upLoadImageList = [];
  601. if (val) {
  602. this.showUploadImage = true;
  603. } else {
  604. this.showUploadImage = false;
  605. }
  606. this.rowDetail = '';
  607. this.showDetail = true;
  608. if (!!this.$refs.endit) {
  609. this.$refs.endit.setContent('');
  610. }
  611. },
  612. submit () {
  613. this.$refs['ruleForm'].validate((valid) => {
  614. if (valid) {
  615. let content = this.ruleForm.editorContents;
  616. let img = [];
  617. content.replace(/<img [^>]*src=['"]([^'"]+)[^>]*>/g, function (match, capture) {
  618. img.push(capture);
  619. });
  620. if (
  621. this.selectDataHouseTreeData.userList.length === 0 &&
  622. this.selectDataPeopleTreeData &&
  623. this.selectDataPeopleTreeData.userList.length === 0
  624. ) {
  625. return this.$message.warning('所选暂无人员,不可发布');
  626. }
  627. let startTime = this.$moment(this.ruleForm.activeTime[0]).format(`YYYY-MM-DDTHH:mm:ss`);
  628. let endTime = this.$moment(this.ruleForm.activeTime[1]).format(`YYYY-MM-DDTHH:mm:ss`);
  629. var userVos = [];
  630. let arr1 = this.selectDataHouseTreeData.userList;
  631. let arr2 = this.selectDataPeopleTreeData.userList;
  632. let treeData = [];
  633. const dedupe = (array) => {
  634. return Array.from(new Set(array));
  635. };
  636. treeData[0] = JSON.stringify(this.selectDataHouseTreeData.userID);
  637. treeData[1] = JSON.stringify(arr2);
  638. if (arr1.length > 0) {
  639. dedupe(arr1).map((item, index) => {
  640. let obj = {
  641. noticeId: '',
  642. userId: item,
  643. userType: 0
  644. };
  645. userVos.push(obj);
  646. });
  647. }
  648. if (arr2.length > 0) {
  649. dedupe(arr2).map((item, index) => {
  650. let obj = {
  651. noticeId: '',
  652. userId: item,
  653. userType: 1
  654. };
  655. userVos.push(obj);
  656. });
  657. }
  658. let query = {
  659. communityId: this.ruleForm.popCommunityId,
  660. content: this.ruleForm.editorContents,
  661. startTime: this.showUploadImage ? startTime : '',
  662. endTime: this.showUploadImage ? endTime : '',
  663. filePath: JSON.stringify(this.uploadFileUrl),
  664. id: 1,
  665. pubDate: this.$moment(new Date()).format(`YYYY-MM-DDTHH:mm:ss`),
  666. themePictrue: JSON.stringify(this.upLoadImageList),
  667. treeData: JSON.stringify(treeData),
  668. title: this.ruleForm.title,
  669. type: this.ruleForm.informType,
  670. urgentFlag: this.ruleForm.exigencyOr == '是' ? 1 : 0,
  671. userVos: userVos
  672. };
  673. this.$http.post('/sc-community/notice/add', query).then((res) => {
  674. if (res.status === 0) {
  675. this.$message.success(res.msg);
  676. this.$refs.endit.setContent('');
  677. this.params.callback();
  678. this.$emit('close');
  679. } else {
  680. this.$message.error(res.msg);
  681. }
  682. this.showUploadImage = false;
  683. });
  684. } else {
  685. return false;
  686. }
  687. });
  688. },
  689. /** 获取社区列表*/
  690. getCommunityList () {
  691. this.$http.get('/sc-community/assets/community/list', {}).then(({ data }) => {
  692. this.communityList = data;
  693. });
  694. },
  695. }
  696. };
  697. </script>
  698. <style lang="scss" scoped>
  699. $fontSizeSmall: 14px;
  700. // 弹框格式
  701. /deep/ .el-dialog__header {
  702. background-color: #f8fcff;
  703. }
  704. /deep/ .el-dialog__body {
  705. padding: 20px 30px 30px;
  706. }
  707. // 表格样式
  708. // /deep/ .el-table th.is-leaf, .el-table td{
  709. // 添加表格边框
  710. // border-right: 1px solid #EBEEF5;
  711. // }
  712. /deep/ .el-table--fit {
  713. border: none;
  714. // box-shadow: 0px 0px 1px 3px white;
  715. }
  716. /deep/ .el-table td:first-child {
  717. text-align: center;
  718. }
  719. /deep/ .el-table th:first-child {
  720. text-align: center;
  721. }
  722. /deep/ .el-table thead {
  723. color: #424656;
  724. }
  725. // 表格内容溢出隐藏
  726. /deep/ .el-table_1_column_8 div p {
  727. width: 230px;
  728. overflow: hidden;
  729. white-space: nowrap;
  730. -o-text-overflow: ellipsis; //浏览器兼容
  731. text-overflow: ellipsis;
  732. }
  733. .statusColor {
  734. color: #ff7f7f;
  735. }
  736. .add {
  737. float: right;
  738. img {
  739. width: 30px;
  740. height: 30px;
  741. cursor: pointer;
  742. }
  743. }
  744. // 投诉建议弹框详情样式
  745. .complaint {
  746. .complaint-title {
  747. display: flex;
  748. }
  749. .complaint-title-left {
  750. width: 4px;
  751. height: 12px;
  752. background-color: #0eaeff;
  753. border-radius: 2px;
  754. margin-top: 4px;
  755. margin-right: 10px;
  756. }
  757. .complaint-title-right {
  758. font-family: PingFangSC-Medium, PingFang SC;
  759. color: #424656;
  760. font-weight: 500;
  761. }
  762. .grate-rate {
  763. background: #f4f7f9;
  764. border-radius: 2px;
  765. padding: 10px;
  766. color: #424656;
  767. font-size: 12px;
  768. }
  769. .grate-rate-title {
  770. margin-bottom: 20px;
  771. }
  772. .grate-text {
  773. margin-top: 8px;
  774. margin-left: 3px;
  775. color: #424656;
  776. font-family: PingFangSC-Regular, PingFang SC;
  777. font-weight: 400;
  778. font-size: 12px;
  779. }
  780. .complaint-content {
  781. display: flex;
  782. justify-content: space-between;
  783. margin: 24px;
  784. font-size: 12px;
  785. .complaint-content-left {
  786. color: #424656;
  787. margin-right: 13px;
  788. }
  789. .complaint-content-right {
  790. color: #535766;
  791. }
  792. .complaint-content-media {
  793. height: 100px !important;
  794. overflow: hidden !important;
  795. .media {
  796. width: 100%;
  797. }
  798. }
  799. }
  800. .complaint-images {
  801. margin-top: 33px;
  802. margin-left: 20px;
  803. display: block;
  804. max-height: 90px;
  805. }
  806. // 图片/视频样式
  807. .images {
  808. width: 25%;
  809. height: 90px;
  810. vertical-align: middle;
  811. border-radius: 4px;
  812. margin-right: 10px;
  813. /deep/ .el-image__preview {
  814. background: #ccc;
  815. width: 100%;
  816. object-fit: fill;
  817. }
  818. }
  819. // 记录部分
  820. .record {
  821. padding: 10px;
  822. margin-top: 20px;
  823. margin-bottom: 20px;
  824. background: #f4f7f9;
  825. max-height: 36vh;
  826. overflow-y: scroll;
  827. .recored-detali-row {
  828. margin: 10px;
  829. line-height: 14px;
  830. font-size: $fontSizeSmall;
  831. }
  832. .circle {
  833. width: 14px;
  834. height: 14px;
  835. margin-right: 10px;
  836. }
  837. .circle + span {
  838. margin-right: 10px;
  839. font-size: 14px;
  840. color: #424656;
  841. }
  842. .circle + span + span {
  843. font-size: 12px;
  844. color: #aaadba;
  845. }
  846. .recored-detali-rows {
  847. display: flex;
  848. margin-left: 7px;
  849. .record-left {
  850. position: absolute;
  851. width: 1px;
  852. height: 33px;
  853. border-radius: 4px;
  854. background-color: #0eaeff;
  855. margin-left: 10px;
  856. }
  857. :last-child {
  858. margin-top: 7px;
  859. margin-left: 26px;
  860. }
  861. }
  862. .recored-detali {
  863. position: relative;
  864. .last-row-right {
  865. position: absolute;
  866. right: 10px;
  867. bottom: 20px;
  868. color: #0eaeff;
  869. }
  870. .last-row-btn {
  871. position: absolute;
  872. top: 10px;
  873. right: 0px;
  874. width: 63px;
  875. height: 30px;
  876. }
  877. .statusColor {
  878. color: #ff7f7f;
  879. }
  880. }
  881. .columns {
  882. display: flex;
  883. justify-content: flex-start;
  884. }
  885. .end-row {
  886. margin-left: 33px;
  887. }
  888. .font-size-small {
  889. font-size: 12px;
  890. margin-bottom: 10px;
  891. }
  892. }
  893. // 下拉框部分
  894. .changeStatus {
  895. display: flex;
  896. width: 100%;
  897. margin-left: 10px;
  898. margin-bottom: 20px;
  899. .changeStatus-left {
  900. font-size: 12px;
  901. padding-top: 6px;
  902. width: 9%;
  903. margin-right: 10px;
  904. min-width: 60px;
  905. }
  906. .changeStatus-right {
  907. width: 88%;
  908. .el-select {
  909. width: 100%;
  910. }
  911. }
  912. }
  913. .replay {
  914. /deep/ .el-form-item__label {
  915. font-size: 12px;
  916. text-align: start;
  917. padding: 0px;
  918. margin: 0;
  919. }
  920. // 回复计数字体样式
  921. /deep/ .el-input__count {
  922. bottom: -2px;
  923. font-size: 12px;
  924. -webkit-transform-origin-x: 0;
  925. -webkit-transform: scale(0.8);
  926. }
  927. }
  928. //
  929. }
  930. // 物业电话样式
  931. .phone {
  932. /deep/.search-btn {
  933. height: 31px;
  934. }
  935. .opt {
  936. img {
  937. margin-right: 20px;
  938. width: 14px;
  939. height: 14px;
  940. line-height: 14px;
  941. &:last-child {
  942. margin-right: 0;
  943. }
  944. }
  945. }
  946. // 添加弹框样式
  947. .dialog-info {
  948. /deep/ .el-dialog__header {
  949. display: none;
  950. }
  951. /deep/ .el-dialog__body {
  952. padding: 0;
  953. }
  954. .dialog {
  955. .dialog-header {
  956. position: relative;
  957. width: 100%;
  958. height: 50px;
  959. background-color: #f8fcff;
  960. .el-dialog__close {
  961. position: absolute;
  962. right: 10px;
  963. top: 10px;
  964. }
  965. .dialogTitle {
  966. position: absolute;
  967. top: 10px;
  968. left: 24px;
  969. }
  970. }
  971. .dialog-content {
  972. padding: 27px 24px 4px 36px;
  973. /deep/ .el-select > .el-input {
  974. width: 324px;
  975. }
  976. /deep/ .el-select,
  977. .dialog-select,
  978. .el-select--small {
  979. width: 100% !important;
  980. }
  981. /deep/ .el-input,
  982. .l-input--small,
  983. .el-input--suffix {
  984. width: 100% !important;
  985. }
  986. /deep/ .el-upload {
  987. width: 92px !important;
  988. height: 30px !important;
  989. }
  990. }
  991. }
  992. }
  993. // 删除弹框
  994. .dialog-delete {
  995. /deep/ .el-dialog__title {
  996. font-size: 18px;
  997. font-weight: bold;
  998. }
  999. .el-button + .el-button {
  1000. margin-left: 20px;
  1001. }
  1002. .dialog-deletecontent {
  1003. margin-top: 10px;
  1004. display: flex;
  1005. .dialog-icon {
  1006. width: 45px;
  1007. height: 45px;
  1008. }
  1009. .dialog-icon + div {
  1010. margin-left: 10px;
  1011. :first-child {
  1012. font-size: 16px !important;
  1013. }
  1014. p {
  1015. font-size: 14px;
  1016. font-weight: bold;
  1017. .delete-name {
  1018. color: #ff7f7f;
  1019. }
  1020. }
  1021. }
  1022. }
  1023. }
  1024. }
  1025. // 通知公告样式
  1026. // 添加弹框样式
  1027. .dialog-contents {
  1028. width: 101%;
  1029. height: 100%;
  1030. display: flex;
  1031. /deep/ .el-radio-group {
  1032. margin-left: 10px;
  1033. }
  1034. .dialog-left {
  1035. width: 65%;
  1036. padding: 0px 20px 40px 0;
  1037. .dialog-select {
  1038. width: 100%;
  1039. /deep/ .el-select > .el-input {
  1040. width: 100%;
  1041. }
  1042. }
  1043. /deep/ .el-range-editor--small.el-input__inner {
  1044. width: 100% !important;
  1045. }
  1046. .issueRoom {
  1047. display: flex;
  1048. // justify-content: space-around;
  1049. .organ-tree {
  1050. width: 100%;
  1051. }
  1052. /deep/ .el-tree--highlight-current .el-tree-node.is-current > .el-tree-node__content {
  1053. background: #fff !important;
  1054. }
  1055. .organ-tree {
  1056. padding: 0 !important;
  1057. width: auto;
  1058. /deep/ .tree-style-box {
  1059. margin: 0px 0 5px 0;
  1060. border-radius: 4px;
  1061. }
  1062. }
  1063. // justify-content: space-between;
  1064. }
  1065. .radio-room {
  1066. margin-right: 10px;
  1067. width: 60%;
  1068. }
  1069. .selet-room {
  1070. display: flex;
  1071. justify-content: flex-end;
  1072. // width: 30%;
  1073. max-height: 50vh;
  1074. /deep/ .el-input__inner {
  1075. // margin-left: 10px;
  1076. width: 275px;
  1077. padding-right: 10px;
  1078. }
  1079. }
  1080. }
  1081. .dialog-right {
  1082. width: 283px;
  1083. height: 570px;
  1084. border-radius: 24px;
  1085. border: 1px solid #e0e1e3;
  1086. margin: 20px 40px 70px;
  1087. background-color: #fafcff;
  1088. .dialog-right-top {
  1089. text-align: center;
  1090. background: white;
  1091. border-top-right-radius: 28px;
  1092. border-top-left-radius: 28px;
  1093. border-bottom: none;
  1094. padding: 4px;
  1095. img {
  1096. background: white;
  1097. width: 100%;
  1098. width: 234px;
  1099. height: 8px;
  1100. text-align: center;
  1101. }
  1102. }
  1103. .dialog-right-header {
  1104. width: 100%;
  1105. padding: 24px 14px;
  1106. background: white;
  1107. :first-child {
  1108. float: left;
  1109. line-height: 20px;
  1110. }
  1111. :last-child {
  1112. font-weight: bold;
  1113. text-align: center;
  1114. }
  1115. }
  1116. .center-padding {
  1117. padding: 5px 0;
  1118. }
  1119. .dialog-right-content {
  1120. background: white;
  1121. padding: 11px;
  1122. .dialog-title {
  1123. display: flex;
  1124. .dialog-titles {
  1125. font-size: 14px;
  1126. color: #424656;
  1127. }
  1128. .dialog-urgency {
  1129. border-radius: 15px;
  1130. width: 36px;
  1131. height: 15px;
  1132. line-height: 15px;
  1133. background-image: linear-gradient(to right, #f65b5b, #ffa3a3);
  1134. font-size: 12px;
  1135. -webkit-transform-origin-x: 0;
  1136. -webkit-transform: scale(0.8);
  1137. margin-left: 2px;
  1138. margin-top: 2px;
  1139. color: white;
  1140. text-align: center;
  1141. }
  1142. }
  1143. .dialog-right-time {
  1144. font-size: 10px;
  1145. -webkit-transform-origin-x: 0;
  1146. -webkit-transform: scale(0.9);
  1147. color: #9ba6af;
  1148. padding: 3px 0;
  1149. }
  1150. .dialog-right-time + div {
  1151. width: 100%;
  1152. border-bottom: 1px solid #eeeeee;
  1153. margin-bottom: 10px;
  1154. }
  1155. .content {
  1156. width: 110%;
  1157. font-size: 10px;
  1158. color: #e0e1e3;
  1159. background-color: #fff;
  1160. -webkit-transform-origin-x: 0;
  1161. -webkit-transform: scale(0.92);
  1162. .content-text {
  1163. width: 100%;
  1164. color: #686b78;
  1165. background-color: #fff;
  1166. /deep/ img {
  1167. // width: 100%;
  1168. max-width: 100%;
  1169. max-height: 750px;
  1170. }
  1171. }
  1172. .file-name {
  1173. margin: 5px;
  1174. border-radius: 24px;
  1175. width: 90%;
  1176. background: #fafcff;
  1177. .file-name-left {
  1178. color: #0eaeff;
  1179. font-size: 14px;
  1180. }
  1181. .file-name-right {
  1182. color: #424656;
  1183. }
  1184. }
  1185. }
  1186. }
  1187. }
  1188. }
  1189. // 上传文件
  1190. .upload-fill {
  1191. width: 100%;
  1192. display: flex;
  1193. position: relative;
  1194. /deep/ .el-upload-list__item {
  1195. background: #f9f9f9;
  1196. }
  1197. /deep/ .el-upload--text {
  1198. width: 100px;
  1199. height: 32px;
  1200. margin-right: 10px;
  1201. border: 1px solid #e0e1e3;
  1202. .el-button {
  1203. border: none;
  1204. padding: 11px 17px;
  1205. }
  1206. }
  1207. .el-upload-text {
  1208. font-size: 12px !important;
  1209. color: #d8d8d8;
  1210. }
  1211. /deep/ .el-upload-list--text {
  1212. position: absolute;
  1213. top: 40px;
  1214. padding-bottom: 100px;
  1215. width: 100%;
  1216. li {
  1217. width: 30%;
  1218. float: left;
  1219. margin-right: 10px;
  1220. vertical-align: middle;
  1221. margin: 0 10px 0 0;
  1222. }
  1223. }
  1224. }
  1225. // 富文本编辑器样式
  1226. .editor-container {
  1227. border-radius: 4px;
  1228. margin-top: 10px;
  1229. border: 1px solid #e0e1e3;
  1230. }
  1231. /deep/ .mce-container,
  1232. .mce-container-body {
  1233. background: #fafcff;
  1234. }
  1235. /deep/ .mce-btn-group,
  1236. .mce-btn {
  1237. margin: 0;
  1238. }
  1239. /deep/ .mce-toolbar,
  1240. .mce-btn-group {
  1241. padding: 0;
  1242. }
  1243. /deep/ #mceu_33 {
  1244. display: none !important;
  1245. }
  1246. // #mceu_17 {
  1247. // display: none;
  1248. // }
  1249. s {
  1250. max-width: 200px;
  1251. max-height: 170px;
  1252. }
  1253. // 弹框自定义滚动条
  1254. .my-scroll-bar {
  1255. height: 438px;
  1256. /deep/ .gm-scrollbar.-horizontal .thumb {
  1257. height: 0;
  1258. }
  1259. }
  1260. .opt {
  1261. img {
  1262. width: 14px;
  1263. height: 14px;
  1264. }
  1265. }
  1266. // 社区邻里
  1267. .neighbor {
  1268. @extend .phone;
  1269. .complaint {
  1270. .record {
  1271. margin-top: 10px;
  1272. .recored-detali-row {
  1273. margin: 0px;
  1274. line-height: 32px;
  1275. position: relative;
  1276. }
  1277. .borders {
  1278. border-left: 1px solid #0eaeff;
  1279. }
  1280. .recored-detali-rows {
  1281. display: block;
  1282. padding-left: 17px;
  1283. .font-size-small {
  1284. margin-left: 0px;
  1285. margin-bottom: 0;
  1286. }
  1287. .rows-replay {
  1288. margin: 0;
  1289. padding-top: 5px;
  1290. font-size: 12px;
  1291. color: #0eaeff;
  1292. :first-child {
  1293. color: #424656;
  1294. margin-left: 0;
  1295. }
  1296. }
  1297. }
  1298. }
  1299. }
  1300. }
  1301. /deep/ iframe {
  1302. width: 99% !important;
  1303. }
  1304. /deep/ .cell.el-tooltip p {
  1305. overflow: hidden;
  1306. text-overflow: ellipsis;
  1307. white-space: nowrap;
  1308. }
  1309. /deep/ .el-table td div {
  1310. overflow: hidden;
  1311. text-overflow: ellipsis;
  1312. white-space: nowrap;
  1313. }
  1314. // 视频样式
  1315. .videos {
  1316. object-fit: fill !important;
  1317. }
  1318. /deep/ .html-left {
  1319. width: 16%;
  1320. }
  1321. </style>