luobisheng
2022-11-28 bb66fcc56438b9f123ee4029f807f672b8baede5
上传图片等修改
7个文件已修改
73 ■■■■■ 已修改文件
src/api/operate/messageManagement.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/myUpload/index.vue 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/operate/disposal/casepool/dispatch/updateUser/uploadResult/components/evidence/index.vue 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/operate/images/updateUser/index.vue 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/operate/message/myIndex/update/index.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/operate/sms/smsTemplate/createTemplate/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/operate/sms/smsTemplate/index.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/api/operate/messageManagement.js
@@ -16,6 +16,6 @@
    return http.post('/sccg/message/sendMessage', params);
}
export function updateMessage(id, params) {
    return http.post('/sccg/message/update/' + id, params);
export function updateMessage(params) {
    return http.post('/sccg/message/update', params);
}
src/components/myUpload/index.vue
@@ -2,11 +2,12 @@
    <div class="my-upload">
      <div v-if="pictureList.length > 0" class="image-box">
        <div v-for="image in pictureList" class="image-box-item">
          <i @click="handleDeletePicture(image)" class="el-icon-delete image-delete-icon"></i>
          <i v-if="isShowUpload" @click="handleDeletePicture(image)" class="el-icon-delete image-delete-icon"></i>
          <el-image :key="image" class="image-content" :src="image" ></el-image>
        </div>
      </div>
      <el-upload
          v-if="isShowUpload"
        :file-list="fileList" 
        action="/sccg/file/medias"
        :multiple="multiple"
@@ -15,8 +16,7 @@
        :limit="limit" 
        :on-success="handleSuccess"
        :on-error="handleError" 
        :list-type="listType"
        :on-remove="handleRemove"
        :list-type="listType"
        :headers="getToken()">
          <div class="upload-btn">
            <i class="el-icon-plus"></i>
@@ -83,10 +83,6 @@
                return { Authorization: tokenHead + token }
            }
        },
        // 移除文件
        handleRemove(file, fileList){
            this.$emit('delPictureUrl',{url:file.response.data.url1});
        },
        handleDeletePicture(imageUrl) {
          this.$emit('delPictureUrl', { url: imageUrl });
@@ -96,6 +92,10 @@
      pictureList: {
        type: Array,
        default: () => []
      },
      isShowUpload: {
        type: Boolean,
        default: () => true
      }
    },
}
src/views/operate/disposal/casepool/dispatch/updateUser/uploadResult/components/evidence/index.vue
@@ -305,10 +305,11 @@
        checkUser() {
            this.$refs.userForm.validate((valid) => {
                if (valid) {
                    this.userFlag = false;
                  this.evidence.userInfo = this.user.name + '...';
                  this.userFlag = false;
                } else {
                    this.evidence.userInfo = false;
                    return false;
                    this.evidence.userInfo = null;
                    this.$message.warning('请检查必填项');
                }
            })
        },
src/views/operate/images/updateUser/index.vue
@@ -24,16 +24,7 @@
            <el-input v-model="imagedata.id"></el-input>
          </el-form-item>
          <el-form-item prop="url" label="图片:" min-width="8">
            <el-upload
                class="avatar-uploader"
                action=""
                ref="image"
                :show-file-list="false"
                :auto-upload="true"
                :http-request="imageUpload">
              <img v-if="imagedata.url" :src="imagedata.url" class="avatar" width="100px" height="100px">
              <i v-else class="el-icon-plus avatar-uploader-icon"></i>
            </el-upload>
            <my-upload :picture-list="imageList" :is-show-upload="dialogType !== 'view'" @setPictureUrl="setPictureUrl" @delPictureUrl="delPictureUrl"></my-upload>
          </el-form-item>
          <div v-if="!isDisabled" class="optionBtn">
            <el-button type="primary" class="btn submit" @click.native.prevent="onSubmit">提交</el-button>
