feat 添加下载中心分类
This commit is contained in:
parent
42c3d66bb8
commit
e1bf0bf4b7
BIN
public/logo_500.ico
Normal file
BIN
public/logo_500.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 17 KiB |
@ -0,0 +1,48 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 下载分类树形查询列表
|
||||||
|
* @param {查询条件} data
|
||||||
|
*/
|
||||||
|
export function downloadCategoryTreeList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/business/DownloadCategory/getDownloadCategoryTreeList',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 下载分类新增或修改
|
||||||
|
export function addOrUpdateDownloadCategory(data) {
|
||||||
|
return request({
|
||||||
|
url: '/business/DownloadCategory/addOrUpdateDownloadCategory',
|
||||||
|
method: 'post',
|
||||||
|
data: data,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 下载分类删除
|
||||||
|
export function delDownloadCategory(ids) {
|
||||||
|
return request({
|
||||||
|
url: '/business/DownloadCategory/'+ ids,
|
||||||
|
method: 'delete'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 下载分类导出
|
||||||
|
export function exportDownloadCategory(query) {
|
||||||
|
return request({
|
||||||
|
url: 'business/DownloadCategory/exportDownloadCategory',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 下载分类审核
|
||||||
|
export function audit(data) {
|
||||||
|
return request({
|
||||||
|
url: 'business/DownloadCategory/audit',
|
||||||
|
method: 'put',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
Binary file not shown.
Before Width: | Height: | Size: 207 KiB |
BIN
src/assets/logo/logo_500.png
Normal file
BIN
src/assets/logo/logo_500.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 22 KiB |
@ -0,0 +1,137 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog v-model="props.modelValue" title="添加下载分类信息" width="900px" @closed="closeDialog" @open="openDialog">
|
||||||
|
<el-form ref="formRef" :model="formData" :rules="rules">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
|
||||||
|
<el-col :lg="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="上级菜单" prop="DownloadCategoryParentGuid">
|
||||||
|
<el-cascader class="w100" :options="dataList"
|
||||||
|
:props="{ checkStrictly: true, value: 'downloadCategoryGuid', label: 'downloadCategoryName', emitPath: false }"
|
||||||
|
placeholder="请选择上级菜单" clearable v-model="formData.downloadCategoryParentGuid">
|
||||||
|
<template #default="{ node, data }">
|
||||||
|
<span>{{ data.downloadCategoryName }}</span>
|
||||||
|
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
|
||||||
|
</template>
|
||||||
|
</el-cascader>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="名称" prop="downloadCategoryName">
|
||||||
|
<el-input v-model="formData.downloadCategoryName" placeholder="请输入名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="排序" prop="downloadCategorySort">
|
||||||
|
<el-input-number v-model.number="formData.downloadCategorySort" controls-position="right" :min="0" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<template #footer>
|
||||||
|
<div key="dialog-footer">
|
||||||
|
<el-button type="primary" @click="handleAddClick(formRef)">添加</el-button>
|
||||||
|
<el-button @click="handleResetClick(formRef)">重置</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { reactive, ref, watch } from "vue";
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
import modal from '@/plugins/modal.js'
|
||||||
|
import { downloadCategoryTreeList, addOrUpdateDownloadCategory } from '@/api/business/Download/DownloadCategorys/downloadCategory.js';
|
||||||
|
|
||||||
|
|
||||||
|
// 打开弹窗时回调
|
||||||
|
const openDialog = async () => {
|
||||||
|
|
||||||
|
await getaudit_status()
|
||||||
|
|
||||||
|
await getTreeList()
|
||||||
|
}
|
||||||
|
|
||||||
|
// -业务参数
|
||||||
|
const dataList = ref([])
|
||||||
|
// 审核状态字典选项列表
|
||||||
|
const audit_status = ref([]);
|
||||||
|
|
||||||
|
|
||||||
|
// -业务方法
|
||||||
|
// 字典获取
|
||||||
|
async function getaudit_status() {
|
||||||
|
await proxy.getDicts('audit_status').then((res) => {
|
||||||
|
audit_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// -基础参数
|
||||||
|
const labelWidth = 100;
|
||||||
|
const formRef = ref();
|
||||||
|
const { proxy } = getCurrentInstance()
|
||||||
|
const emits = defineEmits(["update:modelValue"]);
|
||||||
|
const formData = reactive({
|
||||||
|
downloadCategorySort: 100
|
||||||
|
});
|
||||||
|
const props = defineProps({
|
||||||
|
modelValue: Boolean,
|
||||||
|
done: Function,
|
||||||
|
});
|
||||||
|
const imgData = ref({
|
||||||
|
fileDir: "DownloadCategory"
|
||||||
|
})
|
||||||
|
|
||||||
|
// 验证
|
||||||
|
const rules = reactive({
|
||||||
|
downloadCategoryGuid: [{ required: true, message: "不能为空", trigger: "blur", type: "number" }],
|
||||||
|
downloadCategoryParentGuid: [{ required: true, message: "父级guid不能为空", trigger: "blur", type: "number" }],
|
||||||
|
downloadCategoryName: [{ required: true, message: "名称不能为空", trigger: "blur" }],
|
||||||
|
downloadCategorySort: [{ required: true, message: "排序不能为空", trigger: "blur", type: "number" }],
|
||||||
|
});
|
||||||
|
|
||||||
|
// -基础方法
|
||||||
|
async function getTreeList() {
|
||||||
|
downloadCategoryTreeList().then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
dataList.value = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
watch(props, async (v) => {
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// 提交
|
||||||
|
const handleAddClick = async (formEl) => {
|
||||||
|
if (!formEl) return;
|
||||||
|
formEl.validate(async (valid) => {
|
||||||
|
if (!valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const { code } = await addOrUpdateDownloadCategory(formData);
|
||||||
|
if (code == 200) {
|
||||||
|
modal.msgSuccess('添加成功')
|
||||||
|
closeDialog();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const closeDialog = () => {
|
||||||
|
handleResetClick(formRef.value);
|
||||||
|
props.done();
|
||||||
|
emits("update:modelValue", false);
|
||||||
|
};
|
||||||
|
const handleResetClick = async (formEl) => {
|
||||||
|
if (!formEl) return;
|
||||||
|
formEl.resetFields();
|
||||||
|
};
|
||||||
|
</script>
|
@ -0,0 +1,111 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog v-model="props.modelValue" title="下载分类信息详情" width="900px" @closed="closeDialog" @open="openDialog">
|
||||||
|
<el-form ref="formRef" :model="formData" :disabled="true">
|
||||||
|
|
||||||
|
<el-row :gutter="20">
|
||||||
|
|
||||||
|
<el-col :lg="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="上级菜单" prop="DownloadCategoryParentGuid">
|
||||||
|
<el-cascader class="w100" :options="dataList"
|
||||||
|
:props="{ checkStrictly: true, value: 'downloadCategoryGuid', label: 'downloadCategoryName', emitPath: false }"
|
||||||
|
placeholder="请选择上级菜单" clearable v-model="formData.downloadCategoryParentGuid">
|
||||||
|
<template #default="{ node, data }">
|
||||||
|
<span>{{ data.downloadCategoryName }}</span>
|
||||||
|
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
|
||||||
|
</template>
|
||||||
|
</el-cascader>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="名称" prop="downloadCategoryName">
|
||||||
|
<el-input v-model="formData.downloadCategoryName" placeholder="请输入名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="排序" prop="downloadCategorySort">
|
||||||
|
<el-input-number v-model.number="formData.downloadCategorySort" controls-position="right" :min="0" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="审核状态" prop="downloadCategoryAuditStatus">
|
||||||
|
<el-select v-model="formData.downloadCategoryAuditStatus" placeholder="请选择审核状态">
|
||||||
|
<el-option v-for="item in audit_status " :key="item.dictValue" :label="item.dictLabel"
|
||||||
|
:value="parseInt(item.dictValue)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="审核人guid" prop="downloadCategoryAuditUserGuid">
|
||||||
|
{{ formData.downloadCategoryAuditUserGuid }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
import { reactive, ref, watch } from "vue";
|
||||||
|
import { downloadCategoryTreeList } from "@/api/business/Download/DownloadCategorys/downloadCategory.js";
|
||||||
|
|
||||||
|
|
||||||
|
// 打开弹窗时回调
|
||||||
|
const openDialog = async () => {
|
||||||
|
await getaudit_status()
|
||||||
|
|
||||||
|
await getTreeList()
|
||||||
|
}
|
||||||
|
|
||||||
|
const formData = ref({
|
||||||
|
...props.data,
|
||||||
|
});
|
||||||
|
watch(props, async (v) => {
|
||||||
|
formData.value = v.data;
|
||||||
|
});
|
||||||
|
|
||||||
|
// -业务参数
|
||||||
|
const dataList = ref([])
|
||||||
|
// 审核状态字典选项列表
|
||||||
|
const audit_status = ref([]);
|
||||||
|
|
||||||
|
// -业务方法
|
||||||
|
// 字典获取
|
||||||
|
async function getaudit_status() {
|
||||||
|
await proxy.getDicts('audit_status').then((res) => {
|
||||||
|
audit_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// 基础参数
|
||||||
|
const formRef = ref();
|
||||||
|
const labelWidth = 100;
|
||||||
|
const { proxy } = getCurrentInstance()
|
||||||
|
const props = defineProps({
|
||||||
|
modelValue: Boolean,
|
||||||
|
data: Object,
|
||||||
|
done: Function,
|
||||||
|
});
|
||||||
|
const emits = defineEmits(["update:modelValue"]);
|
||||||
|
|
||||||
|
|
||||||
|
// -基础方法
|
||||||
|
async function getTreeList() {
|
||||||
|
downloadCategoryTreeList().then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
dataList.value = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
const closeDialog = () => {
|
||||||
|
emits("update:modelValue", false);
|
||||||
|
};
|
||||||
|
|
||||||
|
</script>
|
@ -0,0 +1,150 @@
|
|||||||
|
<template>
|
||||||
|
<el-dialog v-model="props.modelValue" title="修改下载分类信息" width="900px" @closed="closeDialog" @open="openDialog">
|
||||||
|
<el-form ref="formRef" :model="formData" :rules="rules">
|
||||||
|
<el-row :gutter="20">
|
||||||
|
|
||||||
|
<el-col :lg="24">
|
||||||
|
<el-form-item :label-width="labelWidth" label="上级菜单" prop="DownloadCategoryParentGuid">
|
||||||
|
<el-cascader class="w100" :options="dataList"
|
||||||
|
:props="{ checkStrictly: true, value: 'downloadCategoryGuid', label: 'downloadCategoryName', emitPath: false }"
|
||||||
|
placeholder="请选择上级菜单" clearable v-model="formData.downloadCategoryParentGuid">
|
||||||
|
<template #default="{ node, data }">
|
||||||
|
<span>{{ data.downloadCategoryName }}</span>
|
||||||
|
<span v-if="!node.isLeaf"> ({{ data.children.length }}) </span>
|
||||||
|
</template>
|
||||||
|
</el-cascader>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="名称" prop="downloadCategoryName">
|
||||||
|
<el-input v-model="formData.downloadCategoryName" placeholder="请输入名称" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="排序" prop="downloadCategorySort">
|
||||||
|
<el-input-number v-model.number="formData.downloadCategorySort" controls-position="right" :min="0" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="审核状态" prop="downloadCategoryAuditStatus">
|
||||||
|
<el-select v-model="formData.downloadCategoryAuditStatus" placeholder="请选择审核状态">
|
||||||
|
<el-option v-for="item in audit_status " :key="item.dictValue" :label="item.dictLabel"
|
||||||
|
:value="parseInt(item.dictValue)"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
<el-col :lg="12">
|
||||||
|
<el-form-item :label-width="labelWidth" label="审核人guid" prop="downloadCategoryAuditUserGuid">
|
||||||
|
{{ formData.downloadCategoryAuditUserGuid }}
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
|
|
||||||
|
</el-row>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<template #footer>
|
||||||
|
<div class="dialog-footer">
|
||||||
|
<el-button type="primary" @click="handleEditClick(formRef)">编辑</el-button>
|
||||||
|
<el-button @click="handleResetClick(formRef)">重置</el-button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</el-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import { ElMessage } from 'element-plus'
|
||||||
|
import modal from '@/plugins/modal.js'
|
||||||
|
import { reactive, ref, watch } from "vue";
|
||||||
|
import { downloadCategoryTreeList, addOrUpdateDownloadCategory } from "@/api/business/Download/DownloadCategorys/downloadCategory.js";
|
||||||
|
|
||||||
|
|
||||||
|
// 打开弹窗时回调
|
||||||
|
const openDialog = async () => {
|
||||||
|
await getaudit_status()
|
||||||
|
|
||||||
|
await getTreeList()
|
||||||
|
}
|
||||||
|
|
||||||
|
const formData = ref({
|
||||||
|
...props.data,
|
||||||
|
});
|
||||||
|
watch(props, async (v) => {
|
||||||
|
formData.value = v.data;
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
// 业务参数
|
||||||
|
const dataList = ref([])
|
||||||
|
// 审核状态字典选项列表
|
||||||
|
const audit_status = ref([]);
|
||||||
|
|
||||||
|
// -业务方法
|
||||||
|
//字典获取
|
||||||
|
async function getaudit_status() {
|
||||||
|
await proxy.getDicts('audit_status').then((res) => {
|
||||||
|
audit_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// -基础参数
|
||||||
|
const props = defineProps({
|
||||||
|
modelValue: Boolean,
|
||||||
|
data: Object,
|
||||||
|
done: Function,
|
||||||
|
});
|
||||||
|
|
||||||
|
const labelWidth = 100;
|
||||||
|
const formRef = ref();
|
||||||
|
const { proxy } = getCurrentInstance()
|
||||||
|
const emits = defineEmits(["update:modelValue"]);
|
||||||
|
const imgData = ref({
|
||||||
|
fileDir: "DownloadCategory"
|
||||||
|
})
|
||||||
|
|
||||||
|
// 验证
|
||||||
|
const rules = reactive({
|
||||||
|
downloadCategoryName: [{ required: true, message: "名称不能为空", trigger: "blur" }],
|
||||||
|
downloadCategorySort: [{ required: true, message: "排序不能为空", trigger: "blur", type: "number" }],
|
||||||
|
});
|
||||||
|
|
||||||
|
// -基础方法
|
||||||
|
async function getTreeList() {
|
||||||
|
downloadCategoryTreeList().then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
dataList.value = res.data
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 提交
|
||||||
|
const handleEditClick = async (formEl) => {
|
||||||
|
if (!formEl) return;
|
||||||
|
formEl.validate(async (valid) => {
|
||||||
|
if (!valid) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const { code } = await addOrUpdateDownloadCategory(formData.value);
|
||||||
|
if (code == 200) {
|
||||||
|
modal.msgSuccess('修改成功')
|
||||||
|
closeDialog();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleResetClick = async (formEl) => {
|
||||||
|
if (!formEl) return;
|
||||||
|
formEl.resetFields();
|
||||||
|
}
|
||||||
|
const closeDialog = () => {
|
||||||
|
props.done();
|
||||||
|
emits("update:modelValue", false);
|
||||||
|
};
|
||||||
|
|
||||||
|
</script>
|
324
src/views/business/Download/DownloadCategorys/index.vue
Normal file
324
src/views/business/Download/DownloadCategorys/index.vue
Normal file
@ -0,0 +1,324 @@
|
|||||||
|
<!--
|
||||||
|
* @Descripttion: (下载分类/tb_download_category)
|
||||||
|
* @version: (1.0)
|
||||||
|
* @Author: (admin)
|
||||||
|
* @Date: (2023-05-25)
|
||||||
|
* @LastEditors: (admin)
|
||||||
|
* @LastEditTime: (2023-05-25)
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-row :gutter="24">
|
||||||
|
<!-- 搜索框 queryParams.需要搜索的字段 -->
|
||||||
|
<el-form :model="queryParams" label-position="left" style="margin:15px;" inline ref="queryForm" label-width="68px"
|
||||||
|
v-show="showSearch" @submit.prevent>
|
||||||
|
<el-form-item label="名称" prop="downloadCategoryName">
|
||||||
|
<el-input v-model="queryParams.downloadCategoryName" placeholder="请输入名称" clearable @keyup.enter="handleQuery" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="审核状态" prop="downloadCategoryAuditStatus">
|
||||||
|
<el-select v-model="queryParams.downloadCategoryAuditStatus" placeholder="请选择审核状态" clearable
|
||||||
|
@change="handleQuery">
|
||||||
|
<el-option v-for="item in audit_status " :key="item.dictValue" :label="item.dictLabel"
|
||||||
|
:value="item.dictValue"></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button icon="search" type="primary" @click="handleQuery">{{ $t('btn.search') }}</el-button>
|
||||||
|
<el-button icon="refresh" @click="resetQuery">{{ $t('btn.reset') }}</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<!-- 工具按钮 -->
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="info" plain icon="sort" @click="toggleExpandAll">展开/折叠</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="primary" v-hasPermi="['business:downloadcategory:addOrUpdateKey']" plain icon="plus"
|
||||||
|
@click="AddDialogVisible = true">
|
||||||
|
{{ $t('btn.add') }}
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="danger" :disabled="multiple" v-hasPermi="['business:downloadcategory:delete']" plain
|
||||||
|
icon="delete" @click="handleDelete">
|
||||||
|
{{ $t('btn.delete') }}
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="warning" :disabled="multiple" v-hasPermi="['business:downloadcategory:audit']" plain icon="check"
|
||||||
|
@click="handleAudit">审核</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="warning" plain icon="download" @click="handleExport"
|
||||||
|
v-hasPermi="['business:downloadcategory:export']">
|
||||||
|
{{ $t('btn.export') }}
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<!-- 表格渲染 prop="对应的字段"-->
|
||||||
|
<el-table v-loading="loading" :data="dataList" ref="tableRef" highlight-current-row
|
||||||
|
@selection-change="handleSelectionChange" v-if="refreshTable" :default-expand-all="isExpandAll"
|
||||||
|
row-key="downloadCategoryGuid" :tree-props="{ children: 'children', hasChildren: 'hasChildren' }">
|
||||||
|
<el-table-column type="selection" width="50" align="center" />
|
||||||
|
|
||||||
|
<el-table-column prop="downloadCategoryName" label="名称" align="left" width="200" :show-overflow-tooltip="true" />
|
||||||
|
<el-table-column prop="downloadCategorySort" label="排序" align="center" width="200" sortable />
|
||||||
|
<el-table-column prop="downloadCategoryAuditStatus" label="审核状态" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<dict-tag :options="audit_status" :value="scope.row.downloadCategoryAuditStatus" />
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="操作" width="350" fixed="right">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button type="warning" v-if="scope.row.downloadCategoryAuditStatus == 1" size="small" icon="check"
|
||||||
|
@click="handleAudit(scope.row)" v-hasPermi="['business:downloadcategory:audit']">审核</el-button>
|
||||||
|
<el-button type="primary" v-if="scope.row.downloadCategoryAuditStatus == 2" size="small" icon="edit"
|
||||||
|
@click="handleUpdate(scope.row)" v-hasPermi="['business:downloadcategory:addOrUpdateKey']">编辑</el-button>
|
||||||
|
<el-button type="danger" size="small" icon="delete" @click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['business:downloadcategory:delete']">删除</el-button>
|
||||||
|
<el-button size="small" icon="view" @click="handleDetail(scope.row)">查看</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
</el-table>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 添加 -->
|
||||||
|
<AddDialog v-model="AddDialogVisible" :done="() => resetQuery()"></AddDialog>
|
||||||
|
<!-- 编辑 -->
|
||||||
|
<EditDialog v-model="EditDialogVisible" :data="EditDialogRow" :done="() => resetQuery()"></EditDialog>
|
||||||
|
<!-- 详情 -->
|
||||||
|
<DetailDialog v-model="DetailDialogVisible" :data="DetailDialogRow" :done="() => resetQuery()"></DetailDialog>
|
||||||
|
</template>
|
||||||
|
<script setup name="downloadcategory">
|
||||||
|
import { ElMessageBox } from 'element-plus'
|
||||||
|
import modal from '@/plugins/modal.js'
|
||||||
|
import { exportDownloadCategory, audit, downloadCategoryTreeList, delDownloadCategory } from '@/api/business/Download/DownloadCategorys/downloadCategory.js'
|
||||||
|
import AddDialog from "./components/AddDialog.vue";
|
||||||
|
import EditDialog from "./components/EditDialog.vue";
|
||||||
|
import DetailDialog from "./components/DetailDialog.vue";
|
||||||
|
|
||||||
|
const AddDialogVisible = ref(false);
|
||||||
|
const EditDialogVisible = ref(false);
|
||||||
|
const EditDialogRow = ref({});
|
||||||
|
const DetailDialogVisible = ref(false);
|
||||||
|
const DetailDialogRow = ref({});
|
||||||
|
|
||||||
|
const { proxy } = getCurrentInstance()
|
||||||
|
|
||||||
|
// 选中categoryId数组数组
|
||||||
|
const ids = ref([])
|
||||||
|
// 非单选禁用
|
||||||
|
const single = ref(true)
|
||||||
|
// 非多个禁用
|
||||||
|
const multiple = ref(true)
|
||||||
|
// 显示搜索条件
|
||||||
|
const showSearch = ref(true)
|
||||||
|
// 数据列表
|
||||||
|
const dataList = ref([])
|
||||||
|
// 总记录数
|
||||||
|
const total = ref(0)
|
||||||
|
// 是否加载
|
||||||
|
const loading = ref(true)
|
||||||
|
// 是否展开,默认全部折叠
|
||||||
|
const isExpandAll = ref(true)
|
||||||
|
const refreshTable = ref(true)
|
||||||
|
|
||||||
|
const data = reactive({
|
||||||
|
form: {},
|
||||||
|
queryParams: {
|
||||||
|
},
|
||||||
|
})
|
||||||
|
const { queryParams } = toRefs(data)
|
||||||
|
|
||||||
|
|
||||||
|
// 业务参数
|
||||||
|
|
||||||
|
|
||||||
|
// 业务方法
|
||||||
|
|
||||||
|
// 字典获取
|
||||||
|
const audit_status = ref([]);
|
||||||
|
async function getaudit_status() {
|
||||||
|
await proxy.getDicts('audit_status').then((res) => {
|
||||||
|
audit_status.value = res.data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
getaudit_status()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//基础方法
|
||||||
|
|
||||||
|
// 树形搜索
|
||||||
|
function selectChild(str, tag, res, parent) {
|
||||||
|
isExpandAll.value = true
|
||||||
|
for (let item of tag) {
|
||||||
|
if (item.downloadCategoryName.indexOf(str) !== -1) {
|
||||||
|
if (parent) {
|
||||||
|
res.push(parent)
|
||||||
|
} else {
|
||||||
|
res.push(item)
|
||||||
|
}
|
||||||
|
} else if (item.children && item.children.length) {
|
||||||
|
selectChild(str, item.children, res, parent || item)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 查询数据
|
||||||
|
function getList() {
|
||||||
|
loading.value = true
|
||||||
|
downloadCategoryTreeList(queryParams.value).then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
loading.value = false
|
||||||
|
|
||||||
|
if (queryParams.value.downloadCategoryName == undefined) {
|
||||||
|
isExpandAll.value = false
|
||||||
|
dataList.value = res.data
|
||||||
|
} else {
|
||||||
|
dataList.value = []
|
||||||
|
selectChild(queryParams.value.downloadCategoryName, res.data, dataList.value)
|
||||||
|
}
|
||||||
|
|
||||||
|
total.value = res.data.totalNum
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// 折叠/展开
|
||||||
|
function toggleExpandAll() {
|
||||||
|
refreshTable.value = false
|
||||||
|
isExpandAll.value = !isExpandAll.value
|
||||||
|
nextTick(() => {
|
||||||
|
refreshTable.value = true
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 多选框选中数据
|
||||||
|
function handleSelectionChange(selection) {
|
||||||
|
ids.value = selection.map((item) => item.downloadCategoryId)
|
||||||
|
single.value = selection.length != 1
|
||||||
|
multiple.value = !selection.length
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 重置查询操作 */
|
||||||
|
function resetQuery() {
|
||||||
|
proxy.resetForm('queryForm')
|
||||||
|
handleQuery()
|
||||||
|
}
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
function handleQuery() {
|
||||||
|
getList()
|
||||||
|
}
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
function handleDelete(row) {
|
||||||
|
const Ids = row.downloadCategoryId || ids.value
|
||||||
|
|
||||||
|
ElMessageBox.confirm("是否确认删除?", "系统提示", {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(function () {
|
||||||
|
return delDownloadCategory(Ids)
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
handleQuery()
|
||||||
|
modal.msgSuccess("删除成功")
|
||||||
|
})
|
||||||
|
.catch(() => { })
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
function handleExport(row) {
|
||||||
|
const Ids = row.downloadCategoryId || ids.value
|
||||||
|
const name = ref("所有")
|
||||||
|
|
||||||
|
if (Ids.length != 0) {
|
||||||
|
let str = ''
|
||||||
|
for (const key in Ids) {
|
||||||
|
str += Ids[key] + ','
|
||||||
|
}
|
||||||
|
str = str.slice(0, str.length - 1)
|
||||||
|
queryParams.value.ids = str
|
||||||
|
name.value = "选中"
|
||||||
|
}
|
||||||
|
|
||||||
|
ElMessageBox.confirm('是否确认导出' + name.value + '数据?', '警告', {
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning',
|
||||||
|
})
|
||||||
|
.then(function () {
|
||||||
|
return exportDownloadCategory(queryParams.value)
|
||||||
|
})
|
||||||
|
.then((response) => {
|
||||||
|
proxy.download(response.data.path)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
/** 审核按钮操作 */
|
||||||
|
const AuditData = reactive({
|
||||||
|
ids: null,
|
||||||
|
downloadCategoryAuditStatus: null,
|
||||||
|
})
|
||||||
|
function handleAudit(row) {
|
||||||
|
const Ids = row.downloadCategoryId || ids.value.toString()
|
||||||
|
|
||||||
|
ElMessageBox.confirm("是否通过审核?", "系统提示", {
|
||||||
|
distinguishCancelAndClose: true,
|
||||||
|
confirmButtonText: '通过',
|
||||||
|
cancelButtonText: '驳回',
|
||||||
|
type: "warning",
|
||||||
|
})
|
||||||
|
.then(async () => {
|
||||||
|
AuditData.downloadCategoryAuditStatus = 2
|
||||||
|
AuditData.ids = Ids
|
||||||
|
Audit()
|
||||||
|
})
|
||||||
|
.catch((action) => {
|
||||||
|
if (action == 'cancel') {
|
||||||
|
AuditData.downloadCategoryAuditStatus = 3
|
||||||
|
AuditData.ids = Ids
|
||||||
|
Audit()
|
||||||
|
// console.log("拒绝");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// console.log("关闭");
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
async function Audit() {
|
||||||
|
audit(AuditData).then((res) => {
|
||||||
|
if (res.code == 200) {
|
||||||
|
handleQuery()
|
||||||
|
ElMessageBox.alert(res.data, "审核信息", {
|
||||||
|
dangerouslyUseHTMLString: true,
|
||||||
|
confirmButtonText: "确定",
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.data);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
// 修改
|
||||||
|
function handleUpdate(row) {
|
||||||
|
EditDialogVisible.value = true
|
||||||
|
EditDialogRow.value = row
|
||||||
|
}
|
||||||
|
|
||||||
|
// 详情
|
||||||
|
function handleDetail(row) {
|
||||||
|
DetailDialogVisible.value = true
|
||||||
|
DetailDialogRow.value = row
|
||||||
|
}
|
||||||
|
|
||||||
|
handleQuery()
|
||||||
|
</script>
|
@ -65,11 +65,11 @@
|
|||||||
<el-checkbox v-model="scope.row.isEdit" :disabled="scope.row.isPk || scope.row.isIncrement"></el-checkbox>
|
<el-checkbox v-model="scope.row.isEdit" :disabled="scope.row.isPk || scope.row.isIncrement"></el-checkbox>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="导出" width="60" align="center">
|
<!-- <el-table-column label="导出" width="60" align="center">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-checkbox v-model="scope.row.isExport"> </el-checkbox>
|
<el-checkbox v-model="scope.row.isExport"> </el-checkbox>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="查询" align="center" label-class-name="text-green">
|
<el-table-column label="查询" align="center" label-class-name="text-green">
|
||||||
<el-table-column label="查询" width="60" align="center">
|
<el-table-column label="查询" width="60" align="center">
|
||||||
|
@ -111,8 +111,8 @@
|
|||||||
<el-option v-for="item in columns" :key="item.columnId" :label="item.csharpField" :value="item.csharpField"> </el-option>
|
<el-option v-for="item in columns" :key="item.columnId" :label="item.csharpField" :value="item.csharpField"> </el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
|
|
||||||
<el-radio v-model="info.sortType" label="asc">正序</el-radio>
|
<el-radio v-model="info.sortType" label="Asc">正序</el-radio>
|
||||||
<el-radio v-model="info.sortType" label="desc">倒序</el-radio>
|
<el-radio v-model="info.sortType" label="Desc">倒序</el-radio>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :lg="12">
|
<el-col :lg="12">
|
||||||
@ -361,7 +361,7 @@ const rules = ref({
|
|||||||
required: true,
|
required: true,
|
||||||
message: '请输入生成模块名',
|
message: '请输入生成模块名',
|
||||||
trigger: 'blur',
|
trigger: 'blur',
|
||||||
pattern: /^[A-Za-z]+$/
|
// pattern: /^[A-Za-z]+$/
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
businessName: [
|
businessName: [
|
||||||
|
Loading…
Reference in New Issue
Block a user