浏览代码

bug修复合并冲突

hbchen 1 年之前
父节点
当前提交
03e39e1713

+ 2 - 2
src/views/classify_manage/classifylist.vue

@@ -186,12 +186,12 @@
 					prop="IsShow" v-if="aeForm.parent_id==0">
 					<el-switch v-model="aeForm.IsShow" inactive-color="#ededed"></el-switch>
 				</el-form-item>
-				<el-form-item label="PPT转报告" prop="hasTel" v-if="aeForm.parent_id!=0">
+				<!-- <el-form-item label="PPT转报告" prop="hasTel" v-if="aeForm.parent_id!=0">
 					<el-select v-model="aeForm.hasTel" placeholder="请选择" style="width:400px;">
 						<el-option label="无" :value="0"></el-option>
 						<el-option label="有" :value="1"></el-option>
 					</el-select>
-				</el-form-item>
+				</el-form-item> -->
 				<el-form-item label="关联设置" 
 					prop="relate" v-if="!['晨报','周报'].includes(aeForm.classify_name)">
 					<el-select v-model="aeForm.relate" multiple placeholder="请选择" style="width:400px;">

+ 8 - 4
src/views/dataEntry_manage/databaseList.vue

@@ -80,7 +80,7 @@
 						@node-drag-leave="dropMouseLeave"
 						@node-drag-enter="dropMouseOver"
 					>
-						<span
+						<div
 							class="custom-tree-node"
 							slot-scope="{ node, data }"
 						>
@@ -102,7 +102,11 @@
 							>
 								<span>{{ currentLang==='en' ? (data.ClassifyNameEn||data.ClassifyName) : data.ClassifyName }}</span>
 							</span>
-							<span
+
+							<!-- 标识计算指标小icon -->
+							<svg v-if="data.EdbType===2&&select_node !== data.UniqueCode" t="1692078566249" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8640" width="20" height="20"><path d="M892.498502 161.874761l-730.640626 730.624253c-4.14132 4.237511-9.673313 6.299473-15.141862 6.299473-5.516644 0-11.048637-2.062985-15.205307-6.299473-8.394181-8.394181-8.394181-21.969361 0-30.347169l730.656999-730.640626c8.362458-8.394181 21.969361-8.394181 30.331819 0C900.892683 139.889027 900.892683 153.49593 892.498502 161.874761L892.498502 161.874761zM447.519941 340.089675 103.737154 340.089675c-11.864212 0-21.521153-9.625218-21.521153-21.457708 0-11.864212 9.657964-21.521153 21.521153-21.521153l343.782787 0c11.879562 0 21.505803 9.657964 21.505803 21.521153C469.025745 330.464457 459.399503 340.089675 447.519941 340.089675L447.519941 340.089675zM275.652596 512.005117c-11.879562 0-21.521153-9.641591-21.521153-21.457708L254.131443 146.653081c0-11.799744 9.641591-21.457708 21.521153-21.457708 11.83249 0 21.457708 9.657964 21.457708 21.457708l0 343.895351C297.110303 502.363526 287.484062 512.005117 275.652596 512.005117L275.652596 512.005117zM920.335501 662.46285l-343.830883 0c-11.879562 0-21.521153-9.641591-21.521153-21.521153 0-11.864212 9.641591-21.457708 21.521153-21.457708l343.830883 0c11.83249 0 21.457708 9.593496 21.457708 21.457708C941.793208 652.821259 932.166967 662.46285 920.335501 662.46285L920.335501 662.46285zM920.335501 834.378292l-343.830883 0c-11.879562 0-21.521153-9.641591-21.521153-21.521153 0-11.864212 9.641591-21.457708 21.521153-21.457708l343.830883 0c11.83249 0 21.457708 9.593496 21.457708 21.457708C941.793208 824.736701 932.166967 834.378292 920.335501 834.378292L920.335501 834.378292z" p-id="8641" fill="#999999"></path></svg>
+
+							<div
 								style="display: flex; align-items: center"
 								v-if="select_node === data.UniqueCode"
 							>
