Browse Source

用友接口

hfxc226 2 years ago
parent
commit
bb3c549372

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

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

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

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

+ 0 - 28
src/api/qykh/plandetails.js

@@ -64,31 +64,3 @@ export function fetchPlanDetail (parameter) {
     }
   })
 }
-
-/**
- * delete batch func
- * parameter: { }
- * @param parameter
- * @returns {*}
- */
-export function deletePlanDetails (parameter) {
-  return axios({
-    url: '/sb/types',
-    method: 'DELETE',
-    data: parameter
-  })
-}
-
-/**
- * delete single func
- * parameter: { }
- * @param parameter
- * @returns {*}
- */
-export function deletePlanDetail (parameter) {
-  return axios({
-    url: '/sb/types/' + parameter.id,
-    method: 'DELETE',
-    data: parameter
-  })
-}

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

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

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

@@ -338,8 +338,11 @@ const constantRouterComponents = {
   'ImportExcel': () => import('@/views/excel/ImportExcel'),
 
   // 乾坤
+  'Plan': () => import('@/views/qykh/plan/Plan'),
   'PlanDetail': () => import('@/views/qykh/plan-detail/PlanDetail'),
-  'ProductHelp': () => import('@/views/qykh/product-help/ProductHelp')
+  'Product': () => import('@/views/qykh/product/Product'),
+  'ProductHelp': () => import('@/views/qykh/product-help/ProductHelp'),
+  'HotspotHelp': () => import('@/views/qykh/hotspot-help/HotspotHelp')
 }
 
 // 前端未找到页面路由(固定不用改)

