Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
XieYongHong 2023-07-12 15:47:13 +08:00
commit 1d84c517d5
9 changed files with 56 additions and 36 deletions

View File

@ -123,7 +123,7 @@
placeholder="请选择功能"
v-model:value="modelRef.message.functionId"
show-search
@change="funcChange"
@change="(e) => funcChange(e)"
>
<j-select-option
v-for="i in metadata?.functions || []"
@ -216,12 +216,33 @@ const onPropertyChange = (val: string, flag?: boolean) => {
};
const onTypeChange = () => {
modelRef.message = {
properties: undefined,
functionId: undefined,
inputs: [],
value: undefined,
};
// ,
// modelRef.message = {
// properties: undefined,
// functionId: undefined,
// inputs: [],
// value: undefined,
// };
};
const funcChange = (val: string, _inputs?: any[]) => {
if (val) {
const arr =
props.metadata?.functions.find((item: any) => item.id === val)
?.inputs || [];
const list = arr.map((item: any) => {
const _item = _inputs?.find(i => i.id === item.id)
return {
id: item.id,
name: item.name,
value: undefined,
valueType: item?.valueType?.type,
..._item,
required: item?.expands?.required
};
});
modelRef.message.inputs = list;
}
};
watch(
@ -232,6 +253,9 @@ watch(
if (newVal?.message?.properties) {
onPropertyChange(newVal?.message?.properties, true);
}
if (newVal?.message?.functionId) {
funcChange(newVal?.message?.functionId, newVal?.message?.inputs);
}
}
},
{
@ -239,24 +263,6 @@ watch(
},
);
const funcChange = (val: string) => {
if (val) {
const arr =
props.metadata?.functions.find((item: any) => item.id === val)
?.inputs || [];
const list = arr.map((item: any) => {
return {
id: item.id,
name: item.name,
value: undefined,
valueType: item?.valueType?.type,
required: item?.expands?.required
};
});
modelRef.message.inputs = list;
}
};
const saveBtn = () =>
new Promise((resolve) => {
formRef.value

View File

@ -72,7 +72,7 @@ const queryChartsAggList = async () => {
{
property: prop.data.id,
alias: prop.data.id,
agg: agg.value,
agg: _type.value ? agg.value : 'COUNT',
},
],
query: {

View File

@ -22,7 +22,7 @@
:columns="columns"
:request="CascadeApi.queryChannelList"
:defaultParams="{
sorts: [{ name: 'name', order: 'desc' }],
sorts: [{ name: 'deviceName', order: 'asc' }, { name: 'name', order: 'asc' }],
terms: [
{
column: 'id',
@ -142,6 +142,7 @@ const columns = [
dataIndex: 'status',
key: 'status',
scopedSlots: true,
width: 150,
search: {
type: 'select',
options: [

View File

@ -212,6 +212,7 @@ const columns = [
dataIndex: 'status',
key: 'status',
scopedSlots: true,
width: 150,
search: {
type: 'select',
options: [
@ -226,6 +227,7 @@ const columns = [
{
title: '操作',
key: 'action',
width: 100,
scopedSlots: true,
},
];

View File

@ -428,6 +428,10 @@
required: true,
message: '请输入心跳周期',
},
{
pattern: /^[1-9]\d*$/,
message: '请输入1~10000的整数',
}
]"
>
<j-input-number
@ -450,6 +454,10 @@
required: true,
message: '请输入注册间隔',
},
{
pattern: /^[1-9]\d*$/,
message: '请输入1~10000的整数',
}
]"
>
<j-input-number

View File

@ -65,7 +65,7 @@ const createChart = () => {
left: maxY > 100000 ? 90 : 50,
right: '5%',
top: '5%',
bottom: '5%',
bottom: '10%',
},
tooltip: {
trigger: 'axis',
@ -199,7 +199,7 @@ watch(
.chart,
.no-data {
width: 100%;
min-height: calc(100vh - 430px);
min-height: calc(100vh - 450px);
}
.no-data {
display: flex;

View File

@ -35,11 +35,13 @@
/>
</j-col>
<j-col :span="24" class="dash-board-bottom">
<Card
title="播放数量(人次)"
:chartData="chartData"
@change="getPlayCount"
/>
<full-page>
<Card
title="播放数量(人次)"
:chartData="chartData"
@change="getPlayCount"
/>
</full-page>
</j-col>
</j-row>
</page-container>

View File

@ -302,8 +302,8 @@ const handleSubmit = () => {
};
}
const res = formData.value.id
? await ChannelApi.update(formData.value.id, extraFormData)
: await ChannelApi.save(extraFormData);
? await ChannelApi.update(formData.value.id, extraFormData).finally(() => {loading.value = false;})
: await ChannelApi.save(extraFormData).finally(() => {loading.value = false;});
if (res.success) {
onlyMessage('操作成功');
_vis.value = false;

View File

@ -191,6 +191,7 @@ const columns = [
dataIndex: 'status',
key: 'status',
scopedSlots: true,
width: 150,
search: {
type: 'select',
options: [