Browse Source

用友接口

hfxc226 2 years ago
parent
commit
f32ba6ea9a

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

@@ -0,0 +1,94 @@
+import { axios } from '@/utils/request'
+import { stringify } from 'qs'
+
+/**
+ * page func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function getPlanDetailPage (parameter) {
+  return axios({
+    url: '/qykh/plan/details/page?' + stringify(parameter),
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
+/**
+ * add func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function addPlanDetail (parameter) {
+  return axios({
+    url: '/qykh/plan/details',
+    method: 'POST',
+    headers: {
+      'Accept': 'application/json',
+      'Content-Type': 'application/json;charset=UTF-8'
+    },
+    data: parameter
+  })
+}
+
+/**
+ * update func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function updatePlanDetail (parameter) {
+  return axios({
+    url: '/qykh/plan/details/' + parameter.id,
+    method: 'PUT',
+    data: parameter
+  })
+}
+
+/**
+ * fetch single func
+ * parameter: { }
+ * @param parameter
+ * @returns {*}
+ */
+export function fetchPlanDetail (parameter) {
+  return axios({
+    url: '/qykh/plan/details/' + parameter.id,
+    method: 'get',
+    headers: {
+      'Content-Type': 'application/json;charset=UTF-8'
+    }
+  })
+}
+
+/**
+ * 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/producthelp.js

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

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

@@ -1,5 +1,5 @@
 <template>
-  <a-card style="width:794px">
+  <a-card style="width:100%">
     <div id="div1" class="toolbar">
     </div>
     <div ref="editorElem" id="div2" class="text"> <!--可使用 min-height 实现编辑区域自动增加高度-->

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

@@ -334,8 +334,11 @@ const constantRouterComponents = {
   'RemoteDegree': () => import('@/views/remote/degree/RemoteDegree'),
   'RemoteDegreeLog': () => import('@/views/remote/degree-log/RemoteDegreeLog'),
   // 初始化导入
-  'ImportExcel': () => import('@/views/excel/ImportExcel')
+  'ImportExcel': () => import('@/views/excel/ImportExcel'),
 
+  // 乾坤
+  'PlanDetail': () => import('@/views/qykh/plan-detail/PlanDetail'),
+  'ProductHelp': () => import('@/views/qykh/product-help/ProductHelp')
 }
 
 // 前端未找到页面路由(固定不用改)

+ 189 - 0
src/views/qykh/plan-detail/PlanDetail.vue

@@ -0,0 +1,189 @@
+<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 {
+  getPlanDetailPage,
+  fetchPlanDetail,
+  deletePlanDetails
+} from '@/api/qykh/plandetails'
+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: 'plantitle'
+        },
+        {
+          title: 'planid',
+          dataIndex: 'planid'
+        },
+        {
+          title: '排序',
+          dataIndex: 'orderid'
+        },
+        {
+          title: '关键字',
+          dataIndex: 'keywords'
+        },
+        {
+          title: '发布时间',
+          dataIndex: 'time'
+        },
+        {
+          title: '操作',
+          key: 'action',
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        parameter = {
+          ...parameter,
+          keyword: this.queryParam.keyword,
+          dataScope: {
+            sortBy: 'desc',
+            sortName: 'time'
+          }
+        }
+        return getPlanDetailPage(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) {
+      fetchPlanDetail({ id: record.id }).then(res => {
+        const modal = this.$refs.baseModal
+        modal.base(res.data)
+      })
+    },
+    handleView (record) {
+      fetchPlanDetail({ 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>

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

@@ -0,0 +1,204 @@
+<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="['plantitle', {rules: [{required: true, message: '标题不能为空'}]}]" />
+      </a-form-item>
+      <a-form-item
+        label="摘要"
+        :labelCol="labelCol"
+        :wrapperCol="wrapperCol"
+      >
+        <a-input
+          v-decorator="['digest', {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"
+      >
+        <a-input
+          v-decorator="['keywords']" />
+      </a-form-item>
+      <a-form-item
+        label="排序"
+        :labelCol="labelCol"
+        :wrapperCol="wrapperCol"
+      >
+        <a-input
+          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"
+        :wrapperCol="wrapperCol"
+      >
+        <wang-editor
+          :content="plancontext"
+          @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 { addPlanDetail, updatePlanDetail } from '@/api/qykh/plandetails'
+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,
+      plancontext: '',
+      picture: '',
+      resultContent: '',
+      type: null
+    }
+  },
+  props: {
+  },
+  created () {
+  },
+  methods: {
+    base (record) {
+      this.visible = true
+      // 如果是空标识添加
+      if (this.BaseTool.Object.isBlank(record)) {
+        this.modalTitle = '添加'
+        this.plancontext = ''
+        return
+      }
+      this.modalTitle = '编辑'
+      this.type = record.type
+      const { form: { setFieldsValue } } = this
+      this.$nextTick(() => {
+        setFieldsValue(Object.assign(pick(record, [
+          'id',
+          'plantitle',
+          'shortdesc',
+          'planid',
+          'orderid',
+          'planid',
+          'seoid',
+          'time',
+          'digest',
+          'keywords'
+        ])))
+        this.plancontext = record.plancontext
+      })
+    },
+    catchData (content) {
+      this.resultContent = content
+    },
+    save () {
+      const { form: { validateFieldsAndScroll } } = this
+      this.confirmLoading = true
+      validateFieldsAndScroll((errors, values) => {
+        if (errors) {
+          this.confirmLoading = false
+          return
+        }
+        values = {
+          ...values,
+          plancontext: this.resultContent ? this.resultContent : this.plancontext
+        }
+        /* if (this.type === 2) {
+          if (values.parentId == null) {
+            this.$message.error('请选择父文章')
+            return
+          }
+        } */
+        if (this.BaseTool.String.isBlank(values.id)) {
+          addPlanDetail(values)
+            .then(() => {
+              this.handleCancel(values)
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+        } else {
+          updatePlanDetail(values)
+            .then(() => {
+              this.handleCancel(values)
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+        }
+      })
+    },
+    handleCancel (values) {
+      this.visible = false
+      this.confirmLoading = false
+      this.plancontext = ''
+      this.resultContent = ''
+      this.topFlag = ''
+      this.status = 1
+      this.picture = ''
+      this.form.resetFields()
+      if (this.BaseTool.Object.isNotBlank(values)) {
+        this.$emit('ok', values)
+      }
+    }
+  }
+}
+</script>

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

