| | |
| | | <el-form-item label="字典标签" prop="dictLabel"> |
| | | <el-input v-model="queryParams.dictLabel" placeholder="请输入字典标签" clearable style="width: 200px" @keyup.enter="handleQuery" /> |
| | | </el-form-item> |
| | | <el-form-item label="状态" prop="status"> |
| | | <el-select v-model="queryParams.status" placeholder="数据状态" clearable style="width: 200px"> |
| | | <el-option v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.label" :value="dict.value" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button> |
| | | <el-button icon="Refresh" @click="resetQuery">重置</el-button> |
| | |
| | | <el-table-column label="字典编码" align="center" prop="dictCode" v-if="false" /> |
| | | <el-table-column label="字典标签" align="center" prop="dictLabel"> |
| | | <template #default="scope"> |
| | | <span v-if="scope.row.listClass === '' || scope.row.listClass === 'default'">{{ scope.row.dictLabel }}</span> |
| | | <el-tag v-else :type="scope.row.listClass === 'primary' ? '' : scope.row.listClass">{{ scope.row.dictLabel |
| | | }}</el-tag> |
| | | <span v-if="(scope.row.listClass === '' || scope.row.listClass === 'default') && (scope.row.cssClass === '' || scope.row.cssClass == null)">{{ scope.row.dictLabel }}</span> |
| | | <el-tag v-else :type="(scope.row.listClass === 'primary' || scope.row.listClass === 'default') ? '' : scope.row.listClass" :class="scope.row.cssClass">{{ scope.row.dictLabel }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="字典键值" align="center" prop="dictValue" /> |
| | | <el-table-column label="字典排序" align="center" prop="dictSort" /> |
| | | <el-table-column label="状态" align="center" prop="status"> |
| | | <template #default="scope"> |
| | | <dict-tag :options="sys_normal_disable" :value="scope.row.status" /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" /> |
| | | <el-table-column label="创建时间" align="center" prop="createTime" width="180"> |
| | | <template #default="scope"> |
| | |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="状态" prop="status"> |
| | | <el-radio-group v-model="form.status"> |
| | | <el-radio v-for="dict in sys_normal_disable" :key="dict.value" :label="dict.value">{{ dict.label }}</el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="备注" prop="remark"> |
| | | <el-input v-model="form.remark" type="textarea" placeholder="请输入内容"></el-input> |
| | | </el-form-item> |
| | |
| | | import { DictDataForm, DictDataQuery, DictDataVO } from "@/api/system/dict/data/types"; |
| | | |
| | | const { proxy } = getCurrentInstance() as ComponentInternalInstance |
| | | const { sys_normal_disable } = toRefs<any>(proxy?.useDict("sys_normal_disable")); |
| | | const route = useRoute(); |
| | | |
| | | const dataList = ref<DictDataVO[]>([]); |
| | |
| | | cssClass: '', |
| | | listClass: "default", |
| | | dictSort: 0, |
| | | status: "0", |
| | | remark: '' |
| | | } |
| | | const data = reactive<PageData<DictDataForm, DictDataQuery>>({ |
| | |
| | | pageSize: 10, |
| | | dictName: '', |
| | | dictType: '', |
| | | status: '', |
| | | dictLabel: '' |
| | | }, |
| | | rules: { |
| | |
| | | } |
| | | /** 新增按钮操作 */ |
| | | const handleAdd = () => { |
| | | reset(); |
| | | form.value.dictType = queryParams.value.dictType; |
| | | dialog.visible = true; |
| | | dialog.title = "添加字典数据"; |
| | | nextTick(() => { |
| | | reset(); |
| | | form.value.dictType = queryParams.value.dictType; |
| | | }) |
| | | } |
| | | /** 多选框选中数据 */ |
| | | const handleSelectionChange = (selection: DictDataVO[]) => { |
| | |
| | | multiple.value = !selection.length; |
| | | } |
| | | /** 修改按钮操作 */ |
| | | const handleUpdate = (row?: DictDataVO) => { |
| | | const handleUpdate = async (row?: DictDataVO) => { |
| | | reset(); |
| | | const dictCode = row?.dictCode || ids.value[0]; |
| | | const res = await getData(dictCode); |
| | | Object.assign(form.value, res.data); |
| | | dialog.visible = true; |
| | | dialog.title = "修改字典数据"; |
| | | nextTick(async () => { |
| | | const res = await getData(dictCode); |
| | | reset(); |
| | | form.value = res.data; |
| | | }) |
| | | } |
| | | /** 提交按钮 */ |
| | | const submitForm = () => { |