兰宝车间质量管理系统-前端
LiuHao
2023-06-06 6af68085ff6615e1ec3a5dd18c761250800d6fca
src/views/system/config/index.vue
@@ -125,8 +125,6 @@
<script setup name="Config" lang="ts">
import { listConfig, getConfig, delConfig, addConfig, updateConfig, refreshCache } from "@/api/system/config";
import { ConfigForm, ConfigQuery, ConfigVO } from "@/api/system/config/types";
import { ComponentInternalInstance } from "vue";
import { DateModelType } from 'element-plus';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { sys_yes_no } = toRefs<any>(proxy?.useDict("sys_yes_no"));
@@ -140,8 +138,8 @@
const total = ref(0);
const dateRange = ref<[DateModelType, DateModelType]>(['', '']);
const queryFormRef = ref(ElForm);
const configFormRef = ref(ElForm);
const queryFormRef = ref<ElFormInstance>();
const configFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({
    visible: false,
    title: ''
@@ -188,7 +186,7 @@
/** 表单重置 */
const reset = () => {
    form.value = {...initFormData};
    configFormRef.value.resetFields();
  configFormRef.value?.resetFields();
}
/** 搜索按钮操作 */
const handleQuery = () => {
@@ -198,7 +196,7 @@
/** 重置按钮操作 */
const resetQuery = () => {
    dateRange.value = ['', ''];
    queryFormRef.value.resetFields();
  queryFormRef.value?.resetFields();
    handleQuery();
}
/** 多选框选中数据 */
@@ -228,12 +226,12 @@
}
/** 提交按钮 */
const submitForm = () => {
    configFormRef.value.validate(async (valid: boolean) => {
  configFormRef.value?.validate(async (valid: boolean) => {
        if (valid) {
            form.value.configId ? await updateConfig(form.value) : await addConfig(form.value);
            proxy?.$modal.msgSuccess("操作成功");
            dialog.visible = false;
            getList();
      await getList();
        }
    });
}
@@ -242,7 +240,7 @@
    const configIds = row?.configId || ids.value;
    await proxy?.$modal.confirm('是否确认删除参数编号为"' + configIds + '"的数据项?');
    await delConfig(configIds);
    getList();
  await getList();
    proxy?.$modal.msgSuccess("删除成功");
}
/** 导出按钮操作 */