productList.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. const { createApp, ref ,onMounted,createVNode, render} = Vue
  2. createApp({
  3. setup() {
  4. onMounted(()=>{
  5. // Class()
  6. if (tool.getQueryParam('type')) {
  7. param.value.content.where.class = tool.getQueryParam('type')
  8. axt_class.value = {value:tool.getQueryParam('type'),remarks:tool.getQueryParam('type')}
  9. }
  10. listData()
  11. getProductDetailData()
  12. })
  13. const data = ref([])
  14. const pageTotal = ref(0)
  15. const pageNumber = ref(0)
  16. const param = ref({
  17. id:20240920101703,
  18. content:{
  19. siteid:"HY",
  20. brandids:[],
  21. pageNumber:1,
  22. pageSize:50,
  23. where:{
  24. "isonsale":1,
  25. "condition":"",
  26. "class":''
  27. }
  28. }
  29. })
  30. const listData = async (id)=>{
  31. const res = await instance.post('',param.value)
  32. data.value = res.data.data
  33. pageTotal.value = res.data.pageTotal
  34. pageNumber.value = res.data.pageNumber
  35. }
  36. const pageChange = (page)=>{
  37. if (page < 1) return false
  38. if (page > pageTotal.value) return false
  39. param.value.content.pageNumber = page
  40. listData()
  41. }
  42. const classData = ref([
  43. {value:'暖通系统',remarks:'暖通系统'},
  44. {value:'水务系统',remarks:'水务系统'},
  45. {value:'消防系统',remarks:'消防系统'},
  46. {value:'液冷系统',remarks:'液冷系统'}
  47. ])
  48. const axt_class = ref({value:'暖通系统',remarks:'暖通系统'})
  49. const Class = async (id)=>{
  50. const res = await instance.post('',{
  51. "classname": "sysmanage.develop.optiontype.optiontype",
  52. "method": "optiontypeselect",
  53. "content": {
  54. "pageNumber": 1,
  55. "pageSize": 1000,
  56. "typename": 'marketproductclass',
  57. "parameter": {},
  58. }
  59. })
  60. classData.value = res.data.data
  61. }
  62. const classDataChild = ref([])
  63. const showClassChild = (cls)=>{
  64. classDataChild.value = cls.subdep
  65. axt_class.value = cls
  66. param.value.content.where.class = cls.value
  67. listData(param.value.content.pageNumber = 1)
  68. }
  69. const child_act = ref('')
  70. const childClick = (child)=>{
  71. child_act.value = child
  72. param.value.content.where.class = child
  73. listData(param.value.content.pageNumber = 1)
  74. }
  75. const linkOf = (url)=>{
  76. window.location.href = url
  77. }
  78. const productDetailData = ref({
  79. attinfos:[]
  80. })
  81. const getProductDetailData = async ()=>{
  82. const res = await instance.post('',{
  83. "id": "20240920101403",
  84. "content": {
  85. siteid:'HY',
  86. sa_fadid:tool.getQueryParam('id')
  87. }
  88. })
  89. if (res.data.code == 1) {
  90. productDetailData.value = res.data.data
  91. tool.modulesClick('服务支持',productDetailData.value.itemname)
  92. }
  93. }
  94. const tab1 = ref('xs')
  95. return {
  96. param,
  97. listData,
  98. data,
  99. pageTotal,
  100. pageNumber,
  101. pageChange,
  102. classData,
  103. axt_class,
  104. showClassChild,
  105. classDataChild,
  106. linkOf,
  107. productDetailData,
  108. tab1,
  109. child_act,
  110. childClick
  111. }
  112. }
  113. }).mount('#app')