mirror of
https://github.com/bufanyun/hotgo.git
synced 2026-04-26 13:04:32 +08:00
发布v2.15.1版本,更新内容请查看:https://github.com/bufanyun/hotgo/blob/v2.0/docs/guide-zh-CN/start-update-log.md
This commit is contained in:
@@ -68,7 +68,7 @@
|
||||
/>
|
||||
</n-form-item>
|
||||
|
||||
<n-form-item label="默认注册岗位" path="loginPostIds">
|
||||
<n-form-item label="默认注册岗位(非必选)" path="loginPostIds">
|
||||
<n-select v-model:value="formValue.loginPostIds" multiple :options="options.post" />
|
||||
</n-form-item>
|
||||
|
||||
@@ -182,22 +182,17 @@
|
||||
|
||||
function load() {
|
||||
show.value = true;
|
||||
new Promise((_resolve, _reject) => {
|
||||
getConfig({ group: group.value })
|
||||
.then((res) => {
|
||||
show.value = false;
|
||||
formValue.value = res.list;
|
||||
})
|
||||
.catch((error) => {
|
||||
show.value = false;
|
||||
message.error(error.toString());
|
||||
});
|
||||
});
|
||||
getConfig({ group: group.value })
|
||||
.then((res) => {
|
||||
formValue.value = res.list;
|
||||
})
|
||||
.finally(() => {
|
||||
show.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(async () => {
|
||||
show.value = true;
|
||||
await loadOptions();
|
||||
load();
|
||||
await loadOptions();
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -12,18 +12,22 @@ export const columns = [
|
||||
{
|
||||
title: 'ID',
|
||||
key: 'id',
|
||||
width: 80,
|
||||
},
|
||||
{
|
||||
title: '任务标题',
|
||||
key: 'title',
|
||||
width: 150,
|
||||
},
|
||||
{
|
||||
title: '任务分组',
|
||||
key: 'groupName',
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '执行方法',
|
||||
key: 'name',
|
||||
width: 100,
|
||||
},
|
||||
// {
|
||||
// title: '执行参数',
|
||||
@@ -50,10 +54,12 @@ export const columns = [
|
||||
}
|
||||
);
|
||||
},
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '表达式',
|
||||
key: 'pattern',
|
||||
width: 150,
|
||||
},
|
||||
// {
|
||||
// title: '执行次数',
|
||||
@@ -77,9 +83,11 @@ export const columns = [
|
||||
}
|
||||
);
|
||||
},
|
||||
width: 100,
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
key: 'createdAt',
|
||||
width: 180,
|
||||
},
|
||||
];
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
ref="actionRef"
|
||||
:actionColumn="actionColumn"
|
||||
@update:checked-row-keys="onCheckedRow"
|
||||
:scroll-x="1090"
|
||||
:scroll-x="scrollX"
|
||||
:resizeHeightOffset="-10000"
|
||||
>
|
||||
<template #tableTitle>
|
||||
<n-button type="primary" @click="addTable">
|
||||
@@ -181,7 +182,7 @@
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { h, reactive, ref, onBeforeMount } from 'vue';
|
||||
import { h, reactive, ref, onBeforeMount, computed } from 'vue';
|
||||
import { useDialog, useMessage } from 'naive-ui';
|
||||
import { BasicTable, TableAction } from '@/components/Table';
|
||||
import { BasicForm, FormSchema, useForm } from '@/components/Form/index';
|
||||
@@ -189,6 +190,7 @@
|
||||
import { columns } from './columns';
|
||||
import { DeleteOutlined, GroupOutlined, PlusOutlined } from '@vicons/antd';
|
||||
import GroupModal from './modal/modal.vue';
|
||||
import { adaTableScrollX } from '@/utils/hotgo';
|
||||
|
||||
const optionTreeData = ref<any>([]);
|
||||
const defaultValueRef = () => ({
|
||||
@@ -335,7 +337,7 @@
|
||||
width: 320,
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
// fixed: 'right',
|
||||
fixed: 'right',
|
||||
render(record) {
|
||||
return h(TableAction as any, {
|
||||
style: 'button',
|
||||
@@ -370,6 +372,10 @@
|
||||
},
|
||||
});
|
||||
|
||||
const scrollX = computed(() => {
|
||||
return adaTableScrollX(columns, actionColumn.width);
|
||||
});
|
||||
|
||||
const [register, {}] = useForm({
|
||||
gridProps: { cols: '1 s:1 m:2 l:3 xl:4 2xl:4' },
|
||||
labelWidth: 80,
|
||||
|
||||
@@ -3,7 +3,7 @@ import { NTag } from 'naive-ui';
|
||||
|
||||
export const columns = [
|
||||
{
|
||||
title: 'id',
|
||||
title: '字典ID',
|
||||
key: 'id',
|
||||
},
|
||||
{
|
||||
|
||||
@@ -126,7 +126,6 @@
|
||||
SearchOutlined,
|
||||
DeleteOutlined,
|
||||
} from '@vicons/antd';
|
||||
import { getTreeItem } from '@/utils';
|
||||
import CreateDrawer from './CreateDrawer.vue';
|
||||
import List from './list.vue';
|
||||
import { DeleteDict, getDictTree } from '@/api/dict/dict';
|
||||
@@ -143,16 +142,7 @@
|
||||
const checkedId = ref(0);
|
||||
const pattern = ref('');
|
||||
const drawerTitle = ref('');
|
||||
const optionTreeData = ref([
|
||||
{
|
||||
id: 0,
|
||||
key: 0,
|
||||
label: '根目录',
|
||||
pid: 0,
|
||||
title: '根目录',
|
||||
type: 1,
|
||||
},
|
||||
]);
|
||||
const optionTreeData = ref([]);
|
||||
const defaultValueRef = () => ({
|
||||
id: 0,
|
||||
pid: 0,
|
||||
@@ -177,10 +167,9 @@
|
||||
openDrawer(formParams);
|
||||
}
|
||||
|
||||
function selectedTree(keys) {
|
||||
function selectedTree(keys, opts) {
|
||||
if (keys.length) {
|
||||
const treeItem = getTreeItem(unref(treeData), keys[0]);
|
||||
// console.log('选择treeItem:' + JSON.stringify(treeItem));
|
||||
const treeItem = opts[0];
|
||||
treeItemKey.value = keys;
|
||||
treeItemTitle.value = treeItem.label;
|
||||
Object.assign(formParams, treeItem);
|
||||
@@ -200,15 +189,10 @@
|
||||
positiveText: '确定',
|
||||
negativeText: '取消',
|
||||
onPositiveClick: () => {
|
||||
DeleteDict({ ...formParams })
|
||||
.then(async (_res) => {
|
||||
message.success('操作成功');
|
||||
// handleReset();
|
||||
await loadData();
|
||||
})
|
||||
.catch((_e: Error) => {
|
||||
// message.error(e.message ?? '操作失败');
|
||||
});
|
||||
DeleteDict({ ...formParams }).then(async (_res) => {
|
||||
message.success('操作成功');
|
||||
await loadData();
|
||||
});
|
||||
},
|
||||
onNegativeClick: () => {
|
||||
message.error('已取消');
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { h, reactive, ref, watch, onMounted } from 'vue';
|
||||
import { TreeSelectOption, useMessage, useDialog, NTag, SelectRenderTag } from 'naive-ui';
|
||||
import { useMessage, useDialog, NTag, SelectRenderTag } from 'naive-ui';
|
||||
import { BasicTable, TableAction } from '@/components/Table';
|
||||
import { BasicForm, FormSchema, useForm } from '@/components/Form/index';
|
||||
import { getDataList, getDictSelect, EditData, DeleteData } from '@/api/dict/dict';
|
||||
@@ -106,9 +106,10 @@
|
||||
import { statusOptions } from '@/enums/optionsiEnum';
|
||||
import { TypeSelect } from '@/api/sys/config';
|
||||
import { Option } from '@/utils/hotgo';
|
||||
import { findTreeDataById } from '@/utils';
|
||||
import { findTreeNode } from '@/utils';
|
||||
import { cloneDeep } from 'lodash-es';
|
||||
const options = ref<Option>();
|
||||
import { defRangeShortcuts } from '@/utils/dateUtil';
|
||||
|
||||
interface Props {
|
||||
checkedId?: number;
|
||||
}
|
||||
@@ -132,15 +133,28 @@
|
||||
{
|
||||
field: 'label',
|
||||
component: 'NInput',
|
||||
label: '标签',
|
||||
label: '字典标签',
|
||||
componentProps: {
|
||||
placeholder: '请输入标签名称',
|
||||
placeholder: '请输入字典标签',
|
||||
onInput: (e: any) => {
|
||||
console.log(e);
|
||||
params.value.label = e;
|
||||
},
|
||||
},
|
||||
rules: [{ message: '请输入字典标签名称', trigger: ['blur'] }],
|
||||
rules: [{ message: '请输入字典标签', trigger: ['blur'] }],
|
||||
},
|
||||
{
|
||||
field: 'value',
|
||||
component: 'NInput',
|
||||
label: '字典键值',
|
||||
componentProps: {
|
||||
placeholder: '请输入字典键值',
|
||||
onInput: (e: any) => {
|
||||
console.log(e);
|
||||
params.value.value = e;
|
||||
},
|
||||
},
|
||||
rules: [{ message: '请输入字典键值', trigger: ['blur'] }],
|
||||
},
|
||||
];
|
||||
|
||||
@@ -194,17 +208,19 @@
|
||||
const showModal = ref(false);
|
||||
const formBtnLoading = ref(false);
|
||||
const formParams = ref<any>({ typeId: 0 });
|
||||
const options = ref<Option>();
|
||||
const params = ref({
|
||||
pageSize: 10,
|
||||
typeId: props.checkedId,
|
||||
label: '',
|
||||
value: '',
|
||||
});
|
||||
|
||||
const actionColumn = reactive({
|
||||
width: 220,
|
||||
width: 120,
|
||||
title: '操作',
|
||||
key: 'action',
|
||||
// fixed: 'right',
|
||||
fixed: 'right',
|
||||
render(record) {
|
||||
return h(TableAction as any, {
|
||||
style: 'button',
|
||||
@@ -223,7 +239,7 @@
|
||||
});
|
||||
|
||||
const [register, {}] = useForm({
|
||||
gridProps: { cols: '1 s:1 m:1 l:2 xl:2 2xl:2' },
|
||||
gridProps: { cols: '1 s:1 m:2 l:3 xl:4 2xl:4' },
|
||||
labelWidth: 80,
|
||||
schemas,
|
||||
});
|
||||
@@ -286,9 +302,6 @@
|
||||
reloadTable();
|
||||
});
|
||||
},
|
||||
onNegativeClick: () => {
|
||||
// message.error('取消');
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -322,7 +335,7 @@
|
||||
}
|
||||
|
||||
function handleUpdateTypeIdValue(value) {
|
||||
const row = findTreeDataById(typeList.value, value);
|
||||
const row = findTreeNode(typeList.value, value, 'id');
|
||||
if (!row) {
|
||||
message.error('未找到该节点数据');
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user