Sfoglia il codice sorgente

增加网站管理

hfxc226 2 anni fa
parent
commit
d64ec58959

+ 66 - 0
src/api/qykh/hotspot.js

@@ -0,0 +1,66 @@
+import { axios } from '@/utils/request'
+import { stringify } from 'qs'
+
+/**
+ * page func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function getHotspotPage (parameter) {
+  return axios({
+    url: '/qykh/hotspots/page?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
+/**
+ * add func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function addHotspot (parameter) {
+  return axios({
+    url: '/qykh/hotspots',
+    method: 'POST',
+    headers: {
+      'Accept': 'application/json',
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    data: parameter
+  })
+}
+
+/**
+ * update func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function updateHotspot (parameter) {
+  return axios({
+    url: '/qykh/hotspots/' + parameter.id,
+    method: 'PUT',
+    data: parameter
+  })
+}
+
+/**
+ * fetch single func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function fetchHotspot (parameter) {
+  return axios({
+    url: '/qykh/hotspots/' + parameter.id,
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}

+ 66 - 0
src/api/qykh/information.js

@@ -0,0 +1,66 @@
+import { axios } from '@/utils/request'
+import { stringify } from 'qs'
+
+/**
+ * page func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function getInformationPage (parameter) {
+  return axios({
+    url: '/qykh/informations/page?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
+/**
+ * add func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function addInformation (parameter) {
+  return axios({
+    url: '/qykh/informations',
+    method: 'POST',
+    headers: {
+      'Accept': 'application/json',
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    data: parameter
+  })
+}
+
+/**
+ * update func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function updateInformation (parameter) {
+  return axios({
+    url: '/qykh/informations/' + parameter.id,
+    method: 'PUT',
+    data: parameter
+  })
+}
+
+/**
+ * fetch single func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function fetchInformation (parameter) {
+  return axios({
+    url: '/qykh/informations/' + parameter.id,
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}

+ 66 - 0
src/api/qykh/informationhelp.js

@@ -0,0 +1,66 @@
+import { axios } from '@/utils/request'
+import { stringify } from 'qs'
+
+/**
+ * page func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function getInformationHelpPage (parameter) {
+  return axios({
+    url: '/qykh/information/helps/page?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
+/**
+ * add func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function addInformationHelp (parameter) {
+  return axios({
+    url: '/qykh/information/helps',
+    method: 'POST',
+    headers: {
+      'Accept': 'application/json',
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    data: parameter
+  })
+}
+
+/**
+ * update func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function updateInformationHelp (parameter) {
+  return axios({
+    url: '/qykh/information/helps/' + parameter.id,
+    method: 'PUT',
+    data: parameter
+  })
+}
+
+/**
+ * fetch single func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function fetchInformationHelp (parameter) {
+  return axios({
+    url: '/qykh/information/helps/' + parameter.id,
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}

+ 2 - 1
src/components/Editor/WangEditor.vue

@@ -66,7 +66,8 @@ export default {
       'table', // 表格
       'code', // 插入代码
       'undo', // 撤销
-      'redo' // 重复
+      'redo', // 重复
+      'fullscreen' // 全屏
     ]
     this.editor.customConfig.onblur = function (html) {
       // html 即编辑器中的内容

+ 4 - 1
src/router/generator-platform-routers.js

@@ -344,7 +344,10 @@ const constantRouterComponents = {
   'PlanDetail': () => import('@/views/qykh/plan-detail/PlanDetail'),
   'Product': () => import('@/views/qykh/product/Product'),
   'ProductHelp': () => import('@/views/qykh/product-help/ProductHelp'),
-  'HotspotHelp': () => import('@/views/qykh/hotspot-help/HotspotHelp')
+  'Hotspot': () => import('@/views/qykh/hotspot/Hotspot'),
+  'HotspotHelp': () => import('@/views/qykh/hotspot-help/HotspotHelp'),
+  'Information': () => import('@/views/qykh/information/Information'),
+  'InformationHelp': () => import('@/views/qykh/information-help/InformationHelp')
 }
 
 // 前端未找到页面路由(固定不用改)

+ 195 - 0
src/views/qykh/hotspot/Hotspot.vue

@@ -0,0 +1,195 @@
+<template>
+  <a-card :bordered="false">
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline">
+        <a-row :gutter="48">
+          <a-col :md="8" :sm="24">
+            <a-form-item label="关键字">
+              <a-input v-model.trim="queryParam.title" placeholder="请输入名称"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="8 || 24" :sm="24">
+            <span class="table-page-search-submitButtons">
+              <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
+            </span>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+
+    <div class="table-operator" style="margin-bottom: 8px;">
+      <a-button v-if="$auth('operate-articles-add')" type="primary" icon="plus" @click="$refs.baseModal.base()">新增</a-button>
+    </div>
+
+    <s-table
+      ref="table"
+      size="default"
+      rowKey="id"
+      :columns="columns"
+      :data="loadData"
+      :alert="options.alert"
+      :rowSelection="options.rowSelection"
+      showPagination="auto"
+    >
+      <span slot="action" slot-scope="record">
+        <template>
+          <a @click="handleView(record)">查看</a>
+          <a-divider type="vertical" />
+          <a @click="handleEdit(record)">修改</a>
+        </template>
+      </span>
+    </s-table>
+    <base-form ref="baseModal" @ok="handleOk"/>
+    <detail ref="detailModal" />
+  </a-card>
+</template>
+
+<script>
+import { STable, Ellipsis } from '@/components'
+import BaseForm from './modules/BaseForm'
+import Detail from './modules/Detail'
+import {
+  getHotspotPage,
+  fetchHotspot
+} from '@/api/qykh/hotspot'
+
+export default {
+  name: 'PlanDetailList',
+  components: {
+    STable,
+    Ellipsis,
+    BaseForm,
+    Detail
+  },
+  data () {
+    return {
+      // 查询参数
+      queryParam: {
+      },
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          customRender: (text, record, index) => {
+            return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
+          }
+        },
+        {
+          title: '标题',
+          dataIndex: 'hname'
+        },
+        {
+          title: 'desrc',
+          dataIndex: 'desrc'
+        },
+        /* {
+          title: '摘要',
+          dataIndex: 'shortdesc'
+        },
+        {
+          title: 'purl',
+          dataIndex: 'purl'
+        },
+        {
+          title: 'bannerurl',
+          dataIndex: 'bannerurl'
+        }, */
+        {
+          title: '关键字',
+          dataIndex: 'keywords'
+        },
+        {
+          title: '排序',
+          dataIndex: 'ord'
+        },
+        {
+          title: '操作',
+          key: 'action',
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        parameter = {
+          ...parameter,
+          keyword: this.queryParam.keyword,
+          dataScope: {
+            sortBy: 'desc',
+            sortName: 'update_time'
+          }
+        }
+        return getHotspotPage(Object.assign(parameter, this.queryParam))
+          .then(res => {
+            return res.data
+          })
+      },
+      selectedRowKeys: [],
+      selectedRows: [],
+
+      options: {
+        alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+        rowSelection: {
+          selectedRowKeys: this.selectedRowKeys,
+          onChange: this.onSelectChange
+        }
+      },
+      optionAlertShow: false
+    }
+  },
+  created () {
+  },
+  methods: {
+    tableOption () {
+      if (!this.optionAlertShow) {
+        this.options = {
+          alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+          rowSelection: {
+            selectedRowKeys: this.selectedRowKeys,
+            onChange: this.onSelectChange,
+            getCheckboxProps: record => ({
+              props: {
+                disabled: false,
+                name: record.id + ''
+              }
+            })
+          }
+        }
+        this.optionAlertShow = true
+      } else {
+        this.options = {
+          alert: false,
+          rowSelection: null
+        }
+        this.optionAlertShow = false
+      }
+    },
+    handleEdit (record) {
+      fetchHotspot({ id: record.id }).then(res => {
+        const modal = this.$refs.baseModal
+        modal.base(res.data)
+      })
+    },
+    handleView (record) {
+      fetchHotspot({ id: record.id }).then(res => {
+        const modal = this.$refs.detailModal
+        modal.base(res.data)
+      })
+    },
+    handleOk () {
+      this.$refs.table.refresh()
+    },
+    onSelectChange (selectedRowKeys, selectedRows) {
+      this.selectedRowKeys = selectedRowKeys
+      this.selectedRows = selectedRows
+    },
+    resetSearchForm () {
+      this.queryParam = {
+      }
+      this.$refs.table.refresh(true)
+    }
+  }
+}
+</script>

