ae31405e1fd7b497de55aa525ccc30ff98f6e734.svn-base 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377
  1. <template>
  2. <div>
  3. <el-container>
  4. <simpleDataTable
  5. ref="dataTable"
  6. :tableViewConfig="config"
  7. data='/gw/ntc/annsmnt/getNtsAnnsmmts'
  8. @outerButtonClick="outerButtonClickHandler"
  9. @innerActionClick="rowButtonClickHandler">
  10. </simpleDataTable>
  11. <el-dialog title="编辑公告"
  12. :visible.sync="showEditorForm"
  13. :before-close="handleClose"
  14. :modal-append-to-body="true"
  15. :append-to-body="true"
  16. width="70%"
  17. >
  18. <simpleDataForm
  19. :tableViewConfig="config"
  20. @formActionFinished="formActionFinishedHandler"
  21. :formData="formObject"
  22. v-if="showEditorForm">
  23. </simpleDataForm>
  24. </el-dialog>
  25. </el-container>
  26. </div>
  27. </template>
  28. <script>
  29. import simpleDataTable from '@widget/simpleDataTable.vue'
  30. import simpleDataForm from '@widget/simpleDataForm.vue'
  31. import {dateFormat} from "@util/gw_date.js"
  32. export default {
  33. components: {
  34. 'simpleDataTable':simpleDataTable,
  35. 'simpleDataForm':simpleDataForm,
  36. },
  37. props: [],
  38. data() {
  39. return {
  40. formObject:{},
  41. showEditorForm:false,
  42. config:{
  43. "type": "list",
  44. "title": "公告",
  45. "columnCount": 1,
  46. "fields": [
  47. {
  48. "uiseq": "1",
  49. "prop": "id",
  50. "label": "主键ID",
  51. "type": "text",
  52. "isrequired": false,
  53. "isfilterable": false,
  54. "refObjValue": null,
  55. "minlength": "0",
  56. "maxlength": "0",
  57. "width": "0",
  58. "isSearchable":false,
  59. "ispk": true,
  60. "isHidden": true,
  61. "issortable": false
  62. },
  63. {
  64. "uiseq": "2",
  65. "prop": "title",
  66. "label": "标题",
  67. "type": "text",
  68. "isrequired": false,
  69. "isfilterable": false,
  70. "isSearchable":true,
  71. "refObjValue": null,
  72. "minlength": "0",
  73. "maxlength": "0",
  74. "width": "0",
  75. "ispk":false,
  76. "isHidden": false,
  77. "issortable": false
  78. },
  79. {
  80. "uiseq": "3",
  81. "prop": "type",
  82. "label": "类型",
  83. "isSearchable":true,
  84. "type": "select",
  85. "isrequired": false,
  86. "isfilterable": false,
  87. "refObjValue": 'gonggaoManage_type',
  88. "minlength": "0",
  89. "maxlength": "0",
  90. "width": "0",
  91. "ispk":false,
  92. "isHidden": false,
  93. "issortable": false
  94. },
  95. {
  96. "uiseq": "4",
  97. "prop": "pubTm",
  98. "label": "发布时间",
  99. "type": "date",
  100. "isSearchable":false,
  101. "isrequired": false,
  102. "isfilterable": false,
  103. "refObjValue": null,
  104. "minlength": "0",
  105. "maxlength": "0",
  106. "width": "0",
  107. "ispk": true,
  108. "isHidden": true,
  109. "issortable": false,
  110. "defaultValue":dateFormat(new Date(),'yyyy-MM-dd')
  111. },
  112. {
  113. "uiseq": "5",
  114. "prop": "persNm",
  115. "label": "发文人",
  116. "isSearchable":true,
  117. "type": "text",
  118. "isrequired": false,
  119. "isfilterable": false,
  120. "refObjValue": null,
  121. "minlength": "0",
  122. "maxlength": "0",
  123. "width": "0",
  124. "ispk":false,
  125. "isHidden": false,
  126. "issortable": false,
  127. "defaultValue":localStorage.getItem('account')
  128. },
  129. {
  130. "uiseq": "6",
  131. "prop": "orgNm",
  132. "label": "发文单位",
  133. "isSearchable":false,
  134. "type": "text",
  135. "isrequired": false,
  136. "isfilterable": false,
  137. "refObjValue": null,
  138. "minlength": "0",
  139. "maxlength": "0",
  140. "width": "0",
  141. "ispk":false,
  142. "isHidden": false,
  143. "issortable": false,
  144. "defaultValue":localStorage.getItem('orgNm')
  145. },
  146. {
  147. "uiseq": "7",
  148. "prop": "pubState",
  149. "label": "状态",
  150. "isSearchable":false,
  151. "type": "select",
  152. "isrequired": false,
  153. "isfilterable": false,
  154. "refObjValue": "gonggaoManage_pubState",
  155. "minlength": "0",
  156. "maxlength": "0",
  157. "width": "0",
  158. "ispk": true,
  159. "isHidden": true,
  160. "issortable": false,
  161. "defaultValue":"0"
  162. },
  163. {
  164. "uiseq": "8",
  165. "prop": "uptm",
  166. "label": "更新时间",
  167. "type": "date",
  168. "isrequired": false,
  169. "isSearchable":false,
  170. "isfilterable": false,
  171. "refObjValue": null,
  172. "minlength": "0",
  173. "maxlength": "0",
  174. "width": "0",
  175. "ispk":false,
  176. "isHidden": false,
  177. "issortable": false,
  178. "defaultValue":dateFormat(new Date(),'yyyy-MM-dd')
  179. },
  180. {
  181. "uiseq": "9",
  182. "prop": "intm",
  183. "isSearchable":false,
  184. "label": "创建时间",
  185. "type": "date",
  186. "isrequired": false,
  187. "isfilterable": false,
  188. "refObjValue": null,
  189. "minlength": "0",
  190. "maxlength": "0",
  191. "width": "0",
  192. "ispk":false,
  193. "isHidden": false,
  194. "issortable": false,
  195. "defaultValue":dateFormat(new Date(),'yyyy-MM-dd')
  196. },
  197. {
  198. "uiseq": "10",
  199. "prop": "content",
  200. "label": "内容",
  201. "isSearchable":false,
  202. "type": "richtext",
  203. "isrequired": false,
  204. "isfilterable": false,
  205. "refObjValue": null,
  206. "minlength": "0",
  207. "maxlength": "0",
  208. "width": "0",
  209. "ispk":false,
  210. "isHidden": false,
  211. "issortable": false
  212. },
  213. {
  214. "uiseq": "11",
  215. "prop": "url",
  216. "isSearchable":false,
  217. "label": "外部链接",
  218. "type": "text",
  219. "isrequired": false,
  220. "isfilterable": false,
  221. "refObjValue": null,
  222. "minlength": "0",
  223. "maxlength": "0",
  224. "width": "0",
  225. "ispk":false,
  226. "isHidden": false,
  227. "issortable": false
  228. },
  229. {
  230. "uiseq": "12",
  231. "prop": "note",
  232. "label": "备注",
  233. "type": "text",
  234. "isSearchable":false,
  235. "isrequired": false,
  236. "isfilterable": false,
  237. "refObjValue": null,
  238. "minlength": "0",
  239. "maxlength": "0",
  240. "width": "0",
  241. "ispk":false,
  242. "isHidden": false,
  243. "issortable": false
  244. },
  245. {
  246. "uiseq": "13",
  247. "prop": "persId",
  248. "label": "发文人ID",
  249. "isSearchable":false,
  250. "type": "text",
  251. "isrequired": false,
  252. "isfilterable": false,
  253. "refObjValue": null,
  254. "minlength": "0",
  255. "maxlength": "0",
  256. "width": "0",
  257. "ispk": true,
  258. "isHidden": true,
  259. "issortable": false,
  260. "defaultValue":localStorage.getItem('userid')
  261. },
  262. {
  263. "uiseq": "14",
  264. "prop": "orgId",
  265. "label": "发文单位ID",
  266. "type": "text",
  267. "isSearchable":false,
  268. "isrequired": false,
  269. "isfilterable": false,
  270. "refObjValue": null,
  271. "minlength": "0",
  272. "maxlength": "0",
  273. "width": "0",
  274. "ispk":false,
  275. "isHidden": true,
  276. "issortable": false,
  277. "defaultValue":localStorage.getItem('guid')
  278. },
  279. ],
  280. "actions": [
  281. {
  282. "type": "button",
  283. "name": "load",
  284. "label": "查询",
  285. "position": "outer",
  286. "seq": "1",
  287. "action":"loadData"
  288. },
  289. {
  290. "type": "button",
  291. "name": "add",
  292. "label": "添加",
  293. "position": "outer",
  294. "seq": "1",
  295. "action":"popup"
  296. },
  297. {
  298. "type": "button",
  299. "action":"popup",
  300. "name": "detail",
  301. "label": "编辑",
  302. "position": "inner",
  303. "seq": "1",
  304. "action":"popup"
  305. },
  306. {
  307. "type": "button",
  308. "name": "delete",
  309. "label": "删除",
  310. "position": "inner",
  311. "seq": "2",
  312. "action":"request",
  313. "requestType": "get",
  314. "url": "/gw/ntc/annsmnt/del/{id}"
  315. },
  316. {
  317. "type": "button",
  318. "action":"request",
  319. "name": "save",
  320. "label": "保存",
  321. "position": "bottom",
  322. "url": "/gw/ntc/annsmnt",
  323. "requestType": "post",
  324. "seq": "1",
  325. },
  326. ]
  327. },
  328. }
  329. },
  330. computed:{
  331. persId(){
  332. return localStorage.getItem('userid') ? localStorage.getItem('userid') : ''
  333. },
  334. orgId(){
  335. return localStorage.getItem('guid') ? localStorage.getItem('guid') : ''
  336. }
  337. },
  338. mounted() {
  339. },
  340. watch: {
  341. },
  342. methods: {
  343. outerButtonClickHandler:function(params){
  344. console.log('outerClick'+params);
  345. if(params.name=='add'){
  346. this.formObject = null;
  347. this.showEditorForm = true;
  348. }
  349. },
  350. handleClose:function(){
  351. this.editorFormClose();
  352. },
  353. editorFormClose:function(){
  354. this.showEditorForm = false;
  355. },
  356. rowButtonClickHandler:function(params){
  357. console.log('rowButtonClickHandler'+params);
  358. if(params.action.action=='popup'){
  359. this.formObject = params.row;
  360. this.showEditorForm = true;
  361. }
  362. },
  363. formActionFinishedHandler:function(){
  364. this.$refs['dataTable'].loadData();
  365. this.showEditorForm = false;
  366. }
  367. }
  368. }
  369. </script>
  370. <style lang="scss" scoped>
  371. </style>