Compare commits

..

No commits in common. "62335447396b9aa0985ab19d63dec3990ab9bf43" and "6985e32a857483407eee75cdf3d807d80f76ba37" have entirely different histories.

7 changed files with 28 additions and 111 deletions

View File

@ -16,7 +16,7 @@ export const columns = [
{
title: '文章标题',
key: 'title',
width: 250,
width: 200,
render(record) {
return h(
'a',

View File

@ -121,9 +121,6 @@
import Editor from '@/components/Editor/tinymce.vue';
import { buildTree } from '@/utils/auth';
/**
* 定义常量
*/
const emit = defineEmits(['success', 'update:visible']);
const formRef = ref();
const editorRef = ref();
@ -136,18 +133,17 @@
const message = useMessage();
const formData = reactive({
id: '',
categoryId: '',
categoryId: undefined,
title: '',
author: '',
cover: '',
images: '',
intro: '',
content: '',
status: 0,
click: '',
sort: 0,
images: '',
imagesList: [],
fileList: [],
});
/**
@ -165,10 +161,6 @@
default: 0,
},
});
/**
* 定义模态
*/
const [modalRegister, { openModal, setSubLoading }] = useModal({
title: props.articleId ? '编辑文章' : '添加文章',
subBtuText: '确定',
@ -190,7 +182,6 @@
);
return;
};
/**
* 执行提交
*/
@ -260,10 +251,7 @@
setFormData();
}
});
/**
* 定义函数
*/
//
defineExpose({
openModal,
});

View File

@ -27,6 +27,7 @@
</template>
新建
</n-button>
<n-button
type="error"
@click="handleDelete"
@ -62,13 +63,12 @@
import { getArticleList, articleDelete, articleBatchDelete } from '@/api/content/article';
import { columns } from './columns';
import { PlusOutlined, DeleteOutlined, FormOutlined } from '@vicons/antd';
import CreateModal from './CreateModal.vue';
import editDialog from './edit.vue';
import { basicModal, useModal } from '@/components/Modal';
import { schemas } from './querySchemas';
import { renderIcon } from '@/utils';
/**
* 定义常量
*/
const message = useMessage();
const dialog = useDialog();
const basicTableRef = ref();
@ -76,19 +76,14 @@
const editVisible = ref(false);
const articleId = ref(0);
const rowKeys = ref([]);
const showModal = ref(false);
const exportLoading = ref(false);
/**
* 定义查询参数
*/
const showModal = ref(false);
const formParams = reactive({
title: '',
status: '',
});
/**
* 定义操作栏
*/
const actionColumn = reactive({
width: 200,
title: '操作',
@ -118,36 +113,24 @@
},
});
/**
* 加载数据列表
* @param res 参数
*/
function addTable() {
showModal.value = true;
}
const loadDataTable = async (res) => {
rowKeys.value = [];
const result = await getArticleList({ ...formParams, ...res });
return result;
};
/**
* 数据行选中事件
* @param keys 参数
*/
function onCheckedRow(keys) {
rowKeys.value = keys;
}
/**
* 刷新数据列表
* @param noRefresh 参数
*/
function reloadTable(noRefresh = '') {
basicTableRef.value.reload(noRefresh ? {} : { pageNo: 1 });
}
/**
* 执行提交表单
* @param values 参数
*/
function handleSubmit(values: Recordable) {
for (const key in formParams) {
formParams[key] = '';
@ -158,9 +141,6 @@
reloadTable();
}
/**
* 执行重置
*/
function handleReset(values: Recordable) {
for (const key in formParams) {
formParams[key] = '';
@ -171,9 +151,6 @@
reloadTable();
}
/**
* 执行注册
*/
const [register, {}] = useForm({
gridProps: { cols: '1 s:1 m:2 l:3 xl:4 2xl:4' },
labelWidth: 80,
@ -189,7 +166,6 @@
await nextTick();
createModalRef.value.openModal();
};
/**
* 执行编辑
*/
@ -199,7 +175,6 @@
await nextTick();
createModalRef.value.openModal();
}
/**
* 执行删除
* @param id 参数

View File

@ -103,19 +103,13 @@
name: '',
//
sort: 0,
//
note: '',
});
/**
* 定义模态
*/
const [modalRegister, { openModal, setSubLoading }] = useModal({
title: props.categoryId ? '编辑分类' : '添加分类',
subBtuText: '确定',
width: 600,
});
/**
* 关闭窗体
*/
@ -128,7 +122,7 @@
/**
* 获取分类数据
*/
const getCategory = async () => {
const getcategory = async () => {
const data: any = await getCategoryList();
data.map((item) => {
expandedKeys.value.push(item.id);
@ -177,17 +171,14 @@
* 钩子函数
*/
onMounted(() => {
getCategory();
getcategory();
if (props.categoryId) {
getDetail();
} else {
formData.parentId = props.pid;
}
});
/**
* 定义函数
*/
//
defineExpose({
openModal,
});

View File

@ -64,11 +64,8 @@
const categoryId = ref(0);
const pid = ref(0);
/**
* 定义操作栏
*/
const actionColumn = reactive({
width: 250,
width: 220,
title: '操作',
align: 'center',
key: 'action',
@ -104,7 +101,7 @@
});
/**
* 获取分类列表
* 获取部门列表
*/
const loadDataTable = async (res) => {
const data = await getCategoryList();

View File

@ -66,16 +66,11 @@
default: 0,
},
});
/**
* 定义模态
*/
const [modalRegister, { openModal, setSubLoading }] = useModal({
title: props.tagId ? '编辑标签' : '添加标签',
subBtuText: '确定',
width: 600,
});
/**
* 执行提交
*/
@ -122,10 +117,7 @@
setFormData();
}
});
/**
* 定义函数
*/
//
defineExpose({
openModal,
});

View File

@ -27,6 +27,7 @@
</template>
新建
</n-button>
<n-button
type="error"
@click="handleDelete"
@ -62,13 +63,12 @@
import { getTagList, tagDelete, tagBatchDelete } from '@/api/content/tag';
import { columns } from './columns';
import { PlusOutlined, DeleteOutlined, FormOutlined } from '@vicons/antd';
import CreateModal from './CreateModal.vue';
import editDialog from './edit.vue';
import { basicModal, useModal } from '@/components/Modal';
import { schemas } from './querySchemas';
import { renderIcon } from '@/utils';
/**
* 定义常量
*/
const message = useMessage();
const dialog = useDialog();
const basicTableRef = ref();
@ -76,18 +76,13 @@
const editVisible = ref(false);
const tagId = ref(0);
const rowKeys = ref([]);
const showModal = ref(false);
const exportLoading = ref(false);
/**
* 定义查询参数
*/
const showModal = ref(false);
const formParams = reactive({
name: '',
});
/**
* 定义操作栏
*/
const actionColumn = reactive({
width: 200,
title: '操作',
@ -117,36 +112,24 @@
},
});
/**
* 加载数据列表
* @param res 参数
*/
function addTable() {
showModal.value = true;
}
const loadDataTable = async (res) => {
rowKeys.value = [];
const result = await getTagList({ ...formParams, ...res });
return result;
};
/**
* 数据行选中事件
* @param keys 参数
*/
function onCheckedRow(keys) {
rowKeys.value = keys;
}
/**
* 刷新数据列表
* @param noRefresh 参数
*/
function reloadTable(noRefresh = '') {
basicTableRef.value.reload(noRefresh ? {} : { pageNo: 1 });
}
/**
* 执行提交表单
* @param values 参数
*/
function handleSubmit(values: Recordable) {
for (const key in formParams) {
formParams[key] = '';
@ -157,10 +140,6 @@
reloadTable();
}
/**
* 执行重置
* @param values 参数
*/
function handleReset(values: Recordable) {
for (const key in formParams) {
formParams[key] = '';
@ -171,9 +150,6 @@
reloadTable();
}
/**
* 执行注册
*/
const [register, {}] = useForm({
gridProps: { cols: '1 s:1 m:2 l:3 xl:4 2xl:4' },
labelWidth: 80,
@ -189,7 +165,6 @@
await nextTick();
createModalRef.value.openModal();
};
/**
* 执行编辑
*/
@ -199,7 +174,6 @@
await nextTick();
createModalRef.value.openModal();
}
/**
* 执行删除
* @param id 参数