diff --git a/src/components/TEditor/index.vue b/src/components/TEditor/index.vue
index ecaf914..7bf39eb 100644
--- a/src/components/TEditor/index.vue
+++ b/src/components/TEditor/index.vue
@@ -216,6 +216,7 @@ const init = reactive({
},
// 设置初始化内容(初始化结束后执行)
init_instance_callback: function (editor) {
+ console.log('初始化内容', props.value)
editor.setContent(props.value); // 设置默认文本内容
emits('update:modelValue', editor.getContent()) //更新
// 设置高度
@@ -276,13 +277,13 @@ window.onresize = function temp() {
};
// 设置值
-const handleSetContent = (content) => {
+const handleSetContent = (content) => {
tinymce.activeEditor.setContent(content);
};
// 获取值
const handleGetContent = () => {
- return tinymce.activeEditor.getContent();
+ return tinymce.activeEditor.getContent();
};
const updateModelValue = (val) => {
@@ -292,7 +293,7 @@ const updateModelValue = (val) => {
const content = editor.getContent()
const isEmpty = checkEmptyContent(editor)
-
+ console.log('dsfsdaf', content, isEmpty)
// 更新绑定值
myValue.value = content
emits('update:modelValue', content)
diff --git a/src/router/index.js b/src/router/index.js
index 91320c4..053c423 100644
--- a/src/router/index.js
+++ b/src/router/index.js
@@ -446,6 +446,20 @@ export const dynamicRoutes = [
}
]
},
+ {
+ path: '/libaryDetail',
+ component: Layout,
+ hidden: true,
+ permissions: ['databaseLibary:view'],
+ children: [
+ {
+ path: ':Id(\\d+)?',
+ component: () => import('@/views/databaseLibary/components/libaryDetail'),
+ name: 'libaryDetail',
+ meta: { title: '百科数据库预览', activeMenu: '/databaseLibary' }
+ }
+ ]
+ },
{
path: '/system/userApprovalForm',
component: Layout,
diff --git a/src/views/databaseLibary/components/card.vue b/src/views/databaseLibary/components/card.vue
index 6b41ac7..64f1b52 100644
--- a/src/views/databaseLibary/components/card.vue
+++ b/src/views/databaseLibary/components/card.vue
@@ -1,7 +1,7 @@
-
+
新增
@@ -14,21 +14,23 @@
+
{{ item.title }}
-
+
加载更多…
@@ -59,16 +61,39 @@ const getBusEncyclopediaDatabasePageList = () => {
getBusEncyclopediaDatabasePage(queryParams.value).then(res => {
console.log('查询结果', res)
if (res.code == 200) {
- tableData.value = res.data.list
+ if (res.data.list.length > 0) tableData.value = tableData.value.concat(res.data.list)
+ else {
+ queryParams.value.pageIndex = queryParams.value.pageIndex - 1
+ proxy.$modal.msgSuccess("没有更多了")
+ }
}
loading.value = false
}).catch(() => {
loading.value = false
})
}
+// 加载更多
+const handleLoadMore = () => {
+ queryParams.value.pageIndex = queryParams.value.pageIndex + 1
+ getBusEncyclopediaDatabasePageList()
+}
+// 删除
+const handleDetele = (recordId) => {
+ proxy.$modal.confirm('是否确认删除该项数据项?').then(function () {
+ return deleteBusEncyclopediaDatabase(recordId)
+ }).then(() => {
+ tableData.value = []
+ queryParams.value.pageIndex = 1
+ getBusEncyclopediaDatabasePageList();
+ proxy.$modal.msgSuccess("删除成功")
+ }).catch(() => { })
+}
const handleOpenAddForm = () => {
router.push('/databaseLibaryForm')
}
+const handleEdit = (recordId) => {
+ router.push('/databaseLibaryForm/' + recordId)
+}
// 暴露给父组件的参数和方法
defineExpose({
@@ -167,7 +192,7 @@ defineExpose({
margin: 6px;
}
}
-
+
&:hover .optionBtns {
opacity: 1;
visibility: visible;
@@ -183,7 +208,7 @@ defineExpose({
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
- text-align: center;
+ text-align: center;
}
.optionBtns {
diff --git a/src/views/databaseLibary/components/libaryDetail.vue b/src/views/databaseLibary/components/libaryDetail.vue
new file mode 100644
index 0000000..4f2b74c
--- /dev/null
+++ b/src/views/databaseLibary/components/libaryDetail.vue
@@ -0,0 +1,312 @@
+
+
+
+
+
+ {{
+ item.title }}
+ {{ item.title }}
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/views/databaseLibary/components/libaryForm.vue b/src/views/databaseLibary/components/libaryForm.vue
index 5e60335..2833e6e 100644
--- a/src/views/databaseLibary/components/libaryForm.vue
+++ b/src/views/databaseLibary/components/libaryForm.vue
@@ -13,7 +13,7 @@
@@ -58,7 +58,7 @@
-
@@ -78,20 +78,20 @@
{{ scope.$index + 1 }}
-
+
- {{ scope.row.remark }}
+ {{ scope.row.name }}
-
+
-
+
- {{ scope.row.remark }}
+ {{ scope.row.linkUrl }}
-
+
{
getBusEncyclopediaDatabase(id).then(res => {
if (res.code == 200) {
ruleForm.value = res.data
- ruleForm.value.year = res.data.year.toString()
- escUserName.value = res.data.escUserName
- escWorkNo.value = res.data.workNo
- escUserId.value = res.data.escUserId
- res.data.reviewProblemList.forEach(item => {
- item.editFlag = false
- showTableData.value.push(item)
- cachShowTableData.value.push(item)
- });
+ categorySelectedValue.value = [res.data.category]
+ categoryTwoSelectedValue.value = [res.data.categoryTwo]
+ editorRef.value.handleSetContent(res.data.mainText)
+ docUploadList.value = JSON.parse(res.data.fileContent)
+
+
+ // ruleForm.value.year = res.data.year.toString()
+ // escUserName.value = res.data.escUserName
+ // escWorkNo.value = res.data.workNo
+ // escUserId.value = res.data.escUserId
+ // res.data.reviewProblemList.forEach(item => {
+ // item.editFlag = false
+ // showTableData.value.push(item)
+ // cachShowTableData.value.push(item)
+ // });
}
})
}
@@ -331,8 +338,9 @@ const handleCancel = () => {
})
}
const handleSubmit = () => {
- proxy.$refs["ruleFormRef"].validate(valid => {
+ proxy.$refs["ruleFormRef"].validate(valid => {
if (valid) {
+ ruleForm.value.fileContent = JSON.stringify(docUploadList.value)
ruleForm.value.encyclopediaDatabaseLinkList = showTableData.value
if (ruleForm.value.id != undefined) {
updateBusEncyclopediaDatabase(ruleForm.value).then(response => {
diff --git a/src/views/databaseLibary/components/list.vue b/src/views/databaseLibary/components/list.vue
index b8cddf8..3a8332a 100644
--- a/src/views/databaseLibary/components/list.vue
+++ b/src/views/databaseLibary/components/list.vue
@@ -1,7 +1,7 @@
-
+
新增
@@ -9,9 +9,9 @@
-