|
@@ -121,25 +121,6 @@ const toSearch = (query: any) => {
|
|
|
const getProps = (data: any, prop: any) => {
|
|
|
return _.get(data, prop);
|
|
|
};
|
|
|
-// 修改是否启用
|
|
|
-const handleChange = (row: any) => {
|
|
|
- const text = row.is_use === '0' ? '启用' : '停用';
|
|
|
- ElMessageBox.confirm('确认要"' + text + '""' + row.type + '"吗?', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- })
|
|
|
- .then(async () => {
|
|
|
- let res: IQueryResult;
|
|
|
- if (row._id) res = await dictType.update(row);
|
|
|
- if (res.errcode == 0) {
|
|
|
- ElMessage({ type: `success`, message: `修改成功` });
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- row.is_use = row.is_use === '0' ? '1' : '0';
|
|
|
- });
|
|
|
-};
|
|
|
// 新增
|
|
|
const toAdd = () => {
|
|
|
dialog.value = { title: '信息管理', show: true, type: '1' };
|
|
@@ -186,6 +167,25 @@ const searchOther = async () => {
|
|
|
let res: IQueryResult = await dictData.query({ type: 'is_use' });
|
|
|
if (res.errcode == 0) is_useList.value = res.data;
|
|
|
};
|
|
|
+// 修改是否启用
|
|
|
+const handleChange = (row: any) => {
|
|
|
+ const text = row.is_use === '0' ? '启用' : '停用';
|
|
|
+ ElMessageBox.confirm('确认要"' + text + '""' + row.type + '"吗?', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ .then(async () => {
|
|
|
+ let res: IQueryResult;
|
|
|
+ if (row._id) res = await dictType.update(row);
|
|
|
+ if (res.errcode == 0) {
|
|
|
+ ElMessage({ type: `success`, message: `修改成功` });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ row.is_use = row.is_use === '0' ? '1' : '0';
|
|
|
+ });
|
|
|
+};
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
|
.main {
|