兰宝车间质量管理系统-前端
疯狂的狮子Li
2023-07-11 c13c622eac5551c6f099f148feb5256711ca34de
src/views/system/dict/data.vue
@@ -1,7 +1,8 @@
<template>
  <div class="p-2">
    <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
      <div class="search" v-show="showSearch">
      <div class="mb-[10px]" v-show="showSearch">
        <el-card shadow="hover">
        <el-form :model="queryParams" ref="queryFormRef" :inline="true" label-width="68px">
          <el-form-item label="字典名称" prop="dictType">
            <el-select v-model="queryParams.dictType" style="width: 200px">
@@ -21,9 +22,10 @@
            <el-button icon="Refresh" @click="resetQuery">重置</el-button>
          </el-form-item>
        </el-form>
        </el-card>
      </div>
    </transition>
    <el-card shadow="never">
    <el-card shadow="hover">
      <template #header>
        <el-row :gutter="10" class="mb8">
          <el-col :span="1.5">
@@ -136,9 +138,7 @@
import { optionselect as getDictOptionselect, getType } from "@/api/system/dict/type";
import { listData, getData, delData, addData, updateData } from "@/api/system/dict/data";
import { DictTypeVO } from '@/api/system/dict/type/types';
import { ComponentInternalInstance } from "vue";
import { DictDataForm, DictDataQuery, DictDataVO } from "@/api/system/dict/data/types";
import { ElForm } from 'element-plus';
const { proxy } = getCurrentInstance() as ComponentInternalInstance
const { sys_normal_disable } = toRefs<any>(proxy?.useDict("sys_normal_disable"));
@@ -154,8 +154,8 @@
const defaultDictType = ref("");
const typeOptions = ref<DictTypeVO[]>([]);
const dataFormRef = ref(ElForm);
const queryFormRef = ref(ElForm);
const dataFormRef = ref<ElFormInstance>();
const queryFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({
@@ -231,7 +231,7 @@
/** 表单重置 */
const reset = () => {
    form.value = { ...initFormData };
    dataFormRef.value.resetFields();
  dataFormRef.value?.resetFields();
}
/** 搜索按钮操作 */
const handleQuery = () => {
@@ -245,7 +245,7 @@
}
/** 重置按钮操作 */
const resetQuery = () => {
    queryFormRef.value.resetFields();
  queryFormRef.value?.resetFields();
    queryParams.value.dictType = defaultDictType.value;
    handleQuery();
}
@@ -277,13 +277,13 @@
}
/** 提交按钮 */
const submitForm = () => {
    dataFormRef.value.validate(async (valid: boolean) => {
  dataFormRef.value?.validate(async (valid: boolean) => {
        if (valid) {
            form.value.dictCode ? await updateData(form.value) : await addData(form.value);
            useDictStore().removeDict(queryParams.value.dictType);
            proxy?.$modal.msgSuccess("操作成功");
            dialog.visible = false;
            getList();
      await getList();
        }
    });
@@ -293,7 +293,7 @@
    const dictCodes = row?.dictCode || ids.value;
    await proxy?.$modal.confirm('是否确认删除字典编码为"' + dictCodes + '"的数据项?');
    await delData(dictCodes);
    getList();
  await getList();
    proxy?.$modal.msgSuccess("删除成功");
    useDictStore().removeDict(queryParams.value.dictType);