Commit 19a2fbc9 authored by 陈浩玮's avatar 陈浩玮

参数管理

parent 9b58ab4c
Pipeline #285 failed with stages
in 0 seconds
...@@ -28,6 +28,21 @@ function updateOrgApi(data) { ...@@ -28,6 +28,21 @@ function updateOrgApi(data) {
return putReq('/api/v1/organizations', data); return putReq('/api/v1/organizations', data);
} }
function addBusinessApi(data) {
return postReq('/api/v1/parameters/business', data);
}
function updateBusinessApi(data) {
return putReq('/api/v1/parameters/business', data);
}
function addOperationApi(data) {
return postReq('/api/v1/parameters/operation', data);
}
function updateOperationApi(data) {
return putReq('/api/v1/parameters/operation', data);
}
export default { export default {
addJobs: addJobsApi, addJobs: addJobsApi,
updateJobs: updateJobsApi, updateJobs: updateJobsApi,
...@@ -36,4 +51,8 @@ export default { ...@@ -36,4 +51,8 @@ export default {
getOrganizationDetails: getOrganizationDetailsApi, getOrganizationDetails: getOrganizationDetailsApi,
addOrg: addOrgApi, addOrg: addOrgApi,
updateOrg: updateOrgApi, updateOrg: updateOrgApi,
addBusiness: addBusinessApi,
updateBusiness: updateBusinessApi,
addOperation: addOperationApi,
updateOperation: updateOperationApi,
}; };
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<div> <div>
<my-card v-if="$scopedSlots.search"> <my-card v-if="$scopedSlots.search">
<a-form-model :model="queryForm" layout="horizontal"> <a-form-model :model="queryForm" layout="horizontal">
<a-row :gutter="24"> <a-row :gutter="16">
<slot name="search" :query="queryForm" /> <slot name="search" :query="queryForm" />
</a-row> </a-row>
</a-form-model> </a-form-model>
......
<template> <template>
<a-col v-bind="span"> <a-col v-bind="span">
<a-form-model-item v-bind="layout"> <a-form-model-item v-bind="layout">
<slot class="tw-w-full" /> <slot />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</template> </template>
...@@ -11,7 +11,7 @@ export default { ...@@ -11,7 +11,7 @@ export default {
data() { data() {
return { return {
span: { xs: 24, sm: 24, lg: 12, xl: 6 }, span: { xs: 24, sm: 24, lg: 12, xl: 6 },
layout: { labelCol: { span: 5 }, wrapperCol: { span: 19 }, ...this.$attrs }, layout: { labelCol: { span: 6 }, wrapperCol: { span: 18 }, ...this.$attrs },
}; };
}, },
}; };
......
<template> <template>
<a-form-model layout="vertical" :model="form" :rules="rules" ref="DrawerForm"> <a-form-model layout="vertical" :model="form" :rules="rules" ref="DrawerForm">
<a-form-model-item label="名称" prop="jobName"> <a-form-model-item label="语言" prop="paramLocale">
<a-input v-model="form.jobName" :disabled="isView" /> <a-select
v-model="form.paramLocale"
:options="langList"
placeholder="请选择"
:disabled="isView"
/>
</a-form-model-item> </a-form-model-item>
<a-form-model-item label="描述" prop="jobDescription"> <a-form-model-item label="参数模块" prop="paramModule">
<a-textarea v-model="form.jobDescription" :disabled="isView" :rows="4" /> <a-input v-model="form.paramModule" placeholder="请输入" :disabled="isView" />
</a-form-model-item>
<a-form-model-item label="参数编码" prop="paramCode">
<a-input v-model="form.paramCode" placeholder="请输入" :disabled="isView" />
</a-form-model-item>
<a-form-model-item label="参数值" prop="paramValue">
<a-input v-model="form.paramValue" placeholder="请输入" :disabled="isView" />
</a-form-model-item>
<a-form-model-item label="参数名称" prop="paramName">
<a-input v-model="form.paramName" placeholder="请输入" :disabled="isView" />
</a-form-model-item>
<a-form-model-item label="显示顺序" prop="paramIndex">
<a-input v-model="form.paramIndex" placeholder="请输入" :disabled="isView" />
</a-form-model-item>
<a-form-model-item label="说明" prop="remark">
<a-textarea v-model="form.remark" :disabled="isView" :rows="4" />
</a-form-model-item> </a-form-model-item>
</a-form-model> </a-form-model>
</template> </template>
<script> <script>
import JobsApi from '@/api/organization'; import Api from '@/api/organization';
import FormMixin from '@/components/FormMixin'; import FormMixin from '@/components/FormMixin';
import { globalConfig } from '@/config';
import { formatObj } from '@/utils';
export default { export default {
mixins: [FormMixin], mixins: [FormMixin],
data() { data() {
return { return {
rules: { rules: {
jobName: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }], paramLocale: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }],
jobDescription: [ paramModule: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }],
{ required: true, message: 'Please select Activity zone', trigger: 'change' }, paramCode: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }],
], paramValue: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }],
paramName: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }],
paramIndex: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }],
}, },
langList: [],
}; };
}, },
async mounted() {
this.langList = await formatObj(globalConfig.langs, { value: 'key', label: 'name', key: 'key' });
},
methods: { methods: {
add() { add() {
return JobsApi.addJobs({ ...this.form }); return Api.addBusiness({ ...this.form });
}, },
edit() { edit() {
return JobsApi.updateJobs({ ...this.form }); return Api.updateBusiness({ ...this.form });
}, },
}, },
}; };
......
<template> <template>
<my-table url="/api/v1/parameters/business" rowKey="paramId" :addBtn="addBtn" ref="table"> <my-table
url="/api/v1/parameters/business"
rowKey="paramId"
:addBtn="addBtn"
ref="table"
:scroll="{ x: true }"
>
<template #drawer> <template #drawer>
<Form ref="form" /> <Form ref="form" />
</template> </template>
<template #search="{ query }"> <template #search="{ query }">
<MyFormModelItem label="归属部门"> <MyFormModelItem label="语言">
<a-input v-model="query.jobName" /> <a-select v-model="query.paramLocale" :options="langList" placeholder="请选择" />
</MyFormModelItem>
<MyFormModelItem label="参数模块">
<a-input v-model="query.paramModule" placeholder="请输入" />
</MyFormModelItem>
<MyFormModelItem label="参数编码">
<a-input v-model="query.paramCode" placeholder="请输入" />
</MyFormModelItem>
<MyFormModelItem label="参数名称">
<a-input v-model="query.paramName" placeholder="请输入" />
</MyFormModelItem> </MyFormModelItem>
</template> </template>
<a-table-column title="语言" data-index="paramLocale" /> <a-table-column title="语言" data-index="paramLocale" />
...@@ -15,30 +30,32 @@ ...@@ -15,30 +30,32 @@
<a-table-column title="参数名称" data-index="paramName" /> <a-table-column title="参数名称" data-index="paramName" />
<a-table-column title="说明" data-index="remark" /> <a-table-column title="说明" data-index="remark" />
<a-table-column title="显示顺序" data-index="paramIndex" /> <a-table-column title="显示顺序" data-index="paramIndex" />
<a-table-column title="操作"> <a-table-column title="操作" fixed="right">
<template #default="row"> <template #default="row">
<a @click="() => view(row, 1)">编辑</a> <a @click="() => view(row, 1)">编辑</a>
<a-divider type="vertical" /> <a-divider type="vertical" />
<PopconfirmDelete :url="`/api/v1/jobs/${row.jobId}`" :cb="refreshTable" /> <PopconfirmDelete :url="`/api/v1/parameters/business/${row.paramId}`" :cb="refreshTable" />
</template> </template>
</a-table-column> </a-table-column>
</my-table> </my-table>
</template> </template>
<script> <script>
import Form from './form.vue';
import PopconfirmDelete from '@/components/popconfirm_delete/index.vue'; import PopconfirmDelete from '@/components/popconfirm_delete/index.vue';
import MyFormModelItem from '@/components/table/my_item.vue'; import MyFormModelItem from '@/components/table/my_item.vue';
import { globalConfig } from '@/config'; import { globalConfig } from '@/config';
import { formatObj } from '@/utils';
import Form from './form.vue';
export default { export default {
components: { Form, PopconfirmDelete, MyFormModelItem }, components: { Form, PopconfirmDelete, MyFormModelItem },
data() { data() {
return { return {
addBtn: { width: 600, onOk: () => this.$refs['form']?.submit() }, addBtn: { width: 600, onOk: () => this.$refs['form']?.submit() },
langList: globalConfig.langs, langList: [],
}; };
}, },
mounted() { async mounted() {
console.log(this.langList); this.langList = await formatObj(globalConfig.langs, { value: 'key', label: 'name', key: 'key' });
}, },
methods: { methods: {
refreshTable() { refreshTable() {
......
<template>
<a-form-model layout="vertical" :model="form" :rules="rules" ref="DrawerForm">
<a-form-model-item label="参数模块" prop="paramModule">
<a-input v-model="form.paramModule" placeholder="请输入" :disabled="isView" />
</a-form-model-item>
<a-form-model-item label="参数编码" prop="paramCode">
<a-input v-model="form.paramCode" placeholder="请输入" :disabled="isView" />
</a-form-model-item>
<a-form-model-item label="参数值" prop="paramValue">
<a-input v-model="form.paramValue" placeholder="请输入" :disabled="isView" />
</a-form-model-item>
<a-form-model-item label="说明" prop="remark">
<a-textarea v-model="form.remark" :disabled="isView" :rows="4" />
</a-form-model-item>
</a-form-model>
</template>
<script>
import Api from '@/api/organization';
import FormMixin from '@/components/FormMixin';
export default {
mixins: [FormMixin],
data() {
return {
rules: {
paramModule: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }],
paramCode: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }],
paramValue: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }],
paramIndex: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }],
},
};
},
methods: {
add() {
return Api.addOperation({ ...this.form });
},
edit() {
return Api.updateOperation({ ...this.form });
},
},
};
</script>
<template>
<my-table
url="/api/v1/parameters/operation"
rowKey="paramId"
:addBtn="addBtn"
ref="table"
:scroll="{ x: true }"
>
<template #drawer>
<Form ref="form" />
</template>
<template #search="{ query }">
<MyFormModelItem label="参数模块">
<a-input v-model="query.paramModule" placeholder="请输入" />
</MyFormModelItem>
<MyFormModelItem label="参数编码">
<a-input v-model="query.paramCode" placeholder="请输入" />
</MyFormModelItem>
<MyFormModelItem label="参数值">
<a-input v-model="query.paramValue" placeholder="请输入" />
</MyFormModelItem>
</template>
<a-table-column title="参数模块" data-index="paramModule" />
<a-table-column title="参数编码" data-index="paramCode" />
<a-table-column title="参数值" data-index="paramValue" />
<a-table-column title="说明" data-index="remark" />
<a-table-column title="操作" fixed="right">
<template #default="row">
<a @click="() => view(row, 1)">编辑</a>
<a-divider type="vertical" />
<PopconfirmDelete :url="`/api/v1/parameters/operation/${row.paramId}`" :cb="refreshTable" />
</template>
</a-table-column>
</my-table>
</template>
<script>
import PopconfirmDelete from '@/components/popconfirm_delete/index.vue';
import MyFormModelItem from '@/components/table/my_item.vue';
import { globalConfig } from '@/config';
import { formatObj } from '@/utils';
import Form from './form.vue';
export default {
components: { Form, PopconfirmDelete, MyFormModelItem },
data() {
return {
addBtn: { width: 600, onOk: () => this.$refs['form']?.submit() },
};
},
methods: {
refreshTable() {
this.$refs['table']?.getData();
},
view(data, type) {
this.$refs['table']?.show({ type });
this.$nextTick(() => {
this.$refs['form'].setData({ ...data }, type);
});
},
},
};
</script>
\ No newline at end of file
...@@ -118,6 +118,12 @@ const options = { ...@@ -118,6 +118,12 @@ const options = {
component: () => component: () =>
import('@/pages/system/view/parameter/business/index.vue'), import('@/pages/system/view/parameter/business/index.vue'),
}, },
{
path: 'operation_management',
name: '运维参数',
component: () =>
import('@/pages/system/view/parameter/operation/index.vue'),
},
], ],
}, },
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment