|
@@ -55,7 +55,7 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item style="float: right; margin-right: 0">
|
|
|
<el-button
|
|
|
- v-if="photography == 1"
|
|
|
+ v-if="photography == 1"
|
|
|
@click="windowOpen({ type: 'photography', library: true })"
|
|
|
>{{ $t("mediaLibrary.photography") }}</el-button
|
|
|
>
|
|
@@ -319,7 +319,7 @@
|
|
|
type="primary"
|
|
|
@click="hanleDown"
|
|
|
>
|
|
|
- {{$t("sys.download")}}
|
|
|
+ {{ $t("sys.download") }}
|
|
|
</el-button>
|
|
|
</div>
|
|
|
</template>
|
|
@@ -337,6 +337,7 @@ import {
|
|
|
getaddOrUpdate,
|
|
|
setFileaddOrUpdate,
|
|
|
uploadFile,
|
|
|
+ getUploadProcess,
|
|
|
getUrlSrc,
|
|
|
} from "@/store/case";
|
|
|
import dayjs from "dayjs";
|
|
@@ -496,30 +497,48 @@ const handleuploadAdd = async () => {
|
|
|
text: loadingText.value,
|
|
|
background: "rgba(0, 0, 0, 0.7)",
|
|
|
});
|
|
|
+ windowOpen({type: 'event', data: 'menu-disabled'})
|
|
|
uploadFile({ file, dictId: addForm.value.dictId }, (completeProgress) => {
|
|
|
console.log("上传进度", completeProgress);
|
|
|
// props.progress = completeProgress; //上传过程
|
|
|
loadingText.value = completeProgress + "%";
|
|
|
- loading.setText(ui18n.t("mediaLibrary.tips.uplooad") + loadingText.value)
|
|
|
- }).then((res) => {
|
|
|
- loading.close();
|
|
|
- console.log("上传进度", res);
|
|
|
- if (res.data?.status != -1) {
|
|
|
+ loading.setText(ui18n.t("mediaLibrary.tips.uplooad") + loadingText.value);
|
|
|
+ })
|
|
|
+ .then(async (res) => {
|
|
|
+ console.log("上传进度", res);
|
|
|
+ if (res.data?.status != -1) {
|
|
|
+ getFileStatus(res.data.id, loading);
|
|
|
+ } else {
|
|
|
+ ElMessage.error(ui18n.t("mediaLibrary.tips.uplooadErr"));
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch((err) => {
|
|
|
+ loading.close();
|
|
|
+ windowOpen({type: 'event', data: 'menu-enabled'})
|
|
|
+ });
|
|
|
+ console.log(formData);
|
|
|
+ }
|
|
|
+};
|
|
|
+const getFileStatus = (id, loading) => {
|
|
|
+ getUploadProcess(id).then((res) => {
|
|
|
+ console.log("getFileStatus", res);
|
|
|
+ if(res.percent == 100){
|
|
|
+ loading.close();
|
|
|
+ windowOpen({type: 'event', data: 'menu-enabled'})
|
|
|
initData();
|
|
|
dialogData.value.show = false;
|
|
|
ElMessage({
|
|
|
type: "success",
|
|
|
message: res.data?.status == 0 ? ui18n.t("record.backRun"):ui18n.t("mediaLibrary.tips.uplooadSuccess"),
|
|
|
});
|
|
|
- } else {
|
|
|
- ElMessage.error(ui18n.t("mediaLibrary.tips.uplooadErr"));
|
|
|
- }
|
|
|
- }).catch((err) => {
|
|
|
- loading.close();
|
|
|
- });
|
|
|
- console.log(formData);
|
|
|
- }
|
|
|
+ }else{
|
|
|
+ setTimeout(()=>{
|
|
|
+ getFileStatus(id, loading)
|
|
|
+ },1000)
|
|
|
+ }
|
|
|
+ });
|
|
|
};
|
|
|
+
|
|
|
// 定义方法
|
|
|
const del = (row) => {
|
|
|
console.log(file, "file");
|
|
@@ -701,9 +720,9 @@ initData();
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss">
|
|
|
-.upload-demo .el-upload-list__item.is-success:focus:not(:hover){
|
|
|
- display: none !important;
|
|
|
- }
|
|
|
+.upload-demo .el-upload-list__item.is-success:focus:not(:hover) {
|
|
|
+ display: none !important;
|
|
|
+}
|
|
|
.mb-3 {
|
|
|
margin-bottom: 1rem;
|
|
|
}
|
|
@@ -761,7 +780,7 @@ initData();
|
|
|
white-space: nowrap; //溢出不换行
|
|
|
}
|
|
|
.del {
|
|
|
- color: #FA3D47;
|
|
|
+ color: #fa3d47;
|
|
|
// width: 40px;
|
|
|
|
|
|
cursor: pointer;
|