@@ -459,11 +456,10 @@ import {
} from 'vue'
import { Setting } from '@element-plus/icons-vue'
-import { getEntityConfig } from '../decorator/EntityConfig'
import { AirSortType } from '../enum/AirSortType'
import { AirConfirm } from '../feedback/AirConfirm'
import { AirTableFieldConfig } from '../config/AirTableFieldConfig'
-import { AirAny, AirTableInstance } from '../type/AirType'
+import { AirAny, AirTableInstance, ClassConstructor } from '../type/AirType'
import { AirColor } from '../enum/AirColor'
import { AirFile } from '../helper/AirFile'
import { AirSort } from '../model/AirSort'
@@ -481,8 +477,9 @@ import { AirI18n } from '../helper/AirI18n'
import { IJson } from '../interface/IJson'
import { AirCrypto } from '../helper/AirCrypto'
import { ITreeProps } from '../interface/props/ITreeProps'
-import { ClassConstructor } from '../type/ClassConstructor'
import { AirDecorator } from '../helper/AirDecorator'
+import { getModelConfig } from '../decorator/Model'
+import { ITableFieldConfig } from '@/airpower/interface/decorators/ITableFieldConfig'
const emits = defineEmits<{
onDetail: [row: E],
@@ -869,6 +866,18 @@ const props = defineProps({
},
})
+/**
+ * # 获取表格列的样式
+ * @param config
+ */
+function getTableColumnClass(config: ITableFieldConfig) {
+ let clazz = 'air-table-column'
+ if (config.nowrap) {
+ clazz += ' nowrap'
+ }
+ return clazz
+}
+
/**
* 表格dom
*/
@@ -923,13 +932,13 @@ watch(() => AirStore().controlKeyDown, () => {
/**
* # 内部使用的配置
*/
-const entityConfig = computed(() => getEntityConfig(entityInstance.value))
+const modelConfig = computed(() => getModelConfig(entityInstance.value))
/**
* # 字段选择器是否启用
*/
const isFieldSelectorEnabled = computed(() => {
- if (entityConfig.value.hideFieldSelector) {
+ if (modelConfig.value.hideFieldSelector) {
// 全局标记了隐藏
return false
}
@@ -1095,7 +1104,7 @@ function getPayloadRowData(row: IJson, config: AirTableFieldConfig): AirAny {
if (row[config.key] && row[config.key].length > 0) {
// 对象数组挂载
return row[config.key].map((i: IJson) => i[config.payloadField || ''])
- .join(config.arraySplitor)
+ .join(config.arraySeparator)
}
}
return config.emptyValue
@@ -1182,7 +1191,7 @@ async function handleDelete(item: E) {
// 如果实体传入 则尝试自动获取
title = AirI18n.get().DeleteConfirm || '确认删除'
- content = AirI18n.get().AreYouConfirmToDelete || '是否确认删除选择的数据'
+ content = AirI18n.get().AreYouConfirmToDelete || '是否确认删除选择这行的数据?'
// 如果传入配置项 则覆盖实体标注的内容
if (props.deleteTitle) {
@@ -1303,8 +1312,8 @@ watch(
// 分页后滚动条置顶
const table = document.querySelector(`#${tableId}`)
- const bodyWrapp = table?.querySelector('.el-scrollbar__wrap') as HTMLElement
- bodyWrapp.scrollTop = 0
+ const bodyWrap = table?.querySelector('.el-scrollbar__wrap') as HTMLElement
+ bodyWrap.scrollTop = 0
})
},
)
@@ -1337,7 +1346,7 @@ init()
color: var(--primary-color);
}
- .el-button+.el-button {
+ .el-button + .el-button {
margin-left: 0;
}
@@ -1355,7 +1364,7 @@ init()
}
}
-.ctrlRow+.el-button {
+.ctrlRow + .el-button {
margin-left: 12px;
}
@@ -1437,7 +1446,7 @@ init()
}
}
-.air-table-tool-bar>* {
+.air-table-tool-bar > * {
margin-bottom: 10px;
}
@@ -1453,7 +1462,7 @@ init()
cursor: not-allowed;
position: relative;
- >* {
+ > * {
user-select: none;
filter: blur(1px);
}
@@ -1579,7 +1588,7 @@ init()
background-color: transparent;
}
- .air-button+.air-button {
+ .air-button + .air-button {
margin: 0 !important;
}
}
diff --git a/component/ToolBar.vue b/component/ToolBar.vue
index d2266483..3c5beaf4 100644
--- a/component/ToolBar.vue
+++ b/component/ToolBar.vue
@@ -4,7 +4,7 @@
@@ -41,16 +41,12 @@
@@ -109,8 +101,8 @@
],
@@ -333,6 +326,27 @@ const props = defineProps({
},
})
+/**
+ * # 默认时间
+ */
+const defaultTime = ref([
+ new Date(1991, 10, 3, 0, 0, 0),
+ new Date(1991, 10, 3, 23, 59, 59),
+])
+
+/**
+ * # 格式化年月日
+ */
+const YYYY_MM_DD = 'YYYY/MM/DD'
+
+/**
+ * # 格式化时分秒
+ */
+const HH_MM_SS = 'HH:mm:ss'
+
+const LABEL_TO = '至'
+const LABEL_END = '结束'
+
/**
* # `Entity` 的实例
*/
@@ -356,7 +370,7 @@ const data = ref(props.defaultFilter ? (props.defaultFilter as IJson) : {
/**
* # 内部使用的配置
*/
-const entityConfig = computed(() => getEntityConfig(entityInstance.value))
+const modelConfig = computed(() => getModelConfig(entityInstance.value))
/**
* # 查询对象
@@ -366,12 +380,12 @@ const request = ref(new AirRequestPage(props.entity)) as Ref>
/**
* # 添加按钮的标题
*/
-const addTitle = computed(() => entityConfig.value.addTitle || (AirI18n.get().Add || '添加'))
+const addTitle = computed(() => modelConfig.value.addTitle || (AirI18n.get().Add || '添加'))
/**
* # 是否显示搜索框
*/
-const isSearchEnabled = computed(() => props.showSearch ?? entityConfig.value.showSearch ?? true)
+const isSearchEnabled = computed(() => props.showSearch ?? modelConfig.value.showSearch ?? true)
/**
* # 为URL拼接AccessToken
@@ -406,6 +420,17 @@ function onExport() {
AirDialog.createExportTask(exportModel)
}
+/**
+ * # 获取API地址
+ * @param url
+ */
+function getApiUrl(url: string): string {
+ if (url.indexOf(AirConstant.PREFIX_HTTP) < 0 && url.indexOf(AirConstant.PREFIX_HTTPS) <= 0) {
+ url = AirConfig.apiUrl + url
+ }
+ return url
+}
+
/**
* # 下载导入的模板
*/
@@ -424,9 +449,7 @@ function onDownloadTemplate() {
const service = AirClassTransformer.newInstance(props.service)
url = `${service.baseUrl}/${AirConfig.importTemplateUrl}`
- if (url.indexOf('https://') < 0 && url.indexOf('http://') <= 0) {
- url = AirConfig.apiUrl + url
- }
+ url = getApiUrl(url)
window.open(getUrlWithAccessToken(url))
}
@@ -483,14 +506,12 @@ async function onImport() {
}
const service = AirClassTransformer.newInstance(props.service)
url = `${service.baseUrl}/${AirConfig.importUrl}`
- if (url.indexOf('https://') < 0 && url.indexOf('http://') <= 0) {
- url = AirConfig.apiUrl + url
- }
+ url = getApiUrl(url)
}
await AirDialog.showUpload(
{
uploadUrl: url,
- exts: ['xls', 'xlsx'],
+ extensions: ['xls', 'xlsx'],
title: props.importTitle || AirI18n.get().Import || '导入',
uploadSuccess: AirI18n.get().ImportSuccess || '数据导入成功',
confirmText: AirI18n.get().DownloadTemplate || '下载模板',
@@ -519,7 +540,7 @@ defineExpose({
flex-direction: row;
align-items: flex-start;
- .el-button+.el-button {
+ .el-button + .el-button {
margin-left: 5px;
}
@@ -550,7 +571,7 @@ defineExpose({
align-items: center;
flex-wrap: wrap-reverse;
- >* {
+ > * {
margin: 0 2px 5px;
}
diff --git a/component/Upload.vue b/component/Upload.vue
index bbd7689c..cc9b0679 100644
--- a/component/Upload.vue
+++ b/component/Upload.vue
@@ -1,12 +1,12 @@
@@ -16,16 +16,16 @@
>
{{ AirI18n.get().ClickHereToUpload || '点击或拖到此处上传' }}
@@ -33,8 +33,8 @@
{{ AirI18n.get().FileSize || '文件大小: ' }}
{{ AirFile.getFileSizeFriendly(props.maxSize) }}
{{ AirI18n.get().FileExt || '文件格式: ' }}
-
- {{ exts.join('/') }}
+
+ {{ extensions.join('/') }}
-
diff --git a/component/phone/Call.vue b/component/phone/Call.vue
index d8377c8c..c98308fe 100644
--- a/component/phone/Call.vue
+++ b/component/phone/Call.vue
@@ -1,6 +1,6 @@
span {
+ > span {
font-size: 12px;
color: var(--text-danger-color);
margin-top: 10px;
diff --git a/component/table/Payload.vue b/component/table/Payload.vue
index 125403fb..e2ce160b 100644
--- a/component/table/Payload.vue
+++ b/component/table/Payload.vue
@@ -3,16 +3,23 @@
{{ payload.getPayloadLabel() }}
-