centaline-data-driven-v3 0.1.18 → 0.1.20

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.18",
3
+ "version": "0.1.20",
4
4
  "private": false,
5
5
  "description": "centaline-data-driven-v3",
6
6
  "main": "dist/centaline-data-driven-v3.umd.js",
@@ -1,5 +1,6 @@
1
1
  <template>
2
- <div class="ct-Layout" v-if="Layout !== null && !loading" @click="rowClickHandle" :style="{ 'background-color': selectIndex === rowindex?selectedRowBackColor:'' }">
2
+ <div class="ct-Layout" v-if="Layout !== null && !loading" @click="rowClickHandle"
3
+ :style="{ 'background-color': selectIndex === rowindex ? selectedRowBackColor : '' }">
3
4
  <ct-layoutchildren :rowindex="rowindex" :actionRouter="actionRouter" :rowdata="vmodel" :vmodel="LayoutList"
4
5
  :flagflex="true" :fields="fields" :parameterAction="parameterAction"
5
6
  :rowMenuDisplayCountForAPP="rowMenuDisplayCountForAPP" @click="clickHandler"
@@ -9,7 +10,7 @@
9
10
  <script setup lang="ts">
10
11
  import { ref, nextTick } from 'vue'
11
12
  import common from '../../utils/common'
12
- const emit = defineEmits(['rolRouterclick', 'changeHandler','rowclick'])
13
+ const emit = defineEmits(['rolRouterclick', 'changeHandler', 'rowclick'])
13
14
  const props = defineProps({
14
15
  action: String,
15
16
  cellLayout: String,
@@ -20,8 +21,8 @@ const props = defineProps({
20
21
  apiParam: Object,
21
22
  parameterAction: String,
22
23
  fields: Array,
23
- selectIndex:Number,
24
- selectedRowBackColor:String,
24
+ selectIndex: Number,
25
+ selectedRowBackColor: String,
25
26
  formListactionRouter: {
26
27
  type: Array,
27
28
  default: [],
@@ -61,16 +62,14 @@ function load(data, cellLayout) {
61
62
  return;
62
63
  }
63
64
  if (cellLayout.indexOf("for=") != -1) {
64
-
65
65
  var cellxmlDOM = loadXML(cellLayout);
66
- var listxml = getxmlForStr(cellxmlDOM);
67
-
68
- if (typeof listxml !== "undefined") {
69
- for (var j = 0; j < listxml.attributes.length; j++) {
70
- var attribute = listxml.attributes.item(j);
66
+ const nodesWithFor = cellxmlDOM.querySelectorAll('[for]');
67
+ nodesWithFor.forEach((v) => {
68
+ for (var j = 0; j < v.attributes.length; j++) {
69
+ var attribute = v.attributes.item(j);
71
70
  if (attribute.nodeName.toLowerCase() == "for".toLowerCase()) {
72
71
  var liststr = "";
73
- var celllist = xmlToString(listxml);
72
+ var celllist = xmlToString(v);
74
73
 
75
74
  var celllistNew = loadXML(celllist);
76
75
  var newAtt = celllistNew.createAttribute("forrowindex");
@@ -97,7 +96,7 @@ function load(data, cellLayout) {
97
96
  cellLayout = cellLayout.replace(celllist, liststr);
98
97
  }
99
98
  }
100
- }
99
+ });
101
100
  }
102
101
  if (typeof data !== "undefined") {
103
102
  str = cellLayout.replace(/\{\{(.+?)\}\}/g, (...args) => {
@@ -303,7 +302,7 @@ function clickHandler(routerKey, rowindex, forname, forrowindex, flagHaveAlert)
303
302
  emit("rolRouterclick", routerKey, rowindex, props.vmodel.$sourceIndex);
304
303
  }
305
304
  else {
306
- emit("rolRouterclick", routerKey, rowindex, forname, forrowindex, flagHaveAlert,props.vmodel,props.actionRouter);
305
+ emit("rolRouterclick", routerKey, rowindex, forname, forrowindex, flagHaveAlert, props.vmodel, props.actionRouter);
307
306
  }
308
307
  }
309
308
  }
@@ -315,7 +314,7 @@ function changeHandler(field) {
315
314
  emit("changeHandler", field, props.vmodel.$sourceIndex);
316
315
  }
317
316
  }
318
- function rowClickHandle(){
317
+ function rowClickHandle() {
319
318
  emit("rowclick", props.rowindex);
320
319
  }
321
320
  </script>
@@ -1,10 +1,10 @@
1
1
  <template>
2
2
  <ct-field :vmodel="model">
3
3
  <template #Control>
4
- <van-checkbox v-if="model.controlType == Enum.ControlType.CheckBox" :disabled="model.locked"
5
- v-model="model.value" shape="square" @change="change">{{ model.sufLabel1 }}</van-checkbox>
6
- <van-switch v-if="model.controlType == Enum.ControlType.Switch" :disabled="model.locked"
7
- v-model="model.value" @change="change">{{ model.sufLabel1 }}</van-switch>
4
+ <van-checkbox v-if="model.controlType == Enum.ControlType.CheckBox" :disabled="model.locked"
5
+ v-model="model.value" shape="square" @change="change">{{ model.sufLabel1 }}</van-checkbox>
6
+ <van-switch v-if="model.controlType == Enum.ControlType.Switch" :disabled="model.locked"
7
+ v-model="model.value" @change="change">{{ model.sufLabel1 }}</van-switch>
8
8
  </template>
9
9
  </ct-field>
10
10
  </template>
@@ -19,6 +19,9 @@ const props = defineProps({
19
19
  source: Object,
20
20
  })
21
21
  const model = initData(props, CheckBox)
22
+ if (!model.value.isList && model.value.code1 == '') {
23
+ model.value.code1 = '0';
24
+ }
22
25
  function change() {
23
26
  changeHandler(model.value, emit);
24
27
  if (model.value.autoSearch) emit('search');
@@ -112,7 +112,7 @@ import Button from '../../loader/src/Button';
112
112
  import Enum from '../../utils/Enum'
113
113
  import common from '../../utils/common'
114
114
  import { ElMessage, UploadFile } from 'element-plus'
115
- const emit = defineEmits(['input', 'fieldClick', 'importComplete', 'SearchWhereManage', 'SaveSearchWhere','clichSearchWhere'])
115
+ const emit = defineEmits(['input', 'fieldClick', 'importComplete', 'SearchWhereManage', 'SaveSearchWhere','clickSearchWhere'])
116
116
  const props = defineProps({
117
117
  parameterAction: String,
118
118
  fileData: Object,
@@ -276,7 +276,7 @@ function SaveSearchWhere(field) {
276
276
  }
277
277
  function clickDropdownItem(col) {
278
278
  refsearchwhere.value.handleClose();
279
- emit('clichSearchWhere', col);
279
+ emit('clickSearchWhere', col);
280
280
  }
281
281
  function generateUUID() {
282
282
  return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c =>
@@ -3,8 +3,8 @@
3
3
  <template #Control>
4
4
  <el-checkbox v-if="model.controlType == Enum.ControlType.CheckBox" v-model="model.value"
5
5
  :disabled="model.locked" :tabindex="model.code1" @change="change">{{ model.sufLabel1 }}</el-checkbox>
6
- <el-switch v-if="model.controlType == Enum.ControlType.Switch" v-model="model.value" :tabindex="model.code1" :disabled="model.locked"
7
- @change="change">
6
+ <el-switch v-if="model.controlType == Enum.ControlType.Switch" v-model="model.value" :tabindex="model.code1"
7
+ :disabled="model.locked" @change="change">
8
8
  {{ model.sufLabel1 }}
9
9
  </el-switch>
10
10
  </template>
@@ -21,6 +21,9 @@ const props = defineProps({
21
21
  source: Object,
22
22
  })
23
23
  const model = initData(props, CheckBox)
24
+ if (!model.value.isList && model.value.code1 == '') {
25
+ model.value.code1 = '0';
26
+ }
24
27
  function change() {
25
28
  changeHandler(model.value, emit);
26
29
  if (model.value.autoSearch) emit('search');
@@ -2,8 +2,8 @@
2
2
  <div :class="isOperationalColumn ? 'subdiv_allinline' : ''" v-if="isShowLabel"
3
3
  @click="isOperationalColumn ? clickHandler($event) : null">
4
4
  <template v-if="eventTriggerType == Enum.EventTriggerType.Hover">
5
- <el-popover @before-enter="onShow" :width="tooltipModel.width"
6
- :fallback-placements="['bottom', 'top', 'right', 'left']">
5
+ <el-popover @before-enter="onShow" :width="tooltipModel.width" placement="right"
6
+ :popper-options="popperOptions">
7
7
  <template #default>
8
8
  <div :style="'height: ' + tooltipModel.height + ''">
9
9
  <component v-bind="tooltipModel.attrs" :is="tooltipModel.component"></component>
@@ -174,9 +174,27 @@ function voiceEndedHandler() {
174
174
  function onShow() {
175
175
  emit('mouseenter', props.router, props.rowData, props.rowindex, null, props.columnName, function (data) {
176
176
  if (data.height) {
177
- data.height = (parseInt(data.height.replace('px', ''))+50)+'px';
177
+ data.height = (parseInt(data.height.replace('px', '')) + 50) + 'px';
178
178
  }
179
179
  tooltipModel.value = data
180
180
  });
181
181
  }
182
+ // 自适应位置配置
183
+ const popperOptions = {
184
+ modifiers: [
185
+ {
186
+ name: 'preventOverflow', // 防止溢出视口
187
+ options: {
188
+ padding: 10 // 距离视口边缘的留白
189
+ }
190
+ },
191
+ {
192
+ name: 'flip', // 当空间不足时翻转位置
193
+ options: {
194
+ fallbackPlacements: ['left', 'top', 'bottom'], // 备选位置
195
+ padding: 5
196
+ }
197
+ }
198
+ ]
199
+ }
182
200
  </script>
@@ -232,7 +232,12 @@ function SearchWhereManage(v) {
232
232
  let field = model.value.actionRouters.find((b) => {
233
233
  return b.key === v.routerKey;
234
234
  });
235
- RouterClickHandler(field, {}, null, model.value, 'form');
235
+ var submitData = {};
236
+ field.getSearchPara().fields.forEach((f) => {
237
+ submitData[common.initialsToLowerCase(f.fieldName1)] = f.searchValue1;
238
+ });
239
+ submitData["sourceFrom"] = "setting";
240
+ RouterClickHandler(field, submitData, null, model.value, 'form');
236
241
  }
237
242
  function saveShortcut() {
238
243
  emit('saveShortcut', model.value);
@@ -104,8 +104,6 @@ function loadFromModel(source, isFormList) {
104
104
  }
105
105
  if (rtn1.controlType === Enum.ControlType.SearchListBox
106
106
  || rtn1.controlType === Enum.ControlType.ComboBox
107
- || rtn1.controlType === Enum.ControlType.MultiSelectWithSearch
108
- || rtn1.controlType === Enum.ControlType.MultiSelectNoSearch
109
107
  ) {
110
108
  if (rtn1["options"].length == 0) {
111
109
  rtn1["options"] = [{ value: '', label: '' }];
@@ -124,6 +122,29 @@ function loadFromModel(source, isFormList) {
124
122
  this.form.$vue.loaded(this.form)
125
123
  }
126
124
  }
125
+ if (rtn1.controlType === Enum.ControlType.MultiSelectWithSearch
126
+ || rtn1.controlType === Enum.ControlType.MultiSelectNoSearch
127
+ ) {
128
+ var value = [];
129
+ var labelValue = [];
130
+ attrValue = attrValue === '' ? [] : [].concat(JSON.parse(attrValue))
131
+ rtn1["options"] = attrValue
132
+ if (attrKey == 'code1') {
133
+ attrValue.forEach((v) => {
134
+ if (v.flagDeleted !== 1) {
135
+ if (v.flagDeleted != undefined && v.flagDeleted == true) {
136
+ }
137
+ else {
138
+ value.push(v.code);
139
+ labelValue.push(v)
140
+ }
141
+ }
142
+ });
143
+ rtn1['value'] = value;
144
+ rtn1['labelValue'] = labelValue;
145
+ }
146
+ if (rtn1.itemKey) rtn1.itemKey = Math.random()
147
+ }
127
148
  if (rtn1.controlType === Enum.ControlType.File
128
149
  || rtn1.controlType === Enum.ControlType.SliceUpload) {
129
150
  if (attrKey.toLowerCase() == 'paramName1'.toLowerCase()) {
@@ -100,8 +100,6 @@ function loadSearchScreenModel(source, prevParam) {
100
100
  }
101
101
  if (rtn1.controlType === Enum.ControlType.SearchListBox
102
102
  || rtn1.controlType === Enum.ControlType.ComboBox
103
- || rtn1.controlType === Enum.ControlType.MultiSelectWithSearch
104
- || rtn1.controlType === Enum.ControlType.MultiSelectNoSearch
105
103
  ) {
106
104
  if (rtn1["options"].length == 0) {
107
105
  rtn1["options"] = [{ value: '', label: '' }];
@@ -115,6 +113,29 @@ function loadSearchScreenModel(source, prevParam) {
115
113
  }
116
114
  if (rtn1.itemKey) rtn1.itemKey = Math.random()
117
115
  }
116
+ if (rtn1.controlType === Enum.ControlType.MultiSelectWithSearch
117
+ || rtn1.controlType === Enum.ControlType.MultiSelectNoSearch
118
+ ) {
119
+ var value = [];
120
+ var labelValue = [];
121
+ attrValue = attrValue === '' ? [] : [].concat(JSON.parse(attrValue))
122
+ rtn1["options"] = attrValue
123
+ if (attrKey == 'code1') {
124
+ attrValue.forEach((v) => {
125
+ if (v.flagDeleted !== 1) {
126
+ if (v.flagDeleted != undefined && v.flagDeleted == true) {
127
+ }
128
+ else {
129
+ value.push(v.code);
130
+ labelValue.push(v)
131
+ }
132
+ }
133
+ });
134
+ rtn1['value'] = value;
135
+ rtn1['labelValue'] = labelValue;
136
+ }
137
+ if (rtn1.itemKey) rtn1.itemKey = Math.random()
138
+ }
118
139
  if (rtn1.is == 'ct-button') {
119
140
  if (common.flagApp() && this.form.$vue.loaded) {
120
141
  this.form.$vue.loaded(this.form)
@@ -431,6 +452,10 @@ function loadSearchScreenModel(source, prevParam) {
431
452
  set title(v) {
432
453
  source.title = v;
433
454
  },
455
+ //页面加载完后 执行的脚本
456
+ get onload() {
457
+ return source.onload;
458
+ },
434
459
  get flagSearch() {
435
460
  if (source.flagSearch === true) {
436
461
  return true
package/src/main.js CHANGED
@@ -21,7 +21,7 @@ for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
21
21
  }
22
22
 
23
23
  app.use(centaline, {
24
- baseUrl: "https://kq-api.centaline.com.cn/onecard-api",
24
+ baseUrl: "http://10.88.22.13:7070/onecard-api/",
25
25
  //baseUrl:"http://10.88.22.13:7070/onecard-api/",
26
26
  //baseUrl: "https://kq-api.centaline.com.cn/onecard-api/",
27
27
  //baseUrl: "http://10.88.22.13:6060/onecard-api/",
@@ -65,7 +65,7 @@ app.use(centaline, {
65
65
  //获取请求头
66
66
  getRequestHeaders: function () {
67
67
  return {
68
- authobject: '{token:"1647-1967489899997401088",platform:"WEB"}',
68
+ authobject: '{token:"jiangzf-1968847679618506752",platform:"WEB"}',
69
69
  //oldToken: 'd92d4a3b-2274-42e8-96f0-100ffb579b6e',
70
70
  //authObject: '{token:"jiangzf-1958445358178844672",platform:"WEB"}',
71
71
  //authObject: '{token:"1-90f7df2c-fba7-4ea0-8874-aa7202034f06"}',
@@ -878,7 +878,7 @@ const common = {
878
878
  var arr = str.split("&");
879
879
  for (var i = 0; i < arr.length; i++) {
880
880
  var res = arr[i].split("=");
881
- obj[res[0]] = res[1];
881
+ obj[this.initialsToLowerCase(res[0])] = res[1];
882
882
  }
883
883
  return obj;
884
884
  },
@@ -776,11 +776,12 @@ export function RouterClickHandler(field, submitData, action, model, source, cal
776
776
  model.$vue.init();
777
777
  }
778
778
  else {
779
- model.$vue.updateFields(ev);
779
+ if (model.$vue && model.$vue.updateFields) {
780
+ model.$vue.updateFields(ev);
781
+ }
780
782
  }
781
783
  }
782
784
  common.closeDialog(dialogOption);
783
-
784
785
  },
785
786
  isIframe: model.isIframe,
786
787
  },
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div id="app-search" style="width:100%;height:100%;position: fixed;">
3
- <ct-searchlist :apiParam="apiParam" :searchConditionApi="'/EmployeeAttendanceBillList/getLayoutOfSearchForMy'"
4
- :searchDataApi="'/EmployeeAttendanceBillList/getListOfSearchModelForMy'"></ct-searchlist>
3
+ <ct-searchlist :apiParam="apiParam" :searchConditionApi="'/ReportPersonAttendanceList/getLayoutOfSearch'"
4
+ :searchDataApi="'/ReportPersonAttendanceList/getListOfSearchModel'"></ct-searchlist>
5
5
 
6
6
  <!-- <ct-searchlist :apiParam="apiParam" :searchConditionApi="'/EmployeeMaternityList/getLayoutOfSearch'"
7
7
  :searchDataApi="'/EmployeeMaternityList/getListOfSearchModel'"></ct-searchlist> -->
@@ -15,6 +15,6 @@
15
15
 
16
16
  <script lang="ts" setup>
17
17
  import { ref, nextTick } from 'vue'
18
- const apiParam = {}
18
+ const apiParam = {"rowGUID":"{7AE0A3FB-2D6C-4E51-8B10-71EAFA2D269A}","code":"KD01","name":"中原(中国)物业顾问有限公司","deptID":"{7AE0A3FB-2D6C-4E51-8B10-71EAFA2D269A}","path":"KD01","checkBillLeftHours":"1","rightEdit":"1"}
19
19
 
20
20
  </script>