|
|
@@ -595,11 +595,11 @@ export default {
|
|
|
setting() {
|
|
|
return this.$store.getters.setting
|
|
|
},
|
|
|
- exampleList() {
|
|
|
- return this.$store.getters.exampleList
|
|
|
- ? this.$store.getters.exampleList.filter((t) => t)
|
|
|
- : []
|
|
|
- }
|
|
|
+ // exampleList() {
|
|
|
+ // return this.$store.getters.exampleList
|
|
|
+ // ? this.$store.getters.exampleList.filter((t) => t)
|
|
|
+ // : []
|
|
|
+ // }
|
|
|
},
|
|
|
watch: {
|
|
|
value: {
|
|
|
@@ -712,23 +712,23 @@ export default {
|
|
|
this.key = pkKey
|
|
|
},
|
|
|
initUI() {
|
|
|
- const item =
|
|
|
- this.template &&
|
|
|
- this.exampleList &&
|
|
|
- this.exampleList.find(
|
|
|
- (t) =>
|
|
|
- t.DEFAULT_URL_ && t.DEFAULT_URL_.includes(this.template.template_id)
|
|
|
- )
|
|
|
- console.log('this.exampleList==>', this.template, item)
|
|
|
- if (item) {
|
|
|
- if (this.template.attrs) {
|
|
|
- this.template.attrs.formExample = item.shi_li_shang_chua || ''
|
|
|
- } else {
|
|
|
- this.template.attrs = {
|
|
|
- formExample: item.shi_li_shang_chua || ''
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ // const item =
|
|
|
+ // this.template &&
|
|
|
+ // this.exampleList &&
|
|
|
+ // this.exampleList.find(
|
|
|
+ // (t) =>
|
|
|
+ // t.DEFAULT_URL_ && t.DEFAULT_URL_.includes(this.template.template_id)
|
|
|
+ // )
|
|
|
+ // console.log('this.exampleList==>', this.template, item)
|
|
|
+ // if (item) {
|
|
|
+ // if (this.template.attrs) {
|
|
|
+ // this.template.attrs.formExample = item.shi_li_shang_chua || ''
|
|
|
+ // } else {
|
|
|
+ // this.template.attrs = {
|
|
|
+ // formExample: item.shi_li_shang_chua || ''
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
this.initialization = false
|
|
|
if (!this.initialization) {
|
|
|
this.initJTemplate()
|
|
|
@@ -1337,51 +1337,51 @@ export default {
|
|
|
break
|
|
|
case 'custom': // 自定义按钮
|
|
|
break
|
|
|
- case 'example': // 示例
|
|
|
- const { data: data1 } = await this.getRemoteByIdFunc(
|
|
|
- this.template.attrs.formExample
|
|
|
- )
|
|
|
- console.log('data---->', data1)
|
|
|
- if (fileTypes.images.includes(data1.ext)) {
|
|
|
- this.file = data1
|
|
|
- this.filePreviewVisible2 = false
|
|
|
- this.filePreviewVisible = true
|
|
|
- } else if (data1.ext === 'pdf' || data1.ext === 'PDF') {
|
|
|
- this.$nextTick(() => {
|
|
|
- const newTab = window.open()
|
|
|
- const link = newTab.document.createElement('link')
|
|
|
- const url =
|
|
|
- BASE_API() +
|
|
|
- SYSTEM_URL() +
|
|
|
- '/file/download?attachmentId=' +
|
|
|
- data1.id
|
|
|
- const hasRole = localStorage.getItem('hasHighRole') || 0
|
|
|
- link.rel = 'shortcut icon'
|
|
|
- link.type = 'image/x-icon'
|
|
|
- link.href = 'favicon.ico'
|
|
|
- // newTab.document.write('<link rel="icon" type="image/x-icon" href="favicon.ico">')
|
|
|
- newTab.document.write(
|
|
|
- `<title>文件预览页-${data1.fileName}</title>`
|
|
|
- )
|
|
|
- newTab.document.write('<style>body { margin: 0px; }</style>')
|
|
|
- newTab.document.head.appendChild(link)
|
|
|
- newTab.document.write(
|
|
|
- `<iframe src="${
|
|
|
- this.$baseUrl
|
|
|
- }lib/pdfjs-dist/web/viewer.html?file=${encodeURIComponent(
|
|
|
- url
|
|
|
- )}&hasRole=${hasRole}" style="width:100%; height:100%;" frameborder="0";>`
|
|
|
- )
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.file.url = `${this.$onlyofficeApi}/file/download?attachmentId=${data1.id}`
|
|
|
- this.file.editUrl = `${this.$onlyofficeApi}/file/editCallback?fileName=${data1.fileName}&fileType=${data1.ext}&id=${data1.id}`
|
|
|
- this.file.title = data1.fileName // 文件名称
|
|
|
- this.file.fileType = data1.ext // 类型
|
|
|
- this.filePreviewVisible = false
|
|
|
- this.filePreviewVisible2 = true
|
|
|
- }
|
|
|
- break
|
|
|
+ // case 'example': // 示例
|
|
|
+ // const { data: data1 } = await this.getRemoteByIdFunc(
|
|
|
+ // this.template.attrs.formExample
|
|
|
+ // )
|
|
|
+ // console.log('data---->', data1)
|
|
|
+ // if (fileTypes.images.includes(data1.ext)) {
|
|
|
+ // this.file = data1
|
|
|
+ // this.filePreviewVisible2 = false
|
|
|
+ // this.filePreviewVisible = true
|
|
|
+ // } else if (data1.ext === 'pdf' || data1.ext === 'PDF') {
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // const newTab = window.open()
|
|
|
+ // const link = newTab.document.createElement('link')
|
|
|
+ // const url =
|
|
|
+ // BASE_API() +
|
|
|
+ // SYSTEM_URL() +
|
|
|
+ // '/file/download?attachmentId=' +
|
|
|
+ // data1.id
|
|
|
+ // const hasRole = localStorage.getItem('hasHighRole') || 0
|
|
|
+ // link.rel = 'shortcut icon'
|
|
|
+ // link.type = 'image/x-icon'
|
|
|
+ // link.href = 'favicon.ico'
|
|
|
+ // // newTab.document.write('<link rel="icon" type="image/x-icon" href="favicon.ico">')
|
|
|
+ // newTab.document.write(
|
|
|
+ // `<title>文件预览页-${data1.fileName}</title>`
|
|
|
+ // )
|
|
|
+ // newTab.document.write('<style>body { margin: 0px; }</style>')
|
|
|
+ // newTab.document.head.appendChild(link)
|
|
|
+ // newTab.document.write(
|
|
|
+ // `<iframe src="${
|
|
|
+ // this.$baseUrl
|
|
|
+ // }lib/pdfjs-dist/web/viewer.html?file=${encodeURIComponent(
|
|
|
+ // url
|
|
|
+ // )}&hasRole=${hasRole}" style="width:100%; height:100%;" frameborder="0";>`
|
|
|
+ // )
|
|
|
+ // })
|
|
|
+ // } else {
|
|
|
+ // this.file.url = `${this.$onlyofficeApi}/file/download?attachmentId=${data1.id}`
|
|
|
+ // this.file.editUrl = `${this.$onlyofficeApi}/file/editCallback?fileName=${data1.fileName}&fileType=${data1.ext}&id=${data1.id}`
|
|
|
+ // this.file.title = data1.fileName // 文件名称
|
|
|
+ // this.file.fileType = data1.ext // 类型
|
|
|
+ // this.filePreviewVisible = false
|
|
|
+ // this.filePreviewVisible2 = true
|
|
|
+ // }
|
|
|
+ // break
|
|
|
case 'openTask': // 编制,开启对应流程
|
|
|
if (!button.deflow) {
|
|
|
return this.$message.warning('请先配置对应流程!')
|
|
|
@@ -1717,29 +1717,29 @@ export default {
|
|
|
// 显示字段
|
|
|
const columns = []
|
|
|
this.setDisplayColumns(this.template.display_columns || [], columns)
|
|
|
- if (
|
|
|
- this.setting &&
|
|
|
- this.setting.system &&
|
|
|
- this.setting.system.exampleButton &&
|
|
|
- this.template.attrs &&
|
|
|
- this.template.attrs.formExample
|
|
|
- ) {
|
|
|
- toolbarButtons.push({
|
|
|
- $index: toolbarButtons.length,
|
|
|
- key: 'example',
|
|
|
- button_type: 'example',
|
|
|
- code: 'example',
|
|
|
- label: '示例',
|
|
|
- icon: 'el-icon-view',
|
|
|
- type: 'warning',
|
|
|
- deflow: null,
|
|
|
- isEditOnHis: false,
|
|
|
- initAddDataCont: null,
|
|
|
- disabled: false,
|
|
|
- hidden: false,
|
|
|
- position: 'toolbar'
|
|
|
- })
|
|
|
- }
|
|
|
+ // if (
|
|
|
+ // this.setting &&
|
|
|
+ // this.setting.system &&
|
|
|
+ // this.setting.system.exampleButton &&
|
|
|
+ // this.template.attrs &&
|
|
|
+ // this.template.attrs.formExample
|
|
|
+ // ) {
|
|
|
+ // toolbarButtons.push({
|
|
|
+ // $index: toolbarButtons.length,
|
|
|
+ // key: 'example',
|
|
|
+ // button_type: 'example',
|
|
|
+ // code: 'example',
|
|
|
+ // label: '示例',
|
|
|
+ // icon: 'el-icon-view',
|
|
|
+ // type: 'warning',
|
|
|
+ // deflow: null,
|
|
|
+ // isEditOnHis: false,
|
|
|
+ // initAddDataCont: null,
|
|
|
+ // disabled: false,
|
|
|
+ // hidden: false,
|
|
|
+ // position: 'toolbar'
|
|
|
+ // })
|
|
|
+ // }
|
|
|
this.listConfig = {
|
|
|
toolbars: toolbarButtons,
|
|
|
columns: columns,
|