| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377 |
- <template>
- <div>
- <el-container>
- <simpleDataTable
- ref="dataTable"
- :tableViewConfig="config"
- data='/gw/ntc/annsmnt/getNtsAnnsmmts'
- @outerButtonClick="outerButtonClickHandler"
- @innerActionClick="rowButtonClickHandler">
- </simpleDataTable>
- <el-dialog title="编辑公告"
- :visible.sync="showEditorForm"
- :before-close="handleClose"
- :modal-append-to-body="true"
- :append-to-body="true"
- width="70%"
- >
- <simpleDataForm
- :tableViewConfig="config"
- @formActionFinished="formActionFinishedHandler"
- :formData="formObject"
- v-if="showEditorForm">
- </simpleDataForm>
- </el-dialog>
- </el-container>
- </div>
- </template>
- <script>
- import simpleDataTable from '@widget/simpleDataTable.vue'
- import simpleDataForm from '@widget/simpleDataForm.vue'
- import {dateFormat} from "@util/gw_date.js"
- export default {
- components: {
- 'simpleDataTable':simpleDataTable,
- 'simpleDataForm':simpleDataForm,
- },
- props: [],
- data() {
- return {
- formObject:{},
- showEditorForm:false,
- config:{
- "type": "list",
- "title": "公告",
- "columnCount": 1,
- "fields": [
-
- {
- "uiseq": "1",
- "prop": "id",
- "label": "主键ID",
- "type": "text",
- "isrequired": false,
- "isfilterable": false,
- "refObjValue": null,
- "minlength": "0",
- "maxlength": "0",
- "width": "0",
- "isSearchable":false,
- "ispk": true,
- "isHidden": true,
- "issortable": false
- },
- {
- "uiseq": "2",
- "prop": "title",
- "label": "标题",
- "type": "text",
- "isrequired": false,
- "isfilterable": false,
- "isSearchable":true,
- "refObjValue": null,
- "minlength": "0",
- "maxlength": "0",
- "width": "0",
- "ispk":false,
- "isHidden": false,
- "issortable": false
- },
- {
- "uiseq": "3",
- "prop": "type",
- "label": "类型",
- "isSearchable":true,
- "type": "select",
- "isrequired": false,
- "isfilterable": false,
- "refObjValue": 'gonggaoManage_type',
- "minlength": "0",
- "maxlength": "0",
- "width": "0",
- "ispk":false,
- "isHidden": false,
- "issortable": false
- },
- {
- "uiseq": "4",
- "prop": "pubTm",
- "label": "发布时间",
- "type": "date",
- "isSearchable":false,
- "isrequired": false,
- "isfilterable": false,
- "refObjValue": null,
- "minlength": "0",
- "maxlength": "0",
- "width": "0",
- "ispk": true,
- "isHidden": true,
- "issortable": false,
- "defaultValue":dateFormat(new Date(),'yyyy-MM-dd')
- },
- {
- "uiseq": "5",
- "prop": "persNm",
- "label": "发文人",
- "isSearchable":true,
- "type": "text",
- "isrequired": false,
- "isfilterable": false,
- "refObjValue": null,
- "minlength": "0",
- "maxlength": "0",
- "width": "0",
- "ispk":false,
- "isHidden": false,
- "issortable": false,
- "defaultValue":localStorage.getItem('account')
- },
- {
- "uiseq": "6",
- "prop": "orgNm",
- "label": "发文单位",
- "isSearchable":false,
- "type": "text",
- "isrequired": false,
- "isfilterable": false,
- "refObjValue": null,
- "minlength": "0",
- "maxlength": "0",
- "width": "0",
- "ispk":false,
- "isHidden": false,
- "issortable": false,
- "defaultValue":localStorage.getItem('orgNm')
- },
- {
- "uiseq": "7",
- "prop": "pubState",
- "label": "状态",
- "isSearchable":false,
- "type": "select",
- "isrequired": false,
- "isfilterable": false,
- "refObjValue": "gonggaoManage_pubState",
- "minlength": "0",
- "maxlength": "0",
- "width": "0",
- "ispk": true,
- "isHidden": true,
- "issortable": false,
- "defaultValue":"0"
- },
- {
- "uiseq": "8",
- "prop": "uptm",
- "label": "更新时间",
- "type": "date",
- "isrequired": false,
- "isSearchable":false,
- "isfilterable": false,
- "refObjValue": null,
- "minlength": "0",
- "maxlength": "0",
- "width": "0",
- "ispk":false,
- "isHidden": false,
- "issortable": false,
- "defaultValue":dateFormat(new Date(),'yyyy-MM-dd')
- },
- {
- "uiseq": "9",
- "prop": "intm",
- "isSearchable":false,
- "label": "创建时间",
- "type": "date",
- "isrequired": false,
- "isfilterable": false,
- "refObjValue": null,
- "minlength": "0",
- "maxlength": "0",
- "width": "0",
- "ispk":false,
- "isHidden": false,
- "issortable": false,
- "defaultValue":dateFormat(new Date(),'yyyy-MM-dd')
- },
- {
- "uiseq": "10",
- "prop": "content",
- "label": "内容",
- "isSearchable":false,
- "type": "richtext",
- "isrequired": false,
- "isfilterable": false,
- "refObjValue": null,
- "minlength": "0",
- "maxlength": "0",
- "width": "0",
- "ispk":false,
- "isHidden": false,
- "issortable": false
- },
- {
- "uiseq": "11",
- "prop": "url",
- "isSearchable":false,
- "label": "外部链接",
- "type": "text",
- "isrequired": false,
- "isfilterable": false,
- "refObjValue": null,
- "minlength": "0",
- "maxlength": "0",
- "width": "0",
- "ispk":false,
- "isHidden": false,
- "issortable": false
- },
- {
- "uiseq": "12",
- "prop": "note",
- "label": "备注",
- "type": "text",
- "isSearchable":false,
- "isrequired": false,
- "isfilterable": false,
- "refObjValue": null,
- "minlength": "0",
- "maxlength": "0",
- "width": "0",
- "ispk":false,
- "isHidden": false,
- "issortable": false
- },
- {
- "uiseq": "13",
- "prop": "persId",
- "label": "发文人ID",
- "isSearchable":false,
- "type": "text",
- "isrequired": false,
- "isfilterable": false,
- "refObjValue": null,
- "minlength": "0",
- "maxlength": "0",
- "width": "0",
- "ispk": true,
- "isHidden": true,
- "issortable": false,
- "defaultValue":localStorage.getItem('userid')
- },
- {
- "uiseq": "14",
- "prop": "orgId",
- "label": "发文单位ID",
- "type": "text",
- "isSearchable":false,
- "isrequired": false,
- "isfilterable": false,
- "refObjValue": null,
- "minlength": "0",
- "maxlength": "0",
- "width": "0",
- "ispk":false,
- "isHidden": true,
- "issortable": false,
- "defaultValue":localStorage.getItem('guid')
- },
- ],
- "actions": [
- {
- "type": "button",
- "name": "load",
- "label": "查询",
- "position": "outer",
- "seq": "1",
- "action":"loadData"
- },
- {
- "type": "button",
- "name": "add",
- "label": "添加",
- "position": "outer",
- "seq": "1",
- "action":"popup"
- },
- {
- "type": "button",
- "action":"popup",
- "name": "detail",
- "label": "编辑",
- "position": "inner",
- "seq": "1",
- "action":"popup"
- },
- {
- "type": "button",
- "name": "delete",
- "label": "删除",
- "position": "inner",
- "seq": "2",
- "action":"request",
- "requestType": "get",
- "url": "/gw/ntc/annsmnt/del/{id}"
- },
- {
- "type": "button",
- "action":"request",
- "name": "save",
- "label": "保存",
- "position": "bottom",
- "url": "/gw/ntc/annsmnt",
- "requestType": "post",
- "seq": "1",
- },
- ]
- },
- }
- },
- computed:{
- persId(){
- return localStorage.getItem('userid') ? localStorage.getItem('userid') : ''
- },
- orgId(){
- return localStorage.getItem('guid') ? localStorage.getItem('guid') : ''
- }
- },
- mounted() {
-
- },
- watch: {
- },
- methods: {
- outerButtonClickHandler:function(params){
- console.log('outerClick'+params);
- if(params.name=='add'){
- this.formObject = null;
- this.showEditorForm = true;
- }
- },
- handleClose:function(){
- this.editorFormClose();
- },
- editorFormClose:function(){
- this.showEditorForm = false;
- },
- rowButtonClickHandler:function(params){
- console.log('rowButtonClickHandler'+params);
- if(params.action.action=='popup'){
- this.formObject = params.row;
- this.showEditorForm = true;
- }
- },
- formActionFinishedHandler:function(){
- this.$refs['dataTable'].loadData();
- this.showEditorForm = false;
- }
- }
- }
- </script>
- <style lang="scss" scoped>
-
- </style>
|