|
@@ -7,12 +7,12 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="tabBoxContent">
|
|
|
- <div v-if="index==0||(index==1&&number1Bas!=0)||(index==2&&number2Bas!=0)" v-for="(item, index) in tapArr" :key="index" @click="changeAction(index)">
|
|
|
- <span>{{index==0?categoryName:item}}({{index==0?number0:index==1?number1:number2}})</span>
|
|
|
+ <div v-for="(item, index) in dataDetail.routes" :key="index" @click="changeAction(index)">
|
|
|
+ <span>{{item.name}}{{ item.state==0?'(未完成)':'(已完成)' }}</span>
|
|
|
<img v-if="tapAction==index" src="../../../../image/tabAction.png"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="searchBoxContent" v-show="(tapAction==0)">
|
|
|
+ <div class="searchBoxContent">
|
|
|
<div class="noDataBox" v-if="dataList.length==0">
|
|
|
<img src="../../../../image/noDataNew.png" class="noData"/>
|
|
|
<p class="noDataText">暂无搜索结果</p>
|
|
@@ -24,53 +24,20 @@
|
|
|
<a-divider class="bottomBorder" v-if="(index!=dataList.length-1)"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <pageBar ref="pageBarref0" @pageChange="pageChange0" :total="total" :pageSize="pageSize" class="pageBar"></pageBar>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="searchBoxContent" v-show="(tapAction==1)">
|
|
|
- <div class="noDataBox" v-if="dataList1.length==0">
|
|
|
- <img src="../../../../image/noDataNew.png" class="noData"/>
|
|
|
- <p class="noDataText">暂无搜索结果</p>
|
|
|
- </div>
|
|
|
- <div v-else class="DataBoxContent">
|
|
|
- <div class="listBox">
|
|
|
- <div class="listBoxItemContent listItemClass" v-for="(item, index) in dataList1" :key="index">
|
|
|
- <pageList :item="item" type="list1" :approval="true" @delRefresh="delRefresh"></pageList>
|
|
|
- <a-divider class="bottomBorder" v-if="(index!=dataList1.length-1)"/>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <pageBar ref="pageBarref1" @pageChange="pageChange1" :total="total" :pageSize="pageSize" class="pageBar"></pageBar>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="searchBoxContent" v-show="(tapAction==2)">
|
|
|
- <div class="noDataBox" v-if="dataList2.length==0">
|
|
|
- <img src="../../../../image/noDataNew.png" class="noData"/>
|
|
|
- <p class="noDataText">暂无搜索结果</p>
|
|
|
- </div>
|
|
|
- <div v-else class="DataBoxContent">
|
|
|
- <div class="listBox">
|
|
|
- <div class="listBoxItemContent listItemClass" v-for="(item, index) in dataList2" :key="index">
|
|
|
- <pageList :item="item" type="list1"></pageList>
|
|
|
- <a-divider class="bottomBorder" v-if="(index!=dataList2.length-1)"/>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <pageBar ref="pageBarref2" @pageChange="pageChange2" :total="total" :pageSize="pageSize" class="pageBar"></pageBar>
|
|
|
+ <pageBar ref="pageBarref" @pageChange="pageChange" :total="total" :pageSize="pageSize" class="pageBar"></pageBar>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import contentData from '@/api/knowledge/contentData'
|
|
|
-import api from '@/api/knowledge/warehouseIndex'
|
|
|
-import search from '../components/search'
|
|
|
import pageBar from '../components/pageBar'
|
|
|
import pageList from '../components/pageListMap'
|
|
|
import {mapState} from "vuex";
|
|
|
+import map from '@/api/knowledge/map'
|
|
|
export default {
|
|
|
name: 'contentData',
|
|
|
components: {
|
|
|
- search,
|
|
|
pageBar,
|
|
|
pageList
|
|
|
},
|
|
@@ -81,315 +48,38 @@ export default {
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- dataDetail:{
|
|
|
- "pkId": "1607226213988474881",
|
|
|
- "title": "新人地图-销售岗位",
|
|
|
- "contentTotal": 99,
|
|
|
- "routes": [
|
|
|
- {
|
|
|
- "name": "第一天",
|
|
|
- "state": "0",
|
|
|
- "contents": [
|
|
|
- {
|
|
|
- "pkId": "1607226213988474883",
|
|
|
- "type": "1",
|
|
|
- "state": "0",
|
|
|
- "outerSystemName": "OA系统",
|
|
|
- "outerContentName": "新员工上邮箱开通",
|
|
|
- "outerAccessUrl": "http://portal.hkcqjy.com.cn:8080/oa/login"
|
|
|
- }
|
|
|
- ]
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- searchData:{
|
|
|
- range:0,
|
|
|
- keyword:''
|
|
|
- },
|
|
|
- categoryId:'',
|
|
|
- defaultCascader:[],
|
|
|
- categoryValue:[],
|
|
|
- categoryDataArr:[],
|
|
|
+ dataDetail:{},
|
|
|
+ tapArr:['','我的审批','我的上传'],
|
|
|
+ tapAction:0,
|
|
|
categoryName:'请选择分类',
|
|
|
- userData:this.user,
|
|
|
pageNum:1,
|
|
|
- pageNum0:1,
|
|
|
- pageNum1:1,
|
|
|
- pageNum2:1,
|
|
|
- total:2,
|
|
|
+ total:10,
|
|
|
pageSize:10,
|
|
|
- tapArr:['','我的审批','我的上传'],
|
|
|
- number0:0,
|
|
|
- number1:0,
|
|
|
- number2:0,
|
|
|
- number1Bas:0,
|
|
|
- number2Bas:0,
|
|
|
- myuploadNum:0,
|
|
|
- tapAction:0,
|
|
|
dataList:[
|
|
|
],
|
|
|
- dataList1:[
|
|
|
- ],
|
|
|
- dataList2:[
|
|
|
- ],
|
|
|
- options: [],
|
|
|
- type:null,
|
|
|
- typeName:["最新知识","最热知识","文档排行","工作成果","经典案例","维基排行"]
|
|
|
+ detailPkId:''
|
|
|
}
|
|
|
},
|
|
|
- created() {
|
|
|
- if(this.$route.query.type!=undefined){
|
|
|
- this.type=this.$route.query.type
|
|
|
- this.categoryName=this.typeName[this.type]
|
|
|
- }
|
|
|
- if(this.$route.query.categoryId!=undefined){
|
|
|
- this.categoryId=this.$route.query.categoryId
|
|
|
- if(this.$route.query.parentp!=undefined){
|
|
|
- this.defaultCascader=[this.$route.query.parentp,this.$route.query.parent,this.$route.query.categoryId]
|
|
|
- }else if(this.$route.query.parent!=0){
|
|
|
- this.defaultCascader=[this.$route.query.parent,this.$route.query.categoryId]
|
|
|
- }else{
|
|
|
- this.defaultCascader.push(this.$route.query.categoryId)
|
|
|
- }
|
|
|
- console.log(this.defaultCascader)
|
|
|
- this.categoryName=this.$route.query.categoryName
|
|
|
- }
|
|
|
- this.getBaseData()
|
|
|
- this.getData(false)
|
|
|
- },
|
|
|
- methods: {
|
|
|
- //搜索返回
|
|
|
- searchResult(data){
|
|
|
- this.searchData=data
|
|
|
- this.getData(true)
|
|
|
- },
|
|
|
- popupVisibleChange(value){
|
|
|
- if(value==false){
|
|
|
- //if(this.type!=0&&this.type!=1&&this.type!=2&&this.type!=5){
|
|
|
- this.categoryName = this.categoryDataArr[this.categoryDataArr.length-1]['label']
|
|
|
- this.type = null
|
|
|
- //}
|
|
|
- this.getData(true);
|
|
|
- }
|
|
|
- },
|
|
|
- filter(inputValue, path) {
|
|
|
- return path.some(option => option.label.toLowerCase().indexOf(inputValue.toLowerCase()) > -1);
|
|
|
- },
|
|
|
- addData(){
|
|
|
- this.$router.push({
|
|
|
- name: "knowledgeAddUpdate"
|
|
|
- })
|
|
|
- },
|
|
|
- getData(type){
|
|
|
- if(this.tapAction==0||type){
|
|
|
- if(this.type==null){
|
|
|
- let param = {
|
|
|
- "pageNo": this.pageNum,
|
|
|
- "pageSize": 10,
|
|
|
- "sortField": "",
|
|
|
- "sortOrder": "asc",
|
|
|
- params: {
|
|
|
- approvalStatus: 5,
|
|
|
- "categoryId":this.categoryId,
|
|
|
- "keyword":this.searchData.keyword,
|
|
|
- }
|
|
|
- }
|
|
|
- if(this.searchData.range!=0){
|
|
|
- param.params.type=this.searchData.range
|
|
|
- }
|
|
|
- contentData.findAllKnowledge(param).then((res) => {
|
|
|
- res.result.data.forEach(element => {
|
|
|
- element.documentName = element.attachmentName
|
|
|
- element.documentRemark = element.summary
|
|
|
+ mounted() {
|
|
|
+ let that = this
|
|
|
+ this.detailPkId = this.$route.query.pkId
|
|
|
+ let getData={'pkId':this.detailPkId}
|
|
|
+ map.info(getData).then((res) => {
|
|
|
+ if(res.code == 200) {
|
|
|
+ this.dataDetail = res.data
|
|
|
+ this.dataDetail.routes[0].contents.forEach(element => {
|
|
|
+ if(element.type==2){
|
|
|
element.viewNum = element.views
|
|
|
element.uploadTime = element.createTime
|
|
|
- element.categoryArr = []
|
|
|
+ element.categoryArr = element.category.split(' ')
|
|
|
this.getType(element)
|
|
|
- this.getCategory(element.categoryArr,element.knowledgeCategoryAdminVo)
|
|
|
- });
|
|
|
- this.number0 = res.result.totalCount
|
|
|
- this.dataList = res.result.data
|
|
|
- this.$nextTick(()=>{
|
|
|
- this.$refs.pageBarref0.setTotal(Number(res.result.totalCount))
|
|
|
- })
|
|
|
- })
|
|
|
- }else{
|
|
|
- if(this.type==0||this.type==1||this.type==2||this.type==5){
|
|
|
- let paramOne = {
|
|
|
- pageNo: this.pageNum,
|
|
|
- pageSize: 10,
|
|
|
- sortField: 'CREATE_TIME_',
|
|
|
- sortOrder: 'desc',
|
|
|
- params: {
|
|
|
- approvalStatus: 5,
|
|
|
- "categoryId":this.categoryId,
|
|
|
- "keyword":this.searchData.keyword,
|
|
|
- }
|
|
|
- }
|
|
|
- if(this.searchData.range!=0){
|
|
|
- paramOne.params.type=this.searchData.range
|
|
|
- }
|
|
|
- if(this.type==1){
|
|
|
- paramOne.sortField='views'
|
|
|
- }
|
|
|
- if(this.type==2){
|
|
|
- paramOne.sortField='views'
|
|
|
- paramOne.type=1
|
|
|
- }
|
|
|
- if(this.type==5){
|
|
|
- paramOne.sortField='views'
|
|
|
- paramOne.type=2
|
|
|
- }
|
|
|
- contentData.findAllKnowledge({...paramOne}).then(res => {
|
|
|
- res.result.data.forEach(element => {
|
|
|
- element.documentName = element.attachmentName
|
|
|
- element.documentRemark = element.summary
|
|
|
- element.viewNum = element.views
|
|
|
- element.uploadTime = element.createTime
|
|
|
- element.categoryArr = []
|
|
|
- this.getType(element)
|
|
|
- this.getCategory(element.categoryArr,element.knowledgeCategoryAdminVo)
|
|
|
- });
|
|
|
- this.number0 = res.result.totalCount
|
|
|
- this.dataList = res.result.data
|
|
|
- this.$nextTick(()=>{
|
|
|
- this.$refs.pageBarref0.setTotal(Number(res.result.totalCount))
|
|
|
- })
|
|
|
- })
|
|
|
- }else{
|
|
|
- let paramTwo = {
|
|
|
- pageNo: this.pageNum,
|
|
|
- pageSize: 10,
|
|
|
- sortField: 'views',
|
|
|
- sortOrder: 'desc',
|
|
|
- params: {
|
|
|
- "keyword":this.searchData.keyword,
|
|
|
- }
|
|
|
- }
|
|
|
- if(this.searchData.range!=0){
|
|
|
- paramOne.params.type=this.searchData.range
|
|
|
- }
|
|
|
- if(this.type==3){
|
|
|
- paramTwo.params.keyword='working'
|
|
|
}
|
|
|
- if(this.type==4){
|
|
|
- paramTwo.params.keyword='experience'
|
|
|
- }
|
|
|
- api.getAllKnowledgeByCategoryId(paramTwo).then(res => {
|
|
|
- res.result.data.forEach(element => {
|
|
|
- element.documentName = element.attachmentName
|
|
|
- element.documentRemark = element.summary
|
|
|
- element.viewNum = element.views
|
|
|
- element.uploadTime = element.createTime
|
|
|
- element.categoryArr = []
|
|
|
- this.getType(element)
|
|
|
- this.getCategory(element.categoryArr,element.knowledgeCategoryAdminVo)
|
|
|
- });
|
|
|
- this.number0 = res.result.totalCount
|
|
|
- this.dataList = res.result.data
|
|
|
- this.$nextTick(()=>{
|
|
|
- this.$refs.pageBarref0.setTotal(Number(res.result.totalCount))
|
|
|
- })
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- if(this.tapAction==1||type){
|
|
|
- let param = {
|
|
|
- "pageNo": this.pageNum,
|
|
|
- "pageSize": 10,
|
|
|
- "sortField": "APPROVAL_STATUS",
|
|
|
- "sortOrder": "asc",
|
|
|
- params: {
|
|
|
- "createBy":this.user.userId,
|
|
|
- "keyword":this.searchData.keyword,
|
|
|
- "isNotAudit":5
|
|
|
- }
|
|
|
- }
|
|
|
- if(this.searchData.range!=0){
|
|
|
- param.params.type=this.searchData.range
|
|
|
- }
|
|
|
- contentData.findAllKnowledge(param).then((res) => {
|
|
|
- res.result.data.forEach(element => {
|
|
|
- element.documentName = element.attachmentName
|
|
|
- element.documentRemark = element.summary
|
|
|
- element.viewNum = element.views
|
|
|
- element.uploadTime = element.createTime
|
|
|
- element.categoryArr = []
|
|
|
- this.getType(element)
|
|
|
- this.getCategory(element.categoryArr,element.knowledgeCategoryAdminVo)
|
|
|
});
|
|
|
- this.number1 = res.result.totalCount
|
|
|
- this.dataList1 = res.result.data
|
|
|
- this.$nextTick(()=>{
|
|
|
- this.$refs.pageBarref1.setTotal(Number(res.result.totalCount))
|
|
|
- })
|
|
|
- })
|
|
|
- }
|
|
|
- if(this.tapAction==2||type){
|
|
|
- let param0 = {
|
|
|
- "pageNo": this.pageNum,
|
|
|
- "pageSize": 10,
|
|
|
- "sortField": "CREATE_TIME_",
|
|
|
- "sortOrder": "desc",
|
|
|
- params: {
|
|
|
- "approvalStatus":5,
|
|
|
- "createBy":this.user.userId,
|
|
|
- "keyword":this.searchData.keyword
|
|
|
- }
|
|
|
- }
|
|
|
- if(this.searchData.range!=0){
|
|
|
- param0.params.type=this.searchData.range
|
|
|
- }
|
|
|
- contentData.findAllKnowledge(param0).then((res) => {
|
|
|
- res.result.data.forEach(element => {
|
|
|
- element.documentName = element.attachmentName
|
|
|
- element.documentRemark = element.summary
|
|
|
- element.viewNum = element.views
|
|
|
- element.uploadTime = element.createTime
|
|
|
- element.categoryArr = []
|
|
|
- this.getType(element)
|
|
|
- this.getCategory(element.categoryArr,element.knowledgeCategoryAdminVo)
|
|
|
- });
|
|
|
- this.number2 = res.result.totalCount
|
|
|
- this.dataList2 = res.result.data
|
|
|
- this.$nextTick(()=>{
|
|
|
- this.$refs.pageBarref2.setTotal(Number(res.result.totalCount))
|
|
|
- })
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
- delRefresh(){
|
|
|
- console.log(this.pageNum)
|
|
|
- let param = {
|
|
|
- "pageNo": this.pageNum,
|
|
|
- "pageSize": 10,
|
|
|
- "sortField": "APPROVAL_STATUS",
|
|
|
- "sortOrder": "asc",
|
|
|
- params: {
|
|
|
- "createBy":this.user.userId,
|
|
|
- "keyword":this.searchData.keyword,
|
|
|
- "isNotAudit":5
|
|
|
+ this.changeAction(0)
|
|
|
}
|
|
|
- }
|
|
|
- contentData.findAllKnowledge(param).then((res) => {
|
|
|
- res.result.data.forEach(element => {
|
|
|
- element.documentName = element.attachmentName
|
|
|
- element.documentRemark = element.summary
|
|
|
- element.viewNum = element.views
|
|
|
- element.uploadTime = element.createTime
|
|
|
- element.categoryArr = []
|
|
|
- this.getType(element)
|
|
|
- this.getCategory(element.categoryArr,element.knowledgeCategoryAdminVo)
|
|
|
- });
|
|
|
- this.number1 = res.result.totalCount
|
|
|
- this.number1Bas = res.result.totalCount
|
|
|
- this.dataList1 = res.result.data
|
|
|
- this.$nextTick(()=>{
|
|
|
- this.$refs.pageBarref1.setTotal(Number(res.result.totalCount))
|
|
|
- })
|
|
|
})
|
|
|
- },
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
categoryData(data){
|
|
|
data.forEach(element => {
|
|
|
element.label=element.name
|
|
@@ -399,62 +89,12 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- getBaseData(){
|
|
|
- contentData.getAllKnowledgeCategory().then((res) =>{
|
|
|
- this.categoryData(res.data)
|
|
|
- console.log(res.data)
|
|
|
- let allposition={
|
|
|
- children: [],
|
|
|
- isSys: 0,
|
|
|
- label: "全部分类",
|
|
|
- level: 1,
|
|
|
- name: "全部分类",
|
|
|
- operatorName: null,
|
|
|
- parent: "0",
|
|
|
- parents: null,
|
|
|
- pkId: "",
|
|
|
- sort: 2,
|
|
|
- updateBy: "1",
|
|
|
- updateTime: "2022-12-27 17:00:30",
|
|
|
- value: ""
|
|
|
- }
|
|
|
- res.data.unshift(allposition)
|
|
|
- this.options=res.data
|
|
|
- })
|
|
|
- this.delRefresh()
|
|
|
- let param1 = {
|
|
|
- "pageNo": 1,
|
|
|
- "pageSize": 10,
|
|
|
- "sortField": "CREATE_TIME_",
|
|
|
- "sortOrder": "desc",
|
|
|
- params: {
|
|
|
- "approvalStatus":5,
|
|
|
- "createBy":this.user.userId
|
|
|
- }
|
|
|
- }
|
|
|
- contentData.findAllKnowledge(param1).then((res) => {
|
|
|
- res.result.data.forEach(element => {
|
|
|
- element.documentName = element.attachmentName
|
|
|
- element.documentRemark = element.summary
|
|
|
- element.viewNum = element.views
|
|
|
- element.uploadTime = element.createTime
|
|
|
- element.categoryArr = []
|
|
|
- this.getType(element)
|
|
|
- this.getCategory(element.categoryArr,element.knowledgeCategoryAdminVo)
|
|
|
- });
|
|
|
- this.number2 = res.result.totalCount
|
|
|
- this.number2Bas = res.result.totalCount
|
|
|
- this.myuploadNum = res.result.totalCount
|
|
|
- this.dataList2 = res.result.data
|
|
|
- this.$nextTick(()=>{
|
|
|
- this.$refs.pageBarref2.setTotal(Number(res.result.totalCount))
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
getType(item){
|
|
|
- item.documentType = 5
|
|
|
- if(item.documentName!=null){
|
|
|
- let typeName = item.documentName.split('.')[(item.documentName.split('.').length-1)]
|
|
|
+ item.documentType = 5
|
|
|
+ let typeName = item.attachmentType
|
|
|
+ if(typeName==null){
|
|
|
+ return false
|
|
|
+ }
|
|
|
if(typeName.indexOf("pdf")>-1){
|
|
|
item.documentType = 1
|
|
|
}else if(typeName.indexOf("doc")>-1){
|
|
@@ -466,7 +106,6 @@ export default {
|
|
|
}else{
|
|
|
item.documentType = 5
|
|
|
}
|
|
|
- }
|
|
|
},
|
|
|
getCategory(arr,data){
|
|
|
arr.unshift(data.name)
|
|
@@ -474,32 +113,26 @@ export default {
|
|
|
this.getCategory(arr,data.parents)
|
|
|
}
|
|
|
},
|
|
|
- changeAction(num){
|
|
|
- this.tapAction = num
|
|
|
- if(this.tapAction==0){
|
|
|
- this.pageNum = this.pageNum0
|
|
|
- }
|
|
|
- if(this.tapAction==1){
|
|
|
- this.pageNum = this.pageNum1
|
|
|
- }
|
|
|
- if(this.tapAction==2){
|
|
|
- this.pageNum = this.pageNum2
|
|
|
- }
|
|
|
- },
|
|
|
- pageChange0(num){
|
|
|
- this.pageNum = num
|
|
|
- this.pageNum0 = num
|
|
|
- this.getData(false)
|
|
|
- },
|
|
|
- pageChange1(num){
|
|
|
+ pageChange(num){
|
|
|
this.pageNum = num
|
|
|
- this.pageNum1 = num
|
|
|
- this.getData(false)
|
|
|
+ this.dataList = this.dataDetail.routes[this.tapAction].contents.slice((this.pageNum-1)*this.pageSize,this.pageNum*this.pageSize)
|
|
|
},
|
|
|
- pageChange2(num){
|
|
|
- this.pageNum = num
|
|
|
- this.pageNum2 = num
|
|
|
- this.getData(false)
|
|
|
+ changeAction(num){
|
|
|
+ let that = this
|
|
|
+ this.tapAction = num
|
|
|
+ this.dataDetail.routes[this.tapAction].contents.forEach(element => {
|
|
|
+ if(element.type==2){
|
|
|
+ element.viewNum = element.views
|
|
|
+ element.uploadTime = element.createTime
|
|
|
+ element.categoryArr = element.category.split(' ')
|
|
|
+ this.getType(element)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.pageNum = 1
|
|
|
+ this.dataList = this.dataDetail.routes[this.tapAction].contents.slice((this.pageNum-1)*this.pageSize,this.pageNum*this.pageSize)
|
|
|
+ setTimeout(function(){
|
|
|
+ that.$refs.pageBarref.setTotal(that.dataDetail.routes[that.tapAction].contents.length)
|
|
|
+ },200)
|
|
|
}
|
|
|
}
|
|
|
}
|