| | |
| | | import PizZip from 'pizzip' |
| | | import JSZipUtils from 'jszip-utils' |
| | | import {saveAs} from 'file-saver' |
| | | |
| | | let docx = require("docx-preview"); |
| | | const ImageModule = require("docxtemplater-image-module-free"); |
| | | |
| | |
| | | let doc = new docxtemplater().loadZip(zip); |
| | | // 设置模板变量的值 |
| | | doc.setData(e); |
| | | console.log(doc.setData(e), 'doc.setData(e);') |
| | | |
| | | try { |
| | | //替换所有模板变量 |
| | |
| | | console.log(JSON.stringify({error: e})); |
| | | throw error; |
| | | } |
| | | |
| | | console.log(doc, 'out~doc') |
| | | // 生成一个代表docxtemplater对象的zip文件(不是一个真实的文件,而是在内存中的表示) |
| | | let out = doc.getZip().generate({ |
| | | type: "blob", |
| | | mimeType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" |
| | | }); |
| | | console.log(doc.getZip().generate, 'doc.getZip().generate') |
| | | // 将目标文件对象保存为目标类型的文件,并命名 |
| | | saveAs(out, docxname); |
| | | }); |
| | |
| | | type: "blob", |
| | | mimeType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" |
| | | }); |
| | | console.log(out, 'out') |
| | | // window.android.toDownLoadWord(out) |
| | | docx.renderAsync(out, continer); // 渲染到页面预览 |
| | | }); |
| | | }; |
| | |
| | | docx.renderAsync(out, continer); // 渲染到页面预览 |
| | | }); |
| | | }; |
| | | |
| | | function base64DataURLToArrayBuffer(dataURL) { |
| | | const base64Regex = /^data:image\/(png|jpg|svg|svg\+xml);base64,/; |
| | | if (!base64Regex.test(dataURL)) { |
| | |
| | | const TENANT_ID = getStore({ name: 'tenantId' }) |
| | | const isToken = (config.headers || {}).isToken === false |
| | | const token = window.android.getAppToken() |
| | | // const token = `dd271fdb-4b69-4eb3-a940-52d70232e56b` |
| | | // const token = `59866cb8-c5ba-4b2f-a367-3ab2f64f30c5` |
| | | if (token && !isToken) { |
| | | config.headers['Authorization'] = 'bearer ' + token// token |
| | | config.headers['Authorization'] = 'Bearer ' + token// token |
| | | } |
| | | if (TENANT_ID) { |
| | | config.headers['TENANT-ID'] = TENANT_ID // 租户ID |
| | |
| | | config.data = serialize(config.data) |
| | | delete config.data.serialize |
| | | } |
| | | config.headers['VERSION'] = 'lmm' |
| | | // config.headers['VERSION'] = 'GHX' |
| | | if (config.method === 'get'||config.params) { |
| | | config.paramsSerializer = function (params) { |
| | | let p ={}; |
| | |
| | | const status = Number(res.status) || 200 |
| | | const message = res.data.msg || errorCode[status] || errorCode['default'] |
| | | /* if (status === 401) { |
| | | // Message({ |
| | | // message: message, |
| | | // type: 'error' |
| | | // }) |
| | | Message({ |
| | | message: message, |
| | | type: 'error' |
| | | }) |
| | | handleError(message) |
| | | store.dispatch('FedLogOut').then(() => { |
| | | router.push({ path: '/login' }) |
| | | router.push({ path: '/pad' }) |
| | | }) |
| | | return |
| | | }*/ |
| | | |
| | | // if (status !== 200 || res.data.code === 1) { |
| | | // // Message({ |
| | | // // message: message, |
| | | // // type: 'error' |
| | | // // }) |
| | | // // handleError(message) |
| | | // return handleError(message) |
| | | // // return Promise.reject(new Error(message)) |
| | | // } |
| | | /*if (status !== 200 || res.data.code === 1) { |
| | | Message({ |
| | | message: message, |
| | | type: 'error' |
| | | }) |
| | | handleError(message) |
| | | return handleError(message) |
| | | // return Promise.reject(new Error(message)) |
| | | }*/ |
| | | return res |
| | | }, error => { |
| | | NProgress.done() |
| | |
| | | name: '简易程序案件', |
| | | component: () => |
| | | import(/* webpackChunkName: "page" */ '@/views/padSunmaryProcedure/padFrom') |
| | | },{ |
| | | }, |
| | | { |
| | | path: '/padWord', |
| | | name: '案件填报流程', |
| | | component: () => |
| | | import(/* webpackChunkName: "page" */ '@/views/padSunmaryProcedure/padWord') |
| | | },{ |
| | | import(/* webpackChunkName: "page" */ '../../views/padSunmaryProcedure/padWord') |
| | | } |
| | | /*,{ |
| | | path: '/WordYulan', |
| | | name: 'word预览', |
| | | component: () => |
| | | import(/* webpackChunkName: "page" */ '@/views/padSunmaryProcedure/word-view') |
| | | }] |
| | | }] |
| | | import(/!* webpackChunkName: "page" *!/ '@/views/padSunmaryProcedure/word-view') |
| | | }*/ |
| | | ] |
| | | } |
| | | ] |
| | |
| | | const originalPush = VueRouter.prototype.push |
| | | const originalReplace = VueRouter.prototype.replace |
| | | //push |
| | | VueRouter.prototype.push = function push(location, onResolve, onReject) { |
| | | /*VueRouter.prototype.push = function push(location, onResolve, onReject) { |
| | | if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject) |
| | | return originalPush.call(this, location).catch(err => err) |
| | | } |
| | | }*/ |
| | | //replace |
| | | VueRouter.prototype.replace = function push(location, onResolve, onReject) { |
| | | if (onResolve || onReject) return originalReplace.call(this, location, onResolve, onReject) |
| | |
| | | isShow: false, |
| | | formInline: { |
| | | litigant: '', |
| | | phone: '' |
| | | phone: '', |
| | | current:this.pageIndex, |
| | | size:this.pageSize |
| | | }, |
| | | pageSize: 10, |
| | | pageIndex: 1, |
| | |
| | | getDataList(type) { |
| | | // this.$nextTick(()=>{ |
| | | if (type == 0) { |
| | | this.formInline.type = type |
| | | this.formInline.type = type; |
| | | this.formInline.current=this.pageIndex; |
| | | this.formInline.size=this.pageSize; |
| | | getObj(this.formInline).then(res => { |
| | | this.tableData = res.data.data.records |
| | | this.total =res.data.data.total |
| | | }) |
| | | } else { |
| | | // this.formInline.type = type; |
| | | this.formInline.current=this.pageIndex; |
| | | this.formInline.size=this.pageSize; |
| | | // this.formInline.user=333 |
| | | getObj().then(res => { |
| | | getObj(this.formInline).then(res => { |
| | | this.tableData = res.data.data.records |
| | | }) |
| | | } |
| | |
| | | sizeChangeHandle(val) { |
| | | this.pageSize = val; |
| | | this.pageIndex = 1; |
| | | // this.getDataList(); |
| | | this.getDataList(0); |
| | | }, |
| | | // 当前页 |
| | | currentChangeHandle(val) { |
| | | this.pageIndex = val; |
| | | // this.getDataList(); |
| | | this.getDataList(0); |
| | | }, |
| | | } |
| | | } |
| | |
| | | }, |
| | | init() { |
| | | // this.$nextTick(()=>{ |
| | | getIdByToken().then(res => { |
| | | console.log(res, 'getIdByToken') |
| | | let a = res.data.data; |
| | | // getIdByToken().then(res => { |
| | | // console.log(res, 'getIdByToken') |
| | | // let a = res.data.data; |
| | | // let b = parseInt(a) |
| | | this.form.hanlderIds.push(a) |
| | | }) |
| | | // this.form.hanlderIds.push(a) |
| | | // }) |
| | | //查询办案人员信息 |
| | | getfindAll().then((res) => { |
| | | this.organPersons = res.data.data; |
| | |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="询问人"> |
| | | <el-input v-model="form.inquirerNameOne" placeholder="请填写询问人"></el-input> |
| | | <el-input v-model="form.inquisitorialNameOne" placeholder="请填写询问人"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item> |
| | | <el-input v-model="form.inquirerNameTwo" placeholder="请填写询问人"></el-input> |
| | | <el-input v-model="form.inquisitorialNameTwo" placeholder="请填写询问人"></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | |
| | | */ |
| | | // const url = 'http://localhost:9999' |
| | | // const url = 'http://192.168.0.164:9999' |
| | | // const url = 'http://192.168.0.134:9999' |
| | | // const url = 'http://192.168.0.126:9999/' |
| | | // const url = 'http://boying.tpddns.cn:9999/' |
| | | const url = 'http://36.138.175.42:9999/' |
| | | const webpack = require('webpack') |