a6f018dc42b6bf177cfc8e1172e71689163d11d2.svn-base 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. <template>
  2. <a-card :bordered="false">
  3. <!-- 查询区域 -->
  4. <div class="table-page-search-wrapper">
  5. <a-form layout="inline" @keyup.enter.native="searchQuery">
  6. <a-row :gutter="24">
  7. <a-col :span="6">
  8. <a-form-item label="标题">
  9. <a-input placeholder="请输入标题" v-model="queryParam.titile"></a-input>
  10. </a-form-item>
  11. </a-col>
  12. <!--<a-col :span="6">
  13. <a-form-item label="内容">
  14. <a-input placeholder="请输入内容" v-model="queryParam.msgContent"></a-input>
  15. </a-form-item>
  16. </a-col>-->
  17. <a-col :span="8">
  18. <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
  19. <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
  20. <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
  21. </span>
  22. </a-col>
  23. </a-row>
  24. </a-form>
  25. </div>
  26. <!-- 操作按钮区域 -->
  27. <div class="table-operator">
  28. <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
  29. <a-button type="primary" icon="download" @click="handleExportXls('系统通告')">导出</a-button>
  30. <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel">
  31. <a-button type="primary" icon="import">导入</a-button>
  32. </a-upload>
  33. <a-dropdown v-if="selectedRowKeys.length > 0">
  34. <a-menu slot="overlay">
  35. <a-menu-item key="1" @click="batchDel">
  36. <a-icon type="delete"/>
  37. 删除
  38. </a-menu-item>
  39. </a-menu>
  40. <a-button style="margin-left: 8px"> 批量操作
  41. <a-icon type="down"/>
  42. </a-button>
  43. </a-dropdown>
  44. </div>
  45. <!-- table区域-begin -->
  46. <div>
  47. <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
  48. <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
  49. <a style="margin-left: 24px" @click="onClearSelected">清空</a>
  50. </div>
  51. <a-table
  52. ref="table"
  53. size="middle"
  54. bordered
  55. rowKey="id"
  56. :columns="columns"
  57. :dataSource="dataSource"
  58. :pagination="ipagination"
  59. :loading="loading"
  60. :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
  61. @change="handleTableChange">
  62. <span slot="action" slot-scope="text, record">
  63. <a v-if="record.sendStatus == 0" @click="handleEdit(record)">编辑</a>
  64. <a-divider type="vertical" v-if="record.sendStatus == 0"/>
  65. <a-dropdown>
  66. <a class="ant-dropdown-link">更多 <a-icon type="down"/></a>
  67. <a-menu slot="overlay">
  68. <a-menu-item v-if="record.sendStatus != 1">
  69. <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
  70. <a>删除</a>
  71. </a-popconfirm>
  72. </a-menu-item>
  73. <a-menu-item v-if="record.sendStatus == 0">
  74. <a-popconfirm title="确定发布吗?" @confirm="() => releaseData(record.id)">
  75. <a>发布</a>
  76. </a-popconfirm>
  77. </a-menu-item>
  78. <!-- <a-menu-item v-if="record.sendStatus == 1">
  79. <a-popconfirm title="确定撤销吗?" @confirm="() => reovkeData(record.id)">
  80. <a>撤销</a>
  81. </a-popconfirm>
  82. </a-menu-item>
  83. -->
  84. <a-menu-item v-if="record.sendStatus == 1">
  85. <a @click="handleAlread(record)">通知情况</a>
  86. </a-menu-item>
  87. <a-menu-item>
  88. <a @click="handleDetail(record)">查看</a>
  89. </a-menu-item>
  90. </a-menu>
  91. </a-dropdown>
  92. </span>
  93. </a-table>
  94. </div>
  95. <!-- table区域-end -->
  96. <!-- 表单区域 -->
  97. <sysAnnouncement-modal ref="modalForm" @ok="modalFormOk"></sysAnnouncement-modal>
  98. <SysAlreadlyModal ref="Alreadly" ></SysAlreadlyModal>
  99. <!-- 查看详情 -->
  100. <j-modal class="detail-modal" title="查看详情" :visible.sync="detailModal.visible" :top="50" :width="600" switchFullscreen :footer="null">
  101. <iframe v-if="detailModal.url" class="detail-iframe" :src="detailModal.url"/>
  102. </j-modal>
  103. </a-card>
  104. </template>
  105. <script>
  106. import SysAnnouncementModal from './modules/SysAnnouncementModal'
  107. import {doReleaseData, doReovkeData} from '@/api/api'
  108. import {getAction} from '@/api/manage'
  109. import {JeecgListMixin} from '@/mixins/JeecgListMixin'
  110. import { ACCESS_TOKEN } from '@/store/mutation-types'
  111. import SysAlreadlyModal from "@views/system/modules/SysAlreadlyModal";
  112. export default {
  113. name: "SysAnnouncementList",
  114. mixins: [JeecgListMixin],
  115. components: {
  116. SysAnnouncementModal,
  117. SysAlreadlyModal
  118. },
  119. data() {
  120. return {
  121. description: '系统通告表管理页面',
  122. // 查询条件
  123. queryParam: {},
  124. // 表头
  125. columns: [
  126. {
  127. title: '#',
  128. dataIndex: '',
  129. key: 'rowIndex',
  130. width: 60,
  131. align: "center",
  132. customRender: function (t, r, index) {
  133. return parseInt(index) + 1;
  134. }
  135. },
  136. {
  137. title: '标题',
  138. align: "center",
  139. dataIndex: 'titile'
  140. },
  141. {
  142. title: '消息类型',
  143. align: "center",
  144. dataIndex: 'msgCategory',
  145. customRender: function (text) {
  146. if (text == '1') {
  147. return "通知公告";
  148. } else if (text == "2") {
  149. return "系统消息";
  150. } else {
  151. return text;
  152. }
  153. }
  154. },
  155. /*{
  156. title: '开始时间',
  157. align: "center",
  158. dataIndex: 'startTime'
  159. },
  160. {
  161. title: '结束时间',
  162. align: "center",
  163. dataIndex: 'endTime'
  164. },*/
  165. {
  166. title: '发布人',
  167. align: "center",
  168. dataIndex: 'sender'
  169. },
  170. {
  171. title: '优先级',
  172. align: "center",
  173. dataIndex: 'priority',
  174. customRender: function (text) {
  175. if (text == 'L') {
  176. return "低";
  177. } else if (text == "M") {
  178. return "中";
  179. } else if (text == "H") {
  180. return "高";
  181. } else {
  182. return text;
  183. }
  184. }
  185. },
  186. {
  187. title: '通告对象',
  188. align: "center",
  189. dataIndex: 'msgType',
  190. customRender: function (text) {
  191. if (text == 'USER') {
  192. return "指定用户";
  193. } else if (text == "ALL") {
  194. return "全体用户";
  195. } else {
  196. return text;
  197. }
  198. }
  199. },
  200. {
  201. title: '发布状态',
  202. align: "center",
  203. dataIndex: 'sendStatus',
  204. customRender: function (text) {
  205. if (text == 0) {
  206. return "未发布";
  207. } else if (text == 1) {
  208. return "已发布";
  209. } else if (text == 2) {
  210. return "已撤销";
  211. } else {
  212. return text;
  213. }
  214. }
  215. },
  216. {
  217. title: '发布时间',
  218. align: "center",
  219. dataIndex: 'sendTime'
  220. },
  221. /*{
  222. title: '撤销时间',
  223. align: "center",
  224. dataIndex: 'cancelTime'
  225. },*/
  226. /*{
  227. title: '删除状态(0,正常,1已删除)',
  228. align:"center",
  229. dataIndex: 'delFlag'
  230. },*/
  231. {
  232. title: '操作',
  233. dataIndex: 'action',
  234. align: "center",
  235. scopedSlots: {customRender: 'action'},
  236. }
  237. ],
  238. detailModal: {visible: false, url: '',},
  239. url: {
  240. list: "/sys/annountCement/list",
  241. delete: "/sys/annountCement/delete",
  242. deleteBatch: "/sys/annountCement/deleteBatch",
  243. releaseDataUrl: "/sys/annountCement/doReleaseData",
  244. reovkeDataUrl: "sys/annountCement/doReovkeData",
  245. exportXlsUrl: "sys/annountCement/exportXls",
  246. importExcelUrl: "sys/annountCement/importExcel",
  247. },
  248. }
  249. },
  250. computed: {
  251. importExcelUrl: function(){
  252. return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
  253. }
  254. },
  255. methods: {
  256. handleAlread(record){
  257. this.$refs.Alreadly.edit(record);
  258. this.$refs.Alreadly.disableSubmit=true;
  259. },
  260. //执行发布操作
  261. releaseData: function (id) {
  262. console.log(id);
  263. var that = this;
  264. doReleaseData({id: id}).then((res) => {
  265. if (res.success) {
  266. that.$message.success(res.message);
  267. that.loadData(1);
  268. } else {
  269. that.$message.warning(res.message);
  270. }
  271. });
  272. },
  273. //执行撤销操作
  274. reovkeData: function (id) {
  275. var that = this;
  276. doReovkeData({id: id}).then((res) => {
  277. if (res.success) {
  278. that.$message.success(res.message);
  279. that.loadData(1);
  280. this.syncHeadNotic(id)
  281. } else {
  282. that.$message.warning(res.message);
  283. }
  284. });
  285. },
  286. syncHeadNotic(anntId){
  287. getAction("sys/annountCement/syncNotic",{anntId:anntId})
  288. },
  289. handleDetail:function(record){
  290. const domain = window._CONFIG['domianURL']
  291. const token = this.$ls.get(ACCESS_TOKEN)
  292. this.detailModal.url = `${domain}/sys/annountCement/show/${record.id}?token=${token}`
  293. this.detailModal.visible = true
  294. },
  295. }
  296. }
  297. </script>
  298. <style scoped lang="less">
  299. @import '~@assets/less/common.less';
  300. /** 查看详情弹窗的样式 */
  301. .detail-modal {
  302. .detail-iframe {
  303. border: 0;
  304. width: 100%;
  305. height: 88vh;
  306. min-height: 600px;
  307. }
  308. &.fullscreen .detail-iframe {
  309. height: 100%;
  310. }
  311. }
  312. .detail-modal /deep/ .ant-modal {
  313. top: 30px;
  314. .ant-modal-body {
  315. font-size: 0;
  316. padding: 0;
  317. }
  318. }
  319. .detail-modal.fullscreen /deep/ .ant-modal {
  320. top: 0;
  321. }
  322. </style>