|
@@ -65,17 +65,17 @@ export default defineComponent({
|
|
|
const videopsrc = ref("");
|
|
|
|
|
|
const handleUpload = (file) => {
|
|
|
- upload(file).then((res) => {
|
|
|
+ upload(file).then((res) => {
|
|
|
let type = /\w+([.jpg|.png|.gif|.swf|.bmp|.jpeg]){1}$/.test(
|
|
|
res.data.fileName?.substr( res.data.fileName?.lastIndexOf('.') + 1 ) ?? '',
|
|
|
);
|
|
|
if (!type) {
|
|
|
videosrclist.push(res.data);
|
|
|
- } else {
|
|
|
+ } else {
|
|
|
imagessrclist.push(res.data);;
|
|
|
}
|
|
|
|
|
|
- }).catch((error)=>{
|
|
|
+ }).catch((error)=>{
|
|
|
|
|
|
});
|
|
|
};
|
|
@@ -95,7 +95,7 @@ export default defineComponent({
|
|
|
source: '1',
|
|
|
// status: route.params.status as unknown as number,
|
|
|
});
|
|
|
- if (result) {
|
|
|
+ if (result) {
|
|
|
router.push("/")
|
|
|
}
|
|
|
|
|
@@ -289,6 +289,29 @@ export default defineComponent({
|
|
|
}}
|
|
|
/>
|
|
|
<Field
|
|
|
+ name="上传图片"
|
|
|
+ label="上传图片"
|
|
|
+ placeholder="请输入"
|
|
|
+ v-slots={{
|
|
|
+ input: () => (
|
|
|
+ <Uploader
|
|
|
+ accept="image/*"
|
|
|
+ v-model={form.value.pic}
|
|
|
+ onDelete={(filep, detail) => {
|
|
|
+ imagessrclist.splice(detail.index, 1);
|
|
|
+ console.log(imagessrclist);
|
|
|
+ }}
|
|
|
+ afterRead={(
|
|
|
+ file: UploaderFileListItem | UploaderFileListItem[],
|
|
|
+ ) => {
|
|
|
+ handleUpload((isArray(file) ? file[0] : file).file);
|
|
|
+ return false;
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ ),
|
|
|
+ }}
|
|
|
+ />
|
|
|
+ <Field
|
|
|
name="上传视频"
|
|
|
label="上传视频"
|
|
|
placeholder="请输入"
|
|
@@ -328,29 +351,6 @@ export default defineComponent({
|
|
|
),
|
|
|
}}
|
|
|
/>
|
|
|
- <Field
|
|
|
- name="上传图片"
|
|
|
- label="上传图片"
|
|
|
- placeholder="请输入"
|
|
|
- v-slots={{
|
|
|
- input: () => (
|
|
|
- <Uploader
|
|
|
- accept="image/*"
|
|
|
- v-model={form.value.pic}
|
|
|
- onDelete={(filep, detail) => {
|
|
|
- imagessrclist.splice(detail.index, 1);
|
|
|
- console.log(imagessrclist);
|
|
|
- }}
|
|
|
- afterRead={(
|
|
|
- file: UploaderFileListItem | UploaderFileListItem[],
|
|
|
- ) => {
|
|
|
- handleUpload((isArray(file) ? file[0] : file).file);
|
|
|
- return false;
|
|
|
- }}
|
|
|
- />
|
|
|
- ),
|
|
|
- }}
|
|
|
- />
|
|
|
</CellGroup>
|
|
|
<div style={{ height: '80px' }}></div>
|
|
|
|