From a309bec35fdd1ed22f2debd89f0c266e8e3aaef4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 2 Jul 2019 10:22:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/config/webpack.config.dev.js | 30 ++++---- .../modules/tpm/TPMsettings/TPMsettings.js | 72 ++++++++++--------- 2 files changed, 52 insertions(+), 50 deletions(-) diff --git a/public/react/config/webpack.config.dev.js b/public/react/config/webpack.config.dev.js index ceddbd81b..dfd54f38b 100644 --- a/public/react/config/webpack.config.dev.js +++ b/public/react/config/webpack.config.dev.js @@ -114,21 +114,21 @@ module.exports = { // First, run the linter. // It's important to do this before Babel processes the JS. // 上线然后要注释回来 - // { - // test: /\.(js|jsx|mjs)$/, - // enforce: 'pre', - // use: [ - // { - // options: { - // formatter: eslintFormatter, - // eslintPath: require.resolve('eslint'), - // - // }, - // loader: require.resolve('eslint-loader'), - // }, - // ], - // include: paths.appSrc, - // }, + { + test: /\.(js|jsx|mjs)$/, + enforce: 'pre', + use: [ + { + options: { + formatter: eslintFormatter, + eslintPath: require.resolve('eslint'), + + }, + loader: require.resolve('eslint-loader'), + }, + ], + include: paths.appSrc, + }, { // "oneOf" will traverse all following loaders until one will // match the requirements. When no loader matches it will fall diff --git a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js index 297802985..5791db82c 100644 --- a/public/react/src/modules/tpm/TPMsettings/TPMsettings.js +++ b/public/react/src/modules/tpm/TPMsettings/TPMsettings.js @@ -223,6 +223,7 @@ export default class TPMsettings extends Component { newuse_scope:undefined, scope_partments:0, shixun_service_configs:undefined, + shixun_service_configlist:undefined, pod_exist_time: undefined, pod_exist_timetype: false, shixunmemoMDvalue:"", @@ -325,7 +326,8 @@ export default class TPMsettings extends Component { newuse_scope:response.data.shixun.use_scope, scope_partments: response.data.shixun.scope_partment.length, shixunmemoMDvalue:response.data.shixun.evaluate_script, - shixun_service_configs:response.data.shixun.shixun_service_configs + shixun_service_configs:response.data.shixun.shixun_service_configs, + shixun_service_configlist:response.data.shixun.shixun_service_configs, }) // if(response.data.status===403){ @@ -490,14 +492,14 @@ export default class TPMsettings extends Component { } shixun_vnc=(e)=>{ - let sum = "" - if (e.target.checked === false) { - sum = 0 - } else if (e.target.checked === true) { - sum = 1 - } + // let sum = "" + // if (e.target.checked === false) { + // sum = 0 + // } else if (e.target.checked === true) { + // sum = 1 + // } this.setState({ - vnc: sum, + vnc: e.target.checked, }); } @@ -539,7 +541,8 @@ export default class TPMsettings extends Component { choice_main_type: value, standard_scripts:response.data, choice_standard_scripts:null, - shixun_service_configs:newshixun_service_configs + shixun_service_configs:newshixun_service_configs, + shixun_service_configlist:newshixun_service_configs, }) } }).catch((error) => { @@ -575,7 +578,8 @@ export default class TPMsettings extends Component { this.setState({ choice_small_type: newchoice_small_type, - shixun_service_configs:newshixun_service_configs + shixun_service_configs:newshixun_service_configs, + shixun_service_configlist:newshixun_service_configs, }) } littleClass = (value) => { @@ -620,7 +624,8 @@ export default class TPMsettings extends Component { this.setState({ choice_small_type: newchoice_small_type, - shixun_service_configs:newshixun_service_configs + shixun_service_configs:newshixun_service_configs, + shixun_service_configlist:newshixun_service_configs, }) } onPodExistTimeChange = (e) => { @@ -681,12 +686,15 @@ export default class TPMsettings extends Component { // } submit_edit_shixun = () => { let { - name, description, choice_main_type, choice_small_type, choice_standard_scripts, scope_partment, choice_standard_scriptssum, - evaluate_script, exec_time, webssh, use_scope, trainee, can_copy, task_pass, test_set_permission, hide_code, code_hidden, forbid_copy, vnc,multi_webssh, - opening_time, pod_exist_time,shixunmemoMDvalue,shixun_service_configs + name, choice_main_type, choice_small_type, choice_standard_scripts, scope_partment, choice_standard_scriptssum, + evaluate_script, webssh, use_scope, trainee, can_copy, task_pass, test_set_permission, hide_code, code_hidden, forbid_copy, vnc,multi_webssh, + opening_time,shixunmemoMDvalue,shixun_service_configlist } = this.state; - console.log(shixun_service_configs) + shixun_service_configlist.map((item,key)=>{ + delete item.name; + }) + let operateauthority=this.props.identity<5&&this.state.status==0||this.props.identity===1&&this.state.status==2||this.props.identity===1&&this.state.status==1; const description_editormd = this.description_editormd.getValue(); @@ -769,14 +777,10 @@ export default class TPMsettings extends Component { let id = this.props.match.params.shixunId; let newmulti_webssh=multi_webssh; - if(newmulti_webssh===true){ - newmulti_webssh=1 - }else{ - newmulti_webssh=0 - } + if(newmulti_webssh===null){ - newmulti_webssh=0 + newmulti_webssh=false } //exec_time: exec_time, let Url = `/shixuns/` + id + `.json`; @@ -786,18 +790,16 @@ export default class TPMsettings extends Component { webssh: webssh, user_scope: use_scope, can_copy: can_copy, - vnc: vnc, + vnc: vnc===null?undefined:vnc, test_set_permission: test_set_permission, code_hidden: code_hidden, trainee: trainee, task_pass: task_pass, - standard_scripts: choice_standard_scripts, hide_code: hide_code, forbid_copy: forbid_copy, multi_webssh:newmulti_webssh, opening_time:opening_time, mirror_script_id:choice_standard_scriptssum, - delType:1 }, shixun_info:{ description: description_editormd, @@ -806,7 +808,7 @@ export default class TPMsettings extends Component { main_type: choice_main_type, small_type: choice_small_type, scope_partment: scope_partment, - shixun_service_configs:shixun_service_configs + shixun_service_configs:shixun_service_configlist } axios.put(Url, data).then((response) => { @@ -1030,14 +1032,14 @@ export default class TPMsettings extends Component { }) } - bigopen=(e)=>{ + bigopen=()=>{ this.setState({ opers:true }) } - bigopens=(e)=>{ + bigopens=()=>{ this.setState({ opers:false, operss:false, @@ -1188,7 +1190,7 @@ export default class TPMsettings extends Component { let operateauthority=this.props.identity===1?true:this.props.identity<5&&this.state.status==0?true:false; return ( -
+
配置 @@ -1789,13 +1791,13 @@ export default class TPMsettings extends Component {
- {/*
*/} - {/*VNC图形化:*/} - {/**/} - {/**/} - {/**/} - {/**/} - {/*
*/} +
+ VNC图形化: + + + + +
{/*"name": "我是镜像名", # 镜像名称*/}