index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470
  1. <template>
  2. <div class="height_100">
  3. <el-container>
  4. <el-header>
  5. <div>
  6. <mySearch style="width:500px" :SearchFields="searchFiled" @search="search" :searchValue="searchOption">
  7. </mySearch>
  8. </div>
  9. <div style="display:flex;">
  10. <el-button-group style="display:flex;justify-content:flex-start" v-if="[2].indexOf(isOperate) == -1">
  11. <el-button v-for="item in viewTypes" :key="item.component" size="small"
  12. :type="viewType == item.component ? 'primary' : ''" @click="onChange2(item.component)">{{ item.name
  13. }}</el-button>
  14. </el-button-group>
  15. <el-dropdown size="small" style="margin-right:20px" v-if="$permission('/pcs/report/add')">
  16. <el-button type="primary" size="small">
  17. 创建报告<i class="el-icon-arrow-down el-icon--right"></i>
  18. </el-button>
  19. <el-dropdown-menu slot="dropdown" style="margin-top:0px" v-if="dictMessage.REPORT_TYPE">
  20. <!-- 遍历按钮 -->
  21. <el-dropdown-item
  22. v-for="item in dictMessage.REPORT_TYPE.filter(item => !['6'].includes(item.dictChildValue))"
  23. :key="item.dictChildLabel" @click.native="handleAnalyse(item.dictChildValue)"
  24. v-if="$permission('/pcs/report/add/' + item.permission)">{{ item.dictChildLabel }}</el-dropdown-item>
  25. </el-dropdown-menu>
  26. </el-dropdown>
  27. </div>
  28. </el-header>
  29. <el-main id="patent-list-container" class="main" v-loading="loading">
  30. <component :is="viewType" v-bind="$attrs" v-on="$listeners" :isOperate="isOperate" :tableData="dataList"
  31. :state="state" :group="group" :queryParams="queryParams" @option="handleOption" @sort="handleSort"
  32. @getRow="checkDetails" @params="getParams"></component>
  33. </el-main>
  34. <el-footer class="pagination" v-if="viewType != 'visual'">
  35. <el-pagination background layout="total,sizes, prev, pager, next, jumper" :current-page.sync="queryParams.current"
  36. :page-sizes="pageSize" :page-size.sync="queryParams.size" @current-change="handleCurrentChange"
  37. @size-change="handleSizeChange" :total="total">
  38. </el-pagination>
  39. </el-footer>
  40. </el-container>
  41. <CreateReport ref="ReportForm" @getList="isGetList"></CreateReport>
  42. </div>
  43. </template>
  44. <script>
  45. import Table from './view/table.vue'
  46. import Card from './view/card.vue'
  47. import visual from './view/visual.vue'
  48. import CreateReport from './dialog/addAndEditReport.vue'
  49. export default {
  50. components: {
  51. Table,
  52. Card,
  53. visual,
  54. CreateReport
  55. },
  56. props: {
  57. isOperate: ''
  58. },
  59. data() {
  60. return {
  61. //视图类型
  62. viewTypes: [
  63. {
  64. name: '可视化',
  65. component: 'visual'
  66. },
  67. {
  68. name: '列表',
  69. component: 'Table'
  70. },
  71. {
  72. name: '卡片',
  73. component: 'Card'
  74. },
  75. ],
  76. //当前视图类型
  77. viewType: 'Table',
  78. //检索字段
  79. searchFiled: [
  80. {
  81. label: '报告名称',
  82. value: 'name',
  83. type: 1,
  84. placeholder: '请输入报告名称'
  85. },
  86. {
  87. label: '报告类型',
  88. value: 'types',
  89. type: 3,
  90. placeholder: '请选择报告类型',
  91. // options:this.dictMessage.REPORT_TYPE||[]
  92. },
  93. {
  94. label: '报告状态',
  95. value: 'statuses',
  96. type: 3,
  97. placeholder: '请选择报告状态',
  98. // options:this.dictMessage.REPORT_STATE||[]
  99. },
  100. {
  101. label: '核心结论',
  102. value: 'cronIds',
  103. type: 3,
  104. placeholder: '请选择核心结论',
  105. options: []
  106. },
  107. ],
  108. //检索条件
  109. searchOption: {
  110. name: localStorage.searchContent
  111. },
  112. //分页信息
  113. queryParams: {
  114. current: 1,
  115. size: 10,
  116. },
  117. //总数
  118. total: 0,
  119. //分页数量
  120. pageSize: [10, "全部"],
  121. //排序字段
  122. sort: [
  123. {
  124. "orderBy": "createTime",
  125. "orderType": 1
  126. }
  127. ],
  128. //分组
  129. group: '',
  130. //加载
  131. loading: false,
  132. //报告数据集合
  133. dataList: [],
  134. //获取报告类型、报告状态、核心结论
  135. reportSearch: {},
  136. };
  137. },
  138. watch: {},
  139. computed: {
  140. dictMessage() {
  141. var a = this.$store.state.dictMessage.dictMessage
  142. if (a.REPORT_TYPE) {
  143. a.REPORT_TYPE.forEach(item => {
  144. if (['0', '1', '2'].includes(item.dictChildValue)) {
  145. item.permission = 'invalid'
  146. } else if (item.dictChildValue == 3) {
  147. item.permission = 'FTO'
  148. } else if (item.dictChildValue == 4) {
  149. item.permission = 'tort'
  150. } else if (item.dictChildValue == 5) {
  151. item.permission = 'avoidDesign'
  152. } else if (item.dictChildValue == 7) {
  153. item.permission = 'reInvalid'
  154. }
  155. })
  156. }
  157. if (a.REPORT_TYPE) {
  158. this.searchFiled[1].options = a.REPORT_TYPE.map(item => {
  159. return {
  160. value: item.dictChildValue,
  161. label: item.dictChildLabel
  162. }
  163. })
  164. this.searchFiled[2].options = a.REPORT_STATE.map(item => {
  165. return {
  166. value: item.dictChildValue,
  167. label: item.dictChildLabel
  168. }
  169. })
  170. }
  171. return a
  172. },
  173. state() {
  174. var a = this.$store.state.dictMessage.dictMessage.REPORT_STATE
  175. var b = {}
  176. if (a) {
  177. a.forEach(item => {
  178. b[item.dictChildValue] = item.dictChildLabel
  179. });
  180. return b
  181. }
  182. return []
  183. }
  184. },
  185. created() { },
  186. mounted() {
  187. //获取报告清单
  188. this.getList()
  189. // 获取报告类型、获取报告状态、 获取核心结论
  190. // this.getReportSearch()
  191. },
  192. methods: {
  193. // 获取报告类型、获取报告状态、 获取核心结论
  194. getReportSearch() {
  195. this.$api.search(params).then(res => {
  196. if (res.code == 200) {
  197. this.reportSearch.types = res.data.types
  198. this.reportSearch.statuses = res.data.statuses
  199. this.reportSearch.cronIds = res.data.cronIds
  200. this.searchFiled.forEach(item => {
  201. if (item.type == 3) {
  202. item.options = this.reportSearch[item.value]
  203. }
  204. })
  205. }
  206. }).catch(error => {
  207. this.reportSearch.type = []
  208. this.reportSearch.state = []
  209. this.reportSearch.conclusion = []
  210. this.$message.error(error.message)
  211. })
  212. },
  213. //接收检索条件
  214. search(val) {
  215. let params = {}
  216. val.forEach(item => {
  217. if (item.type == 3) {
  218. params[item.value] = item.searchValue.map(itemValue => {
  219. return itemValue.value
  220. })
  221. } else {
  222. params[item.value] = item.searchValue.label
  223. }
  224. })
  225. // 返回字符串
  226. this.searchOption.searchQuery = this.$commonJS.objectToString(params)
  227. // 调用查询接口
  228. this.queryParams.current = 1
  229. this.getList()
  230. },
  231. //获取报告列表
  232. getList() {
  233. this.dataList = [{}]
  234. return
  235. let params = {
  236. ...this.queryParams,//分页信息
  237. ...this.searchOption,//检索条件
  238. orderDTOList: this.sort,//排序信息
  239. }
  240. this.$api.query(params).then(res => {
  241. if (res.code == 200) {
  242. this.dataList = res.data
  243. this.total = res.total
  244. }
  245. }).catch(error => {
  246. this.dataList = []
  247. this.total = 0
  248. this.$message.error(error.message)
  249. })
  250. },
  251. //排序
  252. handleSort({ column, prop, order }) {
  253. this.sort = []//如需要多个字段排序,则不需要清空
  254. if (order == 'null') {
  255. return;
  256. }
  257. var orderType = {
  258. ascending: 0,
  259. descending: 1
  260. }
  261. var params = this.sort.find(item => {
  262. return item.orderBy == prop
  263. })
  264. if (params) {
  265. params.orderType = orderType[order]
  266. } else {
  267. params = {}
  268. params.orderBy = prop
  269. params.orderType = orderType[order]
  270. this.sort.push(params)
  271. }
  272. this.queryParams.current = 1
  273. this.getList()
  274. },
  275. //分页
  276. handleCurrentChange(val) {
  277. this.queryParams.current = val;
  278. this.getList();
  279. },
  280. //切换页大小
  281. handleSizeChange(val) {
  282. this.getList()
  283. },
  284. //切换视图
  285. onChange2(type) {
  286. this.viewType = type
  287. if (type == 'visual') {
  288. this.$nextTick(() => {
  289. this.reportVisual()
  290. })
  291. return false
  292. }
  293. this.queryParams.size = this.viewType === 'Table' ? 10 : 12
  294. this.onChange()
  295. },
  296. //展示报告可视化
  297. reportVisual() {
  298. this.$api.reportVisual(this.queryParams).then(response => {
  299. if (response.code == 200) {
  300. this.$refs.reportVisual.open(response.data)
  301. }
  302. })
  303. },
  304. //切换视图后查询报告数据
  305. onChange() {
  306. this.queryParams.current = 1
  307. this.getList()
  308. },
  309. //打开创建报告弹窗
  310. handleAnalyse(id) {
  311. var form = {
  312. type: id,
  313. scenarioList: []
  314. }
  315. this.$refs.ReportForm.open(form)
  316. },
  317. //操作列
  318. handleOption({ option, row }) {
  319. this.$s.setSession('params', row)
  320. switch (option) {
  321. case '0'://分享
  322. this.share(row)
  323. break
  324. case '1'://导出报告
  325. this.exportReport(row)
  326. break
  327. case '2'://报告文档
  328. this.handleFile(row)
  329. break
  330. case '5'://拆分特征
  331. this.handleDetails(row)
  332. break
  333. case '3'://自定义字段
  334. this.handleFields(row)
  335. break
  336. case '4'://任务分配
  337. this.handleTask(row)
  338. break
  339. case '6'://导入专利
  340. this.handleImportPatent(row)
  341. break
  342. case '7'://删除
  343. this.handleDelete(row)
  344. break;
  345. case '8'://侵权分析技术特征对比
  346. this.$s.setSession('reportMessage1', row)
  347. var routerReport3 = this.$router.resolve({
  348. path: "/tortIndex",
  349. query: {
  350. id: row.id,
  351. patentNo: row.signPatentNo,
  352. personId: row.personId,
  353. type: 8
  354. }
  355. })
  356. window.open(routerReport3.href, '_blank');
  357. break
  358. case '9'://回避设计
  359. this.handleDetails(row)
  360. break;
  361. case '10'://添加对比文件
  362. this.addPatentList(row)
  363. break
  364. case '11'://完成报告
  365. this.completeReport(row)
  366. break
  367. case '12'://追踪报告
  368. this.trackReport(row)
  369. break
  370. case '13'://添加无效理由和证据
  371. this.toInvalidIndex(row)
  372. break;
  373. case '14'://导入无效证据
  374. this.toInvalidResponset(row)
  375. break;
  376. case 'e'://编辑
  377. this.handleEdit(row)
  378. break
  379. }
  380. },
  381. // 删除报告
  382. handleDelete(row) {
  383. this.$confirm('此操作将永久删除该报告, 是否继续?', '提示', {
  384. confirmButtonText: '确定',
  385. cancelButtonText: '取消',
  386. type: 'warning'
  387. }).then(() => {
  388. this.$api.dele(params).then(res => {
  389. if (res.code == 200) {
  390. this.$message.success('删除报告成功')
  391. this.getList()
  392. }
  393. }).catch(err => {
  394. this.$message.error(err.message)
  395. })
  396. }).catch(() => {
  397. this.$message.info("已取消删除")
  398. });
  399. },
  400. //编辑报告
  401. handleEdit(row) {
  402. this.$refs.ReportForm.open(row)
  403. },
  404. //查看详情(修改)
  405. checkDetails(row) {
  406. row.dictMessage = this.dictMessage
  407. row.showMenu = true
  408. this.$s.setSession('row', row)
  409. this.$s.setSession('params', row)
  410. switch (row.type) {
  411. case 0://无效分析
  412. case 1://稳定性分析
  413. case 2://第三方意见
  414. var router = this.$router.resolve({
  415. name: 'rDetails',
  416. })
  417. window.open(router.href, '_blank');
  418. break;
  419. case 3://FTO
  420. case 4://侵权
  421. var router = this.$router.resolve({
  422. name: 'FTOrDetails',
  423. })
  424. window.open(router.href, '_blank');
  425. break;
  426. case 5://回避
  427. var router = this.$router.resolve({
  428. name: 'avoidAside',
  429. })
  430. window.open(router.href, '_blank');
  431. break;
  432. case 6://图表
  433. break;
  434. case 7://无效应对
  435. var router = this.$router.resolve({
  436. name: 'InvalidResponse',
  437. })
  438. window.open(router.href, '_blank');
  439. break;
  440. }
  441. },
  442. //接收可视化的参数
  443. getParams(params) {
  444. if (params.conclusionType == '-1') {
  445. this.searchOption.statuses = ['0', '1', '2', '4', '5']
  446. this.searchOption.types = [params.type]
  447. } else {
  448. this.searchOption.cronIds = [params.conclusionType]
  449. }
  450. var a = JSON.parse(JSON.stringify(this.searchOption))
  451. this.searchOption = a
  452. this.viewType = 'Table'
  453. this.onChange()
  454. },
  455. //创建报告子组件返回值
  456. isGetList(val) {
  457. if (val) {
  458. this.getList()
  459. }
  460. }
  461. },
  462. };
  463. </script>
  464. <style lang="scss" scoped></style>