给<td>添加背景色-实现颜色渐变

本文提供了一个具体的代码实例,展示了如何使用HTML与内联样式来实现表格单元格的渐变效果。通过对样式的设置,可以使得表格中的单元格从白色平滑过渡到黑色,增强了网页元素的视觉效果。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 

 

    1.代码实例:

 

       <td style="filter:progid:DxImageTransform.Microsoft.Gradient(startColorStr="#FFFFFF",endColorStr="#000000",gradientType='2')">&nbsp;</td>

將以下mrsnrelate.vue網頁靛蓝色系列顏色成藍色系列顏色,樣式不改變: <!-- mrsnrelate.vue --> <template> <div class="mrsnrelate-container"> <!-- 相关出处区域 --> <div class="tags-section"> <h3>尚未與此醫案關聯的出處列表</h3> <div class="filter-info" v-if="filteredTags.length > 0"> 顯示與當前醫案不同但相關的出處標籤({{ filteredTags.length }}個) </div> <div v-if="filteredTags.length > 0" class="sntag-list"> <div v-for="(tag, index) in filteredTags" :key="tag.id" class="sntag-item"> <div class="tag-content"> <span class="tag-index">{{ index + 1 }}.</span> <span class="tag-name">{{ tag.id }}: {{ tag.snname || '未命名標籤' }}</span> </div> </div> </div> <div v-else class="no-tags"> 沒有符合條件的相關出處標籤 </div> </div> <!-- 分隔线 --> <div class="divider"></div> <!-- MRSN数据区域 --> <div class="mrsn-section"> <h3>醫案出處關聯管理</h3> <!-- 操作按钮 --> <div class="mrsn-controls"> <button @click="fetchMRSNData" class="refresh-btn">刷新數據</button> <button @click="manualCreateMRSN" class="create-btn">手動新增關聯</button> </div> <!-- 数据列表 --> <div v-if="mrsnData.length > 0" class="mrsn-list"> <table class="mrsn-table"> <thead> <tr> <th>ID</th> <th>醫案ID</th> <th>出處ID</th> <th>操作</th> </tr> </thead> <tbody> <tr v-for="item in mrsnData" :key="item.id"> <td>{{ item.id }}</td> <td> <span v-if="!item.editing">{{ item.mrinfo }}</span> <textarea v-else v-model="item.editData.mrinfo" class="edit-textarea"></textarea> </td> <td> <span v-if="!item.editing">{{ item.sntag }}</span> <input v-else v-model="item.editData.sntag" type="text" class="edit-input"> </td> <td class="actions"> <template v-if="!item.editing"> <button @click="startEdit(item)" class="edit-btn">編輯</button> <button @click="confirmDelete(item.id)" class="delete-btn">刪除</button> </template> <template v-else> <button @click="saveEdit(item)" class="save-btn">保存</button> <button @click="cancelEdit(item)" class="cancel-btn">取消</button> </template> </td> </tr> </tbody> </table> </div> <div v-else class="no-data"> 沒有醫案出處關聯數據 </div> </div> </div> </template> <script> export default { name: 'mrsnrelate', props: { currentCase: { type: Object, default: null }, allTags: { type: Array, required: true } }, data() { return { mrsnData: [], isCreating: false, hasAutoCreated: false }; }, computed: { filteredTags() { if (!this.currentCase) return []; const currentTagIds = this.currentCase.sntag ? this.currentCase.sntag.map(tag => tag.id) : []; const caseContent = this.currentCase.mrcase || ''; const contentLower = caseContent.toLowerCase(); return this.allTags.filter(tag => { if (currentTagIds.includes(tag.id)) return false; if (!tag.snname) return false; return contentLower.includes(tag.snname.toLowerCase()); }); } }, watch: { currentCase: { immediate: true, handler(newVal) { if (newVal && newVal.id) { if (!this.hasAutoCreated) { this.autoCreateMRSN(); this.hasAutoCreated = true; } } } } }, methods: { async fetchMRSNData() { try { const response = await fetch("MRSN/?format=json"); const data = await response.json(); this.mrsnData = data.map(item => ({ id: item.id, mrinfo: item.mrinfo || '', sntag: item.sntag || '', editing: false, editData: { mrinfo: item.mrinfo || '', sntag: item.sntag || '' } })); } catch (error) { console.error("獲取MRSN數據失敗:", error); alert("MRSN數據加載失敗"); } }, async autoCreateMRSN() { if (this.isCreating) return; if (!this.currentCase || !this.currentCase.id) return; if (this.filteredTags.length === 0) return; try { this.isCreating = true; const createRequests = this.filteredTags.map(tag => { return fetch("MRSN/", { method: "POST", headers: { "Content-Type": "application/json", "X-CSRFToken": this.getCSRFToken() }, body: JSON.stringify({ mrinfo: `${this.currentCase.id}`, sntag: `${tag.id}` }) }); }); const responses = await Promise.all(createRequests); const allSuccess = responses.every(res => res.ok); if (allSuccess) { console.log(`成功新增 ${this.filteredTags.length} 筆MRSN數據!`); this.fetchMRSNData(); this.triggerDataUpdate(); } else { throw new Error("部分新增失敗"); } } catch (error) { console.error("批量新增MRSN失敗:", error); } finally { this.isCreating = false; } }, async manualCreateMRSN() { try { await this.autoCreateMRSN(); if (this.filteredTags.length > 0) { alert(`成功新增 ${this.filteredTags.length} 筆MRSN數據!`); } } catch (error) { alert("新增過程中發生錯誤"); } }, startEdit(item) { item.editing = true; item.editData = { mrinfo: item.mrinfo, sntag: item.sntag }; }, cancelEdit(item) { item.editing = false; }, async saveEdit(item) { try { const response = await fetch(`MRSN/${item.id}/`, { method: "PUT", headers: { "Content-Type": "application/json", "X-CSRFToken": this.getCSRFToken() }, body: JSON.stringify({ mrinfo: item.editData.mrinfo, sntag: item.editData.sntag }) }); if (response.ok) { item.mrinfo = item.editData.mrinfo; item.sntag = item.editData.sntag; item.editing = false; alert("更新成功!"); this.triggerDataUpdate(); } else { throw new Error("更新失敗"); } } catch (error) { console.error("更新MRSN失敗:", error); alert("更新失敗"); } }, confirmDelete(id) { if (confirm("確定要刪除此數據嗎?")) { this.deleteMRSN(id); } }, async deleteMRSN(id) { try { const response = await fetch(`MRSN/${id}/`, { method: "DELETE", headers: { "X-CSRFToken": this.getCSRFToken() } }); if (response.ok) { this.mrsnData = this.mrsnData.filter(item => item.id !== id); alert("刪除成功!"); this.triggerDataUpdate(); } else { throw new Error("刪除失敗"); } } catch (error) { console.error("刪除MRSN失敗:", error); alert("刪除失敗"); } }, getCSRFToken() { return document.querySelector('[name=csrfmiddlewaretoken]')?.value || ''; }, triggerDataUpdate() { this.$emit('data-updated'); } }, mounted() { this.fetchMRSNData(); if (this.currentCase && this.currentCase.id && !this.hasAutoCreated) { this.autoCreateMRSN(); this.hasAutoCreated = true; } } }; </script> <style scoped> .mrsnrelate-container { padding: 15px; background: linear-gradient(135deg, #e0d6ff 0%, #c8f0ff 100%); /* 靛蓝色渐变背景 */ height: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; } .tags-section { flex: 0 0 40%; overflow-y: auto; background: rgba(255, 255, 255, 0.5); border-radius: 8px; padding: 15px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); } .divider { height: 2px; background: #5e72e4; /* 靛蓝色 */ margin: 10px 0; } .mrsn-section { flex: 1; overflow-y: auto; background: rgba(255, 255, 255, 0.5); border-radius: 8px; padding: 15px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); } h3 { margin-top: 0; padding-bottom: 8px; color: #4b0082; /* 深靛蓝色 */ text-align: center; border-bottom: 2px solid #5e72e4; /* 靛蓝色 */ } .filter-info { text-align: center; margin: 10px 0; font-size: 0.9em; color: #4b0082; /* 深靛蓝色 */ background: rgba(94, 114, 228, 0.2); /* 靛蓝色透明背景 */ padding: 5px; border-radius: 4px; } .sntag-list { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 15px; } .sntag-item { background: #fff; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); overflow: hidden; transition: all 0.3s ease; border-left: 4px solid #5e72e4; /* 靛蓝色 */ } .tag-content { padding: 12px 15px; display: flex; align-items: center; } .tag-index { font-weight: bold; margin-right: 10px; min-width: 25px; height: 25px; display: flex; align-items: center; justify-content: center; background: #5e72e4; /* 靛蓝色 */ color: white; border-radius: 50%; } .tag-name { flex-grow: 1; font-weight: 500; color: #4b0082; /* 深靛蓝色 */ } .no-tags, .no-data { padding: 25px; text-align: center; color: #666; font-style: italic; margin-top: 20px; border: 1px dashed #5e72e4; /* 靛蓝色 */ border-radius: 8px; background: rgba(255, 255, 255, 0.5); } /* MRSN数据管理样式 */ .mrsn-controls { display: flex; justify-content: space-between; margin-bottom: 15px; } .mrsn-controls button { padding: 6px 12px; border-radius: 4px; border: none; cursor: pointer; font-weight: bold; } .refresh-btn { background-color: #5e72e4; /* 靛蓝色 */ color: white; } .create-btn { background-color: #4b0082; /* 深靛蓝色 */ color: white; } .mrsn-table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.1); } .mrsn-table th, .mrsn-table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #eee; } .mrsn-table th { background-color: #5e72e4; /* 靛蓝色 */ color: white; font-weight: bold; } .mrsn-table tr:hover { background-color: #f5f5f5; } .actions { display: flex; gap: 5px; } .actions button { padding: 5px 10px; border: none; border-radius: 3px; cursor: pointer; font-size: 0.85em; } .edit-btn { background-color: #FFC107; color: #333; } .delete-btn { background-color: #F44336; color: white; } .save-btn { background-color: #5e72e4; /* 靛蓝色 */ color: white; } .cancel-btn { background-color: #9E9E9E; color: white; } .edit-input, .edit-textarea { width: 100%; padding: 5px; border: 1px solid #ddd; border-radius: 3px; } .edit-textarea { min-height: 60px; resize: vertical; } </style>
最新发布
07-27
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %> <!DOCTYPE html> <html> <head> <title>员工信息查询</title> <style> body { font-family: 'Arial', sans-serif; background-color: #f4f8fb; color: #333; text-align: center; margin: 0; padding: 0; } h2 { margin-top: 20px; color: #4CAF50; animation: fadeIn 2s ease forwards; } table { margin: 20px auto; border-collapse: collapse; width: 80%; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); background-color: #ffffff; border-radius: 8px; } th, td { padding: 12px; border: 1px solid #ddd; text-align: center; } th { background-color: #4CAF50; color: white; } tr:hover { background-color: #e7f3fe; } .btn { margin-top: 20px; } a.button { display: inline-block; padding: 10px 20px; background-color: #4CAF50; color: white; text-decoration: none; border-radius: 5px; transition: background-color 0.3s ease; } a.button:hover { background-color: #45a049; } @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } } </style> <script> // 页面加载时的淡入效果 window.onload = function() { document.body.style.opacity = 0; setTimeout(function() { document.body.style.transition = "opacity 1s ease"; document.body.style.opacity = 1; }, 100); }; </script> </head> <body> <h2>员工信息查询</h2> <table border="1"> <tr> <th>员工ID</th> <th>姓名</th> <th>性别</th> <th>职位</th> <th>联系方式</th> </tr> <tr> <td>${employee.id}</td> <td>${employee.name}</td> <td>${employee.gender}</td> <td>${employee.position}</td> <td>${employee.contact}</td> </tr> </table> <div class="btn"> <a href="${pageContext.request.contextPath}/employeemanagement" class="button">返回管理页面</a> </div> </body> </html>我想为这段代码的页面加载效果设计出别具风格的效果,在页面加载时整个表单将做波浪运动,表单的两段会先弯曲,然后表单的两段将以波浪的形式由慢到快向中间进行靠拢碰撞,在碰撞的瞬间整个表单压缩为一条彩色的竖状彩色直线,然后展开回复到表单原状
06-18
以下mrviewer.vue及mrsnrelate.vue頁面代碼修改,比照mrdnrelate.vue所有功能樣式為範例,增加顯示出處名稱(欄位為sntag,位置為SNTag/?format=json,對應其中snname中的字串)與啟動本草關聯器(位置為MRSN/?format=json)等與mrdnrelate.vue相似的全部功能, mrviewer.vue: <template> <div class="container"> <!-- 控制面板 --> <div class="control-panel"> <button @click="fetchData" class="refresh-btn">刷新數據</button> <button @click="toggleRelative" class="relative-btn"> {{ showRelative ? '關閉病態關聯器' : '啟動病態關聯器' }} </button> <!-- 新增本草关联器按钮 --> <button @click="toggleMNRelative" class="relative-btn"> {{ showMNRelative ? '關閉本草關聯器' : '啟動本草關聯器' }} </button> <input v-model="searchQuery" placeholder="搜索..." class="search-input" /> <div class="pagination-controls"> <span>每頁顯示:</span> <select v-model.number="pageSize" class="page-size-select"> <option value="1">1筆</option> <option value="4">4筆</option> <option value="10">10筆</option> </select> <button @click="prevPage" :disabled="currentPage === 1">上一页</button> <span>第</span> <input type="number" v-model.number="inputPage" min="1" :max="totalPages" class="page-input" @input="handlePageInput"> <span>頁 / 共 {{ totalPages }} 頁</span> <button @click="nextPage" :disabled="currentPage === totalPages">下一頁</button> <span>醫案閱讀器</span> </div> </div> <!-- 主内容区域 --> <div class="content-area"> <div class="horizontal-records" v-if="filteredData.length > 0"> <div v-for="(item, index) in paginatedData" :key="item.id" class="record-card"> <div class="record-header"> <h3>醫案 #{{ (currentPage - 1) * pageSize + index + 1 }}</h3> </div> <div class="record-body"> <div v-for="(value, key) in processFieldNames(item)" :key="key" class="record-field"> <div class="field-name">{{ key }}:</div> <div class="field-value"> <!-- 修改1: 病态名称使用v-html渲染HTML --> <div v-if="key === '病態名稱' && Array.isArray(value)" class="dntag-value" v-html="formatDntagValueHTML(value)"></div> <!-- 修改2: 本草名称使用v-html渲染HTML --> <div v-else-if="key === '本草名稱' && Array.isArray(value)" class="mntag-value" v-html="formatMntagValueHTML(value)"></div> <div v-else-if="Array.isArray(value)" class="array-value"> <span v-for="(subItem, subIndex) in value" :key="subIndex"> <span v-html="formatValue(subItem, key)"></span><span v-if="subIndex < value.length - 1">;</span> </span> </div> <div v-else v-html="formatValue(value, key)"></div> </div> </div> </div> </div> </div> <div v-else class="no-data"> 沒有找到匹配的數據 </div> </div> <!-- 相关区域 --> <div class="relative-area"> <mrdnrelate v-if="showRelative" :currentCase="currentCase" :allTags="api2Data" @data-updated="handleDataUpdated"></mrdnrelate> <!-- 新增本草关联器 --> <mrmnrelate v-else-if="showMNRelative" :currentCase="currentCase" :allTags="api3Data" @data-updated="handleDataUpdated"></mrmnrelate> <span v-else>顯示醫案相關專有名詞</span> </div> </div> </template> <script> import mrdnrelate from './mrdnrelate.vue'; import mrmnrelate from './mrmnrelate.vue'; // 导入本草关联器组件 export default { name: 'mrviewer', components: { mrdnrelate, mrmnrelate }, data() { return { api1Data: [], api2Data: [], api3Data: [], // 新增本草标签数据 mergedData: [], currentPage: 1, pageSize: 1, searchQuery: '', sortKey: '', sortOrders: {}, inputPage: 1, fieldNames: { 'mrcase': '醫案全文', 'mrname': '醫案命名', 'mrposter': '醫案提交者', 'mrlasttime': '最後編輯時間', 'mreditnumber': '編輯次數', 'mrreadnumber': '閱讀次數', 'mrpriority': '重要性', 'dntag': '病態名稱', 'mntag': '本草名稱' // 新增本草名称字段 }, inputTimeout: null, dnNames: [], mnNames: [], // 新增本草名称列表 stateVersion: '1.0', showRelative: false, showMNRelative: false, // 控制本草关联器显示 currentCase: null }; }, computed: { filteredData() { const query = this.searchQuery.trim(); if (query && /^\d+$/.test(query)) { const idToSearch = parseInt(query, 10); return this.mergedData.filter(item => item.id === idToSearch); } if (!query) return this.mergedData; const lowerQuery = query.toLowerCase(); return this.mergedData.filter(item => { return Object.values(item).some(value => { if (value === null || value === undefined) return false; if (Array.isArray(value)) { return value.some(subValue => { if (typeof subValue === 'object' && subValue !== null) { return JSON.stringify(subValue).toLowerCase().includes(lowerQuery); } return String(subValue).toLowerCase().includes(lowerQuery); }); } if (typeof value === 'object' && value !== null) { return JSON.stringify(value).toLowerCase().includes(lowerQuery); } return String(value).toLowerCase().includes(lowerQuery); }); }); }, sortedData() { if (!this.sortKey) return this.filteredData; const order = this.sortOrders[this.sortKey] || 1; return [...this.filteredData].sort((a, b) => { const getValue = (obj) => { const val = obj[this.sortKey]; if (Array.isArray(val)) return JSON.stringify(val); return val; }; const aValue = getValue(a); const bValue = getValue(b); if (aValue === bValue) return 0; return aValue > bValue ? order : -order; }); }, paginatedData() { const start = (this.currentPage - 1) * Number(this.pageSize); const end = start + Number(this.pageSize); const data = this.sortedData.slice(start, end); // 更新当前医案完整数据 if (data.length > 0) { this.currentCase = data[0]; } else { this.currentCase = null; } return data; }, totalPages() { return Math.ceil(this.filteredData.length / this.pageSize) || 1; } }, watch: { pageSize() { this.currentPage = 1; this.inputPage = 1; this.saveState(); }, currentPage(newVal) { this.inputPage = newVal; this.saveState(); }, filteredData() { if (this.currentPage > this.totalPages) { this.currentPage = Math.max(1, this.totalPages); } this.inputPage = this.currentPage; }, searchQuery() { this.saveState(); } }, methods: { // 新增方法:处理数据更新事件 handleDataUpdated() { // 显示操作成功的提示 alert('數據已更新,正在刷新醫案數據...'); // 刷新数据 this.fetchData(); }, // 新增本草关联器切换方法 toggleMNRelative() { if (!this.showMNRelative) { this.showRelative = false; } this.showMNRelative = !this.showMNRelative; }, // 修改3: 病态名称HTML格式化方法 (使用橙色) formatDntagValueHTML(dntagArray) { return dntagArray.map(tagObj => { const name = tagObj.dnname || tagObj.name || '未命名標籤'; return `<span style="color: rgb(212, 107, 8); font-weight: bold;">${this.escapeHtml(name)}</span>`; }).join(';'); }, // 修改4: 本草名称HTML格式化方法 (使用绿色) formatMntagValueHTML(mntagArray) { return mntagArray.map(tagObj => { const name = tagObj.mnname || tagObj.name || '未命名標籤'; return `<span style="color: rgb(0, 128, 0); font-weight: bold;">${this.escapeHtml(name)}</span>`; }).join(';'); }, // 新增5: HTML转义方法防止XSS攻击 escapeHtml(text) { const map = { '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' }; return text.replace(/[&<>"']/g, m => map[m]); }, saveState() { const state = { version: this.stateVersion, currentPage: this.currentPage, pageSize: this.pageSize, searchQuery: this.searchQuery, timestamp: new Date().getTime() }; sessionStorage.setItem('mrviewerState', JSON.stringify(state)); }, restoreState() { const savedState = sessionStorage.getItem('mrviewerState'); if (!savedState) return; try { const state = JSON.parse(savedState); if (state.version !== this.stateVersion) return; this.currentPage = state.currentPage || 1; this.pageSize = state.pageSize || 1; this.searchQuery = state.searchQuery || ''; this.inputPage = this.currentPage; } catch (e) { sessionStorage.removeItem('mrviewerState'); } }, clearState() { sessionStorage.removeItem('mrviewerState'); }, async fetchData() { try { // 获取原有数据 const api1Response = await fetch("MRInfo/?format=json"); this.api1Data = await api1Response.json(); const api2Response = await fetch("DNTag/?format=json"); this.api2Data = await api2Response.json(); // 新增本草数据获取 const api3Response = await fetch("MNTag/?format=json"); this.api3Data = await api3Response.json(); // 本草名称列表 this.mnNames = this.api3Data.map(item => item.mnname).filter(name => name && name.trim()); this.mnNames.sort((a, b) => b.length - a.length); // 病态名称列表 this.dnNames = this.api2Data.map(item => item.dnname).filter(name => name && name.trim()); this.dnNames.sort((a, b) => b.length - a.length); this.mergeData(); this.currentPage = 1; this.inputPage = 1; this.saveState(); } catch (error) { console.error("獲取數據失敗:", error); alert("數據加載失敗,請稍後重試"); } }, mergeData() { this.mergedData = this.api1Data.map((item) => { const newItem = { ...item }; // 处理病态标签 if (newItem.dntag && Array.isArray(newItem.dntag)) { newItem.dntag = newItem.dntag.map((tagId) => { const matchedItem = this.api2Data.find(api2Item => api2Item.id === tagId); return matchedItem || { id: tagId, dnname: "未找到匹配的數據" }; }); } // 处理本草标签 if (newItem.mntag && Array.isArray(newItem.mntag)) { newItem.mntag = newItem.mntag.map((tagId) => { const matchedItem = this.api3Data.find(api3Item => api3Item.id === tagId); return matchedItem || { id: tagId, mnname: "未找到匹配的數據" }; }); } return newItem; }); // 初始化排序顺序 this.sortOrders = {}; if (this.mergedData.length > 0) { Object.keys(this.mergedData[0]).forEach(key => { this.sortOrders[key] = 1; }); } }, processFieldNames(item) { const result = {}; for (const key in item) { const newKey = this.fieldNames[key] || key; result[newKey] = item[key]; } return result; }, formatValue(value, fieldName) { if (value === null || value === undefined) return ''; if (fieldName === '醫案全文' && typeof value === 'string') { // 高亮病态和本草名称 let highlighted = this.highlightMatches(value, this.dnNames, 'rgb(212, 107, 8)'); highlighted = this.highlightMatches(highlighted, this.mnNames, 'rgb(0, 128, 0)'); return highlighted; } if (typeof value === 'string' && value.startsWith('http')) { return `<a href="${value}" target="_blank">${value}</a>`; } return value; }, // 改进的高亮方法,支持不同颜色 highlightMatches(text, words, color) { if (!text || typeof text !== 'string' || words.length === 0) { return text; } const pattern = new RegExp( words .map(name => name.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')) .join('|'), 'gi' ); return text.replace(pattern, match => `<span style="color: ${color}; font-weight: bold;">${this.escapeHtml(match)}</span>` ); }, sortBy(key) { const originalKey = Object.keys(this.fieldNames).find( origKey => this.fieldNames[origKey] === key ) || key; this.sortKey = originalKey; this.sortOrders[originalKey] = this.sortOrders[originalKey] * -1; this.saveState(); }, prevPage() { if (this.currentPage > 1) { this.currentPage--; this.saveState(); } }, nextPage() { if (this.currentPage < this.totalPages) { this.currentPage++; this.saveState(); } }, handlePageInput() { clearTimeout(this.inputTimeout); this.inputTimeout = setTimeout(() => { this.goToPage(); this.saveState(); }, 300); }, goToPage() { if (this.inputPage === null || this.inputPage === undefined || this.inputPage === '') { this.inputPage = this.currentPage; return; } const page = parseInt(this.inputPage); if (isNaN(page)) { this.inputPage = this.currentPage; return; } if (page < 1) { this.currentPage = 1; } else if (page > this.totalPages) { this.currentPage = this.totalPages; } else { this.currentPage = page; } this.inputPage = this.currentPage; }, toggleRelative() { if (this.showRelative) { this.showRelative = false; } else { this.showMNRelative = false; // 关闭本草关联器 this.showRelative = true; } } }, mounted() { this.restoreState(); this.fetchData(); }, activated() { this.restoreState(); }, deactivated() { this.saveState(); } }; </script> <style scoped> .container { max-width: 1200px; margin: 0px; padding: 0px; } .control-panel { margin-bottom: 0px; display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; align-items: center; position: fixed; bottom: 0; left: 0; width: 100%; background-color: #ffd800ff; z-index: 999; padding: 10px 20px; box-sizing: border-box; } .content-area { position: fixed; top: 56px; bottom: 100px; left: 0; width: 70%; background: white; padding: 1px; z-index: 100; overflow-y: auto; } .relative-area { position: fixed; top: 56px; bottom: 100px; right: 0; width: 30%; background: lightblue; padding: 1px; z-index: 100; overflow-y: auto; } .refresh-btn, .relative-btn { padding: 4px; background-color: #4CAF50; color: white; border: none; border-radius: 4px; cursor: pointer; } .refresh-btn:hover, .relative-btn:hover { background-color: #45a049; } .search-input { padding: 8px; border: 1px solid #ddd; border-radius: 4px; flex-grow: 1; max-width: 300px; } .pagination-controls { display: flex; align-items: center; gap: 5px; } .page-size-select { padding: 4px; border-radius: 4px; width: 70px; } .page-input { width: 50px; padding: 4px; border: 1px solid #ddd; border-radius: 4px; text-align: center; } .horizontal-records { display: flex; flex-direction: column; gap: 20px; } .record-card { border: 1px solid #ddd; border-radius: 4px; overflow: hidden; box-shadow: 0 2px 4px rgba(0,0,0,0.1); } .record-header { padding: 12px 16px; background-color: #f5f5f5; border-bottom: 1px solid #ddd; } .record-header h3 { margin: 0; font-size: 1.1em; } .record-body { padding: 16px; } .record-field { display: flex; margin-bottom: 12px; line-height: 1.5; } .record-field:last-child { margin-bottom: 0; } .field-name { font-weight: bold; min-width: 120px; color: #555; } .field-value { flex-grow: 1; display: flex; flex-wrap: wrap; gap: 8px; } .dntag-value { display: flex; flex-wrap: wrap; gap: 8px; } /* 本草名称样式 */ .mntag-value { display: flex; flex-wrap: wrap; gap: 8px; color: #006400; /* 深绿色 */ font-weight: 500; } .array-value { display: flex; flex-wrap: wrap; gap: 8px; } .no-data { padding: 20px; text-align: center; color: #666; font-style: italic; } button:disabled { opacity: 0.5; cursor: not-allowed; } </style> mrdnrelate.vue: <!-- mrdnrelate.vue --> <template> <div class="mrdnrelate-container"> <!-- 相关病态区域(上方) --> <div class="tags-section"> <h3>尚未與此醫案關聯的病態列表</h3> <div class="filter-info" v-if="filteredTags.length > 0"> 顯示與當前醫案不同但相關的病態標籤({{ filteredTags.length }}個) </div> <div v-if="filteredTags.length > 0" class="dntag-list"> <div v-for="(tag, index) in filteredTags" :key="tag.id" class="dntag-item"> <div class="tag-content"> <span class="tag-index">{{ index + 1 }}.</span> <span class="tag-name">{{ tag.id }}: {{ tag.dnname || '未命名標籤' }}</span> </div> </div> </div> <div v-else class="no-tags"> 沒有符合條件的相關病態標籤 </div> </div> <!-- 分隔线 --> <div class="divider"></div> <!-- MRDN数据区域(下方) --> <div class="mrdn-section"> <h3>醫案病態關聯管理</h3> <!-- 操作按钮 --> <div class="mrdn-controls"> <button @click="fetchMRDNData" class="refresh-btn">刷新數據</button> <button @click="manualCreateMRDN" class="create-btn">手動新增關聯</button> </div> <!-- 数据列表 --> <div v-if="mrdnData.length > 0" class="mrdn-list"> <table class="mrdn-table"> <thead> <tr> <th>ID</th> <th>醫案ID</th> <th>病態ID</th> <th>操作</th> </tr> </thead> <tbody> <tr v-for="item in mrdnData" :key="item.id"> <td>{{ item.id }}</td> <td> <span v-if="!item.editing">{{ item.mrinfo }}</span> <textarea v-else v-model="item.editData.mrinfo" class="edit-textarea"></textarea> </td> <td> <span v-if="!item.editing">{{ item.dntag }}</span> <input v-else v-model="item.editData.dntag" type="text" class="edit-input"> </td> <td class="actions"> <template v-if="!item.editing"> <button @click="startEdit(item)" class="edit-btn">編輯</button> <button @click="confirmDelete(item.id)" class="delete-btn">刪除</button> </template> <template v-else> <button @click="saveEdit(item)" class="save-btn">保存</button> <button @click="cancelEdit(item)" class="cancel-btn">取消</button> </template> </td> </tr> </tbody> </table> </div> <div v-else class="no-data"> 沒有醫案病態關聯數據 </div> </div> </div> </template> <script> export default { name: 'mrdnrelate', props: { currentCase: { type: Object, default: null }, allTags: { type: Array, required: true } }, data() { return { mrdnData: [], isCreating: false, hasAutoCreated: false }; }, computed: { filteredTags() { if (!this.currentCase) return []; const currentTagIds = this.currentCase.dntag ? this.currentCase.dntag.map(tag => tag.id) : []; const caseContent = this.currentCase.mrcase || ''; const contentLower = caseContent.toLowerCase(); return this.allTags.filter(tag => { if (currentTagIds.includes(tag.id)) return false; if (!tag.dnname) return false; return contentLower.includes(tag.dnname.toLowerCase()); }); } }, watch: { currentCase: { immediate: true, handler(newVal) { if (newVal && newVal.id) { if (!this.hasAutoCreated) { this.autoCreateMRDN(); this.hasAutoCreated = true; } } } } }, methods: { async fetchMRDNData() { try { const response = await fetch("MRDN/?format=json"); const data = await response.json(); this.mrdnData = data.map(item => ({ id: item.id, mrinfo: item.mrinfo || '', dntag: item.dntag || '', editing: false, editData: { mrinfo: item.mrinfo || '', dntag: item.dntag || '' } })); } catch (error) { console.error("獲取MRDN數據失敗:", error); alert("MRDN數據加載失敗"); } }, async autoCreateMRDN() { if (this.isCreating) return; if (!this.currentCase || !this.currentCase.id) return; if (this.filteredTags.length === 0) return; try { this.isCreating = true; const createRequests = this.filteredTags.map(tag => { return fetch("MRDN/", { method: "POST", headers: { "Content-Type": "application/json", "X-CSRFToken": this.getCSRFToken() }, body: JSON.stringify({ mrinfo: `${this.currentCase.id}`, dntag: `${tag.id}` }) }); }); const responses = await Promise.all(createRequests); const allSuccess = responses.every(res => res.ok); if (allSuccess) { console.log(`成功新增 ${this.filteredTags.length} 筆MRDN數據!`); this.fetchMRDNData(); this.triggerDataUpdate(); } else { throw new Error("部分新增失敗"); } } catch (error) { console.error("批量新增MRDN失敗:", error); } finally { this.isCreating = false; } }, async manualCreateMRDN() { try { await this.autoCreateMRDN(); if (this.filteredTags.length > 0) { alert(`成功新增 ${this.filteredTags.length} 筆MRDN數據!`); } } catch (error) { alert("新增過程中發生錯誤"); } }, startEdit(item) { item.editing = true; item.editData = { mrinfo: item.mrinfo, dntag: item.dntag }; }, cancelEdit(item) { item.editing = false; }, async saveEdit(item) { try { const response = await fetch(`MRDN/${item.id}/`, { method: "PUT", headers: { "Content-Type": "application/json", "X-CSRFToken": this.getCSRFToken() }, body: JSON.stringify({ mrinfo: item.editData.mrinfo, dntag: item.editData.dntag }) }); if (response.ok) { item.mrinfo = item.editData.mrinfo; item.dntag = item.editData.dntag; item.editing = false; alert("更新成功!"); this.triggerDataUpdate(); } else { throw new Error("更新失敗"); } } catch (error) { console.error("更新MRDN失敗:", error); alert("更新失敗"); } }, confirmDelete(id) { if (confirm("確定要刪除此數據嗎?")) { this.deleteMRDN(id); } }, async deleteMRDN(id) { try { const response = await fetch(`MRDN/${id}/`, { method: "DELETE", headers: { "X-CSRFToken": this.getCSRFToken() } }); if (response.ok) { this.mrdnData = this.mrdnData.filter(item => item.id !== id); alert("刪除成功!"); this.triggerDataUpdate(); } else { throw new Error("刪除失敗"); } } catch (error) { console.error("刪除MRDN失敗:", error); alert("刪除失敗"); } }, getCSRFToken() { return document.querySelector('[name=csrfmiddlewaretoken]')?.value || ''; }, triggerDataUpdate() { this.$emit('data-updated'); } }, mounted() { this.fetchMRDNData(); if (this.currentCase && this.currentCase.id && !this.hasAutoCreated) { this.autoCreateMRDN(); this.hasAutoCreated = true; } } }; </script> <style scoped> .mrdnrelate-container { padding: 15px; background: lightblue; height: 100%; overflow-y: auto; display: flex; flex-direction: column; gap: 15px; } .tags-section { flex: 0 0 40%; overflow-y: auto; background: rgba(255, 255, 255, 0.3); border-radius: 8px; padding: 15px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); } .divider { height: 2px; background: #3498db; margin: 10px 0; } .mrdn-section { flex: 1; overflow-y: auto; background: rgba(255, 255, 255, 0.3); border-radius: 8px; padding: 15px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); } /* 其他样式保持不变... */ /* 分隔线样式 */ .divider { height: 2px; background: #3498db; margin: 10px 0; } h3 { margin-top: 0; padding-bottom: 8px; color: #2c3e50; text-align: center; border-bottom: 2px solid #3498db; } .filter-info { text-align: center; margin: 10px 0; font-size: 0.9em; color: #555; background: rgba(255, 255, 255, 0.3); padding: 5px; border-radius: 4px; } .dntag-list { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 15px; } .dntag-item { background: #fff; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); overflow: hidden; transition: all 0.3s ease; border-left: 4px solid #3498db; } .tag-content { padding: 12px 15px; display: flex; align-items: center; } .tag-index { font-weight: bold; margin-right: 10px; min-width: 25px; height: 25px; display: flex; align-items: center; justify-content: center; background: #3498db; color: white; border-radius: 50%; } .tag-name { flex-grow: 1; font-weight: 500; color: #2c3e50; } .no-tags, .no-data { padding: 25px; text-align: center; color: #666; font-style: italic; margin-top: 20px; border: 1px dashed #3498db; border-radius: 8px; background: rgba(255, 255, 255, 0.5); } /* MRDN数据管理样式 */ .mrdn-controls { display: flex; justify-content: space-between; margin-bottom: 15px; } .mrdn-controls button { padding: 6px 12px; border-radius: 4px; border: none; cursor: pointer; font-weight: bold; } .refresh-btn { background-color: #4CAF50; color: white; } .create-btn { background-color: #2196F3; color: white; } .mrdn-table { width: 100%; border-collapse: collapse; background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.1); } .mrdn-table th, .mrdn-table td { padding: 12px 15px; text-align: left; border-bottom: 1px solid #eee; } .mrdn-table th { background-color: #3498db; color: white; font-weight: bold; } .mrdn-table tr:hover { background-color: #f5f5f5; } .actions { display: flex; gap: 5px; } .actions button { padding: 5px 10px; border: none; border-radius: 3px; cursor: pointer; font-size: 0.85em; } .edit-btn { background-color: #FFC107; color: #333; } .delete-btn { background-color: #F44336; color: white; } .save-btn { background-color: #4CAF50; color: white; } .cancel-btn { background-color: #9E9E9E; color: white; } .edit-input, .edit-textarea { width: 100%; padding: 5px; border: 1px solid #ddd; border-radius: 3px; } .edit-textarea { min-height: 60px; resize: vertical; } </style>
07-25
<template> <a-card :class="$style.wrapHeight"> <!-- 普通搜索区域(替换原来的高级搜索) --> <a-card :class="$style.searchWrap"> <a-form-model ref="searchForm" class="ant-advanced-search-form" :model="factConfirmAdvSearchForm" :rules="rules" v-bind="formItemLayout" > <a-row> <a-col :span="8"> <a-form-model-item :label="'\u2002年度'" prop="timeRange" > <AuditRangePicker ref = "rangePicker" v-model="factConfirmAdvSearchForm.timeRange" :time-range.sync="factConfirmAdvSearchForm.timeRange" /> </a-form-model-item> </a-col> <a-col :span="8"> <a-form-model-item label="审计机构" prop="unitNames"> <AuditGroupPicker ref="unitNames" v-model="factConfirmAdvSearchForm.unitNames" :single="false" :read-only="false" :root-node="rootNode" /> </a-form-model-item> </a-col> <a-col :span="8"> <a-form-model-item label="项目名称" prop="projectName"> <a-input v-model="factConfirmAdvSearchForm.projectName" /> </a-form-model-item> </a-col> </a-row> <a-row> <a-col :span="8"> <a-form-model-item :label="'\u2002\u2002被审计部门'" prop="auditedUnitNames"> <sd-group-picker v-model="factConfirmAdvSearchForm.auditedUnitNames" /> </a-form-model-item> </a-col> <a-col :span="8"> <a-form-model-item label="问题名称" prop="problemName"> <a-input v-model="factConfirmAdvSearchForm.problemName" /> </a-form-model-item> </a-col> <a-col :span="8"> <a-form-model-item label="业务类别" prop="problemType"> <a-input v-model="factConfirmAdvSearchForm.problemType" /> </a-form-model-item> </a-col> </a-row> <a-row> <a-col :span="8"> <a-form-model-item :label="'\u2002\u2002\u2002\u2002风险等级'" prop="riskLevel"> <sd-select v-model="factConfirmAdvSearchForm.riskLevel" :options="riskLevelOption" :class="$style.select" allowClear /> </a-form-model-item> </a-col> <a-col :span="8"> <a-form-model-item label="新老问题" prop="isNewproblems"> <sd-select v-model="factConfirmAdvSearchForm.isNewproblems" :options="isNewproblemsOption" :class="$style.select" allowClear /> </a-form-model-item> </a-col> <a-col :span="8"> <a-form-model-item label="问题来源" prop="problemSource"> <sd-select v-model="factConfirmAdvSearchForm.problemSource" :options="problemSourceOption" :class="$style.select" allowClear /> </a-form-model-item> </a-col> </a-row> <a-row> <a-col :span="8"> <a-form-model-item label="问题确认状态" prop="feedbackStatus"> <sd-select v-model="factConfirmAdvSearchForm.feedbackStatus" :options="feedbackStatusOption" :class="$style.select" allowClear /> </a-form-model-item> </a-col> <a-col :span="8"> <a-form-model-item label="项目来源" prop="projectSourceType"> <a-radio-group v-model="factConfirmAdvSearchForm.projectSourceType"> <a-radio v-for="option in projectSourceOptions" :key="option.id" :value="option.id"> {{ option.text }} </a-radio> </a-radio-group> </a-form-model-item> </a-col> <a-col :span="8" :class="$style.searchbutton"> <div class="reportbuttonContent" style="margin-right: 15%"> <a-button @click="handleReset">重置</a-button> <a-button type="primary" @click="advSJBGSearch">查询</a-button> <a-button type="primary" @click="exportData">导出</a-button> </div> </a-col> </a-row> </a-form-model> </a-card> <!-- 数据表格区域 --> <a-card class="reporttablecardxm"> <sd-data-table ref="SJBGDataTable" :columns="columns" :filter-expressions="expressions" data-url="api/xcoa-mobile/v1/audit-fact-confirm/searchList" > </sd-data-table> </a-card> </a-card> </template> <script> import iamAuditWorkMixins from '@product/iam/audit/work/iam-audit-work-mixins' import axios from '@/common/services/axios-instance' import { getUserInfo } from '@/common/store-mixin' import auditAdvancedQuery from '../../components/audit-advanced-query.vue' import AuditGroupPicker from '../../components/picker/audit-group-picker.vue' import auditAdvancedQueryMixins from '../../components/audit-advanced-query-mixins' import components from './_import-components/audit-statistics-confirm--list-import' import StatisticsService from './statistics-service' import AuditRangePicker from '@product/iam/components/picker/audit-range-picker.vue' import download from '@/common/services/download' import TableActionTypes from '@/common/services/table-action-types' import moment from 'moment' export default { name: 'AuditStatisticsConfirmList', metaInfo: { title: '事实确认查询', }, components: { AuditRangePicker, auditAdvancedQuery, AuditGroupPicker, ...components, }, mixins: [auditAdvancedQueryMixins, iamAuditWorkMixins], data() { return { rootNode: {}, currentYear: new Date().getFullYear(), projectId: this.$route.query.projectId, activeKey: '1', expressions: [], auditTypeOptions: [], formItemLayout: { labelCol: { span: 6 }, wrapperCol: { span: 14 }, }, rules: { timeRange: [{ required: true, message: '请选择统计时间', trigger: 'change' }], unitNames: [{ required: true, message: '请选择审计机构', trigger: 'change' }], }, factConfirmAdvSearchForm: { timeRange: [moment(), moment()], dateStart: '', dateEnd: '', auditedUnitIds: '', unitIds: '', auditedUnitNames: [], unitNames: [], problemName: '', projectName: '', problemType: '', riskLevel: '', isAccountability: '', isNewproblems: [], problemSource: [], feedbackStatus: [], projectSourceType: '', }, riskLevelOption: [], problemTypeOption: [], isAccountabilityOption: [], projectSourceOptions: [ { text: '内部审计项目', id: '1' }, { text: '外部审计项目', id: '2' } ], columns: [ { title: '序号', customRender: (text, record, index) => `${index + 1}`, width: '80px', }, { title: '项目名称', dataIndex: 'projectname', width: '200px', }, { title: '问题名称', dataIndex: 'problemname', scopedSlots: { customRender: 'islink' }, }, { title: '业务类型', dataIndex: 'problemtype', }, { title: '风险等级', dataIndex: 'risklevel', }, { title: '问题来源', dataIndex: 'problemsource', }, { title: '新老问题', dataIndex: 'isnewproblems', }, { title: '问题描述', dataIndex: 'problemdesc', }, { title: '被审计部门反馈意见', dataIndex: 'feedbackopinion', }, { title: '问题原因', dataIndex: 'problemreason', width: '200px', }, { title: '问题整改措施', dataIndex: 'measure', width: '200px', }, { title: '问题涉及部门', dataIndex: 'involveddepartmentnames', }, { title: '问题涉及联系人', dataIndex: 'involvedcontactsnames', }, { title: '问题确认状态', dataIndex: 'feedbackstatus', }, ], actions: [ { label: '导出', id: 'export', type: TableActionTypes.primary, permission: null, callback: () => { this.exportData() }, }, ], itemStatusOptions: [], auditModeOptions: [], changeTypeOptions: [], showOpinionModal: false, problemSourceOption: [], feedbackStatusOption: [ { id: '未确认', name: '未确认' }, { id: '已确认', name: '已确认' }, ], isNewproblemsOption: [], pending: [], batchSubmitSucceed: [], batchsubmitFailed: [], } }, created() { let userInfo = getUserInfo() const params = { orgId: userInfo.deptId, } axios({ url: 'api/xcoa-mobile/v1/iamorg/getCurrentUserGroup', method: 'get', }).then((res) => { userInfo = res.data params.orgId = res.data.id axios({ url: 'api/xcoa-mobile/v1/iamorg/findIamOrgId', method: 'post', params, }).then((res) => { this.id = res.data const deptCode = userInfo.id.toString() const deptName = userInfo.name this.rootNode = { code: deptCode, name: deptName, id: this.id } }) }) }, mounted() { StatisticsService.getDictionary('GY_PROBLEM_TYPE').then((res) => { this.riskLevelOption = res.data }) StatisticsService.getDictionary('GY_PROBLEM_SOURCE').then((res) => { this.problemSourceOption = res.data }) StatisticsService.getDictionary('GY_NEW_PROBLEM').then((res) => { this.isNewproblemsOption = res.data }) this.$nextTick(() => { if (this.$refs.rangePicker) { this.$refs.rangePicker.value = this.factConfirmAdvSearchForm.timeRange } }) }, methods: { getSelectIdValue(selectValue) { if (!selectValue) return null; if (Array.isArray(selectValue) && selectValue.length > 0 && selectValue[0].id) { return selectValue[0].id; } if (typeof selectValue === 'object' && selectValue.id) { return selectValue.id; } return null; }, // 重置 handleReset() { this.factConfirmAdvSearchForm = { timeRange: [], dateStart: '', dateEnd: '', auditedUnitIds: '', unitIds: '', auditedUnitNames: [], unitNames: [], problemName: '', projectName: '', problemType: '', riskLevel: '', isAccountability: '', isNewproblems: [], problemSource: [], feedbackStatus: [], projectSourceType: '', } this.$refs.searchForm.resetFields(); }, // 导出数据 exportData() { this.$refs.searchForm.validate((valid) => { if (valid) { this.advSJBGSearch() const url = `api/xcoa-mobile/v1/audit-fact-confirm/export` const fname = '事实确认列表.xls' download({ url, method: 'post', data: { expressions: this.expressions, maxResults: -1 } }, fname) } }) }, // 查看当前登录人是否项目成员 inProjectUser(userList) { return userList.some(item => item.userAccount === getUserInfo().account); }, // 刷新列表 refresh() { this.$refs.SJBGDataTable.refresh() }, // 查询方法 advSJBGSearch() { this.$refs.searchForm.validate((valid) => { if (valid) { this.expressions = [] // 修改时间范围处理逻辑 if (this.factConfirmAdvSearchForm.timeRange && Array.isArray(this.factConfirmAdvSearchForm.timeRange) && this.factConfirmAdvSearchForm.timeRange.length >= 2) { const [startDate, endDate] = this.factConfirmAdvSearchForm.timeRange if (startDate && endDate) { this.expressions.push({ dataType: 'str', name: 'dateStart', op: 'eq', stringValue: moment(startDate).year() + '', }) this.expressions.push({ dataType: 'str', name: 'dateEnd', op: 'eq', stringValue: moment(endDate).year() + '', }) } } // 审计机构 if (this.factConfirmAdvSearchForm.unitNames) { const codes = this.factConfirmAdvSearchForm.unitNames.map(item => item.code); this.expressions.push({ dataType: 'str', name: 'unitIds', op: 'eq', stringValue: `${codes.join(',')}`, }) } // 被审计单位 if (this.factConfirmAdvSearchForm.auditedUnitNames) { const codes = this.factConfirmAdvSearchForm.auditedUnitNames.map(item => item.code); this.expressions.push({ dataType: 'str', name: 'auditedUnitIds', op: 'eq', stringValue: `${codes.join(',')}`, }) } if (this.factConfirmAdvSearchForm.problemName) { this.expressions.push({ dataType: 'str', name: 'problemName', op: 'like', stringValue: `%${this.factConfirmAdvSearchForm.problemName}%`, }) } if (this.factConfirmAdvSearchForm.projectName) { this.expressions.push({ dataType: 'str', name: 'projectName', op: 'like', stringValue: `%${this.factConfirmAdvSearchForm.projectName}%`, }) } if (this.factConfirmAdvSearchForm.problemType) { this.expressions.push({ dataType: 'str', name: 'problemType', op: 'eq', stringValue: `${this.factConfirmAdvSearchForm.problemType}`, }) } const riskLevelId = this.getSelectIdValue(this.factConfirmAdvSearchForm.riskLevel); console.log('风险等级'+riskLevelId) if (riskLevelId) { this.expressions.push({ dataType: 'str', name: 'riskLevel', op: 'eq', stringValue: riskLevelId, }) } if (this.factConfirmAdvSearchForm.isAccountability) { this.expressions.push({ dataType: 'str', name: 'isAccountability', op: 'eq', stringValue: `${this.factConfirmAdvSearchForm.isAccountability}`, }) } const isNewproblemsId = this.getSelectIdValue(this.factConfirmAdvSearchForm.isNewproblems); console.log('是否新问题'+isNewproblemsId) if (isNewproblemsId) { this.expressions.push({ dataType: 'str', name: 'isNewproblems', op: 'eq', stringValue: isNewproblemsId, }) } const problemSourceId = this.getSelectIdValue(this.factConfirmAdvSearchForm.problemSource); console.log('问题来源'+problemSourceId) if (problemSourceId) { this.expressions.push({ dataType: 'str', name: 'problemSource', op: 'eq', stringValue: problemSourceId, }) } const feedbackStatusId = this.getSelectIdValue(this.factConfirmAdvSearchForm.feedbackStatus); console.log('问题反馈状态'+problemSourceId) if (feedbackStatusId) { this.expressions.push({ dataType: 'str', name: 'feedbackStatus', op: 'eq', stringValue: feedbackStatusId, }) } // 新增项目来源筛选 if (this.factConfirmAdvSearchForm.projectSourceType) { this.expressions.push({ dataType: 'str', name: 'projectSource', op: 'eq', stringValue: `${this.factConfirmAdvSearchForm.projectSourceType}`, }) } } }) }, }, } </script> <style module lang="scss"> @use '@/common/design' as *; /* 为下拉框添加清除按钮后的样式调整 */ .select { :global { .ant-select-selection--single { padding-right: 24px; /* 为清除按钮留出空间 */ } .ant-select-arrow { right: 11px; /* 调整箭头位置 */ } } } </style> 加一个表头冻结功能
07-13
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值