解决代码生成模块无法复制
This commit is contained in:
parent
5f17504d3c
commit
124213bb4c
@ -30,7 +30,7 @@
|
|||||||
</XModal>
|
</XModal>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { useClipboard } from '@vueuse/core'
|
// import { useClipboard } from '@vueuse/core'
|
||||||
import { handleTree2 } from '@/utils/tree'
|
import { handleTree2 } from '@/utils/tree'
|
||||||
import { previewCodegenApi } from '@/api/infra/codegen'
|
import { previewCodegenApi } from '@/api/infra/codegen'
|
||||||
import { CodegenTableVO, CodegenPreviewVO } from '@/api/infra/codegen/types'
|
import { CodegenTableVO, CodegenPreviewVO } from '@/api/infra/codegen/types'
|
||||||
@ -129,15 +129,24 @@ const handleFiles = (datas: CodegenPreviewVO[]) => {
|
|||||||
}
|
}
|
||||||
/** 复制 **/
|
/** 复制 **/
|
||||||
const copy = async (text: string) => {
|
const copy = async (text: string) => {
|
||||||
const { copy, copied, isSupported } = useClipboard({ source: text })
|
let url = text
|
||||||
if (!isSupported.value) {
|
let oInput = document.createElement('textarea')
|
||||||
message.error(t('common.copyError'))
|
oInput.value = url
|
||||||
} else {
|
document.body.appendChild(oInput)
|
||||||
await copy()
|
oInput.select() // 选择对象;
|
||||||
if (unref(copied.value)) {
|
// console.log(oInput.value)
|
||||||
message.success(t('common.copySuccess'))
|
document.execCommand('Copy') // 执行浏览器复制命令
|
||||||
}
|
message.success('复制成功')
|
||||||
}
|
oInput.remove()
|
||||||
|
// const { copy, copied, isSupported } = useClipboard({ source: text })
|
||||||
|
// if (!isSupported.value) {
|
||||||
|
// message.error(t('common.copyError'))
|
||||||
|
// } else {
|
||||||
|
// await copy()
|
||||||
|
// if (unref(copied.value)) {
|
||||||
|
// message.success(t('common.copySuccess'))
|
||||||
|
// }
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
defineExpose({
|
defineExpose({
|
||||||
show
|
show
|
||||||
|
@ -49,16 +49,29 @@
|
|||||||
</template>
|
</template>
|
||||||
<script setup lang="ts" name="JobLog">
|
<script setup lang="ts" name="JobLog">
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
|
|
||||||
import * as JobLogApi from '@/api/infra/jobLog'
|
import * as JobLogApi from '@/api/infra/jobLog'
|
||||||
import { allSchemas } from './jobLog.data'
|
import { allSchemas } from './jobLog.data'
|
||||||
|
import { useRoute } from 'vue-router'
|
||||||
|
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
|
|
||||||
|
const { query } = useRoute()
|
||||||
|
|
||||||
|
let jobId = ''
|
||||||
|
jobId = query ? query.id : ''
|
||||||
|
if (jobId) {
|
||||||
|
allSchemas.searchSchema[0].itemRender.defaultValue = jobId
|
||||||
|
} else {
|
||||||
|
allSchemas.searchSchema[0].itemRender.defaultValue = ''
|
||||||
|
}
|
||||||
// 列表相关的变量
|
// 列表相关的变量
|
||||||
const [registerTable, { exportList }] = useXTable({
|
const [registerTable, { exportList }] = useXTable({
|
||||||
allSchemas: allSchemas,
|
allSchemas: allSchemas,
|
||||||
getListApi: JobLogApi.getJobLogPageApi,
|
getListApi: JobLogApi.getJobLogPageApi,
|
||||||
exportListApi: JobLogApi.exportJobLogApi
|
exportListApi: JobLogApi.exportJobLogApi
|
||||||
})
|
})
|
||||||
|
|
||||||
// ========== CRUD 相关 ==========
|
// ========== CRUD 相关 ==========
|
||||||
const dialogVisible = ref(false) // 是否显示弹出层
|
const dialogVisible = ref(false) // 是否显示弹出层
|
||||||
const dialogTitle = ref('') // 弹出层标题
|
const dialogTitle = ref('') // 弹出层标题
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
|
import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
|
||||||
const { t } = useI18n() // 国际化
|
const { t } = useI18n() // 国际化
|
||||||
// 表单校验
|
// 表单校验
|
||||||
|
|
||||||
export const rules = reactive({
|
export const rules = reactive({
|
||||||
name: [required],
|
name: [required],
|
||||||
handlerName: [required],
|
handlerName: [required],
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
|
import type { VxeCrudSchema } from '@/hooks/web/useVxeCrudSchemas'
|
||||||
// 国际化
|
// 国际化
|
||||||
|
|
||||||
const { t } = useI18n()
|
const { t } = useI18n()
|
||||||
// CrudSchema
|
// CrudSchema
|
||||||
const crudSchemas = reactive<VxeCrudSchema>({
|
const crudSchemas = reactive<VxeCrudSchema>({
|
||||||
@ -12,7 +11,14 @@ const crudSchemas = reactive<VxeCrudSchema>({
|
|||||||
{
|
{
|
||||||
title: '任务编号',
|
title: '任务编号',
|
||||||
field: 'jobId',
|
field: 'jobId',
|
||||||
isSearch: true
|
search: {
|
||||||
|
show: true,
|
||||||
|
itemRender: {
|
||||||
|
name: 'input',
|
||||||
|
defaultValue: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
isForm: true
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '处理器的名字',
|
title: '处理器的名字',
|
||||||
|
Loading…
Reference in New Issue
Block a user