|
|
@@ -23,6 +23,11 @@
|
|
|
<BatchUploadFile @uploadImg="addPic" :colList="colListData" />
|
|
|
</div>
|
|
|
</el-dropdown-item>
|
|
|
+ <el-dropdown-item @click="openWingdingsDialog">
|
|
|
+ <div class="dropdown-item-content">
|
|
|
+ <el-button type="info" plain style="margin-right: 12px;">插入特殊符号</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dropdown-item>
|
|
|
</el-dropdown-menu>
|
|
|
</template>
|
|
|
</el-dropdown>
|
|
|
@@ -46,6 +51,31 @@
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <!-- Wingdings 符号选择弹窗 -->
|
|
|
+ <el-dialog
|
|
|
+ v-model="wingdingsDialogVisible"
|
|
|
+ title="选择特殊符号"
|
|
|
+ width="600px"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ >
|
|
|
+ <div class="wingdings-container">
|
|
|
+ <div class="wingdings-grid">
|
|
|
+ <div
|
|
|
+ v-for="(item, index) in getWingdingsList"
|
|
|
+ :key="index"
|
|
|
+ class="wingdings-item"
|
|
|
+ @click="selectWingdings(item)"
|
|
|
+ >
|
|
|
+ <span class="wingdings-symbol">{{ item.value }}</span>
|
|
|
+ <span class="wingdings-label">{{ item.label }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <template #footer>
|
|
|
+ <el-button @click="wingdingsDialogVisible = false">取消</el-button>
|
|
|
+ </template>
|
|
|
+ </el-dialog>
|
|
|
</template>
|
|
|
<script lang="ts" setup>
|
|
|
import '@grapecity-software/spread-sheets-designer-resources-cn'
|
|
|
@@ -78,6 +108,7 @@ import {editReport, handleCopy} from "@/utils/reportUtil";
|
|
|
import Designer from '@grapecity-software/spread-sheets-designer-vue'
|
|
|
import { ElLoading } from "element-plus"
|
|
|
import {getPDF2, getPDFByInspection} from "@/api/pressure2/standard/template";
|
|
|
+import { useDictStore } from '@/store/modules/dict'
|
|
|
|
|
|
defineOptions({ name: 'SpreadViewer' });
|
|
|
|
|
|
@@ -114,6 +145,7 @@ watch(()=>[props.initData.templateId,props.initData.refId],([newTide,newRid],[ol
|
|
|
//const route = useRoute()
|
|
|
// spread相关
|
|
|
const tagsViewStore = useTagsViewStore()
|
|
|
+const dictStore = useDictStore()
|
|
|
const loading = ref(true)
|
|
|
const showSpread=ref(true)
|
|
|
const previewContainer = ref(null)
|
|
|
@@ -134,6 +166,14 @@ const pdfContentWidth = ref(800)
|
|
|
const pdfViewerHeight = ref(600)
|
|
|
const pdfTimestamp = ref('')
|
|
|
|
|
|
+// Wingdings 弹窗相关
|
|
|
+const wingdingsDialogVisible = ref(false)
|
|
|
+const currentCell = ref(null)
|
|
|
+
|
|
|
+const getWingdingsList = computed(
|
|
|
+ () => dictStore.getDictMap['Wingdings']
|
|
|
+)
|
|
|
+
|
|
|
const handlePdfRendered = () => {
|
|
|
pdfLoading.value = false
|
|
|
}
|
|
|
@@ -215,6 +255,7 @@ const initPreview = async () => {
|
|
|
showPdf.value = false;
|
|
|
loading.value = false;
|
|
|
}
|
|
|
+ console.log(getWingdingsList)
|
|
|
})
|
|
|
|
|
|
}, (error) => {
|
|
|
@@ -367,6 +408,58 @@ const processOADateFields = (obj: any): any => {
|
|
|
return obj;
|
|
|
};
|
|
|
|
|
|
+/**
|
|
|
+ * 打开 Wingdings 符号选择弹窗
|
|
|
+ */
|
|
|
+const openWingdingsDialog = () => {
|
|
|
+ if (!previewSpread) {
|
|
|
+ ElMessage.warning('请先加载文档')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ // 获取当前选中的单元格
|
|
|
+ const activeSheet = previewSpread.getActiveSheet()
|
|
|
+ const selections = activeSheet.getSelections()
|
|
|
+
|
|
|
+ if (!selections || selections.length === 0) {
|
|
|
+ ElMessage.warning('请先选择一个单元格')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ // 保存当前单元格信息
|
|
|
+ const selection = selections[0]
|
|
|
+ currentCell.value = {
|
|
|
+ sheet: activeSheet,
|
|
|
+ row: selection.row,
|
|
|
+ col: selection.col
|
|
|
+ }
|
|
|
+
|
|
|
+ wingdingsDialogVisible.value = true
|
|
|
+}
|
|
|
+
|
|
|
+/**
|
|
|
+ * 选择 Wingdings 符号并插入到单元格
|
|
|
+ */
|
|
|
+const selectWingdings = (item) => {
|
|
|
+ if (!currentCell.value) {
|
|
|
+ ElMessage.error('未找到目标单元格')
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ const { sheet, row, col } = currentCell.value
|
|
|
+ const cell = sheet.getCell(row, col)
|
|
|
+
|
|
|
+ // 获取当前单元格的值
|
|
|
+ const currentValue = cell.value() || ''
|
|
|
+
|
|
|
+ // 追加符号到单元格
|
|
|
+ const newValue = currentValue + item.value
|
|
|
+ cell.value(newValue)
|
|
|
+
|
|
|
+ ElMessage.success(`已插入符号: ${item.label}`)
|
|
|
+ wingdingsDialogVisible.value = false
|
|
|
+}
|
|
|
+
|
|
|
const handleSave = () => {
|
|
|
loading.value = true;
|
|
|
|
|
|
@@ -697,5 +790,50 @@ onUnmounted(()=>{
|
|
|
align-items: center;
|
|
|
}
|
|
|
|
|
|
+// Wingdings 符号选择样式
|
|
|
+.wingdings-container {
|
|
|
+ max-height: 500px;
|
|
|
+ overflow-y: auto;
|
|
|
+}
|
|
|
+
|
|
|
+.wingdings-grid {
|
|
|
+ display: grid;
|
|
|
+ grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
|
|
|
+ gap: 12px;
|
|
|
+ padding: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.wingdings-item {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ padding: 12px 8px;
|
|
|
+ border: 1px solid #dcdfe6;
|
|
|
+ border-radius: 4px;
|
|
|
+ cursor: pointer;
|
|
|
+ transition: all 0.3s;
|
|
|
+
|
|
|
+ &:hover {
|
|
|
+ border-color: #409eff;
|
|
|
+ background-color: #ecf5ff;
|
|
|
+ transform: translateY(-2px);
|
|
|
+ box-shadow: 0 2px 8px rgba(64, 158, 255, 0.2);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+.wingdings-symbol {
|
|
|
+ font-size: 24px;
|
|
|
+ margin-bottom: 4px;
|
|
|
+ color: #303133;
|
|
|
+}
|
|
|
+
|
|
|
+.wingdings-label {
|
|
|
+ font-size: 12px;
|
|
|
+ color: #909399;
|
|
|
+ text-align: center;
|
|
|
+ word-break: break-all;
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
</style>
|