Commit 936a494a by Joey

feat(@gms/gms-plugin-mainpage-commonfunctions): 改为根据用户区分配置

parent ee7693b2
......@@ -5,6 +5,7 @@
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"build-dev": "vue-cli-service build --mode development",
"build-dev-watch": "vue-cli-service build --mode development --watch",
"lint": "vue-cli-service lint"
},
"dependencies": {
......
<template>
<div
class="commonfunctions-card"
@click="gotoQuery(item)"
>
<div class="click-area" @click="gotoQuery(item)">
<div class="icon">
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>{{item.function.title}}</title>
......@@ -13,6 +13,7 @@
{{item.function.title}}
</div>
</div>
</div>
</template>
<script>
......@@ -105,6 +106,10 @@ export default {
background: #FFFFFF;
padding: 24px 16px 16px 16px;
font-family: PingFangSC-Regular, PingFang SC;
.click-area {
height: 100%;
width: fit-content;
margin: 0 auto;
cursor: pointer;
.icon {
width: 46px;
......@@ -125,5 +130,6 @@ export default {
overflow: hidden;
text-overflow: ellipsis;
}
}
}
</style>
\ No newline at end of file
......@@ -2,35 +2,6 @@
<Collapse v-model="value1" class="property">
<Panel name="1">
列表设置
<div slot="content">
<Form :label-width="80">
<FormItem label="每行图标数目">
<Input v-model="properties.rowIconNum" />
</FormItem>
</Form>
<Divider />
<div class="property-item" v-for="(config, index) in properties.configList" :key="index">
<Form :model="config" :label-width="80">
<FormItem label="功能">
<Select v-model="config.function" filterable>
<Option v-for="item in functionList" :value="item.id" :key="item.id">
{{item.title}}
</Option>
</Select>
</FormItem>
<FormItem label="图标">
<Select v-model="config.icon">
<Option v-for="item in iconList" :key="item.value" :value="item.value">
{{item.name}}
</Option>
</Select>
</FormItem>
</Form>
<Button size="small" type="error" @click="removeItem(index)">删除</Button>
<Divider />
</div>
<Button size="small" type="primary" @click="addItem">添加</Button>
</div>
</Panel>
</Collapse>
</template>
......@@ -38,17 +9,6 @@
<script>
export default {
watch: {
'properties.configList': {
handler(newVal) {
window.GMS.vbus.$emit('widgetPluginPropertiesChange', { id: this.type + this.id, properties: this.properties })
this.itemSetting.properties = this.properties
},
deep: true,
},
'properties.rowIconNum'() {
window.GMS.vbus.$emit('widgetPluginPropertiesChange', { id: this.type + this.id, properties: this.properties })
this.itemSetting.properties = this.properties
}
},
props: {
itemSetting: {
......@@ -62,40 +22,7 @@ export default {
properties: { configList: [] },
configList: [],
functionList: [],
iconList: [
{
value: '#icon-a-46_HOME_E_RBC_changyonggongneng_1',
name: '常用功能1',
},
{
value: '#icon-a-46_HOME_E_RBC_changyonggongneng_2',
name: '常用功能2',
},
{
value: '#icon-a-46_HOME_E_RBC_changyonggongneng_3',
name: '常用功能3',
},
{
value: '#icon-a-46_HOME_E_RBC_changyonggongneng_4',
name: '常用功能4',
},
{
value: '#icon-a-46_HOME_E_RBC_changyonggongneng_5',
name: '常用功能5',
},
{
value: '#icon-a-46_HOME_E_RBC_changyonggongneng_6',
name: '常用功能6',
},
{
value: '#icon-a-46_HOME_E_RBC_changyonggongneng_7',
name: '常用功能7',
},
{
value: '#icon-a-46_HOME_E_RBC_changyonggongneng',
name: '常用功能8',
},
],
}
},
computed: {
......@@ -130,13 +57,6 @@ export default {
},
},
created() {
window.GMS.util.nvwa.getRoutes().then((res) => {
this.addFunction(res.data.children)
})
let prop = this.itemSetting.properties
if (prop && prop.configList) {
this.properties = prop
}
},
}
</script>
......
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