centaline-data-driven 1.2.99 → 1.3.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.
@@ -173,9 +173,9 @@ export default {
173
173
  },
174
174
  viewerfile(file) {
175
175
  var self = this;
176
- var MediaAlbum = [{ albumName: "媒体", medias: [] }];
176
+ var MediaAlbum = [{ albumName: this.model.label||"媒体", medias: [] }];
177
177
 
178
- let fileList = this.model.sourceList.filter((item) => {
178
+ let fileList = this.model.sourceList.filter((item) => {
179
179
  return item.flagDeleted !== true;
180
180
  });
181
181
  fileList.forEach((v) => {
@@ -185,7 +185,7 @@ export default {
185
185
  (v) => v.mediaID === file.source.mediaID
186
186
  );
187
187
  var dialogOption = {
188
- title: "预览媒体",
188
+ title: this.model.label||"预览媒体",
189
189
  pane: self.$common.getParentPane(self),
190
190
  content: [
191
191
  {
@@ -9,7 +9,7 @@
9
9
 
10
10
  <ct-searchscreen ref="screen" :api="searchConditionApi" :key="reloadKeyScreen"
11
11
  @loaded="screenLoaded" :screenPara="screenPara"
12
- :categoryLoaded="loaded.categoryLoaded" @search="search()"
12
+ :categoryLoaded="loaded.categoryLoaded" @search="search()" @saveShortcut="saveShortcut"
13
13
  @showTitle="showTitleScreenHandler"></ct-searchscreen>
14
14
 
15
15
  <ct-searchtable ref="table" :api="searchDataApi" :searchStatsApi="searchStatsApi" :from="from" @loaded="tableLoaded"
@@ -274,6 +274,9 @@
274
274
  this.rowClickHandle();
275
275
  this.$refs.table.refreshFromSimple(field,data);
276
276
  },
277
+ saveShortcut(){
278
+ this.$refs.table.getPage(1);
279
+ },
277
280
  }
278
281
  }
279
282
  </script>
@@ -8,9 +8,9 @@
8
8
  </template>
9
9
  <component v-for="(col, index) in model.btnScreen" :key="index" :is="col.is" :vmodel="col" :api="model.optionApi" @click="clickHandler(col)"></component>
10
10
  </div>
11
- <!-- <div class="ct-ptb5" v-if="model.shortcutForm">
11
+ <div class="shortcutFollow" style="padding-left: 20px;" v-if="model.shortcutForm">
12
12
  <ct-form :source="model.shortcutForm.code1" @submit="saveShortcut"></ct-form>
13
- </div> -->
13
+ </div>
14
14
  <el-popover class="SeachScreenPop max-seachpopper" placement="top" transition="el-zoom-in-top" v-model="highScreen" trigger="click" visible-arrow="false">
15
15
  <div style="width:100%">
16
16
  <template v-for="(col, index) in highScreenRow" v-if="col.show !== false">
@@ -166,8 +166,7 @@
166
166
  });
167
167
  },
168
168
  saveShortcut(){
169
- var self=this;
170
-
169
+ this.$emit('saveShortcut');
171
170
  },
172
171
  }
173
172
  }
@@ -107,6 +107,10 @@
107
107
  </el-popover>
108
108
  </div>
109
109
 
110
+ <ct-tablecurrency v-else-if="column.id==='voice'" :isShowVoice="true" :router="column.router" :colValue="column.router.label" :rowData="row" @click="rolRouterClickHandler"
111
+ :class="column.autoRowHeight ? 'lineFeedCell':'cell'">
112
+ </ct-tablecurrency>
113
+
110
114
  <!--可点击的列-->
111
115
  <ct-tablecurrency v-else-if="column.router" :align="column.attrs.align" :class="column.autoRowHeight ? 'lineFeedCell':'cell'" :router="column.router" :colValue="row[column.id]" :rowData="row"
112
116
  @click="rolRouterClickHandler">
@@ -760,6 +764,51 @@
760
764
  else if (field.isSeeVoice) {//看视频
761
765
  self.$common.browseVideo(field,submitData)
762
766
  }
