index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462
  1. <template>
  2. <div>
  3. <el-container>
  4. <el-aside width="200px">Aside</el-aside>
  5. <el-container>
  6. <el-header style="display:flex;justify-content:space-between">
  7. <div style="display:flex">
  8. <el-tooltip class="item" effect="dark" :content="(showLeft ? '隐藏' : '显示') + '左侧菜单'" placement="top">
  9. <i :class="showLeft ? 'el-icon-s-fold' : 'el-icon-s-unfold'"
  10. style="font-size: 25px;position: relative; top: 5px; color: #2f2f2f; cursor: pointer"
  11. @click="showLeft = !showLeft"></i>
  12. </el-tooltip>
  13. <mySearch :SearchFields="searchFiled" @search="search" :searchValue="searchOption"></mySearch>
  14. <el-popover placement="bottom" title="关键词高亮" width="320" trigger="click">
  15. <!-- <patent-keywords-highlight :project-id="projectId" /> -->
  16. <el-button slot="reference" size="small" type="primary" class="margin-right_10 margin-left_10"
  17. :disabled="!$permission('/workspace/common/highlight')">
  18. 高亮<i class="el-icon-arrow-down el-icon--right"></i>
  19. </el-button>
  20. </el-popover>
  21. </div>
  22. <div>
  23. <el-button-group class="margin-left_10">
  24. <el-tooltip v-for="item in viewList" :key="item.value" class="item" effect="dark" :content="item.title"
  25. placement="top">
  26. <el-button @click="handleChangeView(item)" size="small"
  27. :type="viewSelected === item.value ? 'primary' : ''">
  28. <i :class="item.btn" style="font-size: 12px !important;"></i>
  29. </el-button>
  30. </el-tooltip>
  31. </el-button-group>
  32. <el-dropdown trigger="click" split-button type="primary" size="small">
  33. <span @click="handleField"
  34. v-disabled="!($permission('/workspace/common/customField') && $r(projectId, [1, 2]))">自定义栏位管理</span>
  35. <el-dropdown-menu slot="dropdown" class="text-align_center">
  36. <el-dropdown-item @click.native="handleFile">报告文档</el-dropdown-item>
  37. <el-dropdown-item @click.native="handleQuestion" v-if="$permission('/workspace/event')">事
  38. 件</el-dropdown-item>
  39. <el-dropdown-item @click.native="handleFieldManage">显示栏位管理</el-dropdown-item>
  40. <el-dropdown-item @click.native="exportPDF">导出PDF首页</el-dropdown-item>
  41. <el-dropdown-item @click.native="handleBatch"
  42. :disabled="!($permission('/workspace/folder/batchUploadSpecification') && $r(projectId, [1, 2]))">批量上传说明书</el-dropdown-item>
  43. <el-dropdown-item>
  44. <el-dropdown trigger="hover" placement="right-start">
  45. <span>
  46. 导出专利<i class="el-icon-arrow-right el-icon--right"></i>
  47. </span>
  48. <el-dropdown-menu slot="dropdown">
  49. <el-dropdown-item @click.native="handleExport(false)">当前全部</el-dropdown-item>
  50. <el-dropdown-item @click.native="handleExport(true)">当前所选</el-dropdown-item>
  51. </el-dropdown-menu>
  52. </el-dropdown>
  53. </el-dropdown-item>
  54. <el-dropdown-item>
  55. <el-dropdown trigger="hover" placement="right-start">
  56. <span>
  57. {{ familyObj[queryParams.family] }}<i class="el-icon-arrow-right el-icon--right"></i>
  58. </span>
  59. <el-dropdown-menu slot="dropdown">
  60. <el-dropdown-item v-for="(item, key) in familyObj" :key="key" @click.native="onChangeFamily(key)">{{
  61. item }}</el-dropdown-item>
  62. </el-dropdown-menu>
  63. </el-dropdown>
  64. </el-dropdown-item>
  65. <el-dropdown-item :disabled="!$permission('/workspace/folder/merge')">
  66. <el-dropdown trigger="hover" placement="right-start">
  67. <span>
  68. 合并<i class="el-icon-arrow-right el-icon--right"></i>
  69. </span>
  70. <el-dropdown-menu slot="dropdown">
  71. <el-dropdown-item @click.native="handleMerge2"
  72. :disabled="!($permission('/workspace/folder/merge/inventorMerge') && $r(projectId, [1, 2]))">发明人</el-dropdown-item>
  73. <el-dropdown-item @click.native="handleMerge"
  74. :disabled="!($permission('/workspace/folder/merge/applicationMerge') && $r(projectId, [1, 2]))">申请人/权利人</el-dropdown-item>
  75. </el-dropdown-menu>
  76. </el-dropdown>
  77. </el-dropdown-item>
  78. <el-dropdown-item v-if="$permission('/workspace/createReport')">
  79. <el-dropdown trigger="hover" placement="right-start">
  80. <span>
  81. 创建报告<i class="el-icon-arrow-right el-icon--right"></i>
  82. </span>
  83. <el-dropdown-menu slot="dropdown" style="margin-top:0px">
  84. <!-- 遍历按钮 -->
  85. <el-dropdown-item @click.native="handleAnalyses(3)"
  86. v-if="$permission('/workspace/createReport/FTO')">FTO调查</el-dropdown-item>
  87. </el-dropdown-menu>
  88. </el-dropdown>
  89. </el-dropdown-item>
  90. <el-dropdown-item @click.native="handleAnalyse('custom')"
  91. :disabled="!($permission('/workspace/folder/analyticSystem/chartAnalysis') && $r(projectId, [1, 2, 4]))">图表分析</el-dropdown-item>
  92. </el-dropdown-menu>
  93. </el-dropdown>
  94. </div>
  95. </el-header>
  96. <el-main v-loading="loading">
  97. <div>
  98. <component ref="patentViewList" :is="viewSelected" @download="handleDownload" @change-read="handleChangeRead"
  99. :projectId="projectId" :selected.sync="queryParams.selected" :patentNoList.sync="patentNoList"
  100. :column="customList" @index-setting="handleIndexSetting" @on-sort="handleSort" :queryParams="queryParams"
  101. :tableData="tableData"></component>
  102. </div>
  103. </el-main>
  104. <el-footer class="pagination">
  105. <el-pagination background layout="total, sizes, prev, pager, next, jumper"
  106. :current-page.sync="queryParams.current" :page-sizes="sizeArr" :page-size.sync="queryParams.size"
  107. @current-change="handleCurrentChange" @size-change="getList" :total="total">
  108. </el-pagination>
  109. </el-footer>
  110. </el-container>
  111. </el-container>
  112. <Field-Drawer ref="FieldDrawer"></Field-Drawer>
  113. </div>
  114. </template>
  115. <script>
  116. import { downLoad2, getTreeDataList, getTreeLastChildren, getPatentCountry } from "@/utils"
  117. import FieldDrawer from '@/views/components/drawer/Field.vue'
  118. import PatentAbstractListView from './components/views/Abstract'
  119. import PatentTableListView from './components/views/Table.vue'
  120. import PatentPictureListView from './components/views/Picture'
  121. // import PatentPDFListView from './components/views/PDF.vue'
  122. export default {
  123. components: {
  124. FieldDrawer,
  125. PatentAbstractListView,
  126. PatentTableListView,
  127. PatentPictureListView
  128. },
  129. props: {},
  130. data() {
  131. return {
  132. //是否隐藏左侧
  133. showLeft: false,
  134. //检索字段
  135. searchFiled: [],
  136. //检索条件
  137. searchOption: {
  138. name: localStorage.searchContent,
  139. },
  140. //专利数据库ID
  141. projectId: 0,
  142. //视图方式
  143. viewList: [
  144. {
  145. value: 'patent-table-list-view',
  146. title: '表格视图',
  147. btn: 'el-icon-tickets',
  148. },
  149. {
  150. value: 'patent-abstract-list-view',
  151. title: '摘要视图',
  152. btn: 'el-icon-news',
  153. },
  154. {
  155. value: 'patent-picture-list-view',
  156. title: '图片视图',
  157. btn: 'el-icon-picture-outline',
  158. },
  159. {
  160. value: 'PatentPDFListView',
  161. title: 'PDF视图',
  162. btn: 'iconfont icon-pdf',
  163. }
  164. ],
  165. //选择的视图
  166. viewSelected: "patent-table-list-view",
  167. //显示栏位
  168. customList: [],
  169. //同族
  170. familyObj: {
  171. 0: '不区分同族',
  172. 1: '简单同族',
  173. 2: 'INPADOC同族',
  174. 3: '扩展同族',
  175. },
  176. //页大小
  177. sizeArr: [10, 20, 30, 40, 50, 100],
  178. //分页
  179. queryParams: {
  180. current: 1,
  181. size: 10
  182. },
  183. //总数
  184. total: 0,
  185. //排序
  186. sort: [{ "orderBy": "createTime", "orderType": 1 }],
  187. //选择的专利集合
  188. patentNoList: [],
  189. //加载
  190. loading: false,
  191. // 数据
  192. tableData: [],
  193. };
  194. },
  195. watch: {},
  196. computed: {
  197. // 专题库id
  198. id() {
  199. return this.$route.query.id
  200. },
  201. },
  202. created() { },
  203. async mounted() {
  204. this.customList = await this.$commonJS.getCustomField('patent')
  205. await this.getColumn()
  206. // 获取专利信息
  207. this.getList()
  208. },
  209. methods: {
  210. //获取table栏位及分组字段、检索字段
  211. async getColumn() {
  212. let params = ['patent']
  213. await this.$api.getParamsCommon(params).then(res => {
  214. if (res.code == 200) {
  215. let conditionDTOList = JSON.parse(JSON.stringify(res.data[0].conditionDTOList))
  216. // 搜索字段
  217. this.searchFiled = this.$commonJS.getField(conditionDTOList, (u) => u.ifSearch == true, {
  218. label: 'name',
  219. value: 'value',
  220. type: 'type',
  221. })
  222. }
  223. })
  224. },
  225. //检索
  226. search(val) {
  227. let params = {}
  228. val.forEach(item => {
  229. if (item.type == 3) {
  230. params[item.value] = item.searchValue.map(itemValue => {
  231. return itemValue.value
  232. })
  233. } else {
  234. params[item.value] = item.searchValue.label
  235. }
  236. })
  237. // 返回字符串
  238. this.searchOption = params
  239. // 调用查询接口
  240. this.queryParams.current = 1
  241. this.getList()
  242. },
  243. //切换视图
  244. async handleChangeView(item) {
  245. this.viewSelected = item.value
  246. this.queryParams.current = 1
  247. // if (this.viewSelected == 'PatentPDFListView') {
  248. // return false
  249. // }
  250. if (this.viewSelected === 'patent-picture-list-view') {
  251. this.$set(this.queryParams, 'size', 20)
  252. } else {
  253. this.queryParams.size = 10
  254. }
  255. this.getList()
  256. },
  257. //获取专利信息
  258. getList(size) {
  259. if (size) {
  260. this.queryParams.size=size
  261. }
  262. let params = {
  263. ...this.queryParams,//分页信息
  264. projectId: this.id,
  265. searchQuery: this.$commonJS.objectToString(this.searchOption),//检索条件
  266. orderDTOList: this.sort,//排序信息
  267. }
  268. this.$api.QueryPatent(params).then(res => {
  269. if (res.code == 200) {
  270. this.tableData = res.data.data
  271. this.total = res.data.total
  272. }
  273. }).catch(error => {
  274. this.tableData = []
  275. this.total = 0
  276. })
  277. },
  278. //排序
  279. handleSort({ column, prop, order }) {
  280. //如需要多个字段排序,则不需要清空
  281. var params = {
  282. sort: this.sort,
  283. column,
  284. prop,
  285. order,
  286. }
  287. this.sort = this.$commonJS.getSortData(params)
  288. this.queryParams.current = 1
  289. this.getList()
  290. },
  291. //分页
  292. handleCurrentChange(val) {
  293. this.queryParams.current = val;
  294. this.getList();
  295. },
  296. //自定义栏位管理
  297. handleField() {
  298. this.$refs.FieldDrawer.open(5)
  299. },
  300. //显示栏位管理
  301. async handleFieldManage() {
  302. this.$refs.patentViewField.open(this.patentViewField, this.projectId, this.viewSelected)
  303. },
  304. //批量上传说明书
  305. handleBatch() {
  306. this.$refs.batchInstructionDialog.open()
  307. },
  308. //报告文档
  309. handleFile() {
  310. this.$refs.projectFileDrawer.open(this.projectId, 1)
  311. },
  312. // 事件按钮
  313. handleQuestion() {
  314. let a = this.$router.resolve({
  315. path: '/questionEvent',
  316. query: {
  317. projectId: this.projectId
  318. }
  319. })
  320. window.open(a.href, '_blank');
  321. },
  322. //PDF首页导出
  323. exportPDF() {
  324. let params = JSON.parse(JSON.stringify(this.queryParams))
  325. params.tree.map(tree => {
  326. let field = params.field.filter(item => item.key === tree.key)
  327. if (field.length === 0) {
  328. params.field.push(tree)
  329. }
  330. })
  331. params.tree = undefined
  332. this.$api.pdfFirstPage(params).then(response => {
  333. if (response.code == 200) {
  334. const router = this.$router.resolve({
  335. path: '/taskList',
  336. query: {
  337. projectId: this.projectId,
  338. }
  339. })
  340. window.open(router.href, '_blank')
  341. }
  342. })
  343. },
  344. //导出专利
  345. async handleExport(selectId) {
  346. this.exportLoading = true
  347. const key = await this.saveSelectPatent(selectId)
  348. if (!key) {
  349. return false
  350. }
  351. this.exportLoading = false
  352. this.$router.push({
  353. path: '/workspace/folder/export/patent',
  354. query: {
  355. id: this.projectId,
  356. key: key
  357. }
  358. })
  359. },
  360. //切换同族
  361. onChangeFamily(key) {
  362. this.queryParams.current = 1
  363. this.queryParams.family = parseInt(key)
  364. this.getList()
  365. },
  366. //合并申请人
  367. handleMerge() {
  368. this.$refs.patentApplicantMergeDrawer.open(this.projectId)
  369. },
  370. //合并发明人
  371. handleMerge2() {
  372. this.$refs.patentInventorMergeDrawer.open(this.projectId)
  373. },
  374. //创建FTO报告
  375. handleAnalyses(id) {
  376. this.$api.getProject({ id: this.projectId }).then(response => {
  377. var form = {
  378. type: id,
  379. projectId: this.projectId,
  380. departmentId: response.data[0].departmentId,
  381. personId: response.data[0].personnelId,
  382. clientId: response.data[0].clientId,
  383. proTec: response.data[0].technicalTheme,
  384. scenarioList: response.data[0].scenarioList
  385. }
  386. this.$refs.ReportForm.open(form)
  387. })
  388. },
  389. //图表分析
  390. async handleAnalyse(path) {
  391. this.chartLoading = true
  392. const key = await this.saveSelectPatent(false)
  393. this.chartLoading = false
  394. const router = this.$router.resolve({
  395. path: '/analyse/' + path,
  396. query: {
  397. id: this.projectId,
  398. key: key
  399. }
  400. })
  401. window.open(router.href, '_blank');
  402. },
  403. //下载PDF
  404. async handleDownload(patent) {
  405. const { data } = await this.$api.getPatentInstructionList({ current: 1, size: 9999, patentNo: patent.patentNo })
  406. if (data.records.length !== 0) {
  407. downLoad2(data.records[0].url)
  408. } else {
  409. this.$alert('专利暂未上传说明书文档', '请求错误', {
  410. confirmButtonText: '确定',
  411. type: 'error',
  412. callback: action => { }
  413. });
  414. }
  415. },
  416. //切换已读未读
  417. handleChangeRead(ids, status) {
  418. let params = {
  419. patentIds: ids,
  420. projectId: this.projectId,
  421. status: status,
  422. folder: this.queryParams.folder
  423. }
  424. this.fastEditLoading = true
  425. this.$api.updatePatentReadStatus(params).then(response => {
  426. this.$refs.patentQueryFilter.getPatentReadTotal()
  427. this.fastEditLoading = false
  428. this.getList()
  429. }).catch(error => {
  430. this.fastEditLoading = false
  431. })
  432. },
  433. //自定义栏位以及标签设置值
  434. handleIndexSetting(patent, field) {
  435. if (field) {
  436. this.$refs.patentIndexSetting.open(this.queryParams.projectId, patent, field)
  437. }
  438. },
  439. },
  440. };
  441. </script>
  442. <style lang="scss" scoped></style>