mirror of https://gitee.com/xiaonuobase/snowy
【更新】更新前端部分代码的换行格式
parent
17da615cea
commit
d8bf602f74
|
@ -61,7 +61,7 @@
|
|||
</a-upload>
|
||||
|
||||
<!-- 文件预览 -->
|
||||
<a-modal :open="previewVisible" :title="previewTitle" :footer="null" :destroyOnClose="true" @cancel="handleCancel">
|
||||
<a-modal :open="previewVisible" :title="previewTitle" :footer="null" :destroyOnClose="true" @cancel="handleCancel">
|
||||
<template v-if="props.uploadMode === 'image'">
|
||||
<img alt="example" style="width: 100%" :src="previewObj" />
|
||||
</template>
|
||||
|
@ -70,13 +70,11 @@
|
|||
<source :src="previewObj" type="video/mp4" />
|
||||
<object :data="previewObj" width="100%">
|
||||
<embed :src="previewObj" width="100%" />
|
||||
</object>
|
||||
您的浏览器不支持video标签哦,请联系管理员
|
||||
</video>
|
||||
</template>
|
||||
<template v-else>
|
||||
暂不支持该文件预览
|
||||
</object>
|
||||
您的浏览器不支持video标签哦,请联系管理员
|
||||
</video>
|
||||
</template>
|
||||
<template v-else> 暂不支持该文件预览 </template>
|
||||
</a-modal>
|
||||
|
||||
<a-upload-dragger
|
||||
|
@ -305,8 +303,7 @@
|
|||
message.warning('只能上传图片类型文件')
|
||||
}
|
||||
return isPNG || Upload.LIST_IGNORE
|
||||
}
|
||||
else if (props.uploadMode == 'video') {
|
||||
} else if (props.uploadMode == 'video') {
|
||||
const isVideo = file.type.startsWith('video/')
|
||||
if (!isVideo) {
|
||||
message.warning('只能上传视频类型文件')
|
||||
|
@ -348,7 +345,7 @@
|
|||
data.response.data + (resultIntervalValue.value ? ',' + resultIntervalValue.value : '')
|
||||
})
|
||||
emit('update:value', resultIntervalValue)
|
||||
emit('onSuccessful',resultIntervalValue)
|
||||
emit('onSuccessful', resultIntervalValue)
|
||||
emit('onChange', resultIntervalValue)
|
||||
} else if (props.uploadResultCategory === 'array') {
|
||||
if (props.completeResult) {
|
||||
|
@ -360,16 +357,15 @@
|
|||
}
|
||||
})
|
||||
emit('update:value', newResult)
|
||||
emit('onSuccessful',newResult)
|
||||
emit('onSuccessful', newResult)
|
||||
emit('onChange', newResult)
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
const resultArrayValue = ref([])
|
||||
result.forEach((data) => {
|
||||
resultArrayValue.value.push(data.response.data)
|
||||
})
|
||||
emit('update:value', resultArrayValue)
|
||||
emit('onSuccessful',resultArrayValue)
|
||||
emit('onSuccessful', resultArrayValue)
|
||||
emit('onChange', resultArrayValue)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -179,39 +179,41 @@ tool.generateString = (length = 8) => {
|
|||
|
||||
tool.parseTime = (time, cFormat) => {
|
||||
if (time == null || time.length === 0) {
|
||||
return ''
|
||||
return ''
|
||||
}
|
||||
|
||||
const format = cFormat || '{y}-{m}-{d} {h}:{i}:{s}'
|
||||
let date
|
||||
if (typeof time === 'object') {
|
||||
date = time
|
||||
date = time
|
||||
} else {
|
||||
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
|
||||
time = parseInt(time)
|
||||
}
|
||||
if ((typeof time === 'number') && (time.toString().length === 10)) {
|
||||
time = time * 1000
|
||||
}
|
||||
date = new Date(time)
|
||||
if (typeof time === 'string' && /^[0-9]+$/.test(time)) {
|
||||
time = parseInt(time)
|
||||
}
|
||||
if (typeof time === 'number' && time.toString().length === 10) {
|
||||
time = time * 1000
|
||||
}
|
||||
date = new Date(time)
|
||||
}
|
||||
const formatObj = {
|
||||
y: date.getFullYear(),
|
||||
m: date.getMonth() + 1,
|
||||
d: date.getDate(),
|
||||
h: date.getHours(),
|
||||
i: date.getMinutes(),
|
||||
s: date.getSeconds(),
|
||||
a: date.getDay()
|
||||
y: date.getFullYear(),
|
||||
m: date.getMonth() + 1,
|
||||
d: date.getDate(),
|
||||
h: date.getHours(),
|
||||
i: date.getMinutes(),
|
||||
s: date.getSeconds(),
|
||||
a: date.getDay()
|
||||
}
|
||||
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
|
||||
let value = formatObj[key]
|
||||
// Note: getDay() returns 0 on Sunday
|
||||
if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value ] }
|
||||
if (result.length > 0 && value < 10) {
|
||||
value = '0' + value
|
||||
}
|
||||
return value || 0
|
||||
let value = formatObj[key]
|
||||
// Note: getDay() returns 0 on Sunday
|
||||
if (key === 'a') {
|
||||
return ['日', '一', '二', '三', '四', '五', '六'][value]
|
||||
}
|
||||
if (result.length > 0 && value < 10) {
|
||||
value = '0' + value
|
||||
}
|
||||
return value || 0
|
||||
})
|
||||
return time_str
|
||||
}
|
||||
|
|
|
@ -14,7 +14,13 @@
|
|||
<a-textarea v-model:value="formData.remark" placeholder="请输入备注" :auto-size="{ minRows: 3, maxRows: 5 }" />
|
||||
</a-form-item>
|
||||
<a-form-item label="排序码:" name="sortCode">
|
||||
<a-input-number v-model:value="formData.sortCode" placeholder="请输入排序码" :min="1" :max="10000" style="width: 100%" />
|
||||
<a-input-number
|
||||
v-model:value="formData.sortCode"
|
||||
placeholder="请输入排序码"
|
||||
:min="1"
|
||||
:max="10000"
|
||||
style="width: 100%"
|
||||
/>
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
<template #footer>
|
||||
|
@ -53,7 +59,7 @@
|
|||
// 默认要校验的
|
||||
const formRules = {
|
||||
name: [required('请输入名称')],
|
||||
sortCode: [required('请输入排序码')],
|
||||
sortCode: [required('请输入排序码')]
|
||||
}
|
||||
// 验证并提交数据
|
||||
const onSubmit = () => {
|
||||
|
|
Loading…
Reference in New Issue