diff --git a/mayfly_go_web/src/common/config.ts b/mayfly_go_web/src/common/config.ts index 278d0a79..154df42c 100644 --- a/mayfly_go_web/src/common/config.ts +++ b/mayfly_go_web/src/common/config.ts @@ -15,7 +15,7 @@ const config = { baseWsUrl: `${(window as any).globalConfig.BaseWsUrl || `${location.protocol == 'https:' ? 'wss:' : 'ws:'}//${getBaseApiUrl()}`}/api`, // 系统版本 - version: 'v1.6.0', + version: 'v1.6.1', }; export default config; diff --git a/mayfly_go_web/src/components/Grid/components/GridItem.vue b/mayfly_go_web/src/components/Grid/components/GridItem.vue new file mode 100644 index 00000000..9502833d --- /dev/null +++ b/mayfly_go_web/src/components/Grid/components/GridItem.vue @@ -0,0 +1,66 @@ + + + + + + diff --git a/mayfly_go_web/src/components/Grid/index.vue b/mayfly_go_web/src/components/Grid/index.vue new file mode 100644 index 00000000..2e301419 --- /dev/null +++ b/mayfly_go_web/src/components/Grid/index.vue @@ -0,0 +1,159 @@ + + + + + + + diff --git a/mayfly_go_web/src/components/Grid/interface/index.ts b/mayfly_go_web/src/components/Grid/interface/index.ts new file mode 100644 index 00000000..a0beff2c --- /dev/null +++ b/mayfly_go_web/src/components/Grid/interface/index.ts @@ -0,0 +1,6 @@ +export type BreakPoint = "xs" | "sm" | "md" | "lg" | "xl"; + +export type Responsive = { + span?: number; + offset?: number; +}; diff --git a/mayfly_go_web/src/components/SearchForm/components/SearchFormItem.vue b/mayfly_go_web/src/components/SearchForm/components/SearchFormItem.vue new file mode 100644 index 00000000..3cd275df --- /dev/null +++ b/mayfly_go_web/src/components/SearchForm/components/SearchFormItem.vue @@ -0,0 +1,94 @@ + + + + {{ data[fieldNames.label] }} + + + + + + + + + + + diff --git a/mayfly_go_web/src/components/SearchForm/index.ts b/mayfly_go_web/src/components/SearchForm/index.ts new file mode 100644 index 00000000..99a6a329 --- /dev/null +++ b/mayfly_go_web/src/components/SearchForm/index.ts @@ -0,0 +1,115 @@ +import { VNode } from 'vue'; + +export type FieldNamesProps = { + label: string; + value: string; + children?: string; +}; + +export type SearchItemType = + | 'input' + | 'input-number' + | 'select' + | 'select-v2' + | 'tree-select' + | 'cascader' + | 'date-picker' + | 'time-picker' + | 'time-select' + | 'switch' + | 'slider'; + +/** + * 搜索项 + */ +export class SearchItem { + /** + * 属性字段 + */ + prop: string; + + /** + * 当前项搜索框的 label + */ + label: string; + + /** + * 表单项类型,input、select、date等 + */ + type: SearchItemType; + + /** + * select等组件的可选值 + */ + options: any; + + /** + * 插槽名 + */ + slot: string; + + props?: any; // 搜索项参数,根据 element plus 官方文档来传递,该属性所有值会透传到组件 + + tooltip?: string; // 搜索提示 + + span?: number; // 搜索项所占用的列数,默认为 1 列 + + offset?: number; // 搜索字段左侧偏移列数 + + fieldNames: FieldNamesProps; // 指定 label && value && children 的 key 值,用于select等类型组件 + + render?: (scope: any) => VNode; // 自定义搜索内容渲染(tsx语法) + + constructor(prop: string, label: string) { + this.prop = prop; + this.label = label; + } + + static new(prop: string, label: string): SearchItem { + return new SearchItem(prop, label); + } + + static text(prop: string, label: string): SearchItem { + const tq = new SearchItem(prop, label); + tq.type = 'input'; + return tq; + } + + static select(prop: string, label: string): SearchItem { + const tq = new SearchItem(prop, label); + tq.type = 'select'; + return tq; + } + + static date(prop: string, label: string): SearchItem { + const tq = new SearchItem(prop, label); + tq.type = 'date-picker'; + return tq; + } + + static slot(prop: string, label: string, slotName: string): SearchItem { + const tq = new SearchItem(prop, label); + tq.slot = slotName; + return tq; + } + + withSpan(span: number): SearchItem { + this.span = span; + return this; + } + + /** + * 设置枚举值用于选择等 + * @param enumValues 枚举值对象 + * @returns + */ + withEnum(enumValues: any): SearchItem { + this.options = Object.values(enumValues); + return this; + } + + setOptions(options: any): SearchItem { + this.options = options; + return this; + } +} diff --git a/mayfly_go_web/src/components/SearchForm/index.vue b/mayfly_go_web/src/components/SearchForm/index.vue new file mode 100644 index 00000000..1edfd0a2 --- /dev/null +++ b/mayfly_go_web/src/components/SearchForm/index.vue @@ -0,0 +1,136 @@ + + + + + + + + + {{ `${item?.label}` }} + + + + + : + + + + + + + + + + 搜索 + 重置 + + {{ collapsed ? '展开' : '合并' }} + + + + + + + + + + + + diff --git a/mayfly_go_web/src/components/pagetable/PageTable.vue b/mayfly_go_web/src/components/pagetable/PageTable.vue index b8a4fc47..dbecc0e2 100644 --- a/mayfly_go_web/src/components/pagetable/PageTable.vue +++ b/mayfly_go_web/src/components/pagetable/PageTable.vue @@ -1,170 +1,112 @@ - - + + + + + + + + + - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - - - - 查询 - 重置 - - - - - - + + + + + + + + - - - + + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + {{ item.getValueByData(scope.row) }} + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ item.getValueByData(scope.row) }} - - - - - - + diff --git a/mayfly_go_web/src/components/pagetable/index.ts b/mayfly_go_web/src/components/pagetable/index.ts index a5d32fda..06f3419b 100644 --- a/mayfly_go_web/src/components/pagetable/index.ts +++ b/mayfly_go_web/src/components/pagetable/index.ts @@ -242,68 +242,3 @@ export class TableColumn { this.minWidth = (flexWidth > 400 ? 400 : flexWidth) + this.addWidth; }; } - -export class TableQuery { - /** - * 属性字段 - */ - prop: string; - - /** - * 显示表头 - */ - label: string; - - /** - * 查询类型,text、select、date - */ - type: string; - - /** - * select可选值 - */ - options: any; - - /** - * 插槽名 - */ - slot: string; - - constructor(prop: string, label: string) { - this.prop = prop; - this.label = label; - } - - static new(prop: string, label: string): TableQuery { - return new TableQuery(prop, label); - } - - static text(prop: string, label: string): TableQuery { - const tq = new TableQuery(prop, label); - tq.type = 'text'; - return tq; - } - - static select(prop: string, label: string): TableQuery { - const tq = new TableQuery(prop, label); - tq.type = 'select'; - return tq; - } - - static date(prop: string, label: string): TableQuery { - const tq = new TableQuery(prop, label); - tq.type = 'date'; - return tq; - } - - static slot(prop: string, label: string, slotName: string): TableQuery { - const tq = new TableQuery(prop, label); - tq.slot = slotName; - return tq; - } - - setOptions(options: any): TableQuery { - this.options = options; - return this; - } -} diff --git a/mayfly_go_web/src/store/themeConfig.ts b/mayfly_go_web/src/store/themeConfig.ts index 6de03321..c0c9fa9f 100644 --- a/mayfly_go_web/src/store/themeConfig.ts +++ b/mayfly_go_web/src/store/themeConfig.ts @@ -138,7 +138,7 @@ export const useThemeConfig = defineStore('themeConfig', { /** 全局设置 */ // 默认列表页的分页大小 - defaultListPageSize: 15, + defaultListPageSize: 10, }, }), actions: { diff --git a/mayfly_go_web/src/views/ops/db/DbList.vue b/mayfly_go_web/src/views/ops/db/DbList.vue index af17a847..0183fb7d 100644 --- a/mayfly_go_web/src/views/ops/db/DbList.vue +++ b/mayfly_go_web/src/views/ops/db/DbList.vue @@ -4,28 +4,20 @@ ref="pageTableRef" :page-api="dbApi.dbs" :before-query-fn="checkRouteTagPath" - :query="queryConfig" + :search-items="searchItems" v-model:query-form="query" :show-selection="true" v-model:selection-data="state.selectionData" :columns="columns" > - + - + {{ item.name }} @@ -37,7 +29,7 @@ - + 添加 删除 @@ -170,7 +162,7 @@ import { isTrue } from '@/common/assert'; import { dateFormat } from '@/common/utils/date'; import ResourceTag from '../component/ResourceTag.vue'; import PageTable from '@/components/pagetable/PageTable.vue'; -import { TableColumn, TableQuery } from '@/components/pagetable'; +import { TableColumn } from '@/components/pagetable'; import { hasPerms } from '@/components/auth/auth'; import DbSqlExecLog from './DbSqlExecLog.vue'; import { DbType } from './dialect'; @@ -178,6 +170,7 @@ import { tagApi } from '../tag/api'; import { TagResourceTypeEnum } from '@/common/commonEnum'; import { useRoute } from 'vue-router'; import { getDbDialect } from './dialect/index'; +import { SearchItem } from '@/components/SearchForm'; const DbEdit = defineAsyncComponent(() => import('./DbEdit.vue')); @@ -187,7 +180,7 @@ const perms = { delDb: 'db:del', }; -const queryConfig = [TableQuery.slot('tagPath', '标签', 'tagPathSelect'), TableQuery.slot('instanceId', '实例', 'instanceSelect')]; +const searchItems = [SearchItem.slot('tagPath', '标签', 'tagPathSelect'), SearchItem.slot('instanceId', '实例', 'instanceSelect')]; const columns = ref([ TableColumn.new('instanceName', '实例名'), diff --git a/mayfly_go_web/src/views/ops/db/DbSqlExecLog.vue b/mayfly_go_web/src/views/ops/db/DbSqlExecLog.vue index 91ef3eea..19979d82 100644 --- a/mayfly_go_web/src/views/ops/db/DbSqlExecLog.vue +++ b/mayfly_go_web/src/views/ops/db/DbSqlExecLog.vue @@ -5,12 +5,12 @@ :page-api="dbApi.getSqlExecs" :lazy="true" height="100%" - :query="queryConfig" + :search-items="searchItems" v-model:query-form="query" :columns="columns" > - + @@ -40,7 +40,8 @@ import { toRefs, watch, reactive, onMounted, Ref, ref } from 'vue'; import { dbApi } from './api'; import { DbSqlExecTypeEnum } from './enums'; import PageTable from '@/components/pagetable/PageTable.vue'; -import { TableColumn, TableQuery } from '@/components/pagetable'; +import { TableColumn } from '@/components/pagetable'; +import { SearchItem } from '@/components/SearchForm'; const props = defineProps({ dbId: { @@ -53,13 +54,13 @@ const props = defineProps({ }, }); -const queryConfig = [ - TableQuery.slot('db', '数据库', 'dbSelect'), - TableQuery.text('table', '表名'), - TableQuery.select('type', '操作类型').setOptions(Object.values(DbSqlExecTypeEnum)), +const searchItems = [ + SearchItem.slot('db', '数据库', 'dbSelect'), + SearchItem.text('table', '表名'), + SearchItem.select('type', '操作类型').withEnum(DbSqlExecTypeEnum), ]; -const columns = [ +const columns = ref([ TableColumn.new('db', '数据库'), TableColumn.new('table', '表'), TableColumn.new('type', '类型').typeTag(DbSqlExecTypeEnum).setAddWidth(10), @@ -69,7 +70,7 @@ const columns = [ TableColumn.new('createTime', '执行时间').isTime(), TableColumn.new('remark', '备注'), TableColumn.new('action', '操作').isSlot().setMinWidth(90).fixedRight().alignCenter(), -]; +]); const pageTableRef: Ref = ref(null); diff --git a/mayfly_go_web/src/views/ops/db/InstanceList.vue b/mayfly_go_web/src/views/ops/db/InstanceList.vue index 943a919b..3d753772 100644 --- a/mayfly_go_web/src/views/ops/db/InstanceList.vue +++ b/mayfly_go_web/src/views/ops/db/InstanceList.vue @@ -3,13 +3,13 @@ - + 添加 删除 import('./InstanceEdit.vue')); @@ -78,7 +79,7 @@ const perms = { delInstance: 'db:instance:del', }; -const queryConfig = [TableQuery.text('name', '名称')]; +const searchItems = [SearchItem.text('name', '名称')]; const columns = ref([ TableColumn.new('name', '名称'), diff --git a/mayfly_go_web/src/views/ops/machine/MachineList.vue b/mayfly_go_web/src/views/ops/machine/MachineList.vue index 540d571c..70edd3e8 100644 --- a/mayfly_go_web/src/views/ops/machine/MachineList.vue +++ b/mayfly_go_web/src/views/ops/machine/MachineList.vue @@ -4,19 +4,19 @@ ref="pageTableRef" :page-api="machineApi.list" :before-query-fn="checkRouteTagPath" - :query="queryConfig" + :search-items="searchItems" v-model:query-form="params" :show-selection="true" v-model:selection-data="state.selectionData" :columns="columns" > - + - + 添加 删除 @@ -190,11 +190,12 @@ import { machineApi, getMachineTerminalSocketUrl } from './api'; import { dateFormat } from '@/common/utils/date'; import ResourceTag from '../component/ResourceTag.vue'; import PageTable from '@/components/pagetable/PageTable.vue'; -import { TableColumn, TableQuery } from '@/components/pagetable'; +import { TableColumn } from '@/components/pagetable'; import { hasPerms } from '@/components/auth/auth'; import { formatByteSize } from '@/common/utils/format'; import { tagApi } from '../tag/api'; import { TagResourceTypeEnum } from '@/common/commonEnum'; +import { SearchItem } from '@/components/SearchForm'; // 组件 const TerminalDialog = defineAsyncComponent(() => import('@/components/terminal/TerminalDialog.vue')); @@ -218,9 +219,9 @@ const perms = { closeCli: 'machine:close-cli', }; -const queryConfig = [TableQuery.slot('tagPath', '标签', 'tagPathSelect'), TableQuery.text('ip', 'IP'), TableQuery.text('name', '名称')]; +const searchItems = [SearchItem.slot('tagPath', '标签', 'tagPathSelect'), SearchItem.text('ip', 'IP'), SearchItem.text('name', '名称')]; -const columns = ref([ +const columns = [ TableColumn.new('name', '名称'), TableColumn.new('ipPort', 'ip:port').isSlot().setAddWidth(50), TableColumn.new('stat', '运行状态').isSlot().setAddWidth(50), @@ -230,7 +231,7 @@ const columns = ref([ TableColumn.new('tagPath', '关联标签').isSlot().setAddWidth(10).alignCenter(), TableColumn.new('remark', '备注'), TableColumn.new('action', '操作').isSlot().setMinWidth(238).fixedRight().alignCenter(), -]); +]; // 该用户拥有的的操作列按钮权限,使用v-if进行判断,v-auth对el-dropdown-item无效 const actionBtns = hasPerms([perms.updateMachine, perms.closeCli]); diff --git a/mayfly_go_web/src/views/ops/machine/ScriptManage.vue b/mayfly_go_web/src/views/ops/machine/ScriptManage.vue index fcdf7637..ca366d4b 100644 --- a/mayfly_go_web/src/views/ops/machine/ScriptManage.vue +++ b/mayfly_go_web/src/views/ops/machine/ScriptManage.vue @@ -14,13 +14,13 @@ :page-api="machineApi.scripts" :before-query-fn="checkScriptType" :lazy="true" - :query="queryConfig" + :search-items="state.searchItems" v-model:query-form="query" :columns="columns" :show-selection="true" v-model:selection-data="selectionData" > - + 添加 = ref(null); const state = reactive({ dialogVisible: false, selectionData: [], - queryConfig: [TableQuery.select('type', '类型').setOptions(Object.values(ScriptTypeEnum))], + searchItems: [SearchItem.select('type', '类型').withEnum(ScriptTypeEnum)], columns: [ TableColumn.new('name', '名称'), TableColumn.new('description', '描述'), @@ -129,8 +130,6 @@ const state = reactive({ title: '', machineId: 9999999, }, - total: 0, - scriptTable: [], scriptParamsDialog: { script: null, visible: false, @@ -148,7 +147,7 @@ const state = reactive({ }, }); -const { dialogVisible, queryConfig, columns, selectionData, query, editDialog, scriptParamsDialog, resultDialog, terminalDialog } = toRefs(state); +const { dialogVisible, columns, selectionData, query, editDialog, scriptParamsDialog, resultDialog, terminalDialog } = toRefs(state); watch(props, async (newValue) => { state.dialogVisible = newValue.visible; @@ -281,7 +280,6 @@ const handleClose = () => { emit('update:machineId', null); emit('cancel'); state.query.type = ScriptTypeEnum.Private.value; - state.scriptTable = []; state.scriptParamsDialog.paramsFormItem = []; }; diff --git a/mayfly_go_web/src/views/ops/machine/authcert/AuthCertList.vue b/mayfly_go_web/src/views/ops/machine/authcert/AuthCertList.vue index 232fdbbd..2a396e9c 100755 --- a/mayfly_go_web/src/views/ops/machine/authcert/AuthCertList.vue +++ b/mayfly_go_web/src/views/ops/machine/authcert/AuthCertList.vue @@ -3,13 +3,13 @@ - + 添加 删除 @@ -29,8 +29,9 @@ import AuthCertEdit from './AuthCertEdit.vue'; import { authCertApi } from '../api'; import { ElMessage, ElMessageBox } from 'element-plus'; import PageTable from '@/components/pagetable/PageTable.vue'; -import { TableColumn, TableQuery } from '@/components/pagetable'; +import { TableColumn } from '@/components/pagetable'; import { AuthMethodEnum } from '../enums'; +import { SearchItem } from '@/components/SearchForm'; const pageTableRef: Ref = ref(null); const state = reactive({ @@ -39,7 +40,7 @@ const state = reactive({ pageSize: 0, name: null, }, - queryConfig: [TableQuery.text('name', '凭证名称')], + searchItems: [SearchItem.text('name', '凭证名称')], columns: [ TableColumn.new('name', '名称'), TableColumn.new('authMethod', '认证方式').typeTag(AuthMethodEnum), @@ -50,8 +51,6 @@ const state = reactive({ TableColumn.new('createTime', '修改时间').isTime(), TableColumn.new('action', '操作').isSlot().fixedRight().setMinWidth(65).alignCenter(), ], - total: 0, - authcerts: [], selectionData: [], paramsDialog: { visible: false, diff --git a/mayfly_go_web/src/views/ops/machine/cronjob/CronJobExecList.vue b/mayfly_go_web/src/views/ops/machine/cronjob/CronJobExecList.vue index bb6853bf..61664d42 100644 --- a/mayfly_go_web/src/views/ops/machine/cronjob/CronJobExecList.vue +++ b/mayfly_go_web/src/views/ops/machine/cronjob/CronJobExecList.vue @@ -15,13 +15,13 @@ :page-api="cronJobApi.execList" :lazy="true" :data-handler-fn="parseData" - :query="queryConfig" + :search-items="searchItems" v-model:query-form="params" :data="state.data.list" :columns="columns" > - + {{ ac.ip }} @@ -38,8 +38,9 @@ import { watch, ref, toRefs, reactive, Ref } from 'vue'; import { cronJobApi, machineApi } from '../api'; import PageTable from '@/components/pagetable/PageTable.vue'; -import { TableColumn, TableQuery } from '@/components/pagetable'; +import { TableColumn } from '@/components/pagetable'; import { CronJobExecStatusEnum } from '../enums'; +import { SearchItem } from '@/components/SearchForm'; const props = defineProps({ visible: { @@ -55,9 +56,9 @@ const props = defineProps({ const emit = defineEmits(['update:visible', 'update:data', 'cancel']); -const queryConfig = [ - TableQuery.slot('machineId', '机器', 'machineSelect'), - TableQuery.select('status', '状态').setOptions(Object.values(CronJobExecStatusEnum)), +const searchItems = [ + SearchItem.slot('machineId', '机器', 'machineSelect'), + SearchItem.select('status', '状态').setOptions(Object.values(CronJobExecStatusEnum)), ]; const columns = ref([ diff --git a/mayfly_go_web/src/views/ops/machine/cronjob/CronJobList.vue b/mayfly_go_web/src/views/ops/machine/cronjob/CronJobList.vue index 530ceb44..0ac7602d 100644 --- a/mayfly_go_web/src/views/ops/machine/cronjob/CronJobList.vue +++ b/mayfly_go_web/src/views/ops/machine/cronjob/CronJobList.vue @@ -3,13 +3,13 @@ - + 添加 删除 @@ -38,8 +38,9 @@ import { ref, toRefs, reactive, onMounted, defineAsyncComponent, Ref } from 'vue import { ElMessage, ElMessageBox } from 'element-plus'; import { cronJobApi } from '../api'; import PageTable from '@/components/pagetable/PageTable.vue'; -import { TableColumn, TableQuery } from '@/components/pagetable'; +import { TableColumn } from '@/components/pagetable'; import { CronJobStatusEnum, CronJobSaveExecResTypeEnum } from '../enums'; +import { SearchItem } from '@/components/SearchForm'; const CronJobEdit = defineAsyncComponent(() => import('./CronJobEdit.vue')); const CronJobExecList = defineAsyncComponent(() => import('./CronJobExecList.vue')); @@ -49,7 +50,7 @@ const perms = { delCronJob: 'machine:cronjob:del', }; -const queryConfig = [TableQuery.text('name', '名称'), TableQuery.select('status', '状态').setOptions(Object.values(CronJobStatusEnum))]; +const searchItems = [SearchItem.text('name', '名称'), SearchItem.select('status', '状态').withEnum(CronJobStatusEnum)]; const columns = ref([ TableColumn.new('key', 'key'), diff --git a/mayfly_go_web/src/views/ops/mongo/MongoList.vue b/mayfly_go_web/src/views/ops/mongo/MongoList.vue index de8c849e..e1d9cc0e 100644 --- a/mayfly_go_web/src/views/ops/mongo/MongoList.vue +++ b/mayfly_go_web/src/views/ops/mongo/MongoList.vue @@ -4,19 +4,19 @@ ref="pageTableRef" :page-api="mongoApi.mongoList" :before-query-fn="checkRouteTagPath" - :query="queryConfig" + :search-items="searchItems" v-model:query-form="query" :show-selection="true" v-model:selection-data="selectionData" :columns="columns" > - + - + 添加 删除 @@ -53,10 +53,11 @@ import { defineAsyncComponent, ref, toRefs, reactive, onMounted, Ref } from 'vue import { ElMessage, ElMessageBox } from 'element-plus'; import ResourceTag from '../component/ResourceTag.vue'; import PageTable from '@/components/pagetable/PageTable.vue'; -import { TableColumn, TableQuery } from '@/components/pagetable'; +import { TableColumn } from '@/components/pagetable'; import { TagResourceTypeEnum } from '@/common/commonEnum'; import { tagApi } from '../tag/api'; import { useRoute } from 'vue-router'; +import { SearchItem } from '@/components/SearchForm'; const MongoEdit = defineAsyncComponent(() => import('./MongoEdit.vue')); const MongoDbs = defineAsyncComponent(() => import('./MongoDbs.vue')); @@ -65,15 +66,15 @@ const MongoRunCommand = defineAsyncComponent(() => import('./MongoRunCommand.vue const route = useRoute(); const pageTableRef: Ref = ref(null); -const queryConfig = [TableQuery.slot('tagPath', '标签', 'tagPathSelect')]; -const columns = ref([ +const searchItems = [SearchItem.slot('tagPath', '标签', 'tagPathSelect')]; +const columns = [ TableColumn.new('name', '名称'), TableColumn.new('uri', '连接uri'), TableColumn.new('tagPath', '关联标签').isSlot().setAddWidth(20).alignCenter(), TableColumn.new('createTime', '创建时间').isTime(), TableColumn.new('creator', '创建人'), TableColumn.new('action', '操作').isSlot().setMinWidth(170).fixedRight().alignCenter(), -]); +]; const state = reactive({ tags: [], diff --git a/mayfly_go_web/src/views/ops/redis/RedisList.vue b/mayfly_go_web/src/views/ops/redis/RedisList.vue index 50c573a2..c5eeca1d 100644 --- a/mayfly_go_web/src/views/ops/redis/RedisList.vue +++ b/mayfly_go_web/src/views/ops/redis/RedisList.vue @@ -4,19 +4,19 @@ ref="pageTableRef" :page-api="redisApi.redisList" :before-query-fn="checkRouteTagPath" - :query="queryConfig" + :searchItems="searchItems" v-model:query-form="query" :show-selection="true" v-model:selection-data="selectionData" :columns="columns" > - + - + 添加 删除 @@ -163,15 +163,16 @@ import RedisEdit from './RedisEdit.vue'; import { dateFormat } from '@/common/utils/date'; import ResourceTag from '../component/ResourceTag.vue'; import PageTable from '@/components/pagetable/PageTable.vue'; -import { TableColumn, TableQuery } from '@/components/pagetable'; +import { TableColumn } from '@/components/pagetable'; import { tagApi } from '../tag/api'; import { TagResourceTypeEnum } from '@/common/commonEnum'; import { useRoute } from 'vue-router'; +import { SearchItem } from '@/components/SearchForm'; const route = useRoute(); const pageTableRef: Ref = ref(null); -const queryConfig = [TableQuery.slot('tagPath', '标签', 'tagPathSelect')]; +const searchItems = [SearchItem.slot('tagPath', '标签', 'tagPathSelect')]; const columns = ref([ TableColumn.new('name', '名称'), TableColumn.new('host', 'host:port'), diff --git a/mayfly_go_web/src/views/ops/tag/TeamList.vue b/mayfly_go_web/src/views/ops/tag/TeamList.vue index 69e106e9..09ceb1bd 100755 --- a/mayfly_go_web/src/views/ops/tag/TeamList.vue +++ b/mayfly_go_web/src/views/ops/tag/TeamList.vue @@ -3,13 +3,13 @@ - + 添加 删除 @@ -91,11 +91,11 @@ ref="showMemPageTableRef" :page-api="tagApi.getTeamMem" :lazy="true" - :query="showMemDialog.queryConfig" + :search-items="showMemDialog.searchItems" v-model:query-form="showMemDialog.query" :columns="showMemDialog.columns" > - + 添加 @@ -139,13 +139,23 @@ import { accountApi } from '../../system/api'; import { ElMessage, ElMessageBox } from 'element-plus'; import { notBlank } from '@/common/assert'; import PageTable from '@/components/pagetable/PageTable.vue'; -import { TableColumn, TableQuery } from '@/components/pagetable'; +import { TableColumn } from '@/components/pagetable'; +import { SearchItem } from '@/components/SearchForm'; const teamForm: any = ref(null); const tagTreeRef: any = ref(null); const pageTableRef: Ref = ref(null); const showMemPageTableRef: Ref = ref(null); +const searchItems = [SearchItem.text('name', '团队名称')]; +const columns = [ + TableColumn.new('name', '团队名称'), + TableColumn.new('remark', '备注'), + TableColumn.new('createTime', '创建时间').isTime(), + TableColumn.new('creator', '创建人'), + TableColumn.new('action', '操作').isSlot().setMinWidth(120).fixedRight().alignCenter(), +]; + const state = reactive({ currentEditPermissions: false, addTeamDialog: { @@ -158,17 +168,9 @@ const state = reactive({ pageSize: 0, name: null, }, - queryConfig: [TableQuery.text('name', '团队名称')], - columns: [ - TableColumn.new('name', '团队名称'), - TableColumn.new('remark', '备注'), - TableColumn.new('createTime', '创建时间').isTime(), - TableColumn.new('creator', '创建人'), - TableColumn.new('action', '操作').isSlot().setMinWidth(120).fixedRight().alignCenter(), - ], selectionData: [], showMemDialog: { - queryConfig: [TableQuery.text('username', '用户名')], + searchItems: [SearchItem.text('username', '用户名').withSpan(2)], columns: [ TableColumn.new('name', '姓名'), TableColumn.new('username', '账号'), diff --git a/mayfly_go_web/src/views/system/account/AccountList.vue b/mayfly_go_web/src/views/system/account/AccountList.vue index e34f8ac3..54107906 100755 --- a/mayfly_go_web/src/views/system/account/AccountList.vue +++ b/mayfly_go_web/src/views/system/account/AccountList.vue @@ -3,13 +3,13 @@ - + 添加 删除 { if (Object.keys(actionBtns).length > 0) { - columns.value.push(actionColumn); + columns.push(actionColumn); } }); diff --git a/mayfly_go_web/src/views/system/config/ConfigList.vue b/mayfly_go_web/src/views/system/config/ConfigList.vue index e4add04d..d74bd476 100755 --- a/mayfly_go_web/src/views/system/config/ConfigList.vue +++ b/mayfly_go_web/src/views/system/config/ConfigList.vue @@ -1,7 +1,7 @@ - + 添加 diff --git a/mayfly_go_web/src/views/system/role/RoleList.vue b/mayfly_go_web/src/views/system/role/RoleList.vue index 5d705183..e02d03e2 100755 --- a/mayfly_go_web/src/views/system/role/RoleList.vue +++ b/mayfly_go_web/src/views/system/role/RoleList.vue @@ -1,7 +1,7 @@ - + 添加 删除 - + - + @@ -22,13 +14,14 @@ import { toRefs, reactive } from 'vue'; import { logApi, accountApi } from '../api'; import PageTable from '@/components/pagetable/PageTable.vue'; -import { TableColumn, TableQuery } from '@/components/pagetable'; +import { TableColumn } from '@/components/pagetable'; import { LogTypeEnum } from '../enums'; +import { SearchItem } from '@/components/SearchForm'; -const queryConfig = [ - TableQuery.slot('creatorId', '操作人', 'selectAccount'), - TableQuery.select('type', '操作结果').setOptions(Object.values(LogTypeEnum)), - TableQuery.text('description', '描述'), +const searchItems = [ + SearchItem.slot('creatorId', '操作人', 'selectAccount'), + SearchItem.select('type', '操作结果').withEnum(LogTypeEnum), + SearchItem.text('description', '描述'), ]; const columns = [ diff --git a/server/pkg/config/app.go b/server/pkg/config/app.go index 0f11c613..4f17443d 100644 --- a/server/pkg/config/app.go +++ b/server/pkg/config/app.go @@ -4,7 +4,7 @@ import "fmt" const ( AppName = "mayfly-go" - Version = "v1.6.0" + Version = "v1.6.1" ) func GetAppInfo() string {