+ 191 - 0
src/views/qykh/hotspot-help/HotspotHelp.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 {
+  getHotspotHelpPage,
+  fetchHotspotHelp
+} from '@/api/qykh/hotspothelp'
+
+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: 'hid',
+          dataIndex: 'hid'
+        },
+        {
+          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 getHotspotHelpPage(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) {
+      fetchHotspotHelp({ id: record.id }).then(res => {
+        const modal = this.$refs.baseModal
+        modal.base(res.data)
+      })
+    },
+    handleView (record) {
+      fetchHotspotHelp({ 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/hotspot-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 { addHotspotHelp, updateHotspotHelp } from '@/api/qykh/hotspothelp'
+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',
+          'hid',
+          '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)) {
+          addHotspotHelp(values)
+            .then(() => {
+              this.handleCancel(values)
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+        } else {
+          updateHotspotHelp(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/hotspot-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="hid">{{ model.hid }}</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,
+        'hid': 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>

+ 0 - 9
src/views/qykh/plan-detail/modules/BaseForm.vue

@@ -54,15 +54,6 @@
           type="number"
           v-decorator="['orderid', {rules: [{required: true, message: '排序不能为空'}]}]" />
       </a-form-item>
-      <a-form-item
-        label="seoid"
-        :labelCol="labelCol"
-        :wrapperCol="wrapperCol"
-      >
-        <a-input
-          type="number"
-          v-decorator="['seoid', {rules: [{required: true, message: 'seoid不能为空'}]}]" />
-      </a-form-item>
       <a-form-item
         label="内容"
         :labelCol="labelCol"

+ 8 - 15
src/views/qykh/plan-detail/modules/Detail.vue

@@ -43,21 +43,14 @@ export default {
       visible: false,
       model: {
         'id': null,
-        'type': null,
-        'title': null,
-        'status': null,
-        'sort': null,
-        'topFlag': null,
-        'introduction': null,
-        'content': null,
-        'picture': null,
-        'clicks': null,
-        'createdTime': null,
-        'createdUserId': null,
-        'createdUserName': null,
-        'updateTime': null,
-        'updateUserId': null,
-        'updateUserName': null
+        'plantitle': null,
+        'shortdesc': null,
+        'planid': null,
+        'orderid': null,
+        'digest': null,
+        'keywords': null,
+        'time': null,
+        'plancontext': null
       }
     }
   },

+ 184 - 0
src/views/qykh/plan/Plan.vue

@@ -0,0 +1,184 @@
+<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.plantitle" 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 {
+  getPlanPage,
+  fetchPlan
+} from '@/api/qykh/plan'
+import DictCache from '@/utils/dict'
+
+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: 'planname'
+        },
+        {
+          title: '摘要',
+          dataIndex: 'shortdesc'
+        },
+        {
+          title: '排序',
+          dataIndex: 'ord'
+        },
+        {
+          title: 'pid',
+          dataIndex: 'pid'
+        },
+        {
+          title: '操作',
+          key: 'action',
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        parameter = {
+          ...parameter,
+          keyword: this.queryParam.keyword,
+          dataScope: {
+            sortBy: 'desc',
+            sortName: 'time'
+          }
+        }
+        return getPlanPage(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) {
+      fetchPlan({ id: record.id }).then(res => {
+        const modal = this.$refs.baseModal
+        modal.base(res.data)
+      })
+    },
+    handleView (record) {
+      fetchPlan({ 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>

+ 175 - 0
src/views/qykh/plan/modules/BaseForm.vue

@@ -0,0 +1,175 @@
+<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-input v-decorator="['planid']" type="hidden"/>
+      </a-form-item>
+      <a-form-item
+        label="标题"
+        :labelCol="labelCol"
+        :wrapperCol="wrapperCol"
+      >
+        <a-input
+          v-decorator="['planname', {rules: [{required: true, message: '标题不能为空'}]}]" />
+      </a-form-item>
+      <a-form-item
+        label="摘要"
+        :labelCol="labelCol"
+        :wrapperCol="wrapperCol"
+      >
+        <a-input
+          v-decorator="['shortdesc', {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="plandes"
+          @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 { addPlan, updatePlan } from '@/api/qykh/plan'
+import WangEditor from '@/components/Editor/WangEditor'
+import UploadImg from '@/components/Upload/UploadImg'
+import UploadArticleFile from '@/components/Upload/UploadArticleFile'
+export default {
+  name: 'BaseForm',
+  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,
+      plandes: '',
+      picture: '',
+      resultContent: '',
+      type: null
+    }
+  },
+  props: {
+  },
+  created () {
+  },
+  methods: {
+    base (record) {
+      this.visible = true
+      // 如果是空标识添加
+      if (this.BaseTool.Object.isBlank(record)) {
+        this.modalTitle = '添加'
+        this.plandes = ''
+        return
+      }
+      this.modalTitle = '编辑'
+      this.type = record.type
+      const { form: { setFieldsValue } } = this
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign(pick(record, [
+          'id',
+          'planname',
+          'shortdesc',
+          'pid',
+          'ord',
+          'level'
+        ])))
+        this.plandes = record.plandes
+      })
+    },
+    catchData (content) {
+      this.resultContent = content
+    },
+    save () {
+      const { form: { validateFieldsAndScroll } } = this
+      this.confirmLoading = true
+      validateFieldsAndScroll((errors, values) => {
+        if (errors) {
+          this.confirmLoading = false
+          return
+        }
+        values = {
+          ...values,
+          plandes: this.resultContent ? this.resultContent : this.plandes
+        }
+        /* if (this.type === 2) {
+          if (values.parentId == null) {
+            this.$message.error('请选择父文章')
+            return
+          }
+        } */
+        if (this.BaseTool.String.isBlank(values.id)) {
+          addPlan(values)
+            .then(() => {
+              this.handleCancel(values)
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+        } else {
+          updatePlan(values)
+            .then(() => {
+              this.handleCancel(values)
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+        }
+      })
+    },
+    handleCancel (values) {
+      this.visible = false
+      this.confirmLoading = false
+      this.plandes = ''
+      this.resultContent = ''
+      this.topFlag = ''
+      this.status = 1
+      this.picture = ''
+      this.form.resetFields()
+      if (this.BaseTool.Object.isNotBlank(values)) {
+        this.$emit('ok', values)
+      }
+    }
+  }
+}
+</script>

+ 82 - 0
src/views/qykh/plan/modules/Detail.vue

@@ -0,0 +1,82 @@
+<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.planname }}</detail-list-item>
+      <detail-list-item term="简介">{{ model.shortdesc }}</detail-list-item>
+      <detail-list-item term="对应的planid">{{ model.pid }}</detail-list-item>
+      <detail-list-item term="level">{{ model.level }}</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="seoid">{{ model.seoid }}</detail-list-item>
+      <detail-list-item term="内容" v-html="model.plancontext"></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,
+        'planname': null,
+        'shortdesc': null,
+        'pid': null,
+        'level': null,
+        'purl': null,
+        'bannerurl': null,
+        'seoid': null,
+        'ord': 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>

+ 192 - 0
src/views/qykh/product/Product.vue

@@ -0,0 +1,192 @@
+<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 {
+  getProductPage,
+  fetchProduct
+} from '@/api/qykh/product'
+import DictCache from '@/utils/dict'
+
+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: 'pname'
+        },
+     {
+          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 getProductPage(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) {
+      fetchProduct({ id: record.id }).then(res => {
+        const modal = this.$refs.baseModal
+        modal.base(res.data)
+      })
+    },
+    handleView (record) {
+      fetchProduct({ 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/product/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="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 { addProduct, updateProduct } from '@/api/qykh/product'
+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',
+          'pname',
+          '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)) {
+          addProduct(values)
+            .then(() => {
+              this.handleCancel(values)
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+        } else {
+          updateProduct(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/product/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.pname }}</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,
+        'pname': 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>