|
@@ -0,0 +1,96 @@
|
|
|
+<template>
|
|
|
+ <div id="newspaper">
|
|
|
+ <el-row>
|
|
|
+ <el-col :span="24" class="style">
|
|
|
+ <el-col :span="24" class="top">
|
|
|
+ <NavBar v-show="navShow" :title="title" :isleftarrow="isleftarrow"> </NavBar>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="24" class="main">
|
|
|
+ <el-form ref="form" label-width="80px">
|
|
|
+ <el-form-item label="文件上传" prop="zynumberfile">
|
|
|
+ <upload
|
|
|
+ :limit="1"
|
|
|
+ :data="pic"
|
|
|
+ type="pic"
|
|
|
+ listType="text"
|
|
|
+ :url="`/files/task/upload`"
|
|
|
+ :newspaperdialog="newspaperdialog"
|
|
|
+ @upload="uploadSuccess"
|
|
|
+ @delete="toDelete"
|
|
|
+ ></upload>
|
|
|
+ </el-form-item>
|
|
|
+ <div style="margin: 16px;">
|
|
|
+ <el-form-item>
|
|
|
+ <el-button type="primary" @click="onSubmit()">上传</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ </el-form>
|
|
|
+ </el-col>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import upload from '@/components/upload-file.vue';
|
|
|
+import NavBar from '@/layout/common/topInfo.vue';
|
|
|
+import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
+export default {
|
|
|
+ name: 'newspaper',
|
|
|
+ props: {},
|
|
|
+ components: {
|
|
|
+ NavBar,
|
|
|
+ upload,
|
|
|
+ },
|
|
|
+ data: function() {
|
|
|
+ return {
|
|
|
+ title: '',
|
|
|
+ isleftarrow: '',
|
|
|
+ navShow: true,
|
|
|
+ pic: '',
|
|
|
+ newspaperdialog: false,
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {},
|
|
|
+ methods: {
|
|
|
+ onSubmit() {
|
|
|
+ console.log(this.pic);
|
|
|
+ },
|
|
|
+ uploadSuccess({ type, data }) {
|
|
|
+ this.$set(this, `${type}`, data.uri);
|
|
|
+ },
|
|
|
+ toDelete(index) {
|
|
|
+ this.pic.splice(index, 1);
|
|
|
+ },
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ ...mapState(['user']),
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.title = this.$route.meta.title;
|
|
|
+ this.isleftarrow = this.$route.meta.isleftarrow;
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ $route(to, from) {
|
|
|
+ this.title = to.meta.title;
|
|
|
+ this.isleftarrow = to.meta.isleftarrow;
|
|
|
+ },
|
|
|
+ },
|
|
|
+};
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="less" scoped>
|
|
|
+.style {
|
|
|
+ width: 100%;
|
|
|
+ min-height: 667px;
|
|
|
+ position: relative;
|
|
|
+ background-color: #f9fafc;
|
|
|
+}
|
|
|
+.top {
|
|
|
+ height: 46px;
|
|
|
+ overflow: hidden;
|
|
|
+}
|
|
|
+.main {
|
|
|
+ min-height: 570px;
|
|
|
+}
|
|
|
+</style>
|