Преглед изворни кода

修改提交会签时选人问题

xiao-xx пре 4 година
родитељ
комит
f48774b2c6

+ 59 - 7
src/views/system/actform/fawen/iWebOffice.vue

@@ -1,8 +1,14 @@
 <template>
-  <div style="width:100%;height:700px;" >
+  <div style="width:100%;height:600px; bottom:20px;">
+    <el-button  type="success" value="保存文档到服务器" @click="SaveDocument()">保存文档到服务器</el-button>
+    <el-button  type="primary" value="打开本地文档(有窗口)" @click="OnUnLoad(),openlocal()">打开本地文档(有窗口)</el-button>
+    <el-button  type="info" value="锁定文档" @click="WebSetProtect(true, '123456')">锁定文档</el-button>
+    <el-button  type="warning" value="解锁文档" @click="WebSetProtect(false, '123456')">解锁文档</el-button>
+    <el-button  type="danger" value="添加区域保护" @click="WebAreaProtect()">添加区域保护</el-button>
+    <el-button   type="info" style="background:#6E30B4;" value="解除区域保护" @click="WebAreaUnProtect()">解除区域保护</el-button>
+    <el-button   type="info" style="background:#303133" value="禁止拷贝" @click="WebEnableCopy()">禁止拷贝</el-button>
+    <el-button   type="info"  style="background:#19868E"value="允许拷贝" @click="WebEnableCopy()">允许拷贝</el-button>
     <div id="office"></div>
-    <input style="color:Red;" type=button value="打开本地文档(有窗口)" @click="OnUnLoad(),openlocal()">
-    <input style="color:Red;" type=button value="保存文档到服务器" @click="SaveDocument()">
   </div>
 </template>
 <script>
