Merge remote-tracking branch 'origin/yuekuo' into lixuetao

# Conflicts:
#	src/views/Report/ReportList.vue
This commit is contained in:
xuetao.li
2023-04-25 21:21:23 +08:00
4 changed files with 364 additions and 422 deletions
+21 -3
View File
@@ -37,16 +37,26 @@ export default {
// 标签删除|单个 // 标签删除|单个
labelDeleteId (data) { labelDeleteId (data) {
return request({ return request({
url: `api/tree-label/${data.id}`, url: `api/tree-label/delete/${data.id}`,
method: 'POST' method: 'POST'
}) })
}, },
labelUpdate(){ // 标签列表
labelNodeList (id) {
return request({
url: `api/tree-label/labelList/${id}`,
method: 'GET',
params: id
})
},
labelUpdate(data){
return request({ return request({
url: 'api/tree-label/update', url: 'api/tree-label/update',
method: 'POST' method: 'POST',
data
}) })
}, },
// 新增或编辑报告 // 新增或编辑报告
reportAdd (data) { reportAdd (data) {
return request({ return request({
@@ -90,6 +100,14 @@ labelUpdate(){
data data
}) })
}, },
// 报告管理列表
reportListManager (data) {
return request({
url: '/api/report/list-auth',
method: 'POST',
data
})
},
// 获取报告日期列表 // 获取报告日期列表
reportDateList (data) { reportDateList (data) {
return request({ return request({
+74 -134
View File
@@ -8,7 +8,7 @@
<el-col :span="6"> <el-col :span="6">
<div class="tag-item"> <div class="tag-item">
<label class="tag-title">关键词:</label> <label class="tag-title">关键词:</label>
<el-input v-model="q.keyContent" placeholder="请输入报告名称"></el-input> <el-input v-model="q.keyContent" placeholder="请输入关键词"></el-input>
</div> </div>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
@@ -96,30 +96,26 @@
</el-row> </el-row>
</div> </div>
<el-row class="tag-btn">
<el-button @click="permissionApp">权限申请</el-button>
</el-row>
<div class="table"> <div class="table">
<el-row> <el-row>
<el-col :span="4" class="treeList"> <el-col :span="4" class="treeList">
<el-input placeholder="输入关键字进行过滤" v-model="filterText"> <el-input placeholder="输入关键字进行过滤" v-model="filterText">
</el-input> </el-input>
<el-tree <el-tree
class="filter-tree" class="filter-tree"
:data="treeData" :data="treeData"
show-checkbox show-checkbox
node-key="id" node-key="id"
default-expand-all default-expand-all
:filter-node-method="filterNode" :filter-node-method="filterNode"
ref="tree" ref="tree"
> @check="getHalfCheckedNode"
</el-tree> >
</el-col> </el-tree>
<el-col :span="19"> </el-col>
<vxe-table ref="xTable" :data="tableData" :empty-render="{name: 'NotData'}" align="center" border stripe v-table-min-height="'calc(100vh - 420px)'" <el-col :span="19">
@checkbox-all="selectAllEvent" @checkbox-change="selectChangeEvent"> <vxe-table :data="tableData" :empty-render="{name: 'NotData'}" align="center" border stripe v-table-min-height="'calc(100vh - 420px)'">
<vxe-column type="checkbox" width="60"></vxe-column> <vxe-column show-overflow show-header-overflow type="seq" title="序号" width="77">
<vxe-column show-overflow show-header-overflow type="seq" title="序号" width="77">
<template #default="{ row, rowIndex }"> <template #default="{ row, rowIndex }">
{{ rowIndex + (q.pageNo - 1) * q.pageSize + 1 }} {{ rowIndex + (q.pageNo - 1) * q.pageSize + 1 }}
</template> </template>
@@ -141,9 +137,9 @@
<div class="tag-info"> <div class="tag-info">
<span class="icon-tag-item"><img src="@/assets/imgs/icon-time.png" <span class="icon-tag-item"><img src="@/assets/imgs/icon-time.png"
alt=""><span>{{row.year}}</span></span> alt=""><span>{{row.year}}</span></span>
<!-- <span class="icon-tag-item"><img src="@/assets/imgs/icon-tag01.png" <span class="icon-tag-item"><img src="@/assets/imgs/icon-tag01.png"
alt=""><span>{{row.labelOneName}}</span></span> alt=""><span class="keyContent">{{getKeyContent(row.keyContent)}}</span></span>
<span class="icon-tag-item"><img src="@/assets/imgs/icon-tag02.png" <!-- <span class="icon-tag-item"><img src="@/assets/imgs/icon-tag02.png"
alt=""><span>{{row.labelTwoName}}</span></span> alt=""><span>{{row.labelTwoName}}</span></span>
<span class="icon-tag-item"><img src="@/assets/imgs/icon-tag03.png" <span class="icon-tag-item"><img src="@/assets/imgs/icon-tag03.png"
alt=""><span>{{row.labelThreeName}}</span></span> --> alt=""><span>{{row.labelThreeName}}</span></span> -->
@@ -155,8 +151,8 @@
</vxe-column> </vxe-column>
<vxe-column show-overflow show-header-overflow title="操作" width="200" fixed="right"> <vxe-column show-overflow show-header-overflow title="操作" width="200" fixed="right">
<template #default="{ row }"> <template #default="{ row }">
<el-button type="text" v-if="row.power == 1" @click="previewRow(row)">预览</el-button> <el-button type="text" @click="previewRow(row)">预览</el-button>
<el-button type="text" v-if="row.power == 2" @click="downloadRow(row)">下载</el-button> <!-- <el-button type="text" @click="downloadRow(row)">下载</el-button>-->
</template> </template>
</vxe-column> </vxe-column>
@@ -171,7 +167,6 @@
:total="total"/> :total="total"/>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<!--预览--> <!--预览-->
@@ -209,12 +204,10 @@ export default {
q: { q: {
keyContent: '', keyContent: '',
year: [], year: [],
labelOneId: [], name:'',
labelTwoId: [],
labelThreeId: [],
pageNo: 1, pageNo: 1,
pageSize: 10 pageSize: 10,
}, },
total: 0, total: 0,
tableData: [], tableData: [],
yearList: [], yearList: [],
@@ -245,64 +238,8 @@ export default {
content: '', content: '',
filterText:'', filterText:'',
treeData: [ treeData: [
{
id: 0,
label: '根节点',
children: [
{
id: 1,
label: '一级 1',
children: [
{
id: 4,
label: '二级 1-1',
children: [
{
id: 9,
label: '三级 1-1-1'
},
{
id: 10,
label: '三级 1-1-2'
}
]
}
]
},
{
id: 2,
label: '一级 2',
children: [
{
id: 5,
label: '二级 2-1'
},
{
id: 6,
label: '二级 2-2'
}
]
},
{
id: 3,
label: '一级 3',
children: [
{
id: 7,
label: '二级 3-1'
},
{
id: 8,
label: '二级 3-2'
}
]
},
]
}
], ],
checkIds: [], checkedKeys:[]
checkList: []
} }
}, },
watch: { watch: {
@@ -311,50 +248,39 @@ export default {
} }
}, },
methods: { methods: {
getKeyContent(list){
let keyContent=[]
list = JSON.parse(list)
list.forEach(item => {
keyContent.push(item.text)
})
keyContent = keyContent.toString().replace(/,/g, '/');
if(keyContent=='') keyContent='---'
// if(keyContent.length>15){
// keyContent=keyContent.slice(0,15) +'...'
// }
return keyContent
},
getHalfCheckedNode(node,data){
this.checkedKeys=data.checkedKeys
this.reportList()
},
filterNode(value, data) { filterNode(value, data) {
if (!value) return true; if (!value) return true;
return data.label.indexOf(value) !== -1; return data.label.indexOf(value) !== -1;
}, },
selectAllEvent ({ checked }) {
const records = this.$refs.xTable.getCheckboxRecords()
this.checkList= records
this.checkIds = records.map(item => {
return item.id
})
},
selectChangeEvent ({ checked }) {
const records = this.$refs.xTable.getCheckboxRecords()
this.checkList= records
this.checkIds = records.map(item => {
return item.id
})
},
permissionApp () {
if(this.checkList.length <1){
this.$message.warning("至少选择一条报告进行权限申请")
return
}
// 有预览权限的时候是否还让继续申请
let temp=this.checkList.filter(item =>{
if(+item.power == 1 || +item.power == 2){
return item.name
}
})
if(temp.length>0) {
this.$message.warning("当前选择的"+temp.toString()+"已经有权限,无须申请!")
return
}
this.$router.push({
path: '/permission/launch',
query: { id: 'AEHJB8YNJ3', ids: this.checkIds.toString() }
})
},
init () { init () {
this.getTreeLabel()
this.labelList() this.labelList()
this.reportDateList() this.reportDateList()
this.reportList() this.reportList()
}, },
getTreeLabel(){
this.$api.report.labelList().then(res => {
this.treeData=res.data
})
},
// 标签列表 // 标签列表
labelList () { labelList () {
this.$api.report.labelList().then(({ data }) => { this.$api.report.labelList().then(({ data }) => {
@@ -372,7 +298,7 @@ export default {
}, },
// 列表 // 列表
reportList () { reportList () {
this.$api.report.reportList(this.q).then(({ data }) => { this.$api.report.reportList({...this.q,labelId:this.checkedKeys}).then(({ data }) => {
this.tableData = data.records this.tableData = data.records
this.total = data.total this.total = data.total
this.q.pageNo = data.current this.q.pageNo = data.current
@@ -479,6 +405,22 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.keyContent{
display: inline-block;
width: 50px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.treeList{
padding: 20px;
box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);
margin-right: 20px;
.filter-tree{
margin-top: 20px;
}
}
.report-list { .report-list {
.title { .title {
border-bottom: 1px solid #EBEEF5; border-bottom: 1px solid #EBEEF5;
@@ -492,9 +434,7 @@ export default {
color: #262626; color: #262626;
} }
} }
.tag-btn{
padding: 10px 13px;
}
.tag-search { .tag-search {
padding-top: 9px; padding-top: 9px;
@@ -518,11 +458,11 @@ export default {
font-weight: normal; font-weight: normal;
color: #646464; color: #646464;
display: inline-block; display: inline-block;
width: 112px; // width: 112px;
height: 19px; height: 19px;
line-height: 19px; line-height: 19px;
padding-left: 48px; padding-left: 13px;
border-right: 1px solid #BFBFBF; // border-right: 1px solid #BFBFBF;
margin-right: 10px; margin-right: 10px;
margin-top: 2.5px; margin-top: 2.5px;
overflow: hidden; overflow: hidden;
+238 -278
View File
@@ -5,64 +5,73 @@
</div> </div>
<div class="search"> <div class="search">
<el-row> <el-row>
<el-col :span="20"> <el-col :span="6">
<div class="search-box-left"> <div class="tag-item">
<label>搜索:</label> <label class="tag-title">关键词:</label>
<el-input v-model="q.keyContent" placeholder="请输入搜索内容"></el-input> <el-input v-model="q.keyContent" placeholder="请输入关键词"></el-input>
</div>
</el-col>
<el-col :span="6">
<div class="tag-item">
<label class="tag-title">报告年份:</label>
<el-select v-model="q.year" multiple collapse-tags placeholder="请选择报告年份"> <el-select v-model="q.year" multiple collapse-tags placeholder="请选择报告年份">
<template v-for="item in yearList"> <template v-for="item in yearList">
<el-option :label="item" :value="item" :key="item"></el-option> <el-option :label="item" :value="item" :key="item"></el-option>
</template> </template>
</el-select> </el-select>
<el-select v-model="q.labelOneId" multiple collapse-tags
:placeholder="'请选择' + tagsForm.tags01.name">
<template v-for="item in tagsForm.tags01.childList">
<el-option :label="item.name" :value="item.id" :key="item.id"></el-option>
</template>
</el-select>
<el-select v-model="q.labelTwoId" multiple collapse-tags
:placeholder="'请选择' + tagsForm.tags02.name">
<template v-for="item in tagsForm.tags02.childList">
<el-option :label="item.name" :value="item.id" :key="item.id"></el-option>
</template>
</el-select>
<el-select v-model="q.labelThreeId" multiple collapse-tags
:placeholder="'请选择' + tagsForm.tags03.name">
<template v-for="item in tagsForm.tags03.childList">
<el-option :label="item.name" :value="item.id" :key="item.id"></el-option>
</template>
</el-select>
</div> </div>
</el-col> </el-col>
<el-col :span="4" align="right"> <el-col :span="6">
<div class="search-box-right"> <div class="tag-item">
<el-button type="primary" @click="search">查询</el-button> <label class="tag-title">报告名称:</label>
<el-button @click="reset">重置</el-button> <el-input v-model="q.name" placeholder="请输入报告名称"></el-input>
</div> </div>
</el-col> </el-col>
<el-col :span="24">
<el-col :span="6" align="right" class="tag-btns">
<el-button type="primary" @click="search">查询</el-button>
<el-button type="default" @click="reset">重置</el-button>
</el-col>
</el-row>
<el-row >
<div class="operate-box"> <div class="operate-box">
<el-button @click="openLog">操作日志</el-button> <el-button @click="openLog">操作日志</el-button>
<el-button @click="openTags">标签维护</el-button> <el-button @click="openTags">标签维护</el-button>
<el-button @click="openReportAdd">报告上传</el-button> <el-button @click="openReportAdd">报告上传</el-button>
</div> </div>
</el-col>
</el-row> </el-row>
</div> </div>
<div class="table"> <el-row>
<el-col :span="4" class="treeList">
<el-input placeholder="输入关键字进行过滤" v-model="filterText">
</el-input>
<el-tree
class="filter-tree"
:data="treeData"
show-checkbox
node-key="id"
default-expand-all
:filter-node-method="filterNode"
ref="tree"
@check="getHalfCheckedNode"
>
</el-tree>
</el-col>
<el-col :span="19 ">
<div class="table">
<vxe-table ref="xTable" :data="tableData" :empty-render="{name: 'NotData'}" align="center" border stripe v-table-min-height="'calc(100vh - 320px)'"> <vxe-table ref="xTable" :data="tableData" :empty-render="{name: 'NotData'}" align="center" border stripe v-table-min-height="'calc(100vh - 320px)'">
<vxe-column show-overflow show-header-overflow type="seq" title="序号" width="77"> <vxe-column show-overflow show-header-overflow type="seq" title="序号" width="77">
<template #default="{ row, rowIndex }"> <template #default="{ row, rowIndex }">
{{ rowIndex + (q.pageNo - 1) * q.pageSize + 1 }} {{ rowIndex + (q.pageNo - 1) * q.pageSize + 1 }}
</template> </template>
</vxe-column> </vxe-column>
<vxe-column show-overflow show-header-overflow field="labelOneName" <!-- <vxe-column show-overflow show-header-overflow field="labelOneName"
:title="tagsForm.tags01.name"></vxe-column> :title="tagsForm.tags01.name"></vxe-column> -->
<vxe-column show-overflow show-header-overflow field="name" title="报告名称"></vxe-column> <vxe-column show-overflow show-header-overflow field="name" title="报告名称"></vxe-column>
<vxe-column show-overflow show-header-overflow field="labelTwoName" <!-- <vxe-column show-overflow show-header-overflow field="labelTwoName"
:title="tagsForm.tags02.name"></vxe-column> :title="tagsForm.tags02.name"></vxe-column>
<vxe-column show-overflow show-header-overflow field="labelThreeName" <vxe-column show-overflow show-header-overflow field="labelThreeName"
:title="tagsForm.tags03.name"></vxe-column> :title="tagsForm.tags03.name"></vxe-column> -->
<vxe-column show-overflow show-header-overflow field="year" title="报告年份"></vxe-column> <vxe-column show-overflow show-header-overflow field="year" title="报告年份"></vxe-column>
<vxe-column show-overflow show-header-overflow field="createDate" title="上传时间"></vxe-column> <vxe-column show-overflow show-header-overflow field="createDate" title="上传时间"></vxe-column>
<vxe-column show-overflow show-header-overflow title="操作" width="200" fixed="right"> <vxe-column show-overflow show-header-overflow title="操作" width="200" fixed="right">
@@ -78,6 +87,9 @@
:page-sizes="[5, 10, 20]" :page-size="q.pageSize" layout="total, sizes, prev, pager, next, jumper" :page-sizes="[5, 10, 20]" :page-size="q.pageSize" layout="total, sizes, prev, pager, next, jumper"
:total="total" /> :total="total" />
</div> </div>
</el-col>
</el-row>
<!--操作日志--> <!--操作日志-->
<el-dialog title="操作日志" :visible.sync="dialogLog" width="1100px" :close-on-click-modal="false" <el-dialog title="操作日志" :visible.sync="dialogLog" width="1100px" :close-on-click-modal="false"
:close-on-press-escape="false" modal-append-to-body append-to-body> :close-on-press-escape="false" modal-append-to-body append-to-body>
@@ -152,7 +164,7 @@
</el-tree> </el-tree>
</div> </div>
</el-dialog> </el-dialog>
<labelModalVue ref="labelModalVue"></labelModalVue> <labelModalVue ref="labelModalVue" @updateList="updateList"></labelModalVue>
<!--报告上传--> <!--报告上传-->
<el-dialog :title="mode === 'modify' ? '报告编辑' : '报告上传'" :visible.sync="dialogReport" width="750px" <el-dialog :title="mode === 'modify' ? '报告编辑' : '报告上传'" :visible.sync="dialogReport" width="750px"
:close-on-click-modal="false" :close-on-press-escape="false" modal-append-to-body append-to-body> :close-on-click-modal="false" :close-on-press-escape="false" modal-append-to-body append-to-body>
@@ -162,8 +174,22 @@
<el-input v-model="reportF.name" placeholder="请填写" maxlength="100" show-word-limit></el-input> <el-input v-model="reportF.name" placeholder="请填写" maxlength="100" show-word-limit></el-input>
</el-form-item> </el-form-item>
<el-form-item label="关键词:"> <el-form-item label="关键词:">
<vue-tags-input placeholder="请输入关键词" v-model="reportF.keyContent" :tags="tags" <vue-tags-input placeholder="请输入关键词" v-model="reportF.tags" :tags="tags"
@tags-changed="newTags => tags = newTags" /> @tags-changed=" newTags =>{
if(newTags[newTags.length - 1].text.length < 20){
if(tags.length < 10){
tags = newTags
}else{
this.$message({type:'error',message:'关键词数量不能超过10个'})
tags = newTags.slice(0,-1)
}
}
else{
this.$message({type:'error',message:'单个关键词不能超过20个字'})
tags = newTags.slice(0,-1)
}
}" />
</el-form-item> </el-form-item>
<el-form-item label="内容摘要:"> <el-form-item label="内容摘要:">
<el-input v-model="reportF.mainContent" placeholder="请填写" type="textarea" maxlength="500" <el-input v-model="reportF.mainContent" placeholder="请填写" type="textarea" maxlength="500"
@@ -173,14 +199,14 @@
<el-input v-model="reportF.department" placeholder="请填写" maxlength="100" show-word-limit></el-input> <el-input v-model="reportF.department" placeholder="请填写" maxlength="100" show-word-limit></el-input>
</el-form-item> </el-form-item>
<el-form-item label="报告涉密等级:"> <el-form-item label="报告涉密等级:">
<el-select v-model="reportF.secretLevel" placeholder="请选择报告涉密等级"> <el-select v-model="reportF.confidentialLevel" placeholder="请选择报告涉密等级">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> <el-option v-for="item in confidentialLevelOptions" :key="item.value" :label="item.label" :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="报告隐私等级:"> <el-form-item label="报告隐私等级:">
<el-select v-model="reportF.privacyLevel" placeholder="请选择报告隐私等级"> <el-select v-model="reportF.privacyLevel" placeholder="请选择报告隐私等级">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"> <el-option v-for="item in privacyLevelOptions" :key="item.value" :label="item.label" :value="item.value">
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@@ -205,7 +231,7 @@
prefix-icon="null" :picker-options="pickerOptions" /> prefix-icon="null" :picker-options="pickerOptions" />
</el-form-item> </el-form-item>
<el-form-item label="标签:" required> <el-form-item label="标签:" required>
<el-cascader width="100%" v-model="reportF.label" :options="cascaderOptions" filterable <el-cascader width="100%" v-model="reportF.labelList" :options="cascaderOptions" filterable
:props="{ checkStrictly: true }" clearable> :props="{ checkStrictly: true }" clearable>
</el-cascader> </el-cascader>
</el-form-item> </el-form-item>
@@ -279,66 +305,39 @@ export default {
dialogTags: false, // 标签维护 dialogTags: false, // 标签维护
filterText: '', filterText: '',
treeData: [ treeData: [
{
id: 0,
label: '根节点',
children: [
{
id: 1,
label: '一级 1',
children: [
{
id: 4,
label: '二级 1-1',
children: [
{
id: 9,
label: '三级 1-1-1'
},
{
id: 10,
label: '三级 1-1-2'
}
]
}
]
},
{
id: 2,
label: '一级 2',
children: [
{
id: 5,
label: '二级 2-1'
},
{
id: 6,
label: '二级 2-2'
}
]
},
{
id: 3,
label: '一级 3',
children: [
{
id: 7,
label: '二级 3-1'
},
{
id: 8,
label: '二级 3-2'
}
]
},
]
}
], ],
options:[ filterText:'',
checkedKeys:[],
privacyLevelOptions:[
{ {
value:'1', value:'外部公开',
label:'1' label:'外部公开'
},
{
value:'普通商密',
label:'普通商密'
},
{
value:'核心商密',
label:'核心商密'
},
{
value:'内部公开',
label:'内部公开'
},
{
value:'用户信息',
label:'用户信息'
},
{
value:'敏感信息',
label:'敏感信息'
},
],
confidentialLevelOptions:[
{
value:'一般隐私',
label:'一般隐私'
} }
], ],
tagsForm: { tagsForm: {
@@ -390,41 +389,14 @@ export default {
tag: [] tag: []
}, },
tag: '', tag: '',
tags: [], tags: [''],
labelOne: {}, labelOne: {},
labelTwo: {}, labelTwo: {},
labelThree: {}, labelThree: {},
mode: '', mode: '',
userList: [], userList: [],
cascaderOptions: [{ cascaderOptions: [
value: 1, ],
label: '东南',
children: [{
value: 2,
label: '上海',
children: [
{ value: 3, label: '普陀' },
{ value: 4, label: '黄埔' },
{ value: 5, label: '徐汇' }
]
}, {
value: 7,
label: '江苏',
children: [
{ value: 8, label: '南京' },
{ value: 9, label: '苏州' },
{ value: 10, label: '无锡' }
]
}, {
value: 12,
label: '浙江',
children: [
{ value: 13, label: '杭州' },
{ value: 14, label: '宁波' },
{ value: 15, label: '嘉兴' }
]
}]
}],
pickerOptions: { pickerOptions: {
disabledDate(time) { disabledDate(time) {
return time.getFullYear() > new Date().getFullYear() + 1 || time.getFullYear() < new Date().getFullYear() - 10; return time.getFullYear() > new Date().getFullYear() + 1 || time.getFullYear() < new Date().getFullYear() - 10;
@@ -434,9 +406,7 @@ export default {
q: { q: {
keyContent: '', keyContent: '',
year: [], year: [],
labelOneId: [], name:'',
labelTwoId: [],
labelThreeId: [],
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
}, },
@@ -456,11 +426,7 @@ export default {
this.$refs.tree.filter(val); this.$refs.tree.filter(val);
} }
}, },
mounted () {
this.$bus.$on('updateList',()=>{
this.getTreeLabel()
})
},
methods: { methods: {
init() { init() {
this.getTreeLabel() this.getTreeLabel()
@@ -469,10 +435,21 @@ export default {
this.reportDateList(); this.reportDateList();
this.sysUserList(); this.sysUserList();
}, },
getHalfCheckedNode(node,data){
this.checkedKeys=data.checkedKeys
this.reportList()
},
updateList(){
this.$api.report.labelList().then(res => {
this.treeData=res.data
this.cascaderOptions=res.data
})
this.$forceUpdate()
},
getTreeLabel(){ getTreeLabel(){
this.$api.report.labelList().then(res => { this.$api.report.labelList().then(res => {
console.log('5555',res);
this.treeData=res.data this.treeData=res.data
this.cascaderOptions=res.data
}) })
}, },
//标签搜索 //标签搜索
@@ -493,11 +470,20 @@ export default {
type: 'warning' type: 'warning'
}) })
.then(_ => { .then(_ => {
this.$api.report.labelDeleteId(data).then(res=>{
if(res.ok){
this.$message({
type:'success',
message:'删除成功'
})
this.getTreeLabel()
}
})
done(); done();
}) })
.catch(_ => { }); .catch(_ => { });
}, },
/* 权限全选 */ /* 权限全选 */
selectAll() { selectAll() {
this.reportF.reportUserIdList = []; this.reportF.reportUserIdList = [];
@@ -721,107 +707,31 @@ export default {
this.labelList(); this.labelList();
}) })
}, },
// 标签列表
labelList() {
// this.$api.report.labelList().then(({data}) => {
// if(!data.labelOne.childList.length){
// data.labelOne.childList = [{name: '', id: '', parentId: this.tagsForm.tags01.id, type: '1'}]
// }
// if(!data.labelTwo.childList.length){
// data.labelTwo.childList = [{name: '', id: '', parentId: this.tagsForm.tags02.id, type: '2'}]
// }
// if(!data.labelThree.childList.length){
// data.labelThree.childList = [{name: '', id: '', parentId: this.tagsForm.tags03.id, type: '3'}]
// }
// this.tagsForm.tags01 = data.labelOne;
// this.tagsForm.tags02 = data.labelTwo;
// this.tagsForm.tags03 = data.labelThree;
// })
},
handleTagsClose() { handleTagsClose() {
this.dialogTags = false; this.dialogTags = false;
this.labelList(); this.labelList();
this.reset(); this.reset();
}, },
// 保存标签
// saveTags() {
// let tagsForm = JSON.parse(JSON.stringify(this.tagsForm));
// let params = {
// labelList: [
// tagsForm.tags01,
// tagsForm.tags02,
// tagsForm.tags03
// ]
// }
// let isSave = true;
// params.labelList.forEach(item => {
// if(!item.name || item.name === '-'){
// isSave = false;
// return
// }
// item.childList.forEach(ele => {
// if(!ele.name || item.name === '-'){
// isSave = false;
// return
// }
// })
// })
// if(!isSave){
// return this.$message.warning('标签名称不能为空');
// }
// this.$api.report.labelSave(params).then(_ => {
// this.$message.success('操作成功');
// this.dialogTags = false;
// this.labelList();
// this.reset();
// })
// },
/* =============================================== 报告上传 =============================================== */ /* =============================================== 报告上传 =============================================== */
// 打开报告上传 // 打开报告上传
openReportAdd() { openReportAdd() {
this.mode = 'add'; this.mode = 'add';
this.reportF = { this.reportF = {
name: '', // 报告名称 name: '', // 报告名称
tags: '', // 关键词 mainContent: '', // 内容摘要
mainContent: '', // 内容摘要 department: '', // 报告所属部门
department: '', // 报告所属部门 fileName: '', // 文件上传
fileName: '', // 文件上传
fileId: '', fileId: '',
year: '', // 报告年份 year: '', // 报告年份
secretLevel: '', //涉密等级 privacyLevel: undefined, //报告隐私等级
privacyLevel: '', //报告隐私等级 reportUserIdList: [], // 权限
// labelOneId: '', // 标签1 confidentialLevel:undefined, //涉密等级
// labelOneName: '', // 标签1 labelList:[] //标签
// labelTwoId: '', // 标签2
// labelTwoName: '', // 标签2
// labelThreeId: '', // 标签3
// labelThreeName: '', // 标签3
reportUserIdList: [], // 权限
}; };
this.tags = [] this.tags = [] // 关键词
// this.labelOne = {};
// this.labelTwo = {};
// this.labelThree = {};
// this.labelList();
this.dialogReport = true; this.dialogReport = true;
}, },
// 选择标签
// handleSelectTag(val, type) {
// switch (type) {
// case 1:
// this.reportF.labelOneId = val.id;
// this.reportF.labelOneName = val.name;
// break;
// case 2:
// this.reportF.labelTwoId = val.id;
// this.reportF.labelTwoName = val.name;
// break;
// case 3:
// this.reportF.labelThreeId = val.id;
// this.reportF.labelThreeName = val.name;
// break;
// }
// },
// 必填项 // 必填项
checkReportF() { checkReportF() {
if (!this.reportF.name) { if (!this.reportF.name) {
@@ -833,8 +743,8 @@ export default {
if (!this.reportF.year) { if (!this.reportF.year) {
return this.$message.warning('请检查报告年份') && false; return this.$message.warning('请检查报告年份') && false;
} }
if (!this.reportF.label) { if (!this.reportF.labelList) {
return this.$message.warning('请检查报告年份') && false; return this.$message.warning('请检查标签') && false;
} }
// if (!this.reportF.labelOneId || !this.reportF.labelOneName || this.reportF.labelOneName === '-' ) { // if (!this.reportF.labelOneId || !this.reportF.labelOneName || this.reportF.labelOneName === '-' ) {
// return this.$message.warning(`请检查${this.tagsForm.tags01.name}`) && false; // return this.$message.warning(`请检查${this.tagsForm.tags01.name}`) && false;
@@ -853,7 +763,9 @@ export default {
// 新增或编辑报告 // 新增或编辑报告
reportAdd() { reportAdd() {
if (!this.checkReportF()) return; if (!this.checkReportF()) return;
this.$api.report.reportAdd({ ...this.reportF, tags: this.tags }).then(_ => { this.reportF.keyContent = JSON.stringify(this.tags)
delete this.reportF.tags
this.$api.report.reportAdd({ ...this.reportF}).then(_ => {
this.$message.success('操作成功'); this.$message.success('操作成功');
this.dialogReport = false; this.dialogReport = false;
this.reset(); this.reset();
@@ -891,25 +803,28 @@ export default {
}, },
// 打开报告上传 // 打开报告上传
openReportModify(mode, row) { openReportModify(mode, row) {
this.reportF = {
name: '', // 报告名称
mainContent: '', // 内容摘要
department: '', // 报告所属部门
fileName: '', // 文件上传
fileId: '',
year: '', // 报告年份
privacyLevel: undefined, //报告隐私等级
reportUserIdList: [], // 权限
confidentialLevel:undefined, //涉密等级
labelList:[] //标签
};
this.tags = []
this.mode = mode; this.mode = mode;
this.labelList(); // this.labelList();
let rowData = JSON.parse(JSON.stringify(row)); let rowData = JSON.parse(JSON.stringify(row));
if (rowData.labelOneName !== '-') { console.log('rowData',rowData);
this.labelOne = { id: rowData.labelOneId, rowData: rowData.labelOneName };
} else {
this.labelOne = {};
}
if (rowData.labelTwoName !== '-') {
this.labelTwo = { id: rowData.labelTwoId, name: rowData.labelTwoName };
} else {
this.labelTwo = {};
}
if (rowData.labelThreeName !== '-') {
this.labelThree = { id: rowData.labelThreeId, name: rowData.labelThreeName };
} else {
this.labelThree = {};
}
this.reportF = rowData; this.reportF = rowData;
// this.reportF.tags=JSON.parse(rowData.keyContent)
this.tags=JSON.parse(rowData.keyContent)
if(this.tags == '') this.tags =[]
this.$forceUpdate()
this.dialogReport = true; this.dialogReport = true;
}, },
// 获取所有用户 // 获取所有用户
@@ -924,9 +839,7 @@ export default {
this.q = { this.q = {
keyContent: '', keyContent: '',
year: [], year: [],
labelOneId: [], name:'',
labelTwoId: [],
labelThreeId: [],
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
}; };
@@ -955,7 +868,7 @@ export default {
}, },
// 列表 // 列表
reportList() { reportList() {
this.$api.report.reportList(this.q).then(({ data }) => { this.$api.report.reportListManager({...this.q,labelId:this.checkedKeys}).then(({ data }) => {
this.tableData = data.records; this.tableData = data.records;
this.total = data.total; this.total = data.total;
this.q.pageNo = data.current; this.q.pageNo = data.current;
@@ -1005,6 +918,10 @@ export default {
}) })
// }) // })
}, },
filterNode(value, data) {
if (!value) return true;
return data.label.indexOf(value) !== -1;
},
}, },
created() { created() {
this.init(); this.init();
@@ -1013,6 +930,16 @@ export default {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.treeList{
padding: 20px;
margin-left: 13px;
box-shadow: 0 2px 4px rgba(0, 0, 0, .12), 0 0 6px rgba(0, 0, 0, .04);
margin-right: 20px;
.filter-tree{
margin-top: 20px;
}
}
.check-all { .check-all {
text-align: right; text-align: right;
width: 95%; width: 95%;
@@ -1033,19 +960,16 @@ export default {
} }
.search { .search {
.search-box-left { padding-top: 9px;
padding-top: 20px;
display: flex;
justify-content: flex-start;
align-items: center;
label { ::v-deep .el-date-picker,
font-size: 14px; ::v-deep .el-input {
font-weight: 400; width: 240px;
color: #595959; }
margin-right: 5px;
padding-left: 22px; .tag-item {
} margin-bottom: 15px;
display: flex;
.year { .year {
::v-deep .el-input__inner { ::v-deep .el-input__inner {
@@ -1053,31 +977,67 @@ export default {
} }
} }
::v-deep .el-input { label.tag-title {
width: 167px; font-size: 14px;
margin-right: 5px; font-weight: normal;
color: #646464;
display: inline-block;
// width: 112px;
height: 19px;
line-height: 19px;
padding-left: 13px;
// border-right: 1px solid #BFBFBF;
margin-right: 10px;
margin-top: 2.5px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
} }
@media screen and (max-width: 1366px) { .tag-show {
::v-deep .el-input { flex: 1;
width: 135px; margin-right: 28px;
margin-right: 5px; height: 19px;
overflow: hidden;
position: relative;
&.active {
height: auto;
}
::v-deep .check-active{
.el-checkbox__label{
color: #434343;
}
}
::v-deep .el-checkbox {
margin-right: 15px;
color: #434343;
}
::v-deep .el-checkbox__label {
min-width: 80px;
}
::v-deep .el-checkbox-group {
display: inline;
}
.el-icon-arrow-down,
.el-icon-arrow-up {
color: #C0C4CC;
cursor: pointer;
position: absolute;
right: 0;
top: 2px;
} }
} }
::v-deep .el-button {
float: right;
}
} }
.search-box-right { .tag-btns {
padding-top: 20px; padding-right: 15px;
display: flex;
justify-content: flex-end;
align-items: center;
padding-right: 14px;
} }
.operate-box { .operate-box {
padding-left: 13px; padding-left: 13px;
padding-bottom: 11px; padding-bottom: 11px;
+31 -7
View File
@@ -42,8 +42,8 @@ export default {
label:undefined, label:undefined,
name:'', name:'',
sort:'', sort:'',
orderNum:'',
tip:'' remark:''
}, },
cascaderOptions:[ cascaderOptions:[
@@ -74,13 +74,16 @@ export default {
this.$api.report.labelList().then(res => { this.$api.report.labelList().then(res => {
console.log('666',res); console.log('666',res);
this.cascaderOptions=res.data this.cascaderOptions=res.data
})
if (node && data) { if (node && data) {
this.showAddOrUpdateLabel = true let id =data.id
this.form.nodeLabel = node.parent.data.label this.$api.report.labelNodeList(id).then(res=>{
this.form.nodeLabel=res.data
this.$forceUpdate()
})
this.form.label = data.label this.form.label = data.label
this.form.orderNum = data.orderNum this.form.orderNum = data.orderNum
this.form.remark = data.remark this.form.remark = data.remark
this.form.id=data.id
this.form={...this.form} this.form={...this.form}
this.$refs.form.clearValidate('name') this.$refs.form.clearValidate('name')
this.$forceUpdate() this.$forceUpdate()
@@ -88,6 +91,8 @@ export default {
this.form = {} this.form = {}
this.$forceUpdate() this.$forceUpdate()
} }
})
}, },
cancel() { cancel() {
this.dialogVisible = false this.dialogVisible = false
@@ -97,10 +102,29 @@ export default {
if (valid) { if (valid) {
this.form.parentId=this.form.nodeLabel[this.form.nodeLabel.length - 1] this.form.parentId=this.form.nodeLabel[this.form.nodeLabel.length - 1]
delete this.form.nodeLabel delete this.form.nodeLabel
this.$api.report.labelAdd(this.form).then(res => { if(!this.form.id){
this.$api.report.labelAdd(this.form).then(res => {
if(res.ok){
this.$message({
type:'success',
message:'添加成功'
})
this.$emit('updateList')
}
}) })
}else{
this.$api.report.labelUpdate(this.form).then(res=>{
if(res.ok){
this.$message({
type:'success',
message:'更新成功'
})
this.$emit('updateList')
}
})
}
this.dialogVisible = false this.dialogVisible = false
this.$bus.$emit('updataList')
} }
}) })
} }