ソースを参照

素材库更新

zhuxinbo 5 年 前
コミット
abaee0bbd1

+ 1 - 1
src/api/actor.js

@@ -103,6 +103,6 @@ export function fileInsert(parameter) {
     return axios({
         url: "/file/insert",
         method: 'post',
-        params: parameter
+        data: parameter
     })
 }

+ 8 - 1
src/components/jeecgbiz/JSelectUserByDep.vue

@@ -10,6 +10,7 @@
     <j-select-user-by-dep-modal
       ref="selectModal"
       :modal-width="modalWidth"
+      :multiple="multiple"
       @ok="onSearchDepUserCallBack"/>
   </div>
 </template>
@@ -34,6 +35,12 @@
         type: Boolean,
         required: false,
         default: false
+      },
+      multiple:{
+          type:Boolean,
+          default(){
+              return false
+          }
       }
     },
     data() {
@@ -57,7 +64,7 @@
       //通过组织机构筛选选择用户
       onSearchDepUser() {
         this.$refs.selectModal.showModal()
-        this.onSearchDepUserCallBack(this.value)
+        this.onSearchDepUserCallBack(this.value,"")
       },
       onSearchDepUserCallBack(selectedDepUsers,value) {
         this.selectedDepUsers = selectedDepUsers

+ 251 - 234
src/components/jeecgbiz/modal/JSelectUserByDepModal.vue

@@ -18,7 +18,7 @@
             :selectedKeys="selectedKeys"
             :checkStrictly="true"
             @select="this.onSelect"
-            :dropdownStyle="{maxHeight:'200px',overflow:'auto'}"
+            :dropdownStyle="{ maxHeight: '200px', overflow: 'auto' }"
             :treeData="departTree"
           />
         </a-card>
@@ -27,7 +27,7 @@
         <a-card :bordered="false">
           用户账号:
           <a-input-search
-            :style="{width:'150px',marginBottom:'15px'}"
+            :style="{ width: '150px', marginBottom: '15px' }"
             placeholder="请输入用户账号"
             v-model="queryParam.username"
             @search="onSearch"
@@ -42,8 +42,13 @@
             :columns="columns"
             :dataSource="dataSource"
             :pagination="ipagination"
-            :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange,type:'radio'}"
-            @change="handleTableChange">
+            :rowSelection="{
+              selectedRowKeys: selectedRowKeys,
+              onChange: onSelectChange,
+              type: multiple ? 'checkbox' : 'radio'
+            }"
+            @change="handleTableChange"
+          >
           </a-table>
         </a-card>
       </a-col>
@@ -52,256 +57,268 @@
 </template>
 
 <script>
-  import {filterObj} from '@/utils/util'
-  import {queryDepartTreeList, getUserList, queryUserByDepId, queryUserRoleMap} from '@/api/api'
+import { filterObj } from '@/utils/util'
+import { queryDepartTreeList, getUserList, queryUserByDepId, queryUserRoleMap } from '@/api/api'
 
