|
@@ -18,22 +18,30 @@
|
|
|
</template>
|
|
|
<template #actions="{ row }">
|
|
|
<m-button type="primary" text @click="onEdit(row)">编辑</m-button>
|
|
|
+ <m-button type="primary" text @click="onConfiguration(row)">配置图表</m-button>
|
|
|
<m-button type="danger" text @click="onDelete(row)">删除</m-button>
|
|
|
<m-button :type="row.status === 1 ? 'danger' : 'success'" text @click="onStatus(row)">
|
|
|
{{ row.status === 1 ? '停用' : '启用' }}
|
|
|
</m-button>
|
|
|
</template>
|
|
|
</m-table>
|
|
|
- <PrivateChartEdit ref="privateChartEditRefs" fullscreen></PrivateChartEdit>
|
|
|
+ <PrivateChartEdit ref="privateChartEditRefs" fullscreen @refresh="onInit"></PrivateChartEdit>
|
|
|
+ <PrivateEdit ref="privateEditRefs" @refresh="onInit"></PrivateEdit>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
import PrivateChartEdit from './privateChartEdit.vue'
|
|
|
+import PrivateEdit from './privateEdit.vue'
|
|
|
+import {
|
|
|
+ webSettingList,
|
|
|
+ deleteWebSetting
|
|
|
+} from '@/api/system'
|
|
|
export default {
|
|
|
name: 'PrivateChart',
|
|
|
components: {
|
|
|
- PrivateChartEdit
|
|
|
+ PrivateChartEdit,
|
|
|
+ PrivateEdit
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
@@ -58,22 +66,7 @@ export default {
|
|
|
{ label: '描述', prop: 'desc' },
|
|
|
{ label: '操作', prop: 'actions' }
|
|
|
],
|
|
|
- items: [
|
|
|
- {
|
|
|
- name: '图表1',
|
|
|
- author: '张三',
|
|
|
- createDate: '2021-01-01',
|
|
|
- status: 1,
|
|
|
- desc: '这是一个图表'
|
|
|
- },
|
|
|
- {
|
|
|
- name: '图表2',
|
|
|
- author: '李四',
|
|
|
- createDate: '2021-01-02',
|
|
|
- status: 0,
|
|
|
- desc: '这是另一个图表'
|
|
|
- }
|
|
|
- ],
|
|
|
+ items: [],
|
|
|
total: 0,
|
|
|
pageInfo: {
|
|
|
current: 1,
|
|
@@ -86,9 +79,18 @@ export default {
|
|
|
async onInit () {
|
|
|
this.loading = true
|
|
|
try {
|
|
|
- // const { data } = await ApiName()
|
|
|
- // this.items = data.list || []
|
|
|
- // this.total = data.total || 0
|
|
|
+ const { data } = await webSettingList({
|
|
|
+ page: {
|
|
|
+ ...this.pageInfo
|
|
|
+ },
|
|
|
+ entity: {
|
|
|
+ ...this.searchValues,
|
|
|
+ webSettingCategory: 'shareChart', // 自定义图表
|
|
|
+ permission: 0 // 私有
|
|
|
+ }
|
|
|
+ })
|
|
|
+ this.items = data.records
|
|
|
+ this.total = data.total
|
|
|
} catch (error) {
|
|
|
this.$message.error(error)
|
|
|
} finally {
|
|
@@ -96,16 +98,19 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
onAdd () {
|
|
|
- this.$refs.privateChartEditRefs.open()
|
|
|
+ this.$refs.privateEditRefs.open()
|
|
|
},
|
|
|
onEdit (item) {
|
|
|
+ this.$refs.privateEditRefs.open(item)
|
|
|
+ },
|
|
|
+ onConfiguration (item) {
|
|
|
this.$refs.privateChartEditRefs.open(item)
|
|
|
},
|
|
|
onDelete (row) {
|
|
|
this.$confirm('确定删除吗?', '提示')
|
|
|
.then(async () => {
|
|
|
try {
|
|
|
- // await ApiName({ id: row.id })
|
|
|
+ await deleteWebSetting({ webSettingId: row.webSettingId })
|
|
|
this.$message.success('删除成功')
|
|
|
this.onInit()
|
|
|
} catch (error) {
|