mirror of
https://gitee.com/beecue/fastbee.git
synced 2026-03-22 22:44:51 +08:00
feat(国际化): 完善国际化
This commit is contained in:
4
vue/src/assets/icons/svg/globe.svg
Normal file
4
vue/src/assets/icons/svg/globe.svg
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<path d="M8,1 C11.8659932,1 15,4.13400675 15,8 C15,11.8659932 11.8659932,15 8,15 C4.13400675,15 1,11.8659932 1,8 C1,4.13400675 4.13400675,1 8,1 Z M9.99190372,8.50131193 L6.00809628,8.50131193 C6.05866848,10.0621498 6.3438261,11.4964981 6.79782469,12.5558282 C7.21659494,13.5329588 7.68982759,14 8,14 C8.31017241,14 8.78340506,13.5329588 9.20217531,12.5558282 C9.6561739,11.4964981 9.94133152,10.0621498 9.99190372,8.50131193 Z M5.00755213,8.50056098 L2.02061151,8.50090367 C2.22703857,10.9985235 3.96324115,13.0622309 6.28999965,13.7528062 C5.5657829,12.5787023 5.07345663,10.6770109 5.00755213,8.50056098 Z M13.9793885,8.50090367 L10.9924479,8.50056098 C10.9265434,10.6770109 10.4342171,12.5787023 9.70923696,13.7535099 C12.0367588,13.0622309 13.7729614,10.9985235 13.9793885,8.50090367 Z M6.29076304,2.24649006 L6.26712071,2.25403417 C3.95155645,2.9514068 2.22589888,5.01022147 2.02052886,7.50009733 L5.007522,7.50043503 C5.07330643,5.32356926 5.56567231,3.42147692 6.29076304,2.24649006 Z M8,2 C7.68982759,2 7.21659494,2.46704125 6.79782469,3.44417183 C6.34372889,4.5037287 6.05854637,5.93846447 6.00806383,7.49969077 L9.99193617,7.49969077 C9.94145363,5.93846447 9.65627111,4.5037287 9.20217531,3.44417183 C8.81132308,2.53218328 8.37302804,2.06453923 8.06414417,2.00623997 L8,2 Z M9.71000035,2.2471938 L9.73522769,2.28908358 C10.4460778,3.46714611 10.9274826,5.34967989 10.992478,7.50043503 L13.9794711,7.50009733 C13.7734253,5.00202792 12.0370697,2.9378614 9.71000035,2.2471938 Z" id="fe-globe" fill-rule="nonzero"></path>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.7 KiB |
BIN
vue/src/assets/images/cover.png
Normal file
BIN
vue/src/assets/images/cover.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 282 KiB |
BIN
vue/src/assets/images/logo_blue.png
Normal file
BIN
vue/src/assets/images/logo_blue.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.4 KiB |
@@ -652,6 +652,7 @@
|
|||||||
"device.running-status.866086-49": "please enter decimals",
|
"device.running-status.866086-49": "please enter decimals",
|
||||||
"device.running-status.866086-50": "please enter an integer",
|
"device.running-status.866086-50": "please enter an integer",
|
||||||
"device.running-status.866086-51": "please enter a valid integer",
|
"device.running-status.866086-51": "please enter a valid integer",
|
||||||
|
"device.running-status.866086-52": "Send Command",
|
||||||
"device.sub.083943-0": "Add sub devices",
|
"device.sub.083943-0": "Add sub devices",
|
||||||
"device.sub.083943-1": "Remove sub devices",
|
"device.sub.083943-1": "Remove sub devices",
|
||||||
"device.sub.083943-2": "Set sub device address",
|
"device.sub.083943-2": "Set sub device address",
|
||||||
|
|||||||
@@ -67,5 +67,7 @@
|
|||||||
"home.free": "Free",
|
"home.free": "Free",
|
||||||
"home.diskUsage": "Disk Usage",
|
"home.diskUsage": "Disk Usage",
|
||||||
"home.diskStatus": "Disk Status",
|
"home.diskStatus": "Disk Status",
|
||||||
"home.available": "Available"
|
"home.available": "Available",
|
||||||
|
"home.fengxinIoT": "Fengxin IoT",
|
||||||
|
"home.projectDocs": "Project Documentation"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -267,6 +267,8 @@
|
|||||||
"tool.icons.670909-1": "Please enter icon name",
|
"tool.icons.670909-1": "Please enter icon name",
|
||||||
"tool.build.index.670906-13": "Copy",
|
"tool.build.index.670906-13": "Copy",
|
||||||
"tool.build.index.670906-14": "Delete",
|
"tool.build.index.670906-14": "Delete",
|
||||||
|
"tool.build.index.670906-15": "does not have",
|
||||||
|
"tool.build.index.670906-16": "Related components",
|
||||||
"tool.codeType.670910-0": "Generate Type",
|
"tool.codeType.670910-0": "Generate Type",
|
||||||
"tool.codeType.670910-1": "File Name",
|
"tool.codeType.670910-1": "File Name",
|
||||||
"tool.codeType.670910-2": "Please enter file name",
|
"tool.codeType.670910-2": "Please enter file name",
|
||||||
|
|||||||
@@ -652,6 +652,7 @@
|
|||||||
"device.running-status.866086-49": "请输入下发值",
|
"device.running-status.866086-49": "请输入下发值",
|
||||||
"device.running-status.866086-50": "只能输入整数",
|
"device.running-status.866086-50": "只能输入整数",
|
||||||
"device.running-status.866086-51": "请输入有效的整数",
|
"device.running-status.866086-51": "请输入有效的整数",
|
||||||
|
"device.running-status.866086-52": "指令发送",
|
||||||
"device.sub.083943-0": "添加子设备",
|
"device.sub.083943-0": "添加子设备",
|
||||||
"device.sub.083943-1": "移除子设备",
|
"device.sub.083943-1": "移除子设备",
|
||||||
"device.sub.083943-2": "设置子设备地址",
|
"device.sub.083943-2": "设置子设备地址",
|
||||||
|
|||||||
@@ -67,5 +67,7 @@
|
|||||||
"home.free": "剩余",
|
"home.free": "剩余",
|
||||||
"home.diskUsage": "系统盘使用率",
|
"home.diskUsage": "系统盘使用率",
|
||||||
"home.diskStatus": "磁盘状态",
|
"home.diskStatus": "磁盘状态",
|
||||||
"home.available": "可用"
|
"home.available": "可用",
|
||||||
|
"home.fengxinIoT": "蜂信物联",
|
||||||
|
"home.projectDocs": "项目文档"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -267,6 +267,8 @@
|
|||||||
"tool.icons.670909-1": "请输入图标名称",
|
"tool.icons.670909-1": "请输入图标名称",
|
||||||
"tool.build.index.670906-13": "复制",
|
"tool.build.index.670906-13": "复制",
|
||||||
"tool.build.index.670906-14": "删除",
|
"tool.build.index.670906-14": "删除",
|
||||||
|
"tool.build.index.670906-15": "没有与",
|
||||||
|
"tool.build.index.670906-16": "相关的组件",
|
||||||
"tool.codeType.670910-0": "生成类型",
|
"tool.codeType.670910-0": "生成类型",
|
||||||
"tool.codeType.670910-1": "文件名",
|
"tool.codeType.670910-1": "文件名",
|
||||||
"tool.codeType.670910-2": "请输入文件名",
|
"tool.codeType.670910-2": "请输入文件名",
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
<div>
|
<div>
|
||||||
<el-row :gutter="20" style="margin-bottom: 16px">
|
<el-row :gutter="20" style="margin-bottom: 16px">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-select v-model="channelId" placeholder="请选择通道" @change="changeChannel()">
|
<el-select v-model="channelId" :placeholder="$t('views.components.player.deviceLiveStream.48750-1')" @change="changeChannel()">
|
||||||
<el-option v-for="option in channelList" :key="option.value" :label="option.label" :value="option.value"></el-option>
|
<el-option v-for="option in channelList" :key="option.value" :label="option.label" :value="option.value"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5" style="line-height: 36px">
|
<el-col :span="1.5" style="line-height: 36px">
|
||||||
<span style="font-size: 14px">开启拉流:</span>
|
<span style="font-size: 14px">{{ $t('views.components.player.deviceLiveStream.48750-2') }}</span>
|
||||||
<el-switch v-model="pushStream" :disabled="channelId === ''" @change="startPushStream"></el-switch>
|
<el-switch v-model="pushStream" :disabled="channelId === ''" @change="startPushStream"></el-switch>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
|||||||
@@ -206,12 +206,12 @@
|
|||||||
Copyright © 2021-2022
|
Copyright © 2021-2022
|
||||||
<a href="https://fastbee.cn/" target="_blank">FastBee</a>
|
<a href="https://fastbee.cn/" target="_blank">FastBee</a>
|
||||||
|
|
|
|
||||||
<a href="https://fastbee.cn/" target="_blank">蜂信物联</a>
|
<a href="https://fastbee.cn/" target="_blank">{{ $t('home.fengxinIoT') }}</a>
|
||||||
| Apache License
|
| Apache License
|
||||||
</span>
|
</span>
|
||||||
<br />
|
<br />
|
||||||
<span>
|
<span>
|
||||||
项目文档
|
{{ $t('home.projectDocs') }}
|
||||||
<a href="https://fastbee.cn/doc/" target="_blank">https://fastbee.cn/doc/</a>
|
<a href="https://fastbee.cn/doc/" target="_blank">https://fastbee.cn/doc/</a>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -45,8 +45,8 @@
|
|||||||
<span>{{ scope.row.createTime }}</span>
|
<span>{{ scope.row.createTime }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="标识符" align="center" prop="identify" />
|
<el-table-column :label="$t('device.device-log.798283-2')" align="center" prop="identify" />
|
||||||
<el-table-column label="动作" align="left" header-align="center" prop="logValue">
|
<el-table-column :label="$t('device.device-log.798283-15')" align="left" header-align="center" prop="logValue">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div v-html="formatValueDisplay(scope.row)"></div>
|
<div v-html="formatValueDisplay(scope.row)"></div>
|
||||||
</template>
|
</template>
|
||||||
@@ -54,7 +54,7 @@
|
|||||||
|
|
||||||
<el-table-column :label="$t('device.device-log.798283-16')" header-align="center" align="left" prop="remark">
|
<el-table-column :label="$t('device.device-log.798283-16')" header-align="center" align="left" prop="remark">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ scope.row.remark == null ? '无' : scope.row.remark }}
|
{{ scope.row.remark == null ? $t('device.device-log.798283-17') : scope.row.remark }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ export default {
|
|||||||
/** 更新实时监测参数*/
|
/** 更新实时监测参数*/
|
||||||
beginMonitor() {
|
beginMonitor() {
|
||||||
if (this.deviceInfo.status != 3) {
|
if (this.deviceInfo.status != 3) {
|
||||||
this.$modal.alertError('设备不在线,下发指令失败');
|
this.$modal.alertError(this.$t('device.device-monitor.817489-13'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// 清空图表数据
|
// 清空图表数据
|
||||||
@@ -197,7 +197,7 @@ export default {
|
|||||||
}
|
}
|
||||||
// Mqtt发布实时监测消息
|
// Mqtt发布实时监测消息
|
||||||
let model = {};
|
let model = {};
|
||||||
model.name = '更新实时监测';
|
model.name = this.$t('device.device-monitor.817489-16');
|
||||||
model.value = this.monitorNumber;
|
model.value = this.monitorNumber;
|
||||||
model.type = 4;
|
model.type = 4;
|
||||||
this.mqttPublish(this.deviceInfo, model);
|
this.mqttPublish(this.deviceInfo, model);
|
||||||
@@ -206,7 +206,7 @@ export default {
|
|||||||
/** 停止实时监测 */
|
/** 停止实时监测 */
|
||||||
stopMonitor() {
|
stopMonitor() {
|
||||||
if (this.deviceInfo.status != 3) {
|
if (this.deviceInfo.status != 3) {
|
||||||
this.$modal.alertError('设备不在线,下发指令失败');
|
this.$modal.alertError(this.$t('device.device-monitor.817489-13'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.chartLoading = false;
|
this.chartLoading = false;
|
||||||
@@ -228,7 +228,13 @@ export default {
|
|||||||
option = {
|
option = {
|
||||||
title: {
|
title: {
|
||||||
left: 'center',
|
left: 'center',
|
||||||
text: this.monitorThings[i].name + ' ' + this.$t('device.device-monitor.817489-18') + ' ' + (this.monitorThings[i].datatype.unit != undefined ? this.monitorThings[i].datatype.unit : this.$t('device.device-monitor.817489-19')) + ')',
|
text:
|
||||||
|
this.monitorThings[i].name +
|
||||||
|
' ' +
|
||||||
|
this.$t('device.device-monitor.817489-18') +
|
||||||
|
' ' +
|
||||||
|
(this.monitorThings[i].datatype.unit != undefined ? this.monitorThings[i].datatype.unit : this.$t('device.device-monitor.817489-19')) +
|
||||||
|
')',
|
||||||
textStyle: {
|
textStyle: {
|
||||||
fontSize: 14,
|
fontSize: 14,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -28,7 +28,9 @@
|
|||||||
<el-table-column :label="$t('device.index.105953-34')" align="center" class-name="small-padding fixed-width" width="180">
|
<el-table-column :label="$t('device.index.105953-34')" align="center" class-name="small-padding fixed-width" width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['iot:device:share']" v-if="scope.row.isOwner == 0">{{ $t('edit') }}</el-button>
|
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['iot:device:share']" v-if="scope.row.isOwner == 0">{{ $t('edit') }}</el-button>
|
||||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['iot:device:share']" v-if="scope.row.isOwner == 0">{{ $t('device.device-user.037521-11') }}</el-button>
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['iot:device:share']" v-if="scope.row.isOwner == 0">
|
||||||
|
{{ $t('device.device-user.037521-11') }}
|
||||||
|
</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -41,7 +43,17 @@
|
|||||||
<!--用户查询-->
|
<!--用户查询-->
|
||||||
<el-form :model="permParams" ref="queryForm" :rules="rules" :inline="true" label-width="80px" v-if="type == 1">
|
<el-form :model="permParams" ref="queryForm" :rules="rules" :inline="true" label-width="80px" v-if="type == 1">
|
||||||
<el-form-item :label="$t('device.device-user.037521-3')" prop="phonenumber">
|
<el-form-item :label="$t('device.device-user.037521-3')" prop="phonenumber">
|
||||||
<el-input type="text" :placeholder="$t('device.device-user.037521-13')" v-model="permParams.phonenumber" minlength="10" clearable size="small" show-word-limit style="width: 240px" @keyup.enter.native="handleQuery"></el-input>
|
<el-input
|
||||||
|
type="text"
|
||||||
|
:placeholder="$t('device.device-user.037521-13')"
|
||||||
|
v-model="permParams.phonenumber"
|
||||||
|
minlength="10"
|
||||||
|
clearable
|
||||||
|
size="small"
|
||||||
|
show-word-limit
|
||||||
|
style="width: 240px"
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="userQuery">{{ $t('device.device-user.037521-14') }}</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="userQuery">{{ $t('device.device-user.037521-14') }}</el-button>
|
||||||
@@ -250,7 +262,7 @@ export default {
|
|||||||
this.getPermissionList();
|
this.getPermissionList();
|
||||||
} else {
|
} else {
|
||||||
this.permsLoading = false;
|
this.permsLoading = false;
|
||||||
this.message = '查询不到用户信息,或者该用户已经是设备用户';
|
this.message = this.$t('device.device-user.037521-31');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -271,8 +283,8 @@ export default {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
identifier: 'log',
|
identifier: 'log',
|
||||||
modelName: '设备日志',
|
modelName: this.$t('device.device-user.037521-36'),
|
||||||
remark: '包含事件日志和指令日志',
|
remark: this.$t('device.device-user.037521-37'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
identifier: 'monitor',
|
identifier: 'monitor',
|
||||||
@@ -281,8 +293,8 @@ export default {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
identifier: 'statistic',
|
identifier: 'statistic',
|
||||||
modelName: '监测统计',
|
modelName: this.$t('device.device-user.037521-40'),
|
||||||
remark: '图表显示存储的历史监测数据',
|
remark: this.$t('device.device-user.037521-41'),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
this.sharePermissionList = this.sharePermissionList.concat(response.data);
|
this.sharePermissionList = this.sharePermissionList.concat(response.data);
|
||||||
@@ -340,4 +352,9 @@ export default {
|
|||||||
this.resetUserQuery();
|
this.resetUserQuery();
|
||||||
this.open = false;
|
this.open = false;
|
||||||
this.getList();
|
this.getList();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|||||||
@@ -48,8 +48,15 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="item.datatype.type == 'string'">
|
<div v-if="item.datatype.type == 'string'">
|
||||||
<el-input v-model="item.shadow" :placeholder="'请输入字符串 ' + (item.datatype.unit ? ',单位:' + item.datatype.unit : '')" :disabled="shadowUnEnable || item.isReadonly == 1">
|
<el-input v-model="item.shadow" :placeholder="$t('device.running-status.866086-4')" :disabled="shadowUnEnable || item.isReadonly == 1">
|
||||||
<el-button slot="append" icon="el-icon-s-promotion" @click="mqttPublish(deviceInfo, item)" style="font-size: 20px" :title="$t('device.running-status.866086-6')" v-if="!shadowUnEnable && item.isReadonly == 0"></el-button>
|
<el-button
|
||||||
|
slot="append"
|
||||||
|
icon="el-icon-s-promotion"
|
||||||
|
@click="mqttPublish(deviceInfo, item)"
|
||||||
|
style="font-size: 20px"
|
||||||
|
:title="$t('device.running-status.866086-6')"
|
||||||
|
v-if="!shadowUnEnable && item.isReadonly == 0"
|
||||||
|
></el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="item.datatype.type == 'decimal'">
|
<div v-if="item.datatype.type == 'decimal'">
|
||||||
@@ -69,7 +76,7 @@
|
|||||||
type="info"
|
type="info"
|
||||||
@click="mqttPublish(deviceInfo, item)"
|
@click="mqttPublish(deviceInfo, item)"
|
||||||
style="font-size: 16px; padding: 1px 8px; margin: 2px 0 0 5px; border-radius: 3px"
|
style="font-size: 16px; padding: 1px 8px; margin: 2px 0 0 5px; border-radius: 3px"
|
||||||
title="指令发送"
|
:title="$t('device.running-status.866086-52')"
|
||||||
v-if="!shadowUnEnable && item.isReadonly == 0"
|
v-if="!shadowUnEnable && item.isReadonly == 0"
|
||||||
></el-button>
|
></el-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -91,7 +98,7 @@
|
|||||||
type="info"
|
type="info"
|
||||||
@click="mqttPublish(deviceInfo, item)"
|
@click="mqttPublish(deviceInfo, item)"
|
||||||
style="font-size: 16px; padding: 1px 8px; margin: 4px 0 0 10px; border-radius: 3px"
|
style="font-size: 16px; padding: 1px 8px; margin: 4px 0 0 10px; border-radius: 3px"
|
||||||
title="指令发送"
|
:title="$t('device.running-status.866086-52')"
|
||||||
v-if="!shadowUnEnable && item.isReadonly == 0"
|
v-if="!shadowUnEnable && item.isReadonly == 0"
|
||||||
></el-button>
|
></el-button>
|
||||||
</div>
|
</div>
|
||||||
@@ -124,23 +131,51 @@
|
|||||||
{{ subItem.text }}
|
{{ subItem.text }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-select size="small" v-else v-model="param.shadow" placeholder="请选择" @change="mqttPublish(deviceInfo, param)" :disabled="shadowUnEnable || param.isReadonly == 1">
|
<el-select
|
||||||
|
size="small"
|
||||||
|
v-else
|
||||||
|
v-model="param.shadow"
|
||||||
|
:placeholder="$t('device.running-status.866086-3')"
|
||||||
|
@change="mqttPublish(deviceInfo, param)"
|
||||||
|
:disabled="shadowUnEnable || param.isReadonly == 1"
|
||||||
|
>
|
||||||
<el-option v-for="subItem in param.datatype.enumList" :key="subItem.value" :label="subItem.text" :value="subItem.value" />
|
<el-option v-for="subItem in param.datatype.enumList" :key="subItem.value" :label="subItem.text" :value="subItem.value" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="param.datatype.type == 'string'">
|
<div v-if="param.datatype.type == 'string'">
|
||||||
<el-input v-model="param.shadow" placeholder="请输入字符串" :disabled="shadowUnEnable || param.isReadonly == 1">
|
<el-input v-model="param.shadow" :placeholder="$t('device.running-status.866086-4')" :disabled="shadowUnEnable || param.isReadonly == 1">
|
||||||
<el-button slot="append" icon="el-icon-s-promotion" @click="mqttPublish(deviceInfo, param)" style="font-size: 20px" title="指令发送" v-if="!shadowUnEnable && param.isReadonly == 0"></el-button>
|
<el-button
|
||||||
|
slot="append"
|
||||||
|
icon="el-icon-s-promotion"
|
||||||
|
@click="mqttPublish(deviceInfo, param)"
|
||||||
|
style="font-size: 20px"
|
||||||
|
:title="$t('device.running-status.866086-52')"
|
||||||
|
v-if="!shadowUnEnable && param.isReadonly == 0"
|
||||||
|
></el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="param.datatype.type == 'decimal'">
|
<div v-if="param.datatype.type == 'decimal'">
|
||||||
<el-input v-model="param.shadow" type="number" placeholder="请输入小数 " :disabled="shadowUnEnable || param.isReadonly == 1">
|
<el-input v-model="param.shadow" type="number" :placeholder="$t('device.running-status.866086-7')" :disabled="shadowUnEnable || param.isReadonly == 1">
|
||||||
<el-button slot="append" icon="el-icon-s-promotion" @click="mqttPublish(deviceInfo, param)" style="font-size: 20px" title="指令发送" v-if="!shadowUnEnable && param.isReadonly == 0"></el-button>
|
<el-button
|
||||||
|
slot="append"
|
||||||
|
icon="el-icon-s-promotion"
|
||||||
|
@click="mqttPublish(deviceInfo, param)"
|
||||||
|
style="font-size: 20px"
|
||||||
|
:title="$t('device.running-status.866086-52')"
|
||||||
|
v-if="!shadowUnEnable && param.isReadonly == 0"
|
||||||
|
></el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="param.datatype.type == 'integer'">
|
<div v-if="param.datatype.type == 'integer'">
|
||||||
<el-input v-model="param.shadow" type="integer" placeholder="请输入整数 " :disabled="shadowUnEnable || param.isReadonly == 1">
|
<el-input v-model="param.shadow" type="integer" :placeholder="$t('device.running-status.866086-8')" :disabled="shadowUnEnable || param.isReadonly == 1">
|
||||||
<el-button slot="append" icon="el-icon-s-promotion" @click="mqttPublish(deviceInfo, param)" style="font-size: 20px" title="指令发送" v-if="!shadowUnEnable && param.isReadonly == 0"></el-button>
|
<el-button
|
||||||
|
slot="append"
|
||||||
|
icon="el-icon-s-promotion"
|
||||||
|
@click="mqttPublish(deviceInfo, param)"
|
||||||
|
style="font-size: 20px"
|
||||||
|
:title="$t('device.running-status.866086-52')"
|
||||||
|
v-if="!shadowUnEnable && param.isReadonly == 0"
|
||||||
|
></el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
</div>
|
</div>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
@@ -150,18 +185,59 @@
|
|||||||
<el-descriptions :column="1" size="mini" border v-if="item.datatype.arrayType != 'object'">
|
<el-descriptions :column="1" size="mini" border v-if="item.datatype.arrayType != 'object'">
|
||||||
<el-descriptions-item v-for="(model, index) in item.datatype.arrayModel" :key="index" :label="item.name + (index + 1)">
|
<el-descriptions-item v-for="(model, index) in item.datatype.arrayModel" :key="index" :label="item.name + (index + 1)">
|
||||||
<div v-if="item.datatype.arrayType == 'string'">
|
<div v-if="item.datatype.arrayType == 'string'">
|
||||||
<el-input placeholder="请输入字符串" size="mini" v-model="model.shadow" :disabled="shadowUnEnable || item.isReadonly == 1" @input="arrayItemChange($event, item)">
|
<el-input
|
||||||
<el-button slot="append" icon="el-icon-s-promotion" @click="mqttPublish(deviceInfo, model)" style="font-size: 20px" title="指令发送" v-if="!shadowUnEnable || item.isReadonly == 0"></el-button>
|
:placeholder="$t('device.running-status.866086-4')"
|
||||||
|
size="mini"
|
||||||
|
v-model="model.shadow"
|
||||||
|
:disabled="shadowUnEnable || item.isReadonly == 1"
|
||||||
|
@input="arrayItemChange($event, item)"
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
slot="append"
|
||||||
|
icon="el-icon-s-promotion"
|
||||||
|
@click="mqttPublish(deviceInfo, model)"
|
||||||
|
style="font-size: 20px"
|
||||||
|
:title="$t('device.running-status.866086-52')"
|
||||||
|
v-if="!shadowUnEnable || item.isReadonly == 0"
|
||||||
|
></el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="item.datatype.arrayType == 'decimal'">
|
<div v-if="item.datatype.arrayType == 'decimal'">
|
||||||
<el-input type="number" placeholder="请输入小数 " size="mini" v-model="model.shadow" :disabled="shadowUnEnable || item.isReadonly == 1" @input="arrayItemChange($event, item)">
|
<el-input
|
||||||
<el-button slot="append" icon="el-icon-s-promotion" @click="mqttPublish(deviceInfo, model)" style="font-size: 20px" title="指令发送" v-if="!shadowUnEnable || item.isReadonly == 0"></el-button>
|
type="number"
|
||||||
|
:placeholder="$t('device.running-status.866086-7')"
|
||||||
|
size="mini"
|
||||||
|
v-model="model.shadow"
|
||||||
|
:disabled="shadowUnEnable || item.isReadonly == 1"
|
||||||
|
@input="arrayItemChange($event, item)"
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
slot="append"
|
||||||
|
icon="el-icon-s-promotion"
|
||||||
|
@click="mqttPublish(deviceInfo, model)"
|
||||||
|
style="font-size: 20px"
|
||||||
|
:title="$t('device.running-status.866086-52')"
|
||||||
|
v-if="!shadowUnEnable || item.isReadonly == 0"
|
||||||
|
></el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="item.datatype.arrayType == 'integer'">
|
<div v-if="item.datatype.arrayType == 'integer'">
|
||||||
<el-input type="integer" placeholder="请输入整数 " size="mini" v-model="model.shadow" :disabled="shadowUnEnable || item.isReadonly == 1" @input="arrayItemChange($event, item)">
|
<el-input
|
||||||
<el-button slot="append" icon="el-icon-s-promotion" @click="mqttPublish(deviceInfo, model)" style="font-size: 20px" title="指令发送" v-if="!shadowUnEnable || item.isReadonly == 0"></el-button>
|
type="integer"
|
||||||
|
:placeholder="$t('device.running-status.866086-8')"
|
||||||
|
size="mini"
|
||||||
|
v-model="model.shadow"
|
||||||
|
:disabled="shadowUnEnable || item.isReadonly == 1"
|
||||||
|
@input="arrayItemChange($event, item)"
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
slot="append"
|
||||||
|
icon="el-icon-s-promotion"
|
||||||
|
@click="mqttPublish(deviceInfo, model)"
|
||||||
|
style="font-size: 20px"
|
||||||
|
:title="$t('device.running-status.866086-52')"
|
||||||
|
v-if="!shadowUnEnable || item.isReadonly == 0"
|
||||||
|
></el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
</div>
|
</div>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
@@ -201,23 +277,51 @@
|
|||||||
{{ subItem.text }}
|
{{ subItem.text }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-select v-else v-model="param.shadow" placeholder="请选择" size="small" @change="mqttPublish(deviceInfo, param)" :disabled="shadowUnEnable || param.isReadonly == 1">
|
<el-select
|
||||||
|
v-else
|
||||||
|
v-model="param.shadow"
|
||||||
|
:placeholder="$t('device.running-status.866086-3')"
|
||||||
|
size="small"
|
||||||
|
@change="mqttPublish(deviceInfo, param)"
|
||||||
|
:disabled="shadowUnEnable || param.isReadonly == 1"
|
||||||
|
>
|
||||||
<el-option v-for="subItem in param.datatype.enumList" :key="subItem.value" :label="subItem.text" :value="subItem.value" />
|
<el-option v-for="subItem in param.datatype.enumList" :key="subItem.value" :label="subItem.text" :value="subItem.value" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="param.datatype.type == 'string'">
|
<div v-if="param.datatype.type == 'string'">
|
||||||
<el-input v-model="param.shadow" :placeholder="$t('device.running-status.866086-4')" :disabled="shadowUnEnable || param.isReadonly == 1">
|
<el-input v-model="param.shadow" :placeholder="$t('device.running-status.866086-4')" :disabled="shadowUnEnable || param.isReadonly == 1">
|
||||||
<el-button slot="append" icon="el-icon-s-promotion" @click="mqttPublish(deviceInfo, param)" style="font-size: 20px" title="指令发送" v-if="!shadowUnEnable && param.isReadonly == 0"></el-button>
|
<el-button
|
||||||
|
slot="append"
|
||||||
|
icon="el-icon-s-promotion"
|
||||||
|
@click="mqttPublish(deviceInfo, param)"
|
||||||
|
style="font-size: 20px"
|
||||||
|
:title="$t('device.running-status.866086-52')"
|
||||||
|
v-if="!shadowUnEnable && param.isReadonly == 0"
|
||||||
|
></el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="param.datatype.type == 'decimal'">
|
<div v-if="param.datatype.type == 'decimal'">
|
||||||
<el-input v-model="param.shadow" type="number" :placeholder="$t('device.running-status.866086-7')" :disabled="shadowUnEnable || param.isReadonly == 1">
|
<el-input v-model="param.shadow" type="number" :placeholder="$t('device.running-status.866086-7')" :disabled="shadowUnEnable || param.isReadonly == 1">
|
||||||
<el-button slot="append" icon="el-icon-s-promotion" @click="mqttPublish(deviceInfo, param)" style="font-size: 20px" title="指令发送" v-if="!shadowUnEnable && param.isReadonly == 0"></el-button>
|
<el-button
|
||||||
|
slot="append"
|
||||||
|
icon="el-icon-s-promotion"
|
||||||
|
@click="mqttPublish(deviceInfo, param)"
|
||||||
|
style="font-size: 20px"
|
||||||
|
:title="$t('device.running-status.866086-52')"
|
||||||
|
v-if="!shadowUnEnable && param.isReadonly == 0"
|
||||||
|
></el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="param.datatype.type == 'integer'">
|
<div v-if="param.datatype.type == 'integer'">
|
||||||
<el-input v-model="param.shadow" type="integer" :placeholder="$t('device.running-status.866086-8')" :disabled="shadowUnEnable || param.isReadonly == 1">
|
<el-input v-model="param.shadow" type="integer" :placeholder="$t('device.running-status.866086-8')" :disabled="shadowUnEnable || param.isReadonly == 1">
|
||||||
<el-button slot="append" icon="el-icon-s-promotion" @click="mqttPublish(deviceInfo, param)" style="font-size: 20px" title="指令发送" v-if="!shadowUnEnable && param.isReadonly == 0"></el-button>
|
<el-button
|
||||||
|
slot="append"
|
||||||
|
icon="el-icon-s-promotion"
|
||||||
|
@click="mqttPublish(deviceInfo, param)"
|
||||||
|
style="font-size: 20px"
|
||||||
|
:title="$t('device.running-status.866086-52')"
|
||||||
|
v-if="!shadowUnEnable && param.isReadonly == 0"
|
||||||
|
></el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
</div>
|
</div>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
@@ -247,38 +351,48 @@
|
|||||||
<div v-if="item.datatype.showWay && item.datatype.showWay == 'button'">
|
<div v-if="item.datatype.showWay && item.datatype.showWay == 'button'">
|
||||||
<el-button style="margin: 5px" size="mini" disabled v-for="subItem in item.datatype.enumList" :key="subItem.value">{{ subItem.text }}</el-button>
|
<el-button style="margin: 5px" size="mini" disabled v-for="subItem in item.datatype.enumList" :key="subItem.value">{{ subItem.text }}</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-select v-else v-model="item.value" placeholder="请选择" @change="mqttPublish(deviceInfo, item)" disabled size="mini">
|
<el-select v-else v-model="item.value" :placeholder="$t('device.running-status.866086-3')" @change="mqttPublish(deviceInfo, item)" disabled size="mini">
|
||||||
<el-option v-for="subItem in item.datatype.enumList" :key="subItem.value" :label="subItem.text" :value="subItem.value" />
|
<el-option v-for="subItem in item.datatype.enumList" :key="subItem.value" :label="subItem.text" :value="subItem.value" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="item.datatype.type == 'string'">
|
<div v-if="item.datatype.type == 'string'">
|
||||||
<el-input v-model="item.value" placeholder="请输入字符串" disabled size="mini"></el-input>
|
<el-input v-model="item.value" :placeholder="$t('device.running-status.866086-4')" disabled size="mini"></el-input>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="item.datatype.type == 'decimal'">
|
<div v-if="item.datatype.type == 'decimal'">
|
||||||
<el-input v-model="item.value" type="number" placeholder="请输入小数 " disabled size="mini"></el-input>
|
<el-input v-model="item.value" type="number" :placeholder="$t('device.running-status.866086-7')" disabled size="mini"></el-input>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="item.datatype.type == 'integer'">
|
<div v-if="item.datatype.type == 'integer'">
|
||||||
<el-input v-model="item.value" type="integer" placeholder="请输入整数 " disabled size="mini"></el-input>
|
<el-input v-model="item.value" type="integer" :placeholder="$t('device.running-status.866086-8')" disabled size="mini"></el-input>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="item.datatype.type == 'object'">
|
<div v-if="item.datatype.type == 'object'">
|
||||||
<el-descriptions :column="1" size="mini" border>
|
<el-descriptions :column="1" size="mini" border>
|
||||||
<el-descriptions-item v-for="(param, index) in item.datatype.params" :key="index" :label="param.name">
|
<el-descriptions-item v-for="(param, index) in item.datatype.params" :key="index" :label="param.name">
|
||||||
<div v-if="param.datatype.type == 'bool'">
|
<div v-if="param.datatype.type == 'bool'">
|
||||||
<el-switch v-model="param.value" size="mini" @change="mqttPublish(deviceInfo, param)" active-text="" inactive-text="" active-value="1" inactive-value="0" style="min-width: 100px" disabled />
|
<el-switch
|
||||||
|
v-model="param.value"
|
||||||
|
size="mini"
|
||||||
|
@change="mqttPublish(deviceInfo, param)"
|
||||||
|
active-text=""
|
||||||
|
inactive-text=""
|
||||||
|
active-value="1"
|
||||||
|
inactive-value="0"
|
||||||
|
style="min-width: 100px"
|
||||||
|
disabled
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="param.datatype.type == 'enum'">
|
<div v-if="param.datatype.type == 'enum'">
|
||||||
<el-select v-model="param.value" placeholder="请选择" @change="mqttPublish(deviceInfo, param)" disabled size="mini">
|
<el-select v-model="param.value" :placeholder="$t('device.running-status.866086-3')" @change="mqttPublish(deviceInfo, param)" disabled size="mini">
|
||||||
<el-option v-for="subItem in param.datatype.enumList" :key="subItem.value" :label="subItem.text" :value="subItem.value" />
|
<el-option v-for="subItem in param.datatype.enumList" :key="subItem.value" :label="subItem.text" :value="subItem.value" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="param.datatype.type == 'string'">
|
<div v-if="param.datatype.type == 'string'">
|
||||||
<el-input v-model="param.value" placeholder="请输入字符串" disabled size="mini"></el-input>
|
<el-input v-model="param.value" :placeholder="$t('device.running-status.866086-4')" disabled size="mini"></el-input>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="param.datatype.type == 'decimal'">
|
<div v-if="param.datatype.type == 'decimal'">
|
||||||
<el-input v-model="param.value" type="number" placeholder="请输入小数 " disabled size="mini"></el-input>
|
<el-input v-model="param.value" type="number" :placeholder="$t('device.running-status.866086-7')" disabled size="mini"></el-input>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="param.datatype.type == 'integer'">
|
<div v-if="param.datatype.type == 'integer'">
|
||||||
<el-input v-model="param.value" type="integer" placeholder="请输入整数 " disabled size="mini"></el-input>
|
<el-input v-model="param.value" type="integer" :placeholder="$t('device.running-status.866086-8')" disabled size="mini"></el-input>
|
||||||
</div>
|
</div>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
@@ -287,13 +401,13 @@
|
|||||||
<el-descriptions :column="1" size="mini" border v-if="item.datatype.arrayType != 'object'">
|
<el-descriptions :column="1" size="mini" border v-if="item.datatype.arrayType != 'object'">
|
||||||
<el-descriptions-item v-for="(model, index) in item.datatype.arrayModel" :key="index" :label="item.name + (index + 1)">
|
<el-descriptions-item v-for="(model, index) in item.datatype.arrayModel" :key="index" :label="item.name + (index + 1)">
|
||||||
<div v-if="item.datatype.arrayType == 'string'">
|
<div v-if="item.datatype.arrayType == 'string'">
|
||||||
<el-input v-model="model.value" placeholder="请输入字符串" size="mini" disabled></el-input>
|
<el-input v-model="model.value" :placeholder="$t('device.running-status.866086-4')" size="mini" disabled></el-input>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="item.datatype.arrayType == 'decimal'">
|
<div v-if="item.datatype.arrayType == 'decimal'">
|
||||||
<el-input v-model="model.value" type="number" placeholder="请输入小数 " size="mini" disabled></el-input>
|
<el-input v-model="model.value" type="number" :placeholder="$t('device.running-status.866086-7')" size="mini" disabled></el-input>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="item.datatype.arrayType == 'integer'">
|
<div v-if="item.datatype.arrayType == 'integer'">
|
||||||
<el-input v-model="model.value" type="integer" placeholder="请输入整数 " size="mini" disabled></el-input>
|
<el-input v-model="model.value" type="integer" :placeholder="$t('device.running-status.866086-8')" size="mini" disabled></el-input>
|
||||||
</div>
|
</div>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
@@ -308,21 +422,30 @@
|
|||||||
<el-descriptions :column="1" size="mini" border>
|
<el-descriptions :column="1" size="mini" border>
|
||||||
<el-descriptions-item v-for="(param, index) in arrayParam" :key="index" :label="param.name">
|
<el-descriptions-item v-for="(param, index) in arrayParam" :key="index" :label="param.name">
|
||||||
<div v-if="param.datatype.type == 'bool'">
|
<div v-if="param.datatype.type == 'bool'">
|
||||||
<el-switch v-model="param.value" @change="mqttPublish(deviceInfo, param)" active-text="" inactive-text="" active-value="1" inactive-value="0" style="min-width: 100px" disabled />
|
<el-switch
|
||||||
|
v-model="param.value"
|
||||||
|
@change="mqttPublish(deviceInfo, param)"
|
||||||
|
active-text=""
|
||||||
|
inactive-text=""
|
||||||
|
active-value="1"
|
||||||
|
inactive-value="0"
|
||||||
|
style="min-width: 100px"
|
||||||
|
disabled
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="param.datatype.type == 'enum'">
|
<div v-if="param.datatype.type == 'enum'">
|
||||||
<el-select v-model="param.value" placeholder="请选择" @change="mqttPublish(deviceInfo, param)" disabled size="mini">
|
<el-select v-model="param.value" :placeholder="$t('device.running-status.866086-3')" @change="mqttPublish(deviceInfo, param)" disabled size="mini">
|
||||||
<el-option v-for="subItem in param.datatype.enumList" :key="subItem.value" :label="subItem.text" :value="subItem.value" />
|
<el-option v-for="subItem in param.datatype.enumList" :key="subItem.value" :label="subItem.text" :value="subItem.value" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="param.datatype.type == 'string'">
|
<div v-if="param.datatype.type == 'string'">
|
||||||
<el-input v-model="param.value" placeholder="请输入字符串" disabled size="mini"></el-input>
|
<el-input v-model="param.value" :placeholder="$t('device.running-status.866086-4')" disabled size="mini"></el-input>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="param.datatype.type == 'decimal'">
|
<div v-if="param.datatype.type == 'decimal'">
|
||||||
<el-input v-model="param.value" type="number" placeholder="请输入小数 " disabled size="mini"></el-input>
|
<el-input v-model="param.value" type="number" :placeholder="$t('device.running-status.866086-7')" disabled size="mini"></el-input>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="param.datatype.type == 'integer'">
|
<div v-if="param.datatype.type == 'integer'">
|
||||||
<el-input v-model="param.value" type="integer" placeholder="请输入整数 " disabled size="mini"></el-input>
|
<el-input v-model="param.value" type="integer" :placeholder="$t('device.running-status.866086-8')" disabled size="mini"></el-input>
|
||||||
</div>
|
</div>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
</el-descriptions>
|
</el-descriptions>
|
||||||
@@ -348,7 +471,6 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
import { serviceInvoke } from '@/api/iot/runstatus';
|
import { serviceInvoke } from '@/api/iot/runstatus';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@@ -680,7 +802,7 @@ export default {
|
|||||||
arrayInputChange(value, thingsModel) {
|
arrayInputChange(value, thingsModel) {
|
||||||
let arrayModels = value.split(',');
|
let arrayModels = value.split(',');
|
||||||
if (arrayModels.length != thingsModel.datatype.arrayCount) {
|
if (arrayModels.length != thingsModel.datatype.arrayCount) {
|
||||||
this.$modal.alertWarning('元素个数不匹配,数组元素个数为' + thingsModel.datatype.arrayCount + '个,以英文逗号分隔。');
|
this.$modal.alertWarning(this.$t('device.running-status.866086-29') + thingsModel.datatype.arrayCount + this.$t('device.running-status.866086-30'));
|
||||||
} else {
|
} else {
|
||||||
for (let i = 0; i < thingsModel.datatype.arrayCount; i++) {
|
for (let i = 0; i < thingsModel.datatype.arrayCount; i++) {
|
||||||
thingsModel.datatype.arrayModel[i].shadow = arrayModels[i];
|
thingsModel.datatype.arrayModel[i].shadow = arrayModels[i];
|
||||||
@@ -704,7 +826,7 @@ export default {
|
|||||||
let message = '{"version":' + this.firmware.version + ',"downloadUrl":"' + this.getDownloadUrl(this.firmware.filePath) + '"}';
|
let message = '{"version":' + this.firmware.version + ',"downloadUrl":"' + this.getDownloadUrl(this.firmware.filePath) + '"}';
|
||||||
// 发布
|
// 发布
|
||||||
this.$mqttTool
|
this.$mqttTool
|
||||||
.publish(topic, message, '设备升级')
|
.publish(topic, message, this.$t('device.running-status.866086-31'))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
this.$modal.notifySuccess(res);
|
this.$modal.notifySuccess(res);
|
||||||
})
|
})
|
||||||
@@ -832,4 +954,4 @@ export default {
|
|||||||
.el-slider__button-wrapper {
|
.el-slider__button-wrapper {
|
||||||
top: -9px;
|
top: -9px;
|
||||||
}
|
}
|
||||||
</
|
</style>
|
||||||
|
|||||||
@@ -7,13 +7,13 @@
|
|||||||
<el-input v-model="queryParams.productName" :placeholder="$t('productList.index.470902-2')" clearable size="small" @keyup.enter.native="handleQuery" />
|
<el-input v-model="queryParams.productName" :placeholder="$t('productList.index.470902-2')" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('common.search') }}</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('search') }}</el-button>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('common.reset') }}</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('reset') }}</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<el-table v-loading="loading" ref="singleTable" :data="productList" @row-click="rowClick" highlight-current-row size="mini">
|
<el-table v-loading="loading" ref="singleTable" :data="productList" @row-click="rowClick" highlight-current-row size="mini">
|
||||||
<el-table-column :label="$t('common.select')" width="50" align="center">
|
<el-table-column :label="$t('select')" width="50" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<input type="radio" :checked="scope.row.isSelect" name="product" />
|
<input type="radio" :checked="scope.row.isSelect" name="product" />
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -1,23 +1,19 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style="padding: 6px">
|
<div style="padding: 6px">
|
||||||
<el-card v-show="showSearch" style="margin-bottom: 6px">
|
<el-card v-show="showSearch" style="margin-bottom: 6px">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px" style="margin-bottom: -20px">
|
||||||
label-width="68px" style="margin-bottom: -20px">
|
|
||||||
<el-form-item :label="$t('script.349087-0')" prop="scriptId">
|
<el-form-item :label="$t('script.349087-0')" prop="scriptId">
|
||||||
<el-input v-model="queryParams.scriptId" :placeholder="$t('script.349087-1')" clearable
|
<el-input v-model="queryParams.scriptId" :placeholder="$t('script.349087-1')" clearable @keyup.enter.native="handleQuery" />
|
||||||
@keyup.enter.native="handleQuery" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('script.349087-2')" prop="scriptName">
|
<el-form-item :label="$t('script.349087-2')" prop="scriptName">
|
||||||
<el-input v-model="queryParams.scriptName" :placeholder="$t('script.349087-3')" clearable
|
<el-input v-model="queryParams.scriptName" :placeholder="$t('script.349087-3')" clearable @keyup.enter.native="handleQuery" />
|
||||||
@keyup.enter.native="handleQuery" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('common.search') }}</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('search') }}</el-button>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('common.reset') }}</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('reset') }}</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item style="float: right">
|
<el-form-item style="float: right">
|
||||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['iot:script:add']">{{ $t('add') }}</el-button>
|
||||||
v-hasPermi="['iot:script:add']">{{ $t('common.add') }}</el-button>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
@@ -34,8 +30,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :label="$t('script.index.470901-5')" align="center" prop="status">
|
<el-table-column :label="$t('script.index.470901-5')" align="center" prop="status">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<dict-tag :options="dict.type.rule_script_action" :value="scope.row.scriptAction"
|
<dict-tag :options="dict.type.rule_script_action" :value="scope.row.scriptAction" size="small" />
|
||||||
size="small" />
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :label="$t('script.index.470901-7')" align="center" prop="scriptLanguage" />
|
<el-table-column :label="$t('script.index.470901-7')" align="center" prop="scriptLanguage" />
|
||||||
@@ -46,23 +41,19 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :label="$t('script.index.470901-9')" align="center" prop="scriptOrder" />
|
<el-table-column :label="$t('script.index.470901-9')" align="center" prop="scriptOrder" />
|
||||||
<el-table-column :label="$t('common.opation')" align="center" class-name="small-padding fixed-width" width="200">
|
<el-table-column :label="$t('opation')" align="center" class-name="small-padding fixed-width" width="200">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button size="small" type="text" icon="el-icon-date" @click="handleLog(scope.row.scriptId)" v-hasPermi="['iot:script:query']">{{ $t('script.index.470901-23') }}</el-button>
|
<el-button size="small" type="text" icon="el-icon-date" @click="handleLog(scope.row.scriptId)" v-hasPermi="['iot:script:query']">{{ $t('script.index.470901-23') }}</el-button>
|
||||||
<el-button size="mini" type="text" icon="el-icon-view" @click="handleUpdate(scope.row)"
|
<el-button size="mini" type="text" icon="el-icon-view" @click="handleUpdate(scope.row)" v-hasPermi="['iot:script:query']">{{ $t('script.index.470901-24') }}</el-button>
|
||||||
v-hasPermi="['iot:script:query']">{{ $t('script.index.470901-24') }}</el-button>
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['iot:script:remove']">{{ $t('del') }}</el-button>
|
||||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
|
|
||||||
v-hasPermi="['iot:script:remove']">{{ $t('common.del') }}</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||||
:limit.sync="queryParams.pageSize" @pagination="getList" />
|
|
||||||
|
|
||||||
<!-- 添加或修改规则引擎脚本对话框 -->
|
<!-- 添加或修改规则引擎脚本对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body :close-on-click-modal="false"
|
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body :close-on-click-modal="false" :close-on-press-escape="false">
|
||||||
:close-on-press-escape="false">
|
|
||||||
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
|
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
|
||||||
<el-row :gutter="50">
|
<el-row :gutter="50">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
@@ -72,16 +63,19 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item :label="$t('script.index.470901-9')" prop="scriptOrder">
|
<el-form-item :label="$t('script.index.470901-9')" prop="scriptOrder">
|
||||||
<el-input-number v-model="form.scriptOrder" :placeholder="$t('script.index.470901-10')" type="number"
|
<el-input-number v-model="form.scriptOrder" :placeholder="$t('script.index.470901-10')" type="number" controls-position="right" style="width: 100%" />
|
||||||
controls-position="right" style="width: 100%" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item :label="$t('script.349087-6')" prop="scriptEvent">
|
<el-form-item :label="$t('script.349087-6')" prop="scriptEvent">
|
||||||
<el-select v-model="form.scriptEvent" :placeholder="$t('script.349087-11')" style="width: 100%">
|
<el-select v-model="form.scriptEvent" :placeholder="$t('script.349087-11')" style="width: 100%">
|
||||||
<el-option v-for="dict in dict.type.rule_script_event" :key="dict.label"
|
<el-option
|
||||||
:label="dict.label" :value="Number(dict.value)"
|
v-for="dict in dict.type.rule_script_event"
|
||||||
:disabled="dict.value !== '1' && dict.value !== '2'"></el-option>
|
:key="dict.label"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="Number(dict.value)"
|
||||||
|
:disabled="dict.value !== '1' && dict.value !== '2'"
|
||||||
|
></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -89,9 +83,7 @@
|
|||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item :label="$t('script.index.470901-5')" prop="scriptAction">
|
<el-form-item :label="$t('script.index.470901-5')" prop="scriptAction">
|
||||||
<el-select v-model="form.scriptAction" :placeholder="$t('script.index.470901-6')" style="width: 100%">
|
<el-select v-model="form.scriptAction" :placeholder="$t('script.index.470901-6')" style="width: 100%">
|
||||||
<el-option v-for="dict in dict.type.rule_script_action" :key="dict.label"
|
<el-option v-for="dict in dict.type.rule_script_action" :key="dict.label" :label="dict.label" :value="Number(dict.value)" :disabled="dict.value !== '1'"></el-option>
|
||||||
:label="dict.label" :value="Number(dict.value)"
|
|
||||||
:disabled="dict.value !== '1'"></el-option>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -102,10 +94,8 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item :label="$t('script.index.470901-2')" prop="productName">
|
<el-form-item :label="$t('script.index.470901-2')" prop="productName">
|
||||||
<el-input readonly v-model="form.productName" size="small" :placeholder="$t('script.index.470901-3')"
|
<el-input readonly v-model="form.productName" size="small" :placeholder="$t('script.index.470901-3')" style="margin-top: 3px">
|
||||||
style="margin-top: 3px">
|
<el-button slot="append" @click="handleSelectProduct()" size="small">{{ $t('script.index.470901-4') }}</el-button>
|
||||||
<el-button slot="append" @click="handleSelectProduct()"
|
|
||||||
size="small">{{ $t('script.index.470901-4') }}</el-button>
|
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -113,28 +103,21 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div style="padding: 0px 10px" @click="editClick">
|
<div style="padding: 0px 10px" @click="editClick">
|
||||||
<AceEditor ref="codeEditor" :content.sync="form.scriptData" lang="groovy" codeStyle="chrome"
|
<AceEditor ref="codeEditor" :content.sync="form.scriptData" lang="groovy" codeStyle="chrome" :read-only="false" width="100%" height="450px"></AceEditor>
|
||||||
:read-only="false" width="100%" height="450px"></AceEditor>
|
|
||||||
</div>
|
</div>
|
||||||
<div style="padding: 0 10px; margin: 10px 0">
|
<div style="padding: 0 10px; margin: 10px 0">
|
||||||
<el-alert :title="validateMsg" type="success" show-icon v-if="isValidate && validateMsg"
|
<el-alert :title="validateMsg" type="success" show-icon v-if="isValidate && validateMsg" :closable="false"></el-alert>
|
||||||
:closable="false"></el-alert>
|
<el-alert :title="validateMsg" type="error" show-icon v-if="!isValidate && validateMsg" :closable="false"></el-alert>
|
||||||
<el-alert :title="validateMsg" type="error" show-icon v-if="!isValidate && validateMsg"
|
|
||||||
:closable="false"></el-alert>
|
|
||||||
</div>
|
</div>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<span style="float: left">
|
<span style="float: left">
|
||||||
<el-link style="line-height: 40px; padding-left: 20px" icon="el-icon-question"
|
<el-link style="line-height: 40px; padding-left: 20px" icon="el-icon-question" :underline="false" type="primary" href="https://fastbee.cn/doc/pages/rule_engine/" target="_blank">
|
||||||
:underline="false" type="primary" href="https://fastbee.cn/doc/pages/rule_engine/"
|
|
||||||
target="_blank">
|
|
||||||
{{ $t('script.index.470901-17') }}
|
{{ $t('script.index.470901-17') }}
|
||||||
</el-link>
|
</el-link>
|
||||||
</span>
|
</span>
|
||||||
<el-button type="success" @click="handleValidate">{{ $t('script.index.470901-18') }}</el-button>
|
<el-button type="success" @click="handleValidate">{{ $t('script.index.470901-18') }}</el-button>
|
||||||
<el-button type="primary" @click="submitForm" v-hasPermi="['iot:script:edit']"
|
<el-button type="primary" @click="submitForm" v-hasPermi="['iot:script:edit']" v-show="form.scriptId" :disabled="!isValidate">{{ $t('script.index.470901-19') }}</el-button>
|
||||||
v-show="form.scriptId" :disabled="!isValidate">{{ $t('script.index.470901-19') }}</el-button>
|
<el-button type="primary" @click="submitForm" v-hasPermi="['iot:script:add']" v-show="!form.scriptId" :disabled="!isValidate">{{ $t('add') }}</el-button>
|
||||||
<el-button type="primary" @click="submitForm" v-hasPermi="['iot:script:add']"
|
|
||||||
v-show="!form.scriptId" :disabled="!isValidate">{{ $t('common.add') }}</el-button>
|
|
||||||
<el-button @click="cancel">{{ $t('script.index.470901-20') }}</el-button>
|
<el-button @click="cancel">{{ $t('script.index.470901-20') }}</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|||||||
@@ -195,84 +195,84 @@ export default {
|
|||||||
protocol: [
|
protocol: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '默认播放协议不能为空',
|
message: this.$t('sip.index.998533-26'),
|
||||||
trigger: 'blur',
|
trigger: 'blur',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
ip: [
|
ip: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '服务器ip不能为空',
|
message: this.$t('sip.index.998533-27'),
|
||||||
trigger: 'blur',
|
trigger: 'blur',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
domain: [
|
domain: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '服务器域名不能为空',
|
message: this.$t('sip.index.998533-28'),
|
||||||
trigger: 'blur',
|
trigger: 'blur',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
secret: [
|
secret: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '流媒体密钥不能为空',
|
message: this.$t('sip.index.998533-29'),
|
||||||
trigger: 'blur',
|
trigger: 'blur',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
portHttp: [
|
portHttp: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: 'http端口不能为空',
|
message: this.$t('sip.index.998533-30'),
|
||||||
trigger: 'blur',
|
trigger: 'blur',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
portHttps: [
|
portHttps: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: 'https端口不能为空',
|
message: this.$t('sip.index.998533-31'),
|
||||||
trigger: 'blur',
|
trigger: 'blur',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
portRtmp: [
|
portRtmp: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: 'rtmp端口不能为空',
|
message: this.$t('sip.index.998533-32'),
|
||||||
trigger: 'blur',
|
trigger: 'blur',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
portRtsp: [
|
portRtsp: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: 'rtsp端口不能为空',
|
message: this.$t('sip.index.998533-33'),
|
||||||
trigger: 'blur',
|
trigger: 'blur',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
rtpPortRange: [
|
rtpPortRange: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: 'rtp端口范围不能为空',
|
message: this.$t('sip.index.998533-34'),
|
||||||
trigger: 'blur',
|
trigger: 'blur',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
delFlag: [
|
delFlag: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '删除标志不能为空',
|
message: this.$t('sip.index.998533-35'),
|
||||||
trigger: 'blur',
|
trigger: 'blur',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
createBy: [
|
createBy: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '创建者不能为空',
|
message: this.$t('sip.index.998533-36'),
|
||||||
trigger: 'blur',
|
trigger: 'blur',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
createTime: [
|
createTime: [
|
||||||
{
|
{
|
||||||
required: true,
|
required: true,
|
||||||
message: '创建时间不能为空',
|
message: this.$t('sip.index.998533-37'),
|
||||||
trigger: 'blur',
|
trigger: 'blur',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -64,7 +64,12 @@
|
|||||||
<el-switch v-model="mediaServerForm.autoConfig"></el-switch>
|
<el-switch v-model="mediaServerForm.autoConfig"></el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('sip.mediaServerEdit.998534-20')">
|
<el-form-item :label="$t('sip.mediaServerEdit.998534-20')">
|
||||||
<el-switch :active-text="$t('sip.mediaServerEdit.998534-21')" :inactive-text="$t('sip.mediaServerEdit.998534-22')" @change="portRangeChange" v-model="mediaServerForm.rtpEnable"></el-switch>
|
<el-switch
|
||||||
|
:active-text="$t('sip.mediaServerEdit.998534-21')"
|
||||||
|
:inactive-text="$t('sip.mediaServerEdit.998534-22')"
|
||||||
|
@change="portRangeChange"
|
||||||
|
v-model="mediaServerForm.rtpEnable"
|
||||||
|
></el-switch>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item v-if="!mediaServerForm.rtpEnable" :label="$t('sip.mediaServerEdit.998534-23')" prop="rtpProxyPort">
|
<el-form-item v-if="!mediaServerForm.rtpEnable" :label="$t('sip.mediaServerEdit.998534-23')" prop="rtpProxyPort">
|
||||||
<el-input v-model.number="mediaServerForm.rtpProxyPort" clearable></el-input>
|
<el-input v-model.number="mediaServerForm.rtpProxyPort" clearable></el-input>
|
||||||
@@ -111,7 +116,6 @@ export default {
|
|||||||
editFlag: {
|
editFlag: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false,
|
default: false,
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -119,7 +123,7 @@ export default {
|
|||||||
// 校验IP是否符合规则
|
// 校验IP是否符合规则
|
||||||
var reg = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;
|
var reg = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/;
|
||||||
if (!reg.test(value)) {
|
if (!reg.test(value)) {
|
||||||
return callback(new Error('请输入有效的IP地址'));
|
return callback(new Error(this.$t('sip.mediaServerEdit.998534-24')));
|
||||||
} else {
|
} else {
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
@@ -129,7 +133,7 @@ export default {
|
|||||||
// 校验IP是否符合规则
|
// 校验IP是否符合规则
|
||||||
var reg = /^(([0-9]|[1-9]\d{1,3}|[1-5]\d{4}|6[0-5]{2}[0-3][0-5]))$/;
|
var reg = /^(([0-9]|[1-9]\d{1,3}|[1-5]\d{4}|6[0-5]{2}[0-3][0-5]))$/;
|
||||||
if (!reg.test(value)) {
|
if (!reg.test(value)) {
|
||||||
return callback(new Error('请输入有效的端口号'));
|
return callback(new Error(this.$t('sip.mediaServerEdit.998534-25')));
|
||||||
} else {
|
} else {
|
||||||
callback();
|
callback();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,22 +3,19 @@
|
|||||||
<el-card v-show="showSearch" style="margin-bottom: 5px">
|
<el-card v-show="showSearch" style="margin-bottom: 5px">
|
||||||
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px" style="margin-bottom: -20px">
|
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px" style="margin-bottom: -20px">
|
||||||
<el-form-item :label="$t('template.index.891112-22')" prop="templateName">
|
<el-form-item :label="$t('template.index.891112-22')" prop="templateName">
|
||||||
<el-input v-model="queryParams.templateName" :placeholder="$t('template.index.891112-1')" clearable size="small"
|
<el-input v-model="queryParams.templateName" :placeholder="$t('template.index.891112-1')" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||||
@keyup.enter.native="handleQuery" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('template.index.891112-2')" prop="type">
|
<el-form-item :label="$t('template.index.891112-2')" prop="type">
|
||||||
<el-select v-model="queryParams.type" :placeholder="$t('template.index.891112-3')" clearable size="small">
|
<el-select v-model="queryParams.type" :placeholder="$t('template.index.891112-3')" clearable size="small">
|
||||||
<el-option v-for="dict in dict.type.iot_things_type" :key="dict.value" :label="dict.label"
|
<el-option v-for="dict in dict.type.iot_things_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||||
:value="dict.value" />
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('common.search') }}</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('search') }}</el-button>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('common.reset') }}</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('reset') }}</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item style="float: right">
|
<el-form-item style="float: right">
|
||||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['iot:template:add']">{{ $t('add') }}</el-button>
|
||||||
v-hasPermi="['iot:template:add']">{{ $t('common.add') }}</el-button>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-card>
|
</el-card>
|
||||||
@@ -57,32 +54,34 @@
|
|||||||
<dict-tag :options="dict.type.iot_data_type" :value="scope.row.datatype" />
|
<dict-tag :options="dict.type.iot_data_type" :value="scope.row.datatype" />
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :label="$t('template.index.891112-15')" align="left" header-align="center" prop="specs" min-width="150"
|
<el-table-column :label="$t('template.index.891112-15')" align="left" header-align="center" prop="specs" min-width="150" class-name="specsColor">
|
||||||
class-name="specsColor">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div v-html="formatSpecsDisplay(scope.row.specs)"></div>
|
<div v-html="formatSpecsDisplay(scope.row.specs)"></div>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :label="$t('template.index.891112-16')" align="center" prop="modelOrder" width="80" />
|
<el-table-column :label="$t('template.index.891112-16')" align="center" prop="modelOrder" width="80" />
|
||||||
<el-table-column :label="$t('common.opation')" align="center" class-name="small-padding fixed-width" width="150">
|
<el-table-column :label="$t('opation')" align="center" class-name="small-padding fixed-width" width="150">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button size="small" type="text" style="padding: 5px" icon="el-icon-edit"
|
<el-button size="small" type="text" style="padding: 5px" icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['iot:template:query']" v-if="scope.row.isSys == '0' ? true : !isTenant">
|
||||||
@click="handleUpdate(scope.row)" v-hasPermi="['iot:template:query']"
|
{{ $t('edit') }}
|
||||||
v-if="scope.row.isSys == '0' ? true : !isTenant">
|
|
||||||
{{ $t('common.edit') }}
|
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button size="small" type="text" style="padding: 5px" icon="el-icon-delete"
|
<el-button
|
||||||
@click="handleDelete(scope.row)" v-hasPermi="['iot:template:remove']"
|
size="small"
|
||||||
v-if="scope.row.isSys == '0' ? true : !isTenant">
|
type="text"
|
||||||
{{ $t('common.del') }}
|
style="padding: 5px"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['iot:template:remove']"
|
||||||
|
v-if="scope.row.isSys == '0' ? true : !isTenant"
|
||||||
|
>
|
||||||
|
{{ $t('del') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<span style="font-size: 10px; color: #999" v-if="scope.row.isSys == '1' && isTenant">{{ $t('template.index.891112-21') }}</span>
|
<span style="font-size: 10px; color: #999" v-if="scope.row.isSys == '1' && isTenant">{{ $t('template.index.891112-21') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||||
@pagination="getList" />
|
|
||||||
|
|
||||||
<!-- 添加或修改通用物模型对话框 -->
|
<!-- 添加或修改通用物模型对话框 -->
|
||||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body :close-on-click-modal="false">
|
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body :close-on-click-modal="false">
|
||||||
@@ -94,8 +93,7 @@
|
|||||||
<el-input v-model="form.identifier" :placeholder="$t('template.index.891112-25')" style="width: 385px" />
|
<el-input v-model="form.identifier" :placeholder="$t('template.index.891112-25')" style="width: 385px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('template.index.891112-26')" prop="modelOrder">
|
<el-form-item :label="$t('template.index.891112-26')" prop="modelOrder">
|
||||||
<el-input-number controls-position="right" v-model="form.modelOrder" :placeholder="$t('template.index.891112-27')"
|
<el-input-number controls-position="right" v-model="form.modelOrder" :placeholder="$t('template.index.891112-27')" style="width: 386px" />
|
||||||
style="width: 386px" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('template.index.891112-28')" prop="type">
|
<el-form-item :label="$t('template.index.891112-28')" prop="type">
|
||||||
<el-radio-group v-model="form.type" @change="typeChange(form.type)">
|
<el-radio-group v-model="form.type" @change="typeChange(form.type)">
|
||||||
@@ -109,32 +107,51 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-tooltip effect="dark" :content="$t('template.index.891112-33')" placement="top">
|
<el-tooltip effect="dark" :content="$t('template.index.891112-33')" placement="top">
|
||||||
<el-checkbox name="isChart" :label="$t('template.index.891112-8')" @change="isChartChange" v-show="form.type == 1"
|
<el-checkbox
|
||||||
v-model="form.isChart" :true-label="1" :false-label="0"></el-checkbox>
|
name="isChart"
|
||||||
|
:label="$t('template.index.891112-8')"
|
||||||
|
@change="isChartChange"
|
||||||
|
v-show="form.type == 1"
|
||||||
|
v-model="form.isChart"
|
||||||
|
:true-label="1"
|
||||||
|
:false-label="0"
|
||||||
|
></el-checkbox>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-tooltip effect="dark" :content="$t('template.index.891112-34')" placement="top">
|
<el-tooltip effect="dark" :content="$t('template.index.891112-34')" placement="top">
|
||||||
<el-checkbox name="isMonitor" :label="$t('template.index.891112-9')" @change="isMonitorChange" v-show="form.type == 1"
|
<el-checkbox
|
||||||
v-model="form.isMonitor" :true-label="1" :false-label="0"></el-checkbox>
|
name="isMonitor"
|
||||||
|
:label="$t('template.index.891112-9')"
|
||||||
|
@change="isMonitorChange"
|
||||||
|
v-show="form.type == 1"
|
||||||
|
v-model="form.isMonitor"
|
||||||
|
:true-label="1"
|
||||||
|
:false-label="0"
|
||||||
|
></el-checkbox>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-tooltip effect="dark" :content="$t('template.index.891112-35')" placement="top">
|
<el-tooltip effect="dark" :content="$t('template.index.891112-35')" placement="top">
|
||||||
<el-checkbox name="isReadonly" :label="$t('template.index.891112-36')" @change="isReadonlyChange" :disabled="form.type == 3"
|
<el-checkbox
|
||||||
v-model="form.isReadonly" :true-label="1" :false-label="0"></el-checkbox>
|
name="isReadonly"
|
||||||
|
:label="$t('template.index.891112-36')"
|
||||||
|
@change="isReadonlyChange"
|
||||||
|
:disabled="form.type == 3"
|
||||||
|
v-model="form.isReadonly"
|
||||||
|
:true-label="1"
|
||||||
|
:false-label="0"
|
||||||
|
></el-checkbox>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-tooltip effect="dark" :content="$t('template.index.891112-37')" placement="top">
|
<el-tooltip effect="dark" :content="$t('template.index.891112-37')" placement="top">
|
||||||
<el-checkbox name="isHistory" :label="$t('template.index.891112-11')" v-model="form.isHistory" :true-label="1"
|
<el-checkbox name="isHistory" :label="$t('template.index.891112-11')" v-model="form.isHistory" :true-label="1" :false-label="0"></el-checkbox>
|
||||||
:false-label="0"></el-checkbox>
|
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<el-tooltip effect="dark" :content="$t('template.index.891112-38')" placement="top">
|
<el-tooltip effect="dark" :content="$t('template.index.891112-38')" placement="top">
|
||||||
<el-checkbox name="isSharePerm" :label="$t('template.index.891112-39')" v-model="form.isSharePerm" :true-label="1"
|
<el-checkbox name="isSharePerm" :label="$t('template.index.891112-39')" v-model="form.isSharePerm" :true-label="1" :false-label="0"></el-checkbox>
|
||||||
:false-label="0"></el-checkbox>
|
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -156,26 +173,22 @@
|
|||||||
<el-form-item :label="$t('template.index.891112-48')" v-if="form.datatype == 'integer'">
|
<el-form-item :label="$t('template.index.891112-48')" v-if="form.datatype == 'integer'">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="9">
|
<el-col :span="9">
|
||||||
<el-input v-model="form.specs.min" :placeholder="$t('template.index.891112-49')" controls-position="right" type="number"
|
<el-input v-model="form.specs.min" :placeholder="$t('template.index.891112-49')" controls-position="right" type="number" style="width: 174px" @input="handleEdit" />
|
||||||
style="width: 174px;" @input="handleEdit" />
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="2" align="center">{{ $t('template.index.891112-50') }}</el-col>
|
<el-col :span="2" align="center">{{ $t('template.index.891112-50') }}</el-col>
|
||||||
<el-col :span="9">
|
<el-col :span="9">
|
||||||
<el-input v-model="form.specs.max" :placeholder="$t('template.index.891112-51')" type="number" controls-position="right"
|
<el-input v-model="form.specs.max" :placeholder="$t('template.index.891112-51')" type="number" controls-position="right" style="width: 174px" @input="handleEditmax" />
|
||||||
style="width: 174px;" @input="handleEditmax" />
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('template.index.891112-48')" v-if="form.datatype == 'decimal'">
|
<el-form-item :label="$t('template.index.891112-48')" v-if="form.datatype == 'decimal'">
|
||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="9">
|
<el-col :span="9">
|
||||||
<el-input v-model="form.specs.min" :placeholder="$t('template.index.891112-49')" controls-position="right" type="number"
|
<el-input v-model="form.specs.min" :placeholder="$t('template.index.891112-49')" controls-position="right" type="number" style="width: 174px" />
|
||||||
style="width: 174px;" />
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="2" align="center">{{ $t('template.index.891112-50') }}</el-col>
|
<el-col :span="2" align="center">{{ $t('template.index.891112-50') }}</el-col>
|
||||||
<el-col :span="9">
|
<el-col :span="9">
|
||||||
<el-input v-model="form.specs.max" :placeholder="$t('template.index.891112-51')" type="number" controls-position="right"
|
<el-input v-model="form.specs.max" :placeholder="$t('template.index.891112-51')" type="number" controls-position="right" style="width: 174px" />
|
||||||
style="width: 174px;" />
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -183,8 +196,7 @@
|
|||||||
<el-input v-model="form.specs.unit" :placeholder="$t('template.index.891112-53')" style="width: 385px" />
|
<el-input v-model="form.specs.unit" :placeholder="$t('template.index.891112-53')" style="width: 385px" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('template.index.891112-54')" prop="step" v-if="form.datatype == 'integer' || form.datatype == 'decimal'">
|
<el-form-item :label="$t('template.index.891112-54')" prop="step" v-if="form.datatype == 'integer' || form.datatype == 'decimal'">
|
||||||
<el-input controls-position="right" v-model="form.specs.step" :placeholder="$t('template.index.891112-55')" type="number"
|
<el-input controls-position="right" v-model="form.specs.step" :placeholder="$t('template.index.891112-55')" type="number" style="width: 386px" />
|
||||||
style="width: 386px" />
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="form.datatype == 'bool'">
|
<div v-if="form.datatype == 'bool'">
|
||||||
@@ -218,8 +230,9 @@
|
|||||||
<el-col :span="11" :offset="1">
|
<el-col :span="11" :offset="1">
|
||||||
<el-input v-model="item.text" :placeholder="$t('template.index.891112-67')" />
|
<el-input v-model="item.text" :placeholder="$t('template.index.891112-67')" />
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="2" :offset="1" v-if="index != 0"><a style="color: #f56c6c"
|
<el-col :span="2" :offset="1" v-if="index != 0">
|
||||||
@click="removeEnumItem(index)">{{ $t('common.del') }}</a></el-col>
|
<a style="color: #f56c6c" @click="removeEnumItem(index)">{{ $t('del') }}</a>
|
||||||
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
<div>
|
<div>
|
||||||
+
|
+
|
||||||
@@ -260,16 +273,14 @@
|
|||||||
<el-col :span="18">
|
<el-col :span="18">
|
||||||
<el-input readonly v-model="item.name" size="mini" :placeholder="$t('template.index.891112-76')" style="margin-top: 3px">
|
<el-input readonly v-model="item.name" size="mini" :placeholder="$t('template.index.891112-76')" style="margin-top: 3px">
|
||||||
<template slot="prepend">
|
<template slot="prepend">
|
||||||
<el-tag size="mini" effect="dark" style="margin-left: -21px; height: 26px; line-height: 26px">{{
|
<el-tag size="mini" effect="dark" style="margin-left: -21px; height: 26px; line-height: 26px">{{ item.order }}</el-tag>
|
||||||
item.order }}</el-tag>
|
|
||||||
{{ form.identifier + '_' + item.id }}
|
{{ form.identifier + '_' + item.id }}
|
||||||
</template>
|
</template>
|
||||||
<el-button slot="append" @click="editParameter(item, index)" size="small">{{ $t('common.edit') }}</el-button>
|
<el-button slot="append" @click="editParameter(item, index)" size="small">{{ $t('edit') }}</el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="2" :offset="2">
|
<el-col :span="2" :offset="2">
|
||||||
<el-button size="small" plain type="danger" style="padding: 5px" icon="el-icon-delete"
|
<el-button size="small" plain type="danger" style="padding: 5px" icon="el-icon-delete" @click="removeParameter(index)">{{ $t('del') }}</el-button>
|
||||||
@click="removeParameter(index)">{{ $t('common.del') }}</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
@@ -287,16 +298,14 @@
|
|||||||
<el-col :span="18">
|
<el-col :span="18">
|
||||||
<el-input readonly v-model="item.name" size="mini" :placeholder="$t('template.index.891112-76')" style="margin-top: 3px">
|
<el-input readonly v-model="item.name" size="mini" :placeholder="$t('template.index.891112-76')" style="margin-top: 3px">
|
||||||
<template slot="prepend">
|
<template slot="prepend">
|
||||||
<el-tag size="mini" effect="dark" style="margin-left: -21px; height: 26px; line-height: 26px">{{
|
<el-tag size="mini" effect="dark" style="margin-left: -21px; height: 26px; line-height: 26px">{{ item.order }}</el-tag>
|
||||||
item.order }}</el-tag>
|
|
||||||
{{ form.identifier + '_' + item.id }}
|
{{ form.identifier + '_' + item.id }}
|
||||||
</template>
|
</template>
|
||||||
<el-button slot="append" @click="editParameter(item, index)">{{ $t('common.edit') }}</el-button>
|
<el-button slot="append" @click="editParameter(item, index)">{{ $t('edit') }}</el-button>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="2" :offset="2">
|
<el-col :span="2" :offset="2">
|
||||||
<el-button size="small" plain type="danger" style="padding: 5px" icon="el-icon-delete"
|
<el-button size="small" plain type="danger" style="padding: 5px" icon="el-icon-delete" @click="removeParameter(index)">{{ $t('del') }}</el-button>
|
||||||
@click="removeParameter(index)">{{ $t('common.del') }}</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
@@ -309,11 +318,9 @@
|
|||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="submitForm" v-hasPermi="['iot:template:edit']" v-show="form.templateId">{{ $t('common.edit') }}
|
<el-button type="primary" @click="submitForm" v-hasPermi="['iot:template:edit']" v-show="form.templateId">{{ $t('edit') }}</el-button>
|
||||||
</el-button>
|
<el-button type="primary" @click="submitForm" v-hasPermi="['iot:template:add']" v-show="!form.templateId">{{ $t('add') }}</el-button>
|
||||||
<el-button type="primary" @click="submitForm" v-hasPermi="['iot:template:add']" v-show="!form.templateId">{{ $t('common.add') }}
|
<el-button @click="cancel">{{ $t('cancel') }}</el-button>
|
||||||
</el-button>
|
|
||||||
<el-button @click="cancel">{{ $t('common.cancel') }}</el-button>
|
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
@@ -433,7 +440,6 @@ export default {
|
|||||||
trigger: 'change',
|
trigger: 'change',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
@@ -597,10 +603,9 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//验证模型特性为图表展示时,数据类型是否为整数或者小数
|
//验证模型特性为图表展示时,数据类型是否为整数或者小数
|
||||||
if ((this.form.isChart == 1 && this.form.datatype != 'integer') && (this.form.isChart == 1 && this.form.datatype != 'decimal')) {
|
if (this.form.isChart == 1 && this.form.datatype != 'integer' && this.form.isChart == 1 && this.form.datatype != 'decimal') {
|
||||||
this.$modal.msgError(this.$i18n.t('template.index.891112-95'));
|
this.$modal.msgError(this.$i18n.t('template.index.891112-95'));
|
||||||
}
|
} else if (this.form.templateId != null) {
|
||||||
else if (this.form.templateId != null) {
|
|
||||||
// 格式化specs
|
// 格式化specs
|
||||||
let tempForm = JSON.parse(JSON.stringify(this.form));
|
let tempForm = JSON.parse(JSON.stringify(this.form));
|
||||||
tempForm.specs = this.formatThingsSpecs();
|
tempForm.specs = this.formatThingsSpecs();
|
||||||
@@ -720,8 +725,8 @@ export default {
|
|||||||
} else if (this.form.datatype == 'string') {
|
} else if (this.form.datatype == 'string') {
|
||||||
data.maxLength = Number(this.form.specs.maxLength ? this.form.specs.maxLength : 1024);
|
data.maxLength = Number(this.form.specs.maxLength ? this.form.specs.maxLength : 1024);
|
||||||
} else if (this.form.datatype == 'bool') {
|
} else if (this.form.datatype == 'bool') {
|
||||||
data.falseText = this.form.specs.falseText ? this.form.specs.falseText : '关闭';
|
data.falseText = this.form.specs.falseText ? this.form.specs.falseText : this.$t('template.paramter.038405-57');
|
||||||
data.trueText = this.form.specs.trueText ? this.form.specs.trueText : '打开';
|
data.trueText = this.form.specs.trueText ? this.form.specs.trueText : this.$t('template.paramter.038405-58');
|
||||||
} else if (this.form.datatype == 'enum') {
|
} else if (this.form.datatype == 'enum') {
|
||||||
data.showWay = this.form.specs.showWay;
|
data.showWay = this.form.specs.showWay;
|
||||||
if (this.form.specs.enumList && this.form.specs.enumList[0].text != '') {
|
if (this.form.specs.enumList && this.form.specs.enumList[0].text != '') {
|
||||||
@@ -731,11 +736,11 @@ export default {
|
|||||||
data.enumList = [
|
data.enumList = [
|
||||||
{
|
{
|
||||||
value: '0',
|
value: '0',
|
||||||
text: '低',
|
text: this.$t('template.paramter.038405-59'),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: '1',
|
value: '1',
|
||||||
text: '高',
|
text: this.$t('template.paramter.038405-60'),
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@@ -781,19 +786,36 @@ export default {
|
|||||||
let specs = JSON.parse(json);
|
let specs = JSON.parse(json);
|
||||||
if (specs.type === 'integer' || specs.type === 'decimal') {
|
if (specs.type === 'integer' || specs.type === 'decimal') {
|
||||||
return (
|
return (
|
||||||
'<span style=\'width:50%;display:inline-block;\>' + this.$i18n.t('template.index.891112-105') + '<span style="color:#F56C6C">' +
|
"<span style='width:50%;display:inline-block;\>" +
|
||||||
|
this.$i18n.t('template.index.891112-105') +
|
||||||
|
'<span style="color:#F56C6C">' +
|
||||||
specs.max +
|
specs.max +
|
||||||
'</span></span>' + this.$i18n.t('template.index.891112-106') + '<span style="color:#F56C6C">' +
|
'</span></span>' +
|
||||||
|
this.$i18n.t('template.index.891112-106') +
|
||||||
|
'<span style="color:#F56C6C">' +
|
||||||
specs.min +
|
specs.min +
|
||||||
'</span><br /><span style=\'width:50%;display:inline-block;\>' + this.$i18n.t('template.index.891112-107') + '<span style="color:#F56C6C">' +
|
"</span><br /><span style='width:50%;display:inline-block;\>" +
|
||||||
|
this.$i18n.t('template.index.891112-107') +
|
||||||
|
'<span style="color:#F56C6C">' +
|
||||||
specs.step +
|
specs.step +
|
||||||
'</span></span>' + this.$i18n.t('template.index.891112-108') + '<span style="color:#F56C6C">' +
|
'</span></span>' +
|
||||||
|
this.$i18n.t('template.index.891112-108') +
|
||||||
|
'<span style="color:#F56C6C">' +
|
||||||
specs.unit
|
specs.unit
|
||||||
);
|
);
|
||||||
} else if (specs.type === 'string') {
|
} else if (specs.type === 'string') {
|
||||||
return this.$i18n.t('template.index.891112-109') + '<span style="color:#F56C6C">' + specs.maxLength + '</span>';
|
return this.$i18n.t('template.index.891112-109') + '<span style="color:#F56C6C">' + specs.maxLength + '</span>';
|
||||||
} else if (specs.type === 'array') {
|
} else if (specs.type === 'array') {
|
||||||
return '<span style=\'width:50%;display:inline-block;\>' + this.$i18n.t('template.index.891112-110') + '<span style="color:#F56C6C">' + specs.arrayType + '</span></span>' + this.$i18n.t('template.index.891112-111') + '<span style="color:#F56C6C">' + specs.arrayCount;
|
return (
|
||||||
|
"<span style='width:50%;display:inline-block;\>" +
|
||||||
|
this.$i18n.t('template.index.891112-110') +
|
||||||
|
'<span style="color:#F56C6C">' +
|
||||||
|
specs.arrayType +
|
||||||
|
'</span></span>' +
|
||||||
|
this.$i18n.t('template.index.891112-111') +
|
||||||
|
'<span style="color:#F56C6C">' +
|
||||||
|
specs.arrayCount
|
||||||
|
);
|
||||||
} else if (specs.type === 'enum') {
|
} else if (specs.type === 'enum') {
|
||||||
let items = '';
|
let items = '';
|
||||||
for (let i = 0; i < specs.enumList.length; i++) {
|
for (let i = 0; i < specs.enumList.length; i++) {
|
||||||
@@ -847,20 +869,20 @@ export default {
|
|||||||
},
|
},
|
||||||
// 在输入最小值改变时触发
|
// 在输入最小值改变时触发
|
||||||
handleEdit(e) {
|
handleEdit(e) {
|
||||||
let value = e.replace(/[^\-\d]/g, ""); // 只能输入-和数字
|
let value = e.replace(/[^\-\d]/g, ''); // 只能输入-和数字
|
||||||
value = value.replace(/\-{2,}/g, "-"); // -只能保留一个
|
value = value.replace(/\-{2,}/g, '-'); // -只能保留一个
|
||||||
value = value.replace(/(\d)\-/g, "$1"); // 数字后面不能接-,不能出现类似-11-2,12-,11-23
|
value = value.replace(/(\d)\-/g, '$1'); // 数字后面不能接-,不能出现类似-11-2,12-,11-23
|
||||||
value = value.replace(/(-)0+/g, "$1"); // 不能出现-0,-001,-0001类似
|
value = value.replace(/(-)0+/g, '$1'); // 不能出现-0,-001,-0001类似
|
||||||
value = value.replace(/(-\d{10})\d*/, '$1') // 最多保留10位整数
|
value = value.replace(/(-\d{10})\d*/, '$1'); // 最多保留10位整数
|
||||||
this.form.specs.min = value;
|
this.form.specs.min = value;
|
||||||
},
|
},
|
||||||
// 在输入最大值改变时触发
|
// 在输入最大值改变时触发
|
||||||
handleEditmax(e) {
|
handleEditmax(e) {
|
||||||
let value = e.replace(/[^\-\d]/g, ""); // 只能输入-和数字
|
let value = e.replace(/[^\-\d]/g, ''); // 只能输入-和数字
|
||||||
value = value.replace(/\-{2,}/g, "-"); // -只能保留一个
|
value = value.replace(/\-{2,}/g, '-'); // -只能保留一个
|
||||||
value = value.replace(/(\d)\-/g, "$1"); // 数字后面不能接-,不能出现类似-11-2,12-,11-23
|
value = value.replace(/(\d)\-/g, '$1'); // 数字后面不能接-,不能出现类似-11-2,12-,11-23
|
||||||
value = value.replace(/(-)0+/g, "$1"); // 不能出现-0,-001,-0001类似
|
value = value.replace(/(-)0+/g, '$1'); // 不能出现-0,-001,-0001类似
|
||||||
value = value.replace(/(-\d{10})\d*/, '$1') // 最多保留10位整数
|
value = value.replace(/(-\d{10})\d*/, '$1'); // 最多保留10位整数
|
||||||
this.form.specs.max = value;
|
this.form.specs.max = value;
|
||||||
},
|
},
|
||||||
//数据类型为小数的校验
|
//数据类型为小数的校验
|
||||||
|
|||||||
@@ -1,17 +1,21 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="login">
|
<div class="login-wrap">
|
||||||
<el-row>
|
<div class="logo-wrap">
|
||||||
<el-col :xs="24">
|
<img class="icon" src="@/assets/images/logo_blue.png" />
|
||||||
<div style="color: #fff; background-color: #0f73ee; width: 100%; height: 200px; text-align: center; padding: 15px; font-family: '微软雅黑'">
|
<span class="text">{{ $t('login.989807-37') }}</span>
|
||||||
<div style="font-size: 42px; padding-top: 40px; width: 300px; margin: 0 auto">
|
|
||||||
<img :src="logo" alt="logo" style="width: 100px; height: 100px; float: left" />
|
|
||||||
<div style="float: left; margin-top: 13px; width: 200px; text-align: left">
|
|
||||||
<div>FastBee</div>
|
|
||||||
<div style="letter-spacing: 1.5px; font-size: 20px; font-weight: 600; margin-top: -8px; margin-left: 3px">{{ $t('login.989807-0') }}</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<pre class="introduce-text">{{ $t('login.989807-38') }}</pre>
|
||||||
|
<div class="img-wrap">
|
||||||
|
<img style="width: 100%; height: 100%" src="@/assets/images/cover.png" />
|
||||||
</div>
|
</div>
|
||||||
|
<div class="box-wrap">
|
||||||
|
<div class="form-box">
|
||||||
|
<div class="title-wrap">
|
||||||
|
<div v-if="!bindId" class="name">{{ $t('login.989807-1') }}</div>
|
||||||
|
<div v-else class="name">{{ $t('login.989807-36') }}</div>
|
||||||
|
<langSelect class="lang"></langSelect>
|
||||||
</div>
|
</div>
|
||||||
|
<pre class="demo-account">{{ $t('login.989807-33') }}</pre>
|
||||||
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
|
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<div class="alert-box-wrap" v-if="loginForm.bindId != null">
|
<div class="alert-box-wrap" v-if="loginForm.bindId != null">
|
||||||
@@ -54,15 +58,9 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<div style="display: flex; justify-content: space-between">
|
<div style="display: flex; justify-content: space-between">
|
||||||
<el-checkbox v-model="loginForm.rememberMe" style="margin: 0px 0px 25px 0px; color: #000">{{ $t('login.989807-7') }}</el-checkbox>
|
<el-checkbox v-model="loginForm.rememberMe" style="margin: 0px 0px 25px 0px; color: #000">{{ $t('login.989807-7') }}</el-checkbox>
|
||||||
<langSelect class="lang"></langSelect>
|
|
||||||
</div>
|
</div>
|
||||||
<el-form-item style="width: 100%">
|
<el-form-item style="width: 100%">
|
||||||
<div style="margin-bottom: 10px">
|
<div style="margin-bottom: 10px">
|
||||||
<!-- <el-button v-if="!bindAccount" :loading="loading" type="primary" style="width: 100%"
|
|
||||||
@click.native.prevent="handleLogin">
|
|
||||||
<span v-if="!loading">登 录</span>
|
|
||||||
<span v-else>登 录 中...</span>
|
|
||||||
</el-button> -->
|
|
||||||
<div v-if="!bindId">
|
<div v-if="!bindId">
|
||||||
<el-button class="btn" :loading="loading" type="primary" @click.native.prevent="handleLogin">
|
<el-button class="btn" :loading="loading" type="primary" @click.native.prevent="handleLogin">
|
||||||
<span v-if="!loading">{{ $t('login.989807-3') }}</span>
|
<span v-if="!loading">{{ $t('login.989807-3') }}</span>
|
||||||
@@ -78,13 +76,13 @@
|
|||||||
<span>{{ $t('login.989807-44') }}</span>
|
<span>{{ $t('login.989807-44') }}</span>
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-row>
|
<div class="other-link">
|
||||||
<div>
|
<el-link href="https://fastbee.cn/" :underline="false" target="_blank">{{ $t('login.989807-41') }}</el-link>
|
||||||
<el-link href="https://fastbee.cn/" :underline="false" target="_blank" style="float: left">{{ $t('login.989807-41') }}</el-link>
|
<el-divider direction="vertical"></el-divider>
|
||||||
<el-link href="https://fastbee.cn/doc" :underline="false" target="_blank" style="float: left; margin-left: 20px">{{ $t('login.989807-40') }}</el-link>
|
<el-link href="https://fastbee.cn/doc" :underline="false" target="_blank">{{ $t('login.989807-40') }}</el-link>
|
||||||
<router-link v-if="!bindAccount" :to="{ path: '/register', query: this.$route.query }" style="float: left; margin-left: 20px">{{ $t('login.989807-18') }}</router-link>
|
<el-divider direction="vertical"></el-divider>
|
||||||
|
<router-link v-if="!bindAccount" :to="{ path: '/register', query: this.$route.query }">{{ $t('login.989807-18') }}</router-link>
|
||||||
</div>
|
</div>
|
||||||
</el-row>
|
|
||||||
<div class="other-login">
|
<div class="other-login">
|
||||||
<span class="text">{{ $t('login.989807-42') }}</span>
|
<span class="text">{{ $t('login.989807-42') }}</span>
|
||||||
<svg-icon class="icon" icon-class="wechat" style="color: #07c160" @click="handleGotoWeChatLogin" />
|
<svg-icon class="icon" icon-class="wechat" style="color: #07c160" @click="handleGotoWeChatLogin" />
|
||||||
@@ -92,17 +90,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-col>
|
</div>
|
||||||
</el-row>
|
|
||||||
<!-- 底部 -->
|
<!-- 底部 -->
|
||||||
<div class="el-login-footer">
|
<div class="el-login-footer">
|
||||||
<span>
|
<span>
|
||||||
Copyright © 2021-2025
|
Copyright © 2021-2026
|
||||||
<a target="_blank" href="http://fastbee.cn">FastBee</a>
|
<a target="_blank" href="http://fastbee.cn">FastBee</a>
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
@@ -469,22 +468,157 @@ export default {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss" scoped>
|
||||||
.login {
|
.login-wrap {
|
||||||
height: 100%;
|
user-select: none;
|
||||||
overflow: auto;
|
height: 100vh;
|
||||||
|
max-width: 100%;
|
||||||
|
width: 100vw;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
.logo-wrap {
|
||||||
|
position: absolute;
|
||||||
|
top: 80px;
|
||||||
|
left: 80px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
width: 42px;
|
||||||
|
height: 46px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.bindAccountTitle {
|
.text {
|
||||||
margin: 0px auto 30px auto;
|
font-size: 36px;
|
||||||
text-align: center;
|
font-weight: 500;
|
||||||
color: #333;
|
margin-left: 12px;
|
||||||
|
color: #486ff2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.introduce-text {
|
||||||
|
position: absolute;
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #909399;
|
||||||
|
line-height: 20px;
|
||||||
|
text-align: left;
|
||||||
|
font-style: normal;
|
||||||
|
top: 146px;
|
||||||
|
left: 80px;
|
||||||
|
width: 500px;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
word-wrap: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
|
.img-wrap {
|
||||||
|
flex: 1;
|
||||||
|
background: #0f73ee;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box-wrap {
|
||||||
|
position: relative;
|
||||||
|
width: 608px;
|
||||||
|
align-items: center;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
overflow: hidden;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
.form-box {
|
||||||
|
margin-top: -8%; // 上移35下面留宽一点
|
||||||
|
width: 300px;
|
||||||
|
|
||||||
|
.title-wrap {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.name {
|
||||||
|
font-weight: 600;
|
||||||
font-size: 24px;
|
font-size: 24px;
|
||||||
|
color: #303133;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lang {
|
||||||
|
cursor: pointer;
|
||||||
|
|
||||||
|
::v-deep .el-dropdown {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #909399;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.demo-account {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #909399;
|
||||||
|
margin: 40px 0 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.form-wrap {
|
||||||
|
::v-deep .el-form-item {
|
||||||
|
margin-bottom: 21px;
|
||||||
|
|
||||||
|
.el-form-item__content {
|
||||||
|
line-height: 14px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
color: #909399;
|
||||||
|
font-size: 14px;
|
||||||
|
text-align: left;
|
||||||
|
white-space: nowrap;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
margin-top: 26px;
|
||||||
|
width: 100%;
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.other-link {
|
||||||
|
margin-top: 17px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
.login-image {
|
||||||
|
// width: 100%;
|
||||||
|
// height: 100%;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cover-image {
|
||||||
|
width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
object-fit: cover;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-right {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-header {
|
||||||
|
flex-shrink: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.login-form {
|
.login-form {
|
||||||
margin: 30px auto 0 auto;
|
flex: 1;
|
||||||
padding: 15px;
|
padding: 0px;
|
||||||
z-index: 1000;
|
z-index: 1000;
|
||||||
max-width: 350px;
|
max-width: 350px;
|
||||||
|
|
||||||
@@ -514,16 +648,12 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.el-login-footer {
|
.el-login-footer {
|
||||||
height: 40px;
|
position: absolute;
|
||||||
line-height: 40px;
|
bottom: 24px;
|
||||||
position: fixed;
|
font-weight: 400;
|
||||||
bottom: 0;
|
|
||||||
width: 100%;
|
|
||||||
text-align: center;
|
|
||||||
color: #333;
|
|
||||||
font-family: Arial;
|
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
letter-spacing: 1px;
|
color: #909399;
|
||||||
|
line-height: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.alert-box-wrap {
|
.alert-box-wrap {
|
||||||
@@ -542,6 +672,7 @@ export default {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.other-login {
|
.other-login {
|
||||||
margin-top: 40px;
|
margin-top: 40px;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -555,4 +686,66 @@ export default {
|
|||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 响应式设计:当屏幕小于768px时,只显示右侧登录表单
|
||||||
|
@media (max-width: 767.98px) {
|
||||||
|
.login-right {
|
||||||
|
width: 100% !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@media screen and (min-width: 1920px) {
|
||||||
|
.login-wrap .box-wrap {
|
||||||
|
width: 811px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 1180px) {
|
||||||
|
.login-wrap .box-wrap {
|
||||||
|
width: 498px;
|
||||||
|
|
||||||
|
.form-box {
|
||||||
|
width: 246px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-wrap .logo-wrap {
|
||||||
|
top: 66px;
|
||||||
|
left: 66px;
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
width: 34px;
|
||||||
|
height: 38px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
font-size: 29px;
|
||||||
|
margin-left: 10px;
|
||||||
|
color: #486ff2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-wrap .introduce-text {
|
||||||
|
font-size: 11px;
|
||||||
|
top: 120px;
|
||||||
|
left: 66px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media screen and (max-width: 968px) {
|
||||||
|
.login-wrap .img-wrap {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-wrap .logo-wrap {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-wrap .introduce-text {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.login-wrap .box-wrap {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
138
vue/src/views/monitor/cache/list.vue
vendored
138
vue/src/views/monitor/cache/list.vue
vendored
@@ -5,54 +5,17 @@
|
|||||||
<el-card style="height: calc(100vh - 125px)">
|
<el-card style="height: calc(100vh - 125px)">
|
||||||
<div slot="header">
|
<div slot="header">
|
||||||
<span>{{ $t('monitor.cache.list.501235-0') }}</span>
|
<span>{{ $t('monitor.cache.list.501235-0') }}</span>
|
||||||
<el-button
|
<el-button style="float: right; padding: 3px 0" type="text" icon="el-icon-refresh-right" @click="refreshCacheNames()"></el-button>
|
||||||
style="float: right; padding: 3px 0"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-refresh-right"
|
|
||||||
@click="refreshCacheNames()"
|
|
||||||
></el-button>
|
|
||||||
</div>
|
</div>
|
||||||
<el-table
|
<el-table v-loading="loading" :data="cacheNames" :height="tableHeight" highlight-current-row @row-click="getCacheKeys" style="width: 100%">
|
||||||
v-loading="loading"
|
<el-table-column :label="$t('monitor.cache.list.501235-1')" width="60" type="index"></el-table-column>
|
||||||
:data="cacheNames"
|
|
||||||
:height="tableHeight"
|
|
||||||
highlight-current-row
|
|
||||||
@row-click="getCacheKeys"
|
|
||||||
style="width: 100%"
|
|
||||||
>
|
|
||||||
<el-table-column
|
|
||||||
:label="$t('monitor.cache.list.501235-1')"
|
|
||||||
width="60"
|
|
||||||
type="index"
|
|
||||||
></el-table-column>
|
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column :label="$t('monitor.cache.list.501235-2')" align="center" prop="cacheName" :show-overflow-tooltip="true" :formatter="nameFormatter"></el-table-column>
|
||||||
:label="$t('monitor.cache.list.501235-2')"
|
|
||||||
align="center"
|
|
||||||
prop="cacheName"
|
|
||||||
:show-overflow-tooltip="true"
|
|
||||||
:formatter="nameFormatter"
|
|
||||||
></el-table-column>
|
|
||||||
|
|
||||||
<el-table-column
|
<el-table-column :label="$t('remark')" align="center" prop="remark" :show-overflow-tooltip="true" />
|
||||||
:label="$t('common.remark')"
|
<el-table-column :label="$t('opation')" width="60" align="center" class-name="small-padding fixed-width">
|
||||||
align="center"
|
|
||||||
prop="remark"
|
|
||||||
:show-overflow-tooltip="true"
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
:label="$t('common.opation')"
|
|
||||||
width="60"
|
|
||||||
align="center"
|
|
||||||
class-name="small-padding fixed-width"
|
|
||||||
>
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleClearCacheName(scope.row)"></el-button>
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleClearCacheName(scope.row)"
|
|
||||||
></el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -63,46 +26,14 @@
|
|||||||
<el-card style="height: calc(100vh - 125px)">
|
<el-card style="height: calc(100vh - 125px)">
|
||||||
<div slot="header">
|
<div slot="header">
|
||||||
<span>{{ $t('monitor.cache.list.501235-5') }}</span>
|
<span>{{ $t('monitor.cache.list.501235-5') }}</span>
|
||||||
<el-button
|
<el-button style="float: right; padding: 3px 0" type="text" icon="el-icon-refresh-right" @click="refreshCacheKeys()"></el-button>
|
||||||
style="float: right; padding: 3px 0"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-refresh-right"
|
|
||||||
@click="refreshCacheKeys()"
|
|
||||||
></el-button>
|
|
||||||
</div>
|
</div>
|
||||||
<el-table
|
<el-table v-loading="subLoading" :data="cacheKeys" :height="tableHeight" highlight-current-row @row-click="handleCacheValue" style="width: 100%">
|
||||||
v-loading="subLoading"
|
<el-table-column :label="$t('monitor.cache.list.501235-1')" width="60" type="index"></el-table-column>
|
||||||
:data="cacheKeys"
|
<el-table-column :label="$t('monitor.cache.list.501235-6')" align="center" :show-overflow-tooltip="true" :formatter="keyFormatter"></el-table-column>
|
||||||
:height="tableHeight"
|
<el-table-column :label="$t('opation')" width="60" align="center" class-name="small-padding fixed-width">
|
||||||
highlight-current-row
|
|
||||||
@row-click="handleCacheValue"
|
|
||||||
style="width: 100%"
|
|
||||||
>
|
|
||||||
<el-table-column
|
|
||||||
:label="$t('monitor.cache.list.501235-1')"
|
|
||||||
width="60"
|
|
||||||
type="index"
|
|
||||||
></el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
:label="$t('monitor.cache.list.501235-6')"
|
|
||||||
align="center"
|
|
||||||
:show-overflow-tooltip="true"
|
|
||||||
:formatter="keyFormatter"
|
|
||||||
>
|
|
||||||
</el-table-column>
|
|
||||||
<el-table-column
|
|
||||||
:label="$t('common.opation')"
|
|
||||||
width="60"
|
|
||||||
align="center"
|
|
||||||
class-name="small-padding fixed-width"
|
|
||||||
>
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleClearCacheKey(scope.row)"></el-button>
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleClearCacheKey(scope.row)"
|
|
||||||
></el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -113,13 +44,7 @@
|
|||||||
<el-card :bordered="false" style="height: calc(100vh - 125px)">
|
<el-card :bordered="false" style="height: calc(100vh - 125px)">
|
||||||
<div slot="header">
|
<div slot="header">
|
||||||
<span>{{ $t('monitor.cache.list.501235-7') }}</span>
|
<span>{{ $t('monitor.cache.list.501235-7') }}</span>
|
||||||
<el-button
|
<el-button style="float: right; padding: 3px 0" type="text" icon="el-icon-refresh-right" @click="handleClearCacheAll()">{{ $t('monitor.cache.list.501235-11') }}</el-button>
|
||||||
style="float: right; padding: 3px 0"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-refresh-right"
|
|
||||||
@click="handleClearCacheAll()"
|
|
||||||
>{{ $t('monitor.cache.list.501235-11') }}</el-button
|
|
||||||
>
|
|
||||||
</div>
|
</div>
|
||||||
<el-form :model="cacheForm">
|
<el-form :model="cacheForm">
|
||||||
<el-row :gutter="32">
|
<el-row :gutter="32">
|
||||||
@@ -135,12 +60,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :offset="1" :span="22">
|
<el-col :offset="1" :span="22">
|
||||||
<el-form-item :label="$t('monitor.cache.list.501235-10')" prop="cacheValue">
|
<el-form-item :label="$t('monitor.cache.list.501235-10')" prop="cacheValue">
|
||||||
<el-input
|
<el-input v-model="cacheForm.cacheValue" type="textarea" :rows="8" :readOnly="true" />
|
||||||
v-model="cacheForm.cacheValue"
|
|
||||||
type="textarea"
|
|
||||||
:rows="8"
|
|
||||||
:readOnly="true"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -152,10 +72,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listCacheName, listCacheKey, getCacheValue, clearCacheName, clearCacheKey, clearCacheAll } from "@/api/monitor/cache";
|
import { listCacheName, listCacheKey, getCacheValue, clearCacheName, clearCacheKey, clearCacheAll } from '@/api/monitor/cache';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "CacheList",
|
name: 'CacheList',
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
cacheNames: [],
|
cacheNames: [],
|
||||||
@@ -163,8 +83,8 @@ export default {
|
|||||||
cacheForm: {},
|
cacheForm: {},
|
||||||
loading: true,
|
loading: true,
|
||||||
subLoading: false,
|
subLoading: false,
|
||||||
nowCacheName: "",
|
nowCacheName: '',
|
||||||
tableHeight: window.innerHeight - 200
|
tableHeight: window.innerHeight - 200,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -174,7 +94,7 @@ export default {
|
|||||||
/** 查询缓存名称列表 */
|
/** 查询缓存名称列表 */
|
||||||
getCacheNames() {
|
getCacheNames() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listCacheName().then(response => {
|
listCacheName().then((response) => {
|
||||||
this.cacheNames = response.data;
|
this.cacheNames = response.data;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
});
|
});
|
||||||
@@ -186,7 +106,7 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 清理指定名称缓存 */
|
/** 清理指定名称缓存 */
|
||||||
handleClearCacheName(row) {
|
handleClearCacheName(row) {
|
||||||
clearCacheName(row.cacheName).then(response => {
|
clearCacheName(row.cacheName).then((response) => {
|
||||||
this.$modal.msgSuccess(this.$i18n.t('monitor.cache.list.501235-13', [this.nowCacheName]));
|
this.$modal.msgSuccess(this.$i18n.t('monitor.cache.list.501235-13', [this.nowCacheName]));
|
||||||
this.getCacheKeys();
|
this.getCacheKeys();
|
||||||
});
|
});
|
||||||
@@ -194,11 +114,11 @@ export default {
|
|||||||
/** 查询缓存键名列表 */
|
/** 查询缓存键名列表 */
|
||||||
getCacheKeys(row) {
|
getCacheKeys(row) {
|
||||||
const cacheName = row !== undefined ? row.cacheName : this.nowCacheName;
|
const cacheName = row !== undefined ? row.cacheName : this.nowCacheName;
|
||||||
if (cacheName === "") {
|
if (cacheName === '') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.subLoading = true;
|
this.subLoading = true;
|
||||||
listCacheKey(cacheName).then(response => {
|
listCacheKey(cacheName).then((response) => {
|
||||||
this.cacheKeys = response.data;
|
this.cacheKeys = response.data;
|
||||||
this.subLoading = false;
|
this.subLoading = false;
|
||||||
this.nowCacheName = cacheName;
|
this.nowCacheName = cacheName;
|
||||||
@@ -211,31 +131,31 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 清理指定键名缓存 */
|
/** 清理指定键名缓存 */
|
||||||
handleClearCacheKey(cacheKey) {
|
handleClearCacheKey(cacheKey) {
|
||||||
clearCacheKey(cacheKey).then(response => {
|
clearCacheKey(cacheKey).then((response) => {
|
||||||
this.$modal.msgSuccess(this.$i18n.t('monitor.cache.list.501235-15', [cacheKey]));
|
this.$modal.msgSuccess(this.$i18n.t('monitor.cache.list.501235-15', [cacheKey]));
|
||||||
this.getCacheKeys();
|
this.getCacheKeys();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 列表前缀去除 */
|
/** 列表前缀去除 */
|
||||||
nameFormatter(row) {
|
nameFormatter(row) {
|
||||||
return row.cacheName.replace(":", "");
|
return row.cacheName.replace(':', '');
|
||||||
},
|
},
|
||||||
/** 键名前缀去除 */
|
/** 键名前缀去除 */
|
||||||
keyFormatter(cacheKey) {
|
keyFormatter(cacheKey) {
|
||||||
return cacheKey.replace(this.nowCacheName, "");
|
return cacheKey.replace(this.nowCacheName, '');
|
||||||
},
|
},
|
||||||
/** 查询缓存内容详细 */
|
/** 查询缓存内容详细 */
|
||||||
handleCacheValue(cacheKey) {
|
handleCacheValue(cacheKey) {
|
||||||
getCacheValue(this.nowCacheName, cacheKey).then(response => {
|
getCacheValue(this.nowCacheName, cacheKey).then((response) => {
|
||||||
this.cacheForm = response.data;
|
this.cacheForm = response.data;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 清理全部缓存 */
|
/** 清理全部缓存 */
|
||||||
handleClearCacheAll() {
|
handleClearCacheAll() {
|
||||||
clearCacheAll().then(response => {
|
clearCacheAll().then((response) => {
|
||||||
this.$modal.msgSuccess(this.$i18n.t('monitor.cache.list.501235-16'));
|
this.$modal.msgSuccess(this.$i18n.t('monitor.cache.list.501235-16'));
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -2,61 +2,22 @@
|
|||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item :label="$t('operlog.874509-10')" prop="operIp">
|
<el-form-item :label="$t('operlog.874509-10')" prop="operIp">
|
||||||
<el-input
|
<el-input v-model="queryParams.operIp" :placeholder="$t('operlog.874509-10')" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
|
||||||
v-model="queryParams.operIp"
|
|
||||||
:placeholder="$t('operlog.874509-10')"
|
|
||||||
clearable
|
|
||||||
style="width: 240px;"
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('operlog.874509-0')" prop="title">
|
<el-form-item :label="$t('operlog.874509-0')" prop="title">
|
||||||
<el-input
|
<el-input v-model="queryParams.title" :placeholder="$t('operlog.874509-1')" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
|
||||||
v-model="queryParams.title"
|
|
||||||
:placeholder="$t('operlog.874509-1')"
|
|
||||||
clearable
|
|
||||||
style="width: 240px;"
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('operlog.874509-2')" prop="operName">
|
<el-form-item :label="$t('operlog.874509-2')" prop="operName">
|
||||||
<el-input
|
<el-input v-model="queryParams.operName" :placeholder="$t('operlog.874509-3')" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
|
||||||
v-model="queryParams.operName"
|
|
||||||
:placeholder="$t('operlog.874509-3')"
|
|
||||||
clearable
|
|
||||||
style="width: 240px;"
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('system.notice.670989-4')" prop="businessType">
|
<el-form-item :label="$t('system.notice.670989-4')" prop="businessType">
|
||||||
<el-select
|
<el-select v-model="queryParams.businessType" :placeholder="$t('operlog.874509-4')" clearable style="width: 240px">
|
||||||
v-model="queryParams.businessType"
|
<el-option v-for="dict in dict.type.sys_oper_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||||
:placeholder="$t('operlog.874509-4')"
|
|
||||||
clearable
|
|
||||||
style="width: 240px"
|
|
||||||
>
|
|
||||||
|
|
||||||
<el-option
|
|
||||||
v-for="dict in dict.type.sys_oper_type"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('status')" prop="status">
|
<el-form-item :label="$t('status')" prop="status">
|
||||||
<el-select
|
<el-select v-model="queryParams.status" :placeholder="$t('operlog.874509-5')" clearable style="width: 240px">
|
||||||
v-model="queryParams.status"
|
<el-option v-for="dict in dict.type.sys_common_status" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||||
:placeholder="$t('operlog.874509-5')"
|
|
||||||
clearable
|
|
||||||
style="width: 240px"
|
|
||||||
>
|
|
||||||
<el-option
|
|
||||||
v-for="dict in dict.type.sys_common_status"
|
|
||||||
:key="dict.value"
|
|
||||||
:label="dict.label"
|
|
||||||
:value="dict.value"
|
|
||||||
/>
|
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('operlog.874509-6')">
|
<el-form-item :label="$t('operlog.874509-6')">
|
||||||
@@ -79,35 +40,13 @@
|
|||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['monitor:operlog:remove']">{{ $t('del') }}</el-button>
|
||||||
type="danger"
|
|
||||||
plain
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete"
|
|
||||||
v-hasPermi="['monitor:operlog:remove']"
|
|
||||||
>{{ $t('del') }}</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="danger" plain icon="el-icon-delete" size="mini" @click="handleClean" v-hasPermi="['monitor:operlog:remove']">{{ $t('operlog.874509-7') }}</el-button>
|
||||||
type="danger"
|
|
||||||
plain
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
@click="handleClean"
|
|
||||||
v-hasPermi="['monitor:operlog:remove']"
|
|
||||||
>{{ $t('operlog.874509-7') }}</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['monitor:operlog:export']">{{ $t('export') }}</el-button>
|
||||||
type="warning"
|
|
||||||
plain
|
|
||||||
icon="el-icon-download"
|
|
||||||
size="mini"
|
|
||||||
@click="handleExport"
|
|
||||||
v-hasPermi="['monitor:operlog:export']"
|
|
||||||
>{{ $t('export') }}</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -134,31 +73,19 @@
|
|||||||
<span>{{ parseTime(scope.row.operTime) }}</span>
|
<span>{{ parseTime(scope.row.operTime) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :label="$t('operlog.874509-31') align="center" prop="costTime" width="110" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']">
|
<el-table-column :label="$t('operlog.874509-31')" align="center" prop="costTime" width="110" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ scope.row.costTime }}ms</span>
|
<span>{{ scope.row.costTime }}ms</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :label="$t('opation')" align="center" class-name="small-padding fixed-width">
|
<el-table-column :label="$t('opation')" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button size="mini" type="text" icon="el-icon-view" @click="handleView(scope.row, scope.index)" v-hasPermi="['monitor:operlog:query']">{{ $t('operlog.874509-13') }}</el-button>
|
||||||
size="mini"
|
|
||||||
type="text"
|
|
||||||
icon="el-icon-view"
|
|
||||||
@click="handleView(scope.row,scope.index)"
|
|
||||||
v-hasPermi="['monitor:operlog:query']"
|
|
||||||
>{{ $t('operlog.874509-13') }}</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||||
v-show="total>0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNum"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
|
|
||||||
<!-- 操作日志详细 -->
|
<!-- 操作日志详细 -->
|
||||||
<el-dialog :title="$t('operlog.874509-14')" :visible.sync="open" width="800px" append-to-body>
|
<el-dialog :title="$t('operlog.874509-14')" :visible.sync="open" width="800px" append-to-body>
|
||||||
@@ -166,9 +93,7 @@
|
|||||||
<el-row>
|
<el-row>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item :label="$t('operlog.874509-15')">{{ form.title }} / {{ typeFormat(form) }}</el-form-item>
|
<el-form-item :label="$t('operlog.874509-15')">{{ form.title }} / {{ typeFormat(form) }}</el-form-item>
|
||||||
<el-form-item
|
<el-form-item :label="$t('operlog.874509-16')">{{ form.operName }} / {{ form.operIp }} / {{ form.operLocation }}</el-form-item>
|
||||||
:label="$t('operlog.874509-16')"
|
|
||||||
>{{ form.operName }} / {{ form.operIp }} / {{ form.operLocation }}</el-form-item>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item :label="$t('operlog.874509-17')">{{ form.operUrl }}</el-form-item>
|
<el-form-item :label="$t('operlog.874509-17')">{{ form.operUrl }}</el-form-item>
|
||||||
@@ -208,10 +133,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { list, delOperlog, cleanOperlog } from "@/api/monitor/operlog";
|
import { list, delOperlog, cleanOperlog } from '@/api/monitor/operlog';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Operlog",
|
name: 'Operlog',
|
||||||
dicts: ['sys_oper_type', 'sys_common_status'],
|
dicts: ['sys_oper_type', 'sys_common_status'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
@@ -243,8 +168,8 @@ export default {
|
|||||||
title: undefined,
|
title: undefined,
|
||||||
operName: undefined,
|
operName: undefined,
|
||||||
businessType: undefined,
|
businessType: undefined,
|
||||||
status: undefined
|
status: undefined,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -254,12 +179,11 @@ export default {
|
|||||||
/** 查询登录日志 */
|
/** 查询登录日志 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
list(this.addDateRange(this.queryParams, this.dateRange)).then( response => {
|
list(this.addDateRange(this.queryParams, this.dateRange)).then((response) => {
|
||||||
this.list = response.rows;
|
this.list = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
}
|
});
|
||||||
);
|
|
||||||
},
|
},
|
||||||
// 操作日志类型字典翻译
|
// 操作日志类型字典翻译
|
||||||
typeFormat(row, column) {
|
typeFormat(row, column) {
|
||||||
@@ -273,14 +197,14 @@ export default {
|
|||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
resetQuery() {
|
resetQuery() {
|
||||||
this.dateRange = [];
|
this.dateRange = [];
|
||||||
this.resetForm("queryForm");
|
this.resetForm('queryForm');
|
||||||
this.queryParams.pageNum = 1;
|
this.queryParams.pageNum = 1;
|
||||||
this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order)
|
this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order);
|
||||||
},
|
},
|
||||||
/** 多选框选中数据 */
|
/** 多选框选中数据 */
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map(item => item.operId)
|
this.ids = selection.map((item) => item.operId);
|
||||||
this.multiple = !selection.length
|
this.multiple = !selection.length;
|
||||||
},
|
},
|
||||||
/** 排序触发事件 */
|
/** 排序触发事件 */
|
||||||
handleSortChange(column, prop, order) {
|
handleSortChange(column, prop, order) {
|
||||||
@@ -296,29 +220,40 @@ export default {
|
|||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const operIds = row.operId || this.ids;
|
const operIds = row.operId || this.ids;
|
||||||
this.$modal.confirm(this.$t('operlog.874509-27', [operIds])).then(function() {
|
this.$modal
|
||||||
|
.confirm(this.$t('operlog.874509-27', [operIds]))
|
||||||
|
.then(function () {
|
||||||
return delOperlog(operIds);
|
return delOperlog(operIds);
|
||||||
}).then(() => {
|
})
|
||||||
|
.then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.$modal.msgSuccess(this.$t('delSuccess'));
|
this.$modal.msgSuccess(this.$t('delSuccess'));
|
||||||
}).catch(() => {});
|
})
|
||||||
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
/** 清空按钮操作 */
|
/** 清空按钮操作 */
|
||||||
handleClean() {
|
handleClean() {
|
||||||
this.$modal.confirm(this.$t('operlog.874509-28')).then(function() {
|
this.$modal
|
||||||
|
.confirm(this.$t('operlog.874509-28'))
|
||||||
|
.then(function () {
|
||||||
return cleanOperlog();
|
return cleanOperlog();
|
||||||
}).then(() => {
|
})
|
||||||
|
.then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.$modal.msgSuccess(this.$t('operlog.874509-29'));
|
this.$modal.msgSuccess(this.$t('operlog.874509-29'));
|
||||||
}).catch(() => {});
|
})
|
||||||
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
/** 导出按钮操作 */
|
/** 导出按钮操作 */
|
||||||
handleExport() {
|
handleExport() {
|
||||||
this.download('monitor/operlog/export', {
|
this.download(
|
||||||
...this.queryParams
|
'monitor/operlog/export',
|
||||||
}, `operlog_${new Date().getTime()}.xlsx`)
|
{
|
||||||
}
|
...this.queryParams,
|
||||||
}
|
},
|
||||||
|
`operlog_${new Date().getTime()}.xlsx`
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
@@ -1,87 +1,129 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="register">
|
<div class="register-wrap">
|
||||||
<el-row>
|
<div class="logo-wrap">
|
||||||
<el-col :xs="24">
|
<img class="icon" src="@/assets/images/logo_blue.png" />
|
||||||
<div
|
<span class="text">{{ $t('login.989807-37') }}</span>
|
||||||
style="color: #fff; background-color: #0f73ee; width: 100%; height: 200px; text-align: center; padding: 15px; font-family: '微软雅黑'">
|
|
||||||
<div style="font-size: 42px; padding-top: 40px; width: 300px; margin: 0 auto">
|
|
||||||
<img :src="logo" alt="logo" style="width: 100px; height: 100px; float: left" />
|
|
||||||
<div style="float: left; margin-top: 13px; width: 200px; text-align: left">
|
|
||||||
<div>FastBee</div>
|
|
||||||
<div style="letter-spacing: 1.5px; font-size: 20px; font-weight: 600; margin-top: -8px; margin-left: 3px">
|
|
||||||
{{ $t('login.989807-0') }}</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<pre class="introduce-text">{{ $t('login.989807-38') }}</pre>
|
||||||
|
<div class="img-wrap">
|
||||||
|
<img style="width: 100%; height: 100%" src="@/assets/images/cover.png" />
|
||||||
</div>
|
</div>
|
||||||
|
<div class="box-wrap">
|
||||||
|
<!-- 注册表单 -->
|
||||||
|
<div class="form-box" v-show="!isHaveBind && !errorText && formIndex === 1">
|
||||||
|
<div class="title-wrap">
|
||||||
|
<div class="name">{{ $t('register.974236-0') }}</div>
|
||||||
|
<langSelect class="lang"></langSelect>
|
||||||
</div>
|
</div>
|
||||||
<el-form ref="registerForm" :model="registerForm" :rules="registerRules" class="register-form"
|
<el-form class="form-wrap" id="registerForm" ref="registerForm" :model="registerForm" :rules="registerRules">
|
||||||
style="z-index: 1000;">
|
|
||||||
<el-form-item prop="username">
|
<el-form-item prop="username">
|
||||||
<el-input v-model="registerForm.username" type="text" auto-complete="off" :placeholder="$t('login.989807-20')">
|
<div class="item-wrap">
|
||||||
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
|
<div class="input-wrap">
|
||||||
</el-input>
|
<input class="inner" v-model="registerForm.username" auto-complete="off" type="text" :placeholder="$t('login.989807-20')" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="phonenumber">
|
<el-form-item prop="phonenumber">
|
||||||
<el-input v-model="registerForm.phonenumber" type="text" auto-complete="off" :placeholder="$t('register.974236-14')">
|
<div class="item-wrap">
|
||||||
<svg-icon slot="prefix" icon-class="phone" class="el-input__icon input-icon" />
|
<div class="input-wrap">
|
||||||
</el-input>
|
<input class="inner" v-model="registerForm.phonenumber" auto-complete="off" type="text" :placeholder="$t('register.974236-14')" />
|
||||||
</el-form-item>
|
</div>
|
||||||
<el-form-item prop="password">
|
|
||||||
<el-input v-model="registerForm.password" type="password" auto-complete="off" :placeholder="$t('login.989807-21')"
|
|
||||||
@keyup.enter.native="handleRegister">
|
|
||||||
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item prop="confirmPassword">
|
|
||||||
<el-input v-model="registerForm.confirmPassword" type="password" auto-complete="off" :placeholder="$t('login.989807-48')"
|
|
||||||
@keyup.enter.native="handleRegister">
|
|
||||||
<svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
|
|
||||||
</el-input>
|
|
||||||
</el-form-item>
|
|
||||||
<el-form-item v-if="captchaOnOff" prop="code">
|
|
||||||
<el-input v-model="registerForm.code" auto-complete="off" :placeholder="$t('login.989807-22')" style="width: 63%"
|
|
||||||
@keyup.enter.native="handleRegister">
|
|
||||||
<svg-icon slot="prefix" icon-class="validCode" class="el-input__icon input-icon" />
|
|
||||||
</el-input>
|
|
||||||
<div class="register-code">
|
|
||||||
<img :src="codeUrl" @click="getCode" />
|
|
||||||
</div>
|
</div>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item style="width: 100%">
|
<el-form-item prop="password">
|
||||||
<el-button v-if="!bindAccount" :loading="loading" type="primary" style="width: 100%"
|
<div class="item-wrap">
|
||||||
@click.native.prevent="handleRegister">
|
<div class="input-wrap">
|
||||||
|
<input class="inner" v-model="registerForm.password" auto-complete="off" :type="pwdtype" :placeholder="$t('login.989807-21')" />
|
||||||
|
<span class="el-icon-view icon" @click="handlePasswordTypeChange()"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item prop="confirmPassword">
|
||||||
|
<div class="item-wrap">
|
||||||
|
<div class="input-wrap">
|
||||||
|
<input class="inner" v-model="registerForm.confirmPassword" auto-complete="off" :type="pwdtype" :placeholder="$t('login.989807-48')" />
|
||||||
|
<span class="el-icon-view icon" @click="handlePasswordTypeChange()"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item v-if="captchaOnOff" prop="code">
|
||||||
|
<div class="item-wrap">
|
||||||
|
<div class="input-wrap">
|
||||||
|
<input class="inner" v-model="registerForm.code" auto-complete="off" type="text" :placeholder="$t('login.989807-22')" />
|
||||||
|
</div>
|
||||||
|
<img class="input-append" :src="codeUrl" @click="getCode" />
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<div class="item-wrap">
|
||||||
|
<el-checkbox v-model="registerForm.agree">
|
||||||
|
{{ $t('login.989807-53') }}
|
||||||
|
<span style="color: #486ff2; cursor: pointer" @click="handleGotoPrivacyPolicy">
|
||||||
|
{{ $t('login.989807-54') }}
|
||||||
|
</span>
|
||||||
|
</el-checkbox>
|
||||||
|
</div>
|
||||||
|
</el-form-item>
|
||||||
|
|
||||||
|
<el-button class="btn" :loading="loading" type="primary" @click.native.prevent="handleRegister">
|
||||||
<span v-if="!loading">{{ $t('register.974236-4') }}</span>
|
<span v-if="!loading">{{ $t('register.974236-4') }}</span>
|
||||||
<span v-else>{{ $t('register.974236-5') }}</span>
|
<span v-else>{{ $t('register.974236-5') }}</span>
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-form-item>
|
|
||||||
<el-form-item>
|
<div class="other-link">
|
||||||
<el-link href="https://fastbee.cn/" :underline="false" target="_blank" style="float: left">{{ $t('login.989807-41') }}</el-link>
|
<span class="text" @click="handleGotoLogin">{{ $t('register.974236-9') }}</span>
|
||||||
<el-link href="https://fastbee.cn/doc" :underline="false" target="_blank"
|
<el-divider direction="vertical" v-if="systemForm.document"></el-divider>
|
||||||
style="float: left; margin-left: 20px">{{ $t('login.989807-40') }}</el-link>
|
<span class="text" @click="handleGotoDoc" v-if="systemForm.document">{{ $t('login.989807-40') }}</span>
|
||||||
<router-link :to="{ path: '/login', query: this.$route.query }"
|
<el-divider direction="vertical" v-if="systemForm.website"></el-divider>
|
||||||
style="float: left; margin-left: 20px">{{ $t('register.974236-9') }}</router-link>
|
<span class="text" @click="handleGotoOS" v-if="systemForm.website">{{ $t('login.989807-41') }}</span>
|
||||||
</el-form-item>
|
</div>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-col>
|
</div>
|
||||||
</el-row>
|
|
||||||
<!-- 底部 -->
|
<!-- 绑定账号提示 -->
|
||||||
<div class="el-register-footer">
|
<div class="form-box" v-if="isHaveBind">
|
||||||
|
<div class="mess-text">
|
||||||
|
<i style="font-size: 16px" class="el-icon-warning" />
|
||||||
|
<span> {{ $t('login.989807-10') }}</span>
|
||||||
|
<span style="color: #486ff2; cursor: pointer" @click="handleRegister"> {{ $t('login.989807-12') }}</span>
|
||||||
|
</div>
|
||||||
|
<el-button style="margin-top: 40px" class="btn" @click="handleGotoLogin">
|
||||||
|
<span>{{ $t('login.989807-44') }}</span>
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 错误信息提示 -->
|
||||||
|
<div class="form-box" v-if="errorText">
|
||||||
|
<div class="mess-text">
|
||||||
|
<i style="font-size: 16px" class="el-icon-warning" />
|
||||||
|
<span>{{ errorText }}</span>
|
||||||
|
</div>
|
||||||
|
<el-button style="margin-top: 40px" class="btn" @click="handleGotoLogin">
|
||||||
|
<span>{{ $t('login.989807-44') }}</span>
|
||||||
|
</el-button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="copyright-wrap" v-if="systemForm.copyRight">
|
||||||
<span>
|
<span>
|
||||||
Copyright © 2021-2025
|
Copyright © 2021-2026
|
||||||
<a target="_blank" href="http://fastbee.cn">FastBee</a>
|
<a target="_blank" href="http://fastbee.cn">FastBee</a>
|
||||||
All Rights Reserved.
|
All Rights Reserved.
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import 'element-ui/lib/theme-chalk/display.css';
|
import 'element-ui/lib/theme-chalk/display.css';
|
||||||
import logo from '@/assets/logo/logo.gif';
|
import { getCodeImg, checkBindId, getErrorMsg, socialLogin } from '@/api/login';
|
||||||
import { getCodeImg, checkBindId, bindRegister } from '@/api/login';
|
|
||||||
import { register } from '@/api/iot/tool';
|
import { register } from '@/api/iot/tool';
|
||||||
|
import { setToken } from '@/utils/auth';
|
||||||
|
import langSelect from '@/layout/components/langSelect';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Register',
|
name: 'Register',
|
||||||
|
components: { langSelect },
|
||||||
data() {
|
data() {
|
||||||
const equalToPassword = (rule, value, callback) => {
|
const equalToPassword = (rule, value, callback) => {
|
||||||
if (this.registerForm.password !== value) {
|
if (this.registerForm.password !== value) {
|
||||||
@@ -91,7 +133,8 @@ export default {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
logo,
|
formIndex: 1, // 1 注册表单
|
||||||
|
pwdtype: 'password', // 控制密码可见
|
||||||
codeUrl: '',
|
codeUrl: '',
|
||||||
registerForm: {
|
registerForm: {
|
||||||
username: '',
|
username: '',
|
||||||
@@ -101,6 +144,7 @@ export default {
|
|||||||
code: '',
|
code: '',
|
||||||
uuid: '',
|
uuid: '',
|
||||||
bindId: '',
|
bindId: '',
|
||||||
|
agree: false, // 同意隐私协议
|
||||||
},
|
},
|
||||||
registerRules: {
|
registerRules: {
|
||||||
username: [
|
username: [
|
||||||
@@ -144,15 +188,14 @@ export default {
|
|||||||
{
|
{
|
||||||
trigger: 'blur',
|
trigger: 'blur',
|
||||||
validator: (rule, value, callback) => {
|
validator: (rule, value, callback) => {
|
||||||
var passwordreg = /(?![A-Z]*$)(?![a-z]*$)(?![0-9]*$)(?![^a-zA-Z0-9]*$)/
|
var passwordreg = /(?![A-Z]*$)(?![a-z]*$)(?![0-9]*$)(?![^a-zA-Z0-9]*$)/;
|
||||||
if (!passwordreg.test(value)) {
|
if (!passwordreg.test(value)) {
|
||||||
callback(new Error(this.$t('login.989807-62')))
|
callback(new Error(this.$t('login.989807-62')));
|
||||||
}
|
} else {
|
||||||
else {
|
callback();
|
||||||
callback()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
},
|
||||||
],
|
],
|
||||||
confirmPassword: [
|
confirmPassword: [
|
||||||
{
|
{
|
||||||
@@ -175,15 +218,57 @@ export default {
|
|||||||
],
|
],
|
||||||
},
|
},
|
||||||
loading: false,
|
loading: false,
|
||||||
|
// 验证码开关
|
||||||
captchaOnOff: true,
|
captchaOnOff: true,
|
||||||
bindAccount: false,
|
bindAccount: false,
|
||||||
|
redirect: undefined,
|
||||||
|
bindId: '',
|
||||||
|
systemForm: {
|
||||||
|
copyRight: true,
|
||||||
|
logo: undefined,
|
||||||
|
imgUrl: undefined,
|
||||||
|
accountTip: true,
|
||||||
|
document: true,
|
||||||
|
website: true,
|
||||||
|
isShowPhone: true,
|
||||||
|
isDoc: true,
|
||||||
|
},
|
||||||
|
isHaveBind: false, // 是否有绑定账号
|
||||||
|
errorText: '', // 错误信息
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.checkBind();
|
const { loginId } = this.$route.query;
|
||||||
|
if (!loginId) {
|
||||||
this.getCode();
|
this.getCode();
|
||||||
|
this.checkBind();
|
||||||
|
this.checkError();
|
||||||
|
//获取配置信息
|
||||||
|
this.getConfigKey('sys.logo.config').then((response) => {
|
||||||
|
if (response.code === 200 && response.msg !== '' && response.msg !== '{}') {
|
||||||
|
this.systemForm = JSON.parse(response.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
this.redirectLogin(loginId);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 显示|隐藏密码
|
||||||
|
handlePasswordTypeChange() {
|
||||||
|
this.pwdtype == 'password' ? (this.pwdtype = 'text') : (this.pwdtype = 'password');
|
||||||
|
},
|
||||||
|
// 获取验证码
|
||||||
|
getCode() {
|
||||||
|
getCodeImg().then((res) => {
|
||||||
|
this.captchaOnOff = res.captchaEnabled;
|
||||||
|
if (this.captchaOnOff) {
|
||||||
|
this.codeUrl = 'data:image/gif;base64,' + res.img;
|
||||||
|
this.registerForm.uuid = res.uuid;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 检测绑定信息
|
||||||
checkBind() {
|
checkBind() {
|
||||||
const query = this.$route.query;
|
const query = this.$route.query;
|
||||||
const bindId = query.bindId;
|
const bindId = query.bindId;
|
||||||
@@ -204,15 +289,50 @@ export default {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// 检查错误信息
|
||||||
getCode() {
|
checkError() {
|
||||||
getCodeImg().then((res) => {
|
const { errorId } = this.$route.query;
|
||||||
this.captchaOnOff = res.captchaOnOff === undefined ? true : res.captchaOnOff;
|
if (errorId) {
|
||||||
if (this.captchaOnOff) {
|
getErrorMsg(errorId).then((res) => {
|
||||||
this.codeUrl = 'data:image/gif;base64,' + res.img;
|
if (res.code === 200) {
|
||||||
this.registerForm.uuid = res.uuid;
|
this.errorText = res.msg;
|
||||||
|
} else {
|
||||||
|
this.errorText = '';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
// 重定向到登录
|
||||||
|
redirectLogin() {
|
||||||
|
const { loginId } = this.$route.query;
|
||||||
|
socialLogin(loginId).then((res) => {
|
||||||
|
setToken(res.token); // 保存token
|
||||||
|
this.$router.push({
|
||||||
|
path: this.redirect || '/',
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 返回登录页
|
||||||
|
handleGotoLogin() {
|
||||||
|
if (this.captchaOnOff) {
|
||||||
|
this.getCode();
|
||||||
|
}
|
||||||
|
this.formIndex = 1;
|
||||||
|
this.isHaveBind = false;
|
||||||
|
this.errorText = '';
|
||||||
|
this.$router.push('/login');
|
||||||
|
},
|
||||||
|
// 查看文档
|
||||||
|
handleGotoDoc() {
|
||||||
|
window.open('https://fastbee.cn/doc', '_blank');
|
||||||
|
},
|
||||||
|
// 返回官网
|
||||||
|
handleGotoOS() {
|
||||||
|
window.open('https://fastbee.cn', '_blank');
|
||||||
|
},
|
||||||
|
// 跳转到隐私政策
|
||||||
|
handleGotoPrivacyPolicy() {
|
||||||
|
window.open('https://fastbee.cn/privacy-policy.html', '_blank');
|
||||||
},
|
},
|
||||||
qqLogin() {
|
qqLogin() {
|
||||||
window.location.href = 'http://localhost:8080/auth/render/qq';
|
window.location.href = 'http://localhost:8080/auth/render/qq';
|
||||||
@@ -229,6 +349,15 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleRegister() {
|
handleRegister() {
|
||||||
|
// 验證是否同意隱私協議
|
||||||
|
if (!this.registerForm.agree) {
|
||||||
|
this.$message({
|
||||||
|
type: 'warning',
|
||||||
|
message: this.$t('login.989807-58'),
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
this.$refs.registerForm.validate((valid) => {
|
this.$refs.registerForm.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
@@ -260,7 +389,7 @@ export default {
|
|||||||
},
|
},
|
||||||
innerRegister(res) {
|
innerRegister(res) {
|
||||||
const username = this.registerForm.username;
|
const username = this.registerForm.username;
|
||||||
this.$alert("<font color='red'>" + this.$t('register.974236-18') + username + this.$t('register.974236-19') + "</font>", this.$t('register.974236-20'), {
|
this.$alert("<font color='red'>" + this.$t('register.974236-18') + username + this.$t('register.974236-19') + '</font>', this.$t('register.974236-20'), {
|
||||||
dangerouslyUseHTMLString: true,
|
dangerouslyUseHTMLString: true,
|
||||||
type: 'success',
|
type: 'success',
|
||||||
})
|
})
|
||||||
@@ -273,52 +402,197 @@ export default {
|
|||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss" scoped>
|
||||||
.register {
|
.register-wrap {
|
||||||
height: 100%;
|
user-select: none;
|
||||||
overflow: auto;
|
height: 100vh;
|
||||||
|
max-width: 100%;
|
||||||
|
width: 100vw;
|
||||||
|
display: flex;
|
||||||
|
|
||||||
|
.logo-wrap {
|
||||||
|
position: absolute;
|
||||||
|
top: 80px;
|
||||||
|
left: 80px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
width: 42px;
|
||||||
|
height: 46px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.register-form {
|
.text {
|
||||||
margin: 30px auto 0 auto;
|
font-size: 36px;
|
||||||
padding: 15px;
|
font-weight: 500;
|
||||||
z-index: 1000;
|
margin-left: 12px;
|
||||||
max-width: 350px;
|
color: #486ff2;
|
||||||
|
|
||||||
input {
|
|
||||||
height: 38px;
|
|
||||||
background-color: #f1f1f1;
|
|
||||||
color: #666;
|
|
||||||
}
|
|
||||||
|
|
||||||
.input-icon {
|
|
||||||
height: 39px;
|
|
||||||
width: 14px;
|
|
||||||
margin-left: 2px;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.register-code {
|
.introduce-text {
|
||||||
width: 33%;
|
position: absolute;
|
||||||
float: right;
|
font-weight: 400;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #909399;
|
||||||
|
line-height: 20px;
|
||||||
|
text-align: left;
|
||||||
|
font-style: normal;
|
||||||
|
top: 146px;
|
||||||
|
left: 80px;
|
||||||
|
width: 500px;
|
||||||
|
white-space: pre-wrap;
|
||||||
|
word-wrap: break-word;
|
||||||
|
}
|
||||||
|
|
||||||
img {
|
.img-wrap {
|
||||||
|
flex: 1;
|
||||||
|
background: #0f73ee;
|
||||||
|
}
|
||||||
|
|
||||||
|
.box-wrap {
|
||||||
|
position: relative;
|
||||||
|
width: 608px;
|
||||||
|
align-items: center;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
overflow: hidden;
|
||||||
|
justify-content: center;
|
||||||
|
|
||||||
|
.form-box {
|
||||||
|
margin-top: -8%; // 上移35下面留宽一点
|
||||||
|
width: 300px;
|
||||||
|
|
||||||
|
.title-wrap {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
|
||||||
|
.name {
|
||||||
|
font-weight: 600;
|
||||||
|
font-size: 24px;
|
||||||
|
color: #303133;
|
||||||
|
}
|
||||||
|
|
||||||
|
.lang {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
vertical-align: middle;
|
|
||||||
border-radius: 3px;
|
::v-deep .el-dropdown {
|
||||||
height: 38px;
|
font-weight: 400;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #909399;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-register-footer {
|
.form-wrap {
|
||||||
height: 40px;
|
::v-deep .el-form-item {
|
||||||
line-height: 40px;
|
margin-bottom: 21px;
|
||||||
position: fixed;
|
|
||||||
bottom: 0;
|
.el-form-item__content {
|
||||||
|
line-height: 14px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.item-wrap {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.input-wrap {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-between;
|
||||||
|
border-radius: 4px;
|
||||||
|
border: 1px solid #dcdfe6;
|
||||||
|
padding: 3px 16px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
|
||||||
color: #333;
|
.inner {
|
||||||
font-family: Arial;
|
background: none;
|
||||||
|
border: none;
|
||||||
|
box-sizing: border-box;
|
||||||
|
flex-grow: 1;
|
||||||
|
font-size: inherit;
|
||||||
|
outline: none;
|
||||||
|
padding: 0;
|
||||||
|
width: 100%;
|
||||||
|
color: #303133;
|
||||||
|
line-height: 30px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
color: #303133;
|
||||||
|
cursor: pointer;
|
||||||
|
padding-top: 8px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.input-append {
|
||||||
|
width: 112px;
|
||||||
|
height: 40px;
|
||||||
|
margin-left: 8px;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.other-link {
|
||||||
|
margin-top: 17px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.text {
|
||||||
|
color: #909399;
|
||||||
|
font-size: 14px;
|
||||||
|
text-align: left;
|
||||||
|
white-space: nowrap;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
.other-login {
|
||||||
|
margin-top: 40px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: center;
|
||||||
|
|
||||||
|
.icon {
|
||||||
|
width: 16px;
|
||||||
|
height: 16px;
|
||||||
|
margin: 0 12px 0 8px;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
margin-top: 26px;
|
||||||
|
width: 100%;
|
||||||
|
height: 40px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mess-text {
|
||||||
|
font-weight: 400;
|
||||||
|
font-size: 14px;
|
||||||
|
line-height: 24px;
|
||||||
|
color: #ed2525;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.copyright-wrap {
|
||||||
|
position: absolute;
|
||||||
|
bottom: 24px;
|
||||||
|
font-weight: 400;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
letter-spacing: 1px;
|
color: #909399;
|
||||||
}</style>
|
line-height: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -79,7 +79,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="roleKey">
|
<el-form-item prop="roleKey">
|
||||||
<span slot="label">
|
<span slot="label">
|
||||||
<el-tooltip content="控制器中定义的权限字符,如:@PreAuthorize(`@ss.hasRole('admin')`)" placement="top">
|
<el-tooltip :content="$t('role.index.094567-14')" placement="top">
|
||||||
<i class="el-icon-question"></i>
|
<i class="el-icon-question"></i>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
{{ $t('role.index.094567-0') }}
|
{{ $t('role.index.094567-0') }}
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<styule lang="scss">
|
<style lang="scss">
|
||||||
// 自定义二维码样式
|
// 自定义二维码样式
|
||||||
.impowerBox .title {
|
.impowerBox .title {
|
||||||
display: none;
|
display: none;
|
||||||
@@ -214,4 +214,4 @@ export default {
|
|||||||
.impowerBox .status {
|
.impowerBox .status {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
</styule>
|
</style>
|
||||||
|
|||||||
@@ -1,55 +1,82 @@
|
|||||||
<script>
|
<script>
|
||||||
import draggable from 'vuedraggable'
|
import draggable from 'vuedraggable';
|
||||||
import render from '@/utils/generator/render'
|
import render from '@/utils/generator/render';
|
||||||
|
|
||||||
const components = {
|
const components = {
|
||||||
itemBtns(h, element, index, parent) {
|
itemBtns(h, element, index, parent) {
|
||||||
const { copyItem, deleteItem } = this.$listeners
|
const { copyItem, deleteItem } = this.$listeners;
|
||||||
return [
|
return [
|
||||||
<span class="drawing-item-copy" title={this.$i18n.t('tool.build.index.670906-13')} onClick={event => {
|
<span
|
||||||
copyItem(element, parent); event.stopPropagation()
|
class="drawing-item-copy"
|
||||||
}}>
|
title={this.$i18n.t('tool.build.index.670906-13')}
|
||||||
|
onClick={(event) => {
|
||||||
|
copyItem(element, parent);
|
||||||
|
event.stopPropagation();
|
||||||
|
}}
|
||||||
|
>
|
||||||
<i class="el-icon-copy-document" />
|
<i class="el-icon-copy-document" />
|
||||||
</span>,
|
</span>,
|
||||||
<span class="drawing-item-delete" title={this.$i18n.t('tool.build.index.670906-14')} onClick={event => {
|
<span
|
||||||
deleteItem(index, parent); event.stopPropagation()
|
class="drawing-item-delete"
|
||||||
}}>
|
title={this.$i18n.t('tool.build.index.670906-14')}
|
||||||
|
onClick={(event) => {
|
||||||
|
deleteItem(index, parent);
|
||||||
|
event.stopPropagation();
|
||||||
|
}}
|
||||||
|
>
|
||||||
<i class="el-icon-delete" />
|
<i class="el-icon-delete" />
|
||||||
</span>
|
</span>,
|
||||||
]
|
];
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
const layouts = {
|
const layouts = {
|
||||||
colFormItem(h, element, index, parent) {
|
colFormItem(h, element, index, parent) {
|
||||||
const { activeItem } = this.$listeners
|
const { activeItem } = this.$listeners;
|
||||||
let className = this.activeId === element.formId ? 'drawing-item active-from-item' : 'drawing-item'
|
let className = this.activeId === element.formId ? 'drawing-item active-from-item' : 'drawing-item';
|
||||||
if (this.formConf.unFocusedComponentBorder) className += ' unfocus-bordered'
|
if (this.formConf.unFocusedComponentBorder) className += ' unfocus-bordered';
|
||||||
return (
|
return (
|
||||||
<el-col span={element.span} class={className}
|
<el-col
|
||||||
nativeOnClick={event => { activeItem(element); event.stopPropagation() }}>
|
span={element.span}
|
||||||
<el-form-item label-width={element.labelWidth ? `${element.labelWidth}px` : null}
|
class={className}
|
||||||
label={element.label} required={element.required}>
|
nativeOnClick={(event) => {
|
||||||
<render key={element.renderKey} conf={element} onInput={ event => {
|
activeItem(element);
|
||||||
this.$set(element, 'defaultValue', event)
|
event.stopPropagation();
|
||||||
}} />
|
}}
|
||||||
|
>
|
||||||
|
<el-form-item label-width={element.labelWidth ? `${element.labelWidth}px` : null} label={element.label} required={element.required}>
|
||||||
|
<render
|
||||||
|
key={element.renderKey}
|
||||||
|
conf={element}
|
||||||
|
onInput={(event) => {
|
||||||
|
this.$set(element, 'defaultValue', event);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
{components.itemBtns.apply(this, arguments)}
|
{components.itemBtns.apply(this, arguments)}
|
||||||
</el-col>
|
</el-col>
|
||||||
)
|
);
|
||||||
},
|
},
|
||||||
rowFormItem(h, element, index, parent) {
|
rowFormItem(h, element, index, parent) {
|
||||||
const { activeItem } = this.$listeners
|
const { activeItem } = this.$listeners;
|
||||||
const className = this.activeId === element.formId ? 'drawing-row-item active-from-item' : 'drawing-row-item'
|
const className = this.activeId === element.formId ? 'drawing-row-item active-from-item' : 'drawing-row-item';
|
||||||
let child = renderChildren.apply(this, arguments)
|
let child = renderChildren.apply(this, arguments);
|
||||||
if (element.type === 'flex') {
|
if (element.type === 'flex') {
|
||||||
child = <el-row type={element.type} justify={element.justify} align={element.align}>
|
child = (
|
||||||
|
<el-row type={element.type} justify={element.justify} align={element.align}>
|
||||||
{child}
|
{child}
|
||||||
</el-row>
|
</el-row>
|
||||||
|
);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<el-col span={element.span}>
|
<el-col span={element.span}>
|
||||||
<el-row gutter={element.gutter} class={className}
|
<el-row
|
||||||
nativeOnClick={event => { activeItem(element); event.stopPropagation() }}>
|
gutter={element.gutter}
|
||||||
|
class={className}
|
||||||
|
nativeOnClick={(event) => {
|
||||||
|
activeItem(element);
|
||||||
|
event.stopPropagation();
|
||||||
|
}}
|
||||||
|
>
|
||||||
<span class="component-name">{element.componentName}</span>
|
<span class="component-name">{element.componentName}</span>
|
||||||
<draggable list={element.children} animation={340} group="componentsGroup" class="drag-wrapper">
|
<draggable list={element.children} animation={340} group="componentsGroup" class="drag-wrapper">
|
||||||
{child}
|
{child}
|
||||||
@@ -57,44 +84,38 @@ const layouts = {
|
|||||||
{components.itemBtns.apply(this, arguments)}
|
{components.itemBtns.apply(this, arguments)}
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-col>
|
</el-col>
|
||||||
)
|
);
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
|
|
||||||
function renderChildren(h, element, index, parent) {
|
function renderChildren(h, element, index, parent) {
|
||||||
if (!Array.isArray(element.children)) return null
|
if (!Array.isArray(element.children)) return null;
|
||||||
return element.children.map((el, i) => {
|
return element.children.map((el, i) => {
|
||||||
const layout = layouts[el.layout]
|
const layout = layouts[el.layout];
|
||||||
if (layout) {
|
if (layout) {
|
||||||
return layout.call(this, h, el, i, element.children)
|
return layout.call(this, h, el, i, element.children);
|
||||||
}
|
}
|
||||||
return layoutIsNotFound()
|
return layoutIsNotFound();
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function layoutIsNotFound() {
|
function layoutIsNotFound() {
|
||||||
throw new Error(`没有与${this.element.layout}匹配的layout`)
|
throw new Error(this.$t('tool.build.index.670906-15') + `${this.element.layout}` + this.$t('tool.build.index.670906-16'));
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
render,
|
render,
|
||||||
draggable
|
draggable,
|
||||||
},
|
},
|
||||||
props: [
|
props: ['element', 'index', 'drawingList', 'activeId', 'formConf'],
|
||||||
'element',
|
|
||||||
'index',
|
|
||||||
'drawingList',
|
|
||||||
'activeId',
|
|
||||||
'formConf'
|
|
||||||
],
|
|
||||||
render(h) {
|
render(h) {
|
||||||
const layout = layouts[this.element.layout]
|
const layout = layouts[this.element.layout];
|
||||||
|
|
||||||
if (layout) {
|
if (layout) {
|
||||||
return layout.call(this, h, this.element, this.index, this.drawingList)
|
return layout.call(this, h, this.element, this.index, this.drawingList);
|
||||||
}
|
|
||||||
return layoutIsNotFound()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
return layoutIsNotFound();
|
||||||
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -469,7 +469,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
|
||||||
<template v-if="activeData.layoutTree">
|
<template v-if="activeData.layoutTree">
|
||||||
<el-divider>布局结构树</el-divider>
|
<el-divider>{{ $t('tool.rightPanel.670907-123') }}</el-divider>
|
||||||
<el-tree
|
<el-tree
|
||||||
:data="[activeData]"
|
:data="[activeData]"
|
||||||
:props="layoutTreeProps"
|
:props="layoutTreeProps"
|
||||||
@@ -487,7 +487,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="activeData.layout === 'colFormItem' && activeData.tag !== 'el-button'">
|
<template v-if="activeData.layout === 'colFormItem' && activeData.tag !== 'el-button'">
|
||||||
<el-divider>正则校验</el-divider>
|
<el-divider>{{ $t('tool.rightPanel.670907-124') }}</el-divider>
|
||||||
<div
|
<div
|
||||||
v-for="(item, index) in activeData.regList"
|
v-for="(item, index) in activeData.regList"
|
||||||
:key="index"
|
:key="index"
|
||||||
@@ -496,77 +496,77 @@
|
|||||||
<span class="close-btn" @click="activeData.regList.splice(index, 1)">
|
<span class="close-btn" @click="activeData.regList.splice(index, 1)">
|
||||||
<i class="el-icon-close" />
|
<i class="el-icon-close" />
|
||||||
</span>
|
</span>
|
||||||
<el-form-item label="表达式">
|
<el-form-item :label="$t('tool.rightPanel.670907-125')">
|
||||||
<el-input v-model="item.pattern" placeholder="请输入正则" />
|
<el-input v-model="item.pattern" :placeholder="$t('tool.rightPanel.670907-126')" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="错误提示" style="margin-bottom:0">
|
<el-form-item :label="$t('tool.rightPanel.670907-127')" style="margin-bottom:0">
|
||||||
<el-input v-model="item.message" placeholder="请输入错误提示" />
|
<el-input v-model="item.message" :placeholder="$t('tool.rightPanel.670907-128')" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-left: 20px">
|
<div style="margin-left: 20px">
|
||||||
<el-button icon="el-icon-circle-plus-outline" type="text" @click="addReg">
|
<el-button icon="el-icon-circle-plus-outline" type="text" @click="addReg">
|
||||||
添加规则
|
{{ $t('tool.rightPanel.670907-129') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-form>
|
</el-form>
|
||||||
<!-- 表单属性 -->
|
<!-- 表单属性 -->
|
||||||
<el-form v-show="currentTab === 'form'" size="small" label-width="90px">
|
<el-form v-show="currentTab === 'form'" size="small" label-width="90px">
|
||||||
<el-form-item label="表单名">
|
<el-form-item :label="$t('tool.rightPanel.670907-130')">
|
||||||
<el-input v-model="formConf.formRef" placeholder="请输入表单名(ref)" />
|
<el-input v-model="formConf.formRef" :placeholder="$t('tool.rightPanel.670907-131')" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="表单模型">
|
<el-form-item :label="$t('tool.rightPanel.670907-132')">
|
||||||
<el-input v-model="formConf.formModel" placeholder="请输入数据模型" />
|
<el-input v-model="formConf.formModel" :placeholder="$t('tool.rightPanel.670907-133')" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="校验模型">
|
<el-form-item :label="$t('tool.rightPanel.670907-134')">
|
||||||
<el-input v-model="formConf.formRules" placeholder="请输入校验模型" />
|
<el-input v-model="formConf.formRules" :placeholder="$t('tool.rightPanel.670907-135')" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="表单尺寸">
|
<el-form-item :label="$t('tool.rightPanel.670907-136')">
|
||||||
<el-radio-group v-model="formConf.size">
|
<el-radio-group v-model="formConf.size">
|
||||||
<el-radio-button label="medium">
|
<el-radio-button label="medium">
|
||||||
中等
|
{{ $t('tool.rightPanel.670907-107') }}
|
||||||
</el-radio-button>
|
</el-radio-button>
|
||||||
<el-radio-button label="small">
|
<el-radio-button label="small">
|
||||||
较小
|
{{ $t('tool.rightPanel.670907-108') }}
|
||||||
</el-radio-button>
|
</el-radio-button>
|
||||||
<el-radio-button label="mini">
|
<el-radio-button label="mini">
|
||||||
迷你
|
{{ $t('tool.rightPanel.670907-109') }}
|
||||||
</el-radio-button>
|
</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="标签对齐">
|
<el-form-item :label="$t('tool.rightPanel.670907-137')">
|
||||||
<el-radio-group v-model="formConf.labelPosition">
|
<el-radio-group v-model="formConf.labelPosition">
|
||||||
<el-radio-button label="left">
|
<el-radio-button label="left">
|
||||||
左对齐
|
{{ $t('tool.rightPanel.670907-138') }}
|
||||||
</el-radio-button>
|
</el-radio-button>
|
||||||
<el-radio-button label="right">
|
<el-radio-button label="right">
|
||||||
右对齐
|
{{ $t('tool.rightPanel.670907-139') }}
|
||||||
</el-radio-button>
|
</el-radio-button>
|
||||||
<el-radio-button label="top">
|
<el-radio-button label="top">
|
||||||
顶部对齐
|
{{ $t('tool.rightPanel.670907-140') }}
|
||||||
</el-radio-button>
|
</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="标签宽度">
|
<el-form-item :label="$t('tool.rightPanel.670907-20')">
|
||||||
<el-input-number v-model="formConf.labelWidth" placeholder="标签宽度" />
|
<el-input-number v-model="formConf.labelWidth" :placeholder="$t('tool.rightPanel.670907-21')" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="栅格间隔">
|
<el-form-item :label="$t('tool.rightPanel.670907-15')">
|
||||||
<el-input-number v-model="formConf.gutter" :min="0" placeholder="栅格间隔" />
|
<el-input-number v-model="formConf.gutter" :min="0" :placeholder="$t('tool.rightPanel.670907-15')" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="禁用表单">
|
<el-form-item :label="$t('tool.rightPanel.670907-141')">
|
||||||
<el-switch v-model="formConf.disabled" />
|
<el-switch v-model="formConf.disabled" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="表单按钮">
|
<el-form-item :label="$t('tool.rightPanel.670907-142')">
|
||||||
<el-switch v-model="formConf.formBtns" />
|
<el-switch v-model="formConf.formBtns" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="显示未选中组件边框">
|
<el-form-item :label="$t('tool.rightPanel.670907-143')">
|
||||||
<el-switch v-model="formConf.unFocusedComponentBorder" />
|
<el-switch v-model="formConf.unFocusedComponentBorder" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</el-scrollbar>
|
</el-scrollbar>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<treeNode-dialog :visible.sync="dialogVisible" title="添加选项" @commit="addNode" />
|
<treeNode-dialog :visible.sync="dialogVisible" :title="$t('tool.rightPanel.670907-144')" @commit="addNode" />
|
||||||
<icons-dialog :visible.sync="iconsVisible" :current="activeData[currentIconModel]" @select="setIcon" />
|
<icons-dialog :visible.sync="iconsVisible" :current="activeData[currentIconModel]" @select="setIcon" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@@ -4,21 +4,21 @@
|
|||||||
<span>{{ $t('tool.createTable.670904-1') }}</span>
|
<span>{{ $t('tool.createTable.670904-1') }}</span>
|
||||||
<el-input type="textarea" :rows="10" :placeholder="$t('tool.createTable.670904-2')" v-model="content"></el-input>
|
<el-input type="textarea" :rows="10" :placeholder="$t('tool.createTable.670904-2')" v-model="content"></el-input>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="handleCreateTable">{{ $t('common.confirm') }}</el-button>
|
<el-button type="primary" @click="handleCreateTable">{{ $t('confirm') }}</el-button>
|
||||||
<el-button @click="visible = false">{{ $t('common.cancel') }}</el-button>
|
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { createTable } from "@/api/tool/gen";
|
import { createTable } from '@/api/tool/gen';
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
visible: false,
|
visible: false,
|
||||||
// 文本内容
|
// 文本内容
|
||||||
content: ""
|
content: '',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -28,18 +28,18 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 创建按钮操作 */
|
/** 创建按钮操作 */
|
||||||
handleCreateTable() {
|
handleCreateTable() {
|
||||||
if (this.content === "") {
|
if (this.content === '') {
|
||||||
this.$modal.msgError(this.$i18n.t('tool.createTable.670904-3'));
|
this.$modal.msgError(this.$i18n.t('tool.createTable.670904-3'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
createTable({ sql: this.content }).then(res => {
|
createTable({ sql: this.content }).then((res) => {
|
||||||
this.$modal.msgSuccess(res.msg);
|
this.$modal.msgSuccess(res.msg);
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
this.$emit("ok");
|
this.$emit('ok');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -8,24 +8,14 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('tool.import.670901-3')" prop="tableName">
|
<el-form-item :label="$t('tool.import.670901-3')" prop="tableName">
|
||||||
<el-input
|
<el-input v-model="queryParams.tableName" :placeholder="$t('tool.import.670901-4')" clearable @keyup.enter.native="handleQuery" />
|
||||||
v-model="queryParams.tableName"
|
|
||||||
:placeholder="$t('tool.import.670901-4')"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('tool.import.670901-5')" prop="tableComment">
|
<el-form-item :label="$t('tool.import.670901-5')" prop="tableComment">
|
||||||
<el-input
|
<el-input v-model="queryParams.tableComment" :placeholder="$t('tool.import.670901-6')" clearable @keyup.enter.native="handleQuery" />
|
||||||
v-model="queryParams.tableComment"
|
|
||||||
:placeholder="$t('tool.import.670901-6')"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('common.search') }}</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('search') }}</el-button>
|
||||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('common.reset') }}</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('reset') }}</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<el-row>
|
<el-row>
|
||||||
@@ -36,17 +26,11 @@
|
|||||||
<el-table-column prop="createTime" :label="$t('tool.import.670901-7')"></el-table-column>
|
<el-table-column prop="createTime" :label="$t('tool.import.670901-7')"></el-table-column>
|
||||||
<el-table-column prop="updateTime" :label="$t('tool.import.670901-8')"></el-table-column>
|
<el-table-column prop="updateTime" :label="$t('tool.import.670901-8')"></el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||||
v-show="total>0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNum"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
</el-row>
|
</el-row>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="handleImportTable">{{ $t('common.confirm') }}</el-button>
|
<el-button type="primary" @click="handleImportTable">{{ $t('confirm') }}</el-button>
|
||||||
<el-button @click="visible = false">{{ $t('common.cancel') }}</el-button>
|
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</template>
|
</template>
|
||||||
@@ -72,7 +56,7 @@ export default {
|
|||||||
tableName: undefined,
|
tableName: undefined,
|
||||||
tableComment: undefined,
|
tableComment: undefined,
|
||||||
dataName: 'master',
|
dataName: 'master',
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
@@ -86,11 +70,11 @@ export default {
|
|||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.tables = selection.map(item => item.tableName);
|
this.tables = selection.map((item) => item.tableName);
|
||||||
},
|
},
|
||||||
// 查询表数据
|
// 查询表数据
|
||||||
getList() {
|
getList() {
|
||||||
listDbTable(this.queryParams).then(res => {
|
listDbTable(this.queryParams).then((res) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.dbTableList = res.rows;
|
this.dbTableList = res.rows;
|
||||||
this.total = res.total;
|
this.total = res.total;
|
||||||
@@ -112,7 +96,7 @@ export default {
|
|||||||
},
|
},
|
||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
resetQuery() {
|
resetQuery() {
|
||||||
this.resetForm("queryForm");
|
this.resetForm('queryForm');
|
||||||
this.handleQuery();
|
this.handleQuery();
|
||||||
},
|
},
|
||||||
/** 导入按钮操作 */
|
/** 导入按钮操作 */
|
||||||
@@ -130,10 +114,10 @@ export default {
|
|||||||
this.$modal.msgSuccess(res.msg);
|
this.$modal.msgSuccess(res.msg);
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.visible = false;
|
this.visible = false;
|
||||||
this.$emit("ok");
|
this.$emit('ok');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -2,20 +2,10 @@
|
|||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item :label="$t('gen.import.832346-1')" prop="tableName">
|
<el-form-item :label="$t('gen.import.832346-1')" prop="tableName">
|
||||||
<el-input
|
<el-input v-model="queryParams.tableName" :placeholder="$t('gen.import.832346-2')" clearable @keyup.enter.native="handleQuery" />
|
||||||
v-model="queryParams.tableName"
|
|
||||||
:placeholder="$t('gen.import.832346-2')"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('gen.import.832346-3')" prop="tableComment">
|
<el-form-item :label="$t('gen.import.832346-3')" prop="tableComment">
|
||||||
<el-input
|
<el-input v-model="queryParams.tableComment" :placeholder="$t('gen.import.832346-4')" clearable @keyup.enter.native="handleQuery" />
|
||||||
v-model="queryParams.tableComment"
|
|
||||||
:placeholder="$t('gen.import.832346-4')"
|
|
||||||
clearable
|
|
||||||
@keyup.enter.native="handleQuery"
|
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item :label="$t('creatTime')">
|
<el-form-item :label="$t('creatTime')">
|
||||||
<el-date-picker
|
<el-date-picker
|
||||||
@@ -36,57 +26,19 @@
|
|||||||
|
|
||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="primary" plain icon="el-icon-download" size="mini" :disabled="multiple" @click="handleGenTable" v-hasPermi="['tool:gen:code']">{{ $t('build.index.2090840-3') }}</el-button>
|
||||||
type="primary"
|
|
||||||
plain
|
|
||||||
icon="el-icon-download"
|
|
||||||
size="mini"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleGenTable"
|
|
||||||
v-hasPermi="['tool:gen:code']"
|
|
||||||
>{{ $t('build.index.2090840-3') }}</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="openCreateTable" v-hasRole="['admin']">{{ $t('add') }}</el-button>
|
||||||
type="primary"
|
|
||||||
plain
|
|
||||||
icon="el-icon-plus"
|
|
||||||
size="mini"
|
|
||||||
@click="openCreateTable"
|
|
||||||
v-hasRole="['admin']"
|
|
||||||
>{{ $t('add') }}</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="info" plain icon="el-icon-upload" size="mini" @click="openImportTable" v-hasPermi="['tool:gen:import']">{{ $t('import') }}</el-button>
|
||||||
type="info"
|
|
||||||
plain
|
|
||||||
icon="el-icon-upload"
|
|
||||||
size="mini"
|
|
||||||
@click="openImportTable"
|
|
||||||
v-hasPermi="['tool:gen:import']"
|
|
||||||
>{{ $t('import') }}</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleEditTable" v-hasPermi="['tool:gen:edit']">{{ $t('update') }}</el-button>
|
||||||
type="success"
|
|
||||||
plain
|
|
||||||
icon="el-icon-edit"
|
|
||||||
size="mini"
|
|
||||||
:disabled="single"
|
|
||||||
@click="handleEditTable"
|
|
||||||
v-hasPermi="['tool:gen:edit']"
|
|
||||||
>{{ $t('update') }}</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" v-hasPermi="['tool:gen:remove']">{{ $t('del') }}</el-button>
|
||||||
type="danger"
|
|
||||||
plain
|
|
||||||
icon="el-icon-delete"
|
|
||||||
size="mini"
|
|
||||||
:disabled="multiple"
|
|
||||||
@click="handleDelete"
|
|
||||||
v-hasPermi="['tool:gen:remove']"
|
|
||||||
>{{ $t('del') }}</el-button>
|
|
||||||
</el-col>
|
</el-col>
|
||||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -98,85 +50,26 @@
|
|||||||
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
|
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column :label="$t('gen.import.832346-1')" align="center" prop="tableName" :show-overflow-tooltip="true" width="120" />
|
||||||
:label="$t('gen.import.832346-1')"
|
<el-table-column :label="$t('gen.import.832346-3')" align="center" prop="tableComment" :show-overflow-tooltip="true" width="120" />
|
||||||
align="center"
|
<el-table-column :label="$t('gen.index.467583-1')" align="center" prop="className" :show-overflow-tooltip="true" width="120" />
|
||||||
prop="tableName"
|
|
||||||
:show-overflow-tooltip="true"
|
|
||||||
width="120"
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
:label="$t('gen.import.832346-3')"
|
|
||||||
align="center"
|
|
||||||
prop="tableComment"
|
|
||||||
:show-overflow-tooltip="true"
|
|
||||||
width="120"
|
|
||||||
/>
|
|
||||||
<el-table-column
|
|
||||||
:label="$t('gen.index.467583-1')"
|
|
||||||
align="center"
|
|
||||||
prop="className"
|
|
||||||
:show-overflow-tooltip="true"
|
|
||||||
width="120"
|
|
||||||
/>
|
|
||||||
<el-table-column :label="$t('creatTime')" align="center" prop="createTime" width="160" />
|
<el-table-column :label="$t('creatTime')" align="center" prop="createTime" width="160" />
|
||||||
<el-table-column :label="$t('updateTime')" align="center" prop="updateTime" width="160" />
|
<el-table-column :label="$t('updateTime')" align="center" prop="updateTime" width="160" />
|
||||||
<el-table-column :label="$t('opation')" align="center" class-name="small-padding fixed-width">
|
<el-table-column :label="$t('opation')" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button
|
<el-button type="text" size="small" icon="el-icon-view" @click="handlePreview(scope.row)" v-hasPermi="['tool:gen:preview']">{{ $t('preview') }}</el-button>
|
||||||
type="text"
|
<el-button type="text" size="small" icon="el-icon-edit" @click="handleEditTable(scope.row)" v-hasPermi="['tool:gen:edit']">{{ $t('edit') }}</el-button>
|
||||||
size="small"
|
<el-button type="text" size="small" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['tool:gen:remove']">{{ $t('del') }}</el-button>
|
||||||
icon="el-icon-view"
|
<el-button type="text" size="small" icon="el-icon-refresh" @click="handleSynchDb(scope.row)" v-hasPermi="['tool:gen:edit']">{{ $t('gen.index.467583-3') }}</el-button>
|
||||||
@click="handlePreview(scope.row)"
|
<el-button type="text" size="small" icon="el-icon-download" @click="handleGenTable(scope.row)" v-hasPermi="['tool:gen:code']">{{ $t('gen.index.467583-4') }}</el-button>
|
||||||
v-hasPermi="['tool:gen:preview']"
|
|
||||||
>{{ $t('preview') }}</el-button>
|
|
||||||
<el-button
|
|
||||||
type="text"
|
|
||||||
size="small"
|
|
||||||
icon="el-icon-edit"
|
|
||||||
@click="handleEditTable(scope.row)"
|
|
||||||
v-hasPermi="['tool:gen:edit']"
|
|
||||||
>{{ $t('edit') }}</el-button>
|
|
||||||
<el-button
|
|
||||||
type="text"
|
|
||||||
size="small"
|
|
||||||
icon="el-icon-delete"
|
|
||||||
@click="handleDelete(scope.row)"
|
|
||||||
v-hasPermi="['tool:gen:remove']"
|
|
||||||
>{{ $t('del') }}</el-button>
|
|
||||||
<el-button
|
|
||||||
type="text"
|
|
||||||
size="small"
|
|
||||||
icon="el-icon-refresh"
|
|
||||||
@click="handleSynchDb(scope.row)"
|
|
||||||
v-hasPermi="['tool:gen:edit']"
|
|
||||||
>{{ $t('gen.index.467583-3') }}</el-button>
|
|
||||||
<el-button
|
|
||||||
type="text"
|
|
||||||
size="small"
|
|
||||||
icon="el-icon-download"
|
|
||||||
@click="handleGenTable(scope.row)"
|
|
||||||
v-hasPermi="['tool:gen:code']"
|
|
||||||
>{{ $t('gen.index.467583-4') }}</el-button>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<pagination
|
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||||
v-show="total>0"
|
|
||||||
:total="total"
|
|
||||||
:page.sync="queryParams.pageNum"
|
|
||||||
:limit.sync="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
<!-- Preview -->
|
<!-- Preview -->
|
||||||
<el-dialog :title="preview.title" :visible.sync="preview.open" width="80%" top="5vh" append-to-body class="scrollbar">
|
<el-dialog :title="preview.title" :visible.sync="preview.open" width="80%" top="5vh" append-to-body class="scrollbar">
|
||||||
<el-tabs v-model="preview.activeName">
|
<el-tabs v-model="preview.activeName">
|
||||||
<el-tab-pane
|
<el-tab-pane v-for="(value, key) in preview.data" :label="key.substring(key.lastIndexOf('/') + 1, key.indexOf('.vm'))" :name="key.substring(key.lastIndexOf('/') + 1, key.indexOf('.vm'))" :key="key">
|
||||||
v-for="(value, key) in preview.data"
|
|
||||||
:label="key.substring(key.lastIndexOf('/')+1,key.indexOf('.vm'))"
|
|
||||||
:name="key.substring(key.lastIndexOf('/')+1,key.indexOf('.vm'))"
|
|
||||||
:key="key"
|
|
||||||
>
|
|
||||||
<el-link :underline="false" icon="el-icon-document-copy" v-clipboard:copy="value" v-clipboard:success="clipboardSuccess" style="float: right">{{ $t('device.device-edit.148398-55') }}</el-link>
|
<el-link :underline="false" icon="el-icon-document-copy" v-clipboard:copy="value" v-clipboard:success="clipboardSuccess" style="float: right">{{ $t('device.device-edit.148398-55') }}</el-link>
|
||||||
<pre><code class="hljs" v-html="highlightedCode(value, key)"></code></pre>
|
<pre><code class="hljs" v-html="highlightedCode(value, key)"></code></pre>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
@@ -188,27 +81,27 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listTable, previewTable, delTable, genCode, synchDb } from "@/api/tool/gen";
|
import { listTable, previewTable, delTable, genCode, synchDb } from '@/api/tool/gen';
|
||||||
import importTable from "./importTable";
|
import importTable from './importTable';
|
||||||
import createTable from "./createTable";
|
import createTable from './createTable';
|
||||||
import hljs from "highlight.js/lib/highlight";
|
import hljs from 'highlight.js/lib/highlight';
|
||||||
import "highlight.js/styles/github-gist.css";
|
import 'highlight.js/styles/github-gist.css';
|
||||||
hljs.registerLanguage("java", require("highlight.js/lib/languages/java"));
|
hljs.registerLanguage('java', require('highlight.js/lib/languages/java'));
|
||||||
hljs.registerLanguage("xml", require("highlight.js/lib/languages/xml"));
|
hljs.registerLanguage('xml', require('highlight.js/lib/languages/xml'));
|
||||||
hljs.registerLanguage("html", require("highlight.js/lib/languages/xml"));
|
hljs.registerLanguage('html', require('highlight.js/lib/languages/xml'));
|
||||||
hljs.registerLanguage("vue", require("highlight.js/lib/languages/xml"));
|
hljs.registerLanguage('vue', require('highlight.js/lib/languages/xml'));
|
||||||
hljs.registerLanguage("javascript", require("highlight.js/lib/languages/javascript"));
|
hljs.registerLanguage('javascript', require('highlight.js/lib/languages/javascript'));
|
||||||
hljs.registerLanguage("sql", require("highlight.js/lib/languages/sql"));
|
hljs.registerLanguage('sql', require('highlight.js/lib/languages/sql'));
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Gen",
|
name: 'Gen',
|
||||||
components: { importTable, createTable },
|
components: { importTable, createTable },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
// 唯一标识符
|
// 唯一标识符
|
||||||
uniqueId: "",
|
uniqueId: '',
|
||||||
// 选中数组
|
// 选中数组
|
||||||
ids: [],
|
ids: [],
|
||||||
// 选中表数组
|
// 选中表数组
|
||||||
@@ -224,21 +117,21 @@ export default {
|
|||||||
// 表数据
|
// 表数据
|
||||||
tableList: [],
|
tableList: [],
|
||||||
// 日期范围
|
// 日期范围
|
||||||
dateRange: "",
|
dateRange: '',
|
||||||
// 查询参数
|
// 查询参数
|
||||||
queryParams: {
|
queryParams: {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
tableName: undefined,
|
tableName: undefined,
|
||||||
tableComment: undefined
|
tableComment: undefined,
|
||||||
},
|
},
|
||||||
// 预览参数
|
// 预览参数
|
||||||
preview: {
|
preview: {
|
||||||
open: false,
|
open: false,
|
||||||
title: this.$t('gen.index.467583-5'),
|
title: this.$t('gen.index.467583-5'),
|
||||||
data: {},
|
data: {},
|
||||||
activeName: "domain.java"
|
activeName: 'domain.java',
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@@ -256,12 +149,11 @@ export default {
|
|||||||
/** 查询表集合 */
|
/** 查询表集合 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
listTable(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
listTable(this.addDateRange(this.queryParams, this.dateRange)).then((response) => {
|
||||||
this.tableList = response.rows;
|
this.tableList = response.rows;
|
||||||
this.total = response.total;
|
this.total = response.total;
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
}
|
});
|
||||||
);
|
|
||||||
},
|
},
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
@@ -271,26 +163,30 @@ export default {
|
|||||||
/** 生成代码操作 */
|
/** 生成代码操作 */
|
||||||
handleGenTable(row) {
|
handleGenTable(row) {
|
||||||
const tableNames = row.tableName || this.tableNames;
|
const tableNames = row.tableName || this.tableNames;
|
||||||
if (tableNames == "") {
|
if (tableNames == '') {
|
||||||
this.$modal.msgError(this.$t('gen.index.467583-6'));
|
this.$modal.msgError(this.$t('gen.index.467583-6'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(row.genType === "1") {
|
if (row.genType === '1') {
|
||||||
genCode(row.tableName).then(response => {
|
genCode(row.tableName).then((response) => {
|
||||||
this.$modal.msgSuccess(this.$t('gen.index.467583-7') + row.genPath);
|
this.$modal.msgSuccess(this.$t('gen.index.467583-7') + row.genPath);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.$download.zip("/tool/gen/batchGenCode?tables=" + tableNames, "ruoyi.zip");
|
this.$download.zip('/tool/gen/batchGenCode?tables=' + tableNames, 'ruoyi.zip');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
/** 同步数据库操作 */
|
/** 同步数据库操作 */
|
||||||
handleSynchDb(row) {
|
handleSynchDb(row) {
|
||||||
const tableName = row.tableName;
|
const tableName = row.tableName;
|
||||||
this.$modal.confirm(this.$t('gen.index.467583-8') + tableName + this.$t('gen.index.467583-9')).then(function() {
|
this.$modal
|
||||||
|
.confirm(this.$t('gen.index.467583-8') + tableName + this.$t('gen.index.467583-9'))
|
||||||
|
.then(function () {
|
||||||
return synchDb(tableName);
|
return synchDb(tableName);
|
||||||
}).then(() => {
|
})
|
||||||
|
.then(() => {
|
||||||
this.$modal.msgSuccess(this.$t('gen.index.467583-10'));
|
this.$modal.msgSuccess(this.$t('gen.index.467583-10'));
|
||||||
}).catch(() => {});
|
})
|
||||||
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
/** 打开导入表弹窗 */
|
/** 打开导入表弹窗 */
|
||||||
openImportTable() {
|
openImportTable() {
|
||||||
@@ -303,22 +199,22 @@ export default {
|
|||||||
/** 重置按钮操作 */
|
/** 重置按钮操作 */
|
||||||
resetQuery() {
|
resetQuery() {
|
||||||
this.dateRange = [];
|
this.dateRange = [];
|
||||||
this.resetForm("queryForm");
|
this.resetForm('queryForm');
|
||||||
this.handleQuery();
|
this.handleQuery();
|
||||||
},
|
},
|
||||||
/** 预览按钮 */
|
/** 预览按钮 */
|
||||||
handlePreview(row) {
|
handlePreview(row) {
|
||||||
previewTable(row.tableId).then(response => {
|
previewTable(row.tableId).then((response) => {
|
||||||
this.preview.data = response.data;
|
this.preview.data = response.data;
|
||||||
this.preview.open = true;
|
this.preview.open = true;
|
||||||
this.preview.activeName = "domain.java";
|
this.preview.activeName = 'domain.java';
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
/** 高亮显示 */
|
/** 高亮显示 */
|
||||||
highlightedCode(code, key) {
|
highlightedCode(code, key) {
|
||||||
const vmName = key.substring(key.lastIndexOf("/") + 1, key.indexOf(".vm"));
|
const vmName = key.substring(key.lastIndexOf('/') + 1, key.indexOf('.vm'));
|
||||||
var language = vmName.substring(vmName.indexOf(".") + 1, vmName.length);
|
var language = vmName.substring(vmName.indexOf('.') + 1, vmName.length);
|
||||||
const result = hljs.highlight(language, code || "", true);
|
const result = hljs.highlight(language, code || '', true);
|
||||||
return result.value || ' ';
|
return result.value || ' ';
|
||||||
},
|
},
|
||||||
/** 复制代码成功 */
|
/** 复制代码成功 */
|
||||||
@@ -327,8 +223,8 @@ export default {
|
|||||||
},
|
},
|
||||||
// 多选框选中数据
|
// 多选框选中数据
|
||||||
handleSelectionChange(selection) {
|
handleSelectionChange(selection) {
|
||||||
this.ids = selection.map(item => item.tableId);
|
this.ids = selection.map((item) => item.tableId);
|
||||||
this.tableNames = selection.map(item => item.tableName);
|
this.tableNames = selection.map((item) => item.tableName);
|
||||||
this.single = selection.length != 1;
|
this.single = selection.length != 1;
|
||||||
this.multiple = !selection.length;
|
this.multiple = !selection.length;
|
||||||
},
|
},
|
||||||
@@ -337,13 +233,22 @@ export default {
|
|||||||
const tableId = row.tableId || this.ids[0];
|
const tableId = row.tableId || this.ids[0];
|
||||||
const tableName = row.tableName || this.tableNames[0];
|
const tableName = row.tableName || this.tableNames[0];
|
||||||
const params = { pageNum: this.queryParams.pageNum };
|
const params = { pageNum: this.queryParams.pageNum };
|
||||||
this.$tab.openPage(this.$t('update') + "[" + tableName + "]" + this.$t('gen.index.467583-4'), '/tool/gen-edit/index/' + tableId, params);
|
this.$tab.openPage(this.$t('update') + '[' + tableName + ']' + this.$t('gen.index.467583-4'), '/tool/gen-edit/index/' + tableId, params);
|
||||||
},
|
},
|
||||||
/** 删除按钮操作 */
|
/** 删除按钮操作 */
|
||||||
handleDelete(row) {
|
handleDelete(row) {
|
||||||
const tableIds = row.tableId || this.ids;
|
const tableIds = row.tableId || this.ids;
|
||||||
this.$modal.confirm(this.$t('gen.index.467583-12', [tableIds])).then(function() {
|
this.$modal
|
||||||
|
.confirm(this.$t('gen.index.467583-12', [tableIds]))
|
||||||
|
.then(function () {
|
||||||
return delTable(tableIds);
|
return delTable(tableIds);
|
||||||
}).then(() => {
|
})
|
||||||
|
.then(() => {
|
||||||
this.getList();
|
this.getList();
|
||||||
this.$modal.msgSucc
|
this.$modal.msgSuccess(this.$t('delSuccess'));
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user