@xuekl/cli-components 1.1.4 → 1.1.6
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/XklForm.vue +7 -1
- package/XklTable.vue +4 -0
- package/package.json +1 -1
package/XklForm.vue
CHANGED
|
@@ -110,9 +110,15 @@ Object.keys(form).forEach(prop => {
|
|
|
110
110
|
placeholder: placeholderStart + field.label.replace(':', '').replace(':', ''),
|
|
111
111
|
clearable: true
|
|
112
112
|
}
|
|
113
|
+
if (opts.placeholder === false) {
|
|
114
|
+
field.element.placeholder = ''
|
|
115
|
+
}
|
|
113
116
|
} else {
|
|
114
|
-
field.element.placeholder = placeholderStart + field.label.replace(':', '').replace(':', '')
|
|
117
|
+
field.element.placeholder = field.element.placeholder || placeholderStart + field.label.replace(':', '').replace(':', '')
|
|
115
118
|
field.element.clearable = typeof field.element.clearable === 'undefined' ? true : field.element.clearable
|
|
119
|
+
if (opts.placeholder === false) {
|
|
120
|
+
field.element.placeholder = ''
|
|
121
|
+
}
|
|
116
122
|
}
|
|
117
123
|
const item = {
|
|
118
124
|
prop,
|
package/XklTable.vue
CHANGED
|
@@ -24,6 +24,9 @@
|
|
|
24
24
|
<template v-else-if="item.slot" v-slot="{ row }">
|
|
25
25
|
<slot :name="item.prop" :row="row"></slot>
|
|
26
26
|
</template>
|
|
27
|
+
<template v-else-if="item.format" v-slot="{ row }">
|
|
28
|
+
{{moment(row[item.prop]).format(item.format)}}
|
|
29
|
+
</template>
|
|
27
30
|
</el-table-column>
|
|
28
31
|
<el-table-column v-if="table.operation.operation !== false" align="center" v-bind="table.operation">
|
|
29
32
|
<template #default="{ row }">
|
|
@@ -43,6 +46,7 @@ export default {
|
|
|
43
46
|
<script setup lang="ts">
|
|
44
47
|
import http from "@/utils/httpRequest"
|
|
45
48
|
import { computed, ref } from "vue";
|
|
49
|
+
import moment from 'dayjs'
|
|
46
50
|
const props = defineProps(['table'])
|
|
47
51
|
const { table } = props
|
|
48
52
|
const dictTypes = table.columns.map(res => res.dict).filter(res => !!res)
|