shiyu 3 лет назад
Родитель
Сommit
84da102126

+ 4 - 2
src/views/page/pageMenu.vue

@@ -126,7 +126,7 @@
                             >手动运行项目</el-menu-item
                         >
                     </el-submenu>
-                    <!-- <el-submenu index="systemManagement">
+                    <el-submenu index="systemManagement">
                         <template slot="title">
                             <i class="my-icon-menuF"></i>
                             <span>系统管理</span>
@@ -137,7 +137,9 @@
                         <el-menu-item index="/parameterManagement"
                             >参数管理</el-menu-item
                         >    
-                    </el-submenu> -->
+                        <el-menu-item index="clusteringManagement"
+                        >集群管理</el-menu-item>
+                    </el-submenu>
                 </el-menu>
             </div>
         </div>

+ 97 - 50
src/views/systemManagement/clusteringDetail.vue

@@ -9,53 +9,68 @@
             class="flexBox"
         >
             <div class="formItemBox">
-                <el-form-item label="节点名称:" prop="a1">
+                <el-form-item label="账户名称:" prop="userName">
                     <el-input
                         placeholder="请输入"
-                        maxlength="30"
-                        v-autoTrim="{ obj: form, key: 'a1' }"
-                        v-model="form.a1"
+                        readOnly
+                        v-autoTrim="{ obj: form, key: 'userName' }"
+                        v-model="form.userName"
                     >
                     </el-input>
                 </el-form-item>
-                <el-form-item label="节点地址:" prop="a2">
-                    <el-input
-                        placeholder="请输入"
-                        maxlength="100"
-                        v-autoTrim="{ obj: form, key: 'a2' }"
-                        v-model="form.a2"
-                    >
-                    </el-input>
+                <el-form-item label="独占类型:" prop="userType">
+                    <el-select v-model="form.userType" readOnly>
+                        <el-option
+                            v-for="item in userTypeList"
+                            :label="item.caption"
+                            :value="item.code"
+                            :key="item.code"
+                        ></el-option>
+                    </el-select>
                 </el-form-item>
-                <el-form-item label="节点类型:" prop="a3">
+                <el-form-item label="仿真软件license数量:" prop="numSimulationLicense">
                     <el-input
                         placeholder="请输入"
-                        maxlength="100"
-                        v-autoTrim="{ obj: form, key: 'a3' }"
-                        v-model="form.a3"
+                        maxlength="20"
+                        v-autoTrim="{ obj: form, key: 'numSimulationLicense' }"
+                        v-model="form.numSimulationLicense"
                     >
                     </el-input>
                 </el-form-item>
-                <el-form-item label="适用类型:" prop="a4">
+                <el-form-item label="到期时间:" prop="dateSimulationLicense">
+                    <el-date-picker
+                        v-model="form.dateSimulationLicense"
+                        type="date"
+                        placeholder="选择日期"
+                        value-format="yyyy-MM-dd"
+                    ></el-date-picker>
+                </el-form-item>
+                <el-form-item label="动力学软件license数量:" prop="numDynamicLicense">
                     <el-input
                         placeholder="请输入"
-                        maxlength="100"
-                        v-autoTrim="{ obj: form, key: 'a4' }"
-                        v-model="form.a4"
+                        maxlength="20"
+                        v-autoTrim="{ obj: form, key: 'numDynamicLicense' }"
+                        v-model="form.numDynamicLicense"
                     >
                     </el-input>
                 </el-form-item>
+                <el-form-item label="到期时间:" prop="dateDynamicLicense">
+                    <el-date-picker
+                        v-model="form.dateDynamicLicense"
+                        type="date"
+                        placeholder="选择日期"
+                        value-format="yyyy-MM-dd"
+                    ></el-date-picker>
+                </el-form-item>
             </div>
         </el-form>
-        <div class="title">公有</div>
+        <div class="title">历史记录</div>
         <tableList
             ref="table"
             style="width:60%;min-width: 900px;margin: auto;"
             :columns="columns"
             :getDataWay="getDataWay"
-            :checkedData="checkedData"
             index
-            selection
         >   
         </tableList>
         <div class="btns">
