|
@@ -2,6 +2,7 @@
|
|
<div class="picture">
|
|
<div class="picture">
|
|
<div class="title-box-common">
|
|
<div class="title-box-common">
|
|
<h3>图片库</h3>
|
|
<h3>图片库</h3>
|
|
|
|
+ <a-button type="primary" @click="uploadVisible = true">上传</a-button>
|
|
</div>
|
|
</div>
|
|
<div class="padding-box-common">
|
|
<div class="padding-box-common">
|
|
<search :materialType="'picture'" @search="onSearch"></search>
|
|
<search :materialType="'picture'" @search="onSearch"></search>
|
|
@@ -10,12 +11,24 @@
|
|
:searchForm="searchForm"
|
|
:searchForm="searchForm"
|
|
></common-table>
|
|
></common-table>
|
|
</div>
|
|
</div>
|
|
|
|
+ <a-modal
|
|
|
|
+ width="40%"
|
|
|
|
+ :title="`上传图片至${
|
|
|
|
+ searchForm.is_pubilc === 1 ? '公共素材' : '个人素材'
|
|
|
|
+ }`"
|
|
|
|
+ v-model:visible="uploadVisible"
|
|
|
|
+ :confirm-loading="confirmLoading"
|
|
|
|
+ @ok="onConfirmUpload"
|
|
|
|
+ >
|
|
|
|
+ <upload-image v-if="uploadVisible"></upload-image>
|
|
|
|
+ </a-modal>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
import Search from "./component/search.vue";
|
|
import Search from "./component/search.vue";
|
|
import CommonTable from "./component/common-table.vue";
|
|
import CommonTable from "./component/common-table.vue";
|
|
|
|
+import UploadImage from "./component/upload-image.vue";
|
|
import usePagination from "@/hooks/usePagination";
|
|
import usePagination from "@/hooks/usePagination";
|
|
import { defineComponent, reactive, toRefs, ref } from "vue";
|
|
import { defineComponent, reactive, toRefs, ref } from "vue";
|
|
import { onBeforeRouteUpdate } from "vue-router";
|
|
import { onBeforeRouteUpdate } from "vue-router";
|
|
@@ -24,12 +37,14 @@ import { onBeforeRouteUpdate } from "vue-router";
|
|
import { deletePromotion } from "@/api";
|
|
import { deletePromotion } from "@/api";
|
|
import { message } from "ant-design-vue";
|
|
import { message } from "ant-design-vue";
|
|
const ImageLibrary = defineComponent({
|
|
const ImageLibrary = defineComponent({
|
|
- components: { Search, CommonTable },
|
|
|
|
|
|
+ components: { Search, CommonTable, UploadImage },
|
|
setup() {
|
|
setup() {
|
|
let { tablePageOptions } = usePagination();
|
|
let { tablePageOptions } = usePagination();
|
|
const formRef = ref();
|
|
const formRef = ref();
|
|
const state = reactive({
|
|
const state = reactive({
|
|
searchForm: {},
|
|
searchForm: {},
|
|
|
|
+ uploadVisible: false,
|
|
|
|
+ confirmLoading: false, // 上传视频按钮loading
|
|
});
|
|
});
|
|
return { ...toRefs(state), formRef, tablePageOptions };
|
|
return { ...toRefs(state), formRef, tablePageOptions };
|
|
},
|
|
},
|
|
@@ -40,6 +55,10 @@ const ImageLibrary = defineComponent({
|
|
console.log(param);
|
|
console.log(param);
|
|
this.searchForm = param;
|
|
this.searchForm = param;
|
|
},
|
|
},
|
|
|
|
+ // 确定上传 触发组件上传视频
|
|
|
|
+ onConfirmUpload() {
|
|
|
|
+ this.confirmLoading = true;
|
|
|
|
+ },
|
|
},
|
|
},
|
|
});
|
|
});
|
|
|
|
|