|  | @@ -104,20 +104,20 @@
 | 
											
												
													
														|  |              <van-uploader
 |  |              <van-uploader
 | 
											
												
													
														|  |                :after-read="afterRead"
 |  |                :after-read="afterRead"
 | 
											
												
													
														|  |                v-model="fileList"
 |  |                v-model="fileList"
 | 
											
												
													
														|  | -              :max-count="1"
 |  | 
 | 
											
												
													
														|  | 
 |  | +              :max-count="6"
 | 
											
												
													
														|  |                capture="camera"
 |  |                capture="camera"
 | 
											
												
													
														|  |                accept=""
 |  |                accept=""
 | 
											
												
													
														|  | 
 |  | +              :before-delete="fjdelete"
 | 
											
												
													
														|  |              >
 |  |              >
 | 
											
												
													
														|  |                <van-button icon="plus">上传文件</van-button>
 |  |                <van-button icon="plus">上传文件</van-button>
 | 
											
												
													
														|  | -              <template #preview-cover="file">
 |  | 
 | 
											
												
													
														|  | 
 |  | +              <!-- <template #preview-cover="file">
 | 
											
												
													
														|  |                  <div class="preview-cover van-ellipsis">{{ file.name }}</div>
 |  |                  <div class="preview-cover van-ellipsis">{{ file.name }}</div>
 | 
											
												
													
														|  | -              </template>
 |  | 
 | 
											
												
													
														|  | 
 |  | +              </template> -->
 | 
											
												
													
														|  |              </van-uploader>
 |  |              </van-uploader>
 | 
											
												
													
														|  |            </template>
 |  |            </template>
 | 
											
												
													
														|  |          </van-field>
 |  |          </van-field>
 | 
											
												
													
														|  |        </van-cell-group>
 |  |        </van-cell-group>
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | -
 |  | 
 | 
											
												
													
														|  |        <van-cell-group>
 |  |        <van-cell-group>
 | 
											
												
													
														|  |          <div class="rowTextArea">
 |  |          <div class="rowTextArea">
 | 
											
												
													
														|  |            <van-field
 |  |            <van-field
 | 
											
										
											
												
													
														|  | @@ -143,6 +143,8 @@ import { reactive, ref } from "vue";
 | 
											
												
													
														|  |  import personList from "../personList.vue";
 |  |  import personList from "../personList.vue";
 | 
											
												
													
														|  |  import siteInspectionService from "@/api/siteInspection/siteInspectionService";
 |  |  import siteInspectionService from "@/api/siteInspection/siteInspectionService";
 | 
											
												
													
														|  |  import tools from "@/api/sys/tools";
 |  |  import tools from "@/api/sys/tools";
 | 
											
												
													
														|  | 
 |  | +// 图片路径
 | 
											
												
													
														|  | 
 |  | +import $base from "@/utils/config";
 | 
											
												
													
														|  |  export default {
 |  |  export default {
 | 
											
												
													
														|  |    components: { personList },
 |  |    components: { personList },
 | 
											
												
													
														|  |    setup() {
 |  |    setup() {
 | 
											
										
											
												
													
														|  | @@ -226,22 +228,44 @@ export default {
 | 
											
												
													
														|  |      // 文件上传
 |  |      // 文件上传
 | 
											
												
													
														|  |      let fileList = ref([]);
 |  |      let fileList = ref([]);
 | 
											
												
													
														|  |      const afterRead = (file) => {
 |  |      const afterRead = (file) => {
 | 
											
												
													
														|  | -      fileList.value = [];
 |  | 
 | 
											
												
													
														|  |        // 此时可以自行将文件上传至服务器
 |  |        // 此时可以自行将文件上传至服务器
 | 
											
												
													
														|  |        new tools()
 |  |        new tools()
 | 
											
												
													
														|  |          .uploadFile(file, `csjcqk/siteInspection`)
 |  |          .uploadFile(file, `csjcqk/siteInspection`)
 | 
											
												
													
														|  |          .then(({ data }) => {
 |  |          .then(({ data }) => {
 | 
											
												
													
														|  | -          // window.xm.showToast({
 |  | 
 | 
											
												
													
														|  | -          //     message:data.url
 |  | 
 | 
											
												
													
														|  | -          // })
 |  | 
 | 
											
												
													
														|  | -          fileList.value.push("http://localhost:3000"+data.url);
 |  | 
 | 
											
												
													
														|  | -          //siteInspection.value.enclosure = data.url;
 |  | 
 | 
											
												
													
														|  | 
 |  | +        
 | 
											
												
													
														|  | 
 |  | +          data.name = decodeURIComponent(
 | 
											
												
													
														|  | 
 |  | +            data.url.substring(
 | 
											
												
													
														|  | 
 |  | +              data.url.lastIndexOf("/") + 1
 | 
											
												
													
														|  | 
 |  | +            )
 | 
											
												
													
														|  | 
 |  | +          );
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +          data.url = `${$base}` + data.url;      
 | 
											
												
													
														|  | 
 |  | +          
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +          //fileList.value[0].url = `${$base}` + fileList.value[0].url;
 | 
											
												
													
														|  | 
 |  | +          // fileList.value[0].name = decodeURIComponent(
 | 
											
												
													
														|  | 
 |  | +          //   fileList.value[0].url.substring(
 | 
											
												
													
														|  | 
 |  | +          //     fileList.value[0].url.lastIndexOf("/") + 1
 | 
											
												
													
														|  | 
 |  | +          //   )
 | 
											
												
													
														|  | 
 |  | +          // );
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |          });
 |  |          });
 | 
											
												
													
														|  |      };
 |  |      };
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +    const fjdelete = (file) => {
 | 
											
												
													
														|  | 
 |  | +      console.log(file);
 | 
											
												
													
														|  | 
 |  | +    };
 | 
											
												
													
														|  | 
 |  | +    
 | 
											
												
													
														|  |      // 提交数据
 |  |      // 提交数据
 | 
											
												
													
														|  |      const submit = () => {
 |  |      const submit = () => {
 | 
											
												
													
														|  |        //添加保存前判断
 |  |        //添加保存前判断
 | 
											
												
													
														|  |  
 |  |  
 | 
											
												
													
														|  | 
 |  | +      //保存前附件处理
 | 
											
												
													
														|  | 
 |  | +      siteInspection.enclosure = data.url;
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  | 
 |  | +
 | 
											
												
													
														|  |        new siteInspectionService().save(siteInspection).then((res) => {
 |  |        new siteInspectionService().save(siteInspection).then((res) => {
 | 
											
												
													
														|  |          if(res.data=="保存场所检查情况成功"){
 |  |          if(res.data=="保存场所检查情况成功"){
 | 
											
												
													
														|  |            window.xm.showToast({
 |  |            window.xm.showToast({
 | 
											
										
											
												
													
														|  | @@ -276,6 +300,7 @@ export default {
 | 
											
												
													
														|  |        // 文件上传
 |  |        // 文件上传
 | 
											
												
													
														|  |        afterRead,
 |  |        afterRead,
 | 
											
												
													
														|  |        fileList,
 |  |        fileList,
 | 
											
												
													
														|  | 
 |  | +      fjdelete,
 | 
											
												
													
														|  |        submit,
 |  |        submit,
 | 
											
												
													
														|  |      };
 |  |      };
 | 
											
												
													
														|  |    },
 |  |    },
 | 
											
										
											
												
													
														|  | @@ -342,4 +367,15 @@ export default {
 | 
											
												
													
														|  |    width: 80%;
 |  |    width: 80%;
 | 
											
												
													
														|  |    top: 50%;
 |  |    top: 50%;
 | 
											
												
													
														|  |  }
 |  |  }
 | 
											
												
													
														|  | 
 |  | +.preview-cover {
 | 
											
												
													
														|  | 
 |  | +    position: absolute;
 | 
											
												
													
														|  | 
 |  | +    bottom: 0;
 | 
											
												
													
														|  | 
 |  | +    box-sizing: border-box;
 | 
											
												
													
														|  | 
 |  | +    width: 100%;
 | 
											
												
													
														|  | 
 |  | +    padding: 4px;
 | 
											
												
													
														|  | 
 |  | +    color: #fff;
 | 
											
												
													
														|  | 
 |  | +    font-size: 12px;
 | 
											
												
													
														|  | 
 |  | +    text-align: center;
 | 
											
												
													
														|  | 
 |  | +    background: rgba(0, 0, 0, 0.3);
 | 
											
												
													
														|  | 
 |  | +  }
 | 
											
												
													
														|  |  </style>
 |  |  </style>
 |