Browse Source

配置参数修改

master_hella_20240701
zhaoxuebing 8 months ago
parent
commit
085c894a01
  1. 7
      src/api/system/dict/dict.data.ts
  2. 26
      src/views/infra/config/ConfigForm.vue
  3. 29
      src/views/infra/config/index.vue

7
src/api/system/dict/dict.data.ts

@ -23,8 +23,13 @@ export const getDictDataPage = (params: PageParam) => {
return request.get({ url: '/system/dict-data/page', params }) return request.get({ url: '/system/dict-data/page', params })
} }
// 查询字典数据列表根据类型
export const queryByDictType = (dictType: number) => {
return request.get({ url: '/system/dict-data/queryByDictType?dictType=' + dictType })
}
// 查询字典数据详情 // 查询字典数据详情
export const getDictData = (id: number) => { export const getDictData = (id: string) => {
return request.get({ url: '/system/dict-data/get?id=' + id }) return request.get({ url: '/system/dict-data/get?id=' + id })
} }

26
src/views/infra/config/ConfigForm.vue

@ -19,6 +19,21 @@
<el-form-item label="参数键值" prop="value"> <el-form-item label="参数键值" prop="value">
<el-input v-model="formData.value" placeholder="请输入参数键值" /> <el-input v-model="formData.value" placeholder="请输入参数键值" />
</el-form-item> </el-form-item>
<el-form-item label="物料类型">
<el-select v-model="formData.itemTypeList" multiple placeholder="配置物料类型">
<el-option v-for="item in getStrDictOptions(DICT_TYPE.ITEM_TYPE)" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="库区类型">
<el-select v-model="formData.areaTypeList" multiple placeholder="库区类型">
<el-option v-for="item in getStrDictOptions(DICT_TYPE.AREA_TYPE)" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="库存状态">
<el-select v-model="formData.inventoryStatusList" multiple placeholder="库存状态">
<el-option v-for="item in getStrDictOptions(DICT_TYPE.INVENTORY_STATUS)" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-form-item>
<el-form-item label="是否可见" prop="visible"> <el-form-item label="是否可见" prop="visible">
<el-radio-group v-model="formData.visible"> <el-radio-group v-model="formData.visible">
<el-radio <el-radio
@ -41,7 +56,7 @@
</Dialog> </Dialog>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { DICT_TYPE, getBoolDictOptions } from '@/utils/dict' import { DICT_TYPE, getBoolDictOptions,getStrDictOptions } from '@/utils/dict'
import * as ConfigApi from '@/api/infra/config' import * as ConfigApi from '@/api/infra/config'
defineOptions({ name: 'InfraConfigForm' }) defineOptions({ name: 'InfraConfigForm' })
@ -59,6 +74,9 @@ const formData = ref({
name: '', name: '',
key: '', key: '',
value: '', value: '',
itemTypeList:'',
areaTypeList:'',
inventoryStatusList:'',
visible: true, visible: true,
remark: '' remark: ''
}) })
@ -70,6 +88,9 @@ const formRules = reactive({
visible: [{ required: true, message: '是否可见不能为空', trigger: 'blur' }] visible: [{ required: true, message: '是否可见不能为空', trigger: 'blur' }]
}) })
const formRef = ref() // Ref const formRef = ref() // Ref
// const itemTypeList = ref([]) //
/** 打开弹窗 */ /** 打开弹窗 */
const open = async (type: string, id?: number) => { const open = async (type: string, id?: number) => {
@ -123,6 +144,9 @@ const resetForm = () => {
name: '', name: '',
key: '', key: '',
value: '', value: '',
itemTypeList:'',
areaTypeList:'',
inventoryStatusList:'',
visible: true, visible: true,
remark: '' remark: ''
} }

29
src/views/infra/config/index.vue

@ -40,22 +40,37 @@
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<el-table v-loading="loading" :data="list"> <el-table v-loading="loading" :data="list">
<el-table-column label="参数主键" align="center" prop="id" /> <el-table-column label="参数主键" align="left" prop="id" :width="100"/>
<el-table-column label="参数分类" align="center" prop="category" /> <el-table-column label="参数分类" align="left" prop="category" :width="150"/>
<el-table-column label="参数名称" align="center" prop="name" :show-overflow-tooltip="true" /> <el-table-column label="参数名称" align="left" prop="name" :show-overflow-tooltip="true" :width="200"/>
<el-table-column label="参数键名" align="center" prop="key" :show-overflow-tooltip="true" /> <el-table-column label="参数键名" align="left" prop="key" :show-overflow-tooltip="true" :width="250"/>
<el-table-column label="参数键值" align="center" prop="value" /> <el-table-column label="参数键值" align="left" prop="value" :width="200"/>
<el-table-column label="物料类型" align="left" prop="itemType" :width="250">
<template #default="scope">
<dict-tag :type="DICT_TYPE.ITEM_TYPE" :value="scope.row.itemType" />
</template>
</el-table-column>
<el-table-column label="库区类型" align="left" prop="areaType" :width="250">
<template #default="scope">
<dict-tag :type="DICT_TYPE.AREA_TYPE" :value="scope.row.areaType" />
</template>
</el-table-column>
<el-table-column label="库存状态" align="left" prop="inventoryStatus" :width="250">
<template #default="scope">
<dict-tag :type="DICT_TYPE.INVENTORY_STATUS" :value="scope.row.inventoryStatus" />
</template>
</el-table-column>
<el-table-column label="是否可见" align="center" prop="visible"> <el-table-column label="是否可见" align="center" prop="visible">
<template #default="scope"> <template #default="scope">
<dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.visible" /> <dict-tag :type="DICT_TYPE.INFRA_BOOLEAN_STRING" :value="scope.row.visible" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="系统内置" align="center" prop="type"> <el-table-column label="系统内置" align="center" prop="type" :width="150">
<template #default="scope"> <template #default="scope">
<dict-tag :type="DICT_TYPE.INFRA_CONFIG_TYPE" :value="scope.row.type" /> <dict-tag :type="DICT_TYPE.INFRA_CONFIG_TYPE" :value="scope.row.type" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" /> <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" :width="150"/>
<el-table-column label="创建时间" align="center" prop="createTime" width="180" :formatter="dateFormatter" /> <el-table-column label="创建时间" align="center" prop="createTime" width="180" :formatter="dateFormatter" />
<el-table-column label="操作" align="center" fixed="right" width="180"> <el-table-column label="操作" align="center" fixed="right" width="180">
<template #default="scope"> <template #default="scope">

Loading…
Cancel
Save