centaline-data-driven-v3 0.1.30 → 0.1.32

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.30",
3
+ "version": "0.1.32",
4
4
  "private": false,
5
5
  "description": "centaline-data-driven-v3",
6
6
  "main": "dist/centaline-data-driven-v3.umd.js",
@@ -51,6 +51,10 @@ const props = defineProps({
51
51
  Number,
52
52
  default: 500,
53
53
  },
54
+ apiParam: {
55
+ type: Object,
56
+ default: () => { },
57
+ }
54
58
  })
55
59
  const refTree = ref()
56
60
  const rootNode = ref();
@@ -64,7 +68,7 @@ const defaultProps = ref({
64
68
  id: 'code',
65
69
  })
66
70
  const searchStatus = ref([])
67
-
71
+ const screenPara = ref(props.apiParam);
68
72
  const menuVisible = ref(false)//右键菜单显示控制
69
73
  const currentData = ref({ code: "" })// 当前节点所对应的数据
70
74
  const currentNode = ref(null)//当前节点对应的 Node
@@ -91,33 +95,34 @@ onBeforeUnmount(() => {
91
95
 
92
96
  //搜索(查询条件调用)
93
97
  function search(m) {
98
+ screenPara.value = m;
94
99
  if (searchStatus.value.length == 0) {
95
100
  // 重置计数器
96
101
  retryCount.value = 0
97
102
  if (qrtimer.value) clearTimeout(qrtimer.value);
98
103
  searchStatus.value.push('a');
99
104
  rootNode.value.childNodes = []
100
- loadNode(rootNode.value, rootResolve.value, m)
105
+ loadNode(rootNode.value, rootResolve.value)
101
106
  }
102
107
  else {
103
108
  if (retryCount.value >= 50) {
104
- console.warn(`搜索繁忙,请稍后再试`);
109
+ console.warn(`搜索繁忙,请稍后再试`);
105
110
  return;
106
111
  }
107
112
  retryCount.value++
108
113
 
109
114
  qrtimer.value = setTimeout(() => {
110
- search(m);
115
+ search();
111
116
  }, 200);
112
117
  }
113
118
  }
114
119
  //加载节点(点击节点加号时调用)
115
- function loadNode(node, resolve, m) {
120
+ function loadNode(node, resolve) {
116
121
  if (node.level === 0) {
117
122
  loading.value = true;
118
123
  rootNode.value = node
119
124
  rootResolve.value = resolve;
120
- return SearchTree(m || undefined).then(data => {
125
+ return SearchTree(screenPara.value || undefined).then(data => {
121
126
  loading.value = false;
122
127
  resolve(data.rows);
123
128
  load(data, true)
@@ -126,7 +131,15 @@ function loadNode(node, resolve, m) {
126
131
  if (node.level >= 1) {
127
132
  let fields = model.value.searchData("code", node.data.code, 9, 3);
128
133
  let filter = {
129
- "searchData": fields
134
+ "searchData": {
135
+ // 先保留searchData的其他属性
136
+ ...(screenPara.value?.searchData || {}),
137
+ // 再合并fields数组(将两个数组合并,而不是覆盖)
138
+ fields: [
139
+ ...fields.fields,
140
+ ...(screenPara.value?.searchData?.fields || [])
141
+ ]
142
+ }
130
143
  };
131
144
  return SearchTree(filter).then(data => {
132
145
  loading.value = false;
@@ -204,7 +217,9 @@ function rightClick(event, object, Node) { // event、object该节点所对应
204
217
  }
205
218
  })
206
219
  }
207
- document.addEventListener('click', closeMenu) // 监听事件鼠标点击事件,若点击则隐藏菜单
220
+ if (menuVisible.value) {
221
+ document.addEventListener('click', closeMenu) // 监听事件鼠标点击事件,若点击则隐藏菜单
222
+ }
208
223
  }
209
224
  //关闭菜单
210
225
  function closeMenu() {
@@ -1,10 +1,11 @@
1
1
  <template>
2
2
  <div>
3
3
  <div ref="refscreenDiv" id="refscreenDiv">
4
- <ct-searchscreen ref="reftreescreen" :from="'tree'" style="padding-left: 11px;" :api="searchConditionApi" :screenPara="screenPara"
5
- @search="search" @loaded="screenload" ></ct-searchscreen>
4
+ <ct-searchscreen ref="reftreescreen" :from="'tree'" style="padding-left: 11px;" :api="searchConditionApi"
5
+ :screenPara="apiParam" @search="search" @loaded="screenload"></ct-searchscreen>
6
6
  </div>
7
- <tree v-if="loadTree" ref="reftree" :api="searchDataApi" @loaded="loaded" :treeHeight="treeHeight">
7
+ <tree v-if="loadTree" ref="reftree" :api="searchDataApi" @loaded="loaded" :treeHeight="treeHeight"
8
+ :apiParam="{ searchData:searchData }">
8
9
  </tree>
9
10
 
10
11
 
@@ -14,7 +15,7 @@
14
15
  import { ref, nextTick, watch, onMounted, onBeforeUnmount } from 'vue'
15
16
  import Tree from './Tree/Tree.vue';
16
17
  const emit = defineEmits(['loaded'])
17
- const loadTree=ref(false)
18
+ const loadTree = ref(false)
18
19
 
19
20
  const props = defineProps({
20
21
  searchConditionApi: String,
@@ -24,7 +25,7 @@ const props = defineProps({
24
25
  type: Number,
25
26
  default: 800,
26
27
  },
27
- screenPara: {
28
+ apiParam: {
28
29
  type: Object,
29
30
  default: () => { },
30
31
  }
@@ -33,19 +34,19 @@ const refscreenDiv = ref()
33
34
  const reftreescreen = ref()
34
35
  const reftree = ref()
35
36
  const treeHeight = ref(0)
36
-
37
- const qrtimer=ref(null)
38
- onBeforeUnmount(()=>{
39
- if (qrtimer.value) {
40
- clearTimeout(qrtimer.value);
41
- qrtimer.value = null;
42
- }
37
+ const searchData = ref([])
38
+ const qrtimer = ref(null)
39
+ onBeforeUnmount(() => {
40
+ if (qrtimer.value) {
41
+ clearTimeout(qrtimer.value);
42
+ qrtimer.value = null;
43
+ }
43
44
  })
44
45
 
45
46
  function setTreeHeight() {
46
47
  nextTick(() => {
47
48
  if (refscreenDiv.value) {
48
- qrtimer.value = setTimeout(() => {
49
+ qrtimer.value = setTimeout(() => {
49
50
  let searchHeight = refscreenDiv.value.offsetHeight;
50
51
  treeHeight.value = props.searchtreeHeight - searchHeight;
51
52
  }, 200);
@@ -56,6 +57,7 @@ function setTreeHeight() {
56
57
 
57
58
  function search() {
58
59
  setTreeHeight();
60
+ searchData.value = reftreescreen.value?.model?.searchData;
59
61
  reftree.value.search(reftreescreen.value.model);
60
62
  }
61
63
  function loaded(data) {
@@ -64,15 +66,18 @@ function loaded(data) {
64
66
  } catch (e) { }
65
67
  }
66
68
  function screenload(data) {
67
- loadTree.value=true
68
- setTreeHeight();
69
+ nextTick(() => {
70
+ searchData.value = reftreescreen.value?.model?.searchData;
71
+ loadTree.value = true
72
+ setTreeHeight();
73
+ });
69
74
  }
70
75
  onMounted(() => {
71
76
 
72
77
  })
73
78
  watch(() => props.searchtreeHeight, () => {
74
79
  setTreeHeight();
75
- })
80
+ })
76
81
  // watch(() => reftreescreen.value?.model, // 监听子组件的someData属性
77
82
  // (newVal, oldVal) => {
78
83
  // if (newVal?.searchData != oldVal?.searchData) {
@@ -5,7 +5,9 @@
5
5
  style="background-color:white;border-radius: 6px;overflow-y:hidden">
6
6
  <div>
7
7
  <ct-tree :flagsearch="true" :searchConditionApi="searchConditionApi" ref="reftree"
8
- :searchDataApi="searchDataApi" :searchtreeHeight="searchtreeHeight" @loaded="loaded"></ct-tree>
8
+ :searchDataApi="searchDataApi" :searchtreeHeight="searchtreeHeight"
9
+ :apiParam="apiParam"
10
+ @loaded="loaded"></ct-tree>
9
11
  </div>
10
12
 
11
13
  </el-aside>
@@ -15,14 +17,14 @@
15
17
  <div style="height: 100%;">
16
18
  <div class="ct-form"
17
19
  :style="{ 'width': (width ? width + 'px' : 'auto'), 'height': (height ? height + 'px' : 'auto') }">
18
- <ct-form :api="formApi" :api-param="apiParam" :width="width" :height="height"></ct-form>
20
+ <ct-form :api="formApi" :api-param="apiParam1" :width="width" :height="height"></ct-form>
19
21
  </div>
20
22
  </div>
21
23
  </template>
22
24
  <template v-else>
23
25
  <div :style="{ 'height': searchtreeHeight + 'px' }">
24
26
  <ct-searchlist :searchConditionApi="searchTableConditionApi" :searchDataApi="searchTableDataApi"
25
- :api-param="apiParam" @refreshParent="refreshParentHandler"></ct-searchlist>
27
+ :api-param="apiParam1" @refreshParent="refreshParentHandler"></ct-searchlist>
26
28
  </div>
27
29
  </template>
28
30
 
@@ -58,7 +60,7 @@ const width = ref(0)
58
60
  const height = ref(0)
59
61
  const isShowMain = ref(false)
60
62
  const pageType = ref('list')
61
- const apiParam = ref()
63
+ const apiParam1 = ref()
62
64
  const searchtreeHeight = ref(0)
63
65
  const refleft = ref()
64
66
  const reftree = ref()
@@ -95,7 +97,7 @@ function loaded(data) {
95
97
  delete defaultPara.width;
96
98
  delete defaultPara.height;
97
99
 
98
- apiParam.value = defaultPara;
100
+ apiParam1.value = defaultPara;
99
101
  nextTick(() => {
100
102
  if (searchTableConditionApi.value || searchTableDataApi.value || formApi.value) {
101
103
  isShowMain.value = true;
package/src/main.js CHANGED
@@ -65,7 +65,7 @@ app.use(centaline, {
65
65
  //获取请求头
66
66
  getRequestHeaders: function () {
67
67
  return {
68
- authobject: '{token:"wufw-1988032150800367616",platform:"WEB"}',
68
+ authobject: '{token:"wufw-1988477363054436352",platform:"WEB"}',
69
69
  //oldToken: 'd92d4a3b-2274-42e8-96f0-100ffb579b6e',
70
70
  //authObject: '{token:"jiangzf-1958445358178844672",platform:"WEB"}',
71
71
  //authObject: '{EmpID:"Token_4e09499b-4b76-46df-9ce5-5498d48ed062",MachineCode:"ae184643-f8e2-453c-a752-ba82612b592f",SSO_Token:"SSOToken_4e09499b-4b76-46df-9ce5-5498d48ed062",Platform:"WEB"}',
@@ -363,10 +363,9 @@ export function RouterClickHandler(field, submitData, action, model, source, cal
363
363
  return;
364
364
  }
365
365
  }
366
- if (typeof field.onChanged !== 'undefined') {
367
- verified = common.excute.call(model.scripts, field.onChanged);
368
- }
369
-
366
+ // if (typeof field.onChanged !== 'undefined') {
367
+ // verified = common.excute.call(model.scripts, field.onChanged);
368
+ // }
370
369
  if (!submitData) {
371
370
  submitData = model.$vue.getFileData(field);
372
371
  }
@@ -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="'ReportOverTimeList/getLayoutOfSearch'"
4
- :searchDataApi="'ReportOverTimeList/getListOfSearchModel'"></ct-searchlist>
3
+ <ct-searchlist :apiParam="apiParam" :searchConditionApi="'RoleList/getLayoutOfSearch'"
4
+ :searchDataApi="'RoleList/getListOfSearchModel'"></ct-searchlist>
5
5
 
6
6
  <!-- <ct-searchlist :apiParam="apiParam" :searchConditionApi="'/EmployeeMaternityList/getLayoutOfSearch'"
7
7
  :searchDataApi="'/EmployeeMaternityList/getListOfSearchModel'"></ct-searchlist> -->