Compare commits
No commits in common. "62335447396b9aa0985ab19d63dec3990ab9bf43" and "6985e32a857483407eee75cdf3d807d80f76ba37" have entirely different histories.
6233544739
...
6985e32a85
@ -16,7 +16,7 @@ export const columns = [
|
|||||||
{
|
{
|
||||||
title: '文章标题',
|
title: '文章标题',
|
||||||
key: 'title',
|
key: 'title',
|
||||||
width: 250,
|
width: 200,
|
||||||
render(record) {
|
render(record) {
|
||||||
return h(
|
return h(
|
||||||
'a',
|
'a',
|
||||||
|
@ -121,9 +121,6 @@
|
|||||||
import Editor from '@/components/Editor/tinymce.vue';
|
import Editor from '@/components/Editor/tinymce.vue';
|
||||||
import { buildTree } from '@/utils/auth';
|
import { buildTree } from '@/utils/auth';
|
||||||
|
|
||||||
/**
|
|
||||||
* 定义常量
|
|
||||||
*/
|
|
||||||
const emit = defineEmits(['success', 'update:visible']);
|
const emit = defineEmits(['success', 'update:visible']);
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
const editorRef = ref();
|
const editorRef = ref();
|
||||||
@ -136,18 +133,17 @@
|
|||||||
const message = useMessage();
|
const message = useMessage();
|
||||||
const formData = reactive({
|
const formData = reactive({
|
||||||
id: '',
|
id: '',
|
||||||
categoryId: '',
|
categoryId: undefined,
|
||||||
title: '',
|
title: '',
|
||||||
author: '',
|
author: '',
|
||||||
cover: '',
|
cover: '',
|
||||||
images: '',
|
|
||||||
intro: '',
|
intro: '',
|
||||||
content: '',
|
content: '',
|
||||||
status: 0,
|
status: 0,
|
||||||
click: '',
|
click: '',
|
||||||
sort: 0,
|
sort: 0,
|
||||||
|
images: '',
|
||||||
imagesList: [],
|
imagesList: [],
|
||||||
fileList: [],
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -165,10 +161,6 @@
|
|||||||
default: 0,
|
default: 0,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
|
||||||
* 定义模态
|
|
||||||
*/
|
|
||||||
const [modalRegister, { openModal, setSubLoading }] = useModal({
|
const [modalRegister, { openModal, setSubLoading }] = useModal({
|
||||||
title: props.articleId ? '编辑文章' : '添加文章',
|
title: props.articleId ? '编辑文章' : '添加文章',
|
||||||
subBtuText: '确定',
|
subBtuText: '确定',
|
||||||
@ -190,7 +182,6 @@
|
|||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 执行提交
|
* 执行提交
|
||||||
*/
|
*/
|
||||||
@ -260,10 +251,7 @@
|
|||||||
setFormData();
|
setFormData();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
//导出方法
|
||||||
/**
|
|
||||||
* 定义函数
|
|
||||||
*/
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
openModal,
|
openModal,
|
||||||
});
|
});
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
</template>
|
</template>
|
||||||
新建
|
新建
|
||||||
</n-button>
|
</n-button>
|
||||||
|
|
||||||
<n-button
|
<n-button
|
||||||
type="error"
|
type="error"
|
||||||
@click="handleDelete"
|
@click="handleDelete"
|
||||||
@ -62,13 +63,12 @@
|
|||||||
import { getArticleList, articleDelete, articleBatchDelete } from '@/api/content/article';
|
import { getArticleList, articleDelete, articleBatchDelete } from '@/api/content/article';
|
||||||
import { columns } from './columns';
|
import { columns } from './columns';
|
||||||
import { PlusOutlined, DeleteOutlined, FormOutlined } from '@vicons/antd';
|
import { PlusOutlined, DeleteOutlined, FormOutlined } from '@vicons/antd';
|
||||||
|
import CreateModal from './CreateModal.vue';
|
||||||
import editDialog from './edit.vue';
|
import editDialog from './edit.vue';
|
||||||
|
import { basicModal, useModal } from '@/components/Modal';
|
||||||
import { schemas } from './querySchemas';
|
import { schemas } from './querySchemas';
|
||||||
import { renderIcon } from '@/utils';
|
import { renderIcon } from '@/utils';
|
||||||
|
|
||||||
/**
|
|
||||||
* 定义常量
|
|
||||||
*/
|
|
||||||
const message = useMessage();
|
const message = useMessage();
|
||||||
const dialog = useDialog();
|
const dialog = useDialog();
|
||||||
const basicTableRef = ref();
|
const basicTableRef = ref();
|
||||||
@ -76,19 +76,14 @@
|
|||||||
const editVisible = ref(false);
|
const editVisible = ref(false);
|
||||||
const articleId = ref(0);
|
const articleId = ref(0);
|
||||||
const rowKeys = ref([]);
|
const rowKeys = ref([]);
|
||||||
const showModal = ref(false);
|
const exportLoading = ref(false);
|
||||||
|
|
||||||
/**
|
const showModal = ref(false);
|
||||||
* 定义查询参数
|
|
||||||
*/
|
|
||||||
const formParams = reactive({
|
const formParams = reactive({
|
||||||
title: '',
|
title: '',
|
||||||
status: '',
|
status: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
|
||||||
* 定义操作栏
|
|
||||||
*/
|
|
||||||
const actionColumn = reactive({
|
const actionColumn = reactive({
|
||||||
width: 200,
|
width: 200,
|
||||||
title: '操作',
|
title: '操作',
|
||||||
@ -118,36 +113,24 @@
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
function addTable() {
|
||||||
* 加载数据列表
|
showModal.value = true;
|
||||||
* @param res 参数
|
}
|
||||||
*/
|
|
||||||
const loadDataTable = async (res) => {
|
const loadDataTable = async (res) => {
|
||||||
rowKeys.value = [];
|
rowKeys.value = [];
|
||||||
const result = await getArticleList({ ...formParams, ...res });
|
const result = await getArticleList({ ...formParams, ...res });
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* 数据行选中事件
|
|
||||||
* @param keys 参数
|
|
||||||
*/
|
|
||||||
function onCheckedRow(keys) {
|
function onCheckedRow(keys) {
|
||||||
rowKeys.value = keys;
|
rowKeys.value = keys;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 刷新数据列表
|
|
||||||
* @param noRefresh 参数
|
|
||||||
*/
|
|
||||||
function reloadTable(noRefresh = '') {
|
function reloadTable(noRefresh = '') {
|
||||||
basicTableRef.value.reload(noRefresh ? {} : { pageNo: 1 });
|
basicTableRef.value.reload(noRefresh ? {} : { pageNo: 1 });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 执行提交表单
|
|
||||||
* @param values 参数
|
|
||||||
*/
|
|
||||||
function handleSubmit(values: Recordable) {
|
function handleSubmit(values: Recordable) {
|
||||||
for (const key in formParams) {
|
for (const key in formParams) {
|
||||||
formParams[key] = '';
|
formParams[key] = '';
|
||||||
@ -158,9 +141,6 @@
|
|||||||
reloadTable();
|
reloadTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 执行重置
|
|
||||||
*/
|
|
||||||
function handleReset(values: Recordable) {
|
function handleReset(values: Recordable) {
|
||||||
for (const key in formParams) {
|
for (const key in formParams) {
|
||||||
formParams[key] = '';
|
formParams[key] = '';
|
||||||
@ -171,9 +151,6 @@
|
|||||||
reloadTable();
|
reloadTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 执行注册
|
|
||||||
*/
|
|
||||||
const [register, {}] = useForm({
|
const [register, {}] = useForm({
|
||||||
gridProps: { cols: '1 s:1 m:2 l:3 xl:4 2xl:4' },
|
gridProps: { cols: '1 s:1 m:2 l:3 xl:4 2xl:4' },
|
||||||
labelWidth: 80,
|
labelWidth: 80,
|
||||||
@ -189,7 +166,6 @@
|
|||||||
await nextTick();
|
await nextTick();
|
||||||
createModalRef.value.openModal();
|
createModalRef.value.openModal();
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 执行编辑
|
* 执行编辑
|
||||||
*/
|
*/
|
||||||
@ -199,7 +175,6 @@
|
|||||||
await nextTick();
|
await nextTick();
|
||||||
createModalRef.value.openModal();
|
createModalRef.value.openModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 执行删除
|
* 执行删除
|
||||||
* @param id 参数
|
* @param id 参数
|
||||||
|
@ -103,19 +103,13 @@
|
|||||||
name: '',
|
name: '',
|
||||||
//排序
|
//排序
|
||||||
sort: 0,
|
sort: 0,
|
||||||
// 备注
|
|
||||||
note: '',
|
note: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
|
||||||
* 定义模态
|
|
||||||
*/
|
|
||||||
const [modalRegister, { openModal, setSubLoading }] = useModal({
|
const [modalRegister, { openModal, setSubLoading }] = useModal({
|
||||||
title: props.categoryId ? '编辑分类' : '添加分类',
|
title: props.categoryId ? '编辑分类' : '添加分类',
|
||||||
subBtuText: '确定',
|
subBtuText: '确定',
|
||||||
width: 600,
|
width: 600,
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 关闭窗体
|
* 关闭窗体
|
||||||
*/
|
*/
|
||||||
@ -128,7 +122,7 @@
|
|||||||
/**
|
/**
|
||||||
* 获取分类数据
|
* 获取分类数据
|
||||||
*/
|
*/
|
||||||
const getCategory = async () => {
|
const getcategory = async () => {
|
||||||
const data: any = await getCategoryList();
|
const data: any = await getCategoryList();
|
||||||
data.map((item) => {
|
data.map((item) => {
|
||||||
expandedKeys.value.push(item.id);
|
expandedKeys.value.push(item.id);
|
||||||
@ -177,17 +171,14 @@
|
|||||||
* 钩子函数
|
* 钩子函数
|
||||||
*/
|
*/
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getCategory();
|
getcategory();
|
||||||
if (props.categoryId) {
|
if (props.categoryId) {
|
||||||
getDetail();
|
getDetail();
|
||||||
} else {
|
} else {
|
||||||
formData.parentId = props.pid;
|
formData.parentId = props.pid;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
//导出方法
|
||||||
/**
|
|
||||||
* 定义函数
|
|
||||||
*/
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
openModal,
|
openModal,
|
||||||
});
|
});
|
||||||
|
@ -64,11 +64,8 @@
|
|||||||
const categoryId = ref(0);
|
const categoryId = ref(0);
|
||||||
const pid = ref(0);
|
const pid = ref(0);
|
||||||
|
|
||||||
/**
|
|
||||||
* 定义操作栏
|
|
||||||
*/
|
|
||||||
const actionColumn = reactive({
|
const actionColumn = reactive({
|
||||||
width: 250,
|
width: 220,
|
||||||
title: '操作',
|
title: '操作',
|
||||||
align: 'center',
|
align: 'center',
|
||||||
key: 'action',
|
key: 'action',
|
||||||
@ -104,7 +101,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取分类列表
|
* 获取部门列表
|
||||||
*/
|
*/
|
||||||
const loadDataTable = async (res) => {
|
const loadDataTable = async (res) => {
|
||||||
const data = await getCategoryList();
|
const data = await getCategoryList();
|
||||||
|
@ -66,16 +66,11 @@
|
|||||||
default: 0,
|
default: 0,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
|
||||||
* 定义模态
|
|
||||||
*/
|
|
||||||
const [modalRegister, { openModal, setSubLoading }] = useModal({
|
const [modalRegister, { openModal, setSubLoading }] = useModal({
|
||||||
title: props.tagId ? '编辑标签' : '添加标签',
|
title: props.tagId ? '编辑标签' : '添加标签',
|
||||||
subBtuText: '确定',
|
subBtuText: '确定',
|
||||||
width: 600,
|
width: 600,
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 执行提交
|
* 执行提交
|
||||||
*/
|
*/
|
||||||
@ -122,10 +117,7 @@
|
|||||||
setFormData();
|
setFormData();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
//导出方法
|
||||||
/**
|
|
||||||
* 定义函数
|
|
||||||
*/
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
openModal,
|
openModal,
|
||||||
});
|
});
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
</template>
|
</template>
|
||||||
新建
|
新建
|
||||||
</n-button>
|
</n-button>
|
||||||
|
|
||||||
<n-button
|
<n-button
|
||||||
type="error"
|
type="error"
|
||||||
@click="handleDelete"
|
@click="handleDelete"
|
||||||
@ -62,13 +63,12 @@
|
|||||||
import { getTagList, tagDelete, tagBatchDelete } from '@/api/content/tag';
|
import { getTagList, tagDelete, tagBatchDelete } from '@/api/content/tag';
|
||||||
import { columns } from './columns';
|
import { columns } from './columns';
|
||||||
import { PlusOutlined, DeleteOutlined, FormOutlined } from '@vicons/antd';
|
import { PlusOutlined, DeleteOutlined, FormOutlined } from '@vicons/antd';
|
||||||
|
import CreateModal from './CreateModal.vue';
|
||||||
import editDialog from './edit.vue';
|
import editDialog from './edit.vue';
|
||||||
|
import { basicModal, useModal } from '@/components/Modal';
|
||||||
import { schemas } from './querySchemas';
|
import { schemas } from './querySchemas';
|
||||||
import { renderIcon } from '@/utils';
|
import { renderIcon } from '@/utils';
|
||||||
|
|
||||||
/**
|
|
||||||
* 定义常量
|
|
||||||
*/
|
|
||||||
const message = useMessage();
|
const message = useMessage();
|
||||||
const dialog = useDialog();
|
const dialog = useDialog();
|
||||||
const basicTableRef = ref();
|
const basicTableRef = ref();
|
||||||
@ -76,18 +76,13 @@
|
|||||||
const editVisible = ref(false);
|
const editVisible = ref(false);
|
||||||
const tagId = ref(0);
|
const tagId = ref(0);
|
||||||
const rowKeys = ref([]);
|
const rowKeys = ref([]);
|
||||||
const showModal = ref(false);
|
const exportLoading = ref(false);
|
||||||
|
|
||||||
/**
|
const showModal = ref(false);
|
||||||
* 定义查询参数
|
|
||||||
*/
|
|
||||||
const formParams = reactive({
|
const formParams = reactive({
|
||||||
name: '',
|
name: '',
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
|
||||||
* 定义操作栏
|
|
||||||
*/
|
|
||||||
const actionColumn = reactive({
|
const actionColumn = reactive({
|
||||||
width: 200,
|
width: 200,
|
||||||
title: '操作',
|
title: '操作',
|
||||||
@ -117,36 +112,24 @@
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
function addTable() {
|
||||||
* 加载数据列表
|
showModal.value = true;
|
||||||
* @param res 参数
|
}
|
||||||
*/
|
|
||||||
const loadDataTable = async (res) => {
|
const loadDataTable = async (res) => {
|
||||||
rowKeys.value = [];
|
rowKeys.value = [];
|
||||||
const result = await getTagList({ ...formParams, ...res });
|
const result = await getTagList({ ...formParams, ...res });
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* 数据行选中事件
|
|
||||||
* @param keys 参数
|
|
||||||
*/
|
|
||||||
function onCheckedRow(keys) {
|
function onCheckedRow(keys) {
|
||||||
rowKeys.value = keys;
|
rowKeys.value = keys;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 刷新数据列表
|
|
||||||
* @param noRefresh 参数
|
|
||||||
*/
|
|
||||||
function reloadTable(noRefresh = '') {
|
function reloadTable(noRefresh = '') {
|
||||||
basicTableRef.value.reload(noRefresh ? {} : { pageNo: 1 });
|
basicTableRef.value.reload(noRefresh ? {} : { pageNo: 1 });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 执行提交表单
|
|
||||||
* @param values 参数
|
|
||||||
*/
|
|
||||||
function handleSubmit(values: Recordable) {
|
function handleSubmit(values: Recordable) {
|
||||||
for (const key in formParams) {
|
for (const key in formParams) {
|
||||||
formParams[key] = '';
|
formParams[key] = '';
|
||||||
@ -157,10 +140,6 @@
|
|||||||
reloadTable();
|
reloadTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 执行重置
|
|
||||||
* @param values 参数
|
|
||||||
*/
|
|
||||||
function handleReset(values: Recordable) {
|
function handleReset(values: Recordable) {
|
||||||
for (const key in formParams) {
|
for (const key in formParams) {
|
||||||
formParams[key] = '';
|
formParams[key] = '';
|
||||||
@ -171,9 +150,6 @@
|
|||||||
reloadTable();
|
reloadTable();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 执行注册
|
|
||||||
*/
|
|
||||||
const [register, {}] = useForm({
|
const [register, {}] = useForm({
|
||||||
gridProps: { cols: '1 s:1 m:2 l:3 xl:4 2xl:4' },
|
gridProps: { cols: '1 s:1 m:2 l:3 xl:4 2xl:4' },
|
||||||
labelWidth: 80,
|
labelWidth: 80,
|
||||||
@ -189,7 +165,6 @@
|
|||||||
await nextTick();
|
await nextTick();
|
||||||
createModalRef.value.openModal();
|
createModalRef.value.openModal();
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 执行编辑
|
* 执行编辑
|
||||||
*/
|
*/
|
||||||
@ -199,7 +174,6 @@
|
|||||||
await nextTick();
|
await nextTick();
|
||||||
createModalRef.value.openModal();
|
createModalRef.value.openModal();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 执行删除
|
* 执行删除
|
||||||
* @param id 参数
|
* @param id 参数
|
||||||
|
Loading…
Reference in New Issue
Block a user