| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169 |
- <!DOCTYPE html>
- <html lang="zh-CN">
- <head>
- <meta charset="UTF-8"/>
- <meta name="viewport"
- content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
- <title>团体基本情况</title>
- <script src="/js/mp_base/base.js"></script>
- <style>
- [v-cloak] { display: none !important; }
- :root { --line: #e5e7eb; --text: #222; --muted: #8b95a5; }
- * { box-sizing: border-box; }
- body { margin: 0; color: var(--text); background: #f5f5f5;
- font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
- "Microsoft YaHei", sans-serif; }
- #app { min-height: 100vh; padding: 8px; }
- .loading, .error { padding: 48px 16px; text-align: center;
- color: var(--muted); font-size: 14px; }
- .error { color: #e5484d; }
- .form-table { overflow: hidden; background: #fff; border-radius: 6px;
- border: 1px solid var(--line); }
- .form-row { display: grid; grid-template-columns: 112px minmax(0, 1fr);
- border-bottom: 1px solid var(--line); }
- .form-row:last-child { border-bottom: 0; }
- .form-label { padding: 12px; color: var(--muted); background: #fbfbfc;
- border-right: 1px solid var(--line); text-align: center; font-size: 15px; }
- .form-value { min-width: 0; padding: 12px; white-space: pre-wrap;
- word-break: break-all; line-height: 1.55; font-size: 15px; }
- .description-cell { position: relative; min-height: 110px; }
- .description-text { min-height: 110px; padding: 0 76px 0 0; }
- .pms-attachment-button { position: absolute; top: 0; right: 0; bottom: 0;
- width: 64px; display: flex; align-items: center; justify-content: center;
- flex-direction: column; gap: 5px; color: #666; background: #f0f0f0;
- border: 0; border-left: 1px solid #ddd; border-radius: 0;
- font: inherit; font-size: 13px; }
- .pms-attachment-button:disabled { color: #aaa; background: #f5f5f5; }
- .pms-attachment-button .common-icon { font-size: 18px; }
- .attachment-modal { position: fixed; z-index: 9999; inset: 0;
- display: flex; flex-direction: column; background: #fff; }
- .attachment-modal-head { display: flex; height: 48px; align-items: center;
- justify-content: space-between; padding: 0 14px;
- border-bottom: 1px solid var(--line); font-size: 16px; font-weight: 700; }
- .attachment-close { padding: 8px 4px 8px 14px; color: #19a463;
- background: transparent; border: 0; font: inherit; font-size: 15px; }
- .attachment-frame { flex: 1; width: 100%; border: 0; }
- </style>
- </head>
- <body>
- <div id="app" v-cloak>
- <div v-if="loading" class="loading">加载中...</div>
- <div v-else-if="error" class="error">{{ error }}</div>
- <template v-else>
- <div class="form-table">
- <div class="form-row"><div class="form-label">名称</div><div class="form-value">{{ data.mc || '-' }}</div></div>
- <div class="form-row"><div class="form-label">类别</div><div class="form-value">{{ data.ttlbmc || data.ttlbm || '-' }}</div></div>
- <div class="form-row"><div class="form-label">负责人员</div><div class="form-value">{{ data.fzrymc || data.fzryid || '-' }}</div></div>
- <div class="form-row"><div class="form-label">负责部门</div><div class="form-value">{{ data.fzbmmc || data.fzbmid || '-' }}</div></div>
- <div class="form-row"><div class="form-label">生效日期</div><div class="form-value">{{ data.ksrq || '-' }}</div></div>
- <div class="form-row"><div class="form-label">结束日期</div><div class="form-value">{{ data.jsrq || '-' }}</div></div>
- <div class="form-row"><div class="form-label">学年</div><div class="form-value">{{ data.xndm || '-' }}</div></div>
- <div class="form-row"><div class="form-label">描述</div><div class="form-value">
- <div class="description-cell">
- <div class="description-text">{{ data.ms || '-' }}</div>
- <button class="pms-attachment-button" type="button"
- :disabled="!data.fjid || attachmentLoading"
- :aria-label="'附件'"
- @click="openAttachment">
- <ss-common-icon class="common-icon-paper-clip"></ss-common-icon>
- <span>{{ attachmentLoading ? '处理中' : '附件' }}</span>
- </button>
- </div>
- </div></div>
- </div>
- </template>
- <div v-if="attachmentVisible" class="attachment-modal">
- <div class="attachment-modal-head">
- <span>附件管理</span>
- <button class="attachment-close" type="button" @click="attachmentVisible=false">关闭</button>
- </div>
- <iframe class="attachment-frame" :src="attachmentUrl"></iframe>
- </div>
- </div>
- <script>
- window.SS.ready(function () {
- window.SS.dom.initializeFormApp({
- el: "#app",
- data() {
- return {
- loading: true,
- error: "",
- data: {},
- attachmentVisible: false,
- attachmentLoading: false,
- attachmentUrl: "",
- pageParams: {}
- };
- },
- async mounted() {
- this.pageParams = this.getUrlParams();
- await this.loadData();
- },
- methods: {
- getUrlParams() {
- const params = {};
- new URLSearchParams(window.location.search).forEach((value, key) => {
- try { params[key] = decodeURIComponent(value); }
- catch (_) { params[key] = value; }
- });
- return params;
- },
- parseParamObject(raw) {
- if (!raw) return {};
- if (typeof raw === "object") return raw;
- try { return JSON.parse(raw); } catch (_) {
- try {
- return JSON.parse(String(raw)
- .replace(/([{,]\s*)([A-Za-z0-9_]+)\s*:/g, '$1"$2":')
- .replace(/'/g, '"'));
- } catch (__) { return {}; }
- }
- },
- async loadData() {
- const param = this.parseParamObject(this.pageParams.param);
- const ttid = String(param.ttid || param.ssObjId ||
- this.pageParams.ttid || this.pageParams.ssObjId || "").trim();
- if (!ttid) {
- this.error = "缺少团体ID";
- this.loading = false;
- return;
- }
- try {
- const req = window.request;
- const response = await req.post(
- "/service?ssServ=xsh_mpDetail&ssDest=data",
- {ttid, ssObjName: "xsh", ssObjId: ttid},
- {loading: false, formData: true});
- const raw = response && response.data !== undefined
- ? response.data : response;
- if (raw && raw.ssCode !== undefined && Number(raw.ssCode) !== 0)
- throw new Error(raw.ssMsg || "加载失败");
- this.data = raw && raw.ssData !== undefined ? raw.ssData : (raw || {});
- } catch (error) {
- this.error = "加载失败:" + (error.message || "未知错误");
- } finally {
- this.loading = false;
- }
- },
- async openAttachment() {
- if (!this.data.fjid || this.attachmentLoading) return;
- this.attachmentLoading = true;
- try {
- const fjid = encodeURIComponent(this.data.fjid);
- this.attachmentUrl =
- "/service?ssServ=regCms&ssDest=cmsPlay&wdConfirmationCaptchaService=0"
- + "&nrid=T-" + fjid + "&objectId=" + fjid
- + "&objectName=fjid&jlztm=null";
- this.attachmentVisible = true;
- } finally {
- this.attachmentLoading = false;
- }
- }
- }
- });
- });
- </script>
- </body>
- </html>
|