centaline-data-driven-v3 0.1.55 → 0.1.57

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "centaline-data-driven-v3",
3
- "version": "0.1.55",
3
+ "version": "0.1.57",
4
4
  "private": false,
5
5
  "description": "centaline-data-driven-v3",
6
6
  "main": "dist/centaline-data-driven-v3.umd.js",
@@ -70,6 +70,8 @@ import common from '../../utils/common'
70
70
  import File from '../../loader/src/File';
71
71
  import util from '../../utils/pub-use'
72
72
  import draggable from "vuedraggable";
73
+ import axios from 'axios'; // 如未引入,需安装 axios
74
+
73
75
  const emit = defineEmits(['loaded', "change", "click"])
74
76
  const props = defineProps({
75
77
  api: String,
@@ -137,13 +139,14 @@ function beforeUploadProcess(file) {
137
139
  }
138
140
  //文件上传时的钩子
139
141
  function uploadProcess(file) {
140
- if (file.length && file.length > 0) {
141
- file.forEach((v) => {
142
- SliceUpload(v);
143
- });
144
- } else {
145
- SliceUpload(file);
142
+ const files = Array.isArray(file) ? file : [file];
143
+ files.forEach((v) => {
144
+ if (model.value.controlType == 51) {
145
+ SliceUpload(v); // 分片上传(原有)
146
+ } else if (model.value.controlType == 25) {
147
+ normalUpload(v); // 普通上传(新增)
146
148
  }
149
+ });
147
150
  }
148
151
  //删除
149
152
  function handleRemove(file) {
@@ -242,6 +245,71 @@ function uploadpro(uploadOptions, res, xhr, flagError) {
242
245
  }
243
246
 
244
247
  }
248
+
249
+ async function normalUpload(options) {
250
+ const { file, onProgress, onSuccess, onError } = options;
251
+
252
+ // 生成唯一标识,与分片上传保持一致
253
+ const uid = File.uploadguid();
254
+ file.uid = uid;
255
+
256
+ // 先加入文件列表(进度环状态)
257
+ addfileItem(file);
258
+ const index = model.value.fileList.findIndex(v => v.uid === uid);
259
+
260
+ const formData = new FormData();
261
+ formData.append('file', file); // 字段名需与后台一致
262
+ const customHeaders = common.getDataDrivenOpts().handler.getRequestHeaders();
263
+
264
+ try {
265
+ const res = await axios.post(model.value.action, formData, {
266
+ headers: {
267
+ ...customHeaders, // 先合并自定义头
268
+ 'Content-Type': 'multipart/form-data', // 再保证 multipart 类型
269
+ },
270
+ onUploadProgress: (progressEvent) => {
271
+ const percent = Math.round(
272
+ (progressEvent.loaded * 100) / progressEvent.total
273
+ );
274
+ // 直接更新列表中的进度,进度环会自动响应
275
+ if (index !== -1) {
276
+ model.value.fileList[index].loadProgress = percent;
277
+ }
278
+ },
279
+ });
280
+
281
+ // 模拟原有 handleAvatarSuccess 的处理
282
+ if (res.data.rtnCode === 200) {
283
+ // 将后台返回的媒体信息整合
284
+ const media = res.data.content[0]; // 根据实际返回结构调整
285
+ media.mediaLabelID = file.mediaLabelID || model.value.mediaLabe?.mediaLabelID || '';
286
+ media.mediaLabelName = file.mediaLabelName || model.value.mediaLabe?.mediaLabelName || '';
287
+
288
+ // 写入原始数据源
289
+ model.value.fileSourceList.push(media);
290
+
291
+ // 构造最终文件对象(复用已有方法)
292
+ const data = File.getFileData(media);
293
+ data.progressFlag = false;
294
+ data.loadProgress = 100;
295
+ data.uid = uid;
296
+
297
+ // 替换列表项,结束进度状态
298
+ if (index !== -1) {
299
+ model.value.fileList[index] = data;
300
+ }
301
+
302
+ handleChange(); // 触发 change 事件
303
+ } else {
304
+ // 上传失败,移除进度项
305
+ if (index !== -1) model.value.fileList.splice(index, 1);
306
+ showToast(res.data.rtnMsg || '上传失败');
307
+ }
308
+ } catch (error) {
309
+ if (index !== -1) model.value.fileList.splice(index, 1);
310
+ showToast('网络错误');
311
+ }
312
+ }
245
313
  function addfileItem(file) {
246
314
  let awaitfile = {
247
315
  "url": "",
@@ -31,8 +31,8 @@
31
31
  </div>
32
32
  </template>
33
33
  <template v-else>
34
- <div v-if="model.title" class="list-title">
35
- <h5>{{ model.title }}</h5>
34
+ <div v-if="model.controlLabel" class="list-title">
35
+ <h5>{{ model.controlLabel }}</h5>
36
36
  </div>
37
37
  <div class="list-button">
38
38
  <component v-if="model.selectRouter !== null" :is="model.selectRouter.is" size="small"
@@ -48,7 +48,7 @@
48
48
  <thead ref="tableHead" class="right-no-fixation-th">
49
49
  <tr class="ct-tr" ref="headTr">
50
50
  <th class="ct-th th-edit"
51
- v-if="model.rows[0].edit || model.rows[0].delete || model.buttons.length > 0">
51
+ v-if="model.rows[0].edit || model.rows[0].delete || (model.buttons.length > 0 && model.buttonsShow.length > 0)">
52
52
  <span>操作</span>
53
53
  </th>
54
54
  <template v-for="(column, i) in model.rows[0].field" :key="i">
@@ -65,7 +65,7 @@
65
65
  <tr v-for="(row, rowindex) in model.tableData" :key="rowindex"
66
66
  :ref="'rows.' + rowindex" class="ct-tr">
67
67
  <template
68
- v-if="model.rows[0].edit || model.rows[0].delete || model.buttons.length > 0">
68
+ v-if="model.rows[0].edit || model.rows[0].delete || (model.buttons.length > 0 && model.buttonsShow.length > 0)">
69
69
  <td class="ct-td td-edit" align="center" valign="middle">
70
70
  <van-image v-if="row.edit || row.isSet"
71
71
  style="cursor: pointer;margin-right: 5px;" width="20" height="20"
@@ -87,8 +87,14 @@
87
87
  <template v-for="(column, i) in model.rows[0].field" :key="i">
88
88
  <td v-if="column.show" class="ct-td" :rowspan="column.rowspan"
89
89
  :colspan="column.colspan">
90
- <ct-span v-if="row[column.fieldName1]" :vmodel="row[column.fieldName1]"
91
- :rowData="row"></ct-span>
90
+ <span v-if="column.router" :class="'cell'" style="display: flex;">
91
+ <Tablecurrency :router="column.router"
92
+ :colValue="row[column.fieldName1].code1" :rowData="row"
93
+ @click="rolRouterClickHandler">
94
+ </Tablecurrency>
95
+ </span>
96
+ <ct-span v-else-if="row[column.fieldName1]"
97
+ :vmodel="row[column.fieldName1]" :rowData="row"></ct-span>
92
98
  </td>
93
99
  </template>
94
100
  </tr>
@@ -96,7 +102,7 @@
96
102
  <template v-else>
97
103
  <tr class="ct-tr" ref="headTr">
98
104
  <td class="ct-td" :colspan="colspansum" style="text-align: center;">
99
- <span> {{common.LocalizedString('暂无数据','暫無數據')}}</span>
105
+ <span> {{ common.LocalizedString('暂无数据', '暫無數據') }}</span>
100
106
  </td>
101
107
  </tr>
102
108
  </template>
@@ -135,6 +141,8 @@ import Enum from '../../utils/Enum'
135
141
  import common from '../../utils/common'
136
142
  import util from '../../utils/pub-use'
137
143
  import draggable from "vuedraggable";
144
+ import Tablecurrency from './SearchList/Tablecurrency.vue';
145
+
138
146
  const emit = defineEmits(['click', 'input', 'change', 'popupSearchList', 'tableButtonClick'])
139
147
  const props = defineProps({
140
148
  parameterAction: String,
@@ -167,7 +175,7 @@ function Init() {
167
175
  model.value.validExcute = () => {
168
176
  var rtn = fieldsValidExcute();
169
177
  if (!rtn) {
170
- model.value.displayValidMessage = common.LocalizedString('请填写','請填寫')+'[' + model.value.controlLabel + ']'
178
+ model.value.displayValidMessage = common.LocalizedString('请填写', '請填寫') + '[' + model.value.controlLabel + ']'
171
179
  }
172
180
  return fieldsValidExcute();
173
181
  }
@@ -230,7 +238,7 @@ function fieldsValidExcute() {
230
238
  if (model.value.form && model.value.form.fields) {
231
239
  const currentIndex = model.value.form.fields.findIndex(v => v.fieldName1 === model.value.fieldName1);
232
240
  if (currentIndex - 1 >= 0) {
233
- if (model.value.form.fields[currentIndex - 1].controlType == Enum.ControlType.Group){
241
+ if (model.value.form.fields[currentIndex - 1].controlType == Enum.ControlType.Group) {
234
242
  controlLabel = model.value.form.fields[currentIndex - 1].controlLabel;
235
243
  }
236
244
  }
@@ -284,11 +292,14 @@ function changeHandler(field, index) {
284
292
  model.value.currentEventField = field;
285
293
  emit('change', model.value);
286
294
  }
295
+ function rolRouterClickHandler(field, rowData, rowindex) {
296
+ buttonClick(rowData, field);
297
+ }
287
298
 
288
299
  function buttonClick(row, button) {
289
300
  var submitData = {};
290
301
  button.submitFormField.forEach((v) => {
291
- submitData[v] = row[common.initialsToUpperCase(v)].code1;
302
+ submitData[v] = common.getDataOfUpperLower(row, v).code1;
292
303
  });
293
304
  model.value.currentRowIndex = model.value.source.rows.findIndex(v => v.$sourceIndex === row.$sourceIndex);
294
305
 
@@ -0,0 +1,154 @@
1
+ <template>
2
+ <div :class="isOperationalColumn ? 'subdiv_allinline' : ''" v-if="isShowLabel"
3
+ @click="isOperationalColumn ? clickHandler($event) : null">
4
+ <div v-if="isShowVoice" style="line-height: 16px;padding-top: 3px;">
5
+ <video ref="video"
6
+ v-if="rowData[router.submitFormField] && (!router.rightField || rowData[router.rightField] == 1)"
7
+ :src="rowData[router.submitFormField]" controls="true" controlslist="nodownload"
8
+ @timeupdate="saveVoiceHistoryHandler" @ended="voiceEndedHandler" height="20" width="100%">您的浏览器不支持
9
+ video
10
+ 标签。
11
+ </video>
12
+ <span v-else-if="!rowData[router.submitFormField]"></span>
13
+ <span v-else>没有权限听录音</span>
14
+ </div>
15
+
16
+ <div v-else>
17
+ <a href="javascript:void(0);" class="ct-tablecurrencyItem" :class="labelColor"
18
+ @click="!isOperationalColumn ? clickHandler($event) : null" v-html="label">
19
+ </a>
20
+ </div>
21
+ </div>
22
+ </template>
23
+ <script setup lang="ts">
24
+ import { ref, computed } from 'vue'
25
+ import Enum from '../../../utils/Enum';
26
+ const emit = defineEmits(['click', 'mouseenter'])
27
+ const props = defineProps({
28
+ router: Object,
29
+ rowData: Object,
30
+ colValue: String,
31
+ rowindex: Number,
32
+ columnName: String,
33
+ columnGroupId: String,
34
+ isOperationalColumn: {
35
+ type: Boolean,
36
+ default: false
37
+ },
38
+ isShowImg: {
39
+ type: Boolean,
40
+ default: true
41
+ },
42
+ isShowVoice: {
43
+ type: Boolean,
44
+ default: false
45
+ },
46
+ eventTriggerType: {
47
+ type: Number,
48
+ default: 2
49
+ },
50
+ })
51
+
52
+ const visible = ref(false)
53
+ const listenSeconds = ref(-1)
54
+ const option = ref({
55
+ isHidden: true,//是否开启操作栏隐藏设置,默认开启
56
+ showNum: 3,//如果isHidden为true时,个数大于3就会隐藏,默认是3
57
+ appendId: '',//将浮动栏添加到对应id或者class节点中。或者.xxx。传空字符串是添加到body中。
58
+ trigger: 'manual',//触发方式,传值可查看Popper UI组件trigger属性
59
+ placement: 'left-start',//方向,传值可查看Popper UI组件placement属性
60
+ })
61
+ const tooltipModel = ref({});
62
+ const labelColor = ref('')
63
+ const video = ref()
64
+ const label = computed(() => {
65
+ return (typeof props.colValue === "undefined" || props.colValue === '') ? props.router.controlLabel : props.colValue
66
+ })
67
+ const isShowLabel = computed(() => {
68
+ let flag = false;
69
+ if (props.router.imgUrl) {
70
+ flag = true
71
+ }
72
+ else if (props.isOperationalColumn) {
73
+ if (label.value) {
74
+ flag = true
75
+ }
76
+ }
77
+ else {
78
+ if (props.colValue) {
79
+ flag = true
80
+ }
81
+ }
82
+ return flag;
83
+ })
84
+
85
+ isVisited()
86
+ function isVisited() {
87
+ var key = props.router.action + props.rowData.chanceID;
88
+ // if (typeof Cookies.get(key) !== "undefined") {
89
+ // props.labelColor = 'mazarine'
90
+ // }
91
+ }
92
+ function clickHandler(ev) {
93
+ if (props.router.isListenVoice) {
94
+ if (visible.value) {
95
+ video.value.pause();
96
+ }
97
+ visible.value = !visible.value;
98
+ emit('click', props.router, props.rowData, props.rowindex, visible.value, props.columnName,props.columnGroupId);
99
+ }
100
+ else {
101
+ emit('click', props.router, props.rowData, props.rowindex, null, props.columnName, props.columnGroupId);
102
+ }
103
+ labelColor.value = 'mazarine'
104
+
105
+ }
106
+
107
+
108
+ function saveVoiceHistoryHandler() {
109
+ if (props.router.action && (visible.value || props.isShowVoice)) {
110
+ var currentTime = parseInt(video.value.currentTime) + 1;
111
+ if (listenSeconds.value === currentTime) {
112
+ return;
113
+ }
114
+ listenSeconds.value = currentTime;
115
+ var submitData = {};
116
+ props.router.actionField.split(',').forEach((k) => {
117
+ submitData[k] = props.rowData[k];
118
+ });
119
+ submitData.listenSeconds = currentTime;
120
+ props.router.doAction(submitData, (data) => {
121
+
122
+ })
123
+ }
124
+ }
125
+ function voiceEndedHandler() {
126
+ listenSeconds.value = -1;
127
+ }
128
+ function onShow() {
129
+ emit('mouseenter', props.router, props.rowData, props.rowindex, null, props.columnName, props.columnGroupId,function (data) {
130
+ if (data.height) {
131
+ data.height = (parseInt(data.height.replace('px', '')) + 50) + 'px';
132
+ }
133
+ tooltipModel.value = data
134
+ });
135
+ }
136
+ // 自适应位置配置
137
+ const popperOptions = {
138
+ modifiers: [
139
+ {
140
+ name: 'preventOverflow', // 防止溢出视口
141
+ options: {
142
+ padding: 10 // 距离视口边缘的留白
143
+ }
144
+ },
145
+ {
146
+ name: 'flip', // 当空间不足时翻转位置
147
+ options: {
148
+ fallbackPlacements: ['left', 'top', 'bottom'], // 备选位置
149
+ padding: 5
150
+ }
151
+ }
152
+ ]
153
+ }
154
+ </script>
@@ -3,12 +3,12 @@ async function postFile(api, data, callback) {
3
3
  var xhr = window.XMLHttpRequest ? new XMLHttpRequest : new ActiveXObject("Microsoft.XMLHTTP");
4
4
  xhr.open('POST', api, !0)
5
5
 
6
- // let headers=common.getDataDrivenOpts().handler.getRequestHeaders(api);
7
- // if(headers){
8
- // for (const [key, value] of Object.entries(headers)) {
9
- // xhr.setRequestHeader(key,value)
10
- // }
11
- // }
6
+ let headers=common.getDataDrivenOpts().handler.getRequestHeaders(api);
7
+ if(headers){
8
+ for (const [key, value] of Object.entries(headers)) {
9
+ xhr.setRequestHeader(key,value)
10
+ }
11
+ }
12
12
 
13
13
  xhr.onreadystatechange = function () {
14
14
  if (xhr.readyState != 4 || xhr.status < 200) {
package/src/main.js CHANGED
@@ -21,16 +21,15 @@ for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
21
21
  }
22
22
 
23
23
  app.use(centaline, {
24
- //baseUrl: "http://10.88.22.13:7080/ibs-api/",
24
+ baseUrl: "http://10.88.22.69:7080/external/",
25
25
  //baseUrl:"http://10.88.22.66:7080/ibs-api/",
26
26
  //baseUrl: "https://kq-api.centaline.com.cn/onecard-api/",
27
27
  //baseUrl: "http://10.88.22.13:6060/onecard-api/",
28
- baseUrl: "http://10.88.22.13:6060/smartclass-api/",
29
28
  //baseUrl: "http://10.1.245.50:38735/max-uplink-api/",
30
29
  //baseUrl: "http://10.1.245.111:38028/",
31
30
 
32
31
  flagRouterSelf: true,
33
- flagApp: false,//是否app端
32
+ flagApp: true,//是否app端
34
33
  zindex: 999,
35
34
  showRequestSuccessMessage: true,
36
35
  showRequestErrorMessage: true,
@@ -67,7 +66,7 @@ app.use(centaline, {
67
66
  return {
68
67
 
69
68
  //AuthorizationCode:'Bearer eyJhbGciOiJIUzUxMiJ9.eyJ1c2VyaWQiOiIyNTEyMTUxNzQyMTg5QzI4MTgwRDkxRTk0MDhEOTA0QSIsImxvZ2luX3VzZXJfa2V5IjoiN2MzYzNjNjAtNWVjMy00MzdkLWExMDYtOWYxZTMwYjU0Mjg2In0.daG9mS98Gg8KmHSUjYHktMcO2Jk7SVtCcqm2sRB0I8Y2N0TuonIrVUDcHdNdDiuD3v6qO_f010tQWlBsAQ1dqg',
70
- authobject: '{token:"1-83322f82-1cd6-47bb-89db-7cad6d97eb5d"}',
69
+ authobject: '{token:"TY002-2058735234823970816",platform:"Android"}',
71
70
  //authobject: '{EmpID:"Token_946d56e1-7972-4382-9d10-4a72496aab39",MachineCode:"ae184643-f8e2-453c-a752-ba82612b592f",SSO_Token:"SSOToken_946d56e1-7972-4382-9d10-4a72496aab39",Platform:"WEB"}',
72
71
  //oldToken: 'd92d4a3b-2274-42e8-96f0-100ffb579b6e',
73
72
  //authObject: '{token:"jiangzf-1958445358178844672",platform:"WEB"}',
@@ -993,8 +993,10 @@ export function RouterClickHandler(field, submitData, action, model, source, cal
993
993
  cancelButtonText: '取消',
994
994
  type: 'warning'
995
995
  },model.appendToBody).then(() => {
996
+ model.$vue.operationLoading = true
996
997
  submitData.flagHaveAlert = '1';
997
998
  field.doAction(submitData, (res) => {
999
+ model.$vue.operationLoading = false
998
1000
  if (res.rtnCode === Enum.ReturnCode.Successful) {
999
1001
  if (!field.flagFreshCurrentRow && !field.flagAddRowAfterAction) {
1000
1002
  model.$vue.doAction(res, model);
@@ -1,10 +1,10 @@
1
1
  <template>
2
2
  <div id="form-app" class="data-driven" style="width:100%;height:100%;overflow:auto">
3
3
  <!-- <ct-form :source="formdata.content" :apiParam="apiParam"></ct-form> -->
4
- <ct-form :api="'/admin/SchoolTeachingPlanLibrary/readDetail'" :apiParam="apiParam" :topHeight="topHeight"></ct-form>
5
- <ct-dialog-list></ct-dialog-list>
4
+ <ct-form :api="'/Order/view-layout'" :apiParam="apiParam"></ct-form>
5
+ <ct-dialoglist></ct-dialoglist>
6
6
  </div>
7
7
  </template>
8
8
  <script lang="ts" setup>
9
- const apiParam={"teachingPlanId":"1982726202548482048","actionType":3}
9
+ const apiParam={"originalOrderId":"2014640778344816640","actionType":1}
10
10
  </script>
@@ -4,11 +4,11 @@
4
4
 
5
5
  :searchDataApi="'/ccesmanage/AppUseSummaryList/getList'"></ct-searchlist> -->
6
6
 
7
- <ct-searchlist :apiParam="apiParam" :searchConditionApi="'/propertyTenderList/getLayoutOfSearch'"
7
+ <!-- <ct-searchlist :apiParam="apiParam" :searchConditionApi="'/propertyPublishList/getLayoutOfSearch'"
8
8
 
9
- :searchDataApi="'/propertyTenderList/getListOfSearchModel'"></ct-searchlist>
10
- <!-- <ct-searchlist :apiParam="apiParam" :searchConditionApi="'/EmployeeMaternityList/getLayoutOfSearch'"
11
- :searchDataApi="'/EmployeeMaternityList/getListOfSearchModel'"></ct-searchlist> -->
9
+ :searchDataApi="'/propertyPublishList/getListOfSearchModel'" :searchStatsApi="'/propertyPublishList/getListStats'"></ct-searchlist> -->
10
+ <ct-searchlist :apiParam="apiParam" :searchConditionApi="'/PropertyComprehensiveQueryList/getLayoutOfSearch'"
11
+ :searchDataApi="'/PropertyComprehensiveQueryList/getListOfSearchModel'"></ct-searchlist>
12
12
 
13
13
 
14
14
  <ct-dialoglist ref="dialogList"></ct-dialoglist>