浏览代码

添加新增信息模板,更新依赖vue-dev-server到最新版本。需要升级webpack到5.0以上版本

尹帮元 2 年之前
父节点
当前提交
712f5d346a

+ 6 - 4
package.json

@@ -50,6 +50,7 @@
     "js-beautify": "1.13.0",
     "js-cookie": "3.0.1",
     "jsencrypt": "3.0.0-rc.1",
+    "node-polyfill-webpack-plugin": "^2.0.1",
     "nprogress": "0.2.0",
     "quill": "1.3.7",
     "screenfull": "5.0.2",
@@ -63,9 +64,9 @@
     "vuex": "3.6.0"
   },
   "devDependencies": {
-    "@vue/cli-plugin-babel": "4.4.6",
-    "@vue/cli-plugin-eslint": "4.4.6",
-    "@vue/cli-service": "4.4.6",
+    "@vue/cli-plugin-babel": "5.0.8",
+    "@vue/cli-plugin-eslint": "5.0.8",
+    "@vue/cli-service": "5.0.8",
     "babel-eslint": "10.1.0",
     "babel-plugin-dynamic-import-node": "2.3.3",
     "chalk": "4.1.0",
@@ -79,7 +80,8 @@
     "sass-loader": "10.1.1",
     "script-ext-html-webpack-plugin": "2.1.5",
     "svg-sprite-loader": "5.1.1",
-    "vue-template-compiler": "2.6.12"
+    "vue-template-compiler": "2.6.12",
+    "webpack": "^5.88.2"
   },
   "engines": {
     "node": ">=8.9",

+ 1 - 1
src/assets/styles/variables.scss

@@ -11,7 +11,7 @@ $panGreen: #30B08F;
 // 默认菜单主题风格
 $base-menu-color:#bfcbd9;
 $base-menu-color-active:#f4f4f5;
-$base-menu-background:#304156;
+$base-menu-background:#f1f1f1;
 $base-logo-title-color: #ffffff;
 
 $base-menu-light-color:rgba(0,0,0,.70);

+ 71 - 0
src/components/btnTip/index.vue

@@ -0,0 +1,71 @@
+<template>
+  <div class="btn-tip">
+    <el-popover ref="popover" placement="top" :width="popoverWidth" v-model="visible">
+      <p>{{tip}}</p>
+      <div style="text-align: right; margin: 0">
+        <el-button :size="size" type="text" @click="visible = false">取消</el-button>
+        <el-button type="primary" size="mini" @click="onConfirm">确定</el-button>
+      </div>
+    </el-popover>
+    <el-button
+      class="w-full"
+      :disabled="disabled"
+      :type="type"
+      :size="size"
+      v-bind="$attrs"
+      v-popover:popover
+      @click.stop
+    >
+      <slot></slot>
+    </el-button>
+  </div>
+</template>
+
+<script>
+export default {
+  data() {
+    return {
+      visible: false
+    };
+  },
+  props: {
+    type: {
+      default: "danger"
+    },
+    size: {
+      default: ""
+    },
+    tip: {
+      default: "确定要删除数据吗?"
+    },
+    disabled: {
+      default: false
+    },
+    popoverWidth: {
+      default: 160
+    }
+  },
+  methods: {
+    onConfirm() {
+      this.visible = false;
+      this.$emit("click");
+    }
+  }
+};
+</script>
+
+<style lang="scss" >
+.btn-tip {
+  display: inline-block;
+}
+.el-button + .btn-tip {
+  margin-left: 10px;
+}
+.btn-tip + .el-button {
+  margin-left: 10px;
+}
+.btn-tip + .btn-tip {
+  margin-left: 10px;
+}
+</style>
+

+ 166 - 0
src/components/orgTreeSelect/index.vue

@@ -0,0 +1,166 @@
+<template>
+    <!--  弹出框  -->
+    <el-popover
+      placement="bottom-start"
+      v-model="visible">
+
+      <el-input style="width: 100%;margin-bottom: 20px;" v-model="queryForm.value" placeholder="请输入过滤值" clearable></el-input>
+      <el-row :gutter="20" type="flex" align="middle">
+        <el-col :span="14" :xs="24">
+          <el-select  v-model="queryForm.type" placeholder="请选择过滤机构类型" clearable>
+            <el-option
+              v-for="dict in dict.type.org_type_number"
+              :key="dict.value"
+              :label="dict.label"
+              :value="`${dict.value}`"
+            ></el-option>
+          </el-select>
+        </el-col>
+        <el-col :span="10" :xs="24" >
+          <el-checkbox v-model="isIncludeSub">按过滤机构类型勾选</el-checkbox>
+        </el-col>
+      </el-row>
+
+      <div class="tree-box">
+        <el-tree
+          ref="tree"
+          :data='orgTree'
+          :props="props"
+          node-key="id"
+          show-checkbox
+          check-strictly
+          :default-expand-all="showAll"
+          :expand-on-click-node="false"
+          :default-checked-keys="defaultNode"
+          @node-click="handleNodeClick"
+          @check="onCheck"
+          :filter-node-method="filterNode">
+        </el-tree>
+      </div>
+
+
+      <!--  选中的值  -->
+      <div slot="reference" class="tags-box"></div>
+  </el-popover>
+</template>
+
+<script>
+import {deptTreeSelect} from "@/api/system/user";
+
+export default {
+  dicts:['org_type_number'],
+  data (){
+    return {
+      visible:false,
+      orgTree:null,
+      props: {
+        label: 'name',
+      },
+      queryForm:{
+        value:null,
+        type:null,
+      },
+      isIncludeSub:false,
+      defaultNode:[],
+      selectNode:[],
+      showAll:false
+    }
+  },
+  mounted(){
+    this.getDeptTree();
+  },
+  watch: {
+    queryForm:{
+      deep:true,
+      handler(n,o) {
+        this.$refs.tree.filter(n);
+      },
+    },
+  },
+  methods:{
+    /** 查询机构树 */
+    getDeptTree() {
+      deptTreeSelect().then(response => {
+        this.orgTree = response.data;
+      });
+    },
+    filterNode(value,data,node){
+      if (this.queryForm.value && this.queryForm.type) {
+        return data.name.indexOf(this.queryForm.value) >= 0 && data.type == this.queryForm.type;
+      }
+      if (this.queryForm.value) {
+        return data.name.indexOf(this.queryForm.value) >= 0;
+      }
+      if (this.queryForm.type) {
+        return data.type == this.queryForm.type;
+      }
+      console.log('ttttt')
+      this.showAll = false;
+      return true
+    },
+    handleNodeClick(){
+
+    },
+    onCheck(data, checked, tree) {
+        if (this.queryForm.type && this.isIncludeSub) {
+          let subOrgIds = [];
+          let currentCheckedIndex = checked.checkedKeys.findIndex(
+            (x) => {
+              x == data.id
+            }
+          );
+          checked.checkedKeys.splice(currentCheckedIndex, 1);
+          let checkValue = currentCheckedIndex > -1;
+          this.getSubOrgIdsByOrgType(data, this.queryForm.type, subOrgIds);
+          console.log(subOrgIds,checkValue,'subOrgIds')
+          if (!checkValue) {
+            subOrgIds.forEach((x) => checked.checkedKeys.push(x.id));
+          } else {
+            subOrgIds.forEach((x) => {
+              let index = checked.checkedKeys.findIndex((y) => x.id == y);
+              if (index > -1) {
+                checked.checkedKeys.splice(index, 1);
+              }
+            });
+          }
+          console.log(checked,'checked')
+          this.$refs.tree.setCheckedKeys(checked.checkedKeys);
+      }
+      const dataList = this.$refs.tree.getCheckedNodes();
+      this.$emit("selectNode", JSON.stringify(dataList));
+    },
+    getSubOrgIdsByOrgType(topOrg, orgType, orgIdList) {
+        if (!topOrg) return;
+        if (topOrg.type == orgType) {orgIdList.push(topOrg)};
+        if (topOrg.children && topOrg.children.length > 0) {
+          topOrg.children.forEach((item) => {
+            this.getSubOrgIdsByOrgType(item, orgType, orgIdList);
+          });
+        }
+    },
+  }
+}
+</script>
+
+<style scoped lang="scss">
+  .tags-box{
+    background-color: #fff;
+    border-radius: 4px;
+    border: 1px solid #DCDFE6;
+    box-sizing: border-box;
+    color: #606266;
+    display: inline-block;
+    outline: 0;
+    padding: 0 15px;
+    width: 100%;
+    height: 36px;
+    line-height: 36px;
+  }
+  .tree-box{
+    margin-top: 20px;
+    max-height: 300px;
+    overflow: auto;
+    border-radius: 4px;
+    border: 1px solid #DCDFE6;
+  }
+</style>

+ 440 - 0
src/views/system/workTimeSet/dialog.template.vue

@@ -0,0 +1,440 @@
+<template>
+  <div class="question-infos">
+    <el-dialog :title="id? '编辑作息模版':'新增作息模版'" @close="handleClose" :visible.sync="isShow" :close-on-click-modal="false"
+      custom-class="gxDialog" width="75%" top="10vh" append-to-body>
+<!--      <div class="p-5 work-time-modify">-->
+        <el-form
+            label-width="140px"
+            :rules="rules"
+            label-suffix=":"
+            label-position="left">
+          <el-form-item>
+            <span slot="label"> <span style="color: red"> * </span>机构 </span>
+            <org-tree-select
+                ref="tree"
+                multiple
+                orgTypeFilter
+                :strictly="true"
+                :active-value="formData.orgIdList"
+                v-model="data.orgIdList"
+                :disabled="data.disabled"
+                :clearable="!data.disabled"
+                :style="id? 'background-color: #f5f7fa;color: #c0c4cc;': ''"
+            ></org-tree-select>
+          </el-form-item>
+          <el-form-item >
+            <span slot="label"> <span style="color: red"> * </span>生效日期 </span>
+            <el-date-picker  v-model="formData.effectiveDate"  :disabled="data.disabled"
+                             :clearable="!data.disabled" :picker-options="startDatepickerOptions"  popper-class="no-atTheMoment"  type="date" placeholder="请选择日期">
+            </el-date-picker>
+          </el-form-item>
+          <div style="color: red">
+            (保存后生成或更新本月或下月生效日期后的每日作息)
+          </div>
+          <!--  -->
+          <div class="grid">
+            <div class="title">
+              <span style="color: red"> * </span>作息设置(勾选表示当日正常上班)
+            </div>
+            <div class="box">
+              <el-table class="w-auto" border :data="formData.dayOfWeeks">
+                <el-table-column label="星期" width="60px" prop="dayOfWeekText">
+                </el-table-column>
+                <el-table-column label="营业状态" width="180px">
+                  <template slot-scope="r">
+                    <el-radio-group
+                        v-model="r.row.isWorkday"
+                        @change="onEnableChange(r.row)"
+                    >
+                      <el-radio text-color="#48bb78" :label="true">营业</el-radio>
+                      <el-radio text-color="#f56565" :label="false">歇业</el-radio>
+                    </el-radio-group>
+                  </template>
+                </el-table-column>
+                <el-table-column label="上班时间">
+                  <template slot-scope="r">
+                    <el-time-select
+                        :picker-options="pickerOptions"
+                        :disabled="!r.row.isWorkday || r.row.isWorkday === false"
+                        v-model="r.row.workTime"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column label="营业时间">
+                  <template slot-scope="r">
+                    <el-time-select
+                        :picker-options="pickerOptions"
+                        :disabled="!r.row.isWorkday || r.row.isWorkday === false"
+                        v-model="r.row.openTime"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column label="午休开始">
+                  <template slot-scope="r">
+                    <el-time-select
+                        :picker-options="pickerOptions"
+                        :disabled="!r.row.isWorkday || r.row.isWorkday === false"
+                        v-model="r.row.noonbreakStart"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column label="午休结束">
+                  <template slot-scope="r">
+                    <el-time-select
+                        :picker-options="pickerOptions"
+                        :disabled="!r.row.isWorkday || r.row.isWorkday === false"
+                        v-model="r.row.noonbreakEnd"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column label="营业终了">
+                  <template slot-scope="r">
+                    <el-time-select
+                        :picker-options="pickerOptions"
+                        :disabled="!r.row.isWorkday || r.row.isWorkday === false"
+                        v-model="r.row.closeTime"
+                    />
+                  </template>
+                </el-table-column>
+                <el-table-column label="下班时间">
+                  <template slot-scope="r">
+                    <el-time-select
+                        :picker-options="pickerOptions"
+                        :disabled="!r.row.isWorkday || r.row.isWorkday === false"
+                        v-model="r.row.workOffTime"
+                    />
+                  </template>
+                </el-table-column>
+
+              </el-table>
+
+            </div>
+          </div>
+        </el-form>
+<!--      </div>-->
+      <div slot="footer" class="dialog-footer">
+        <el-button @click="onHide">取消</el-button>
+        <btn-tip tip="确定要提交吗?" type="primary" @click="onSubmit">保存</btn-tip>
+      </div>
+    </el-dialog>
+    <el-dialog
+        title="提示"
+        :visible="centerDialogVisible"
+        width="25%"
+        @close="centerDialogVisible=false"
+        center>
+      <span>所选机构中在当前生效日期内已有按指定日期配置的作息数据,是否覆盖按指定日期配置的作息数据?</span>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="submitData(0)">不覆盖</el-button>
+        <el-button type="primary" @click="submitData(1)">覆盖</el-button>
+      </span>
+    </el-dialog>
+
+    <el-dialog
+        title="提示"
+        :visible="centerDialogVisiblea"
+        width="25%"
+        @close="centerDialogVisiblea=false"
+        center>
+      <span>已存在其他生效的配置,将会生成{{checkMsg}}的作息,是否提交?</span>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="checkDataMsg(0)">取消</el-button>
+        <el-button type="primary" @click="checkDataMsg(1)">提交</el-button>
+      </span>
+    </el-dialog>
+  </div>
+</template>
+<script>
+
+import BtnTip from "@/components/btnTip";
+import OrgTreeSelect from '@/components/orgTreeSelect'
+//import { timeCheck } from "@/util/util";
+export default {
+  components:{BtnTip,OrgTreeSelect},
+  data() {
+    let { params, query } = this.$route;
+    return {
+      isShow: false,
+      id:null,
+      orgId:null,
+      orgTree:null,
+      formData: {
+        orgIdList: [],
+        dayOfWeeks: [],
+      },
+      data: {
+        orgIdList: [],
+        disabled: false,
+      },
+      rules: {
+        orgIdList: [
+          {
+            required: true,
+            message: "请选择机构",
+            trigger: "change",
+          },
+        ],
+      },
+      options: [
+        {
+          value: new Date().getFullYear(),
+          label: new Date().getFullYear(),
+        },
+        {
+          value: new Date().getFullYear() + 1,
+          label: new Date().getFullYear() + 1,
+        },
+      ],
+      pickerOptions: {
+        start: "00:00",
+        step: "00:10",
+        end: "24:00",
+      },
+      startDatepickerOptions: {
+        disabledDate(time) {
+          const date = new Date();
+          date.setTime(date.getTime() );
+          return time.getTime() < date;
+        },
+      },
+      centerDialogVisible: false,
+      centerDialogVisiblea:false,
+      checkData:null,
+      checkMsg:null,
+    };
+  },
+  props: {},
+  watch: {
+    year() {
+      this.getData();
+    },
+  },
+  mounted() {
+    this.getData();
+  },
+  computed: {},
+  methods: {
+    add(tree){
+      this.orgTree = tree;
+      this.isShow = true;
+    },
+   // ...mapMutations([]),
+    async refresh() {},
+
+    async show(id,orgId, other = {}) {
+      console.log("show",id,orgId);
+      this.isShow = true;
+      this.id=id;
+      this.orgId=orgId;
+      this.getData();
+    },
+    async onSubmit() {
+
+      this.formData.orgIds = this.data.orgIdList;
+
+      if (this.data.orgIdList.length < 1) {
+        this.$message.error("机构不能为空");
+        return;
+      }
+      if (!this.formData.effectiveDate ) {
+        this.$message.error("生效日期不能为空");
+        return;
+      }
+      let d=this.formData;
+      if (
+          this.formData.dayOfWeeks.filter((w) => w.isWorkday ===true || w.isWorkday)
+              .length === 0
+      ) {
+        this.$message.error("工作日不能为空");
+        return;
+      }
+
+      for (let i=0;i< this.formData.dayOfWeeks.length;i++ ) {
+        let dayOfWeek=this.formData.dayOfWeeks[i];
+        if(!dayOfWeek.isWorkday && dayOfWeek.isWorkday!=true){
+          continue;
+        }
+        if (
+            !(
+                dayOfWeek.workTime &&
+                dayOfWeek.openTime &&
+                dayOfWeek.closeTime &&
+                dayOfWeek.workOffTime
+            )
+        ) {
+          this.onError(`${dayOfWeek.dayOfWeekText}的上班时间、营业时间未配置完整`);
+          return;
+        }
+
+        if (!dayOfWeek.noonbreakStart ^ !dayOfWeek.noonbreakEnd) {
+          this.onError(`${dayOfWeek.dayOfWeekText}的午休开始及结束时间必须同时配置`);
+          return;
+        }
+        if (
+            !timeCheck([
+              dayOfWeek.workTime,
+              dayOfWeek.openTime,
+              dayOfWeek.noonbreakStart,
+              dayOfWeek.noonbreakEnd,
+              dayOfWeek.closeTime,
+              dayOfWeek.workOffTime,
+            ])
+        ) {
+          this.onError(
+              `${dayOfWeek.dayOfWeekText}的上班时间<=营业时间<=午休开始<=午休结束<=营业终了<=下班时间`
+          );
+          return false;
+        }
+      }
+
+      let data  = await this.$api.workTime.checkData(this.formData);
+      this.checkData=data.checkData
+      this.checkMsg=data.checkMsg
+
+      if((data.checkData==null||data.checkData==0)&&data.checkMsg==null) {
+        // this.$api.workTimeMonth.timeSetAdd(this.formData).then((v) => {
+        //   this.$emit("success");
+        //   this.onHide();
+        // });
+
+      }else{
+        this.checkDataDialog();
+      }
+    },
+
+    checkDataDialog(){
+      if(this.checkMsg!=null){
+        this.centerDialogVisiblea=true;
+        return;
+      }
+      if(this.checkData>0){
+        this.centerDialogVisible=true;
+        return;
+      }
+    },
+    checkDataMsg(tyep){
+      if(tyep==0){
+        this.centerDialogVisiblea=false;
+        this.checkData=null;
+        this.checkMsg=null;
+        return;
+      }else{
+        if(this.checkData>0){
+          this.centerDialogVisible=true;
+          return;
+        }else{
+          // this.$api.workTimeMonth.timeSetAdd(this.formData).then((v) => {
+          //   this.$emit("success");
+          //   this.onHide();
+          // });
+        }
+      }
+
+    },
+    async submitData(result){
+      this.centerDialogVisible=false;
+      this.centerDialogVisiblea=false;
+      this.formData.checkDataResult =result;
+      // this.$api.workTimeMonth.timeSetAdd(this.formData).then((v) => {
+      //   this.$emit("success");
+      //   this.onHide();
+      // });
+
+    },
+
+    async getData() {
+      console.log("this.formData.id",this.formData.id);
+      console.log("this.formData.orgId",this.formData.orgId);
+      // this.formData = await this.$api.workTimeMonth.holiday({
+      //   id: this.id,
+      // });
+
+      // this.data.orgIdList =[];
+      if (this.id != 0) {
+        this.data.disabled=true;
+        this.data.orgIdList = [this.formData.orgId];
+        console.log(this.formData.orgIdList);
+        if (this.orgId) {
+          this.data.orgIdList = [this.formData.orgId];
+          console.log(this.data.orgIdList);
+        }
+      } else {
+        this.data.orgIdList = [];
+        this.data.disabled= false;
+      }
+    },
+    onEnableChange(workTime) {
+      if (workTime.isWorkday === false) {
+        workTime.openTime = null;
+        workTime.closeTime = null;
+        workTime.noonbreakStart = null;
+        workTime.noonbreakEnd = null;
+        workTime.workTime = null;
+        workTime.workOffTime = null;
+      }
+    },
+    handleClose() {
+
+      this.id=null;
+      this.formData = {
+        orgIdList: [],
+        effectiveDate: null,
+        checkDataResult:null,
+      };
+      this.checkData=null;
+      this.checkMsg=null;
+      this.centerDialogVisiblea=false;
+      this.centerDialogVisible=false;
+      this.isShow = false;
+    },
+    onHide() {
+      this.id=null;
+      this.formData = {
+        orgIdList: [],
+        effectiveDate: null,
+        checkDataResult:null,
+      };
+      this.checkData=null;
+      this.checkMsg=null;
+      this.centerDialogVisiblea=false;
+      this.centerDialogVisible=false;
+      this.isShow = false;
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.work-time-modify {
+  .red {
+    color: red;
+  }
+  .grid {
+    width: 100%;
+    margin-bottom: 20px;
+    .title {
+    }
+    .box {
+      padding: 20px;
+      border: 1px solid #000000;
+      background: #ffffff;
+      .time {
+      }
+    }
+  }
+  //
+  .el-input {
+    width: 400px;
+  }
+
+  .el-table {
+    .el-date-editor.el-input {
+      width: 100%;
+    }
+  }
+  .el-dialog__body {
+    overflow-y: auto;
+    min-height: 200px;
+  }
+}
+</style>

+ 2 - 2
src/views/system/workTimeSet/workTime.vue

@@ -2,7 +2,7 @@
   <div class="tabs-container">
 
     <el-row :gutter="20">
-      <!--部门数据-->
+      <!--机构数据-->
       <el-col :span="4" :xs="24">
         <div class="head-container">
           <el-input
@@ -31,7 +31,7 @@
           />
         </div>
       </el-col>
-      <!--用户数据-->
+      <!--table数据-->
       <el-col :span="20" :xs="24">
 
         <!--    搜索条件    -->

+ 13 - 19
src/views/system/workTimeSet/workTimeWeek.vue

@@ -2,7 +2,7 @@
   <div class="tabs-container">
 
     <el-row :gutter="20">
-      <!--部门数据-->
+      <!--机构数据-->
       <el-col :span="4" :xs="24">
         <div class="head-container">
           <el-input
@@ -19,7 +19,7 @@
             <el-checkbox v-model="queryParams.checkSub" @change="changeCheckBox">是否关联下级机构</el-checkbox>
           </div>
           <el-tree
-            :data="deptOptions"
+            :data="orgTree"
             :props="defaultProps"
             :expand-on-click-node="false"
             :filter-node-method="filterNode"
@@ -31,7 +31,7 @@
           />
         </div>
       </el-col>
-      <!--用户数据-->
+      <!--table数据-->
       <el-col :span="20" :xs="24">
 
         <!--    搜索条件    -->
@@ -50,8 +50,7 @@
           <el-form-item label="仅显示当前生效" label-width="120px">
             <el-switch
               v-model="queryParams.value"
-              active-color="#13ce66"
-              inactive-color="#ff4949">
+              inactive-color="#ccc">
             </el-switch>
           </el-form-item>
           <el-form-item>
@@ -120,14 +119,14 @@
     </el-row>
 
 
-    <dialog-edit ref="modalEdit" ></dialog-edit>
+    <dialog-template ref="modalTemplate" ></dialog-template>
 
   </div>
 </template>
 
 <script>
 import tableList  from '@/mixins/tableList'
-import DialogEdit from './dialog.edit'
+import DialogTemplate from './dialog.template'
 import {json} from'./json'
 /** 引入节点树接口*/
 import { deptTreeSelect } from "@/api/system/user";
@@ -136,13 +135,8 @@ export default {
   /**  得先引入字典才能使用 */
   dicts: ['sys_business_type'],
   mixins:[tableList],
-  components: {DialogEdit},
+  components: {DialogTemplate},
   data() {
-    //初始化查询日期
-    let timea = new Date();
-    timea.setHours(0, 0, 0, 0);
-    let timeb = new Date(timea.getTime() - 3600 * 1000 * 24 * 30);
-    timeb.setHours(0, 0, 0, 0);
     return {
       //选中的行
       selectRow:null,
@@ -150,12 +144,12 @@ export default {
       showSearch: true,
       // 用户表格数据
       tableList: null,
-      // 部门树选项
-      deptOptions: undefined,
+      // 树选项
+      orgTree: null,
       // 是否显示弹出层
       open: false,
       // 通过机构名称查询tree
-      deptName: undefined,
+      deptName: null,
       //是否关联下级
       checked: false,
       //自定义机构树数据
@@ -168,7 +162,7 @@ export default {
         checkSub: false,
         orgId: null,
         orgType: null,
-        range: [timeb, timea],
+        range: [],
       },
       // 列信息
       columns: [
@@ -205,7 +199,7 @@ export default {
   },
   methods: {
     addTemplate(){
-
+      this.$refs.modalTemplate.add(this.orgTree)
     },
     /** 下穿状态改变*/
     changeCheckBox(){
@@ -231,7 +225,7 @@ export default {
     /** 查询机构树 */
     getDeptTree() {
       deptTreeSelect().then(response => {
-        this.deptOptions = response.data;
+        this.orgTree = response.data;
         console.log( this.deptOptions,' this.deptOptions')
         this.defaultKeys.push(response.data[0].id);
         this.queryParams.orgId = response.data[0].id;

+ 7 - 1
vue.config.js

@@ -1,5 +1,9 @@
 'use strict'
 const path = require('path')
+const NodePolyfillPlugin = require('node-polyfill-webpack-plugin')
+configureWebpack: {
+
+}
 
 function resolve(dir) {
   return path.join(__dirname, dir)
@@ -29,6 +33,8 @@ module.exports = {
   productionSourceMap: false,
   // webpack-dev-server 相关配置
   devServer: {
+    historyApiFallback:false,
+    allowedHosts:'all',
     //host: '0.0.0.0',
     port: port,
     open: false,
@@ -42,7 +48,6 @@ module.exports = {
         }
       },
     },
-    disableHostCheck: true
   },
   css: {
     loaderOptions: {
@@ -59,6 +64,7 @@ module.exports = {
       }
     },
     plugins: [
+      new NodePolyfillPlugin(),
       // http://doc.ruoyi.vip/ruoyi-vue/other/faq.html#使用gzip解压缩静态文件
       new CompressionPlugin({
         cache: false,                   // 不启用文件缓存