free-fe-core-modules 0.0.54 → 0.1.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.
@@ -1,55 +1,21 @@
1
1
  <template>
2
2
  <div class="row free-field-file-list" v-if="Field">
3
- <span
4
- :class="`field-label ${(Field.Label && Field.Label.trim().length)
5
- ? '' : 'field-label-empty'} ${Field.Required ? 'required' : ''}`"
6
- v-if="Field.Label !== void 0"
7
- >
8
- <q-tooltip
9
- v-if="Field.Description"
10
- anchor="top right"
11
- >{{Field.Description}}</q-tooltip>
12
- {{Field.Label || ''}}
13
- <span
14
- v-if="Field.Required"
15
- class="required-mark"
16
- >*</span>
3
+ <span :class="`field-label ${(Field.Label && Field.Label.trim().length)
4
+ ? '' : 'field-label-empty'} ${Field.Required ? 'required' : ''}`" v-if="Field.Label !== void 0">
5
+ <q-tooltip v-if="Field.Description" anchor="top right">{{ Field.Description }}</q-tooltip>
6
+ {{ Field.Label || '' }}
7
+ <span v-if="Field.Required" class="required-mark">*</span>
17
8
  </span>
18
- <q-uploader
19
- @added="localFiles.push(...$event)"
20
- @uploaded="uploaded"
21
- @removed="removeFile"
22
- @rejected="filesRejected"
23
- :factory="factoryFn"
24
- multiple
25
- :auto-upload="Field && Field.Options && Field.Options.Auto"
26
- :max-file-size="maxFileSize"
27
- :max-total-size="maxTotalSize"
28
- :accept="acceptedFileTypes"
29
- :class="`q-ma-xs ${hasError ? 'free-field--error' : ''}`"
30
- ref="uploader"
31
- >
9
+ <q-uploader @added="localFiles.push(...$event)" @uploaded="uploaded" @removed="removeFile" @rejected="filesRejected"
10
+ :factory="factoryFn" multiple :auto-upload="Field && Field.Options && Field.Options.Auto"
11
+ :max-file-size="maxFileSize" :max-total-size="maxTotalSize" :accept="acceptedFileTypes"
12
+ :class="`q-ma-xs ${hasError ? 'free-field--error' : ''}`" ref="uploader">
32
13
  <template v-slot:list="scope">
33
- <div
34
- v-if="Field.Options && Field.Options.AsLink && Array.isArray(allFiles) && allFiles.length"
35
- class="file-link row full-width ellipsis items-center"
36
- >
37
- <div
38
- class="row ellipsis full-width"
39
- v-for="(file, index) in allFiles || []"
40
- :key="index"
41
- >
42
- <q-btn
43
- icon="cloud_download"
44
- dense
45
- flat
46
- ></q-btn>
47
- <a
48
- class="ellipsis"
49
- target="_blank"
50
- :href="$filter('serverPath', file.id)"
51
- :download="file.name"
52
- >
14
+ <div v-if="Field.Options && Field.Options.AsLink && Array.isArray(allFiles) && allFiles.length"
15
+ class="file-link row full-width ellipsis items-center">
16
+ <div class="row ellipsis full-width" v-for="(file, index) in allFiles || []" :key="index">
17
+ <q-btn icon="cloud_download" dense flat></q-btn>
18
+ <a class="ellipsis" target="_blank" :href="$filter('serverPath', file.id)" :download="file.name">
53
19
  {{ file.name }}
54
20
  <q-tooltip>{{ file.name }}</q-tooltip>
55
21
  </a>
@@ -57,43 +23,17 @@
57
23
  </div>
58
24
  <div v-else>
59
25
  <div class="uploader-btns row no-wrap items-center">
60
- <q-spinner
61
- v-if="scope.isUploading"
62
- class="q-uploader__spinner"
63
- />
64
- <q-btn
65
- v-if="scope.canAddFiles && !Field.ReadOnly && canHaveMore"
66
- type="a"
67
- icon="add_box"
68
- label="点击添加"
69
- class="add-btn"
70
- dense
71
- flat
72
- >
26
+ <q-spinner v-if="scope.isUploading" class="q-uploader__spinner" />
27
+ <q-btn v-if="scope.canAddFiles && !Field.ReadOnly && canHaveMore" type="a" icon="add_box" label="点击添加"
28
+ class="add-btn" dense flat>
73
29
  <q-uploader-add-trigger v-if="!Field.ReadOnly" />
74
30
  </q-btn>
75
- <q-btn
76
- v-if="!Field.ReadOnly
77
- && scope.canUpload && !(Field && Field.Options && Field.Options.Auto)"
78
- type="a"
79
- icon="cloud_upload"
80
- @click="scope.upload"
81
- class="upload-btn"
82
- label="点击上传"
83
- dense
84
- flat
85
- ></q-btn>
86
-
87
- <q-btn
88
- v-if="scope.isUploading && !Field.ReadOnly"
89
- type="a"
90
- icon="clear"
91
- @click="scope.abort"
92
- class="abort-btn"
93
- round
94
- dense
95
- flat
96
- ></q-btn>
31
+ <q-btn v-if="!Field.ReadOnly
32
+ && scope.canUpload && !(Field && Field.Options && Field.Options.Auto)" type="a" icon="cloud_upload"
33
+ @click="scope.upload" class="upload-btn" label="点击上传" dense flat></q-btn>
34
+
35
+ <q-btn v-if="scope.isUploading && !Field.ReadOnly" type="a" icon="clear" @click="scope.abort"
36
+ class="abort-btn" round dense flat></q-btn>
97
37
  <slot name="warning"></slot>
98
38
  </div>
99
39
 
@@ -134,36 +74,18 @@
134
74
  </q-list>
135
75
  </div> -->
136
76
 
137
- <div
138
- v-if="Array.isArray(allFiles) && allFiles.length"
139
- class="file-list file-list-card row items-start justify-start q-gutter-xl"
140
- >
141
- <q-card
142
- flat
143
- class="file-list-item"
144
- v-for="(file, index) in allFiles || []"
145
- :key="index"
146
- >
147
- <e-icon
148
- class="file-image"
149
- :name="fileThumb(file)"
150
- thumb
151
- :relative="filePreviewType(file) !== 'image'"
152
- @click="preview(file)"
153
- >
77
+ <div v-if="Array.isArray(allFiles) && allFiles.length"
78
+ class="file-list file-list-card row items-start justify-start q-gutter-xl">
79
+ <q-card flat class="file-list-item" v-for="(file, index) in allFiles || []" :key="index">
80
+ <e-icon class="file-image" :name="fileThumb(file)" thumb :relative="filePreviewType(file) !== 'image'"
81
+ @click="preview(file)">
154
82
  <div class="view-btn-wrapper absolute-full justify-center text-center">
155
- <q-btn
156
- flat
157
- class="view-btn full-height full-width"
158
- >查看</q-btn>
83
+ <q-btn flat class="view-btn full-height full-width">查看</q-btn>
159
84
  </div>
160
85
  </e-icon>
161
86
  <span class="file-name full-width ellipsis">
162
- <a
163
- target="_blank"
164
- :href="$filter('serverPath', file.id)"
165
- :download="file.name">
166
- {{ file.name }}
87
+ <a target="_blank" :href="$filter('serverPath', file.id)" :download="file.name">
88
+ {{ file.name }}
167
89
  </a>
168
90
  <q-tooltip>{{ file.name }}</q-tooltip>
169
91
  </span>
@@ -172,58 +94,28 @@
172
94
  Size: {{ file.sizeLabel || file.__sizeLabel }}
173
95
  </span>
174
96
 
175
- <q-btn
176
- flat
177
- dense
178
- round
179
- class="delete-btn"
180
- icon="close"
181
- @click="scope.removeFile(file)"
182
- v-if="!Field.ReadOnly"
183
- />
97
+ <q-btn flat dense round class="delete-btn" icon="close" @click="scope.removeFile(file)"
98
+ v-if="!Field.ReadOnly" />
184
99
  </q-card>
185
100
  </div>
186
- <div
187
- class="free-field--error-tag"
188
- v-if="hasError"
189
- >
101
+ <div class="free-field--error-tag" v-if="hasError">
190
102
  <e-icon name="error"></e-icon>
191
103
  </div>
192
104
  </div>
193
105
  </template>
194
106
  </q-uploader>
195
- <q-dialog
196
- class="image-preview-dialog"
197
- flat
198
- full-width
199
- full-height
200
- v-model="showPreview"
201
- style="background: rgba(0,0,0,0)"
202
- >
107
+ <q-dialog class="image-preview-dialog" flat full-width full-height v-model="showPreview"
108
+ style="background: rgba(0,0,0,0)">
203
109
  <div class="image-preview">
204
- <q-icon name="close"
205
- class="absolute cursor-pointer bg-white text-primary"
206
- style="border-radius: 6px;border: 1px solid primary;right: 0;"
207
- round size="20px"
208
- @click="showPreview=false"></q-icon>
209
- <q-img
210
- v-if="previewType=== 'image'"
211
- contain
212
- :src="previewFile"
213
- @click="showPreview=false"
214
- style="height: 100%; max-width: 100%;"
215
- >
110
+ <q-icon name="close" class="absolute cursor-pointer bg-white text-primary"
111
+ style="border-radius: 6px;border: 1px solid primary;right: 0;" round size="20px"
112
+ @click="showPreview = false"></q-icon>
113
+ <q-img v-if="previewType === 'image'" fit="contain" :src="previewFile" @click="showPreview = false"
114
+ style="height: 100%; max-width: 100%;">
216
115
  </q-img>
217
116
 
218
- <pdf-viewer
219
- v-if="previewType === 'pdf'"
220
- v-model="showPreview"
221
- @click="showPreview=false"
222
- :src="previewFile"
223
- :version="Field?.Options?.PdfViewerVersion"
224
- type="pdfjs"
225
- style="height: 100%; max-width: 100%;"
226
- />
117
+ <pdf-viewer v-if="previewType === 'pdf'" v-model="showPreview" @click="showPreview = false" :src="previewFile"
118
+ :version="Field?.Options?.PdfViewerVersion" type="pdfjs" style="height: 100%; max-width: 100%;" />
227
119
  </div>
228
120
  </q-dialog>
229
121
  </div>
@@ -231,10 +123,10 @@
231
123
 
232
124
  <script>
233
125
  import { computed, defineComponent, getCurrentInstance, ref } from 'vue';
234
- import { useFreeField, freeFieldProps } from '../composible/useFreeField';
235
- import { useFormValidator} from '../../composible/useFormValidator';
236
- import { useUploader } from '../composible/useUploader';
237
- import PdfViewer from './pdfviewer';
126
+ import { useFreeField, freeFieldProps } from '../composible/useFreeField.js';
127
+ import { useFormValidator} from '../../composible/useFormValidator.js';
128
+ import { useUploader } from '../composible/useUploader.js';
129
+ import PdfViewer from './pdfviewer.js';
238
130
 
239
131
  export default defineComponent({
240
132
  name: 'InputFieldFileList',
@@ -375,7 +267,6 @@ export default defineComponent({
375
267
  if (res && res.msg === 'OK') {
376
268
  uploadedFiles.push({
377
269
  id: res.data.id,
378
- // eslint-disable-next-line no-underscore-dangle
379
270
  sizeLabel: file.__sizeLabel,
380
271
  name: file.name,
381
272
  size: file.size,
@@ -1,69 +1,38 @@
1
1
  <template>
2
2
  <div class="free-field-fixed-list row">
3
- <span
4
- :class="`field-label ${(Field.Label && Field.Label.trim().length)
5
- ? '' : 'field-label-empty'} ${Field.Required ? 'required' : ''}`"
6
- v-if="Field.Label !== void 0"
7
- >
8
- <q-tooltip v-if="Field.Description" anchor="top right">{{Field.Description}}</q-tooltip>
9
- {{Field.Label || ''}}
3
+ <span :class="`field-label ${(Field.Label && Field.Label.trim().length)
4
+ ? '' : 'field-label-empty'} ${Field.Required ? 'required' : ''}`" v-if="Field.Label !== void 0">
5
+ <q-tooltip v-if="Field.Description" anchor="top right">{{ Field.Description }}</q-tooltip>
6
+ {{ Field.Label || '' }}
10
7
  <span v-if="Field.Required" class="required-mark">*</span>
11
8
  </span>
12
- <q-table
13
- class="q-ma-xs col"
14
- :rows="tableData"
15
- :columns="columns"
16
- row-key="Name"
17
- :hide-bottom="!summaryContent"
18
- separator="cell"
19
- :pagination="{rowsPerPage:100000}"
20
- table-header-class="row-zebra-even"
21
- >
9
+ <q-table class="q-ma-xs col" :rows="tableData" :columns="columns" row-key="Name" :hide-bottom="!summaryContent"
10
+ separator="cell" :pagination="{ rowsPerPage: 100000 }" table-header-class="row-zebra-even">
22
11
  <template v-slot:top v-if="Field.Warning">
23
12
  <slot name="warning"></slot>
24
13
  </template>
25
14
  <template v-slot:body-cell="props">
26
- <q-td
27
- :props="props"
28
- style="text-align: center;padding:0;margin:0;height:auto;width:auto;"
29
- v-if="props.col.List &&
15
+ <q-td :props="props" style="text-align: center;padding:0;margin:0;height:auto;width:auto;" v-if="props.col.List &&
30
16
  (props.col.List.length === 1) &&
31
- props.row[props.col.List[0].Name] === 'NaN'"
32
- :class="tableTdClass(props.rowIndex)"
33
- >/</q-td>
34
- <q-td
35
- :props="props"
36
- v-else-if="showCell(props)"
37
- :colspan="props.value && props.value.colspan || 1"
17
+ props.row[props.col.List[0].Name] === 'NaN'" :class="tableTdClass(props.rowIndex)">/</q-td>
18
+ <q-td :props="props" v-else-if="showCell(props)" :colspan="props.value && props.value.colspan || 1"
38
19
  :rowspan="props.value && props.value.rowspan || 1"
39
20
  :class="`items-center justify-center ${tableTdClass(props.rowIndex)}`"
40
- style="padding:0;margin:0;height:auto;width:auto;"
41
- >
21
+ style="padding:0;margin:0;height:auto;width:auto;">
42
22
  <span v-if="props.col.List && props.col.List.length > 1" class="full-width full-height">
43
- <free-field
44
- v-for="(col,index) in props.col.List"
45
- :key="index"
46
- :Field="columnField(col, true, props.col)"
47
- :values="props.row"
48
- @input="cellChanged()"
49
- ref="fieldsToValid"
50
- ></free-field>
23
+ <free-field v-for="(col, index) in props.col.List" :key="index" :Field="columnField(col, true, props.col)"
24
+ :values="props.row" @input="cellChanged()" ref="fieldsToValid"></free-field>
51
25
  </span>
52
26
  <span v-else class="full-width full-height">
53
- <free-field
54
- :Field="columnField(props.col, false)"
55
- :values="props.row"
56
- @input="cellChanged()"
57
- borderless
58
- ref="fieldToValid"
59
- ></free-field>
27
+ <free-field :Field="columnField(props.col, false)" :values="props.row" @input="cellChanged()" borderless
28
+ ref="fieldToValid"></free-field>
60
29
  </span>
61
30
  </q-td>
62
31
  </template>
63
32
 
64
33
  <template v-slot:bottom>
65
34
  <q-tr class="summary-tr">
66
- <q-td colspan="100%" class="text-right summary-row">{{summaryContent}}</q-td>
35
+ <q-td colspan="100%" class="text-right summary-row">{{ summaryContent }}</q-td>
67
36
  </q-tr>
68
37
  </template>
69
38
  </q-table>
@@ -72,8 +41,8 @@
72
41
 
73
42
  <script>
74
43
  import { defineComponent, watchEffect, ref, computed } from 'vue';
75
- import { useFreeField, freeFieldProps } from '../composible/useFreeField';
76
- import { useFormValidator} from '../../composible/useFormValidator';
44
+ import { useFreeField, freeFieldProps } from '../composible/useFreeField.js';
45
+ import { useFormValidator} from '../../composible/useFormValidator.js';
77
46
 
78
47
  export default defineComponent({
79
48
  name: 'InputFieldFixedList',
@@ -235,7 +204,6 @@ export default defineComponent({
235
204
  const showCell = (p) => {
236
205
  const colNum = Number(p.col.name);
237
206
 
238
- // eslint-disable-next-line no-restricted-globals
239
207
  if (isNaN(colNum)) return true;
240
208
 
241
209
  if (p.row.rowSize !== void 0) {
@@ -1,94 +1,47 @@
1
1
  <template>
2
2
  <div class="free-field-list row full-width">
3
- <span
4
- :class="`field-label ${(Field.Label && Field.Label.trim().length)
5
- ? '' : 'field-label-empty'} ${Field.Required ? 'required' : ''}`"
6
- v-if="Field.Label !== void 0"
7
- >
8
- <q-tooltip
9
- v-if="Field.Description"
10
- anchor="top right"
11
- >{{Field.Description}}</q-tooltip>
12
- {{Field.Label || ''}}
13
- <span
14
- v-if="Field.Required"
15
- class="required-mark"
16
- >*</span>
3
+ <span :class="`field-label ${(Field.Label && Field.Label.trim().length)
4
+ ? '' : 'field-label-empty'} ${Field.Required ? 'required' : ''}`" v-if="Field.Label !== void 0">
5
+ <q-tooltip v-if="Field.Description" anchor="top right">{{ Field.Description }}</q-tooltip>
6
+ {{ Field.Label || '' }}
7
+ <span v-if="Field.Required" class="required-mark">*</span>
17
8
  </span>
18
9
 
19
- <dynamic-list
20
- class="col"
21
- :Field="localField"
22
- :values="values"
23
- readonly
24
- ref="fieldList"
25
- selection="multiple"
26
- >
10
+ <dynamic-list class="col" :Field="localField" :values="values" readonly ref="fieldList" selection="multiple">
27
11
  <template v-slot:top>
28
12
  <q-btn-group class="action-buttons">
29
- <q-btn
30
- icon="content_copy"
31
- @click="copy"
32
- >
13
+ <q-btn icon="content_copy" @click="copy">
33
14
  <q-tooltip>拷贝选中</q-tooltip>
34
15
  </q-btn>
35
- <q-btn
36
- icon="content_paste"
37
- @click="paste"
38
- >
16
+ <q-btn icon="content_paste" @click="paste">
39
17
  <q-tooltip>粘贴</q-tooltip>
40
18
  </q-btn>
41
- <q-btn
42
- icon="update"
43
- @click="batch"
44
- v-if="fieldListLength > 1"
45
- >
19
+ <q-btn icon="update" @click="batch" v-if="fieldListLength > 1">
46
20
  <q-tooltip>批量修改</q-tooltip>
47
21
  </q-btn>
48
22
  </q-btn-group>
49
23
  </template>
50
24
  <template v-slot:header-actions>
51
- <q-btn
52
- flat
53
- round
54
- icon="add"
55
- @click="addField"
56
- ></q-btn>
25
+ <q-btn flat round icon="add" @click="addField"></q-btn>
57
26
  </template>
58
27
  <template v-slot:body-actions="props">
59
- <q-btn
60
- flat
61
- round
62
- icon="edit"
63
- @click="editField(props.row)"
64
- ></q-btn>
65
- <q-btn
66
- flat
67
- round
68
- icon="delete"
69
- @click="deleteField(props)"
70
- ></q-btn>
28
+ <q-btn flat round icon="edit" @click="editField(props.row)"></q-btn>
29
+ <q-btn flat round icon="delete" @click="deleteField(props)"></q-btn>
71
30
  </template>
72
31
  <template v-slot:warning>
73
32
  <slot name="warning"></slot>
74
33
  </template>
75
34
  </dynamic-list>
76
35
 
77
- <free-field
78
- :Field="editingFieldField"
79
- :values="editingField"
80
- @cancel="editorCancelled"
81
- @save="saveField"
82
- @input="editorInput"
83
- @update:field="editingFieldChanged"
84
- ></free-field>
36
+ <free-field :Field="editingFieldField" :values="editingField" @cancel="editorCancelled" @save="saveField"
37
+ @input="editorInput" @update:field="editingFieldChanged"></free-field>
85
38
  </div>
86
39
  </template>
87
40
 
88
41
  <script>
89
- import { defineComponent, ref, unref, computed, watchEffect } from 'vue';
90
- import { useFreeField, freeFieldProps } from '../composible/useFreeField';
91
- import DynamicList from './DynamicList';
42
+ import { defineComponent, ref, unref, computed } from 'vue';
43
+ import { useFreeField, freeFieldProps } from '../composible/useFreeField.js';
44
+ import DynamicList from './DynamicList.vue';
92
45
 
93
46
  const clipBoardStore = {
94
47
  content: '',