@@ -73,60 +88,92 @@ export default {
     components: {tableList},
     data() {
         return {
+            userTypeList: [],
             getDataWay:{
-                //dataType: "url",
-                dataType: "data",
+                dataType: "url",
                 type: "post",
-                // firstRequest: false,
-                // data: this.$api.algorithmsLibrary.selectSharedAlgorithmList,
-                data:[{a1:'1',a2:'2',a3:'3',a4:'4'}],
-                param: {},
+                firstRequest: false,
+                data: this.$api.systemManagement.getClusterHistory,
+                param: {
+                    //userId: this.$route.query.userId
+                },
             },
             columns: [
                 //表格列
                 {
-                    label: "账户名",
-                    prop: "a1",
+                    label: "仿真软件license",
+                    prop: "numSimulationLicense",
                 },
                 {
-                    label: "账户类型",
-                    prop: "a2",
+                    label: "到期时间",
+                    prop: "dateSimulationLicense",
                 },
                 {
-                    label: "联系人",
-                    prop: "a3",
+                    label: "动力学软件license",
+                    prop: "numDynamicLicnese",
                 },
                 {
-                    label: "联系方式",
-                    prop: "a4",
+                    label: "到期时间",
+                    prop: "dateDynamicLicense",
                 },
+                {
+                    label: "操作时间",
+                    prop: "modifyTime"
+                }
             ],
             form: {
-                a1:'',
-                a2:'',
-                a3:'',
-                a4:''
+                userName:"",
+                id: "",
+                userId: "",
+                numSimulationLicense: "",
+                dateSimulationLicense: "",
+                numDynamicLicense: "",
+                dateDynamicLicense: ""
             },
-            
             rules: {
+                numSimulationLicense: [{ required: true, message: "请输入", trigger: "blur" }],
+                dateSimulationLicense: [{ required: true, message: "请选择", trigger: "blur" }],
+                numDynamicLicense: [{ required: true, message: "请输入", trigger: "blur" }],
+                dateDynamicLicense: [{ required: true, message: "请选择", trigger: "blur" }]
             }
         };
     },
-
+    created(){
+        if(this.$route.query.userId){
+            this.form = {...this.$route.query}
+            this.getDataWay.param = {
+                userId: this.$route.query.userId
+            }
+            this.$refs.table.loadData()
+        }
+    },
+    async mounted() {
+        await this.$dicsListsInit({
+            userTypeList: "useType"
+        });
+    },
     computed: {},
-
     methods: {
         save(){
-
+            this.$axios({
+                method:"POST",
+                url:this.$api.systemManagement.saveCluster,
+                data:{
+                    ...this.form
+                }
+            }).then(res=>{
+                if(res.code == 200){
+                    this.$message.success("保存成功");
+                    this.$router.history.go(-1)        
+                }else{
+                    this.$message.error(res.message || "保存失败");
+                }
+            })
         },
         cancel(){
-
+            this.$router.history.go(-1)
         },
     },
-
-    mounted() {
-        
-    },
 };
 </script>
 

+ 106 - 35
src/views/systemManagement/clusteringManagement.vue

@@ -5,41 +5,60 @@
             <template slot="searchItem1">
                 <span class="label">分配账户</span>
                 <el-input
-                    v-model="searchParams.a1"
+                    v-model="searchParams.userName"
                     size="small"
                     clearable
                     placeholder="请输入"
                 >
                 </el-input>
             </template>
+            <template slot="searchItem2">
+                <span class="label">操作时间</span>
+                <el-date-picker
+                    v-model="modifyTimeRange"
+                    type="daterange"
+                    format="yyyy-MM-dd"
+                    value-format="yyyy-MM-dd"
+                    range-separator="至"
+                    start-placeholder="开始日期"
+                    end-placeholder="结束日期"
+                >
+                </el-date-picker>
+            </template>
             <template slot="searchItem3">
-                <span class="label">节点类型</span>
-                <el-select v-model="searchParams.a2">
-                    <el-option
-                        v-for="item in list"
-                        :label="item.caption"
-                        :value="item.code"
-                        :key="item.code"
-                    ></el-option>
-                </el-select>
+                <span class="label">到期时间</span>
+                <el-date-picker
+                    v-model="dueTimeRange"
+                    type="daterange"
+                    format="yyyy-MM-dd"
+                    value-format="yyyy-MM-dd"
+                    range-separator="至"
+                    start-placeholder="开始日期"
+                    end-placeholder="结束日期"
+                >
+                </el-date-picker>
             </template>
             <template slot="searchBtn1">
-                <el-button type="primary">查询</el-button>
+                <el-button type="primary" @click="doSearch">查询</el-button>
             </template>
             <template slot="searchBtn2">
-                <el-button type="primary">重置</el-button>
+                <el-button type="primary" @click="reset">重置</el-button>
             </template>
         </search-layout>
 
-        <div class="btnsPanel">
+        <!--<div class="btnsPanel">
             <el-button
                 type="primary"
                 icon="el-icon-circle-plus-outline"
                 @click="addConfig"
                 >新建配置</el-button
             >
-        </div>
+        </div>-->
 
