messageNotification.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. <template>
  2. <!-- 消息通知 -->
  3. <div class="messageNotification">
  4. <div class="pAHeader">
  5. <div class="pAHeader1">消息通知</div>
  6. </div>
  7. <hr>
  8. <div class="twoSelectInp">
  9. <div class="selectTwo">
  10. <div class="selectsBlock">
  11. <el-input v-model="selectInput" style="width:200px" placeholder="请输入"></el-input>
  12. <el-button type="primary" class="btn2" >查询</el-button>
  13. </div>
  14. </div>
  15. <el-button type="primary" class="btn" @click="addMessage" size="mini">新建全站通知</el-button>
  16. </div>
  17. <!-- 通知表格开始 -->
  18. <div class="projectBlock">
  19. <el-table
  20. :data="tableData"
  21. tooltip-effect="dark"
  22. stripe
  23. class="fontSize"
  24. :header-cell-style="{ background: '#f2f2f2',color:'#000' }"
  25. >
  26. <el-table-column
  27. prop="projectName"
  28. label="通知内容"
  29. align="center"
  30. min-width="25%">
  31. </el-table-column>
  32. <el-table-column
  33. prop="founder"
  34. label="创建者"
  35. align="center"
  36. min-width="20%">
  37. </el-table-column>
  38. <el-table-column
  39. prop="date"
  40. label="创建时间"
  41. align="center"
  42. min-width="25%">
  43. </el-table-column>
  44. <el-table-column
  45. prop="operation"
  46. label="操作"
  47. align="center"
  48. min-width="30%"
  49. >
  50. <template #default="scope">
  51. <div class="operations">
  52. <!-- <el-button type="primary" > -->
  53. <el-button type="primary" size="mini" @click="lookIntro(scope)">查看信息</el-button>
  54. <el-button type="primary" size="mini" @click="del" >删除</el-button>
  55. <!-- </el-button> -->
  56. </div>
  57. </template>
  58. </el-table-column>
  59. </el-table>
  60. </div>
  61. <!-- 通知表格结束-->
  62. <!-- 添加全站通知开始 -->
  63. <el-dialog
  64. title="添加全站通知"
  65. :visible.sync="dialogVisible"
  66. width="600px"
  67. class="addDialog">
  68. <div class="addDialogLogo">LOGO</div>
  69. <div class="addDialogMid">
  70. <div class="addDialogTit">
  71. <span>通知标题</span>
  72. <el-input v-model="addMess.tit" placeholder="请输入内容"></el-input>
  73. </div>
  74. <div class="addDialogTit addDialogCon">
  75. <span>通知内容</span>
  76. <el-input
  77. type="textarea"
  78. :rows="10"
  79. resize="none"
  80. placeholder="请输入内容"
  81. v-model="addMess.con">
  82. </el-input>
  83. </div>
  84. </div>
  85. <span slot="footer" class="dialog-footer">
  86. <el-button type="primary" @click="confirmAdd" class="btn5">确认添加</el-button>
  87. <el-button @click="init" class="btn5">取 消</el-button>
  88. </span>
  89. </el-dialog>
  90. <!-- 添加全站通知结束-->
  91. <!-- 删除通知开始 -->
  92. <el-dialog
  93. title="删除通知"
  94. :visible.sync="dialogVisible1"
  95. width="600px"
  96. class="addDialog">
  97. <div class="addDialogLogo">LOGO</div>
  98. <span class="deleteContent">确定删除通知?</span>
  99. <span slot="footer" class="dialog-footer">
  100. <el-button type="primary" @click="dialogVisible1=false" class="btn5">确认删除</el-button>
  101. <el-button @click="dialogVisible1=false" class="btn5" >取消</el-button>
  102. </span>
  103. </el-dialog>
  104. <!-- 删除通知结束-->
  105. <!-- 查看通知开始 -->
  106. <el-dialog
  107. title="查看通知"
  108. :visible.sync="dialogVisible2"
  109. width="600px"
  110. class="addDialog">
  111. <div class="addDialogLogo">LOGO</div>
  112. <div class="addDialogMid">
  113. <div class="addDialogTit1">
  114. <div style="font-size:18px;color:#000">关于"一校一案"创客有关通知</div>
  115. <div style="margin-top: 13px;font-size: 16px;">蝎子莱莱</div>
  116. </div>
  117. <hr>
  118. <div class="addDialogTit2">
  119. <p>
  120. 活过,总要留下些什么
  121. 每一个活过的人,都能给后人的路途上添些光亮,也许是一颗巨
  122. 星,也许是一把火炬,也许只是一支含泪的蜡烛
  123. -《奶奶的星星》
  124. </p>
  125. </div>
  126. </div>
  127. <span slot="footer" class="dialog-footer">
  128. <el-button type="primary" @click="dialogVisible2=false" class="btn5">关闭</el-button>
  129. </span>
  130. </el-dialog>
  131. <!-- 查看通知结束 -->
  132. </div>
  133. </template>
  134. <script>
  135. export default {
  136. data() {
  137. return {
  138. textarea:'',
  139. //查询框
  140. selectInput:"",
  141. dialogVisible:false,
  142. dialogVisible1:false,
  143. dialogVisible2:false,
  144. input:'',
  145. tableData:[{
  146. projectName:'创业孵化基地企业情况信息表',
  147. date:'2022-11-12 10:18',
  148. size:'50k',
  149. founder:'黄猿',
  150. },
  151. {
  152. projectName:'创业孵化基地企业情况信息表',
  153. size:'50k',
  154. date:'2022-11-12 10:18',
  155. founder:'黄猿'
  156. }
  157. ],
  158. addMess:{
  159. tit:'',
  160. con:''
  161. }
  162. }
  163. },
  164. methods:{
  165. del(){
  166. this.dialogVisible1=true;
  167. },
  168. init(){
  169. //重置
  170. // if(this.textarea==''||this.input=='')return;
  171. // const date = new Date();
  172. // let data = {
  173. // projectName:this.input,
  174. // date:`${date.getFullYear()}-${date.getMonth()+1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}`,
  175. // founder:"覃罡彤",
  176. // }
  177. // this.tableData.push(data);
  178. this.dialogVisible=false;
  179. this.dialogVisible1=false;
  180. this.dialogVisible2=false;
  181. },
  182. addMessage(){
  183. this.dialogVisible=true;
  184. },
  185. confirmAdd(){
  186. let param ={
  187. uid:this.$store.state.userInfo.userid,
  188. title:this.addMess.tit,
  189. brief:this.addMess.con,
  190. }
  191. console.log(param)
  192. this.ajax
  193. .post(this.$store.state.api+"/CreateNewNotification",param)
  194. .then(res=>{
  195. console.log(res);
  196. this.init()
  197. },err=>{
  198. console.log(err);
  199. })
  200. },
  201. lookIntro(){
  202. this.dialogVisible2=true;
  203. }
  204. }
  205. }
  206. </script>
  207. <style lang="less">
  208. .messageNotification{
  209. .el-dialog{
  210. border-radius:5px;
  211. overflow: hidden;
  212. }
  213. .btn{
  214. height: 35px;
  215. width: 125px;
  216. background: #477edd;
  217. font-size: 16px;
  218. }
  219. .addDialog{
  220. font-size: 18px;
  221. .el-dialog{
  222. border-radius: 5px;
  223. overflow: hidden;
  224. }
  225. .deleteContent{
  226. margin: 30px 0;
  227. font-size: 22px;
  228. color: #000;
  229. }
  230. .addDialogLogo{
  231. width: 60px;
  232. height: 30px;
  233. line-height: 30px;
  234. background: #f2f2f2;
  235. position: absolute;
  236. left: 20px; top: 15px;
  237. }
  238. .el-dialog__header{
  239. background: #32455b;
  240. }
  241. .el-dialog__title{
  242. color:#fff;
  243. font-size: 22px;
  244. }
  245. .addDialogMid{
  246. box-sizing: border-box;
  247. padding:0 60px 0 10px;
  248. .addDialogTit{
  249. display: flex;
  250. span{
  251. width: 80px;
  252. font-size: 16px;
  253. line-height: 40px;
  254. text-align: left;
  255. }
  256. }
  257. .addDialogTit1{
  258. display: flex;
  259. justify-content: space-between;
  260. margin-bottom: 15px;
  261. }
  262. .addDialogTit2{
  263. margin-top: 10px;
  264. font-size: 16px;
  265. color: #000;
  266. text-indent: 2em;
  267. }
  268. .addDialogCon{
  269. margin-top: 20px;
  270. }
  271. }
  272. .dialog-footer{
  273. display: flex;
  274. justify-content: center;
  275. box-sizing: border-box;
  276. .btn5{
  277. font-size: 16px;
  278. }
  279. }
  280. }
  281. }
  282. </style>