<template>
  <el-drawer append-to-body
             title="更多设置"
             class="avue-dialog"
             v-model="box"
             size="40%">
    <el-form label-width="90px">
      <el-form-item label="全局请求地址">
        <avue-input v-model="contain.config.url"
                    placeholder="/"></avue-input>
      </el-form-item>
      <el-form-item label="全局请求参数">
        <avue-highlight height="100"
                        v-model="contain.config.query"></avue-highlight>
        <el-button class="el-button--edit"
                   type="primary"
                   icon="el-icon-edit"
                   @click="contain.openCode({type:'query',title:'全局请求参数'})">编辑</el-button>
      </el-form-item>
      <el-form-item label="全局请求头">
        <avue-highlight height="100"
                        v-model="contain.config.header">
        </avue-highlight>
        <el-button class="el-button--edit"
                   type="primary"
                   icon="el-icon-edit"
                   @click="contain.openCode({type:'header',title:'全局请求头'})">编辑</el-button>
      </el-form-item>
      <el-form-item label="大屏渲染前">
        <avue-highlight height="100"
                        v-model="contain.config.before">
        </avue-highlight>
        <el-button class="el-button--edit"
                   type="primary"
                   icon="el-icon-edit"
                   @click="contain.openCode({type:'before',title:'大屏渲染前'})">编辑</el-button>
      </el-form-item>
      <el-form-item label="全局CSS样式">
        <avue-highlight height="100"
                        v-model="contain.config.style">
        </avue-highlight>
        <el-button class="el-button--edit"
                   type="primary"
                   icon="el-icon-edit"
                   @click="contain.openCode({type:'style',title:'全局CSS样式'})">编辑</el-button>
      </el-form-item>
      <el-form-item label="全局外链">
        <avue-highlight height="100"
                        v-model="contain.config.links">
        </avue-highlight>
        <el-button class="el-button--edit"
                   type="primary"
                   icon="el-icon-edit"
                   @click="contain.openCode({type:'links',title:'全局外链',isObject:true})">编辑</el-button>
      </el-form-item>
    </el-form>
    <span class="avue-dialog__footer avue-dialog__footer--right">
      <el-button type="danger"
                 icon="el-icon-close"
                 @click="box=false">关闭</el-button>
    </span>
  </el-drawer>
</template>
<script>
import MonacoEditor from '@/page/components/monaco-editor'
import { isObject } from 'lodash';
export default {
  inject: ["contain"],
  components: {
    MonacoEditor
  },
  data () {
    return {
      box: false
    }
  }
}
</script>
<style>
</style>