|
@@ -21,9 +21,9 @@
|
|
|
}
|
|
|
</style>
|
|
|
<style lang="scss" scoped>
|
|
|
-.home-item {
|
|
|
- overflow: hidden;
|
|
|
-}
|
|
|
+// .home-item {
|
|
|
+// overflow: hidden;
|
|
|
+// }
|
|
|
|
|
|
@media (min-width: 1024px) {
|
|
|
.home-item {
|
|
@@ -166,38 +166,7 @@ a {
|
|
|
<a-row :gutter="24">
|
|
|
<a-col :md="8" :sm="8">
|
|
|
<selectTable :projectId.sync="queryParam.projectId"></selectTable>
|
|
|
- <!-- <a-form-item label="项目名称">
|
|
|
- <a-select
|
|
|
- placeholder="请输入项目名称"
|
|
|
- showSearch
|
|
|
- optionFilterProp="children"
|
|
|
- :filterOption="filterOption"
|
|
|
- v-model="queryParam.projectId"
|
|
|
- @change="getList"
|
|
|
- >
|
|
|
- <a-select-option :value="item.projectId" v-for="item of dataElse" :key="item.id">
|
|
|
- {{ item.projectName }} {{
|
|
|
- item.mediaId == '1' ? '头条' : '快手'
|
|
|
- }} {{ item.advertiserName }}
|
|
|
- </a-select-option>
|
|
|
- </a-select>
|
|
|
- </a-form-item> -->
|
|
|
- </a-col>
|
|
|
- <!-- <a-col :md="6" :sm="8">
|
|
|
- <a-form-item label="剪辑">
|
|
|
- <a-input placeholder="请输入剪辑者名称" v-model="queryParam.advertiserId"></a-input>
|
|
|
- </a-form-item>
|
|
|
- </a-col>
|
|
|
- <a-col :md="6" :sm="8">
|
|
|
- <a-form-item label="编导">
|
|
|
- <a-input placeholder="请输入编导" v-model="queryParam.responsible"></a-input>
|
|
|
- </a-form-item>
|
|
|
</a-col>
|
|
|
- <a-col :md="6" :sm="8">
|
|
|
- <a-form-item label="拍摄">
|
|
|
- <a-input placeholder="请输入拍摄" v-model="queryParam.responsible"></a-input>
|
|
|
- </a-form-item>
|
|
|
- </a-col> -->
|
|
|
<a-col :md="8" :sm="8">
|
|
|
<a-form-item label="时间选择">
|
|
|
<!-- <a-date-picker v-model="queryParam.createTime" format="YYYY-MM-DD" style="width:100%" /> -->
|
|
@@ -218,27 +187,13 @@ a {
|
|
|
<!-- <div> -->
|
|
|
|
|
|
<div class="table-operator" style="position:relative;z-index:100">
|
|
|
- <a-button @click="visible = true" type="primary" icon="plus">新增</a-button>
|
|
|
+ <!-- <a-button @click="visible = true" type="primary" icon="plus">新增</a-button> -->
|
|
|
<a-button @click="onCheckAllChange" v-if="queryParam.projectId && active == '1'">{{
|
|
|
checkAll ? '取消 ( ' + checkArr.length + ' )' : '全选'
|
|
|
}}</a-button>
|
|
|
<a-button v-if="queryParam.projectId && active == '1'" :disabled="checkArr.length == 0" @click="tongbu"
|
|
|
>一键下载
|
|
|
</a-button>
|
|
|
- <a-button
|
|
|
- v-if="
|
|
|
- queryParam.projectId &&
|
|
|
- active == '1' &&
|
|
|
- (role.roleCode == 'operator' ||
|
|
|
- role.roleCode == 'kuaishouOperationManager' ||
|
|
|
- role.roleCode == 'admin' ||
|
|
|
- role.roleCode == 'operationAssistant' ||
|
|
|
- role.roleCode == 'touTiaoOperationManager')
|
|
|
- "
|
|
|
- :disabled="checkArr.length == 0"
|
|
|
- @click="tongbuImage"
|
|
|
- >一键同步</a-button
|
|
|
- >
|
|
|
</div>
|
|
|
<a-tabs @change="callbackTwo" v-model="active" id="material-card" type="card">
|
|
|
<a-tab-pane :tab="item.tab" v-for="item of examinelList" :key="item.value">
|
|
@@ -299,65 +254,12 @@ a {
|
|
|
<a
|
|
|
href="javascript:;"
|
|
|
style="margin-left:20px"
|
|
|
- @click="edit(items, '2')"
|
|
|
+ @click="imageEdit(items, '2')"
|
|
|
v-show="active == '2'"
|
|
|
v-if="items.userId == userInfo().id"
|
|
|
>
|
|
|
修改</a
|
|
|
>
|
|
|
- <a-popconfirm
|
|
|
- @confirm="okEditShow(items, '2')"
|
|
|
- v-show="active != '2'"
|
|
|
- v-if="
|
|
|
- role.roleCode == 'operator' ||
|
|
|
- role.roleCode == 'kuaishouOperationManager' ||
|
|
|
- role.roleCode == 'admin' ||
|
|
|
- role.roleCode == 'touTiaoOperationManager'
|
|
|
- "
|
|
|
- >
|
|
|
- <div slot="title">
|
|
|
- <div>
|
|
|
- 驳回原因:
|
|
|
- <a-textarea
|
|
|
- placeholder="请输入原因"
|
|
|
- v-model="refuseReason"
|
|
|
- :autosize="{ minRows: 3, maxRows: 10 }"
|
|
|
- />
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- 截图:
|
|
|
- <upload-to-ali
|
|
|
- v-model="refuseFile"
|
|
|
- :customDomain="customDomain"
|
|
|
- multiple
|
|
|
- preview
|
|
|
- :region="region"
|
|
|
- :bucket="bucket"
|
|
|
- :accept="acceptImage"
|
|
|
- :max="10"
|
|
|
- :size="1024000"
|
|
|
- :accessKeyId="accessKeyId"
|
|
|
- :accessKeySecret="accessKeySecret"
|
|
|
- :dir="dirImg"
|
|
|
- ></upload-to-ali>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <a href="javascript:;" style="margin-left:20px">驳回</a>
|
|
|
- </a-popconfirm>
|
|
|
- <a
|
|
|
- @click="okEditShow(items, '1')"
|
|
|
- href="javascript:;"
|
|
|
- style="margin-left:20px"
|
|
|
- v-show="active != '1'"
|
|
|
- v-if="
|
|
|
- role.roleCode == 'operator' ||
|
|
|
- role.roleCode == 'kuaishouOperationManager' ||
|
|
|
- role.roleCode == 'admin' ||
|
|
|
- role.roleCode == 'touTiaoOperationManager'
|
|
|
- "
|
|
|
- >
|
|
|
- 通过审核</a
|
|
|
- >
|
|
|
|
|
|
<a-checkbox :value="items.url" v-show="active == '1'" style="float:right"></a-checkbox>
|
|
|
</span>
|
|
@@ -387,43 +289,18 @@ a {
|
|
|
<a-button
|
|
|
key="submit"
|
|
|
type="primary"
|
|
|
- :disabled="material.filter(item => item == false).length > 0 || urlList.url.length == 0"
|
|
|
+ :disabled="material.filter(item => item == false).length > 0 || urlList.url == ''"
|
|
|
@click="handleOk"
|
|
|
>
|
|
|
确定
|
|
|
</a-button>
|
|
|
</template>
|
|
|
<a-form :form="form">
|
|
|
- <a-form-item :label-col="labelCol" :wrapper-col="wrapperCol" label="项目选择">
|
|
|
- <a-select
|
|
|
- v-decorator="[
|
|
|
- 'projectId', // 给表单赋值或拉取表单时,该input对应的key
|
|
|
- { rules: [{ required: true, message: '请选择项目!' }] }
|
|
|
- ]"
|
|
|
- @change="getProjectId"
|
|
|
- showSearch
|
|
|
- optionFilterProp="children"
|
|
|
- :filterOption="filterOption"
|
|
|
- >
|
|
|
- <a-select-option :value="item.projectId" v-for="item of dataElse" :key="item.id">
|
|
|
- {{ item.projectName }} {{
|
|
|
- item.mediaId == '1' ? '头条' : '快手'
|
|
|
- }} {{ item.advertiserName }}
|
|
|
- </a-select-option>
|
|
|
- </a-select>
|
|
|
- </a-form-item>
|
|
|
- <a-form-item
|
|
|
- :label-col="labelCol"
|
|
|
- :wrapper-col="wrapperCol"
|
|
|
- label="图片素材上传"
|
|
|
- class="add-image-material"
|
|
|
- v-if="getData('projectId')"
|
|
|
- >
|
|
|
+ <a-form-item :label-col="labelCol" :wrapper-col="wrapperCol" label="图片素材上传" class="add-image-material">
|
|
|
<upload-to-ali
|
|
|
style="width:160%"
|
|
|
v-model="urlList.url"
|
|
|
:customDomain="customDomain"
|
|
|
- :multiple="add"
|
|
|
preview
|
|
|
:region="region"
|
|
|
:bucket="bucket"
|
|
@@ -436,70 +313,13 @@ a {
|
|
|
:dir="activeKey == 'image' ? dirImg : dirVideo"
|
|
|
@loaded="overUpload"
|
|
|
></upload-to-ali>
|
|
|
- <span v-if="material.filter(item => item == false).length > 0 && urlList.url.length > 0" style="color:red"
|
|
|
- >上传素材的尺寸不符,请修改(<span v-for="(item, index) of material" :key="index" v-show="!item"
|
|
|
- >第{{ index + 1 }}张</span
|
|
|
- >出错)</span
|
|
|
+ <span v-if="material.filter(item => item == false).length > 0 && urlList.url != ''" style="color:red"
|
|
|
+ >上传素材的尺寸不符,请修改</span
|
|
|
>
|
|
|
- <span
|
|
|
- v-else-if="urlList.url.length > 0 && material.filter(item => item == false).length == 0"
|
|
|
- style="color:green"
|
|
|
+ <span v-else-if="material.filter(item => item == false).length == 0 && urlList.url != ''" style="color:green"
|
|
|
>上传成功</span
|
|
|
>
|
|
|
</a-form-item>
|
|
|
-
|
|
|
- <a-form-item :label-col="labelCol" :wrapper-col="wrapperCol" :label="role.roleName">
|
|
|
- <span>{{ userInfo().realname }}</span>
|
|
|
- </a-form-item>
|
|
|
- <a-form-item
|
|
|
- :label-col="labelCol"
|
|
|
- :wrapper-col="{
|
|
|
- xs: { span: 24 },
|
|
|
- sm: { span: 18 }
|
|
|
- }"
|
|
|
- label="标签"
|
|
|
- >
|
|
|
- <template v-for="(tag, index) in tags">
|
|
|
- <a-tooltip v-if="tag.length > 20" :key="tag" :title="tag">
|
|
|
- <a-tag :key="tag" :closable="index !== 0" :afterClose="() => handleClose(tag)">
|
|
|
- {{ `${tag.slice(0, 20)}...` }}
|
|
|
- </a-tag>
|
|
|
- </a-tooltip>
|
|
|
- <a-tag v-else :key="tag" :closable="true" :afterClose="() => handleClose(tag)">
|
|
|
- {{ tag }}
|
|
|
- </a-tag>
|
|
|
- </template>
|
|
|
- <a-input
|
|
|
- v-if="inputVisible"
|
|
|
- ref="input"
|
|
|
- type="text"
|
|
|
- size="small"
|
|
|
- :style="{ width: '78px' }"
|
|
|
- :value="inputValue"
|
|
|
- @change="handleInputChange"
|
|
|
- @blur="handleInputConfirm"
|
|
|
- @keyup.enter="handleInputConfirm"
|
|
|
- />
|
|
|
- <a-tag v-else @click="showInput" style="background: #fff; borderStyle: dashed;">
|
|
|
- <a-icon type="plus" /> New Tag
|
|
|
- </a-tag>
|
|
|
- </a-form-item>
|
|
|
- <a-form-item
|
|
|
- :label-col="labelCol"
|
|
|
- :wrapper-col="{
|
|
|
- xs: { span: 24 },
|
|
|
- sm: { span: 18 }
|
|
|
- }"
|
|
|
- label="描述"
|
|
|
- >
|
|
|
- <a-textarea
|
|
|
- placeholder="请输入描述"
|
|
|
- v-decorator="[
|
|
|
- 'materialDescribe' // 给表单赋值或拉取表单时,该input对应的key
|
|
|
- ]"
|
|
|
- :autosize="{ minRows: 3, maxRows: 10 }"
|
|
|
- />
|
|
|
- </a-form-item>
|
|
|
</a-form>
|
|
|
</a-modal>
|
|
|
|
|
@@ -516,43 +336,30 @@ a {
|
|
|
<img :src="showUrl" alt="" v-if="activeKey == 'image'" style="height:100%" />
|
|
|
</div>
|
|
|
<div style="flex:3;padding:10px;box-sizing:border-box;">
|
|
|
+ <!-- <video
|
|
|
+ v-if="detail.videoUrl"
|
|
|
+ :src="detail.videoUrl"
|
|
|
+ style="height:200px;max-width:100%;position:absolute;z-index:10;"
|
|
|
+ /> -->
|
|
|
+
|
|
|
<a-form v-if="detail" class="detail">
|
|
|
- <div v-if="detail.parameter">
|
|
|
- <a-form-item
|
|
|
- label="尺寸"
|
|
|
- :label-col="{ span: 6 }"
|
|
|
- :wrapper-col="{ span: 18 }"
|
|
|
- v-if="detail.parameter.width"
|
|
|
- >
|
|
|
- {{ detail.parameter.width }}*{{ detail.parameter.height }}
|
|
|
- </a-form-item>
|
|
|
- <a-form-item
|
|
|
- label="大小"
|
|
|
- :label-col="{ span: 6 }"
|
|
|
- :wrapper-col="{ span: 18 }"
|
|
|
- v-if="detail.parameter.size"
|
|
|
- >
|
|
|
- {{ detail.parameter.size }}
|
|
|
- </a-form-item>
|
|
|
- </div>
|
|
|
- <div v-if="detail.ascription">
|
|
|
- <a-form-item
|
|
|
- label="剪辑"
|
|
|
- :label-col="{ span: 6 }"
|
|
|
- :wrapper-col="{ span: 18 }"
|
|
|
- v-if="detail.ascription.clipName"
|
|
|
+ <a-form-item label="绑定视频" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" v-if="detail.videoUrl">
|
|
|
+ <video
|
|
|
+ class="video"
|
|
|
+ :src="detail.videoUrl"
|
|
|
+ controls="controls"
|
|
|
+ style="width:150px"
|
|
|
+ controlsList="nodownload"
|
|
|
>
|
|
|
- {{ detail.ascription.clipName }}
|
|
|
- </a-form-item>
|
|
|
- <a-form-item
|
|
|
- label="平面"
|
|
|
- :label-col="{ span: 6 }"
|
|
|
- :wrapper-col="{ span: 18 }"
|
|
|
- v-if="detail.ascription.planeName"
|
|
|
- >
|
|
|
- {{ detail.ascription.planeName }}
|
|
|
- </a-form-item>
|
|
|
- </div>
|
|
|
+ 您的浏览器不支持 video 标签。
|
|
|
+ </video>
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="尺寸" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" v-if="detail.width">
|
|
|
+ {{ detail.width }}*{{ detail.height }}
|
|
|
+ </a-form-item>
|
|
|
+ <a-form-item label="大小" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" v-if="detail.size">
|
|
|
+ {{ detail.size }}
|
|
|
+ </a-form-item>
|
|
|
<a-form-item label="标签" :label-col="{ span: 6 }" :wrapper-col="{ span: 18 }" v-if="detail.tag">
|
|
|
<a-tag v-for="(item, index) of detail.tag" :key="index">{{ item }}</a-tag>
|
|
|
</a-form-item>
|
|
@@ -587,53 +394,6 @@ a {
|
|
|
></upload-to-ali>
|
|
|
<div v-else>无截图</div>
|
|
|
</a-form-item>
|
|
|
- <a-form-item
|
|
|
- label="审核"
|
|
|
- :label-col="{ span: 6 }"
|
|
|
- :wrapper-col="{ span: 18 }"
|
|
|
- v-if="
|
|
|
- active != '2' &&
|
|
|
- (role.roleCode == 'operator' ||
|
|
|
- role.roleCode == 'kuaishouOperationManager' ||
|
|
|
- role.roleCode == 'admin' ||
|
|
|
- role.roleCode == 'touTiaoOperationManager')
|
|
|
- "
|
|
|
- >
|
|
|
- <a-button type="primary" @click="edit(null, '0', '1')" v-if="active == '0'" style="margin-right:10px"
|
|
|
- >通过审核
|
|
|
- </a-button>
|
|
|
- <a-popconfirm @confirm="okEdit">
|
|
|
- <div slot="title">
|
|
|
- <div>
|
|
|
- 驳回原因:
|
|
|
- <a-textarea
|
|
|
- placeholder="请输入原因"
|
|
|
- v-model="refuseReason"
|
|
|
- :autosize="{ minRows: 3, maxRows: 10 }"
|
|
|
- />
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- 截图:
|
|
|
- <upload-to-ali
|
|
|
- v-model="refuseFile"
|
|
|
- :customDomain="customDomain"
|
|
|
- multiple
|
|
|
- preview
|
|
|
- :region="region"
|
|
|
- :bucket="bucket"
|
|
|
- :accept="acceptImage"
|
|
|
- :max="10"
|
|
|
- :size="1024000"
|
|
|
- :accessKeyId="accessKeyId"
|
|
|
- :accessKeySecret="accessKeySecret"
|
|
|
- :dir="dirImg"
|
|
|
- ></upload-to-ali>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <a-button type="primary">驳回</a-button>
|
|
|
- <!-- @click="edit(null, '0', '2')" -->
|
|
|
- </a-popconfirm>
|
|
|
- </a-form-item>
|
|
|
</a-form>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -648,7 +408,7 @@ import { JeecgListMixin } from '@/mixins/JeecgListMixin'
|
|
|
import JEllipsis from '@/components/jeecg/JEllipsis'
|
|
|
import UploadToAli from '@femessage/upload-to-ali'
|
|
|
import { fileCheck, fileInsert, fileEdit } from '@/api/actor'
|
|
|
-import { getAction, postAction, postFile, downFile, downFilePost, deleteAction } from '@/api/manage'
|
|
|
+import { getAction, postAction, postFile, downFile, downFilePost, deleteAction, putAction } from '@/api/manage'
|
|
|
|
|
|
import { mapGetters } from 'vuex'
|
|
|
import moment from 'moment'
|
|
@@ -670,6 +430,8 @@ export default {
|
|
|
|
|
|
data() {
|
|
|
return {
|
|
|
+ projectId: '',
|
|
|
+ videoId: '',
|
|
|
inputVisible: false,
|
|
|
inputValue: '',
|
|
|
labelCol: {
|
|
@@ -719,9 +481,12 @@ export default {
|
|
|
// 表头
|
|
|
columns: [],
|
|
|
urlList: {
|
|
|
- url: [],
|
|
|
- md5: [],
|
|
|
- name: []
|
|
|
+ url: '',
|
|
|
+ md5: '',
|
|
|
+ name: '',
|
|
|
+ size: '',
|
|
|
+ width: '',
|
|
|
+ height: ''
|
|
|
},
|
|
|
imageArr: [],
|
|
|
watermarkUrl: {
|
|
@@ -730,7 +495,7 @@ export default {
|
|
|
name: ''
|
|
|
},
|
|
|
url: {
|
|
|
- list: '/ctop/materialInfo/list'
|
|
|
+ list: '/ctop/MaterialImageInfo/pageList'
|
|
|
},
|
|
|
detail: false,
|
|
|
form: this.$form.createForm(this),
|
|
@@ -906,29 +671,6 @@ export default {
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- // for (var i = 0; i < this.checkArr.length; i++) {
|
|
|
- // let image = new Image()
|
|
|
- // image.setAttribute('crossOrigin', 'anonymous')
|
|
|
- // image.src = this.checkArr[i]
|
|
|
- // image.onload = () => {
|
|
|
- // let canvas = document.createElement('canvas')
|
|
|
- // canvas.width = image.width
|
|
|
- // canvas.height = image.height
|
|
|
- // let ctx = canvas.getContext('2d')
|
|
|
- // ctx.drawImage(image, 0, 0, image.width, image.height)
|
|
|
- // canvas.toBlob(blob => {
|
|
|
- // let url = URL.createObjectURL(blob)
|
|
|
- // let eleLink = document.createElement('a')
|
|
|
- // eleLink.download = '封面下载'
|
|
|
- // eleLink.href = url
|
|
|
- // eleLink.click()
|
|
|
- // eleLink.remove()
|
|
|
- // // 用完释放URL对象
|
|
|
- // URL.revokeObjectURL(url)
|
|
|
- // })
|
|
|
- // }
|
|
|
- // }
|
|
|
},
|
|
|
implement(data) {
|
|
|
var params = {}
|
|
@@ -1079,201 +821,49 @@ export default {
|
|
|
this.refuseReason = ''
|
|
|
this.refuseFile = []
|
|
|
}
|
|
|
- getAction('/ctop/materialInfo/getDetail', {
|
|
|
- materialId: item.id
|
|
|
+ getAction('/ctop/MaterialImageInfo/getDetail', {
|
|
|
+ id: item.id
|
|
|
}).then(res => {
|
|
|
- this.detail = res
|
|
|
+ this.detail = res.result
|
|
|
})
|
|
|
},
|
|
|
- okEditShow(item, editStatus) {
|
|
|
- if (editStatus == '2') {
|
|
|
- var params = {}
|
|
|
- params.id = item.id
|
|
|
- params.auditorId = this.userInfo().id
|
|
|
- params.refuseReason = this.refuseReason
|
|
|
- var data = this.refuseFile.map(item => {
|
|
|
- return 'https:' + item
|
|
|
- })
|
|
|
- params.refuseFile = JSON.stringify(data)
|
|
|
- params.status = editStatus
|
|
|
- fileEdit(params).then(res => {
|
|
|
- this.refuseFile = []
|
|
|
- this.refuseReason = ''
|
|
|
- this.loadData()
|
|
|
- })
|
|
|
- } else if (editStatus == '1') {
|
|
|
- var params = {}
|
|
|
- params.id = item.id
|
|
|
- params.auditorId = this.userInfo().id
|
|
|
- params.creativeCopywriter = this.refuseReason
|
|
|
- params.status = editStatus
|
|
|
- fileEdit(params).then(res => {
|
|
|
- this.refuseReason = ''
|
|
|
- this.loadData()
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
- okEdit(e) {
|
|
|
- this.edit(null, this.active, '2')
|
|
|
- },
|
|
|
- edit(item, status, editStatus) {
|
|
|
- if (status == '0' || status == '1') {
|
|
|
- if (editStatus == '2') {
|
|
|
- var params = {}
|
|
|
- params.id = this.id
|
|
|
- params.auditorId = this.userInfo().id
|
|
|
- params.refuseReason = this.refuseReason
|
|
|
- var data = this.refuseFile.map(item => {
|
|
|
- return 'https:' + item
|
|
|
- })
|
|
|
- params.refuseFile = JSON.stringify(data)
|
|
|
- params.status = editStatus
|
|
|
- fileEdit(params).then(res => {
|
|
|
- this.refuseFile = []
|
|
|
- this.refuseReason = ''
|
|
|
- this.loadData()
|
|
|
- this.visibleDetail = false
|
|
|
- })
|
|
|
- } else {
|
|
|
- fileEdit({
|
|
|
- id: this.id,
|
|
|
- status: editStatus,
|
|
|
- auditorId: this.userInfo().id
|
|
|
- }).then(res => {
|
|
|
- this.refuseFile = []
|
|
|
- this.refuseReason = ''
|
|
|
- this.loadData()
|
|
|
- this.visibleDetail = false
|
|
|
- })
|
|
|
- }
|
|
|
- } else {
|
|
|
- this.add = false
|
|
|
- this.visible = true
|
|
|
- this.getProjectId(item.projectId)
|
|
|
- getAction('/ctop/materialInfo/getDetail', {
|
|
|
- materialId: item.id
|
|
|
- }).then(res => {
|
|
|
- if (this.activeKey == 'image') {
|
|
|
- this.form.setFieldsValue({
|
|
|
- projectId: item.projectId,
|
|
|
- clipId: res.ascription.clipId,
|
|
|
- planeId: res.ascription.planeId,
|
|
|
- materialDescribe: item.materialDescribe
|
|
|
- })
|
|
|
- } else {
|
|
|
- this.form.setFieldsValue({
|
|
|
- projectId: item.projectId,
|
|
|
- clipId: res.ascription.clipId,
|
|
|
- planId: res.ascription.planId,
|
|
|
- shotId: res.ascription.shotId,
|
|
|
- materialDescribe: item.materialDescribe
|
|
|
- })
|
|
|
- }
|
|
|
- this.tags = res.tag
|
|
|
- this.urlList.url = item.url
|
|
|
- this.urlList.md5 = item.code
|
|
|
- this.urlList.name = item.materialName
|
|
|
- this.watermarkUrl.url = item.watermarkUrl
|
|
|
- this.watermarkUrl.md5 = item.watermarkCode
|
|
|
- this.watermarkUrl.name = item.watermarkMaterialName
|
|
|
- this.id = item.id
|
|
|
- })
|
|
|
- }
|
|
|
+ imageEdit(item) {
|
|
|
+ this.projectId = item.id
|
|
|
+ this.videoId = item.videoId
|
|
|
+ this.visible = true
|
|
|
},
|
|
|
handleOk() {
|
|
|
this.form.validateFieldsAndScroll((err, values) => {
|
|
|
if (err) {
|
|
|
// 这里做逻辑处理
|
|
|
} else {
|
|
|
- var params = {}
|
|
|
- var roleCode = {}
|
|
|
- for (const key in this.role) {
|
|
|
- if (key == 'roleCode') {
|
|
|
- this.role[key] = this.role[key] + 'Id'
|
|
|
- roleCode[this.role[key]] = this.userInfo().id
|
|
|
- }
|
|
|
- }
|
|
|
- params.id = this.add ? null : this.id
|
|
|
- // params.code = this.urlList.md5
|
|
|
- params.url = this.add ? null : this.urlList.url[0]
|
|
|
- // params.materialName = this.urlList.name
|
|
|
- params.imageArr = this.add ? this.urlList.url : null
|
|
|
- // params.watermarkCode = this.watermarkUrl.md5
|
|
|
- // params.watermarkUrl = this.watermarkUrl.url
|
|
|
- // params.watermarkMaterialName = this.watermarkUrl.name
|
|
|
- params.userId = this.userInfo().id
|
|
|
- params.projectId = values.projectId
|
|
|
- params.materialDescribe = values.materialDescribe
|
|
|
- params.type = 'IMAGE'
|
|
|
- params.ascription =
|
|
|
- this.activeKey == 'image'
|
|
|
- ? roleCode
|
|
|
- : {
|
|
|
- planId: values.planId,
|
|
|
- shotId: values.shotId,
|
|
|
- clipId: values.clipId
|
|
|
- }
|
|
|
- params.tag = this.tags
|
|
|
- if (this.add) {
|
|
|
- fileInsert(params).then(res => {
|
|
|
- this.form.resetFields()
|
|
|
- this.urlList = {
|
|
|
- url: '',
|
|
|
- md5: '',
|
|
|
- name: ''
|
|
|
- }
|
|
|
- this.watermarkUrl = {
|
|
|
- url: '',
|
|
|
- md5: '',
|
|
|
- name: ''
|
|
|
- }
|
|
|
- this.tags = []
|
|
|
- this.loadData()
|
|
|
- this.visible = false
|
|
|
- this.add = true
|
|
|
- for (const key in this.role) {
|
|
|
- if (key == 'roleCode') {
|
|
|
- this.role[key] = this.role[key].substr(0, this.role[key].length - 2)
|
|
|
- }
|
|
|
- }
|
|
|
- this.$message.success('素材上传成功')
|
|
|
- })
|
|
|
- } else {
|
|
|
- fileEdit({
|
|
|
- ...params,
|
|
|
- status: '0'
|
|
|
- }).then(res => {
|
|
|
+ var params = { ...this.urlList }
|
|
|
+ params.id = this.projectId
|
|
|
+ params.videoId = this.videoId
|
|
|
+ params.status = '0'
|
|
|
+ putAction('/ctop/MaterialImageInfo/edit', params).then(res => {
|
|
|
+ if (res.success) {
|
|
|
this.form.resetFields()
|
|
|
this.urlList = {
|
|
|
- url: [],
|
|
|
- md5: '',
|
|
|
- name: ''
|
|
|
- }
|
|
|
- this.watermarkUrl = {
|
|
|
url: '',
|
|
|
md5: '',
|
|
|
- name: ''
|
|
|
+ name: '',
|
|
|
+ size: '',
|
|
|
+ width: '',
|
|
|
+ height: ''
|
|
|
}
|
|
|
this.tags = []
|
|
|
this.loadData()
|
|
|
this.visible = false
|
|
|
- this.add = true
|
|
|
- for (const key in this.role) {
|
|
|
- if (key == 'roleCode') {
|
|
|
- this.role[key] = this.role[key].substr(0, this.role[key].length - 2)
|
|
|
- }
|
|
|
- }
|
|
|
this.$message.success('素材修改成功')
|
|
|
- })
|
|
|
- }
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
close() {
|
|
|
- // this.form.resetFields()
|
|
|
- // this.urlList = { url: '', md5: '', name: '' }
|
|
|
- // this.watermarkUrl = { url: '', md5: '', name: '' }
|
|
|
- // this.tags = []
|
|
|
+ this.urlList = { url: '', md5: '', name: '', size: '', width: '', height: '' }
|
|
|
+ this.visible = false
|
|
|
},
|
|
|
onChange(date, dateString) {},
|
|
|
callbackTwo(key) {
|
|
@@ -1289,19 +879,49 @@ export default {
|
|
|
},
|
|
|
overUpload(urlAll) {
|
|
|
console.log(urlAll, this.urlList)
|
|
|
-
|
|
|
- // var index = this.urlList.url.findIndex(item => item === urlAll[0])
|
|
|
- // var data = { url: urlAll[0], code: this.urlList.md5[index], name: this.urlList.name[index] }
|
|
|
- // this.imageArr.push(data)
|
|
|
- // console.log(this.imageArr)
|
|
|
var that = this
|
|
|
var img = null
|
|
|
img = new Image()
|
|
|
that.material = []
|
|
|
- for (let i = 0; i < this.urlList.url.length; i++) {
|
|
|
- img.src = this.urlList.url[i]
|
|
|
- if (img.complete) {
|
|
|
- // 打印
|
|
|
+
|
|
|
+ img.src = this.urlList.url
|
|
|
+ if (img.complete) {
|
|
|
+ that.urlList.width = img.width
|
|
|
+ that.urlList.height = img.height
|
|
|
+ // 打印
|
|
|
+ if (img.width == 720) {
|
|
|
+ if (img.height == 1280) {
|
|
|
+ that.material.push(true)
|
|
|
+ } else {
|
|
|
+ that.material.push(false)
|
|
|
+ }
|
|
|
+ } else if (img.width == 1080) {
|
|
|
+ if (img.height == 1920) {
|
|
|
+ that.material.push(true)
|
|
|
+ } else {
|
|
|
+ that.material.push(false)
|
|
|
+ }
|
|
|
+ } else if (img.width == 1280) {
|
|
|
+ if (img.height == 720) {
|
|
|
+ that.material.push(true)
|
|
|
+ } else {
|
|
|
+ that.material.push(false)
|
|
|
+ }
|
|
|
+ } else if (img.width == 1920) {
|
|
|
+ if (img.height == 1080) {
|
|
|
+ that.material.push(true)
|
|
|
+ } else {
|
|
|
+ that.material.push(false)
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ that.material.push(false)
|
|
|
+ }
|
|
|
+ console.log(this.material)
|
|
|
+ } else {
|
|
|
+ // 加载完成执行
|
|
|
+ img.onload = function() {
|
|
|
+ that.urlList.width = img.width
|
|
|
+ that.urlList.height = img.height
|
|
|
if (img.width == 720) {
|
|
|
if (img.height == 1280) {
|
|
|
that.material.push(true)
|
|
@@ -1329,40 +949,6 @@ export default {
|
|
|
} else {
|
|
|
that.material.push(false)
|
|
|
}
|
|
|
- console.log(this.material)
|
|
|
- } else {
|
|
|
- // 加载完成执行
|
|
|
- img.onload = function() {
|
|
|
- // 打印
|
|
|
- // alert('from:onload : width:' + img.width + ',height:' + img.height)
|
|
|
- if (img.width == 720) {
|
|
|
- if (img.height == 1280) {
|
|
|
- that.material.push(true)
|
|
|
- } else {
|
|
|
- that.material.push(false)
|
|
|
- }
|
|
|
- } else if (img.width == 1080) {
|
|
|
- if (img.height == 1920) {
|
|
|
- that.material.push(true)
|
|
|
- } else {
|
|
|
- that.material.push(false)
|
|
|
- }
|
|
|
- } else if (img.width == 1280) {
|
|
|
- if (img.height == 720) {
|
|
|
- that.material.push(true)
|
|
|
- } else {
|
|
|
- that.material.push(false)
|
|
|
- }
|
|
|
- } else if (img.width == 1920) {
|
|
|
- if (img.height == 1080) {
|
|
|
- that.material.push(true)
|
|
|
- } else {
|
|
|
- that.material.push(false)
|
|
|
- }
|
|
|
- } else {
|
|
|
- that.material.push(false)
|
|
|
- }
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
},
|
|
@@ -1371,25 +957,23 @@ export default {
|
|
|
var bmf = new BMF()
|
|
|
var that = this
|
|
|
return new Promise(function(resolve, reject) {
|
|
|
- for (let i = 0; i < file.length; i++) {
|
|
|
- bmf.md5(file[i], (err, md5) => {
|
|
|
- // that.urlList.name.push(file[0].name)
|
|
|
- // that.urlList.md5.push(md5)
|
|
|
-
|
|
|
- fileCheck({
|
|
|
- code: md5,
|
|
|
- projectId: that.getData('projectId')
|
|
|
- }).then(res => {
|
|
|
- if (res.code == 0) {
|
|
|
- that.$message.error('此素材已经上传')
|
|
|
- reject()
|
|
|
- } else {
|
|
|
- resolve()
|
|
|
- // reject()
|
|
|
- }
|
|
|
- })
|
|
|
+ bmf.md5(file[0], (err, md5) => {
|
|
|
+ that.urlList.name = file[0].name
|
|
|
+ that.urlList.md5 = md5
|
|
|
+ that.urlList.size = file[0].size
|
|
|
+ fileCheck({
|
|
|
+ code: md5,
|
|
|
+ projectId: that.getData('projectId')
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 0) {
|
|
|
+ that.$message.error('此素材已经上传')
|
|
|
+ reject()
|
|
|
+ } else {
|
|
|
+ resolve()
|
|
|
+ // reject()
|
|
|
+ }
|
|
|
})
|
|
|
- }
|
|
|
+ })
|
|
|
})
|
|
|
},
|
|
|
getData(className) {
|