|
|
@@ -9,7 +9,7 @@
|
|
|
append-to-body
|
|
|
:show-close="false"
|
|
|
@close="onCancel">
|
|
|
- <div class="drawer__panel" style="margin-bottom: 0!important;">
|
|
|
+ <div class="drawer__panel" >
|
|
|
<el-row :gutter="10">
|
|
|
<el-form :model="form" :rules="rules" ref="form" size="mini" label-position="top">
|
|
|
<el-col :span="24">
|
|
|
@@ -35,20 +35,30 @@
|
|
|
<previewImage v-if="form.cover" style="width:256px" :image="form.image" :deletebtn="true"
|
|
|
@onSuccess="clearCover"></previewImage>
|
|
|
<upload v-else btntype="image" :folderid="folderid" accept=".JPG,.PNG"
|
|
|
- :bindData="{ ownertable: 'sat_notice', ownerid: form.sat_noticeid, usetype: 'cover' }"
|
|
|
+ :bindData="{ ownertable: 'sat_sharematerial', ownerid: form.sat_sharematerialid, usetype: 'cover' }"
|
|
|
@onSuccess="onCoverSubmit"></upload>
|
|
|
<p class="info">注:建议上传图片大小130x80像素,大小不超过2M,格式为JPG/PNG</p>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="24">
|
|
|
<el-form-item label="内容" prop="notes">
|
|
|
- <myEditor ref="editor" :content="form.notes" :id="form.sat_sharematerialid"></myEditor>
|
|
|
+ <myEditor ref="editor" :content="form.content" :id="form.sat_sharematerialid"></myEditor>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-form>
|
|
|
</el-row>
|
|
|
<div>
|
|
|
- <div style="font-size: 16px;font-weight: bold">关联产品</div>
|
|
|
+ <div style="font-size: 16px;font-weight: bold;margin-bottom: 10px">关联产品</div>
|
|
|
+ <addProduct :sat_sharematerialid="form.sat_sharematerialid" style="margin-bottom: 10px" @selectData="selectData"></addProduct>
|
|
|
+ <tableNewLayout ref="tableRef" :checkbox="false" :custom="true" :data="list" :layout="tablecols"
|
|
|
+ :opwidth="200" :width="true" height="300px">
|
|
|
+ <template v-slot:customcol="scope">
|
|
|
+ <div v-if="scope.column.columnname === 'itemclassfullname'">
|
|
|
+ {{scope.column.data.itemclass?scope.column.data.itemclass.length>0?scope.column.data.itemclass[0].itemclassfullname:'':''}}
|
|
|
+ </div>
|
|
|
+ <p v-else>{{scope.column.data[scope.column.columnname]}}</p>
|
|
|
+ </template>
|
|
|
+ </tableNewLayout>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="fixed__btn__panel">
|
|
|
@@ -63,18 +73,22 @@
|
|
|
import upload from '@/components/upload/hw_obs_upload.vue'
|
|
|
import previewImage from '@/components/previewImage/index.vue'
|
|
|
import myEditor from '@/components/my-editor/Editor.vue'
|
|
|
+import tableNewLayout from '@/components/dynamic-newTable/index2'
|
|
|
+import addProduct from '@/WebsiteManagement/caseManage/modules/addProduct'
|
|
|
export default {
|
|
|
name: "add",
|
|
|
- components:{upload,previewImage,myEditor},
|
|
|
+ components:{upload,previewImage,myEditor,tableNewLayout,addProduct},
|
|
|
data(){
|
|
|
return {
|
|
|
dialogFormVisible:false,
|
|
|
+ tablecols:[],
|
|
|
+ list:[],
|
|
|
form:{
|
|
|
"title": "",
|
|
|
"notes": "",
|
|
|
"content": "",
|
|
|
"sat_sharematerialid":0,
|
|
|
- "status":"发布",
|
|
|
+ "status":"新建",
|
|
|
"sequence":'',
|
|
|
"image":{},
|
|
|
},
|
|
|
@@ -88,16 +102,79 @@ export default {
|
|
|
},
|
|
|
folderid: JSON.parse(sessionStorage.getItem('folderid')).appfolderid,
|
|
|
attinfo_attachment:[],
|
|
|
+ productParam:{
|
|
|
+ "id": "20240801134003",
|
|
|
+ "content": {
|
|
|
+ "sat_sharematerialid": '',
|
|
|
+ "where": {
|
|
|
+ "condition": ""
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
methods:{
|
|
|
- addBtn(){},
|
|
|
- onSubmit(){},
|
|
|
- onCancel(){},
|
|
|
+ addBtn(){
|
|
|
+ this.createCase()
|
|
|
+ },
|
|
|
+ /*新建空的案例*/
|
|
|
+ async createCase(){
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": "20240801133403",
|
|
|
+ "content": {
|
|
|
+ "title": "",
|
|
|
+ "notes": "",
|
|
|
+ "content": "",
|
|
|
+ "sat_sharematerialid":0,
|
|
|
+ "status":"新建",
|
|
|
+ "sequence":''
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (res.code == 0){
|
|
|
+ this.tool.showMessage(res,()=>{
|
|
|
+ })
|
|
|
+ }else {
|
|
|
+ this.form.sat_sharematerialid = res.data.sat_sharematerialid
|
|
|
+ this.productParam.content.sat_sharematerialid = res.data.sat_sharematerialid
|
|
|
+ this.productData()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ onSubmit(){
|
|
|
+ this.$refs.form.validate(async (valid)=>{
|
|
|
+ if (!valid) return false
|
|
|
+ this.form.content = this.$refs.editor.html
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": "20240801133403",
|
|
|
+ "content": this.form
|
|
|
+ })
|
|
|
+ this.tool.showMessage(res,()=>{
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ this.$refs.form.resetFields()
|
|
|
+ this.$refs.editor.html = ''
|
|
|
+ this.$emit('onSuccess')
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async onCancel(){
|
|
|
+ this.dialogFormVisible = false
|
|
|
+ if (this.form.title == '' || this.form.image == {}){
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id":20240801133503,
|
|
|
+ "content": {
|
|
|
+ "sat_sharematerialids":[this.form.sat_sharematerialid]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
clearCover() {
|
|
|
this.form.cover = null
|
|
|
this.image = {}
|
|
|
},
|
|
|
+ async productData(){
|
|
|
+ const res = await this.$api.requested(this.productParam)
|
|
|
+ this.list = res.data
|
|
|
+ },
|
|
|
async onCoverSubmit(data) {
|
|
|
// console.log(res,'上传图片1111')
|
|
|
// this.image = res.data.attachmentids[0]
|
|
|
@@ -105,8 +182,8 @@ export default {
|
|
|
"classname": "system.attachment.Attachment",
|
|
|
"method": "queryFileLink",
|
|
|
"content": {
|
|
|
- "ownertable": 'sat_notice',
|
|
|
- "ownerid": this.form.sat_noticeid,
|
|
|
+ "ownertable": 'sat_sharematerial',
|
|
|
+ "ownerid": this.form.sat_sharematerialid,
|
|
|
"usetype": 'cover'//传空返回有所
|
|
|
}
|
|
|
})
|
|
|
@@ -117,6 +194,35 @@ export default {
|
|
|
// this.form.cover = JSON.parse(res.attinfos).data[0].url
|
|
|
// this.image = JSON.parse(res.attinfos).data[0]
|
|
|
},
|
|
|
+ async queryNoticeMain(){
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": "20240801133703",
|
|
|
+ "content": {
|
|
|
+ "sat_sharematerialid":this.form.sat_sharematerialid
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.attinfo_attachment = res.data.attinfos.filter(e => {
|
|
|
+ if (e.postfix !== 'mp4' && e.postfix !== 'ogg' && e.postfix !== 'webm') {
|
|
|
+ return e
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ async selectData(data){
|
|
|
+ const res = await this.$api.requested({
|
|
|
+ "id": "20240801133803",
|
|
|
+ "content": {
|
|
|
+ "sat_sharematerialid": this.form.sat_sharematerialid,
|
|
|
+ "sat_sharematerial_itemsid": data.sat_sharematerial_itemsid,
|
|
|
+ "itemid": data.itemid
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.productParam.content.sat_sharematerialid = this.form.sat_sharematerialid
|
|
|
+ this.productData()
|
|
|
+ },
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.tablecols = this.tool.tabelCol(this.$route.name).productTable.tablecols
|
|
|
}
|
|
|
}
|
|
|
</script>
|