|
@@ -79,7 +79,7 @@
|
|
</t-space>
|
|
</t-space>
|
|
<t-space direction="vertical" size="small" class="mt-8">
|
|
<t-space direction="vertical" size="small" class="mt-8">
|
|
<t-collapse
|
|
<t-collapse
|
|
- :defaultValue="['1']"
|
|
|
|
|
|
+ :defaultValue="['1', '2']"
|
|
expandIconPlacement="right"
|
|
expandIconPlacement="right"
|
|
:borderless="true"
|
|
:borderless="true"
|
|
>
|
|
>
|
|
@@ -131,6 +131,55 @@
|
|
</t-collapse-panel>
|
|
</t-collapse-panel>
|
|
<t-collapse-panel value="2" header="进阶设置">
|
|
<t-collapse-panel value="2" header="进阶设置">
|
|
<t-space direction="vertical" size="small">
|
|
<t-space direction="vertical" size="small">
|
|
|
|
+ <div class="form-item">
|
|
|
|
+ <label>
|
|
|
|
+ 图标URL
|
|
|
|
+ <span>
|
|
|
|
+ <label
|
|
|
|
+ class="vip-label"
|
|
|
|
+ style="font-size: 10px; padding: 0 2px"
|
|
|
|
+ >
|
|
|
|
+ VIP
|
|
|
|
+ </label>
|
|
|
|
+ </span>
|
|
|
|
+ </label>
|
|
|
|
+ <div class="px-8" style="width: 200px">
|
|
|
|
+ <template v-if="data.meta2dData.iconUrls">
|
|
|
|
+ <div
|
|
|
|
+ v-for="(icon, i) of data.meta2dData.iconUrls"
|
|
|
|
+ class="flex middle between"
|
|
|
|
+ style="height: 30px"
|
|
|
|
+ >
|
|
|
|
+ <div>
|
|
|
|
+ {{ icon.substring(0, 8) }}...{{ icon.substr(-16) }}
|
|
|
|
+ </div>
|
|
|
|
+ <t-icon
|
|
|
|
+ name="close"
|
|
|
|
+ class="hover"
|
|
|
|
+ @click="removeIconUrl(i)"
|
|
|
|
+ />
|
|
|
|
+ </div>
|
|
|
|
+ </template>
|
|
|
|
+ <div class="flex middle" v-if="user.isVip">
|
|
|
|
+ <t-input
|
|
|
|
+ v-model="data.iconUrl"
|
|
|
|
+ placeholder="Font class方式URL"
|
|
|
|
+ style="width: 150px; margin-left: -8px"
|
|
|
|
+ />
|
|
|
|
+ <t-button
|
|
|
|
+ theme="default"
|
|
|
|
+ style="padding: 4px 8px; margin-left: 8px"
|
|
|
|
+ @click="addIconUrl"
|
|
|
|
+ >
|
|
|
|
+ 添加
|
|
|
|
+ </t-button>
|
|
|
|
+ </div>
|
|
|
|
+ <div v-else class="desc mt-4">
|
|
|
|
+ 支持添加iconfont。
|
|
|
|
+ <a :href="assets.account" target="_blank">VIP</a> 功能
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
<div class="form-item">
|
|
<div class="form-item">
|
|
<label>初始化动作</label>
|
|
<label>初始化动作</label>
|
|
<t-button
|
|
<t-button
|
|
@@ -188,20 +237,28 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script lang="ts" setup>
|
|
<script lang="ts" setup>
|
|
-import { onMounted, reactive, onUnmounted, ref } from 'vue';
|
|
|
|
|
|
+import { onMounted, reactive, onUnmounted } from 'vue';
|
|
|
|
+import { useUser } from '@/services/user';
|
|
import { getCookie } from '@/services/cookie';
|
|
import { getCookie } from '@/services/cookie';
|
|
import ElementTree from './ElementTree.vue';
|
|
import ElementTree from './ElementTree.vue';
|
|
import CodeEditor from '@/views/components/common/CodeEditor.vue';
|
|
import CodeEditor from '@/views/components/common/CodeEditor.vue';
|
|
|
|
+import { autoSave, useAssets } from '@/services/common';
|
|
|
|
+import { MessagePlugin } from 'tdesign-vue-next';
|
|
|
|
|
|
const headers = {
|
|
const headers = {
|
|
Authorization: 'Bearer ' + (localStorage.token || getCookie('token') || ''),
|
|
Authorization: 'Bearer ' + (localStorage.token || getCookie('token') || ''),
|
|
};
|
|
};
|
|
const updataData = { directory: '/项目' };
|
|
const updataData = { directory: '/项目' };
|
|
|
|
|
|
|
|
+const { assets } = useAssets();
|
|
|
|
+
|
|
|
|
+const { user } = useUser();
|
|
|
|
+
|
|
const data = reactive<any>({
|
|
const data = reactive<any>({
|
|
tab: 1,
|
|
tab: 1,
|
|
background: [],
|
|
background: [],
|
|
meta2dData: {},
|
|
meta2dData: {},
|
|
|
|
+ iconUrl: '',
|
|
});
|
|
});
|
|
|
|
|
|
const screenList = reactive([
|
|
const screenList = reactive([
|
|
@@ -331,6 +388,28 @@ const onOkDataTransformation = () => {
|
|
meta2d.store.data.socketCbJs = dataTransformationDialog.data;
|
|
meta2d.store.data.socketCbJs = dataTransformationDialog.data;
|
|
dataTransformationDialog.show = false;
|
|
dataTransformationDialog.show = false;
|
|
};
|
|
};
|
|
|
|
+
|
|
|
|
+const addIconUrl = () => {
|
|
|
|
+ if (!data.iconUrl || data.iconUrl.substr(-4) !== '.css') {
|
|
|
|
+ MessagePlugin.error('请填写以.css结尾的font-class引用方式的URL地址');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ if (!data.meta2dData.iconUrls) {
|
|
|
|
+ data.meta2dData.iconUrls = [];
|
|
|
|
+ }
|
|
|
|
+ data.meta2dData.iconUrls.push(data.iconUrl);
|
|
|
|
+ // @ts-ignore
|
|
|
|
+ meta2d.store.data.iconUrls = data.meta2dData.iconUrls;
|
|
|
|
+ data.iconUrl = '';
|
|
|
|
+ autoSave(true);
|
|
|
|
+};
|
|
|
|
+
|
|
|
|
+const removeIconUrl = (i: number) => {
|
|
|
|
+ data.meta2dData.iconUrls.splice(i, 1);
|
|
|
|
+ // @ts-ignore
|
|
|
|
+ meta2d.store.data.iconUrls = data.meta2dData.iconUrls;
|
|
|
|
+ autoSave(true);
|
|
|
|
+};
|
|
</script>
|
|
</script>
|
|
<style lang="postcss" scoped>
|
|
<style lang="postcss" scoped>
|
|
.props {
|
|
.props {
|