    <template>
      <div class="Infrastruture">
        <template v-if="InfrasShowAdd">
          <div class="head-title">
            基础设置
          </div>
          <div class="content">
            <div>
              <el-form label-width="130px">
                <el-tabs v-model="activeName">
                  <el-tab-pane label="基础设置" name="first">
                    <el-form-item label="修改密码状态">
                      <el-switch v-model="msg.IsUpdatePwd" :active-value="1" :inactive-value="0" active-color="#409EFF"
                        inactive-color="#ff4949">
                      </el-switch>
                    </el-form-item>
                  </el-tab-pane>
                  <el-tab-pane label="员工登录页设置" name="second">
                    <el-row>
                      <div class="el-col el-col-12">
                        <el-form-item label="员工页面LOGO" size="small">
                          <el-input v-model="msg.Logo">
                            <el-tooltip slot="append" class="item" effect="dark" content="建议尺寸:325 * 325"
                              placement="top-start">
                              <el-button @click="choicImg=true">上传图片</el-button>
                            </el-tooltip>
                          </el-input>
                          <div v-if="msg.Logo==''">建议尺寸98*36</div>
                          <img v-else :src="getIconLink(msg.Logo)" style="height:36px;" alt="" />
                        </el-form-item>
                        <el-form-item label="员工页面版权信息" size="small">
                          <el-input v-model="msg.Copyright"></el-input>
                        </el-form-item>
                        <el-form-item label="员工页面版权链接" size="small">
                          <el-input placeholder="例如:https://www.baidu.com" v-model="msg.CopyrightLink"></el-input>
                        </el-form-item>
                      </div>
                    </el-row>
                  </el-tab-pane>
                </el-tabs>
              </el-form>
            </div>
          </div>
          <el-button style="margin-top:20px;padding:9px 25px;" type="primary" @click="saveMsg()" size="small">保存
          </el-button>
        </template>
        <!-- 选择图片文件 -->
        <el-dialog title="选择文件" :visible.sync="choicImg" width="1240px">
          <ChooseImg @SelectId="SelectId"></ChooseImg>
        </el-dialog>
      </div>
    </template>
    <script>
      import ChooseImg from "@/components/global/ChooseImg.vue";
      export default {
        data() {
          return {
            msg: {
              ConfigId: 0,
              IsUpdatePwd: 1, //0不能修改 1可以修改
              Logo: '', //员工页面LOGO
              Copyright: "", //员工页面版权信息
              CopyrightLink: '' //员工页面版权链接
            },
            activeName: 'first',
            InfrasShowAdd: true,
            //选择图片弹窗
            choicImg: false,
          };
        },
        components: {
          ChooseImg
        },

        created() {

        },
        methods: {
          //获取信息
          GetEmpConfigList() {
            this.apipost("/api/Employee/GetEmpConfigList", {
              ConfigId: 0
            }, res => {
              if (res.data.resultCode == 1) {
                var jsonData = res.data.data;
                if (jsonData) {
                  this.msg.ConfigId = jsonData.ConfigId;
                  this.msg.IsUpdatePwd = jsonData.IsUpdatePwd;
                  this.msg.Logo = jsonData.Logo;
                  this.msg.Copyright = jsonData.Copyright;
                  this.msg.CopyrightLink = jsonData.CopyrightLink;
                }
              } else {
                this.Info(res.data.message);
              }
            })
          },
          //保存信息
          saveMsg() {
            this.apipost("/api/Employee/SetEmpConfig", this.msg, res => {
              if (res.data.resultCode == 1) {
                this.GetEmpConfigList();
                this.Success(res.data.message);
              } else {
                this.Info(res.data.message);
              }
            })
          },
          //选择图片
          SelectId(msg) {
            this.msg.Logo = this.getIconLink(msg.url);
            this.choicImg = false;
          },

        },
        mounted() {
          this.GetEmpConfigList();
        }
      };

    </script>
    <style>
      .Infrastruture .content {
        background: #fff;
        margin-top: 10px;
        padding: 20px;
        box-sizing: border-box;
      }

    </style>
