|
|
@@ -1,24 +1,24 @@
|
|
|
<script setup lang="ts">
|
|
|
import { type VxeGridInstance, type VxeGridProps } from 'vxe-table'
|
|
|
import { useRowClickStyle } from '@/hooks/rowClickStyle'
|
|
|
-import { formatTimezone, formatNumber } from '@/utils/tools'
|
|
|
+import { formatNumber } from '@/utils/tools'
|
|
|
import { ref, onMounted } from 'vue'
|
|
|
import { useRouter } from 'vue-router'
|
|
|
-import { useVisitedRowState } from '@/stores/modules/visitedRow'
|
|
|
import DefaultConfiguration from '../images/default_configuration@2x.png'
|
|
|
|
|
|
-const visitedRowState = useVisitedRowState()
|
|
|
const router = useRouter()
|
|
|
-interface ColumnsListItem {
|
|
|
- field: String
|
|
|
- title: String
|
|
|
- type: String
|
|
|
- formatter: String
|
|
|
-}
|
|
|
-const props = defineProps({
|
|
|
- ColumnsList: Array<ColumnsListItem>,
|
|
|
- height: Number
|
|
|
-})
|
|
|
+
|
|
|
+interface ColumnConfig {
|
|
|
+ field: string
|
|
|
+ title: string
|
|
|
+ type: string
|
|
|
+ width?: number
|
|
|
+ formatter?: string
|
|
|
+}
|
|
|
+const props = defineProps<{
|
|
|
+ ColumnsList: ColumnConfig[]
|
|
|
+ height: number
|
|
|
+}>()
|
|
|
|
|
|
const columnstest = ref(props.ColumnsList)
|
|
|
|
|
|
@@ -65,19 +65,18 @@ const getTableColumns = async () => {
|
|
|
tableData.value.columns = handleColumns(columnstest.value)
|
|
|
tableData.value.columns?.push({
|
|
|
title: 'Operation',
|
|
|
- fixed: 'right',
|
|
|
+ fixed: 'left',
|
|
|
width: 100,
|
|
|
slots: { default: 'action' }
|
|
|
})
|
|
|
}
|
|
|
// 获取表格数据
|
|
|
const getTableData = (isPageChange?: boolean) => {
|
|
|
- const rc = isPageChange ? pageInfo.value.total : -1
|
|
|
$api
|
|
|
.getConfigurationList({
|
|
|
cp: pageInfo.value.pageNo,
|
|
|
ps: pageInfo.value.pageSize,
|
|
|
- rc
|
|
|
+ rc: isPageChange ? pageInfo.value.total : -1
|
|
|
})
|
|
|
.then((res: any) => {
|
|
|
if (res.code === 200) {
|
|
|
@@ -114,25 +113,15 @@ const deleteMoniTable = (row: any) => {
|
|
|
}
|
|
|
|
|
|
// 编辑表格数据
|
|
|
-const handleedit = ({ row }: any) => {
|
|
|
- router.push({
|
|
|
- path: '/destination-delivery/ConfiguRations/CreateNewRule',
|
|
|
- query: { a: row._serial_no}
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-const handleedittow = (row: any) => {
|
|
|
+const handleEdit = (row: any) => {
|
|
|
router.push({
|
|
|
path: '/destination-delivery/ConfiguRations/CreateNewRule',
|
|
|
query: {a: row._serial_no}
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
+// 添加新规则
|
|
|
const clickAddNewRule = () => {
|
|
|
- router.push({
|
|
|
- path: '/destination-delivery/ConfiguRations/CreateNewRule',
|
|
|
- query: {}
|
|
|
- })
|
|
|
+ router.push('/destination-delivery/ConfiguRations/CreateNewRule')
|
|
|
}
|
|
|
|
|
|
onMounted(() => {
|
|
|
@@ -148,7 +137,7 @@ onMounted(() => {
|
|
|
:style="{ border: 'none'}"
|
|
|
v-bind="tableData"
|
|
|
:height="props.height"
|
|
|
- @cell-dblclick="handleedit"
|
|
|
+ @cell-dblclick="({ row }) => handleEdit(row)"
|
|
|
>
|
|
|
<!-- 空数据时的插槽 -->
|
|
|
<template #empty>
|
|
|
@@ -169,7 +158,7 @@ onMounted(() => {
|
|
|
</span>
|
|
|
</template>
|
|
|
<template #action="{ row }">
|
|
|
- <el-button class="el-button--blue" style="height: 24px" @click="handleedittow(row)">
|
|
|
+ <el-button class="el-button--blue" style="height: 24px" @click="handleEdit(row)">
|
|
|
<span class="font_family icon-icon_edit_b"></span>
|
|
|
</el-button>
|
|
|
<el-popover trigger="click" :visible="row.visible" placement="left" :width="480">
|