@@ -47,8 +38,10 @@
import { deepClone, RESOURCE_TYPE } from "@/utils/helper";
import imageManagement from "@/api/operate/imageManagement";
import { FILE_ORIGINAL_URL } from "@/utils";
import MyUpload from "@/components/myUpload";
export default {
  components: { MyUpload },
  data() {
    const validateImageUrl = (rule, value, callback) => {
      if (this.imagedata.url) {
@@ -76,14 +69,15 @@
        url: [{ required: true, validator: validateImageUrl }],
        type: [{ required: true, trigger: ['blur', 'change'], message: '请选择类型' }]
      },
      isDisabled: false
      isDisabled: false,
      imageList: []
    }
  },
  created() {
    this.imagedata = deepClone(this.originalData);
    if (this.dialogType !== 'create') {
      this.imagedata.url = this.imagedata.url.split(',')[0];
      this.imageList = this.imagedata.url.split(',');
    }
    this.isDisabled = this.dialogType === 'view';
  },
@@ -117,19 +111,13 @@
        }
      })
    },
    imageUpload(file) {
      const formData = new FormData();
      formData.append('file', file.file);
      imageManagement.importImage(formData)
          .then(res => {
            this.$refs.image.clearFiles();
            this.$set(this.imagedata, 'url', FILE_ORIGINAL_URL + res.url1);
            this.$message.success('上传成功');
          })
          .catch(err => {
            this.$message.error(`${err}`);
            this.$refs.image.clearFiles();
          })
    setPictureUrl({ url }) {
      this.imageList.push(`${FILE_ORIGINAL_URL}${url}`);
      this.imagedata.url = this.imageList.join(',');
    },
    delPictureUrl({ url }) {
      this.imageList = this.imageList.filter(item => item !== url);
      this.imagedata.url = this.imageList.join(',');
    },
    getResourceType(value) {
      return value ? RESOURCE_TYPE.find(item => item.value === value) : RESOURCE_TYPE;
src/views/operate/message/myIndex/update/index.vue
@@ -305,7 +305,7 @@
                })
              );
          } else {
            updateMessage(params)
            updateMessage({ id: this.myDataRow.id, ...params })
              .then(() => {
                this.$emit("closeMyDialog");
                this.$message({ type: "success", message: "操作成功" });
src/views/operate/sms/smsTemplate/createTemplate/index.vue
@@ -70,7 +70,7 @@
                  { required: true, trigger: ['blur', 'change'], validator: validateMessageContent }
                ]
            },
            colList: [{ id: "1", columnName: "验证码模板"}, {id: "2",columnName: "活动模板"}],
            colList: [{ id: 1, columnName: "验证码模板"}, {id: 2, columnName: "活动模板"}],
        }
    },
    created() {
@@ -81,7 +81,7 @@
  computed: {
      formDisabled() {
        return this.dialogType !== 'create';
        return this.dialogType === 'view';
      }
  },
    methods: {
src/views/operate/sms/smsTemplate/index.vue
@@ -53,7 +53,7 @@
                    <el-table-column prop="operation" label="操作" min-width="15">
                        <template slot-scope="scope">
                            <div class="operation">
                                <el-link icon="el-icon-view" :underline="false" @click="handleView(scope.row)">查看</el-link>
                                <el-link icon="el-icon-view" :underline="false" @click="handleView(scope.row, 'view')">查看</el-link>
                                <el-link icon="el-icon-edit" class="leftPx" :underline="false" @click="handleEdit(scope.row)">编辑</el-link>
                                <el-link class="leftPx" icon="el-icon-delete-solid" :underline="false"
                                    @click="handleDelete([scope.row.id])">删除</el-link>
@@ -62,7 +62,7 @@
                    </el-table-column>
                </el-table>
                <!-- 新建消息 -->
                <el-dialog :title="dialogType === 'create' ? '新建短信模板' : '查看短信模板'" :visible.sync="isShowDialog" width="80%"
                <el-dialog :title="dialogType === 'view' ? '查看短信模板' : '更新短信模板'" :visible.sync="isShowDialog" width="80%"
                    :before-close="handleConfirmClose">
                    <MyCreate v-if="isShowDialog" @closeMyDialog="handleConfirmClose" :dialogType="dialogType" :tableRowData="messageTemplateData"></MyCreate>
                </el-dialog>