@@ -151,8 +155,8 @@
 									style="width: 14px; height: 14px;margin-left: 8px"
 									alt=""
 								/>
-							</span>
-						</span>
+							</div>
+						</div>
 					</el-tree>
 					<div class="noDepart" @click="addLevelOneHandle" v-if="CanOpClassify">
 						<img

+ 228 - 109
src/views/dataEntry_manage/onlineExcelCopy.vue

@@ -30,9 +30,10 @@
         <el-tooltip :open-delay="400">
           <div slot="content">
             <p class="hint-message">1、新增指标:在预设好的指标列下输入指标名称、单位、数值并保存;</p>
-            <p class="hint-message">2、新增日期:在第一列选择日期或插入日期行(需复制已有日期格式)输入数值并保存;</p>
-            <p class="hint-message">3、除指标:清空该指标下所有数据并保存,请勿直接删除指标列;</p>
+            <p class="hint-message">2、新增日期:在第一列选择日期或插入日期行(需复制已有日期格式)输入数值并保存;</p>
+            <p class="hint-message">3、除指标:清空该指标下所有数据并保存,该操作不会删除指标,仅清除指标数据,请勿直接删除指标列;</p>
             <p class="hint-message">4、删除日期:清空该日期对应所有数据并保存,请勿直接删除日期行;</p>
+            <p class="hint-message">5、指标名称编辑、单位编辑、频度编辑、指标删除等操作请在“手工指标列表”中完成;</p>
           </div>
           <div class="instruction-hint" >
             <span>使用说明</span>
