wjx 2 éve
szülő
commit
c3c3e03c27

+ 2 - 2
src/api/accounts/ttAdapi.js

@@ -139,9 +139,9 @@ export function refreshUser(adAppId, authUserId) {
  * @param {*} putUserId 
  * @returns 
  */
-export function putUser(adAppId, authUserId, putUserId) {
+export function putUser(authUserId, accountId, putUserId) {
     return request({
-        url: `/oceanengine/authUser/configPutUser/${adAppId}/${authUserId}/${putUserId}`,
+        url: `/oceanengine/adAccount/configPutUser/${authUserId}/${accountId}/${putUserId}`,
         method: 'PUT'
     })
 }

+ 1 - 4
src/views/accounts/ttAdWarrant/index.vue

@@ -62,8 +62,6 @@
             </el-table-column>
             <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right" width="250">
                 <template slot-scope="scope">
-                    <!-- 指派 -->
-                    <put-user-button :adAppId="queryParams.adAppId" :authUserId="scope.row.authUserId" :putUserId="scope.row.sysUserId" @onChange="getList()"/>
                     <!-- 刷新账户 -->
                     <refresh-user-button :adAppId="queryParams.adAppId" :authUserId="scope.row.authUserId" @onChange="getList()"/>
                     <!-- 查看账户 -->
@@ -87,10 +85,9 @@
 import { getAdApp, getAuthUserList, toAuthUser } from "@/api/accounts/ttAdapi";
 import appManage from "./appManage.vue"
 import refreshUserButton from "./refreshUserButton.vue"
-import putUserButton from "./putUserButton.vue"
 import lookAccountButton from "./lookAccountButton.vue"
 export default {
-    components: { appManage, refreshUserButton, putUserButton, lookAccountButton },
+    components: { appManage, refreshUserButton, lookAccountButton },
     data () {
         return {
             queryParams: {

+ 27 - 11
src/views/accounts/ttAdWarrant/lookAccountButton.vue

@@ -1,25 +1,41 @@
 <template>
     <el-button size="mini" type="text" icon="el-icon-view" @click="lookHangdle()">
         <span>查看账号</span>
-        <el-dialog :title="'查看 ' + authUserId" :visible.sync="visible" width="780px" append-to-body v-if="visible">
+        <el-dialog :title="'查看 ' + authUserId" :visible.sync="visible" width="900px" append-to-body v-if="visible">
             <el-table :data="accountList" :loading="loading">
-                <el-table-column label="账号名称" prop="accountName" align="center" fixed :show-overflow-tooltip="true"/>
-                <el-table-column label="账号ID" prop="accountId" align="center" fixed :show-overflow-tooltip="true"/>
+                <el-table-column label="账号ID" prop="accountId" align="center" fixed width="150"
+                    :show-overflow-tooltip="true" />
+                <el-table-column label="账号名称" prop="accountName" align="center" :show-overflow-tooltip="true"
+                    width="300" />
+                <el-table-column label="投手ID" prop="putUserId" align="center" width="120"
+                    :show-overflow-tooltip="true" />
+                <el-table-column label="所属组" prop="groupName" align="center" width="120"
+                    :show-overflow-tooltip="true" />
+                <el-table-column label="Enabled?" prop="enabled" align="center" width="80">
+                    <template slot-scope="scope">
+                        <span>{{ scope.row.enabled ? '可用' : '禁用' }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column label="操作" align="center" class-name="small-padding fixed-width" fixed="right"
+                    width="90">
+                    <template slot-scope="scope">
+                        <!-- 指派 -->
+                        <put-user-button :accountId="scope.row.accountId" :authUserId="scope.row.authUserId"
+                            :putUserId="scope.row.putUserId" @onChange="getList()" />
+                    </template>
+                </el-table-column>
             </el-table>
-            <pagination
-                v-show="total > 0"
-                :total="total"
-                :page.sync="queryParams.pageNum"
-                :limit.sync="queryParams.pageSize"
-                @pagination="getList"
-            />
+            <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
+                :limit.sync="queryParams.pageSize" @pagination="getList" />
         </el-dialog>
     </el-button>
 </template>
 <script>
 import { getAdAccountList } from "@/api/accounts/ttAdapi";
+import putUserButton from "./putUserButton.vue"
 export default {
-    data () {
+    components: { putUserButton },
+    data() {
         return {
             visible: false,
             loading: false,

+ 9 - 10
src/views/accounts/ttAdWarrant/putUserButton.vue

@@ -37,7 +37,7 @@ export default {
         }
     },
     props: {
-        adAppId: {
+        accountId: {
             type: Number,
             default: null,
         },
@@ -53,26 +53,25 @@ export default {
     methods: {
         putHangdle() {
             this.getUserAllHandle()
-            this.paramsForm.putUserId = this.putUserId
+            if(this.putUserId && this.putUserId !== -1) {
+                this.$set(this.paramsForm, 'putUserId', this.putUserId)
+            }
             this.visible = true
         },
         onSubmit(val) {
             this.$refs[val].validate((valid) => {
-                if (valid && this.adAppId && this.authUserId) {
+                if (valid && this.accountId && this.authUserId) {
                     this.loading = true
-                    putUser(this.adAppId, this.authUserId, this.paramsForm.putUserId).then(res => {
+                    putUser(this.authUserId, this.accountId, this.paramsForm.putUserId).then(res => {
                         this.loading = false
                         if (res.data) {
                             this.$message({
                                 showClose: true,
                                 message: '指派成功',
-                                type: 'success',
-                                onClose: () => {
-                                    this.$emit("onChange");
-                                    this.visible = false
-                                }
+                                type: 'success'
                             });
-                            
+                            this.$emit("onChange");
+                            this.visible = false
                         }
                     }).catch(() => this.loading = false)
                 }