|
@@ -111,21 +111,21 @@ const search = async (e: { skip: number; limit: number }) => {
|
|
|
total.value = res.total;
|
|
|
}
|
|
|
};
|
|
|
-const toSearch = (query) => {
|
|
|
+const toSearch = (query: any) => {
|
|
|
searchForm.value = query;
|
|
|
search({ skip, limit });
|
|
|
};
|
|
|
-const getDict = (value, model) => {
|
|
|
+const getDict = (value: any, model: any) => {
|
|
|
console.log(value);
|
|
|
if (model == 'is_use') {
|
|
|
if (value) {
|
|
|
- let data = is_useList.value.find((i) => i.value == value);
|
|
|
+ let data = is_useList.value.find((i: any) => i.value == value);
|
|
|
if (data) return data.label;
|
|
|
else return '暂无';
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
-const getProps = (data, prop) => {
|
|
|
+const getProps = (data: any, prop: any) => {
|
|
|
return _.get(data, prop);
|
|
|
};
|
|
|
// 新增
|
|
@@ -133,7 +133,7 @@ const toAdd = () => {
|
|
|
dialog.value = { title: '信息管理', show: true, type: '1' };
|
|
|
};
|
|
|
// 修改
|
|
|
-const toEdit = async (data) => {
|
|
|
+const toEdit = async (data: any) => {
|
|
|
let res: IQueryResult = await dictType.fetch(data._id);
|
|
|
if (res.errcode == 0) {
|
|
|
form.value = res.data as {};
|
|
@@ -141,7 +141,7 @@ const toEdit = async (data) => {
|
|
|
}
|
|
|
};
|
|
|
// 提交
|
|
|
-const onSubmit = async (data) => {
|
|
|
+const onSubmit = async (data: any) => {
|
|
|
let res: IQueryResult;
|
|
|
if (data._id) res = await dictType.update(data);
|
|
|
else res = await dictType.create(data);
|
|
@@ -151,7 +151,7 @@ const onSubmit = async (data) => {
|
|
|
}
|
|
|
};
|
|
|
// 删除
|
|
|
-const toDel = async (data) => {
|
|
|
+const toDel = async (data: any) => {
|
|
|
let res: IQueryResult = await dictType.del(data._id);
|
|
|
if (res.errcode == 0) {
|
|
|
ElMessage({ type: `success`, message: `刪除信息成功` });
|
|
@@ -166,7 +166,7 @@ const toClose = () => {
|
|
|
search({ skip, limit });
|
|
|
};
|
|
|
// 字典类型跳转
|
|
|
-const toType = (data) => {
|
|
|
+const toType = (data: any) => {
|
|
|
router.push({ path: '/system/dictData', query: { id: data._id, type: data.type } });
|
|
|
};
|
|
|
// 查询其他信息
|