From 12c6f51d841e80bab7089725e63a034dbe6a294f Mon Sep 17 00:00:00 2001
From: fei <791364011@qq.com>
Date: 星期日, 11 一月 2026 21:57:45 +0800
Subject: [PATCH] 修改了代码
---
src/views/archiveManager/archiveMaterial/index.vue | 32 ++++++++-------
src/api/system/materials.js | 6 +-
src/main.js | 36 ++++++++++++++++++
src/views/archiveManager/index.vue | 23 ++++++++---
src/api/system/records.js | 6 +-
5 files changed, 76 insertions(+), 27 deletions(-)
diff --git a/src/api/system/materials.js b/src/api/system/materials.js
index 041cbb2..ee70edd 100644
--- a/src/api/system/materials.js
+++ b/src/api/system/materials.js
@@ -82,7 +82,7 @@
export function getFileCount(recordId)
{
return request({
- url:'/system/materials/getFileCount/'+recordId,
+ url:'/system/materials/getFileCounts/'+recordId,
method:'get',
// headers:{
@@ -94,6 +94,6 @@
return request({
url: '/system/materials/addMiddleRecords/'+recordId+'/'+maxPageNumber,
method: 'get',
-
+
})
-}
\ No newline at end of file
+}
diff --git a/src/api/system/records.js b/src/api/system/records.js
index 8ea0f1e..f28d5f6 100644
--- a/src/api/system/records.js
+++ b/src/api/system/records.js
@@ -8,10 +8,10 @@
})
}
//鏇存柊鐘舵��
-export function updateStatusById(status, id)
+export function updateStatusById(status, id,operator)
{
return request({
- url: '/system/records/updateStatusById/' + status+"/"+id,
+ url: '/system/records/updateStatusById/' + status+"/"+id+"/"+operator,
method: 'get',
// data: data
})
@@ -86,4 +86,4 @@
method: 'post',
data: ids
})
-}
\ No newline at end of file
+}
diff --git a/src/main.js b/src/main.js
index 32aeb90..e4738ac 100644
--- a/src/main.js
+++ b/src/main.js
@@ -62,7 +62,43 @@
Vue.use(directive)
Vue.use(plugins)
DictData.install()
+// 鍒涘缓涓�涓嚜瀹氫箟鎸囦护
+Vue.directive('auto-height', {
+ bind(el, binding) {
+ const minRows = binding.value?.minRows || 1;
+ const maxRows = binding.value?.maxRows || 10;
+ const resize = () => {
+ // 閲嶇疆楂樺害
+ el.style.height = 'auto';
+
+ // 鑾峰彇鍐呭楂樺害
+ const scrollHeight = el.scrollHeight;
+ const lineHeight = parseInt(getComputedStyle(el).lineHeight);
+
+ // 璁$畻闇�瑕佺殑琛屾暟
+ let rows = Math.floor(scrollHeight / lineHeight);
+ rows = Math.max(minRows, Math.min(rows, maxRows));
+
+ // 璁剧疆琛屾暟
+ el.setAttribute('rows', rows);
+ el.style.height = `${rows * lineHeight}px`;
+ };
+
+ // 鐩戝惉杈撳叆浜嬩欢
+ el.addEventListener('input', resize);
+ // 鍒濆鍖栨椂璋冩暣涓�娆�
+ resize();
+
+ // 淇濆瓨resize鍑芥暟浠ヤ究鍗歌浇
+ el._autoHeightResize = resize;
+ },
+
+ unbind(el) {
+ el.removeEventListener('input', el._autoHeightResize);
+ delete el._autoHeightResize;
+ }
+});
/**
* If you don't want to use mock-server
* you want to use MockJs for mock api
diff --git a/src/views/archiveManager/archiveMaterial/index.vue b/src/views/archiveManager/archiveMaterial/index.vue
index 79fd6da..fa1d883 100644
--- a/src/views/archiveManager/archiveMaterial/index.vue
+++ b/src/views/archiveManager/archiveMaterial/index.vue
@@ -19,7 +19,9 @@
<div class="title-search-wrapper">
<el-input
type="textarea"
- rows="1"
+ rows="2"
+ v-auto-height="{ minRows: 2, maxRows: 10 }"
+
v-model="form.creator"
placeholder="璇疯緭鍏ヨ矗浠昏��"
@input="handleCreatorInput"
@@ -51,7 +53,7 @@
<div class="title-search-wrapper">
<el-input
type="textarea"
- rows="1"
+ rows="2"
v-model="form.title"
placeholder="璇疯緭鍏ユ枃浠堕鍚�"
@input="handleTitleInput"
@@ -1037,7 +1039,7 @@
//alert(this.totalPageCount)
//alert(recordId)
this.recordId = recordId;
- this.uploadUrl = process.env.VUE_APP_BASE_API +'/system/materials/upload/'+this.recordId
+ this.uploadUrl = process.env.VUE_APP_BASE_API +'/system/materials/uploads/'+this.recordId
// alert('Bearer ' + getToken())
this.reset()
this.form.securityLevel = '鏅��' // 璁剧疆瀵硅瘽妗嗚〃鍗曢粯璁ゅ��
@@ -1094,10 +1096,10 @@
// 鎵撳紑瀵煎叆瀵硅瘽妗�
handleImport() {
//鐢熸垚鏂扮殑璁板綍
- insertFile(this.recordId, this.totalPageCount).then(response => {
- console.log(response)
- // alert(3245)
- })
+ // insertFile(this.recordId, this.totalPageCount).then(response => {
+ // console.log(response)
+ // // alert(3245)
+ // })
this.importDialogVisible = true
},
// 鏂囦欢绉婚櫎
@@ -1129,12 +1131,12 @@
// var res = response.data.res
// console.log(res)
//alert(response.data.total)
- if(fileCount!=this.totalPageCount)
- {
- this.$modal.msgWarning('璇烽�夋嫨涓庤褰曟暟涓�鑷寸殑鏂囦欢')
- return
- }
- else
+ // if(fileCount!=this.totalPageCount)
+ // {
+ // this.$modal.msgWarning('璇烽�夋嫨涓庤褰曟暟涓�鑷寸殑鏂囦欢')
+ // return
+ // }
+ // else
{
// 鍒濆鍖栦笂浼犵姸鎬佽鏁�
this.uploadSuccessCount = 0;
@@ -1142,7 +1144,7 @@
this.totalUploadFiles = fileCount;
// 鎵ц涓婁紶
this.$refs.upload.submit()
- this.getList()
+ // this.getList()
}
// else
// {
@@ -1641,7 +1643,7 @@
//淇敼妗堝嵎鐨勭姸鎬�
// var id = row.id
var status = '鏈笂浼犻檮浠�'
- updateStatusById(status, recordId).then(response=>{
+ updateStatusById(status, recordId, '閫�鍥炵鐞嗗憳').then(response=>{
// this.$modal.msgSuccess("鎻愪氦鎴愬姛")
// this.getList()
_this.$store.dispatch('tagsView/delView', this.$route);
diff --git a/src/views/archiveManager/index.vue b/src/views/archiveManager/index.vue
index 26b791b..da1e8ea 100644
--- a/src/views/archiveManager/index.vue
+++ b/src/views/archiveManager/index.vue
@@ -959,7 +959,7 @@
import { listAllCategory } from "@/api/system/category"
import { listAllProjectName } from "@/api/system/projectName"
import { listPlaceName, listAllPlaceName } from "@/api/system/placeName"
-import { judge } from "@/api/system/materials"
+import { judge,getFileCount } from "@/api/system/materials"
import { UserRoleIdList,unallocatedUserList, authUserSelectAll } from "@/api/system/role"
import {authManyRecordsToUsers} from "@/api/system/archiverecordstouser"
@@ -1559,21 +1559,32 @@
{
//alert(row.id)
var id = row.id
+ var pageCount = row.pageCount
+ if(pageCount===undefined||pageCount===0)
+ this.$modal.msgWarning('璇峰厛琛ュ厖妗堝嵎椤垫暟锛�')
+
// 鍦ㄦ彁浜や箣鍓嶏紝璋冪敤鍚庣鎺ュ彛妫�鏌ユ槸鍚﹀凡缁忎笂浼犻檮浠�
- judge(id).then(response => {
- // console.log(response)
+ getFileCount(id).then(response => {
+ console.log(response)
// alert(response.data)
- if (response.data===undefined||response.data === false) {
+ if (response.length===undefined||response.length === 0) {
// 濡傛灉鏂囦欢鏁伴噺涓�0锛屾彁绀虹敤鎴峰厛涓婁紶闄勪欢
this.$modal.msgWarning('璇峰厛涓婁紶闄勪欢锛屽啀杩涜鎻愪氦鎿嶄綔')
- } else {
+ }
+ else if(response.length===pageCount)
+ {
// 濡傛灉宸茬粡涓婁紶浜嗛檮浠讹紝缁х画鎻愪氦鎿嶄綔
var status = '褰曞叆瀹屾垚'
- updateStatusById(status, id).then(response=>{
+ updateStatusById(status, id, '鎻愪氦妗堝嵎').then(response=>{
this.$modal.msgSuccess("鎻愪氦鎴愬姛")
this.getList()
})
}
+ else
+ {
+ this.$modal.msgWarning('闄勪欢鏁伴噺涓婁紶涓嶈冻锛岃缁х画涓婁紶锛�')
+
+ }
}).catch(error => {
console.error('妫�鏌ラ檮浠舵暟閲忓け璐�:', error)
this.$modal.msgError('妫�鏌ラ檮浠舵暟閲忓け璐ワ紝璇风◢鍚庨噸璇�')
--
Gitblit v1.9.1