使用tanstack/vue-query
This commit is contained in:
@@ -17,11 +17,12 @@ export default function useCrudRef(currentRow: Ref<{ id: number | string; name:
|
||||
showTools: false,
|
||||
beforeAdd: (form: any) => {
|
||||
form.id = currentRow.value?.id
|
||||
return true
|
||||
},
|
||||
add: { show: true, api: dictApi.saveDictItem },
|
||||
edit: { show: true, api: dictApi.updateDictItemData },
|
||||
delete: { show: true, api: dictApi.realDeleteItem },
|
||||
afterDelete(response) {
|
||||
afterDelete() {
|
||||
crudRef.value.tableRef.selectAll(false)
|
||||
}
|
||||
})
|
||||
|
||||
@@ -289,7 +289,7 @@ const crudColumns = ref([
|
||||
{
|
||||
title: "闭环方式",
|
||||
align: "center",
|
||||
width: 160,
|
||||
width: 200,
|
||||
dataIndex: "closeMethod",
|
||||
addDefaultValue: [],
|
||||
search: true,
|
||||
|
||||
@@ -6,14 +6,14 @@
|
||||
class="my-custom-class"
|
||||
:columns="props.columns"
|
||||
:data="previewRecord"
|
||||
:column="1"
|
||||
:column="3"
|
||||
size="mini"
|
||||
></ma-info>
|
||||
</a-modal>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import { ref, reactive } from "vue"
|
||||
import { ref } from "vue"
|
||||
import MaInfo from "@/components/ma-info/index.vue"
|
||||
// 提供open方法给外界,并获取整行数据
|
||||
const visible = ref(false)
|
||||
|
||||
@@ -199,7 +199,6 @@ const useCrudInit = function () {
|
||||
}
|
||||
]
|
||||
},
|
||||
// 这是只为了搜索的字段
|
||||
{
|
||||
title: "时间范围",
|
||||
hide: true,
|
||||
@@ -261,6 +260,7 @@ const useCrudInit = function () {
|
||||
hide: true,
|
||||
search: false,
|
||||
formType: "select",
|
||||
allowCreate: true,
|
||||
dict: { name: "devplant", props: { label: "title", value: "key" } }
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user