zhuxinbo 5 anni fa
parent
commit
0ee5893f7e
1 ha cambiato i file con 29 aggiunte e 31 eliminazioni
  1. 29 31
      src/views/modules/material/scriptMaterial.vue

+ 29 - 31
src/views/modules/material/scriptMaterial.vue

@@ -57,12 +57,12 @@
 //         width:70%
 //     }
 // } /*>=1100的设备*/
-@media (min-width: 1450px) {
+@media (min-width: 1600px) {
   .home-item {
     border-style: solid;
     border-width: 1px;
     border-color: #e4e4e4;
-    width: calc(25% - 10px);
+    width: calc(50% - 10px);
     padding: 10px;
     margin-right: 10px;
     margin-bottom: 10px;
@@ -209,7 +209,6 @@ a {
         <div class="home-item" v-for="(items, index) in dataSource" :key="index">
           <div class="home-right" @click="showDetail(items)">
             <span
-              @click.stop
               style="color: #999; fontSize: 16px;padding-bottom:10px;display:block;width:100%;overflow: hidden;text-overflow: ellipsis;"
             >
               {{ items.dramaName }}
@@ -228,6 +227,7 @@ a {
             <span style="color: black; fontSize: 16px;padding-top:10px;display:block;width:100%" @click.stop>
               {{ items.createTime }}
               <a style="float:right;" @click.stop="writeScript(items)"> 编写剧本</a>
+              <a style="float:right;margin-right:15px" @click.stop="editScript(items)"> 内容修改</a>
             </span>
           </div>
         </div>
@@ -655,11 +655,6 @@ export default {
         }
       })
     },
-    addRole(item) {
-      this.visibleRole = true
-      this.dramaId = item.id
-      this.getRoleList()
-    },
     getRoleList() {
       getAction('/ctop/dramaInfo/detail', { dramaId: this.dramaId }).then(res => {
         if (res.success) {
@@ -667,6 +662,7 @@ export default {
         }
       })
     },
+
     handleOkRole() {
       this.formRole.validateFieldsAndScroll((err, values) => {
         if (err) {
@@ -731,6 +727,21 @@ export default {
       this.visibleScript = false
       this.comments = []
     },
+    editScript(item) {
+      this.visible = true
+      this.add = false
+      this.id = item.id
+      this.$nextTick(() => {
+        this.form.setFieldsValue({
+          category: item.category,
+          dramaName: item.dramaName,
+          nonpublic: item.nonpublic,
+          introduction: item.introduction
+        })
+      })
+
+      this.tags = item.tag.split(',')
+    },
     handleOk() {
       this.form.validateFieldsAndScroll((err, values) => {
         if (err) {
@@ -751,29 +762,16 @@ export default {
               }
             })
           } else {
-            fileEdit({
-              ...params,
-              status: '0'
-            }).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)
-                }
+            params.id = this.id
+            postAction('/ctop/dramaInfo/edit', params).then(res => {
+              if (res.success) {
+                this.form.resetFields()
+                this.tags = []
+                this.loadData()
+                this.visible = false
+                this.add = true
+              } else {
+                this.$message.error(res.message)
               }
             })
           }