|
@@ -1,268 +1,397 @@
|
|
|
+<style>
|
|
|
+ #wps-iframe {
|
|
|
+ height: 100%
|
|
|
+ }
|
|
|
+</style>
|
|
|
<template>
|
|
|
<a-card :bordered="false">
|
|
|
<!-- 查询区域 -->
|
|
|
- <!-- <div class="table-page-search-wrapper">
|
|
|
+ <div class="table-page-search-wrapper">
|
|
|
<a-form layout="inline">
|
|
|
<a-row :gutter="24">
|
|
|
<a-col :md="6" :sm="8">
|
|
|
- <a-form-item label="广告主开户主体名称">
|
|
|
- <a-input placeholder="请输入广告主开户主体名称" v-model="queryParam.name"></a-input>
|
|
|
+ <selectTable :projectId.sync="queryParam.projectId"></selectTable>
|
|
|
+ </a-col>
|
|
|
+ <a-col :md="6" :sm="8">
|
|
|
+ <a-form-item label="脚本名称">
|
|
|
+ <a-input placeholder="请输入脚本名称" v-model="queryParam.name"></a-input>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col :md="6" :sm="6">
|
|
|
- <a-form-item label="行业">
|
|
|
- <j-tree-select
|
|
|
- v-model="queryParam.industryId"
|
|
|
- ref="treeSelect"
|
|
|
- placeholder="请选择行业"
|
|
|
- dict="sys_category,name,id"
|
|
|
- pidField="pid"
|
|
|
- pidValue="f5cb2d2d28417b3b65a6dd744bcb9a76"
|
|
|
- >
|
|
|
- </j-tree-select>
|
|
|
+ <a-col :md="6" :sm="8">
|
|
|
+ <a-form-item label="创建人">
|
|
|
+ <!-- <a-input placeholder="请输入创建人" v-model="queryParam.creator_dictText"></a-input> -->
|
|
|
+ <a-select v-model="queryParam.creator" showSearch allowClear placeholder="请选择创建人"
|
|
|
+ optionFilterProp="children" style="width: 100%" :filterOption="true">
|
|
|
+ <a-select-option v-for="appModel in options" :key="appModel.userId + new Date().getTime()"
|
|
|
+ :value="appModel.userId">
|
|
|
+ {{ appModel.realName }}
|
|
|
+   {{ appModel.roleName }}</a-select-option>
|
|
|
+ </a-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<a-col :md="6" :sm="8">
|
|
|
<span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
|
|
|
<a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
|
|
|
- <a-button type="primary" @click="searchRe" icon="reload" style="margin-left: 8px">重置</a-button>
|
|
|
+ <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
|
|
|
</span>
|
|
|
</a-col>
|
|
|
+
|
|
|
</a-row>
|
|
|
</a-form>
|
|
|
- </div> -->
|
|
|
-
|
|
|
- <!-- 操作按钮区域 -->
|
|
|
- <div class="table-operator" style="float:right">
|
|
|
- <!-- <a-button @click="handleAddElse" type="primary" icon="plus">新增</a-button> -->
|
|
|
- <a-dropdown :trigger="['click']">
|
|
|
- <a class="ant-dropdown-link" @click="e => e.preventDefault()">
|
|
|
- Click me
|
|
|
- <a-icon type="down" />
|
|
|
- </a>
|
|
|
+ </div>
|
|
|
+ <div style="float:right;margin:0 0 20px 20px">
|
|
|
+ <a-upload name="file" :multiple="false" :action="uploadAction" :headers="tokenHeader" :showUploadList="false"
|
|
|
+ :beforeUpload="beforeUpload" @change="handleChange" style="margin-right:20px">
|
|
|
+ <a-button :disabled="loadingElse">
|
|
|
+ <a-icon type="upload" />
|
|
|
+ {{loadingElse?'上传中,请稍后':'文件上传'}}
|
|
|
+ </a-button>
|
|
|
+ </a-upload>
|
|
|
+ <a-dropdown placement="bottomRight">
|
|
|
+ <a-button>新增</a-button>
|
|
|
<a-menu slot="overlay">
|
|
|
- <a-menu-item key="0">
|
|
|
- <a href="http://www.alipay.com/">1st menu item</a>
|
|
|
+ <a-menu-item>
|
|
|
+ <a-icon type="file-word" /><span style="text-align: center" @click="creatWps('word')">文字文档</span>
|
|
|
</a-menu-item>
|
|
|
- <a-menu-item key="1">
|
|
|
- <a href="http://www.taobao.com/">2nd menu item</a>
|
|
|
+ <a-menu-item>
|
|
|
+ <a-icon type="file-excel" /><span style="text-align: center" @click="creatWps('excel')">表格文档</span>
|
|
|
</a-menu-item>
|
|
|
- <a-menu-divider />
|
|
|
- <a-menu-item key="3">
|
|
|
- 3rd menu item
|
|
|
+ <a-menu-item>
|
|
|
+ <a-icon type="file-ppt" /><span style="text-align: center" @click="creatWps('ppt')">演示文档</span>
|
|
|
</a-menu-item>
|
|
|
+
|
|
|
+ <!-- <a-menu-item>
|
|
|
+ <a target="_blank" rel="noopener noreferrer" href="http://www.alipay.com/">1st menu item</a>
|
|
|
+ </a-menu-item>
|
|
|
+ <a-menu-item>
|
|
|
+ <a target="_blank" rel="noopener noreferrer" href="http://www.taobao.com/">2nd menu item</a>
|
|
|
+ </a-menu-item>
|
|
|
+ <a-menu-item>
|
|
|
+ <a target="_blank" rel="noopener noreferrer" href="http://www.tmall.com/">3rd menu item</a>
|
|
|
+ </a-menu-item> -->
|
|
|
</a-menu>
|
|
|
</a-dropdown>
|
|
|
</div>
|
|
|
-
|
|
|
- <!-- table区域-begin -->
|
|
|
+ <div style="clear:both"></div>
|
|
|
<div>
|
|
|
- <a-table ref="table" size="middle" bordered rowKey="id" :columns="columns" :dataSource="dataSource"
|
|
|
+ <a-table ref="table" size="middle" bordered rowKey="name" :columns="columns" :dataSource="dataSource"
|
|
|
:pagination="ipagination" :loading="loading" @change="handleTableChange">
|
|
|
+ <span slot="modifyTime" slot-scope="text">{{text|getDate}}</span>
|
|
|
+ <span slot="size" slot-scope="text">{{text|sizeShow}}</span>
|
|
|
+ <span slot="projectId_dictText" slot-scope="text">{{text?text:'-'}}</span>
|
|
|
<span slot="action" slot-scope="text, record">
|
|
|
- <a @click="handleEdit(record)">编辑</a>
|
|
|
-
|
|
|
+ <a @click="getViewUrlDbPath(record)">编辑</a>
|
|
|
+ <a-divider type="vertical" />
|
|
|
+ <a @click="bindProject(record)">项目绑定</a>
|
|
|
<a-divider type="vertical" />
|
|
|
<a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
|
|
|
<a>删除</a>
|
|
|
</a-popconfirm>
|
|
|
</span>
|
|
|
- </a-table>
|
|
|
- <a-modal title="新建文件" v-model="visible" @ok="handleSubmit" :width="800"
|
|
|
- :okButtonProps="{ props: { disabled: false } }" :cancelButtonProps="{ props: { disabled: false } }">
|
|
|
|
|
|
- </a-modal>
|
|
|
+ </a-table>
|
|
|
</div>
|
|
|
+ <!-- <div id="show"></div> -->
|
|
|
+ <a-modal :maskClosable="false" :title="type=='add'?'脚本新建':'脚本编辑'" v-model="visibleBind" :width="1200"
|
|
|
+ :footer="null">
|
|
|
+
|
|
|
+ <iframe :src="src" frameborder="0" style="width:100%;height:600px" v-if="type=='add'"></iframe>
|
|
|
+ <div id="showWps" style="height:600px" v-show="type=='edit'"></div>
|
|
|
+
|
|
|
+
|
|
|
+ </a-modal>
|
|
|
+ <a-modal :maskClosable="false" title="绑定项目" v-model="visibleProject" @ok="handleOk">
|
|
|
+ <span>项目选择:</span>
|
|
|
+ <a-select v-model="projectId" showSearch style="width:300px" optionFilterProp="children"
|
|
|
+ :filterOption="filterOption">
|
|
|
+ <a-select-option :value="item.projectId" v-for="item of dataElse" :key="item.id">
|
|
|
+ {{ item.projectName }} {{
|
|
|
+ item.mediaId == "1" ? '头条' :item.mediaId == "2"? '快手':item.mediaId == "3"?'头条内广':'快手内广'
|
|
|
+ }} {{ item.advertiserName }}
|
|
|
+ </a-select-option>
|
|
|
+ </a-select>
|
|
|
+ </a-modal>
|
|
|
<!-- table区域-end -->
|
|
|
|
|
|
<!-- 表单区域 -->
|
|
|
- <j-select-user ref="userForm" @ok="modalFormOk"></j-select-user>
|
|
|
+ <wpsFile-modal ref="modalForm" @ok="modalFormOk"></wpsFile-modal>
|
|
|
+
|
|
|
</a-card>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import {
|
|
|
- JeecgListMixin
|
|
|
- } from '@/mixins/JeecgListMixin'
|
|
|
- import JTreeSelect from '@/components/jeecg/JTreeSelect'
|
|
|
- import AFormItem from 'ant-design-vue/es/form/FormItem'
|
|
|
- import JSelectDepart from '@/components/jeecgbiz/JSelectDepart'
|
|
|
- import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
|
|
|
- import JSelectUser from '@/components/jeecgbiz/JSelectUser'
|
|
|
- // import { postAction } from '../../../api/manage'
|
|
|
- import {
|
|
|
getAction,
|
|
|
postAction,
|
|
|
postFile,
|
|
|
- deleteAction
|
|
|
+ deleteAction,
|
|
|
+ putAction
|
|
|
} from '@/api/manage'
|
|
|
+ import selectTable from '@/views/modules/Statistics/components/selecTable.vue'
|
|
|
+ import WpsFileModal from './modules/WpsFileModal'
|
|
|
import {
|
|
|
- mapActions,
|
|
|
mapGetters
|
|
|
} from 'vuex'
|
|
|
-
|
|
|
+ import {
|
|
|
+ JeecgListMixin
|
|
|
+ } from '@/mixins/JeecgListMixin'
|
|
|
+ import qs from 'qs';
|
|
|
+ const fileSuffix = [
|
|
|
+ 'xls', 'xlt', 'et', 'xlsx', 'xltx', 'csv', 'xlsm', 'xltm',
|
|
|
+ 'doc', 'dot', 'wps', 'wpt', 'docx', 'dotx', 'docm', 'dotm',
|
|
|
+ 'ppt', 'pptx', 'pptm', 'ppsx', 'ppsm', 'pps', 'potx', 'potm', 'dpt', 'dps',
|
|
|
+ 'pdf'
|
|
|
+ ];
|
|
|
export default {
|
|
|
- name: 'AdvertiserList',
|
|
|
+ name: "WpsFileList",
|
|
|
mixins: [JeecgListMixin],
|
|
|
components: {
|
|
|
- AFormItem,
|
|
|
- JTreeSelect,
|
|
|
- JSelectUserByDep,
|
|
|
- JSelectDepart,
|
|
|
- JSelectUser
|
|
|
+ WpsFileModal,
|
|
|
+ selectTable
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
- departDisabled: false, //是否是我的部门调用该页面
|
|
|
- users: this.userInfo().realname, //用户名称
|
|
|
- departmentId: this.userInfo().departId, //部门id
|
|
|
- description: '广告主信息表管理页面',
|
|
|
- visible: false,
|
|
|
- accountName: '',
|
|
|
- password: '',
|
|
|
- mode: 'login',
|
|
|
- showLogin: true,
|
|
|
- showAuthorization: false,
|
|
|
- authorizationType: 'kuaishou',
|
|
|
- loginType: 'kuaishou',
|
|
|
- form: this.$form.createForm(this),
|
|
|
+ description: 'wps文件管理页面',
|
|
|
+ dataElse: [],
|
|
|
+ projectId: '',
|
|
|
+ visibleProject: false,
|
|
|
// 表头
|
|
|
+ visibleBind: false,
|
|
|
+ wpsType: 'word',
|
|
|
+ type: "add",
|
|
|
+ uploadAction: "https://trac.tjyourong.com.cn/ctop/wpsFile/uploadFile",
|
|
|
columns: [{
|
|
|
title: '脚本名称',
|
|
|
- align: 'center',
|
|
|
+ align: "center",
|
|
|
dataIndex: 'name'
|
|
|
},
|
|
|
{
|
|
|
- title: '分类',
|
|
|
- align: 'center',
|
|
|
- dataIndex: 'industryId_dictText'
|
|
|
+ title: '文件大小(KB)',
|
|
|
+ align: "center",
|
|
|
+ dataIndex: 'size',
|
|
|
+ scopedSlots: {
|
|
|
+ customRender: 'size'
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
- title: '项目名称',
|
|
|
- align: 'center',
|
|
|
- dataIndex: 'contact'
|
|
|
+ title: '绑定项目',
|
|
|
+ align: "center",
|
|
|
+ dataIndex: 'projectId_dictText',
|
|
|
+ scopedSlots: {
|
|
|
+ customRender: 'projectId_dictText'
|
|
|
+ },
|
|
|
},
|
|
|
{
|
|
|
- title: '上传人',
|
|
|
- align: 'center',
|
|
|
- dataIndex: 'mobile'
|
|
|
+ title: '创建人',
|
|
|
+ align: "center",
|
|
|
+ dataIndex: 'creator_dictText'
|
|
|
},
|
|
|
{
|
|
|
title: '发布时间',
|
|
|
- align: 'center',
|
|
|
- dataIndex: 'email'
|
|
|
+ align: "center",
|
|
|
+ dataIndex: 'modifyTime',
|
|
|
+ scopedSlots: {
|
|
|
+ customRender: 'modifyTime'
|
|
|
+ },
|
|
|
},
|
|
|
-
|
|
|
{
|
|
|
title: '操作',
|
|
|
dataIndex: 'action',
|
|
|
- align: 'center',
|
|
|
+ align: "center",
|
|
|
scopedSlots: {
|
|
|
customRender: 'action'
|
|
|
- }
|
|
|
+ },
|
|
|
}
|
|
|
],
|
|
|
url: {
|
|
|
- list: '/ctop/wpsFile/list',
|
|
|
- delete: '/ctop/advertiser/delete',
|
|
|
- deleteBatch: '/ctop/advertiser/deleteBatch',
|
|
|
- exportXlsUrl: 'ctop/advertiser/exportXls',
|
|
|
- importExcelUrl: 'ctop/advertiser/importExcel',
|
|
|
- bindAccountLoginUrl: '/ctop/bindAccountLogin/login',
|
|
|
- bindAuthorizationUrl: '/ctop/bindAccountAuth/authorization',
|
|
|
- getLoginInfo: '/ctop/bindAccount/getLoginInfo',
|
|
|
- userId: '/sys/user/generateUserId', // 引入生成添加用户情况下的url
|
|
|
- userWithDepart: '/sys/user/userDepartList' // 引入为指定用户查看部门信息需要的url
|
|
|
- }
|
|
|
+ list: "/ctop/wpsFile/list",
|
|
|
+ delete: "/ctop/wpsFile/delete",
|
|
|
+ deleteBatch: "/ctop/wpsFile/deleteBatch",
|
|
|
+ exportXlsUrl: "ctop/wpsFile/exportXls",
|
|
|
+ importExcelUrl: "ctop/wpsFile/importExcel",
|
|
|
+ },
|
|
|
+ src: "",
|
|
|
+ loadingElse: false,
|
|
|
+ fileId: '',
|
|
|
+ loadingOk: false,
|
|
|
+ options: []
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
importExcelUrl: function () {
|
|
|
- return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
|
|
|
+ return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ visibleBind(n, o) {
|
|
|
+ if (!n) {
|
|
|
+ this.src = ''
|
|
|
+ this.loadData(1)
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
- created() {
|
|
|
- this.queryParam.userId = this.userInfo().id
|
|
|
+ filters: {
|
|
|
+ getDate(value) {
|
|
|
+ let date = new Date(value)
|
|
|
+ let y = date.getFullYear()
|
|
|
+ let MM = date.getMonth() + 1
|
|
|
+ MM = MM < 10 ? '0' + MM : MM
|
|
|
+ let d = date.getDate()
|
|
|
+ d = d < 10 ? '0' + d : d
|
|
|
+ return y + '-' + MM + '-' + d
|
|
|
+ },
|
|
|
+ sizeShow(value) {
|
|
|
+ return (value / 1024).toFixed(2)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.getParticipateList()
|
|
|
+ getAction('/sys/user/getAllUserList', '').then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ this.options = res.result
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
methods: {
|
|
|
+ filterOption(input, option) {
|
|
|
+ return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
|
|
|
+ },
|
|
|
...mapGetters(['nickname', 'avatar', 'userInfo']),
|
|
|
- handleAddElse() {
|
|
|
-
|
|
|
+ getParticipateList() {
|
|
|
+ getAction('/ctop/projectMember/participateList', {
|
|
|
+ userId: this.userInfo().id
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 0) {
|
|
|
+ this.dataElse = res.result
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
- searchRe() {
|
|
|
- this.queryParam.name = ''
|
|
|
- this.queryParam.industryId = ''
|
|
|
- this.loadData()
|
|
|
+ beforeUpload(file) {
|
|
|
+ this.loadingElse = true
|
|
|
+ const size = (Number(file.size) / (1024 * 1024)).toFixed(2);
|
|
|
+ const fileName = file.name;
|
|
|
+ const fileStrArr = fileName.split(".");
|
|
|
+ const suffix = fileStrArr[fileStrArr.length - 1];
|
|
|
+
|
|
|
+ let result = fileSuffix.some((item) => {
|
|
|
+ return item === suffix
|
|
|
+ });
|
|
|
+
|
|
|
+ if (!result) {
|
|
|
+ this.$message.error("不支持该文件类型");
|
|
|
+ this.loadingElse = false
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (size > 10) {
|
|
|
+ this.$message.error("文件不能大于10MB");
|
|
|
+ this.loadingElse = false
|
|
|
+ return false;
|
|
|
+ }
|
|
|
},
|
|
|
- handleSubmit() {
|
|
|
- let params = {}
|
|
|
- params.advertiserId = this.record.id
|
|
|
- params.advertiser_name = this.record.name
|
|
|
- params.userId = this.userInfo().id
|
|
|
- params.userName = this.userInfo().realname
|
|
|
- params.projectId = this.record.projectId
|
|
|
- params.projectName = this.record.projectName
|
|
|
+ handleChange(info) {
|
|
|
|
|
|
- // 触发表单验证
|
|
|
- this.form.validateFields(err => {
|
|
|
- if (!err) {
|
|
|
- if (this.mode == 'login') {
|
|
|
- params.accountName = this.accountName
|
|
|
- params.password = this.password
|
|
|
- params.loginType = this.loginType
|
|
|
- if (this.loginType == 'kuaishou') {
|
|
|
- params.mediaId = 2
|
|
|
- } else if (this.loginType == 'bytedance') {
|
|
|
- params.mediaId = 1
|
|
|
- }
|
|
|
- postAction(this.url.bindAccountLoginUrl, params).then(res => {
|
|
|
- if (res.success) {
|
|
|
- alert('绑定成功')
|
|
|
- this.accountName = ''
|
|
|
- this.password = ''
|
|
|
- this.loginType = ''
|
|
|
- } else {
|
|
|
- alert(res.message)
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- // 授权登录
|
|
|
- if (this.mode == 'authorization') {
|
|
|
- params.authorizationType = this.authorizationType
|
|
|
- if (this.authorizationType == 'kuaishou') {
|
|
|
- params.mediaId = 2
|
|
|
- } else if (this.authorizationType == 'bytedance') {
|
|
|
- params.mediaId = 1
|
|
|
- }
|
|
|
- postAction(this.url.bindAuthorizationUrl, params).then(res => {
|
|
|
- if (res.success) {
|
|
|
- window.open(res.message, '_blank')
|
|
|
- } else {
|
|
|
- alert('绑定失败')
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
+ if (info.file.status !== 'uploading') {
|
|
|
+ console.log(info.file, info.fileList);
|
|
|
+ }
|
|
|
+ if (info.file.status === 'done') {
|
|
|
+ this.$message.success(`${info.file.name} 上传成功`);
|
|
|
+ this.loadingElse = false
|
|
|
+ this.loadData(1)
|
|
|
+ } else if (info.file.status === 'error') {
|
|
|
+ this.$message.error(`${info.file.name} file upload failed.`);
|
|
|
+ this.loadingElse = false
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleOk(e) {
|
|
|
+ this.loadingOk = true
|
|
|
+ var params = qs.stringify({
|
|
|
+ projectId: this.projectId,
|
|
|
+ fileId: this.fileId
|
|
|
+ })
|
|
|
+ postAction('/ctop/wpsFile/bindProject', params).then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ this.visibleProject = false
|
|
|
+ this.projectId = ""
|
|
|
+ this.loadingOk = false
|
|
|
+ this.loadData()
|
|
|
+ } else {
|
|
|
+ this.$message.error('绑定失败')
|
|
|
+ this.loadingOk = false
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ creatWps(type) {
|
|
|
+ console.log(type)
|
|
|
+ this.visibleBind = true
|
|
|
+ this.wpsType = type
|
|
|
+ this.type = 'add'
|
|
|
+ getAction('/ctop/wpsFile/createTemplateFile', {
|
|
|
+ template: type
|
|
|
+ }).then(res => {
|
|
|
+ console.log(res)
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.src = res.msg;
|
|
|
+ console.log(this.src)
|
|
|
+ } else {
|
|
|
+ this.$message.error('请求错误!')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // getCreateFilePath({
|
|
|
+ // template: type
|
|
|
+ // }).then(res => {
|
|
|
+ // console.log(res)
|
|
|
+ // // if (res.data.data){
|
|
|
+ // this.src = res.data.msg;
|
|
|
+ // // }else {
|
|
|
+ // // this.showErrMeg('请求错误!');
|
|
|
+ // // }
|
|
|
+ // }).catch(() => {
|
|
|
+ // this.showErrMeg('请求错误!');
|
|
|
+ // });
|
|
|
|
|
|
- onChageLogin() {
|
|
|
- console.log(this.mode)
|
|
|
- if (this.mode == 'login') {
|
|
|
- this.showLogin = true
|
|
|
- this.showAuthorization = false
|
|
|
- } else {
|
|
|
- this.showLogin = false
|
|
|
- this.showAuthorization = true
|
|
|
- }
|
|
|
},
|
|
|
- showModal(record) {
|
|
|
- this.record = record
|
|
|
- this.visible = true
|
|
|
+
|
|
|
+ bindProject(item) {
|
|
|
+ this.visibleProject = true
|
|
|
+ this.projectId = ''
|
|
|
+ this.fileId = item.id
|
|
|
+ // this.getParticipateList()
|
|
|
},
|
|
|
+ getViewUrlDbPath(item) {
|
|
|
+ // this.loading = true;
|
|
|
+ const params = {
|
|
|
+ fileId: item.id,
|
|
|
+ userId: item.creator
|
|
|
+ };
|
|
|
+ getAction('/v1/api/file/getViewUrlDbPath', params).then((res) => {
|
|
|
+ console.log(res)
|
|
|
+ if (res.data) {
|
|
|
+ let r = res.data;
|
|
|
+ this.visibleBind = true
|
|
|
+ // this.src = r.wpsUrl;
|
|
|
+ this.type = 'edit'
|
|
|
+ this.openWps(r.wpsUrl, r.token)
|
|
|
|
|
|
- handleCancel() {
|
|
|
- this.close()
|
|
|
+ } else {
|
|
|
+ this.$message.error('请求错误')
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ openWps(url, token) {
|
|
|
+
|
|
|
+ this.$nextTick(() => {
|
|
|
+ let _this = this;
|
|
|
+ const wps = _this.wps.config({
|
|
|
+ mode: 'simple',
|
|
|
+ mount: document.querySelector('#showWps'),
|
|
|
+ wpsUrl: url,
|
|
|
+ });
|
|
|
+ wps.setToken({
|
|
|
+ "token": token
|
|
|
+ });
|
|
|
+ let app = wps.Application;
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
}
|