合并分支

This commit is contained in:
nisen
2023-08-01 17:37:08 +08:00
parent adc5ed7afb
commit cf5a7ee4f8
22 changed files with 3525 additions and 2139 deletions

View File

@@ -9,18 +9,27 @@
<div style="display: flex;justify-content:flex-start;">
<!-- <div style="padding: 0px 5px;"><el-cascader placeholder="资源归属" clearable v-model="params.type" :options="typeList"></el-cascader></div> -->
<div style="padding: 0px 5px;">
<el-select v-model="queryObj.isTop" style="width: 110px;" clearable placeholder="置顶">
<el-select v-model="queryObj.isTop" style="width: 110px;" clearable placeholder="全部">
<el-option label="已置顶" :value="true"></el-option>
<el-option label="未置顶" :value="false"></el-option>
</el-select>
</div>
<div style="padding: 0px 5px;"><el-input placeholder="关键词搜索" v-model="queryObj.keyWord" @input="inputOn($event)" clearable></el-input></div>
<div style="padding: 0px 5px;">
<el-button @click="getData(1)" icon="el-icon-search" type="primary" >搜索</el-button>
<el-select v-model="queryObj.excellent" style="width: 120px;" clearable placeholder="全部">
<el-option label="最佳案例" :value="true"></el-option>
<el-option label="非最佳案例" :value="false"></el-option>
</el-select>
</div>
<div style="padding: 0px 5px;"><el-input placeholder="关键词搜索" v-model="queryObj.keyWord" @input="inputOn($event)"
clearable></el-input></div>
<div style="padding: 0px 5px;flex: 1;display: flex;align-items: center;">
<el-button @click="getData(1)" icon="el-icon-search" type="primary">搜索</el-button>
<!-- <el-button @click="showRecords()" icon="el-icon-tickets" type="info" >推荐记录</el-button> -->
<el-button icon="el-icon-refresh-right" type="primary" @click="reset">重置</el-button>
<el-checkbox style="margin-left:10px" v-model="queryObj.excellent" @change="getData()">优秀案例</el-checkbox>
<el-button icon="el-icon-refresh-right" type="primary" @click="reset">重置</el-button>
<!-- <el-checkbox style="margin-left:10px" v-model="queryObj.excellent" @change="getData()">优秀案例</el-checkbox> -->
<div style="flex: 1; display: flex; justify-content: flex-end;align-items:baseline;">
<el-button type="primary" icon="el-icon-document" @click="importList">导出</el-button>
</div>
</div>
</div>
</div>
@@ -34,60 +43,61 @@
</el-table-column> -->
<el-table-column label="作者" width="80px" prop="authorName"></el-table-column>
<el-table-column label="密级" width="80px" prop="confidentialityLevel"></el-table-column>
<el-table-column label="浏览次数" width="80px" prop="views"></el-table-column>
<el-table-column label="导入时间" prop="sysCreateTime"></el-table-column>
<el-table-column label="设置优秀时间" prop="excellentTime"></el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button-group>
<!-- <el-button type="text" @click="shareItem(scope.row)" icon="el-icon-share" style="margin:0 5px">推荐</el-button> -->
<el-button style="margin:0 5px" v-if="!scope.row.isTop && scope.row.confidentialityLevel=='内部'" type="text" @click="setTop(scope.row)" icon="el-icon-top">置顶</el-button>
<el-button style="margin:0 5px" v-if="scope.row.isTop && scope.row.confidentialityLevel=='内部'" type="text" @click="setTop(scope.row)" icon="el-icon-bottom">取消置顶</el-button>
<el-button type="text" icon="el-icon-medal" v-if="scope.row.filePath && scope.row.confidentialityLevel=='内部'" ><span @click="cancal(scope.row)" v-if="scope.row.excellent">取消优秀</span><span @click="open(scope.row)" v-else>设为优秀</span></el-button>
<el-button style="margin:0 5px" type="text" @click="delItem(scope.row)" icon="el-icon-delete">删除</el-button>
<el-button style="margin:0 5px" v-if="!scope.row.isTop && scope.row.confidentialityLevel == '内部'" type="text"
@click="setTop(scope.row)" icon="el-icon-top">置顶</el-button>
<el-button style="margin:0 5px" v-if="scope.row.isTop && scope.row.confidentialityLevel == '内部'" type="text"
@click="setTop(scope.row)" icon="el-icon-bottom">取消置顶</el-button>
<el-button type="text" icon="el-icon-medal"
v-if="scope.row.filePath && scope.row.confidentialityLevel == '内部'"><span @click="cancal(scope.row)"
v-if="scope.row.excellent">取消最佳</span><span @click="open(scope.row)" v-else>最佳案例</span></el-button>
<el-button style="margin:0 5px" type="text" @click="delItem(scope.row)" icon="el-icon-delete">删除</el-button>
</el-button-group>
</template>
</el-table-column>
</el-table>
<div style="text-align: center;margin-top: 50px;">
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="queryObj.pageIndex"
:page-sizes="[10, 20, 30, 40]"
:page-size="queryObj.pageSize"
layout="total, sizes, prev, pager, next, jumper"
:total="count"
></el-pagination>
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
:current-page="queryObj.pageIndex" :page-sizes="[10, 20, 30, 40]" :page-size="queryObj.pageSize"
layout="total, sizes, prev, pager, next, jumper" :total="count"></el-pagination>
</div>
<div style="height: 100px;"></div>
<el-dialog title="推荐案例" :visible.sync="shareShow" :close-on-click-modal="false" width="500px" custom-class="g-dialog">
<div style="padding-right: 30px;">
<el-form label-width="100px" @submit.native.prevent >
<el-form-item label="推荐案例">{{shareItemData.title}}</el-form-item>
<el-form-item label="姓名或工号">
<el-input v-model="shareInfo.name" maxlength="10" placeholder="您要分享的人的姓名搜索" @keyup.enter.native="keyupEnter">
<el-button @click="findUser" slot="append" icon="el-icon-search"></el-button>
</el-input>
</el-form-item>
<el-form-item>
<el-checkbox-group v-model="shareUsers">
<el-checkbox v-for="(u,uidx) in shareInfo.list" :key="uidx" :label="u.aid">{{u.name+'('+u.orgInfo+')'}}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<!-- <div style="padding: 0 20px 20px 20px;">
<el-form label-width="100px" @submit.native.prevent>
<el-form-item label="推荐案例">{{ shareItemData.title }}</el-form-item>
<el-form-item label="姓名或工号">
<el-input v-model="shareInfo.name" maxlength="10" placeholder="您要分享的人的姓名搜索" @keyup.enter.native="keyupEnter">
<el-button @click="findUser" slot="append" icon="el-icon-search"></el-button>
</el-input>
</el-form-item>
<el-form-item>
<el-checkbox-group v-model="shareUsers">
<el-checkbox v-for="(u, uidx) in shareInfo.list" :key="uidx" :label="u.aid">{{ u.name + '(' + u.orgInfo +
')' }}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<!-- <div style="padding: 0 20px 20px 20px;">
</div> -->
<el-form-item label="推荐说明"><el-input type="textarea" :rows="3" v-model="shareItemData.recommentThat" placeholder="备注说明"></el-input></el-form-item>
</el-form>
<el-form-item label="推荐说明"><el-input type="textarea" :rows="3" v-model="shareItemData.recommentThat"
placeholder="备注说明"></el-input></el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="shareShow = false"> </el-button>
<el-button @click="submitWork" type="primary">提交推荐任务</el-button>
</span>
</el-dialog>
<el-dialog title="推荐记录" :visible.sync="recommend.dlgShow" :close-on-click-modal="false" width="900px" custom-class="g-dialog">
<el-dialog title="推荐记录" :visible.sync="recommend.dlgShow" :close-on-click-modal="false" width="900px"
custom-class="g-dialog">
<div>
<el-table stripe style="width: 100%" :data="recommend.records">
<el-table-column prop="caseName" label="案例名称"></el-table-column>
@@ -121,27 +131,27 @@ export default {
name: 'articleItems',
data() {
return {
excellent:false,
excellent: false,
queryObj: {
pageIndex:1,
pageSize:10,
isTop:'',
excellent:'',
pageIndex: 1,
pageSize: 10,
isTop: '',
excellent: '',
}, //查询对象
caseList: [], //案例列表
count:0,
count: 0,
recommend: {
dlgShow: false,
records: []
},
shareInfo:{
name:'',
load:false,
list:[]
shareInfo: {
name: '',
load: false,
list: []
},
shareShow: false,
shareUsers:[],
shareItemData:{},
shareUsers: [],
shareItemData: {},
timeout: null,
params: { name: '', type: '' },
typeList: [],
@@ -163,66 +173,81 @@ export default {
this.getData();
},
methods: {
// 导出
importList() {
apiCase.exports(this.queryObj).then(res => {
const link = document.createElement('a');// 创建a标签
let blob = new Blob([res], { type: 'application/vnd.ms-excel;charset=UTF-8' }); // 设置文件类型
link.style.display = "none";
link.href = URL.createObjectURL(blob); // 创建URL
console.log(link.href);
link.setAttribute("download", "案例.xls");
document.body.appendChild(link);
link.click();
URL.revokeObjectURL(link.href)
document.body.removeChild(link);
})
},
// getSearch(){
// this.queryObj.excellent = !this.queryObj.excellent;
// this.getData();
// },
cancal(item){
this.$confirm('是否取消该案例为优秀案例?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.excellent = false;
let data = {
id:item.id,
excellent:this.excellent
cancal(item) {
this.$confirm('确定要取消设置为最佳案例?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.excellent = false;
let data = {
id: item.id,
excellent: this.excellent
}
console.log(data)
apiCase.excellent(data).then(res => {
if (res.status == 200) {
this.$message({
type: 'success',
message: '取消成功!'
});
this.getData()
}
console.log(data)
apiCase.excellent(data).then(res => {
if(res.status == 200){
this.$message({
type: 'success',
message: '取消成功!'
});
this.getData()
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已撤回取消推荐'
});
})
}).catch(() => {
this.$message({
type: 'info',
message: '已撤回取消推荐'
});
});
},
open(item) {
this.$confirm('是否设置此案例为优秀案例吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.excellent = true;
let data = {
id:item.id,
excellent:this.excellent
this.$confirm('你确认要设置为最佳案例吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.excellent = true;
let data = {
id: item.id,
excellent: this.excellent
}
console.log(data)
apiCase.excellent(data).then(res => {
if (res.status == 200) {
this.$message({
type: 'success',
message: '设置优秀案例成功!'
});
this.getData()
}
console.log(data)
apiCase.excellent(data).then(res => {
if(res.status == 200){
this.$message({
type: 'success',
message: '设置优秀案例成功!'
});
this.getData()
}
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消优秀案例设置'
});
})
}).catch(() => {
this.$message({
type: 'info',
message: '已取消优秀案例设置'
});
},
});
},
inputOn() {
this.$forceUpdate();
},
@@ -235,20 +260,20 @@ export default {
},
//获取案例列表数据
getData(num) {
if(num === 1) {
this.queryObj.pageIndex = 1;
}
if(!this.queryObj.excellent){
this.queryObj.excellent='';
if (num === 1) {
this.queryObj.pageIndex = 1;
}
// if (!this.queryObj.excellent) {
// this.queryObj.excellent = '';
// }
apiCase.isTopList(this.queryObj).then(res => {
if (res.status == 200) {
this.count=res.result.count
this.caseList = res.result.list;
} else {
this.$message({type: 'error', message: '查询数据失败'});
}
})
if (res.status == 200) {
this.count = res.result.count
this.caseList = res.result.list;
} else {
this.$message({ type: 'error', message: '查询数据失败' });
}
})
.catch(err => {
this.$message({
type: 'error',
@@ -257,54 +282,69 @@ export default {
});
},
handleSizeChange(val) {
this.queryObj.pageSize=val;
this.queryObj.pageSize = val;
this.getData(1);
},
handleCurrentChange(val) {
this.queryObj.pageIndex=val;
this.queryObj.pageIndex = val;
this.getData();
},
//暂时因为没数据,先做添加
showRecords() {
this.recommend.dlgShow = true;
apiCase.query().then(res=>{
if(res.status==200){
this.recommend.records=res.result
apiCase.query().then(res => {
if (res.status == 200) {
this.recommend.records = res.result
}
}).catch(err=>{
}).catch(err => {
this.$message({
type:'error',
message:'获取数据失败'
type: 'error',
message: '获取数据失败'
})
})
},
setTop(item) {
let msg,isTop;
if (item.isTop==1) {
msg = '取消置顶';
isTop=0
let msg, isTop, btnMsg;
if (item.isTop == 1) {
msg = '确认要取消置顶此案例吗?';
btnMsg = "取消成功"
isTop = 0
} else {
msg = '置顶成功';
isTop=1
msg = '你确认要置顶此案例吗?';
btnMsg = "设置置顶成功"
isTop = 1
}
apiCase.updateTop(item.id,isTop).then(res=>{
if(res.status==200){
this.$message.success(msg);
this.getData()
}else{
this.$message.error("操作失败")
}
})
},
delItem(item) {
this.$confirm('您确定要删除所选内容吗?', '删除提示', {
this.$confirm(msg, '删除提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
apiCase.del(item.id).then(res=>{
if(res.status==200){
apiCase.updateTop(item.id, isTop).then(res => {
if (res.status == 200) {
this.$message({
type: 'success',
message: btnMsg
});
this.getData()
} else {
this.$message.error("操作失败")
}
})
})
.catch(() => {
this.$message({ type: 'info', message: '取消操作', offset: 50 });
});
},
delItem(item) {
this.$confirm('您确定要删除这条案例吗?', '删除提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(() => {
apiCase.del(item.id).then(res => {
if (res.status == 200) {
this.$message.success("删除成功");
this.getData()
}
@@ -316,67 +356,67 @@ export default {
},
//添加推荐
shareItem(item) {
this.shareItemData={...item}
this.shareItemData = { ...item }
this.shareShow = true;
},
submitWork(){
if(this.shareUsers.length==0){
submitWork() {
if (this.shareUsers.length == 0) {
this.$message.error('请选择分享人');
return;
}
let {title,recommentThat,id}=this.shareItemData
let {aid:acceptAid}=this.shareInfo.list[0]
let queryData={
title,recommentThat,acceptAid,id
let { title, recommentThat, id } = this.shareItemData
let { aid: acceptAid } = this.shareInfo.list[0]
let queryData = {
title, recommentThat, acceptAid, id
}
//暂时只针对个人分享,所以暂时只传一条,没有传数组
apiCase.savaRecommend(queryData).then(res=>{
if(res.status==200){
apiCase.savaRecommend(queryData).then(res => {
if (res.status == 200) {
this.$message.success("分享成功")
this.shareShow = false;
}else{
this.shareShow = false;
} else {
this.$message.error("分享失败")
}
}).catch(err=>{
}).catch(err => {
this.$message.error("分享失败")
})
// let {id,title,acceptAid,recommentThat}=item
// apiCase.savaRecommend()
},
keyupEnter(){
this.findUser();
return false;
keyupEnter() {
this.findUser();
return false;
},
findUser(){
this.shareInfo.load=false;
this.shareInfo.list=[];
this.shareUsers=[];
var name=this.shareInfo.name;
var regPos = /^\d+(\.\d+)?$/; //非负浮点数
if(regPos.test(name)){
//console.log("数字");
apiUser.getByLoginName(name).then(rs=>{
if(rs.status==200){
//因为根据工号查询只会是一个人所有会有null情况而json会返回空字符串
if(rs.result!=''){
this.shareInfo.list.push(rs.result);
}
this.shareInfo.load=true;
}else{
this.$message.error('查询用户失败');
}
})
}else{
// console.log("非数字");
apiUser.findByName(name).then(rs=>{
if(rs.status==200){
this.shareInfo.list=rs.result;
this.shareInfo.load=true;
}else{
this.$message.error('查询用户失败');
}
})
}
findUser() {
this.shareInfo.load = false;
this.shareInfo.list = [];
this.shareUsers = [];
var name = this.shareInfo.name;
var regPos = /^\d+(\.\d+)?$/; //非负浮点数
if (regPos.test(name)) {
//console.log("数字");
apiUser.getByLoginName(name).then(rs => {
if (rs.status == 200) {
//因为根据工号查询只会是一个人所有会有null情况而json会返回空字符串
if (rs.result != '') {
this.shareInfo.list.push(rs.result);
}
this.shareInfo.load = true;
} else {
this.$message.error('查询用户失败');
}
})
} else {
// console.log("非数字");
apiUser.findByName(name).then(rs => {
if (rs.status == 200) {
this.shareInfo.list = rs.result;
this.shareInfo.load = true;
} else {
this.$message.error('查询用户失败');
}
})
}
},
setEssence(item, idx) {
@@ -415,12 +455,12 @@ export default {
};
},
viewTopic(data) {
if(data.confidentialityLevel=='内部'){
this.$router.push({path:'/case/detail',query:{id:data.id}})
}else{
if (data.confidentialityLevel == '内部') {
this.$router.push({ path: '/case/detail', query: { id: data.id } })
} else {
this.$message.warning("非内部密级案例不能查看");
}
}
}
};
@@ -432,16 +472,19 @@ export default {
border: 1px dotted #1ea0fa;
color: #1ea0fa;
}
.article-status2 {
padding: 3px;
border: 1px dotted #00aa00;
color: #00aa00;
}
.article-status3 {
padding: 3px;
border: 1px dotted #ff0000;
color: #ff0000;
}
.article-list {
margin: 5px 0;
border: 1px solid #dddddd;
@@ -454,6 +497,7 @@ export default {
font-weight: 400;
height: 40px;
line-height: 40px;
.article-info-date {
width: 150px;
height: 40px;
@@ -461,21 +505,26 @@ export default {
float: right;
font-weight: 200;
color: #999999;
i {
margin-right: 5px;
}
}
}
.article-info-summary {
height: 65px;
color: #999999;
}
.article-info-tools {
height: 30px;
.article-info-tools-auth {
float: left;
font-size: 13px;
color: #999999;
img {
margin-right: 10px;
width: 30px;
@@ -484,14 +533,17 @@ export default {
vertical-align: middle;
}
}
.article-info-tools-btns {
float: right;
.article-info-tools-btn {
margin: 0 0 0 15px;
}
}
}
}
.case-row-btn {
line-height: 25px;
@@ -500,8 +552,9 @@ export default {
padding: 3px 20px;
}
}
.el-form{
.el-form-item{
.el-form {
.el-form-item {
margin-bottom: 10px;
}
}