|
|
@@ -107,12 +107,58 @@
|
|
|
<span class="button" @click="setFeedback"> <SvgIcon icon-class="sidebar-feedback" size="14" /> 用户反馈</span> -->
|
|
|
</template>
|
|
|
</div>
|
|
|
+ <template v-if="showRemark && Object.keys(componentRemarkObj).length !== 0 && componentRemarkObj['WHOLE']">
|
|
|
+ <el-popover
|
|
|
+ v-for="(items, indexs) in componentRemarkObj['WHOLE']"
|
|
|
+ :key="'menu-remark-info' + indexs"
|
|
|
+ placement="bottom"
|
|
|
+ trigger="click"
|
|
|
+ popper-class="menu-remark-info"
|
|
|
+ >
|
|
|
+ <div v-html="items.content"></div>
|
|
|
+ <template v-if="items.file_list.length > 0">
|
|
|
+ <div v-for="(item, index) in items.file_list" :key="indexs + '-' + index" class="remark-file-item">
|
|
|
+ <SvgIcon :icon-class="item.icon_type" />
|
|
|
+ <span class="file-item-name">{{ item.file_name }}</span>
|
|
|
+ <SvgIcon icon-class="uploadPreview" @click="viewDialog(item)" />
|
|
|
+ <SvgIcon icon-class="download" @click="downLoad(item)" />
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ <template #reference>
|
|
|
+ <div
|
|
|
+ v-if="items.position_br_x - items.position_x > 3 && items.position_br_y - items.position_y > 3"
|
|
|
+ slot="reference"
|
|
|
+ :style="{
|
|
|
+ position: 'absolute',
|
|
|
+ top: `${items.position_y}px`,
|
|
|
+ left: `${items.position_x}px`,
|
|
|
+ width: `${items.position_br_x - items.position_x}px`,
|
|
|
+ height: `${items.position_br_y - items.position_y}px`,
|
|
|
+ border: '2px solid #165DFF',
|
|
|
+ }"
|
|
|
+ ></div>
|
|
|
+ </template>
|
|
|
+ </el-popover>
|
|
|
+ </template>
|
|
|
+ <el-dialog
|
|
|
+ v-if="visible"
|
|
|
+ :visible.sync="visible"
|
|
|
+ :show-close="true"
|
|
|
+ :close-on-click-modal="true"
|
|
|
+ :modal-append-to-body="true"
|
|
|
+ :append-to-body="true"
|
|
|
+ :lock-scroll="true"
|
|
|
+ :width="'80%'"
|
|
|
+ top="0"
|
|
|
+ >
|
|
|
+ <iframe v-if="visible" :src="newpath" width="100%" :height="iframeHeight" frameborder="0"></iframe>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import { previewComponentList } from '@/views/book/courseware/data/bookType';
|
|
|
-
|
|
|
+import { getToken, getConfig } from '@/utils/auth';
|
|
|
import _ from 'lodash';
|
|
|
|
|
|
export default {
|
|
|
@@ -198,6 +244,10 @@ export default {
|
|
|
curSelectId: '', // 当前选中组件id
|
|
|
|
|
|
isSelecting: false, // 是否开始框选内容
|
|
|
+ file_preview_url: getConfig() ? getConfig().doc_preview_service_address : '',
|
|
|
+ visible: false,
|
|
|
+ newpath: '',
|
|
|
+ iframeHeight: `${window.innerHeight - 100}px`,
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -1029,7 +1079,6 @@ export default {
|
|
|
startSelection(event) {
|
|
|
if (this.canRemark) {
|
|
|
this.isSelecting = true;
|
|
|
-
|
|
|
let clientRect = document.getElementById(`selectable-area-preview`).getBoundingClientRect();
|
|
|
this.menuPosition.startX = event.clientX - clientRect.left;
|
|
|
this.menuPosition.startY = event.clientY - clientRect.top;
|
|
|
@@ -1068,6 +1117,25 @@ export default {
|
|
|
resetRemark() {
|
|
|
this.menuPosition = { x: 0, y: 0, select_node: '', startX: null, startY: null, endX: null, endY: null };
|
|
|
},
|
|
|
+ // 下载文件
|
|
|
+ downLoad(file) {
|
|
|
+ let userInfor = getToken();
|
|
|
+ let AccessToken = '';
|
|
|
+ if (userInfor) {
|
|
|
+ AccessToken = userInfor.access_token;
|
|
|
+ }
|
|
|
+ let FileID = file.file_id;
|
|
|
+ let data = {
|
|
|
+ AccessToken,
|
|
|
+ FileID,
|
|
|
+ };
|
|
|
+ location.href = `${process.env.VUE_APP_EEP}/FileServer/WebFileDownload?AccessToken=${data.AccessToken}&FileID=${data.FileID}`;
|
|
|
+ },
|
|
|
+ // 预览
|
|
|
+ viewDialog(file) {
|
|
|
+ this.newpath = `${this.file_preview_url}onlinePreview?url=${Base64.encode(file.file_url)}`;
|
|
|
+ this.visible = true;
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
|
@@ -1173,4 +1241,30 @@ export default {
|
|
|
max-width: 100%;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+.remark-file-item {
|
|
|
+ display: flex;
|
|
|
+ gap: 5px;
|
|
|
+ align-items: center;
|
|
|
+ padding: 3px;
|
|
|
+ margin: 5px 0;
|
|
|
+ background: #f2f3f5;
|
|
|
+ border-radius: 3px;
|
|
|
+
|
|
|
+ &-name {
|
|
|
+ flex: 1;
|
|
|
+ font-size: 12px;
|
|
|
+ word-break: break-all;
|
|
|
+ }
|
|
|
+
|
|
|
+ .svg-icon {
|
|
|
+ flex-shrink: 0;
|
|
|
+ font-size: 16px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .uploadPreview,
|
|
|
+ .download {
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|