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) {
return request({
url: `api/tree-label/${data.id}`,
url: `api/tree-label/delete/${data.id}`,
method: 'POST'
})
},
labelUpdate(){
// 标签列表
labelNodeList (id) {
return request({
url: `api/tree-label/labelList/${id}`,
method: 'GET',
params: id
})
},
labelUpdate(data){
return request({
url: 'api/tree-label/update',
method: 'POST'
method: 'POST',
data
})
},
// 新增或编辑报告
reportAdd (data) {
return request({
@@ -90,6 +100,14 @@ labelUpdate(){
data
})
},
// 报告管理列表
reportListManager (data) {
return request({
url: '/api/report/list-auth',
method: 'POST',
data
})
},
// 获取报告日期列表
reportDateList (data) {
return request({
+74 -134
View File
@@ -8,7 +8,7 @@
<el-col :span="6">
<div class="tag-item">
<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">
@@ -96,30 +96,26 @@
</el-row>
</div>
<el-row class="tag-btn">
<el-button @click="permissionApp">权限申请</el-button>
</el-row>
<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"
>
</el-tree>
</el-col>
<el-col :span="19">
<vxe-table ref="xTable" :data="tableData" :empty-render="{name: 'NotData'}" align="center" border stripe v-table-min-height="'calc(100vh - 420px)'"
@checkbox-all="selectAllEvent" @checkbox-change="selectChangeEvent">
<vxe-column type="checkbox" width="60"></vxe-column>
<vxe-column show-overflow show-header-overflow type="seq" title="序号" width="77">
<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">
<vxe-table :data="tableData" :empty-render="{name: 'NotData'}" align="center" border stripe v-table-min-height="'calc(100vh - 420px)'">
<vxe-column show-overflow show-header-overflow type="seq" title="序号" width="77">
<template #default="{ row, rowIndex }">
{{ rowIndex + (q.pageNo - 1) * q.pageSize + 1 }}
</template>
@@ -141,9 +137,9 @@
<div class="tag-info">
<span class="icon-tag-item"><img src="@/assets/imgs/icon-time.png"
alt=""><span>{{row.year}}</span></span>
<!-- <span class="icon-tag-item"><img src="@/assets/imgs/icon-tag01.png"
alt=""><span>{{row.labelOneName}}</span></span>
<span class="icon-tag-item"><img src="@/assets/imgs/icon-tag02.png"
<span class="icon-tag-item"><img src="@/assets/imgs/icon-tag01.png"
alt=""><span class="keyContent">{{getKeyContent(row.keyContent)}}</span></span>
<!-- <span class="icon-tag-item"><img src="@/assets/imgs/icon-tag02.png"
alt=""><span>{{row.labelTwoName}}</span></span>
<span class="icon-tag-item"><img src="@/assets/imgs/icon-tag03.png"
alt=""><span>{{row.labelThreeName}}</span></span> -->
@@ -155,8 +151,8 @@
</vxe-column>
<vxe-column show-overflow show-header-overflow title="操作" width="200" fixed="right">
<template #default="{ row }">
<el-button type="text" v-if="row.power == 1" @click="previewRow(row)">预览</el-button>
<el-button type="text" v-if="row.power == 2" @click="downloadRow(row)">下载</el-button>
<el-button type="text" @click="previewRow(row)">预览</el-button>
<!-- <el-button type="text" @click="downloadRow(row)">下载</el-button>-->
</template>
</vxe-column>
@@ -171,7 +167,6 @@
:total="total"/>
</el-col>
</el-row>
</div>
<!--预览-->
@@ -209,12 +204,10 @@ export default {
q: {
keyContent: '',
year: [],
labelOneId: [],
labelTwoId: [],
labelThreeId: [],
name:'',
pageNo: 1,
pageSize: 10
},
pageSize: 10,
},
total: 0,
tableData: [],
yearList: [],
@@ -245,64 +238,8 @@ export default {
content: '',
filterText:'',
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: [],
checkList: []
checkedKeys:[]
}
},
watch: {
@@ -311,50 +248,39 @@ export default {
}
},
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) {
if (!value) return true;
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 () {
this.getTreeLabel()
this.labelList()
this.reportDateList()
this.reportList()
},
getTreeLabel(){
this.$api.report.labelList().then(res => {
this.treeData=res.data
})
},
// 标签列表
labelList () {
this.$api.report.labelList().then(({ data }) => {
@@ -372,7 +298,7 @@ export default {
},
// 列表
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.total = data.total
this.q.pageNo = data.current
@@ -479,6 +405,22 @@ export default {
</script>
<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 {
.title {
border-bottom: 1px solid #EBEEF5;
@@ -492,9 +434,7 @@ export default {
color: #262626;
}
}
.tag-btn{
padding: 10px 13px;
}
.tag-search {
padding-top: 9px;
@@ -518,11 +458,11 @@ export default {
font-weight: normal;
color: #646464;
display: inline-block;
width: 112px;
// width: 112px;
height: 19px;
line-height: 19px;
padding-left: 48px;
border-right: 1px solid #BFBFBF;
padding-left: 13px;
// border-right: 1px solid #BFBFBF;
margin-right: 10px;
margin-top: 2.5px;
overflow: hidden;
+238 -278
View File
@@ -5,64 +5,73 @@
</div>
<div class="search">
<el-row>
<el-col :span="20">
<div class="search-box-left">
<label>搜索:</label>
<el-input v-model="q.keyContent" placeholder="请输入搜索内容"></el-input>
<el-col :span="6">
<div class="tag-item">
<label class="tag-title">关键词:</label>
<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="请选择报告年份">
<template v-for="item in yearList">
<el-option :label="item" :value="item" :key="item"></el-option>
</template>
</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>
</el-col>
<el-col :span="4" align="right">
<div class="search-box-right">
<el-button type="primary" @click="search">查询</el-button>
<el-button @click="reset">重置</el-button>
<el-col :span="6">
<div class="tag-item">
<label class="tag-title">报告名称:</label>
<el-input v-model="q.name" placeholder="请输入报告名称"></el-input>
</div>
</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">
<el-button @click="openLog">操作日志</el-button>
<el-button @click="openTags">标签维护</el-button>
<el-button @click="openReportAdd">报告上传</el-button>
</div>
</el-col>
</el-row>
</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-column show-overflow show-header-overflow type="seq" title="序号" width="77">
<template #default="{ row, rowIndex }">
{{ rowIndex + (q.pageNo - 1) * q.pageSize + 1 }}
</template>
</vxe-column>
<vxe-column show-overflow show-header-overflow field="labelOneName"
:title="tagsForm.tags01.name"></vxe-column>
<!-- <vxe-column show-overflow show-header-overflow field="labelOneName"
: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="labelTwoName"
<!-- <vxe-column show-overflow show-header-overflow field="labelTwoName"
:title="tagsForm.tags02.name"></vxe-column>
<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="createDate" title="上传时间"></vxe-column>
<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"
:total="total" />
</div>
</el-col>
</el-row>
<!--操作日志-->
<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>
@@ -152,7 +164,7 @@
</el-tree>
</div>
</el-dialog>
<labelModalVue ref="labelModalVue"></labelModalVue>
<labelModalVue ref="labelModalVue" @updateList="updateList"></labelModalVue>
<!--报告上传-->
<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>
@@ -162,8 +174,22 @@
<el-input v-model="reportF.name" placeholder="请填写" maxlength="100" show-word-limit></el-input>
</el-form-item>
<el-form-item label="关键词:">
<vue-tags-input placeholder="请输入关键词" v-model="reportF.keyContent" :tags="tags"
@tags-changed="newTags => tags = newTags" />
<vue-tags-input placeholder="请输入关键词" v-model="reportF.tags" :tags="tags"
@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 label="内容摘要:">
<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-form-item>
<el-form-item label="报告涉密等级:">
<el-select v-model="reportF.secretLevel" placeholder="请选择报告涉密等级">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
<el-select v-model="reportF.confidentialLevel" placeholder="请选择报告涉密等级">
<el-option v-for="item in confidentialLevelOptions" :key="item.value" :label="item.label" :value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="报告隐私等级:">
<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-select>
</el-form-item>
@@ -205,7 +231,7 @@
prefix-icon="null" :picker-options="pickerOptions" />
</el-form-item>
<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>
</el-cascader>
</el-form-item>
@@ -279,66 +305,39 @@ export default {
dialogTags: false, // 标签维护
filterText: '',
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',
label:'1'
value:'外部公开',
label:'外部公开'
},
{
value:'普通商密',
label:'普通商密'
},
{
value:'核心商密',
label:'核心商密'
},
{
value:'内部公开',
label:'内部公开'
},
{
value:'用户信息',
label:'用户信息'
},
{
value:'敏感信息',
label:'敏感信息'
},
],
confidentialLevelOptions:[
{
value:'一般隐私',
label:'一般隐私'
}
],
tagsForm: {
@@ -390,41 +389,14 @@ export default {
tag: []
},
tag: '',
tags: [],
tags: [''],
labelOne: {},
labelTwo: {},
labelThree: {},
mode: '',
userList: [],
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: '嘉兴' }
]
}]
}],
cascaderOptions: [
],
pickerOptions: {
disabledDate(time) {
return time.getFullYear() > new Date().getFullYear() + 1 || time.getFullYear() < new Date().getFullYear() - 10;
@@ -434,9 +406,7 @@ export default {
q: {
keyContent: '',
year: [],
labelOneId: [],
labelTwoId: [],
labelThreeId: [],
name:'',
pageNo: 1,
pageSize: 10,
},
@@ -456,11 +426,7 @@ export default {
this.$refs.tree.filter(val);
}
},
mounted () {
this.$bus.$on('updateList',()=>{
this.getTreeLabel()
})
},
methods: {
init() {
this.getTreeLabel()
@@ -469,10 +435,21 @@ export default {
this.reportDateList();
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(){
this.$api.report.labelList().then(res => {
console.log('5555',res);
this.treeData=res.data
this.cascaderOptions=res.data
})
},
//标签搜索
@@ -493,11 +470,20 @@ export default {
type: 'warning'
})
.then(_ => {
this.$api.report.labelDeleteId(data).then(res=>{
if(res.ok){
this.$message({
type:'success',
message:'删除成功'
})
this.getTreeLabel()
}
})
done();
})
.catch(_ => { });
},
/* 权限全选 */
selectAll() {
this.reportF.reportUserIdList = [];
@@ -721,107 +707,31 @@ export default {
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() {
this.dialogTags = false;
this.labelList();
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() {
this.mode = 'add';
this.reportF = {
name: '', // 报告名称
tags: '', // 关键词
mainContent: '', // 内容摘要
department: '', // 报告所属部门
fileName: '', // 文件上传
name: '', // 报告名称
mainContent: '', // 内容摘要
department: '', // 报告所属部门
fileName: '', // 文件上传
fileId: '',
year: '', // 报告年份
secretLevel: '', //涉密等级
privacyLevel: '', //报告隐私等级
// labelOneId: '', // 标签1
// labelOneName: '', // 标签1
// labelTwoId: '', // 标签2
// labelTwoName: '', // 标签2
// labelThreeId: '', // 标签3
// labelThreeName: '', // 标签3
reportUserIdList: [], // 权限
year: '', // 报告年份
privacyLevel: undefined, //报告隐私等级
reportUserIdList: [], // 权限
confidentialLevel:undefined, //涉密等级
labelList:[] //标签
};
this.tags = []
// this.labelOne = {};
// this.labelTwo = {};
// this.labelThree = {};
// this.labelList();
this.tags = [] // 关键词
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() {
if (!this.reportF.name) {
@@ -833,8 +743,8 @@ export default {
if (!this.reportF.year) {
return this.$message.warning('请检查报告年份') && false;
}
if (!this.reportF.label) {
return this.$message.warning('请检查报告年份') && false;
if (!this.reportF.labelList) {
return this.$message.warning('请检查标签') && false;
}
// if (!this.reportF.labelOneId || !this.reportF.labelOneName || this.reportF.labelOneName === '-' ) {
// return this.$message.warning(`请检查${this.tagsForm.tags01.name}`) && false;
@@ -853,7 +763,9 @@ export default {
// 新增或编辑报告
reportAdd() {
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.dialogReport = false;
this.reset();
@@ -891,25 +803,28 @@ export default {
},
// 打开报告上传
openReportModify(mode, row) {
this.reportF = {
name: '', // 报告名称
mainContent: '', // 内容摘要
department: '', // 报告所属部门
fileName: '', // 文件上传
fileId: '',
year: '', // 报告年份
privacyLevel: undefined, //报告隐私等级
reportUserIdList: [], // 权限
confidentialLevel:undefined, //涉密等级
labelList:[] //标签
};
this.tags = []
this.mode = mode;
this.labelList();
// this.labelList();
let rowData = JSON.parse(JSON.stringify(row));
if (rowData.labelOneName !== '-') {
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 = {};
}
console.log('rowData',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;
},
// 获取所有用户
@@ -924,9 +839,7 @@ export default {
this.q = {
keyContent: '',
year: [],
labelOneId: [],
labelTwoId: [],
labelThreeId: [],
name:'',
pageNo: 1,
pageSize: 10,
};
@@ -955,7 +868,7 @@ export default {
},
// 列表
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.total = data.total;
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() {
this.init();
@@ -1013,6 +930,16 @@ export default {
</script>
<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 {
text-align: right;
width: 95%;
@@ -1033,19 +960,16 @@ export default {
}
.search {
.search-box-left {
padding-top: 20px;
display: flex;
justify-content: flex-start;
align-items: center;
padding-top: 9px;
label {
font-size: 14px;
font-weight: 400;
color: #595959;
margin-right: 5px;
padding-left: 22px;
}
::v-deep .el-date-picker,
::v-deep .el-input {
width: 240px;
}
.tag-item {
margin-bottom: 15px;
display: flex;
.year {
::v-deep .el-input__inner {
@@ -1053,31 +977,67 @@ export default {
}
}
::v-deep .el-input {
width: 167px;
margin-right: 5px;
label.tag-title {
font-size: 14px;
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) {
::v-deep .el-input {
width: 135px;
margin-right: 5px;
.tag-show {
flex: 1;
margin-right: 28px;
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 {
padding-top: 20px;
display: flex;
justify-content: flex-end;
align-items: center;
padding-right: 14px;
.tag-btns {
padding-right: 15px;
}
.operate-box {
padding-left: 13px;
padding-bottom: 11px;
+31 -7
View File
@@ -42,8 +42,8 @@ export default {
label:undefined,
name:'',
sort:'',
tip:''
orderNum:'',
remark:''
},
cascaderOptions:[
@@ -74,13 +74,16 @@ export default {
this.$api.report.labelList().then(res => {
console.log('666',res);
this.cascaderOptions=res.data
})
if (node && data) {
this.showAddOrUpdateLabel = true
this.form.nodeLabel = node.parent.data.label
let id =data.id
this.$api.report.labelNodeList(id).then(res=>{
this.form.nodeLabel=res.data
this.$forceUpdate()
})
this.form.label = data.label
this.form.orderNum = data.orderNum
this.form.remark = data.remark
this.form.id=data.id
this.form={...this.form}
this.$refs.form.clearValidate('name')
this.$forceUpdate()
@@ -88,6 +91,8 @@ export default {
this.form = {}
this.$forceUpdate()
}
})
},
cancel() {
this.dialogVisible = false
@@ -97,10 +102,29 @@ export default {
if (valid) {
this.form.parentId=this.form.nodeLabel[this.form.nodeLabel.length - 1]
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.$bus.$emit('updataList')
}
})
}