Commit 59041a03 authored by 陈浩玮's avatar 陈浩玮

Merge branch 'feature/chw' into 'master'

参数管理

See merge request product/kim3-web-vue/starter-web-vue!16
parents 7d528119 19a2fbc9
......@@ -28,6 +28,21 @@ function updateOrgApi(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 {
addJobs: addJobsApi,
updateJobs: updateJobsApi,
......@@ -36,4 +51,8 @@ export default {
getOrganizationDetails: getOrganizationDetailsApi,
addOrg: addOrgApi,
updateOrg: updateOrgApi,
addBusiness: addBusinessApi,
updateBusiness: updateBusinessApi,
addOperation: addOperationApi,
updateOperation: updateOperationApi,
};
......@@ -2,7 +2,7 @@
<div>
<my-card v-if="$scopedSlots.search">
<a-form-model :model="queryForm" layout="horizontal">
<a-row :gutter="24">
<a-row :gutter="16">
<slot name="search" :query="queryForm" />
</a-row>
</a-form-model>
......
<template>
<a-col v-bind="span">
<a-form-model-item v-bind="layout">
<slot class="tw-w-full" />
<slot />
</a-form-model-item>
</a-col>
</template>
......@@ -11,7 +11,7 @@ export default {
data() {
return {
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>
<a-form-model layout="vertical" :model="form" :rules="rules" ref="DrawerForm">
<a-form-model-item label="名称" prop="jobName">
<a-input v-model="form.jobName" :disabled="isView" />
<a-form-model-item label="语言" prop="paramLocale">
<a-select
v-model="form.paramLocale"
:options="langList"
placeholder="请选择"
:disabled="isView"
/>
</a-form-model-item>
<a-form-model-item label="描述" prop="jobDescription">
<a-textarea v-model="form.jobDescription" :disabled="isView" :rows="4" />
<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="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>
</template>
<script>
import JobsApi from '@/api/organization';
import Api from '@/api/organization';
import FormMixin from '@/components/FormMixin';
import { globalConfig } from '@/config';
import { formatObj } from '@/utils';
export default {
mixins: [FormMixin],
data() {
return {
rules: {
jobName: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }],
jobDescription: [
{ required: true, message: 'Please select Activity zone', trigger: 'change' },
],
paramLocale: [{ required: true, message: 'Please select Activity zone', trigger: 'change' }],
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' }],
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: {
add() {
return JobsApi.addJobs({ ...this.form });
return Api.addBusiness({ ...this.form });
},
edit() {
return JobsApi.updateJobs({ ...this.form });
return Api.updateBusiness({ ...this.form });
},
},
};
......
<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>
<Form ref="form" />
</template>
<template #search="{ query }">
<MyFormModelItem label="归属部门">
<a-input v-model="query.jobName" />
<MyFormModelItem label="语言">
<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>
</template>
<a-table-column title="语言" data-index="paramLocale" />
......@@ -15,30 +30,32 @@
<a-table-column title="参数名称" data-index="paramName" />
<a-table-column title="说明" data-index="remark" />
<a-table-column title="显示顺序" data-index="paramIndex" />
<a-table-column title="操作">
<a-table-column title="操作" fixed="right">
<template #default="row">
<a @click="() => view(row, 1)">编辑</a>
<a-divider type="vertical" />
<PopconfirmDelete :url="`/api/v1/jobs/${row.jobId}`" :cb="refreshTable" />
<PopconfirmDelete :url="`/api/v1/parameters/business/${row.paramId}`" :cb="refreshTable" />
</template>
</a-table-column>
</my-table>
</template>
<script>
import Form from './form.vue';
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() },
langList: globalConfig.langs,
langList: [],
};
},
mounted() {
console.log(this.langList);
async mounted() {
this.langList = await formatObj(globalConfig.langs, { value: 'key', label: 'name', key: 'key' });
},
methods: {
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 = {
component: () =>
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