123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- <template>
- <view>
- <view class="control-title">控制面板</view>
- <basics ref="basics" />
- <division ref="division" />
- </view>
- </template>
- <script>
- import basics from "./modules/basics";
- import division from "./modules/division";
- export default {
- name: "prodnum-MT02",
- components: { basics, division },
- props: {
- control: Object,
- },
- watch: {
- control: function (newVal) {
- if (newVal) {
- try {
- let ctrlModel = this.__proto__.getControlItem(["Control"], newVal, {
- Control: "radioNum",
- })[0];
- ctrlModel.params.options = ctrlModel.params.options.filter(
- (v) => v.label != "恒压控制停止"
- );
- this.$refs.basics.ctrlModel = ctrlModel;
- console.log(
- "this.$refs.basics.ctrlModel",
- this.$refs.basics.ctrlModel
- );
- this.$refs.basics.list = [
- "MostBad",
- "FaWei",
- "NowFlow",
- "CumFlow",
- ].map((v) => newVal.params[v]);
- try {
- const replenish = {
- TimeConOFF: 1,
- TimeConON: 0,
- };
- const TimeConON = this.__proto__.getControlItem(
- ["TimeCon"],
- JSON.parse(JSON.stringify(newVal))
- )[0].paramName.TimeConON;
- if (TimeConON == 1) {
- this.$refs.basics.ctrlModel.showValue = "分时控制模式";
- // replenish.TimeConON = 1;
- } else {
- // replenish.TimeConOFF = 1;
- }
- this.$refs.basics.replenish = replenish;
- } catch (error) {
- console.log("获取分时补充字段失败", error);
- }
- console.log(this.$refs.basics.ctrlModel);
- switch (this.$refs.basics.ctrlModel.showValue) {
- case "远程不利点模式":
- this.$refs.basics.subcontrol = this.__proto__.getControlItem(
- ["Tarb"],
- newVal
- )[0];
- break;
- case "远程开关阀模式":
- this.$refs.basics.subcontrol = this.__proto__.getControlItem(
- ["RC"],
- newVal
- )[0];
- break;
- case "恒压控制启动":
- this.$refs.basics.subcontrol = this.__proto__.getControlItem(
- ["DownTar"],
- newVal
- )[0];
- break;
- default:
- this.$refs.basics.subcontrol = null;
- break;
- }
- } catch (error) {
- console.error("MT02控制模式", error);
- }
- try {
- let division = this.$refs.division;
- division && division.loadData(newVal);
- } catch (error) {
- console.error("MT02分时控制", error);
- }
- } else {
- }
- },
- },
- onUnload() {
- delete this.$Http.changeOptions;
- },
- };
- </script>
- <style></style>
|