Pārlūkot izejas kodu

公告调整、生成快照方法调整、数据表增加字段类型

cfort 2 gadi atpakaļ
vecāks
revīzija
b20f5c22d4

+ 2 - 2
src/business/platform/data/templaterender/templates/list.vue

@@ -154,7 +154,6 @@ import Scan from '@/views/system/jbdScan/scan.vue'
 import IbpsExport from '@/plugins/export'
 import IbpsImport from '@/plugins/import'
 import Vue from 'vue'
-import { preview } from '@/business/platform/form/utils/custom/preview'
 Vue.component('ibps-data-template-render-dialog', () => import('@/business/platform/data/templaterender/preview/dialog.vue'))
 import xlsxFile from '@/business/platform/data/templaterender/templates/compenent/xlsxFile.vue'
 
@@ -794,7 +793,8 @@ export default {
                             return
                         }
                         src = `${this.$reportPath.replace('show', 'pdf')}${button.reportPath}&id_=${selection}`
-                        preview(this, src)
+                        console.log(src)
+                        this.$common.preview(this, src)
                         break
                     case 'download': // 下载记录
                         if (!button.reportPath) {

+ 1 - 1
src/plugins/ibps/index.js

@@ -60,7 +60,7 @@ export default {
         const reportPath = '金通医学实验室管理系统'
         const downloadReport = (src, where, type = 6) => {
             // 目前可用type    6:生成报表的pdf文件【默认】   7:生成报表的word文件   3:生成报表的excel文件
-            return `${BASE_URL}demo/reportServlet?action=${type}&file=${encodeURIComponent(reportPath + '/' + src)}&columns=0&srcType=file&paramString=${encodeURIComponent(where)}`
+            return `${BASE_URL}demo/reportServlet?action=${type}&file=${encodeURIComponent(reportPath + '/' + src)}&print=1&srcType=file&paramString=${encodeURIComponent(where)}`
         }
         const timer = setInterval(() => { // 定时循环添加参数
             if (getToken()) {

+ 5 - 1
src/views/platform/bo/boDef/constants/index.js

@@ -64,7 +64,11 @@ export const typeOptions = [
     },
     {
         value: 'clob',
-        label: '大文本'
+        label: 'text【最大长度为65,535个字符(约64KB)】'
+    },
+    {
+        value: 'mediumtext',
+        label: 'mediumtext【最大长度为16,777,215个字符(约16MB)】'
     }
 ]
 export const formatOptions = [

+ 41 - 40
src/views/platform/system/news/constants/index.js

@@ -1,46 +1,47 @@
 export const typeOptions = [
-  {
-    value: 'expired',
-    label: '已过期',
-    type: 'info'
-  },
-  {
-    value: 'publish',
-    label: '已发布',
-    type: 'danger'
-  },
-  {
-    value: 'drafts',
-    label: '草稿'
-  }
+    {
+        value: 'expired',
+        label: '已过期',
+        type: 'danger'
+    },
+    {
+        value: 'publish',
+        label: '已发布',
+        type: 'success'
+    },
+    {
+        value: 'drafts',
+        label: '草稿',
+        type: 'warning'
+    }
 ]
 export const publicItemOptions = [
-  {
-    value: 'top',
-    label: '置顶工作首页',
-    type: 'warning'
-  },
-  {
-    value: 'notices',
-    label: '发布公告',
-    type: 'success'
-  }
+    {
+        value: 'top',
+        label: '置顶工作首页',
+        type: 'warning'
+    },
+    {
+        value: 'notices',
+        label: '发布公告',
+        type: 'success'
+    }
 ]
 export const isPublicOptions = [
-  {
-    value: 'yes',
-    label: '是'
-  },
-  {
-    value: 'Y',
-    label: '是'
-  },
-  {
-    value: 'no',
-    label: '否'
-  },
-  {
-    value: 'N',
-    label: '否'
-  }
+    {
+        value: 'yes',
+        label: '是'
+    },
+    {
+        value: 'Y',
+        label: '是'
+    },
+    {
+        value: 'no',
+        label: '否'
+    },
+    {
+        value: 'N',
+        label: '否'
+    }
 ]

+ 170 - 189
src/views/platform/system/news/detail.vue

@@ -1,98 +1,75 @@
 <template>
-  <el-dialog
-    :title="title"
-    :visible.sync="dialogVisible"
-    :close-on-click-modal="false"
-    :close-on-press-escape="false"
-    append-to-body
-    width="65%"
-    top="5vh"
-    class="news-detail-dialog"
-    @open="getFormData"
-    @close="closeDialog"
-  >
-    <div style="padding: 10px;">
-      <el-row>
-        <el-col :span="24">
-          <el-col :span="18">
-            <el-col :span="24">
-                         <span> 标题: <div class="text-border">{{ form.title || "/" }}</div></span>
-              </el-col>
-            <el-col :span="24">
-              <el-col :span="8">
-                <span>发布人:<div class="text-border">{{ form.userName|| "/" }}</div></span>
-              </el-col>
-              <el-col :span="8" style="display: none;">
-                <span>作者:<div class="text-border">{{ form.author|| "/" }}</div></span>
-              </el-col>
-              <el-col :span="8" style="display: none;">
-                <div>公告类型:<div class="text-border">{{ form.publicItem|optionsFilter(publicItemOptions,'label') || "/"}}</div></div>
-              </el-col>
-            </el-col>
-            <el-col :span="24" style="display: none;">
-              <el-col :span="8">
-                <span>是否公共:<div class="text-border">{{ form.isPublic|optionsFilter(isPublicOptions,'label')|| "/" }}</div></span>
-              </el-col>
-              <el-col :span="16" style="display: none;">
-                <span>查看范围组织:<div class="text-border">{{ form.depName || "/"}}</div> </span>
-              </el-col>
-            </el-col>
-            <el-col :span="24">
-              <el-col :span="8">
-                <span>有效时间:<div class="text-border">{{ form.publicDate|dateFormat('yyyy-MM-dd') }} 至 {{ form.loseDate|dateFormat('yyyy-MM-dd')|| "/" }}</div></span>
-              </el-col>
-              <el-col :span="16" style="display: none;">
-                <span>关键字:<label style="color:red"><div class="text-border">{{ form.key || "/"}}</div></label></span>
-              </el-col>
-            </el-col>
-            <el-col :span="24" style="display: none;">
-              <span>附件:</span>
-              <ibps-attachment-selector
-                ref="fileAttach"
-                :value="form.fileAttach"
-                multiple
-                readonly
-                allow-download
-                :download="readonly"
-                style="margin:5px;"
-                @callback="data => formId = data.id"
-                v-if="form.fileAttach"
-              />
-              <span v-else>/</span>
-
-            </el-col>
-          </el-col>
-           <br/>
-          <el-col :span="6" style="display: none;">
-            <el-image :src="image" class="avatar" style="width: 180px; height: 180px; display: block;">
-              <div slot="error">
-                <i class="el-icon-picture-outline" style="font-size:180px;color: #909399;" />
-              </div>
-            </el-image>
-            <!-- <img :src="image" class="avatar"> -->
-          </el-col>
-        </el-col>
-        <el-col :span="24">
-          <el-row :gutter="10">
-            <el-col :span="24">内容:<span  v-if="!form.content">/</span></el-col>
-              <el-col :span="24">
-                <div class="ibps-p-10" v-html="form.content"  v-if="form.content"/>
-              </el-col>
-          </el-row>
-          </span>
-
-          <!-- <ibps-ueditor v-model="form.content" :readonly="readonly" destroy /> -->
-        </el-col>
-      </el-row>
-
-    </div>
-    <div slot="footer" class="el-dialog--center">
-      <ibps-toolbar
-        :actions="toolbars"
-        @action-event="handleActionEvent"
-      />
-    </div>
-  </el-dialog>
+    <el-dialog
+        :title="title"
+        :visible.sync="dialogVisible"
+        :close-on-click-modal="false"
+        :close-on-press-escape="false"
+        append-to-body
+        width="65%"
+        top="10vh"
+        class="news-detail-dialog"
+        @open="getFormData"
+        @close="closeDialog"
+    >
+        <el-row style="padding: 10px 10px 0 10px; max-height: 600px;">
+            <el-form ref="form" :model="form" label-width="100px" disabled>
+                <el-form-item label="公告分类:" prop="typeId">
+                    <ibps-type-select v-model="form.typeId" category-key="NOTICE_TYPE" />
+                </el-form-item>
+                <el-form-item label="标题:" prop="title">
+                    <el-input v-model="form.title" />
+                </el-form-item>
+                <el-form-item label="作者:" prop="author">
+                    <el-input v-model="form.author" />
+                </el-form-item>
+                <el-form-item label="关键字:" prop="key">
+                    <el-input v-model="form.key" />
+                </el-form-item>
+                <el-row>
+                    <el-col :span="12">
+                        <el-form-item label="发布时间:" prop="publicDate">
+                            <el-date-picker
+                                v-model="form.publicDate"
+                                type="date"
+                                style="width:100%;"
+                                placeholder=""
+                                value-format="yyyy-MM-dd HH:mm:ss"
+                            />
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="12">
+                        <el-form-item label="失效时间:" prop="loseDate">
+                            <el-date-picker
+                                v-model="form.loseDate"
+                                type="date"
+                                style="width:100%;"
+                                placeholder=""
+                                value-format="yyyy-MM-dd HH:mm:ss"
+                            />
+                        </el-form-item>
+                    </el-col>
+                </el-row>
+                <el-form-item label="附件:" prop="fileAttach">
+                    <ibps-attachment-selector
+                        v-if="form.fileAttach"
+                        :value="form.fileAttach"
+                        multiple
+                        readonly
+                    />
+                    <span v-else>/</span>
+                </el-form-item>
+                <el-form-item label="内容:" prop="content">
+                    <ibps-ueditor v-model="form.content" :readonly="readonly" destroy />
+                </el-form-item>
+            </el-form>
+        </el-row>
+        <div slot="footer" class="el-dialog--center">
+            <ibps-toolbar
+                :actions="toolbars"
+                @action-event="handleActionEvent"
+            />
+        </div>
+    </el-dialog>
 </template>
 
 <script>
@@ -100,111 +77,115 @@ import IbpsAttachmentSelector from '@/business/platform/file/attachment/selector
 import { get } from '@/api/platform/system/news'
 import { typeOptions, publicItemOptions, isPublicOptions } from './constants'
 import { getFile } from '@/utils/avatar'
+import IbpsUeditor from '@/components/ibps-ueditor'
+import IbpsTypeSelect from '@/business/platform/cat/type/select'
 export default {
-  components: {
-    IbpsAttachmentSelector
-  },
-  props: {
-    visible: {
-      type: Boolean,
-      default: false
-    },
-    readonly: {
-      type: Boolean,
-      default: false
+    components: {
+        IbpsAttachmentSelector,
+        IbpsUeditor,
+        IbpsTypeSelect
     },
-    id: String,
-    title: String
-  },
-  data() {
-    return {
-      formName: 'form',
-      dialogVisible: this.visible,
-      dialogLoading: false,
-      dialogFormVisible: false, // 弹窗
-      typeOptions: typeOptions,
-      publicItemOptions: publicItemOptions,
-      isPublicOptions: isPublicOptions,
-      form: {},
-      toolbars: [
-        { key: 'cancel' }
-      ]
-    }
-  },
-  computed: {
-    formId() {
-      return this.id
-    },
-    image() {
-      return getFile(this.form.picture)
-    }
-  },
-  watch: {
-    visible: {
-      handler: function(val, oldVal) {
-        this.dialogVisible = this.visible
-      },
-      immediate: true
-    }
-  },
-  methods: {
-    handleActionEvent({ key }) {
-      switch (key) {
-        case 'cancel':
-          this.closeDialog()
-          break
-        default:
-          break
-      }
+    props: {
+        visible: {
+            type: Boolean,
+            default: false
+        },
+        readonly: {
+            type: Boolean,
+            default: false
+        },
+        id: String,
+        title: String
     },
-    // 关闭当前窗口
-    closeDialog() {
-      this.$emit('close', false)
+    data () {
+        return {
+            formName: 'form',
+            dialogVisible: this.visible,
+            dialogLoading: false,
+            dialogFormVisible: false, // 弹窗
+            typeOptions: typeOptions,
+            publicItemOptions: publicItemOptions,
+            isPublicOptions: isPublicOptions,
+            form: {},
+            toolbars: [
+                { key: 'cancel', label: '关闭' }
+            ]
+        }
     },
-    titleStyle(color) {
-      this.$refs.title.style.color = color
+    computed: {
+        formId () {
+            return this.id
+        },
+        image () {
+            return getFile(this.form.picture)
+        }
     },
-    /**
-     * 获取表单数据
-     */
-    getFormData() {
-      this.dialogLoading = true
-      get({
-        newsId: this.formId
-      }).then(response => {
-        const data = response.data
-        this.form = data
-        if (response.data.publicItem === 'important') {
-          this.titleStyle('red')
-        } else {
-          this.titleStyle('black')
+    watch: {
+        visible: {
+            handler: function (val, oldVal) {
+                this.dialogVisible = this.visible
+            },
+            immediate: true
         }
+    },
+    methods: {
+        handleActionEvent ({ key }) {
+            switch (key) {
+                case 'cancel':
+                    this.closeDialog()
+                    break
+                default:
+                    break
+            }
+        },
+        // 关闭当前窗口
+        closeDialog () {
+            this.$emit('close', false)
+        },
+        titleStyle (color) {
+            this.$refs.title.style.color = color
+        },
+        /**
+         * 获取表单数据
+         */
+        getFormData () {
+            this.dialogLoading = true
+            get({
+                newsId: this.formId
+            }).then(response => {
+                const data = response.data
+                this.form = data
+                if (response.data.publicItem === 'important') {
+                    this.titleStyle('red')
+                } else {
+                    this.titleStyle('black')
+                }
 
-        this.dialogLoading = false
-      }).catch(() => {
-        this.dialogLoading = false
-      })
+                this.dialogLoading = false
+            }).catch(() => {
+                this.dialogLoading = false
+            })
+        }
     }
-  }
 
 }
 </script>
 <style lang="scss">
-.news-detail-dialog{
-  .text-border{
-    width:100%;
-    color: #000000;
-    box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.1),
-    0 0 0 0 rgba(0, 0, 0, 0.1),
-    0 0 0 0 rgba(0, 0, 0, 0.1),
-    0 1px 0px 0 rgba(0, 0, 0, 0.1);
-    min-height: 38px;
-    font-size: 14px;
-    font-weight: bold;
-    text-align: center;
-  }
-  .el-dialog__body{
-    height:  calc(70vh - 110px) !important;
-  }
-}
+    .news-detail-dialog{
+        .text-border{
+            width:100%;
+            color: #000000;
+            box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.1),
+            0 0 0 0 rgba(0, 0, 0, 0.1),
+            0 0 0 0 rgba(0, 0, 0, 0.1),
+            0 1px 0px 0 rgba(0, 0, 0, 0.1);
+            min-height: 38px;
+            font-size: 14px;
+            font-weight: bold;
+            text-align: center;
+        }
+        .el-dialog__body{
+            height:  calc(70vh - 110px) !important;
+        }
+    }
 </style>

+ 431 - 411
src/views/platform/system/news/edit.vue

@@ -1,133 +1,147 @@
 <template>
-  <el-dialog
-    :title="title"
-    :visible.sync="dialogVisible"
-    :close-on-click-modal="false"
-    :close-on-press-escape="false"
-    append-to-body
-    width="65%"
-    top="0"
-    custom-class="dialog is-fullscreen"
-    @open="getform"
-    @close="closeDialog"
-  >
-    <el-row>
-      <el-col :span="7">
-        <div style="padding-left:65px; display: none;">
-          <span class="photo-area" @click="dialogPictureVisible = !readonly">
-            <img v-if="form.picture" :src="image" class="avatar">
-            <i v-else class="el-icon-plus avatar-uploader-icon" />
-            <div v-if="!readonly" :class="form.picture!==''?'handle-photo-buttons':null" @click.stop="() => { dialogPictureVisible = false }">
-              <div v-if="form.picture!==''">
-                <i class="el-icon-edit" @click.stop="dialogPictureVisible = !readonly" />
-                <i class="el-icon-delete" @click.stop="form.picture = ''" />
-              </div>
+    <el-dialog
+        :title="title"
+        :visible.sync="dialogVisible"
+        :close-on-click-modal="false"
+        :close-on-press-escape="false"
+        append-to-body
+        width="65%"
+        top="10vh"
+        custom-class="dialog"
+        @open="getform"
+        @close="closeDialog"
+    >
+        <el-row style="padding: 10px; max-height: 600px;">
+            <!-- <div style="padding-left:65px;">
+                <span class="photo-area" @click="dialogPictureVisible = !readonly">
+                    <img v-if="form.picture" :src="image" class="avatar">
+                    <i v-else class="el-icon-plus avatar-uploader-icon" />
+                    <div
+                        v-if="!readonly"
+                        :class="form.picture !== '' ? 'handle-photo-buttons' : null"
+                        @click.stop="() => { dialogPictureVisible = false }"
+                    >
+                        <div v-if="form.picture !== ''">
+                            <i class="el-icon-edit" @click.stop="dialogPictureVisible = !readonly" />
+                            <i class="el-icon-delete" @click.stop="form.picture = ''" />
+                        </div>
+                    </div>
+                </span>
             </div>
-          </span>
-        </div>
-        <span v-if="!readonly " class="operation" style="display: none;">点击上方选择封面图片</span>
+            <span v-if="!readonly" class="operation">点击上方选择封面图片</span>
+            <ibps-uploader
+                :visible="dialogPictureVisible"
+                :accept="accept"
+                @action-event="uploaderPictureAction"
+                @close="visible => dialogPictureVisible = visible"
+            /> -->
+            <el-form ref="form" :rules="rules" :model="form" label-width="100px" @submit.native.prevent>
+                <!-- <el-form-item label="发布选项:" prop="publicItem">
+                    <el-radio-group v-model="form.publicItem">
+                        <el-radio label="notices">发布公告</el-radio>
+                        <el-radio label="top">置顶工作首页</el-radio>
+                    </el-radio-group>
+                </el-form-item> -->
+                <el-form-item label="公告分类:" prop="typeId">
+                    <ibps-type-select v-model="form.typeId" category-key="NOTICE_TYPE" clearable />
+                </el-form-item>
+                <el-form-item label="标题:" prop="title">
+                    <el-input v-model="form.title" />
+                </el-form-item>
+                <!-- <el-form-item label="发布人:" prop="userId">
+                    <ibps-employee-selector :value="form.userId" @callback="handleInput" />
+                </el-form-item> -->
+                <!-- <el-row>
+                    <el-col :span="12">
+                        <el-form-item label="是否公共:" prop="public0">
+                            <el-radio-group v-model="form.public0" @change="change">
+                                <el-radio label="Y">是</el-radio>
+                                <el-radio label="N">否</el-radio>
+                            </el-radio-group>
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="12">
+                        <el-form-item v-if="show === 'N'" label="是否包含子集" prop="includeChild">
+                            <el-radio-group v-model="form.includeChild">
+                                <el-radio label="Y">是</el-radio>
+                                <el-radio label="N">否</el-radio>
+                            </el-radio-group>
+                        </el-form-item>
+                    </el-col>
+                </el-row>
+                <el-form-item v-if="show === 'N'" label="发布范围:" prop="depName">
+                    <ibps-org-selector
+                        :value="form.depId"
+                        :multiple="true"
+                        @input="depNameInput"
+                        @callback="callbackDepName"
+                    />
+                </el-form-item> -->
+                <el-form-item label="作者:" prop="author">
+                    <el-input v-model="form.author" />
+                </el-form-item>
+                <el-form-item label="关键字:" prop="key">
+                    <el-input v-model="form.key" />
+                </el-form-item>
+                <!-- <el-form-item label="发布时间:" prop="publicDate">
+                    <el-date-picker
+                        v-model="form.publicDate"
+                        type="date"
+                        style="width:100%;"
+                        placeholder="选择日期"
+                        value-format="yyyy-MM-dd HH:mm:ss"
+                    />
+                </el-form-item>
+                <el-form-item label="失效时间:" prop="loseDate">
+                    <el-date-picker
+                        v-model="form.loseDate"
+                        type="date"
+                        style="width:100%;"
+                        placeholder="选择日期,不可早于发布时间"
+                        value-format="yyyy-MM-dd HH:mm:ss"
+                    />
+                </el-form-item> -->
+                <el-row>
+                    <el-col :span="12">
+                        <el-form-item label="发布时间:" prop="publicDate">
+                            <el-date-picker
+                                v-model="form.publicDate"
+                                type="date"
+                                style="width:100%;"
+                                placeholder="选择日期"
+                                value-format="yyyy-MM-dd HH:mm:ss"
+                            />
+                        </el-form-item>
+                    </el-col>
+                    <el-col :span="12">
+                        <el-form-item label="失效时间:" prop="loseDate">
+                            <el-date-picker
+                                v-model="form.loseDate"
+                                type="date"
+                                style="width:100%;"
+                                placeholder="选择日期,不可早于发布时间"
+                                value-format="yyyy-MM-dd HH:mm:ss"
+                            />
+                        </el-form-item>
+                    </el-col>
+                </el-row>
+                <el-form-item label="附件:" prop="fileAttach">
+                    <ibps-attachment-selector v-model="form.fileAttach" accept="*" multiple />
+                </el-form-item>
+                <el-form-item label="内容:" prop="content">
+                    <ibps-ueditor v-model="form.content" />
+                </el-form-item>
+            </el-form>
+        </el-row>
         <ibps-uploader
-          :visible="dialogPictureVisible"
-          :accept="accept"
-          @action-event="uploaderPictureAction"
-          @close="visible => dialogPictureVisible = visible"
+            :visible="dialogFormVisible"
+            @action-event="uploaderAction"
+            @close="visible => dialogFormVisible = visible"
         />
-      </el-col>
-      <el-col :span="15" style="margin-left:25px;">
-        <el-form ref="form" :rules="rules" :model="form" label-width="100px" @submit.native.prevent>
-          <el-form-item label="发布选项:" prop="publicItem">
-            <el-radio-group v-model="form.publicItem">
-              <el-radio label="notices">发布公告</el-radio>
-              <el-radio label="top">置顶工作首页</el-radio>
-            </el-radio-group>
-          </el-form-item>
-          <el-form-item label="公告分类:" prop="type" style="display: none;">
-            <ibps-type-select v-model="form.typeId" category-key="NOTICE_TYPE" clearable />
-          </el-form-item>
-          <el-form-item label="标题:" prop="title">
-            <el-input v-model="form.title" />
-          </el-form-item>
-          <el-form-item label="发布人:" prop="userId">
-            <ibps-employee-selector
-              :value="form.userId"
-              @callback="handleInput"
-            />
-          </el-form-item>
-          <el-row>
-            <el-col :span="12">
-              <el-form-item label="是否公共:" prop="public0" style="display: none;">
-                <el-radio-group v-model="form.public0" @change="change">
-                  <el-radio label="Y">是</el-radio>
-                  <el-radio label="N">否</el-radio>
-                </el-radio-group>
-              </el-form-item>
-            </el-col>
-            <el-col :span="12">
-              <el-form-item v-if="show==='N'" label="是否包含子集" prop="includeChild">
-                <el-radio-group v-model="form.includeChild">
-                  <el-radio label="Y">是</el-radio>
-                  <el-radio label="N">否</el-radio>
-                </el-radio-group>
-              </el-form-item>
-            </el-col>
-          </el-row>
-          <el-form-item v-if="show==='N'" label="发布范围:" prop="depName">
-            <ibps-org-selector
-              :value="form.depId"
-              :multiple="true"
-              @input="depNameInput"
-              @callback="callbackDepName"
-            />
-          </el-form-item>
-          <el-form-item label="作者:" prop="author" style="display: none;">
-            <el-input v-model="form.author" />
-          </el-form-item>
-          <el-form-item label="关键字:" prop="key" style="display: none;">
-            <el-input v-model="form.key" />
-          </el-form-item>
-          <el-form-item label="发布时间:" prop="publicDate">
-            <el-date-picker
-              v-model="form.publicDate"
-              type="date"
-              style="width:100%;"
-              placeholder="选择日期"
-              value-format="yyyy-MM-dd HH:mm:ss"
-            />
-          </el-form-item>
-          <el-form-item label="失效时间:" prop="loseDate">
-            <el-date-picker
-              v-model="form.loseDate"
-              type="date"
-              style="width:100%;"
-              placeholder="选择日期"
-              value-format="yyyy-MM-dd HH:mm:ss"
-            />
-          </el-form-item>
-          <el-form-item label="附件:" prop="fileAttach" style="display: none;">
-            <ibps-attachment-selector
-              v-model="form.fileAttach"
-              accept="*"
-              multiple
-            />
-          </el-form-item>
-          <el-form-item label="内容" prop="content">
-            <ibps-ueditor v-model="form.content" />
-          </el-form-item>
-        </el-form>
-      </el-col>
-    </el-row>
-    <ibps-uploader
-      :visible="dialogFormVisible"
-      @action-event="uploaderAction"
-      @close="visible => dialogFormVisible = visible"
-    />
-    <div slot="footer" class="el-dialog--center">
-      <ibps-toolbar
-        :actions="toolbars"
-        @action-event="handleActionEvent"
-      />
-    </div>
-  </el-dialog>
+        <div slot="footer" class="el-dialog--center">
+            <ibps-toolbar :actions="toolbars" @action-event="handleActionEvent" />
+        </div>
+    </el-dialog>
 </template>
 
 <script>
@@ -146,313 +160,319 @@ import IbpsUeditor from '@/components/ibps-ueditor'
 import IbpsAttachmentSelector from '@/business/platform/file/attachment/selector'
 
 export default {
-  components: {
-    IbpsUeditor,
-    IbpsTypeSelect,
-    IbpsEmployeeSelector,
-    IbpsOrgSelector,
-    IbpsUploader,
-    IbpsAttachmentSelector
-  },
-  props: {
-    visible: {
-      type: Boolean,
-      default: false
-    },
-    readonly: {
-      type: Boolean,
-      default: false
-    },
-    id: String,
-    title: String,
-    status: String
-  },
-  data() {
-    return {
-      limit: 1,
-      accept: '.jpeg,.gif,.png,.jpg', // 规定上传类型
-      formName: 'form',
-      dialogVisible: this.visible,
-      dialogLoading: false,
-      dialogFormVisible: false, // 弹窗
-      dialogPictureVisible: false, // 弹窗
-      typeOptions: typeOptions,
-      defaultForm: {},
-      show: '',
-      formsId: this.id,
-      form: {
-        author: '',
-        content: '',
-        createBy: '',
-        createOrgId: '',
-        createTime: '',
-        dataStatus: '',
-        dbtype: '',
-        depId: '',
-        depName: '',
-        fileAttach: '',
-        id: '',
-        ip: '',
-        public0: 'Y',
-        includeChild: 'Y',
-        key: '',
-        loseDate: '',
-        name: '',
-        picture: '',
-        pk: '',
-        publicDate: '',
-        publicItem: 'notices',
-        status: '',
-        tenantId: '',
-        title: '',
-        type: '',
-        typeId: '',
-        updateBy: '',
-        updateTime: '',
-        userId: this.$store.getters.userId,
-        userName: this.$store.getters.name
-      },
-      rules: {
-        title: [{ required: true, message: this.$t('validate.required') }],
-        userId: [{ required: true, message: this.$t('validate.required') }],
-        publicDate: [{ required: true, message: this.$t('validate.required') }]
-      },
-      toolbars: [
-        { key: 'save',
-          icon: 'ibps-icon-send',
-          label: '发布',
-          type: 'success',
-          hidden: () => {
-            return this.readonly
-          } },
-        { key: 'drafts',
-          icon: 'ibps-icon-save',
-          label: '存为草稿',
-          hidden: () => {
-            return this.readonly
-          } },
-        { key: 'cancel' }
-      ]
-    }
-  },
-  computed: {
-    formId() {
-      return this.id
-    },
-    image() {
-      return getFile(this.form.picture)
-    }
-  },
-  watch: {
-    visible: {
-      handler: function(val, oldVal) {
-        this.dialogVisible = this.visible
-      },
-      immediate: true
-    }
-  },
-  created() {
-    this.defaultForm = JSON.parse(JSON.stringify(this.form))
-    this.form.userId = this.$store.getters.userId
-  },
-  methods: {
-    handleActionEvent({ key }) {
-      switch (key) {
-        case 'save':
-          this.handleSave()
-          break
-        case 'drafts':
-          this.handleDrafts()
-          break
-        case 'cancel':
-          this.closeDialog()
-          break
-        default:
-          break
-      }
-    },
-    // 选择图片附件区
-    /**
-     * 上传
-     */
-    handleUpload() {
-      this.dialogFormVisible = true
+    components: {
+        IbpsUeditor,
+        IbpsTypeSelect,
+        IbpsEmployeeSelector,
+        IbpsOrgSelector,
+        IbpsUploader,
+        IbpsAttachmentSelector
     },
-    uploaderAction(buttonKey, data) {
-      this.dialogFormVisible = false
-      this.form.fileAttach = data.id
+    props: {
+        visible: {
+            type: Boolean,
+            default: false
+        },
+        readonly: {
+            type: Boolean,
+            default: false
+        },
+        id: String,
+        title: String,
+        status: String
     },
-    uploaderPictureAction(buttonKey, data) {
-      this.dialogPictureVisible = false
-      this.form.picture = fileUrl(data.id || data[0].id)
-    },
-    beforeAvatarUpload(file) {
-      return true
-    },
-    handleAvatarSuccess(res, file) {
-      this.form.imageUrl = URL.createObjectURL(file.raw)
-    },
-    // 填写编辑区
-    handleInput(data) {
-      this.form.userId = data.id
-      this.form.userName = data.name
-    },
-    depNameInput(data) {
-      this.form.depId = data
-    },
-    callbackDepName(data) {
-      const arr = []
-      data.forEach(i => {
-        arr.push(i.name)
-      })
-      this.form.depName = arr.join(' ')
-    },
-    change(data) {
-      this.show = data
+    data () {
+        return {
+            limit: 1,
+            accept: '.jpeg,.gif,.png,.jpg', // 规定上传类型
+            formName: 'form',
+            dialogVisible: this.visible,
+            dialogLoading: false,
+            dialogFormVisible: false, // 弹窗
+            dialogPictureVisible: false, // 弹窗
+            typeOptions: typeOptions,
+            defaultForm: {},
+            show: '',
+            formsId: this.id,
+            form: {
+                author: '',
+                content: '',
+                createBy: '',
+                createOrgId: '',
+                createTime: '',
+                dataStatus: '',
+                dbtype: '',
+                depId: '',
+                depName: '',
+                fileAttach: '',
+                id: '',
+                ip: '',
+                public0: 'Y',
+                includeChild: 'N',
+                key: '',
+                loseDate: '',
+                name: '',
+                picture: '',
+                pk: '',
+                publicDate: this.$common.getDateNow(19),
+                publicItem: 'notices',
+                status: '',
+                tenantId: '',
+                title: '',
+                type: '',
+                typeId: '',
+                updateBy: '',
+                updateTime: '',
+                userId: this.$store.getters.userId,
+                userName: this.$store.getters.name
+            },
+            rules: {
+                typeId: [{ required: true, message: this.$t('validate.required') }],
+                title: [{ required: true, message: this.$t('validate.required') }],
+                userId: [{ required: true, message: this.$t('validate.required') }],
+                publicDate: [{ required: true, message: this.$t('validate.required') }],
+                content: [{ required: true, message: this.$t('validate.required') }]
+            },
+            toolbars: [
+                {
+                    key: 'save',
+                    icon: 'ibps-icon-send',
+                    label: '发布',
+                    type: 'success',
+                    hidden: () => {
+                        return this.readonly
+                    }
+                },
+                {
+                    key: 'drafts',
+                    icon: 'ibps-icon-save',
+                    label: '存为草稿',
+                    hidden: () => {
+                        return this.readonly
+                    }
+                },
+                { key: 'cancel' }
+            ]
+        }
     },
-    // 发布
-    handleSave() {
-      this.form.status = 'publish'
-      this.rules = {
-        title: [{ required: true, message: this.$t('validate.required') }],
-        userId: [{ required: true, message: this.$t('validate.required') }],
-        publicDate: [{ required: true, message: this.$t('validate.required') }]
-      }
-      this.$refs[this.formName].validate(valid => {
-        if (valid) {
-          // 置顶公告必须选择图片
-          if (this.image === '' && this.form.publicItem === 'top') {
-            ActionUtils.warning('请选择封面图片')
-          } else {
-            this.saveData()
-          }
-        } else {
-          ActionUtils.saveErrorMessage()
+    computed: {
+        formId () {
+            return this.id
+        },
+        image () {
+            return getFile(this.form.picture)
         }
-      })
     },
-    // 保存草稿
-    handleDrafts() {
-      this.form.status = 'drafts'
-      this.rules = {}
-      this.$refs[this.formName].validate(valid => {
-        if (valid) {
-          this.saveData()
-        } else {
-          ActionUtils.saveErrorMessage()
+    watch: {
+        visible: {
+            handler: function (val, oldVal) {
+                this.dialogVisible = this.visible
+            },
+            immediate: true
         }
-      })
     },
-    // 保存数据
-    saveData() {
-      const data = JSON.parse(JSON.stringify(this.form))
-      data.publicDate = new Date(this.form.publicDate).getTime() || ''
-      data.loseDate = new Date(this.form.loseDate).getTime() || ''
-      // 检测失效日期是否发布日期在之前。
-      if (data.publicDate > data.loseDate && data.loseDate !== '') {
-        ActionUtils.error('发布时间与失效时间范围不合法!')
-        return
-      }
-      save(this.form).then(response => {
-        this.$emit('callback', this)
-        ActionUtils.saveSuccessMessage(response.message, (rtn) => {
-          if (rtn) {
-            this.closeDialog()
-          } else {
-            if (this.form.status === 'drafts') {
-              return
+    created () {
+        this.defaultForm = JSON.parse(JSON.stringify(this.form))
+        this.form.userId = this.$store.getters.userId
+    },
+    methods: {
+        handleActionEvent ({ key }) {
+            switch (key) {
+                case 'save':
+                    this.handleSave()
+                    break
+                case 'drafts':
+                    this.handleDrafts()
+                    break
+                case 'cancel':
+                    this.closeDialog()
+                    break
+                default:
+                    break
+            }
+        },
+        // 选择图片附件区
+        /**
+         * 上传
+         */
+        handleUpload () {
+            this.dialogFormVisible = true
+        },
+        uploaderAction (buttonKey, data) {
+            this.dialogFormVisible = false
+            this.form.fileAttach = data.id
+        },
+        uploaderPictureAction (buttonKey, data) {
+            this.dialogPictureVisible = false
+            this.form.picture = fileUrl(data.id || data[0].id)
+        },
+        beforeAvatarUpload (file) {
+            return true
+        },
+        handleAvatarSuccess (res, file) {
+            this.form.imageUrl = URL.createObjectURL(file.raw)
+        },
+        // 填写编辑区
+        handleInput (data) {
+            this.form.userId = data.id
+            this.form.userName = data.name
+        },
+        depNameInput (data) {
+            this.form.depId = data
+        },
+        callbackDepName (data) {
+            const arr = []
+            data.forEach(i => {
+                arr.push(i.name)
+            })
+            this.form.depName = arr.join(' ')
+        },
+        change (data) {
+            this.show = data
+        },
+        // 发布
+        handleSave () {
+            this.form.status = 'publish'
+            this.$refs[this.formName].validate(valid => {
+                if (valid) {
+                    // 置顶公告必须选择图片
+                    if (this.image === '' && this.form.publicItem === 'top') {
+                        ActionUtils.warning('请选择封面图片')
+                    } else {
+                        this.saveData()
+                    }
+                } else {
+                    ActionUtils.saveErrorMessage()
+                }
+            })
+        },
+        // 保存草稿
+        handleDrafts () {
+            this.form.status = 'drafts'
+            this.$refs[this.formName].validate(valid => {
+                if (valid) {
+                    this.saveData()
+                } else {
+                    ActionUtils.saveErrorMessage()
+                }
+            })
+        },
+        // 保存数据
+        saveData () {
+            const data = JSON.parse(JSON.stringify(this.form))
+            data.publicDate = new Date(this.form.publicDate).getTime() || ''
+            data.loseDate = new Date(this.form.loseDate).getTime() || ''
+            // 检测失效日期是否发布日期在之前。
+            if (data.publicDate > data.loseDate && data.loseDate !== '') {
+                ActionUtils.error('发布时间与失效时间范围不合法!')
+                return
             }
-            this.form.depId = ''
-            this.form.picture = ''
+            save(this.form).then(response => {
+                this.$emit('callback', this)
+                ActionUtils.saveSuccessMessage(response.message, (rtn) => {
+                    if (rtn) {
+                        this.closeDialog()
+                    } else {
+                        if (this.form.status === 'drafts') {
+                            return
+                        }
+                        this.form.depId = ''
+                        this.form.picture = ''
+                        this.$refs[this.formName].resetFields()
+                    }
+                })
+            }).catch((err) => {
+                console.error(err)
+            })
+        },
+        // 关闭当前窗口
+        closeDialog () {
+            this.$emit('close', false)
+            this.show = ''
             this.$refs[this.formName].resetFields()
-          }
-        })
-      }).catch((err) => {
-        console.error(err)
-      })
-    },
-    // 关闭当前窗口
-    closeDialog() {
-      this.$emit('close', false)
-      this.show = ''
-      this.$refs[this.formName].resetFields()
-    },
-    /**
-     * 表单验证
-     */
-    formValidate() {
-      if (this.readonly) return
-      this.$nextTick(() => {
-        this.$refs[this.formName].validate(() => {})
-      })
-    },
-    /**
-     * 获取表单数据
-     */
-    getform() {
-      this.form.userName = this.$store.getters.name
-      if (this.$utils.isEmpty(this.formId)) {
-        // 重置表单
-        const firstDate = new Date()
-        this.form.publicDate = firstDate.setDate(1)
-        this.form = JSON.parse(JSON.stringify(this.defaultForm))
-        this.formValidate()
-        return
-      }
-      this.dialogLoading = true
-      get({
-        newsId: this.formId
-      }).then(response => {
-        this.form = response.data
-        this.show = this.form.public0
-        this.formValidate()
-        this.dialogLoading = false
-      }).catch(() => {
-        this.dialogLoading = false
-      })
+        },
+        /**
+         * 表单验证
+         */
+        formValidate () {
+            if (this.readonly) return
+            this.$nextTick(() => {
+                this.$refs[this.formName].validate(() => { })
+            })
+        },
+        /**
+         * 获取表单数据
+         */
+        getform () {
+            this.form.userName = this.$store.getters.name
+            if (this.$utils.isEmpty(this.formId)) {
+                // 重置表单
+                const firstDate = new Date()
+                this.form.publicDate = firstDate.setDate(1)
+                this.form = JSON.parse(JSON.stringify(this.defaultForm))
+                this.formValidate()
+                return
+            }
+            this.dialogLoading = true
+            get({
+                newsId: this.formId
+            }).then(response => {
+                this.form = response.data
+                this.show = this.form.public0
+                this.formValidate()
+                this.dialogLoading = false
+            }).catch(() => {
+                this.dialogLoading = false
+            })
+        }
     }
-  }
 
 }
 </script>
 <style lang="scss">
-  .photo-area{
-    display:block;
+.photo-area {
+    display: block;
     position: relative;
     width: 178px;
     height: 178px;
-      z-index:9997;
+    z-index: 9997;
+
     .avatar {
-      display: block;
-      width: 178px;
-      height: 178px;
+        display: block;
+        width: 178px;
+        height: 178px;
     }
-    .handle-photo-buttons{
-      width:100%;
-      height:100%;
-      position: absolute;
-      top:0;
-      background: rgba(7, 0, 0, 0.6);
-      display:none;
-      z-index:9998;
-      >div{
-        margin:44% 0 0 30%;
-        i{
-          z-index:9999;
-          cursor: pointer;
-          margin:0 7px;
-          color:white;
-          font-size:18px;
+
+    .handle-photo-buttons {
+        width: 100%;
+        height: 100%;
+        position: absolute;
+        top: 0;
+        background: rgba(7, 0, 0, 0.6);
+        // display: none;
+        z-index: 9998;
+
+        >div {
+            margin: 44% 0 0 30%;
+
+            i {
+                z-index: 9999;
+                cursor: pointer;
+                margin: 0 7px;
+                color: white;
+                font-size: 18px;
+            }
         }
-      }
     }
-  }
-  .photo-area:hover>.handle-photo-buttons{
-      display: block;
-  }
-  .avatar {
+}
+
+.photo-area:hover>.handle-photo-buttons {
+    display: block;
+}
+
+.avatar {
     width: 178px;
     height: 178px;
     display: block;
-  }
+}
 </style>

+ 229 - 230
src/views/platform/system/news/list.vue

@@ -1,40 +1,40 @@
 <template>
-  <div class="main-container">
-    <ibps-crud
-      ref="crud"
-      :height="height"
-      :data="listData"
-      :toolbars="listConfig.toolbars"
-      :search-form="listConfig.searchForm"
-      :pk-key="pkKey"
-      :columns="listConfig.columns"
-      :row-handle="listConfig.rowHandle"
-      :pagination="pagination"
-      :loading="loading"
-      @action-event="handleAction"
-      @sort-change="handleSortChange"
-      @pagination-change="handlePaginationChange"
-    />
-    <!-- 编辑 -->
-    <edit
-      :id="editId"
-      :title="title"
-      :status="status"
-      :visible="dialogFormVisible"
-      :readonly="readonly"
-      @callback="search"
-      @close="visible => dialogFormVisible = visible"
-    />
-    <!-- 明细 -->
-    <detail
-      :id="editId"
-      :title="title"
-      :visible="dialogdetailVisible"
-      :readonly="readonly"
-      @callback="search"
-      @close="visible => dialogdetailVisible = visible"
-    />
-  </div>
+    <div class="main-container">
+        <ibps-crud
+            ref="crud"
+            :height="height"
+            :data="listData"
+            :toolbars="listConfig.toolbars"
+            :search-form="listConfig.searchForm"
+            :pk-key="pkKey"
+            :columns="listConfig.columns"
+            :row-handle="listConfig.rowHandle"
+            :pagination="pagination"
+            :loading="loading"
+            @action-event="handleAction"
+            @sort-change="handleSortChange"
+            @pagination-change="handlePaginationChange"
+        />
+        <!-- 编辑 -->
+        <edit
+            :id="editId"
+            :title="title"
+            :status="status"
+            :visible="dialogFormVisible"
+            :readonly="false"
+            @callback="search"
+            @close="visible => dialogFormVisible = visible"
+        />
+        <!-- 明细 -->
+        <detail
+            :id="editId"
+            :title="title"
+            :visible="dialogdetailVisible"
+            :readonly="true"
+            @callback="search"
+            @close="visible => dialogdetailVisible = visible"
+        />
+    </div>
 </template>
 
 <script>
@@ -46,206 +46,205 @@ import Edit from './edit'
 import Detail from './detail'
 
 export default {
-  components: {
-    Edit,
-    Detail
-  },
-  mixins: [FixHeight],
-  data() {
-    return {
-      dialogFormVisible: false, // 弹窗
-      dialogdetailVisible: false,
-      editId: '', // 编辑dialog需要使用
-      readonly: false, // 是否只读
-      pkKey: 'id', // 主键  如果主键不是pk需要传主键
-      status: '',
-      title: '',
-      loading: true,
-      height: document.clientHeight,
-
-      listData: [],
-      pagination: {},
-      sorts: {},
-      listConfig: {
-        toolbars: [
-          {
-            key: 'search'
-          },
-          {
-            key: 'add'
-          },
-          {
-            key: 'remove'
-          }
-        ],
-        searchForm: {
-          forms: [
-            { prop: 'Q^TITLE_^SL', label: '标题' },
-            { prop: 'Q^USER_NAME_^SL', label: '发布人' },
-            { prop: ['Q^PUBLIC_DATE_^DL', 'Q^PUBLIC_DATE_^DG'], label: '发布时间', fieldType: 'daterange' }
-          ]
-        },
-        // 表格字段配置
-        columns: [
-          { prop: 'title', label: '标题' },
-          { prop: 'publicItem', label: '发布选项', tags: publicItemOptions },
-          { prop: 'userName', label: '发布人' },
-          { prop: 'publicDate', label: '发布时间', dateFormat: 'yyyy-MM-dd' },
-          { prop: 'loseDate', label: '失效时间', dateFormat: 'yyyy-MM-dd' },
-          { prop: 'public0', label: '是否公共', tags: isPublicOptions },
-          { prop: 'status', label: '发布状态', tags: typeOptions },
-          { prop: 'depName', label: '发布范围' }
-        ],
-        rowHandle: {
-          actions: [{
-            key: 'edit',
-            hidden: (row, index) => {
-              return row.status === 'publish' || row.status === 'expired'
-            }
-          }, {
-            key: 'remove',
-            hidden: (row, index) => {
-              return row.status === 'publish' || row.status === 'expired'
+    components: {
+        Edit,
+        Detail
+    },
+    mixins: [FixHeight],
+    data () {
+        return {
+            dialogFormVisible: false, // 弹窗
+            dialogdetailVisible: false,
+            editId: '', // 编辑dialog需要使用
+            readonly: false, // 是否只读
+            pkKey: 'id', // 主键  如果主键不是pk需要传主键
+            status: '',
+            title: '',
+            loading: true,
+            height: document.clientHeight,
+            listData: [],
+            pagination: {},
+            sorts: {},
+            listConfig: {
+                toolbars: [
+                    {
+                        key: 'search'
+                    },
+                    {
+                        key: 'add'
+                    },
+                    {
+                        key: 'remove'
+                    }
+                ],
+                searchForm: {
+                    forms: [
+                        { prop: 'Q^TITLE_^SL', label: '标题' },
+                        { prop: 'Q^USER_NAME_^SL', label: '发布人' },
+                        { prop: ['Q^PUBLIC_DATE_^DL', 'Q^PUBLIC_DATE_^DG'], label: '发布时间', fieldType: 'daterange' }
+                    ]
+                },
+                // 表格字段配置
+                columns: [
+                    { prop: 'title', label: '标题', minWidth: 250 },
+                    // { prop: 'publicItem', label: '发布选项', tags: publicItemOptions },
+                    { prop: 'userName', label: '发布人', width: 120 },
+                    { prop: 'publicDate', label: '发布时间', dateFormat: 'yyyy-MM-dd', width: 120 },
+                    { prop: 'loseDate', label: '失效时间', dateFormat: 'yyyy-MM-dd', width: 120 },
+                    // { prop: 'public0', label: '是否公共', tags: isPublicOptions },
+                    { prop: 'status', label: '发布状态', tags: typeOptions, width: 100 },
+                    // { prop: 'depName', label: '发布范围' }
+                ],
+                rowHandle: {
+                    actions: [{
+                        key: 'edit',
+                        hidden: (row, index) => {
+                            return row.status === 'publish' || row.status === 'expired'
+                        }
+                    }, {
+                        key: 'remove',
+                        hidden: (row, index) => {
+                            return row.status === 'publish' || row.status === 'expired'
+                        }
+                    }, {
+                        key: 'detail'
+                    }]
+                }
             }
-          }, {
-            key: 'detail'
-          }]
         }
-      }
-    }
-  },
-  created() {
-    this.loadData()
-  },
-  methods: {
-    // 加载数据
-    loadData() {
-      this.loading = true
-      queryPageList(this.getSearcFormData()).then(response => {
-        ActionUtils.handleListData(this, response.data)
-        this.loading = false
-      }).catch(() => {
-        this.loading = false
-      })
-    },
-    /**
-     * 获取格式化参数
-     */
-    getSearcFormData() {
-      return ActionUtils.formatParams(
-        this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {},
-        this.pagination,
-        this.sorts)
-    },
-    /**
-     * 处理分页事件
-     */
-    handlePaginationChange(page) {
-      ActionUtils.setPagination(this.pagination, page)
-      this.loadData()
     },
-    /**
-     * 处理排序
-     */
-    handleSortChange(sort) {
-      ActionUtils.setSorts(this.sorts, sort)
-      this.loadData()
+    created () {
+        this.loadData()
     },
-    /**
-     * 查询
-     */
-    search() {
-      this.loadData()
-    },
-    /**
-     * 处理按钮事件
-     */
-    handleAction(command, position, selection, data) {
-      switch (command) {
-        case 'search':// 查询
-          ActionUtils.setFirstPagination(this.pagination)
-          this.search()
-          break
-        case 'add':// 添加
-          this.handleEdit()
-          this.title = '添加公告'
-          break
-        case 'edit':// 编辑
-          ActionUtils.selectedRecord(selection).then((id) => {
-            this.handleEdit(id)
-            this.title = '编辑'
-            this.status = data.status
-          }).catch(() => { })
-          break
-        case 'detail':// 明细
-          ActionUtils.selectedRecord(selection).then((id) => {
-            this.handleDetail(id, true)
-            this.title = '公告明细'
-          }).catch(() => { })
-          break
-        case 'remove':// 删除
-          ActionUtils.removeRecord(selection).then((ids) => {
-            this.handleRemove(ids)
-          }).catch(() => { })
-          break
-        default:
-          break
-      }
-    },
-    /**
-     * 处理编辑
-     */
-    handleEdit(id = '', readonly = false) {
-      this.editId = id
-      this.readonly = readonly
-      this.dialogFormVisible = true
-    },
-    /**
-     * 处理明细
-     */
-    handleDetail(id = '', readonly = false) {
-      this.editId = id
-      this.readonly = readonly
-      this.dialogdetailVisible = true
-    },
-    /**
-     * 处理删除
-     */
-    handleRemove(ids) {
-      // 获取数据
-      remove({ newsIds: ids }).then(response => {
-        ActionUtils.removeSuccessMessage()
-        this.search()
-      }).catch(() => {})
-    },
-    /**
-     * 处理展示发布组织
-     */
-    handleDepName(value) {
-      // 获取数据
-      let className
-      const arr = value.split(',')
-      if (this.$utils.isEmpty(arr)) {
-        className = null
-      } else if (arr.length > 2) {
-        className = 'table-row-depNames'
-      }
-      return className
+    methods: {
+    // 加载数据
+        loadData () {
+            this.loading = true
+            queryPageList(this.getSearcFormData()).then(response => {
+                ActionUtils.handleListData(this, response.data)
+                this.loading = false
+            }).catch(() => {
+                this.loading = false
+            })
+        },
+        /**
+         * 获取格式化参数
+         */
+        getSearcFormData () {
+            return ActionUtils.formatParams(
+                this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {},
+                this.pagination,
+                this.sorts)
+        },
+        /**
+         * 处理分页事件
+         */
+        handlePaginationChange (page) {
+            ActionUtils.setPagination(this.pagination, page)
+            this.loadData()
+        },
+        /**
+         * 处理排序
+         */
+        handleSortChange (sort) {
+            ActionUtils.setSorts(this.sorts, sort)
+            this.loadData()
+        },
+        /**
+         * 查询
+         */
+        search () {
+            this.loadData()
+        },
+        /**
+         * 处理按钮事件
+         */
+        handleAction (command, position, selection, data) {
+            switch (command) {
+                case 'search':// 查询
+                    ActionUtils.setFirstPagination(this.pagination)
+                    this.search()
+                    break
+                case 'add':// 添加
+                    this.handleEdit()
+                    this.title = '添加公告'
+                    break
+                case 'edit':// 编辑
+                    ActionUtils.selectedRecord(selection).then((id) => {
+                        this.handleEdit(id)
+                        this.title = '编辑'
+                        this.status = data.status
+                    }).catch(() => { })
+                    break
+                case 'detail':// 明细
+                    ActionUtils.selectedRecord(selection).then((id) => {
+                        this.handleDetail(id, true)
+                        this.title = '公告明细'
+                    }).catch(() => { })
+                    break
+                case 'remove':// 删除
+                    ActionUtils.removeRecord(selection).then((ids) => {
+                        this.handleRemove(ids)
+                    }).catch(() => { })
+                    break
+                default:
+                    break
+            }
+        },
+        /**
+         * 处理编辑
+         */
+        handleEdit (id = '', readonly = false) {
+            this.editId = id
+            this.readonly = readonly
+            this.dialogFormVisible = true
+        },
+        /**
+         * 处理明细
+         */
+        handleDetail (id = '', readonly = false) {
+            this.editId = id
+            this.readonly = readonly
+            this.dialogdetailVisible = true
+        },
+        /**
+         * 处理删除
+         */
+        handleRemove (ids) {
+            // 获取数据
+            remove({ newsIds: ids }).then(response => {
+                ActionUtils.removeSuccessMessage()
+                this.search()
+            }).catch(() => {})
+        },
+        /**
+         * 处理展示发布组织
+         */
+        handleDepName (value) {
+            // 获取数据
+            let className
+            const arr = value.split(',')
+            if (this.$utils.isEmpty(arr)) {
+                className = null
+            } else if (arr.length > 2) {
+                className = 'table-row-depNames'
+            }
+            return className
+        }
     }
-  }
 }
 </script>
 <style lang="scss">
-.table-row-depName{
-  input{
-    display:none;
-  }
-}
-.table-row-depNames{
-  .el-selector__tags{
-    position: relative !important;
-    -webkit-transform: translateY(10%) !important;
-    transform: translateY(10%) !important;
-  }
-}
+    .table-row-depName{
+        input{
+            display:none;
+        }
+    }
+    .table-row-depNames{
+        .el-selector__tags{
+            position: relative !important;
+            -webkit-transform: translateY(10%) !important;
+            transform: translateY(10%) !important;
+        }
+    }
 </style>