修改bug
This commit is contained in:
@@ -541,5 +541,13 @@ module.exports = {
|
||||
deletedSuccessfully:'deleted successfully',
|
||||
uploadSuccessful:'upload successful',
|
||||
noDelete:'the "exhibition area" has associated data, which cannot be deleted!',
|
||||
numberRows:'number of rows',
|
||||
numberColumns:'number of columns',
|
||||
table:'table',
|
||||
tableRowsColumns:'table rows and columns',
|
||||
addQuantity:'add quantity',
|
||||
enterQuantity:'Please enter quantity',
|
||||
text:'text',
|
||||
picture:'picture',
|
||||
|
||||
}
|
||||
@@ -545,5 +545,13 @@ module.exports = {
|
||||
deletedSuccessfully:'删除成功',
|
||||
uploadSuccessful:'上传成功',
|
||||
noDelete:'该“展示区域”有关联数据,无法删除!',
|
||||
numberRows:'行数',
|
||||
numberColumns:'列数',
|
||||
table:'表格',
|
||||
tableRowsColumns:'表格行数列数',
|
||||
addQuantity:'添加数量',
|
||||
enterQuantity:'请输入数量',
|
||||
text:'文本',
|
||||
picture:'图片',
|
||||
|
||||
}
|
||||
@@ -6,16 +6,12 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/* eslint-disable */
|
||||
// import 'ueditor/example/public/ueditor/ueditor.config'
|
||||
// import 'ueditor/example/public/ueditor/ueditor.all'
|
||||
// import 'ueditor/example/public/ueditor/lang/zh-cn/zh-cn'
|
||||
|
||||
import '@/../public/ueditor/ueditor.config.js'
|
||||
import '@/../public/ueditor/ueditor.all.js'
|
||||
import '@/../public/ueditor/lang/zh-cn/zh-cn.js'
|
||||
import '@/../public/ueditor/lang/en/en.js'
|
||||
|
||||
|
||||
// import '@/../public/ueditor/ueditor.config.js'
|
||||
// import '@/../public/ueditor/ueditor.all.js'
|
||||
// import '@/../public/ueditor/lang/zh-cn/zh-cn.js'
|
||||
export default {
|
||||
name: 'UEditor',
|
||||
data () {
|
||||
@@ -73,6 +69,7 @@
|
||||
watch: {
|
||||
},
|
||||
mounted () {
|
||||
UEDITOR_CONFIG.UEDITOR_HOME_URL = '../../public/ueditor/'
|
||||
// 初始化UE
|
||||
this.editor = UE.delEditor('editor')
|
||||
this.editor = UE.getEditor('editor', this.config)
|
||||
@@ -93,8 +90,10 @@
|
||||
if (_this.bold) {
|
||||
UE.getEditor('editor').execCommand('bold')
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
},
|
||||
beforeDestroy() {
|
||||
},
|
||||
destoryed () {
|
||||
this.editor.destory()
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
:visible="visible"
|
||||
:after-visible-change="afterVisibleChange"
|
||||
@close="onClose"
|
||||
width="1100"
|
||||
width="900"
|
||||
>
|
||||
<a-form>
|
||||
<a-form-model
|
||||
@@ -64,11 +64,12 @@
|
||||
{{$t('Add')}}
|
||||
</div>
|
||||
</div>
|
||||
<a-row :gutter="24" class="split-content" id="split-content" v-for="(item, index) in contentList" :key="item.id">
|
||||
<a-row :gutter="24" class="split-content" id="split-content" v-for="(item, index) in contentList" :key="index">
|
||||
<div class="split-row">
|
||||
<div class="row-left">
|
||||
<a-textarea v-if="item.type=='TEXT'" v-model="item.textContent" :placeholder="$t('pleaseEnter')+$t('content')" auto-size />
|
||||
<img v-if="item.type=='IMG'" :src="item.src" alt="" @click="preImg(item)">
|
||||
<a-textarea v-if="item.type==='TEXT'" v-model="item.textContent" :placeholder="$t('pleaseEnter')+$t('content')" auto-size />
|
||||
<img v-if="item.type==='IMG'" :src="item.src" alt="" @click="preImg(item)">
|
||||
<div v-if="item.type==='TABLE'" v-html="item.content" class="item-table"></div>
|
||||
</div>
|
||||
<div class="row-right">
|
||||
<a-button class="row-btn-add" @click="splitAdd(index)">{{$t('Add')}}</a-button>
|
||||
@@ -105,28 +106,48 @@
|
||||
>
|
||||
<div class="title-wraper">
|
||||
<div class="title-top">
|
||||
<span class="title-flex title-text" :class="{'title-flex-active':selected==1}" @click="selectTitle(1)">文本</span>
|
||||
<span class="title-flex title-pic" :class="{'title-flex-active':selected==2}" @click="selectTitle(2)">图片</span>
|
||||
<span class="title-flex title-table" :class="{'title-flex-active':selected==3}" @click="selectTitle(3)">表格</span>
|
||||
<span class="title-flex title-text" :class="{'title-flex-active':selected==1}" @click="selectTitle(1)">{{$t('text')}}</span>
|
||||
<span class="title-flex title-pic" :class="{'title-flex-active':selected==2}" @click="selectTitle(2)">{{$t('picture')}}</span>
|
||||
<span class="title-flex title-table" :class="{'title-flex-active':selected==3}" @click="selectTitle(3)">{{$t('table')}}</span>
|
||||
</div>
|
||||
<div class="title-num" v-if="selectedNum">
|
||||
<span class="title-num-add">添加数量</span>
|
||||
<a-input-number class="title-num-edit" :min="1" v-model="textNumber" placeholder="请输入数据" :formatter="limitNumber" :parser="limitNumber"></a-input-number>
|
||||
<span class="title-num-add">{{$t('addQuantity')}}</span>
|
||||
<a-input-number class="title-num-edit" :min="1" v-model="textNumber" :placeholder="$t('enterQuantity')" :formatter="limitNumber" :parser="limitNumber"></a-input-number>
|
||||
</div>
|
||||
</div>
|
||||
</a-modal>
|
||||
<!-- 上传图片弹框-->
|
||||
<split-upload v-if="splitVisible" ref="uploadFile2" :disabled="disabled" :accept="accept" :title="titleImg" :listType='listType' :splitVisible="splitVisible" @uploadSuccess="uploadSuccess"></split-upload>
|
||||
<!-- 输入表格行数列数-->
|
||||
|
||||
<a-modal
|
||||
:title="titleColRow"
|
||||
class="split-col-title"
|
||||
:visible="tableColVisible"
|
||||
:confirm-loading="confirmLoading"
|
||||
@ok="handleColOk"
|
||||
@cancel="handleColCancel"
|
||||
>
|
||||
<a-form :form="form" :label-col="{ span: 8 }" :wrapper-col="{ span: 14 }">
|
||||
<a-form-item :label="$t('numberRows')">
|
||||
<a-input-number v-model="rowCount" :min="1" :placeholder="$t('pleaseEnter')+$t('numberRows')" :formatter="limitNumber" :parser="limitNumber" />
|
||||
</a-form-item>
|
||||
<a-form-item :label="$t('numberColumns')">
|
||||
<a-input-number v-model="colCount" :min="1" :placeholder="$t('pleaseEnter')+$t('numberColumns')" :formatter="limitNumber" :parser="limitNumber" />
|
||||
</a-form-item>
|
||||
</a-form>
|
||||
</a-modal>
|
||||
<!-- 表格弹框-->
|
||||
<a-modal
|
||||
:title="titleTable"
|
||||
class="split-title"
|
||||
class="split-table-title"
|
||||
:visible="tableVisible"
|
||||
:confirm-loading="confirmLoading"
|
||||
@ok="handleOk"
|
||||
@cancel="handleCancel"
|
||||
@ok="handleOkTable"
|
||||
@cancel="handleCancelTable"
|
||||
width="700"
|
||||
>
|
||||
<!-- <u-editor :content="ueContent" :config=config ref="ueditor" @editor-onChange="uEditorChange"></u-editor>-->
|
||||
<u-editor v-if="tableVisible" :content="ueContent" :config=config ref="ueditor" @editor-onChange="uEditorChange"></u-editor>
|
||||
</a-modal>
|
||||
</a-drawer>
|
||||
</div>
|
||||
@@ -136,16 +157,17 @@
|
||||
<script>
|
||||
import Vue from 'vue'
|
||||
import splitUpload from '@/components/splitUpload/index'
|
||||
// import uEditor from '@/components/ueditor/index'
|
||||
import uEditor from '@/components/ueditor/index'
|
||||
export default {
|
||||
name: 'splitAddForm',
|
||||
components:{
|
||||
splitUpload,
|
||||
// uEditor
|
||||
uEditor
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
titleTable:'表格',
|
||||
titleTable:this.$t('table'),
|
||||
titleColRow:this.$t('tableRowsColumns'),
|
||||
title:this.$t('newClause'),
|
||||
TitlePreImg:'',
|
||||
contentList:[
|
||||
@@ -179,11 +201,11 @@
|
||||
form:{},
|
||||
validatorRules:{
|
||||
number:[
|
||||
{ required:true,message: '请输入条款号',trigger: 'blur' },
|
||||
{ required:true,message: this.$t('pleaseEnter')+this.$t('clauseNo'),trigger: 'blur' },
|
||||
{ min:1, max: 200, message: this.$t('cantExeed')+'200'+this.$t('characters'), trigger: 'blur' }
|
||||
],
|
||||
name:[
|
||||
{ required:true,message: '请输入条款名称',trigger: 'blur' },
|
||||
{ required:true,message: this.$t('pleaseEnter')+this.$t('clauseName'),trigger: 'blur' },
|
||||
{ min:1, max: 200, message: this.$t('cantExeed')+'200'+this.$t('characters'), trigger: 'blur' }
|
||||
]
|
||||
},
|
||||
@@ -220,6 +242,9 @@
|
||||
'customstyle', // 自定义标题
|
||||
'indent', // 首行缩进
|
||||
'justifyleft', // 居左对齐
|
||||
|
||||
'fullscreen', // 全屏
|
||||
|
||||
'justifyright', // 居右对齐
|
||||
'justifycenter', // 居中对齐
|
||||
'justifyjustify', // 两端对齐
|
||||
@@ -228,9 +253,6 @@
|
||||
'rowspacingbottom', // 段后距
|
||||
'directionalityltr', // 从左向右输入
|
||||
'directionalityrtl', // 从右向左输入
|
||||
'fullscreen' // 全屏
|
||||
],
|
||||
[
|
||||
'cleardoc', // 清空文档
|
||||
'formatmatch', // 格式刷
|
||||
'removeformat', // 清除格式
|
||||
@@ -250,6 +272,8 @@
|
||||
'imageright', // 右浮动
|
||||
'imagecenter', // 居中
|
||||
'touppercase', // 字母大写
|
||||
|
||||
|
||||
'tolowercase', // 字母小写
|
||||
'emotion', // 表情
|
||||
'spechars', // 特殊字符
|
||||
@@ -261,9 +285,7 @@
|
||||
'charts', // 图表
|
||||
'edittip ', // 编辑提示
|
||||
'autotypeset', // 自动排版
|
||||
'drafts' // 从草稿箱加载
|
||||
],
|
||||
[
|
||||
'drafts', // 从草稿箱加载
|
||||
'inserttable', // 插入表格
|
||||
'deletetable', // 删除表格,
|
||||
'insertparagraphbeforetable', // ”表格前插入行”
|
||||
@@ -292,9 +314,13 @@
|
||||
initialFrameHeight: 300,
|
||||
maximumWords: 4000,
|
||||
BaseUrl: '',
|
||||
UEDITOR_HOME_URL: 'ueditor/',
|
||||
editTableIndex: 1
|
||||
UEDITOR_HOME_URL: '/ueditor/',
|
||||
editTableIndex: 1,
|
||||
|
||||
},
|
||||
tableColVisible:false,
|
||||
colCount:'', //列数
|
||||
rowCount:'', //行数
|
||||
}
|
||||
},
|
||||
props:{
|
||||
@@ -311,6 +337,7 @@
|
||||
},
|
||||
mounted() {
|
||||
this.visible=this.addVisible
|
||||
|
||||
},
|
||||
methods:{
|
||||
afterVisibleChange(){
|
||||
@@ -349,7 +376,6 @@
|
||||
//确定增加的类型
|
||||
handleOk(){
|
||||
this.addConVisible=false
|
||||
console.log('addIndex',this.addIndex)
|
||||
let contentLength=this.contentList.length
|
||||
if(this.selected==1){ //文本类型
|
||||
for(let i=this.contentList.length;i>this.addIndex;i--){
|
||||
@@ -368,7 +394,7 @@
|
||||
this.splitVisible=true
|
||||
|
||||
}else if(this.selected==3){ //表格类型
|
||||
this.tableVisible=true
|
||||
this.tableColVisible=true
|
||||
|
||||
}
|
||||
console.log('conteend',this.contentList)
|
||||
@@ -405,8 +431,62 @@
|
||||
handlePreImgCancel(){
|
||||
this.preImgVisible=false
|
||||
},
|
||||
uEditorChange () {
|
||||
this.itemContent = this.$refs.ueditor.getUEContent()
|
||||
//表格确认按钮
|
||||
handleOkTable(){
|
||||
this.tableVisible=false
|
||||
},
|
||||
//表格取消按钮
|
||||
handleCancelTable(){
|
||||
this.tableVisible=false
|
||||
},
|
||||
//获取表格内容
|
||||
uEditorChange (val) {
|
||||
// this.itemContent = this.$refs.ueditor.getUEContent()
|
||||
this.contentList[this.addIndex+1]= {
|
||||
id:'',
|
||||
type:'TABLE',
|
||||
content:val
|
||||
}
|
||||
},
|
||||
//取消行数列数按钮
|
||||
handleColCancel(){
|
||||
this.tableColVisible=false
|
||||
},
|
||||
//确定行数列数按钮
|
||||
handleColOk(){
|
||||
this.tableColVisible=false
|
||||
this.tableVisible=true
|
||||
if(this.rowCount>0&&this.colCount>0){
|
||||
let tableList=[]
|
||||
let tableStr=''
|
||||
tableStr='<table class=\'word-table\' border="1" cellpadding="0" cellspacing="0">'
|
||||
for(let r=0;r<this.rowCount;r++){
|
||||
let rowTableList=[]
|
||||
tableStr+='<tr>'
|
||||
for(let c=0;c<this.colCount;c++){
|
||||
tableStr+=`<td></td>`
|
||||
let tableItem={}
|
||||
tableItem.id=''
|
||||
tableItem.rowNum=r+1
|
||||
tableItem.colNum=c+1
|
||||
tableItem.content=''
|
||||
rowTableList.push(tableItem)
|
||||
}
|
||||
tableStr+=`</tr>`
|
||||
tableList.push(rowTableList)
|
||||
}
|
||||
tableStr+=`</table>`
|
||||
this.ueContent=tableStr
|
||||
this.contentList[this.addIndex+1]= {
|
||||
id:'',
|
||||
type:'TABLE',
|
||||
content:tableStr
|
||||
}
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ueditor.setContent(this.ueContent)
|
||||
})
|
||||
}
|
||||
console.log('cont1111',this.addIndex,this.contentList)
|
||||
},
|
||||
//正则替换小数点
|
||||
limitNumber(value) {
|
||||
@@ -426,10 +506,11 @@
|
||||
@import '~@assets/less/common.less';
|
||||
.split-add-form{
|
||||
.split-add-form-wrapper{
|
||||
|
||||
width: 900px;
|
||||
}
|
||||
}
|
||||
.split-table-drawer{
|
||||
width: 900px;
|
||||
.split-content{
|
||||
.con-divider{
|
||||
font-size: 16px;
|
||||
@@ -453,6 +534,12 @@
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
}
|
||||
.item-table{
|
||||
table{
|
||||
width: 100%!important;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
.row-right{
|
||||
min-width: 150px;
|
||||
@@ -512,6 +599,7 @@
|
||||
text-align: center;
|
||||
img{
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -522,4 +610,47 @@
|
||||
}
|
||||
|
||||
}
|
||||
.split-table-drawer{
|
||||
width: 900px;
|
||||
.ant-drawer-content-wrapper{
|
||||
width: 900px;
|
||||
.row-left{
|
||||
.item-table{
|
||||
height: 100%;
|
||||
table.word-table {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.ant-col-sm-5{
|
||||
min-width: 170px;
|
||||
}
|
||||
.ant-col-sm-16{
|
||||
width: 58%;
|
||||
}
|
||||
}
|
||||
.split-table-title{
|
||||
.ant-modal{
|
||||
width: 700px;
|
||||
.ant-modal-content{
|
||||
width: 700px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.split-col-title{
|
||||
.ant-col-5{
|
||||
.ant-input-number{
|
||||
min-width: 260px;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
.ant-modal-footer{
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -82,6 +82,8 @@
|
||||
import { getAction, postAction, deleteAction, putAction } from '@/api/manage'
|
||||
import listTable from './listTable'
|
||||
import treeTable from './treeTable'
|
||||
import Vue from 'vue'
|
||||
import { UI_CACHE_DB_DICT_DATA } from "@/store/mutation-types"
|
||||
export default {
|
||||
name: 'dicList',
|
||||
components:{
|
||||
@@ -268,6 +270,7 @@
|
||||
putAction(`sys/dictItem/edit`, params).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
this.reFresh()
|
||||
this.form = {}
|
||||
this.loadData()
|
||||
this.newVisible = false
|
||||
@@ -279,6 +282,7 @@
|
||||
postAction(`sys/dictItem/add`, params).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
this.reFresh()
|
||||
this.form = {}
|
||||
this.loadData()
|
||||
this.newVisible = false
|
||||
@@ -320,6 +324,22 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
//刷新缓存
|
||||
reFresh(){
|
||||
getAction('sys/dict/refleshCache').then((res) => {
|
||||
if (res.success) {
|
||||
//重新加载缓存
|
||||
getAction('sys/dict/queryAllDictItems').then((res) => {
|
||||
if (res.success) {
|
||||
Vue.ls.remove(UI_CACHE_DB_DICT_DATA)
|
||||
Vue.ls.set(UI_CACHE_DB_DICT_DATA, res.result, 7 * 24 * 60 * 60 * 1000)
|
||||
}
|
||||
})
|
||||
}
|
||||
}).catch(e => {
|
||||
console.log('刷新失败', e)
|
||||
})
|
||||
},
|
||||
//取消
|
||||
cancelModel(){
|
||||
this.newVisible=false;
|
||||
@@ -361,6 +381,7 @@
|
||||
deleteAction(`sys/dictItem/logicDelete`, params).then(res => {
|
||||
if(res.success) {
|
||||
this.$message.success(this.$t('OperationSuccessful'));
|
||||
this.reFresh()
|
||||
if(this.tableData&&this.tableData.length==1&&this.queryParams.pageNo!=1){
|
||||
this.queryParams.pageNo=this.queryParams.pageNo-1
|
||||
}
|
||||
@@ -397,6 +418,7 @@
|
||||
deleteAction(`sys/dictItem/logicDeleteBatch`, params).then(res => {
|
||||
if(res.success){
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
this.reFresh()
|
||||
if(this.selectedIds.length==this.tableData.length&&this.queryParams.pageNo!=1){
|
||||
this.queryParams.pageNo=this.queryParams.pageNo-1
|
||||
}
|
||||
|
||||
@@ -169,6 +169,8 @@
|
||||
},
|
||||
onSelectChange(keys){
|
||||
this.selectedRowKeys=keys
|
||||
console.log('rowss',this.selectedRowKeys)
|
||||
this.$emit('selectedKeys',keys)
|
||||
// console.log('keys',keys,this.selectedRowKeys)
|
||||
},
|
||||
// onSelectAll(selected) {
|
||||
|
||||
@@ -95,6 +95,8 @@
|
||||
import { getAction, postAction, deleteAction, putAction } from '@/api/manage'
|
||||
// import tabTable from './tabTable'
|
||||
import dicList from '../dialog/dicList'
|
||||
import Vue from 'vue'
|
||||
import { UI_CACHE_DB_DICT_DATA } from "@/store/mutation-types"
|
||||
export default {
|
||||
name: 'tagContent',
|
||||
components:{
|
||||
@@ -130,8 +132,9 @@
|
||||
{
|
||||
title: this.$t('describe'),
|
||||
align: "center",
|
||||
width: 100,
|
||||
dataIndex: 'description',
|
||||
ellipsis: true,
|
||||
width:300
|
||||
},
|
||||
{
|
||||
title: this.$t('operation'),
|
||||
@@ -216,6 +219,7 @@
|
||||
postAction(`sys/dict/add`,params).then(res=>{
|
||||
if(res.success){
|
||||
this.$message.success( this.$t('OperationSuccessful'))
|
||||
this.reFresh()
|
||||
this.loadData()
|
||||
this.contentVisible=false
|
||||
this.form={}
|
||||
@@ -237,6 +241,7 @@
|
||||
putAction(`sys/dict/edit`,params).then(res=>{
|
||||
if(res.success){
|
||||
this.$message.success( this.$t('OperationSuccessful'))
|
||||
this.reFresh()
|
||||
this.loadData()
|
||||
this.contentVisible=false
|
||||
this.form={}
|
||||
@@ -249,6 +254,22 @@
|
||||
})
|
||||
|
||||
},
|
||||
//刷新缓存
|
||||
reFresh(){
|
||||
getAction('sys/dict/refleshCache').then((res) => {
|
||||
if (res.success) {
|
||||
//重新加载缓存
|
||||
getAction('sys/dict/queryAllDictItems').then((res) => {
|
||||
if (res.success) {
|
||||
Vue.ls.remove(UI_CACHE_DB_DICT_DATA)
|
||||
Vue.ls.set(UI_CACHE_DB_DICT_DATA, res.result, 7 * 24 * 60 * 60 * 1000)
|
||||
}
|
||||
})
|
||||
}
|
||||
}).catch(e => {
|
||||
console.log('刷新失败', e)
|
||||
})
|
||||
},
|
||||
cancelModel(){
|
||||
this.contentVisible=false
|
||||
this.form={}
|
||||
@@ -269,6 +290,7 @@
|
||||
deleteAction(`sys/dict/logicDelete`, param).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
this.reFresh()
|
||||
if(this.tableData&&this.tableData.length==1&&this.queryParams.pageNo!=1){
|
||||
this.queryParams.pageNo=this.queryParams.pageNo-1
|
||||
}
|
||||
@@ -300,6 +322,7 @@
|
||||
deleteAction(`sys/dict/logicDeleteBatch`, params).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
this.reFresh()
|
||||
this.selectedRowKeys=[]
|
||||
if(this.ids.length==this.tableData.length&&this.queryParams.pageNo!=1){
|
||||
this.queryParams.pageNo=this.queryParams.pageNo-1
|
||||
|
||||
Reference in New Issue
Block a user