mirror of
https://gitee.com/beecue/fastbee.git
synced 2026-03-21 22:14:50 +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-50": "please enter an 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-1": "Remove sub devices",
|
||||
"device.sub.083943-2": "Set sub device address",
|
||||
|
||||
@@ -67,5 +67,7 @@
|
||||
"home.free": "Free",
|
||||
"home.diskUsage": "Disk Usage",
|
||||
"home.diskStatus": "Disk Status",
|
||||
"home.available": "Available"
|
||||
"home.available": "Available",
|
||||
"home.fengxinIoT": "Fengxin IoT",
|
||||
"home.projectDocs": "Project Documentation"
|
||||
}
|
||||
|
||||
@@ -265,12 +265,14 @@
|
||||
"tool.treeNode.670908-7": "Cancel",
|
||||
"tool.icons.670909-0": "Select Icon",
|
||||
"tool.icons.670909-1": "Please enter icon name",
|
||||
"tool.build.index.670906-13": "Copy",
|
||||
"tool.build.index.670906-14": "Delete",
|
||||
"tool.codeType.670910-0": "Generate Type",
|
||||
"tool.codeType.670910-1": "File Name",
|
||||
"tool.codeType.670910-2": "Please enter file name",
|
||||
"tool.codeType.670910-3": "Page",
|
||||
"tool.codeType.670910-4": "Dialog",
|
||||
"tool.codeType.670910-5": "Generate type cannot be empty"
|
||||
"tool.build.index.670906-13": "Copy",
|
||||
"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-1": "File Name",
|
||||
"tool.codeType.670910-2": "Please enter file name",
|
||||
"tool.codeType.670910-3": "Page",
|
||||
"tool.codeType.670910-4": "Dialog",
|
||||
"tool.codeType.670910-5": "Generate type cannot be empty"
|
||||
}
|
||||
|
||||
@@ -652,6 +652,7 @@
|
||||
"device.running-status.866086-49": "请输入下发值",
|
||||
"device.running-status.866086-50": "只能输入整数",
|
||||
"device.running-status.866086-51": "请输入有效的整数",
|
||||
"device.running-status.866086-52": "指令发送",
|
||||
"device.sub.083943-0": "添加子设备",
|
||||
"device.sub.083943-1": "移除子设备",
|
||||
"device.sub.083943-2": "设置子设备地址",
|
||||
|
||||
@@ -67,5 +67,7 @@
|
||||
"home.free": "剩余",
|
||||
"home.diskUsage": "系统盘使用率",
|
||||
"home.diskStatus": "磁盘状态",
|
||||
"home.available": "可用"
|
||||
"home.available": "可用",
|
||||
"home.fengxinIoT": "蜂信物联",
|
||||
"home.projectDocs": "项目文档"
|
||||
}
|
||||
|
||||
@@ -265,12 +265,14 @@
|
||||
"tool.treeNode.670908-7": "取消",
|
||||
"tool.icons.670909-0": "选择图标",
|
||||
"tool.icons.670909-1": "请输入图标名称",
|
||||
"tool.build.index.670906-13": "复制",
|
||||
"tool.build.index.670906-14": "删除",
|
||||
"tool.codeType.670910-0": "生成类型",
|
||||
"tool.codeType.670910-1": "文件名",
|
||||
"tool.codeType.670910-2": "请输入文件名",
|
||||
"tool.codeType.670910-3": "页面",
|
||||
"tool.codeType.670910-4": "弹窗",
|
||||
"tool.codeType.670910-5": "生成类型不能为空"
|
||||
"tool.build.index.670906-13": "复制",
|
||||
"tool.build.index.670906-14": "删除",
|
||||
"tool.build.index.670906-15": "没有与",
|
||||
"tool.build.index.670906-16": "相关的组件",
|
||||
"tool.codeType.670910-0": "生成类型",
|
||||
"tool.codeType.670910-1": "文件名",
|
||||
"tool.codeType.670910-2": "请输入文件名",
|
||||
"tool.codeType.670910-3": "页面",
|
||||
"tool.codeType.670910-4": "弹窗",
|
||||
"tool.codeType.670910-5": "生成类型不能为空"
|
||||
}
|
||||
|
||||
@@ -2,12 +2,12 @@
|
||||
<div>
|
||||
<el-row :gutter="20" style="margin-bottom: 16px">
|
||||
<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-select>
|
||||
</el-col>
|
||||
<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-col>
|
||||
</el-row>
|
||||
|
||||
@@ -206,12 +206,12 @@
|
||||
Copyright © 2021-2022
|
||||
<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
|
||||
</span>
|
||||
<br />
|
||||
<span>
|
||||
项目文档
|
||||
{{ $t('home.projectDocs') }}
|
||||
<a href="https://fastbee.cn/doc/" target="_blank">https://fastbee.cn/doc/</a>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -45,8 +45,8 @@
|
||||
<span>{{ scope.row.createTime }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="标识符" align="center" prop="identify" />
|
||||
<el-table-column label="动作" align="left" header-align="center" prop="logValue">
|
||||
<el-table-column :label="$t('device.device-log.798283-2')" align="center" prop="identify" />
|
||||
<el-table-column :label="$t('device.device-log.798283-15')" align="left" header-align="center" prop="logValue">
|
||||
<template slot-scope="scope">
|
||||
<div v-html="formatValueDisplay(scope.row)"></div>
|
||||
</template>
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
<el-table-column :label="$t('device.device-log.798283-16')" header-align="center" align="left" prop="remark">
|
||||
<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>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
@@ -182,7 +182,7 @@ export default {
|
||||
/** 更新实时监测参数*/
|
||||
beginMonitor() {
|
||||
if (this.deviceInfo.status != 3) {
|
||||
this.$modal.alertError('设备不在线,下发指令失败');
|
||||
this.$modal.alertError(this.$t('device.device-monitor.817489-13'));
|
||||
return;
|
||||
}
|
||||
// 清空图表数据
|
||||
@@ -197,7 +197,7 @@ export default {
|
||||
}
|
||||
// Mqtt发布实时监测消息
|
||||
let model = {};
|
||||
model.name = '更新实时监测';
|
||||
model.name = this.$t('device.device-monitor.817489-16');
|
||||
model.value = this.monitorNumber;
|
||||
model.type = 4;
|
||||
this.mqttPublish(this.deviceInfo, model);
|
||||
@@ -206,7 +206,7 @@ export default {
|
||||
/** 停止实时监测 */
|
||||
stopMonitor() {
|
||||
if (this.deviceInfo.status != 3) {
|
||||
this.$modal.alertError('设备不在线,下发指令失败');
|
||||
this.$modal.alertError(this.$t('device.device-monitor.817489-13'));
|
||||
return;
|
||||
}
|
||||
this.chartLoading = false;
|
||||
@@ -228,7 +228,13 @@ export default {
|
||||
option = {
|
||||
title: {
|
||||
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: {
|
||||
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">
|
||||
<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-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>
|
||||
</el-table-column>
|
||||
</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-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-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();
|
||||
} else {
|
||||
this.permsLoading = false;
|
||||
this.message = '查询不到用户信息,或者该用户已经是设备用户';
|
||||
this.message = this.$t('device.device-user.037521-31');
|
||||
}
|
||||
});
|
||||
},
|
||||
@@ -271,8 +283,8 @@ export default {
|
||||
},
|
||||
{
|
||||
identifier: 'log',
|
||||
modelName: '设备日志',
|
||||
remark: '包含事件日志和指令日志',
|
||||
modelName: this.$t('device.device-user.037521-36'),
|
||||
remark: this.$t('device.device-user.037521-37'),
|
||||
},
|
||||
{
|
||||
identifier: 'monitor',
|
||||
@@ -281,8 +293,8 @@ export default {
|
||||
},
|
||||
{
|
||||
identifier: 'statistic',
|
||||
modelName: '监测统计',
|
||||
remark: '图表显示存储的历史监测数据',
|
||||
modelName: this.$t('device.device-user.037521-40'),
|
||||
remark: this.$t('device.device-user.037521-41'),
|
||||
},
|
||||
];
|
||||
this.sharePermissionList = this.sharePermissionList.concat(response.data);
|
||||
@@ -340,4 +352,9 @@ export default {
|
||||
this.resetUserQuery();
|
||||
this.open = false;
|
||||
this.getList();
|
||||
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -48,8 +48,15 @@
|
||||
</el-select>
|
||||
</div>
|
||||
<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-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 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-input>
|
||||
</div>
|
||||
<div v-if="item.datatype.type == 'decimal'">
|
||||
@@ -69,7 +76,7 @@
|
||||
type="info"
|
||||
@click="mqttPublish(deviceInfo, item)"
|
||||
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"
|
||||
></el-button>
|
||||
</div>
|
||||
@@ -91,7 +98,7 @@
|
||||
type="info"
|
||||
@click="mqttPublish(deviceInfo, item)"
|
||||
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"
|
||||
></el-button>
|
||||
</div>
|
||||
@@ -124,23 +131,51 @@
|
||||
{{ subItem.text }}
|
||||
</el-button>
|
||||
</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-select>
|
||||
</div>
|
||||
<div v-if="param.datatype.type == 'string'">
|
||||
<el-input v-model="param.shadow" placeholder="请输入字符串" :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-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="$t('device.running-status.866086-52')"
|
||||
v-if="!shadowUnEnable && param.isReadonly == 0"
|
||||
></el-button>
|
||||
</el-input>
|
||||
</div>
|
||||
<div v-if="param.datatype.type == 'decimal'">
|
||||
<el-input v-model="param.shadow" type="number" placeholder="请输入小数 " :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-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="$t('device.running-status.866086-52')"
|
||||
v-if="!shadowUnEnable && param.isReadonly == 0"
|
||||
></el-button>
|
||||
</el-input>
|
||||
</div>
|
||||
<div v-if="param.datatype.type == 'integer'">
|
||||
<el-input v-model="param.shadow" type="integer" placeholder="请输入整数 " :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-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="$t('device.running-status.866086-52')"
|
||||
v-if="!shadowUnEnable && param.isReadonly == 0"
|
||||
></el-button>
|
||||
</el-input>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
@@ -150,18 +185,59 @@
|
||||
<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)">
|
||||
<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-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>
|
||||
<el-input
|
||||
: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>
|
||||
</div>
|
||||
<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-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>
|
||||
<el-input
|
||||
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>
|
||||
</div>
|
||||
<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-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>
|
||||
<el-input
|
||||
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>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
@@ -201,23 +277,51 @@
|
||||
{{ subItem.text }}
|
||||
</el-button>
|
||||
</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-select>
|
||||
</div>
|
||||
<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-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>
|
||||
</div>
|
||||
<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-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>
|
||||
</div>
|
||||
<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-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>
|
||||
</div>
|
||||
</el-descriptions-item>
|
||||
@@ -247,38 +351,48 @@
|
||||
<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>
|
||||
</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-select>
|
||||
</div>
|
||||
<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 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 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 v-if="item.datatype.type == 'object'">
|
||||
<el-descriptions :column="1" size="mini" border>
|
||||
<el-descriptions-item v-for="(param, index) in item.datatype.params" :key="index" :label="param.name">
|
||||
<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 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-select>
|
||||
</div>
|
||||
<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 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 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>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
@@ -287,13 +401,13 @@
|
||||
<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)">
|
||||
<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 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 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>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
@@ -308,21 +422,30 @@
|
||||
<el-descriptions :column="1" size="mini" border>
|
||||
<el-descriptions-item v-for="(param, index) in arrayParam" :key="index" :label="param.name">
|
||||
<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 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-select>
|
||||
</div>
|
||||
<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 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 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>
|
||||
</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
@@ -348,7 +471,6 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import { serviceInvoke } from '@/api/iot/runstatus';
|
||||
|
||||
export default {
|
||||
@@ -680,7 +802,7 @@ export default {
|
||||
arrayInputChange(value, thingsModel) {
|
||||
let arrayModels = value.split(',');
|
||||
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 {
|
||||
for (let i = 0; i < thingsModel.datatype.arrayCount; 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) + '"}';
|
||||
// 发布
|
||||
this.$mqttTool
|
||||
.publish(topic, message, '设备升级')
|
||||
.publish(topic, message, this.$t('device.running-status.866086-31'))
|
||||
.then((res) => {
|
||||
this.$modal.notifySuccess(res);
|
||||
})
|
||||
@@ -832,4 +954,4 @@ export default {
|
||||
.el-slider__button-wrapper {
|
||||
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-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">{{ $t('common.search') }}</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('common.reset') }}</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('reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<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">
|
||||
<input type="radio" :checked="scope.row.isSelect" name="product" />
|
||||
</template>
|
||||
|
||||
@@ -1,23 +1,19 @@
|
||||
<template>
|
||||
<div style="padding: 6px">
|
||||
<el-card v-show="showSearch" style="margin-bottom: 6px">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
|
||||
label-width="68px" style="margin-bottom: -20px">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px" style="margin-bottom: -20px">
|
||||
<el-form-item :label="$t('script.349087-0')" prop="scriptId">
|
||||
<el-input v-model="queryParams.scriptId" :placeholder="$t('script.349087-1')" clearable
|
||||
@keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="queryParams.scriptId" :placeholder="$t('script.349087-1')" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('script.349087-2')" prop="scriptName">
|
||||
<el-input v-model="queryParams.scriptName" :placeholder="$t('script.349087-3')" clearable
|
||||
@keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="queryParams.scriptName" :placeholder="$t('script.349087-3')" clearable @keyup.enter.native="handleQuery" />
|
||||
</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 icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('common.reset') }}</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('reset') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item style="float: right">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||
v-hasPermi="['iot:script:add']">{{ $t('common.add') }}</el-button>
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['iot:script:add']">{{ $t('add') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
@@ -34,8 +30,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('script.index.470901-5')" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.rule_script_action" :value="scope.row.scriptAction"
|
||||
size="small" />
|
||||
<dict-tag :options="dict.type.rule_script_action" :value="scope.row.scriptAction" size="small" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('script.index.470901-7')" align="center" prop="scriptLanguage" />
|
||||
@@ -46,23 +41,19 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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">
|
||||
<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)"
|
||||
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('common.del') }}</el-button>
|
||||
<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>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['iot:script:remove']">{{ $t('del') }}</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 添加或修改规则引擎脚本对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body :close-on-click-modal="false"
|
||||
:close-on-press-escape="false">
|
||||
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body :close-on-click-modal="false" :close-on-press-escape="false">
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="90px">
|
||||
<el-row :gutter="50">
|
||||
<el-col :span="12">
|
||||
@@ -72,16 +63,19 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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"
|
||||
controls-position="right" style="width: 100%" />
|
||||
<el-input-number v-model="form.scriptOrder" :placeholder="$t('script.index.470901-10')" type="number" controls-position="right" style="width: 100%" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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-option v-for="dict in dict.type.rule_script_event" :key="dict.label"
|
||||
:label="dict.label" :value="Number(dict.value)"
|
||||
:disabled="dict.value !== '1' && dict.value !== '2'"></el-option>
|
||||
<el-option
|
||||
v-for="dict in dict.type.rule_script_event"
|
||||
:key="dict.label"
|
||||
:label="dict.label"
|
||||
:value="Number(dict.value)"
|
||||
:disabled="dict.value !== '1' && dict.value !== '2'"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -89,9 +83,7 @@
|
||||
<el-col :span="12">
|
||||
<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-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>
|
||||
<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>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -102,10 +94,8 @@
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<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')"
|
||||
style="margin-top: 3px">
|
||||
<el-button slot="append" @click="handleSelectProduct()"
|
||||
size="small">{{ $t('script.index.470901-4') }}</el-button>
|
||||
<el-input readonly v-model="form.productName" size="small" :placeholder="$t('script.index.470901-3')" style="margin-top: 3px">
|
||||
<el-button slot="append" @click="handleSelectProduct()" size="small">{{ $t('script.index.470901-4') }}</el-button>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
@@ -113,28 +103,21 @@
|
||||
</el-row>
|
||||
</el-form>
|
||||
<div style="padding: 0px 10px" @click="editClick">
|
||||
<AceEditor ref="codeEditor" :content.sync="form.scriptData" lang="groovy" codeStyle="chrome"
|
||||
:read-only="false" width="100%" height="450px"></AceEditor>
|
||||
<AceEditor ref="codeEditor" :content.sync="form.scriptData" lang="groovy" codeStyle="chrome" :read-only="false" width="100%" height="450px"></AceEditor>
|
||||
</div>
|
||||
<div style="padding: 0 10px; margin: 10px 0">
|
||||
<el-alert :title="validateMsg" type="success" 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>
|
||||
<el-alert :title="validateMsg" type="success" 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 slot="footer" class="dialog-footer">
|
||||
<span style="float: left">
|
||||
<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">
|
||||
<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">
|
||||
{{ $t('script.index.470901-17') }}
|
||||
</el-link>
|
||||
</span>
|
||||
<el-button type="success" @click="handleValidate">{{ $t('script.index.470901-18') }}</el-button>
|
||||
<el-button type="primary" @click="submitForm" v-hasPermi="['iot:script:edit']"
|
||||
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('common.add') }}</el-button>
|
||||
<el-button type="primary" @click="submitForm" v-hasPermi="['iot:script:edit']" 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 @click="cancel">{{ $t('script.index.470901-20') }}</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
@@ -406,7 +389,7 @@ msgContext.setPayload(NewPayload);`,
|
||||
this.getList();
|
||||
this.$modal.msgSuccess(this.$i18n.t('script.index.470901-27'));
|
||||
})
|
||||
.catch(() => { });
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 验证按钮操作 */
|
||||
handleValidate() {
|
||||
|
||||
@@ -195,84 +195,84 @@ export default {
|
||||
protocol: [
|
||||
{
|
||||
required: true,
|
||||
message: '默认播放协议不能为空',
|
||||
message: this.$t('sip.index.998533-26'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
ip: [
|
||||
{
|
||||
required: true,
|
||||
message: '服务器ip不能为空',
|
||||
message: this.$t('sip.index.998533-27'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
domain: [
|
||||
{
|
||||
required: true,
|
||||
message: '服务器域名不能为空',
|
||||
message: this.$t('sip.index.998533-28'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
secret: [
|
||||
{
|
||||
required: true,
|
||||
message: '流媒体密钥不能为空',
|
||||
message: this.$t('sip.index.998533-29'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
portHttp: [
|
||||
{
|
||||
required: true,
|
||||
message: 'http端口不能为空',
|
||||
message: this.$t('sip.index.998533-30'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
portHttps: [
|
||||
{
|
||||
required: true,
|
||||
message: 'https端口不能为空',
|
||||
message: this.$t('sip.index.998533-31'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
portRtmp: [
|
||||
{
|
||||
required: true,
|
||||
message: 'rtmp端口不能为空',
|
||||
message: this.$t('sip.index.998533-32'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
portRtsp: [
|
||||
{
|
||||
required: true,
|
||||
message: 'rtsp端口不能为空',
|
||||
message: this.$t('sip.index.998533-33'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
rtpPortRange: [
|
||||
{
|
||||
required: true,
|
||||
message: 'rtp端口范围不能为空',
|
||||
message: this.$t('sip.index.998533-34'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
delFlag: [
|
||||
{
|
||||
required: true,
|
||||
message: '删除标志不能为空',
|
||||
message: this.$t('sip.index.998533-35'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
createBy: [
|
||||
{
|
||||
required: true,
|
||||
message: '创建者不能为空',
|
||||
message: this.$t('sip.index.998533-36'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
createTime: [
|
||||
{
|
||||
required: true,
|
||||
message: '创建时间不能为空',
|
||||
message: this.$t('sip.index.998533-37'),
|
||||
trigger: 'blur',
|
||||
},
|
||||
],
|
||||
|
||||
@@ -64,14 +64,19 @@
|
||||
<el-switch v-model="mediaServerForm.autoConfig"></el-switch>
|
||||
</el-form-item>
|
||||
<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 v-if="!mediaServerForm.rtpEnable" :label="$t('sip.mediaServerEdit.998534-23')" prop="rtpProxyPort">
|
||||
<el-input v-model.number="mediaServerForm.rtpProxyPort" clearable></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="mediaServerForm.rtpEnable" :label="$t('sip.mediaServerEdit.998534-23')">
|
||||
<el-input v-model="rtpPortRange1" :placeholder="$t('sip.mediaServerEdit.998534-24')" @change="portRangeChange" clearable style="width: 100px" prop="rtpPortRange1"></el-input>
|
||||
<el-input v-model="rtpPortRange2" :placeholder="$t('sip.mediaServerEdit.998534-25')" @change="portRangeChange" clearable style="width: 100px" prop="rtpPortRange2" ></el-input>
|
||||
<el-input v-model="rtpPortRange2" :placeholder="$t('sip.mediaServerEdit.998534-25')" @change="portRangeChange" clearable style="width: 100px" prop="rtpPortRange2"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('sip.mediaServerEdit.998534-26')" prop="portRtmp">
|
||||
<el-input v-model="mediaServerForm.portRtmp" :placeholder="$t('sip.mediaServerEdit.998534-27')" clearable></el-input>
|
||||
@@ -111,15 +116,14 @@ export default {
|
||||
editFlag: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
|
||||
},
|
||||
},
|
||||
},
|
||||
data() {
|
||||
const isValidIp = (rule, value, callback) => {
|
||||
// 校验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])$/;
|
||||
if (!reg.test(value)) {
|
||||
return callback(new Error('请输入有效的IP地址'));
|
||||
return callback(new Error(this.$t('sip.mediaServerEdit.998534-24')));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
@@ -129,7 +133,7 @@ export default {
|
||||
// 校验IP是否符合规则
|
||||
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)) {
|
||||
return callback(new Error('请输入有效的端口号'));
|
||||
return callback(new Error(this.$t('sip.mediaServerEdit.998534-25')));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
|
||||
@@ -3,22 +3,19 @@
|
||||
<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-item :label="$t('template.index.891112-22')" prop="templateName">
|
||||
<el-input v-model="queryParams.templateName" :placeholder="$t('template.index.891112-1')" clearable size="small"
|
||||
@keyup.enter.native="handleQuery" />
|
||||
<el-input v-model="queryParams.templateName" :placeholder="$t('template.index.891112-1')" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<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-option v-for="dict in dict.type.iot_things_type" :key="dict.value" :label="dict.label"
|
||||
:value="dict.value" />
|
||||
<el-option v-for="dict in dict.type.iot_things_type" :key="dict.value" :label="dict.label" :value="dict.value" />
|
||||
</el-select>
|
||||
</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 icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('common.reset') }}</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('reset') }}</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item style="float: right">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
|
||||
v-hasPermi="['iot:template:add']">{{ $t('common.add') }}</el-button>
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" v-hasPermi="['iot:template:add']">{{ $t('add') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
@@ -57,32 +54,34 @@
|
||||
<dict-tag :options="dict.type.iot_data_type" :value="scope.row.datatype" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('template.index.891112-15')" align="left" header-align="center" prop="specs" min-width="150"
|
||||
class-name="specsColor">
|
||||
<el-table-column :label="$t('template.index.891112-15')" align="left" header-align="center" prop="specs" min-width="150" class-name="specsColor">
|
||||
<template slot-scope="scope">
|
||||
<div v-html="formatSpecsDisplay(scope.row.specs)"></div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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">
|
||||
<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">
|
||||
{{ $t('common.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">
|
||||
{{ $t('edit') }}
|
||||
</el-button>
|
||||
<el-button size="small" type="text" 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('common.del') }}
|
||||
<el-button
|
||||
size="small"
|
||||
type="text"
|
||||
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>
|
||||
<span style="font-size: 10px; color: #999" v-if="scope.row.isSys == '1' && isTenant">{{ $t('template.index.891112-21') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
<!-- 添加或修改通用物模型对话框 -->
|
||||
<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-form-item>
|
||||
<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')"
|
||||
style="width: 386px" />
|
||||
<el-input-number controls-position="right" v-model="form.modelOrder" :placeholder="$t('template.index.891112-27')" style="width: 386px" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('template.index.891112-28')" prop="type">
|
||||
<el-radio-group v-model="form.type" @change="typeChange(form.type)">
|
||||
@@ -109,32 +107,51 @@
|
||||
<el-row>
|
||||
<el-col :span="6">
|
||||
<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"
|
||||
v-model="form.isChart" :true-label="1" :false-label="0"></el-checkbox>
|
||||
<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-col>
|
||||
<el-col :span="6">
|
||||
<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"
|
||||
v-model="form.isMonitor" :true-label="1" :false-label="0"></el-checkbox>
|
||||
<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-col>
|
||||
<el-col :span="6">
|
||||
<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"
|
||||
v-model="form.isReadonly" :true-label="1" :false-label="0"></el-checkbox>
|
||||
<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-col>
|
||||
<el-col :span="6">
|
||||
<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"
|
||||
:false-label="0"></el-checkbox>
|
||||
<el-checkbox name="isHistory" :label="$t('template.index.891112-11')" v-model="form.isHistory" :true-label="1" :false-label="0"></el-checkbox>
|
||||
</el-tooltip>
|
||||
</el-col>
|
||||
<el-col :span="6">
|
||||
<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"
|
||||
:false-label="0"></el-checkbox>
|
||||
<el-checkbox name="isSharePerm" :label="$t('template.index.891112-39')" v-model="form.isSharePerm" :true-label="1" :false-label="0"></el-checkbox>
|
||||
</el-tooltip>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -156,26 +173,22 @@
|
||||
<el-form-item :label="$t('template.index.891112-48')" v-if="form.datatype == 'integer'">
|
||||
<el-row>
|
||||
<el-col :span="9">
|
||||
<el-input v-model="form.specs.min" :placeholder="$t('template.index.891112-49')" controls-position="right" type="number"
|
||||
style="width: 174px;" @input="handleEdit" />
|
||||
<el-input v-model="form.specs.min" :placeholder="$t('template.index.891112-49')" controls-position="right" type="number" style="width: 174px" @input="handleEdit" />
|
||||
</el-col>
|
||||
<el-col :span="2" align="center">{{ $t('template.index.891112-50') }}</el-col>
|
||||
<el-col :span="9">
|
||||
<el-input v-model="form.specs.max" :placeholder="$t('template.index.891112-51')" type="number" controls-position="right"
|
||||
style="width: 174px;" @input="handleEditmax" />
|
||||
<el-input v-model="form.specs.max" :placeholder="$t('template.index.891112-51')" type="number" controls-position="right" style="width: 174px" @input="handleEditmax" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('template.index.891112-48')" v-if="form.datatype == 'decimal'">
|
||||
<el-row>
|
||||
<el-col :span="9">
|
||||
<el-input v-model="form.specs.min" :placeholder="$t('template.index.891112-49')" controls-position="right" type="number"
|
||||
style="width: 174px;" />
|
||||
<el-input v-model="form.specs.min" :placeholder="$t('template.index.891112-49')" controls-position="right" type="number" style="width: 174px" />
|
||||
</el-col>
|
||||
<el-col :span="2" align="center">{{ $t('template.index.891112-50') }}</el-col>
|
||||
<el-col :span="9">
|
||||
<el-input v-model="form.specs.max" :placeholder="$t('template.index.891112-51')" type="number" controls-position="right"
|
||||
style="width: 174px;" />
|
||||
<el-input v-model="form.specs.max" :placeholder="$t('template.index.891112-51')" type="number" controls-position="right" style="width: 174px" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
@@ -183,8 +196,7 @@
|
||||
<el-input v-model="form.specs.unit" :placeholder="$t('template.index.891112-53')" style="width: 385px" />
|
||||
</el-form-item>
|
||||
<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"
|
||||
style="width: 386px" />
|
||||
<el-input controls-position="right" v-model="form.specs.step" :placeholder="$t('template.index.891112-55')" type="number" style="width: 386px" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div v-if="form.datatype == 'bool'">
|
||||
@@ -218,8 +230,9 @@
|
||||
<el-col :span="11" :offset="1">
|
||||
<el-input v-model="item.text" :placeholder="$t('template.index.891112-67')" />
|
||||
</el-col>
|
||||
<el-col :span="2" :offset="1" v-if="index != 0"><a style="color: #f56c6c"
|
||||
@click="removeEnumItem(index)">{{ $t('common.del') }}</a></el-col>
|
||||
<el-col :span="2" :offset="1" v-if="index != 0">
|
||||
<a style="color: #f56c6c" @click="removeEnumItem(index)">{{ $t('del') }}</a>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<div>
|
||||
+
|
||||
@@ -260,16 +273,14 @@
|
||||
<el-col :span="18">
|
||||
<el-input readonly v-model="item.name" size="mini" :placeholder="$t('template.index.891112-76')" style="margin-top: 3px">
|
||||
<template slot="prepend">
|
||||
<el-tag size="mini" effect="dark" style="margin-left: -21px; height: 26px; line-height: 26px">{{
|
||||
item.order }}</el-tag>
|
||||
<el-tag size="mini" effect="dark" style="margin-left: -21px; height: 26px; line-height: 26px">{{ item.order }}</el-tag>
|
||||
{{ form.identifier + '_' + item.id }}
|
||||
</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-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button size="small" plain type="danger" style="padding: 5px" icon="el-icon-delete"
|
||||
@click="removeParameter(index)">{{ $t('common.del') }}</el-button>
|
||||
<el-button size="small" plain type="danger" style="padding: 5px" icon="el-icon-delete" @click="removeParameter(index)">{{ $t('del') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
@@ -287,16 +298,14 @@
|
||||
<el-col :span="18">
|
||||
<el-input readonly v-model="item.name" size="mini" :placeholder="$t('template.index.891112-76')" style="margin-top: 3px">
|
||||
<template slot="prepend">
|
||||
<el-tag size="mini" effect="dark" style="margin-left: -21px; height: 26px; line-height: 26px">{{
|
||||
item.order }}</el-tag>
|
||||
<el-tag size="mini" effect="dark" style="margin-left: -21px; height: 26px; line-height: 26px">{{ item.order }}</el-tag>
|
||||
{{ form.identifier + '_' + item.id }}
|
||||
</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-col>
|
||||
<el-col :span="2" :offset="2">
|
||||
<el-button size="small" plain type="danger" style="padding: 5px" icon="el-icon-delete"
|
||||
@click="removeParameter(index)">{{ $t('common.del') }}</el-button>
|
||||
<el-button size="small" plain type="danger" style="padding: 5px" icon="el-icon-delete" @click="removeParameter(index)">{{ $t('del') }}</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
@@ -309,11 +318,9 @@
|
||||
</el-form>
|
||||
|
||||
<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>
|
||||
<el-button type="primary" @click="submitForm" v-hasPermi="['iot:template:add']" v-show="!form.templateId">{{ $t('common.add') }}
|
||||
</el-button>
|
||||
<el-button @click="cancel">{{ $t('common.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="submitForm" v-hasPermi="['iot:template:edit']" v-show="form.templateId">{{ $t('edit') }}</el-button>
|
||||
<el-button type="primary" @click="submitForm" v-hasPermi="['iot:template:add']" v-show="!form.templateId">{{ $t('add') }}</el-button>
|
||||
<el-button @click="cancel">{{ $t('cancel') }}</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
@@ -433,7 +440,6 @@ export default {
|
||||
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'));
|
||||
}
|
||||
else if (this.form.templateId != null) {
|
||||
} else if (this.form.templateId != null) {
|
||||
// 格式化specs
|
||||
let tempForm = JSON.parse(JSON.stringify(this.form));
|
||||
tempForm.specs = this.formatThingsSpecs();
|
||||
@@ -651,7 +656,7 @@ export default {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess(this.$i18n.t('template.index.891112-130'));
|
||||
})
|
||||
.catch(() => { });
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
@@ -720,8 +725,8 @@ export default {
|
||||
} else if (this.form.datatype == 'string') {
|
||||
data.maxLength = Number(this.form.specs.maxLength ? this.form.specs.maxLength : 1024);
|
||||
} else if (this.form.datatype == 'bool') {
|
||||
data.falseText = this.form.specs.falseText ? this.form.specs.falseText : '关闭';
|
||||
data.trueText = this.form.specs.trueText ? this.form.specs.trueText : '打开';
|
||||
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 : this.$t('template.paramter.038405-58');
|
||||
} else if (this.form.datatype == 'enum') {
|
||||
data.showWay = this.form.specs.showWay;
|
||||
if (this.form.specs.enumList && this.form.specs.enumList[0].text != '') {
|
||||
@@ -731,11 +736,11 @@ export default {
|
||||
data.enumList = [
|
||||
{
|
||||
value: '0',
|
||||
text: '低',
|
||||
text: this.$t('template.paramter.038405-59'),
|
||||
},
|
||||
{
|
||||
value: '1',
|
||||
text: '高',
|
||||
text: this.$t('template.paramter.038405-60'),
|
||||
},
|
||||
];
|
||||
}
|
||||
@@ -781,19 +786,36 @@ export default {
|
||||
let specs = JSON.parse(json);
|
||||
if (specs.type === 'integer' || specs.type === 'decimal') {
|
||||
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 +
|
||||
'</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 +
|
||||
'</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 +
|
||||
'</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
|
||||
);
|
||||
} else if (specs.type === 'string') {
|
||||
return this.$i18n.t('template.index.891112-109') + '<span style="color:#F56C6C">' + specs.maxLength + '</span>';
|
||||
} 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') {
|
||||
let items = '';
|
||||
for (let i = 0; i < specs.enumList.length; i++) {
|
||||
@@ -847,20 +869,20 @@ export default {
|
||||
},
|
||||
// 在输入最小值改变时触发
|
||||
handleEdit(e) {
|
||||
let value = e.replace(/[^\-\d]/g, ""); // 只能输入-和数字
|
||||
value = value.replace(/\-{2,}/g, "-"); // -只能保留一个
|
||||
value = value.replace(/(\d)\-/g, "$1"); // 数字后面不能接-,不能出现类似-11-2,12-,11-23
|
||||
value = value.replace(/(-)0+/g, "$1"); // 不能出现-0,-001,-0001类似
|
||||
value = value.replace(/(-\d{10})\d*/, '$1') // 最多保留10位整数
|
||||
let value = e.replace(/[^\-\d]/g, ''); // 只能输入-和数字
|
||||
value = value.replace(/\-{2,}/g, '-'); // -只能保留一个
|
||||
value = value.replace(/(\d)\-/g, '$1'); // 数字后面不能接-,不能出现类似-11-2,12-,11-23
|
||||
value = value.replace(/(-)0+/g, '$1'); // 不能出现-0,-001,-0001类似
|
||||
value = value.replace(/(-\d{10})\d*/, '$1'); // 最多保留10位整数
|
||||
this.form.specs.min = value;
|
||||
},
|
||||
// 在输入最大值改变时触发
|
||||
handleEditmax(e) {
|
||||
let value = e.replace(/[^\-\d]/g, ""); // 只能输入-和数字
|
||||
value = value.replace(/\-{2,}/g, "-"); // -只能保留一个
|
||||
value = value.replace(/(\d)\-/g, "$1"); // 数字后面不能接-,不能出现类似-11-2,12-,11-23
|
||||
value = value.replace(/(-)0+/g, "$1"); // 不能出现-0,-001,-0001类似
|
||||
value = value.replace(/(-\d{10})\d*/, '$1') // 最多保留10位整数
|
||||
let value = e.replace(/[^\-\d]/g, ''); // 只能输入-和数字
|
||||
value = value.replace(/\-{2,}/g, '-'); // -只能保留一个
|
||||
value = value.replace(/(\d)\-/g, '$1'); // 数字后面不能接-,不能出现类似-11-2,12-,11-23
|
||||
value = value.replace(/(-)0+/g, '$1'); // 不能出现-0,-001,-0001类似
|
||||
value = value.replace(/(-\d{10})\d*/, '$1'); // 最多保留10位整数
|
||||
this.form.specs.max = value;
|
||||
},
|
||||
//数据类型为小数的校验
|
||||
|
||||
@@ -1,17 +1,21 @@
|
||||
<template>
|
||||
<div class="login">
|
||||
<el-row>
|
||||
<el-col :xs="24">
|
||||
<div 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 class="login-wrap">
|
||||
<div class="logo-wrap">
|
||||
<img class="icon" src="@/assets/images/logo_blue.png" />
|
||||
<span class="text">{{ $t('login.989807-37') }}</span>
|
||||
</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 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>
|
||||
|
||||
<pre class="demo-account">{{ $t('login.989807-33') }}</pre>
|
||||
<el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
|
||||
<el-form-item>
|
||||
<div class="alert-box-wrap" v-if="loginForm.bindId != null">
|
||||
@@ -54,15 +58,9 @@
|
||||
</el-form-item>
|
||||
<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>
|
||||
<langSelect class="lang"></langSelect>
|
||||
</div>
|
||||
<el-form-item style="width: 100%">
|
||||
<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">
|
||||
<el-button class="btn" :loading="loading" type="primary" @click.native.prevent="handleLogin">
|
||||
<span v-if="!loading">{{ $t('login.989807-3') }}</span>
|
||||
@@ -78,13 +76,13 @@
|
||||
<span>{{ $t('login.989807-44') }}</span>
|
||||
</el-button>
|
||||
</div>
|
||||
<el-row>
|
||||
<div>
|
||||
<el-link href="https://fastbee.cn/" :underline="false" target="_blank" style="float: left">{{ $t('login.989807-41') }}</el-link>
|
||||
<el-link href="https://fastbee.cn/doc" :underline="false" target="_blank" style="float: left; margin-left: 20px">{{ $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>
|
||||
<div class="other-link">
|
||||
<el-link href="https://fastbee.cn/" :underline="false" target="_blank">{{ $t('login.989807-41') }}</el-link>
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
<el-link href="https://fastbee.cn/doc" :underline="false" target="_blank">{{ $t('login.989807-40') }}</el-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>
|
||||
</el-row>
|
||||
<div class="other-login">
|
||||
<span class="text">{{ $t('login.989807-42') }}</span>
|
||||
<svg-icon class="icon" icon-class="wechat" style="color: #07c160" @click="handleGotoWeChatLogin" />
|
||||
@@ -92,17 +90,18 @@
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
|
||||
<!-- 底部 -->
|
||||
<div class="el-login-footer">
|
||||
<span>
|
||||
Copyright © 2021-2025
|
||||
Copyright © 2021-2026
|
||||
<a target="_blank" href="http://fastbee.cn">FastBee</a>
|
||||
All Rights Reserved.
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -469,22 +468,157 @@ export default {
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.login {
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
<style lang="scss" scoped>
|
||||
.login-wrap {
|
||||
user-select: none;
|
||||
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;
|
||||
}
|
||||
|
||||
.text {
|
||||
font-size: 36px;
|
||||
font-weight: 500;
|
||||
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;
|
||||
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;
|
||||
}
|
||||
|
||||
.bindAccountTitle {
|
||||
margin: 0px auto 30px auto;
|
||||
text-align: center;
|
||||
color: #333;
|
||||
font-size: 24px;
|
||||
.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 {
|
||||
margin: 30px auto 0 auto;
|
||||
padding: 15px;
|
||||
flex: 1;
|
||||
padding: 0px;
|
||||
z-index: 1000;
|
||||
max-width: 350px;
|
||||
|
||||
@@ -514,16 +648,12 @@ export default {
|
||||
}
|
||||
|
||||
.el-login-footer {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
color: #333;
|
||||
font-family: Arial;
|
||||
position: absolute;
|
||||
bottom: 24px;
|
||||
font-weight: 400;
|
||||
font-size: 12px;
|
||||
letter-spacing: 1px;
|
||||
color: #909399;
|
||||
line-height: 20px;
|
||||
}
|
||||
|
||||
.alert-box-wrap {
|
||||
@@ -542,6 +672,7 @@ export default {
|
||||
width: 100%;
|
||||
height: 40px;
|
||||
}
|
||||
|
||||
.other-login {
|
||||
margin-top: 40px;
|
||||
display: flex;
|
||||
@@ -555,4 +686,66 @@ export default {
|
||||
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>
|
||||
|
||||
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)">
|
||||
<div slot="header">
|
||||
<span>{{ $t('monitor.cache.list.501235-0') }}</span>
|
||||
<el-button
|
||||
style="float: right; padding: 3px 0"
|
||||
type="text"
|
||||
icon="el-icon-refresh-right"
|
||||
@click="refreshCacheNames()"
|
||||
></el-button>
|
||||
<el-button style="float: right; padding: 3px 0" type="text" icon="el-icon-refresh-right" @click="refreshCacheNames()"></el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="loading"
|
||||
: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 v-loading="loading" :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
|
||||
:label="$t('monitor.cache.list.501235-2')"
|
||||
align="center"
|
||||
prop="cacheName"
|
||||
:show-overflow-tooltip="true"
|
||||
:formatter="nameFormatter"
|
||||
></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>
|
||||
|
||||
<el-table-column
|
||||
:label="$t('common.remark')"
|
||||
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"
|
||||
>
|
||||
<el-table-column :label="$t('remark')" align="center" prop="remark" :show-overflow-tooltip="true" />
|
||||
<el-table-column :label="$t('opation')" width="60" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleClearCacheName(scope.row)"
|
||||
></el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleClearCacheName(scope.row)"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -63,46 +26,14 @@
|
||||
<el-card style="height: calc(100vh - 125px)">
|
||||
<div slot="header">
|
||||
<span>{{ $t('monitor.cache.list.501235-5') }}</span>
|
||||
<el-button
|
||||
style="float: right; padding: 3px 0"
|
||||
type="text"
|
||||
icon="el-icon-refresh-right"
|
||||
@click="refreshCacheKeys()"
|
||||
></el-button>
|
||||
<el-button style="float: right; padding: 3px 0" type="text" icon="el-icon-refresh-right" @click="refreshCacheKeys()"></el-button>
|
||||
</div>
|
||||
<el-table
|
||||
v-loading="subLoading"
|
||||
:data="cacheKeys"
|
||||
:height="tableHeight"
|
||||
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"
|
||||
>
|
||||
<el-table v-loading="subLoading" :data="cacheKeys" :height="tableHeight" 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('opation')" width="60" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleClearCacheKey(scope.row)"
|
||||
></el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleClearCacheKey(scope.row)"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -113,13 +44,7 @@
|
||||
<el-card :bordered="false" style="height: calc(100vh - 125px)">
|
||||
<div slot="header">
|
||||
<span>{{ $t('monitor.cache.list.501235-7') }}</span>
|
||||
<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
|
||||
>
|
||||
<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>
|
||||
<el-form :model="cacheForm">
|
||||
<el-row :gutter="32">
|
||||
@@ -135,12 +60,7 @@
|
||||
</el-col>
|
||||
<el-col :offset="1" :span="22">
|
||||
<el-form-item :label="$t('monitor.cache.list.501235-10')" prop="cacheValue">
|
||||
<el-input
|
||||
v-model="cacheForm.cacheValue"
|
||||
type="textarea"
|
||||
:rows="8"
|
||||
:readOnly="true"
|
||||
/>
|
||||
<el-input v-model="cacheForm.cacheValue" type="textarea" :rows="8" :readOnly="true" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -152,10 +72,10 @@
|
||||
</template>
|
||||
|
||||
<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 {
|
||||
name: "CacheList",
|
||||
name: 'CacheList',
|
||||
data() {
|
||||
return {
|
||||
cacheNames: [],
|
||||
@@ -163,8 +83,8 @@ export default {
|
||||
cacheForm: {},
|
||||
loading: true,
|
||||
subLoading: false,
|
||||
nowCacheName: "",
|
||||
tableHeight: window.innerHeight - 200
|
||||
nowCacheName: '',
|
||||
tableHeight: window.innerHeight - 200,
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@@ -174,7 +94,7 @@ export default {
|
||||
/** 查询缓存名称列表 */
|
||||
getCacheNames() {
|
||||
this.loading = true;
|
||||
listCacheName().then(response => {
|
||||
listCacheName().then((response) => {
|
||||
this.cacheNames = response.data;
|
||||
this.loading = false;
|
||||
});
|
||||
@@ -186,7 +106,7 @@ export default {
|
||||
},
|
||||
/** 清理指定名称缓存 */
|
||||
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.getCacheKeys();
|
||||
});
|
||||
@@ -194,11 +114,11 @@ export default {
|
||||
/** 查询缓存键名列表 */
|
||||
getCacheKeys(row) {
|
||||
const cacheName = row !== undefined ? row.cacheName : this.nowCacheName;
|
||||
if (cacheName === "") {
|
||||
if (cacheName === '') {
|
||||
return;
|
||||
}
|
||||
this.subLoading = true;
|
||||
listCacheKey(cacheName).then(response => {
|
||||
listCacheKey(cacheName).then((response) => {
|
||||
this.cacheKeys = response.data;
|
||||
this.subLoading = false;
|
||||
this.nowCacheName = cacheName;
|
||||
@@ -211,31 +131,31 @@ export default {
|
||||
},
|
||||
/** 清理指定键名缓存 */
|
||||
handleClearCacheKey(cacheKey) {
|
||||
clearCacheKey(cacheKey).then(response => {
|
||||
clearCacheKey(cacheKey).then((response) => {
|
||||
this.$modal.msgSuccess(this.$i18n.t('monitor.cache.list.501235-15', [cacheKey]));
|
||||
this.getCacheKeys();
|
||||
});
|
||||
},
|
||||
/** 列表前缀去除 */
|
||||
nameFormatter(row) {
|
||||
return row.cacheName.replace(":", "");
|
||||
return row.cacheName.replace(':', '');
|
||||
},
|
||||
/** 键名前缀去除 */
|
||||
keyFormatter(cacheKey) {
|
||||
return cacheKey.replace(this.nowCacheName, "");
|
||||
return cacheKey.replace(this.nowCacheName, '');
|
||||
},
|
||||
/** 查询缓存内容详细 */
|
||||
handleCacheValue(cacheKey) {
|
||||
getCacheValue(this.nowCacheName, cacheKey).then(response => {
|
||||
getCacheValue(this.nowCacheName, cacheKey).then((response) => {
|
||||
this.cacheForm = response.data;
|
||||
});
|
||||
},
|
||||
/** 清理全部缓存 */
|
||||
handleClearCacheAll() {
|
||||
clearCacheAll().then(response => {
|
||||
clearCacheAll().then((response) => {
|
||||
this.$modal.msgSuccess(this.$i18n.t('monitor.cache.list.501235-16'));
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -2,61 +2,22 @@
|
||||
<div class="app-container">
|
||||
<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-input
|
||||
v-model="queryParams.operIp"
|
||||
:placeholder="$t('operlog.874509-10')"
|
||||
clearable
|
||||
style="width: 240px;"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.operIp" :placeholder="$t('operlog.874509-10')" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('operlog.874509-0')" prop="title">
|
||||
<el-input
|
||||
v-model="queryParams.title"
|
||||
:placeholder="$t('operlog.874509-1')"
|
||||
clearable
|
||||
style="width: 240px;"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.title" :placeholder="$t('operlog.874509-1')" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('operlog.874509-2')" prop="operName">
|
||||
<el-input
|
||||
v-model="queryParams.operName"
|
||||
:placeholder="$t('operlog.874509-3')"
|
||||
clearable
|
||||
style="width: 240px;"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.operName" :placeholder="$t('operlog.874509-3')" clearable style="width: 240px" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('system.notice.670989-4')" prop="businessType">
|
||||
<el-select
|
||||
v-model="queryParams.businessType"
|
||||
: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 v-model="queryParams.businessType" :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-form-item>
|
||||
<el-form-item :label="$t('status')" prop="status">
|
||||
<el-select
|
||||
v-model="queryParams.status"
|
||||
: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 v-model="queryParams.status" :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-form-item>
|
||||
<el-form-item :label="$t('operlog.874509-6')">
|
||||
@@ -79,35 +40,13 @@
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<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-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 :span="1.5">
|
||||
<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-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 :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="el-icon-download"
|
||||
size="mini"
|
||||
@click="handleExport"
|
||||
v-hasPermi="['monitor:operlog:export']"
|
||||
>{{ $t('export') }}</el-button>
|
||||
<el-button type="warning" plain icon="el-icon-download" size="mini" @click="handleExport" v-hasPermi="['monitor:operlog:export']">{{ $t('export') }}</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
@@ -118,7 +57,7 @@
|
||||
<el-table-column :label="$t('operlog.874509-0')" align="center" prop="title" :show-overflow-tooltip="true" />
|
||||
<el-table-column :label="$t('operlog.874509-4')" align="center" prop="businessType">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_oper_type" :value="scope.row.businessType"/>
|
||||
<dict-tag :options="dict.type.sys_oper_type" :value="scope.row.businessType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('operlog.874509-2')" align="center" prop="operName" width="110" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']" />
|
||||
@@ -126,7 +65,7 @@
|
||||
<el-table-column :label="$t('operlog.874509-11')" align="center" prop="operLocation" :show-overflow-tooltip="true" />
|
||||
<el-table-column :label="$t('operlog.874509-30')" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.sys_common_status" :value="scope.row.status"/>
|
||||
<dict-tag :options="dict.type.sys_common_status" :value="scope.row.status" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('operlog.874509-12')" align="center" prop="operTime" width="160" sortable="custom" :sort-orders="['descending', 'ascending']">
|
||||
@@ -134,31 +73,19 @@
|
||||
<span>{{ parseTime(scope.row.operTime) }}</span>
|
||||
</template>
|
||||
</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">
|
||||
<span>{{ scope.row.costTime }}ms</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column :label="$t('opation')" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<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>
|
||||
<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>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<pagination 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>
|
||||
@@ -166,9 +93,7 @@
|
||||
<el-row>
|
||||
<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-16')"
|
||||
>{{ form.operName }} / {{ form.operIp }} / {{ form.operLocation }}</el-form-item>
|
||||
<el-form-item :label="$t('operlog.874509-16')">{{ form.operName }} / {{ form.operIp }} / {{ form.operLocation }}</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item :label="$t('operlog.874509-17')">{{ form.operUrl }}</el-form-item>
|
||||
@@ -208,10 +133,10 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { list, delOperlog, cleanOperlog } from "@/api/monitor/operlog";
|
||||
import { list, delOperlog, cleanOperlog } from '@/api/monitor/operlog';
|
||||
|
||||
export default {
|
||||
name: "Operlog",
|
||||
name: 'Operlog',
|
||||
dicts: ['sys_oper_type', 'sys_common_status'],
|
||||
data() {
|
||||
return {
|
||||
@@ -232,7 +157,7 @@ export default {
|
||||
// 日期范围
|
||||
dateRange: [],
|
||||
// 默认排序
|
||||
defaultSort: {prop: 'operTime', order: 'descending'},
|
||||
defaultSort: { prop: 'operTime', order: 'descending' },
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 查询参数
|
||||
@@ -243,8 +168,8 @@ export default {
|
||||
title: undefined,
|
||||
operName: undefined,
|
||||
businessType: undefined,
|
||||
status: undefined
|
||||
}
|
||||
status: undefined,
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@@ -254,12 +179,11 @@ export default {
|
||||
/** 查询登录日志 */
|
||||
getList() {
|
||||
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.total = response.total;
|
||||
this.loading = false;
|
||||
}
|
||||
);
|
||||
});
|
||||
},
|
||||
// 操作日志类型字典翻译
|
||||
typeFormat(row, column) {
|
||||
@@ -273,14 +197,14 @@ export default {
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.dateRange = [];
|
||||
this.resetForm("queryForm");
|
||||
this.resetForm('queryForm');
|
||||
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) {
|
||||
this.ids = selection.map(item => item.operId)
|
||||
this.multiple = !selection.length
|
||||
this.ids = selection.map((item) => item.operId);
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
/** 排序触发事件 */
|
||||
handleSortChange(column, prop, order) {
|
||||
@@ -296,29 +220,40 @@ export default {
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
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);
|
||||
}).then(() => {
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess(this.$t('delSuccess'));
|
||||
}).catch(() => {});
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 清空按钮操作 */
|
||||
handleClean() {
|
||||
this.$modal.confirm(this.$t('operlog.874509-28')).then(function() {
|
||||
this.$modal
|
||||
.confirm(this.$t('operlog.874509-28'))
|
||||
.then(function () {
|
||||
return cleanOperlog();
|
||||
}).then(() => {
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess(this.$t('operlog.874509-29'));
|
||||
}).catch(() => {});
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('monitor/operlog/export', {
|
||||
...this.queryParams
|
||||
}, `operlog_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
this.download(
|
||||
'monitor/operlog/export',
|
||||
{
|
||||
...this.queryParams,
|
||||
},
|
||||
`operlog_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -1,87 +1,129 @@
|
||||
<template>
|
||||
<div class="register">
|
||||
<el-row>
|
||||
<el-col :xs="24">
|
||||
<div
|
||||
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 class="register-wrap">
|
||||
<div class="logo-wrap">
|
||||
<img class="icon" src="@/assets/images/logo_blue.png" />
|
||||
<span class="text">{{ $t('login.989807-37') }}</span>
|
||||
</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 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>
|
||||
<el-form ref="registerForm" :model="registerForm" :rules="registerRules" class="register-form"
|
||||
style="z-index: 1000;">
|
||||
<el-form class="form-wrap" id="registerForm" ref="registerForm" :model="registerForm" :rules="registerRules">
|
||||
<el-form-item prop="username">
|
||||
<el-input v-model="registerForm.username" type="text" auto-complete="off" :placeholder="$t('login.989807-20')">
|
||||
<svg-icon slot="prefix" icon-class="user" class="el-input__icon input-icon" />
|
||||
</el-input>
|
||||
<div class="item-wrap">
|
||||
<div class="input-wrap">
|
||||
<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 prop="phonenumber">
|
||||
<el-input v-model="registerForm.phonenumber" type="text" auto-complete="off" :placeholder="$t('register.974236-14')">
|
||||
<svg-icon slot="prefix" icon-class="phone" class="el-input__icon input-icon" />
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
<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 class="item-wrap">
|
||||
<div class="input-wrap">
|
||||
<input class="inner" v-model="registerForm.phonenumber" auto-complete="off" type="text" :placeholder="$t('register.974236-14')" />
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item style="width: 100%">
|
||||
<el-button v-if="!bindAccount" :loading="loading" type="primary" style="width: 100%"
|
||||
@click.native.prevent="handleRegister">
|
||||
<el-form-item prop="password">
|
||||
<div class="item-wrap">
|
||||
<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-else>{{ $t('register.974236-5') }}</span>
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-link href="https://fastbee.cn/" :underline="false" target="_blank" style="float: left">{{ $t('login.989807-41') }}</el-link>
|
||||
<el-link href="https://fastbee.cn/doc" :underline="false" target="_blank"
|
||||
style="float: left; margin-left: 20px">{{ $t('login.989807-40') }}</el-link>
|
||||
<router-link :to="{ path: '/login', query: this.$route.query }"
|
||||
style="float: left; margin-left: 20px">{{ $t('register.974236-9') }}</router-link>
|
||||
</el-form-item>
|
||||
|
||||
<div class="other-link">
|
||||
<span class="text" @click="handleGotoLogin">{{ $t('register.974236-9') }}</span>
|
||||
<el-divider direction="vertical" v-if="systemForm.document"></el-divider>
|
||||
<span class="text" @click="handleGotoDoc" v-if="systemForm.document">{{ $t('login.989807-40') }}</span>
|
||||
<el-divider direction="vertical" v-if="systemForm.website"></el-divider>
|
||||
<span class="text" @click="handleGotoOS" v-if="systemForm.website">{{ $t('login.989807-41') }}</span>
|
||||
</div>
|
||||
</el-form>
|
||||
</el-col>
|
||||
</el-row>
|
||||
<!-- 底部 -->
|
||||
<div class="el-register-footer">
|
||||
</div>
|
||||
|
||||
<!-- 绑定账号提示 -->
|
||||
<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>
|
||||
Copyright © 2021-2025
|
||||
Copyright © 2021-2026
|
||||
<a target="_blank" href="http://fastbee.cn">FastBee</a>
|
||||
All Rights Reserved.
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import 'element-ui/lib/theme-chalk/display.css';
|
||||
import logo from '@/assets/logo/logo.gif';
|
||||
import { getCodeImg, checkBindId, bindRegister } from '@/api/login';
|
||||
import { getCodeImg, checkBindId, getErrorMsg, socialLogin } from '@/api/login';
|
||||
import { register } from '@/api/iot/tool';
|
||||
import { setToken } from '@/utils/auth';
|
||||
import langSelect from '@/layout/components/langSelect';
|
||||
|
||||
export default {
|
||||
name: 'Register',
|
||||
components: { langSelect },
|
||||
data() {
|
||||
const equalToPassword = (rule, value, callback) => {
|
||||
if (this.registerForm.password !== value) {
|
||||
@@ -91,7 +133,8 @@ export default {
|
||||
}
|
||||
};
|
||||
return {
|
||||
logo,
|
||||
formIndex: 1, // 1 注册表单
|
||||
pwdtype: 'password', // 控制密码可见
|
||||
codeUrl: '',
|
||||
registerForm: {
|
||||
username: '',
|
||||
@@ -101,6 +144,7 @@ export default {
|
||||
code: '',
|
||||
uuid: '',
|
||||
bindId: '',
|
||||
agree: false, // 同意隐私协议
|
||||
},
|
||||
registerRules: {
|
||||
username: [
|
||||
@@ -144,15 +188,14 @@ export default {
|
||||
{
|
||||
trigger: 'blur',
|
||||
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)) {
|
||||
callback(new Error(this.$t('login.989807-62')))
|
||||
}
|
||||
else {
|
||||
callback()
|
||||
}
|
||||
callback(new Error(this.$t('login.989807-62')));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
confirmPassword: [
|
||||
{
|
||||
@@ -175,15 +218,57 @@ export default {
|
||||
],
|
||||
},
|
||||
loading: false,
|
||||
// 验证码开关
|
||||
captchaOnOff: true,
|
||||
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() {
|
||||
this.checkBind();
|
||||
const { loginId } = this.$route.query;
|
||||
if (!loginId) {
|
||||
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: {
|
||||
// 显示|隐藏密码
|
||||
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() {
|
||||
const query = this.$route.query;
|
||||
const bindId = query.bindId;
|
||||
@@ -204,15 +289,50 @@ export default {
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
getCode() {
|
||||
getCodeImg().then((res) => {
|
||||
this.captchaOnOff = res.captchaOnOff === undefined ? true : res.captchaOnOff;
|
||||
if (this.captchaOnOff) {
|
||||
this.codeUrl = 'data:image/gif;base64,' + res.img;
|
||||
this.registerForm.uuid = res.uuid;
|
||||
// 检查错误信息
|
||||
checkError() {
|
||||
const { errorId } = this.$route.query;
|
||||
if (errorId) {
|
||||
getErrorMsg(errorId).then((res) => {
|
||||
if (res.code === 200) {
|
||||
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() {
|
||||
window.location.href = 'http://localhost:8080/auth/render/qq';
|
||||
@@ -229,6 +349,15 @@ export default {
|
||||
});
|
||||
},
|
||||
handleRegister() {
|
||||
// 验證是否同意隱私協議
|
||||
if (!this.registerForm.agree) {
|
||||
this.$message({
|
||||
type: 'warning',
|
||||
message: this.$t('login.989807-58'),
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
this.$refs.registerForm.validate((valid) => {
|
||||
if (valid) {
|
||||
this.loading = true;
|
||||
@@ -260,65 +389,210 @@ export default {
|
||||
},
|
||||
innerRegister(res) {
|
||||
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,
|
||||
type: 'success',
|
||||
})
|
||||
.then(() => {
|
||||
this.$router.push('/login');
|
||||
})
|
||||
.catch(() => { });
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.register {
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
<style lang="scss" scoped>
|
||||
.register-wrap {
|
||||
user-select: none;
|
||||
height: 100vh;
|
||||
max-width: 100%;
|
||||
width: 100vw;
|
||||
display: flex;
|
||||
|
||||
.register-form {
|
||||
margin: 30px auto 0 auto;
|
||||
padding: 15px;
|
||||
z-index: 1000;
|
||||
max-width: 350px;
|
||||
.logo-wrap {
|
||||
position: absolute;
|
||||
top: 80px;
|
||||
left: 80px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
|
||||
input {
|
||||
height: 38px;
|
||||
background-color: #f1f1f1;
|
||||
color: #666;
|
||||
.icon {
|
||||
width: 42px;
|
||||
height: 46px;
|
||||
}
|
||||
|
||||
.input-icon {
|
||||
height: 39px;
|
||||
width: 14px;
|
||||
margin-left: 2px;
|
||||
.text {
|
||||
font-size: 36px;
|
||||
font-weight: 500;
|
||||
margin-left: 12px;
|
||||
color: #486ff2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.register-code {
|
||||
width: 33%;
|
||||
float: right;
|
||||
.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 {
|
||||
.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;
|
||||
vertical-align: middle;
|
||||
border-radius: 3px;
|
||||
height: 38px;
|
||||
|
||||
::v-deep .el-dropdown {
|
||||
font-weight: 400;
|
||||
font-size: 14px;
|
||||
color: #909399;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.form-wrap {
|
||||
::v-deep .el-form-item {
|
||||
margin-bottom: 21px;
|
||||
|
||||
.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%;
|
||||
|
||||
.inner {
|
||||
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;
|
||||
color: #909399;
|
||||
line-height: 20px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.el-register-footer {
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
color: #333;
|
||||
font-family: Arial;
|
||||
font-size: 12px;
|
||||
letter-spacing: 1px;
|
||||
}</style>
|
||||
</style>
|
||||
|
||||
@@ -79,7 +79,7 @@
|
||||
</el-form-item>
|
||||
<el-form-item prop="roleKey">
|
||||
<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>
|
||||
</el-tooltip>
|
||||
{{ $t('role.index.094567-0') }}
|
||||
|
||||
@@ -197,7 +197,7 @@ export default {
|
||||
},
|
||||
};
|
||||
</script>
|
||||
<styule lang="scss">
|
||||
<style lang="scss">
|
||||
// 自定义二维码样式
|
||||
.impowerBox .title {
|
||||
display: none;
|
||||
@@ -214,4 +214,4 @@ export default {
|
||||
.impowerBox .status {
|
||||
display: none;
|
||||
}
|
||||
</styule>
|
||||
</style>
|
||||
|
||||
@@ -1,55 +1,82 @@
|
||||
<script>
|
||||
import draggable from 'vuedraggable'
|
||||
import render from '@/utils/generator/render'
|
||||
import draggable from 'vuedraggable';
|
||||
import render from '@/utils/generator/render';
|
||||
|
||||
const components = {
|
||||
itemBtns(h, element, index, parent) {
|
||||
const { copyItem, deleteItem } = this.$listeners
|
||||
const { copyItem, deleteItem } = this.$listeners;
|
||||
return [
|
||||
<span class="drawing-item-copy" title={this.$i18n.t('tool.build.index.670906-13')} onClick={event => {
|
||||
copyItem(element, parent); event.stopPropagation()
|
||||
}}>
|
||||
<span
|
||||
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" />
|
||||
</span>,
|
||||
<span class="drawing-item-delete" title={this.$i18n.t('tool.build.index.670906-14')} onClick={event => {
|
||||
deleteItem(index, parent); event.stopPropagation()
|
||||
}}>
|
||||
<span
|
||||
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" />
|
||||
</span>
|
||||
]
|
||||
}
|
||||
}
|
||||
</span>,
|
||||
];
|
||||
},
|
||||
};
|
||||
const layouts = {
|
||||
colFormItem(h, element, index, parent) {
|
||||
const { activeItem } = this.$listeners
|
||||
let className = this.activeId === element.formId ? 'drawing-item active-from-item' : 'drawing-item'
|
||||
if (this.formConf.unFocusedComponentBorder) className += ' unfocus-bordered'
|
||||
const { activeItem } = this.$listeners;
|
||||
let className = this.activeId === element.formId ? 'drawing-item active-from-item' : 'drawing-item';
|
||||
if (this.formConf.unFocusedComponentBorder) className += ' unfocus-bordered';
|
||||
return (
|
||||
<el-col span={element.span} class={className}
|
||||
nativeOnClick={event => { activeItem(element); 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-col
|
||||
span={element.span}
|
||||
class={className}
|
||||
nativeOnClick={(event) => {
|
||||
activeItem(element);
|
||||
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>
|
||||
{components.itemBtns.apply(this, arguments)}
|
||||
</el-col>
|
||||
)
|
||||
);
|
||||
},
|
||||
rowFormItem(h, element, index, parent) {
|
||||
const { activeItem } = this.$listeners
|
||||
const className = this.activeId === element.formId ? 'drawing-row-item active-from-item' : 'drawing-row-item'
|
||||
let child = renderChildren.apply(this, arguments)
|
||||
const { activeItem } = this.$listeners;
|
||||
const className = this.activeId === element.formId ? 'drawing-row-item active-from-item' : 'drawing-row-item';
|
||||
let child = renderChildren.apply(this, arguments);
|
||||
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}
|
||||
</el-row>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<el-col span={element.span}>
|
||||
<el-row gutter={element.gutter} class={className}
|
||||
nativeOnClick={event => { activeItem(element); event.stopPropagation() }}>
|
||||
<el-row
|
||||
gutter={element.gutter}
|
||||
class={className}
|
||||
nativeOnClick={(event) => {
|
||||
activeItem(element);
|
||||
event.stopPropagation();
|
||||
}}
|
||||
>
|
||||
<span class="component-name">{element.componentName}</span>
|
||||
<draggable list={element.children} animation={340} group="componentsGroup" class="drag-wrapper">
|
||||
{child}
|
||||
@@ -57,44 +84,38 @@ const layouts = {
|
||||
{components.itemBtns.apply(this, arguments)}
|
||||
</el-row>
|
||||
</el-col>
|
||||
)
|
||||
}
|
||||
}
|
||||
);
|
||||
},
|
||||
};
|
||||
|
||||
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) => {
|
||||
const layout = layouts[el.layout]
|
||||
const layout = layouts[el.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() {
|
||||
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 {
|
||||
components: {
|
||||
render,
|
||||
draggable
|
||||
draggable,
|
||||
},
|
||||
props: [
|
||||
'element',
|
||||
'index',
|
||||
'drawingList',
|
||||
'activeId',
|
||||
'formConf'
|
||||
],
|
||||
props: ['element', 'index', 'drawingList', 'activeId', 'formConf'],
|
||||
render(h) {
|
||||
const layout = layouts[this.element.layout]
|
||||
const layout = layouts[this.element.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>
|
||||
|
||||
@@ -469,7 +469,7 @@
|
||||
</el-form-item>
|
||||
|
||||
<template v-if="activeData.layoutTree">
|
||||
<el-divider>布局结构树</el-divider>
|
||||
<el-divider>{{ $t('tool.rightPanel.670907-123') }}</el-divider>
|
||||
<el-tree
|
||||
:data="[activeData]"
|
||||
:props="layoutTreeProps"
|
||||
@@ -487,7 +487,7 @@
|
||||
</template>
|
||||
|
||||
<template v-if="activeData.layout === 'colFormItem' && activeData.tag !== 'el-button'">
|
||||
<el-divider>正则校验</el-divider>
|
||||
<el-divider>{{ $t('tool.rightPanel.670907-124') }}</el-divider>
|
||||
<div
|
||||
v-for="(item, index) in activeData.regList"
|
||||
:key="index"
|
||||
@@ -496,77 +496,77 @@
|
||||
<span class="close-btn" @click="activeData.regList.splice(index, 1)">
|
||||
<i class="el-icon-close" />
|
||||
</span>
|
||||
<el-form-item label="表达式">
|
||||
<el-input v-model="item.pattern" placeholder="请输入正则" />
|
||||
<el-form-item :label="$t('tool.rightPanel.670907-125')">
|
||||
<el-input v-model="item.pattern" :placeholder="$t('tool.rightPanel.670907-126')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="错误提示" style="margin-bottom:0">
|
||||
<el-input v-model="item.message" placeholder="请输入错误提示" />
|
||||
<el-form-item :label="$t('tool.rightPanel.670907-127')" style="margin-bottom:0">
|
||||
<el-input v-model="item.message" :placeholder="$t('tool.rightPanel.670907-128')" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div style="margin-left: 20px">
|
||||
<el-button icon="el-icon-circle-plus-outline" type="text" @click="addReg">
|
||||
添加规则
|
||||
{{ $t('tool.rightPanel.670907-129') }}
|
||||
</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-form>
|
||||
<!-- 表单属性 -->
|
||||
<el-form v-show="currentTab === 'form'" size="small" label-width="90px">
|
||||
<el-form-item label="表单名">
|
||||
<el-input v-model="formConf.formRef" placeholder="请输入表单名(ref)" />
|
||||
<el-form-item :label="$t('tool.rightPanel.670907-130')">
|
||||
<el-input v-model="formConf.formRef" :placeholder="$t('tool.rightPanel.670907-131')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="表单模型">
|
||||
<el-input v-model="formConf.formModel" placeholder="请输入数据模型" />
|
||||
<el-form-item :label="$t('tool.rightPanel.670907-132')">
|
||||
<el-input v-model="formConf.formModel" :placeholder="$t('tool.rightPanel.670907-133')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="校验模型">
|
||||
<el-input v-model="formConf.formRules" placeholder="请输入校验模型" />
|
||||
<el-form-item :label="$t('tool.rightPanel.670907-134')">
|
||||
<el-input v-model="formConf.formRules" :placeholder="$t('tool.rightPanel.670907-135')" />
|
||||
</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-button label="medium">
|
||||
中等
|
||||
{{ $t('tool.rightPanel.670907-107') }}
|
||||
</el-radio-button>
|
||||
<el-radio-button label="small">
|
||||
较小
|
||||
{{ $t('tool.rightPanel.670907-108') }}
|
||||
</el-radio-button>
|
||||
<el-radio-button label="mini">
|
||||
迷你
|
||||
{{ $t('tool.rightPanel.670907-109') }}
|
||||
</el-radio-button>
|
||||
</el-radio-group>
|
||||
</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-button label="left">
|
||||
左对齐
|
||||
{{ $t('tool.rightPanel.670907-138') }}
|
||||
</el-radio-button>
|
||||
<el-radio-button label="right">
|
||||
右对齐
|
||||
{{ $t('tool.rightPanel.670907-139') }}
|
||||
</el-radio-button>
|
||||
<el-radio-button label="top">
|
||||
顶部对齐
|
||||
{{ $t('tool.rightPanel.670907-140') }}
|
||||
</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="标签宽度">
|
||||
<el-input-number v-model="formConf.labelWidth" placeholder="标签宽度" />
|
||||
<el-form-item :label="$t('tool.rightPanel.670907-20')">
|
||||
<el-input-number v-model="formConf.labelWidth" :placeholder="$t('tool.rightPanel.670907-21')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="栅格间隔">
|
||||
<el-input-number v-model="formConf.gutter" :min="0" placeholder="栅格间隔" />
|
||||
<el-form-item :label="$t('tool.rightPanel.670907-15')">
|
||||
<el-input-number v-model="formConf.gutter" :min="0" :placeholder="$t('tool.rightPanel.670907-15')" />
|
||||
</el-form-item>
|
||||
<el-form-item label="禁用表单">
|
||||
<el-form-item :label="$t('tool.rightPanel.670907-141')">
|
||||
<el-switch v-model="formConf.disabled" />
|
||||
</el-form-item>
|
||||
<el-form-item label="表单按钮">
|
||||
<el-form-item :label="$t('tool.rightPanel.670907-142')">
|
||||
<el-switch v-model="formConf.formBtns" />
|
||||
</el-form-item>
|
||||
<el-form-item label="显示未选中组件边框">
|
||||
<el-form-item :label="$t('tool.rightPanel.670907-143')">
|
||||
<el-switch v-model="formConf.unFocusedComponentBorder" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-scrollbar>
|
||||
</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" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -4,21 +4,21 @@
|
||||
<span>{{ $t('tool.createTable.670904-1') }}</span>
|
||||
<el-input type="textarea" :rows="10" :placeholder="$t('tool.createTable.670904-2')" v-model="content"></el-input>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="handleCreateTable">{{ $t('common.confirm') }}</el-button>
|
||||
<el-button @click="visible = false">{{ $t('common.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="handleCreateTable">{{ $t('confirm') }}</el-button>
|
||||
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { createTable } from "@/api/tool/gen";
|
||||
import { createTable } from '@/api/tool/gen';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
visible: false,
|
||||
// 文本内容
|
||||
content: ""
|
||||
content: '',
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
@@ -28,18 +28,18 @@ export default {
|
||||
},
|
||||
/** 创建按钮操作 */
|
||||
handleCreateTable() {
|
||||
if (this.content === "") {
|
||||
if (this.content === '') {
|
||||
this.$modal.msgError(this.$i18n.t('tool.createTable.670904-3'));
|
||||
return;
|
||||
}
|
||||
createTable({ sql: this.content }).then(res => {
|
||||
createTable({ sql: this.content }).then((res) => {
|
||||
this.$modal.msgSuccess(res.msg);
|
||||
if (res.code === 200) {
|
||||
this.visible = false;
|
||||
this.$emit("ok");
|
||||
this.$emit('ok');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -8,24 +8,14 @@
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('tool.import.670901-3')" prop="tableName">
|
||||
<el-input
|
||||
v-model="queryParams.tableName"
|
||||
:placeholder="$t('tool.import.670901-4')"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.tableName" :placeholder="$t('tool.import.670901-4')" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('tool.import.670901-5')" prop="tableComment">
|
||||
<el-input
|
||||
v-model="queryParams.tableComment"
|
||||
:placeholder="$t('tool.import.670901-6')"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.tableComment" :placeholder="$t('tool.import.670901-6')" clearable @keyup.enter.native="handleQuery" />
|
||||
</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 icon="el-icon-refresh" size="mini" @click="resetQuery">{{ $t('common.reset') }}</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('reset') }}</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-row>
|
||||
@@ -36,17 +26,11 @@
|
||||
<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>
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
</el-row>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="handleImportTable">{{ $t('common.confirm') }}</el-button>
|
||||
<el-button @click="visible = false">{{ $t('common.cancel') }}</el-button>
|
||||
<el-button type="primary" @click="handleImportTable">{{ $t('confirm') }}</el-button>
|
||||
<el-button @click="visible = false">{{ $t('cancel') }}</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</template>
|
||||
@@ -72,7 +56,7 @@ export default {
|
||||
tableName: undefined,
|
||||
tableComment: undefined,
|
||||
dataName: 'master',
|
||||
}
|
||||
},
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
@@ -86,11 +70,11 @@ export default {
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.tables = selection.map(item => item.tableName);
|
||||
this.tables = selection.map((item) => item.tableName);
|
||||
},
|
||||
// 查询表数据
|
||||
getList() {
|
||||
listDbTable(this.queryParams).then(res => {
|
||||
listDbTable(this.queryParams).then((res) => {
|
||||
if (res.code === 200) {
|
||||
this.dbTableList = res.rows;
|
||||
this.total = res.total;
|
||||
@@ -112,7 +96,7 @@ export default {
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.resetForm('queryForm');
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 导入按钮操作 */
|
||||
@@ -130,10 +114,10 @@ export default {
|
||||
this.$modal.msgSuccess(res.msg);
|
||||
if (res.code === 200) {
|
||||
this.visible = false;
|
||||
this.$emit("ok");
|
||||
this.$emit('ok');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -2,20 +2,10 @@
|
||||
<div class="app-container">
|
||||
<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-input
|
||||
v-model="queryParams.tableName"
|
||||
:placeholder="$t('gen.import.832346-2')"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.tableName" :placeholder="$t('gen.import.832346-2')" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('gen.import.832346-3')" prop="tableComment">
|
||||
<el-input
|
||||
v-model="queryParams.tableComment"
|
||||
:placeholder="$t('gen.import.832346-4')"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-input v-model="queryParams.tableComment" :placeholder="$t('gen.import.832346-4')" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item :label="$t('creatTime')">
|
||||
<el-date-picker
|
||||
@@ -36,57 +26,19 @@
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<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-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 :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="el-icon-plus"
|
||||
size="mini"
|
||||
@click="openCreateTable"
|
||||
v-hasRole="['admin']"
|
||||
>{{ $t('add') }}</el-button>
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="openCreateTable" v-hasRole="['admin']">{{ $t('add') }}</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="info"
|
||||
plain
|
||||
icon="el-icon-upload"
|
||||
size="mini"
|
||||
@click="openImportTable"
|
||||
v-hasPermi="['tool:gen:import']"
|
||||
>{{ $t('import') }}</el-button>
|
||||
<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 :span="1.5">
|
||||
<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-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 :span="1.5">
|
||||
<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-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>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
@@ -95,89 +47,30 @@
|
||||
<el-table-column type="selection" align="center" width="55"></el-table-column>
|
||||
<el-table-column :label="$t('system.cache.list.093478-1')" type="index" width="50" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
|
||||
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
:label="$t('gen.import.832346-1')"
|
||||
align="center"
|
||||
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('gen.import.832346-1')" align="center" 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('updateTime')" align="center" prop="updateTime" width="160" />
|
||||
<el-table-column :label="$t('opation')" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
type="text"
|
||||
size="small"
|
||||
icon="el-icon-view"
|
||||
@click="handlePreview(scope.row)"
|
||||
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>
|
||||
<el-button type="text" size="small" icon="el-icon-view" @click="handlePreview(scope.row)" 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>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination
|
||||
v-show="total>0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
<!-- Preview -->
|
||||
<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-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"
|
||||
>
|
||||
<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-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">
|
||||
<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>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
@@ -188,27 +81,27 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listTable, previewTable, delTable, genCode, synchDb } from "@/api/tool/gen";
|
||||
import importTable from "./importTable";
|
||||
import createTable from "./createTable";
|
||||
import hljs from "highlight.js/lib/highlight";
|
||||
import "highlight.js/styles/github-gist.css";
|
||||
hljs.registerLanguage("java", require("highlight.js/lib/languages/java"));
|
||||
hljs.registerLanguage("xml", 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("javascript", require("highlight.js/lib/languages/javascript"));
|
||||
hljs.registerLanguage("sql", require("highlight.js/lib/languages/sql"));
|
||||
import { listTable, previewTable, delTable, genCode, synchDb } from '@/api/tool/gen';
|
||||
import importTable from './importTable';
|
||||
import createTable from './createTable';
|
||||
import hljs from 'highlight.js/lib/highlight';
|
||||
import 'highlight.js/styles/github-gist.css';
|
||||
hljs.registerLanguage('java', require('highlight.js/lib/languages/java'));
|
||||
hljs.registerLanguage('xml', 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('javascript', require('highlight.js/lib/languages/javascript'));
|
||||
hljs.registerLanguage('sql', require('highlight.js/lib/languages/sql'));
|
||||
|
||||
export default {
|
||||
name: "Gen",
|
||||
name: 'Gen',
|
||||
components: { importTable, createTable },
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 唯一标识符
|
||||
uniqueId: "",
|
||||
uniqueId: '',
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 选中表数组
|
||||
@@ -224,21 +117,21 @@ export default {
|
||||
// 表数据
|
||||
tableList: [],
|
||||
// 日期范围
|
||||
dateRange: "",
|
||||
dateRange: '',
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
tableName: undefined,
|
||||
tableComment: undefined
|
||||
tableComment: undefined,
|
||||
},
|
||||
// 预览参数
|
||||
preview: {
|
||||
open: false,
|
||||
title: this.$t('gen.index.467583-5'),
|
||||
data: {},
|
||||
activeName: "domain.java"
|
||||
}
|
||||
activeName: 'domain.java',
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
@@ -256,12 +149,11 @@ export default {
|
||||
/** 查询表集合 */
|
||||
getList() {
|
||||
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.total = response.total;
|
||||
this.loading = false;
|
||||
}
|
||||
);
|
||||
});
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
@@ -271,26 +163,30 @@ export default {
|
||||
/** 生成代码操作 */
|
||||
handleGenTable(row) {
|
||||
const tableNames = row.tableName || this.tableNames;
|
||||
if (tableNames == "") {
|
||||
if (tableNames == '') {
|
||||
this.$modal.msgError(this.$t('gen.index.467583-6'));
|
||||
return;
|
||||
}
|
||||
if(row.genType === "1") {
|
||||
genCode(row.tableName).then(response => {
|
||||
if (row.genType === '1') {
|
||||
genCode(row.tableName).then((response) => {
|
||||
this.$modal.msgSuccess(this.$t('gen.index.467583-7') + row.genPath);
|
||||
});
|
||||
} else {
|
||||
this.$download.zip("/tool/gen/batchGenCode?tables=" + tableNames, "ruoyi.zip");
|
||||
this.$download.zip('/tool/gen/batchGenCode?tables=' + tableNames, 'ruoyi.zip');
|
||||
}
|
||||
},
|
||||
/** 同步数据库操作 */
|
||||
handleSynchDb(row) {
|
||||
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);
|
||||
}).then(() => {
|
||||
})
|
||||
.then(() => {
|
||||
this.$modal.msgSuccess(this.$t('gen.index.467583-10'));
|
||||
}).catch(() => {});
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
/** 打开导入表弹窗 */
|
||||
openImportTable() {
|
||||
@@ -303,22 +199,22 @@ export default {
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.dateRange = [];
|
||||
this.resetForm("queryForm");
|
||||
this.resetForm('queryForm');
|
||||
this.handleQuery();
|
||||
},
|
||||
/** 预览按钮 */
|
||||
handlePreview(row) {
|
||||
previewTable(row.tableId).then(response => {
|
||||
previewTable(row.tableId).then((response) => {
|
||||
this.preview.data = response.data;
|
||||
this.preview.open = true;
|
||||
this.preview.activeName = "domain.java";
|
||||
this.preview.activeName = 'domain.java';
|
||||
});
|
||||
},
|
||||
/** 高亮显示 */
|
||||
highlightedCode(code, key) {
|
||||
const vmName = key.substring(key.lastIndexOf("/") + 1, key.indexOf(".vm"));
|
||||
var language = vmName.substring(vmName.indexOf(".") + 1, vmName.length);
|
||||
const result = hljs.highlight(language, code || "", true);
|
||||
const vmName = key.substring(key.lastIndexOf('/') + 1, key.indexOf('.vm'));
|
||||
var language = vmName.substring(vmName.indexOf('.') + 1, vmName.length);
|
||||
const result = hljs.highlight(language, code || '', true);
|
||||
return result.value || ' ';
|
||||
},
|
||||
/** 复制代码成功 */
|
||||
@@ -327,8 +223,8 @@ export default {
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.tableId);
|
||||
this.tableNames = selection.map(item => item.tableName);
|
||||
this.ids = selection.map((item) => item.tableId);
|
||||
this.tableNames = selection.map((item) => item.tableName);
|
||||
this.single = selection.length != 1;
|
||||
this.multiple = !selection.length;
|
||||
},
|
||||
@@ -337,13 +233,22 @@ export default {
|
||||
const tableId = row.tableId || this.ids[0];
|
||||
const tableName = row.tableName || this.tableNames[0];
|
||||
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) {
|
||||
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);
|
||||
}).then(() => {
|
||||
})
|
||||
.then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSucc
|
||||
this.$modal.msgSuccess(this.$t('delSuccess'));
|
||||
})
|
||||
.catch(() => {});
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user