@xilonglab/vue-main 1.1.21 → 1.2.1

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": "@xilonglab/vue-main",
3
- "version": "1.1.21",
3
+ "version": "1.2.1",
4
4
  "description": "xilong vue main",
5
5
  "main": "packages/index.js",
6
6
  "scripts": {
@@ -9,9 +9,9 @@
9
9
  "author": "xilonglab",
10
10
  "license": "ISC",
11
11
  "dependencies": {
12
+ "@imengyu/vue3-context-menu": "^1.3.3",
12
13
  "element-plus": "2.3.6",
13
14
  "image-conversion": "^2.1.1",
14
- "@imengyu/vue3-context-menu": "^1.3.3",
15
15
  "vue-router": "^4.2.2"
16
16
  }
17
17
  }
@@ -102,16 +102,7 @@ const { refs, api, params, obj, chartOptions, total } = inject('injections')
102
102
  <div :class="['xl-data-view', english]">
103
103
  <xl-tool-bar :type="type" :table="refs.table" :params="params" @query="() => api.stat()">
104
104
  <template #inputs>
105
- <template v-for="col in columns" :key="col.prop">
106
- <template v-if="col.search">
107
- <component
108
- :is="`xl-${col.search.type || 'input'}`"
109
- :placeholder="col.label"
110
- v-model="params[col.prop]"
111
- v-bind="col.search || {}"
112
- />
113
- </template>
114
- </template>
105
+ <xl-search-inputs :columns="columns" :params="params"/>
115
106
  <slot name="inputs" />
116
107
  </template>
117
108
  <template #buttons>
@@ -121,51 +112,7 @@ const { refs, api, params, obj, chartOptions, total } = inject('injections')
121
112
  </xl-tool-bar>
122
113
  <xl-query-page-table v-show="params.view != 'chart'" :ref="refs.table" :api="api" :params="params"
123
114
  v-bind="$props" :summary-method="summaryMethod?summaryMethod:()=>({0:total})" :sort-change="(data) => api.sort(data)">
124
- <template v-for="col in columns" :key="col.prop">
125
- <template v-if="!col.hidden">
126
- <xl-datetime-col
127
- v-if="col.type === 'datetime'"
128
- :l="col.label"
129
- :p="col.prop"
130
- />
131
- <xl-map-col
132
- v-else-if="col.type === 'map'"
133
- :l="col.label"
134
- :p="col.prop"
135
- :width="col.width"
136
- :map="col.map"
137
- />
138
- <xl-status-col
139
- v-else-if="col.type === 'status'"
140
- :l="col.label"
141
- :p="col.prop"
142
- :map="col.map"
143
- />
144
- <xl-review-col
145
- v-else-if="col.type === 'review'"
146
- :l="col.label"
147
- :p="col.prop"
148
- />
149
- <xl-clamp-col
150
- v-else-if="col.type === 'clamp'"
151
- :l="col.label"
152
- :p="col.prop"
153
- :width="col.width"
154
- />
155
- <xl-bool-col
156
- v-else-if="col.type === 'bool'"
157
- :l="col.label"
158
- :p="col.prop"
159
- :width="col.width"
160
- />
161
- <xl-col
162
- v-else
163
- :l="col.label"
164
- :p="col.prop"
165
- :width="col.width"
166
- />
167
- </template>
168
- </template>
115
+ <xl-table-columns :columns="columns"/>
169
116
  <slot name="columns" />
170
117
  </xl-query-page-table>
171
118
  <xl-chart v-show="params.view == 'chart'" :options="chartOptions" />
@@ -0,0 +1,29 @@
1
+ <script setup>
2
+ defineOptions({ name: "XlSearchInputs" })
3
+
4
+ const props = defineProps({
5
+ columns: {
6
+ type: Array,
7
+ default: () => [],
8
+ },
9
+ params: {
10
+ type: Object,
11
+ default: () => ({}),
12
+ },
13
+ });
14
+
15
+ defineSlots(['default'])
16
+ </script>
17
+
18
+ <template>
19
+ <template v-for="col in columns" :key="col.prop">
20
+ <template v-if="col.search">
21
+ <component
22
+ :is="`xl-${col.search.type || 'input'}`"
23
+ :placeholder="col.label"
24
+ v-model="params[col.prop]"
25
+ v-bind="col.search || {}"
26
+ />
27
+ </template>
28
+ </template>
29
+ </template>
@@ -0,0 +1,60 @@
1
+ <script setup>
2
+ defineOptions({ name: "XlTableColumns" })
3
+
4
+ const props = defineProps({
5
+ columns: {
6
+ type: Array,
7
+ default: () => [],
8
+ },
9
+ });
10
+
11
+ defineSlots(['default'])
12
+ </script>
13
+
14
+ <template>
15
+ <template v-for="col in columns" :key="col.prop">
16
+ <template v-if="!col.hidden">
17
+ <xl-datetime-col
18
+ v-if="col.type === 'datetime'"
19
+ :l="col.label"
20
+ :p="col.prop"
21
+ />
22
+ <xl-map-col
23
+ v-else-if="col.type === 'map'"
24
+ :l="col.label"
25
+ :p="col.prop"
26
+ :width="col.width"
27
+ :map="col.map"
28
+ />
29
+ <xl-status-col
30
+ v-else-if="col.type === 'status'"
31
+ :l="col.label"
32
+ :p="col.prop"
33
+ :map="col.map"
34
+ />
35
+ <xl-review-col
36
+ v-else-if="col.type === 'review'"
37
+ :l="col.label"
38
+ :p="col.prop"
39
+ />
40
+ <xl-clamp-col
41
+ v-else-if="col.type === 'clamp'"
42
+ :l="col.label"
43
+ :p="col.prop"
44
+ :width="col.width"
45
+ />
46
+ <xl-bool-col
47
+ v-else-if="col.type === 'bool'"
48
+ :l="col.label"
49
+ :p="col.prop"
50
+ :width="col.width"
51
+ />
52
+ <xl-col
53
+ v-else
54
+ :l="col.label"
55
+ :p="col.prop"
56
+ :width="col.width"
57
+ />
58
+ </template>
59
+ </template>
60
+ </template>