Ver código fonte

代码提交:
1028知识分享

sunruiqi 2 anos atrás
pai
commit
d53d281104

Diferenças do arquivo suprimidas por serem muito extensas
+ 889 - 27
package-lock.json


+ 46 - 0
src/api/sys/KnowledgeShareInfoService.js

@@ -0,0 +1,46 @@
+import request from '@/utils/httpRequest'
+
+export default class KnowledgeShareInfoService {
+  list (param) {
+    return request({
+      url: '/knowledgeShare/info/list',
+      method: 'get',
+      params: param
+    })
+  }
+  save (param) {
+    return request({
+      url: '/knowledgeShare/info/save',
+      method: 'post',
+      data: param
+    })
+  }
+  findById (id, method) {
+    return request({
+      url: '/knowledgeShare/info/findById',
+      method: 'get',
+      params: {id: id, method: method}
+    })
+  }
+  remove (id) {
+    return request({
+      url: '/knowledgeShare/info/removeById',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+  addComment (param) {
+    return request({
+      url: '/knowledgeShare/info/addComment',
+      method: 'post',
+      data: param
+    })
+  }
+  delComment (id) {
+    return request({
+      url: '/knowledgeShare/info/delComment',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+}

+ 32 - 0
src/api/sys/KnowledgeShareTypeService.js

@@ -0,0 +1,32 @@
+import request from '@/utils/httpRequest'
+
+export default class KnowledgeShareTypeService {
+  list (param) {
+    return request({
+      url: '/knowledgeShare/type/list',
+      method: 'get',
+      params: param
+    })
+  }
+  save (param) {
+    return request({
+      url: '/knowledgeShare/type/save',
+      method: 'post',
+      data: param
+    })
+  }
+  findById (id) {
+    return request({
+      url: '/knowledgeShare/type/findById',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+  remove (id) {
+    return request({
+      url: '/knowledgeShare/type/remove',
+      method: 'get',
+      params: {id: id}
+    })
+  }
+}

+ 155 - 0
src/views/modules/finance/invoice/KnowledgeShareTypePageForm.vue

@@ -0,0 +1,155 @@
+<template>
+  <div>
+    <el-dialog
+      title="知识分享类型"
+      :close-on-click-modal="false"
+      v-dialogDrag
+      width="1100px"
+      height="500px"
+      @close="close"
+      @keyup.enter.native=""
+      :append-to-body="true"
+      :visible.sync="visible">
+      <div style="height: calc(100% - 80px);">
+        <el-form size="small" :inline="true" class="query-form" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
+          <!-- 搜索框-->
+          <el-form-item label="分享类型" prop="klgsType">
+            <el-input size="small" v-model="searchForm.klgsType" placeholder="请输入分享类型" clearable></el-input>
+          </el-form-item>
+
+          <el-form-item>
+            <el-button type="primary" @click="list()" size="small" icon="el-icon-search">查询</el-button>
+            <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
+          </el-form-item>
+        </el-form>
+
+        <vxe-table
+          border="inner"
+          auto-resize
+          resizable
+          height="400px"
+          :loading="loading"
+          size="small"
+          ref="programTable"
+          show-header-overflow
+          show-overflow
+          highlight-hover-row
+          :menu-config="{}"
+          :print-config="{}"
+          @sort-change=""
+          :sort-config="{remote:true}"
+          :data="dataList"
+          :checkbox-config="{}">
+          <vxe-column type="seq" width="40"></vxe-column>
+          <vxe-column type="checkbox" width="40px"></vxe-column>
+
+          <vxe-column title="分享类型" field="klgsType" align="left"></vxe-column>
+          <vxe-column width="200" title="分享类型key值" field="klgsKey" align="left"></vxe-column>
+          <vxe-column width="100" title="序号" field="klgsSort"></vxe-column>
+          <vxe-column width="100" title="创建人" field="createBy"></vxe-column>
+          <vxe-column width="100" title="创建时间" field="createDate"></vxe-column>
+
+        </vxe-table>
+        <vxe-pager
+          background
+          size="small"
+          :current-page="tablePage.currentPage"
+          :page-size="tablePage.pageSize"
+          :total="tablePage.total"
+          :page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"
+          :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
+          @page-change="currentChangeHandle">
+        </vxe-pager>
+      </div>
+
+      <span slot="footer" class="dialog-footer">
+      <el-button size="small" @click="close()" icon="el-icon-circle-close">关闭</el-button>
+      <el-button size="small" type="primary" v-if="method != 'view'" @click="getProgram()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+    </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import KnowledgeShareTypeService from '@/api/sys/KnowledgeShareTypeService'
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        visible: false,
+        loading: false,
+        tablePage: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 10,
+          orders: []
+        },
+        dataList: [],
+        searchForm: {
+          klgsType: ''
+        },
+        checkType: '',
+        detail: '',
+        isShow: true,
+        num: true // num为true是多选,false是单选
+      }
+    },
+    knowledgeShareTypeService: null,
+    created () {
+      this.knowledgeShareTypeService = new KnowledgeShareTypeService()
+    },
+    components: {
+    },
+    methods: {
+      init () {
+        this.num = true
+        this.visible = true
+        this.list()
+      },
+      // 表单提交
+      getProgram () {
+        let rows
+        if (this.$refs.programTable.getCheckboxRecords().length > 1) {
+          this.$message.error('最多选择一条数据')
+          return
+        }
+        rows = this.$refs.programTable.getCheckboxRecords()
+        this.close()
+        this.$emit('getProgram', rows)
+      },
+      list () {
+        this.loading = true
+        this.knowledgeShareTypeService.list({
+          'current': this.tablePage.currentPage,
+          'size': this.tablePage.pageSize,
+          'orders': this.tablePage.orders,
+          ...this.searchForm
+        }).then(({data}) => {
+          this.dataList = data.records
+          this.tablePage.total = data.total
+          this.loading = false
+        })
+      },
+      // 当前页
+      currentChangeHandle ({currentPage, pageSize}) {
+        this.tablePage.currentPage = currentPage
+        this.tablePage.pageSize = pageSize
+        this.list()
+      },
+      resetSearch () {
+        this.$refs.searchForm.resetFields()
+        this.list()
+      },
+      close () {
+        this.$refs.searchForm.resetFields()
+        this.visible = false
+      }
+    }
+  }
+</script>
+<style>
+  .messageZindex {
+    z-index:9999 !important;
+  }
+</style>

+ 294 - 0
src/views/modules/knowledgeShare/InfoForm.vue

@@ -0,0 +1,294 @@
+<template>
+  <div>
+    <el-dialog
+      :title="formTitle"
+      :close-on-click-modal="false"
+      v-dialogDrag
+      width="1300px"
+      @close="close"
+      @keyup.enter.native="doSubmit"
+      :visible.sync="visible">
+      <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''" :disabled="method === 'view'"
+               label-width="150px" @submit.native.prevent>
+        <el-row  :gutter="15">
+
+          <el-col :span="21">
+            <el-form-item label="知识分享类型" prop="typeName"
+                          :rules="[
+                          {required: true, message:'分享类型不能为空', trigger:'blur'}
+                 ]">
+              <el-input v-model="inputForm.typeName" @focus="openProgramPageForm()" placeholder="请选择知识分享类型"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="21">
+            <el-form-item label="主题" prop="title"
+                          :rules="[
+                          {required: true, message:'主题不能为空', trigger:'blur'}
+                 ]">
+              <el-input v-model="inputForm.title" placeholder="请填写主题"></el-input>
+            </el-form-item>
+          </el-col>
+
+          <el-col>
+            <el-form-item label="内容" prop="detail"
+                          :rules="[
+                          {required: true, message:'内容不能为空', trigger:'blur'}
+                 ]">
+              <WangEditor ref="contentEditor" v-model="inputForm.detail"/>
+            </el-form-item>
+          </el-col>
+        </el-row>
+
+        <!-- 附件 -->
+        <UpLoadComponent ref="uploadComponent"></UpLoadComponent>
+
+        <el-divider v-if="method === 'view'" content-position="left"><i class="el-icon-document"></i>访问日志</el-divider>
+        <el-row :gutter="15" >
+          <vxe-table
+            border
+            show-overflow
+            v-if="method === 'view'"
+            ref="detailTable"
+            class="vxe-table-element"
+            :data="inputForm.visits"
+            @cell-click=""
+            @edit-closed=""
+            highlight-current-row
+            :edit-config="{trigger: 'click', mode: 'cell', showStatus: true, autoClear: true}"
+          >
+            <vxe-table-column field="userId" title="访问人" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input :disbale="method === 'view'" v-model="scope.row.userId" ></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="firstTime" title="首次访问时间" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input :disbale="method === 'view'" v-model="scope.row.firstTime" ></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="lastTime" title="最近访问时间" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input :disbale="method === 'view'" v-model="scope.row.lastTime" ></el-input>
+              </template>
+            </vxe-table-column>
+            <vxe-table-column field="num" title="访问次数" :edit-render="{}">
+              <template v-slot:edit="scope">
+                <el-input v-model="scope.row.num" ></el-input>
+              </template>
+            </vxe-table-column>
+          </vxe-table>
+        </el-row>
+
+        <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''" :disabled="false" @submit.native.prevent>
+        <el-divider v-if="method === 'view'" content-position="left"><i class="el-icon-document"></i>发表评论</el-divider>
+          <el-row>
+            <el-col>
+              <el-form-item v-if="method === 'view'" prop="content">
+                <el-input v-model="inputForm.content"
+                          type="textarea"
+                          :rows="5"
+                          :disabled="method !== 'view'"
+                          maxlength="500"
+                          placeholder="请输入评论信息"
+                          show-word-limit>
+                </el-input>
+              </el-form-item>
+            </el-col>
+            <el-button v-if="method === 'view'" style="float: right" type="primary" size="mini" @click="pushComment()" plain>
+              发表
+            </el-button>
+            <el-button v-if="method === 'view'" style="float: right; margin-right: 20px" type="primary" size="mini" @click="cleanComment()" plain>
+              清空
+            </el-button>
+          </el-row>
+
+          <el-divider v-if="method === 'view'" content-position="left"><i class="el-icon-document"></i>全部评论({{inputForm.comments.length}}条)</el-divider>
+          <div v-if="method === 'view'" v-for="(item, index) in inputForm.comments">
+            <el-divider></el-divider>
+            <div class="font_div" style="width: 100%; height:30px;"><span>{{item.userId}}</span></div>
+            <div style="margin-left: 20px; height:45px;"><span>{{item.content}}</span></div>
+            <div style="width: 100%; height:30px;">
+              <span>{{item.deff}}</span>
+              <a v-if="create === item.createBy || isAdmin" style="float: right" type="text" size="mini" @click="delComment(item.id)">删除</a>
+            </div>
+          </div>
+
+        </el-form>
+
+        <KnowledgeShareTypePageForm ref="knowledgeShareTypePageForm" @getProgram="getProgram"></KnowledgeShareTypePageForm>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+      <el-button size="small" @click="close()" icon="el-icon-circle-close">关闭</el-button>
+      <el-button size="small" type="primary" v-if="method != 'view'" @click="doSubmit()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+    </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import KnowledgeShareInfoService from '@/api/sys/KnowledgeShareInfoService'
+  import UpLoadComponent from '@/views/common/UpLoadComponent'
+  import UserService from '@/api/sys/UserService'
+  import KnowledgeShareTypePageForm from '@/views/modules/finance/invoice/KnowledgeShareTypePageForm'
+  import WangEditor from '@/components/editor/WangEditor'
+  export default {
+    data () {
+      return {
+        formTitle: '',
+        method: '',
+        visible: false,
+        loading: false,
+        isAdmin: false,
+        create: '',
+        inputForm: {
+          id: '',
+          typeId: '',
+          title: '',
+          detail: '',
+          visits: [],
+          comments: [],
+          files: [],
+          content: ''
+        }
+      }
+    },
+    knowledgeShareInfoService: null,
+    userService: null,
+    created () {
+      this.knowledgeShareInfoService = new KnowledgeShareInfoService()
+      this.userService = new UserService()
+    },
+    components: {
+      UpLoadComponent,
+      KnowledgeShareTypePageForm,
+      WangEditor
+    },
+    methods: {
+      init (method, id) {
+        this.method = method
+        this.inputForm = {
+          id: '',
+          typeId: '',
+          typeName: '',
+          title: '',
+          detail: '',
+          visits: [],
+          comments: [],
+          files: [],
+          content: ''
+        }
+        if (method === 'add') {
+          this.formTitle = `新建知识分享`
+        } else if (method === 'edit') {
+          this.inputForm.id = id
+          this.formTitle = '修改知识分享'
+        } else if (method === 'view') {
+          this.inputForm.id = id
+          this.formTitle = '查看知识分享'
+        }
+        this.visible = true
+        this.loading = false
+        this.$nextTick(() => {
+          if (method === 'edit' || method === 'view') { // 修改或者查看
+            this.loading = true
+            // 富文本处理
+            this.$refs.contentEditor.clear()
+            this.is()
+            this.create = JSON.parse(localStorage.getItem('user')).id
+            this.$refs.inputForm.resetFields()
+            this.knowledgeShareInfoService.findById(this.inputForm.id, method).then(({data}) => {
+              // 富文本处理
+              this.$refs.contentEditor.disable()
+              this.inputForm = this.recover(this.inputForm, data)
+              this.$refs.uploadComponent.newUpload(method, this.inputForm.files, 'knowledgeShare')
+              this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+              this.inputForm.comments = JSON.parse(JSON.stringify(this.inputForm.comments))
+              // 富文本处理
+              if (this.commonJS.isNotEmpty(this.inputForm.detail)) {
+                this.$refs.contentEditor.init(this.inputForm.detail)
+              }
+              this.loading = false
+            })
+          }
+        })
+      },
+      // 表单提交
+      doSubmit () {
+        this.$refs['inputForm'].validate((valid) => {
+          if (valid) {
+            this.loading = true
+            if (this.$refs.uploadComponent.checkProgress()) {
+              this.loading = false
+              return
+            }
+            if (this.commonJS.isEmpty(this.inputForm.files)) {
+              this.inputForm.files = []
+            }
+            this.inputForm.files = this.$refs.uploadComponent.getDataList()
+            this.knowledgeShareInfoService.save(this.inputForm).then(({data}) => {
+              this.close()
+              this.$message.success(data)
+              this.$emit('refreshDataList')
+              this.loading = false
+            }).catch(() => {
+              this.loading = false
+            })
+          }
+        })
+      },
+      close () {
+        this.$refs.inputForm.resetFields()
+        this.$refs.uploadComponent.clearUpload()
+        // 富文本处理
+        this.$refs.contentEditor.clear()
+        this.visible = false
+      },
+      pushComment () {
+        if (this.commonJS.isEmpty(this.inputForm.content)) {
+          this.$message.error("请输入评论内容")
+          return
+        }
+        this.commentForm = {
+          detailId: this.inputForm.id,
+          content: this.inputForm.content
+        }
+        this.loading = true
+        this.knowledgeShareInfoService.addComment(this.commentForm).then(({data}) => {
+          this.close()
+          this.$message.success(data)
+          this.$emit('refreshDataList')
+          this.loading = false
+        })
+      },
+      cleanComment () {
+        this.inputForm.content = ''
+      },
+      delComment (id) {
+        this.knowledgeShareInfoService.delComment(id)
+        this.init('view', this.inputForm.id)
+      },
+      is () {
+        this.userService.is().then(({data}) => {
+          this.isAdmin = data
+        })
+      },
+      // 知识分享类型弹窗选择
+      openProgramPageForm () {
+        this.$refs.knowledgeShareTypePageForm.init()
+      },
+      getProgram (rows) {
+        console.log('aaaaaaaaaaa', rows[0])
+        this.inputForm.typeId = rows[0].id
+        this.inputForm.typeName = rows[0].klgsType
+        this.$forceUpdate()
+      }
+    }
+  }
+</script>
+
+<style>
+  .font_div {
+    font-weight: bold; /*加粗*/
+  }
+
+</style>

+ 183 - 0
src/views/modules/knowledgeShare/InfoList.vue

@@ -0,0 +1,183 @@
+<template>
+  <div class="page">
+    <el-form size="small" :inline="true" class="query-form" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
+      <!-- 搜索框-->
+      <el-form-item label="主题" prop="title">
+        <el-input size="small" v-model="searchForm.title" placeholder="请输入主题" clearable></el-input>
+      </el-form-item>
+      <el-form-item label="发帖人" prop="createBy">
+        <UserSelect :limit='1' :userName="searchForm.createBy" @getValue='(value, label) => {searchForm.createBy = label}'></UserSelect>
+      </el-form-item>
+
+      <el-form-item>
+        <el-button type="primary" @click="refreshList()" size="small" icon="el-icon-search">查询</el-button>
+        <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <div class="bg-white top" style="">
+      <vxe-toolbar :refresh="{query: refreshList}" custom>
+        <template #buttons>
+          <el-button v-if="hasPermission('knowledgeShare:info:add')" type="primary" size="small" icon="el-icon-plus" @click="add()">新建</el-button>
+          <el-button v-if="hasPermission('knowledgeShare:info:del')" type="danger"   size="small" icon="el-icon-delete" @click="del()" :disabled="$refs.typeTable && $refs.typeTable.getCheckboxRecords().length === 0" plain>删除</el-button>
+        </template>
+      </vxe-toolbar>
+      <div style="height: calc(100% - 50px)">
+        <vxe-table
+          border="inner"
+          auto-resize
+          resizable
+          height="auto"
+          :loading="loading"
+          size="small"
+          ref="typeTable"
+          show-header-overflow
+          show-overflow
+          highlight-hover-row
+          :menu-config="{}"
+          :sort-config="{remote:true}"
+          :data="dataList"
+          :checkbox-config="{}">
+          <vxe-column type="seq" width="40"></vxe-column>
+          <vxe-column type="checkbox" width="40" ></vxe-column>
+
+          <vxe-column title="主题" field="title" align="left">
+            <template slot-scope="scope">
+              <el-link  type="primary" :underline="false" v-if="hasPermission('knowledgeShare:info:view')" @click="view(scope.row.id)">{{scope.row.title}}</el-link>
+              <el-link  type="primary" :underline="false" v-else-if="hasPermission('knowledgeShare:info:view')" @click="view(scope.row.id)">{{scope.row.title}}</el-link>
+              <span v-else>{{scope.row.title}}</span>
+            </template>
+          </vxe-column>
+          <vxe-column width="150" title="发帖人" field="createBy" align="left"></vxe-column>
+          <vxe-column width="150" title="发帖时间" field="createDate"></vxe-column>
+          <vxe-column width="100" title="阅读量" field="visitNum"></vxe-column>
+          <vxe-column width="100" title="回复量" field="commentNum"></vxe-column>
+
+          <vxe-column title="操作" width="230px" fixed="right" align="center">
+            <template  slot-scope="scope">
+              <el-button v-if="hasPermission('knowledgeShare:info:edit') && (create === scope.row.createBy)" type="text" icon="el-icon-edit" size="small" @click="edit(scope.row.id)">修改</el-button>
+              <el-button v-if="hasPermission('knowledgeShare:info:del') && (create === scope.row.createBy || isAdmin)" type="text"  icon="el-icon-delete" size="small" @click="del(scope.row.id)">删除</el-button>
+            </template>
+          </vxe-column>
+        </vxe-table>
+        <vxe-pager
+          background
+          size="small"
+          :current-page="tablePage.currentPage"
+          :page-size="tablePage.pageSize"
+          :total="tablePage.total"
+          :page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"
+          :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
+          @page-change="currentChangeHandle">
+        </vxe-pager>
+      </div>
+    </div>
+    <InfoForm  ref="infoForm" @refreshDataList="refreshList"></InfoForm>
+  </div>
+</template>
+
+<script>
+  import KnowledgeShareInfoService from '@/api/sys/KnowledgeShareInfoService'
+  import InfoForm from './InfoForm'
+  import UserSelect from '@/components/userSelect'
+  import UserService from '@/api/sys/UserService'
+  export default {
+    data () {
+      return {
+        searchForm: {
+          title: '',
+          createBy: ''
+        },
+        dataList: [],
+        tablePage: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 10,
+          orders: []
+        },
+        loading: false,
+        isAdmin: false,
+        create: ''
+      }
+    },
+    knowledgeShareInfoService: null,
+    userService: null,
+    created () {
+      this.knowledgeShareInfoService = new KnowledgeShareInfoService()
+      this.userService = new UserService()
+    },
+    components: {
+      InfoForm,
+      UserSelect
+    },
+    mounted () {
+      this.refreshList()
+    },
+    methods: {
+      // 新增
+      add () {
+        this.$refs.infoForm.init('add', '')
+      },
+      // 修改
+      edit (id) {
+        id = id || this.$refs.typeTable.getCheckboxRecords().map(item => {
+          return item.id
+        })[0]
+        this.$refs.infoForm.init('edit', id)
+      },
+      // 查看
+      view (id) {
+        this.$refs.infoForm.init('view', id)
+      },
+      // 获取数据列表
+      refreshList () {
+        this.loading = true
+        this.is()
+        this.create = JSON.parse(localStorage.getItem('user')).name
+        this.knowledgeShareInfoService.list({
+          'current': this.tablePage.currentPage,
+          'size': this.tablePage.pageSize,
+          'orders': this.tablePage.orders,
+          ...this.searchForm
+        }).then(({data}) => {
+          this.dataList = data.records
+          this.tablePage.total = data.total
+          this.loading = false
+        })
+      },
+      // 删除
+      del (id) {
+        let ids = id || this.$refs.typeTable.getCheckboxRecords().map(item => {
+          return item.id
+        }).join(',')
+        this.$confirm(`确定删除所选项吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.loading = true
+          this.knowledgeShareInfoService.remove(ids).then(({data}) => {
+            this.$message.success(data)
+            this.refreshList()
+            this.loading = false
+          })
+        })
+      },
+      resetSearch () {
+        this.$refs.searchForm.resetFields()
+        this.refreshList()
+      },
+      // 当前页
+      currentChangeHandle ({ currentPage, pageSize }) {
+        this.tablePage.currentPage = currentPage
+        this.tablePage.pageSize = pageSize
+        this.refreshList()
+      },
+      is () {
+        this.userService.is().then(({data}) => {
+          this.isAdmin = data
+        })
+      }
+    }
+  }
+</script>

+ 124 - 0
src/views/modules/knowledgeShare/TypeForm.vue

@@ -0,0 +1,124 @@
+<template>
+  <div>
+    <el-dialog
+      :title="title"
+      :close-on-click-modal="false"
+      v-dialogDrag
+      width="500px"
+      @close="close"
+      @keyup.enter.native="doSubmit"
+      :visible.sync="visible">
+      <el-form size="middle" :model="inputForm" ref="inputForm" v-loading="loading" :class="method==='view'?'readonly':''"  :disabled="method==='view'"
+               label-width="150px" @submit.native.prevent>
+        <el-row  :gutter="15">
+
+          <el-col :span="21">
+            <el-form-item label="分享类型" prop="klgsType"
+                          :rules="[
+                          {required: true, message:'分享类型不能为空', trigger:'blur'}
+                 ]">
+              <el-input v-model="inputForm.klgsType" placeholder="请填写分享类型"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="21">
+            <el-form-item label="分析类型key值" prop="klgsKey"
+                          :rules="[
+                          {required: true, message:'分享类型key值不能为空', trigger:'blur'}
+                 ]">
+              <el-input v-model="inputForm.klgsKey" placeholder="请填写分析类型key值"></el-input>
+            </el-form-item>
+          </el-col>
+          <el-col :span="21">
+            <el-form-item label="排序" prop="klgsSort"
+                          :rules="[
+                          {required: true, message:'排序不能为空', trigger:'blur'}
+                 ]">
+              <el-input v-model="inputForm.klgsSort" oninput="value=value.replace(/[^\d]/g,'')" placeholder="请填写排序"></el-input>
+            </el-form-item>
+          </el-col>
+        </el-row>
+      </el-form>
+      <span slot="footer" class="dialog-footer">
+      <el-button size="small" @click="close()" icon="el-icon-circle-close">关闭</el-button>
+      <el-button size="small" type="primary" v-if="method != 'view'" @click="doSubmit()" icon="el-icon-circle-check" v-noMoreClick>确定</el-button>
+    </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+  import KnowledgeShareTypeService from '@/api/sys/KnowledgeShareTypeService'
+  export default {
+    data () {
+      return {
+        title: '',
+        method: '',
+        visible: false,
+        loading: false,
+        inputForm: {
+          klgsType: '',
+          klgsKey: '',
+          klgsSort: ''
+        }
+      }
+    },
+    knowledgeShareTypeService: null,
+    created () {
+      this.knowledgeShareTypeService = new KnowledgeShareTypeService()
+    },
+    components: {
+    },
+    methods: {
+      init (method, id) {
+        this.method = method
+        this.inputForm = {
+          klgsType: '',
+          klgsKey: '',
+          klgsSort: ''
+        }
+        if (method === 'add') {
+          this.title = `新建知识分享类型`
+        } else if (method === 'edit') {
+          this.inputForm.id = id
+          this.title = '修改知识分享类型'
+        } else if (method === 'view') {
+          this.inputForm.id = id
+          this.title = '查看知识分享类型'
+        }
+        this.visible = true
+        this.loading = false
+        this.$nextTick(() => {
+          if (method === 'edit' || method === 'view') { // 修改或者查看
+            this.loading = true
+            this.$refs.inputForm.resetFields()
+            this.knowledgeShareTypeService.findById(this.inputForm.id).then(({data}) => {
+              this.inputForm = this.recover(this.inputForm, data)
+              this.inputForm = JSON.parse(JSON.stringify(this.inputForm))
+              this.loading = false
+            })
+          }
+        })
+      },
+      // 表单提交
+      doSubmit () {
+        this.$refs['inputForm'].validate((valid) => {
+          if (valid) {
+            this.loading = true
+            this.knowledgeShareTypeService.save(this.inputForm).then(({data}) => {
+              this.close()
+              this.$message.success(data)
+              this.$emit('refreshDataList')
+              this.loading = false
+            }).catch(() => {
+              this.loading = false
+            })
+          }
+        })
+      },
+      close () {
+        this.$refs.inputForm.resetFields()
+        this.visible = false
+      }
+    }
+  }
+</script>

+ 159 - 0
src/views/modules/knowledgeShare/TypeList.vue

@@ -0,0 +1,159 @@
+<template>
+  <div class="page">
+    <el-form size="small" :inline="true" class="query-form" ref="searchForm" :model="searchForm" @keyup.enter.native="refreshList()" @submit.native.prevent>
+      <!-- 搜索框-->
+      <el-form-item label="分享类型" prop="type">
+        <el-input size="small" v-model="searchForm.type" placeholder="请输入分享类型" clearable></el-input>
+      </el-form-item>
+
+      <el-form-item>
+        <el-button type="primary" @click="refreshList()" size="small" icon="el-icon-search">查询</el-button>
+        <el-button @click="resetSearch()" size="small" icon="el-icon-refresh-right">重置</el-button>
+      </el-form-item>
+    </el-form>
+
+    <div class="bg-white top" style="">
+      <vxe-toolbar :refresh="{query: refreshList}" custom>
+        <template #buttons>
+          <el-button v-if="hasPermission('knowledgeShare:type:add')" type="primary" size="small" icon="el-icon-plus" @click="add()">新建</el-button>
+          <el-button v-if="hasPermission('knowledgeShare:type:del')" type="danger"   size="small" icon="el-icon-delete" @click="del()" :disabled="$refs.typeTable && $refs.typeTable.getCheckboxRecords().length === 0" plain>删除</el-button>
+        </template>
+      </vxe-toolbar>
+      <div style="height: calc(100% - 50px)">
+        <vxe-table
+          border="inner"
+          auto-resize
+          resizable
+          height="auto"
+          :loading="loading"
+          size="small"
+          ref="typeTable"
+          show-header-overflow
+          show-overflow
+          highlight-hover-row
+          :menu-config="{}"
+          :sort-config="{remote:true}"
+          :data="dataList"
+          :checkbox-config="{}">
+          <vxe-column type="seq" width="40"></vxe-column>
+          <vxe-column type="checkbox" width="40" ></vxe-column>
+
+          <vxe-column title="分享类型" field="klgsType" align="left"></vxe-column>
+          <vxe-column width="200" title="分享类型key值" field="klgsKey" align="left"></vxe-column>
+          <vxe-column width="100" title="序号" field="klgsSort"></vxe-column>
+          <vxe-column width="100" title="创建人" field="createBy"></vxe-column>
+          <vxe-column width="100" title="创建时间" field="createDate"></vxe-column>
+
+          <vxe-column title="操作" width="230px" fixed="right" align="center">
+            <template  slot-scope="scope">
+              <el-button v-if="hasPermission('knowledgeShare:type:edit')" type="text" icon="el-icon-edit" size="small" @click="edit(scope.row.id)">修改</el-button>
+              <el-button v-if="hasPermission('knowledgeShare:type:del')" type="text"  icon="el-icon-delete" size="small" @click="del(scope.row.id)">删除</el-button>
+            </template>
+          </vxe-column>
+        </vxe-table>
+        <vxe-pager
+          background
+          size="small"
+          :current-page="tablePage.currentPage"
+          :page-size="tablePage.pageSize"
+          :total="tablePage.total"
+          :page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"
+          :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
+          @page-change="currentChangeHandle">
+        </vxe-pager>
+      </div>
+    </div>
+    <TypeForm  ref="typeForm" @refreshDataList="refreshList"></TypeForm>
+  </div>
+</template>
+
+<script>
+  import KnowledgeShareTypeService from '@/api/sys/KnowledgeShareTypeService'
+  import TypeForm from './TypeForm'
+  export default {
+    data () {
+      return {
+        searchForm: {
+          klgsType: ''
+        },
+        dataList: [],
+        tablePage: {
+          total: 0,
+          currentPage: 1,
+          pageSize: 10,
+          orders: []
+        },
+        loading: false
+      }
+    },
+    knowledgeShareTypeService: null,
+    created () {
+      this.knowledgeShareTypeService = new KnowledgeShareTypeService()
+    },
+    components: {
+      TypeForm
+    },
+    mounted () {
+      this.refreshList()
+    },
+    methods: {
+      // 新增
+      add () {
+        this.$refs.typeForm.init('add', '')
+      },
+      // 修改
+      edit (id) {
+        id = id || this.$refs.typeTable.getCheckboxRecords().map(item => {
+          return item.id
+        })[0]
+        this.$refs.typeForm.init('edit', id)
+      },
+      // 查看
+      view (id) {
+        this.$refs.typeForm.init('view', id)
+      },
+      // 获取数据列表
+      refreshList () {
+        this.loading = true
+        this.knowledgeShareTypeService.list({
+          'current': this.tablePage.currentPage,
+          'size': this.tablePage.pageSize,
+          'orders': this.tablePage.orders,
+          ...this.searchForm
+        }).then(({data}) => {
+          this.dataList = data.records
+          this.tablePage.total = data.total
+          this.loading = false
+        })
+      },
+      // 删除
+      del (id) {
+        let ids = id || this.$refs.typeTable.getCheckboxRecords().map(item => {
+          return item.id
+        }).join(',')
+        this.$confirm(`确定删除所选项吗?`, '提示', {
+          confirmButtonText: '确定',
+          cancelButtonText: '取消',
+          type: 'warning'
+        }).then(() => {
+          this.loading = true
+          this.knowledgeShareTypeService.remove(ids).then(({data}) => {
+            this.$message.success(data)
+            this.refreshList()
+            this.loading = false
+          })
+        })
+      },
+      resetSearch () {
+        this.$refs.searchForm.resetFields()
+        this.refreshList()
+      },
+      // 当前页
+      currentChangeHandle ({ currentPage, pageSize }) {
+        this.tablePage.currentPage = currentPage
+        this.tablePage.pageSize = pageSize
+        this.refreshList()
+      }
+    }
+  }
+</script>

+ 17 - 0
src/views/modules/reimbursement/info/InfoList.vue

@@ -139,6 +139,17 @@
           </vxe-column>
         </vxe-table>
 
+        <vxe-pager
+          background
+          size="small"
+          :current-page="tablePage.currentPage"
+          :page-size="tablePage.pageSize"
+          :total="tablePage.total"
+          :page-sizes="[10, 20, 100, 1000, {label: '全量数据', value: 1000000}]"
+          :layouts="['PrevPage', 'JumpNumber', 'NextPage', 'FullJump', 'Sizes', 'Total']"
+          @page-change="currentChangeHandle">
+        </vxe-pager>
+
         <ProgramPageForm ref="programPageForm" @getProgram="getProgram"></ProgramPageForm>
         <InfoForm ref="infoForm" @refreshDataList="refreshList"></InfoForm>
         <ProjectForm ref="projectForm" @refreshDataList="refreshList"></ProjectForm>
@@ -410,6 +421,12 @@
             console.log(err.response)
           }
         })
+      },
+      // 当前页
+      currentChangeHandle ({ currentPage, pageSize }) {
+        this.tablePage.currentPage = currentPage
+        this.tablePage.pageSize = pageSize
+        this.refreshList()
       }
     }
   }