|
|
@@ -40,7 +40,7 @@
|
|
|
<view class="floating-field-name-display">{{ currentFieldName }}</view>
|
|
|
<view class="button-group">
|
|
|
<button class="upload-image-btn" :disabled="!currentCell" @click="openCamera">
|
|
|
- 拍摄图片
|
|
|
+ 插入图片
|
|
|
</button>
|
|
|
<button
|
|
|
class="special-symbol-btn"
|
|
|
@@ -108,6 +108,29 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
+ <view
|
|
|
+ v-if="imageSourceDialogVisible"
|
|
|
+ class="dialog-overlay"
|
|
|
+ @click="imageSourceDialogVisible = false"
|
|
|
+ >
|
|
|
+ <view class="image-source-dialog-content" @click.stop>
|
|
|
+ <view class="image-source-dialog-header">
|
|
|
+ <text class="image-source-dialog-title">插入图片</text>
|
|
|
+ <button class="image-source-dialog-close" @click="imageSourceDialogVisible = false">
|
|
|
+ ×
|
|
|
+ </button>
|
|
|
+ </view>
|
|
|
+ <view class="image-source-options">
|
|
|
+ <button class="image-source-option-btn" @click="handleTakePhoto">
|
|
|
+ <text class="option-label">拍摄图片</text>
|
|
|
+ </button>
|
|
|
+ <button class="image-source-option-btn" @click="handlePickFile">
|
|
|
+ <text class="option-label">选择文件</text>
|
|
|
+ </button>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+ </view>
|
|
|
+
|
|
|
<view v-if="dialogVisible" class="dialog-overlay" @click="dialogVisible = false">
|
|
|
<view class="dialog-content" @click.stop>
|
|
|
<view class="modal-message">{{ dialogMessage }}</view>
|
|
|
@@ -164,6 +187,7 @@ const emit = defineEmits([
|
|
|
'cancel',
|
|
|
'close',
|
|
|
'openCamera',
|
|
|
+ 'openFilePicker',
|
|
|
'calcCompleted',
|
|
|
'selectedReport',
|
|
|
'updateCheckItemData',
|
|
|
@@ -186,6 +210,7 @@ const currentFieldName = ref('-')
|
|
|
const fieldNameMapping = ref([])
|
|
|
const dialogVisible = ref(false)
|
|
|
const dialogMessage = ref('')
|
|
|
+const imageSourceDialogVisible = ref(false)
|
|
|
const floatingInputRef = ref(null)
|
|
|
const floatingInputCursor = ref(0)
|
|
|
const specialSymbolVisible = ref(false)
|
|
|
@@ -582,7 +607,7 @@ function setDataSource(designerInstance, schemaData, dataSourceValues) {
|
|
|
totalDataCount,
|
|
|
} = processContinueDataSource(spreadInstance, resultDataSource)
|
|
|
|
|
|
- console.log("@@@@xxxxxxxxx111111....", continuePageProceedDataSource)
|
|
|
+ console.log("@@@@preContinuePageProceedDatasource....", continuePageProceedDataSource)
|
|
|
prefixFields = prefixFieldSet
|
|
|
dataCount = totalDataCount
|
|
|
processContinuePage(
|
|
|
@@ -591,7 +616,7 @@ function setDataSource(designerInstance, schemaData, dataSourceValues) {
|
|
|
sheetToRecordRowCount,
|
|
|
totalDataCount,
|
|
|
)
|
|
|
- console.log("@@@@@xxxxxxxx2222222....", continuePageProceedDataSource)
|
|
|
+ console.log("@@@@@afterContinuePageProceedDatasource....", continuePageProceedDataSource)
|
|
|
registerCellValuesChangeEventHandlerForEverySheet(spreadInstance.sheets)
|
|
|
for (const sheet of spreadInstance.sheets) {
|
|
|
const tables = sheet.tables?.all() || []
|
|
|
@@ -1340,9 +1365,6 @@ function handleDataJson(dataJson) {
|
|
|
|
|
|
const prefixFieldData = {}
|
|
|
for (const prefixField of prefixFields) {
|
|
|
- if(prefixField.startsWith('yearInspectionConclusion')) {
|
|
|
- continue
|
|
|
- }
|
|
|
const cellDataList = []
|
|
|
for (let i = 0; i < dataCount; i++) {
|
|
|
const cellData = dataJson[`${prefixField}_${i+1}`]
|
|
|
@@ -1355,12 +1377,6 @@ function handleDataJson(dataJson) {
|
|
|
if(key.startsWith(prefixField)) {
|
|
|
delete dataJson[key]
|
|
|
}
|
|
|
- if(key.startsWith("yearInspectionConclusion")) {
|
|
|
- const yc = dataJson[key]
|
|
|
- if(yc == null || yc == "") {
|
|
|
- delete dataJson[key]
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -1407,9 +1423,19 @@ function goBack() {
|
|
|
}
|
|
|
|
|
|
function openCamera() {
|
|
|
+ imageSourceDialogVisible.value = true
|
|
|
+}
|
|
|
+
|
|
|
+function handleTakePhoto() {
|
|
|
+ imageSourceDialogVisible.value = false
|
|
|
emit('openCamera')
|
|
|
}
|
|
|
|
|
|
+function handlePickFile() {
|
|
|
+ imageSourceDialogVisible.value = false
|
|
|
+ emit('openFilePicker')
|
|
|
+}
|
|
|
+
|
|
|
function getPictureSource(photoData) {
|
|
|
if (!photoData?.base64) return ''
|
|
|
if (photoData.base64.startsWith('data:')) return photoData.base64
|
|
|
@@ -2148,4 +2174,74 @@ defineExpose({
|
|
|
color: #333;
|
|
|
text-align: center;
|
|
|
}
|
|
|
+
|
|
|
+.image-source-dialog-content {
|
|
|
+ width: min(80vw, 320px);
|
|
|
+ padding: 20px;
|
|
|
+ background-color: white;
|
|
|
+ border-radius: 8px;
|
|
|
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
|
+}
|
|
|
+
|
|
|
+.image-source-dialog-header {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+ margin-bottom: 16px;
|
|
|
+}
|
|
|
+
|
|
|
+.image-source-dialog-title {
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: 600;
|
|
|
+ color: #333;
|
|
|
+}
|
|
|
+
|
|
|
+.image-source-dialog-close {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ width: 28px;
|
|
|
+ height: 28px;
|
|
|
+ font-size: 18px;
|
|
|
+ color: #666;
|
|
|
+ cursor: pointer;
|
|
|
+ background: #f5f5f5;
|
|
|
+ border: none;
|
|
|
+ border-radius: 14px;
|
|
|
+}
|
|
|
+
|
|
|
+.image-source-options {
|
|
|
+ display: flex;
|
|
|
+ gap: 12px;
|
|
|
+ justify-content: center;
|
|
|
+}
|
|
|
+
|
|
|
+.image-source-option-btn {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+ width: 120px;
|
|
|
+ height: 80px;
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: 500;
|
|
|
+ color: #333;
|
|
|
+ cursor: pointer;
|
|
|
+ background: #f8f9fa;
|
|
|
+ border: 1px solid #dee2e6;
|
|
|
+ border-radius: 8px;
|
|
|
+ transition: all 0.2s ease;
|
|
|
+}
|
|
|
+
|
|
|
+.image-source-option-btn:hover {
|
|
|
+ color: #007aff;
|
|
|
+ background: #eef6ff;
|
|
|
+ border-color: #007aff;
|
|
|
+}
|
|
|
+
|
|
|
+.option-label {
|
|
|
+ font-size: 14px;
|
|
|
+ font-weight: 500;
|
|
|
+ color: inherit;
|
|
|
+}
|
|
|
</style>
|