[],
},
});
+ const menuOptionsList = ref(props.menuOptions);
+ const reloadShow = ref(false);
+ if (props.menuOptions.length > 0 && props.menuOptions[0].key === 'GroupItem') {
+ reloadShow.value = true;
+ }
const chartLayoutStore = useChartLayoutStore();
const contentChartsItemBoxRef = ref();
@@ -150,11 +158,9 @@
// 双击添加
const dblclickHandle = async (item: ConfigType) => {
- console.log('双击添加', item);
if (item.disabled) return;
// 保存的分组,进行使用
if (item.key == 'GroupItem') {
- console.log('分组');
try {
loadingStart();
const recordCharts = item.json;
@@ -265,20 +271,52 @@
},
);
const deleteComponent = (item: ConfigType, index: number) => {
- props.menuOptions.splice(index, 1);
- customComponentSaveDelete({
- ids: item.id,
- }).then((res) => {
- if (res) {
- window['$message'].success(`删除成功`);
- } else {
- window['$message'].success(`删除失败`);
- }
+ Modal.confirm({
+ title: '是否确认删除?',
+ onCancel() {},
+ async onOk() {
+ await customComponentSaveDelete({
+ ids: item.id,
+ }).then((res) => {
+ if (res) {
+ props.menuOptions.splice(index, 1);
+ window['$message'].success(`删除成功`);
+ } else {
+ window['$message'].success(`删除失败`);
+ }
+ });
+ },
+ });
+ };
+ const getCustomComponentList = async () => {
+ const data = await customComponentList({
+ page: 1,
+ limit: 999,
+ });
+ let list = [];
+ data.items.forEach((item) => {
+ let obj = JSON.parse(item.content);
+ list.push({
+ ...obj,
+ id: item.id,
+ });
+ });
+ return list;
+ };
+ const reloadBtn = () => {
+ getCustomComponentList().then((res) => {
+ menuOptionsList.value = res;
});
};
diff --git a/src/views/chart/hooks/useContextMenu.hook.ts b/src/views/chart/hooks/useContextMenu.hook.ts
index 8aaeaea..a675dce 100644
--- a/src/views/chart/hooks/useContextMenu.hook.ts
+++ b/src/views/chart/hooks/useContextMenu.hook.ts
@@ -36,6 +36,9 @@ export const divider = (n: number = 3) => {
key: `d${n}`,
};
};
+const saveGroup = () => {
+ chartEditStore.setSaveGroupImgShow(true);
+};
// * 默认单组件选项
export const defaultOptions: MenuOptionsItemType[] = [
@@ -133,7 +136,8 @@ export const defaultOptions: MenuOptionsItemType[] = [
label: '保存至分组',
key: MenuEnum.SAVETOGROUP,
icon: renderIcon(GridIcon),
- fnHandle: chartEditStore.saveToGroup,
+ // fnHandle: chartEditStore.saveToGroup,
+ fnHandle: saveGroup,
},
];
diff --git a/src/views/chart/index.vue b/src/views/chart/index.vue
index 7424b3e..64de446 100644
--- a/src/views/chart/index.vue
+++ b/src/views/chart/index.vue
@@ -37,6 +37,59 @@
>
+
+
+
+
+ 上传组件预览图
+
+
+
+
+
+
+
+
+ 上传多组合组件预览图
+
+
+
+
+
+
+
+
+
+
+ 说明
+
+ 上传多组合组件预览图
+
+
+
+ 取消
+ 保存
+
+
+
+
+
@@ -46,10 +99,18 @@
import { useContextMenu } from './hooks/useContextMenu.hook';
import { useChartEditStore } from '@/store/modules/chartEditStore/chartEditStore';
import { useChartHistoryStore } from '@/store/modules/chartHistoryStore/chartHistoryStore';
- import { useDarkThemeHook, useThemeOverridesHook, useCode, useLang } from '@/hooks'
- import { NConfigProvider } from 'naive-ui'
+ import { useDarkThemeHook, useThemeOverridesHook, useCode, useLang } from '@/hooks';
+ import { NConfigProvider } from 'naive-ui';
+ import { icon } from '@/plugins';
+ import { ref } from 'vue';
+ import { useGlobSetting } from '@/hooks/setting';
+ import { uploadFile } from '@/api/demo/files';
+
+ const { apiUrl } = useGlobSetting();
+ const uploadFileUrl = apiUrl + '/api/Files/Upload';
+ const { DocumentTextIcon } = icon.ionicons5;
// 暗黑主题
- const darkNTheme = useDarkThemeHook()
+ const darkNTheme = useDarkThemeHook();
const chartHistoryStoreStore = useChartHistoryStore();
const chartEditStore = useChartEditStore();
@@ -85,6 +146,35 @@
},
{ passive: false },
);
+ const previewFileList = ref([]);
+ // 关闭弹窗
+ const closeModel = () => {
+ chartEditStore.setSaveGroupImgShow(false);
+ };
+ const filePath = ref();
+ // 保存多组合组件
+ const saveCopyData = () => {
+ if (!filePath.value) {
+ window['$message'].warning('预览图不能为空');
+ return;
+ }
+ chartEditStore.saveToGroup(filePath.value);
+ closeModel();
+ };
+ const beforeUpload = async (options) => {
+ const Loading = window['$loading'];
+ Loading && Loading.start();
+ let uploadParams = new FormData();
+ uploadParams.append('files', options.file.file);
+ const uploadRes = await uploadFile(uploadParams);
+ if (uploadRes.length > 0) {
+ window['$message'].success('上传成功!');
+ filePath.value = uploadRes[0].filePath;
+ Loading && Loading.finish();
+ } else {
+ window['$message'].error('上传失败!');
+ }
+ };
diff --git a/src/packages/components/Zhigan/Zhigan/WuRenJiFeiXingShuJu/config.ts b/src/packages/components/Zhigan/Zhigan/WuRenJiFeiXingShuJu/config.ts
index 5a5ff2c..1d31e7c 100644
--- a/src/packages/components/Zhigan/Zhigan/WuRenJiFeiXingShuJu/config.ts
+++ b/src/packages/components/Zhigan/Zhigan/WuRenJiFeiXingShuJu/config.ts
@@ -40,23 +40,6 @@ export const option = {
bottomComponentColor1: '#6FEF94',
bottomComponentColor2: '#A8F8C6',
},
- dataStyleClone: {
- iconColor1: '#B8FDB4',
- iconColor2: '#60EC8D',
- rectStrokeColor: '#00611A',
- rectFillColor: '#0A251E',
- gFillColor: '#4FE985',
-
- bottomFontColor1: '#A4F9AB',
- bottomFontColor2: '#FFFFFF',
- lineColor: '#A4F9AB',
- bottomFontColor3: '#FFFFFF',
-
- bottomComponentColor1: '#337D4E',
- bottomComponentColor2: '#2D593B',
- bottomLineColor1: '#6FEF94',
- bottomLineColor2: '#A8F8C6',
- }
}
export default class Config extends PublicConfigClass implements CreateComponentType {
diff --git a/src/packages/components/Zhigan/Zhigan/WuRenJiFeiXingShuJu/config.vue b/src/packages/components/Zhigan/Zhigan/WuRenJiFeiXingShuJu/config.vue
index fde4193..48f0a84 100644
--- a/src/packages/components/Zhigan/Zhigan/WuRenJiFeiXingShuJu/config.vue
+++ b/src/packages/components/Zhigan/Zhigan/WuRenJiFeiXingShuJu/config.vue
@@ -54,10 +54,7 @@
>
-
+
恢复默认
@@ -69,10 +66,7 @@
>
-
+
恢复默认
@@ -134,9 +128,7 @@
恢复默认
@@ -151,9 +143,7 @@
恢复默认
@@ -166,10 +156,7 @@
>
-
+
恢复默认
@@ -183,9 +170,7 @@
恢复默认
@@ -225,9 +210,7 @@
恢复默认
@@ -242,9 +225,7 @@
恢复默认
@@ -260,10 +241,7 @@
恢复默认
@@ -278,10 +256,7 @@
恢复默认
@@ -320,6 +295,24 @@
},
});
+ const dataStyleClone = {
+ iconColor1: '#B8FDB4',
+ iconColor2: '#60EC8D',
+ rectStrokeColor: '#00611A',
+ rectFillColor: '#0A251E',
+ gFillColor: '#4FE985',
+
+ bottomFontColor1: '#A4F9AB',
+ bottomFontColor2: '#FFFFFF',
+ lineColor: '#A4F9AB',
+ bottomFontColor3: '#FFFFFF',
+
+ bottomComponentColor1: '#337D4E',
+ bottomComponentColor2: '#2D593B',
+ bottomLineColor1: '#6FEF94',
+ bottomLineColor2: '#A8F8C6',
+ };
+
// 适应类型
const fitList = [
{
diff --git a/src/packages/components/Zhigan/Zhigan/WuRenJiShiShiHuaMian/config.ts b/src/packages/components/Zhigan/Zhigan/WuRenJiShiShiHuaMian/config.ts
index e6df4ad..4b01592 100644
--- a/src/packages/components/Zhigan/Zhigan/WuRenJiShiShiHuaMian/config.ts
+++ b/src/packages/components/Zhigan/Zhigan/WuRenJiShiShiHuaMian/config.ts
@@ -20,7 +20,7 @@ export const option = {
titleWidth: 181,
titleHeight: 30,
- videoloop: true, // 视频-循环播放
+ videoloop: false, // 视频-循环播放
videomuted: true, // 视频-静音
videofit: 'fill', // 视频-适应方式
videowidth: 181,
@@ -40,17 +40,6 @@ export const option = {
iconFillColor: '#0A251E',
iconBottomColor: '#0E4030',
},
- dataStyleClone:{
- borderColor: '#008000',
- titleColorStop1: '#1F6B55',
- titleColorStop2: '#0A392A',
- titleRightrColor: '#00611A',
- iconColorStop1: '#73F095',
- iconColorStop2: '#BBFDB5',
- iconStrokeColor: '#00611A',
- iconFillColor: '#0A251E',
- iconBottomColor: '#0E4030',
- }
}
export default class Config extends PublicConfigClass implements CreateComponentType {
diff --git a/src/packages/components/Zhigan/Zhigan/WuRenJiShiShiHuaMian/config.vue b/src/packages/components/Zhigan/Zhigan/WuRenJiShiShiHuaMian/config.vue
index 74f9172..d58b02b 100644
--- a/src/packages/components/Zhigan/Zhigan/WuRenJiShiShiHuaMian/config.vue
+++ b/src/packages/components/Zhigan/Zhigan/WuRenJiShiShiHuaMian/config.vue
@@ -25,7 +25,7 @@
/>
-
+ 编辑页面修改视频数据配置后,请在预览页面查看效果
@@ -69,7 +69,7 @@
恢复默认
@@ -101,7 +101,7 @@
恢复默认
@@ -116,7 +116,7 @@
恢复默认
@@ -131,9 +131,7 @@
恢复默认
@@ -148,7 +146,7 @@
恢复默认
@@ -163,7 +161,7 @@
恢复默认
@@ -178,7 +176,7 @@
恢复默认
@@ -193,7 +191,7 @@
恢复默认
@@ -208,7 +206,7 @@
恢复默认
@@ -294,4 +292,16 @@
label: 'none',
},
];
+
+ const dataStyleClone = {
+ borderColor: '#008000',
+ titleColorStop1: '#1F6B55',
+ titleColorStop2: '#0A392A',
+ titleRightrColor: '#00611A',
+ iconColorStop1: '#73F095',
+ iconColorStop2: '#BBFDB5',
+ iconStrokeColor: '#00611A',
+ iconFillColor: '#0A251E',
+ iconBottomColor: '#0E4030',
+ };
diff --git a/src/packages/components/Zhigan/Zhigan/WuRenJiShiShiHuaMian/data.json b/src/packages/components/Zhigan/Zhigan/WuRenJiShiShiHuaMian/data.json
index e02ba44..e3c702e 100644
--- a/src/packages/components/Zhigan/Zhigan/WuRenJiShiShiHuaMian/data.json
+++ b/src/packages/components/Zhigan/Zhigan/WuRenJiShiShiHuaMian/data.json
@@ -2,27 +2,27 @@
"source": [
{
"title":"DJA-72无人机监控画面",
- "videoUrl": "/src/assets/videos/earth.mp4"
+ "videoUrl": "http://221.2.83.254:7012/live/37130100181328000001.m3u8"
},
{
"title":"DJ-057无人机监控画面",
- "videoUrl": "/src/assets/videos/earth.mp4"
+ "videoUrl": "http://221.2.83.254:7012/live/37130100181328000001.m3u8"
},
{
"title":"DJA-20无人机监控画面",
- "videoUrl": "/src/assets/videos/earth.mp4"
+ "videoUrl": "http://221.2.83.254:7012/live/37130100181328000001.m3u8"
},
{
"title":"DJA-035无人机监控画面",
- "videoUrl": "/src/assets/videos/earth.mp4"
+ "videoUrl": "http://221.2.83.254:7012/live/37130100181328000001.m3u8"
},
{
"title":"DJA-11无人机监控画面",
- "videoUrl": "/src/assets/videos/earth.mp4"
+ "videoUrl": "http://221.2.83.254:7012/live/37130100181328000001.m3u8"
},
{
"title":"DJ-021无人机监控画面",
- "videoUrl": "/src/assets/videos/earth.mp4"
+ "videoUrl": "http://221.2.83.254:7012/live/37130100181328000001.m3u8"
}
]
}
diff --git a/src/packages/components/Zhigan/Zhigan/WuRenJiShiShiHuaMian/index.vue b/src/packages/components/Zhigan/Zhigan/WuRenJiShiShiHuaMian/index.vue
index 7e9a85e..b08228b 100644
--- a/src/packages/components/Zhigan/Zhigan/WuRenJiShiShiHuaMian/index.vue
+++ b/src/packages/components/Zhigan/Zhigan/WuRenJiShiShiHuaMian/index.vue
@@ -1,24 +1,40 @@