Skip to content

Commit c964ca7

Browse files
YunaiVgitee-org
authored andcommitted
回退 'Pull Request !84 : 修改测试所提bug'
1 parent e94eb75 commit c964ca7

File tree

18 files changed

+989
-727
lines changed

18 files changed

+989
-727
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ dist-ssr
66
/dist*
77
*-lock.*
88
pnpm-debug
9+
10+
.idea
11+
.history

src/views/bpm/form/formEditor.vue

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -133,24 +133,15 @@ const openModel = (title: string) => {
133133
}
134134
/** 复制 **/
135135
const copy = async (text: string) => {
136-
// const { copy, copied, isSupported } = useClipboard({ source: JSON.stringify(text) })
137-
// if (!isSupported.value) {
138-
// message.error(t('common.copyError'))
139-
// } else {
140-
// await copy()
141-
// if (unref(copied.value)) {
142-
// message.success(t('common.copySuccess'))
143-
// }
144-
// }
145-
let url = JSON.stringify(text)
146-
let oInput = document.createElement('textarea')
147-
oInput.value = url
148-
document.body.appendChild(oInput)
149-
oInput.select() // 选择对象;
150-
// console.log(oInput.value)
151-
document.execCommand('Copy') // 执行浏览器复制命令
152-
message.success(t('common.copySuccess'))
153-
oInput.remove()
136+
const { copy, copied, isSupported } = useClipboard({ source: text })
137+
if (!isSupported) {
138+
message.error(t('common.copyError'))
139+
} else {
140+
await copy()
141+
if (unref(copied)) {
142+
message.success(t('common.copySuccess'))
143+
}
144+
}
154145
}
155146
// ========== 初始化 ==========
156147
onMounted(() => {

src/views/infra/build/index.vue

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -77,24 +77,15 @@ const showTemplate = () => {
7777
7878
/** 复制 **/
7979
const copy = async (text: string) => {
80-
// const { copy, copied, isSupported } = useClipboard({ source: JSON.stringify(text) })
81-
// if (!isSupported.value) {
82-
// message.error(t('common.copyError'))
83-
// } else {
84-
// await copy()
85-
// if (unref(copied.value)) {
86-
// message.success(t('common.copySuccess'))
87-
// }
88-
// }
89-
let url = JSON.stringify(text)
90-
let oInput = document.createElement('textarea')
91-
oInput.value = url
92-
document.body.appendChild(oInput)
93-
oInput.select() // 选择对象;
94-
// console.log(oInput.value)
95-
document.execCommand('Copy') // 执行浏览器复制命令
96-
message.success(t('common.copySuccess'))
97-
oInput.remove()
80+
const { copy, copied, isSupported } = useClipboard({ source: text })
81+
if (!isSupported) {
82+
message.error(t('common.copyError'))
83+
} else {
84+
await copy()
85+
if (unref(copied)) {
86+
message.success(t('common.copySuccess'))
87+
}
88+
}
9889
}
9990
10091
const makeTemplate = () => {

src/views/infra/codegen/components/Preview.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,11 @@ const handleFiles = (datas: CodegenPreviewVO[]) => {
130130
/** 复制 **/
131131
const copy = async (text: string) => {
132132
const { copy, copied, isSupported } = useClipboard({ source: text })
133-
if (!isSupported.value) {
133+
if (!isSupported) {
134134
message.error(t('common.copyError'))
135135
} else {
136136
await copy()
137-
if (unref(copied.value)) {
137+
if (unref(copied)) {
138138
message.success(t('common.copySuccess'))
139139
}
140140
}

src/views/infra/config/config.data.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ export const rules = reactive({
66
category: [required],
77
name: [required],
88
key: [required],
9-
value: [required],
10-
visible: [{ required: true, message: '请选择是否可见', trigger: 'change' }]
9+
value: [required]
1110
})
1211

1312
// CrudSchema

src/views/infra/config/index.vue

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ const message = useMessage() // 消息弹窗
9393
// 列表相关的变量
9494
const [registerTable, { reload, deleteData, exportList }] = useXTable({
9595
allSchemas: allSchemas,
96-
getListApi: ConfigApi.getConfigPage,
97-
deleteApi: ConfigApi.deleteConfig,
96+
getListApi: ConfigApi.getConfigPageApi,
97+
deleteApi: ConfigApi.deleteConfigApi,
9898
exportListApi: ConfigApi.exportConfigApi
9999
})
100100
@@ -127,22 +127,32 @@ const handleCreate = async () => {
127127
},
128128
2
129129
)
130+
unref(formRef)?.addSchema(
131+
{
132+
field: 'value',
133+
label: '参数键值',
134+
component: 'Input'
135+
},
136+
3
137+
)
130138
}
131139
}
132140
133141
// 修改操作
134142
const handleUpdate = async (rowId: number) => {
135143
setDialogTile('update')
136144
// 设置数据
137-
const res = await ConfigApi.getConfig(rowId)
145+
const res = await ConfigApi.getConfigApi(rowId)
138146
unref(formRef)?.delSchema('key')
147+
unref(formRef)?.delSchema('value')
148+
139149
unref(formRef)?.setValues(res)
140150
}
141151
142152
// 详情操作
143153
const handleDetail = async (rowId: number) => {
144154
setDialogTile('detail')
145-
const res = await ConfigApi.getConfig(rowId)
155+
const res = await ConfigApi.getConfigApi(rowId)
146156
detailData.value = res
147157
}
148158
@@ -157,10 +167,10 @@ const submitForm = async () => {
157167
try {
158168
const data = unref(formRef)?.formModel as ConfigApi.ConfigVO
159169
if (actionType.value === 'create') {
160-
await ConfigApi.createConfig(data)
170+
await ConfigApi.createConfigApi(data)
161171
message.success(t('common.createSuccess'))
162172
} else {
163-
await ConfigApi.updateConfig(data)
173+
await ConfigApi.updateConfigApi(data)
164174
message.success(t('common.updateSuccess'))
165175
}
166176
dialogVisible.value = false

src/views/infra/fileList/index.vue

Lines changed: 13 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
:on-exceed="handleExceed"
6060
:on-success="handleFileSuccess"
6161
:on-error="excelUploadError"
62-
:on-change="handleFileChange"
6362
:before-remove="beforeRemove"
6463
:auto-upload="false"
6564
accept=".jpg, .png, .gif"
@@ -84,7 +83,7 @@
8483
</XModal>
8584
</template>
8685
<script setup lang="ts" name="FileList">
87-
import type { UploadInstance, UploadRawFile, UploadProps, UploadFile } from 'element-plus'
86+
import type { UploadInstance, UploadRawFile, UploadProps } from 'element-plus'
8887
// 业务相关的 import
8988
import { allSchemas } from './fileList.data'
9089
import * as FileApi from '@/api/infra/fileList'
@@ -120,11 +119,9 @@ const beforeUpload = (file: UploadRawFile) => {
120119
return isImg && isLt5M
121120
}
122121
// 处理上传的文件发生变化
123-
const handleFileChange = (uploadFile: UploadFile): void => {
124-
// uploadRef.value.data.path = uploadFile.name
125-
console.log(uploadFile, 'uploadFile')
126-
uploadDisabled.value = false
127-
}
122+
// const handleFileChange = (uploadFile: UploadFile): void => {
123+
// uploadRef.value.data.path = uploadFile.name
124+
// }
128125
// 文件上传
129126
const submitFileForm = () => {
130127
uploadHeaders.value = {
@@ -151,12 +148,10 @@ const beforeRemove: UploadProps['beforeRemove'] = () => {
151148
// 文件数超出提示
152149
const handleExceed = (): void => {
153150
message.error('最多只能上传一个文件!')
154-
uploadDisabled.value = false
155151
}
156152
// 上传错误提示
157153
const excelUploadError = (): void => {
158154
message.error('导入数据失败,请您重新上传!')
159-
uploadDisabled.value = false
160155
}
161156
162157
// 详情操作
@@ -169,26 +164,14 @@ const handleDetail = (row: FileApi.FileVO) => {
169164
170165
// ========== 复制相关 ==========
171166
const handleCopy = async (text: string) => {
172-
let url = text
173-
let oInput = document.createElement('textarea')
174-
oInput.value = url
175-
document.body.appendChild(oInput)
176-
oInput.select() // 选择对象;
177-
// console.log(oInput.value)
178-
document.execCommand('Copy') // 执行浏览器复制命令
179-
message.success(t('common.copySuccess'))
180-
oInput.remove()
181-
// const { copy, copied, isSupported } = useClipboard({ source: text, read: true })
182-
// console.log(copy, 'copycopycopy')
183-
// console.log(copied, 'copiedcopiedcopied')
184-
// console.log(isSupported, 'isSupportedisSupportedisSupported')
185-
// if (!isSupported.value) {
186-
// message.error(t('common.copyError'))
187-
// } else {
188-
// await copy()
189-
// if (unref(copied.value)) {
190-
// message.success(t('common.copySuccess'))
191-
// }
192-
// }
167+
const { copy, copied, isSupported } = useClipboard({ source: text })
168+
if (!isSupported) {
169+
message.error(t('common.copyError'))
170+
} else {
171+
await copy()
172+
if (unref(copied)) {
173+
message.success(t('common.copySuccess'))
174+
}
175+
}
193176
}
194177
</script>

0 commit comments

Comments
 (0)