Commit 24ec6cb4 authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents 249dfd2c 2af0acbc
......@@ -35,6 +35,7 @@
"highlight.js": "^10.2.1",
"html2canvas": "^1.4.1",
"js-cookie": "^2.2.1",
"lodash": "^4.17.21",
"mockjs": "^1.1.0",
"moment": "^2.24.0",
"nanoid": "^4.0.0",
......
......@@ -3,8 +3,6 @@ import App from "./App.vue";
import { initRouter } from "./router";
import "./theme/index.less";
import Antd from "ant-design-vue";
// import Viser from 'viser-vue'
// import '@/mock'
import store from "./store";
import "animate.css/source/animate.css";
import "./assets/css/common.less";
......@@ -48,6 +46,9 @@ Vue.use(Viewer);
// moment 时间处理
import moment from "moment";
Vue.prototype.$moment = moment;
// 引入lodash
import lodash from "lodash";
Vue.prototype.$_ = lodash;
// nanoid
import { nanoid } from "nanoid";
Vue.prototype.$nanoid = nanoid;
......
......@@ -201,8 +201,8 @@ export default {
size: -1,
siteId: this.siteId,
});
let { data } = res.data.data;
if (res.data.code === 1) {
let { data } = res.data.data;
this.categoryList = data;
}
},
......@@ -287,8 +287,9 @@ export default {
this.siteVisible = true;
},
filterItems(appThemeName) {
if (!appThemeName) return;
let arr = this.categoryList.find((v) => v.id == appThemeName);
if (arr.length) {
if (arr) {
return arr.categoryName;
} else {
return "--";
......
......@@ -65,9 +65,9 @@
<template slot="img" slot-scope="text">
<img
v-if="text.img"
width="50"
:src="api2 + text.img"
@click="handlePreview('img', api2 + text.img)"
class="pre-item"
:src="filterRes(text.img)"
@click="handlePreview('img', text.img)"
/>
<span v-else>--</span>
</template>
......@@ -76,8 +76,8 @@
<video
v-if="text.video"
width="50"
:src="api2 + text.video"
@click="handlePreview('vidoe', api2 + text.video)"
:src="filterRes(text.video)"
@click="handlePreview('video', api2 + text.video)"
/>
<span v-else>--</span>
</template>
......@@ -241,7 +241,7 @@ export default {
return;
}
this.title = "新增";
let arr = JSON.parse(JSON.stringify(this.appTemplate));
let arr = this.$_.cloneDeep(this.appTemplate);
this.$refs.AddData.onAdd(arr);
this.AddVisible = true;
},
......@@ -292,13 +292,30 @@ export default {
},
});
},
// 过滤影音
filterRes(data) {
let resource = data.split(",").map((v) => {
return this.api2 + v;
});
return resource[0];
},
// 预览
handlePreview(type, url) {
handlePreview(type, data) {
let resource = data.split(",").map((v) => {
return this.api2 + v;
});
if (type == "img") {
this.$viewerApi({
images: resource,
});
} else {
this.previewData = {
type,
url,
url: resource[0],
};
this.previewVisible = true;
}
},
},
};
......@@ -311,6 +328,7 @@ export default {
}
img,
video {
width: 50px;
cursor: pointer;
}
</style>
\ No newline at end of file
......@@ -47,9 +47,11 @@
<template slot="appIconPath" slot-scope="text">
<img
v-if="text.appIconPath"
class="pointer"
height="20"
width="20"
:src="api2 + text.appIconPath"
@click="handlePreview(api2 + text.appIconPath)"
/>
<span v-else>--</span>
</template>
......@@ -378,6 +380,12 @@ export default {
this.categoryList.find((v) => v.id == appThemeName).categoryName || "--"
);
},
// 预览图片
handlePreview(url) {
this.$viewerApi({
images: [url],
});
},
},
};
</script>
......
......@@ -47,9 +47,11 @@
<template slot="appIconPath" slot-scope="text">
<img
v-if="text.appIconPath"
class="pointer"
height="20"
width="20"
:src="api2 + text.appIconPath"
@click="handlePreview(api2 + text.appIconPath)"
/>
<span v-else>--</span>
</template>
......@@ -362,6 +364,12 @@ export default {
this.categoryList.find((v) => v.id == appThemeName).categoryName || "--"
);
},
// 预览图片
handlePreview(url) {
this.$viewerApi({
images: [url],
});
},
},
};
</script>
......
......@@ -147,11 +147,6 @@
<a-button type="primary" @click="onSubmit"> 确定 </a-button>
</a-space>
</div>
<!-- 预览 -->
<PrevieModal
:previewData="previewData"
:previewVisible.sync="previewVisible"
></PrevieModal>
</a-drawer>
</div>
</template>
......@@ -162,11 +157,9 @@ import { saveApp } from "@/services/market";
import { mapGetters } from "vuex";
import { changeCodeNumber } from "@/utils/validate";
// import local from "@/utils/local";
import PrevieModal from "@/components/PrevieModal.vue";
export default {
components: {
YSwitch,
PrevieModal,
},
props: {
title: {
......@@ -190,8 +183,6 @@ export default {
accept: "image/jpeg,image/png,image/svg+xml",
api: process.env.VUE_APP_API_BASE_URL + "/",
api2: process.env.VUE_APP_API_IMG_URL,
previewData: {}, // 预览
previewVisible: false,
iconFileList: [],
labelCol: {
span: 3,
......@@ -336,11 +327,9 @@ export default {
},
// 预览
handlePreview(info) {
this.previewData = {
type: "img",
url: info.url,
};
this.previewVisible = true;
this.$viewerApi({
images: [info.url],
});
},
// 上传应用
handleChangeFile(info) {
......
......@@ -127,8 +127,8 @@
<!-- 文件上传 -->
<a-upload
v-else-if="v.fieldType == 'upload'"
:action="api + 'base/file/commonupload'"
:multiple="false"
:action="api + '/base/file/commonupload'"
:multiple="true"
:file-list="v.fileList"
@change="
(info) => {
......@@ -158,8 +158,15 @@
:columns="columns"
:data-source="tableList"
:row-selection="{
selectedRowKeys: selectedLeftRowKeys,
onChange: onSelectChange,
selectedRowKeys: selectedRowKeys,
onChange: (keys, rows) => {
onSelectChange(
keys,
rows,
v,
`appInfoFieldList.${i}.fieldValue`
);
},
}"
@change="changeTable"
:rowKey="(record) => record.id"
......@@ -187,7 +194,9 @@
>
<a-space size="middle">
<a-button @click="onClose"> 取消 </a-button>
<a-button type="primary" @click="onSubmit"> 保存 </a-button>
<a-button :loading="loading" type="primary" @click="onSubmit">
保存
</a-button>
</a-space>
</div>
</a-drawer>
......@@ -196,7 +205,7 @@
<script>
import YQuillEditor from "@/components/YQuillEditor.vue";
import { saveDataset } from "@/services/market";
import { batchSaveDataset } from "@/services/market";
import { request } from "@/utils/request";
import local from "@/utils/local";
export default {
......@@ -217,14 +226,15 @@ export default {
},
data() {
return {
loading: false,
siteId: local.getLocal("siteId"),
api: process.env.VUE_APP_API_BASE_URL + "/",
api: process.env.VUE_APP_API_BASE_URL,
pageSizeOptions: ["10", "30", "50", "100", "200"],
labelCol: {
span: 2,
span: 3,
},
wrapperCol: {
span: 22,
span: 21,
},
form: {
appId: "",
......@@ -232,12 +242,15 @@ export default {
},
isopen: false,
year: null,
selectedLeftRowKeys: [],
selectedRowKeys: [],
selectedRow: [],
current: 1,
size: 10,
total: 0,
tableList: [],
columns: [],
serviceApi: "",
serviceApiParams: {},
};
},
computed: {
......@@ -260,8 +273,30 @@ export default {
async onSubmit() {
this.$refs.form.validate(async (valid) => {
if (valid) {
let res = await saveDataset(this.form);
this.loading = true;
let arr = [];
if (this.selectedRow.length) {
arr = this.selectedRow.map((v) => {
return {
appId: this.form.appId,
appInfoFieldList: this.$_.cloneDeep(
this.form.appInfoFieldList.map((item) => {
Object.keys(this.serviceApiParams).forEach((key) => {
if (item.fieldCode == key) {
item.fieldValue = v[this.serviceApiParams[key]];
}
});
return item;
})
),
};
});
} else {
arr = [this.form];
}
let res = await batchSaveDataset(arr);
let { code, msg } = res.data;
this.loading = false;
if (code === 1) {
this.$message.success(msg);
this.$emit("addSuccess");
......@@ -276,7 +311,7 @@ export default {
onAdd(appTemplate) {
Object.assign(this.form, this.$options.data().form);
this.form.id && this.$delete(this.form, "id");
this.form.appInfoFieldList = appTemplate.map(async (v) => {
this.form.appInfoFieldList = appTemplate.map((v) => {
if (v.id) {
delete v.id;
}
......@@ -288,7 +323,24 @@ export default {
v.checkbox = [];
}
if (v.fieldType == "table") {
await this.getData(v.serviceApi);
let index = {
title: "序号",
width: "65px",
scopedSlots: {
customRender: "num",
},
};
let fieldTypeValue = JSON.parse(v.fieldTypeValue);
fieldTypeValue = Object.keys(fieldTypeValue).map((key) => {
return {
title: fieldTypeValue[key],
dataIndex: key,
};
});
this.columns = [index, ...fieldTypeValue];
this.serviceApi = v.serviceApi;
this.serviceApiParams = JSON.parse(v.serviceApiParams);
this.getData();
}
return v;
});
......@@ -299,14 +351,15 @@ export default {
data.appInfoFieldList.forEach((v) => {
if (v.fieldType == "upload") {
if (v.fieldValue) {
v.fileList = [
{
uid: v.id,
name: v.fieldValue,
let arr = v.fieldValue.split(",");
v.fileList = arr.map((v, i) => {
return {
uid: i,
name: v,
status: "done",
url: v.fieldValue,
},
];
url: v,
};
});
} else {
v.fileList = [];
}
......@@ -323,11 +376,11 @@ export default {
// 文件上传
handleChange(info, row) {
let fileList = [...info.fileList];
fileList = fileList.slice(-1);
// fileList = fileList.slice(-1);
fileList = fileList.map((file) => {
if (file.response) {
if (!file.url && file.response) {
file.url = file.response.url;
} else {
} else if (!file.url && !file.response) {
file.url = "";
}
return file;
......@@ -351,22 +404,67 @@ export default {
row.fieldValue = this.$moment(value).format("YYYY");
this.isopen = false;
},
onSelectChange(keys, rows) {
this.selectedLeftRowKeys = keys;
console.log(rows);
onSelectChange(keys, rows, data, prop) {
this.selectedRowKeys = keys;
const res = new Map();
this.selectedRow = [...this.selectedRow, ...rows]
.filter((v) => {
return !res.has(v.id) && res.set(v.id, 1);
})
.filter((v) => {
return this.selectedRowKeys.some((val) => v.id == val);
});
data.fieldValue = keys.join(",");
for (let item of this.form.appInfoFieldList) {
Object.keys(this.serviceApiParams).forEach((key) => {
if (item.fieldCode == key) {
item.fieldValue = this.selectedRow.length
? this.selectedRow[0][this.serviceApiParams[key]]
: "";
if (item.fieldType == "upload") {
if (this.selectedRow.length) {
item.fileList = [
...item.fileList,
{
uid: -1,
name: this.selectedRow[0][this.serviceApiParams[key]],
status: "done",
url: this.selectedRow[0][this.serviceApiParams[key]],
},
].filter((v) => {
return !res.has(v.uuid) && res.set(v.uuid, 1);
});
} else {
item.fileList = item.fileList.filter((v) => v.uid != -1);
}
}
}
});
}
this.$refs.form.validateField(prop);
},
// 获取数据函数
async getData(url, data) {
let res = await request(this.api + url, "post", {
async getData(data) {
let res = await request(this.api + this.serviceApi, "post", {
size: this.size,
page: this.current,
siteId: this.siteId,
...data,
});
if (res.data.code == 1) {
console.log(res.data.data);
let { data, total } = res.data.data;
this.tableList = data;
this.total = total;
}
},
changeTable(info) {
let { current, pageSize } = info;
this.current = current;
this.size = pageSize;
this.getData();
},
},
};
</script>
......@@ -374,7 +472,7 @@ export default {
<style lang="less" scoped>
/deep/.ant-form-item {
display: flex;
align-items: center;
align-items: flex-start;
}
/deep/.ant-drawer-body {
height: calc(100vh - 55px);
......@@ -398,4 +496,9 @@ export default {
.upload-item {
display: block !important;
}
// .ant-input,
// .ant-select,
// .ant-calendar-picker {
// width: 40%;
// }
</style>
\ No newline at end of file
......@@ -36,7 +36,7 @@
>
<a-input
v-model="form.serviceApi"
placeholder="请输入接口地址,示例:/app/dataset/save"
placeholder="请输入接口地址,示例:/base/app/dataset/save"
/>
</a-form-model-item>
<a-form-model-item
......@@ -85,14 +85,14 @@
<a-space>
<div>
<a-space>
<span>键名</span>
<a-input v-model="v.key" placeholder="请输入键名" />
<span>编码</span>
<a-input v-model="v.key" placeholder="请输入字段编码" />
</a-space>
</div>
<div>
<a-space>
<span>映射:</span>
<a-input v-model="v.value" placeholder="请输入映射字段编码" />
<a-input v-model="v.value" placeholder="请输入映射字段" />
</a-space>
</div>
<a-button type="primary" @click="insertion(i, 'params')"
......@@ -309,10 +309,22 @@ export default {
handleOk() {
this.$refs.form.validate(async (valid) => {
if (valid) {
let fieldTypeObj = {};
let apiParamsObj = {};
this.fieldType.forEach((v) => {
if (v.key && v.value) {
fieldTypeObj[v.key] = v.value;
}
});
this.apiParams.forEach((v) => {
if (v.key && v.value) {
apiParamsObj[v.key] = v.value;
}
});
let res = await saveTemplete({
...this.form,
fieldTypeValue: JSON.stringify(this.fieldType),
serviceApiParams: JSON.stringify(this.apiParams),
fieldTypeValue: fieldTypeObj ? JSON.stringify(fieldTypeObj) : "",
serviceApiParams: apiParamsObj ? JSON.stringify(apiParamsObj) : "",
});
let { code, msg } = res.data;
if (code === 1) {
......@@ -348,7 +360,13 @@ export default {
// 编辑
onEdit(data) {
if (data.fieldTypeValue) {
this.fieldType = JSON.parse(data.fieldTypeValue);
let fieldTypeObj = JSON.parse(data.fieldTypeValue);
this.fieldType = Object.keys(fieldTypeObj).map((key) => {
return {
key,
value: fieldTypeObj[key],
};
});
} else {
this.fieldType = [
{
......@@ -358,7 +376,13 @@ export default {
];
}
if (data.serviceApiParams) {
this.apiParams = JSON.parse(data.serviceApiParams);
let apiParamsObj = JSON.parse(data.serviceApiParams);
this.apiParams = Object.keys(apiParamsObj).map((key) => {
return {
key,
value: apiParamsObj[key],
};
});
} else {
this.apiParams = [
{
......
......@@ -60,7 +60,13 @@
<img width="30" height="30" :src="api2 + text.modelIcon" />
</div> -->
<div class="svg-box">
<img width="30" height="30" :src="api2 + text.modelIcon" />
<img
class="pointer"
width="30"
height="30"
:src="api2 + text.modelIcon"
@click="handlePreview({ url: api2 + text.modelIcon })"
/>
</div>
</div>
<span v-else>--</span>
......@@ -220,11 +226,6 @@
</a-col>
</a-row>
</a-form-model>
<!-- 预览 -->
<PrevieModal
:previewData="previewData"
:previewVisible.sync="previewVisible"
></PrevieModal>
</a-modal>
<!-- 报表管理 -->
<StatementManage
......@@ -236,7 +237,6 @@
<script>
import { modelList, addMode, delMode } from "@/services/basicsetFun";
import PrevieModal from "@/components/PrevieModal.vue";
import StatementManage from "./components/StatementManage.vue";
import TabHeader from "@/components/TabHeader";
import { pageSizeOptions } from "@/config/pageConfig.js";
......@@ -294,7 +294,6 @@ const columns = [
];
export default {
components: {
PrevieModal,
StatementManage,
TabHeader,
},
......@@ -304,8 +303,6 @@ export default {
api: process.env.VUE_APP_API_BASE_URL + "/",
api2: process.env.VUE_APP_API_IMG_URL,
accept: "image/jpeg,image/png,image/svg+xml", // 上传类型
previewData: {}, // 预览
previewVisible: false,
columns,
loading: true,
title: "新增模块",
......@@ -502,11 +499,9 @@ export default {
},
// 预览
handlePreview(info) {
this.previewData = {
type: "img",
url: info.url,
};
this.previewVisible = true;
this.$viewerApi({
images: [info.url],
});
},
// 关闭对话框
......
......@@ -299,11 +299,6 @@
</a-form-model>
</div>
</a-modal>
<!-- 预览 -->
<PrevieModal
:previewData="previewData"
:previewVisible.sync="previewVisible"
></PrevieModal>
</div>
</template>
<script>
......@@ -312,7 +307,6 @@ import YCheckbox from "@/components/ycheckbox/YCheckbox.vue";
import YSwitch from "@/components/yswitch/YSwitch.vue";
// import options from "@/utils/city";
import { regionData } from "element-china-area-data";
import PrevieModal from "@/components/PrevieModal.vue";
export default {
props: {
formVisible: {
......@@ -326,7 +320,6 @@ export default {
},
components: {
YCheckbox,
PrevieModal,
YSwitch,
},
data() {
......@@ -356,8 +349,6 @@ export default {
api2: process.env.VUE_APP_API_IMG_URL,
accept: "image/jpeg,image/png", // 上传类型
loading: false,
previewData: {}, // 预览logo信息
previewVisible: false,
options: regionData, // 地区级联数据
tablename: "", //接口名称
modelIds: [], // 板块数据
......@@ -711,11 +702,9 @@ export default {
},
// 预览logo
handlePreview(info) {
this.previewData = {
type: "img",
url: info.url,
};
this.previewVisible = true;
this.$viewerApi({
images: [info.url],
});
},
// 删除logo
// handleRemove() {
......
......@@ -334,18 +334,12 @@
<a-button @click="handleReset">重置</a-button>
<a-button type="primary" @click="hideModal">确定</a-button>
</div>
<!-- 预览 -->
<PrevieModal
:previewData="previewData"
:previewVisible.sync="previewVisible"
></PrevieModal>
</a-modal>
</template>
<script>
import { getWindowList, saveWorkman } from "@/services/dept";
import { modelList } from "@/services/basicsetFun";
import PrevieModal from "@/components/PrevieModal.vue";
// import { changePhone, changeLandline } from "@/utils/validate";
export default {
props: {
......@@ -374,9 +368,7 @@ export default {
},
},
},
components: {
PrevieModal,
},
components: {},
data() {
const checkIdCard = (rule, value, callback) => {
if (!value) {
......@@ -395,8 +387,6 @@ export default {
api: process.env.VUE_APP_API_BASE_URL + "/",
api2: process.env.VUE_APP_API_IMG_URL,
accept: "image/jpeg,image/png", // 上传类型
previewData: {}, // 预览
previewVisible: false,
fileList: [],
loading: false,
imageUrl: "",
......@@ -586,11 +576,9 @@ export default {
},
// 预览
handlePreview(info) {
this.previewData = {
type: "img",
url: info.url,
};
this.previewVisible = true;
this.$viewerApi({
images: [info.url],
});
},
// 照片大小格式限制
beforeUpload(file) {
......
......@@ -366,11 +366,6 @@
<a-button @click="handleReset">重置</a-button>
<a-button type="primary" @click="hideModal">确定</a-button>
</div>
<!-- 预览 -->
<PrevieModal
:previewData="previewData"
:previewVisible.sync="previewVisible"
></PrevieModal>
</a-modal>
</template>
......@@ -378,7 +373,6 @@
import { changeAccount, changePassWord } from "@/utils/validate";
import { getWindowList, saveWorkman } from "@/services/dept";
import { modelList } from "@/services/basicsetFun";
import PrevieModal from "@/components/PrevieModal.vue";
// import { changePhone, changeLandline } from "@/utils/validate";
import local from "@/utils/local";
export default {
......@@ -408,9 +402,7 @@ export default {
},
},
},
components: {
PrevieModal,
},
components: {},
data() {
const checkIdCard = (rule, value, callback) => {
if (!value) {
......@@ -429,8 +421,6 @@ export default {
api: process.env.VUE_APP_API_BASE_URL + "/",
api2: process.env.VUE_APP_API_IMG_URL,
accept: "image/jpeg,image/png", // 上传类型
previewData: {}, // 预览
previewVisible: false,
fileList: [],
loading: false,
imageUrl: "",
......@@ -626,11 +616,9 @@ export default {
},
// 预览
handlePreview(info) {
this.previewData = {
type: "img",
url: info.url,
};
this.previewVisible = true;
this.$viewerApi({
images: [info.url],
});
},
// 照片大小格式限制
beforeUpload(file) {
......
......@@ -219,6 +219,7 @@
<img
v-if="text.photoPath"
:src="api2 + text.photoPath"
@click="handlePreview(api2 + text.photoPath)"
class="pht"
/>
......@@ -651,6 +652,12 @@ export default {
}
return fromnum;
},
// 预览照片
handlePreview(url) {
this.$viewerApi({
images: [url],
});
},
},
};
</script>
......@@ -690,6 +697,7 @@ export default {
width: 56px;
height: 74px;
object-fit: cover;
cursor: pointer;
}
div.person_gruop1 {
......
......@@ -294,6 +294,7 @@ module.exports = {
list: `${BASE_URL}/base/app/dataset/list`,
info: `${BASE_URL}/base/app/dataset/info`,
save: `${BASE_URL}/base/app/dataset/save`,
batchSave: `${BASE_URL}/base/app/dataset/batchSave`,
delete: `${BASE_URL}/base/app/dataset/delete`,
},
// 应用信息字段配置
......
......@@ -61,6 +61,10 @@ export async function getDatasetInfo(data) {
export async function saveDataset(data) {
return request(dataset.save, METHOD.POST, data);
}
// 批量保存数据
export async function batchSaveDataset(data) {
return request(dataset.batchSave, METHOD.POST, data);
}
// 删除数据
export async function deleteDataset(data) {
return request(dataset.delete, METHOD.GET, data);
......
......@@ -7220,6 +7220,11 @@ lodash@^4.17.11, lodash@^4.17.13, lodash@^4.17.14, lodash@^4.17.15, lodash@^4.17
resolved "https://registry.npmjs.org/lodash/-/lodash-4.17.19.tgz"
integrity sha512-JNvd8XER9GQX0v2qJgsaN/mzFCNA5BRe/j8JN9d+tWyGLSodKQHKFicdwNYzWwI3wjRnaKPsGj1XkBjx/F96DQ==
lodash@^4.17.21:
version "4.17.21"
resolved "https://registry.npmmirror.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
log-symbols@^2.2.0:
version "2.2.0"
resolved "https://registry.npm.taobao.org/log-symbols/download/log-symbols-2.2.0.tgz?cache=0&sync_timestamp=1587898912367&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Flog-symbols%2Fdownload%2Flog-symbols-2.2.0.tgz"
......@@ -11004,7 +11009,7 @@ uuid@^8.3.2:
v-viewer@^1.6.4:
version "1.6.4"
resolved "https://registry.npmmirror.com/v-viewer/-/v-viewer-1.6.4.tgz"
resolved "https://registry.npmmirror.com/v-viewer/-/v-viewer-1.6.4.tgz#39e36b534baab34076fb816704c6a734de0dc72f"
integrity sha512-LVkiUHpmsbsZXebeNXnu8krRCi5i2n07FeLFxoIVGhw8lVvTBO0ffpbDC6mLEuacCjrIh09HjIqpciwUtWE8lQ==
dependencies:
throttle-debounce "^2.0.1"
......
......@@ -115,8 +115,8 @@ export default {
opacity: 0,
scale: 0,
duration: 2,
x: this.getDomTranX("Title"),
y: this.getDomTranY("Title"),
z: 10,
...this.getDomTran("Title"),
},
"<"
)
......@@ -126,8 +126,8 @@ export default {
opacity: 0,
scale: 0,
duration: 2,
x: this.getDomTranX("des"),
y: this.getDomTranY("des"),
z: 10,
...this.getDomTran("des"),
},
"<"
)
......@@ -137,8 +137,8 @@ export default {
opacity: 0.7,
scale: 0,
duration: 2,
x: this.getDomTranX("item0"),
y: this.getDomTranY("item0"),
z: 10,
...this.getDomTran("item0"),
},
"<"
)
......@@ -148,8 +148,8 @@ export default {
opacity: 0.7,
scale: 0,
duration: 2,
x: this.getDomTranX("item1"),
y: this.getDomTranY("item1"),
z: 10,
...this.getDomTran("item1"),
},
"<"
)
......@@ -159,8 +159,8 @@ export default {
opacity: 0.7,
scale: 0,
duration: 2,
x: this.getDomTranX("item2"),
y: this.getDomTranY("item2"),
z: 10,
...this.getDomTran("item2"),
},
"<"
)
......@@ -170,8 +170,8 @@ export default {
opacity: 0.7,
scale: 0,
duration: 2,
x: this.getDomTranX("item3"),
y: this.getDomTranY("item3"),
z: 10,
...this.getDomTran("item3"),
},
"<"
)
......@@ -181,8 +181,8 @@ export default {
opacity: 0.7,
scale: 0,
duration: 2,
x: this.getDomTranX("item4"),
y: this.getDomTranY("item4"),
z: 10,
...this.getDomTran("item4"),
},
"<"
)
......@@ -192,8 +192,8 @@ export default {
opacity: 0.7,
scale: 0,
duration: 2,
x: this.getDomTranX("item5"),
y: this.getDomTranY("item5"),
z: 10,
...this.getDomTran("item5"),
},
"<"
)
......@@ -203,8 +203,8 @@ export default {
opacity: 0.7,
scale: 0,
duration: 2,
x: this.getDomTranX("item6"),
y: this.getDomTranY("item6"),
z: 10,
...this.getDomTran("item6"),
},
"<"
)
......@@ -214,24 +214,25 @@ export default {
opacity: 0.7,
scale: 0,
duration: 2,
x: this.getDomTranX("item7"),
y: this.getDomTranY("item7"),
z: 10,
...this.getDomTran("item7"),
},
"<"
)
.to(
".menu-box",
{
background: "rgba(5, 30, 75, 0.66)",
},
">"
)
.from(
".name",
{
duration: 2,
opacity: 0,
},
">"
"> -1"
)
.to(
".menu-box",
{
background: "rgba(5, 30, 75, 0.66)",
},
"> -1"
);
});
},
......@@ -241,7 +242,7 @@ export default {
this.$router.push(url);
},
// 获取dom动画偏移
getDomTranX(ref) {
getDomTran(ref) {
let dom;
if (this.$refs[ref] && Array.isArray(this.$refs[ref])) {
dom = this.$refs[ref][0].getBoundingClientRect();
......@@ -251,18 +252,11 @@ export default {
let menuBox = this.$refs.menuBox.getBoundingClientRect();
let x = menuBox.left + menuBox.width / 2 - dom.left - dom.width / 2;
return x;
},
getDomTranY(ref) {
let dom;
if (this.$refs[ref] && Array.isArray(this.$refs[ref])) {
dom = this.$refs[ref][0].getBoundingClientRect();
} else {
dom = this.$refs[ref].getBoundingClientRect();
}
let menuBox = this.$refs.menuBox.getBoundingClientRect();
let y = menuBox.top + menuBox.height / 2 - dom.top - dom.height / 2;
return y;
return {
x,
y,
};
},
},
beforeDestroy() {},
......@@ -279,6 +273,8 @@ export default {
padding-top: @headerH;
color: #ffffff;
position: relative;
transform-style: preserve-3d;
perspective: 500px;
// background-color: #000;
.wavy {
position: absolute;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment