-
-
-
+
+
+
-
-
+
+
-
+
-
+
@@ -53,111 +28,81 @@
- 新增
+ 新增
- 修改
+ 修改
- 删除
+ 删除
- 导出
+ 导出
-
-
-
-
-
-
-
+
+
+
+
+
+
- {{ configTypeOptions.find(item => item.value === scope.row.configType)?.label || scope.row.configType }}
-
-
-
-
-
-
-
-
+ {{configTypeOptions.find(item => item.value === scope.row.configType)?.label || scope.row.configType}}
+
+
+
+
+
+
+
+
- {{ configOptiontypeOptions.find(item => item.value === scope.row.configOptiontype)?.label || scope.row.configOptiontype }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ parseTime(scope.row.createTime) }}
-
-
-
-
- 修改
- 删除
-
-
-
-
+ }">
+ {{configOptiontypeOptions.find(item => item.value === scope.row.configOptiontype)?.label ||
+ scope.row.configOptiontype}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ parseTime(scope.row.createTime) }}
+
+
+
+
+ 修改
+ 删除
+
+
+
+
+
-
-
+
-
-
+
+
@@ -167,17 +112,9 @@
-
-
+
+
@@ -189,11 +126,8 @@
- {{ dict.label }}
+ {{ dict.label
+ }}
@@ -217,13 +151,14 @@ import {
listconfigdict,
updateconfigdict
} from "@/api/liswork/xtwh/configdictApi.ts";
+import DynamicInput from "@/views/liswork/xtwh/localconfig/components/DynamicInput.vue"
// 1. 定义类别下拉选项(根据实际业务调整)
const configTypeOptions = ref([
- { label: "仪器全局设置", value: "SYSTEM",color: "#E6A23C" },
+ { label: "仪器全局设置", value: "SYSTEM", color: "#E6A23C" },
{ label: "仪器界面设置", value: "INPUT", color: "#67C23A" },
- { label: "本地选项设置", value: "LOCAL" , color: "#409EFF" },
- { label: "本院特殊设置", value: "HISOPT", color: "#909399" },
- { label: "门诊采血设置", value: "_MZCX_", color: "#C74127" }
+ { label: "本地选项设置", value: "LOCAL", color: "#409EFF" },
+ { label: "本院特殊设置", value: "HISOPT", color: "#909399" },
+ { label: "门诊采血设置", value: "_MZCX_", color: "#C74127" }
]);
// 2. 定义获取类别对应颜色的方法
function getConfigTypeColor(type) {
@@ -233,15 +168,15 @@ function getConfigTypeColor(type) {
}
// 2. 定义参数类别下拉选项(根据实际业务调整)
const configOptiontypeOptions = ref([
- { label: "单选框", value: "0",color: "#56BBBD" },
- { label: "下拉框", value: "1",color: "#67C23A" },
- { label: "字典单选", value: "2",color: "#FF443F" },
- { label: "字典多选", value: "3",color: "#F08784" },
- { label: "特殊", value: "4",color: "#909399" },
- { label: "文本框", value: "5",color: "#3282F6" },
- { label: "数字框", value: "6",color: "#507F80" },
- { label: "日期框", value: "7",color: "#7E84F7" },
- { label: "时间框", value: "8",color: "#377D22" },
+ { label: "单选框", value: "0", color: "#56BBBD" },
+ { label: "下拉框", value: "1", color: "#67C23A" },
+ { label: "字典单选", value: "2", color: "#FF443F" },
+ { label: "字典多选", value: "3", color: "#F08784" },
+ { label: "特殊", value: "4", color: "#909399" },
+ { label: "文本框", value: "5", color: "#3282F6" },
+ { label: "数字框", value: "6", color: "#507F80" },
+ { label: "日期框", value: "7", color: "#7E84F7" },
+ { label: "时间框", value: "8", color: "#377D22" },
]);
function getconfigOptionTypeColor(type) {
// 匹配对应类别的颜色,无匹配时用默认色
@@ -265,26 +200,26 @@ const data = reactive({
queryParams: {
configCode: undefined,
configName: undefined,
- configType:undefined,
- status: undefined
+ configType: undefined,
+ status: undefined,
+ pageNum: 1,
+ pageSize: 30
},
rules: {
- configType: [{ required: true, message: menuname.value+"类别不能为空", trigger: "blur" }],
- configName: [{ required: true, message: menuname.value+"名称不能为空", trigger: "blur" }],
- configCode: [{ required: true, message: menuname.value+"编码不能为空", trigger: "blur" }],
- configSort: [{ required: true, message: menuname.value+"顺序不能为空", trigger: "blur" }],
+ configType: [{ required: true, message: menuname.value + "类别不能为空", trigger: "blur" }],
+ configName: [{ required: true, message: menuname.value + "名称不能为空", trigger: "blur" }],
+ configCode: [{ required: true, message: menuname.value + "编码不能为空", trigger: "blur" }],
+ configSort: [{ required: true, message: menuname.value + "顺序不能为空", trigger: "blur" }],
}
});
const { queryParams, form, rules } = toRefs(data);
-
/** 查询字典列表 */
function getList() {
loading.value = true;
listconfigdict(queryParams.value).then(response => {
- console.log('response:', response);
- regdictList.value = response.data;
- total.value = response.data.length;
+ regdictList.value = response.rows;
+ total.value = response.total;
loading.value = false;
});
}
@@ -301,7 +236,7 @@ function reset() {
configName: undefined,
configType: configTypeOptions.value[0]?.value || "",
configOptiontype: configOptiontypeOptions.value[0]?.value || "",
- configDefvalue:undefined,
+ configDefvalue: undefined,
configSort: 0,
status: "0",
remark: undefined
@@ -328,7 +263,7 @@ function handleSelectionChange(selection) {
function handleAdd() {
reset();
open.value = true;
- title.value = "添加"+menuname.value;
+ title.value = "添加" + menuname.value;
}
/** 修改按钮操作 */
function handleUpdate(row) {
@@ -337,25 +272,28 @@ function handleUpdate(row) {
getconfigdict(configId).then(response => {
form.value = response.data;
open.value = true;
- title.value = "修改"+menuname.value;
+ title.value = "修改" + menuname.value;
});
}
/** 提交按钮 */
function submitForm() {
proxy.$refs["configdictRef"].validate(valid => {
if (valid) {
-
if (form.value.configId != undefined) {
updateconfigdict(form.value).then(response => {
- proxy.$modal.msgSuccess("修改成功");
- open.value = false;
- getList();
+ if (response.code == 200) {
+ proxy.$modal.msgSuccess("修改成功");
+ open.value = false;
+ getList();
+ }
});
} else {
addconfigdict(form.value).then(response => {
- proxy.$modal.msgSuccess("新增成功");
- open.value = false;
- getList();
+ if (response.code == 200) {
+ proxy.$modal.msgSuccess("新增成功");
+ open.value = false;
+ getList();
+ }
});
}
}
@@ -364,13 +302,12 @@ function submitForm() {
/** 删除按钮操作 */
function handleDelete(row) {
const configIds = row.configId || ids.value;
- proxy.$modal.confirm('是否确认删除"' + menuname.value + '"编号为"' + configIds + '"的数据项?').then(function() {
-
+ proxy.$modal.confirm('是否确认删除"' + menuname.value + '"编号为"' + configIds + '"的数据项?').then(function () {
return delconfigdict(configIds);
}).then(() => {
getList();
proxy.$modal.msgSuccess("删除成功");
- }).catch(() => {});
+ }).catch(() => { });
}
/** 导出按钮操作 */
function handleExport() {
@@ -381,42 +318,40 @@ function handleExport() {
getList();