index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453
  1. <template>
  2. <div class="height_100">
  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. <field ref="field" type="patent" @getFieldList="getFieldList"></field>
  114. </div>
  115. </template>
  116. <script>
  117. import { downLoad2, getTreeDataList, getTreeLastChildren, getPatentCountry } from "@/utils"
  118. import FieldDrawer from '@/views/components/drawer/Field.vue'
  119. import PatentAbstractListView from './components/views/Abstract'
  120. import PatentTableListView from './components/views/Table.vue'
  121. import PatentPictureListView from './components/views/Picture'
  122. // import PatentPDFListView from './components/views/PDF.vue'
  123. import field from '@/views/components/dialog/fields.vue';
  124. export default {
  125. components: {
  126. FieldDrawer,
  127. PatentAbstractListView,
  128. PatentTableListView,
  129. PatentPictureListView,
  130. field
  131. },
  132. props: {},
  133. data() {
  134. return {
  135. //是否隐藏左侧
  136. showLeft: false,
  137. //检索字段
  138. searchFiled: [],
  139. //检索条件
  140. searchOption: {
  141. name: localStorage.searchContent,
  142. },
  143. //专利数据库ID
  144. projectId: 0,
  145. //视图方式
  146. viewList: [
  147. {
  148. value: 'patent-table-list-view',
  149. title: '表格视图',
  150. btn: 'el-icon-tickets',
  151. },
  152. {
  153. value: 'patent-abstract-list-view',
  154. title: '摘要视图',
  155. btn: 'el-icon-news',
  156. },
  157. {
  158. value: 'patent-picture-list-view',
  159. title: '图片视图',
  160. btn: 'el-icon-picture-outline',
  161. },
  162. {
  163. value: 'PatentPDFListView',
  164. title: 'PDF视图',
  165. btn: 'iconfont icon-pdf',
  166. }
  167. ],
  168. //选择的视图
  169. viewSelected: "patent-table-list-view",
  170. //显示栏位
  171. customList: [],
  172. //同族
  173. familyObj: {
  174. 0: '不区分同族',
  175. 1: '简单同族',
  176. 2: 'INPADOC同族',
  177. 3: '扩展同族',
  178. },
  179. //页大小
  180. sizeArr: [10, 20, 30, 40, 50, 100],
  181. //分页
  182. queryParams: {
  183. current: 1,
  184. size: 10
  185. },
  186. //总数
  187. total: 0,
  188. //排序
  189. sort: [],
  190. //选择的专利集合
  191. patentNoList: [],
  192. //加载
  193. loading: false,
  194. // 数据
  195. tableData: [],
  196. };
  197. },
  198. watch: {},
  199. computed: {
  200. // 专题库id
  201. id() {
  202. return this.$route.query.id
  203. },
  204. },
  205. created() { },
  206. async mounted() {
  207. this.customList = await this.$commonJS.getCustomField('patent')
  208. await this.getColumn()
  209. // 获取专利信息
  210. this.getList()
  211. },
  212. methods: {
  213. //获取table栏位及分组字段、检索字段
  214. async getColumn() {
  215. let params = ['patent']
  216. await this.$api.getParamsCommon(params).then(res => {
  217. if (res.code == 200) {
  218. let conditionDTOList = JSON.parse(JSON.stringify(res.data[0].conditionDTOList))
  219. // 搜索字段
  220. this.searchFiled = this.$commonJS.getField(conditionDTOList, (u) => u.ifSearch == true, {
  221. label: 'name',
  222. value: 'value',
  223. type: 'type',
  224. })
  225. }
  226. })
  227. },
  228. //检索
  229. search(val) {
  230. let params = {}
  231. val.forEach(item => {
  232. if (item.type == 3) {
  233. params[item.value] = item.searchValue.map(itemValue => {
  234. return itemValue.value
  235. })
  236. } else {
  237. params[item.value] = item.searchValue.label
  238. }
  239. })
  240. // 返回字符串
  241. this.searchOption = params
  242. // 调用查询接口
  243. this.queryParams.current = 1
  244. this.getList()
  245. },
  246. //切换视图
  247. async handleChangeView(item) {
  248. this.viewSelected = item.value
  249. this.queryParams.current = 1
  250. // if (this.viewSelected == 'PatentPDFListView') {
  251. // return false
  252. // }
  253. if (this.viewSelected === 'patent-picture-list-view') {
  254. this.$set(this.queryParams, 'size', 20)
  255. } else {
  256. this.queryParams.size = 10
  257. }
  258. this.getList()
  259. },
  260. //获取专利信息
  261. getList(size) {
  262. if (size) {
  263. this.queryParams.size=size
  264. }
  265. let params = {
  266. ...this.queryParams,//分页信息
  267. projectId: this.id,
  268. searchQuery: this.$commonJS.objectToString(this.searchOption),//检索条件
  269. orderDTOList: this.sort,//排序信息
  270. }
  271. this.$api.QueryPatent(params).then(res => {
  272. if (res.code == 200) {
  273. this.tableData = res.data.data
  274. this.total = res.data.total
  275. }
  276. }).catch(error => {
  277. this.tableData = []
  278. this.total = 0
  279. })
  280. },
  281. //排序
  282. handleSort({ column, prop, order }) {
  283. //如需要多个字段排序,则不需要清空
  284. var params = {
  285. sort: this.sort,
  286. column,
  287. prop,
  288. order,
  289. }
  290. this.sort = this.$commonJS.getSortData(params)
  291. this.queryParams.current = 1
  292. this.getList()
  293. },
  294. //分页
  295. handleCurrentChange(val) {
  296. this.queryParams.current = val;
  297. this.getList();
  298. },
  299. //自定义栏位管理
  300. handleField() {
  301. this.$refs.FieldDrawer.open(5)
  302. },
  303. //获取自定义栏位
  304. getFieldList(data) {
  305. this.customList = data
  306. },
  307. //显示栏位管理
  308. async handleFieldManage() {
  309. this.$refs.field.open(this.customList)
  310. },
  311. //批量上传说明书
  312. handleBatch() {
  313. this.$refs.batchInstructionDialog.open()
  314. },
  315. //报告文档
  316. handleFile() {
  317. this.$refs.projectFileDrawer.open(this.projectId, 1)
  318. },
  319. // 事件按钮
  320. handleQuestion() {
  321. let a = this.$router.resolve({
  322. path: '/questionEvent',
  323. query: {
  324. projectId: this.projectId
  325. }
  326. })
  327. window.open(a.href, '_blank');
  328. },
  329. //PDF首页导出
  330. exportPDF() {
  331. let params = JSON.parse(JSON.stringify(this.queryParams))
  332. params.tree.map(tree => {
  333. let field = params.field.filter(item => item.key === tree.key)
  334. if (field.length === 0) {
  335. params.field.push(tree)
  336. }
  337. })
  338. params.tree = undefined
  339. this.$api.pdfFirstPage(params).then(response => {
  340. if (response.code == 200) {
  341. const router = this.$router.resolve({
  342. path: '/taskList',
  343. query: {
  344. projectId: this.projectId,
  345. }
  346. })
  347. window.open(router.href, '_blank')
  348. }
  349. })
  350. },
  351. //导出专利
  352. async handleExport(selectId) {
  353. this.exportLoading = true
  354. const key = await this.saveSelectPatent(selectId)
  355. if (!key) {
  356. return false
  357. }
  358. this.exportLoading = false
  359. this.$router.push({
  360. path: '/workspace/folder/export/patent',
  361. query: {
  362. id: this.projectId,
  363. key: key
  364. }
  365. })
  366. },
  367. //切换同族
  368. onChangeFamily(key) {
  369. this.queryParams.current = 1
  370. this.queryParams.family = parseInt(key)
  371. this.getList()
  372. },
  373. //合并申请人
  374. handleMerge() {
  375. this.$refs.patentApplicantMergeDrawer.open(this.projectId)
  376. },
  377. //合并发明人
  378. handleMerge2() {
  379. this.$refs.patentInventorMergeDrawer.open(this.projectId)
  380. },
  381. //创建FTO报告
  382. handleAnalyses(id) {
  383. this.$api.getProject({ id: this.projectId }).then(response => {
  384. var form = {
  385. type: id,
  386. projectId: this.projectId,
  387. departmentId: response.data[0].departmentId,
  388. personId: response.data[0].personnelId,
  389. clientId: response.data[0].clientId,
  390. proTec: response.data[0].technicalTheme,
  391. scenarioList: response.data[0].scenarioList
  392. }
  393. this.$refs.ReportForm.open(form)
  394. })
  395. },
  396. //图表分析
  397. async handleAnalyse(path) {
  398. this.chartLoading = true
  399. const key = await this.saveSelectPatent(false)
  400. this.chartLoading = false
  401. const router = this.$router.resolve({
  402. path: '/analyse/' + path,
  403. query: {
  404. id: this.projectId,
  405. key: key
  406. }
  407. })
  408. window.open(router.href, '_blank');
  409. },
  410. //下载PDF
  411. async handleDownload(patent) {
  412. const { data } = await this.$api.getPatentInstructionList({ current: 1, size: 9999, patentNo: patent.patentNo })
  413. if (data.records.length !== 0) {
  414. downLoad2(data.records[0].url)
  415. } else {
  416. this.$alert('专利暂未上传说明书文档', '请求错误', {
  417. confirmButtonText: '确定',
  418. type: 'error',
  419. callback: action => { }
  420. });
  421. }
  422. },
  423. //切换已读未读
  424. handleChangeRead(ids, status) {
  425. let params = {
  426. patentIds: ids,
  427. projectId: this.projectId,
  428. status: status,
  429. folder: this.queryParams.folder
  430. }
  431. this.fastEditLoading = true
  432. this.$api.updatePatentReadStatus(params).then(response => {
  433. this.$refs.patentQueryFilter.getPatentReadTotal()
  434. this.fastEditLoading = false
  435. this.getList()
  436. }).catch(error => {
  437. this.fastEditLoading = false
  438. })
  439. },
  440. //自定义栏位以及标签设置值
  441. handleIndexSetting(patent, field) {
  442. if (field) {
  443. this.$refs.patentIndexSetting.open(this.queryParams.projectId, patent, field)
  444. }
  445. },
  446. },
  447. };
  448. </script>
  449. <style lang="scss" scoped></style>