{"remainingRequest":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\vue-loader\\lib\\index.js??vue-loader-options!D:\\jenkins\\workspace\\xq-web-bpm\\src\\views\\uc\\ShiftRuleManager.vue?vue&type=script&lang=js&","dependencies":[{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\src\\views\\uc\\ShiftRuleManager.vue","mtime":1675071993381},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\thread-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\babel-loader\\lib\\index.js","mtime":315532800000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"D:\\jenkins\\workspace\\xq-web-bpm\\node_modules\\vue-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n//\n\nimport uc from \"@/api/uc.js\";\nimport ShiftUserManager from \"./ShiftUserManager\";\nexport default {\n  name: \"shift-rule-manager\",\n  components: {\n    ShiftUserManager\n  },\n  data() {\n    return {\n      data: [],\n      pageResult: {\n        page: 1,\n        pageSize: 10,\n        total: 0\n      },\n      deleteUrl: window.context.uc + \"/uc/shiftRule/v1/remove\",\n      saveUrl: window.context.uc + \"/uc/shiftRule/v1/save\",\n      title: \"编辑轮班规则\",\n      dialogVisible: false,\n      shiftRule: {\n        name: \"\",\n        key: \"\",\n        desc: \"\",\n        holidayId: \"\"\n      },\n      rules: [],\n      weeks: [\"日\",\"一\",\"二\",\"三\",\"四\",\"五\",\"六\"],\n      selectId: \"\",\n      userId: \"\",\n      holidays: [],\n      disabled: false\n    }\n  },\n  mounted() {\n    this.getHolidays();\n  },\n  methods: {\n    rowClick(row, column, event){\n      this.$refs.htTable.$refs.htTable.toggleRowSelection(row);\n    },\n    loadData(param, cb){\n      uc.ruleList(param).then(data => {\n        this.data = data.rows;\n        this.pageResult = {\n          page: data.page,\n          pageSize: data.pageSize,\n          total: data.total\n        }\n      }).finally(() => {\n        cb && cb();\n      })\n    },\n    edit(id){\n      this.dialogVisible = true;\n      if (id){\n        this.title = \"编辑轮班规则\";\n        this.disabled = true;\n        uc.getRule(id).then(data => {\n          this.shiftRule = data;\n          this.rules = JSON.parse(data.rule);\n        });\n      }else{\n        this.title = \"新增轮班规则\";\n        this.disabled = false;\n        this.shiftRule = {\n          name: \"\",\n          key: \"\",\n          desc: \"\",\n          holidayId:\"\"\n        }\n        this.rules = [];\n        for (let i=0;i<7;i++){\n          this.rules.push({\n            date: i,\n            type: 1,\n            startTime: \"\",\n            endTime: \"\"\n          })\n        }\n      }\n    },\n    handleClose(){\n      this.dialogVisible = false;\n    },\n    beforeSaveData(){\n      this.shiftRule.rule = JSON.stringify(this.rules);\n    },\n    afterSaveData() {\n      this.dialogVisible = false;\n      this.$refs.htTable.load();\n    },\n    weekFormat(row){\n      return \"星期\" + this.weeks[row.date];\n    },\n    setUser(id){\n      this.$refs.shiftUserManager.openDialog(id);\n    },\n    getHolidays(){\n      uc.holidayList({}).then(data => {\n        this.holidays = data.rows;\n      })\n    },\n    change(row){\n      if (row.type===0){\n        this.$set(row,\"startTime\",\"00:00:00\");\n        this.$set(row,\"endTime\",\"00:00:00\");\n      }\n    }\n  }\n}\n",null]}