配置变化: eslint配置变化
This commit is contained in:
@@ -54,12 +54,6 @@ export const createCrudOptions = function ({ crudExpose }: { crudExpose: CrudExp
|
||||
align: 'center',
|
||||
width: '70px',
|
||||
columnSetDisabled: true, //禁止在列设置中选择
|
||||
formatter: (context) => {
|
||||
//计算序号,你可以自定义计算规则,此处为翻页累加
|
||||
let index = context.index ?? 1;
|
||||
let pagination = crudExpose.crudBinding.value.pagination;
|
||||
return ((pagination.currentPage ?? 1) - 1) * pagination.pageSize + index + 1;
|
||||
},
|
||||
},
|
||||
},
|
||||
search: {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import { request } from '/@/utils/service';
|
||||
import { PageQuery, AddReq, DelReq, EditReq, InfoReq } from '@fast-crud/fast-crud';
|
||||
import {request} from '/@/utils/service';
|
||||
import {PageQuery, AddReq, DelReq, EditReq, InfoReq} from '@fast-crud/fast-crud';
|
||||
|
||||
export const apiPrefix = '/api/system/message_center/';
|
||||
|
||||
export function GetList(query: PageQuery) {
|
||||
return request({
|
||||
url: apiPrefix,
|
||||
@@ -9,6 +10,7 @@ export function GetList(query: PageQuery) {
|
||||
params: query,
|
||||
});
|
||||
}
|
||||
|
||||
export function GetObj(id: InfoReq) {
|
||||
return request({
|
||||
url: apiPrefix + id,
|
||||
@@ -17,7 +19,6 @@ export function GetObj(id: InfoReq) {
|
||||
}
|
||||
|
||||
export function AddObj(obj: AddReq) {
|
||||
console.log(20,obj)
|
||||
return request({
|
||||
url: apiPrefix,
|
||||
method: 'post',
|
||||
@@ -37,6 +38,6 @@ export function DelObj(id: DelReq) {
|
||||
return request({
|
||||
url: apiPrefix + id + '/',
|
||||
method: 'delete',
|
||||
data: { id },
|
||||
data: {id},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -223,15 +223,7 @@ export const createCrudOptions = function ({crudExpose}: { crudExpose: CrudExpos
|
||||
required: true,
|
||||
message: '必填项'
|
||||
}
|
||||
],
|
||||
itemProps: {
|
||||
class: {yxtInput: true}
|
||||
}
|
||||
},
|
||||
component: {
|
||||
name: 'manyToMany',
|
||||
valueBinding: 'dept_info',
|
||||
children: 'name'
|
||||
]
|
||||
}
|
||||
},
|
||||
content: {
|
||||
@@ -249,9 +241,9 @@ export const createCrudOptions = function ({crudExpose}: { crudExpose: CrudExpos
|
||||
}
|
||||
],
|
||||
component: {
|
||||
disabled: compute(({form}) => {
|
||||
return form.disabled;
|
||||
}),
|
||||
// disabled: compute(({form}) => {
|
||||
// return form.disabled;
|
||||
// }),
|
||||
id: "1", // 当同一个页面有多个editor时,需要配置不同的id
|
||||
config: {},
|
||||
uploader: {
|
||||
@@ -264,6 +256,6 @@ export const createCrudOptions = function ({crudExpose}: { crudExpose: CrudExpos
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
<template>
|
||||
<fs-page>
|
||||
<fs-crud ref="crudRef" v-bind="crudBinding"> </fs-crud>
|
||||
</fs-page>
|
||||
<fs-page>
|
||||
<fs-crud ref="crudRef" v-bind="crudBinding"></fs-crud>
|
||||
</fs-page>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, onMounted } from 'vue';
|
||||
import { useExpose, useCrud } from '@fast-crud/fast-crud';
|
||||
import { createCrudOptions } from './crud';
|
||||
import {ref, onMounted} from 'vue';
|
||||
import {useExpose, useCrud} from '@fast-crud/fast-crud';
|
||||
import {createCrudOptions} from './crud';
|
||||
// crud组件的ref
|
||||
const crudRef = ref();
|
||||
// crud 配置的ref
|
||||
const crudBinding = ref();
|
||||
// 暴露的方法
|
||||
const { crudExpose } = useExpose({ crudRef, crudBinding });
|
||||
const {crudExpose} = useExpose({crudRef, crudBinding});
|
||||
// 你的crud配置
|
||||
const { crudOptions } = createCrudOptions({ crudExpose });
|
||||
const {crudOptions} = createCrudOptions({crudExpose});
|
||||
// 初始化crud配置
|
||||
const { resetCrudOptions } = useCrud({ crudExpose, crudOptions });
|
||||
const {resetCrudOptions} = useCrud({crudExpose, crudOptions});
|
||||
|
||||
// 页面打开后获取列表数据
|
||||
onMounted(() => {
|
||||
crudExpose.doRefresh();
|
||||
crudExpose.doRefresh();
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user