customFields.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. <template>
  2. <div class="patent-tree-filter">
  3. <el-container>
  4. <el-header class="patent-query-filter-header">
  5. <!-- 已读、未读、全部 -->
  6. <div class="query-read-status" style="margin: 0px 5px 0px 5px;" v-for="(item, key) in readList" :key="key"
  7. :class="{ 'query-read-status_is-active': readStatus[key].value == returnData.read }"
  8. @click="handleReadQuery(readStatus[key].value)">
  9. <span class="a">(<span class="b">{{ item }}</span>)</span>
  10. <span class="c">{{ readStatus[key].label }}</span>
  11. </div>
  12. </el-header>
  13. <el-main class="patent-tree-filter-main">
  14. <template v-if="field.length > 0">
  15. <el-collapse v-model="activeNames" @change="handleChange" style="margin: 0px 5px 0px 5px;">
  16. <el-collapse-item v-for="item in field" :title="item.name" :name="item.id" :key="item.id"
  17. v-if="sourceQuery[item.id] && item.type != 2">
  18. <div class="patent-query-filter-search">
  19. <div class="patent-query-filter-search-input">
  20. <el-input v-if="item.type != 6" v-model="sourceQuery[item.id].name" size="small"
  21. placeholder="请输入查询内容"></el-input>
  22. <div v-else-if="!item.type" class="year-data-picker">
  23. <el-date-picker clear-icon size="small" v-model="sourceQuery[item.id].datePicker[0]" type="year"
  24. value-format="yyyy" placeholder="请选择时间"></el-date-picker>
  25. <span style="margin: 5px;">至</span>
  26. <el-date-picker clear-icon size="small" v-model="sourceQuery[item.id].datePicker[1]" type="year"
  27. value-format="yyyy" placeholder="请选择时间"></el-date-picker>
  28. </div>
  29. </div>
  30. <el-button v-if="item.type != 6" @click="handleSearch(item)" size="small" type="primary"
  31. icon="el-icon-search" circle></el-button>
  32. </div>
  33. <el-checkbox-group v-if="item.type != 6" v-model="sourceQuery[item.id].checked" @change="onChange(item.id)">
  34. <div class="source-checkbox">
  35. <el-checkbox v-for="source in sourceData[item.id]" :label="source.key" :key="source.id">
  36. <span class="source-checkbox-label" :title="source.label">{{ source.label }}</span>
  37. <span class="source-checkbox-count">({{ source.count }})</span>
  38. </el-checkbox>
  39. </div>
  40. </el-checkbox-group>
  41. <el-tree v-else @check-change="onChangeTree" :ref="item.id" :data="item.option" show-checkbox node-key="id"
  42. check-strictly default-expand-all>
  43. <div class="custom-filter-tree-node" slot-scope="{ node, data }">
  44. <span class="name">{{ data.name }}</span>
  45. <span class="total">({{ getCount(item.id, data.id) }})</span>
  46. </div>
  47. </el-tree>
  48. <div class="patent-query-filter-search-bottom" v-if="item.type != 6">
  49. <el-button type="success" size="small" @click="handleSelectAll(item)">全选</el-button>
  50. <el-button type="danger" size="small" @click="handleSelectCancel(item)">取消</el-button>
  51. <el-button v-if="!sourceQuery[item.id].isEnd" type="primary" size="small" @click="handleLoadMore(item)"
  52. :loading="sourceQuery[item.id].loading">加载更多</el-button>
  53. <span v-else></span>
  54. </div>
  55. </el-collapse-item>
  56. </el-collapse>
  57. </template>
  58. <template v-else>
  59. <div class="no-data">暂无数据</div>
  60. </template>
  61. </el-main>
  62. </el-container>
  63. </div>
  64. </template>
  65. <script>
  66. // import { patentQueryMixins } from "@/views/task/components/mixins";
  67. // import { getTreeLastChildren, getTreeDataList } from "@/utils";
  68. export default {
  69. // mixins: [patentQueryMixins],
  70. // props:["reportId","taskId","isHidden"],
  71. data() {
  72. return {
  73. // isHidden: true,// 是都显示已读、未读、全部
  74. readList: [],//已读未读全部
  75. activeNames: '',//展示哪一个面板
  76. // 已读未读状态信息
  77. readStatus: {
  78. all: {
  79. label: "全部",
  80. value:"3"
  81. },
  82. read: {
  83. label: "已读",
  84. value:"1"
  85. },
  86. noRead: {
  87. label: "未读",
  88. value:"0"
  89. },
  90. },
  91. sourceQuery: [],
  92. // 分页信息
  93. queryParams: {
  94. current: 1,
  95. size: 10,
  96. total: 0,
  97. },
  98. }
  99. },
  100. watch: {
  101. },
  102. mounted() {
  103. },
  104. methods: {
  105. // 加载更多
  106. handleLoadMore(){},
  107. // 全选
  108. handleSelectAll(){},
  109. // 取消
  110. handleSelectCancel(){},
  111. // 点击节点发生的变化
  112. onChangeTree(val){},
  113. // 点击面版
  114. handleChange(val){},
  115. // 点击已读、未读、全部
  116. handleReadQuery(val) { },
  117. }
  118. }
  119. </script>
  120. <style lang="scss">
  121. .patent-tree-filter {
  122. height: 100%;
  123. .patent-tree-filter-main {
  124. height: 100%;
  125. padding: 10px 0;
  126. .no-data {
  127. text-align: center;
  128. color: #6b6868;
  129. }
  130. }
  131. .change-show-type {
  132. font-size: 13px;
  133. .change-show-type-info {
  134. color: #6b6868;
  135. padding-left: 10px;
  136. }
  137. .el-form-item__label {
  138. padding: 0 !important;
  139. line-height: 20px;
  140. }
  141. .el-form-item__content {
  142. height: 30px;
  143. line-height: 30px;
  144. }
  145. }
  146. }
  147. .patent-query-filter-search {
  148. display: flex;
  149. }
  150. .patent-query-filter-search-input {
  151. margin-right: 5px;
  152. }
  153. .patent-query-filter-search-bottom {
  154. text-align: center;
  155. margin-top: 10px;
  156. }
  157. .year-data-picker {
  158. width: 200px;
  159. display: flex;
  160. justify-content: space-between;
  161. .el-input__prefix {
  162. display: none;
  163. }
  164. .el-input__inner {
  165. padding: 10px;
  166. text-align: center;
  167. }
  168. }
  169. .year-data-input {
  170. width: 100px;
  171. }
  172. .source-checkbox {
  173. margin-top: 10px;
  174. span {
  175. display: inline-block;
  176. font-size: 13px;
  177. }
  178. .el-checkbox {
  179. display: block;
  180. }
  181. .el-checkbox__label {
  182. position: relative;
  183. top: 5px;
  184. }
  185. .source-checkbox-count {
  186. color: #409EFF;
  187. position: relative;
  188. top: -4px;
  189. left: 10px;
  190. }
  191. .source-checkbox-label {
  192. max-width: 190px;
  193. padding-left: 5px;
  194. overflow: hidden;
  195. white-space: nowrap;
  196. text-overflow: ellipsis;
  197. }
  198. }
  199. .query-read-status {
  200. font-size: 12px;
  201. height: 25px;
  202. line-height: 25px;
  203. cursor: pointer;
  204. background: #dcdcdc;
  205. border-radius: 3px;
  206. padding: 0 5px;
  207. span {
  208. display: inline-block;
  209. }
  210. .a {}
  211. .b {
  212. text-align: center;
  213. width: 30px;
  214. }
  215. .c {
  216. padding-left: 5px;
  217. }
  218. }
  219. .query-read-status_is-active {
  220. background: #409EFF !important;
  221. color: #ffffff !important;
  222. }
  223. </style>