index.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
  4. <el-form-item>
  5. <el-button type="primary" icon="Search" @click="handleQuery">刷新</el-button>
  6. <el-button
  7. type="warning"
  8. plain
  9. icon="Download"
  10. @click="handleExport"
  11. v-hasPermi="['calc:sjl:export']"
  12. >导出</el-button>
  13. </el-form-item>
  14. </el-form>
  15. <el-table v-loading="loading" height="750px" :data="dataList">
  16. <el-table-column label="设备ID" align="center" prop="device" />
  17. <el-table-column label="L1梳栉送经量" align="center" prop="l1" />
  18. <el-table-column label="L2梳栉送经量" align="center" prop="l2" />
  19. <el-table-column label="L3梳栉送经量" align="center" prop="l3" />
  20. <el-table-column label="L4梳栉送经量" align="center" prop="l4" />
  21. <el-table-column label="L5梳栉送经量" align="center" prop="l5" />
  22. <el-table-column label="设定落布米长" align="center" prop="length" />
  23. <el-table-column label="牵拉密度" align="center" prop="density" />
  24. <el-table-column label="卷曲张力系数" align="center" prop="coefficient" />
  25. </el-table>
  26. </div>
  27. </template>
  28. <script setup name="SJL">
  29. import { Get09Data } from "@/api/calc/sjl";
  30. const { proxy } = getCurrentInstance();
  31. const dataList = ref([]);
  32. const open = ref(false);
  33. const loading = ref(true);
  34. const showSearch = ref(true);
  35. const ids = ref([]);
  36. const single = ref(true);
  37. const multiple = ref(true);
  38. const total = ref(0);
  39. const title = ref("");
  40. const data = reactive({
  41. form: {},
  42. queryParams: {
  43. deviceId: null,
  44. orderByColumn: 'id',
  45. isAsc: 'descending'
  46. },
  47. rules: {
  48. }
  49. });
  50. const { queryParams, form, rules } = toRefs(data);
  51. /** 查询日统计数据列表 */
  52. function getList() {
  53. loading.value = true;
  54. dataList.value = [];
  55. Get09Data(queryParams.value).then(response => {
  56. loading.value = false;
  57. if(response.code!=0){
  58. return;
  59. }
  60. dataList.value = response.data;
  61. total.value = response.total;
  62. });
  63. }
  64. // 取消按钮
  65. function cancel() {
  66. open.value = false;
  67. reset();
  68. }
  69. // 表单重置
  70. function reset() {
  71. form.value = {
  72. id: null,
  73. deviceId: null,
  74. };
  75. proxy.resetForm("calcDayRef");
  76. }
  77. /** 搜索按钮操作 */
  78. function handleQuery() {
  79. getList();
  80. }
  81. /** 重置按钮操作 */
  82. function resetQuery() {
  83. proxy.resetForm("queryRef");
  84. handleQuery();
  85. }
  86. // 多选框选中数据
  87. function handleSelectionChange(selection) {
  88. ids.value = selection.map(item => item.id);
  89. single.value = selection.length != 1;
  90. multiple.value = !selection.length;
  91. }
  92. /** 导出按钮操作 */
  93. function handleExport() {
  94. proxy.download('api/export/warp-run-in', {
  95. ...queryParams.value
  96. }, `送经量统计_${new Date().getTime()}.xlsx`)
  97. }
  98. getList();
  99. </script>