-
+
导出
@@ -13,16 +13,15 @@
-
-
-
+
+
- 取消
+ 取消
确定
@@ -30,7 +29,9 @@
创建表
-
+
+
+
@@ -161,8 +162,8 @@ const state = reactive({
tables: [],
tableNameSearch: '',
tableCommentSearch: '',
- showDumpInfo: false,
dumpInfo: {
+ visible: false,
id: 0,
db: '',
type: 3,
@@ -201,19 +202,7 @@ const state = reactive({
},
});
-const {
- loading,
- tables,
- tableNameSearch,
- tableCommentSearch,
- showDumpInfo,
- dumpInfo,
- chooseTableName,
- columnDialog,
- indexDialog,
- ddlDialog,
- tableCreateDialog,
-} = toRefs(state);
+const { loading, tableNameSearch, tableCommentSearch, dumpInfo, chooseTableName, columnDialog, indexDialog, ddlDialog, tableCreateDialog } = toRefs(state);
onMounted(async () => {
getTables();
@@ -259,21 +248,22 @@ const getTables = async () => {
* 选择导出数据库表
*/
const handleDumpTableSelectionChange = (vals: any) => {
- state.dumpInfo.tables = vals.map((x: any) => x.tableName);
+ state.dumpInfo.tables = vals;
};
/**
* 数据库信息导出
*/
const dump = (db: string) => {
- isTrue(state.dumpInfo.tables.length > 0, '请选择要导出的表');
+ isTrue(state.dumpInfo.tables.length > 0, '请先选择要导出的表');
+ const tableNames = state.dumpInfo.tables.map((x: any) => x.tableName);
const a = document.createElement('a');
a.setAttribute(
'href',
- `${config.baseApiUrl}/dbs/${props.dbId}/dump?db=${db}&type=${state.dumpInfo.type}&tables=${state.dumpInfo.tables.join(',')}&${joinClientParams()}`
+ `${config.baseApiUrl}/dbs/${props.dbId}/dump?db=${db}&type=${state.dumpInfo.type}&tables=${tableNames.join(',')}&${joinClientParams()}`
);
a.click();
- state.showDumpInfo = false;
+ state.dumpInfo.visible = false;
};
const showColumns = async (row: any) => {
diff --git a/mayfly_go_web/src/views/ops/db/db.ts b/mayfly_go_web/src/views/ops/db/db.ts
index 96e84e4b..6a3d5319 100644
--- a/mayfly_go_web/src/views/ops/db/db.ts
+++ b/mayfly_go_web/src/views/ops/db/db.ts
@@ -352,7 +352,6 @@ export class DbInst {
* 弹框提示是否执行sql
*/
promptExeSql = (db: string, sql: string, cancelFunc: any = null, successFunc: any = null) => {
- console.log(this);
SqlExecBox({
sql,
dbId: this.id,
diff --git a/mayfly_go_web/src/views/ops/machine/MachineList.vue b/mayfly_go_web/src/views/ops/machine/MachineList.vue
index 2f15e018..d94af0b3 100644
--- a/mayfly_go_web/src/views/ops/machine/MachineList.vue
+++ b/mayfly_go_web/src/views/ops/machine/MachineList.vue
@@ -160,10 +160,10 @@
{{ infoDialog.data.sshTunnelMachineId > 0 ? '是' : '否' }}
{{ infoDialog.data.enableRecorder == 1 ? '是' : '否' }}
- {{ dateFormat(infoDialog.data.createTime) }}
+ {{ formatDate(infoDialog.data.createTime) }}
{{ infoDialog.data.creator }}
- {{ dateFormat(infoDialog.data.updateTime) }}
+ {{ formatDate(infoDialog.data.updateTime) }}
{{ infoDialog.data.modifier }}
@@ -236,12 +236,11 @@ import { defineAsyncComponent, onMounted, reactive, ref, Ref, toRefs } from 'vue
import { useRoute, useRouter } from 'vue-router';
import { ElMessage, ElMessageBox } from 'element-plus';
import { getMachineTerminalSocketUrl, machineApi } from './api';
-import { dateFormat } from '@/common/utils/date';
import ResourceTags from '../component/ResourceTags.vue';
import PageTable from '@/components/pagetable/PageTable.vue';
import { TableColumn } from '@/components/pagetable';
import { hasPerms } from '@/components/auth/auth';
-import { formatByteSize } from '@/common/utils/format';
+import { formatByteSize, formatDate } from '@/common/utils/format';
import { TagResourceTypeEnum } from '@/common/commonEnum';
import { SearchItem } from '@/components/SearchForm';
import { getTagPathSearchItem } from '../component/tag';
diff --git a/mayfly_go_web/src/views/ops/machine/MachineOp.vue b/mayfly_go_web/src/views/ops/machine/MachineOp.vue
index df6a8332..8363859b 100644
--- a/mayfly_go_web/src/views/ops/machine/MachineOp.vue
+++ b/mayfly_go_web/src/views/ops/machine/MachineOp.vue
@@ -103,10 +103,10 @@
{{ infoDialog.data.sshTunnelMachineId > 0 ? '是' : '否' }}
{{ infoDialog.data.enableRecorder == 1 ? '是' : '否' }}
- {{ dateFormat(infoDialog.data.createTime) }}
+ {{ formatDate(infoDialog.data.createTime) }}
{{ infoDialog.data.creator }}
- {{ dateFormat(infoDialog.data.updateTime) }}
+ {{ formatDate(infoDialog.data.updateTime) }}
{{ infoDialog.data.modifier }}
@@ -157,7 +157,7 @@
import { defineAsyncComponent, nextTick, onMounted, reactive, ref, toRefs, watch } from 'vue';
import { useRouter } from 'vue-router';
import { getMachineTerminalSocketUrl, machineApi } from './api';
-import { dateFormat } from '@/common/utils/date';
+import { formatDate } from '@/common/utils/format';
import { hasPerms } from '@/components/auth/auth';
import { TagResourceTypeEnum } from '@/common/commonEnum';
import { NodeType, TagTreeNode, getTagTypeCodeByPath } from '../component/tag';
diff --git a/mayfly_go_web/src/views/ops/machine/MachineRec.vue b/mayfly_go_web/src/views/ops/machine/MachineRec.vue
index 789d387b..d5e2f9c8 100644
--- a/mayfly_go_web/src/views/ops/machine/MachineRec.vue
+++ b/mayfly_go_web/src/views/ops/machine/MachineRec.vue
@@ -33,7 +33,7 @@
- {{ dateFormat(new Date(scope.row.time * 1000).toString()) }}
+ {{ formatDate(new Date(scope.row.time * 1000).toString()) }}
@@ -48,7 +48,7 @@ import * as AsciinemaPlayer from 'asciinema-player';
import 'asciinema-player/dist/bundle/asciinema-player.css';
import PageTable from '@/components/pagetable/PageTable.vue';
import { TableColumn } from '@/components/pagetable';
-import { dateFormat } from '@/common/utils/date';
+import { formatDate } from '@/common/utils/format';
const props = defineProps({
visible: { type: Boolean },
@@ -122,8 +122,8 @@ const playRec = async (rec: any) => {
idleTimeLimit: 2,
// fit: false,
// terminalFontSize: 'small',
- cols: 144,
- rows: 32,
+ // cols: 144,
+ // rows: 32,
});
});
} finally {
diff --git a/mayfly_go_web/src/views/ops/redis/RedisList.vue b/mayfly_go_web/src/views/ops/redis/RedisList.vue
index 85273e2a..db49a7db 100644
--- a/mayfly_go_web/src/views/ops/redis/RedisList.vue
+++ b/mayfly_go_web/src/views/ops/redis/RedisList.vue
@@ -130,10 +130,10 @@
{{ detailDialog.data.remark }}
{{ detailDialog.data.sshTunnelMachineId > 0 ? '是' : '否' }}
- {{ dateFormat(detailDialog.data.createTime) }}
+ {{ formatDate(detailDialog.data.createTime) }}
{{ detailDialog.data.creator }}
- {{ dateFormat(detailDialog.data.updateTime) }}
+ {{ formatDate(detailDialog.data.updateTime) }}
{{ detailDialog.data.modifier }}
@@ -153,7 +153,7 @@ import { redisApi } from './api';
import { onMounted, reactive, ref, Ref, toRefs } from 'vue';
import { ElMessage, ElMessageBox } from 'element-plus';
import RedisEdit from './RedisEdit.vue';
-import { dateFormat } from '@/common/utils/date';
+import { formatDate } from '@/common/utils/format';
import ResourceTags from '../component/ResourceTags.vue';
import PageTable from '@/components/pagetable/PageTable.vue';
import { TableColumn } from '@/components/pagetable';
diff --git a/mayfly_go_web/src/views/ops/tag/TagTreeList.vue b/mayfly_go_web/src/views/ops/tag/TagTreeList.vue
index 527f5128..e015c316 100644
--- a/mayfly_go_web/src/views/ops/tag/TagTreeList.vue
+++ b/mayfly_go_web/src/views/ops/tag/TagTreeList.vue
@@ -82,9 +82,9 @@
{{ currentTag.remark }}
{{ currentTag.creator }}
- {{ dateFormat(currentTag.createTime) }}
+ {{ formatDate(currentTag.createTime) }}
{{ currentTag.modifier }}
- {{ dateFormat(currentTag.updateTime) }}
+ {{ formatDate(currentTag.updateTime) }}
@@ -148,7 +148,7 @@
import { toRefs, ref, watch, reactive, onMounted, Ref, defineAsyncComponent } from 'vue';
import { ElMessage, ElMessageBox } from 'element-plus';
import { tagApi } from './api';
-import { dateFormat } from '@/common/utils/date';
+import { formatDate } from '@/common/utils/format';
import { Contextmenu, ContextmenuItem } from '@/components/contextmenu/index';
import { useUserInfo } from '@/store/userInfo';
import { Splitpanes, Pane } from 'splitpanes';
diff --git a/mayfly_go_web/src/views/ops/tag/TeamList.vue b/mayfly_go_web/src/views/ops/tag/TeamList.vue
index 0eca6eb6..6eb2463d 100755
--- a/mayfly_go_web/src/views/ops/tag/TeamList.vue
+++ b/mayfly_go_web/src/views/ops/tag/TeamList.vue
@@ -18,6 +18,8 @@
+ {{ data.validityStartDate }} ~ {{ data.validityEndDate }}
+
成员
@@ -40,12 +42,26 @@
+
+
+
+
+
-
+
@@ -101,6 +117,7 @@ import AccountSelectFormItem from '@/views/system/account/components/AccountSele
import DrawerHeader from '@/components/drawer-header/DrawerHeader.vue';
import TagTreeCheck from '../component/TagTreeCheck.vue';
import TagCodePath from '../component/TagCodePath.vue';
+import { formatDate } from '@/common/utils/format';
const teamForm: any = ref(null);
const pageTableRef: Ref = ref(null);
@@ -114,13 +131,21 @@ const teamFormRules = {
trigger: ['change', 'blur'],
},
],
+ validityDate: [
+ {
+ required: true,
+ message: '请选择生效时间',
+ trigger: ['change', 'blur'],
+ },
+ ],
};
const searchItems = [SearchItem.input('name', '团队名称')];
const columns = [
TableColumn.new('name', '团队名称'),
- TableColumn.new('remark', '备注'),
TableColumn.new('tags', '分配标签').isSlot().setAddWidth(40),
+ TableColumn.new('validityDate', '有效期').isSlot('validityDate').setMinWidth(310),
+ TableColumn.new('remark', '备注'),
TableColumn.new('creator', '创建者'),
TableColumn.new('createTime', '创建时间').isTime(),
TableColumn.new('modifier', '修改者'),
@@ -132,7 +157,7 @@ const state = reactive({
currentEditPermissions: false,
addTeamDialog: {
visible: false,
- form: { id: 0, name: '', remark: '', codePaths: [] },
+ form: { id: 0, name: '', validityDate: ['', ''], validityStartDate: '', validityEndDate: '', remark: '', codePaths: [] },
},
query: {
pageNum: 1,
@@ -182,24 +207,33 @@ const showSaveTeamDialog = async (data: any) => {
if (data) {
state.addTeamDialog.form.id = data.id;
state.addTeamDialog.form.name = data.name;
+ state.addTeamDialog.form.validityDate = [data.validityStartDate, data.validityEndDate];
state.addTeamDialog.form.remark = data.remark;
state.addTeamDialog.form.codePaths = data.tags?.map((tag: any) => tag.codePath);
- // state.addTeamDialog.form.tags = await tagApi.getRelateTagIds.request({ relateType: TagTreeRelateTypeEnum.Team.value, relateId: data.id });
+ } else {
+ let end = new Date();
+ end.setFullYear(end.getFullYear() + 10);
+ state.addTeamDialog.form.validityDate = [formatDate(new Date()), formatDate(end)];
}
state.addTeamDialog.visible = true;
};
const saveTeam = async () => {
- teamForm.value.validate(async (valid: any) => {
- if (valid) {
- const form = state.addTeamDialog.form;
- await tagApi.saveTeam.request(form);
- ElMessage.success('保存成功');
- search();
- cancelSaveTeam();
- }
- });
+ try {
+ await teamForm.value.validate();
+ } catch (e: any) {
+ ElMessage.error('请正确填写信息');
+ return false;
+ }
+
+ const form = state.addTeamDialog.form;
+ form.validityStartDate = form.validityDate[0];
+ form.validityEndDate = form.validityDate[1];
+ await tagApi.saveTeam.request(form);
+ ElMessage.success('保存成功');
+ search();
+ cancelSaveTeam();
};
const cancelSaveTeam = () => {
diff --git a/mayfly_go_web/src/views/system/account/AccountList.vue b/mayfly_go_web/src/views/system/account/AccountList.vue
index bc40cf26..f693a6fe 100755
--- a/mayfly_go_web/src/views/system/account/AccountList.vue
+++ b/mayfly_go_web/src/views/system/account/AccountList.vue
@@ -42,7 +42,7 @@
- {{ dateFormat(scope.row.createTime) }}
+ {{ formatDate(scope.row.createTime) }}
@@ -60,7 +60,7 @@ import AccountEdit from './AccountEdit.vue';
import { AccountStatusEnum } from '../enums';
import { accountApi } from '../api';
import { ElMessage, ElMessageBox } from 'element-plus';
-import { dateFormat } from '@/common/utils/date';
+import { formatDate } from '@/common/utils/format';
import PageTable from '@/components/pagetable/PageTable.vue';
import { TableColumn } from '@/components/pagetable';
import { hasPerms } from '@/components/auth/auth';
diff --git a/mayfly_go_web/src/views/system/resource/ResourceList.vue b/mayfly_go_web/src/views/system/resource/ResourceList.vue
index 6fbe9437..cedad989 100644
--- a/mayfly_go_web/src/views/system/resource/ResourceList.vue
+++ b/mayfly_go_web/src/views/system/resource/ResourceList.vue
@@ -89,9 +89,9 @@
{{ currentResource.creator }}
-
{{ dateFormat(currentResource.createTime) }}
+
{{ formatDate(currentResource.createTime) }}
{{ currentResource.modifier }}
-
{{ dateFormat(currentResource.updateTime) }}
+
{{ formatDate(currentResource.updateTime) }}
@@ -119,7 +119,7 @@ import { ElMessage, ElMessageBox } from 'element-plus';
import ResourceEdit from './ResourceEdit.vue';
import { ResourceTypeEnum } from '../enums';
import { resourceApi } from '../api';
-import { dateFormat } from '@/common/utils/date';
+import { formatDate } from '@/common/utils/format';
import EnumTag from '@/components/enumtag/EnumTag.vue';
import { Contextmenu, ContextmenuItem } from '@/components/contextmenu';
import { Splitpanes, Pane } from 'splitpanes';
diff --git a/mayfly_go_web/src/views/system/role/ShowResource.vue b/mayfly_go_web/src/views/system/role/ShowResource.vue
index a504530d..ec497195 100644
--- a/mayfly_go_web/src/views/system/role/ShowResource.vue
+++ b/mayfly_go_web/src/views/system/role/ShowResource.vue
@@ -20,7 +20,7 @@
{{ data.creator }}
- {{ dateFormat(data.createTime) }}
+ {{ formatDate(data.createTime) }}
@@ -35,7 +35,7 @@