diff --git a/src/components/ma-crud/components/column.vue b/src/components/ma-crud/components/column.vue
index 3614c3a4..74190979 100644
--- a/src/components/ma-crud/components/column.vue
+++ b/src/components/ma-crud/components/column.vue
@@ -119,10 +119,10 @@
@@ -131,10 +131,13 @@
-
+
+
+
@@ -157,12 +160,12 @@
查看图片
- {{ record[row.dataIndex] }} {{ row.formType }}
+ {{ record[row.dataIndex] }}
@@ -194,6 +197,7 @@ const props = defineProps({
})
const options = inject('options')
const requestParams = inject('requestParams')
+const dicts = inject('dicts')
const dictTrans = inject('dictTrans')
const dictColors = inject('dictColors')
@@ -267,13 +271,25 @@ const editAction = record => {
}
}
-const allowQuickEdit = (formType) => ['select', 'input', 'input-number', 'date'].includes(formType ?? 'input')
+const allowQuickEdit = (formType) => ['select', 'input', 'input-number', 'radio'].includes(formType ?? 'input')
-const quickEdit = (row, record, index) => {
- console.log(props.crudFormRef.form)
+const quickEdit = (row, record) => {
+ if (row.formType === 'select' || row.formType === 'radio') {
+ record[row.dataIndex] = record[row.dataIndex].toString()
+ }
row.isEdit = true
}
+const updateQuickEditData = async (row, record) => {
+ if (isFunction(options.beforeEdit) && ! await options.beforeEdit(record)) {
+ return false
+ }
+ const response = await options.edit.api(record[options.pk], record)
+ row.isEdit = false
+ isFunction(options.afterEdit) && await options.afterEdit(response, record)
+ Message.success(response.message || `修改成功!`)
+}
+
const recoveryAction = async record => {
const response = await options.recovery.api({ ids: [record[options.pk]] })
response.success && Message.success(response.message || `恢复成功!`)
diff --git a/src/components/ma-crud/components/setting.vue b/src/components/ma-crud/components/setting.vue
index eec2e59b..a552a095 100644
--- a/src/components/ma-crud/components/setting.vue
+++ b/src/components/ma-crud/components/setting.vue
@@ -57,7 +57,10 @@
/
-
+
+
+
+
@@ -92,6 +95,8 @@ const options = inject('options')
const columns = inject('columns')
const allowShowColumns = ref([])
+const emit = defineEmits([ 'onChangeSearchHide' ])
+
const setShowColumns = () => {
allowShowColumns.value = columns.value.filter(item => {
return ! (item?.settingHide ?? false)
@@ -122,6 +127,9 @@ const changeColumn = (ev, type, name) => {
column.sortable = undefined
}
break
+ case 'search':
+ emit('onChangeSearchHide')
+ break
}
}
diff --git a/src/components/ma-crud/index.vue b/src/components/ma-crud/index.vue
index a6507099..ce7bf3c4 100644
--- a/src/components/ma-crud/index.vue
+++ b/src/components/ma-crud/index.vue
@@ -236,7 +236,11 @@
/>
-
+