刘光辉
11 小时以前 0dfe84494048ce27ba8449831782128412d3eb13
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
<script lang="ts" setup>
import { onMounted, reactive, toRefs } from 'vue';
 
import { useMessage } from '@jnpf/hooks';
 
import { getShareList, saveShare } from '#/api/onlineDev/visualDev';
 
import FormSelectModal from './FormSelectModal.vue';
 
interface State {
  baseForm: any;
  loading: boolean;
}
 
defineOptions({ name: 'AppConfigAppShare' });
 
const state = reactive<State>({
  baseForm: {},
  loading: false,
});
const { baseForm, loading } = toRefs(state);
const { createMessage } = useMessage();
 
function initData() {
  getShareList().then((res) => {
    state.baseForm = res.data;
  });
}
function handleSubmit() {
  state.loading = true;
  saveShare(state.baseForm)
    .then((res) => {
      state.loading = false;
      createMessage.success(res.msg);
      initData();
    })
    .catch(() => {
      state.loading = false;
    });
}
 
onMounted(() => {
  initData();
});
</script>
<template>
  <div class="app-share-v jnpf-config-wrapper">
    <div class="share-common-pane">
      <div class="pane-header">
        <p>跨应用</p>
        <p class="pane-header-subTitle">设置访问其他应用的表单</p>
      </div>
      <div class="pane-content">
        <a-form :colon="false" label-align="left" :label-col="{ style: { width: '100px' } }">
          <FormSelectModal class="mt-[10px]" v-model:value="baseForm.ids" multiple placeholder="请选择" />
          <a-button :loading="loading" class="mt-[20px]" type="primary" @click="handleSubmit">保存</a-button>
        </a-form>
      </div>
    </div>
  </div>
</template>
<style lang="scss" scoped>
.app-share-v {
  padding: 20px 30px;
 
  .share-common-pane {
    padding: 10px;
    margin-bottom: 30px;
    border: 1px solid var(--border-color-base);
    border-radius: 8px;
 
    .pane-header {
      padding: 0 10px 10px;
      font-size: 18px;
      line-height: 30px;
      border-bottom: 1px solid var(--border-color-base);
 
      .pane-header-subTitle {
        margin-top: 4px;
        font-size: 14px;
        line-height: 20px;
        color: var(--text-color-label);
      }
    }
 
    .pane-content {
      padding: 10px;
    }
  }
}
</style>