瀏覽代碼

test-zhu提交

朱鑫波 4 年之前
父節點
當前提交
b0a88008db
共有 4 個文件被更改,包括 153 次插入29 次删除
  1. 二進制
      dist.zip
  2. 9 5
      src/mixins/JeecgListMixin.js
  3. 142 22
      src/views/modules/advertiser/AdvertiserList.vue
  4. 2 2
      vue.config.js

二進制
dist.zip


+ 9 - 5
src/mixins/JeecgListMixin.js

@@ -66,21 +66,25 @@ export const JeecgListMixin = {
     expand(expanded,record){
         if(this.url.listTwo){
             var param = {}
+            
             param.field = this.getQueryField();
-            param.pageNo = this.ipagination.current;
-            param.pageSize = this.ipagination.pageSize;
-            param.parentId = record.id
+            // param.pageNo = this.ipagination.current;
+            // param.pageSize = this.ipagination.pageSize;
+            // param.parentId = record.id
+            param.advertiserId = record.id
             if(expanded){
+                record.showVideo = true
                 getAction(this.url.listTwo, filterObj(param)).then((res) => {
                     if (res.success) {
-                        record.innerData=res.result.records.map((item,index)=>{
+                        record.innerData=res.result.map((item,index)=>{
                             return {
                                 ...item,
                                 key:index
                             }
                         })
+                        record.showVideo = false
                         // console.log(record.innerData)
-                        record.innerData = transformTozTreeFormat( record.innerData)
+                        // record.innerData = transformTozTreeFormat( record.innerData)
                     }
                     if (res.code === 510) {
                       this.$message.warning(res.message)

+ 142 - 22
src/views/modules/advertiser/AdvertiserList.vue

@@ -18,8 +18,7 @@
                 dict="sys_category,name,id"
                 pidField="pid"
                 pidValue="f5cb2d2d28417b3b65a6dd744bcb9a76"
-              >
-              </j-tree-select>
+              ></j-tree-select>
             </a-form-item>
           </a-col>
           <a-col :md="6" :sm="8">
@@ -39,21 +38,48 @@
 
     <!-- table区域-begin -->
     <div>
+      <!-- bordered -->
       <a-table
         ref="table"
         size="middle"
-        bordered
         rowKey="id"
+        bordered
         :columns="columns"
         :dataSource="dataSource"
         :pagination="ipagination"
         :loading="loading"
         @change="handleTableChange"
+        @expand="expand"
       >
+        <a-table
+          slot="expandedRowRender"
+          slot-scope="text"
+          :columns="innerColumns"
+          :data-source="text.innerData"
+          :pagination="false"
+          :loading="text.showVideo"
+          :bordered="false"
+        >
+          <span slot="action" slot-scope="text, record">
+            <a @click="handleEdit(record)">编辑</a>
+
+            <a-divider type="vertical" />
+            <a @click="addProduct(record)">新增产品</a>
+
+            <a-divider type="vertical" />
+            <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
+              <a>删除</a>
+            </a-popconfirm>
+          </span>
+        </a-table>
+
         <span slot="action" slot-scope="text, record">
           <a @click="handleEdit(record)">编辑</a>
 
           <a-divider type="vertical" />
+          <a @click="addProduct(record)">新增产品</a>
+
+          <a-divider type="vertical" />
           <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
             <a>删除</a>
           </a-popconfirm>
@@ -171,6 +197,22 @@
     <!-- 表单区域 -->
     <advertiser-modal ref="modalForm" @ok="modalFormOk"></advertiser-modal>
     <j-select-user ref="userForm" @ok="modalFormOk"></j-select-user>
+
+    <a-modal
+      title="新增产品"
+      v-model="productVisible"
+      @ok="handleSubmitProduct"
+      :width="800"
+      :confirm-loading="productLoading"
+    >
+      <a-form-item
+        label="产品名称"
+        :label-col="{ xs: { span: 24 }, sm: { span: 5 } }"
+        :wrapper-col="{ xs: { span: 24 }, sm: { span: 16 } }"
+      >
+        <a-input v-model="productName" placeholder="请输入产品名称" />
+      </a-form-item>
+    </a-modal>
   </a-card>
 </template>
 
@@ -182,7 +224,7 @@ 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 } from '../../../api/manage'
 import { mapActions, mapGetters } from 'vuex'
 
 export default {
@@ -194,7 +236,7 @@ export default {
     JTreeSelect,
     JSelectUserByDep,
     JSelectDepart,
-    JSelectUser
+    JSelectUser,
   },
   data() {
     return {
@@ -212,44 +254,84 @@ export default {
       loginType: 'kuaishou',
       form: this.$form.createForm(this),
       // 表头
+      productVisible: false,
+      productName: '',
+      advertiserId: '',
+      productLoading: false,
+      productListLoading: false,
+      innerColumns: [
+        {
+          title: '产品名称',
+          align: 'center',
+          dataIndex: 'productName',
+          width:400
+        },
+        {
+          title: '上传人',
+          align: 'center',
+          dataIndex: 'userName',
+        },
+        {
+          title: '状态',
+          align: 'center',
+          dataIndex: 'productStatus',
+          customRender: function (text) {
+            if (text == 0) {
+              return '启用'
+            } else if (text == 1) {
+              return '暂停'
+            }
+          },
+        },
+        {
+          title: '创建时间',
+          align: 'center',
+          dataIndex: 'createTime',
+          customRender: function (text) {
+            return text.split(' ')[0]
+          },
+        },
+      ],
+      innerData: [],
       columns: [
         {
           title: '广告主开户主体名称',
           align: 'center',
-          dataIndex: 'name'
+          dataIndex: 'name',
+          width:400
         },
         {
           title: '行业',
           align: 'center',
-          dataIndex: 'industryId_dictText'
+          dataIndex: 'industryId_dictText',
         },
         {
           title: '联系人姓名',
           align: 'center',
-          dataIndex: 'contact'
+          dataIndex: 'contact',
         },
         {
           title: '联系人手机',
           align: 'center',
-          dataIndex: 'mobile'
+          dataIndex: 'mobile',
         },
         {
           title: '联系人邮箱',
           align: 'center',
-          dataIndex: 'email'
+          dataIndex: 'email',
         },
         {
           title: '销售',
           align: 'center',
-          dataIndex: 'saleId_dictText'
+          dataIndex: 'saleId_dictText',
         },
 
         {
           title: '操作',
           dataIndex: 'action',
           align: 'center',
-          scopedSlots: { customRender: 'action' }
-        }
+          scopedSlots: { customRender: 'action' },
+        },
       ],
       url: {
         list: '/ctop/advertiser/list',
@@ -261,19 +343,57 @@ export default {
         bindAuthorizationUrl: '/ctop/bindAccountAuth/authorization',
         getLoginInfo: '/ctop/bindAccount/getLoginInfo',
         userId: '/sys/user/generateUserId', // 引入生成添加用户情况下的url
-        userWithDepart: '/sys/user/userDepartList' // 引入为指定用户查看部门信息需要的url
-      }
+        userWithDepart: '/sys/user/userDepartList', // 引入为指定用户查看部门信息需要的url
+        listTwo:'/ctop/product/productList'
+      },
     }
   },
   computed: {
-    importExcelUrl: function() {
+    importExcelUrl: function () {
       return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
-    }
+    },
   },
   created() {
     this.queryParam.userId = this.userInfo().id
   },
   methods: {
+    getProductList(expanded, record) {
+      console.log(expanded, record)
+      if (expanded) {
+        getAction('/ctop/product/productList', { advertiserId: record.id }).then((res) => {
+          if (res.success) {
+            this.innerData = res.result
+          }
+        })
+      }
+    },
+    addProduct(item) {
+      this.productVisible = true
+      this.advertiserId = item.id
+    },
+    handleSubmitProduct() {
+      let params = {}
+      params.advertiserId = this.advertiserId
+      params.userId = this.userInfo().id
+      params.productName = this.productName
+      if (this.productName != '') {
+        this.productLoading = true
+        postAction('/ctop/product/add', params).then((res) => {
+          if (res.success) {
+            this.$message.success('新增成功')
+            this.productName = ''
+            this.advertiserId = ''
+            this.productVisible = false
+            this.productLoading = false
+          } else {
+            this.$message.error(res.message)
+            this.productLoading = false
+          }
+        })
+      } else {
+        this.$message.error('请输入产品名称')
+      }
+    },
     ...mapGetters(['nickname', 'avatar', 'userInfo']),
     searchRe() {
       this.queryParam.name = ''
@@ -290,7 +410,7 @@ export default {
       params.projectName = this.record.projectName
 
       // 触发表单验证
-      this.form.validateFields(err => {
+      this.form.validateFields((err) => {
         if (!err) {
           if (this.mode == 'login') {
             params.accountName = this.accountName
@@ -301,7 +421,7 @@ export default {
             } else if (this.loginType == 'bytedance') {
               params.mediaId = 1
             }
-            postAction(this.url.bindAccountLoginUrl, params).then(res => {
+            postAction(this.url.bindAccountLoginUrl, params).then((res) => {
               if (res.success) {
                 alert('绑定成功')
                 this.accountName = ''
@@ -320,7 +440,7 @@ export default {
             } else if (this.authorizationType == 'bytedance') {
               params.mediaId = 1
             }
-            postAction(this.url.bindAuthorizationUrl, params).then(res => {
+            postAction(this.url.bindAuthorizationUrl, params).then((res) => {
               if (res.success) {
                 window.open(res.message, '_blank')
               } else {
@@ -349,8 +469,8 @@ export default {
 
     handleCancel() {
       this.close()
-    }
-  }
+    },
+  },
 }
 </script>
 <style scoped>

+ 2 - 2
vue.config.js

@@ -58,7 +58,7 @@ module.exports = {
     open : true,
     proxy: {
       '/jeecg-boot': {
-        //  target: 'http://192.168.1.90:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
+         target: 'http://192.168.1.90:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
         // target: 'http://192.168.0.59:8088', //请求本地 需要jeecg-boot后台项目  英豪
         // target: 'http://192.168.1.72:8088', //请求本地 需要jeecg-boot后台项目  英豪
         // target: 'http://192.168.2.115:8080', //请求本地 需要jeecg-boot后台项目  祚云
@@ -69,7 +69,7 @@ module.exports = {
         // target: 'http://192.168.1.51:8098', //请求本地 需要jeecg-boot后台项目  毕洁泉
         // target: 'http://192.168.0.252:8098', //请求本地 需要jeecg-boot后台项目  毕洁泉
         // target: 'http://192.168.0.170:8088', //请求本地 需要jeecg-boot后台项目  毕洁泉
-         target: 'http://api.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目 
+        //  target: 'http://api.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目 
          
         // target: 'https://trac.tjyourong.com.cn', //请求本地 需要jeecg-boot后台项目 
         // target: 'http://39.106.184.70:8088/', //请求本地 需要jeecg-boot后台项目