报告列表接口对接
This commit is contained in:
@@ -109,6 +109,7 @@
|
|||||||
default-expand-all
|
default-expand-all
|
||||||
:filter-node-method="filterNode"
|
:filter-node-method="filterNode"
|
||||||
ref="tree"
|
ref="tree"
|
||||||
|
@check="getHalfCheckedNode"
|
||||||
>
|
>
|
||||||
</el-tree>
|
</el-tree>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -243,62 +244,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'
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
]
|
|
||||||
|
|
||||||
}
|
|
||||||
],
|
],
|
||||||
|
checkedKeys:[]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
@@ -307,15 +254,26 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
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;
|
||||||
},
|
},
|
||||||
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 }) => {
|
||||||
@@ -333,7 +291,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
|
||||||
|
|||||||
@@ -691,61 +691,12 @@ 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() {
|
||||||
@@ -763,29 +714,8 @@ export default {
|
|||||||
labelList:[] //标签
|
labelList:[] //标签
|
||||||
};
|
};
|
||||||
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) {
|
||||||
@@ -857,25 +787,27 @@ 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)
|
||||||
|
this.$forceUpdate()
|
||||||
this.dialogReport = true;
|
this.dialogReport = true;
|
||||||
},
|
},
|
||||||
// 获取所有用户
|
// 获取所有用户
|
||||||
|
|||||||
Reference in New Issue
Block a user