[update] 文档拆分详情页布局

This commit is contained in:
lideqin
2023-08-18 18:03:53 +08:00
parent 6b1a7feaed
commit e331340e55
5 changed files with 293 additions and 523 deletions
+17 -1
View File
@@ -21,7 +21,8 @@
<span v-else-if="ol.text === $t('cancelSubscribe')" v-has="ol.has" class="text"> <span v-else-if="ol.text === $t('cancelSubscribe')" v-has="ol.has" class="text">
{{ !record.subscribeFlag || record.subscribeFlag === 0 ? $t('subscribe') :$t('cancelSubscribe') }} {{ !record.subscribeFlag || record.subscribeFlag === 0 ? $t('subscribe') :$t('cancelSubscribe') }}
</span> </span>
<span v-else v-has="ol.has" class="text"> <!-- v-has="ol.has"-->
<span v-else class="text">
{{ ol.text }} {{ ol.text }}
</span> </span>
</a> </a>
@@ -200,6 +201,21 @@ export default {
// scopedSlots: { customRender: 'operation' } // scopedSlots: { customRender: 'operation' }
// } // }
] ]
let width = 0
if (this.operationList.length > 0) {
for (let i = 0; i < this.operationList.length; i++) {
width += this.getTextWith(this.operationList[i].text)
}
}
if (this.showAction) {
this.columns.push({
title: this.$t('operation'),
align: 'center',
fixed: 'right',
width: width,
scopedSlots: { customRender: 'operation' }
})
}
this.dataSource = [ this.dataSource = [
{ {
collectFlag: '0', collectFlag: '0',
+1 -1
View File
@@ -2,7 +2,7 @@
<a-card :bordered="false"> <a-card :bordered="false">
<div class="left-tree-div"> <div class="left-tree-div">
<div class="div-left"> <div class="div-left">
<div class="split-detail-left-tree"> <div>
<a-input-search style="margin-bottom: 8px" :placeholder="$t('nodeQuickLookup')" @change="onLeftChange" <a-input-search style="margin-bottom: 8px" :placeholder="$t('nodeQuickLookup')" @change="onLeftChange"
@search="onSearch"/> @search="onSearch"/>
<a-tree <a-tree
+2 -2
View File
@@ -62,12 +62,12 @@ export default {
// 查看 // 查看
{ {
text: this.$t('view'), text: this.$t('view'),
ClickEvent: 'detailClick' clickEvent: 'detailClick'
}, },
// 删除 // 删除
{ {
text: this.$t('delete'), text: this.$t('delete'),
ClickEvent: 'deleteDetail' clickEvent: 'deleteDetail'
} }
], ],
url: { url: {
@@ -16,7 +16,7 @@
:rules="rules" :rules="rules"
ref="splitEditForm" ref="splitEditForm"
> >
<a-row :gutter="24" class="split-form-row"> <a-row :gutter="24">
<a-col :span="12" v-for="(item,index) in dataList" :key="index"> <a-col :span="12" v-for="(item,index) in dataList" :key="index">
<div class="box-title-text" v-if="item.field_show_type === '1' || item.field_show_type === '11'"> <div class="box-title-text" v-if="item.field_show_type === '1' || item.field_show_type === '11'">
<div class="title-text"> <div class="title-text">
@@ -143,7 +143,7 @@
<span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span> <span class="title-text-text" :title="item.db_field_txt">{{item.db_field_txt}}</span>
</div> </div>
<a-form-model-item class="item-model" :prop="item.db_field_name"> <a-form-model-item class="item-model" :prop="item.db_field_name">
<Standardselection :query="item" <standard-selection :query="item"
:disabled="disabled" :disabled="disabled"
:standard="formInline" :standard="formInline"
v-model="formInline[item.db_field_name]"/> v-model="formInline[item.db_field_name]"/>
@@ -329,16 +329,16 @@ import UploadFile from '@/components/UploadFile'
import StandardSelection from '@/components/selection/StandardSelection' import StandardSelection from '@/components/selection/StandardSelection'
import SplitUpload from '@/components/splitUpload/SplitUpload' import SplitUpload from '@/components/splitUpload/SplitUpload'
import UEditor from '@/components/uEditor/UEditor' import UEditor from '@/components/uEditor/UEditor'
import moment from 'moment'
import axios from 'axios' import axios from 'axios'
import { getAction, postAction } from '@/api/manage' import { getAction } from '@/api/manage'
import { ACCESS_TOKEN } from '@/store/mutation-types' import { ACCESS_TOKEN } from '@/store/mutation-types'
import Vue from 'vue'
export default { export default {
name: 'SplitAddForm', name: 'SplitAddForm',
components: { components: {
uploadFile, UploadFile,
Standardselection, StandardSelection,
SplitUpload, SplitUpload,
UEditor UEditor
}, },
@@ -726,7 +726,7 @@ export default {
this.$message.warning(this.$t('oneTableAdded')) this.$message.warning(this.$t('oneTableAdded'))
} else if (!ueContent || ueContent.length < 1) { } else if (!ueContent || ueContent.length < 1) {
this.$message.warning(this.$t('addATable')) this.$message.warning(this.$t('addATable'))
} if (ueContent && ueContent.length == 1) { } if (ueContent && ueContent.length === 1) {
this.tableVisible = false this.tableVisible = false
if (this.isTableEdit) { if (this.isTableEdit) {
this.contentList[this.addIndex] = { this.contentList[this.addIndex] = {
+21 -267
View File
@@ -1,10 +1,8 @@
<template> <template>
<div class="main-item">
<div class="split-detail" @click="clearMenu" :style="'width:' + (fullWidth - 200) + 'px'">
<a-card :bordered="false"> <a-card :bordered="false">
<div class="split-detail-wrap"> <div class="left-tree-div">
<div class="split-detail-left"> <div class="div-left">
<div class="split-detail-left-tree"> <div>
<a-input-search style="margin-bottom: 8px" :placeholder="$t('nodeQuickLookup')" @change="onLeftChange" <a-input-search style="margin-bottom: 8px" :placeholder="$t('nodeQuickLookup')" @change="onLeftChange"
@search="onSearch" /> @search="onSearch" />
<a-tree <a-tree
@@ -67,9 +65,9 @@
</a-tree> </a-tree>
</div> </div>
</div> </div>
<div class="split-detail-right"> <div class="div-right">
<div class="split-detail-right-wraper"> <div class="div-right-wrapper">
<div class="split-detail-search-header"> <div class="right-search-header table-page-search-wrapper">
<search :flag="'4'" :url="url" :infoId="$route.query.infoId" <search :flag="'4'" :url="url" :infoId="$route.query.infoId"
:menuId="menuId" @resetSearch="resetSearch" @queryParams="queryParamsValues" /> :menuId="menuId" @resetSearch="resetSearch" @queryParams="queryParamsValues" />
</div> </div>
@@ -80,9 +78,9 @@
<a-icon type="copy" /> <a-icon type="copy" />
{{ $t('copy') }} {{ $t('copy') }}
</div> </div>
<div class="operator-text" @click="handleAddManage" <div class="operator-text" @click="handleAddManage">
v-if="$route.query.createBy === userData.username || administrators" <!-- v-if="$route.query.createBy === userData.username || administrators"-->
v-has="'split:sarFileSplitItems:add'"> <!-- v-has="'split:sarFileSplitItems:add'"-->
<a-icon type="plus" /> <a-icon type="plus" />
{{ $t('add') }} {{ $t('add') }}
</div> </div>
@@ -208,8 +206,6 @@
</div> </div>
</a-card> </a-card>
</div>
</div>
</template> </template>
<script> <script>
@@ -218,7 +214,9 @@ import TableData from '@/components/customField/TableData'
import AddForm from '@/components/customField/AddForm' import AddForm from '@/components/customField/AddForm'
import Vue from 'vue' import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types' import { ACCESS_TOKEN } from '@/store/mutation-types'
import mapGetters from 'vuex' import { mapGetters } from 'vuex'
import { postAction, getAction, putAction, downloadFile } from '@/api/manage'
import moment from 'moment'
export default { export default {
name: 'SplitDetail', name: 'SplitDetail',
@@ -656,45 +654,22 @@ export default {
this.$confirm({ this.$confirm({
title: this.$t('confirmReplication'), title: this.$t('confirmReplication'),
content: '', content: '',
onOk: onOk: () => {
async () => { getAction('/split/sarFileSplitItems/batchCopyItems', params).then((res) => {
axios({
url: '/jero-boot/split/sarFileSplitItems/batchCopyItems',
method: 'get',
params: params,
// transformRequest: [function (data) {
// // Do whatever you want to transform the data
// let ret = ''
// for (let it in data) {
// ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
// }
// return ret
// }],
headers: {
// 'Content-Type': 'application/x-www-form-urlencoded',
'X-Access-Token': this.token
}
})
.then((res) => {
if (res.data.success) { if (res.data.success) {
this.$message.success(this.$t('operationSuccessful')) this.$message.success(this.$t('operationSuccessful'))
this.$emit('selectClear')
this.selectClear() this.selectClear()
// this.loadData() // this.loadData()
this.loadMenuData() this.loadMenuData()
const queryParam = { const queryParam = {
menu_id: this.menuId, menu_id: this.menuId,
info_id: this.infoId info_id: this.infoId
} }
this.$refs.splitDetailTable.$emit('searchGetData', JSON.parse(JSON.stringify(queryParam))) this.$refs.splitDetailTable.$emit('searchGetData', JSON.parse(JSON.stringify(queryParam)))
// eventBUs.$emit('searchReset')
} else { } else {
this.$message.warning(this.$t('operationFailed')) this.$message.warning(this.$t('operationFailed'))
} }
}) })
},
onCancel () {
} }
}) })
} else if (menuIds.length === 0) { } else if (menuIds.length === 0) {
@@ -791,19 +766,8 @@ export default {
this.$confirm({ this.$confirm({
title: this.$t('docTool.split.mergeTerms'), title: this.$t('docTool.split.mergeTerms'),
content: '', content: '',
onOk: onOk: () => {
async () => { getAction('/split/sarFileSplitItems/batchMergeItems', { ids: ids }).then(res => {
axios({
url: '/jero-boot/split/sarFileSplitItems/batchMergeItems',
method: 'get',
params: {
ids: ids
},
headers: {
'X-Access-Token': this.token
}
})
.then((res) => {
if (res.data.success) { if (res.data.success) {
this.$message.success(this.$t('operationSuccessful')) this.$message.success(this.$t('operationSuccessful'))
this.selectClear() this.selectClear()
@@ -811,7 +775,6 @@ export default {
const queryParam = { const queryParam = {
menu_id: this.menuId, menu_id: this.menuId,
info_id: this.infoId info_id: this.infoId
} }
this.$refs.splitDetailTable.$emit('searchGetData', JSON.parse(JSON.stringify(queryParam))) this.$refs.splitDetailTable.$emit('searchGetData', JSON.parse(JSON.stringify(queryParam)))
this.selectedRowKeys = [] this.selectedRowKeys = []
@@ -848,15 +811,7 @@ export default {
url = this.url.addInfo url = this.url.addInfo
} }
formInline.ids = this.ids formInline.ids = this.ids
axios({ postAction(url, formInline).then((res) => {
url: url,
method: 'post',
data: formInline,
headers: {
'X-Access-Token': this.token
}
})
.then((res) => {
if (res.data.success) { if (res.data.success) {
this.$message.success(this.$t('operationSuccessful')) this.$message.success(this.$t('operationSuccessful'))
this.batSetVisible = false this.batSetVisible = false
@@ -880,33 +835,14 @@ export default {
this.$confirm({ this.$confirm({
title: this.$t('confirmBatchDeletion'), title: this.$t('confirmBatchDeletion'),
content: '', content: '',
onOk: onOk: () => {
async () => { postAction('/split/sarFileSplitItems/batchDeleteItems', params).then((res) => {
axios({
url: '/jero-boot/split/sarFileSplitItems/batchDeleteItems',
method: 'post',
data: params,
transformRequest: [function (data) {
// Do whatever you want to transform the data
let ret = ''
for (const it in data) {
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
}
return ret
}],
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Access-Token': this.token
}
})
.then((res) => {
if (res.data.success) { if (res.data.success) {
this.$message.success(this.$t('operationSuccessful')) this.$message.success(this.$t('operationSuccessful'))
this.loadMenuData() this.loadMenuData()
const queryParam = { const queryParam = {
menu_id: this.menuId, menu_id: this.menuId,
info_id: this.infoId info_id: this.infoId
} }
this.$refs.splitDetailTable.$emit('searchGetData', JSON.parse(JSON.stringify(queryParam))) this.$refs.splitDetailTable.$emit('searchGetData', JSON.parse(JSON.stringify(queryParam)))
this.selectClear() this.selectClear()
@@ -915,11 +851,6 @@ export default {
this.$message.warning(res.data.message) this.$message.warning(res.data.message)
} }
}) })
.catch((error) => {
console.log(error)
})
},
onCancel () {
} }
}) })
} else { } else {
@@ -950,26 +881,8 @@ export default {
this.$confirm({ this.$confirm({
title: this.$t('areYouSure'), title: this.$t('areYouSure'),
content: '', content: '',
onOk: onOk: () => {
async () => { postAction('/split/sarFileSplitItems/batchDeleteItems', params).then((res) => {
axios({
url: '/jero-boot/split/sarFileSplitItems/batchDeleteItems',
method: 'post',
data: params,
transformRequest: [function (data) {
// Do whatever you want to transform the data
let ret = ''
for (const it in data) {
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
}
return ret
}],
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'X-Access-Token': this.token
}
})
.then((res) => {
if (res.data.success) { if (res.data.success) {
this.$message.success(this.$t('operationSuccessful')) this.$message.success(this.$t('operationSuccessful'))
this.loadMenuData() this.loadMenuData()
@@ -983,11 +896,6 @@ export default {
this.$message.warning(this.$t('operationFailed')) this.$message.warning(this.$t('operationFailed'))
} }
}) })
.catch((error) => {
console.log(error)
})
},
onCancel () {
} }
}) })
}, },
@@ -1110,89 +1018,6 @@ export default {
<style scoped lang="less"> <style scoped lang="less">
@import '~@assets/less/common.less'; @import '~@assets/less/common.less';
.split-detail {
/*height: 100% !important;*/
.split-detail-wrap {
/*display: flex;*/
/*justify-content: space-between;*/
.split-detail-left {
/*height: 100%;*/
width: 230px;
float: left;
padding-right: 20px;
/*border-right: 1px solid #E6E7EC;*/
overflow-y: auto;
.split-detail-left-tree {
}
.menu-item {
padding: 2px 8px;
border: 1px solid #000000;
border-bottom: none;
cursor: pointer;
}
.menu-bottom {
border-bottom: 1px solid #000000;
}
.menu-item:hover {
background: #00B3BE;
color: #ffffff;
}
}
.split-detail-right {
padding-left: 20px;
width: calc(100% - 230px);
float: right;
border-left: 1px solid #E6E7EC;
/*flex: 1;*/
.split-detail-search-header {
margin-bottom: 20px;
.table-page-search-submitButtons {
display: flex;
}
}
.split-detail-table {
.action-edit {
margin-right: 20px;
}
.content-show {
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
height: 60px;
line-height: 20px;
white-space: pre-wrap;
}
.page {
text-align: right;
}
}
.split-item {
display: flex;
}
}
.page {
margin-top: 20px;
}
}
}
/deep/ .ant-table-body { /deep/ .ant-table-body {
overflow: hidden !important; overflow: hidden !important;
} }
@@ -1205,39 +1030,6 @@ export default {
} }
} }
.split-detail-right-wraper {
.table-page-search-submitButtons {
.ant-col-md-6 {
display: flex;
}
}
.split-detail-search-header {
.ant-col-sm-8 {
min-width: 300px;
}
.ant-select-selection--multiple {
ul {
height: 36px;
overflow-y: auto;
}
}
}
.upload-split {
.ant-upload {
color: #040B29;
}
.anticon-import {
display: inline-block;
margin-right: 3px !important;
}
}
}
.show-setting { .show-setting {
.ant-modal { .ant-modal {
min-width: 700px; min-width: 700px;
@@ -1256,44 +1048,6 @@ export default {
} }
} }
.split-detail-left {
.ant-tree-node-content-wrapper-normal {
}
ant-tree-node-content-wrapper {
.expand-title {
}
}
.ant-tree-title {
span {
//display: block;
width: auto;
overflow: hidden;
text-overflow: ellipsis;
}
}
.ant-tree-child-tree {
.ant-tree-title {
span {
//display: block;
width: auto;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
}
@media screen and (min-width: 600px) and (max-width: 1600px) { @media screen and (min-width: 600px) and (max-width: 1600px) {
.operator-text { .operator-text {
margin-right: 20px !important; margin-right: 20px !important;