manage-client-xy 3.2.1 → 3.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,252 +1,254 @@
1
- <template>
2
- <div>
3
- <modal :show.sync="show" v-ref:modal backdrop="false">
4
- <header slot="modal-header" class="modal-header">
5
- <h4 class="modal-title">附件查看</h4>
6
- </header>
7
- <article slot="modal-body" class="modal-body">
8
- <div v-if="loading" class="loading-container">
9
- <div class="loading-spinner"></div>
10
- <p>加载中...</p>
11
- </div>
12
- <div v-if="!loading && error" class="error-container">
13
- <p>{{ error }}</p>
14
- </div>
15
- <div v-if="!loading && !error && (!attachments || attachments.length === 0)" class="no-data-container">
16
- <p>暂无附件</p>
17
- </div>
18
- <div v-if="!loading && !error && attachments && attachments.length > 0" class="attachments-list">
19
- <div class="showList col-sm-12" style="padding: 10px;margin-top: 10px">
20
- <div class="col-sm-6" style="padding:10px 10px 0px 10px;height: auto;box-sizing: border-box"
21
- v-for="attachment in attachments" track-by="id">
22
- <div class="showData">
23
- <div class="left">
24
- <img v-if="isImageFile(attachment)" :src="attachment.f_downloadpath || '#'" />
25
- <div v-else class="file-icon">
26
- <i class="glyphicon" :class="getFileIconClass(attachment)"></i>
27
- </div>
28
- </div>
29
- <div class="right">
30
- <ul class="buttonList top">
31
- <li v-if="['jpg','jpeg','png','gif','bmp'].includes(attachment.f_filetype.toLowerCase())">
32
- <a target="_blank" :href="attachment.f_downloadpath">预览</a>
33
- </li>
34
- <li>
35
- <a href="javascript:void(0)" @click="downloadAttachment(attachment)">下载</a>
36
- </li>
37
- </ul>
38
- </div>
39
- </div>
40
- </div>
41
- </div>
42
- </div>
43
- </article>
44
- <footer slot="modal-footer" class="modal-footer">
45
- <button class="button_clear button_spacing" @click="close">关闭</button>
46
- </footer>
47
- </modal>
48
- </div>
49
- </template>
50
-
51
- <script>
52
- import { HttpResetClass } from 'vue-client'
53
-
54
- export default {
55
- props: {
56
- businessId: {
57
- type: [String, Number],
58
- required: true
59
- },
60
- tableName: {
61
- type: String,
62
- required: true
63
- }
64
- },
65
- data() {
66
- return {
67
- show: true,
68
- loading: true,
69
- error: null,
70
- attachments: []
71
- }
72
- },
73
- created() {
74
- this.fetchAttachments()
75
- },
76
- methods: {
77
- fetchAttachments() {
78
- this.loading = true
79
- this.error = null
80
-
81
- try {
82
- if(!this.businessId || !this.tableName){
83
- this.error = '业务ID和表名不能为空'
84
- this.loading = false
85
- return
86
- }
87
- const HttpReset = new HttpResetClass()
88
- HttpReset.load('POST', 'rs/sql/singleTable_OrderBy', {
89
- data: {
90
- items: 'id,F_DOWNLOADPATH,f_filename,f_filetype',
91
- condition: `F_TABLE_NAME='${this.tableName}' and F_BUSINESSID = '${this.businessId}'`,
92
- tablename: 't_files',
93
- orderitem: 'id'
94
- }
95
- },{rejectMsg:null,resolveMsg:null}).then((response) => {
96
- this.attachments = response.data || []
97
- // 处理文件路径,确保完整URL
98
- this.attachments.forEach(item => {
99
- if (item.f_downloadpath && !item.f_downloadpath.startsWith('http')) {
100
- let temp = item.f_downloadpath
101
- let URL = temp.substring(temp.lastIndexOf(":\\") + 2)
102
- item.f_downloadpath = "http://" + location.host + "/" + URL
103
- } else {
104
- item.f_downloadpath = item.f_downloadpath
105
- }
106
- })
107
- this.loading = false
108
- }).catch((error) => {
109
- this.error = '获取附件失败:' + (error.message || '未知错误')
110
- this.loading = false
111
- })
112
-
113
- } catch (error) {
114
- this.error = '获取附件失败:' + (error.message || '未知错误')
115
- this.loading = false
116
- }
117
- },
118
- previewAttachment(attachment) {
119
- // 根据附件类型处理预览
120
- alert('预览附件:' + attachment.fileName)
121
- },
122
- downloadAttachment(attachment) {
123
- this.$downFileR(attachment.f_downloadpath,attachment.f_filename,true)
124
- },
125
- close() {
126
- this.show = false
127
- this.$emit('close')
128
- },
129
- isImageFile(file) {
130
- const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp'];
131
- const fileExt = file.f_filetype.toLowerCase();
132
- return imageExtensions.indexOf(fileExt) !== -1;
133
- },
134
- getFileIconClass(file) {
135
- const fileType = file.f_filetype.toLowerCase();
136
-
137
- if (fileType === 'pdf') {
138
- return 'glyphicon-file text-danger';
139
- } else if (['doc', 'docx'].indexOf(fileType) !== -1) {
140
- return 'glyphicon-file text-primary';
141
- } else if (['xls', 'xlsx'].indexOf(fileType) !== -1) {
142
- return 'glyphicon-file text-success';
143
- } else {
144
- return 'glyphicon-file';
145
- }
146
- }
147
- }
148
- }
149
- </script>
150
-
151
- <style scoped>
152
- .loading-container, .error-container, .no-data-container {
153
- text-align: center;
154
- padding: 30px;
155
- }
156
-
157
- .loading-spinner {
158
- display: inline-block;
159
- width: 40px;
160
- height: 40px;
161
- border: 4px solid #f3f3f3;
162
- border-top: 4px solid #3498db;
163
- border-radius: 50%;
164
- animation: spin 1s linear infinite;
165
- margin-bottom: 10px;
166
- }
167
-
168
- @keyframes spin {
169
- 0% { transform: rotate(0deg); }
170
- 100% { transform: rotate(360deg); }
171
- }
172
-
173
- .attachments-list {
174
- width: 100%;
175
- }
176
-
177
- .showData {
178
- height: auto;
179
- position: relative;
180
- padding-bottom: 7px;
181
- border-bottom: solid 1px #c1c1c1;
182
- font-family: "微软雅黑";
183
- }
184
-
185
- .showData .left {
186
- height: 180px;
187
- width: 210px;
188
- background-color: rgb(240, 240, 240);
189
- overflow: hidden;
190
- line-height: 180px;
191
- text-align: center;
192
- }
193
-
194
- .showData .left img {
195
- width: 100%;
196
- height: auto;
197
- }
198
-
199
- .showData .right {
200
- position: absolute;
201
- top: 0px;
202
- left: 220px;
203
- right: 0px;
204
- height: 180px;
205
- }
206
-
207
- .showData .right .top {
208
- height: 30px;
209
- line-height: 30px;
210
- color: rgb(98, 98, 98);
211
- }
212
-
213
- .showData .right ul {
214
- height: 20px;
215
- padding: 0px;
216
- margin: 0px;
217
- font-size: 0px;
218
- }
219
-
220
- .showData .right ul li {
221
- display: inline-block;
222
- height: 20px;
223
- list-style: none;
224
- font-size: 16px;
225
- line-height: 20px;
226
- color: #FFFFFF;
227
- background-color: #5bb85d;
228
- padding: 0px 7px;
229
- margin-right: 10px;
230
- cursor: pointer;
231
- }
232
-
233
- .showData .right ul li:hover {
234
- background-color: rgb(80, 150, 80);
235
- }
236
-
237
- .showData .right ul li:active {
238
- background-color: rgb(150, 200, 150);
239
- }
240
-
241
- .showData .right ul li a {
242
- width: 100%;
243
- height: 100%;
244
- text-decoration: none;
245
- color: #FFFFFF;
246
- }
247
-
248
- .file-icon {
249
- font-size: 60px;
250
- color: #999;
251
- }
1
+ <template>
2
+ <div>
3
+ <modal :show.sync="show" v-ref:modal backdrop="false">
4
+ <header slot="modal-header" class="modal-header">
5
+ <h4 class="modal-title">附件查看</h4>
6
+ </header>
7
+ <article slot="modal-body" class="modal-body">
8
+ <div v-if="loading" class="loading-container">
9
+ <div class="loading-spinner"></div>
10
+ <p>加载中...</p>
11
+ </div>
12
+ <div v-if="!loading && error" class="error-container">
13
+ <p>{{ error }}</p>
14
+ </div>
15
+ <div v-if="!loading && !error && (!attachments || attachments.length === 0)" class="no-data-container">
16
+ <p>暂无附件</p>
17
+ </div>
18
+ <div v-if="!loading && !error && attachments && attachments.length > 0" class="attachments-list">
19
+ <div class="showList col-sm-12" style="padding: 10px;margin-top: 10px">
20
+ <div class="col-sm-6" style="padding:10px 10px 0px 10px;height: auto;box-sizing: border-box"
21
+ v-for="attachment in attachments" track-by="id">
22
+ <div class="showData">
23
+ <div class="left">
24
+ <img v-if="isImageFile(attachment)" :src="attachment.f_downloadpath || '#'" />
25
+ <div v-else class="file-icon">
26
+ <i class="glyphicon" :class="getFileIconClass(attachment)"></i>
27
+ </div>
28
+ </div>
29
+ <div class="right">
30
+ <ul class="buttonList top">
31
+ <li v-if="['jpg','jpeg','png','gif','bmp'].includes(attachment.f_filetype.toLowerCase())">
32
+ <a target="_blank" :href="attachment.f_downloadpath">预览</a>
33
+ </li>
34
+ <li>
35
+ <a href="javascript:void(0)" @click="downloadAttachment(attachment)">下载</a>
36
+ </li>
37
+ </ul>
38
+ </div>
39
+ </div>
40
+ </div>
41
+ </div>
42
+ </div>
43
+ </article>
44
+ <footer slot="modal-footer" class="modal-footer">
45
+ <button class="button_clear button_spacing" @click="close">关闭</button>
46
+ </footer>
47
+ </modal>
48
+ </div>
49
+ </template>
50
+
51
+ <script>
52
+ import { HttpResetClass } from 'vue-client'
53
+
54
+ export default {
55
+ props: {
56
+ businessId: {
57
+ type: [String, Number],
58
+ required: true
59
+ },
60
+ tableName: {
61
+ type: String,
62
+ required: true
63
+ }
64
+ },
65
+ data() {
66
+ return {
67
+ show: true,
68
+ loading: true,
69
+ error: null,
70
+ attachments: []
71
+ }
72
+ },
73
+ created() {
74
+ this.fetchAttachments()
75
+ },
76
+ methods: {
77
+ fetchAttachments() {
78
+ this.loading = true
79
+ this.error = null
80
+
81
+ try {
82
+ if(!this.businessId || !this.tableName){
83
+ this.error = '业务ID和表名不能为空'
84
+ this.loading = false
85
+ return
86
+ }
87
+ const HttpReset = new HttpResetClass()
88
+ HttpReset.load('POST', 'rs/sql/singleTable_OrderBy', {
89
+ data: {
90
+ items: 'id,F_DOWNLOADPATH,f_filename,f_filetype',
91
+ condition: `F_TABLE_NAME='${this.tableName}' and F_BUSINESSID = '${this.businessId}'`,
92
+ tablename: 't_files',
93
+ orderitem: 'id'
94
+ }
95
+ },{rejectMsg:null,resolveMsg:null}).then((response) => {
96
+ this.attachments = response.data || []
97
+ // 处理文件路径,确保完整URL
98
+ this.attachments.forEach(item => {
99
+ if (item.f_downloadpath && !item.f_downloadpath.startsWith('http')) {
100
+ let temp = item.f_downloadpath
101
+ let URL = temp.substring(temp.lastIndexOf(":\\") + 2)
102
+ // 将反斜杠替换为正斜杠
103
+ URL = URL.replace(/\\/g, '/')
104
+ item.f_downloadpath = "http://" + location.host + "/" + URL
105
+ } else {
106
+ item.f_downloadpath = item.f_downloadpath
107
+ }
108
+ })
109
+ this.loading = false
110
+ }).catch((error) => {
111
+ this.error = '获取附件失败:' + (error.message || '未知错误')
112
+ this.loading = false
113
+ })
114
+
115
+ } catch (error) {
116
+ this.error = '获取附件失败:' + (error.message || '未知错误')
117
+ this.loading = false
118
+ }
119
+ },
120
+ previewAttachment(attachment) {
121
+ // 根据附件类型处理预览
122
+ alert('预览附件:' + attachment.fileName)
123
+ },
124
+ downloadAttachment(attachment) {
125
+ this.$downFileR(attachment.f_downloadpath,attachment.f_filename,true)
126
+ },
127
+ close() {
128
+ this.show = false
129
+ this.$emit('close')
130
+ },
131
+ isImageFile(file) {
132
+ const imageExtensions = ['jpg', 'jpeg', 'png', 'gif', 'bmp'];
133
+ const fileExt = file.f_filetype.toLowerCase();
134
+ return imageExtensions.indexOf(fileExt) !== -1;
135
+ },
136
+ getFileIconClass(file) {
137
+ const fileType = file.f_filetype.toLowerCase();
138
+
139
+ if (fileType === 'pdf') {
140
+ return 'glyphicon-file text-danger';
141
+ } else if (['doc', 'docx'].indexOf(fileType) !== -1) {
142
+ return 'glyphicon-file text-primary';
143
+ } else if (['xls', 'xlsx'].indexOf(fileType) !== -1) {
144
+ return 'glyphicon-file text-success';
145
+ } else {
146
+ return 'glyphicon-file';
147
+ }
148
+ }
149
+ }
150
+ }
151
+ </script>
152
+
153
+ <style scoped>
154
+ .loading-container, .error-container, .no-data-container {
155
+ text-align: center;
156
+ padding: 30px;
157
+ }
158
+
159
+ .loading-spinner {
160
+ display: inline-block;
161
+ width: 40px;
162
+ height: 40px;
163
+ border: 4px solid #f3f3f3;
164
+ border-top: 4px solid #3498db;
165
+ border-radius: 50%;
166
+ animation: spin 1s linear infinite;
167
+ margin-bottom: 10px;
168
+ }
169
+
170
+ @keyframes spin {
171
+ 0% { transform: rotate(0deg); }
172
+ 100% { transform: rotate(360deg); }
173
+ }
174
+
175
+ .attachments-list {
176
+ width: 100%;
177
+ }
178
+
179
+ .showData {
180
+ height: auto;
181
+ position: relative;
182
+ padding-bottom: 7px;
183
+ border-bottom: solid 1px #c1c1c1;
184
+ font-family: "微软雅黑";
185
+ }
186
+
187
+ .showData .left {
188
+ height: 180px;
189
+ width: 210px;
190
+ background-color: rgb(240, 240, 240);
191
+ overflow: hidden;
192
+ line-height: 180px;
193
+ text-align: center;
194
+ }
195
+
196
+ .showData .left img {
197
+ width: 100%;
198
+ height: auto;
199
+ }
200
+
201
+ .showData .right {
202
+ position: absolute;
203
+ top: 0px;
204
+ left: 220px;
205
+ right: 0px;
206
+ height: 180px;
207
+ }
208
+
209
+ .showData .right .top {
210
+ height: 30px;
211
+ line-height: 30px;
212
+ color: rgb(98, 98, 98);
213
+ }
214
+
215
+ .showData .right ul {
216
+ height: 20px;
217
+ padding: 0px;
218
+ margin: 0px;
219
+ font-size: 0px;
220
+ }
221
+
222
+ .showData .right ul li {
223
+ display: inline-block;
224
+ height: 20px;
225
+ list-style: none;
226
+ font-size: 16px;
227
+ line-height: 20px;
228
+ color: #FFFFFF;
229
+ background-color: #5bb85d;
230
+ padding: 0px 7px;
231
+ margin-right: 10px;
232
+ cursor: pointer;
233
+ }
234
+
235
+ .showData .right ul li:hover {
236
+ background-color: rgb(80, 150, 80);
237
+ }
238
+
239
+ .showData .right ul li:active {
240
+ background-color: rgb(150, 200, 150);
241
+ }
242
+
243
+ .showData .right ul li a {
244
+ width: 100%;
245
+ height: 100%;
246
+ text-decoration: none;
247
+ color: #FFFFFF;
248
+ }
249
+
250
+ .file-icon {
251
+ font-size: 60px;
252
+ color: #999;
253
+ }
252
254
  </style>
