net
2025-02-14 06d3d15a5a08637041cc601101c063b11b07a346
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<template>
  <div class="page">
    <div class="form-card">
      <el-form ref="form" :inline="true" :model="queryParams" @submit.prevent label-width="80px">
        <el-form-item label="函数名">
          <el-input v-model="queryParams.funcName" placeholder="请输入函数名" />
        </el-form-item>
        <el-form-item>
          <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
          <el-button icon="Refresh" @click="resetQuery">重置</el-button>
        </el-form-item>
      </el-form>
    </div>
    <div class="table-box">
      <el-table :data="tableData" style="width: 100%">
        <el-table-column prop="funcName" label="函数名" show-overflow-tooltip align="center"> </el-table-column>
        <el-table-column prop="funcText" label="函数文本" show-overflow-tooltip align="center"> </el-table-column>
        <el-table-column prop="info" label="介绍" show-overflow-tooltip align="center"> </el-table-column>
        <!-- <el-table-column prop="prop" label="操作" width="150" align="center">
                    <template #default="scope">
                        <el-button link type="primary" icon="Delete" @click="handleDel(scope.row)">
                            删除
                        </el-button>
                    </template>
                </el-table-column> -->
      </el-table>
      <pagination
        v-show="total > 0"
        :total="total"
        v-model:page="queryParams.pageNum"
        v-model:limit="queryParams.pageSize"
        @pagination="getList"
      />
    </div>
  </div>
</template>
<script setup>
import { delFunction, listFunction } from "@/api/modelConfiguration/indexWarehouse"
 
let { proxy } = getCurrentInstance()
 
let queryParams = ref({
  funcName: "",
  pageNum: 1,
  pageSize: 10,
})
let tableData = ref([])
let total = ref(0)
let loading = ref(false)
 
/** 搜索按钮操作 */
function handleQuery() {
  queryParams.value.pageNum = 1
  getList()
}
/** 重置按钮操作 */
function resetQuery() {
  queryParams.value = {}
  handleQuery()
}
 
function getList() {
  loading.value = true
  listFunction(queryParams.value).then((response) => {
    tableData.value = response.rows
    total.value = response.total
    loading.value = false
  })
}
getList()
/** 删除按钮操作 */
function handleDel(row) {
  proxy.$modal
    .confirm('是否确认删除计算函数为"' + row.funcName + '"的数据项?', "警告", {
      confirmButtonText: "确定",
      cancelButtonText: "取消",
      type: "warning",
    })
    .then(function () {
      return delFunction(row.id)
    })
    .then(() => {
      getList()
      proxy.$modal.msgSuccess("删除成功")
    })
    .catch(function () {})
}
</script>
 
<style lang="scss" scoped>
@import "@/assets/styles/page.scss";
</style>