ocpview-plus 1.0.9 → 1.0.11

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": "ocpview-plus",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "title": "ocpviewPlus",
5
5
  "description": "A high quality Service UI components Library with Vue.js",
6
6
  "homepage": "",
@@ -351,6 +351,12 @@ export default {
351
351
  enabled: false,
352
352
  defaultValue: item.defaultValue || "",
353
353
  },
354
+ ...(item.isFilters && {
355
+ filters: [{ data: null }],
356
+ filterRender: {
357
+ name: "FilterInput",
358
+ },
359
+ }),
354
360
  ...(!item.readOnly &&
355
361
  !columnsItemType && {
356
362
  editRender: {
@@ -7,13 +7,14 @@
7
7
  style="background: #fff; padding: 14px 16px 14px 16px"
8
8
  >
9
9
  <div ref="toolbar" style="padding-bottom: 14px">
10
- <QueryBar
10
+ <BillListPanelQueryBar
11
+ ref="BillListPanelQueryBarVM"
11
12
  :config="myConfig.queryConfig"
12
13
  :dictData="dictData"
13
14
  :moduleMethod="moduleMethod"
14
15
  @conditionAction="conditionAction"
15
16
  @doAction="doAction"
16
- />
17
+ ></BillListPanelQueryBar>
17
18
  </div>
18
19
  <Card
19
20
  class="billquerygrid"
@@ -75,18 +76,31 @@
75
76
  <script>
76
77
  import billquerygrid from "../billquerygrid.vue";
77
78
  import BillListPanelTable from "./BillListPanelTable.vue";
79
+ import BillListPanelQueryBar from "./BillListPanelQueryBar.vue";
78
80
 
79
81
  export default {
80
82
  name: "BillListPanel",
81
83
  extends: billquerygrid,
82
- components: { BillListPanelTable },
84
+ components: { BillListPanelTable, BillListPanelQueryBar },
83
85
  data() {
84
86
  return {};
85
87
  },
86
88
  computed: {},
89
+ methods: {
90
+ clearSearchParams() {
91
+ this.$refs.BillListPanelQueryBarVM.clearSearchParams();
92
+ },
93
+ },
87
94
  mounted() {
88
95
  // console.log("我继承覆写了1111");
89
96
  },
97
+ created() {
98
+ if (this.myConfig.gridConfig.searchFormList) {
99
+ this.myConfig.queryConfig.searchFormList = this.$Method.copy(
100
+ this.myConfig.gridConfig.searchFormList
101
+ );
102
+ }
103
+ },
90
104
  };
91
105
  </script>
92
106
 
@@ -0,0 +1,274 @@
1
+ <template>
2
+ <div class="querybar">
3
+ <Row type="flex" :gutter="0">
4
+ <Col span="16">
5
+ <Row type="flex" :gutter="0">
6
+ <Col span="6" style="margin-right: 12px">
7
+ <ControlBox
8
+ ref="field"
9
+ :config="fieldConfig"
10
+ ></ControlBox>
11
+ </Col>
12
+ <Col span="6" style="margin-right: 20px">
13
+ <ControlBox
14
+ v-if="hackReset"
15
+ ref="editors"
16
+ :config="editorsConfig"
17
+ ></ControlBox>
18
+ </Col>
19
+ <Col style="margin-right: 10px">
20
+ <Button
21
+ customIcon="iconfont icon-custom-search"
22
+ type="primary"
23
+ @click="search"
24
+ >查询</Button
25
+ >
26
+ </Col>
27
+ <Col>
28
+ <Button
29
+ customIcon="iconfont icon-custom-reset"
30
+ @click="clear"
31
+ >重置</Button
32
+ >
33
+ </Col>
34
+ <Col>
35
+ <Divider type="vertical" class="dividercommon" />
36
+ </Col>
37
+ <Col>
38
+ <Dropdown
39
+ trigger="custom"
40
+ :visible="filterSceneFlag"
41
+ @on-click="filterAction"
42
+ placement="bottom-start"
43
+ @on-clickoutside="closeFilterScene"
44
+ >
45
+ <Badge class-name="badgeclass" :count="sceneNum">
46
+ <ButtonGroup>
47
+ <Button
48
+ customIcon="iconfont icon-custom-filter"
49
+ @click="updataFilterScene"
50
+ >高级查询</Button
51
+ >
52
+ <Button
53
+ v-if="!filterSceneFlag && sceneFlag"
54
+ icon="ios-arrow-down"
55
+ @click="openFilterScene"
56
+ >
57
+ </Button>
58
+ <Button
59
+ v-if="filterSceneFlag && sceneFlag"
60
+ icon="ios-arrow-up"
61
+ @click="closeFilterScene"
62
+ >
63
+ </Button>
64
+ </ButtonGroup>
65
+ </Badge>
66
+ <template #list>
67
+ <DropdownMenu>
68
+ <DropdownItem
69
+ v-for="(temp, index) in sceneData"
70
+ :selected="
71
+ temp.scenename == selectedScence
72
+ "
73
+ :name="temp.scenename"
74
+ :key="'scene_' + index"
75
+ >{{ temp.scenename }}</DropdownItem
76
+ >
77
+ </DropdownMenu>
78
+ </template>
79
+ </Dropdown>
80
+ </Col>
81
+ </Row>
82
+ </Col>
83
+ <Col span="8">
84
+ <Row type="flex" justify="end" :gutter="0">
85
+ <Col style="padding-right: 10px">
86
+ <Dropdown
87
+ trigger="custom"
88
+ :visible="btnFlag"
89
+ @on-click="action"
90
+ placement="bottom-start"
91
+ @on-clickoutside="closeBtn"
92
+ >
93
+ <ButtonGroup>
94
+ <Button
95
+ customIcon="iconfont icon-custom-add"
96
+ v-if="addDataBtnFlag"
97
+ @click="addData"
98
+ >新增</Button
99
+ >
100
+ <Button
101
+ v-if="!btnFlag && moreBtnFlag"
102
+ icon="ios-arrow-down"
103
+ @click="openBtn"
104
+ >
105
+ </Button>
106
+ <Button
107
+ v-if="btnFlag && moreBtnFlag"
108
+ icon="ios-arrow-up"
109
+ @click="closeBtn"
110
+ >
111
+ </Button>
112
+ </ButtonGroup>
113
+ <template #list>
114
+ <DropdownMenu>
115
+ <DropdownItem
116
+ v-for="(item, index) in btnData"
117
+ style="padding-left: 0px"
118
+ :key="'btn_' + index"
119
+ >
120
+ <Button
121
+ :icon="item.icon"
122
+ type="text"
123
+ :customIcon="item.customIcon"
124
+ @click="action(item.name)"
125
+ >{{ item.text }}</Button
126
+ >
127
+ </DropdownItem>
128
+ </DropdownMenu>
129
+ </template>
130
+ </Dropdown>
131
+ </Col>
132
+ <Col>
133
+ <PromptMessages style="height: 100%" />
134
+ </Col>
135
+ </Row>
136
+ </Col>
137
+ </Row>
138
+ <!-- 列表快捷查询 -->
139
+ <FormBox
140
+ v-if="searchFormListShowType"
141
+ style="padding-top: 16px"
142
+ ref="searchFormListVM"
143
+ :config="searchFormList"
144
+ :dictData="dictData"
145
+ />
146
+ <!-- 列表快捷查询 -->
147
+ <div v-show="filterFlag" style="margin-top: 20px">
148
+ <BillConditionsBox
149
+ ref="filter"
150
+ @doAction="doAction"
151
+ @conditionAction="conditionAction"
152
+ :config="config"
153
+ :dictData="dictData"
154
+ />
155
+ </div>
156
+ </div>
157
+ </template>
158
+ <script>
159
+ import querybar from "../querybar.vue";
160
+
161
+ export default {
162
+ name: "BillListPanelQueryBar",
163
+ extends: querybar,
164
+ data() {
165
+ return {
166
+ searchFormListShowType: false,
167
+ searchFormList: {},
168
+ searchFormItemHashMap: {},
169
+ };
170
+ },
171
+ methods: {
172
+ /**
173
+ * 快捷查询参数整理复写
174
+ */
175
+ customGetQuerySearchParam() {
176
+ let searchParam = {};
177
+ let obj = {};
178
+ let el = {};
179
+ el.field = this.$refs.field.getValue();
180
+ el.editors = this.$refs.editors.getValue();
181
+ el.calculator = "==";
182
+ if (el.field && el.editors) {
183
+ if (this.dataType[el.field].calculator) {
184
+ el.calculator = this.dataType[el.field].calculator;
185
+ }
186
+ obj = this.getConditionValue(
187
+ el.field,
188
+ el.editors,
189
+ el.calculator,
190
+ this.dataType[el.field]
191
+ );
192
+ }
193
+ searchParam = obj;
194
+ // ==============================================
195
+ if (this.$refs.searchFormListVM) {
196
+ const searchFormData = this.$refs.searchFormListVM.getData();
197
+ this.$utils.objectEach(searchFormData, (value, key) => {
198
+ const itemConfig = this.$utils.get(
199
+ this.searchFormItemHashMap,
200
+ key,
201
+ {}
202
+ );
203
+ const valueStr = this.$utils.toValueString(value);
204
+ if (
205
+ !this.$utils.isEmpty(itemConfig) &&
206
+ !this.$utils.isEmpty(valueStr)
207
+ ) {
208
+ const fieldKey = this.$utils.get(
209
+ itemConfig,
210
+ "field",
211
+ key
212
+ );
213
+ const calculator = this.$utils.get(
214
+ itemConfig,
215
+ "calculator",
216
+ "=="
217
+ );
218
+ const transformObj = this.getConditionValue(
219
+ fieldKey,
220
+ value,
221
+ calculator,
222
+ itemConfig
223
+ );
224
+ searchParam = { ...searchParam, ...transformObj };
225
+ }
226
+ });
227
+ }
228
+ // ==============================================
229
+ return searchParam;
230
+ },
231
+ /**
232
+ * 重置事件复写
233
+ */
234
+ clear() {
235
+ this.customClear();
236
+ let temp = {};
237
+ temp.name = "condition_clear";
238
+ this.$emit("conditionAction", temp);
239
+ // ==============================================
240
+ this.clearSearchParams();
241
+ // ==============================================
242
+ },
243
+ clearSearchParams() {
244
+ if (this.$refs.searchFormListVM) {
245
+ this.$refs.searchFormListVM.clearData();
246
+ }
247
+ },
248
+ },
249
+ computed: {},
250
+ mounted() {},
251
+ created() {
252
+ this.searchFormList = this.$utils.get(
253
+ this.config,
254
+ "searchFormList",
255
+ {}
256
+ );
257
+ const items = this.$utils.get(this.searchFormList, "items", []);
258
+ this.searchFormListShowType = items.length > 0;
259
+ this.searchFormItemHashMap = this.$utils.reduce(
260
+ items,
261
+ (previous, item) => {
262
+ previous[item.name] = {
263
+ ...item,
264
+ field: this.$utils.get(item, "field", item.name),
265
+ };
266
+ return previous;
267
+ },
268
+ {}
269
+ );
270
+ },
271
+ };
272
+ </script>
273
+
274
+ <style lang="less" scoped></style>
@@ -138,6 +138,10 @@ export default {
138
138
  let temp = {};
139
139
  let self = this;
140
140
  temp.onOk = () => {
141
+ // ==========================================
142
+ // 清空自定义列表查询条件
143
+ self.$refs.billqureygrid.clearSearchParams();
144
+ // ==========================================
141
145
  self.$refs.billqureygrid.refurbish();
142
146
  self.$nextTick(() => {
143
147
  self.showHead = false;
@@ -436,7 +436,6 @@
436
436
  if( JSON.stringify(lastParam) === '{}') {
437
437
  this.query.Config.lastQueryParam = newParam;
438
438
  }
439
-
440
439
  this.searchParam = { ...newParam };
441
440
  this.$refs['popView'].setSearchBeforeSearchParam(this.searchParam);
442
441
  }
@@ -604,6 +603,13 @@
604
603
  if (this.config.onOpenChange) {
605
604
  this.config.onOpenChange(newValue);
606
605
  }
606
+ if(!newValue) {
607
+ if(this.searchParam) {
608
+ if(!this.searchParam.notfatherclean) {
609
+ this.query.Config.lastQueryParam = {}
610
+ }
611
+ }
612
+ }
607
613
  },
608
614
  immediate: true
609
615
  }
package/src/index.js CHANGED
@@ -92,6 +92,7 @@ import MapBox from './components/map';
92
92
  import wRichTextBox from './components/wrichtextbox';
93
93
 
94
94
  import VXETable from "./plugins/vxeTable";
95
+ import XEUtils from "xe-utils";
95
96
 
96
97
  const components = {
97
98
  /*自定义组件*/
@@ -185,6 +186,7 @@ const install = function(app, opts = {}) {
185
186
  if (install.installed) return;
186
187
 
187
188
  VXETable.install(app)
189
+ app.config.globalProperties.$utils = XEUtils;
188
190
 
189
191
  iviewCoustom.initEview(ViewUI);
190
192
  app.use(ViewUI);
@@ -3,7 +3,7 @@ import "vxe-table/lib/style.css";
3
3
  import "../theme/theme-variable.css";
4
4
 
5
5
  // ========== 全局renderer引入位置 ==========
6
- // import './renderer/filter'
6
+ import "./renderer/filter";
7
7
  // import './renderer/edit'
8
8
  // import './renderer/cell'
9
9
  // ========== 全局renderer引入位置 ==========
@@ -0,0 +1,51 @@
1
+ <template>
2
+ <div class="filter-input">
3
+ <i-input
4
+ v-model="option.data"
5
+ @on-change="onChange"
6
+ @on-enter="onPressEnter"
7
+ clearable
8
+ placeholder="请输入搜索词"
9
+ ></i-input>
10
+ </div>
11
+ </template>
12
+
13
+ <script setup>
14
+ import { ref, onMounted, defineProps } from "vue";
15
+
16
+ /**
17
+ * props参数
18
+ *
19
+ * params 渲染器传递的scope参数
20
+ * option 更新数据模型
21
+ * onChange 更新选项触发事件
22
+ * onPressEnter 确认筛选触发事件
23
+ */
24
+ const props = defineProps({
25
+ params: {
26
+ params: Object,
27
+ default: function () {
28
+ return {};
29
+ },
30
+ },
31
+ });
32
+ const option = ref({ data: null });
33
+ onMounted(() => {
34
+ option.value = props.params.column.filters[0];
35
+ });
36
+ const onChange = () => {
37
+ const { $panel } = props.params;
38
+ const checked = !!option.value.data;
39
+ $panel.changeOption(null, checked, option.value);
40
+ };
41
+ const onPressEnter = () => {
42
+ const { $panel } = props.params;
43
+ $panel.confirmFilter();
44
+ };
45
+ </script>
46
+
47
+ <style lang="less" scoped>
48
+ .filter-input {
49
+ padding: 5px;
50
+ }
51
+ </style>
@@ -0,0 +1,32 @@
1
+ import VXETable from "vxe-table";
2
+ import { h } from "vue";
3
+ import TableFilterInput from "./components/TableFilterInput.vue";
4
+
5
+ // 创建一个简单的输入框筛选
6
+ VXETable.renderer.add("FilterInput", {
7
+ // 筛选模板
8
+ renderFilter(renderOpts, params) {
9
+ return h(TableFilterInput, { params });
10
+ },
11
+ // 重置数据方法
12
+ filterResetMethod(params) {
13
+ const { options } = params;
14
+ options.forEach((option) => {
15
+ option.data = "";
16
+ });
17
+ },
18
+ // 重置筛选复原方法(当未点击确认时,该选项将被恢复为默认值)
19
+ filterRecoverMethod({ option }) {
20
+ option.data = "";
21
+ },
22
+ // 筛选方法
23
+ filterMethod(params) {
24
+ const { option, row, column } = params;
25
+ const { data } = option;
26
+ const cellValue = row[column.field];
27
+ if (cellValue) {
28
+ return cellValue.indexOf(data) > -1;
29
+ }
30
+ return false;
31
+ },
32
+ });