This commit is contained in:
zhutianqi
2021-06-22 18:00:43 +08:00
parent e51c79f98c
commit e575d3b2ea
3 changed files with 103 additions and 328 deletions
+53 -54
View File
@@ -334,60 +334,59 @@ export default {
// }
]
},
// {
// title: '个人中心',
// path: '/personal',
// 'icon-class': 'ucenter',
// menuId: 'ZY9RFA4M35',
// children: [
// {
// title: '我的消息',
// path: '/dynamics',
// menuId: 'JCEV4AEV32'
// },
// {
// title: '我的企标',
// path: '/MyEnterpriseStandard',
// menuId: 'LKU3W23UMEHDM9VLDHGK'
// },
// {
// title: '我的收藏',
// path: '/collection',
// menuId: 'JY5LKL2HPD'
// },
//
// {
// title: '我的浏览',
// path: '/browsing',
// menuId: 'HAEY2A4LMX'
// },
// {
// title: '已收分享',
// path: '/push',
// menuId: '9F8T7DPYHE'
// },
// {
// title: '已发分享',
// path: '/forward',
// menuId: 'K45Y9TGKZV2K4XP4CETD'
// },
// {
// title: '我的问答',
// path: '/questionsAndAnswers',
// menuId: '8VKLZATQQG4NQHXV9UDS'
// },
// {
// title: '我的板块',
// path: '/plate',
// menuId: 'TUYHX8JBWV'
// }
// // {
// // title: '个人信息',
// // path: '/info',
// // menuId: '8K7FDHG89G'
// // }
// ]
// },
{
title: '个人中心',
path: '/personal',
'icon-class': 'ucenter',
menuId: 'ZY9RFA4M35',
children: [
// {
// title: '我的消息',
// path: '/dynamics',
// menuId: 'JCEV4AEV32'
// },
// {
// title: '我的企标',
// path: '/MyEnterpriseStandard',
// menuId: 'LKU3W23UMEHDM9VLDHGK'
// },
{
title: '我的收藏',
path: '/collection',
menuId: 'JY5LKL2HPD'
},
// {
// title: '我的浏览',
// path: '/browsing',
// menuId: 'HAEY2A4LMX'
// },
// {
// title: '已收分享',
// path: '/push',
// menuId: '9F8T7DPYHE'
// },
// {
// title: '已发分享',
// path: '/forward',
// menuId: 'K45Y9TGKZV2K4XP4CETD'
// },
// {
// title: '我的问答',
// path: '/questionsAndAnswers',
// menuId: '8VKLZATQQG4NQHXV9UDS'
// },
// {
// title: '我的板块',
// path: '/plate',
// menuId: 'TUYHX8JBWV'
// }
// {
// title: '个人信息',
// path: '/info',
// menuId: '8K7FDHG89G'
// }
]
},
// {
// title: '搜索中心',
// path: '/advancedSearch',
@@ -6,7 +6,7 @@
<div class="search-area">
<el-form :inline="true" class="label-input-form" @keyup.enter.native="selectStandardBtn">
<el-form-item label="标准法规标题" class="search-item search-item-last">
<el-input v-model="search.collectionStandard"
<el-input v-model="search.name"
placeholder="请输入标准法规信息"
clearable
:maxlength="100"
@@ -18,15 +18,21 @@
icon="el-icon-search"
type="primary"
class="common-button-primary"
round
size="mini"
@click="selectStandardBtn">
</el-button>
<el-button
class="common-button-default"
icon="el-icon-refresh-left"
round
size="mini"
@click="resetSelect"></el-button>
<el-button class="common-button-default" round @click="cancleCollectBatch" v-btn-permission="'YEG2HVV27R'"><i class="iconfont">&#xe602;</i>取消收藏</el-button>
<!-- <el-button-->
<!-- class="common-button-default"-->
<!-- size="mini"-->
<!-- @click="cancleCollectBatch">-->
<!--&lt;!&ndash; <i class="iconfont">&#xe602;</i>&ndash;&gt;-->
<!-- 取消收藏-->
<!-- </el-button>-->
</el-form-item>
</el-form>
</div>
@@ -40,62 +46,31 @@
<div class="card domBtn">
<el-col :span="1"><el-checkbox v-model="item.checked" size="large"></el-checkbox></el-col>
<el-row>
<div @click="detailsStandard(item)">
<div>
<el-col :span="5" :offset="1" >
<i class="el-icon-collection-tag" style="position: relative; left: -15px" />
所属板块{{ item.collectType === 'INLAND_STAND' ? '国内标准法规' : (item.collectType === 'FOREIGN_STAND' ? '海外标准法规' : '企业标准') }}
</el-col>
<el-col :span="6">
<el-tooltip class="item" effect="dark" :content="item.collectTitle" placement="top" v-if="item.collectTitle">
<div class="left-contents">标题{{ item.collectTitle }}</div>
<div class="left-contents">标题{{ item.name }}</div>
</el-tooltip>
<div v-else>
<div class="left-contents">标题{{ item.collectTitle }}</div>
<div class="left-contents">标题{{ item.name }}</div>
</div>
</el-col>
<el-col :span="4" :offset="3">创建时间{{getDate(item.creationTime)}}</el-col>
<el-col :span="4" :offset="3">创建时间{{getDate(item.createTime)}}</el-col>
</div>
<el-col :span="4">
<el-button size="mini" @click="cancelStandard(item.id)" style="margin-top: -5px; border: 1px dashed #dcdee2" v-btn-permission="'GSMRLL6A4Y'">取消收藏</el-button>
<!-- <el-button size="mini" @click="writeStandardNotes(item,index1)" style="margin-top: -5px; border: 1px dashed #dcdee2">{{item.seeBtn}}</el-button>-->
</el-col>
</el-row>
</div>
<div :class="{ 'selected ': item.checked }" @click="handleCardClick(item,$event)">
<el-button size="mini" icon="el-icon-plus" @click="createStandardNote(item, index1)" style="border: 1px dashed #dcdee2" v-show="item.check" v-btn-permission="'HD7HL2JY4Z'">添加笔记</el-button>
<div class="note" v-show="item.check" v-for="(note,index2) in item.noteList" :key="index2">
<div class="noteLeft">笔记{{index2 +1 }}: {{note.noteContentValue}}</div>
<div class="noteRight">
<el-button type="primary" size="mini" @click="viewStandardData(note)">查看此条笔记</el-button>
<el-button type="warning" size="mini" @click="noteStandardEdit(note ,index1)" v-btn-permission="'XLA4JQDS5A'">修改笔记</el-button>
<el-button type="danger" size="mini" @click="noteStandardDel(note ,index1)" v-btn-permission="'2RZ3EQRATU'">删除笔记</el-button>
</div>
</div>
</div>
</div>
</div>
<has-no-data pClass="content-detail" v-if="total === 0"></has-no-data>
<loading :loading="loading">数据获取中</loading>
</div>
<el-dialog
:title="standardTitle"
:visible.sync="standardModal"
:close-on-click-modal = false
width="450px"
:class="{ 'hide-modal-footer': modalType === 3 }"
@on-visible-change="noteChange">
<div style="margin-left: 20px">
<el-form ref="standardForm" :model="standardForm" :rules="standardFormRules">
<el-form-item prop="textarea">
<el-input type="textarea" v-model.trim="standardForm.textarea" maxlength="20000" show-word-limit :autosize="{minRows: 5,maxRows: 7}" :disabled="noteType" placeholder="书写笔记"></el-input>
</el-form-item>
</el-form>
</div>
<div slot="footer">
<el-button size="mini" @click="closeModal">取消</el-button>
<el-button size="mini" type="primary" @click="saveClass" :loading="isSubmit">确认</el-button>
</div>
</el-dialog>
<pagination :total="total" :page="page" @pageChange="pageChange" @pageSizeChange="pageSizeChange"></pagination>
</div>
</template>
@@ -113,7 +88,7 @@ export default {
loadDate: false,
// 查询
search: {
collectionStandard: ''
name: ''
},
// 分页
total: 0,
@@ -121,108 +96,25 @@ export default {
rows: 10,
// 数据内容
standardList: [],
// 对话框状态
standardModal: false,
// 对话框标题
standardTitle: '',
// 对话框内容
standardForm: {
textarea: '',
collectId: '',
id: ''
},
modalType: '',
// 是否读写
noteType: false,
// 计算
// 笔记规则
standardFormRules: {
textarea: [
{required: true, message: '笔记不能为空', trigger: 'blur'},
{type: 'string', max: 20000, message: '最多输入20000字符'}
]
},
checkAll: false, // 是否全选
indeterminate: false, // 是否半选
isSubmit: false,
selectedList: [],
selectedAllInfoList: []
}
},
methods: {
// 对话框关闭清除表单
noteChange (type) {
if (!type) {
this.$refs['standardForm'].resetFields()
}
},
// 重置
resetSelect () {
this.search.collectionStandard = ''
this.search.name = ''
this.pageChange(1)
},
// 笔记数字提示
descInput () {
if (this.standardForm.textarea.length > 20000) {
this.error('最多输入20000字')
}
},
error (msg) {
this.$Message.error(msg)
},
// 跳转
detailsStandard (item) {
console.log(item);
this.$http.get('lawss/sarMenu/judgeSarMenuByRole', {
sarId: item.collectResId,
sarType: item.collectType
}, {
_this: this
}, res => {
if (res.ok) {
if (item.collectType === 'BUSINESS_STAND') {
// if (this.$hasPermission('YJUHC32R7G')) {
let routeUrl = this.$router.resolve({
name: 'OtherBussStandardDetails',
params: {
id: item.collectResId,
pageType: item.collectType
}
})
window.open(routeUrl.href, '_blank')
// } else {
// this.$message.warning('无权访问')
// }
} else {
// if (this.$hasPermission('SSA6WR4HV8')) {
let routeUrl = this.$router.resolve({
name: 'OtherStandardDetails',
params: {
id: item.collectResId,
pageType: item.collectType
}
})
window.open(routeUrl.href, '_blank')
// } else {
// this.$message.warning('无权访问')
// }
}
} else {
this.$message.error(res.message)
}
}, e => {
this.$message.error('无权访问')
})
},
// 分页
pageChange (page) {
this.page = page
this.saveNote = ''
this.selectStandard()
},
pageSizeChange (pageSize) {
this.rows = pageSize
this.saveNote = ''
this.selectStandard()
},
// 搜索
@@ -232,36 +124,19 @@ export default {
},
// 查询、加载数据
selectStandard () {
this.$http.get('person/personCollect/page', {
pageNo: this.page,
pageSize: this.$store.getters.userInfo.configContent,
modeType: 'STAND',
collectTitle: this.search.collectionStandard,
userId: this.$store.getters.userInfo.userId
this.$http.get('sarPersonalCenter/sar-user-star/getList', {
current: this.page,
size: this.$store.getters.userInfo.configContent,
userId: this.$store.getters.userInfo.userId,
name: this.search.name
}, {
_this: this,
loading: 'loading'
}, res => {
// for (let i = 0; i < res.data.list.length; i++) {
// res.data.list[i].checked = false
// res.data.list[i].check = false
// res.data.list[i].seeBtn = '查看笔记'
// }
res.data.list.map((item, index) => {
item.checked = false
})
this.standardList = []
this.standardList = res.data.list
this.total = res.data.count
this.standardList = res.data.records
this.total = res.data.total
this.contentOpen = true
// if (this.saveNote !== '') {
// this.standardList[this.saveNote].check = true
// if (this.standardList[this.saveNote].check === true) {
// this.standardList[this.saveNote].seeBtn = '关闭笔记'
// } else {
// this.standardList[this.saveNote].seeBtn = '查看笔记'
// }
// }
}, e => {})
},
// 取消收藏
@@ -273,130 +148,28 @@ export default {
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.put('person/personCollect/updateByUserId ', {
modeType: 'STAND',
id: id
}, {
_this: this
}, res => {
this.contentOpen = false
this.pageChange(1)
}, e => {
})
}).catch(() => {
})
},
// 查看笔记
writeStandardNotes (item, index) {
item.check = !item.check
if (item.check === true) {
item.seeBtn = '关闭笔记'
} else {
item.seeBtn = '查看笔记'
}
for (let i = 0; i < this.standardList.length; i++) {
if (i !== index) {
this.standardList[i].check = false
this.standardList[i].seeBtn = '查看笔记'
}
}
},
// 添加笔记
createStandardNote (item, index) {
this.standardModal = true
this.noteType = false
this.modalType = 1
this.standardTitle = '添加笔记'
this.standardForm.textarea = ''
this.standardForm = item
this.saveNote = index
},
// 查看此条笔记
viewStandardData (note) {
this.standardModal = true
this.standardTitle = '查看笔记'
this.standardForm.textarea = note.noteContentValue
this.noteType = true
this.modalType = 3
},
// 修改笔记
noteStandardEdit (note, index) {
this.standardModal = true
this.noteType = false
this.standardTitle = '修改笔记'
this.modalType = 2
this.standardForm.id = note.id
this.standardForm.textarea = note.noteContentValue
this.saveNote = index
},
// 删除笔记
noteStandardDel (note, index) {
this.saveNote = index
this.$confirm('确认删除该条数据?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
confirmButtonClass: 'common-button-primary',
roundButton: true
}).then(() => {
this.$http.post('lawss/utNoteInfo/deleteNote', {
ids: note.id
},
{
var json = {}
json.userId = this.$store.getters.userInfo.userId
json.id = id
this.$http.postData('/sarPersonalCenter/sar-user-star/delete',json, {
_this: this
}, res => {
if (res.ok) {
this.selectStandard()
} else {
this.$message.success('已取消收藏')
this.contentOpen = false
this.pageChange(1)
}
}).catch(() => {
}, e => {
})
})
},
closeModal () {
this.standardModal = false
this.$refs['standardForm'].resetFields()
},
// 保存笔记 (新增、编辑)
saveClass () {
this.$refs['standardForm'].validate((valid) => {
if (valid) {
this.standardModal = false
if (this.modalType === 1) {
let noteForm = {}
noteForm.noteContentValue = this.standardForm.textarea
noteForm.sourceType = 'COSTAND'
noteForm.noteName = this.standardForm.collectTitle
noteForm.sarId = this.standardForm.id
noteForm.forwardId = this.standardForm.collectResId
this.$http.post('lawss/utNoteInfo/saveNote', noteForm, {
_this: this,
loading: 'isSubmit'
}, res => {
this.selectStandard()
}, e => {
})
} else if (this.modalType === 2) {
let noteForm = {
id: this.standardForm.id,
noteContentValue: this.standardForm.textarea
}
this.$http.post('lawss/utNoteInfo/updateNote', noteForm, {
_this: this
}, res => {
this.selectStandard()
}, e => {
})
}
} else {
this.$message.error('请正确输入')
}
}).catch(() => {
})
},
getDate (date) {
return date != null ? date.substring(0, date.indexOf(' ')) : ''
},
cancleCollectBatch () {
console.log(this.selectedList);
return
if (this.selectedList.length === 0) {
this.$confirm('请先选择数据进行取消收藏', '提示', {
showCancelButton: false,
@@ -17,19 +17,22 @@ export default {
data () {
return {
active: 'CollectionStandard',
tabsList: [ {
title: '已收藏的标准法规',
name: 'CollectionStandard'
}, {
title: '已收藏的动态&资料 ',
name: 'CollectionDynamics'
}, {
title: '已收藏的政策',
name: 'CollectionLaws'
}, {
title: '已收藏的标准拆分',
name: 'CollectionBreak'
}]
tabsList: [
{
title: '已收藏的标准法规',
name: 'CollectionStandard'
},
// {
// title: '已收藏的动态&资料 ',
// name: 'CollectionDynamics'
// }, {
// title: '已收藏的政策',
// name: 'CollectionLaws'
// }, {
// title: '已收藏的标准拆分',
// name: 'CollectionBreak'
// }
]
}
},
methods: {