mirror of
				https://github.com/continew-org/continew-admin-ui.git
				synced 2025-11-04 10:57:08 +08:00 
			
		
		
		
	fix: 修复文件重命名时不能回显原值的问题
This commit is contained in:
		@@ -14,11 +14,17 @@
 | 
				
			|||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<script lang="ts" setup>
 | 
					<script lang="ts" setup>
 | 
				
			||||||
 | 
					import type { FileItem } from '@/apis'
 | 
				
			||||||
import type { FormInstance } from '@arco-design/web-vue'
 | 
					import type { FormInstance } from '@arco-design/web-vue'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					interface Props {
 | 
				
			||||||
 | 
					  data: FileItem
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					const props = withDefaults(defineProps<Props>(), {})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const formRef = ref<FormInstance>()
 | 
					const formRef = ref<FormInstance>()
 | 
				
			||||||
const form = reactive({
 | 
					const form = reactive({
 | 
				
			||||||
  name: ''
 | 
					  name: props.data?.name || ''
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
defineExpose({ formRef })
 | 
					defineExpose({ formRef })
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,6 +12,7 @@ export function openFileRenameModal(data: FileItem, callback?: () => void) {
 | 
				
			|||||||
    width: '90%',
 | 
					    width: '90%',
 | 
				
			||||||
    content: () =>
 | 
					    content: () =>
 | 
				
			||||||
      h(ModalContent, {
 | 
					      h(ModalContent, {
 | 
				
			||||||
 | 
					        data,
 | 
				
			||||||
        ref: (e) => {
 | 
					        ref: (e) => {
 | 
				
			||||||
          ModalContentRef.value = e as any
 | 
					          ModalContentRef.value = e as any
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,7 +17,13 @@
 | 
				
			|||||||
        </a-dropdown>
 | 
					        </a-dropdown>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        <a-input-group>
 | 
					        <a-input-group>
 | 
				
			||||||
          <a-input v-model="queryForm.name" placeholder="请输入文件名" allow-clear @change="search" />
 | 
					          <a-input
 | 
				
			||||||
 | 
					            v-model="queryForm.name"
 | 
				
			||||||
 | 
					            placeholder="请输入文件名"
 | 
				
			||||||
 | 
					            allow-clear
 | 
				
			||||||
 | 
					            style="width: 200px"
 | 
				
			||||||
 | 
					            @change="search"
 | 
				
			||||||
 | 
					          />
 | 
				
			||||||
          <a-button type="primary" @click="search">
 | 
					          <a-button type="primary" @click="search">
 | 
				
			||||||
            <template #icon>
 | 
					            <template #icon>
 | 
				
			||||||
              <icon-search />
 | 
					              <icon-search />
 | 
				
			||||||
@@ -47,11 +53,11 @@
 | 
				
			|||||||
          <template #default>{{ isBatchMode ? '取消批量' : '批量操作' }}</template>
 | 
					          <template #default>{{ isBatchMode ? '取消批量' : '批量操作' }}</template>
 | 
				
			||||||
        </a-button>
 | 
					        </a-button>
 | 
				
			||||||
        <a-button-group>
 | 
					        <a-button-group>
 | 
				
			||||||
          <a-tooltip content="视图" position="bottom">
 | 
					          <a-tooltip content="视图">
 | 
				
			||||||
            <a-button @click="toggleMode">
 | 
					            <a-button class="gi_hover_btn-border" @click="toggleMode">
 | 
				
			||||||
              <template #icon>
 | 
					              <template #icon>
 | 
				
			||||||
                <icon-apps v-if="mode === 'grid'" />
 | 
					                <icon-list v-if="mode === 'grid'" />
 | 
				
			||||||
                <icon-list v-else />
 | 
					                <icon-apps v-else />
 | 
				
			||||||
              </template>
 | 
					              </template>
 | 
				
			||||||
            </a-button>
 | 
					            </a-button>
 | 
				
			||||||
          </a-tooltip>
 | 
					          </a-tooltip>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user