@@ -51,105 +52,101 @@ import EventBus from '@/api/bus.js'
 export default {
   name:'onlineExcelCopy',
   data() {
-    return {
-      // 初始化数据
-      options:{
-        container:'luckysheet',
-        lang: 'zh',
-        gridKey:'handmade-excel',
-        showinfobar:false,
-        row:300,
-        column:60,
-        data:[
-          {
-            "name":"test",
-            "celldata":[
-              {
-                "r":0,
-                "c":0,
-                "v":{
-                  ct: {fa: "General", t: "g"},
-                  m:"一级分类",
-                  v:"一级分类",
-                  bg:'#b4a7d6'
-                },
-              },
-              {
-                "r":1,
-                "c":0,
-                "v":{
-                  ct: {fa: "General", t: "g"},
-                  m:"指标分类",
-                  v:"指标分类",
-                  bg:'#b4a7d6'
-                },
+    // 受保护的数据 维护一个二维数组 用于还原不能被修改或者以错误方式修改的数据
+    this.protectedData=[]
+
+    // 初始化数据
+    this.options={
+      container:'luckysheet',
+      lang: 'zh',
+      gridKey:'handmade-excel',
+      showinfobar:false,
+      row:300,
+      column:60,
+      data:[
+        {
+          "name":"test",
+          "celldata":[
+            {
+              "r":0,
+              "c":0,
+              "v":{
+                ct: {fa: "General", t: "g"},
+                m:"一级分类",
+                v:"一级分类",
+                bg:'#b4a7d6'
               },
-              {
-                "r":2,
-                "c":0,
-                "v":{
-                  ct: {fa: "General", t: "g"},
-                  m:"频度",
-                  v:"频度",
-                  bg:'#b4a7d6'
-                },
+            },
+            {
+              "r":1,
+              "c":0,
+              "v":{
+                ct: {fa: "General", t: "g"},
+                m:"指标分类",
+                v:"指标分类",
+                bg:'#b4a7d6'
               },
-              {
-                "r":3,
-                "c":0,
-                "v":{
-                  ct: {fa: "General", t: "g"},
-                  m:"指标名称",
-                  v:"指标名称",
-                  bg:'#b4a7d6'
-                },
+            },
+            {
+              "r":2,
+              "c":0,
+              "v":{
+                ct: {fa: "General", t: "g"},
+                m:"频度",
+                v:"频度",
+                bg:'#b4a7d6'
               },
-              {
-                "r":4,
-                "c":0,
-                "v":{
-                  ct: {fa: "General", t: "g"},
-                  m:"单位",
-                  v:"单位",
-                  bg:'#b4a7d6'
-                },
+            },
+            {
+              "r":3,
+              "c":0,
+              "v":{
+                ct: {fa: "General", t: "g"},
+                m:"指标名称",
+                v:"指标名称",
+                bg:'#b4a7d6'
               },
-            ],
-            "config":{
-              "borderInfo":[{
-                "rangeType": "range",
-                "borderType": "border-all",
-                "style": "1",
-                "color": "#fff",
-                "range": [{
-                    "row": [0,4],
-                    "column": [0,0]
-                }]
-              }],
             },
-            "frozen":{
-              type: 'rangeBoth',
-              range: {row_focus: 4, column_focus: 0}
+            {
+              "r":4,
+              "c":0,
+              "v":{
+                ct: {fa: "General", t: "g"},
+                m:"单位",
+                v:"单位",
+                bg:'#b4a7d6'
+              },
             },
-            "dataVerification":{}
-          }
-        ],
-        hook:{
-          cellUpdateBefore(r,c){
-            // 禁止更新的单元格
-            if([0,1,2,3,4].includes(r) && c==0){
-              return false
-            }
+          ],
+          "config":{
+            "borderInfo":[{
+              "rangeType": "range",
+              "borderType": "border-all",
+              "style": "1",
+              "color": "#fff",
+              "range": [{
+                  "row": [0,4],
+                  "column": [0,0]
+              }]
+            }],
           },
-          cellMousedownBefore(e,position){
-            // 禁止鼠标选中的单元格
-            if([0,1,2].includes(position.r) || ([3,4].includes(position.r) && position.c==0)){
-              return false
-            }
-          }
-        },
-        showsheetbar:false
-		  },
+          "frozen":{
+            type: 'rangeBoth',
+            range: {row_focus: 4, column_focus: 0}
+          },
+          "dataVerification":{}
+        }
+      ],
+      hook:{},
+      showsheetbar:false,
+      // cellRightClickConfig:{
+      //   insertColumn:false,
+      //   deleteRow:false,
+      //   deleteColumn:false
+      // }
+    }
+
+    return {
       dataForm:{
         firstClassify:'',
         secondClassify:'',
@@ -165,7 +162,9 @@ export default {
       secondClassifyArray:[],
       // 保存时候的加载框
       saveLoading:false,
-      isEdit:"false"
+      isEdit:"false",
+      refreshed:false,
+      haveSaveProtected:false
     }
   },
 created() {
@@ -224,6 +223,102 @@ created() {
           // if(res.Data.FrequencyList) this.dataForm.frequency = res.Data.FrequencyList[0]
         }
       }
+
+      // hook设置
+      // 处理复制粘贴造成的漏洞 - 记录数据
+      this.options.hook.cellAllRenderBefore=(data,sheet)=>{
+        if(this.haveSaveProtected) return 
+        // console.log("全部刷新");
+        if(!this.protectedData.length>0){
+          for (let i = 0; i < 5; i++) {
+            if([0,1,2].includes(i)){
+              for (let j = 0; j < 2; j++) {
+                const element = data[i][j];
+                if(!Array.isArray(this.protectedData[i])) this.protectedData[i]=[]
+                this.protectedData[i][j] = element
+              }
+            }else{
+              for (let k = 0; k <= dataList.length; k++) {
+                const element = data[i][k];
+                if(!Array.isArray(this.protectedData[i])) this.protectedData[i]=[]
+                this.protectedData[i][k] = element
+              }
+            }
+          }
+        }
+        this.haveSaveProtected=true
+      }
+      this.options.hook.cellUpdateBefore=(r,c)=>{
+        // 禁止更新的单元格 已经有的指标名称和单位不允许更新
+        if(([0,1,2].includes(r) && c==0) || ([3,4].includes(r) && c<=dataList.length)){
+          return false
+        }
+      }
+
+      this.options.hook.cellMousedownBefore=(e,position)=>{
+        // console.log(e,position);
+        // 禁止鼠标选中的单元格
+        if([0,1,2].includes(position.r) || ([3,4].includes(position.r) && position.c<=dataList.length)){
+          return false
+        }
+      }
+
+      // 处理复制粘贴造成的漏洞 - 还原数据
+      this.options.hook.cellRenderBefore=(cell,position,sheet,ctx)=>{
+        // console.log('cellRenderBeforecellRenderBefore');
+        // 是否更改了受保护的数据
+        let haveUpdatedProtectedData=false
+        if([3,4].includes(position.r) && position.c>=0 && position.c<=dataList.length){
+          if(!cell) return 
+          Object.keys(this.protectedData[position.r][position.c]).forEach(key => {
+            // console.log(_.isEqual(cell[key], this.protectedData[position.r][position.c][key]),'lodash');
+            if(!_.isEqual(cell[key], this.protectedData[position.r][position.c][key])){
+              haveUpdatedProtectedData=true
+              cell[key] = this.protectedData[position.r][position.c][key]
+            }
+          }); 
+        }else if([0,1,2].includes(position.r)){
+          let cindex = position.c>1?1:position.c
+          // console.log(position.c,position.r,cell);
+          if(!cell){
+            if(cindex<1){
+              return 
+            }
+            luckysheet.getSheet().data[position.r][position.c] = this.protectedData[position.r][cindex]
+          }else{
+            Object.keys(this.protectedData[position.r][cindex]).forEach(key => {
+              if(!_.isEqual(cell[key], this.protectedData[position.r][cindex][key])){
+                haveUpdatedProtectedData=true
+                cell[key] = this.protectedData[position.r][cindex][key]
+              }
+            });
+            if([0,1,2].includes(position.r) && position.c>0){
+              if(position.r==0){
+                if(cell.m !==this.firstClassName || cell.v !== this.firstClassName){
+                  haveUpdatedProtectedData=true
+                  cell.m = cell.v = this.firstClassName
+                }
+              }else if(position.r==1){
+                if(cell.m !==this.secondClassName || cell.v !== this.secondClassName){
+                  haveUpdatedProtectedData=true
+                  cell.m = cell.v = this.secondClassName
+                }
+              }else{
+                if(cell.m !==this.dataForm.frequency || cell.v !== this.dataForm.frequency){
+                  haveUpdatedProtectedData=true
+                  cell.m = cell.v = this.dataForm.frequency
+                }
+              }
+            }
+          }
+          // console.log(cindex,position.r,'cindex,position.r',this.protectedData[position.r][cindex]);
+        }
+        if(haveUpdatedProtectedData){
+          // 还原数据后的手动刷新
+          this.refreshManual()
+        }
+      }
+
       // 拿出所有数组
       let arr = dataList.map((item => item.DataList)).flat()
       // 拿出所有数组的日期并展平排序
@@ -238,7 +333,7 @@ created() {
         return objList
       })
       /**
-       * 当数据的长度大于默认的84时,行数需要设置成数据的长度+15
+       * 当数据的长度大于默认的300时,行数需要设置成数据的长度+15
        */
       this.options.row = dateArr.length>(this.options.row-15) ? (dateArr.length+15):this.options.row
       /**
@@ -257,7 +352,8 @@ created() {
             "v":{
               ct: {fa: "General", t: "g"},
               m:item.SecName,
-              v:item.SecName
+              v:item.SecName,
+              bg:'#cccccc'
             }
           },
           {
@@ -266,7 +362,8 @@ created() {
             "v":{
               ct: {fa: "General", t: "g"},
               m:item.Unit,
-              v:item.Unit
+              v:item.Unit,
+              bg:'#cccccc'
             }
         })
       })
@@ -343,6 +440,15 @@ created() {
             "row": [5,row],
             "column": [0,0]
         }]
+      },{
+        "rangeType": "range",
+        "borderType": "border-all",
+        "style": "1",
+        "color": "#fff",
+        "range": [{
+            "row": [3,4],
+            "column": [1,dataList.length]
+        }]
       })
       // 设置数据验证
       for (let i = 0; i < col; i++) {
@@ -360,6 +466,15 @@ created() {
         luckysheet.create(this.options)
       })
     },
+    refreshManual: _.debounce(function() {
+      if(!this.refreshed) {
+        luckysheet.refresh()
+        this.refreshed=true
+        setTimeout(()=>{
+          this.refreshed=false
+        },1500)
+      }
+		},1000),
     // 获取分类
     async getClassify() {
       let res=await dataInterence.getClassify()
@@ -393,25 +508,29 @@ created() {
         this.dataForm.secondClassify = this.secondClassifyArray[0].ClassifyId
         this.secondClassName = this.secondClassifyArray[0].ClassifyName
       }
-      for (let i= 1;  i< col+1 ; i++) {
-        luckysheet.setCellValue(0,i,this.firstClassName,{isRefresh:false})
-        luckysheet.setCellValue(1,i,this.secondClassName,{isRefresh:i==col?true:false})
-      }
+      luckysheet.refresh()
+      // for (let i= 1;  i< col+1 ; i++) {
+      //   luckysheet.setCellValue(0,i,this.firstClassName,{isRefresh:false})
+      //   luckysheet.setCellValue(1,i,this.secondClassName,{isRefresh:i==col?true:false})
+      // }
     },
     // 切换选择二级分类
     changeSecondClassify(id){
       let col = this.options.column
       let item = this.secondClassifyArray.find(item => item.ClassifyId == id)
-      for (let i= 1;  i< col+1; i++) {
-        luckysheet.setCellValue(1,i,item.ClassifyName,{isRefresh:i==col?true:false})
-      }
+      this.secondClassName=item.ClassifyName
+      // for (let i= 1;  i< col+1; i++) {
+      //   luckysheet.setCellValue(1,i,this.secondClassName,{isRefresh:i==col?true:false})
+      // }
+      luckysheet.refresh()
     },
     // 切换选择频度
     changeFrequency(value){
-      let col = this.options.column
-      for (let i= 1;  i< col+1; i++) {
-        luckysheet.setCellValue(2,i,value,{isRefresh:i==col?true:false})
-      }
+      // let col = this.options.column
+      // for (let i= 1;  i< col+1; i++) {
+      //   luckysheet.setCellValue(2,i,value,{isRefresh:i==col?true:false})
+      // }
+      luckysheet.refresh()
     },
     saveExcel(){
       this.$refs.dataOptions.validate((valid)=>{

+ 8 - 4
src/views/predictEdb_manage/predictEdb.vue

@@ -69,7 +69,7 @@
 						@node-drag-leave="dropMouseLeave"
 						@node-drag-enter="dropMouseOver"
 					>
-						<span class="custom-tree-node" slot-scope="{ node, data }">
+						<div class="custom-tree-node" slot-scope="{ node, data }">
 							<el-input
 								ref="editVal"
 								style="width: 90px"
@@ -89,7 +89,11 @@
 							>
 								<span>{{ currentLang==='en' ? (data.ClassifyNameEn||data.ClassifyName) : data.ClassifyName }}</span>
 							</span>
-							<span
+
+							<!-- 标识计算指标小icon -->
+							<svg v-if="data.EdbType===2&&select_node !== data.UniqueCode" t="1692078566249" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8640" width="20" height="20"><path d="M892.498502 161.874761l-730.640626 730.624253c-4.14132 4.237511-9.673313 6.299473-15.141862 6.299473-5.516644 0-11.048637-2.062985-15.205307-6.299473-8.394181-8.394181-8.394181-21.969361 0-30.347169l730.656999-730.640626c8.362458-8.394181 21.969361-8.394181 30.331819 0C900.892683 139.889027 900.892683 153.49593 892.498502 161.874761L892.498502 161.874761zM447.519941 340.089675 103.737154 340.089675c-11.864212 0-21.521153-9.625218-21.521153-21.457708 0-11.864212 9.657964-21.521153 21.521153-21.521153l343.782787 0c11.879562 0 21.505803 9.657964 21.505803 21.521153C469.025745 330.464457 459.399503 340.089675 447.519941 340.089675L447.519941 340.089675zM275.652596 512.005117c-11.879562 0-21.521153-9.641591-21.521153-21.457708L254.131443 146.653081c0-11.799744 9.641591-21.457708 21.521153-21.457708 11.83249 0 21.457708 9.657964 21.457708 21.457708l0 343.895351C297.110303 502.363526 287.484062 512.005117 275.652596 512.005117L275.652596 512.005117zM920.335501 662.46285l-343.830883 0c-11.879562 0-21.521153-9.641591-21.521153-21.521153 0-11.864212 9.641591-21.457708 21.521153-21.457708l343.830883 0c11.83249 0 21.457708 9.593496 21.457708 21.457708C941.793208 652.821259 932.166967 662.46285 920.335501 662.46285L920.335501 662.46285zM920.335501 834.378292l-343.830883 0c-11.879562 0-21.521153-9.641591-21.521153-21.521153 0-11.864212 9.641591-21.457708 21.521153-21.457708l343.830883 0c11.83249 0 21.457708 9.593496 21.457708 21.457708C941.793208 824.736701 932.166967 834.378292 920.335501 834.378292L920.335501 834.378292z" p-id="8641" fill="#999999"></path></svg>
+
+							<div
 								style="display: flex; align-items: center"
 								v-if="select_node === data.UniqueCode"
 							>
@@ -136,8 +140,8 @@
 									style="width: 14px; height: 14px;margin-left: 8px"
 									alt=""
 								/>
-							</span>
-						</span>
+							</div>
+						</div>
 					</el-tree>
 					<div
 						class="noDepart"

+ 124 - 0
src/views/report_manage/editChapterReport.vue

@@ -383,6 +383,130 @@ export default {
         addType: [{ required: true, message: "请选择", trigger: "change" }],
       },
       lastEditRange: null,
+      froalaConfig: {
+        toolbarButtons: [
+          "insertImage",
+          "insertVideo",
+          "insertLink",
+          "embedly",
+          "insertFile",
+          "textColor",
+          "bold",
+          "italic",
+          "underline",
+          "strikeThrough",
+          "subscript",
+          "superscript",
+          "fontFamily",
+          "fontSize",
+          "color",
+          "inlineClass",
+          "inlineStyle",
+          "paragraphStyle",
+          "lineHeight",
+          "paragraphFormat",
+          "align",
+          "formatOL",
+          "formatUL",
+          "outdent",
+          "indent",
+          "quote",
+          "insertTable",
+          "emoticons",
+          "fontAwesome",
+          "specialCharacters",
+          "insertHR",
+          "selectAll",
+          "clearFormatting",
+          "html",
+          "undo",
+          "redo",
+        ],
+        imageDefaultWidth: false,
+        imageInsertButtons: ["imageUpload", "imageByURL"],
+        height: 800,
+        fontSizeDefaultSelection: "16",
+        fontSize: ["12", "14", "16", "18", "20", "24", "28", "32", "36", "40"],
+        fontFamily:{
+          'Arial,Helvetica,sans-serif': 'Arial',
+          'Georgia,serif': 'Georgia',
+          'Impact,Charcoal,sans-serif': 'Impact',
+          'Tahoma,Geneva,sans-serif': 'Tahoma',
+          "'Times New Roman',Times,serif": 'Times New Roman',
+          'Verdana,Geneva,sans-serif': 'Verdana',
+          '宋体': '宋体',
+          '黑体': '黑体',
+          '微软雅黑': '微软雅黑'
+        },
+        theme: "dark", //主题
+        placeholderText: "请输入内容",
+        language: "zh_cn", //国际化
+        imageUploadURL: process.env.VUE_APP_API_ROOT + "/report/uploadImg", //上传url
+        imagePaste: true,
+        imagePasteProcess: true,
+        imageResize: true,
+        videoUploadURL: process.env.VUE_APP_API_ROOT + "/report/uploadImg", //上传url
+        fileUploadURL: process.env.VUE_APP_API_ROOT + "/report/uploadImg", //上传url 更多上传介绍 请访问https://www.froala.com/wysiwyg-editor/docs/options
+        toolbarSticky: false, //操作栏是否自动吸顶
+        imageEditButtons: [
+          "imageLink",
+          "imageAlign",
+          "imageInfo",
+          "imageRemove",
+        ],
+        quickInsertButtons: ["image", "table", "ul", "ol", "hr"], //快速插入项
+        toolbarVisibleWithoutSelection: true, //是否开启 不选中模式
+        saveInterval: 0,
+        /* saveParam: 'Content',
+					saveURL: process.env.VUE_APP_API_ROOT+'/report/saveReportContent',
+					saveMethod: 'POST',
+					saveParams: {}, */
+        events: {
+          initialized: function () {
+            //this.editor 定义在vue data 中
+            that.editor = this;
+          },
+          keyup: function (e, editor) {
+            //添加事件,在每次按键按下时,都记录一下最后停留位置
+            that.lastEditRange = getSelection().getRangeAt(0) || 0;
+          },
+          click: function (e, editor) {
+            //添加事件,在每次鼠标点击时,都记录一下最后停留位置
+            if (getSelection().type === "None") return;
+            that.lastEditRange = getSelection().getRangeAt(0) || 0;
+          },
+          //内容改变事件
+          contentChanged: function () {
+            console.log("cont-change");
+            that.ischange = true;
+            if (getSelection().type !== "None") {
+              that.lastEditRange = getSelection().getRangeAt(0) || 0;
+            }
+          },
+          //粘贴图片上传事件
+          "image.beforePasteUpload": function (img) {
+            //console.log('image.beforePasteUpload',img)
+            //暂停自动保存
+            that.autoSaveFlag = false;
+          },
+          //点击toolbar上传图片事件
+          "image.beforeUpload": function (imgs) {
+            //console.log('image.beforeUpload',imgs)
+            //暂停自动保存
+            that.autoSaveFlag = false;
+          },
+          "image.inserted": function ($img, response) {
+            //console.log('img-inserted',$img)
+            //开启自动保存
+            that.autoSaveFlag = true;
+          },
+          //如果上传图片出错,重置autoSaveFlag
+          "image.error": function (error, response) {
+            that.autoSaveFlag = true;
+          },
+        },
+        charCounterCount: false,
+      },
       reportloadding: false,
       timer: null,
       ischange: false,

+ 11 - 0
src/views/report_manage/mixins/reportMixin.js

@@ -70,6 +70,17 @@ export default {
         height: 800,
         fontSize: ["12", "14", "16", "18", "20", "24", "28", "32", "36", "40"],
         fontSizeDefaultSelection: "16",
+        fontFamily:{
+          'Arial,Helvetica,sans-serif': 'Arial',
+          'Georgia,serif': 'Georgia',
+          'Impact,Charcoal,sans-serif': 'Impact',
+          'Tahoma,Geneva,sans-serif': 'Tahoma',
+          "'Times New Roman',Times,serif": 'Times New Roman',
+          'Verdana,Geneva,sans-serif': 'Verdana',
+          '宋体': '宋体',
+          '黑体': '黑体',
+          '微软雅黑': '微软雅黑'
+        },
         theme: "dark", //主题
         placeholderText: "请输入内容",
         language: "zh_cn", //国际化

+ 1 - 0
src/vuex/mutations.js

@@ -9,6 +9,7 @@ const mutations = {
   SET_DATA_AUTH(state, bool) {
     state.dataAuth = bool;
   },
+
   SET_COLLAPSE(state,bool) {
     state.isCollapse = bool;
   },