767
+ else if (field.isUrlInLayer) {//URL页面(弹层)
768
+ var dialogOption = {
769
+ title: field.pageTitle,
770
+ pane: self.$common.getParentPane(self),
771
+ content: [{
772
+ attrs: {
773
+ apiParam: field.getActionPara(submitData).para,
774
+ src: 'http://10.88.22.50:3333/#/form',
775
+ width: field.dialogWidth + 'px',
776
+ height: field.dialogHeight + 'px'
777
+ },
778
+ on: {
779
+ submit(ev) {
780
+ if (!field.flagFreshCurrentRow && !field.flagAddRowAfterAction) {
781
+ self.model.doAction(ev);
782
+ }
783
+ self.$forceUpdate();
784
+ self.$refs.footer.$forceUpdate();
785
+ self.$common.closeDialog(dialogOption.dialog);
786
+ self.updateCurrentRow(field, ev);
787
+ },
788
+ new(ev) {
789
+
790
+ },
791
+ update() {
792
+
793
+ },
794
+ delete() {
795
+ var res={};
796
+ res.notification=self.model.Enum.ActionType.Delete;
797
+ res.content='';
798
+ self.model.doAction(res);
799
+ },
800
+ refreshParent() {
801
+ self.getPage(1);
802
+ self.$common.closeDialog(dialogOption.dialog);
803
+ },
804
+ closeDialog() {
805
+ self.$common.closeDialog(dialogOption.dialog);
806
+ }
807
+ }
808
+ }]
809
+ };
810
+ self.$common.openDialog(dialogOption);
811
+ }
763
812
  else {
764
813
  //self.operationLoading = true;
765
814
 
@@ -1,15 +1,30 @@
1
1
  <template>
2
- <div style="height: 100%" id="viewer-file">
2
+ <div style="height: 100%" id="viewer-file" ref="viewerfile">
3
3
  <el-container style="height: 100%; border: 1px solid #eee">
4
4
  <el-aside style="background-color: rgb(238, 241, 246)"
5
- ><div>
6
- <el-menu :default-openeds="openeds" :default-active="activeitem">
5
+ ><div style="height: 100%" class="viewerMenu">
6
+ <el-menu
7
+ :default-openeds="openeds"
8
+ :default-active="activeitem"
9
+ style="height: 100%"
10
+ >
7
11
  <el-submenu
8
12
  :key="groupIndex"
9
13
  :index="groupIndex.toString()"
10
14
  v-for="(group, groupIndex) in MediaAlbum"
11
15
  >
12
- <template slot="title"> <i></i>{{ group.albumName }} </template>
16
+ <template slot="title">
17
+ <i></i>
18
+ <div
19
+ style="
20
+ padding: 0 10px !important;
21
+ height: 30px;
22
+ line-height: 30px;
23
+ "
24
+ >
25
+ {{ group.albumName }}
26
+ </div>
27
+ </template>
13
28
  <el-menu-item-group>
14
29
  <el-menu-item
15
30
  @click="handleClick(item, groupIndex, index)"
@@ -23,7 +38,7 @@
23
38
  </el-menu>
24
39
  </div>
25
40
  </el-aside>
26
- <el-main>
41
+ <el-main ref="displayArea">
27
42
  <div
28
43
  style="position: relative; width: 100%; height: 100%"
29
44
  v-if="resultObject"
@@ -84,7 +99,10 @@
84
99
  <!--File-->
85
100
  <template v-else-if="itemFile.mediaTypeID == '6'">
86
101
  <template
87
- v-if="'doc,docx,xlsx'.search(FileExtension(itemFile)) > -1"
102
+ v-if="
103
+ 'doc,docx,xlsx'.search((itemFile.fileExtension).toLowerCase()) >
104
+ -1
105
+ "
88
106
  >
89
107
  <div
90
108
  class="viewerContent"
@@ -97,30 +115,40 @@
97
115
  >
98
116
  </div>
99
117
  </template>
100
- <template v-else-if="'pdf'.search(FileExtension(itemFile)) > -1">
101
- <div
102
- class="viewerContent"
103
- style="height: 100%; width: 800px; text-align: center"
104
- >
105
- <ct-viewerPDF :pdfUrl="resultObject"> </ct-viewerPDF>
106
- </div>
118
+ <template
119
+ v-else-if="
120
+ 'pdf'.search(itemFile.fileExtension.toLowerCase()) > -1
121
+ "
122
+ >
123
+
124
+ <ct-viewerPDF :pdfUrl="resultObject" :displayAreaHeight="displayAreaHeight" :displayAreaWidth="displayAreaWidth"> </ct-viewerPDF>
125
+
107
126
  </template>
108
127
  </template>
109
128
  <template v-else> 不支持此类型:{{ itemFile.mediaTypeID }} </template>
110
129
 
111
130
  <template v-if="resultObject != ''">
112
- <div class="magnify-footer">
113
- <div class="magnify-toolbar">
131
+ <div
132
+ class="magnify-footer"
133
+ :style="{
134
+ width: displayAreaWidth + 'px',
135
+ bottom: displayAreabtm + 10 + 'px',
136
+ }"
137
+ >
138
+ <div
139
+ class="magnify-toolbar"
140
+ :style="{ 'margin-left': displayArealeft + 'px' }"
141
+ >
114
142
  <a
