Showing
5 changed files
with
23 additions
and
5 deletions
@@ -101,7 +101,7 @@ | @@ -101,7 +101,7 @@ | ||
101 | </el-link> | 101 | </el-link> |
102 | <br/> | 102 | <br/> |
103 | <el-link type="info" :underline="false" @click="reNameFile(file,false)" > | 103 | <el-link type="info" :underline="false" @click="reNameFile(file,false)" > |
104 | - <span v-if="!reNameFileFlg[file.id]">{{file.fileName}}</span> | 104 | + <div v-if="!reNameFileFlg[file.id]" style="width: 120px;overflow: hidden;text-overflow: ellipsis;text-align: left;">{{file.fileName}}</div> |
105 | <el-input :autofocus="true" v-if="reNameFileFlg[file.id]" placeholder="输入文件名" v-model="file.fileName" @blur="reNameFile(file,true)"></el-input> | 105 | <el-input :autofocus="true" v-if="reNameFileFlg[file.id]" placeholder="输入文件名" v-model="file.fileName" @blur="reNameFile(file,true)"></el-input> |
106 | </el-link> | 106 | </el-link> |
107 | </div> | 107 | </div> |
@@ -150,7 +150,7 @@ export default { | @@ -150,7 +150,7 @@ export default { | ||
150 | 150 | ||
151 | getPage(id); | 151 | getPage(id); |
152 | } else { | 152 | } else { |
153 | - proxy.$global.viewer(item.localPath); | 153 | + proxy.$global.viewer(item.localPath,proxy); |
154 | } | 154 | } |
155 | } | 155 | } |
156 | 156 | ||
@@ -556,6 +556,10 @@ export default { | @@ -556,6 +556,10 @@ export default { | ||
556 | if(type == 'folder'){ | 556 | if(type == 'folder'){ |
557 | url = `/inspection-report/file/rename/user`; | 557 | url = `/inspection-report/file/rename/user`; |
558 | } | 558 | } |
559 | + if(item.fileName == null || item.fileName == '' ){ | ||
560 | + proxy.$global.showMsg("文件名称不能为空!","warning"); | ||
561 | + return; | ||
562 | + } | ||
559 | // 执行改名 | 563 | // 执行改名 |
560 | proxy.$http.get(url, {id:item.id,name:item.fileName}, function (res) { | 564 | proxy.$http.get(url, {id:item.id,name:item.fileName}, function (res) { |
561 | if (res && res.success) { | 565 | if (res && res.success) { |
@@ -34,6 +34,7 @@ | @@ -34,6 +34,7 @@ | ||
34 | :before-upload="beforeUpload" | 34 | :before-upload="beforeUpload" |
35 | :multiple="false" | 35 | :multiple="false" |
36 | :http-request="getInsetFile" | 36 | :http-request="getInsetFile" |
37 | + :on-change="fileChange" | ||
37 | :auto-upload="true"> | 38 | :auto-upload="true"> |
38 | <el-button size="small" type="primary">上传照片</el-button> | 39 | <el-button size="small" type="primary">上传照片</el-button> |
39 | </el-upload> | 40 | </el-upload> |
@@ -120,6 +120,7 @@ export default { | @@ -120,6 +120,7 @@ export default { | ||
120 | category:props.category, | 120 | category:props.category, |
121 | docNo:props.docNo | 121 | docNo:props.docNo |
122 | } | 122 | } |
123 | +debugger | ||
123 | // 上传文件 | 124 | // 上传文件 |
124 | proxy.$http.uploadFile("/inspection-report/file/upload", params, function (res) { | 125 | proxy.$http.uploadFile("/inspection-report/file/upload", params, function (res) { |
125 | if (res && res.code == 0) { | 126 | if (res && res.code == 0) { |
@@ -131,6 +132,11 @@ export default { | @@ -131,6 +132,11 @@ export default { | ||
131 | }) | 132 | }) |
132 | } | 133 | } |
133 | 134 | ||
135 | + let fileChange = (file, fileList) =>{ | ||
136 | +debugger | ||
137 | + console.log(file, fileList); | ||
138 | + } | ||
139 | + | ||
134 | // 上传按钮点击 | 140 | // 上传按钮点击 |
135 | let uploadFile = () => { | 141 | let uploadFile = () => { |
136 | proxy.$refs.upload.submit() | 142 | proxy.$refs.upload.submit() |
@@ -167,7 +173,8 @@ export default { | @@ -167,7 +173,8 @@ export default { | ||
167 | show, | 173 | show, |
168 | uploadFile, | 174 | uploadFile, |
169 | hidedialog, | 175 | hidedialog, |
170 | - beforeUpload | 176 | + beforeUpload, |
177 | + fileChange | ||
171 | } | 178 | } |
172 | } | 179 | } |
173 | } | 180 | } |
@@ -123,8 +123,14 @@ global.getQueryVariable = (variable) => { | @@ -123,8 +123,14 @@ global.getQueryVariable = (variable) => { | ||
123 | * 文件预览 | 123 | * 文件预览 |
124 | * @param path | 124 | * @param path |
125 | */ | 125 | */ |
126 | -global.viewer = (path) =>{ | ||
127 | - window.open("/src/lib/extend/pdfjs/web/viewer.html?test=" + encodeURIComponent(path)); | 126 | +global.viewer = (path,proxy) =>{ |
127 | + proxy.$http.get(`/api-web/openoffice/convertPdf/?path=${encodeURIComponent(path)}`, {}, function (res) { | ||
128 | + if (res && res.success) { | ||
129 | + window.open("/src/lib/extend/pdfjs/web/viewer.html?test=" + encodeURIComponent(res.str)); | ||
130 | + } else { | ||
131 | + global.showMsg(data.msg,"error") | ||
132 | + } | ||
133 | + }) | ||
128 | } | 134 | } |
129 | 135 | ||
130 | /** | 136 | /** |
-
Please register or login to post a comment