patentList.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. <template>
  2. <div class="height_100">
  3. <div class="height_100" style="display:flex">
  4. <div class="height_100" :style="{width:showRight?'calc( 100% - 300px )':'100%'}">
  5. <el-container>
  6. <el-header style="padding:0 10px !important;">
  7. <div id="step1">
  8. <mySearch style="width:500px" :SearchFields="searchFiled" @search="search" :searchValue="searchOption">
  9. </mySearch>
  10. </div>
  11. <div style="display:flex;align-items:center">
  12. <el-dropdown id="step4" trigger="click" split-button type="primary" size="small" @click="handleFieldManage"
  13. @command="handleCommand($event)">
  14. <span v-disabled="false">显示栏位管理</span>
  15. <el-dropdown-menu slot="dropdown" class="text-align_center">
  16. <el-dropdown-item command="1">任务分配</el-dropdown-item>
  17. <el-dropdown-item>
  18. <el-dropdown trigger="hover" placement="right-start" @command="handleCommand($event)">
  19. <p>导入专利<i class="el-icon-arrow-right el-icon--right"></i></p>
  20. <el-dropdown-menu slot="dropdown">
  21. <el-dropdown-item command="2">专利号导入</el-dropdown-item>
  22. <el-dropdown-item command="3">Excel导入</el-dropdown-item>
  23. <el-dropdown-item command="4">检索导入</el-dropdown-item>
  24. </el-dropdown-menu>
  25. </el-dropdown>
  26. </el-dropdown-item>
  27. </el-dropdown-menu>
  28. </el-dropdown>
  29. <div>
  30. <el-tooltip class="item" effect="dark" :content="(showRight ? '隐藏' : '显示') + '右侧自定义栏位'" placement="top">
  31. <i :class="showRight ? 'el-icon-s-unfold' : 'el-icon-s-fold'"
  32. style="font-size: 25px; margin-left: 10px;color: #2f2f2f; cursor: pointer"
  33. @click="showRight = !showRight"></i>
  34. </el-tooltip>
  35. </div>
  36. </div>
  37. </el-header>
  38. <el-main class="height_100" style="width: 100%;">
  39. <component :is='components' :tableData="tableData" :column="fieldList" :projectId="projectId"
  40. @on-sort="handleSort" :queryParams="queryParams"></component>
  41. </el-main>
  42. <el-footer class="pagination">
  43. <el-pagination background layout="total, sizes, prev, pager, next, jumper"
  44. :current-page.sync="queryParams.current" :page-sizes="sizeArr" :page-size.sync="queryParams.size"
  45. @current-change="handleCurrentChange" @size-change="getList" :total="total">
  46. </el-pagination>
  47. </el-footer>
  48. </el-container>
  49. </div>
  50. <div class="height_100 right" v-if="showRight" :style="{'min-width':showRight?'300px':'0px'}">
  51. <customFields :projectId="projectId"></customFields>
  52. </div>
  53. </div>
  54. <field ref="field" type="patentProject" @getFieldList="getFieldList"></field>
  55. </div>
  56. </template>
  57. <script>
  58. import field from '@/views/components/dialog/fields.vue';
  59. import PatentTableListView from '@/views/project/patentCollection/components/views/Table.vue'
  60. import customFields from '../patentListTask/components/customFields.vue';
  61. export default {
  62. components: {
  63. field,
  64. PatentTableListView,
  65. customFields,
  66. },
  67. props: {
  68. projectId: {
  69. default: 0
  70. }
  71. },
  72. data() {
  73. return {
  74. //显示组件
  75. components: 'PatentTableListView',
  76. //显示右侧
  77. showRight: false,
  78. //检索字段
  79. searchFiled: [],
  80. //检索条件
  81. searchOption: {},
  82. //专利数据库数据总数
  83. total: 0,
  84. //分页信息
  85. queryParams: {
  86. size: 10,
  87. current: 1,
  88. },
  89. //页大小
  90. sizeArr: [10, 20, 30, 40, 50, 100],
  91. //排序
  92. sort: [
  93. {
  94. "orderBy": "createTime",
  95. "orderType": 1
  96. }
  97. ],
  98. //专利列表
  99. tableData: [],
  100. //显示栏位
  101. fieldList: []
  102. };
  103. },
  104. watch: {},
  105. computed: {},
  106. created() { },
  107. async mounted() {
  108. this.fieldList = await this.$commonJS.getCustomField('patent')
  109. this.getList()
  110. },
  111. methods: {
  112. // 搜索
  113. search() {
  114. let params = {}
  115. val.forEach(item => {
  116. if (item.type == 3) {
  117. params[item.value] = item.searchValue.map(itemValue => {
  118. return itemValue.value
  119. })
  120. } else {
  121. params[item.value] = item.searchValue.label
  122. }
  123. })
  124. // 返回字符串
  125. this.searchOption = params
  126. // 调用查询接口
  127. this.queryParams.current = 1
  128. this.getList()
  129. },
  130. //获取专利列表
  131. getList() {
  132. let params = {
  133. ...this.queryParams,//分页信息
  134. projectId: this.projectId,
  135. searchQuery: this.$commonJS.objectToString(this.searchOption),//检索条件
  136. orderDTOList: this.sort,//排序信息
  137. }
  138. this.$api.QueryPatent(params).then(res => {
  139. if (res.code == 200) {
  140. this.tableData = res.data.data
  141. this.total = res.data.total
  142. }
  143. }).catch(error => {
  144. this.tableData = []
  145. this.total = 0
  146. })
  147. },
  148. //排序
  149. handleSort({ column, prop, order }) {
  150. //如需要多个字段排序,则不需要清空
  151. var params = {
  152. sort: this.sort,
  153. column,
  154. prop,
  155. order,
  156. }
  157. this.sort = this.$commonJS.getSortData(params)
  158. this.queryParams.current = 1
  159. this.getList()
  160. },
  161. //分页
  162. handleCurrentChange(val) {
  163. this.queryParams.current = val;
  164. this.getList();
  165. },
  166. //下拉按钮
  167. handleCommand(option) {
  168. switch (option) {
  169. case '1'://分配任务
  170. this.toAllocationTask()
  171. break;
  172. case '2'://专利号导入
  173. this.patentImport(1)
  174. break;
  175. case '3'://excel导入
  176. this.patentImport(2)
  177. break;
  178. case '4'://检索导入
  179. this.patentImport(4)
  180. break;
  181. }
  182. },
  183. // 去分配任务页面
  184. toAllocationTask() {
  185. this.$router.push({
  186. path: '/allocationTask',
  187. query: {
  188. projectId: this.projectId,
  189. }
  190. })
  191. },
  192. //专利导入
  193. patentImport(type) {
  194. var form = {
  195. importToId: this.projectId,
  196. importToType: 1,
  197. type: type,
  198. }
  199. this.$commonJS.toImportParent(form, type)
  200. },
  201. //显示栏位管理
  202. handleFieldManage() {
  203. this.$refs.field.open(this.fieldList)
  204. },
  205. //获取自定义栏位
  206. getFieldList(data) {
  207. this.fieldList = data
  208. },
  209. },
  210. };
  211. </script>
  212. <style lang="scss" scoped>
  213. .left {
  214. width: 100%
  215. }
  216. .right {
  217. width: 100%
  218. }
  219. </style>