Commit 901b26d2c75c43b0a8cf48c44536b7cd96f53e89

Authored by fengistao
1 parent 674e0300

fix:修复通知管理接收者类型问题等

@@ -6,7 +6,7 @@ VITE_PUBLIC_PATH = / @@ -6,7 +6,7 @@ VITE_PUBLIC_PATH = /
6 6
7 # Cross-domain proxy, you can configure multiple 7 # Cross-domain proxy, you can configure multiple
8 # Please note that no line breaks 8 # Please note that no line breaks
9 -VITE_PROXY = [["/api","http://192.168.10.123:8082/api"],["/upload","http://192.168.10.134:3300/upload"]] 9 +VITE_PROXY = [["/api","http://192.168.10.116:8080/api"],["/upload","http://192.168.10.134:3300/upload"]]
10 # VITE_PROXY=[["/api","https://vvbin.cn/test"]] 10 # VITE_PROXY=[["/api","https://vvbin.cn/test"]]
11 11
12 # Delete console 12 # Delete console
@@ -19,4 +19,4 @@ VITE_GLOB_API_URL=/api @@ -19,4 +19,4 @@ VITE_GLOB_API_URL=/api
19 VITE_GLOB_UPLOAD_URL=/upload 19 VITE_GLOB_UPLOAD_URL=/upload
20 20
21 # Interface prefix 21 # Interface prefix
22 -VITE_GLOB_API_URL_PREFIX=/v1 22 +VITE_GLOB_API_URL_PREFIX=/yt
1 import { defHttp } from '/@/utils/http/axios'; 1 import { defHttp } from '/@/utils/http/axios';
2 import { 2 import {
3 - NoticeByIdParams,  
4 NoticeQueryParam, 3 NoticeQueryParam,
5 NotifyAddDraftModel, 4 NotifyAddDraftModel,
6 NotifyAddreLeaseModel, 5 NotifyAddreLeaseModel,
@@ -69,7 +68,7 @@ export const notifyAddLeaseApi = (params: NotifyAddreLeaseModel) => { @@ -69,7 +68,7 @@ export const notifyAddLeaseApi = (params: NotifyAddreLeaseModel) => {
69 * 批量删除 68 * 批量删除
70 * @param params pageSize page name 69 * @param params pageSize page name
71 */ 70 */
72 -export const notifyDeleteApi = (ids: string) => { 71 +export const notifyDeleteApi = (ids: string[]) => {
73 return defHttp.delete({ 72 return defHttp.delete({
74 url: `${NotifyManagerApi.NOTICE_DELETE_URL}?ids=${ids}`, 73 url: `${NotifyManagerApi.NOTICE_DELETE_URL}?ids=${ids}`,
75 }); 74 });
@@ -32,6 +32,7 @@ export function loginApi(params: LoginParams, mode: ErrorMessageMode = 'modal') @@ -32,6 +32,7 @@ export function loginApi(params: LoginParams, mode: ErrorMessageMode = 'modal')
32 }, 32 },
33 { 33 {
34 errorMessageMode: mode, 34 errorMessageMode: mode,
  35 + joinPrefix: false,
35 } 36 }
36 ); 37 );
37 } 38 }
@@ -9,6 +9,12 @@ import { @@ -9,6 +9,12 @@ import {
9 tenantProfileDTO, 9 tenantProfileDTO,
10 } from './tenantInfo'; 10 } from './tenantInfo';
11 import { defHttp } from '/@/utils/http/axios'; 11 import { defHttp } from '/@/utils/http/axios';
  12 +import { BasicPageParams } from '/@/api/model/baseModel';
  13 +export type QueryTenantProfilesParam = BasicPageParams & OtherParams;
  14 +export type OtherParams = {
  15 + sortProperty?: string;
  16 + sortOrder?: string;
  17 +};