+        <div style="border-top: none; margin: 30px 40px 10px 40px">
+            <span>仿真软件已分配未到期节点数量:{{totalSimulation}}</span>
+            <span style="margin-left: 20%">动力学软件已分配未到期节点数量:{{totalDynamic}}</span>
+        </div>
         <tableList
             ref="table"
             style="border-top: none; margin: 0 30px"
@@ -47,7 +66,6 @@
             :getDataWay="getDataWay"
             :pagination="pagination"
             index
-            selection
         >
             <el-table-column label="操作" slot="cgInfos" align="center">
                 <template v-slot="scope">
@@ -55,10 +73,6 @@
                         @click="addMarkDia(scope.row)"
                         class="el-icon-edit-outline elIcon"
                     ></i>
-                    <i
-                        @click="addMarkDia(scope.row)"
-                        class="el-icon-video-pause elIcon"
-                    ></i>
                 </template>
             </el-table-column>
         </tableList>
@@ -76,26 +90,42 @@ export default {
         return {
             searchParams: {
                 //搜索参数
-
+                userName: "",
+                dueTimeStart: "",
+                dueTimeEnd: "",
+                modifyTimeStart: "",
+                modifyTimeEnd: ""
             },
+            modifyTimeRange:[],
+            dueTimeRange:[],
             list: [],
+            totalSimulation:0,
+            totalDynamic:0,
             columns: [
                 //表格列
                 {
-                    label: "节点ID",
-                    prop: "a1",
+                    label: "账户名称",
+                    prop: "userName",
                 },
                 {
-                    label: "节点类型",
-                    prop: "a2",
+                    label: "独占类型",
+                    prop: "userType",
                 },
                 {
-                    label: "适用类型",
-                    prop: "a3",
+                    label: "仿真软件license",
+                    prop: "numSimulationLicense",
                 },
                 {
-                    label: "分配账户",
-                    prop: "a4",
+                    label: "到期时间",
+                    prop: "dateSimulationLicense",
+                },
+                {
+                    label: "动力学软件license",
+                    prop: "numDynamicLicense",
+                },
+                {
+                    label: "到期时间",
+                    prop: "dateDynamicLicense",
                 },
                 {
                     label: "操作",
@@ -112,21 +142,62 @@ export default {
                 layout: "sizes, total, prev, pager, next, jumper",
             },
             getDataWay: {
-                //dataType: "url",
-                dataType: "data",
+                dataType: "url",
                 type: "post",
-                // firstRequest: false,
-                // data: this.$api.algorithmsLibrary.selectSharedAlgorithmList,
-                data:[{a1:'1',a2:'2',a3:'3',a4:'4',a5:'5',a6:'6'}],
+                data: this.$api.systemManagement.getClusterList,
                 param: {},
             },
         };
     },
+    created(){
+        //获取未到期已分配节点数量
+        this.$axios({
+            method:'POST',
+            url:this.$api.systemManagement.getClusterNum,
+            data:{}
+        }).then(res=>{
+            if(res.code=='200'){
+                this.totalSimulation=res.info.totalSimulation
+                this.totalDynamic=res.info.totalDynamic
+            }
+        })
+    },
     methods: {
+        doSearch(){
+            this.searchParams.modifyTimeStart=this.modifyTimeRange[0]||''
+            this.searchParams.modifyTimeEnd=this.modifyTimeRange[1]||''
+            this.searchParams.dueTimeStart=this.modifyTimeRange[0]||''
+            this.searchParams.dueTimeEnd=this.modifyTimeRange[1]||''
+            this.refreshList(this.searchParams)
+        },
+        reset(){
+            this.searchParams = {
+                userName: "",
+                dueTimeStart: "",
+                dueTimeEnd: "",
+                modifyTimeStart: "",
+                modifyTimeEnd: ""
+            }
+            this.modifyTimeRange=[]
+            this.dueTimeRange=[]
+        },
+        refreshList(param) {
+            param
+                ? this.$refs["table"].loadData(param)
+                : this.$refs["table"].loadData();
+        },
         addConfig() {
-            this.$router.push({ path: "/clusteringDetail" });
+            this.$router.push({
+                path:'/clusteringDetail'
+            })
+        },
+        addMarkDia(row) {
+            let query = {...row}
+            this.$router.push({
+                path:'/clusteringDetail',
+                query
+            })
         },
-        addMarkDia() {},
     },
 };
 </script>

+ 2 - 0
src/views/systemManagement/parameterDetail.vue

@@ -94,6 +94,7 @@ export default {
             this.form = {...this.$route.query}
             delete this.form.modifyTime
         }
+        /*获取修改历史
         this.$axios({
             method:'POST',
             url:this.$api.systemManagement.getParamHistory,
@@ -101,6 +102,7 @@ export default {
                 userId: this.$route.query.userId
             }
         })
+        */
     },
     methods: {
         save(){