+ 158 - 0
src/views/qykh/hotspot/modules/BaseForm.vue

@@ -0,0 +1,158 @@
+<template>
+  <a-modal
+    :title="modalTitle"
+    :width="1400"
+    :visible="visible"
+    class="ant-modal2"
+    :confirmLoading="confirmLoading"
+    @cancel="handleCancel"
+  >
+    <a-form :form="form">
+
+      <a-form-item v-show="false" >
+        <a-input v-decorator="['id']" type="hidden"/>
+      </a-form-item>
+      <a-form-item
+        label="标题"
+        :labelCol="labelCol"
+        :wrapperCol="wrapperCol"
+      >
+        <a-input
+          v-decorator="['hname', {rules: [{required: true, message: '标题不能为空'}]}]" />
+      </a-form-item>
+      <a-form-item
+        label="摘要"
+        :labelCol="labelCol"
+        :wrapperCol="wrapperCol"
+      >
+        <a-input
+          v-decorator="['shortdesc']" />
+      </a-form-item>
+      <a-form-item
+        label="内容"
+        :labelCol="labelCol"
+        :wrapperCol="wrapperCol"
+      >
+        <wang-editor
+          :content="desrc"
+          @catchData="catchData"
+        ></wang-editor>
+      </a-form-item>
+    </a-form>
+    <template slot="footer">
+      <a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
+    </template>
+  </a-modal>
+</template>
+
+<script>
+import pick from 'lodash.pick'
+import { addHotspot, updateHotspot } from '@/api/qykh/hotspot'
+import WangEditor from '@/components/Editor/WangEditor'
+import UploadImg from '@/components/Upload/UploadImg'
+import UploadArticleFile from '@/components/Upload/UploadArticleFile'
+export default {
+  name: 'BaseArticle',
+  components: {
+    WangEditor,
+    UploadImg,
+    UploadArticleFile
+  },
+  data () {
+    return {
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 4 }
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 20 }
+      },
+      topFlag: 0,
+      status: 1,
+      confirmLoading: false,
+      mdl: {},
+      modalTitle: null,
+      form: this.$form.createForm(this),
+      visible: false,
+      desrc: '',
+      resultContent: '',
+      type: null
+    }
+  },
+  props: {
+  },
+  created () {
+  },
+  methods: {
+    base (record) {
+      this.visible = true
+      // 如果是空标识添加
+      if (this.BaseTool.Object.isBlank(record)) {
+        this.modalTitle = '添加'
+        this.desrc = ''
+        return
+      }
+      this.modalTitle = '编辑'
+      this.type = record.type
+      const { form: { setFieldsValue } } = this
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign(pick(record, [
+          'id',
+          'hname',
+          'shortdesc'
+        ])))
+        this.desrc = record.desrc
+      })
+    },
+    catchData (content) {
+      this.resultContent = content
+    },
+    save () {
+      const { form: { validateFieldsAndScroll } } = this
+      this.confirmLoading = true
+      validateFieldsAndScroll((errors, values) => {
+        if (errors) {
+          this.confirmLoading = false
+          return
+        }
+        values = {
+          ...values,
+          desrc: this.resultContent ? this.resultContent : this.desrc
+        }
+        /* if (this.type === 2) {
+          if (values.parentId == null) {
+            this.$message.error('请选择父文章')
+            return
+          }
+        } */
+        if (this.BaseTool.String.isBlank(values.id)) {
+          addHotspot(values)
+            .then(() => {
+              this.handleCancel(values)
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+        } else {
+          updateHotspot(values)
+            .then(() => {
+              this.handleCancel(values)
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+        }
+      })
+    },
+    handleCancel (values) {
+      this.visible = false
+      this.confirmLoading = false
+      this.desrc = ''
+      this.resultContent = ''
+      this.form.resetFields()
+      if (this.BaseTool.Object.isNotBlank(values)) {
+        this.$emit('ok', values)
+      }
+    }
+  }
+}
+</script>

+ 72 - 0
src/views/qykh/hotspot/modules/Detail.vue

@@ -0,0 +1,72 @@
+<template>
+  <a-modal
+    :title="modalTitle"
+    :width="1200"
+    :visible="visible"
+    class="ant-modal2"
+    :confirmLoading="confirmLoading"
+    @cancel="handleCancel"
+  >
+    <detail-list title="" :col="1">
+      <detail-list-item term="标题">{{ model.hname }}</detail-list-item>
+      <detail-list-item term="简介">{{ model.shortdesc }}</detail-list-item>
+      <detail-list-item term="简介" v-html="model.descr"></detail-list-item>
+    </detail-list>
+
+    <template slot="footer">
+      <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">返回</a-button>
+    </template>
+  </a-modal>
+</template>
+
+<script>
+import DetailList from '@/components/tools/DetailList'
+const DetailListItem = DetailList.Item
+
+export default {
+  name: 'ArticleDetail',
+  components: {
+    DetailList,
+    DetailListItem
+  },
+  data () {
+    return {
+      confirmLoading: false,
+      mdl: {},
+      modalTitle: null,
+      visible: false,
+      model: {
+        'id': null,
+        'desrc': null,
+        'hname': null,
+        'shortdesc': null
+      }
+    }
+  },
+  props: {
+    typeMap: {
+      type: Object,
+      default: () => ({})
+    }
+  },
+  methods: {
+    base (record) {
+      this.visible = true
+      this.modalTitle = '详情'
+      this.model = record
+    },
+    handleCancel () {
+      this.visible = false
+      this.confirmLoading = false
+    },
+    downTemplate (picture) {
+      const a = document.createElement('a')
+      console.log('picture: ' + picture)
+      a.href = picture
+      a.target = '_blank'
+      a.click()
+    }
+
+  }
+}
+</script>

+ 191 - 0
src/views/qykh/information-help/InformationHelp.vue

@@ -0,0 +1,191 @@
+<template>
+  <a-card :bordered="false">
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline">
+        <a-row :gutter="48">
+          <a-col :md="8" :sm="24">
+            <a-form-item label="关键字">
+              <a-input v-model.trim="queryParam.title" placeholder="请输入名称/类型名称"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="8 || 24" :sm="24">
+            <span class="table-page-search-submitButtons">
+              <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
+            </span>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+
+    <div class="table-operator" style="margin-bottom: 8px;">
+      <a-button v-if="$auth('operate-articles-add')" type="primary" icon="plus" @click="$refs.baseModal.base()">新增</a-button>
+    </div>
+
+    <s-table
+      ref="table"
+      size="default"
+      rowKey="id"
+      :columns="columns"
+      :data="loadData"
+      :alert="options.alert"
+      :rowSelection="options.rowSelection"
+      showPagination="auto"
+    >
+      <span slot="action" slot-scope="record">
+        <template>
+          <a @click="handleView(record)">查看</a>
+          <a-divider type="vertical" />
+          <a @click="handleEdit(record)">修改</a>
+        </template>
+      </span>
+    </s-table>
+    <base-form ref="baseModal" @ok="handleOk"/>
+    <detail ref="detailModal" />
+  </a-card>
+</template>
+
+<script>
+import { STable, Ellipsis } from '@/components'
+import BaseForm from './modules/BaseForm'
+import Detail from './modules/Detail'
+import {
+  getInformationHelpPage,
+  fetchInformationHelp
+} from '@/api/qykh/informationhelp'
+
+export default {
+  name: 'PlanDetailList',
+  components: {
+    STable,
+    Ellipsis,
+    BaseForm,
+    Detail
+  },
+  data () {
+    return {
+      // 查询参数
+      queryParam: {
+      },
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          customRender: (text, record, index) => {
+            return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
+          }
+        },
+        {
+          title: '标题',
+          dataIndex: 'title'
+        },
+        /*   {
+          title: '摘要',
+          dataIndex: 'shortdesc'
+        }, */
+        {
+          title: 'pid',
+          dataIndex: 'pid'
+        },
+        {
+          title: '关键字',
+          dataIndex: 'keywords'
+        },
+        {
+          title: '排序',
+          dataIndex: 'ord'
+        },
+        {
+          title: '时间',
+          dataIndex: 'time'
+        },
+        {
+          title: '操作',
+          key: 'action',
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        parameter = {
+          ...parameter,
+          keyword: this.queryParam.keyword,
+          dataScope: {
+            sortBy: 'desc',
+            sortName: 'update_time'
+          }
+        }
+        return getInformationHelpPage(Object.assign(parameter, this.queryParam))
+          .then(res => {
+            return res.data
+          })
+      },
+      selectedRowKeys: [],
+      selectedRows: [],
+
+      options: {
+        alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+        rowSelection: {
+          selectedRowKeys: this.selectedRowKeys,
+          onChange: this.onSelectChange
+        }
+      },
+      optionAlertShow: false
+    }
+  },
+  created () {
+  },
+  methods: {
+    tableOption () {
+      if (!this.optionAlertShow) {
+        this.options = {
+          alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+          rowSelection: {
+            selectedRowKeys: this.selectedRowKeys,
+            onChange: this.onSelectChange,
+            getCheckboxProps: record => ({
+              props: {
+                disabled: false,
+                name: record.id + ''
+              }
+            })
+          }
+        }
+        this.optionAlertShow = true
+      } else {
+        this.options = {
+          alert: false,
+          rowSelection: null
+        }
+        this.optionAlertShow = false
+      }
+    },
+    handleEdit (record) {
+      fetchInformationHelp({ id: record.id }).then(res => {
+        const modal = this.$refs.baseModal
+        modal.base(res.data)
+      })
+    },
+    handleView (record) {
+      fetchInformationHelp({ id: record.id }).then(res => {
+        const modal = this.$refs.detailModal
+        modal.base(res.data)
+      })
+    },
+    handleOk () {
+      this.$refs.table.refresh()
+    },
+    onSelectChange (selectedRowKeys, selectedRows) {
+      this.selectedRowKeys = selectedRowKeys
+      this.selectedRows = selectedRows
+    },
+    resetSearchForm () {
+      this.queryParam = {
+      }
+      this.$refs.table.refresh(true)
+    }
+  }
+}
+</script>

+ 180 - 0
src/views/qykh/information-help/modules/BaseForm.vue

@@ -0,0 +1,180 @@
+<template>
+  <a-modal
+    :title="modalTitle"
+    :width="1400"
+    :visible="visible"
+    class="ant-modal2"
+    :confirmLoading="confirmLoading"
+    @cancel="handleCancel"
+  >
+    <a-form :form="form">
+
+      <a-form-item v-show="false" >
+        <a-input v-decorator="['id']" type="hidden"/>
+      </a-form-item>
+      <a-form-item
+        label="标题"
+        :labelCol="labelCol"
+        :wrapperCol="wrapperCol"
+      >
+        <a-input
+          v-decorator="['title', {rules: [{required: true, message: '标题不能为空'}]}]" />
+      </a-form-item>
+      <a-form-item
+        label="摘要"
+        :labelCol="labelCol"
+        :wrapperCol="wrapperCol"
+      >
+        <a-input
+          v-decorator="['digest']" />
+      </a-form-item>
+      <a-form-item
+        label="关键字"
+        :labelCol="labelCol"
+        :wrapperCol="wrapperCol"
+      >
+        <a-input
+          v-decorator="['keywords', {rules: [{required: true, message: '排序不能为空'}]}]" />
+      </a-form-item>
+      <a-form-item
+        label="排序"
+        :labelCol="labelCol"
+        :wrapperCol="wrapperCol"
+      >
+        <a-input
+          type="number"
+          v-decorator="['ord', {rules: [{required: true, message: '排序不能为空'}]}]" />
+      </a-form-item>
+      <a-form-item
+        label="内容"
+        :labelCol="labelCol"
+        :wrapperCol="wrapperCol"
+      >
+        <wang-editor
+          :content="descr"
+          @catchData="catchData"
+        ></wang-editor>
+      </a-form-item>
+    </a-form>
+    <template slot="footer">
+      <a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
+    </template>
+  </a-modal>
+</template>
+
+<script>
+import pick from 'lodash.pick'
+import { addInformationHelp, updateInformationHelp } from '@/api/qykh/informationhelp'
+import WangEditor from '@/components/Editor/WangEditor'
+import UploadImg from '@/components/Upload/UploadImg'
+import UploadArticleFile from '@/components/Upload/UploadArticleFile'
+export default {
+  name: 'BaseArticle',
+  components: {
+    WangEditor,
+    UploadImg,
+    UploadArticleFile
+  },
+  data () {
+    return {
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 4 }
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 20 }
+      },
+      topFlag: 0,
+      status: 1,
+      confirmLoading: false,
+      mdl: {},
+      modalTitle: null,
+      form: this.$form.createForm(this),
+      visible: false,
+      descr: '',
+      resultContent: '',
+      type: null
+    }
+  },
+  props: {
+  },
+  created () {
+  },
+  methods: {
+    base (record) {
+      this.visible = true
+      // 如果是空标识添加
+      if (this.BaseTool.Object.isBlank(record)) {
+        this.modalTitle = '添加'
+        this.descr = ''
+        return
+      }
+      this.modalTitle = '编辑'
+      this.type = record.type
+      const { form: { setFieldsValue } } = this
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign(pick(record, [
+          'id',
+          'title',
+          'pid',
+          'shortdesc',
+          'ord',
+          'digest',
+          'time',
+          'keywords'
+        ])))
+        this.descr = record.descr
+      })
+    },
+    catchData (content) {
+      this.resultContent = content
+    },
+    save () {
+      const { form: { validateFieldsAndScroll } } = this
+      this.confirmLoading = true
+      validateFieldsAndScroll((errors, values) => {
+        if (errors) {
+          this.confirmLoading = false
+          return
+        }
+        values = {
+          ...values,
+          descr: this.resultContent ? this.resultContent : this.descr
+        }
+        /* if (this.type === 2) {
+          if (values.parentId == null) {
+            this.$message.error('请选择父文章')
+            return
+          }
+        } */
+        if (this.BaseTool.String.isBlank(values.id)) {
+          addInformationHelp(values)
+            .then(() => {
+              this.handleCancel(values)
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+        } else {
+          updateInformationHelp(values)
+            .then(() => {
+              this.handleCancel(values)
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+        }
+      })
+    },
+    handleCancel (values) {
+      this.visible = false
+      this.confirmLoading = false
+      this.descr = ''
+      this.resultContent = ''
+      this.form.resetFields()
+      if (this.BaseTool.Object.isNotBlank(values)) {
+        this.$emit('ok', values)
+      }
+    }
+  }
+}
+</script>

+ 81 - 0
src/views/qykh/information-help/modules/Detail.vue

@@ -0,0 +1,81 @@
+<template>
+  <a-modal
+    :title="modalTitle"
+    :width="1200"
+    :visible="visible"
+    class="ant-modal2"
+    :confirmLoading="confirmLoading"
+    @cancel="handleCancel"
+  >
+    <detail-list title="" :col="1">
+      <detail-list-item term="标题">{{ model.title }}</detail-list-item>
+      <detail-list-item term="简介">{{ model.shortdesc }}</detail-list-item>
+      <detail-list-item term="pid">{{ model.pid }}</detail-list-item>
+      <detail-list-item term="关键字">{{ model.keywords }}</detail-list-item>
+      <detail-list-item term="排序">{{ model.ord }}</detail-list-item>
+      <detail-list-item term="摘要">{{ model.digest }}</detail-list-item>
+      <detail-list-item term="发布时间">{{ model.time }}</detail-list-item>
+      <detail-list-item term="内容" v-html="model.descr"></detail-list-item>
+    </detail-list>
+
+    <template slot="footer">
+      <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">返回</a-button>
+    </template>
+  </a-modal>
+</template>
+
+<script>
+import DetailList from '@/components/tools/DetailList'
+const DetailListItem = DetailList.Item
+
+export default {
+  name: 'ArticleDetail',
+  components: {
+    DetailList,
+    DetailListItem
+  },
+  data () {
+    return {
+      confirmLoading: false,
+      mdl: {},
+      modalTitle: null,
+      visible: false,
+      model: {
+        'id': null,
+        'shortdesc': null,
+        'title': null,
+        'pid': null,
+        'keywords': null,
+        'ord': null,
+        'digest': null,
+        'time': null
+      }
+    }
+  },
+  props: {
+    typeMap: {
+      type: Object,
+      default: () => ({})
+    }
+  },
+  methods: {
+    base (record) {
+      this.visible = true
+      this.modalTitle = '详情'
+      this.model = record
+    },
+    handleCancel () {
+      this.visible = false
+      this.confirmLoading = false
+    },
+    downTemplate (picture) {
+      const a = document.createElement('a')
+      console.log('picture: ' + picture)
+      a.href = picture
+      a.target = '_blank'
+      a.click()
+    }
+
+  }
+}
+</script>

+ 195 - 0
src/views/qykh/information/Information.vue

@@ -0,0 +1,195 @@
+<template>
+  <a-card :bordered="false">
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline">
+        <a-row :gutter="48">
+          <a-col :md="8" :sm="24">
+            <a-form-item label="关键字">
+              <a-input v-model.trim="queryParam.title" placeholder="请输入名称"/>
+            </a-form-item>
+          </a-col>
+          <a-col :md="8 || 24" :sm="24">
+            <span class="table-page-search-submitButtons">
+              <a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
+              <a-button style="margin-left: 8px" @click="resetSearchForm">重置</a-button>
+            </span>
+          </a-col>
+        </a-row>
+      </a-form>
+    </div>
+
+    <div class="table-operator" style="margin-bottom: 8px;">
+      <a-button v-if="$auth('operate-articles-add')" type="primary" icon="plus" @click="$refs.baseModal.base()">新增</a-button>
+    </div>
+
+    <s-table
+      ref="table"
+      size="default"
+      rowKey="id"
+      :columns="columns"
+      :data="loadData"
+      :alert="options.alert"
+      :rowSelection="options.rowSelection"
+      showPagination="auto"
+    >
+      <span slot="action" slot-scope="record">
+        <template>
+          <a @click="handleView(record)">查看</a>
+          <a-divider type="vertical" />
+          <a @click="handleEdit(record)">修改</a>
+        </template>
+      </span>
+    </s-table>
+    <base-form ref="baseModal" @ok="handleOk"/>
+    <detail ref="detailModal" />
+  </a-card>
+</template>
+
+<script>
+import { STable, Ellipsis } from '@/components'
+import BaseForm from './modules/BaseForm'
+import Detail from './modules/Detail'
+import {
+  getInformationPage,
+  fetchInformation
+} from '@/api/qykh/information'
+
+export default {
+  name: 'PlanDetailList',
+  components: {
+    STable,
+    Ellipsis,
+    BaseForm,
+    Detail
+  },
+  data () {
+    return {
+      // 查询参数
+      queryParam: {
+      },
+      // 表头
+      columns: [
+        {
+          title: '序号',
+          dataIndex: 'index',
+          customRender: (text, record, index) => {
+            return `${(this.$refs.table.localPagination.current - 1) * this.$refs.table.localPagination.pageSize + index + 1}`
+          }
+        },
+        {
+          title: '标题',
+          dataIndex: 'inforname'
+        },
+        {
+          title: '摘要',
+          dataIndex: 'infordes'
+        },
+        {
+          title: 'purl',
+          dataIndex: 'purl'
+        },
+        {
+          title: 'pid',
+          dataIndex: 'pid'
+        },
+        {
+          title: '等级',
+          dataIndex: 'level'
+        },
+        {
+          title: '关键字',
+          dataIndex: 'keywords'
+        },
+        {
+          title: '排序',
+          dataIndex: 'ord'
+        },
+        {
+          title: '操作',
+          key: 'action',
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        parameter = {
+          ...parameter,
+          keyword: this.queryParam.keyword,
+          dataScope: {
+            sortBy: 'asc',
+            sortName: 'ord'
+          }
+        }
+        return getInformationPage(Object.assign(parameter, this.queryParam))
+          .then(res => {
+            return res.data
+          })
+      },
+      selectedRowKeys: [],
+      selectedRows: [],
+
+      options: {
+        alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+        rowSelection: {
+          selectedRowKeys: this.selectedRowKeys,
+          onChange: this.onSelectChange
+        }
+      },
+      optionAlertShow: false
+    }
+  },
+  created () {
+  },
+  methods: {
+    tableOption () {
+      if (!this.optionAlertShow) {
+        this.options = {
+          alert: { show: true, clear: () => { this.selectedRowKeys = [] } },
+          rowSelection: {
+            selectedRowKeys: this.selectedRowKeys,
+            onChange: this.onSelectChange,
+            getCheckboxProps: record => ({
+              props: {
+                disabled: false,
+                name: record.id + ''
+              }
+            })
+          }
+        }
+        this.optionAlertShow = true
+      } else {
+        this.options = {
+          alert: false,
+          rowSelection: null
+        }
+        this.optionAlertShow = false
+      }
+    },
+    handleEdit (record) {
+      fetchInformation({ id: record.id }).then(res => {
+        const modal = this.$refs.baseModal
+        modal.base(res.data)
+      })
+    },
+    handleView (record) {
+      fetchInformation({ id: record.id }).then(res => {
+        const modal = this.$refs.detailModal
+        modal.base(res.data)
+      })
+    },
+    handleOk () {
+      this.$refs.table.refresh()
+    },
+    onSelectChange (selectedRowKeys, selectedRows) {
+      this.selectedRowKeys = selectedRowKeys
+      this.selectedRows = selectedRows
+    },
+    resetSearchForm () {
+      this.queryParam = {
+      }
+      this.$refs.table.refresh(true)
+    }
+  }
+}
+</script>

+ 158 - 0
src/views/qykh/information/modules/BaseForm.vue

@@ -0,0 +1,158 @@
+<template>
+  <a-modal
+    :title="modalTitle"
+    :width="1400"
+    :visible="visible"
+    class="ant-modal2"
+    :confirmLoading="confirmLoading"
+    @cancel="handleCancel"
+  >
+    <a-form :form="form">
+
+      <a-form-item v-show="false" >
+        <a-input v-decorator="['id']" type="hidden"/>
+      </a-form-item>
+      <a-form-item
+        label="标题"
+        :labelCol="labelCol"
+        :wrapperCol="wrapperCol"
+      >
+        <a-input
+          v-decorator="['pname', {rules: [{required: true, message: '标题不能为空'}]}]" />
+      </a-form-item>
+      <a-form-item
+        label="摘要"
+        :labelCol="labelCol"
+        :wrapperCol="wrapperCol"
+      >
+        <a-input
+          v-decorator="['shortdesc']" />
+      </a-form-item>
+      <a-form-item
+        label="内容"
+        :labelCol="labelCol"
+        :wrapperCol="wrapperCol"
+      >
+        <wang-editor
+          :content="infordes"
+          @catchData="catchData"
+        ></wang-editor>
+      </a-form-item>
+    </a-form>
+    <template slot="footer">
+      <a-button :loading="confirmLoading" type="primary" @click="save()">保存</a-button>
+    </template>
+  </a-modal>
+</template>
+
+<script>
+import pick from 'lodash.pick'
+import { addInformation, updateInformation } from '@/api/qykh/information'
+import WangEditor from '@/components/Editor/WangEditor'
+import UploadImg from '@/components/Upload/UploadImg'
+import UploadArticleFile from '@/components/Upload/UploadArticleFile'
+export default {
+  name: 'BaseArticle',
+  components: {
+    WangEditor,
+    UploadImg,
+    UploadArticleFile
+  },
+  data () {
+    return {
+      labelCol: {
+        xs: { span: 24 },
+        sm: { span: 4 }
+      },
+      wrapperCol: {
+        xs: { span: 24 },
+        sm: { span: 20 }
+      },
+      topFlag: 0,
+      status: 1,
+      confirmLoading: false,
+      mdl: {},
+      modalTitle: null,
+      form: this.$form.createForm(this),
+      visible: false,
+      infordes: '',
+      resultContent: '',
+      type: null
+    }
+  },
+  props: {
+  },
+  created () {
+  },
+  methods: {
+    base (record) {
+      this.visible = true
+      // 如果是空标识添加
+      if (this.BaseTool.Object.isBlank(record)) {
+        this.modalTitle = '添加'
+        this.infordes = ''
+        return
+      }
+      this.modalTitle = '编辑'
+      this.type = record.type
+      const { form: { setFieldsValue } } = this
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign(pick(record, [
+          'id',
+          'inforname',
+          'ord'
+        ])))
+        this.infordes = record.infordes
+      })
+    },
+    catchData (content) {
+      this.resultContent = content
+    },
+    save () {
+      const { form: { validateFieldsAndScroll } } = this
+      this.confirmLoading = true
+      validateFieldsAndScroll((errors, values) => {
+        if (errors) {
+          this.confirmLoading = false
+          return
+        }
+        values = {
+          ...values,
+          infordes: this.resultContent ? this.resultContent : this.infordes
+        }
+        /* if (this.type === 2) {
+          if (values.parentId == null) {
+            this.$message.error('请选择父文章')
+            return
+          }
+        } */
+        if (this.BaseTool.String.isBlank(values.id)) {
+          addInformation(values)
+            .then(() => {
+              this.handleCancel(values)
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+        } else {
+          updateInformation(values)
+            .then(() => {
+              this.handleCancel(values)
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+        }
+      })
+    },
+    handleCancel (values) {
+      this.visible = false
+      this.confirmLoading = false
+      this.infordes = ''
+      this.resultContent = ''
+      this.form.resetFields()
+      if (this.BaseTool.Object.isNotBlank(values)) {
+        this.$emit('ok', values)
+      }
+    }
+  }
+}
+</script>

+ 70 - 0
src/views/qykh/information/modules/Detail.vue

@@ -0,0 +1,70 @@
+<template>
+  <a-modal
+    :title="modalTitle"
+    :width="1200"
+    :visible="visible"
+    class="ant-modal2"
+    :confirmLoading="confirmLoading"
+    @cancel="handleCancel"
+  >
+    <detail-list title="" :col="1">
+      <detail-list-item term="标题">{{ model.inforname }}</detail-list-item>
+      <detail-list-item term="内容" v-html="model.infordes"></detail-list-item>
+    </detail-list>
+
+    <template slot="footer">
+      <a-button :loading="confirmLoading" type="primary" @click="handleCancel()">返回</a-button>
+    </template>
+  </a-modal>
+</template>
+
+<script>
+import DetailList from '@/components/tools/DetailList'
+const DetailListItem = DetailList.Item
+
+export default {
+  name: 'ArticleDetail',
+  components: {
+    DetailList,
+    DetailListItem
+  },
+  data () {
+    return {
+      confirmLoading: false,
+      mdl: {},
+      modalTitle: null,
+      visible: false,
+      model: {
+        'id': null,
+        'inforname': null,
+        'infordes': null
+      }
+    }
+  },
+  props: {
+    typeMap: {
+      type: Object,
+      default: () => ({})
+    }
+  },
+  methods: {
+    base (record) {
+      this.visible = true
+      this.modalTitle = '详情'
+      this.model = record
+    },
+    handleCancel () {
+      this.visible = false
+      this.confirmLoading = false
+    },
+    downTemplate (picture) {
+      const a = document.createElement('a')
+      console.log('picture: ' + picture)
+      a.href = picture
+      a.target = '_blank'
+      a.click()
+    }
+
+  }
+}
+</script>

+ 2 - 2
src/views/qykh/product/Product.vue

@@ -114,8 +114,8 @@ export default {
           ...parameter,
           keyword: this.queryParam.keyword,
           dataScope: {
-            sortBy: 'desc',
-            sortName: 'update_time'
+            sortBy: 'asc',
+            sortName: 'ord'
           }
         }
         return getProductPage(Object.assign(parameter, this.queryParam))