12 18
13 enum Api { 19 enum Api {
14 userPage = '/user/page', 20 userPage = '/user/page',
@@ -21,8 +27,16 @@ enum Api { @@ -21,8 +27,16 @@ enum Api {
21 deleteTenantAdmin = '/admin/user/deleteTenantAdmin', 27 deleteTenantAdmin = '/admin/user/deleteTenantAdmin',
22 getTenantRoles = '/admin/tenant/roles/', 28 getTenantRoles = '/admin/tenant/roles/',
23 postAddTenantProfile = '/tenantProfile', 29 postAddTenantProfile = '/tenantProfile',
  30 + getTenantProfile = '/tenantProfiles',
24 } 31 }
25 32
  33 +export const getTableTenantProfileApi = (params?: QueryTenantProfilesParam) => {
  34 + return defHttp.get({
  35 + params: params,
  36 + url: Api.getTenantProfile,
  37 + });
  38 +};
  39 +
26 export async function saveTenantProfileApi(params: tenantProfileDTO) { 40 export async function saveTenantProfileApi(params: tenantProfileDTO) {
27 await defHttp.post({ 41 await defHttp.post({
28 params: params, 42 params: params,
  1 +import { ComponentInternalInstance, getCurrentInstance } from 'vue';
  2 +
  3 +//在ts中使用会报错:报错:...类型“ComponentInternalInstance | null”
  4 +// 我们在项目中一般会用到很多getCurrentInstance()方法,直接封装一下
  5 +export default function useCurrentInstance() {
  6 + const { appContext } = getCurrentInstance() as ComponentInternalInstance;
  7 + const proxy = appContext.config.globalProperties;
  8 + return {
  9 + proxy,
  10 + };
  11 +}
1 <template> 1 <template>
2 - <BasicModal v-bind="$attrs" width="55rem" @register="register" :title="getTitle"> 2 + <BasicModal
  3 + v-bind="$attrs"
  4 + width="55rem"
  5 + @register="register"
  6 + :title="getTitle"
  7 + @ok="handleSubmit"
  8 + @cancel="handleCancel"
  9 + >
3 <div class="step-form-form"> 10 <div class="step-form-form">
4 <a-steps :current="current"> 11 <a-steps :current="current">
5 <a-step title="设备配置" /> 12 <a-step title="设备配置" />
@@ -8,9 +15,9 @@ @@ -8,9 +15,9 @@
8 </a-steps> 15 </a-steps>
9 </div> 16 </div>
10 <div class="mt-5"> 17 <div class="mt-5">
11 - <DeviceProfileStep1 @next="handleStep1Next" v-show="current === 0" />  
12 - <DeviceProfileStep2 @prev="handleStepPrev" @next="handleStep2Next" v-show="current === 1" />  
13 - <DeviceProfileStep3 @prev="handleStepPrev" @redo="handleRedo" v-show="current === 2" /> 18 + <DeviceProfileStep1 @next="handleStep1Next" v-if="current === 0" />
  19 + <DeviceProfileStep2 @prev="handleStepPrev" @next="handleStep2Next" v-if="current === 1" />
  20 + <DeviceProfileStep3 @prev="handleStepPrev" @redo="handleRedo" v-if="current === 2" />
14 </div> 21 </div>
15 </BasicModal> 22 </BasicModal>
16 </template> 23 </template>
@@ -35,14 +42,12 @@ @@ -35,14 +42,12 @@
35 userData: { type: Object }, 42 userData: { type: Object },
36 }, 43 },
37 setup(_) { 44 setup(_) {
38 - const current = ref(2); 45 + const current = ref(0);
39 const isUpdate = ref(true); 46 const isUpdate = ref(true);
40 const getTitle = computed(() => (!unref(isUpdate) ? '新增设备配置' : '编辑设备配置')); 47 const getTitle = computed(() => (!unref(isUpdate) ? '新增设备配置' : '编辑设备配置'));
41 -  
42 const [register] = useModalInner((data) => { 48 const [register] = useModalInner((data) => {
43 isUpdate.value = !!data?.isUpdate; 49 isUpdate.value = !!data?.isUpdate;
44 }); 50 });
45 -  
46 function handleStepPrev() { 51 function handleStepPrev() {
47 current.value--; 52 current.value--;
48 } 53 }
@@ -57,8 +62,15 @@ @@ -57,8 +62,15 @@
57 function handleRedo() { 62 function handleRedo() {
58 current.value = 0; 63 current.value = 0;
59 } 64 }
60 - 65 + const handleSubmit = () => {
  66 + console.log(1);
  67 + };
  68 + const handleCancel = () => {
  69 + console.log(1);
  70 + };
61 return { 71 return {
  72 + handleSubmit,
  73 + handleCancel,
62 register, 74 register,
63 getTitle, 75 getTitle,
64 current, 76 current,
1 <template> 1 <template>
2 - <CollapseContainer title="执行条件1" style="background-color: #eeeeee"> 2 + <CollapseContainer title="执行条件" style="background-color: #eeeeee">
3 <div style="position: relative"> 3 <div style="position: relative">
4 <BasicForm 4 <BasicForm
5 :labelWidth="100" 5 :labelWidth="100"
@@ -16,13 +16,13 @@ @@ -16,13 +16,13 @@
16 type="primary" 16 type="primary"
17 >+新增执行条件</Button 17 >+新增执行条件</Button
18 > 18 >
19 - <Button 19 + <!-- <Button
20 @click="del(field)" 20 @click="del(field)"
21 style="margin-left: 10px" 21 style="margin-left: 10px"
22 v-if="Number(field) === 0" 22 v-if="Number(field) === 0"
23 type="primary" 23 type="primary"
24 >删除</Button 24 >删除</Button
25 - > 25 + > -->
26 <Button 26 <Button
27 style="margin-left: -95px; margin-top: 20px" 27 style="margin-left: -95px; margin-top: 20px"
28 v-if="field > 0" 28 v-if="field > 0"
@@ -39,7 +39,7 @@ @@ -39,7 +39,7 @@
39 </CollapseContainer> 39 </CollapseContainer>
40 </template> 40 </template>
41 <script lang="ts"> 41 <script lang="ts">
42 - import { defineComponent, ref, reactive, watch } from 'vue'; 42 + import { defineComponent, ref, watch } from 'vue';
43 import { CollapseContainer } from '/@/components/Container/index'; 43 import { CollapseContainer } from '/@/components/Container/index';
44 import { BasicForm, useForm } from '/@/components/Form/index'; 44 import { BasicForm, useForm } from '/@/components/Form/index';
45 import { Input } from 'ant-design-vue'; 45 import { Input } from 'ant-design-vue';
@@ -50,8 +50,8 @@ @@ -50,8 +50,8 @@
50 export default defineComponent({ 50 export default defineComponent({
51 components: { CollapseContainer, BasicForm, [Input.name]: Input, Button }, 51 components: { CollapseContainer, BasicForm, [Input.name]: Input, Button },
52 props: ['deviceInfo1'], 52 props: ['deviceInfo1'],
53 - setup(props, { emit }) {  
54 - let formData = reactive({}); 53 + setup(props) {
  54 + const getValueData: any = ref({});
55 const [ 55 const [
56 registerCondition, 56 registerCondition,
57 { resetFields, updateSchema, appendSchemaByField, removeSchemaByFiled, getFieldsValue }, 57 { resetFields, updateSchema, appendSchemaByField, removeSchemaByFiled, getFieldsValue },
@@ -79,26 +79,19 @@ @@ -79,26 +79,19 @@
79 }); 79 });
80 } 80 }
81 ); 81 );
82 - // async function handleSubmit() {  
83 - // try {  
84 - // let data = getFieldsValue();  
85 - // formData = data;  
86 - // emit('get-conditiondata', formData);  
87 - // isJudge.value++;  
88 - // } catch (e) {  
89 - // console.log(e);  
90 - // }  
91 - // } 82 +
  83 + function getAllFields(getV) {
  84 + const values = getFieldsValue();
  85 + getValueData.value = values;
  86 + getV = getValueData.value;
  87 + return getV;
  88 + }
  89 + function funcResetFields() {
  90 + resetFields();
  91 + }
  92 +
92 const n = ref(1); 93 const n = ref(1);
93 function add() { 94 function add() {
94 - try {  
95 - let data = getFieldsValue();  
96 - formData = data;  
97 - emit('get-conditiondata', formData);  
98 - isJudge.value++;  
99 - } catch (e) {  
100 - console.log(e);  
101 - }  
102 appendSchemaByField( 95 appendSchemaByField(
103 { 96 {
104 field: `kong${n.value}`, 97 field: `kong${n.value}`,
@@ -308,7 +301,7 @@ @@ -308,7 +301,7 @@
308 ]); 301 ]);
309 n.value--; 302 n.value--;
310 } 303 }
311 - return { registerCondition, add, del }; 304 + return { registerCondition, add, del, getAllFields, funcResetFields };
312 }, 305 },
313 }); 306 });
314 </script> 307 </script>
1 <template> 1 <template>
2 - <CollapseContainer title="执行动作1" style="background-color: #eeeeee"> 2 + <CollapseContainer class="prefixRedDot" title="执行动作" style="background-color: #eeeeee">
3 <div style="position: relative"> 3 <div style="position: relative">
4 <BasicForm 4 <BasicForm
5 :labelWidth="100" 5 :labelWidth="100"
@@ -10,30 +10,20 @@ @@ -10,30 +10,20 @@
10 > 10 >
11 <template #add="{ field }"> 11 <template #add="{ field }">
12 <Button 12 <Button
13 - style="margin-left: -99px; margin-top: 30px; display: inline-block" 13 + style="margin-left: -99px; margin-top: 5px; display: inline-block"
14 v-if="Number(field) === 0" 14 v-if="Number(field) === 0"
15 @click="add" 15 @click="add"
16 type="primary" 16 type="primary"
17 >+新增执行动作</Button 17 >+新增执行动作</Button
18 > 18 >
19 - <Button  
20 - style="margin-left: 10px"  
21 - v-if="Number(field) === 0"  
22 - @click="handleSubmit"  
23 - type="primary"  
24 - >保存</Button  
25 - >  
26 <br /> 19 <br />
27 <Button 20 <Button
28 - style="margin-left: -98px; margin-top: -15px" 21 + style="margin-left: -98px; margin-top: -5px"
29 v-if="field > 0" 22 v-if="field > 0"
30 @click="add" 23 @click="add"
31 type="primary" 24 type="primary"
32 >+新增执行动作</Button 25 >+新增执行动作</Button
33 > 26 >
34 - <Button style="margin-left: 10px" v-if="field > 0" @click="handleSubmit" type="primary"  
35 - >保存</Button  
36 - >  
37 <Button style="margin-left: 10px" v-if="field > 0" @click="del(field)" type="primary" 27 <Button style="margin-left: 10px" v-if="field > 0" @click="del(field)" type="primary"
38 >删除</Button 28 >删除</Button
39 > 29 >
@@ -43,7 +33,7 @@ @@ -43,7 +33,7 @@
43 </CollapseContainer> 33 </CollapseContainer>
44 </template> 34 </template>
45 <script lang="ts"> 35 <script lang="ts">
46 - import { defineComponent, ref, reactive, watch } from 'vue'; 36 + import { defineComponent, ref, watch } from 'vue';
47 import { CollapseContainer } from '/@/components/Container/index'; 37 import { CollapseContainer } from '/@/components/Container/index';
48 import { BasicForm, useForm } from '/@/components/Form/index'; 38 import { BasicForm, useForm } from '/@/components/Form/index';
49 import { Input } from 'ant-design-vue'; 39 import { Input } from 'ant-design-vue';
@@ -54,8 +44,8 @@ @@ -54,8 +44,8 @@
54 export default defineComponent({ 44 export default defineComponent({
55 components: { CollapseContainer, BasicForm, [Input.name]: Input, Button }, 45 components: { CollapseContainer, BasicForm, [Input.name]: Input, Button },
56 props: ['deviceInfo2'], 46 props: ['deviceInfo2'],
57 - setup(props, { emit }) {  
58 - let formData = reactive({}); 47 + setup(props) {
  48 + const getValueData: any = ref({});
59 const [ 49 const [
60 registerAction, 50 registerAction,
61 { resetFields, updateSchema, appendSchemaByField, getFieldsValue, removeSchemaByFiled }, 51 { resetFields, updateSchema, appendSchemaByField, getFieldsValue, removeSchemaByFiled },
@@ -83,15 +73,14 @@ @@ -83,15 +73,14 @@
83 }); 73 });
84 } 74 }
85 ); 75 );
86 - async function handleSubmit() {  
87 - try {  
88 - let data = getFieldsValue();  
89 - formData = data;  
90 - emit('get-actiondata', formData);  
91 - isJudge.value++;  
92 - } catch (e) {  
93 - console.log(e);  
94 - } 76 + function getAllFields(getV) {
  77 + const values = getFieldsValue();
  78 + getValueData.value = values;
  79 + getV = getValueData.value;
  80 + return getV;
  81 + }
  82 + function funcResetFields() {
  83 + resetFields();
95 } 84 }
96 const n = ref(1); 85 const n = ref(1);
97 function add() { 86 function add() {
@@ -236,7 +225,18 @@ @@ -236,7 +225,18 @@
236 n.value--; 225 n.value--;
237 } 226 }
238 227
239 - return { registerAction, handleSubmit, add, del }; 228 + return { registerAction, add, del, getAllFields, funcResetFields };
240 }, 229 },
241 }); 230 });
242 </script> 231 </script>
  232 +
  233 +<style lang="less">
  234 + .prefixRedDot:before {
  235 + content: '* ';
  236 + color: red;
  237 + vertical-align: middle;
  238 + display: inline-block;
  239 + position: relative;
  240 + top: 33px;
  241 + }
  242 +</style>