115
143
  href="javascript:void(0)"
116
144
  class="magnify-btn el-icon-back"
117
- title="上一张"
145
+ title="上一个"
118
146
  @click="jump(-1)"
119
147
  ></a
120
148
  ><a
121
149
  href="javascript:void(0)"
122
150
  class="magnify-btn el-icon-right"
123
- title="下一张"
151
+ title="下一个"
124
152
  @click="jump(1)"
125
153
  ></a>
126
154
  <template v-if="itemFile.mediaTypeID == '2'">
@@ -198,6 +226,10 @@ export default {
198
226
  groupCountLen: 0,
199
227
  activeitem: "",
200
228
  openeds: [],
229
+ displayAreaWidth: 0,
230
+ displayAreabtm: 0,
231
+ displayArealeft: 0,
232
+ displayAreaHeight: 0,
201
233
  };
202
234
  },
203
235
  created() {
@@ -210,7 +242,19 @@ export default {
210
242
  });
211
243
  });
212
244
  },
213
- mounted() {
245
+
246
+ mounted() {
247
+ var self = this;
248
+ self.displayAreaWidth = this.DomWidth();
249
+ self.displayArealeft = self.DomLeft();
250
+ self.displayAreabtm = self.DomTop(self.$refs.displayArea.$el);
251
+ self.displayAreaHeight =self.$refs.displayArea.$el.offsetHeight;
252
+ window.onresize = () => {
253
+ self.displayAreaWidth = self.DomWidth();
254
+ self.displayArealeft = self.DomLeft();
255
+ self.displayAreabtm = self.DomTop(self.$refs.displayArea.$el);
256
+ self.displayAreaHeight =self.$refs.displayArea.$el.offsetHeight;
257
+ };
214
258
 
215
259
  if (
216
260
  this.groupIndex != undefined &&
@@ -218,15 +262,55 @@ export default {
218
262
  this.groupIndex > -1 &&
219
263
  this.index > -1
220
264
  ) {
221
- var item = this.MediaAlbum[this.groupIndex].medias[this.index];
265
+ var item = this.MediaAlbum[this.groupIndex].medias[this.index];
222
266
  this.handleClick(item, this.groupIndex, this.index);
223
267
  }
224
268
  },
225
269
  methods: {
270
+ DomWidth() {
271
+ let arrLength = window.innerWidth - this.$refs.viewerfile.offsetWidth;
272
+ arrLength = arrLength > 0 ? arrLength : 0;
273
+ var Width =
274
+ window.innerWidth -
275
+ arrLength -
276
+ this.$refs.displayArea.$el.offsetLeft -
277
+ 40;
278
+
279
+ return Width;
280
+ },
281
+ DomLeft() {
282
+ let arrLength = window.innerWidth - this.$refs.viewerfile.offsetWidth;
283
+ arrLength = arrLength > 0 ? arrLength : 0;
284
+ var Width =
285
+ window.innerWidth -
286
+ arrLength -
287
+ this.$refs.displayArea.$el.offsetLeft -
288
+ 40;
289
+
290
+ return Width / 2 - 524 + this.$refs.displayArea.$el.offsetLeft - 40;
291
+ },
292
+ DomTop() {
293
+ const height = window.innerHeight; //可视区窗口高度
294
+ const curDomHeight = this.$refs.viewerfile.offsetHeight;
295
+ // const curDomHeight = dom.getBoundingClientRect().height
296
+ const curDomY = this.$refs.viewerfile.getBoundingClientRect().y;
297
+ let curDomBottom = height - curDomHeight - curDomY;
298
+ curDomBottom = curDomBottom > 0 ? curDomBottom : 0;
299
+ return curDomBottom;
300
+ },
226
301
  FileExtension(item) {
227
302
  return item.savedFileName.replace(/.+\./, "").toLowerCase();
228
303
  },
304
+ offsetLeft(elements) {
305
+ var left = elements.offsetLeft;
306
+ var parent = elements.offsetParent;
307
+ while (parent != null) {
308
+ left += parent.offsetLeft;
309
+ parent = parent.offsetParent;
310
+ }
229
311
 
312
+ return left;
313
+ },
230
314
  handleClick(item, groupIndex, index) {
231
315
  if (index == this.activeIndex && groupIndex == this.activeGroup) return;
232
316
  this.activeIndex = index;
@@ -245,7 +329,7 @@ export default {
245
329
  var index = -1;
246
330
  if (n > 0) {
247
331
  if (
248
- this.activeGroup * 1 + this.activeIndex + 1 + n >=
332
+ this.activeGroup * 1 + this.activeIndex + 1 + n >
249
333
  this.groupCountLen
250
334
  ) {
251
335
  groupIndex = 0;
@@ -318,9 +402,9 @@ export default {
318
402
  },
319
403
  };
320
404
  // 禁止右键菜单
321
- document.oncontextmenu = function () {
322
- return false;
323
- };
405
+ // document.oncontextmenu = function () {
406
+ // return false;
407
+ // };
324
408
  </script>
325
409
 
326
410
  <style>
@@ -344,11 +428,10 @@ html {
344
428
  }
345
429
 
346
430
  .magnify-footer {
347
- width: calc(100vw - 340px);
348
431
  position: fixed;
349
432
  height: 50px;
350
- bottom: 20px;
351
- text-align: center;
433
+ bottom: 0px;
434
+ /* text-align: center; */
352
435
  color: #fff;
353
436
  z-index: 9;
354
437
  }
@@ -370,4 +453,18 @@ html {
370
453
  .magnify-btn-close:hover {
371
454
  color: #fff;
372
455
  }
456
+
457
+ .viewerMenu .el-submenu__title,
458
+ .viewerMenu .el-submenu .el-menu-item {
459
+ height: 30px;
460
+ line-height: 30px;
461
+ }
462
+ .viewerMenu .el-menu-item-group__title {
463
+ line-height: 1px;
464
+ height: 1px;
465
+ display: none;
466
+ }
467
+ .viewerMenu .el-submenu__title .el-submenu__icon-arrow {
468
+ display: inline-block;
469
+ }
373
470
  </style>
@@ -1,24 +1,23 @@
1
1
 
2
2
  <template>
3
3
  <div>
4
- <pdf
5
- v-for="i in numPages"
6
- :key="i"
7
- :src="fileUrl"
8
- :page="i"
9
- style="width: 100%"
4
+ <iframe
5
+ ref="previewPdf"
6
+ id="previewPdf"
7
+ :src="'/static/pdf/web/viewer.html?' + fileUrl"
8
+ :height="displayAreaHeight - 35 + 'px'"
9
+ :width="displayAreaWidth + 'px'"
10
+ @load="loadFrame()"
10
11
  >
11
- </pdf>
12
+ </iframe>
12
13
  </div>
13
14
  </template>
14
15
  <script>
15
- import pdf from "vue-pdf";
16
16
  export default {
17
- components: {
18
- pdf,
19
- },
20
17
  props: {
21
18
  pdfUrl: String,
19
+ displayAreaHeight: Number,
20
+ displayAreaWidth: Number,
22
21
  },
23
22
  data() {
24
23
  return {
@@ -29,18 +28,23 @@ export default {
29
28
  mounted() {
30
29
  this.init(this.pdfUrl);
31
30
  },
31
+ created() {
32
+ this.$nextTick(() => {
33
+ // 可以使用回调函数的写法
34
+ // 这个函数中DOM必定渲染完成
35
+ //this.loadFrame();
36
+ });
37
+ },
32
38
  methods: {
33
39
  init(pdfUrl) {
34
40
  var self = this;
35
- var loadingTask = pdf.createLoadingTask(pdfUrl);
36
- loadingTask
37
- .then((pdf) => {
38
- self.fileUrl = loadingTask;
39
- self.numPages = pdf.numPages;
40
- })
41
- .catch((err) => {
42
- console.error("pdf加载失败");
43
- });
41
+ self.fileUrl = 'r='+Math.random()+'&file='+encodeURIComponent(pdfUrl);
42
+ },
43
+ loadFrame() {
44
+ var doc = document.getElementById("previewPdf").contentWindow.document;
45
+ doc.getElementById("download").style.display = "none";
46
+ doc.getElementById("openFile").style.display = "none";
47
+ doc.getElementById("print").style.display = "none";
44
48
  },
45
49
  },
46
50
  watch: {
@@ -50,24 +54,4 @@ export default {
50
54
  },
51
55
  };
52
56
  </script>
53
-
54
- <style>
55
- .Imagebox {
56
- position: relative;
57
- width: 100%;
58
- height: 100%;
59
- overflow: hidden;
60
- }
61
-
62
- .scaleimg {
63
- max-height: 100%;
64
- max-width: 100%;
65
- cursor: move;
66
- position: absolute;
67
- top: 0;
68
- bottom: 0;
69
- left: 0;
70
- right: 0;
71
- margin: auto;
72
- }
73
- </style>
57
+
@@ -30,6 +30,11 @@ const Detail = function (source,para ,callBack) {
30
30
  _operationList:null,
31
31
  _operationRouters:[],
32
32
  _commissionList:null,
33
+ get mediaAlbums() {
34
+ return data.mediaAlbums||[];
35
+ }, get noMediaUrl() {
36
+ return data.noMediaUrl||"";
37
+ },
33
38
  get title() {
34
39
  return data.title;
35
40
  },
@@ -98,6 +98,9 @@ const Router = function (source) {
98
98
  get isSearchPageWithList() {
99
99
  return source.pageStyle === Enum.PageStyle.SearchPageWithList;
100
100
  },
101
+ get isUrlInLayer(){
102
+ return source.pageStyle === Enum.PageStyle.UrlInLayer;
103
+ },
101
104
  get isOpenUrlInBrowse() {
102
105
  return source.actionType === Enum.ActionType.OpenUrlInBrowse;
103
106
  },
@@ -6,7 +6,6 @@ import common from '../../../common';
6
6
  import Vue from 'vue';
7
7
  const SearchScreen = function (source, callBack, screenPara) {
8
8
  var init = function (source) {
9
- console.log(source.content)
10
9
  var rtn = {
11
10
  $vue: null,
12
11
  get source() {
@@ -544,7 +544,12 @@ const Enum = {
544
544
  /// <summary>
545
545
  /// 查询列表选择页(如:客户选择)
546
546
  /// </summary>
547
- SearchPageWithList: 7
547
+ SearchPageWithList: 7,
548
+
549
+ /// <summary>
550
+ /// URL页面(弹层)
551
+ /// </summary>
552
+ UrlInLayer: 8,
548
553
  },
549
554
 
550
555
  /// <summary>
@@ -1,12 +1,19 @@
1
1
  <template>
2
- <div :class="isOperationalColumn?'subdiv_allinline':''" v-if="isShowLabel" @click="isOperationalColumn?clickHandler($event):null">
3
- <div v-if="router.isListenVoice">
2
+ <div :class="isOperationalColumn?'subdiv_allinline':''" v-if="isShowLabel" @click="isOperationalColumn?clickHandler($event):null">
3
+ <div v-if="isShowVoice" style="line-height: 16px;padding-top: 3px;">
4
+ <video ref="video" :src="rowData[router.submitFormField]" controls="true" controlslist="nodownload"
5
+ @timeupdate="saveVoiceHistoryHandler" @ended="voiceEndedHandler"
6
+ height="20" width="100%">您的浏览器不支持 video 标签。
7
+ </video>
8
+ </div>
9
+ <div v-else-if="router.isListenVoice">
4
10
  <el-popover class="Stats-popover" :popper-class="'el-listenVoice'+rowindex" :placement="option.placement?option.placement:'left'"
5
11
  v-model="visible" :trigger="option.trigger?option.trigger:''" style="margin:0px;">
6
12
  <div class="alert fade in" role="alert" style="padding:0px;border-bottom:none;display: table-caption;">
7
13
  <button type="button" class="close el-icon-close" style="right:0px;float:right;margin-bottom: 5px;cursor: pointer;" data-dismiss="alert" aria-label="Close" @click="clickHandler">
8
14
  </button>
9
- <video ref="video" :src="rowData[router.submitFormField]" controls="true" autoplay controlslist="nodownload" @timeupdate="saveVoiceHistoryHandler"
15
+ <video ref="video" :src="rowData[router.submitFormField]" controls="true" controlslist="nodownload" @timeupdate="saveVoiceHistoryHandler"
16
+ @ended="voiceEndedHandler"
10
17
  :height="router.dialogHeight?router.dialogHeight:'40'" :width="router.dialogWidth?router.dialogWidth:'100%'">您的浏览器不支持 video 标签。
11
18
  </video>
12
19
  </div>
@@ -40,7 +47,11 @@
40
47
  isShowImg: {
41
48
  type: Boolean,
42
49
  default: true
43
- }
50
+ },
51
+ isShowVoice: {
52
+ type: Boolean,
53
+ default: false
54
+ },
44
55
  },
45
56
  computed: {
46
57
  label: function () {
@@ -56,6 +67,7 @@
56
67
  data() {
57
68
  return {
58
69
  visible:false,
70
+ listenSeconds:-1,
59
71
  option: {
60
72
  isHidden: true,//是否开启操作栏隐藏设置,默认开启
61
73
  showNum: 3,//如果isHidden为true时,个数大于3就会隐藏,默认是3
@@ -76,17 +88,25 @@
76
88
  },
77
89
  saveVoiceHistoryHandler() {
78
90
  var self=this;
79
- if(self.router.action && self.visible){
91
+ if(self.router.action && (self.visible || self.isShowVoice)){
92
+ var currentTime=parseInt(self.$refs.video.currentTime)+1;
93
+ if(this.listenSeconds===currentTime){
94
+ return;
95
+ }
96
+ this.listenSeconds=currentTime;
80
97
  var submitData = {};
81
98
  self.router.actionField.split(',').forEach((k) => {
82
99
  submitData[k] = self.rowData[k];
83
100
  });
84
- submitData.listenSeconds=self.$refs.video.currentTime;
101
+ submitData.listenSeconds=currentTime;
85
102
  self.router.doAction(submitData, (data) => {
86
103
 
87
104
  })
88
105
  }
89
- }
106
+ },
107
+ voiceEndedHandler() {
108
+ this.listenSeconds=-1;
109
+ },
90
110
  }
91
111
  }
92
112
  </script>
package/src/main.js CHANGED
@@ -47,7 +47,7 @@ Vue.use(centaline, {
47
47
  },
48
48
  // 请求完成事件,可判断是否登录过期执行响应操作
49
49
  requestComplete: function (response) {
50
- console.log(response);
50
+ // console.log(response);
51
51
  }
52
52
  }});
53
53