From f399034d0f8e7960512858392d0e8a8692406773 Mon Sep 17 00:00:00 2001
From: wangting <wangting@vci-tech.com>
Date: 星期一, 13 一月 2025 18:14:33 +0800
Subject: [PATCH] 查询模板候选条件可以选择父节点,时间类型不能选择查询模板
---
Source/plt-web/plt-web-ui/src/components/actions/base/uploadFile.vue | 100 +++++++++++++++++++++++---------------------------
1 files changed, 46 insertions(+), 54 deletions(-)
diff --git a/Source/plt-web/plt-web-ui/src/components/actions/base/uploadFile.vue b/Source/plt-web/plt-web-ui/src/components/actions/base/uploadFile.vue
index 433d92d..bb493fa 100644
--- a/Source/plt-web/plt-web-ui/src/components/actions/base/uploadFile.vue
+++ b/Source/plt-web/plt-web-ui/src/components/actions/base/uploadFile.vue
@@ -1,45 +1,35 @@
<template>
<el-dialog
v-dialogDrag
- :width="width"
- :visible.sync="visible"
- :destroy-on-close="true"
:close-on-click-modal="false"
+ :visible.sync="visible"
+ :width="width"
append-to-body
- title="涓婁紶鏂囦欢"
class="avue-dialog"
+ title="涓婁紶鏂囦欢"
+ style="margin-top: -20vh !important;"
>
<Divider left="30px" text="瀵煎叆鎻愮ず"></Divider>
- <ul>
- <li>
- 1.绾㈣壊瀛椾綋琛ㄧず蹇呰緭椤�
+ <ul style="color: #e73a3a">
+ <li v-if="!paramVOS.tipList">
+ 璇风偣鍑绘祻瑙堟枃浠惰繘琛屼笂浼�
</li>
- <li>
- 2.姣忔浠呰兘鏈�澶氬鍏�10000鏉℃暟鎹�
- </li>
+ <li v-if="paramVOS.tipList && paramVOS.tipList.length >=1 " v-for="(item,index) in paramVOS.tipList" :key="index"> {{index+1}} : {{item}}銆�</li>
</ul>
- <Divider left="30px" text="excel鏂囦欢锛岄�夋嫨鏂囦欢鍚庝細鑷姩涓婁紶"></Divider>
+ <Divider left="30px" text="閫夋嫨鏂囦欢鍚庝細鑷姩涓婁紶"></Divider>
<el-upload
:before-upload="beforeUpload"
+ :data="fileData"
:headers="uploadHeaders"
:on-change="uploadChange"
:on-error="onError"
:on-success="onSuccess"
:show-file-list="false"
- accept=".xlsx, .xls"
- action="/api/ubcs-code/codeClassify/importClassify"
+ action="/api/vciFileUploadController/uploadFile"
class="upload-demo">
<el-button size="small" style="margin: 15px 35px" type="primary">娴忚鏂囦欢</el-button>
</el-upload>
<template #footer>
- <el-button
- :loading="downloadLoading"
- size="small"
- type="primary"
- @click="downloadTemplateFun"
- >涓嬭浇瀵煎叆妯℃澘
- </el-button
- >
<el-button size="small" @click="visible = false">鍏抽棴</el-button>
</template>
</el-dialog>
@@ -74,8 +64,11 @@
flga: true,
pageLoading: null,
downloadLoading: false,
- visible:false,
+ visible: false,
}
+ },
+ created() {
+ console.log(this.sourceData);
},
watch: {
visible: {
@@ -87,8 +80,17 @@
computed: {
uploadHeaders() {
return {
- "Blade-Auth": "bearer " + getToken(),
+ "Authorizationtoken": getToken(),
};
+ },
+ fileData() {
+ return {
+ ownbizOid: this.sourceData.oid,
+ ownBtmName: this.sourceData.btmname,
+ secretGrade: this.paramVOS.secretGrade || -1,
+ fileDocClassify: this.paramVOS.fileDocClassify || "",
+ updateFileFlag: this.paramVOS.updateFileFlag || true,
+ }
},
width() {
if (!validatenull(this.paramVOS.width)) {
@@ -98,14 +100,14 @@
return this.paramVOS.width + "px";
}
} else {
- return "60%";
+ return "40%";
}
},
- fullscreen(){
+ fullscreen() {
console.log(this.paramVOS)
- if(this.paramVOS.width || this.paramVOS.height){
+ if (this.paramVOS.width || this.paramVOS.height) {
return false;
- }else if(this.paramVOS.form){
+ } else if (this.paramVOS.form) {
return false;
}
return true;
@@ -114,56 +116,46 @@
methods: {
//鏂囦欢涓婁紶鍓�
async beforeUpload(file) {
- const fileType = file.name.split(".").pop();
- if (fileType !== "xlsx" && fileType !== "xls") {
- // 涓婁紶鏍煎紡涓嶇鍚堣姹傦紝鎻愮ず閿欒淇℃伅骞跺彇娑堜笂浼�
- this.$message.error("鍙厑璁镐笂浼爔lsx銆亁ls鏍煎紡鐨勬枃浠�");
- return Promise.reject(false);
+ // 鑾峰彇鏂囦欢鎵╁睍鍚�
+ const fileExtension = file.name.split(".").pop().toLowerCase(); // 杞崲涓哄皬鍐欎互閬垮厤澶у皬鍐欎笉鍖归厤鐨勯棶棰�
+
+ if(this.paramVOS.filetype){
+ if (!this.paramVOS.filetype.includes(fileExtension)) {
+ // 涓婁紶鏍煎紡涓嶇鍚堣姹傦紝鎻愮ず閿欒淇℃伅骞跺彇娑堜笂浼�
+ this.$message.error(`鍙厑璁镐笂浼�${this.paramVOS.filetype.toString()}鏍煎紡鐨勬枃浠禶);
+ return Promise.reject(false);
+ }
}
+
this.pageLoading = this.$loading({
lock: true,
text: "鏂囦欢涓婁紶涓�",
spinner: "el-icon-loading",
background: "rgba(0, 0, 0, 0.7)",
});
+
return true;
},
// 鏂囦欢涓婁紶鎴愬姛
onSuccess(resbonse) {
- if (Object.keys(resbonse.data).length === 0) {
+ if (resbonse.code === 200) {
this.$message.success("涓婁紶鎴愬姛锛�");
- this.dialogVisible = false;
- return;
+ this.visible = false;
+ }else {
+ this.$message.error(resbonse.msg);
}
- if (resbonse.data.fileOid) {
- const fileName = resbonse.data.filePath.split("/").pop();
- this.$message.error("璇蜂笅杞介敊璇俊鎭枃浠惰繘琛屾煡鐪嬶紒");
- downloadErrorFile({uuid: resbonse.data.fileOid}).then((res) => {
- func.downloadFileByBlobHandler(res);
- });
- }
- },
- //鐐瑰嚮涓嬭浇妯℃澘
- downloadTemplateFun() {
- this.downloadLoading = true;
- downloadBatchImportApplyTemplate({codeClassifyOid: this.codeClassifyOid}).then(res => {
- this.$utilFunc.downloadFileByBlob(res.data, "妯℃澘鏂囦欢.xls");
- this.downloadLoading = false;
- }).catch((res) => {
- this.$message.warning(res)
- this.downloadLoading = false;
- })
},
//鏂囦欢涓婁紶澶辫触
onError(res) {
this.pageLoading.close();
+ this.$message.error(res);
},
//鏂囦欢鐘舵�佹敼鍙�
uploadChange(file) {
if (file.status === "success" || file.status === "error") {
this.pageLoading.close();
}
- }
+ },
}
}
</script>
--
Gitblit v1.9.3