luobisheng
2022-12-01 1e4e67cf052f4c3cdfa2e756b342c1a38f4805b5
图片上传更新
2个文件已修改
20 ■■■■■ 已修改文件
src/components/myUpload/index.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/operate/images/index.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/myUpload/index.vue
@@ -9,6 +9,9 @@
    <el-upload
      v-if="isShowUpload && pictureList.length < limit"
      :file-list="fileList"
      v-loading="loading"
      element-loading-spinner="el-icon-loading"
      element-loading-background="rgba(0, 0, 0, 0.8)"
      action=""
      :multiple="multiple"
      :show-file-list="flag"
@@ -79,18 +82,11 @@
          .then(({ url1, url2, url3, url4 }) => {
            const url = url1 ?? url2 ?? url3 ?? url4;
            this.$emit('setPictureUrl', { url: url });
            this.loading = false;
          })
          .catch(err => {
            this.$message.error(err);
          })
    },
    // 获取token
    getToken() {
      const token = sessionStorage.getItem("token");
      const tokenHead = sessionStorage.getItem("tokenHead");
      if (token && tokenHead) {
        return { Authorization: tokenHead + token };
      }
    },
    handleDeletePicture(imageUrl) {
src/views/operate/images/index.vue
@@ -78,12 +78,12 @@
                <span @click="handleUpdateImageResource(scope.row, 'view')"
                  >查看</span
                >
                <span v-if="mystatus === 2" class="line">|</span>
                <span v-if="mystatus === 2" @click="handleUpdateImageResource(scope.row, 'update')"
                <span v-if="mystatus === 3" class="line">|</span>
                <span v-if="mystatus === 3" @click="handleUpdateImageResource(scope.row, 'update')"
                  >修改</span
                >
                <span v-if="mystatus === 2"  class="line">|</span>
                <span v-if="mystatus === 2"  @click="handleDelete(scope.row)">删除</span>
                <span v-if="mystatus === 3"  class="line">|</span>
                <span v-if="mystatus === 3"  @click="handleDelete(scope.row)">删除</span>
              </div>
            </template>
          </el-table-column>