|
@@ -18,12 +18,13 @@
|
|
</BasicModal>
|
|
</BasicModal>
|
|
</template>
|
|
</template>
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
- import { defineComponent, nextTick, ref, reactive } from 'vue';
|
|
|
|
|
|
+ import { defineComponent, nextTick, ref, computed, reactive } from 'vue';
|
|
import { BasicModal, useModalInner } from '/@/components/Modal';
|
|
import { BasicModal, useModalInner } from '/@/components/Modal';
|
|
import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
|
|
import { BasicForm, FormSchema, useForm } from '/@/components/Form/index';
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
// import { checkUserAddAble } from '/@/api/corporation/modal';
|
|
// import { checkUserAddAble } from '/@/api/corporation/modal';
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
|
+ import { useUserStore } from '/@/store/modules/user';
|
|
import { staffListApi } from '/@/api/staff/list';
|
|
import { staffListApi } from '/@/api/staff/list';
|
|
import { ListApi } from '/@/api/scene/live';
|
|
import { ListApi } from '/@/api/scene/live';
|
|
import { bindUserList, createOrUpdate } from '/@/api/scene/list';
|
|
import { bindUserList, createOrUpdate } from '/@/api/scene/list';
|
|
@@ -40,6 +41,10 @@
|
|
setup(props, { emit }) {
|
|
setup(props, { emit }) {
|
|
const { createMessage } = useMessage();
|
|
const { createMessage } = useMessage();
|
|
const modalTitle = ref('编辑');
|
|
const modalTitle = ref('编辑');
|
|
|
|
+ const userStore = useUserStore();
|
|
|
|
+ const userinfo = computed(() => userStore.getUserInfo);
|
|
|
|
+ console.log('userinfovalue', userinfo.value);
|
|
|
|
+ const { getCheckRole } = userStore;
|
|
const isPropsData = reactive({
|
|
const isPropsData = reactive({
|
|
isUpdate: true,
|
|
isUpdate: true,
|
|
isSetData: true,
|
|
isSetData: true,
|
|
@@ -209,6 +214,9 @@
|
|
function onDataReceive(data) {
|
|
function onDataReceive(data) {
|
|
isPropsData.isUpdate = data.isUpdate || false;
|
|
isPropsData.isUpdate = data.isUpdate || false;
|
|
isPropsData.isSetData = data.isSetData || false;
|
|
isPropsData.isSetData = data.isSetData || false;
|
|
|
|
+ modalTitle.value = data.isSetData ? '查看' : data.isUpdate ? '编辑' : '新增';
|
|
|
|
+ // const = ref('编辑');
|
|
|
|
+
|
|
isPropsData.record = data.record || {};
|
|
isPropsData.record = data.record || {};
|
|
if (data.isUpdate) {
|
|
if (data.isUpdate) {
|
|
//编辑
|
|
//编辑
|
|
@@ -273,7 +281,7 @@
|
|
effectiveEndTime: new Date(launchPeriod[0]).getTime(),
|
|
effectiveEndTime: new Date(launchPeriod[0]).getTime(),
|
|
effectiveStartTime: new Date(launchPeriod[1]).getTime(),
|
|
effectiveStartTime: new Date(launchPeriod[1]).getTime(),
|
|
};
|
|
};
|
|
- if (isPropsData.isUpdate) {
|
|
|
|
|
|
+ if (!isPropsData.isSetData) {
|
|
apiData.id = isPropsData.record.id;
|
|
apiData.id = isPropsData.record.id;
|
|
await createOrUpdate(apiData);
|
|
await createOrUpdate(apiData);
|
|
createMessage.success(t('common.optSuccess'));
|
|
createMessage.success(t('common.optSuccess'));
|
|
@@ -298,6 +306,12 @@
|
|
anchorUserId: '',
|
|
anchorUserId: '',
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
+ if (getCheckRole(['staff'])) {
|
|
|
|
+ disabled = true;
|
|
|
|
+ setFieldsValue({
|
|
|
|
+ anchorUserId: userinfo.value.id,
|
|
|
|
+ });
|
|
|
|
+ }
|
|
updateSchema({
|
|
updateSchema({
|
|
field: 'anchorUserId',
|
|
field: 'anchorUserId',
|
|
componentProps: {
|
|
componentProps: {
|