1 <template> 1 <template>
2 <div> 2 <div>
3 - <CollapseContainer title="触发器1" style="background-color: #eeeeee"> 3 + <CollapseContainer title="触发器" style="background-color: #eeeeee">
4 <div style="position: relative"> 4 <div style="position: relative">
5 <BasicForm 5 <BasicForm
6 :labelWidth="100" 6 :labelWidth="100"
@@ -17,13 +17,13 @@ @@ -17,13 +17,13 @@
17 type="primary" 17 type="primary"
18 >+新增触发器</Button 18 >+新增触发器</Button
19 > 19 >
20 - <Button 20 + <!-- <Button
21 style="margin-left: 20px; margin-top: -60px" 21 style="margin-left: 20px; margin-top: -60px"
22 v-if="Number(field) === 0" 22 v-if="Number(field) === 0"
23 type="primary" 23 type="primary"
24 @click="del(field)" 24 @click="del(field)"
25 >删除</Button 25 >删除</Button
26 - > 26 + > -->
27 <Button 27 <Button
28 style="margin-left: 5px; margin-top: 35px" 28 style="margin-left: 5px; margin-top: 35px"
29 v-if="field > 0" 29 v-if="field > 0"
@@ -41,7 +41,7 @@ @@ -41,7 +41,7 @@
41 </div> 41 </div>
42 </template> 42 </template>
43 <script lang="ts"> 43 <script lang="ts">
44 - import { defineComponent, reactive, ref, watch } from 'vue'; 44 + import { defineComponent, ref, watch } from 'vue';
45 import { CollapseContainer } from '/@/components/Container/index'; 45 import { CollapseContainer } from '/@/components/Container/index';
46 import { BasicForm, useForm } from '/@/components/Form/index'; 46 import { BasicForm, useForm } from '/@/components/Form/index';
47 import { Input } from 'ant-design-vue'; 47 import { Input } from 'ant-design-vue';
@@ -59,7 +59,8 @@ @@ -59,7 +59,8 @@
59 export default defineComponent({ 59 export default defineComponent({
60 components: { CollapseContainer, BasicForm, [Input.name]: Input, Button }, 60 components: { CollapseContainer, BasicForm, [Input.name]: Input, Button },
61 props: ['deviceInfo'], 61 props: ['deviceInfo'],
62 - setup(props, { emit }) { 62 + setup(props) {
  63 + const getValueData: any = ref({});
63 const [ 64 const [
64 registerTrigger, 65 registerTrigger,
65 { resetFields, appendSchemaByField, removeSchemaByFiled, getFieldsValue, updateSchema }, 66 { resetFields, appendSchemaByField, removeSchemaByFiled, getFieldsValue, updateSchema },
@@ -68,7 +69,6 @@ @@ -68,7 +69,6 @@
68 schemas: useTriggerDrawerSchema, 69 schemas: useTriggerDrawerSchema,
69 actionColOptions: { span: 24 }, 70 actionColOptions: { span: 24 },
70 }); 71 });
71 - let formData = reactive({});  
72 let isJudge = ref(1); 72 let isJudge = ref(1);
73 if (isJudge.value == 1) { 73 if (isJudge.value == 1) {
74 resetFields(); 74 resetFields();
@@ -88,28 +88,18 @@ @@ -88,28 +88,18 @@
88 }); 88 });
89 } 89 }
90 ); 90 );
  91 + function getAllFields(getV) {
  92 + const values = getFieldsValue();
  93 + getValueData.value = values;
  94 + getV = getValueData.value;
  95 + return getV;
  96 + }
  97 + function funcResetFields() {
  98 + resetFields();
  99 + }