@@ -0,0 +1,90 @@
+<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.plantitle }}</detail-list-item>
+      <detail-list-item term="简介">{{ model.shortdesc }}</detail-list-item>
+      <detail-list-item term="对应的planid">{{ model.planid }}</detail-list-item>
+      <detail-list-item term="关键字">{{ model.keywords }}</detail-list-item>
+      <detail-list-item term="排序">{{ model.orderid }}</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="发布时间">{{ model.time }}</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,
+        '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
+      }
+    }
+  },
+  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>

+ 196 - 0
src/views/qykh/product-help/ProductHelp.vue

@@ -0,0 +1,196 @@
+<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 {
+  getProductHelpPage,
+  fetchProductHelp
+} from '@/api/qykh/producthelp'
+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: 'title'
+        },
+    /*    {
+          title: '摘要',
+          dataIndex: 'digest'
+        },*/
+        {
+          title: 'purl',
+          dataIndex: 'purl'
+        },
+        {
+          title: 'purl',
+          dataIndex: 'purl'
+        },
+        {
+          title: '关键字',
+          dataIndex: 'keywords'
+        },
+        {
+          title: '排序',
+          dataIndex: 'ord'
+        },
+        {
+          title: 'purl',
+          dataIndex: 'purl'
+        },
+        {
+          title: '操作',
+          key: 'action',
+          align: 'center',
+          scopedSlots: { customRender: 'action' }
+        }
+      ],
+      // 加载数据方法 必须为 Promise 对象
+      loadData: parameter => {
+        parameter = {
+          ...parameter,
+          keyword: this.queryParam.keyword,
+          dataScope: {
+            sortBy: 'desc',
+            sortName: 'update_time'
+          }
+        }
+        return getProductHelpPage(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) {
+      fetchProductHelp({ id: record.id }).then(res => {
+        const modal = this.$refs.baseModal
+        modal.base(res.data)
+      })
+    },
+    handleView (record) {
+      fetchProductHelp({ 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>

+ 187 - 0
src/views/qykh/product-help/modules/BaseForm.vue

@@ -0,0 +1,187 @@
+<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="['purl']" />
+      </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 { addProductHelp, updateProductHelp } from '@/api/qykh/producthelp'
+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',
+          'planid',
+          'purl',
+          'ord',
+          'digest',
+          '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)) {
+          addProductHelp(values)
+            .then(() => {
+              this.handleCancel(values)
+            }).catch(() => {
+              this.confirmLoading = false
+            })
+        } else {
+          updateProductHelp(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/product-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.purl }}</detail-list-item>
+      <detail-list-item term="对应的产品id">{{ 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,
+        'purl': 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>