@@ -1,50 +1,50 @@
1
- <template>
2
- <div id="unit" class="flex-row" >
3
- <div class="basic-main" :style="{width:width}">
4
- <day-report-list @getdata="getdata" @close="close" @show="show" :style="style" v-ref:list ></day-report-list>
5
- </div>
6
- <div class="binary-right" v-if="summaryshow">
7
- <ul class="nav nav-tabs">
8
- <li class="active"><a href="#">数据汇总</a></li>
9
- </ul>
10
- <day-report-summary :sumsmodel="sumsmodel" v-ref:gas></day-report-summary>
11
- </div>
12
- </div>
13
- </template>
14
-
15
- <script>
16
-
17
- export default {
18
- title:'日清单',
19
- name: "DayReport",
20
- data () {
21
- return {
22
- width:'100%',
23
- summaryshow:false,
24
- style:'col-sm-2'
25
- }
26
- },
27
- ready(){
28
- },
29
- methods:{
30
- getdata(val){
31
- console.log(val)
32
- this.sumsmodel = val
33
- },
34
- show(){
35
- this.width = '58%'
36
- this.summaryshow = true
37
- this.style='col-sm-3'
38
- },
39
- close(){
40
- this.width = '100%'
41
- this.summaryshow = false
42
- this.style='col-sm-2'
43
- }
44
- }
45
- }
46
- </script>
47
-
48
- <style>
49
- </style>
50
-
1
+ <template>
2
+ <div id="unit" class="flex-row" >
3
+ <div class="basic-main" :style="{width:width}">
4
+ <day-report-list @getdata="getdata" @close="close" @show="show" :style="style" v-ref:list ></day-report-list>
5
+ </div>
6
+ <div class="binary-right" v-if="summaryshow">
7
+ <ul class="nav nav-tabs">
8
+ <li class="active"><a href="#">数据汇总</a></li>
9
+ </ul>
10
+ <day-report-summary :sumsmodel="sumsmodel" v-ref:gas></day-report-summary>
11
+ </div>
12
+ </div>
13
+ </template>
14
+
15
+ <script>
16
+
17
+ export default {
18
+ title:'日清单',
19
+ name: "DayReport",
20
+ data () {
21
+ return {
22
+ width:'100%',
23
+ summaryshow:false,
24
+ style:'col-sm-2'
25
+ }
26
+ },
27
+ ready(){
28
+ },
29
+ methods:{
30
+ getdata(val){
31
+ console.log(val)
32
+ this.sumsmodel = val
33
+ },
34
+ show(){
35
+ this.width = '58%'
36
+ this.summaryshow = true
37
+ this.style='col-sm-3'
38
+ },
39
+ close(){
40
+ this.width = '100%'
41
+ this.summaryshow = false
42
+ this.style='col-sm-2'
43
+ }
44
+ }
45
+ }
46
+ </script>
47
+
48
+ <style>
49
+ </style>
50
+