Browse Source

是否自动发课

yfh 4 ngày trước cách đây
mục cha
commit
4d580cbd9b
1 tập tin đã thay đổi với 53 bổ sung1 xóa
  1. 53 1
      src/views/qw/user/index.vue

+ 53 - 1
src/views/qw/user/index.vue

@@ -117,6 +117,12 @@
           </el-tooltip>
         </template>
       </el-table-column>
+
+      <el-table-column label="自动发课" align="center" prop="isAuto">
+        <template slot-scope="scope">
+          <dict-tag :options="isAutoOptions" :value="scope.row.isAuto"/>
+        </template>
+      </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120px" fixed="right">
         <template slot-scope="scope">
           <el-button
@@ -192,6 +198,28 @@
           >
             解绑Ai主机
           </el-button>
+          <el-button
+            v-if="scope.row.isAuto=='00'"
+            size="mini"
+            type="text"
+            icon="el-icon-moon"
+            plain
+            @click="handleUpdateIsAuto(scope.row,'01')"
+            v-hasPermi="['qw:user:login']"
+          >
+            启用插件
+          </el-button>
+          <el-button
+            v-if="scope.row.isAuto=='01'"
+            size="mini"
+            type="text"
+            icon="el-icon-moon"
+            plain
+            @click="handleUpdateIsAuto(scope.row,'00')"
+            v-hasPermi="['qw:user:login']"
+          >
+            禁用插件
+          </el-button>
         </template>
       </el-table-column>
       <el-table-column label="主机" align="center" class-name="small-padding fixed-width" width="110px" fixed="right">
@@ -472,6 +500,7 @@ export default {
   components: { fastGptRole},
   data() {
     return {
+      isAutoOptions:[],
       updateIp:{
         open:false,
         title: "修改云主机IP"
@@ -554,6 +583,10 @@ export default {
         id:null,
         welcomeText:null,
       },
+      isAutoForm:{
+        id:null,
+        isAuto:null,
+      },
 
       editRemarkOpen: {
         open: false,
@@ -596,7 +629,9 @@ export default {
     };
   },
   created() {
-
+    this.getDicts("qw_user_is_auto").then(response => {
+      this.isAutoOptions = response.data;
+    });
     getMyQwCompanyList().then(response => {
       this.myQwCompanyList = response.data;
       if(this.myQwCompanyList!=null){
@@ -801,6 +836,23 @@ export default {
         this.getList()
       })
     },
+
+    handleUpdateIsAuto(val,code) {
+      this.isAutoForm={
+        id:val.id,
+        isAuto:code
+      }
+      updateUser(this.isAutoForm).then(res => {
+        if (code==='00'){
+          this.$message.success('禁用成功');
+        }else {
+          this.$message.success('启用成功');
+        }
+        this.getList();
+      });
+
+
+    },
     //传验证码
     handleLoginQwCodeMsg() {
       loginQwCodeMsg({appKey: this.qwLogin.appKey, code: this.qwLogin.code}).then(res => {