mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-27 01:32:03 +08:00
fix: fileconfig
This commit is contained in:
parent
4397d47da1
commit
82fb1eb08e
@ -42,7 +42,7 @@ export const getFileConfigApi = (id: number) => {
|
|||||||
|
|
||||||
// 更新文件配置为主配置
|
// 更新文件配置为主配置
|
||||||
export const updateFileConfigMasterApi = (id: number) => {
|
export const updateFileConfigMasterApi = (id: number) => {
|
||||||
return request.get({ url: '/infra/file-config/update-master?id=' + id })
|
return request.put({ url: '/infra/file-config/update-master?id=' + id })
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增文件配置
|
// 新增文件配置
|
||||||
|
@ -35,12 +35,7 @@
|
|||||||
@click="handleMaster(row)"
|
@click="handleMaster(row)"
|
||||||
/>
|
/>
|
||||||
<!-- 操作:测试 -->
|
<!-- 操作:测试 -->
|
||||||
<XTextButton
|
<XTextButton preIcon="ep:share" :title="t('action.test')" @click="handleTest(row.id)" />
|
||||||
preIcon="ep:share"
|
|
||||||
:title="t('action.test')"
|
|
||||||
v-hasPermi="['infra:file-config:update']"
|
|
||||||
@click="handleUpdate(row.id)"
|
|
||||||
/>
|
|
||||||
<!-- 操作:删除 -->
|
<!-- 操作:删除 -->
|
||||||
<XTextButton
|
<XTextButton
|
||||||
preIcon="ep:delete"
|
preIcon="ep:delete"
|
||||||
@ -164,7 +159,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script setup lang="ts" name="FileConfig">
|
<script setup lang="ts" name="FileConfig">
|
||||||
// 全局相关的 import
|
// 全局相关的 import
|
||||||
import { reactive, ref } from 'vue'
|
import { ref } from 'vue'
|
||||||
import {
|
import {
|
||||||
ElForm,
|
ElForm,
|
||||||
ElFormItem,
|
ElFormItem,
|
||||||
@ -202,7 +197,7 @@ const dialogVisible = ref(false) // 是否显示弹出层
|
|||||||
const dialogTitle = ref('edit') // 弹出层标题
|
const dialogTitle = ref('edit') // 弹出层标题
|
||||||
const formRef = ref<FormInstance>() // 表单 Ref
|
const formRef = ref<FormInstance>() // 表单 Ref
|
||||||
const detailData = ref() // 详情 Ref
|
const detailData = ref() // 详情 Ref
|
||||||
let form = reactive<FileConfigApi.FileConfigVO>({
|
let form = ref<FileConfigApi.FileConfigVO>({
|
||||||
id: 0,
|
id: 0,
|
||||||
name: '',
|
name: '',
|
||||||
storage: 0,
|
storage: 0,
|
||||||
@ -211,7 +206,7 @@ let form = reactive<FileConfigApi.FileConfigVO>({
|
|||||||
config: {
|
config: {
|
||||||
basePath: '',
|
basePath: '',
|
||||||
host: '',
|
host: '',
|
||||||
port: '',
|
port: 0,
|
||||||
username: '',
|
username: '',
|
||||||
password: '',
|
password: '',
|
||||||
mode: '',
|
mode: '',
|
||||||
@ -222,7 +217,7 @@ let form = reactive<FileConfigApi.FileConfigVO>({
|
|||||||
domain: ''
|
domain: ''
|
||||||
},
|
},
|
||||||
remark: '',
|
remark: '',
|
||||||
createTime: ''
|
createTime: new Date()
|
||||||
})
|
})
|
||||||
// 设置标题
|
// 设置标题
|
||||||
const setDialogTile = (type: string) => {
|
const setDialogTile = (type: string) => {
|
||||||
@ -241,7 +236,7 @@ const handleCreate = (formEl: FormInstance | undefined) => {
|
|||||||
const handleUpdate = async (rowId: number) => {
|
const handleUpdate = async (rowId: number) => {
|
||||||
// 设置数据
|
// 设置数据
|
||||||
const res = await FileConfigApi.getFileConfigApi(rowId)
|
const res = await FileConfigApi.getFileConfigApi(rowId)
|
||||||
form = res
|
form.value = res
|
||||||
setDialogTile('update')
|
setDialogTile('update')
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,6 +258,11 @@ const handleMaster = (row: FileConfigApi.FileConfigVO) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const handleTest = async (rowId: number) => {
|
||||||
|
const res = await FileConfigApi.testFileConfigApi(rowId)
|
||||||
|
message.alert('测试通过,上传文件成功!访问地址:' + res)
|
||||||
|
}
|
||||||
|
|
||||||
// 删除操作
|
// 删除操作
|
||||||
const handleDelete = async (rowId: number) => {
|
const handleDelete = async (rowId: number) => {
|
||||||
await deleteData(xGrid, rowId)
|
await deleteData(xGrid, rowId)
|
||||||
@ -277,10 +277,10 @@ const submitForm = async (formEl: FormInstance | undefined) => {
|
|||||||
// 提交请求
|
// 提交请求
|
||||||
try {
|
try {
|
||||||
if (actionType.value === 'create') {
|
if (actionType.value === 'create') {
|
||||||
await FileConfigApi.createFileConfigApi(form)
|
await FileConfigApi.createFileConfigApi(form.value)
|
||||||
message.success(t('common.createSuccess'))
|
message.success(t('common.createSuccess'))
|
||||||
} else {
|
} else {
|
||||||
await FileConfigApi.updateFileConfigApi(form)
|
await FileConfigApi.updateFileConfigApi(form.value)
|
||||||
message.success(t('common.updateSuccess'))
|
message.success(t('common.updateSuccess'))
|
||||||
}
|
}
|
||||||
dialogVisible.value = false
|
dialogVisible.value = false
|
||||||
|
Loading…
Reference in New Issue
Block a user