<template>
  <el-col :span="22" :offset="1">
    <el-card>
      <div slot="header" class="clearfix">
        <span>公共配置</span>
      </div>
      <el-form ref="form" :model="ruleEngineCommonConfig" label-width="120px">
        <el-row>
          <el-col :span="12">
            <el-form-item label="规则基础目录">
              <el-input v-model="ruleEngineCommonConfig.packageName" disabled></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">

          </el-col>
        </el-row>
      </el-form>
    </el-card>
    <el-col>
      <el-card>
        <div slot="header" class="clearfix">
          <span>作用域</span>
        </div>
        <el-tabs type="border-card">
          <el-tab-pane v-for="scope in scopeList" :label="scope.type" :name="scope.value">
            <encoding v-model="scope.code"></encoding>
          </el-tab-pane>
        </el-tabs>
      </el-card>
    </el-col>
  </el-col>

</template>

<script>

import Encoding from "@/components/Encoding/index.vue";

export default {
  name: "EngineConfig",
  components: {Encoding},
  data() {
    return {
      code: "",
      ruleEngineCommonConfig: {
        packageName: "com.muyu.rule.engine",
      },
      scopeList: [
        { type: "任务", value: "taskContext", "code":
            "package com.muyu;\n" +
            "\n" +
            "import com.muyu.scope.DataModelContext;\n" +
            "import com.muyu.scope.DataSetContext;\n" +
            "import com.muyu.scope.RecordContext;\n" +
            "import com.muyu.scope.TaskContext;\n" +
            "\n" +
            "/**\n" +
            " * @Author: DongZeLiang\n" +
            " * @date: 2024/4/29\n" +
            " * @Description: ceshi\n" +
            " * @Version: 1.0\n" +
            " */\n" +
            "public class Main {\n" +
            "    public static void main (String[] args) {\n" +
            "        TaskContext taskContext = TaskContext.build();\n" +
            "        RecordContext recordContext = new RecordContext(taskContext);\n" +
            "        DataSetContext dataSetContext = new DataSetContext(recordContext);\n" +
            "        DataModelContext dataModelContext = new DataModelContext(dataSetContext);\n" +
            "    }\n" +
            "}"
        },
        { type: "资产集", value: "recordContext", "code":
            "package com.muyu;\n" +
            "\n" +
            "import com.muyu.scope.DataModelContext;\n" +
            "import com.muyu.scope.DataSetContext;\n" +
            "import com.muyu.scope.RecordContext;\n" +
            "import com.muyu.scope.TaskContext;\n" +
            "\n" +
            "/**\n" +
            " * @Author: DongZeLiang\n" +
            " * @date: 2024/4/29\n" +
            " * @Description: ceshi\n" +
            " * @Version: 1.0\n" +
            " */\n" +
            "public class Main {\n" +
            "    public static void main (String[] args) {\n" +
            "        TaskContext taskContext = TaskContext.build();\n" +
            "        RecordContext recordContext = new RecordContext(taskContext);\n" +
            "        DataSetContext dataSetContext = new DataSetContext(recordContext);\n" +
            "        DataModelContext dataModelContext = new DataModelContext(dataSetContext);\n" +
            "    }\n" +
            "}" },
        { type: "资产记录", value: "dataSetContext", "code":
            "package com.muyu;\n" +
            "\n" +
            "import com.muyu.scope.DataModelContext;\n" +
            "import com.muyu.scope.DataSetContext;\n" +
            "import com.muyu.scope.RecordContext;\n" +
            "import com.muyu.scope.TaskContext;\n" +
            "\n" +
            "/**\n" +
            " * @Author: DongZeLiang\n" +
            " * @date: 2024/4/29\n" +
            " * @Description: ceshi\n" +
            " * @Version: 1.0\n" +
            " */\n" +
            "public class Main {\n" +
            "    public static void main (String[] args) {\n" +
            "        TaskContext taskContext = TaskContext.build();\n" +
            "        RecordContext recordContext = new RecordContext(taskContext);\n" +
            "        DataSetContext dataSetContext = new DataSetContext(recordContext);\n" +
            "        DataModelContext dataModelContext = new DataModelContext(dataSetContext);\n" +
            "    }\n" +
            "}" },
        { type: "资产模型", value: "dataModelContext", "code":
            "package com.muyu;\n" +
            "\n" +
            "import com.muyu.scope.DataModelContext;\n" +
            "import com.muyu.scope.DataSetContext;\n" +
            "import com.muyu.scope.RecordContext;\n" +
            "import com.muyu.scope.TaskContext;\n" +
            "\n" +
            "/**\n" +
            " * @Author: DongZeLiang\n" +
            " * @date: 2024/4/29\n" +
            " * @Description: ceshi\n" +
            " * @Version: 1.0\n" +
            " */\n" +
            "public class Main {\n" +
            "    public static void main (String[] args) {\n" +
            "        TaskContext taskContext = TaskContext.build();\n" +
            "        RecordContext recordContext = new RecordContext(taskContext);\n" +
            "        DataSetContext dataSetContext = new DataSetContext(recordContext);\n" +
            "        DataModelContext dataModelContext = new DataModelContext(dataSetContext);\n" +
            "    }\n" +
            "}" }
      ]
    }
  },
  created() {
  },
  methods: {}
}
</script>

<style>
.el-col {
  margin-top: 20px;
}
</style>
