Ver código fonte

增加快手推广产品列表

xuzuoyun 5 anos atrás
pai
commit
0ba839e9a7

+ 95 - 0
src/views/modules/appad/KuaishouAppProductList.vue

@@ -0,0 +1,95 @@
+<template>
+  <a-card :bordered="false">
+
+    <!-- 查询区域 -->
+    <div class="table-page-search-wrapper">
+      <a-form layout="inline">
+        <a-row :gutter="24">
+
+          <a-col :md="6" :sm="8">
+            <a-form-item label="产品名称">
+              <a-input placeholder="请输入产品名称" v-model="queryParam.name"></a-input>
+            </a-form-item>
+          </a-col>
+          <a-col :md="6" :sm="8" >
+            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
+              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
+              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
+            </span>
+          </a-col>
+
+        </a-row>
+      </a-form>
+    </div>
+
+    <!-- table区域-begin -->
+    <div>
+
+      <a-table
+        ref="table"
+        size="middle"
+        bordered
+        rowKey="id"
+        :columns="columns"
+        :dataSource="dataSource"
+        :pagination="ipagination"
+        :loading="loading">
+
+
+      </a-table>
+    </div>
+    <!-- table区域-end -->
+
+    <!-- 表单区域 -->
+    <kuaishouAppProduct-modal ref="modalForm" @ok="modalFormOk"></kuaishouAppProduct-modal>
+  </a-card>
+</template>
+
+<script>
+  import KuaishouAppProductModal from './modules/KuaishouAppProductModal'
+  import { JeecgListMixin } from '@/mixins/JeecgListMixin'
+
+  export default {
+    name: "KuaishouAppProductList",
+    mixins:[JeecgListMixin],
+    components: {
+      KuaishouAppProductModal
+    },
+    data () {
+      return {
+        description: '快手推广产品管理页面',
+        // 表头
+        columns: [
+		   {
+            title: '产品名称',
+            align:"center",
+            dataIndex: 'name'
+           },
+          {
+            title: '投放日期',
+            align:"center",
+            dataIndex: 'createTime'
+          }
+        ],
+		url: {
+          list: "/kuaishou.modules.app/kuaishouAppProduct/list",
+          delete: "/kuaishou.modules.app/kuaishouAppProduct/delete",
+          deleteBatch: "/kuaishou.modules.app/kuaishouAppProduct/deleteBatch",
+          exportXlsUrl: "kuaishou.modules.app/kuaishouAppProduct/exportXls",
+          importExcelUrl: "kuaishou.modules.app/kuaishouAppProduct/importExcel",
+       },
+    }
+  },
+  computed: {
+    importExcelUrl: function(){
+      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`;
+    }
+  },
+    methods: {
+     
+    }
+  }
+</script>
+<style scoped>
+  @import '~@assets/less/common.less'
+</style>

+ 125 - 0
src/views/modules/appad/modules/KuaishouAppProductModal.vue

@@ -0,0 +1,125 @@
+<template>
+  <a-modal
+    :title="title"
+    :width="800"
+    :visible="visible"
+    :confirmLoading="confirmLoading"
+    @ok="handleOk"
+    @cancel="handleCancel"
+    cancelText="关闭">
+    
+    <a-spin :spinning="confirmLoading">
+      <a-form :form="form">
+      
+        <a-form-item
+          :labelCol="labelCol"
+          :wrapperCol="wrapperCol"
+          label="产品名称">
+          <a-input placeholder="请输入产品名称" v-decorator="['name', validatorRules.name ]" />
+        </a-form-item>
+		
+      </a-form>
+    </a-spin>
+  </a-modal>
+</template>
+
+<script>
+  import { httpAction } from '@/api/manage'
+  import pick from 'lodash.pick'
+  import moment from "moment"
+
+  export default {
+    name: "KuaishouAppProductModal",
+    data () {
+      return {
+        title:"操作",
+        visible: false,
+        model: {},
+        labelCol: {
+          xs: { span: 24 },
+          sm: { span: 5 },
+        },
+        wrapperCol: {
+          xs: { span: 24 },
+          sm: { span: 16 },
+        },
+
+        confirmLoading: false,
+        form: this.$form.createForm(this),
+        validatorRules:{
+        name:{rules: [{ required: true, message: '请输入产品名称!' }]},
+        },
+        url: {
+          add: "/kuaishou.modules.app/kuaishouAppProduct/add",
+          edit: "/kuaishou.modules.app/kuaishouAppProduct/edit",
+        },
+      }
+    },
+    created () {
+    },
+    methods: {
+      add () {
+        this.edit({});
+      },
+      edit (record) {
+        this.form.resetFields();
+        this.model = Object.assign({}, record);
+        this.visible = true;
+        this.$nextTick(() => {
+          this.form.setFieldsValue(pick(this.model,'name'))
+		  //时间格式化
+        });
+
+      },
+      close () {
+        this.$emit('close');
+        this.visible = false;
+      },
+      handleOk () {
+        const that = this;
+        // 触发表单验证
+        this.form.validateFields((err, values) => {
+          if (!err) {
+            that.confirmLoading = true;
+            let httpurl = '';
+            let method = '';
+            if(!this.model.id){
+              httpurl+=this.url.add;
+              method = 'post';
+            }else{
+              httpurl+=this.url.edit;
+               method = 'put';
+            }
+            let formData = Object.assign(this.model, values);
+            //时间格式化
+            
+            console.log(formData)
+            httpAction(httpurl,formData,method).then((res)=>{
+              if(res.success){
+                that.$message.success(res.message);
+                that.$emit('ok');
+              }else{
+                that.$message.warning(res.message);
+              }
+            }).finally(() => {
+              that.confirmLoading = false;
+              that.close();
+            })
+
+
+
+          }
+        })
+      },
+      handleCancel () {
+        this.close()
+      },
+
+
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+
+</style>

+ 2 - 2
vue.config.js

@@ -66,10 +66,10 @@ module.exports = {
       '/jeecg-boot': {
         // target: 'http://39.97.120.42:8080', //请求本地 需要jeecg-boot后台项目  生产环境
         // target: 'http://39.106.184.70:8080', //请求本地 需要jeecg-boot后台项目
-        target: 'http://192.168.2.130:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
+        // target: 'http://192.168.2.130:8080', //请求本地 需要jeecg-boot后台项目  蒙蒙
         // target: 'http://192.168.2.133:8080', //请求本地 需要jeecg-boot后台项目  英豪
         // target: 'http://192.168.2.132:8080', //请求本地 需要jeecg-boot后台项目
-        // target: 'http://192.168.2.185:8080', //请求本地 需要jeecg-boot后台项目  祚云
+        target: 'http://192.168.2.174:8080', //请求本地 需要jeecg-boot后台项目  祚云
         ws: false,
         changeOrigin: true
       },