@@ -27,6 +33,7 @@
 
     },
     mounted() {
+
       this.$nextTick(() => {
         this.initWebOffice();
         this.initWebOfficeObject();
@@ -52,25 +59,35 @@
       },
       initWebOfficeObject() {
         this.webOfficeObj = new WebOffice2015();
+        this.webOfficeObj.setObj(document.getElementById('WebOffice'));
         try {
+
           this.webOfficeObj.ServerUrl = "http://localhost/dev-api";
           // this.webOfficeObj.RecordID = "web";  //RecordID:本文档记录编号
-          this.webOfficeObj.setObj(document.getElementById('WebOffice'));
           this.webOfficeObj.UserName = this.fileData.user;
           this.webOfficeObj.FileName = this.fileData.filePath;
           this.webOfficeObj.getResultJson = {};
           this.webOfficeObj.SaveServlet = "/content/upload";
           this.webOfficeObj.FileType = "." + this.fileData.filePath.split(".")[this.fileData.filePath.split(".").length - 1]; //FileType:文档类型  .doc  .xls
           this.webOfficeObj.ShowWindow = false; //显示/隐藏进度条
-          this.webOfficeObj.EditType = "1"; //设置加载文档类型 0 锁定文档,1无痕迹模式,2带痕迹模式
+          this.webOfficeObj.EditType = this.fileData.EditType; //设置加载文档类型 0 锁定文档,1无痕迹模式,2带痕迹模式
           this.webOfficeObj.ShowMenu = 1;
           this.webOfficeObj.ShowToolBar = 0;
           this.webOfficeObj.SetCaption(this.webOfficeObj.UserName + "正在编辑文档"); // 设置控件标题栏标题文本信息
           //参数顺序依次为:控件标题栏颜色、自定义菜单开始颜色、自定义工具栏按钮开始颜色、自定义工具栏按钮结束颜色、
           //自定义工具栏按钮边框颜色、自定义工具栏开始颜色、控件标题栏文本颜色(默认值为:0x000000)
-          if (!this.webOfficeObj.WebSetSkin(0xdbdbdb, 0xeaeaea, 0xeaeaea, 0xdbdbdb, 0xdbdbdb, 0xdbdbdb, 0x000000)) {
-            this.msgSuccess(this.webOfficeObj.Status);
+
+          if (!this.webOfficeObj.WebSetSkin(0xdbdbdb,
+            0xeaeaea,
+            0xeaeaea,
+            0xdbdbdb,
+            0xdbdbdb,
+            0xdbdbdb,
+            0x000000)) {
+            this.msgError("插件发生错误,该浏览器不支持office");
+            // this.msgSuccess(this.webOfficeObj.Status);
           }    //设置控件皮肤
+
           if (this.webOfficeObj.WebOpen()) {
             this.msgSuccess(this.webOfficeObj.Status);
           }
@@ -114,6 +131,41 @@
           this.StatusMsg(this.webOfficeObj.Status);
         }
       },
+      //锁定/解锁文档
+      WebSetProtect(Boolean, PassWord) {
+        this.webOfficeObj.WebSetProtect(Boolean, PassWord);
+        this.msgSuccess(this.webOfficeObj.Status);
+      },
+
+      //允许/禁止拷贝文档
+      WebEnableCopy(Boolean) {
+        this.webOfficeObj.WebEnableCopy(Boolean);
+        this.msgSuccess(this.webOfficeObj.Status);
+      },
+
+      //添加区域保护
+      WebAreaProtect() {
+        //如果非ie浏览器调用HidePlugin隐藏插件避免窗体被遮挡
+        this.webOfficeObj.HidePlugin(0);
+        var mText = window.prompt("文档里需要先设置保护的书签,示例文档默认添加了KingGrid的书签,请输入书签名称", "KingGrid", "");
+        if (mText != null) {
+          this.webOfficeObj.WebAreaProtect(mText)
+        }
+        ;
+        this.webOfficeObj.HidePlugin(1);
+      },
+      //取消区域保护
+      WebAreaUnProtect() {
+        //如果非ie浏览器调用HidePlugin隐藏插件避免窗体被遮挡
+        this.webOfficeObj.HidePlugin(0);
+        var mText = window.prompt("需要和保护的书签对应,示例文档默认添加了KingGrid的书签,请输入书签名称", "KingGrid", "");
+        //显示HidePlugin隐藏的插件
+        if (mText != null) {
+          this.webOfficeObj.WebAreaUnprotect(mText)
+        }
+        ;
+        this.webOfficeObj.HidePlugin(1);
+      },
       OnCommand(ID, Caption, bCancel) {
         switch (ID) {
           case 1:

+ 14 - 5
src/views/system/actform/fawen/write1.vue

@@ -154,14 +154,19 @@
     </div>
     <el-dialog id="content" title="正文修改"
                :visible.sync="contentOpen"
-               :before-close="cancel" append-to-body
+               :before-close="cancel1" append-to-body
                width="80%"
-               top="10" height="800px">
+               top="10"
+
+               height="900px">
       <!-- 动态引入组件-->
           <i-web-office :key="timer" @func="getcontent" :fileData="fileData" ></i-web-office>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="contentOpen = false">取 消</el-button>
+      </span>
     </el-dialog>
 
-    <select-user-by-dept ref="selectUserByDept" :title="title" :open="Renopen" @ok="selectOK"/>
+<!--    <select-user-by-dept ref="selectUserByDept" :title="title" :open="Renopen" @ok="selectOK"/>-->
 
     <el-dialog :title="title" :visible.sync="deptOpen" width="40%" append-to-body style="size: 30px">
       <el-tree
@@ -215,6 +220,7 @@
         fileData: {
           filePath: '/profile/doc/NewCreate.doc',
           user: 'xxx',
+          EditType: '1',
         },
         fileList3: [],
         // 选中数组
@@ -415,7 +421,7 @@
       getDetails() {
         getFormData(this.form.formId).then(response => {
           this.form = response.data;
-          this.fileData.filePath = this.form.content;
+          this.fileData.filePath = this.form.content==""?"/profile/doc/NewCreate.doc":this.form.content;
           this.fileData.user = this.form.user;
           var files= response.data.accessory.split(",")
           for (var i=0;i<files.length;i++){
@@ -444,11 +450,14 @@
       // 取消按钮
       cancel() {
         this.$emit('getList');
-        this.contentOpen = false;
+
         this.open = false;
         this.reset();
 
       },
+      cancel1(){
+        this.contentOpen = false;
+      },
       // 表单重置
       reset() {
         this.form = {

+ 16 - 25
src/views/system/actform/fawen/write2.vue

@@ -66,7 +66,7 @@
         </tr>
         <tr>
           <td colspan="2">
-            <el-form-item label="上传附件:" prop="accessory">
+            <el-form-item label="附件:" prop="accessory">
               <el-upload
                 ref="upload"
                 :limit="1"
@@ -75,7 +75,7 @@
                 :headers="upload.headers"
                 :file-list="upload.fileList"
                 :auto-upload="false">
-                <div slot="tip" class="el-upload__tip">只能上传文件,且不超过500kb</div>
+<!--                <div slot="tip" class="el-upload__tip">只能上传文件,且不超过500kb</div>-->
               </el-upload>
             </el-form-item>
           </td>
@@ -99,7 +99,7 @@
           <td colspan="2">
             <el-form-item label="选择下一步处理人:" :disabled="true">
               <el-input v-model="postForm.sendUserRealName" placeholder=" 请选择下一步处理人"
-                        prop="avtiveSend" :disabled="true">
+                        :disabled="true">
                 <template slot="append">
                   <el-button
                     type="primary"
@@ -142,30 +142,21 @@
       <el-button type="primary" @click="submitFw()">提交</el-button>
       <el-button @click="cancel">取 消</el-button>
     </div>
-    <el-dialog id="content" title="正文修改" :visible.sync="contentOpen" :before-close="cancel" append-to-body
+    <el-dialog id="content" title="正文修改" :visible.sync="contentOpen"
+               :before-close="cancel1" append-to-body
                width="80%"
-               top="10" height="800px">
+               top="10" height="900px">
       <!-- 动态引入组件-->
       <i-web-office :key="timer" @func="getcontent" :fileData="fileData"></i-web-office>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="contentOpen = false">取 消</el-button>
+      </span>
     </el-dialog>
 
-    <el-dialog :title="title" :visible.sync="deptOpen" width="40%" append-to-body style="size: 30px">
-      <el-tree
-        :data="deptOptions"
-        show-checkbox
-        default-expand-all
-        ref="dept"
-        node-key="id"
-        empty-text="加载中,请稍后"
-        :props="defaultProps"
-      ></el-tree>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="getDeptAllCheckedKeys">确 定</el-button>
-        <el-button @click="cancelDept">取 消</el-button>
-      </div>
-    </el-dialog>
-
-    <select-user-by-dept ref="selectUserByDept" :title="title" :open="Renopen" @ok="selectOK"/>
+    <select-user-by-dept ref="selectUserByDept" :title="title" :open="Renopen"
+                         :inputName="postForm.sendUserRealName"
+                         :inputAccount="postForm.sendUser"
+                         @ok="selectOK"/>
 
   </div>
 </template>
@@ -174,7 +165,6 @@
   import SelectUserByDept from '@/components/SelectRen/selectUserByDept'
   import iWebOffice from './iWebOffice'
   import SelectRen from '@/components/SelectRen'
-  import { treeselect } from '@/api/system/dept'
   import { getFormData, deleteToDoItem, submitToDoItem, updateInfo, rejectToDoItem } from '@/api/activiti/form/fw'
   import Treeselect from '@riophae/vue-treeselect'
   import { getToken } from '@/utils/auth'
@@ -323,11 +313,12 @@
         this.$refs.selectUserByDept.childOpen = true
         this.Renopen = true
       },
-
+      cancel1(){
+        this.contentOpen = false;
+      },
       // 取消按钮
       cancel() {
         this.$emit('getList')
-        this.contentOpen = false
         this.open = false
         this.reset()
       },

+ 1 - 4
static/iweboffice/WebOffice.js

@@ -325,7 +325,6 @@ function WebOffice2015() {
 		this.Status = "成功";
 		var httpclient = this.obj.Http; // 设置http对象
 		httpclient.Clear();
-
 		this.GetSingleFileName(this.FileName);
 		this.WebSetMsgByName("USERNAME", this.UserName); // 加载UserName
 		this.WebSetMsgByName("FILENAME", this.FileName); // 加载FileName
@@ -613,7 +612,6 @@ function WebOffice2015() {
 	/* 保存文件 */		//(该功能已完整实现)
 	this.WebSave = function(header)
 	{
-	  debugger
 		this.Status = "";
 		var httpclient = this.obj.Http; // 设置http对象
 		httpclient.Clear();
@@ -1956,10 +1954,9 @@ function WebOffice2015() {
 			menuBarButtonEndColor/* 自定义工具栏按钮结束颜色 */,
 			menuBarButtonFrameColor/* 自定义工具栏按钮边框颜色 */,
 			CustomToolbarStartColor/* 自定义工具栏开始颜色 */, TitleBarTextColor/* 控件标题栏文本颜色 */) {
-
 		this.Status = '';
-
 		var style = this.obj.Style;
+
 		try {
 			style.TitleBarColor = titleBarColor;
 			if ((TitleBarTextColor == undefined) || (TitleBarTextColor == '')) // 设置默认标题文字颜色