pageProduct.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  1. <template>
  2. <div class="height_100">
  3. <el-container>
  4. <el-header>
  5. <div id="step1">
  6. <mySearch style="width: 500px" :SearchFields="searchFiled" @search="search" :searchValue="searchOption"></mySearch>
  7. </div>
  8. </el-header>
  9. <el-main v-DivHeight="getDivHeight">
  10. <el-table :data="data" header-row-class-name="custom-table-header" v-if="showTable" :maxHeight="tableHeight" @sort-change="sortChange" border>
  11. <el-table-column label="#" width="60" type="index" align="center">
  12. <template slot-scope="scope">
  13. <span>{{ (scope.$index + 1) + ((queryParams.current - 1) * queryParams.size) }}</span>
  14. </template>
  15. </el-table-column>
  16. <el-table-column v-for="item in column" :render-header="$commonJS.renderHeaderMethods" :key="item.value" :prop="item.value" :label="item.name" align="center" sortable="custom">
  17. <template slot-scope="scope">
  18. <div v-if="['name'].includes(item.value)">
  19. <el-link @click="handleItem(scope.row, '2')" type="primary">
  20. <span v-html="$commonJS.getColumnData(scope.row, item)"></span>
  21. </el-link>
  22. </div>
  23. <div v-else v-html="$commonJS.getColumnData(scope.row, item)">
  24. </div>
  25. </template>
  26. </el-table-column>
  27. <el-table-column label="操作" align="center" width="150px">
  28. <template slot-scope="scope">
  29. <el-dropdown split-button type="primary" size="small" @click="handleCommand('0', scope.row)"
  30. @command="handleCommand($event, scope.row)">
  31. <span>编 辑</span>
  32. <el-dropdown-menu slot="dropdown" style="text-align:center">
  33. <el-dropdown-item command="1">预览图片</el-dropdown-item>
  34. <el-dropdown-item command="2">产品架构</el-dropdown-item>
  35. <el-dropdown-item command="3">产品的营销数据</el-dropdown-item>
  36. <el-dropdown-item command="4">营销数据的趋势图</el-dropdown-item>
  37. <el-dropdown-item command="5">专利布局可视化</el-dropdown-item>
  38. <el-dropdown-item command="6">商品化专利</el-dropdown-item>
  39. <el-dropdown-item command="7" divided style="color:red">删 除</el-dropdown-item>
  40. </el-dropdown-menu>
  41. </el-dropdown>
  42. </template>
  43. </el-table-column>
  44. </el-table>
  45. </el-main>
  46. <el-footer class="pagination">
  47. <el-pagination background layout="total,sizes, prev, pager, next, jumper" :current-page.sync="queryParams.current" :page-size.sync="queryParams.size" @current-change="handleCurrentChange" :total="total">
  48. </el-pagination>
  49. </el-footer>
  50. </el-container>
  51. <marketing ref="marketing"></marketing>
  52. <addEditProduct ref="addEditProduct" @getMessage="getList"></addEditProduct>
  53. <myImageViewer v-if="showImg" :on-close="closeViewer" :src="imgSrc"></myImageViewer>
  54. </div>
  55. </template>
  56. <script>
  57. import { getTableHeight } from '@/views/components/mixins'
  58. import mixins from '@/views/product/components/mixins/index'
  59. import fun from '@/views/product/components/mixins/fun'
  60. import product from '@/views/product/components/mixins/product'
  61. import marketing from '@/views/product/components/dialog/marketing.vue'
  62. import addEditProduct from '@/views/product/components/dialog/addEditProduct.vue'
  63. export default {
  64. components: {
  65. marketing,
  66. addEditProduct
  67. },
  68. props: {
  69. patentNo:{}
  70. },
  71. mixins:[getTableHeight,mixins,fun,product],
  72. data() {
  73. return {
  74. showTable:true,
  75. column:[
  76. {
  77. value:'name',
  78. type:'String',
  79. name:'类别名称'
  80. },
  81. {
  82. value:'marketTime',
  83. type:'DateTime',
  84. name:'上市时间'
  85. },
  86. {
  87. value:'companyName',
  88. type:'String',
  89. name:'所属公司'
  90. },
  91. {
  92. value:'licenseRate',
  93. type:'String',
  94. name:'许可费率'
  95. },
  96. {
  97. value:'description',
  98. type:'String',
  99. name:'产品说明'
  100. },
  101. {
  102. value:'createName',
  103. type:'String',
  104. name:'创建人'
  105. },
  106. {
  107. value:'createTime',
  108. type:'DataTime',
  109. name:'创建时间'
  110. },
  111. ],
  112. searchFiled:[],
  113. //检索条件
  114. searchOption: {},
  115. queryParams:{
  116. size:10,
  117. current:1
  118. },
  119. total:0,
  120. tableData:[],
  121. // 排序数组
  122. sort: [
  123. {
  124. "orderBy": "createTime",
  125. "orderType": 1
  126. }
  127. ],
  128. };
  129. },
  130. watch: {
  131. patentNo(){
  132. this.getList()
  133. }
  134. },
  135. computed: {},
  136. created() {},
  137. mounted() {
  138. this.getList()
  139. },
  140. methods: {
  141. //获取检索条件检索
  142. search(val) {
  143. let params = {}
  144. if(val.length>0){
  145. val.forEach(item => {
  146. if (item.type == 3) {
  147. params[item.value]=item.searchValue.map(itemValue => {
  148. return itemValue.value
  149. })
  150. } else {
  151. params[item.value]=item.searchValue.label
  152. }
  153. })
  154. }
  155. this.searchOption = this.$commonJS.ArrayToArray(val)
  156. this.queryParams.current = 1
  157. this.getList()
  158. },
  159. getList(){
  160. },
  161. handleCurrentChange(val){
  162. this.queryParams.current = val
  163. this.getList()
  164. },
  165. async handleCommand( option, row ){
  166. if(!(await this.$permission.producePermission(row.id,2))){
  167. this.$showPermissionDialog()
  168. return false
  169. }
  170. switch (option) {
  171. case '0'://编辑
  172. this.$refs.addEditProduct.open(row)
  173. break;
  174. case '1'://预览图片
  175. this.checkImage(row)
  176. break;
  177. case '2'://产品架构
  178. this.toFramework(row,2)
  179. break;
  180. case '3'://产品的营销数据
  181. this.$refs.marketing.open(row)
  182. break;
  183. case '4'://产品的营销数据趋势图
  184. this.showTrend(row,2)
  185. break;
  186. case '5'://专利布局可视化
  187. break;
  188. case '6'://商品化专利
  189. this.toCommodity(row)
  190. break;
  191. case '7'://删除产品
  192. this.deletes(row)
  193. break;
  194. default:
  195. break;
  196. }
  197. },
  198. // 排序方法
  199. sortChange({ column, prop, order }) {
  200. //如需要多个字段排序,则不需要清空
  201. var params = {
  202. sort:this.sort,
  203. column,
  204. prop,
  205. order,
  206. }
  207. this.sort = this.$commonJS.getSortData(params)
  208. this.getList()
  209. },
  210. },
  211. };
  212. </script>
  213. <style lang="scss" scoped>
  214. </style>