|
@@ -4,8 +4,7 @@
|
|
|
<div class="content">
|
|
|
<byTable :source="sourceList.data" :pagination="sourceList.pagination" :config="config" :loading="loading" highlight-current-row
|
|
|
:selectConfig="selectConfig" :table-events="{
|
|
|
- //element talbe事件都能传
|
|
|
- select: select,
|
|
|
+
|
|
|
}" :action-list="[
|
|
|
{
|
|
|
text: '添加设备',
|
|
@@ -36,6 +35,7 @@ import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
import byTable from "@/components/byTable/index";
|
|
|
import byForm from "@/components/byForm/index";
|
|
|
import { computed, defineComponent, ref } from "vue";
|
|
|
+const { proxy } = getCurrentInstance();
|
|
|
const loading = ref(false);
|
|
|
const submitLoading = ref(false);
|
|
|
const sourceList = ref({
|
|
@@ -66,52 +66,46 @@ let rules = ref({
|
|
|
{ required: true, message: "请输入密钥", trigger: ["blur", "change"] },
|
|
|
],
|
|
|
});
|
|
|
-const { proxy } = getCurrentInstance();
|
|
|
-const selectConfig = reactive([
|
|
|
- {
|
|
|
- label: "行业名称",
|
|
|
- prop: "flowStatus",
|
|
|
- data: [],
|
|
|
- },
|
|
|
- {
|
|
|
- label: "产品名称",
|
|
|
- prop: "flowStatus",
|
|
|
- data: [],
|
|
|
- },
|
|
|
-]);
|
|
|
-
|
|
|
+const selectConfig = reactive([]);
|
|
|
const config = computed(() => {
|
|
|
return [
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "行业名称",
|
|
|
+ label: "设备编码",
|
|
|
prop: "appName",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "产品名称",
|
|
|
+ label: "设备名称",
|
|
|
prop: "productName",
|
|
|
align: "center",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "设备名称",
|
|
|
+ label: "规格型号",
|
|
|
prop: "deviceName",
|
|
|
align: "center",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "设备标识",
|
|
|
+ label: "制造商",
|
|
|
prop: "nodeId",
|
|
|
align: "center",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "密钥",
|
|
|
+ label: "制造商电话",
|
|
|
+ prop: "secret",
|
|
|
+ align: "center",
|
|
|
+ },
|
|
|
+ },
|
|
|
+ {
|
|
|
+ attrs: {
|
|
|
+ label: "备注",
|
|
|
prop: "secret",
|
|
|
align: "center",
|
|
|
},
|
|
@@ -119,8 +113,8 @@ const config = computed(() => {
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "操作",
|
|
|
- width: "200",
|
|
|
- align: "right",
|
|
|
+ width: "120",
|
|
|
+ align: "center",
|
|
|
},
|
|
|
// 渲染 el-button,一般用在最后一列。
|
|
|
renderHTML(row) {
|
|
@@ -178,56 +172,47 @@ const byform = ref(null);
|
|
|
const treeData = ref([]);
|
|
|
const formConfig = reactive([
|
|
|
{
|
|
|
- type: "select",
|
|
|
- prop: "copyTdaProductId",
|
|
|
- label: "行业名称",
|
|
|
+ type: "input",
|
|
|
+ prop: "deviceName",
|
|
|
+ label: "设备编码",
|
|
|
+ required: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "input",
|
|
|
+ prop: "deviceName",
|
|
|
+ label: "设备名称",
|
|
|
required: true,
|
|
|
- // isLoad: {
|
|
|
- // url: "/tdaApplication/page",
|
|
|
- // req: {
|
|
|
- // pageNum: 1,
|
|
|
- // pageSize: 9999,
|
|
|
- // },
|
|
|
- // labelKey: "appName",
|
|
|
- // labelVal: "id",
|
|
|
- // method: "post",
|
|
|
- // resUrl: "rows",
|
|
|
- // },
|
|
|
},
|
|
|
{
|
|
|
- type: "select",
|
|
|
- prop: "tdaProductId",
|
|
|
- label: "产品名称",
|
|
|
+ type: "input",
|
|
|
+ prop: "deviceName",
|
|
|
+ label: "规格型号",
|
|
|
required: true,
|
|
|
- data: [],
|
|
|
},
|
|
|
- // isLoad: {
|
|
|
- // url: "/tdaProduct/page",
|
|
|
- // req: {
|
|
|
- // pageNum: 1,
|
|
|
- // pageSize: 9999,
|
|
|
- // },
|
|
|
- // labelKey: "name",
|
|
|
- // labelVal: "id",
|
|
|
- // method: "post",
|
|
|
- // resUrl: "rows",
|
|
|
- // },
|
|
|
{
|
|
|
type: "input",
|
|
|
prop: "deviceName",
|
|
|
- label: "设备名称",
|
|
|
+ label: "制造商",
|
|
|
required: true,
|
|
|
},
|
|
|
{
|
|
|
type: "input",
|
|
|
+ prop: "deviceName",
|
|
|
+ label: "制造商电话",
|
|
|
+ required: true,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ type: "date",
|
|
|
+ itemType: "date",
|
|
|
prop: "nodeId",
|
|
|
- label: "设备标识",
|
|
|
+ label: "出厂日期",
|
|
|
required: true,
|
|
|
},
|
|
|
{
|
|
|
type: "input",
|
|
|
+ itemType: "textarea",
|
|
|
prop: "secret",
|
|
|
- label: "密钥",
|
|
|
+ label: "备注",
|
|
|
required: true,
|
|
|
},
|
|
|
]);
|
|
@@ -248,41 +233,6 @@ const openModal = () => {
|
|
|
modalType.value = "add";
|
|
|
formData.data = {};
|
|
|
};
|
|
|
-const selection = ref({
|
|
|
- data: [],
|
|
|
-});
|
|
|
-const select = (_selection, row) => {
|
|
|
- selection.value.data = _selection;
|
|
|
- console.log(_selection.length);
|
|
|
-};
|
|
|
-const openRoomModal = () => {
|
|
|
- roomDialogVisible.value = true;
|
|
|
-
|
|
|
- proxy
|
|
|
- .get("/tenantInfo/roleMenuTreeSelect/" + selection.value.data[0].tenantId)
|
|
|
- .then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- treeData.value = res.menus;
|
|
|
- formData.treeData = res.checkedKeys;
|
|
|
- tree.value.setCheckedKeys(res.checkedKeys);
|
|
|
- }
|
|
|
- });
|
|
|
-};
|
|
|
-const tree = ref(null);
|
|
|
-const submitTree = () => {
|
|
|
- proxy
|
|
|
- .post("/tenantInfo/bindingMenu", {
|
|
|
- tenantId: selection.value.data[0].tenantId,
|
|
|
- menuIdList: tree.value.getCheckedKeys(),
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- ElMessage({
|
|
|
- message: "保存成功",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- roomDialogVisible.value = false;
|
|
|
- });
|
|
|
-};
|
|
|
|
|
|
const submitForm = () => {
|
|
|
console.log(byform.value);
|
|
@@ -313,46 +263,7 @@ const getDtl = (row) => {
|
|
|
});
|
|
|
};
|
|
|
|
|
|
-const selectData = reactive({
|
|
|
- tradeList: [],
|
|
|
-});
|
|
|
-const getSelect = () => {
|
|
|
- proxy
|
|
|
- .post("/tdaApplication/page", { pageNum: 1, pageSize: 9999 })
|
|
|
- .then((message) => {
|
|
|
- selectData.tradeList = message.rows;
|
|
|
- formConfig[0].data = selectData.tradeList.map((x) => ({
|
|
|
- title: x.appName,
|
|
|
- value: x.id,
|
|
|
- }));
|
|
|
- // formConfig[1].data = selectData.tradeList.map((x) => ({
|
|
|
- // title: x.name,
|
|
|
- // value: x.id,
|
|
|
- // }));
|
|
|
- });
|
|
|
-};
|
|
|
-
|
|
|
-watch(
|
|
|
- () => formData.data.copyTdaProductId,
|
|
|
- (val, old) => {
|
|
|
- if (val) {
|
|
|
- proxy
|
|
|
- .post("/tdaProduct/page", {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 9999,
|
|
|
- tdaApplicationId: val,
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- formConfig[1].data = res.rows.map((x) => ({
|
|
|
- title: x.name,
|
|
|
- value: x.id,
|
|
|
- }));
|
|
|
- });
|
|
|
- }
|
|
|
- }
|
|
|
-);
|
|
|
getList();
|
|
|
-getSelect();
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|