소스 검색

feat:提交代码

jinx 3 년 전
부모
커밋
d34811bc87
2개의 변경된 파일71개의 추가작업 그리고 16개의 파일을 삭제
  1. 3 2
      src/components/tableForm/index.vue
  2. 68 14
      src/views/sence/sence.vue

+ 3 - 2
src/components/tableForm/index.vue

@@ -33,7 +33,8 @@
                       :index="scope.$index"
                       :column="item"></v-solt>
               <div v-else-if="item.action">
-                <el-link href="javascripy:;"
+                <el-link :underline="o.underline || false"
+                         href="javascripy:;"
                          @click="o.clickFun(scope.$index,scope.row)"
                          v-for="(o,key) in item.action"
                          :key="key"
@@ -70,7 +71,7 @@ import vSolt from './vSolt.vue'
 export default defineComponent({
   // props: ['dataApi', 'tableHeader'],
   props: {
-    dataApi: Function,
+    handleSearch: Function,
     config: {
       type: Object,
       default: function () {

+ 68 - 14
src/views/sence/sence.vue

@@ -18,6 +18,33 @@
         </el-table-column>
       </template> -->
     </tableForm>
+
+    <!-- 弹窗 -->
+    <el-dialog v-model="dialogVisible"
+               title="修改"
+               width="40%"
+               :before-close="handleClose">
+
+      <el-form ref="formData"
+               label-width="80px">
+        <el-form-item label="场景名称">
+          <el-input></el-input>
+        </el-form-item>
+        <el-form-item label="封面">
+          <div class="">
+
+          </div>
+        </el-form-item>
+      </el-form>
+
+      <template #footer>
+        <span class="dialog-footer">
+          <el-button @click="dialogVisible = false">取消</el-button>
+          <el-button type="primary"
+                     @click="dialogVisible = false">确认</el-button>
+        </span>
+      </template>
+    </el-dialog>
   </div>
 </template>
 
@@ -40,6 +67,7 @@ export default defineComponent({
   setup(props) {
     const { ctx } = getCurrentInstance()
     const data = reactive({
+      dialogVisible: false,
       pageParam: {
         limit: 10,
         nd: 1635487948418,
@@ -51,6 +79,7 @@ export default defineComponent({
       },
     })
     const searchFormData = ref({
+      formData: {},
       searchList: [
         {
           type: 'input',
@@ -84,22 +113,26 @@ export default defineComponent({
           ],
         },
       ],
-      action: [
-        {
-          name: '新增',
-          clickFun: () => {
-            handleTableData()
-          },
-        },
-      ],
+      // action: [
+      //   {
+      //     name: '新增',
+      //     clickFun: () => {
+      //       data.dialogVisible = true
+      //       // handleTableData()
+      //     },
+      //   },
+      // ],
     })
+    const handleClose = () => {
+      console.log('handleClose')
+    }
     const tableHeader = ref([
       { prop: 'sceneName', label: '场景名称' },
       {
         prop: 'thumb',
         label: '封面',
         render: (params) => {
-          console.log(params.row.thumb)
+          // console.log(params.row.thumb)
           return h('img', {
             style: {
               width: '100px',
@@ -150,14 +183,22 @@ export default defineComponent({
         label: '操作',
         action: [
           {
-            name: '编辑',
+            name: '修改',
+            type: 'danger',
+            clickFun: (index, row) => {
+              // console.log(index, row)
+              editRow(index, row)
+            },
+          },
+          {
+            name: '打开编辑器',
+            type: 'success',
             clickFun: (index, row) => {
               console.log(index, row)
             },
           },
           {
-            name: '删除',
-            type: 'danger',
+            name: '生成直播间',
             clickFun: (index, row) => {
               console.log(index, row)
               hanldeDelRow(index, row)
@@ -187,6 +228,11 @@ export default defineComponent({
       tableData.value = res.page.list
       console.log(tableData)
     }
+    const editRow = (index, row) => {
+      data.formData = row
+      data.dialogVisible = true
+      // console.log(formData.value.sceneName)
+    }
     const hanldeDelRow = (index, row) => {
       ElMessageBox.confirm('是否删除改数据?', {
         confirmButtonText: '确认',
@@ -202,7 +248,7 @@ export default defineComponent({
     return {
       handleSearch,
       handleTableData,
-
+      handleClose,
       tableHeader,
       tableData,
       searchFormData,
@@ -212,4 +258,12 @@ export default defineComponent({
 })
 </script>
 
-<style scoped lang="scss"></style>
+<style  lang="scss">
+#sence {
+  .cell {
+    .el-link {
+      display: block;
+    }
+  }
+}
+</style>