-  export default {
-    name: 'JSelectUserByDepModal',
-    components: {},
-    props: ['modalWidth'],
-    data() {
-      return {
-        queryParam: {
-          username: "",
+export default {
+  name: 'JSelectUserByDepModal',
+  components: {},
+  props: {
+    modalWidth: {
+      type: Number,
+      default: 1250,
+      required: false
+    },
+    multiple: {
+      type: Boolean,
+      default() {
+        return false
+      }
+    }
+  },
+  data() {
+    return {
+      queryParam: {
+        username: ''
+      },
+      columns: [
+        {
+          title: '用户账号',
+          align: 'center',
+          dataIndex: 'username'
+        },
+        {
+          title: '真实姓名',
+          align: 'center',
+          dataIndex: 'realname'
         },
-        columns: [
-          {
-            title: '用户账号',
-            align: 'center',
-            dataIndex: 'username'
-          },
-          {
-            title: '真实姓名',
-            align: 'center',
-            dataIndex: 'realname'
-          },
-          {
-            title: '角色名称',
-            align: 'center',
-            dataIndex: 'roleName'
-          },
-          {
-            title: '性别',
-            align: 'center',
-            dataIndex: 'sex',
-            customRender: function (text) {
-              if (text === 1) {
-                return '男'
-              } else if (text === 2) {
-                return '女'
-              } else {
-                return text
-              }
+        {
+          title: '角色名称',
+          align: 'center',
+          dataIndex: 'roleName'
+        },
+        {
+          title: '性别',
+          align: 'center',
+          dataIndex: 'sex',
+          customRender: function(text) {
+            if (text === 1) {
+              return '男'
+            } else if (text === 2) {
+              return '女'
+            } else {
+              return text
             }
-          },
-          {
-            title: '手机号码',
-            align: 'center',
-            dataIndex: 'phone'
-          },
-          {
-            title: '邮箱',
-            align: 'center',
-            dataIndex: 'email'
           }
-        ],
-        scrollTrigger: {},
-        dataSource: [],
-        selectedKeys: [],
-        userNameArr: [],
-        departName: '',
-        userRolesMap: {},
-        title: '根据部门选择用户',
-        ipagination: {
-          current: 1,
-          pageSize: 10,
-          pageSizeOptions: ['10', '20', '30'],
-          showTotal: (total, range) => {
-            return range[0] + '-' + range[1] + ' 共' + total + '条'
-          },
-          showQuickJumper: true,
-          showSizeChanger: true,
-          total: 0
         },
-        isorter: {
-          column: 'createTime',
-          order: 'desc'
+        {
+          title: '手机号码',
+          align: 'center',
+          dataIndex: 'phone'
         },
-        selectedRowKeys: [],
-        selectedRows: [],
-        departTree: [],
-        visible: false,
-        form: this.$form.createForm(this)
-      }
-    },
-    created() {
-      // 该方法触发屏幕自适应
-      this.resetScreenSize();
-      this.queryUserRoleMap();
-    },
-    methods: {
-      loadData(arg) {
-        if (arg === 1) {
-          this.ipagination.current = 1;
+        {
+          title: '邮箱',
+          align: 'center',
+          dataIndex: 'email'
         }
-        let params = this.getQueryParams();//查询条件
-        getUserList(params).then((res) => {
-          if (res.success) {
-            this.dataSource = res.result.records;
-            this.assignRoleName(this.dataSource);
-            this.ipagination.total = res.result.total;
-          }
-        })
-      },
-      queryUserRoleMap() {
-        queryUserRoleMap().then((res) => {
-          if (res.success) {
-            this.userRolesMap = res.result;
-            this.loadData();
-          }
-        })
-      },
-      // 触发屏幕自适应
-      resetScreenSize() {
-        let screenWidth = document.body.clientWidth;
-        if (screenWidth < 500) {
-          this.scrollTrigger = {x: 800};
-        } else {
-          this.scrollTrigger = {};
-        }
-      },
-      showModal() {
-        this.visible = true;
-        this.assignRoleName(this.dataSource);
-        this.queryDepartTree();
-        this.form.resetFields();
+      ],
+      scrollTrigger: {},
+      dataSource: [],
+      selectedKeys: [],
+      userNameArr: [],
+      departName: '',
+      userRolesMap: {},
+      title: '根据部门选择用户',
+      ipagination: {
+        current: 1,
+        pageSize: 10,
+        pageSizeOptions: ['10', '20', '30'],
+        showTotal: (total, range) => {
+          return range[0] + '-' + range[1] + ' 共' + total + '条'
+        },
+        showQuickJumper: true,
+        showSizeChanger: true,
+        total: 0
       },
-      getQueryParams() {
-        let param = Object.assign({}, this.queryParam, this.isorter);
-        param.field = this.getQueryField();
-        param.pageNo = this.ipagination.current;
-        param.pageSize = this.ipagination.pageSize;
-        return filterObj(param);
+      isorter: {
+        column: 'createTime',
+        order: 'desc'
       },
-      getQueryField() {
-        let str = 'id,';
-        for (let a = 0; a < this.columns.length; a++) {
-          str += ',' + this.columns[a].dataIndex;
-        }
-        return str;
-      },
-      searchReset(num) {
-        let that = this;
-        if (num !== 0) {
-          that.queryParam = {};
-          that.loadData(1);
+      selectedRowKeys: [],
+      selectedRows: [],
+      departTree: [],
+      visible: false,
+      form: this.$form.createForm(this)
+    }
+  },
+  created() {
+    // 该方法触发屏幕自适应
+    this.resetScreenSize()
+    this.queryUserRoleMap()
+  },
+  methods: {
+    loadData(arg) {
+      if (arg === 1) {
+        this.ipagination.current = 1
+      }
+      let params = this.getQueryParams() //查询条件
+      getUserList(params).then(res => {
+        if (res.success) {
+          this.dataSource = res.result.records
+          this.assignRoleName(this.dataSource)
+          this.ipagination.total = res.result.total
         }
-        that.selectedRowKeys = [];
-        that.userNameArr = [];
-        that.selectedKeys = [];
-      },
-      close() {
-        this.searchReset(0);
-        this.visible = false;
-      },
-      handleTableChange(pagination, filters, sorter) {
-        //TODO 筛选
-        if (Object.keys(sorter).length > 0) {
-          this.isorter.column = sorter.field;
-          this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc';
+      })
+    },
+    queryUserRoleMap() {
+      queryUserRoleMap().then(res => {
+        if (res.success) {
+          this.userRolesMap = res.result
+          this.loadData()
         }
-        this.ipagination = pagination;
-        this.loadData();
-      },
-      handleSubmit() {
-        let that = this;
-        for (let i = 0, len = this.selectedRowKeys.length; i < len; i++) {
-          this.getUserNames(this.selectedRowKeys[i]);
+      })
+    },
+    // 触发屏幕自适应
+    resetScreenSize() {
+      let screenWidth = document.body.clientWidth
+      if (screenWidth < 500) {
+        this.scrollTrigger = { x: 800 }
+      } else {
+        this.scrollTrigger = {}
+      }
+    },
+    showModal() {
+      this.visible = true
+      this.assignRoleName(this.dataSource)
+      this.queryDepartTree()
+      this.form.resetFields()
+    },
+    getQueryParams() {
+      let param = Object.assign({}, this.queryParam, this.isorter)
+      param.field = this.getQueryField()
+      param.pageNo = this.ipagination.current
+      param.pageSize = this.ipagination.pageSize
+      return filterObj(param)
+    },
+    getQueryField() {
+      let str = 'id,'
+      for (let a = 0; a < this.columns.length; a++) {
+        str += ',' + this.columns[a].dataIndex
+      }
+      return str
+    },
+    searchReset(num) {
+      let that = this
+      if (num !== 0) {
+        that.queryParam = {}
+        that.loadData(1)
+      }
+      that.selectedRowKeys = []
+      that.userNameArr = []
+      that.selectedKeys = []
+    },
+    close() {
+      this.searchReset(0)
+      this.visible = false
+    },
+    handleTableChange(pagination, filters, sorter) {
+      //TODO 筛选
+      if (Object.keys(sorter).length > 0) {
+        this.isorter.column = sorter.field
+        this.isorter.order = 'ascend' === sorter.order ? 'asc' : 'desc'
+      }
+      this.ipagination = pagination
+      this.loadData()
+    },
+    handleSubmit() {
+      let that = this
+      for (let i = 0, len = this.selectedRowKeys.length; i < len; i++) {
+        this.getUserNames(this.selectedRowKeys[i])
+      }
+      that.$emit('ok', that.userNameArr.join(','), that.selectedRowKeys.join(','))
+      that.close()
+    },
+    // 遍历匹配,获取用户真实姓名
+    getUserNames(rowId) {
+      let dataSource = this.dataSource
+      for (let i = 0, len = dataSource.length; i < len; i++) {
+        if (rowId === dataSource[i].id) {
+          this.userNameArr.push(dataSource[i].realname)
         }
-        that.$emit('ok', that.userNameArr.join(','),that.selectedRowKeys.join(','));
-        that.close();
-      },
-      // 遍历匹配,获取用户真实姓名
-      getUserNames(rowId) {
-        let dataSource = this.dataSource;
-        for (let i = 0, len = dataSource.length; i < len; i++) {
-          if (rowId === dataSource[i].id) {
-            this.userNameArr.push(dataSource[i].realname);
-          }
+      }
+    },
+    // 点击树节点,筛选出对应的用户
+    onSelect(selectedKeys) {
+      if (selectedKeys[0] != null) {
+        this.queryUserByDepId(selectedKeys) // 调用方法根据选选择的id查询用户信息
+        if (this.selectedKeys[0] !== selectedKeys[0]) {
+          this.selectedKeys = [selectedKeys[0]]
         }
-      },
-      // 点击树节点,筛选出对应的用户
-      onSelect(selectedKeys) {
-        if (selectedKeys[0] != null) {
-          this.queryUserByDepId(selectedKeys); // 调用方法根据选选择的id查询用户信息
-          if (this.selectedKeys[0] !== selectedKeys[0]) {
-            this.selectedKeys = [selectedKeys[0]];
-          }
+      }
+    },
+    onSelectChange(selectedRowKeys, selectionRows) {
+      this.selectedRowKeys = selectedRowKeys
+      this.selectionRows = selectionRows
+    },
+    onSearch() {
+      this.loadData(1)
+    },
+    // 根据选择的id来查询用户信息
+    queryUserByDepId(selectedKeys) {
+      queryUserByDepId({ id: selectedKeys.toString() }).then(res => {
+        if (res.success) {
+          this.dataSource = res.result
+          this.ipagination.total = res.result.length
+          this.assignRoleName(this.dataSource)
         }
-      },
-      onSelectChange(selectedRowKeys, selectionRows) {
-        this.selectedRowKeys = selectedRowKeys;
-        this.selectionRows = selectionRows;
-      },
-      onSearch() {
-        this.loadData(1);
-      },
-      // 根据选择的id来查询用户信息
-      queryUserByDepId(selectedKeys) {
-        queryUserByDepId({id: selectedKeys.toString()}).then((res) => {
-          if (res.success) {
-            this.dataSource = res.result;
-            this.ipagination.total = res.result.length;
-            this.assignRoleName(this.dataSource);
-          }
-        })
-      },
-      // 传入用户id,找到匹配的角色名称
-      queryUserRole(userId) {
-        let map = this.userRolesMap;
-        let roleName = [];
-        for (var key in map) {
-          if (userId === key) {
-            roleName.push(map[key]);
-          }
+      })
+    },
+    // 传入用户id,找到匹配的角色名称
+    queryUserRole(userId) {
+      let map = this.userRolesMap
+      let roleName = []
+      for (var key in map) {
+        if (userId === key) {
+          roleName.push(map[key])
         }
-        return roleName.join(',');
-      },
-      queryDepartTree() {
-        queryDepartTreeList().then((res) => {
-          if (res.success) {
-            this.departTree = res.result;
-          }
-        })
-      },
-      // 为角色名称赋值
-      assignRoleName(data) {
-        let userId = '';
-        let role = '';
-        for (let i = 0, length = data.length; i < length; i++) {
-          userId = this.dataSource[i].id;
-          role = this.queryUserRole(userId);
-          this.dataSource[i].roleName = role;
+      }
+      return roleName.join(',')
+    },
+    queryDepartTree() {
+      queryDepartTreeList().then(res => {
+        if (res.success) {
+          this.departTree = res.result
         }
-      },
-      modalFormOk() {
-        this.loadData();
+      })
+    },
+    // 为角色名称赋值
+    assignRoleName(data) {
+      let userId = ''
+      let role = ''
+      for (let i = 0, length = data.length; i < length; i++) {
+        userId = this.dataSource[i].id
+        role = this.queryUserRole(userId)
+        this.dataSource[i].roleName = role
       }
+    },
+    modalFormOk() {
+      this.loadData()
     }
   }
+}
 </script>
 
 <style scoped>
-  .ant-table-tbody .ant-table-row td {
-    padding-top: 10px;
-    padding-bottom: 10px;
-  }
+.ant-table-tbody .ant-table-row td {
+  padding-top: 10px;
+  padding-bottom: 10px;
+}
 
-  #components-layout-demo-custom-trigger .trigger {
-    font-size: 18px;
-    line-height: 64px;
-    padding: 0 24px;
-    cursor: pointer;
-    transition: color .3s;
-  }
-</style>
+#components-layout-demo-custom-trigger .trigger {
+  font-size: 18px;
+  line-height: 64px;
+  padding: 0 24px;
+  cursor: pointer;
+  transition: color 0.3s;
+}
+</style>

+ 1 - 1
src/mixins/JeecgListMixin.js

@@ -51,7 +51,7 @@ export const JeecgListMixin = {
       superQueryParams: ""
     }
   },
-  created() {
+  mounted() {
     this.loadData();
     //初始化字典配置 在自己页面定义
     this.initDictConfig();

+ 10 - 16
src/views/modules/Statistics/materialStatistics.vue

@@ -92,25 +92,19 @@
             :pagination="pagination"
             :customRow="rowClick"
             :loading="loading"
+            :scroll="{ x: 1900 }"
           >
             <div slot="url" slot-scope="url">
-              <video
-                @click.stop
-                class="video"
-                :src="url"
-                controls="controls"
-                style="height:200px;width:112.5px"
-              >您的浏览器不支持 video 标签。</video>
+              <video @click.stop class="video" :src="url" controls="controls" style="height:200px;width:112.5px">
+                您的浏览器不支持 video 标签。
+              </video>
             </div>
-            <span slot="photoClickRatio" slot-scope="photoClickRatio">{{photoClickRatio|getBo}}</span>
-            <span slot="actionRatio" slot-scope="actionRatio">{{actionRatio|getBo}}</span>
-            <span
-              slot="impression1kCost"
-              slot-scope="impression1kCost"
-            >{{impression1kCost|toFixtwo}}</span>
-            <span slot="photoClickCost" slot-scope="photoClickCost">{{photoClickCost|toFixtwo}}</span>
-            <span slot="actionCost" slot-scope="actionCost">{{actionCost|toFixtwo}}</span>
-            <span slot="conversionPrice" slot-scope="conversionPrice">{{conversionPrice|toFixtwo}}</span>
+            <span slot="photoClickRatio" slot-scope="photoClickRatio">{{ photoClickRatio | getBo }}</span>
+            <span slot="actionRatio" slot-scope="actionRatio">{{ actionRatio | getBo }}</span>
+            <span slot="impression1kCost" slot-scope="impression1kCost">{{ impression1kCost | toFixtwo }}</span>
+            <span slot="photoClickCost" slot-scope="photoClickCost">{{ photoClickCost | toFixtwo }}</span>
+            <span slot="actionCost" slot-scope="actionCost">{{ actionCost | toFixtwo }}</span>
+            <span slot="conversionPrice" slot-scope="conversionPrice">{{ conversionPrice | toFixtwo }}</span>
           </a-table>
         </a-card>
       </a-col>

+ 3 - 3
src/views/modules/advertiser/AdvertiserList.vue

@@ -320,9 +320,9 @@
         params.advertiserId = this.record.id;
         params.advertiser_name = this.record.name;
         params.userId = this.userInfo().id;
-        params.realName = this.userInfo().realname;
-        params.departmentId = this.departmentId;
-        params.distributionName = this.users;
+        params.userName = this.userInfo().username
+        params.projectId = this.record.projectId
+        params.projectName = this.record.projectName
 
         // 触发表单验证
         this.form.validateFields((err) => {

+ 343 - 97
src/views/modules/advertiser/ProjectMemberList.vue

@@ -1,79 +1,38 @@
+<style>
+.my-project .ant-tabs-nav-scroll {
+  display: flex;
+  justify-content: center;
+}
+</style>
 <template>
   <a-card
     :bordered="false"
     :tabList="tabListNoTitle"
     :activeTabKey="noTitleKey"
     @tabChange="key => onTabChange(key, 'noTitleKey')"
+    class="my-project"
   >
     <!-- 查询区域 -->
-    {{noTitleKey}}
     <div class="table-page-search-wrapper">
       <a-form layout="inline">
         <a-row :gutter="24">
           <a-col :md="6" :sm="8">
-            <a-form-item label="项目id">
-              <a-input placeholder="请输入项目id" v-model="queryParam.projectId"></a-input>
-            </a-form-item>
-          </a-col>
-          <a-col :md="6" :sm="8">
-            <a-form-item label="成员id">
-              <a-input placeholder="请输入成员id" v-model="queryParam.userId"></a-input>
+            <a-form-item label="项目名称">
+              <a-input placeholder="请输入项目名称" v-model="keyWord"></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>
-              <a @click="handleToggleSearch" style="margin-left: 8px">
-                {{ toggleSearchStatus ? '收起' : '展开' }}
-                <a-icon :type="toggleSearchStatus ? 'up' : 'down'" />
-              </a>
+              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
             </span>
           </a-col>
         </a-row>
       </a-form>
     </div>
 
-    <!-- 操作按钮区域 -->
-    <div class="table-operator">
-      <a-button @click="handleAdd" type="primary" icon="plus">新增</a-button>
-      <a-button type="primary" icon="download" @click="handleExportXls('项目成员')">导出</a-button>
-      <a-upload
-        name="file"
-        :showUploadList="false"
-        :multiple="false"
-        :headers="tokenHeader"
-        :action="importExcelUrl"
-        @change="handleImportExcel"
-      >
-        <a-button type="primary" icon="import">导入</a-button>
-      </a-upload>
-      <a-dropdown v-if="selectedRowKeys.length > 0">
-        <a-menu slot="overlay">
-          <a-menu-item key="1" @click="batchDel">
-            <a-icon type="delete" />删除
-          </a-menu-item>
-        </a-menu>
-        <a-button style="margin-left: 8px">
-          批量操作
-          <a-icon type="down" />
-        </a-button>
-      </a-dropdown>
-    </div>
-
     <!-- table区域-begin -->
     <div>
-      <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
-        <i class="anticon anticon-info-circle ant-alert-icon"></i> 已选择
-        <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项
-        <a style="margin-left: 24px" @click="onClearSelected">清空</a>
-      </div>
-
       <a-table
         ref="table"
         size="middle"
@@ -83,53 +42,119 @@
         :dataSource="dataSource"
         :pagination="ipagination"
         :loading="loading"
-        :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
-        @change="handleTableChange"
       >
+        <span slot="mediaId" slot-scope="mediaId">{{ mediaId == 1 ? '头条' : '快手' }}</span>
         <span slot="action" slot-scope="text, record">
-          <a @click="handleEdit(record)">编辑</a>
-
-          <a-divider type="vertical" />
-          <a-dropdown>
-            <a class="ant-dropdown-link">
-              更多
-              <a-icon type="down" />
-            </a>
-            <a-menu slot="overlay">
-              <a-menu-item>
-                <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
-                  <a>删除</a>
-                </a-popconfirm>
-              </a-menu-item>
-            </a-menu>
-          </a-dropdown>
+          <a @click="handleEdit(record)">{{ noTitleKey == 'myProject' ? '查看成员' : '账号绑定' }}</a>
+          <a-divider type="vertical" v-show="noTitleKey == 'myProject'" />
+          <a @click="addParams(record)" v-show="noTitleKey == 'myProject'">新增人员</a>
         </span>
       </a-table>
     </div>
     <!-- table区域-end -->
 
-    <!-- 表单区域 -->
-    <projectMember-modal ref="modalForm" @ok="modalFormOk"></projectMember-modal>
+    <!--  查看项目成员 -->
+    <a-modal title="查看项目成员" v-model="visible" @ok="handleOk" width="800px">
+      <div style="display:flex;line-height:50px;flex-wrap: wrap;">
+        <div style="width:25%;text-align:center;" v-for="(item, index) of memberList" :key="index">
+          <a-tag color="#2db7f5"
+            >{{ item.userName }}
+            <a-divider type="vertical" />
+            {{ item.roleCode | roleCode }}</a-tag
+          >
+        </div>
+      </div>
+    </a-modal>
+
+    <!--  添加项目成员 -->
+    <a-modal title="添加项目成员" v-model="visibleAdd" @ok="handleOkAdd">
+      <j-select-user-by-dep multiple v-model="user" @change="add"></j-select-user-by-dep>
+    </a-modal>
+
+    <!-- 账号绑定 -->
+    <a-modal
+      title="账号绑定"
+      v-model="visibleBind"
+      @ok="handleSubmit"
+      :width="800"
+      :okButtonProps="{ props: { disabled: false } }"
+      :cancelButtonProps="{ props: { disabled: false } }"
+    >
+      <a-form v-model="form">
+        <a-form-item
+          label="选择方式"
+          :labelCol="{ xs: { span: 24 }, sm: { span: 5 } }"
+          :wrapperCol="{ xs: { span: 24 }, sm: { span: 16 } }"
+        >
+          <a-radio-group buttonStyle="solid" v-model="mode" @change="onChageLogin">
+            <a-radio-button value="login">登录</a-radio-button>
+            <a-radio-button value="authorization">授权</a-radio-button>
+          </a-radio-group>
+        </a-form-item>
+
+        <a-form-item
+          label="账号:"
+          :label-col="{ xs: { span: 24 }, sm: { span: 5 } }"
+          :wrapper-col="{ xs: { span: 24 }, sm: { span: 16 } }"
+          v-show="mode == 'login'"
+        >
+          <a-input v-model="accountName" placeholder="请输入账户名" />
+        </a-form-item>
+        <a-form-item
+          label="密码:"
+          :label-col="{ xs: { span: 24 }, sm: { span: 5 } }"
+          :wrapper-col="{ xs: { span: 24 }, sm: { span: 16 } }"
+          v-show="mode == 'login'"
+        >
+          <a-input type="password" v-model="password" placeholder="请输入密码" />
+        </a-form-item>
+        <a-form-item
+          label="媒体:"
+          :label-col="{ xs: { span: 24 }, sm: { span: 5 } }"
+          :wrapper-col="{ xs: { span: 24 }, sm: { span: 16 } }"
+        >
+          <a-radio-group buttonStyle="outline" v-model="loginType">
+            <a-radio-button value="kuaishou">快手</a-radio-button>
+            <a-radio-button value="bytedance">头条</a-radio-button>
+          </a-radio-group>
+        </a-form-item>
+      </a-form>
+    </a-modal>
   </a-card>
 </template>
 
 <script>
 import ProjectMemberModal from './modules/ProjectMemberModal'
-import { JeecgListMixin } from '@/mixins/JeecgListMixin'
 import { httpAction, getAction } from '@/api/manage'
 
 import { mapGetters } from 'vuex'
 
+import JSelectUserByDep from '@/components/jeecgbiz/JSelectUserByDep'
+
 export default {
   name: 'ProjectMemberList',
-  mixins: [JeecgListMixin],
   components: {
-    ProjectMemberModal
+    ProjectMemberModal,
+    JSelectUserByDep
   },
   data() {
     return {
       description: '我的项目',
       // 表头
+      visible: false,
+      keyWord: '',
+      mode: 'login',
+      mediaId: '2',
+      accountName: '',
+      password: '',
+      loginType: 'kuaishou',
+      form: this.$form.createForm(this),
+      record: '',
+      queryParam: {
+        projectId: '',
+        userId: ''
+      },
+      user: '',
       tabListNoTitle: [
         {
           key: 'myProject',
@@ -143,24 +168,20 @@ export default {
       noTitleKey: 'participation',
       columns: [
         {
-          title: '#',
-          dataIndex: '',
-          key: 'rowIndex',
-          width: 60,
+          title: '项目名称',
           align: 'center',
-          customRender: function(t, r, index) {
-            return parseInt(index) + 1
-          }
+          dataIndex: 'projectName'
         },
         {
-          title: '项目id',
+          title: '成员',
           align: 'center',
-          dataIndex: 'projectId'
+          dataIndex: 'userName'
         },
         {
-          title: '成员id',
+          title: '媒体类型',
           align: 'center',
-          dataIndex: 'userId'
+          dataIndex: 'mediaId',
+          scopedSlots: { customRender: 'mediaId' }
         },
         {
           title: '操作',
@@ -169,13 +190,17 @@ export default {
           scopedSlots: { customRender: 'action' }
         }
       ],
-      url: {
-        list: '/ctop/projectMember/list',
-        delete: '/ctop/projectMember/delete',
-        deleteBatch: '/ctop/projectMember/deleteBatch',
-        exportXlsUrl: 'ctop/projectMember/exportXls',
-        importExcelUrl: 'ctop/projectMember/importExcel'
-      }
+      dataSource: [],
+      dataElse: [],
+      ipagination: {},
+      loading: false,
+      memberList: [],
+      visibleAdd: false,
+      member: [],
+      itemJson: null,
+      visibleBind: false,
+      bindAccountLoginUrl: '/ctop/bindAccountLogin/login',
+      bindAuthorizationUrl: '/ctop/bindAccountAuth/authorization'
     }
   },
   computed: {
@@ -183,22 +208,243 @@ export default {
       return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
     }
   },
+  filters: {
+    roleCode(value) {
+      var state = {
+        clip: '剪辑',
+        shot: '拍摄',
+        plan: '策划',
+        plane: '平面',
+        admin: '管理员',
+        operator: '运营专员',
+        kuaishouOperationManager: '快手运营经理'
+      }
+
+      if (value) {
+        return state[value]
+      } else {
+        return '暂无'
+      }
+    }
+  },
   methods: {
     ...mapGetters(['nickname', 'avatar', 'userInfo']),
+    add(value, key) {
+      var dataValue = value.split(',')
+      var dataKey = key.split(',')
+      var jsonArr = []
+      for (let i = 0; i < dataValue.length; i++) {
+        jsonArr.push({ userId: dataKey[i], userName: dataValue[i] })
+      }
+      this.member = jsonArr
+    },
     onTabChange(key, type) {
       console.log(key, type)
       this[type] = key
+      this.keyWord = ''
+      if (key == 'myProject') {
+        this.getResponsibleList()
+      } else {
+        this.getParticipateList()
+      }
+    },
+    getResponsibleList() {
+      //我管理的
+      this.dataSource = []
+      this.dataElse = []
+      this.loading = true
+      getAction('/ctop/project/responsibleList', { userId: this.userInfo().id }).then(res => {
+        if (res.code == 0) {
+          this.columns = [
+            {
+              title: '项目名称',
+              align: 'center',
+              dataIndex: 'projectName'
+            },
+            {
+              title: '管理人',
+              align: 'center',
+              dataIndex: 'advertiserName'
+            },
+            {
+              title: '媒体类型',
+              align: 'center',
+              dataIndex: 'mediaId',
+              scopedSlots: { customRender: 'mediaId' }
+            },
+            {
+              title: '操作',
+              dataIndex: 'action',
+              align: 'center',
+              scopedSlots: { customRender: 'action' }
+            }
+          ]
+          this.dataSource = res.result
+          this.dataElse = res.result
+          this.loading = false
+        }
+      })
+    },
+    getParticipateList() {
+      //我参与的
+      this.dataSource = []
+      this.dataElse = []
+      this.loading = true
+      getAction('/ctop/projectMember/participateList', { userId: this.userInfo().id }).then(res => {
+        if (res.code == 0) {
+          this.dataSource = res.result
+          this.dataElse = res.result
+          this.columns = [
+            {
+              title: '项目名称',
+              align: 'center',
+              dataIndex: 'projectName'
+            },
+            {
+              title: '广告主',
+              align: 'center',
+              dataIndex: 'advertiserName'
+            },
+            {
+              title: '管理者',
+              align: 'center',
+              dataIndex: 'responsibleName'
+            },
+            {
+              title: '媒体类型',
+              align: 'center',
+              dataIndex: 'mediaId',
+              scopedSlots: { customRender: 'mediaId' }
+            },
+            {
+              title: '操作',
+              dataIndex: 'action',
+              align: 'center',
+              scopedSlots: { customRender: 'action' }
+            }
+          ]
+          this.loading = false
+        }
+      })
+    },
+    getMemberList(projectId) {
+      //成员查看
+      this.memberList = []
+
+      getAction('/ctop/projectMember/getMemberList', { projectId: projectId }).then(res => {
+        if (res.code == 0) {
+          this.visible = true
+          this.memberList = res.result
+        }
+      })
+    },
+    handleOk(e) {
+      console.log(e)
+      this.visible = false
+    },
+    handleOkAdd(e) {
+      console.log(e)
+      var params = {}
+      params.projectId = this.itemJson.id
+      params.projectName = this.itemJson.projectName
+      params.memberArr = this.member
+
+      httpAction('/ctop/projectMember/batchAdd', params, 'post').then(res => {
+        console.log(res)
+        this.visibleAdd = false
+        this.user = ''
+      })
     },
-    
+    addParams(item) {
+      this.visibleAdd = true
+      this.itemJson = item
+      console.log(this.itemJson)
+    },
+    handleAdd() {},
+    handleEdit(item) {
+      if (this.noTitleKey == 'myProject') {
+        this.getMemberList(item.id)
+      } else {
+        console.log(item)
+        this.record = item
+        this.visibleBind = true
+      }
+    },
+    handleDelete(id) {},
+    onChageLogin() {
+      console.log(this.mode)
+      this.loginType = 'kuaishou'
+    },
+    handleSubmit() {
+      let params = {}
+      params.advertiserId = this.record.advertiserId
+      params.advertiser_name = this.record.advertiserName
+      params.userId = this.userInfo().id
+      params.userName = this.userInfo().username
+      params.projectId = this.record.projectId
+      params.projectName = this.record.projectName
+
+      // 触发表单验证
+      this.form.validateFields(err => {
+        if (!err) {
+          if (this.mode == 'login') {
+            params.accountName = this.accountName
+            params.password = this.password
+            params.loginType = this.loginType
+            if (this.loginType == 'kuaishou') {
+              params.mediaId = this.mediaId
+            } else if (this.loginType == 'bytedance') {
+              params.mediaId = 1
+            }
+            httpAction(this.bindAccountLoginUrl, params, 'post').then(res => {
+              if (res.success) {
+                alert('绑定成功')
+                this.accountName = ''
+                this.password = ''
+                this.loginType = 'kuaishou'
+                this.visibleBind = false
+              } else {
+                alert(res.message)
+              }
+            })
+          }
+          // 授权登录
+          if (this.mode == 'authorization') {
+            params.authorizationType = this.loginType
+            if (this.loginType == 'kuaishou') {
+              params.mediaId = this.mediaId
+            } else if (this.loginType == 'bytedance') {
+              params.mediaId = 1
+            }
+            httpAction(this.bindAuthorizationUrl, params, 'post').then(res => {
+              if (res.success) {
+                window.open(res.message, '_blank')
+                this.visibleBind = false
+              } else {
+                alert('绑定失败')
+              }
+            })
+          }
+        }
+      })
+    },
+    searchReset() {
+      this.keyWord = ''
+      this.dataSource = this.dataElse
+    },
+    searchQuery() {
+      this.dataSource = this.dataElse.filter(item => {
+        return item.projectName.toLowerCase().indexOf(this.keyWord.toLowerCase()) > -1
+      })
+    }
   },
   mounted() {
-    //我管理的
-    getAction('/ctop/project/responsibleList', { userId: this.userInfo().id }).then(res => {
-      console.log(res)
+    this.$nextTick(() => {
+      this.getParticipateList()
     })
   }
 }
 </script>
 <style scoped>
 @import '~@assets/less/common.less';
-</style>
+</style>

ファイルの差分が大きいため隠しています
+ 659 - 295
src/views/modules/material/materialList.vue