Browse Source

fix:坐标管理刷新

master
guoapeng 2 months ago
parent
commit
ef15ef663a
  1. 52
      src/views/point/index.vue
  2. 1
      src/views/taskLog/index.vue

52
src/views/point/index.vue

@ -1,15 +1,38 @@
<script setup lang="ts"> <script setup lang="ts">
import { getPointList } from 'apis/point' import { getPointList } from 'apis/point'
import FtButton from 'components/common/FTButton/index.vue'
import Edit from 'components/point/Edit/index.vue' import Edit from 'components/point/Edit/index.vue'
import { cloneDeep } from 'lodash'
import { h, provide, ref } from 'vue'
import { provide, ref, useTemplateRef } from 'vue'
const upDataVisible = ref(false) const upDataVisible = ref(false)
const currentData = ref<Point.Point>() const currentData = ref<Point.Point>()
provide('currentData', currentData) provide('currentData', currentData)
const edit = (data: Point.Point[]) => {
currentData.value = data[0]
upDataVisible.value = true
}
const tableRef = useTemplateRef('tableRef')
const ok = () => {
tableRef.value?.initData()
cancel()
}
const cancel = () => {
upDataVisible.value = false
}
const btnList = [
{
name: '编辑',
type: 'primary',
serverUrl: 'edit',
serverCondition: 1,
},
]
const columns = [ const columns = [
{ {
type: 'selection',
},
{
title: '名称', title: '名称',
key: 'name', key: 'name',
}, },
@ -21,32 +44,13 @@ const columns = [
title: '坐标', title: '坐标',
key: 'position', key: 'position',
}, },
{
title: '操作',
fixed: 'right',
width: 120,
render: (row: any) => {
return h(
FtButton,
{
class: ['table-cell-mouse-on'],
id: row.id,
onClick: () => {
upDataVisible.value = true
currentData.value = cloneDeep(row)
},
},
{ default: () => '编辑' },
)
},
},
] ]
</script> </script>
<template> <template>
<div> <div>
<FtTable :columns="columns" :get-data-fn="getPointList" />
<Edit v-if="upDataVisible" @ok="upDataVisible = false" @cancel="upDataVisible = false" />
<FtTable ref="tableRef" :columns="columns" has-header :btn-list="btnList" :get-data-fn="getPointList" @edit="edit" />
<Edit v-if="upDataVisible" @ok="ok" @cancel="cancel" />
</div> </div>
</template> </template>

1
src/views/taskLog/index.vue

@ -20,7 +20,6 @@ const btnList = [
] ]
const columns = [ const columns = [
{ {
title: '实验名称',
type: 'selection', type: 'selection',
}, },
{ {

Loading…
Cancel
Save