91 100
92 - // async function handleSubmit() {  
93 - // try {  
94 - // formData = getFieldsValue();  
95 - // console.log(formData);  
96 - // emit('get-triggerdata', formData);  
97 - // isJudge.value++;  
98 - // } catch (e) {  
99 - // console.log(e);  
100 - // }  
101 - // }  
102 const n = ref(1); 101 const n = ref(1);
103 function add() { 102 function add() {
104 - try {  
105 - formData = getFieldsValue();  
106 - console.log(formData);  
107 - emit('get-triggerdata', formData);  
108 - isJudge.value++;  
109 - } catch (e) {  
110 - console.log(e);  
111 - }  
112 -  
113 appendSchemaByField( 103 appendSchemaByField(
114 { 104 {
115 field: `kong${n.value}`, 105 field: `kong${n.value}`,
@@ -345,7 +335,7 @@ @@ -345,7 +335,7 @@
345 ]); 335 ]);
346 n.value--; 336 n.value--;
347 } 337 }
348 - return { registerTrigger, add, del }; 338 + return { registerTrigger, add, del, getAllFields, funcResetFields };
349 }, 339 },
350 }); 340 });
351 </script> 341 </script>
@@ -143,7 +143,7 @@ export const formSchema: FormSchema[] = [ @@ -143,7 +143,7 @@ export const formSchema: FormSchema[] = [
143 { 143 {
144 field: 'name', 144 field: 'name',
145 label: '场景联动名称', 145 label: '场景联动名称',
146 - colProps: { span: 12 }, 146 + colProps: { span: 24 },
147 required: true, 147 required: true,
148 component: 'Input', 148 component: 'Input',
149 componentProps: { 149 componentProps: {
@@ -154,7 +154,7 @@ export const formSchema: FormSchema[] = [ @@ -154,7 +154,7 @@ export const formSchema: FormSchema[] = [
154 required: true, 154 required: true,
155 field: 'organizationId', 155 field: 'organizationId',
156 label: '所属组织', 156 label: '所属组织',
157 - colProps: { span: 12 }, 157 + colProps: { span: 24 },
158 component: 'ApiTreeSelect', 158 component: 'ApiTreeSelect',
159 componentProps: ({ formModel, formActionType }) => { 159 componentProps: ({ formModel, formActionType }) => {
160 return { 160 return {
@@ -164,7 +164,6 @@ export const formSchema: FormSchema[] = [ @@ -164,7 +164,6 @@ export const formSchema: FormSchema[] = [
164 return data; 164 return data;
165 }, 165 },
166 onChange: async (v) => { 166 onChange: async (v) => {
167 - console.log(v);  
168 if (v == undefined) { 167 if (v == undefined) {
169 formModel.deviceId = undefined; 168 formModel.deviceId = undefined;
170 const { updateSchema } = formActionType; 169 const { updateSchema } = formActionType;
@@ -184,7 +183,7 @@ export const formSchema: FormSchema[] = [ @@ -184,7 +183,7 @@ export const formSchema: FormSchema[] = [
184 { 183 {
185 field: 'description', 184 field: 'description',
186 label: '描述', 185 label: '描述',
187 - colProps: { span: 12 }, 186 + colProps: { span: 24 },
188 component: 'InputTextArea', 187 component: 'InputTextArea',
189 componentProps: { 188 componentProps: {
190 placeholder: '请输入描述', 189 placeholder: '请输入描述',
@@ -8,13 +8,13 @@ @@ -8,13 +8,13 @@
8 @ok="handleSubmit" 8 @ok="handleSubmit"
9 > 9 >
10 <BasicForm @register="registerForm" /> 10 <BasicForm @register="registerForm" />
11 - <AddTriggerForm :deviceInfo="getDeviceInfo" @get-triggerdata="getTriggerData" />  
12 - <AddConditiForm :deviceInfo1="getDeviceInfo1" @get-conditiondata="getFormConditiData" />  
13 - <AddActionForm :deviceInfo2="getDeviceInfo2" @get-actiondata="getFormActionData" /> 11 + <AddTriggerForm ref="getTriggerChildData" :deviceInfo="getDeviceInfo" />
  12 + <AddConditiForm ref="getConditionChildData" :deviceInfo1="getDeviceInfo1" />
  13 + <AddActionForm ref="getChildData" :deviceInfo2="getDeviceInfo2" />
14 </BasicDrawer> 14 </BasicDrawer>
15 </template> 15 </template>
16 <script lang="ts"> 16 <script lang="ts">
17 - import { defineComponent, ref, computed, unref, reactive, watch } from 'vue'; 17 + import { defineComponent, ref, computed, unref, reactive, watch, getCurrentInstance } from 'vue';
18 import { BasicForm, useForm } from '/@/components/Form'; 18 import { BasicForm, useForm } from '/@/components/Form';
19 import { formSchema, getData } from './config.d'; 19 import { formSchema, getData } from './config.d';
20 import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; 20 import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
@@ -29,17 +29,18 @@ @@ -29,17 +29,18 @@
29 components: { BasicDrawer, BasicForm, AddTriggerForm, AddActionForm, AddConditiForm }, 29 components: { BasicDrawer, BasicForm, AddTriggerForm, AddActionForm, AddConditiForm },
30 emits: ['success', 'register'], 30 emits: ['success', 'register'],
31 setup(_, { emit }) { 31 setup(_, { emit }) {
  32 + const { proxy } = getCurrentInstance();
  33 + const getChildData = ref(null);
  34 + const getTriggerChildData = ref(null);
  35 + const getConditionChildData = ref(null);
32 const { createMessage } = useMessage(); 36 const { createMessage } = useMessage();
33 const isUpdate = ref(true); 37 const isUpdate = ref(true);
34 - let triggersArray: any[] = reactive([]);  
35 let doConditionsArray: any[] = reactive([]); 38 let doConditionsArray: any[] = reactive([]);
36 let doActionsArray: any[] = reactive([]); 39 let doActionsArray: any[] = reactive([]);
  40 + let triggersArray: any[] = reactive([]);
37 let getAllFormData: any = reactive({}); 41 let getAllFormData: any = reactive({});
38 let getValuesFormData: any = reactive({}); 42 let getValuesFormData: any = reactive({});
39 let getId = ref(''); 43 let getId = ref('');
40 - let getTriggerFormData: any = reactive({});  
41 - let getConditionFormData: any = reactive({});  
42 - let getActionFormData: any = reactive({});  
43 let getDeviceInfo = ref(null); 44 let getDeviceInfo = ref(null);
44 let getDeviceInfo1 = ref(null); 45 let getDeviceInfo1 = ref(null);
45 let getDeviceInfo2 = ref(null); 46 let getDeviceInfo2 = ref(null);
@@ -58,6 +59,9 @@ @@ -58,6 +59,9 @@
58 }); 59 });
59 60
60 const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => { 61 const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
  62 + proxy.$refs.getChildData.funcResetFields();
  63 + proxy.$refs.getTriggerChildData.funcResetFields();
  64 + proxy.$refs.getConditionChildData.funcResetFields();
61 await resetFields(); 65 await resetFields();
62 setDrawerProps({ confirmLoading: false }); 66 setDrawerProps({ confirmLoading: false });
63 isUpdate.value = !!data?.isUpdate; 67 isUpdate.value = !!data?.isUpdate;
@@ -71,36 +75,18 @@ @@ -71,36 +75,18 @@
71 await resetFields(); 75 await resetFields();
72 } 76 }
73 }); 77 });
74 - // function trimNumber(str) {  
75 - // return str.replace(/\d+/g, '');  
76 - // }  
77 -  
78 const getTitle = computed(() => (!unref(isUpdate) ? '新增场景联动' : '编辑场景联动')); 78 const getTitle = computed(() => (!unref(isUpdate) ? '新增场景联动' : '编辑场景联动'));
79 - let getTriggerData = (v) => {  
80 - getTriggerFormData = v;  
81 - triggersArray.push(getTriggerFormData);  
82 - // let retuArray = triggersArray.map((m) => {  
83 - // let getArrayKeys = Object.keys(m);  
84 - // let getArrayKeysReturn = null;  
85 - // getArrayKeys.forEach((f) => {  
86 - // getArrayKeysReturn = trimNumber(f);  
87 - // });  
88 - // return getArrayKeysReturn;  
89 - // });  
90 - // console.log(retuArray);  
91 - };  
92 - let getFormConditiData = (v) => {  
93 - getConditionFormData = v;  
94 - doConditionsArray.push(getConditionFormData);  
95 - };  
96 - let getFormActionData = (v) => {  
97 - getActionFormData = v;  
98 - doActionsArray.push(getActionFormData);  
99 - }; 79 +
100 async function handleSubmit() { 80 async function handleSubmit() {
101 if (!unref(isUpdate)) { 81 if (!unref(isUpdate)) {
102 let res = validateFields(); 82 let res = validateFields();
103 if (!res) return; 83 if (!res) return;
  84 + let getChildValues = proxy.$refs.getChildData.getAllFields();
  85 + let getTriggerChildValues = proxy.$refs.getTriggerChildData.getAllFields();
  86 + let getconditionChildValues = proxy.$refs.getConditionChildData.getAllFields();
  87 + doActionsArray.push(getChildValues);
  88 + triggersArray.push(getTriggerChildValues);
  89 + doConditionsArray.push(getconditionChildValues);
104 getValuesFormData = getFieldsValue(); 90 getValuesFormData = getFieldsValue();
105 Object.assign(getAllFormData, getValuesFormData); 91 Object.assign(getAllFormData, getValuesFormData);
106 getAllFormData.triggers = triggersArray; 92 getAllFormData.triggers = triggersArray;
@@ -115,6 +101,12 @@ @@ -115,6 +101,12 @@
115 } 101 }
116 if (unref(isUpdate)) { 102 if (unref(isUpdate)) {
117 getValuesFormData = getFieldsValue(); 103 getValuesFormData = getFieldsValue();
  104 + let getChildValues = proxy.$refs.getChildData.getAllFields();
  105 + let getTriggerChildValues = proxy.$refs.getTriggerChildData.getAllFields();
  106 + let getconditionChildValues = proxy.$refs.getConditionChildData.getAllFields();
  107 + doActionsArray.push(getChildValues);
  108 + triggersArray.push(getTriggerChildValues);
  109 + doConditionsArray.push(getconditionChildValues);
118 getValuesFormData.id = getId.value; 110 getValuesFormData.id = getId.value;
119 Object.assign(getAllFormData, getValuesFormData); 111 Object.assign(getAllFormData, getValuesFormData);
120 getAllFormData.triggers = triggersArray; 112 getAllFormData.triggers = triggersArray;
@@ -128,13 +120,13 @@ @@ -128,13 +120,13 @@
128 } 120 }
129 } 121 }
130 return { 122 return {
  123 + getConditionChildData,
  124 + getTriggerChildData,
  125 + getChildData,
131 getDeviceInfo, 126 getDeviceInfo,
132 getDeviceInfo1, 127 getDeviceInfo1,
133 getDeviceInfo2, 128 getDeviceInfo2,
134 getAllFormData, 129 getAllFormData,
135 - getTriggerData,  
136 - getFormConditiData,  
137 - getFormActionData,  
138 registerDrawer, 130 registerDrawer,
139 registerForm, 131 registerForm,
140 getTitle, 132 getTitle,
@@ -14,6 +14,10 @@ @@ -14,6 +14,10 @@
14 label: '创建者', 14 label: '创建者',
15 }, 15 },
16 { 16 {
  17 + field: 'createTime',
  18 + label: '创建时间',
  19 + },
  20 + {
17 field: 'title', 21 field: 'title',
18 label: '标题', 22 label: '标题',
19 }, 23 },
@@ -70,7 +74,7 @@ @@ -70,7 +74,7 @@
70 } 74 }
71 ); 75 );
72 const [register1] = useDescription({ 76 const [register1] = useDescription({
73 - title: '详情', 77 + title: '通知详情',
74 bordered: false, 78 bordered: false,
75 data: useDescriptionData, 79 data: useDescriptionData,
76 schema: schema, 80 schema: schema,
@@ -16,13 +16,13 @@ export const columns: BasicColumn[] = [ @@ -16,13 +16,13 @@ export const columns: BasicColumn[] = [
16 dataIndex: 'type', 16 dataIndex: 'type',
17 width: 200, 17 width: 200,
18 format: (text: string, record: Recordable) => { 18 format: (text: string, record: Recordable) => {
19 - return record.type === 'MEETING' 19 + return record.type === 'NOTICE'
20 ? '公告' 20 ? '公告'
21 - : record.type === 'MEETING1' 21 + : record.type === 'MEETING'
22 ? '会议' 22 ? '会议'
23 - : record.type === 'MEETING2' 23 + : record.type === 'OTHER'
24 ? '其他' 24 ? '其他'
25 - : ''; 25 + : '';
26 }, 26 },
27 }, 27 },
28 { 28 {
@@ -44,20 +44,11 @@ export const columns: BasicColumn[] = [ @@ -44,20 +44,11 @@ export const columns: BasicColumn[] = [
44 width: 200, 44 width: 200,
45 customRender: ({ record }) => { 45 customRender: ({ record }) => {
46 const status = record.readStatus; 46 const status = record.readStatus;
47 - const enable = status == 0 ? '未读' : ~~status == 1 ? '已读' : '其他'; 47 + const enable = status == 0 ? '未读' : status == 1 ? '已读' : '其他';
48 const color = enable == '未读' ? 'green' : enable == '已读' ? 'yellow' : 'red'; 48 const color = enable == '未读' ? 'green' : enable == '已读' ? 'yellow' : 'red';
49 const text = enable == '未读' ? '未读' : enable == '已读' ? '已读' : '其他'; 49 const text = enable == '未读' ? '未读' : enable == '已读' ? '已读' : '其他';
50 return h(Tag, { color: color }, () => text); 50 return h(Tag, { color: color }, () => text);
51 }, 51 },
52 - // format: (text: string, record: Recordable) => {  
53 - // return record.readStatus == 0  
54 - // ? '未读'  
55 - // : record.type == 1  
56 - // ? '已读'  
57 - // : record.type == 2  
58 - // ? '其他'  
59 - // : '其他';  
60 - // },  
61 }, 52 },
62 ]; 53 ];
63 54
@@ -21,6 +21,7 @@ @@ -21,6 +21,7 @@
21 notifyMyGetDetailApi, 21 notifyMyGetDetailApi,
22 } from '/@/api/stationnotification/stationnotifyApi'; 22 } from '/@/api/stationnotification/stationnotifyApi';
23 import { BasicTable } from '/@/components/Table'; 23 import { BasicTable } from '/@/components/Table';
  24 + import { BasicColumn } from '/@/components/Table/src/types/table';
24 25
25 export default defineComponent({ 26 export default defineComponent({
26 name: 'ConfigDrawer', 27 name: 'ConfigDrawer',
@@ -39,7 +40,7 @@ @@ -39,7 +40,7 @@
39 title: '阅读状态', 40 title: '阅读状态',
40 dataIndex: 'readStatus', 41 dataIndex: 'readStatus',
41 format: (_text: string, record: Recordable) => { 42 format: (_text: string, record: Recordable) => {
42 - return record.readStatus === 0 ? '草稿' : record.readStatus === 1 ? '已读' : '其他'; 43 + return record.readStatus === '0' ? '草稿' : record.readStatus === '1' ? '已读' : '其他';
43 }, 44 },
44 }, 45 },
45 { 46 {
@@ -49,22 +50,31 @@ @@ -49,22 +50,31 @@
49 { 50 {
50 title: '发送者', 51 title: '发送者',
51 dataIndex: 'senderName', 52 dataIndex: 'senderName',
  53 + format: (_text: string, record: Recordable) => {
  54 + return record.sysNoticeDTO.senderName;
  55 + },
  56 + },
  57 + {
  58 + title: '发送时间',
  59 + dataIndex: 'senderDate',
  60 + format: (_text: string, record: Recordable) => {
  61 + return record.sysNoticeDTO.senderDate;
  62 + },
52 }, 63 },
53 { 64 {
54 title: '类型', 65 title: '类型',
55 dataIndex: 'type', 66 dataIndex: 'type',
56 - render: (_, data) => {  
57 - return data.type === 'NOTICE' 67 + format: (_text: string, record: Recordable) => {
  68 + return record.sysNoticeDTO.type === 'NOTICE'
58 ? '公告' 69 ? '公告'
59 - : data.type === 'MEETING' 70 + : record.sysNoticeDTO.type === 'MEETING'
60 ? '会议' 71 ? '会议'
61 - : data.type === 'OTHER' 72 + : record.sysNoticeDTO.type === 'OTHER'
62 ? '其他' 73 ? '其他'
63 - : ''; 74 + : '';
64 }, 75 },
65 }, 76 },
66 ]; 77 ];
67 - // const { createMessage } = useMessage();  
68 const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => { 78 const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
69 setDrawerProps({ confirmLoading: false }); 79 setDrawerProps({ confirmLoading: false });
70 isUpdate.value = !!data?.isUpdate; 80 isUpdate.value = !!data?.isUpdate;
@@ -6,12 +6,8 @@ import { getOrganizationList } from '/@/api/system/system'; @@ -6,12 +6,8 @@ import { getOrganizationList } from '/@/api/system/system';
6 import { copyTransFun } from '/@/utils/fnUtils'; 6 import { copyTransFun } from '/@/utils/fnUtils';
7 import { Tag } from 'ant-design-vue'; 7 import { Tag } from 'ant-design-vue';
8 8
9 -export const selectAll = ref(null);  
10 -export const selectOrg = ref(null);  
11 -export const selectDep = ref(null);  
12 -export const selectPer = ref(null); 9 +export const selectWhere = ref(null);
13 export const isDeptId = ref(null); 10 export const isDeptId = ref(null);
14 -  
15 export const columns: BasicColumn[] = [ 11 export const columns: BasicColumn[] = [
16 { 12 {
17 title: '类型', 13 title: '类型',
@@ -54,14 +50,11 @@ export const columns: BasicColumn[] = [ @@ -54,14 +50,11 @@ export const columns: BasicColumn[] = [
54 width: 200, 50 width: 200,
55 customRender: ({ record }) => { 51 customRender: ({ record }) => {
56 const status = record.status; 52 const status = record.status;
57 - const enable = status === '已发布' ? '已发布' : ~~status === '草稿' ? '草稿' : '其他'; 53 + const enable = status === '已发布' ? '已发布' : status === '草稿' ? '草稿' : '其他';
58 const color = enable === '已发布' ? 'green' : enable === '草稿' ? 'yellow' : 'red'; 54 const color = enable === '已发布' ? 'green' : enable === '草稿' ? 'yellow' : 'red';
59 const text = enable === '已发布' ? '已发布' : enable === '草稿' ? '草稿' : '其他'; 55 const text = enable === '已发布' ? '已发布' : enable === '草稿' ? '草稿' : '其他';
60 return h(Tag, { color: color }, () => text); 56 return h(Tag, { color: color }, () => text);
61 }, 57 },
62 - // format: (_text: string, record: Recordable) => {  
63 - // return record.status;  
64 - // },  
65 }, 58 },
66 ]; 59 ];
67 60
@@ -128,7 +121,6 @@ export const formSchema: FormSchema[] = [ @@ -128,7 +121,6 @@ export const formSchema: FormSchema[] = [
128 }, 121 },
129 onChange: (v) => { 122 onChange: (v) => {
130 isDeptId.value = v; 123 isDeptId.value = v;
131 - console.log(isDeptId.value);  
132 }, 124 },
133 }, 125 },
134 }, 126 },
@@ -146,14 +138,21 @@ export const formSchema: FormSchema[] = [ @@ -146,14 +138,21 @@ export const formSchema: FormSchema[] = [
146 labelField: 'itemText', 138 labelField: 'itemText',
147 valueField: 'itemValue', 139 valueField: 'itemValue',
148 onChange: (v) => { 140 onChange: (v) => {
149 - if (v == 0) {  
150 - selectAll.value = 0;  
151 - } else if (v == 1) {  
152 - selectOrg.value = 1;  
153 - } else if (v == 2) {  
154 - selectDep.value = 2;  
155 - } else if (v == 3) {  
156 - selectPer.value = 3; 141 + switch (v) {
  142 + case '0':
  143 + selectWhere.value = v;
  144 + break;
  145 + case '1':
  146 + selectWhere.value = v;
  147 + break;
  148 + case '2':
  149 + selectWhere.value = v;
  150 + break;
  151 + case '3':
  152 + selectWhere.value = v;
  153 + break;
  154 + default:
  155 + selectWhere.value = v;
157 } 156 }
158 }, 157 },
159 }, 158 },
@@ -65,7 +65,7 @@ @@ -65,7 +65,7 @@
65 components: { BasicTable, NotifyManagerDrawer, TableAction, tableViewChild }, 65 components: { BasicTable, NotifyManagerDrawer, TableAction, tableViewChild },
66 setup() { 66 setup() {
67 let isJudgeStatus = ref(true); 67 let isJudgeStatus = ref(true);
68 - let selectedRowKeys: Array<string> = []; 68 + let selectedRowKeys: string[] = reactive([]);
69 let echoEditData = reactive({}); 69 let echoEditData = reactive({});
70 const [registerDrawer, { openDrawer }] = useDrawer(); 70 const [registerDrawer, { openDrawer }] = useDrawer();
71 const { createMessage } = useMessage(); 71 const { createMessage } = useMessage();
@@ -11,24 +11,24 @@ @@ -11,24 +11,24 @@
11 <Button style="margin-left: 30px; margin-top: 80px" type="primary" @click="handleCancel" 11 <Button style="margin-left: 30px; margin-top: 80px" type="primary" @click="handleCancel"
12 >取消</Button 12 >取消</Button
13 > 13 >
14 - <Button style="margin-left: 30px" type="primary" @click="handleSubmit">保存草稿</Button> 14 + <Button style="margin-left: 30px" type="primary" @click="handleSaveDraft">保存草稿</Button>
15 <Button style="margin-left: 30px" type="primary" @click="handleSend">发布通知</Button> 15 <Button style="margin-left: 30px" type="primary" @click="handleSend">发布通知</Button>
16 </template> 16 </template>
17 </BasicForm> 17 </BasicForm>
18 </BasicDrawer> 18 </BasicDrawer>
19 </template> 19 </template>
20 <script lang="ts"> 20 <script lang="ts">
21 - import { defineComponent, ref, computed, unref, reactive, watch, onMounted } from 'vue'; 21 + import { defineComponent, ref, computed, unref, reactive, watch } from 'vue';
22 import { Button } from '/@/components/Button'; 22 import { Button } from '/@/components/Button';
23 import { BasicForm, useForm } from '/@/components/Form'; 23 import { BasicForm, useForm } from '/@/components/Form';
24 - import { formSchema, selectAll, selectOrg, selectDep, selectPer, isDeptId } from './config.d'; 24 + import { formSchema, selectWhere, isDeptId } from './config.d';
25 import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; 25 import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
26 import { 26 import {
27 notifyAddDraftApi, 27 notifyAddDraftApi,
28 notifyAddLeaseApi, 28 notifyAddLeaseApi,
29 } from '/@/api/stationnotification/stationnotifyApi'; 29 } from '/@/api/stationnotification/stationnotifyApi';
30 import { useMessage } from '/@/hooks/web/useMessage'; 30 import { useMessage } from '/@/hooks/web/useMessage';
31 - import { getOrganizationList } from '/@/api/system/system'; 31 + // import { getOrganizationList } from '/@/api/system/system';
32 32
33 export default defineComponent({ 33 export default defineComponent({
34 name: 'ConfigDrawer', 34 name: 'ConfigDrawer',
@@ -37,11 +37,15 @@ @@ -37,11 +37,15 @@
37 setup(_, { emit }) { 37 setup(_, { emit }) {
38 const { createMessage } = useMessage(); 38 const { createMessage } = useMessage();
39 const isUpdate = ref(true); 39 const isUpdate = ref(true);
40 - const pointArray = ref([]);  
41 - const isJudgeWherePoint = ref([]);  
42 - const newArray = ref([]); 40 + const pointArray = ref([] as any);
  41 + const isJudgeWherePoint = ref([] as any);
  42 + // const newArray = ref([]);
  43 + let getId = ref('');
  44 + let getOranAndDeptId = ref(null);
43 let getAllData: any = reactive({}); 45 let getAllData: any = reactive({});
44 - const [registerForm, { setFieldsValue, resetFields, validate }] = useForm({ 46 + let getAllEditData: any = reactive({});
  47 + let postAllEditData: any = reactive({});
  48 + const [registerForm, { setFieldsValue, resetFields, validate, getFieldsValue }] = useForm({
45 labelWidth: 120, 49 labelWidth: 120,
46 schemas: formSchema, 50 schemas: formSchema,
47 showActionButtonGroup: false, 51 showActionButtonGroup: false,
@@ -52,127 +56,146 @@ @@ -52,127 +56,146 @@
52 isUpdate.value = !!data?.isUpdate; 56 isUpdate.value = !!data?.isUpdate;
53 //编辑 57 //编辑
54 if (unref(isUpdate)) { 58 if (unref(isUpdate)) {
  59 + getId.value = data.record.id;
55 await setFieldsValue({ 60 await setFieldsValue({
56 ...data.record, 61 ...data.record,
57 }); 62 });
58 } else { 63 } else {
59 } 64 }
60 }); 65 });
61 -  
62 const getTitle = computed(() => (!unref(isUpdate) ? '新增通知' : '编辑通知')); 66 const getTitle = computed(() => (!unref(isUpdate) ? '新增通知' : '编辑通知'));
63 const handleCancel = () => { 67 const handleCancel = () => {
64 closeDrawer(); 68 closeDrawer();
65 }; 69 };
66 -  
67 - watch([selectAll, selectOrg, selectDep, selectPer, isDeptId], (newV) => {  
68 - isJudgeWherePoint.value = newV; 70 + watch(selectWhere, (nV) => {
  71 + isJudgeWherePoint.value = nV;
69 }); 72 });
70 -  
71 - onMounted(() => {  
72 - getOrganizationList().then((res) => {  
73 - res.map((m) => {  
74 - if (m.children) {  
75 - m.children.map((m1) => {  
76 - newArray.value.push(m1.id);  
77 - });  
78 - }  
79 - });  
80 - }); 73 + watch(isDeptId, (nV) => {
  74 + getOranAndDeptId.value = nV;
81 }); 75 });
  76 + // onMounted(() => {
  77 + // getOrganizationList().then((res) => {
  78 + // res.map((m) => {
  79 + // if (m.children) {
  80 + // m.children.map((m1) => {
  81 + // newArray.value.push(m1.id);
  82 + // });
  83 + // }
  84 + // });
  85 + // });
  86 + // });
82 87
83 async function handleSend() { 88 async function handleSend() {
84 if (!unref(isUpdate)) { 89 if (!unref(isUpdate)) {
85 const values = await validate(); 90 const values = await validate();
86 Object.assign(getAllData, values); 91 Object.assign(getAllData, values);
87 - isJudgeWherePoint.value.forEach((f) => {  
88 - if (f == 0) {  
89 - if (pointArray.value.length == 0) {  
90 - pointArray.value = [];  
91 - }  
92 - } else if (f == 1) {  
93 - //组织  
94 - if (pointArray.value.length == 0) { 92 + switch (isJudgeWherePoint.value) {
  93 + case '0':
  94 + pointArray.value = [];
  95 + break;
  96 + case '1':
  97 + if (pointArray.value.length === 0) {
95 pointArray.value.push(getAllData.organizationId); 98 pointArray.value.push(getAllData.organizationId);
96 } 99 }
97 - } else if (f == 2) {  
98 - //部门  
99 - let findDeptId = newArray.value.find((f) => {  
100 - return f == isJudgeWherePoint.value[4];  
101 - });  
102 - if (pointArray.value.length == 0) {  
103 - pointArray.value.push(findDeptId); 100 + break;
  101 + case '2':
  102 + if (pointArray.value.length === 0) {
  103 + pointArray.value.push(getOranAndDeptId.value);
104 } 104 }
105 - } else if (f == 3) {  
106 - //个人  
107 - if (pointArray.value.length == 0) {  
108 - pointArray.value = [3];  
109 - }  
110 - }  
111 - }); 105 + break;
  106 + case '3':
  107 + pointArray.value = [3];
  108 + break;
  109 + }
112 getAllData.pointId = pointArray.value; 110 getAllData.pointId = pointArray.value;
113 await notifyAddLeaseApi(getAllData); 111 await notifyAddLeaseApi(getAllData);
114 createMessage.success('新增成功'); 112 createMessage.success('新增成功');
115 closeDrawer(); 113 closeDrawer();
116 emit('success'); 114 emit('success');
117 resetFields(); 115 resetFields();
118 - setTimeout(() => {  
119 - pointArray.value.length = 0;  
120 - isJudgeWherePoint.value.length = 0;  
121 - }, 1000);  
122 } 116 }
123 if (unref(isUpdate)) { 117 if (unref(isUpdate)) {
124 - const values = await validate();  
125 - // saveForm = getFieldsValue();  
126 - await notifyAddLeaseApi(values); 118 + getAllEditData = getFieldsValue();
  119 + getAllEditData.id = getId.value;
  120 + switch (isJudgeWherePoint.value) {
  121 + case '0':
  122 + pointArray.value = [];
  123 + break;
  124 + case '1':
  125 + if (pointArray.value.length === 0) {
  126 + pointArray.value.push(getAllData.organizationId);
  127 + }
  128 + break;
  129 + case '2':
  130 + if (pointArray.value.length === 0) {
  131 + pointArray.value.push(getOranAndDeptId.value);
  132 + }
  133 + break;
  134 + case '3':
  135 + pointArray.value = [3];
  136 + break;
  137 + }
  138 + getAllEditData.pointId = pointArray.value;
  139 + Object.assign(postAllEditData, getAllEditData);
  140 + await notifyAddLeaseApi(postAllEditData);
127 createMessage.success('编辑成功'); 141 createMessage.success('编辑成功');
128 closeDrawer(); 142 closeDrawer();
129 emit('success'); 143 emit('success');
130 } 144 }
131 } 145 }
132 - async function handleSubmit() { 146 + async function handleSaveDraft() {
133 if (!unref(isUpdate)) { 147 if (!unref(isUpdate)) {
134 const values = await validate(); 148 const values = await validate();
135 Object.assign(getAllData, values); 149 Object.assign(getAllData, values);
136 - isJudgeWherePoint.value.forEach((f) => {  
137 - if (f == 0) {  
138 - if (pointArray.value.length == 0) {  
139 - pointArray.value = [];  
140 - }  
141 - } else if (f == 1) {  
142 - //组织  
143 - if (pointArray.value.length == 0) { 150 + switch (isJudgeWherePoint.value) {
  151 + case '0':
  152 + pointArray.value = [];
  153 + break;
  154 + case '1':
  155 + if (pointArray.value.length === 0) {
144 pointArray.value.push(getAllData.organizationId); 156 pointArray.value.push(getAllData.organizationId);
145 } 157 }
146 - } else if (f == 2) {  
147 - //部门  
148 - let findDeptId = newArray.value.find((f) => {  
149 - return f == isJudgeWherePoint.value[4];  
150 - });  
151 - if (pointArray.value.length == 0) {  
152 - pointArray.value.push(findDeptId); 158 + break;
  159 + case '2':
  160 + if (pointArray.value.length === 0) {
  161 + pointArray.value.push(getOranAndDeptId.value);
153 } 162 }
154 - } else if (f == 3) {  
155 - //个人  
156 - if (pointArray.value.length == 0) {  
157 - pointArray.value = [3];  
158 - }  
159 - }  
160 - }); 163 + break;
  164 + case '3':
  165 + pointArray.value = [3];
  166 + break;
  167 + }
161 getAllData.pointId = pointArray.value; 168 getAllData.pointId = pointArray.value;
162 await notifyAddDraftApi(getAllData); 169 await notifyAddDraftApi(getAllData);
163 createMessage.success('新增成功'); 170 createMessage.success('新增成功');
164 closeDrawer(); 171 closeDrawer();
165 emit('success'); 172 emit('success');
166 resetFields(); 173 resetFields();
167 - setTimeout(() => {  
168 - pointArray.value = [];  
169 - isJudgeWherePoint.value = [];  
170 - }, 1000);  
171 } 174 }
172 if (unref(isUpdate)) { 175 if (unref(isUpdate)) {
173 - const values = await validate();  
174 - // saveForm = getFieldsValue();  
175 - await notifyAddDraftApi(values); 176 + getAllEditData = getFieldsValue();
  177 + getAllEditData.id = getId.value;
  178 + switch (isJudgeWherePoint.value) {
  179 + case '0':
  180 + pointArray.value = [];
  181 + break;
  182 + case '1':
  183 + if (pointArray.value.length === 0) {
  184 + pointArray.value.push(getAllData.organizationId);
  185 + }
  186 + break;
  187 + case '2':
  188 + if (pointArray.value.length === 0) {
  189 + pointArray.value.push(getOranAndDeptId.value);
  190 + }
  191 + break;
  192 + case '3':
  193 + pointArray.value = [3];
  194 + break;
  195 + }
  196 + getAllEditData.pointId = pointArray.value;
  197 + Object.assign(postAllEditData, getAllEditData);
  198 + await notifyAddLeaseApi(postAllEditData);
176 createMessage.success('编辑成功'); 199 createMessage.success('编辑成功');
177 closeDrawer(); 200 closeDrawer();
178 emit('success'); 201 emit('success');
@@ -182,7 +205,7 @@ @@ -182,7 +205,7 @@
182 handleSend, 205 handleSend,
183 handleCancel, 206 handleCancel,
184 getTitle, 207 getTitle,
185 - handleSubmit, 208 + handleSaveDraft,
186 registerForm, 209 registerForm,
187 registerDrawer, 210 registerDrawer,
188 }; 211 };
@@ -26,6 +26,9 @@ @@ -26,6 +26,9 @@
26 { 26 {
27 field: 'content', 27 field: 'content',
28 label: '内容', 28 label: '内容',
  29 + render: (_, data) => {
  30 + return !data.content ? '' : data.content.slice(3, data.content.length - 4);
  31 + },
29 }, 32 },
30 { 33 {
31 field: 'senderName', 34 field: 'senderName',
@@ -39,11 +42,11 @@ @@ -39,11 +42,11 @@
39 field: 'type', 42 field: 'type',
40 label: '类型', 43 label: '类型',
41 render: (_, data) => { 44 render: (_, data) => {
42 - return data.type === 'MEETING' 45 + return data.type === 'NOTICE'
43 ? '公告' 46 ? '公告'
44 - : data.type === 'MEETING1' 47 + : data.type === 'MEETING'
45 ? '会议' 48 ? '会议'
46 - : data.type === 'MEETING2' 49 + : data.type === 'OTHER'
47 ? '其他' 50 ? '其他'
48 : ''; 51 : '';
49 }, 52 },
@@ -30,24 +30,22 @@ @@ -30,24 +30,22 @@
30 import { formSchema } from './role.data'; 30 import { formSchema } from './role.data';
31 import { BasicDrawer, useDrawerInner } from '/@/components/Drawer'; 31 import { BasicDrawer, useDrawerInner } from '/@/components/Drawer';
32 import { BasicTree, TreeItem } from '/@/components/Tree'; 32 import { BasicTree, TreeItem } from '/@/components/Tree';
33 -  
34 const { t } = useI18n(); //加载国际化 33 const { t } = useI18n(); //加载国际化
35 -  
36 // import { getMenuList } from '/@/api/demo/system'; 34 // import { getMenuList } from '/@/api/demo/system';
37 -  
38 // 加载菜单数据 35 // 加载菜单数据
39 import { getMenuList, getMenusIdsByRoleId } from '/@/api/sys/menu'; 36 import { getMenuList, getMenusIdsByRoleId } from '/@/api/sys/menu';
40 import { useI18n } from '/@/hooks/web/useI18n'; 37 import { useI18n } from '/@/hooks/web/useI18n';
41 import { RouteItem } from '/@/api/sys/model/menuModel'; 38 import { RouteItem } from '/@/api/sys/model/menuModel';
42 import { saveOrUpdateRoleInfoWithMenu } from '/@/api/system/system'; 39 import { saveOrUpdateRoleInfoWithMenu } from '/@/api/system/system';
43 import { RoleEnum } from '/@/enums/roleEnum'; 40 import { RoleEnum } from '/@/enums/roleEnum';
  41 + // import useCurrentInstance from '/@/hooks/web/useCurrentInstance';
  42 +
44 export default defineComponent({ 43 export default defineComponent({
45 name: 'RoleDrawer', 44 name: 'RoleDrawer',
46 components: { BasicDrawer, BasicForm, BasicTree }, 45 components: { BasicDrawer, BasicForm, BasicTree },
47 emits: ['success', 'register'], 46 emits: ['success', 'register'],
48 setup(_, { emit }) { 47 setup(_, { emit }) {
49 const { proxy } = getCurrentInstance(); 48 const { proxy } = getCurrentInstance();
50 -  
51 const isUpdate = ref(true); 49 const isUpdate = ref(true);
52 const treeData = ref<TreeItem[]>([]); 50 const treeData = ref<TreeItem[]>([]);
53 const roleMenus = ref<string[]>([]); 51 const roleMenus = ref<string[]>([]);
@@ -132,6 +130,21 @@ @@ -132,6 +130,21 @@
132 // } 130 // }
133 }); 131 });
134 132
  133 + // Tree check事件
  134 + const handleCheckClick = (_, e) => {
  135 + allCheckedKeys.value = [];
  136 + let nodes = e.checkedNodes;
  137 + let halfKeys = e.halfCheckedKeys;
  138 + nodes.map((node) => {
  139 + if (node.key != halfKeys[0] && halfKeys.length == []) {
  140 + allCheckedKeys.value.push(node.key);
  141 + } else {
  142 + allCheckedKeys.value.push(node.key);
  143 + }
  144 + });
  145 + allCheckedKeys.value.push(...halfKeys);
  146 + };
  147 +
135 const getTitle = computed(() => (!unref(isUpdate) ? '新增角色' : '编辑角色')); 148 const getTitle = computed(() => (!unref(isUpdate) ? '新增角色' : '编辑角色'));
136 149
137 async function handleSubmit() { 150 async function handleSubmit() {
@@ -147,28 +160,13 @@ @@ -147,28 +160,13 @@
147 menu: allCheckedKeys.value as string[], 160 menu: allCheckedKeys.value as string[],
148 }; 161 };
149 console.log(req, '请求参数'); 162 console.log(req, '请求参数');
150 - saveOrUpdateRoleInfoWithMenu(req).then(() => {  
151 - closeDrawer();  
152 - emit('success');  
153 - }); 163 + await saveOrUpdateRoleInfoWithMenu(req);
  164 + closeDrawer();
  165 + emit('success');
154 } finally { 166 } finally {
155 setDrawerProps({ confirmLoading: false }); 167 setDrawerProps({ confirmLoading: false });
156 } 168 }
157 } 169 }
158 - // Tree check事件  
159 - const handleCheckClick = (_, e) => {  
160 - allCheckedKeys.value = [];  
161 - let nodes = e.checkedNodes;  
162 - let halfKeys = e.halfCheckedKeys;  
163 - nodes.map((node) => {  
164 - if (node.key != halfKeys[0] && halfKeys.length == []) {  
165 - allCheckedKeys.value.push(node.key);  
166 - } else {  
167 - allCheckedKeys.value.push(node.key);  
168 - }  
169 - });  
170 - allCheckedKeys.value.push(...halfKeys);  
171 - };  
172 170
173 return { 171 return {
174 allCheckedKeys, 172 allCheckedKeys,
@@ -44,22 +44,21 @@ @@ -44,22 +44,21 @@
44 import TenantSettingDrawer from './useDrawer.vue'; 44 import TenantSettingDrawer from './useDrawer.vue';
45 import { columns } from './config'; 45 import { columns } from './config';
46 import { useMessage } from '/@/hooks/web/useMessage'; 46 import { useMessage } from '/@/hooks/web/useMessage';
47 - import { screenLinkPageGetApi, screenLinkPageDeleteApi } from '/@/api/ruleengine/ruleengineApi'; 47 + import { getTableTenantProfileApi } from '/@/api/tenant/tenantApi';
48 48
49 export default defineComponent({ 49 export default defineComponent({
50 name: 'index', 50 name: 'index',
51 components: { BasicTable, TenantSettingDrawer, TableAction }, 51 components: { BasicTable, TenantSettingDrawer, TableAction },
52 setup() { 52 setup() {
53 - let selectedRowKeys: Array<string> = []; 53 + // let selectedRowKeys: Array<string> = [];
54 let echoEditData = reactive({}); 54 let echoEditData = reactive({});
55 const [registerDrawer, { openDrawer }] = useDrawer(); 55 const [registerDrawer, { openDrawer }] = useDrawer();
56 const { createMessage } = useMessage(); 56 const { createMessage } = useMessage();
57 - const [registerTable, { reload, getSelectRowKeys }] = useTable({ 57 + const [registerTable, { reload }] = useTable({
58 title: '', 58 title: '',
59 clickToRowSelect: false, 59 clickToRowSelect: false,
60 - api: screenLinkPageGetApi, 60 + api: getTableTenantProfileApi,
61 columns, 61 columns,
62 - rowKey: 'id',  
63 useSearchForm: true, 62 useSearchForm: true,
64 showTableSetting: true, 63 showTableSetting: true,
65 bordered: true, 64 bordered: true,
@@ -80,12 +79,13 @@ @@ -80,12 +79,13 @@
80 } 79 }
81 80
82 const useSelectionChange = () => { 81 const useSelectionChange = () => {
83 - selectedRowKeys = getSelectRowKeys(); 82 + console.log(1);
  83 + // selectedRowKeys = getSelectRowKeys();
84 }; 84 };
85 85
86 async function handleToolbarDel() { 86 async function handleToolbarDel() {
87 - await screenLinkPageDeleteApi(selectedRowKeys);  
88 - createMessage.success('删除成功'); 87 + // await screenLinkPageDeleteApi(selectedRowKeys);
  88 + // createMessage.success('删除成功');
89 reload(); 89 reload();
90 } 90 }
91 91
@@ -96,9 +96,9 @@ @@ -96,9 +96,9 @@
96 }); 96 });
97 echoEditData = record; 97 echoEditData = record;
98 } 98 }
99 - async function handleDelete(record: Recordable) {  
100 - let ids = [record.id];  
101 - await screenLinkPageDeleteApi(ids); 99 + async function handleDelete() {
  100 + // let ids = [record.id];
  101 + // await screenLinkPageDeleteApi(ids);
102 createMessage.success('删除成功'); 102 createMessage.success('删除成功');
103 reload(); 103 reload();
104 } 104 }