import { defineComponent, ref, reactive, resolveComponent, mergeProps, withCtx, unref, createTextVNode, toDisplayString, createVNode, isRef, createBlock, createCommentVNode, openBlock, useSSRContext } from 'vue'; import { ssrRenderAttrs, ssrRenderComponent, ssrInterpolate } from 'vue/server-renderer'; import { message } from 'ant-design-vue'; import { PlusOutlined } from '@ant-design/icons-vue'; import { a as _export_sfc, c as useHead } from './server.mjs'; import '../nitro/nitro.mjs'; import 'node:http'; import 'node:https'; import 'node:events'; import 'node:buffer'; import 'node:fs'; import 'node:path'; import 'node:crypto'; import 'node:url'; import 'better-sqlite3'; import 'vue-router'; import '@babel/runtime/helpers/esm/extends'; import 'stylis'; import 'dayjs'; import '../routes/renderer.mjs'; import 'vue-bundle-renderer/runtime'; import 'unhead/server'; import 'devalue'; import 'unhead/plugins'; import 'unhead/utils'; const _sfc_main = /* @__PURE__ */ defineComponent({ __name: "downloads", __ssrInlineRender: true, setup(__props) { useHead({ title: "资料下载管理" }); const loading = ref(false); const saving = ref(false); const modalVisible = ref(false); const editingRecord = ref(null); const fileList = ref([]); const activeCategory = ref(""); const total = ref(0); const formData = reactive({ fileName: "", category: "form", memberOnly: false, description: "" }); const columns = [ { title: "文件名称", key: "fileName" }, { title: "分类", key: "category", width: 110 }, { title: "文件大小", dataIndex: "fileSize", key: "fileSize", width: 100 }, { title: "下载次数", dataIndex: "downloadCount", key: "downloadCount", width: 100 }, { title: "权限", key: "memberOnly", width: 100 }, { title: "上传时间", dataIndex: "uploadTime", key: "uploadTime", width: 150 }, { title: "操作", key: "action", width: 200 } ]; const dataSource = ref([ { id: 1, fileName: "企业会员入会申请表.docx", fileType: "docx", category: "form", fileSize: "35KB", downloadCount: 128, memberOnly: false, uploadTime: "2024-11-01" }, { id: 2, fileName: "个人会员入会申请表.docx", fileType: "docx", category: "form", fileSize: "32KB", downloadCount: 96, memberOnly: false, uploadTime: "2024-11-01" }, { id: 3, fileName: "专家申请表.docx", fileType: "docx", category: "form", fileSize: "40KB", downloadCount: 65, memberOnly: false, uploadTime: "2024-11-01" }, { id: 4, fileName: "广西经济社会发展研究报告2024.pdf", fileType: "pdf", category: "report", fileSize: "2.8MB", downloadCount: 342, memberOnly: true, uploadTime: "2024-12-01" }, { id: 5, fileName: "广西数字经济政策汇编.pdf", fileType: "pdf", category: "policy", fileSize: "1.2MB", downloadCount: 215, memberOnly: false, uploadTime: "2024-11-15" } ]); function getFileIcon(type) { const iconMap = { pdf: "📕", docx: "📘", doc: "📘", xlsx: "📗", pptx: "📙", zip: "📦" }; return iconMap[type] || "📄"; } function getCategoryLabel(cat) { const map = { form: "申请表格", report: "研究报告", policy: "政策文件", other: "其他" }; return map[cat] || cat; } function handleAdd() { editingRecord.value = null; Object.assign(formData, { fileName: "", category: "form", memberOnly: false, description: "" }); fileList.value = []; modalVisible.value = true; } function handleEdit(record) { editingRecord.value = record; Object.assign(formData, { fileName: record.fileName, category: record.category, memberOnly: record.memberOnly, description: record.description || "" }); modalVisible.value = true; } async function handleSave() { saving.value = true; try { message.success(editingRecord.value ? "文件信息已更新" : "文件上传成功"); modalVisible.value = false; loadData(); } finally { saving.value = false; } } async function handleDelete(record) { message.success("文件已删除"); } function previewFile(record) { message.info(`预览:${record.fileName}`); } async function loadData() { total.value = dataSource.value.length; } return (_ctx, _push, _parent, _attrs) => { const _component_a_tag = resolveComponent("a-tag"); const _component_a_button = resolveComponent("a-button"); const _component_a_radio_group = resolveComponent("a-radio-group"); const _component_a_radio_button = resolveComponent("a-radio-button"); const _component_a_table = resolveComponent("a-table"); const _component_a_space = resolveComponent("a-space"); const _component_a_popconfirm = resolveComponent("a-popconfirm"); const _component_a_modal = resolveComponent("a-modal"); const _component_a_form = resolveComponent("a-form"); const _component_a_form_item = resolveComponent("a-form-item"); const _component_a_upload = resolveComponent("a-upload"); const _component_a_input = resolveComponent("a-input"); const _component_a_row = resolveComponent("a-row"); const _component_a_col = resolveComponent("a-col"); const _component_a_select = resolveComponent("a-select"); const _component_a_select_option = resolveComponent("a-select-option"); const _component_a_radio = resolveComponent("a-radio"); const _component_a_textarea = resolveComponent("a-textarea"); _push(`

资料下载管理

`); _push(ssrRenderComponent(_component_a_tag, null, { default: withCtx((_, _push2, _parent2, _scopeId) => { if (_push2) { _push2(`共 ${ssrInterpolate(unref(total))} 个文件`); } else { return [ createTextVNode("共 " + toDisplayString(unref(total)) + " 个文件", 1) ]; } }), _: 1 }, _parent)); _push(`
`); _push(ssrRenderComponent(_component_a_button, { type: "primary", onClick: handleAdd }, { icon: withCtx((_, _push2, _parent2, _scopeId) => { if (_push2) { _push2(ssrRenderComponent(unref(PlusOutlined), null, null, _parent2, _scopeId)); } else { return [ createVNode(unref(PlusOutlined)) ]; } }), default: withCtx((_, _push2, _parent2, _scopeId) => { if (_push2) { _push2(` 上传文件 `); } else { return [ createTextVNode(" 上传文件 ") ]; } }), _: 1 }, _parent)); _push(`
`); _push(ssrRenderComponent(_component_a_radio_group, { value: unref(activeCategory), "onUpdate:value": ($event) => isRef(activeCategory) ? activeCategory.value = $event : null, "button-style": "solid", onChange: loadData }, { default: withCtx((_, _push2, _parent2, _scopeId) => { if (_push2) { _push2(ssrRenderComponent(_component_a_radio_button, { value: "" }, { default: withCtx((_2, _push3, _parent3, _scopeId2) => { if (_push3) { _push3(`全部`); } else { return [ createTextVNode("全部") ]; } }), _: 1 }, _parent2, _scopeId)); _push2(ssrRenderComponent(_component_a_radio_button, { value: "form" }, { default: withCtx((_2, _push3, _parent3, _scopeId2) => { if (_push3) { _push3(`申请表格`); } else { return [ createTextVNode("申请表格") ]; } }), _: 1 }, _parent2, _scopeId)); _push2(ssrRenderComponent(_component_a_radio_button, { value: "report" }, { default: withCtx((_2, _push3, _parent3, _scopeId2) => { if (_push3) { _push3(`研究报告`); } else { return [ createTextVNode("研究报告") ]; } }), _: 1 }, _parent2, _scopeId)); _push2(ssrRenderComponent(_component_a_radio_button, { value: "policy" }, { default: withCtx((_2, _push3, _parent3, _scopeId2) => { if (_push3) { _push3(`政策文件`); } else { return [ createTextVNode("政策文件") ]; } }), _: 1 }, _parent2, _scopeId)); _push2(ssrRenderComponent(_component_a_radio_button, { value: "other" }, { default: withCtx((_2, _push3, _parent3, _scopeId2) => { if (_push3) { _push3(`其他`); } else { return [ createTextVNode("其他") ]; } }), _: 1 }, _parent2, _scopeId)); } else { return [ createVNode(_component_a_radio_button, { value: "" }, { default: withCtx(() => [ createTextVNode("全部") ]), _: 1 }), createVNode(_component_a_radio_button, { value: "form" }, { default: withCtx(() => [ createTextVNode("申请表格") ]), _: 1 }), createVNode(_component_a_radio_button, { value: "report" }, { default: withCtx(() => [ createTextVNode("研究报告") ]), _: 1 }), createVNode(_component_a_radio_button, { value: "policy" }, { default: withCtx(() => [ createTextVNode("政策文件") ]), _: 1 }), createVNode(_component_a_radio_button, { value: "other" }, { default: withCtx(() => [ createTextVNode("其他") ]), _: 1 }) ]; } }), _: 1 }, _parent)); _push(`
`); _push(ssrRenderComponent(_component_a_table, { columns, "data-source": unref(dataSource), loading: unref(loading), "row-key": "id", pagination: { total: unref(total), pageSize: 15, showTotal: (t) => `共 ${t} 条` } }, { bodyCell: withCtx(({ column, record }, _push2, _parent2, _scopeId) => { if (_push2) { if (column.key === "fileName") { _push2(`
${ssrInterpolate(getFileIcon(record.fileType))}${ssrInterpolate(record.fileName)}
`); } else { _push2(``); } if (column.key === "category") { _push2(ssrRenderComponent(_component_a_tag, null, { default: withCtx((_, _push3, _parent3, _scopeId2) => { if (_push3) { _push3(`${ssrInterpolate(getCategoryLabel(record.category))}`); } else { return [ createTextVNode(toDisplayString(getCategoryLabel(record.category)), 1) ]; } }), _: 2 }, _parent2, _scopeId)); } else { _push2(``); } if (column.key === "memberOnly") { _push2(ssrRenderComponent(_component_a_tag, { color: record.memberOnly ? "blue" : "default" }, { default: withCtx((_, _push3, _parent3, _scopeId2) => { if (_push3) { _push3(`${ssrInterpolate(record.memberOnly ? "会员专享" : "公开")}`); } else { return [ createTextVNode(toDisplayString(record.memberOnly ? "会员专享" : "公开"), 1) ]; } }), _: 2 }, _parent2, _scopeId)); } else { _push2(``); } if (column.key === "action") { _push2(ssrRenderComponent(_component_a_space, null, { default: withCtx((_, _push3, _parent3, _scopeId2) => { if (_push3) { _push3(ssrRenderComponent(_component_a_button, { size: "small", onClick: ($event) => handleEdit(record) }, { default: withCtx((_2, _push4, _parent4, _scopeId3) => { if (_push4) { _push4(`编辑`); } else { return [ createTextVNode("编辑") ]; } }), _: 2 }, _parent3, _scopeId2)); _push3(ssrRenderComponent(_component_a_button, { size: "small", onClick: ($event) => previewFile(record) }, { default: withCtx((_2, _push4, _parent4, _scopeId3) => { if (_push4) { _push4(`预览`); } else { return [ createTextVNode("预览") ]; } }), _: 2 }, _parent3, _scopeId2)); _push3(ssrRenderComponent(_component_a_popconfirm, { title: "确定删除此文件?", onConfirm: ($event) => handleDelete() }, { default: withCtx((_2, _push4, _parent4, _scopeId3) => { if (_push4) { _push4(ssrRenderComponent(_component_a_button, { size: "small", danger: "" }, { default: withCtx((_3, _push5, _parent5, _scopeId4) => { if (_push5) { _push5(`删除`); } else { return [ createTextVNode("删除") ]; } }), _: 2 }, _parent4, _scopeId3)); } else { return [ createVNode(_component_a_button, { size: "small", danger: "" }, { default: withCtx(() => [ createTextVNode("删除") ]), _: 1 }) ]; } }), _: 2 }, _parent3, _scopeId2)); } else { return [ createVNode(_component_a_button, { size: "small", onClick: ($event) => handleEdit(record) }, { default: withCtx(() => [ createTextVNode("编辑") ]), _: 1 }, 8, ["onClick"]), createVNode(_component_a_button, { size: "small", onClick: ($event) => previewFile(record) }, { default: withCtx(() => [ createTextVNode("预览") ]), _: 1 }, 8, ["onClick"]), createVNode(_component_a_popconfirm, { title: "确定删除此文件?", onConfirm: ($event) => handleDelete() }, { default: withCtx(() => [ createVNode(_component_a_button, { size: "small", danger: "" }, { default: withCtx(() => [ createTextVNode("删除") ]), _: 1 }) ]), _: 1 }, 8, ["onConfirm"]) ]; } }), _: 2 }, _parent2, _scopeId)); } else { _push2(``); } } else { return [ column.key === "fileName" ? (openBlock(), createBlock("div", { key: 0, class: "file-info" }, [ createVNode("span", { class: "file-icon" }, toDisplayString(getFileIcon(record.fileType)), 1), createVNode("span", { class: "file-name" }, toDisplayString(record.fileName), 1) ])) : createCommentVNode("", true), column.key === "category" ? (openBlock(), createBlock(_component_a_tag, { key: 1 }, { default: withCtx(() => [ createTextVNode(toDisplayString(getCategoryLabel(record.category)), 1) ]), _: 2 }, 1024)) : createCommentVNode("", true), column.key === "memberOnly" ? (openBlock(), createBlock(_component_a_tag, { key: 2, color: record.memberOnly ? "blue" : "default" }, { default: withCtx(() => [ createTextVNode(toDisplayString(record.memberOnly ? "会员专享" : "公开"), 1) ]), _: 2 }, 1032, ["color"])) : createCommentVNode("", true), column.key === "action" ? (openBlock(), createBlock(_component_a_space, { key: 3 }, { default: withCtx(() => [ createVNode(_component_a_button, { size: "small", onClick: ($event) => handleEdit(record) }, { default: withCtx(() => [ createTextVNode("编辑") ]), _: 1 }, 8, ["onClick"]), createVNode(_component_a_button, { size: "small", onClick: ($event) => previewFile(record) }, { default: withCtx(() => [ createTextVNode("预览") ]), _: 1 }, 8, ["onClick"]), createVNode(_component_a_popconfirm, { title: "确定删除此文件?", onConfirm: ($event) => handleDelete() }, { default: withCtx(() => [ createVNode(_component_a_button, { size: "small", danger: "" }, { default: withCtx(() => [ createTextVNode("删除") ]), _: 1 }) ]), _: 1 }, 8, ["onConfirm"]) ]), _: 2 }, 1024)) : createCommentVNode("", true) ]; } }), _: 1 }, _parent)); _push(`
`); _push(ssrRenderComponent(_component_a_modal, { open: unref(modalVisible), "onUpdate:open": ($event) => isRef(modalVisible) ? modalVisible.value = $event : null, title: unref(editingRecord) ? "编辑文件信息" : "上传文件", onOk: handleSave, "confirm-loading": unref(saving), width: "560px" }, { default: withCtx((_, _push2, _parent2, _scopeId) => { if (_push2) { _push2(ssrRenderComponent(_component_a_form, { model: unref(formData), layout: "vertical" }, { default: withCtx((_2, _push3, _parent3, _scopeId2) => { if (_push3) { if (!unref(editingRecord)) { _push3(ssrRenderComponent(_component_a_form_item, { label: "文件" }, { default: withCtx((_3, _push4, _parent4, _scopeId3) => { if (_push4) { _push4(ssrRenderComponent(_component_a_upload, { "file-list": unref(fileList), "onUpdate:fileList": ($event) => isRef(fileList) ? fileList.value = $event : null, "max-count": 1, "before-upload": () => false }, { default: withCtx((_4, _push5, _parent5, _scopeId4) => { if (_push5) { _push5(ssrRenderComponent(_component_a_button, null, { icon: withCtx((_5, _push6, _parent6, _scopeId5) => { if (_push6) { _push6(`📎`); } else { return [ createTextVNode("📎") ]; } }), default: withCtx((_5, _push6, _parent6, _scopeId5) => { if (_push6) { _push6(`选择文件`); } else { return [ createTextVNode("选择文件") ]; } }), _: 1 }, _parent5, _scopeId4)); } else { return [ createVNode(_component_a_button, null, { icon: withCtx(() => [ createTextVNode("📎") ]), default: withCtx(() => [ createTextVNode("选择文件") ]), _: 1 }) ]; } }), _: 1 }, _parent4, _scopeId3)); } else { return [ createVNode(_component_a_upload, { "file-list": unref(fileList), "onUpdate:fileList": ($event) => isRef(fileList) ? fileList.value = $event : null, "max-count": 1, "before-upload": () => false }, { default: withCtx(() => [ createVNode(_component_a_button, null, { icon: withCtx(() => [ createTextVNode("📎") ]), default: withCtx(() => [ createTextVNode("选择文件") ]), _: 1 }) ]), _: 1 }, 8, ["file-list", "onUpdate:fileList"]) ]; } }), _: 1 }, _parent3, _scopeId2)); } else { _push3(``); } _push3(ssrRenderComponent(_component_a_form_item, { label: "显示名称", required: "" }, { default: withCtx((_3, _push4, _parent4, _scopeId3) => { if (_push4) { _push4(ssrRenderComponent(_component_a_input, { value: unref(formData).fileName, "onUpdate:value": ($event) => unref(formData).fileName = $event, placeholder: "请输入文件显示名称" }, null, _parent4, _scopeId3)); } else { return [ createVNode(_component_a_input, { value: unref(formData).fileName, "onUpdate:value": ($event) => unref(formData).fileName = $event, placeholder: "请输入文件显示名称" }, null, 8, ["value", "onUpdate:value"]) ]; } }), _: 1 }, _parent3, _scopeId2)); _push3(ssrRenderComponent(_component_a_row, { gutter: 16 }, { default: withCtx((_3, _push4, _parent4, _scopeId3) => { if (_push4) { _push4(ssrRenderComponent(_component_a_col, { span: 12 }, { default: withCtx((_4, _push5, _parent5, _scopeId4) => { if (_push5) { _push5(ssrRenderComponent(_component_a_form_item, { label: "文件分类" }, { default: withCtx((_5, _push6, _parent6, _scopeId5) => { if (_push6) { _push6(ssrRenderComponent(_component_a_select, { value: unref(formData).category, "onUpdate:value": ($event) => unref(formData).category = $event }, { default: withCtx((_6, _push7, _parent7, _scopeId6) => { if (_push7) { _push7(ssrRenderComponent(_component_a_select_option, { value: "form" }, { default: withCtx((_7, _push8, _parent8, _scopeId7) => { if (_push8) { _push8(`申请表格`); } else { return [ createTextVNode("申请表格") ]; } }), _: 1 }, _parent7, _scopeId6)); _push7(ssrRenderComponent(_component_a_select_option, { value: "report" }, { default: withCtx((_7, _push8, _parent8, _scopeId7) => { if (_push8) { _push8(`研究报告`); } else { return [ createTextVNode("研究报告") ]; } }), _: 1 }, _parent7, _scopeId6)); _push7(ssrRenderComponent(_component_a_select_option, { value: "policy" }, { default: withCtx((_7, _push8, _parent8, _scopeId7) => { if (_push8) { _push8(`政策文件`); } else { return [ createTextVNode("政策文件") ]; } }), _: 1 }, _parent7, _scopeId6)); _push7(ssrRenderComponent(_component_a_select_option, { value: "other" }, { default: withCtx((_7, _push8, _parent8, _scopeId7) => { if (_push8) { _push8(`其他`); } else { return [ createTextVNode("其他") ]; } }), _: 1 }, _parent7, _scopeId6)); } else { return [ createVNode(_component_a_select_option, { value: "form" }, { default: withCtx(() => [ createTextVNode("申请表格") ]), _: 1 }), createVNode(_component_a_select_option, { value: "report" }, { default: withCtx(() => [ createTextVNode("研究报告") ]), _: 1 }), createVNode(_component_a_select_option, { value: "policy" }, { default: withCtx(() => [ createTextVNode("政策文件") ]), _: 1 }), createVNode(_component_a_select_option, { value: "other" }, { default: withCtx(() => [ createTextVNode("其他") ]), _: 1 }) ]; } }), _: 1 }, _parent6, _scopeId5)); } else { return [ createVNode(_component_a_select, { value: unref(formData).category, "onUpdate:value": ($event) => unref(formData).category = $event }, { default: withCtx(() => [ createVNode(_component_a_select_option, { value: "form" }, { default: withCtx(() => [ createTextVNode("申请表格") ]), _: 1 }), createVNode(_component_a_select_option, { value: "report" }, { default: withCtx(() => [ createTextVNode("研究报告") ]), _: 1 }), createVNode(_component_a_select_option, { value: "policy" }, { default: withCtx(() => [ createTextVNode("政策文件") ]), _: 1 }), createVNode(_component_a_select_option, { value: "other" }, { default: withCtx(() => [ createTextVNode("其他") ]), _: 1 }) ]), _: 1 }, 8, ["value", "onUpdate:value"]) ]; } }), _: 1 }, _parent5, _scopeId4)); } else { return [ createVNode(_component_a_form_item, { label: "文件分类" }, { default: withCtx(() => [ createVNode(_component_a_select, { value: unref(formData).category, "onUpdate:value": ($event) => unref(formData).category = $event }, { default: withCtx(() => [ createVNode(_component_a_select_option, { value: "form" }, { default: withCtx(() => [ createTextVNode("申请表格") ]), _: 1 }), createVNode(_component_a_select_option, { value: "report" }, { default: withCtx(() => [ createTextVNode("研究报告") ]), _: 1 }), createVNode(_component_a_select_option, { value: "policy" }, { default: withCtx(() => [ createTextVNode("政策文件") ]), _: 1 }), createVNode(_component_a_select_option, { value: "other" }, { default: withCtx(() => [ createTextVNode("其他") ]), _: 1 }) ]), _: 1 }, 8, ["value", "onUpdate:value"]) ]), _: 1 }) ]; } }), _: 1 }, _parent4, _scopeId3)); _push4(ssrRenderComponent(_component_a_col, { span: 12 }, { default: withCtx((_4, _push5, _parent5, _scopeId4) => { if (_push5) { _push5(ssrRenderComponent(_component_a_form_item, { label: "访问权限" }, { default: withCtx((_5, _push6, _parent6, _scopeId5) => { if (_push6) { _push6(ssrRenderComponent(_component_a_radio_group, { value: unref(formData).memberOnly, "onUpdate:value": ($event) => unref(formData).memberOnly = $event }, { default: withCtx((_6, _push7, _parent7, _scopeId6) => { if (_push7) { _push7(ssrRenderComponent(_component_a_radio, { value: false }, { default: withCtx((_7, _push8, _parent8, _scopeId7) => { if (_push8) { _push8(`公开`); } else { return [ createTextVNode("公开") ]; } }), _: 1 }, _parent7, _scopeId6)); _push7(ssrRenderComponent(_component_a_radio, { value: true }, { default: withCtx((_7, _push8, _parent8, _scopeId7) => { if (_push8) { _push8(`会员专享`); } else { return [ createTextVNode("会员专享") ]; } }), _: 1 }, _parent7, _scopeId6)); } else { return [ createVNode(_component_a_radio, { value: false }, { default: withCtx(() => [ createTextVNode("公开") ]), _: 1 }), createVNode(_component_a_radio, { value: true }, { default: withCtx(() => [ createTextVNode("会员专享") ]), _: 1 }) ]; } }), _: 1 }, _parent6, _scopeId5)); } else { return [ createVNode(_component_a_radio_group, { value: unref(formData).memberOnly, "onUpdate:value": ($event) => unref(formData).memberOnly = $event }, { default: withCtx(() => [ createVNode(_component_a_radio, { value: false }, { default: withCtx(() => [ createTextVNode("公开") ]), _: 1 }), createVNode(_component_a_radio, { value: true }, { default: withCtx(() => [ createTextVNode("会员专享") ]), _: 1 }) ]), _: 1 }, 8, ["value", "onUpdate:value"]) ]; } }), _: 1 }, _parent5, _scopeId4)); } else { return [ createVNode(_component_a_form_item, { label: "访问权限" }, { default: withCtx(() => [ createVNode(_component_a_radio_group, { value: unref(formData).memberOnly, "onUpdate:value": ($event) => unref(formData).memberOnly = $event }, { default: withCtx(() => [ createVNode(_component_a_radio, { value: false }, { default: withCtx(() => [ createTextVNode("公开") ]), _: 1 }), createVNode(_component_a_radio, { value: true }, { default: withCtx(() => [ createTextVNode("会员专享") ]), _: 1 }) ]), _: 1 }, 8, ["value", "onUpdate:value"]) ]), _: 1 }) ]; } }), _: 1 }, _parent4, _scopeId3)); } else { return [ createVNode(_component_a_col, { span: 12 }, { default: withCtx(() => [ createVNode(_component_a_form_item, { label: "文件分类" }, { default: withCtx(() => [ createVNode(_component_a_select, { value: unref(formData).category, "onUpdate:value": ($event) => unref(formData).category = $event }, { default: withCtx(() => [ createVNode(_component_a_select_option, { value: "form" }, { default: withCtx(() => [ createTextVNode("申请表格") ]), _: 1 }), createVNode(_component_a_select_option, { value: "report" }, { default: withCtx(() => [ createTextVNode("研究报告") ]), _: 1 }), createVNode(_component_a_select_option, { value: "policy" }, { default: withCtx(() => [ createTextVNode("政策文件") ]), _: 1 }), createVNode(_component_a_select_option, { value: "other" }, { default: withCtx(() => [ createTextVNode("其他") ]), _: 1 }) ]), _: 1 }, 8, ["value", "onUpdate:value"]) ]), _: 1 }) ]), _: 1 }), createVNode(_component_a_col, { span: 12 }, { default: withCtx(() => [ createVNode(_component_a_form_item, { label: "访问权限" }, { default: withCtx(() => [ createVNode(_component_a_radio_group, { value: unref(formData).memberOnly, "onUpdate:value": ($event) => unref(formData).memberOnly = $event }, { default: withCtx(() => [ createVNode(_component_a_radio, { value: false }, { default: withCtx(() => [ createTextVNode("公开") ]), _: 1 }), createVNode(_component_a_radio, { value: true }, { default: withCtx(() => [ createTextVNode("会员专享") ]), _: 1 }) ]), _: 1 }, 8, ["value", "onUpdate:value"]) ]), _: 1 }) ]), _: 1 }) ]; } }), _: 1 }, _parent3, _scopeId2)); _push3(ssrRenderComponent(_component_a_form_item, { label: "文件描述" }, { default: withCtx((_3, _push4, _parent4, _scopeId3) => { if (_push4) { _push4(ssrRenderComponent(_component_a_textarea, { value: unref(formData).description, "onUpdate:value": ($event) => unref(formData).description = $event, rows: 3, placeholder: "请输入文件描述" }, null, _parent4, _scopeId3)); } else { return [ createVNode(_component_a_textarea, { value: unref(formData).description, "onUpdate:value": ($event) => unref(formData).description = $event, rows: 3, placeholder: "请输入文件描述" }, null, 8, ["value", "onUpdate:value"]) ]; } }), _: 1 }, _parent3, _scopeId2)); } else { return [ !unref(editingRecord) ? (openBlock(), createBlock(_component_a_form_item, { key: 0, label: "文件" }, { default: withCtx(() => [ createVNode(_component_a_upload, { "file-list": unref(fileList), "onUpdate:fileList": ($event) => isRef(fileList) ? fileList.value = $event : null, "max-count": 1, "before-upload": () => false }, { default: withCtx(() => [ createVNode(_component_a_button, null, { icon: withCtx(() => [ createTextVNode("📎") ]), default: withCtx(() => [ createTextVNode("选择文件") ]), _: 1 }) ]), _: 1 }, 8, ["file-list", "onUpdate:fileList"]) ]), _: 1 })) : createCommentVNode("", true), createVNode(_component_a_form_item, { label: "显示名称", required: "" }, { default: withCtx(() => [ createVNode(_component_a_input, { value: unref(formData).fileName, "onUpdate:value": ($event) => unref(formData).fileName = $event, placeholder: "请输入文件显示名称" }, null, 8, ["value", "onUpdate:value"]) ]), _: 1 }), createVNode(_component_a_row, { gutter: 16 }, { default: withCtx(() => [ createVNode(_component_a_col, { span: 12 }, { default: withCtx(() => [ createVNode(_component_a_form_item, { label: "文件分类" }, { default: withCtx(() => [ createVNode(_component_a_select, { value: unref(formData).category, "onUpdate:value": ($event) => unref(formData).category = $event }, { default: withCtx(() => [ createVNode(_component_a_select_option, { value: "form" }, { default: withCtx(() => [ createTextVNode("申请表格") ]), _: 1 }), createVNode(_component_a_select_option, { value: "report" }, { default: withCtx(() => [ createTextVNode("研究报告") ]), _: 1 }), createVNode(_component_a_select_option, { value: "policy" }, { default: withCtx(() => [ createTextVNode("政策文件") ]), _: 1 }), createVNode(_component_a_select_option, { value: "other" }, { default: withCtx(() => [ createTextVNode("其他") ]), _: 1 }) ]), _: 1 }, 8, ["value", "onUpdate:value"]) ]), _: 1 }) ]), _: 1 }), createVNode(_component_a_col, { span: 12 }, { default: withCtx(() => [ createVNode(_component_a_form_item, { label: "访问权限" }, { default: withCtx(() => [ createVNode(_component_a_radio_group, { value: unref(formData).memberOnly, "onUpdate:value": ($event) => unref(formData).memberOnly = $event }, { default: withCtx(() => [ createVNode(_component_a_radio, { value: false }, { default: withCtx(() => [ createTextVNode("公开") ]), _: 1 }), createVNode(_component_a_radio, { value: true }, { default: withCtx(() => [ createTextVNode("会员专享") ]), _: 1 }) ]), _: 1 }, 8, ["value", "onUpdate:value"]) ]), _: 1 }) ]), _: 1 }) ]), _: 1 }), createVNode(_component_a_form_item, { label: "文件描述" }, { default: withCtx(() => [ createVNode(_component_a_textarea, { value: unref(formData).description, "onUpdate:value": ($event) => unref(formData).description = $event, rows: 3, placeholder: "请输入文件描述" }, null, 8, ["value", "onUpdate:value"]) ]), _: 1 }) ]; } }), _: 1 }, _parent2, _scopeId)); } else { return [ createVNode(_component_a_form, { model: unref(formData), layout: "vertical" }, { default: withCtx(() => [ !unref(editingRecord) ? (openBlock(), createBlock(_component_a_form_item, { key: 0, label: "文件" }, { default: withCtx(() => [ createVNode(_component_a_upload, { "file-list": unref(fileList), "onUpdate:fileList": ($event) => isRef(fileList) ? fileList.value = $event : null, "max-count": 1, "before-upload": () => false }, { default: withCtx(() => [ createVNode(_component_a_button, null, { icon: withCtx(() => [ createTextVNode("📎") ]), default: withCtx(() => [ createTextVNode("选择文件") ]), _: 1 }) ]), _: 1 }, 8, ["file-list", "onUpdate:fileList"]) ]), _: 1 })) : createCommentVNode("", true), createVNode(_component_a_form_item, { label: "显示名称", required: "" }, { default: withCtx(() => [ createVNode(_component_a_input, { value: unref(formData).fileName, "onUpdate:value": ($event) => unref(formData).fileName = $event, placeholder: "请输入文件显示名称" }, null, 8, ["value", "onUpdate:value"]) ]), _: 1 }), createVNode(_component_a_row, { gutter: 16 }, { default: withCtx(() => [ createVNode(_component_a_col, { span: 12 }, { default: withCtx(() => [ createVNode(_component_a_form_item, { label: "文件分类" }, { default: withCtx(() => [ createVNode(_component_a_select, { value: unref(formData).category, "onUpdate:value": ($event) => unref(formData).category = $event }, { default: withCtx(() => [ createVNode(_component_a_select_option, { value: "form" }, { default: withCtx(() => [ createTextVNode("申请表格") ]), _: 1 }), createVNode(_component_a_select_option, { value: "report" }, { default: withCtx(() => [ createTextVNode("研究报告") ]), _: 1 }), createVNode(_component_a_select_option, { value: "policy" }, { default: withCtx(() => [ createTextVNode("政策文件") ]), _: 1 }), createVNode(_component_a_select_option, { value: "other" }, { default: withCtx(() => [ createTextVNode("其他") ]), _: 1 }) ]), _: 1 }, 8, ["value", "onUpdate:value"]) ]), _: 1 }) ]), _: 1 }), createVNode(_component_a_col, { span: 12 }, { default: withCtx(() => [ createVNode(_component_a_form_item, { label: "访问权限" }, { default: withCtx(() => [ createVNode(_component_a_radio_group, { value: unref(formData).memberOnly, "onUpdate:value": ($event) => unref(formData).memberOnly = $event }, { default: withCtx(() => [ createVNode(_component_a_radio, { value: false }, { default: withCtx(() => [ createTextVNode("公开") ]), _: 1 }), createVNode(_component_a_radio, { value: true }, { default: withCtx(() => [ createTextVNode("会员专享") ]), _: 1 }) ]), _: 1 }, 8, ["value", "onUpdate:value"]) ]), _: 1 }) ]), _: 1 }) ]), _: 1 }), createVNode(_component_a_form_item, { label: "文件描述" }, { default: withCtx(() => [ createVNode(_component_a_textarea, { value: unref(formData).description, "onUpdate:value": ($event) => unref(formData).description = $event, rows: 3, placeholder: "请输入文件描述" }, null, 8, ["value", "onUpdate:value"]) ]), _: 1 }) ]), _: 1 }, 8, ["model"]) ]; } }), _: 1 }, _parent)); _push(``); }; } }); const _sfc_setup = _sfc_main.setup; _sfc_main.setup = (props, ctx) => { const ssrContext = useSSRContext(); (ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/admin/downloads.vue"); return _sfc_setup ? _sfc_setup(props, ctx) : void 0; }; const downloads = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8bc7dadf"]]); export { downloads as default }; //# sourceMappingURL=downloads-HRDItwoB.mjs.map