fix: 产品仪表盘新增上传详情更改数据回显
This commit is contained in:
parent
f76f76965d
commit
708f93dc28
|
@ -228,7 +228,6 @@ const getOnline = () => {
|
|||
onlineYdata.reverse();
|
||||
setOnlineChartOpition(x, onlineYdata);
|
||||
onlineFooter.value[0].value = y?.[1];
|
||||
console.log(res.result);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
@ -41,19 +41,21 @@
|
|||
</j-descriptions>
|
||||
</j-card>
|
||||
<!-- 编辑 -->
|
||||
<Save ref="saveRef" :isAdd="isAdd" :title="title" />
|
||||
<Save ref="saveRef" :isAdd="isAdd" :title="title" @success="refresh"/>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { useProductStore } from '@/store/product';
|
||||
import Save from '../../Save/index.vue';
|
||||
import moment from 'moment';
|
||||
import { useRoute } from 'vue-router';
|
||||
import {
|
||||
EditOutlined,
|
||||
DeleteOutlined,
|
||||
PlusOutlined,
|
||||
} from '@ant-design/icons-vue';
|
||||
const productStore = useProductStore();
|
||||
const route = useRoute();
|
||||
const saveRef = ref();
|
||||
const isAdd = ref(2);
|
||||
const title = ref('编辑');
|
||||
|
@ -69,4 +71,10 @@ const editConfig = () => {
|
|||
const changeTables = () => {
|
||||
productStore.tabActiveKey = 'Device';
|
||||
};
|
||||
/**
|
||||
* 修改成功刷新
|
||||
*/
|
||||
const refresh = () =>{
|
||||
productStore.refresh(route.params.id as string);
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -151,7 +151,6 @@ watch(
|
|||
() => route.params.id,
|
||||
(newId) => {
|
||||
if (newId) {
|
||||
console.log(newId);
|
||||
productStore.tabActiveKey = 'Info';
|
||||
productStore.refresh(newId as string);
|
||||
}
|
||||
|
@ -230,7 +229,7 @@ const getProtocol = async () => {
|
|||
* 详情页跳转到设备页
|
||||
*/
|
||||
const jumpDevice = () => {
|
||||
console.log(productStore.current?.id);
|
||||
// console.log(productStore.current?.id);
|
||||
const searchParams = {
|
||||
column: 'productId',
|
||||
termType: 'eq',
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
<div class="product-title">产品创建成功</div>
|
||||
</div>
|
||||
<div style="display: flex">
|
||||
<div class="product-id">产品ID: {{ idValue.value }}</div>
|
||||
<div class="product-btn" @click="showDetail">查看详情</div>
|
||||
<div class="product-id">产品ID: {{ idValue }}</div>
|
||||
<div class="product-btn" @click="showDetail" style="cursor: pointer;">查看详情</div>
|
||||
</div>
|
||||
<div>接下来推荐操作:</div>
|
||||
<div class="product-main">1、配置产品接入方式</div>
|
||||
|
@ -49,10 +49,12 @@
|
|||
import { getImage } from '@/utils/comm.ts';
|
||||
import { useProductStore } from '@/store/product';
|
||||
import { CheckCircleOutlined } from '@ant-design/icons-vue';
|
||||
import { useMenuStore } from '@/store/menu';
|
||||
const visible = ref<boolean>(false);
|
||||
const productStore = useProductStore();
|
||||
const router = useRouter();
|
||||
const idValue = ref({});
|
||||
const menuStore = useMenuStore();
|
||||
/**
|
||||
* 弹窗关闭
|
||||
*/
|
||||
|
@ -70,17 +72,12 @@ const show = (id: string) => {
|
|||
* 查看详情
|
||||
*/
|
||||
const showDetail = () => {
|
||||
jump(idValue.value);
|
||||
};
|
||||
/**
|
||||
* 跳转页面
|
||||
*/
|
||||
const jump = (id: string) => {
|
||||
router.push('/iot/device/product/detail/' + id);
|
||||
menuStore.jumpPage('device/Product/Detail',{id:idValue.value})
|
||||
};
|
||||
defineExpose({
|
||||
show: show,
|
||||
});
|
||||
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.product-tips {
|
||||
|
|
|
@ -395,7 +395,7 @@ const submitData = () => {
|
|||
message.success('保存成功!');
|
||||
visible.value = false;
|
||||
emit('success');
|
||||
dialogRef.value.show(form.id);
|
||||
dialogRef.value.show(res.result.id);
|
||||
} else {
|
||||
message.error('操作失败');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue